Kaynağa Gözat

重构数据集

rsbi 4 yıl önce
ebeveyn
işleme
667d4fc058

+ 13 - 0
src/router/index.js

@@ -9,6 +9,8 @@ import RoleMenu from '@/view/frame/RoleMenu'
 import User from '@/view/frame/User'
 import UserMenu from '@/view/frame/UserMenu'
 import Model from '@/view/model/Index'
+import Portal from '@/view/portal/Index'
+import ReportDesign from '@/view/bireport/ReportDesign'
 
 Vue.use(Router)
 
@@ -58,6 +60,17 @@ export default new Router({
           path:'/model/Index',
           name:'model',
           component:Model
+        },
+        {
+          path:'/portal/Index',
+          name:'portal',
+          component:Portal
+        }
+        ,
+        {
+          path:'/bireport/ReportDesign',
+          name:'bireport',
+          component:ReportDesign
         }
       ]
     }

+ 1 - 6
src/view/Login.vue

@@ -9,7 +9,7 @@
 	  </div>
 		<transition name="el-fade-in">
 	  		<section class="form_contianer" v-show="showLogin">
-		    	<el-form :model="loginForm" :rules="rules" ref="loginForm">
+		    	<el-form :model="loginForm" :rules="rules" ref="loginForm" @keyup.enter.native="submitForm('loginForm')">
 					<h2>用户登录</h2>
 					<div class="row">
 						<div class="col-sm-6">
@@ -104,11 +104,6 @@
 							}
 						});						
 					} else {
-						this.$notify.error({
-							title: '登录错误',
-							message: '请输入正确的用户名密码',
-							offset: 50
-						});
 						return false;
 					}
 				});

+ 31 - 0
src/view/bireport/ReportDesign.vue

@@ -0,0 +1,31 @@
+<template>
+  	<div class="wrapper-content">
+		  多维分析
+  	</div>
+</template>
+
+<script>
+	import {baseUrl} from '@/common/biConfig'
+	import $ from 'jquery'
+
+	export default {
+	    data(){
+			return {
+				
+			}
+		},
+		mounted(){
+			
+		},
+		computed: {
+		},
+		methods: {				
+		},
+		watch: {
+		}
+	}
+</script>
+
+<style lang="less" scoped>
+	@import "../../style/mixin";
+</style>

+ 145 - 8
src/view/model/DsetAdd.vue

@@ -1,8 +1,66 @@
 <template>
   <el-form :model="dset" :rules="rules" ref="dsetForm">
-    <el-form-item label="名称" label-width="100px" prop="name">
-      <el-input v-model="dset.name"></el-input>
-    </el-form-item>
+    <el-tabs v-model="active" type="card">
+      <el-tab-pane label="基本信息" name="base">
+        <el-form-item label="数据集名称" label-width="100px" prop="name">
+          <el-input v-model="dset.name"></el-input>
+        </el-form-item>
+        <el-form-item label="数据源" label-width="100px" prop="dsid">
+          <el-select v-model="dset.dsid" placeholder="请选择" @change="selectds">
+            <el-option
+              v-for="item in dsourceList"
+              :key="item.dsid"
+              :label="item.dsname"
+              :value="item.dsid"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="选择表" label-width="100px">
+          <div class="row">
+            <div class="col-sm-4" style="padding-left: 0">
+              <div class="ibox">
+                <div class="ibox-title" style="line-height: normal">待选表</div>
+                <div class="ibox-content" style="padding: 0px">
+                  <div
+                    id="allTablesTree"
+                    style="height: 300px; overflow: auto"
+                  ></div>
+                </div>
+              </div>
+            </div>
+            <div class="col-sm-2" style="text-align: center">
+              <button
+                type="button"
+                id="left2right"
+                style="margin-top: 120px"
+                class="btn btn-success btn-circle"
+              >
+                <i class="fa fa-chevron-right"></i></button
+              ><br /><br /><button
+                type="button"
+                id="right2left"
+                class="btn btn-success btn-circle"
+              >
+                <i class="fa fa-chevron-left"></i>
+              </button>
+            </div>
+            <div class="col-sm-4" style="padding-left: 0">
+              <div class="ibox">
+                <div class="ibox-title" style="line-height: normal">已选表</div>
+                <div class="ibox-content" style="padding: 0px">
+                  <div
+                    id="selTablesTree"
+                    style="height: 300px; overflow: auto"
+                  ></div>
+                </div>
+              </div>
+            </div>
+          </div>
+        </el-form-item>
+      </el-tab-pane>
+      <el-tab-pane label="表关联" name="join"> </el-tab-pane>
+    </el-tabs>
   </el-form>
 </template>
 
@@ -16,28 +74,98 @@ export default {
       operDailogTitle: "创建数据集",
       dset: {
         name: null,
+        dsid: null,
       },
+      dsourceList: [],
       rules: {
         name: [{ required: true, message: "必填", trigger: "blur" }],
+        dsid: [{ required: true, message: "必填", trigger: "blur" }],
       },
+      active: "base",
     };
   },
   components: {},
-  mounted() {},
+  mounted() {
+    this.loadDsource();
+  },
   computed: {},
   methods: {
+    selectds(){
+      let dsid = this.dset.dsid;
+      ajax({
+        type:"POST",
+        url:"model/listTables.action",
+        data:{dsid:dsid},
+        success:(resp)=>{
+          this.initLeftTree(false, resp.rows);
+        }
+      }, this);
+    },
     saveDset(isupdate) {
       let ret = true;
-      this.$refs['dsetForm'].validate((valid) => {
+      this.$refs["dsetForm"].validate((valid) => {
         if (valid) {
-          
-        }else{
-          ret= false;
+        } else {
+          ret = false;
         }
       });
       return ret;
     },
     addDset(isupdate) {
+      this.initLeftTree(isupdate, []);
+      this.initRightTree(isupdate);
+    },
+    loadDsource() {
+      ajax(
+        {
+          type: "GET",
+          url: "model/listDataSource.action",
+          data: {},
+          success: (resp) => {
+            this.dsourceList = resp.rows;
+          },
+        },
+        this
+      );
+    },
+    initLeftTree(isupdate, dts) {
+      let ref = $("#allTablesTree").jstree(true);
+      if(ref){
+        ref.destroy();
+      }
+      $("#allTablesTree")
+        .jstree({
+          core: {
+            check_callback: true,
+            data: dts,
+          },
+          plugins: ["wholerow"],
+        })
+        .bind("ready.jstree", function () {
+          if (isupdate) {
+            //隐藏已经选择的表
+            var ref = $("#allTablesTree").jstree(true);
+            ref.hide_node(transform.master);
+
+            for (
+              k = 0;
+              transform.joininfo && k < transform.joininfo.length;
+              k++
+            ) {
+              var j = transform.joininfo[k];
+              ref.hide_node(j.ref);
+            }
+          }
+        });
+    },
+    initRightTree(isupdate) {
+      $("#selTablesTree").jstree({
+        core: {
+          check_callback: true,
+          data: [],
+        },
+        plugins: ["wholerow"],
+      });
     },
   },
 };
@@ -45,4 +173,13 @@ export default {
 
 <style lang="less" scoped>
 @import "../../style/mixin";
+.btn-circle {
+  width: 30px;
+  height: 30px;
+  padding: 6px 0;
+  border-radius: 15px;
+  text-align: center;
+  font-size: 12px;
+  line-height: 1.428571429;
+}
 </style>

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

@@ -0,0 +1,31 @@
+<template>
+  	<div class="wrapper-content">
+		  数据报表
+  	</div>
+</template>
+
+<script>
+	import {baseUrl} from '@/common/biConfig'
+	import $ from 'jquery'
+
+	export default {
+	    data(){
+			return {
+				
+			}
+		},
+		mounted(){
+			
+		},
+		computed: {
+		},
+		methods: {				
+		},
+		watch: {
+		}
+	}
+</script>
+
+<style lang="less" scoped>
+	@import "../../style/mixin";
+</style>