Jelajahi Sumber

多维分析参数模块

rsbi 4 tahun lalu
induk
melakukan
e5d3ad8c1f

TEMPAT SAMPAH
src/assets/image/login_bg.jpg


+ 11 - 0
src/common/biConfig.js

@@ -87,4 +87,15 @@ export const insertText2focus = (obj,str) => {
 	} else {
 		obj.value += str;
 	}
+}
+
+/**
+ * list 转 String
+ * @param {*} ls 
+ */
+export const list2string = (ls)=>{
+	if(!ls){
+		return "";
+	}
+	return ls.join(",");
 }

+ 2 - 1
src/components/NavMenu.vue

@@ -135,7 +135,8 @@ export default {
            }else if(cmd === 'flash'){
                $(this.menus).each((a, b)=>{
                    if(b.active === 'active'){
-                       //this.$router.push(b.url);
+                       //this.$router.go(0);
+                       //this.$forceUpdate();
                        //刷新页面暂时能用。
                        return false;
                    }

+ 7 - 0
src/view/Login.vue

@@ -122,6 +122,7 @@
 	@import '../style/mixin';
 	.login_page{
 		background-color: #f0f3f4;
+		background:url("../assets/image/login_bg.jpg") 100% center
 	}
 	.form_contianer{
 		max-width: 600px;
@@ -174,5 +175,11 @@
 		bottom:0px;
 		width: 100%;
 		position: absolute;
+		.txt {
+			color:#fff;
+		}
+		a {
+			color:#fff;
+		}
 	}
 </style>

+ 83 - 0
src/view/bireport/ParamFilter.vue

@@ -0,0 +1,83 @@
+<template>
+  	<el-dialog :title="title" :visible.sync="show">
+		<template v-if="param.type === 'frd'">
+			<el-checkbox-group v-model="checkList">
+				<template v-for="(item) in dimValus">
+					<div :key="item.id">
+						<el-checkbox name="vls" :key="item.id" :label="item.id">{{item.name}}</el-checkbox> 
+					</div>
+				</template>
+			</el-checkbox-group>
+		</template>
+		<template v-if="param.type === 'month'">
+		</template>
+		<template v-if="param.type === 'day'">
+		</template>
+		<div slot="footer" class="dialog-footer">
+			<el-button type="primary" @click="save()">确 定</el-button>
+			<el-button @click="show = false">取 消</el-button>
+		</div>
+  </el-dialog>
+</template>
+
+<script>
+	import {ajax} from '@/common/biConfig'
+	import $ from 'jquery'
+	import {findParamById} from '@/view/bireport/bireportUtils'
+
+	export default {
+		props:{
+			pageInfo:{
+				type:Object,
+				required:true
+			}
+		},
+	    data(){
+			return {
+				show:false,
+				title:"",
+				param:{},
+				checkList:[],
+				dimValus:[]
+			}
+		},
+		mounted(){
+		},
+		computed: {
+		},
+		methods: {	
+			create(paramId){
+				this.show = true
+				let p = findParamById(paramId, this.pageInfo.params);
+				this.title = p.name + " - 参数筛选";
+				this.param = p;
+				this.dimValus = [];
+				this.checkList = p.vals || [];
+				ajax({
+					url:"bireport/paramFilter.action",
+					data:{id:p.id, cubeId:p.cubeId, dsid:p.dsid},
+					success:(resp)=>{
+						this.dimValus = resp.rows.datas;
+					}
+				}, this);
+			},
+			save(){
+				this.param.vals = this.checkList;
+				var strs = [];
+				this.checkList.forEach(e=>{
+					let t = this.dimValus.filter(m=>m.id===e)[0];
+					strs.push(t.name);
+				});
+				this.param.valStrs = strs;
+				this.show = false;
+				//刷新组件
+				this.$parent.$refs['paramForm'].$forceUpdate();
+			}
+		},
+		watch: {
+		}
+	}
+</script>
+
+<style lang="css" scoped>
+</style>

+ 29 - 0
src/view/bireport/ReportChart.vue

@@ -0,0 +1,29 @@
+<template>
+	<div>
+		图形
+	</div>
+</template>
+
+<script>
+	import {ajax} from '@/common/biConfig'
+	import $ from 'jquery'
+
+	export default {
+	    data(){
+			
+		},
+		mounted(){
+		},
+		computed: {
+		},
+		methods: {	
+			
+		},
+		watch: {
+		}
+	}
+</script>
+
+<style lang="less" scoped>
+
+</style>

+ 37 - 18
src/view/bireport/ReportDesign.vue

@@ -33,22 +33,25 @@
 				</div>
 				
 				<div class="col-sm-9 animated fadeInRight">
-					<div class="ibox" style="margin-bottom:20px;">
-						<div class="ibox-content" id="p_param" style="padding:5px;">
-							<div class="ptabhelpr">拖拽维度到此处作为筛选条件</div>
-						</div>
-					</div>
+					<reportParam :pageInfo="pageInfo" ref="paramForm"></reportParam>
 					
 					<el-tabs v-model="showtype" type="border-card">
-						<el-tab-pane label="表格" name="table">表格</el-tab-pane>
-						<el-tab-pane label="图形" name="chart">图形</el-tab-pane>
+						<el-tab-pane label="表格" name="table">
+							<reportTable ref="tableForm"></reportTable>
+						</el-tab-pane>
+						<el-tab-pane label="图形" name="chart">
+							<report-chart ref="chartForm"></report-chart>
+						</el-tab-pane>
 					</el-tabs>
-							
+					<div class="clearbtn">
+						<button type="button" class="btn btn-default btn-xs" @click="cleanData()">清除数据</button>
+					</div>
 					
 				</div>
 			</div>
 		</div>
 		<selectCube ref="selectCubeForm"></selectCube>
+		<paramFilter :pageInfo="pageInfo" ref="paramFilterForm"></paramFilter>
   	</div>
 </template>
 
@@ -56,6 +59,10 @@
 	import {baseUrl} from '@/common/biConfig'
 	import $ from 'jquery'
 	import selectCube from "@/view/bireport/SelectCube";
+	import reportParam from "@/view/bireport/ReportParam";
+	import reportTable from "@/view/bireport/ReportTable";
+	import reportChart from "@/view/bireport/ReportChart";
+	import paramFilter from "@/view/bireport/ParamFilter";
 	import "jstree";
 	import "jstree/dist/themes/default/style.min.css";
 	import 'jquery-ui-dist/jquery-ui'
@@ -65,11 +72,17 @@
 			return {
 				activeIndex:"1",
 				showtype:"table",
-				selectDs:""
+				pageInfo:{
+					selectDs:"",
+					comps:[
+						{"name":"表格组件","id":1, "type":"table"},
+						{"name":"","id":2, "type":"chart",chartJson:{type:"line",params:[]},kpiJson:[]}], 
+					params:[]
+				}  //多维分析的配置对象
 			}
 		},
 		components: {
-			selectCube
+			selectCube,reportParam,reportTable,reportChart,paramFilter
     	},
 		mounted(){
 			this.initdataset();
@@ -85,7 +98,7 @@
 				if(ref){
 					ref.destroy();
 				}
-				if (this.selectDs.length === 0) {
+				if (this.pageInfo.selectDs.length === 0) {
 					$('#datasettree').jstree({
 						core: {
 							data: {
@@ -123,7 +136,7 @@
 					$('#datasettree').jstree({
 						core: {
 							data: {
-								url: 'model/treeCube.action?cubeId=' + this.selectDs + '&t=' + Math.random()
+								url: 'model/treeCube.action?cubeId=' + this.pageInfo.selectDs + '&t=' + Math.random()
 							},
 							check_callback: false
 						},
@@ -134,8 +147,10 @@
 						dragfunc();
 					});
 				}
-			}
+			},
+			cleanData(){
 
+			}
 		},
 		watch: {
 		}
@@ -143,11 +158,6 @@
 </script>
 
 <style lang="css">
-#p_param .ptabhelpr{
-	padding:5px;
-	color: #999999;
-    font-size: 14px;
-}
 .icon_kpi {
 	color:#e07900;
 }
@@ -168,4 +178,13 @@
 	height:16px;
 	color:#3f36c3;
 }
+.el-tabs--border-card {
+	box-shadow:none;
+}
+.clearbtn {
+	position: absolute;
+	z-index:10;
+	right:20px;
+	top:73px;
+}
 </style>

File diff ditekan karena terlalu besar
+ 133 - 0
src/view/bireport/ReportParam.vue


+ 29 - 0
src/view/bireport/ReportTable.vue

@@ -0,0 +1,29 @@
+<template>
+	<div>
+		表格
+	</div>
+</template>
+
+<script>
+	import {ajax} from '@/common/biConfig'
+	import $ from 'jquery'
+
+	export default {
+	    data(){
+			
+		},
+		mounted(){
+		},
+		computed: {
+		},
+		methods: {	
+			
+		},
+		watch: {
+		}
+	}
+</script>
+
+<style lang="less" scoped>
+
+</style>

+ 3 - 2
src/view/bireport/SelectCube.vue

@@ -14,6 +14,7 @@
 				<el-table-column align="center" prop="dsetName" label="数据集"></el-table-column>
 			</el-table>
 			<el-pagination
+				background
 				layout="prev, pager, next"
 				:total="total">
 			</el-pagination>
@@ -58,7 +59,7 @@
 					return;
 				}
 				var p = this.$parent;
-				p.selectDs = chk;
+				p.pageInfo.selectDs = chk;
 				p.initdataset();
 
 				this.show = false;
@@ -93,7 +94,7 @@
 	}
 </script>
 
-<style lang="less" scoped>
+<style lang="css">
 .el-dialog__body{
 	padding: 5px;
 }

+ 21 - 0
src/view/bireport/bireportUtils.js

@@ -0,0 +1,21 @@
+/**
+ * 多维分析的工具类
+ */
+import $ from 'jquery'
+
+/**
+ * 根据ID查找参数
+ * @param {*} pid 
+ * @param {*} params 
+ */
+export const findParamById = (pid, params)=>{
+    var ret = null;
+    for(var i=0; params&&i<params.length; i++){
+        var p = params[i];
+        if(p.id == pid){
+            ret = p;
+            break;
+        }
+    }
+    return ret;
+}

+ 1 - 0
src/view/frame/User.vue

@@ -39,6 +39,7 @@
 					</el-table-column>
 				</el-table>
 				<el-pagination
+					background
 					@size-change="handleSizeChange"
 					@current-change="handleCurrentChange"
 					:page-sizes="[10, 20, 50, 100]"