避免缓存导致

This commit is contained in:
lai
2024-09-27 19:18:28 +08:00
parent a77b968a17
commit a889f97bd6

View File

@@ -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,20 +781,33 @@ let deptTreeData = ref<DataNode[]>([]);
/**查询部门下拉树结构 */ /**查询部门下拉树结构 */
function fnGetDeptTree() { function fnGetDeptTree() {
deptTreeData.value = []; //reSet deptTreeData.value = []; //reSet
listTenant({ parentId: 0 }).then(res => { listTenant({ parentId: 0 })
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { .then(res => {
res.data.forEach((item: any) => { if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
if (item.parentId === '0') { res.data.forEach((item: any) => {
deptTreeData.value.push({ if (item.parentId === '0') {
childern: undefined, deptTreeData.value.push({
title: item.tenantName, childern: undefined,
key: item.tenantId, title: item.tenantName,
...item, key: item.tenantId,
}); ...item,
});
}
});
}
})
.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);
} }
}); }
} });
});
} }
function handleChange(value: any, options: any) { function handleChange(value: any, options: any) {