用户管理列表的部门树改为懒加载

dev
smallchill 6 years ago
parent 8189c0872d
commit 56a9c29ff3
  1. 2
      public/cdn/avue/2.3.4/avue.min.js
  2. 2
      public/cdn/avue/2.3.4/index.css
  3. 11
      src/api/system/dept.js
  4. 4
      src/views/monitor/log/api.vue
  5. 17
      src/views/system/user.vue

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -58,6 +58,7 @@ export const getDept = (id) => {
}
})
}
export const getDeptTree = (tenantId) => {
return request({
url: '/api/blade-system/dept/tree',
@ -68,3 +69,13 @@ export const getDeptTree = (tenantId) => {
})
}
export const getDeptLazyTree = (parentId) => {
return request({
url: '/api/blade-system/dept/lazy-tree',
method: 'get',
params: {
parentId
}
})
}

@ -50,6 +50,7 @@
{
label: "服务id",
prop: "serviceId",
width:'120',
search: true
},
{
@ -59,7 +60,8 @@
},
{
label: "服务ip",
prop: "serverIp"
prop: "serverIp",
width:'160'
},
{
label: "软件环境",

@ -64,7 +64,7 @@
add,
resetPassword
} from "@/api/system/user";
import {getDeptTree} from "@/api/system/dept";
import {getDeptTree, getDeptLazyTree} from "@/api/system/dept";
import {getRoleTree} from "@/api/system/role";
import {mapGetters} from "vuex";
import website from '@/config/website';
@ -105,6 +105,18 @@
treeData: [],
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
}
}))
});
},
addBtn: false,
menu: false,
size: 'small',
@ -322,9 +334,6 @@
this.onLoad(this.page);
},
initData() {
getDeptTree().then(res => {
this.treeData = res.data.data;
});
getDeptTree(this.form.tenantId).then(res => {
const index = this.$refs.crud.findColumnIndex("deptId");
this.option.column[index].dicData = res.data.data;

Loading…
Cancel
Save