| | |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="sizes[1]"> |
| | | <basic-container> |
| | | <basic-container |
| | | :class="[ |
| | | $store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '', |
| | | ]" |
| | | > |
| | | <avue-crud |
| | | :option="option" |
| | | :search.sync="search" |
| | |
| | | resetPassword, |
| | | getJurisdiction, |
| | | } from "@/api/system/user"; |
| | | import { getDeptTree, getDeptLazyTree } from "@/api/system/dept"; |
| | | import { getSecurityDeptTree, getDeptLazyTree } from "@/api/system/dept"; |
| | | import { getRoleTree } from "@/api/system/role"; |
| | | import { getPostList } from "@/api/system/post"; |
| | | import { mapGetters } from "vuex"; |
| | |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | ...this.$store.state.control.changePageSize, |
| | | }, |
| | | platformPage: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | ...this.$store.state.control.changePageSize, |
| | | }, |
| | | init: { |
| | | roleTree: [], |
| | |
| | | treeData: [], |
| | | treeOption: { |
| | | nodeKey: "id", |
| | | defaultExpandAll:true, |
| | | defaultExpandedKeys: [], |
| | | // defaultExpandAll:true, |
| | | // lazy: false, |
| | | // treeLoad: "", //处理权限 在created中 |
| | | // function (node, resolve) { |
| | |
| | | viewBtn: true, |
| | | //dialogType: 'drawer', |
| | | dialogClickModal: false, |
| | | ...this.$store.state.control.clearOtherBut, |
| | | column: [ |
| | | { |
| | | label: "登录账号", |
| | |
| | | label: "所属组织机构", |
| | | prop: "deptId", |
| | | type: "tree", |
| | | defaultExpandAll:true, |
| | | defaultExpandAll: true, |
| | | // dicUrl: "/api/blade-system/dept/lazy-tree", |
| | | props: { |
| | | label: "title", |
| | | value: "id", |
| | | }, |
| | | dicData:[], |
| | | dicData: [], |
| | | // hide: !website.tenantMode, |
| | | // addDisplay: website.tenantMode, |
| | | // editDisplay: website.tenantMode, |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | | ], |
| | | }, |
| | | ], |
| | |
| | | }, |
| | | }, |
| | | created() { |
| | | console.log(this.userInfo.role_name); |
| | | if (this.userInfo.role_name == "保安公司管理员") { |
| | | // console.log(this.userInfo.role_name); |
| | | if ( |
| | | this.userInfo.role_name == "保安公司管理员" || |
| | | this.userInfo.role_name == "分公司管理员" |
| | | ) { |
| | | this.deptids = this.userInfo.dept_id; |
| | | this.sizes = [0, 24]; |
| | | this.isguanli = false; |
| | | this.option.group[0].column[0]["value"] = this.userInfo.dept_id; |
| | | this.option.group[0].column[0]["disabled"] = true; |
| | | // this.option.group[0].column[0]["disabled"] = true; |
| | | // this.option.group[2].column[1]["disabled"] = true; |
| | | } else { |
| | | this.deptids = null; |
| | |
| | | var that = this; |
| | | //公安局进入 |
| | | if (this.userInfo.role_name == "公安管理员") { |
| | | var parentId = this.userInfo.dept_id; |
| | | var userId = this.userInfo.Id; |
| | | var parentId = this.userInfo.dept_id; |
| | | var userId = this.userInfo.Id; |
| | | getDeptLazyTree(parentId, userId).then((res) => { |
| | | that.treeData = res.data.data; |
| | | that.treeOption.defaultExpandedKeys = []; |
| | | res.data.data.forEach((item) => { |
| | | that.treeOption.defaultExpandedKeys.push(item.id); |
| | | }); |
| | | }); |
| | | } else { |
| | | // this.treeOption.treeLoad = function (node, resolve) { |
| | |
| | | getDeptLazyTree(0).then((res) => { |
| | | that.treeData = res.data.data; |
| | | }); |
| | | this.treeOption.defaultExpandAll = false; |
| | | // var parentId1 = this.userInfo.dept_id; |
| | | // getSecurityDeptTree(null,null,this.userInfo.dept_id).then((res) => { |
| | | // that.treeData = res.data.data; |
| | | // }); |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | if (d == "保安公司管理员") { |
| | | // console.log(k); |
| | | for (var n in k) { |
| | | if (k[n].title == "保安" || k[n].title == "保安公司管理员") { |
| | | if (k[n].title == "保安" || k[n].title == "保安公司管理员" || k[n].title == "分公司管理员") { |
| | | b.push(k[n]); |
| | | } |
| | | } |
| | | column.dicData = b; |
| | | } else if(d == "公安管理员"){ |
| | | } else if (d == "分公司管理员") { |
| | | for (var j in k) { |
| | | if (k[j].title == "分公司管理员" || k[j].title == "保安") { |
| | | b.push(k[j]); |
| | | } |
| | | if(k[j].children){ |
| | | for (var h in k[j].children) { |
| | | if (k[j].children[h].title == "分公司管理员" || k[j].children[h].title == "保安") { |
| | | b.push(k[j].children[h]); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | column.dicData = b; |
| | | }else if (d == "公安管理员") { |
| | | for (var i in k) { |
| | | if (k[i].title == "公安管理员") { |
| | | b.push(k[i]); |
| | | } |
| | | } |
| | | column.dicData = b; |
| | | }else { |
| | | } else { |
| | | column.dicData = k; |
| | | } |
| | | }); |
| | | |
| | | // this.userInfo.role_name == "保安公司管理员" |
| | | //公安局进入 |
| | | if (this.userInfo.role_name == "公安管理员" || this.userInfo.role_name == "保安公司管理员") { |
| | | var parentId = this.userInfo.dept_id; |
| | | var userId = this.userInfo.Id; |
| | | getDeptLazyTree(parentId, userId).then((res) => { |
| | | const column = this.findObject(this.option.group, "deptId"); |
| | | column.dicData = res.data.data; |
| | | }); |
| | | } else { |
| | | getDeptLazyTree(0).then((res) => { |
| | | const column = this.findObject(this.option.group, "deptId"); |
| | | column.dicData = res.data.data; |
| | | }); |
| | | } |
| | | if ( |
| | | this.userInfo.role_name == "公安管理员" |
| | | ) { |
| | | var parentId = this.userInfo.dept_id; |
| | | var userId = this.userInfo.Id; |
| | | getDeptLazyTree(parentId, userId).then((res) => { |
| | | const column = this.findObject(this.option.group, "deptId"); |
| | | column.dicData = res.data.data; |
| | | }); |
| | | } else if( this.userInfo.role_name == "administrator"){ |
| | | getDeptLazyTree(0).then((res) => { |
| | | const column = this.findObject(this.option.group, "deptId"); |
| | | column.dicData = res.data.data; |
| | | }); |
| | | }else { |
| | | getSecurityDeptTree(null,null,this.userInfo.dept_id).then((res) => { |
| | | const column = this.findObject(this.option.group, "deptId"); |
| | | column.dicData = res.data.data; |
| | | }); |
| | | } |
| | | // getDeptTree(tenantId).then((res) => { |
| | | // const column = this.findObject(this.option.group, "deptId"); |
| | | // column.dicData = res.data.data; |
| | |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | if(this.userInfo.role_name!="公安管理员"){ |
| | | if (this.userInfo.role_name != "公安管理员") { |
| | | const column = this.findObject(this.option.group, "code"); |
| | | column.display = false; |
| | | } |
| | | |
| | | |
| | | getUser(this.form.id).then((res) => { |
| | | this.form = res.data.data; |
| | | if (this.form.hasOwnProperty("deptId")) { |
| | |
| | | }); |
| | | } |
| | | if (["add"].includes(type)) { |
| | | if(this.userInfo.role_name!="公安管理员"){ |
| | | if (this.userInfo.role_name != "公安管理员") { |
| | | const column = this.findObject(this.option.group, "code"); |
| | | column.display = false; |
| | | } |