refactor: 移除不必要的部门接口

This commit is contained in:
valarchie
2023-03-28 21:18:53 +08:00
parent 8ddc45cd84
commit 953b6b0589
2 changed files with 6 additions and 10 deletions

View File

@@ -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({

View File

@@ -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;