浏览代码

交叉表

rsbi 4 年之前
父节点
当前提交
b705b98155

+ 8 - 2
src/components/FrameTop.vue

@@ -56,11 +56,17 @@ export default {
       if(this.swatchcls === ''){
         this.swatchcls = 'swatchBtn';
         this.$parent.isShowMenu = false;
-        window.setTimeout(()=>$(".page-wrapper").css({"margin": "0", "width":"100%"}), 200);
+        window.setTimeout(()=>{
+          $(".page-wrapper").css({"margin": "0", "width":"100%"})
+          $(window).trigger("resize");
+        }, 200);
       }else{
         this.swatchcls = '';
         this.$parent.isShowMenu = true;
-        window.setTimeout(()=>$(".page-wrapper").css({"margin": "0 0 0 220px", "width":"calc(100% - 220px)"}), 200);
+        window.setTimeout(()=>{
+          $(".page-wrapper").css({"margin": "0 0 0 220px", "width":"calc(100% - 220px)"});
+           $(window).trigger("resize");
+        }, 200);
       }
     },
     handleCommand:function(cmd){

+ 2 - 2
src/style/common.less

@@ -41,8 +41,8 @@ html,body{
     overflow: auto;
 }
 .wrapper-content-nomargin {
-    height: calc(100% - 30px);
-    overflow: auto;
+    height: calc(100% - 37px);
+    overflow: hidden;
 }
 .ibox {
     /**

+ 27 - 2
src/view/bireport/ParamFilter.vue

@@ -84,6 +84,8 @@
 				show:false,
 				title:"",
 				param:{},
+				cubeId:null,
+				dsid:null,
 				checkList:[],
 				dimValus:[],
 				st:null,  //日期/月份的开始日期
@@ -96,11 +98,34 @@
 		computed: {
 		},
 		methods: {	
+			createDimFilter(dim, comp){
+				this.show = true;
+				this.title = dim.dimdesc+" - 维度筛选";
+				this.param = dim;
+				this.cubeId = comp.cubeId;
+				this.dsid = comp.dsid;
+				this.search = null;
+				this.dimValus = [];
+				this.checkList = dim.vals || [];
+				this.st = dim.st?dim.st: null;
+				this.end = dim.end?dim.end:null;
+				let load = Loading.service({ fullscreen: true });
+				ajax({
+					url:"bireport/paramFilter.action",
+					data:{id:dim.id, cubeId:comp.cubeId, dsid:comp.dsid},
+					success:(resp)=>{
+						this.dimValus = resp.rows.datas;
+					}
+				}, this, load);
+			},
 			create(paramId){
-				this.show = true
+				this.show = true;
 				let p = findParamById(paramId, this.pageInfo.params);
 				this.title = p.name + " - 参数筛选";
 				this.param = p;
+				this.cubeId = p.cubeId;
+				this.dsid = p.dsid;
+				this.search = null;
 				this.dimValus = [];
 				this.checkList = p.vals || [];
 				this.st = p.st?p.st: null;
@@ -151,7 +176,7 @@
 				let p = this.param;
 				ajax({
 					url:"bireport/paramFilter.action",
-					data:{id:p.id, cubeId:p.cubeId, keyword:this.search, dsid:p.dsid},
+					data:{id:p.id, cubeId:this.cubeId, keyword:this.search, dsid:this.dsid},
 					success:(resp)=>{
 						this.dimValus = resp.rows.datas;
 					}

+ 9 - 1
src/view/bireport/ReportTable.vue

@@ -34,6 +34,14 @@ export default {
   },
   mounted() {
 	  this.bindDropEvent(this.tableId);
+	  //注册固定表头事件
+	  tableUtils.fireTableScroll(tools.findCompById(this.tableId, this.pageInfo));
+	  $(window).bind("resize",()=>{
+		  tableUtils.fireTableScroll(tools.findCompById(this.tableId, this.pageInfo));
+	  });
+  },
+  beforeDestroy(){
+    $(window).unbind("resize");
   },
   computed: {},
   methods: {
@@ -350,7 +358,7 @@ export default {
 							ts.setUpdate();
 						});
 					}else if(key == "filter"){
-						filterDims();
+						ts.$parent.$parent.$parent.$refs['paramFilterForm'].createDimFilter(dim, comp);
 					}else if(key == "aggre"){
 						aggreDim();
 					}else if(key == "top"){

+ 30 - 0
src/view/bireport/tableUtils.js

@@ -415,4 +415,34 @@ export function goupDim(comp, pos, dimId, pageInfo, cb){
 	if(cb){
 		cb();
 	}
+}
+export function fireTableScroll(comp){
+	let id = comp.id;
+	$("#T"+id+" #d_kpi").scroll(function(){
+		var top = $(this).scrollTop();
+		$("#d_rowDims table").css("margin-top", "-"+top+"px");
+		//$("#T"+id+" #d_rowDims").scrollTop(top);
+		var left = $(this).scrollLeft();
+		$("#T"+id+" #d_colDims table").css("margin-left", "-"+left+"px");
+	});
+	/**
+	$("#T"+id+" #d_rowDims").scroll(function(){
+		var top = $(this).scrollTop();
+		//$("#d_kpi table").css("margin-top", "-"+top+"px");
+		$("#T"+id+" #d_kpi").scrollTop(top);
+	});
+	**/
+	var rowLvl = comp.rows?comp.rows.length:1;
+	if(rowLvl == 0){
+		rowLvl = 1;
+	}
+	var w = Math.round($("#T"+id).width()), h = Math.round($(".wrapper-content").height());
+	h = h - Math.round($("#d_colDims").height()) - 110;
+	w = w - (127 * rowLvl);
+	if(w <0){
+		w = 200;
+	}
+	$("#T"+id+" #d_rowDims").height(h);
+	$("#T"+id+" #d_colDims").width(w);
+	$("#T"+id+" #d_kpi").width(w).height(h).css("overflow", "auto");
 }