diff --git a/src/api/system/deptApi.js b/src/api/system/deptApi.js index 530b153..1393beb 100644 --- a/src/api/system/deptApi.js +++ b/src/api/system/deptApi.js @@ -9,14 +9,6 @@ export function listDept(query) { }); } -// 查询部门列表(排除当前自身节点) -export function listDeptExcludeItself(deptId) { - return request({ - url: `/system/dept/list/exclude/${deptId}`, - method: 'get', - }); -} - // 查询部门详细 export function getDept(deptId) { return request({ diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index 2f38b2c..6814655 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -230,8 +230,12 @@ function toggleExpandAll() { /** 修改按钮操作 */ function handleUpdate(row) { reset(); - deptApi.listDeptExcludeItself(row.deptId).then((response) => { - deptOptions.value = proxy.handleTree(response, 'deptId'); + deptApi.listDept(row.deptId).then((response) => { + const deptListExcludeItSelf = response.filter((dept) => { + return dept.deptId !== row.deptId; + }); + + deptOptions.value = proxy.handleTree(deptListExcludeItSelf, 'deptId'); }); deptApi.getDept(row.deptId).then((response) => { form.value = response;