Przeglądaj źródła

数据建模功能

rsbi 4 lat temu
rodzic
commit
a2130453ee

+ 16 - 1
src/components/FrameTop.vue

@@ -26,18 +26,25 @@
       </li>
     </ul>
 	</nav>
+  <userInfo ref="uinfo"></userInfo>
+  <password ref="psd"></password>
   </div>
 </template>
 
 <script>
 import {baseUrl} from '@/common/biConfig'
 import $ from 'jquery'
-  
+import userInfo from '@/components/UserInfo'
+import password from '@/components/Password'
+
 export default {
   name: 'FrameTOp',
   data () {
     return {userbtnstyle:'glyphicon-menu-up',swatchcls:''}
   },
+  components: {
+		userInfo,password
+	},
   methods:{
     mover:function(){
       this.userbtnstyle = "glyphicon-menu-down";
@@ -73,6 +80,14 @@ export default {
                ts.$router.push('/'); 
             }
           });
+        }else if(cmd === 'grxx'){
+          this.$refs['uinfo'].show = true;
+        }else if(cmd === 'xgmm'){
+          this.$refs['psd'].show = true;
+        }else if(cmd === 'wtfk'){
+          window.open("http://www.ruisitech.com/suggest.html");
+        }else if(cmd === 'sysc'){
+          window.open("http://book.ruisitech.com");
         }
     }
   }

+ 90 - 0
src/components/Password.vue

@@ -0,0 +1,90 @@
+<template>
+  <el-dialog title="修改密码" :visible.sync="show">
+    <el-form :model="userpsd" :rules="rules" ref="userPsdForm">
+      <el-form-item label="原密码" label-width="100px" prop="password1">
+        <el-input type="password" v-model="userpsd.password1"  :show-password="true" ></el-input>
+      </el-form-item>
+      <el-form-item label="新密码" label-width="100px" prop="password2">
+        <el-input type="password" v-model="userpsd.password2"  :show-password="true" ></el-input>
+      </el-form-item>
+      <el-form-item label="重复密码" label-width="100px" prop="password3">
+        <el-input type="password" v-model="userpsd.password3"  :show-password="true" ></el-input>
+      </el-form-item>
+    </el-form>
+    <div slot="footer" class="dialog-footer">
+      <el-button type="primary" @click="savepsd()">确 定</el-button>
+      <el-button @click="show = false">取 消</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { ajax } from "@/common/biConfig";
+import $ from "jquery";
+
+export default {
+  name: "password",
+  data() {
+    return {
+      show: false,
+      userpsd:{
+        password1:null,
+        password2:null,
+        password3:null
+      },
+      rules:{
+        password1:[
+						{ required: true, message: '必填', trigger: 'blur' },
+						{ min: 6, max: 18, message: '密码长度6到18位', trigger: 'blur' }
+					],
+					password2:[
+						{ required: true, message: '必填', trigger: 'blur' },
+						{ min: 6, max: 18, message: '密码长度6到18位', trigger: 'blur' }
+          ],
+          password3:[
+						{ required: true, message: '必填', trigger: 'blur' },
+						{ min: 6, max: 18, message: '密码长度6到18位', trigger: 'blur' }
+					]
+      }
+    };
+  },
+  mounted: function () {
+
+  },
+  methods: {
+      savepsd:function(){
+				let ts = this;
+				this.$refs['userPsdForm'].validate((valid) => {
+					if (valid) {
+						if(ts.userpsd.password2 != ts.userpsd.password3){
+							ts.$notify.error({
+										title: '两次密码不一致',
+										offset: 50
+									});
+							return false;
+						}
+						ajax({
+							type:"POST",
+							data: ts.userpsd,
+							postJSON:false,
+							url:"frame/chgPsd.action",
+							success:function(resp){
+								ts.$notify.success({
+										title: '密码修改成功',
+										offset: 50
+									});
+								ts.show = false;
+							}
+						}, ts);
+					} else {
+						return false;
+					}
+				});
+			}
+  }
+};
+</script>
+
+<style scoped lang="less">
+@import "../style/mixin";
+</style>

+ 54 - 0
src/components/UserInfo.vue

@@ -0,0 +1,54 @@
+<template>
+  <el-dialog title="个人信息" :visible.sync="show">
+    <dl class="dl-horizontal">
+      <dt>登录名:</dt>
+      <dd>{{user.staffId}}</dd>
+      <dt>用户名:</dt>
+      <dd>{{user.loginName}}</dd>
+      <dt>所属企业:</dt>
+      <dd>成都睿思商智科技有限公司</dd>
+      <dt>账号状态:</dt>
+      <dd>{{ user.state==1?"启用":"停用" }}</dd>
+      <dt>登录次数:</dt>
+      <dd>{{user.logCnt}}次</dd>
+      <dt>上次登录时间:</dt>
+      <dd>{{user.loginTime}}</dd>
+    </dl>
+      <div slot="footer" class="dialog-footer">
+				<el-button @click="show = false">取 消</el-button>
+			  </div>
+  </el-dialog>
+</template>
+
+<script>
+import { ajax } from "@/common/biConfig";
+import $ from "jquery";
+
+export default {
+  name: "userInfo",
+  data() {
+    return {
+      show:false,
+      user:{}
+    };
+  },
+  mounted:function(){
+    let ts = this;
+    ajax({
+      type:"GET",
+      data:{},
+      url:"frame/user.action",
+      success:function(resp){
+        ts.user = resp.rows;
+      }
+    }, ts);
+  },
+  methods: {
+
+  },
+};
+</script>
+
+<style scoped lang="less">
+@import "../style/mixin";
+</style>

+ 6 - 0
src/router/index.js

@@ -8,6 +8,7 @@ import Role from '@/view/frame/Role'
 import RoleMenu from '@/view/frame/RoleMenu'
 import User from '@/view/frame/User'
 import UserMenu from '@/view/frame/UserMenu'
+import Model from '@/view/model/Index'
 
 Vue.use(Router)
 
@@ -52,6 +53,11 @@ export default new Router({
           path:'/frame/UserMenu',
           name:'userMenu',
           component:UserMenu
+        },
+        {
+          path:'/model/Index',
+          name:'model',
+          component:Model
         }
       ]
     }

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

@@ -308,9 +308,24 @@
 						});
 					}
 				}, ts);
+				this.curUserId = userId;
 			},
 			saveUserRole:function(){
-				alert(this.checkList);
+				let ts = this;
+				ajax({
+					type:"POST",
+					url:"frame/role/userRoleSave.action",
+					dataType:"JSON",
+					postJSON:true,
+					data:JSON.stringify({roleId:ts.checkList,userId:ts.curUserId}),
+					success:function(resp){
+						 ts.$notify.success({
+							title: '授权成功',
+							offset: 50
+						});
+						ts.userRoleDailog = false;
+					}
+				}, ts);
 			}
 		},
 		watch: {

+ 31 - 1
src/view/frame/UserMenu.vue

@@ -76,7 +76,37 @@ export default {
     },
     save:function(){
       const ts = this;
-      
+      let ids = "";
+      let nodes = this.treeRef.get_selected(true);
+      for(let i=0; nodes&&i<nodes.length; i++){
+        var n = nodes[i];
+        if(n.state.disabled){
+          continue;
+        }
+        ids = ids + n.id + ",";
+      }
+      $("#menutree").find(".jstree-undetermined").each(function (i, element) {
+        var id = $(element).closest('.jstree-node').attr("id");
+        if(id != 'root'){
+          ids = ids + id + ",";
+        }
+      });
+      if(ids.length > 0){
+        ids = ids.substring(0, ids.length - 1);
+      }
+      ajax({
+        type:"POST",
+        url:"/frame/user/userMenu/save.action",
+        dataType:"JSON",
+        data:{userId:ts.$route.params.userId, menuIds:ids},
+        success:function(resp){
+          ts.$notify.success({
+            title: '授权成功',
+            offset: 50
+          });
+          ts.backpage();
+        }
+      }, ts);
     },
     backpage:function(){
       this.$router.push('user')

+ 31 - 0
src/view/model/Cube.vue

@@ -0,0 +1,31 @@
+<template>
+  <div> cube </div>
+</template>
+
+<script>
+import { baseUrl, ajax } from "@/common/biConfig";
+import operationDailog from '@/components/OperationDailog'
+import $ from "jquery"
+
+export default {
+   name: 'cube',
+  data() {
+    return {
+    }
+  },
+  components: {
+		
+	},
+  mounted() {
+    
+  },
+  computed: {},
+  methods: {
+	 
+  }
+};
+</script>
+
+<style lang="less" scoped>
+@import "../../style/mixin";
+</style>

+ 31 - 0
src/view/model/Dset.vue

@@ -0,0 +1,31 @@
+<template>
+  <div> dset </div>
+</template>
+
+<script>
+import { baseUrl, ajax } from "@/common/biConfig";
+import operationDailog from '@/components/OperationDailog'
+import $ from "jquery"
+
+export default {
+   name: 'dset',
+  data() {
+    return {
+    }
+  },
+  components: {
+		
+	},
+  mounted() {
+    
+  },
+  computed: {},
+  methods: {
+	 
+  }
+};
+</script>
+
+<style lang="less" scoped>
+@import "../../style/mixin";
+</style>

+ 71 - 0
src/view/model/Dsource.vue

@@ -0,0 +1,71 @@
+<template>
+  <div> 
+    <div class="btn-group optbtncls" role="group">
+						<button type="button" class="btn btn-outline btn-default" title="新增" @click="addRole(false)">
+							<i class="glyphicon glyphicon-plus" aria-hidden="true"></i>
+						</button>
+						<button type="button" class="btn btn-outline btn-default" title="修改" @click="addRole(true)">
+							<i class="glyphicon glyphicon-edit" aria-hidden="true"></i>
+						</button>
+						<button type="button" class="btn btn-outline btn-default" title="删除" @click="delRole()">
+							<i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
+						</button>
+					</div>
+					<el-table :data="tableData" @row-click="selectme" border style="width: 100%" header-row-class-name="tableHeadbg">
+						<el-table-column label="" width="45">
+							<template slot-scope="scope">
+								<el-radio v-model="checked" name="myselect2" :label="scope.row.dsid">&nbsp;</el-radio>
+							</template>
+						</el-table-column>
+						<el-table-column align="center" width="150" prop="dsname" label="名称"></el-table-column>
+						<el-table-column align="center" width="150" prop="use" label="类型"></el-table-column>
+						<el-table-column align="center" width="150" prop="linkType" label="数据库"></el-table-column>
+						<el-table-column align="center" prop="linkUrl" label="链接字符串"></el-table-column>
+						<el-table-column align="center" width="150" prop="linkName" label="用户名"></el-table-column>
+					</el-table>
+  </div>
+</template>
+
+<script>
+import { baseUrl, ajax } from "@/common/biConfig";
+import operationDailog from '@/components/OperationDailog'
+import $ from "jquery"
+
+export default {
+   name: 'dsource',
+  data() {
+    return {
+		tableData:[],
+		checked:""
+    }
+  },
+  components: {
+		
+	},
+  mounted() {
+    this.loadData();
+  },
+  computed: {},
+  methods: {
+	 selectme:function(a, b){
+		this.checked = a.dsid;
+	},
+	loadData:function(){
+		let ts = this;
+		ajax({
+			type:"GET",
+			url:"model/listDataSource.action",
+			dataType:"JSON",
+			data:{},
+			success:function(resp){
+				ts.tableData = resp.rows;
+			}
+		}, ts);
+	}
+  }
+};
+</script>
+
+<style lang="less" scoped>
+@import "../../style/mixin";
+</style>

+ 61 - 0
src/view/model/Index.vue

@@ -0,0 +1,61 @@
+<template>
+  <div class="wrapper-content">
+
+    <div class="ibox" id="mainDiv">
+      <div class="ibox-title">数据建模</div>
+      <div class="ibox-content">
+        <el-tabs tab-position="left" :style="autoHeight()">
+          <el-tab-pane label="数据源">
+              <dsource></dsource>
+          </el-tab-pane>
+          <el-tab-pane label="数据集">
+              <dset></dset>
+          </el-tab-pane>
+          <el-tab-pane label="立方体">
+              <cube></cube>
+          </el-tab-pane>
+        </el-tabs>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { baseUrl, ajax } from "@/common/biConfig";
+import operationDailog from '@/components/OperationDailog'
+import $ from "jquery"
+import cube from '@/view/model/Cube'
+import dset from '@/view/model/Dset'
+import dsource from '@/view/model/Dsource'
+
+export default {
+  data() {
+    return {
+    }
+  },
+  components: {
+		cube, dset, dsource
+	},
+  mounted() {
+    
+  },
+  computed: {},
+  methods: {
+	  autoHeight:function(){
+        let h = $(".page-wrapper").height();
+        if(h){
+            return  "height:"+ (h - 110 )+ "px;";
+        }else{
+            return "height:460px;";
+        }
+    }
+  },
+  watch: {
+
+  }
+};
+</script>
+
+<style lang="less" scoped>
+@import "../../style/mixin";
+</style>