fix: 修复部门多级下拉菜单回显错误问题

Former-commit-id: 66e0a0c5a7afd8b0531707b52c2107e511eafc32
This commit is contained in:
郝先瑞
2022-08-26 07:33:12 +08:00
parent f7c850d266
commit c88f5f9b35
2 changed files with 151 additions and 56 deletions

View File

@@ -18,7 +18,7 @@ import {
// 导入API
import {
listUserPages,
getUserFormData,
getUserDetail,
deleteUsers,
addUser,
updateUser,
@@ -272,27 +272,28 @@ function resetPassword(row: { [key: string]: any }) {
* 添加用户
**/
async function handleAdd() {
await loadDeptOptions();
await loadRoleOptions();
state.dialog = {
title: '添加用户',
visible: true
};
await loadDeptOptions();
await loadRoleOptions();
}
/**
* 修改用户
**/
async function handleUpdate(row: { [key: string]: any }) {
const userId = row.id || state.ids;
await loadDeptOptions();
await loadRoleOptions();
state.dialog = {
title: '修改用户',
visible: true
};
getUserFormData(userId).then(({ data }) => {
state.formData = data;
const userId = row.id || state.ids;
await loadDeptOptions();
await loadRoleOptions();
getUserDetail(userId).then(({ data }) => {
formData.value = data;
});
}
@@ -398,7 +399,7 @@ function handleDownloadTemplate() {
async function showImportDialog() {
await loadDeptOptions();
await loadRoleOptions();
state.importDialog.visible = true;
importDialog.value.visible = true;
}
/**
@@ -714,6 +715,7 @@ onMounted(() => {
:data="deptOptions"
filterable
check-strictly
:render-after-expand="false"
/>
</el-form-item>