实时更新租户树
This commit is contained in:
@@ -431,6 +431,8 @@ function fnModalVisibleByEdit(userId?: string | number) {
|
|||||||
(role: any) => role.roleKey === 'tenant'
|
(role: any) => role.roleKey === 'tenant'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if(modalState.showTenant) fnGetDeptTree();
|
||||||
|
|
||||||
modalState.title =
|
modalState.title =
|
||||||
t('common.editText') + t('views.system.user.userInfo');
|
t('common.editText') + t('views.system.user.userInfo');
|
||||||
modalState.visibleByEdit = true;
|
modalState.visibleByEdit = true;
|
||||||
@@ -497,7 +499,7 @@ function fnModalCancel() {
|
|||||||
modalStateFrom.resetFields();
|
modalStateFrom.resetFields();
|
||||||
modalState.options.roles = [];
|
modalState.options.roles = [];
|
||||||
modalState.options.posts = [];
|
modalState.options.posts = [];
|
||||||
modalState.showTenant=false;
|
modalState.showTenant = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -777,8 +779,8 @@ let deptTreeData = ref<DataNode[]>([]);
|
|||||||
|
|
||||||
/**查询部门下拉树结构 */
|
/**查询部门下拉树结构 */
|
||||||
function fnGetDeptTree() {
|
function fnGetDeptTree() {
|
||||||
if (deptTreeData.value.length > 0) return;
|
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') {
|
||||||
@@ -797,6 +799,8 @@ function fnGetDeptTree() {
|
|||||||
function handleChange(value: any, options: any) {
|
function handleChange(value: any, options: any) {
|
||||||
modalState.from.roleIds = [value];
|
modalState.from.roleIds = [value];
|
||||||
modalState.showTenant = options.roleKey === 'tenant';
|
modalState.showTenant = options.roleKey === 'tenant';
|
||||||
|
// 获取租户树结构数据
|
||||||
|
if (modalState.showTenant) fnGetDeptTree();
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
@@ -814,8 +818,6 @@ onMounted(() => {
|
|||||||
});
|
});
|
||||||
// 获取列表数据
|
// 获取列表数据
|
||||||
fnGetList();
|
fnGetList();
|
||||||
// 获取部门树结构数据
|
|
||||||
fnGetDeptTree();
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user