| | |
| | | callback(); |
| | | } |
| | | }; |
| | | |
| | | return { |
| | | isguanli: true, |
| | | |
| | |
| | | treeOption: { |
| | | nodeKey: "id", |
| | | lazy: true, |
| | | treeLoad: function (node, resolve) { |
| | | const parentId = node.level === 0 ? 0 : node.data.id; |
| | | getDeptLazyTree(parentId).then((res) => { |
| | | resolve( |
| | | res.data.data.map((item) => { |
| | | return { |
| | | ...item, |
| | | leaf: !item.hasChildren, |
| | | }; |
| | | }) |
| | | ); |
| | | }); |
| | | }, |
| | | treeLoad: "", //处理权限 在created中 |
| | | // function (node, resolve) { |
| | | // const parentId = node.level === 0 ? 0 : node.data.id; |
| | | // //公安局进入 |
| | | |
| | | // getDeptLazyTree(parentId, jurisdiction).then((res) => { |
| | | // resolve( |
| | | // res.data.data.map((item) => { |
| | | // return { |
| | | // ...item, |
| | | // leaf: !item.hasChildren, |
| | | // }; |
| | | // }) |
| | | // ); |
| | | // }); |
| | | // }, |
| | | addBtn: false, |
| | | menu: false, |
| | | size: "small", |
| | |
| | | this.deptids = null; |
| | | this.sizes = [5, 19]; |
| | | } |
| | | |
| | | //公安局进入 |
| | | var jurisdiction = ""; |
| | | if (this.userInfo.role_name == "公安管理员") { |
| | | jurisdiction = this.userInfo.jurisdiction; |
| | | this.treeOption.treeLoad = function (node, resolve) { |
| | | const parentId = node.level === 0 ? 0 : node.data.id; |
| | | getDeptLazyTree(parentId, jurisdiction).then((res) => { |
| | | resolve( |
| | | res.data.data.map((item) => { |
| | | return { |
| | | ...item, |
| | | leaf: !item.hasChildren, |
| | | }; |
| | | }) |
| | | ); |
| | | }); |
| | | }; |
| | | } else { |
| | | this.treeOption.treeLoad = function (node, resolve) { |
| | | const parentId = node.level === 0 ? 0 : node.data.id; |
| | | getDeptLazyTree(parentId).then((res) => { |
| | | resolve( |
| | | res.data.data.map((item) => { |
| | | return { |
| | | ...item, |
| | | leaf: !item.hasChildren, |
| | | }; |
| | | }) |
| | | ); |
| | | }); |
| | | }; |
| | | } |
| | | }, |
| | | mounted() { |
| | | // 非保安单位模式默认加载管理组数据 |
| | |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | var deptid = this.deptids == null ? this.treeDeptId : this.deptids; |
| | | //公安局进入 |
| | | if (this.userInfo.role_name == "公安管理员") { |
| | | params["jurisdiction"] = this.userInfo.jurisdiction; |
| | | } |
| | | |
| | | getList( |
| | | page.currentPage, |
| | | page.pageSize, |