选择角色为tenant才显示框
This commit is contained in:
@@ -18,7 +18,7 @@ import {
|
|||||||
updateUser,
|
updateUser,
|
||||||
addUser,
|
addUser,
|
||||||
} from '@/api/system/user';
|
} from '@/api/system/user';
|
||||||
import { listDept } from '@/api/system/tenant';
|
import { listTenant } from '@/api/system/tenant';
|
||||||
|
|
||||||
import { saveAs } from 'file-saver';
|
import { saveAs } from 'file-saver';
|
||||||
import useI18n from '@/hooks/useI18n';
|
import useI18n from '@/hooks/useI18n';
|
||||||
@@ -238,6 +238,8 @@ type ModalStateType = {
|
|||||||
visibleByResetPwd: boolean;
|
visibleByResetPwd: boolean;
|
||||||
/**标题 */
|
/**标题 */
|
||||||
title: string;
|
title: string;
|
||||||
|
/**是否展示tenant框 */
|
||||||
|
showTenant: boolean;
|
||||||
/**表单数据 */
|
/**表单数据 */
|
||||||
from: Record<string, any>;
|
from: Record<string, any>;
|
||||||
/**确定按钮 loading */
|
/**确定按钮 loading */
|
||||||
@@ -252,6 +254,7 @@ let modalState: ModalStateType = reactive({
|
|||||||
visibleByEdit: false,
|
visibleByEdit: false,
|
||||||
visibleByResetPwd: false,
|
visibleByResetPwd: false,
|
||||||
title: '用户',
|
title: '用户',
|
||||||
|
showTenant: false,
|
||||||
from: {
|
from: {
|
||||||
userId: undefined,
|
userId: undefined,
|
||||||
userName: '',
|
userName: '',
|
||||||
@@ -673,6 +676,12 @@ let uploadImportState: ModalUploadImportStateType = reactive({
|
|||||||
templateDownload: false,
|
templateDownload: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function showTenant(value: any, option: any) {
|
||||||
|
modalState.showTenant = option.some(
|
||||||
|
(option: any) => option.roleKey === 'tenant'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**对话框表格信息导入弹出窗口 */
|
/**对话框表格信息导入弹出窗口 */
|
||||||
function fnModalUploadImportOpen() {
|
function fnModalUploadImportOpen() {
|
||||||
uploadImportState.updateSupport = false;
|
uploadImportState.updateSupport = false;
|
||||||
@@ -770,7 +779,7 @@ let deptTreeData = ref<DataNode[]>([]);
|
|||||||
/**查询部门下拉树结构 */
|
/**查询部门下拉树结构 */
|
||||||
function fnGetDeptTree() {
|
function fnGetDeptTree() {
|
||||||
if (deptTreeData.value.length > 0) return;
|
if (deptTreeData.value.length > 0) return;
|
||||||
listDept({ 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') {
|
||||||
@@ -1462,6 +1471,7 @@ onMounted(() => {
|
|||||||
:options="modalState.options.roles"
|
:options="modalState.options.roles"
|
||||||
:field-names="{ label: 'roleName', value: 'roleId' }"
|
:field-names="{ label: 'roleName', value: 'roleId' }"
|
||||||
:placeholder="t('common.selectPlease')"
|
:placeholder="t('common.selectPlease')"
|
||||||
|
@change="showTenant"
|
||||||
>
|
>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -1470,6 +1480,7 @@ onMounted(() => {
|
|||||||
:label="t('views.system.user.fromTenant')"
|
:label="t('views.system.user.fromTenant')"
|
||||||
name="tenantId"
|
name="tenantId"
|
||||||
:label-col="{ span: 3 }"
|
:label-col="{ span: 3 }"
|
||||||
|
v-show="modalState.showTenant"
|
||||||
>
|
>
|
||||||
<a-tree-select
|
<a-tree-select
|
||||||
v-model:value="modalState.from.tenantId"
|
v-model:value="modalState.from.tenantId"
|
||||||
|
|||||||
Reference in New Issue
Block a user