rsbi %!s(int64=4) %!d(string=hai) anos
pai
achega
9c8fc70ee2

BIN=BIN
src/assets/image/wingrip.png


+ 21 - 9
src/view/portal/ChartDailog.vue

@@ -1,12 +1,12 @@
 <!-- 表格对话框都放这里面 -->
 <template>
-  	<el-dialog title="切换图形类型" :visible.sync="show" :close-on-click-modal="false" custom-class="nopadding">
+  	<el-dialog title="选择图形类型" :visible.sync="show" :close-on-click-modal="false" custom-class="nopadding">
 		
 		<div class="row">
 			<div class="col-sm-3">
 				<ul>
 				<template v-for="item in charts">
-					<li :key="item.cid" :class="item.show?'select':''" @click="selectchart(item.cid)">{{item.cname}}</li>
+					<li :key="item.cid" :class="item.show==true?'select':''" @click="selectchart(item.cid)">{{item.cname}}</li>
 				</template>
 				</ul>
 			</div>
@@ -57,7 +57,7 @@
 					areas:[]
 				},
 				charts:[
-					{cid:"1", cname:"曲线图", type:"line",show:true,children:[
+					{cid:"1", cname:"曲线图", type:"line",show:false,children:[
 						{img:"c1.gif", index:"1", name:"曲线图", select:true},
 						{img:"c12.gif", index:"2", name:"双轴曲线图"}
 					]},
@@ -146,6 +146,14 @@
 				this.layoutId = layoutId;
 				this.show = true;
 				this.comp = null;
+				//选中第一个
+				$(this.charts).each((a, b)=>{
+					b.show=false;
+					$(b.children).each((c, d)=>{
+						d.select = false;
+					});
+				});
+				this.charts[0].show = true;
 			},
 			//更改图形类型
 			changeType(comp){
@@ -153,19 +161,23 @@
 				this.comp = comp;
 				let type = comp.chartJson.type;
 				let index = comp.chartJson.typeIndex;
+				$(this.charts).each((a, b)=>{
+					b.show=false;
+					$(b.children).each((c, d)=>{
+						d.select = false;
+					});
+				});
 				//选中值
 				$(this.charts).each((a, b)=>{
 					$(b.children).each((c, d)=>{
-						if(b.type === type && d.index === index){
+						if(b.type === type && d.index == index){
 							d.select = true;
 							b.show = true;
-						}else{
-							d.select = false;
-							b.show = false;
+							return false;
 						}
 					});
 				})
-				//this.$forceUpdate();
+				this.$forceUpdate();
 			},
 			selectchart(chartId){
 				$(this.charts).each((a, b)=>{
@@ -189,7 +201,7 @@
 			selectone(index, type){
 				$(this.charts).each((a, b)=>{
 					$(b.children).each((c, d)=>{
-						if(b.type === type && d.index === index){
+						if(b.type === type && d.index == index){
 							d.select = true;
 						}else{
 							d.select = false;

+ 2 - 0
src/view/portal/Index.vue

@@ -9,6 +9,8 @@
 import {baseUrl} from '@/common/biConfig'
 import PortalIndex from "./PortalIndex.vue"
 import PortalIndexCustomiz from "./PortalIndexCustomiz.vue"
+import 'jquery-ui-dist/jquery-ui'
+import 'jquery-ui-dist/jquery-ui.css'
 
 export default {
   components:{PortalIndex,PortalIndexCustomiz},

+ 31 - 1
src/view/portal/LayoutOptarea.vue

@@ -122,11 +122,14 @@ export default {
       }else if(comp.type === 'table'){
         compctx.push(h('table-view',{ref:'mv_'+comp.id, attrs:{comp:comp}}));
       }
-      let style = {padding:"3px"};
+      let style = {padding:"1px", width:"100%"};
       let bgcolor = comp.bgcolor;
       if(bgcolor){
         style['background-color'] = bgcolor;
       }
+      if(comp.height){
+        style['height'] =  comp.height + "px";
+      }
       let bodys = {class:"ccctx", style:{}};
       if(comp.type ==='text'){
         bodys.domProps = {innerHTML:comp.desc.replace(/\n/g,"<br>")};
@@ -154,6 +157,7 @@ export default {
           }
         }
       }
+      //let winSizeGrip = h('div', {class:"win-size-grip"});
       let ctx = h('div', {class:"cctx ibox-content", style:style}, [h('div', bodys, comp.type=='text'?"":compctx)]);
       return h('div', {attrs:{class:"ibox", id:"c_" + comp.id}}, [title, ctx]);
     },
@@ -480,6 +484,19 @@ export default {
           //alert(ui); 
         }
       });
+      //注册resize事件
+      $("#c_" + obj.id+" .ibox-content").resizable({
+        autoHide: false ,
+        handles:"s",
+        minHeight:50,
+        grid: [ 10, 10 ],
+        stop:function(event, ui){
+          let id = $(ui.element).parent().attr("id");
+          id = id.replace("c_", "");
+          let comp = utils.findCompById(ts.pageInfo, id);
+          comp.height = ui.size.height;
+        }
+      });
     }
   },
   watch:{
@@ -546,8 +563,21 @@ table.r_layout {
 #optarea .ibox {
     margin-bottom: 10px !important;
 }
+.cctx {
+  overflow: auto;
+}
 .tipinfo {
 	color:#999;
 	padding:10px;
 }
+.win-size-grip {
+	position: absolute;
+	width: 16px;
+	height: 16px;
+	padding: 4px;
+	bottom: 0;
+	right: 0;
+	cursor: nwse-resize;
+	background: url(../../assets/image/wingrip.png) no-repeat;
+}
 </style>

+ 24 - 7
src/view/portal/PortalTableDailog.vue

@@ -3,6 +3,11 @@
   	<el-dialog :title="title" :visible.sync="show" :close-on-click-modal="false" custom-class="nopadding">
 		  <el-form :model="val" ref="valForm" label-position="left">
 			<template v-if="type === 'dimAggre'">
+				<el-form-item label="自动聚合" label-width="100px">
+					<el-switch v-model="val.autoaggre"></el-switch>
+					(设置后,聚合方式的选择功能既无效) 
+				</el-form-item>
+				<template v-if="val.autoaggre == false">
 				<el-form-item label="聚合方式" label-width="100px">
 					<el-select v-model="val.aggreType" style="width:100%" placeholder="请选择">
 						<el-option
@@ -13,6 +18,7 @@
 						</el-option>
 					</el-select>
 				</el-form-item>
+				</template>
 				<el-form-item label-width="100px">
 					<button type="button" class="btn btn-danger btn-rounded btn-outline btn-xs" @click="clearAggre()">清除聚合</button>
 				</el-form-item>
@@ -128,8 +134,9 @@
 				},
 				val:{
 					aggreType:"",
+					autoaggre:false,
 					top:null,
-					topType:"number",
+					topType:null,
 					unit:null,
 					fmt:null,
 					oper:null,
@@ -149,17 +156,19 @@
 				this.type = "dimAggre";
 				this.show = true;
 				this.dim = dim;
-				if(this.type === 'dimAggre'){
 					this.val.aggreType = dim.aggre;
+				if(dim.aggre === 'auto'){
+					this.val.autoaggre = true;
 				}
 			},
+			
 			dimTop(dim, comp){
 				this.title = "维度取Top";
 				this.type = "top";
 				this.show = true;
 				this.dim = dim;
 				this.val.top = dim.top;
-				this.val.topType = dim.topType;
+				this.val.topType = dim.topType?dim.topType:"number";
 			},
 			kpiProperty(kpi, comp){
 				this.title = "度量属性";
@@ -176,15 +185,23 @@
 				}
 				this.val.code = kpi.code?unescape(kpi.code):null;
 			},
+			clearAggre(){
+				let dim = this.dim;
+				dim.issum = 'n';
+				delete dim.aggre;
+				this.show = false;
+				let p = this.$parent;
+				p.setUpdate();
+				p.tableView();
+			},
 			save(){
 				let dim = this.dim;
 				let kpi = this.kpi;
 				if(this.type === 'dimAggre'){
-					if(dim.issum == 'y'){
-						dim.issum = "n";
-						delete dim.aggre;
+					dim.issum = 'y';
+					if(this.val.autoaggre===true){
+						dim.aggre = "auto";
 					}else{
-						dim.issum = 'y';
 						dim.aggre = this.val.aggreType;
 					}
 				}else if(this.type === 'top'){

+ 5 - 1
src/view/portal/data/Table.vue

@@ -109,7 +109,7 @@ export default {
           };
         }
         $.contextMenu({
-          selector: '#tableData button.btn', 
+          selector: '#tableData .ibox-tools button.btn', 
           trigger: 'left',
           delay: 500,
           autoHide:true,
@@ -131,6 +131,10 @@ export default {
               ts.dimkpimove(pos, opt, node);
             }else if(opt == 'moveTo'){
               ts.dimexchange(pos, opt, node);
+            }else if(opt === 'top'){
+              ts.$refs['tableDailog'].dimTop(node, comp);
+            }else if(opt === 'aggre'){
+               ts.$refs['tableDailog'].dimAggre(node, comp);
             }
           },
           items: items