部门管理:增删改查、用户部门显示

This commit is contained in:
陈淳
2022-09-13 17:50:20 +08:00
parent 7b6d8671cf
commit 5b1ad450d3
9 changed files with 63 additions and 54 deletions

View File

@@ -238,8 +238,9 @@
<script setup name="User">
import { getToken } from "@/utils/auth";
import { changeUserStatus, listUser, resetUserPwd, delUser, getUser, updateUser, addUser, deptTreeSelect } from "@/api/system/user";
import { changeUserStatus, listUser, resetUserPwd, delUser, getUser, updateUser, addUser } from "@/api/system/user";
import { roleOptionselect } from "@/api/system/role";
import { listDept} from "@/api/system/dept";
const router = useRouter();
const { proxy } = getCurrentInstance();
const { sys_normal_disable, sys_user_sex } = proxy.useDict("sys_normal_disable", "sys_user_sex");
@@ -317,8 +318,14 @@ watch(deptName, val => {
});
/** 查询部门下拉树结构 */
function getDeptTree() {
deptTreeSelect().then(response => {
deptOptions.value = response.data;
listDept().then(response => {
const selectList=[];
response.data.forEach(res=>{
selectList.push({id:res.id,label:res.deptName,parentId:res.parentId,orderNum:res.orderNum, children:[]})
}
)
deptOptions.value = proxy.handleTree(selectList, "id");;
});
};
/** 查询用户列表 */