| | |
| | | treeData: [], |
| | | treeOption: { |
| | | nodeKey: "id", |
| | | defaultExpandAll:true, |
| | | defaultExpandedKeys: [], |
| | | // defaultExpandAll:true, |
| | | // lazy: false, |
| | | // treeLoad: "", //处理权限 在created中 |
| | | // function (node, resolve) { |
| | |
| | | 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, |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | | ], |
| | | }, |
| | | ], |
| | |
| | | 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; |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | } |
| | | } |
| | | column.dicData = b; |
| | | } else if(d == "公安管理员"){ |
| | | } else if (d == "公安管理员") { |
| | | for (var i in k) { |
| | | if (k[i].title == "公安管理员") { |
| | | b.push(k[i]); |
| | | } |
| | | } |
| | | column.dicData = b; |
| | | }else { |
| | | } else { |
| | | column.dicData = k; |
| | | } |
| | | }); |
| | | |
| | | //公安局进入 |
| | | 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 == "公安管理员" || |
| | | 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; |
| | | }); |
| | | } |
| | | // 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; |
| | | } |