Forráskód Böngészése

多维分析模块-选立方体

rsbi 4 éve
szülő
commit
50a3c9d9f8

+ 1 - 1
config/index.js

@@ -12,7 +12,7 @@ module.exports = {
     assetsPublicPath: '/',
     proxyTable: {
       "/": {
-        target: "http://www.ruisitech.com/",
+        target: "http://localhost:8080/",
         // changeOrigin: true,
         // pathRewrite: {
         //   '^/': '/rsbi-os-4.7/'

+ 5 - 0
package-lock.json

@@ -8127,6 +8127,11 @@
       "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz",
       "integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg=="
     },
+    "jquery-ui-dist": {
+      "version": "1.12.1",
+      "resolved": "https://registry.npmjs.org/jquery-ui-dist/-/jquery-ui-dist-1.12.1.tgz",
+      "integrity": "sha1-XAgV08xvkP9fqvWyaKbiO0ypBPo="
+    },
     "js-base64": {
       "version": "2.6.4",
       "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz",

+ 1 - 0
package.json

@@ -24,6 +24,7 @@
     "element-ui": "^2.13.2",
     "font-awesome": "^4.7.0",
     "jquery": "^3.5.1",
+    "jquery-ui-dist": "^1.12.1",
     "jstree": "^3.3.10",
     "popper.js": "^1.16.1",
     "vue": "^2.5.2",

+ 1 - 1
src/components/OperationDailog.vue

@@ -51,7 +51,7 @@ export default {
     autoHeight:function(){
         let h = $(".page-wrapper").height();
         if(h){
-            return  "height:"+ (h - 110 )+ "px;";
+            return  "height:"+ (h - 135 )+ "px;";
         }else{
             return "height:460px;";
         }

+ 52 - 3
src/view/bireport/ReportDesign.vue

@@ -56,6 +56,9 @@
 	import {baseUrl} from '@/common/biConfig'
 	import $ from 'jquery'
 	import selectCube from "@/view/bireport/SelectCube";
+	import "jstree";
+	import "jstree/dist/themes/default/style.min.css";
+	import 'jquery-ui-dist/jquery-ui'
 
 	export default {
 	    data(){
@@ -78,6 +81,10 @@
 				this.$refs['selectCubeForm'].select();
 			},
 			initdataset(){
+				let ref = $("#datasettree").jstree(true);
+				if(ref){
+					ref.destroy();
+				}
 				if (this.selectDs.length === 0) {
 					$('#datasettree').jstree({
 						core: {
@@ -91,18 +98,40 @@
 					});
 					return;
 				} else {
+					const dragfunc = () => {
+						$("#datasettree .jstree-node").draggable({
+							cursor: "point",
+							appendTo: "body",
+							revert: 'invalid',
+							revertDuration: 250,
+							cursorAt: { top: 0, left: -35 },
+							helper:function(e){
+								var id = $(this).find("a.jstree-anchor:first").text();
+								return "<div class=\"vakata-dnd\"><span class=\"miconcancel glyphicon glyphicon-remove\"></span>"+id+"</div>";
+							},
+							start:function(e){
+								var ref = $('#datasettree').jstree(true),node = ref.get_node(this);
+								var attr = node.li_attr;
+								delete attr.id;
+								if($.isEmptyObject(attr)){
+									return false;
+								}
+								return true;
+							}
+						});
+					}
 					$('#datasettree').jstree({
 						core: {
 							data: {
-								url: 'model/cubeTree.action?selectDsIds=' + this.selectDs + '&t=' + Math.random()
+								url: 'model/treeCube.action?cubeId=' + this.selectDs + '&t=' + Math.random()
 							},
 							check_callback: false
 						},
 						"plugins": ["wholerow"]
 					}).bind("ready.jstree", function (a, b) {
-						//dragfunc();
+						dragfunc();
 					}).bind("after_open.jstree", function () {
-						//dragfunc();
+						dragfunc();
 					});
 				}
 			}
@@ -119,4 +148,24 @@
 	color: #999999;
     font-size: 14px;
 }
+.icon_kpi {
+	color:#e07900;
+}
+.icon_dim {
+	color:#006ae1;
+}
+.vakata-dnd {
+	border:solid 1px #ddd;
+	background-color:#f5f5f5;
+	border-radius:3px;
+	z-index:9999;
+	padding:3px;
+	box-shadow:0 2px 3px 0 rgba(0,0,0,.16), 0 2px 5px 0 rgba(0,0,0,.12);
+}
+.vakata-dnd .miconcancel {
+	display:inline-block;
+	width:16px;
+	height:16px;
+	color:#3f36c3;
+}
 </style>

+ 12 - 0
src/view/bireport/SelectCube.vue

@@ -52,6 +52,15 @@
 				this.loadData();
 			},
 			save(){
+				let chk = this.checked;
+				if(!chk){
+					this.$notify.error({title: '未勾选数据',offset: 50});
+					return;
+				}
+				var p = this.$parent;
+				p.selectDs = chk;
+				p.initdataset();
+
 				this.show = false;
 			},
 			selectme:function(a, b){
@@ -85,4 +94,7 @@
 </script>
 
 <style lang="less" scoped>
+.el-dialog__body{
+	padding: 5px;
+}
 </style>