避免缓存导致
This commit is contained in:
@@ -396,17 +396,6 @@ function fnModalVisibleByEdit(userId?: string | number) {
|
|||||||
modalState.from = Object.assign(modalState.from, user);
|
modalState.from = Object.assign(modalState.from, user);
|
||||||
modalState.from.roleIds = roleIds;
|
modalState.from.roleIds = roleIds;
|
||||||
modalState.from.postIds = postIds;
|
modalState.from.postIds = postIds;
|
||||||
//deptTreeData.value=[];
|
|
||||||
//若长度为0 删除租户选项
|
|
||||||
if (deptTreeData.value.length === 0) {
|
|
||||||
const index = modalState.options.roles.findIndex(
|
|
||||||
(role: any) => role.roleKey === 'tenant'
|
|
||||||
);
|
|
||||||
|
|
||||||
if (index !== -1) {
|
|
||||||
modalState.options.roles.splice(index, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
modalState.title =
|
modalState.title =
|
||||||
t('common.addText') + t('views.system.user.userInfo');
|
t('common.addText') + t('views.system.user.userInfo');
|
||||||
modalState.visibleByEdit = true;
|
modalState.visibleByEdit = true;
|
||||||
@@ -792,7 +781,8 @@ let deptTreeData = ref<DataNode[]>([]);
|
|||||||
/**查询部门下拉树结构 */
|
/**查询部门下拉树结构 */
|
||||||
function fnGetDeptTree() {
|
function fnGetDeptTree() {
|
||||||
deptTreeData.value = []; //reSet
|
deptTreeData.value = []; //reSet
|
||||||
listTenant({ parentId: 0 }).then(res => {
|
listTenant({ parentId: 0 })
|
||||||
|
.then(res => {
|
||||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||||
res.data.forEach((item: any) => {
|
res.data.forEach((item: any) => {
|
||||||
if (item.parentId === '0') {
|
if (item.parentId === '0') {
|
||||||
@@ -805,6 +795,18 @@ function fnGetDeptTree() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
//若长度为0 删除租户选项
|
||||||
|
if (deptTreeData.value.length === 0) {
|
||||||
|
const index = modalState.options.roles.findIndex(
|
||||||
|
(role: any) => role.roleKey === 'tenant'
|
||||||
|
);
|
||||||
|
|
||||||
|
if (index !== -1) {
|
||||||
|
modalState.options.roles.splice(index, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user