chore: tenant
This commit is contained in:
parent
b01ac1bca4
commit
66c2d18a4e
@ -134,18 +134,30 @@ export const drawerSchema: FormSchemaGetter = () => [
|
|||||||
renderComponentContent: () => ({
|
renderComponentContent: () => ({
|
||||||
default: () => '管理员信息',
|
default: () => '管理员信息',
|
||||||
}),
|
}),
|
||||||
|
dependencies: {
|
||||||
|
if: (values) => !values?.tenantId,
|
||||||
|
triggerFields: ['tenantId'],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'username',
|
fieldName: 'username',
|
||||||
label: '用户账号',
|
label: '用户账号',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
|
dependencies: {
|
||||||
|
if: (values) => !values?.tenantId,
|
||||||
|
triggerFields: ['tenantId'],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'InputPassword',
|
component: 'InputPassword',
|
||||||
fieldName: 'password',
|
fieldName: 'password',
|
||||||
label: '密码',
|
label: '密码',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
|
dependencies: {
|
||||||
|
if: (values) => !values?.tenantId,
|
||||||
|
triggerFields: ['tenantId'],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Divider',
|
component: 'Divider',
|
||||||
|
@ -17,6 +17,7 @@ import {
|
|||||||
tenantStatusChange,
|
tenantStatusChange,
|
||||||
} from '#/api/system/tenant';
|
} from '#/api/system/tenant';
|
||||||
import { TableSwitch } from '#/components/table';
|
import { TableSwitch } from '#/components/table';
|
||||||
|
import { useTenantStore } from '#/store/tenant';
|
||||||
import { downloadExcel } from '#/utils/file/download';
|
import { downloadExcel } from '#/utils/file/download';
|
||||||
|
|
||||||
import { columns, querySchema } from './data';
|
import { columns, querySchema } from './data';
|
||||||
@ -106,9 +107,12 @@ async function handleEdit(record: Recordable<any>) {
|
|||||||
drawerApi.open();
|
drawerApi.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const tenantStore = useTenantStore();
|
||||||
async function handleDelete(row: Recordable<any>) {
|
async function handleDelete(row: Recordable<any>) {
|
||||||
await tenantRemove(row.id);
|
await tenantRemove(row.id);
|
||||||
await tableApi.query();
|
await tableApi.query();
|
||||||
|
// 重新加载租户信息
|
||||||
|
tenantStore.initTenant();
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleMultiDelete() {
|
function handleMultiDelete() {
|
||||||
@ -122,6 +126,8 @@ function handleMultiDelete() {
|
|||||||
await tenantRemove(ids);
|
await tenantRemove(ids);
|
||||||
await tableApi.query();
|
await tableApi.query();
|
||||||
checked.value = false;
|
checked.value = false;
|
||||||
|
// 重新加载租户信息
|
||||||
|
tenantStore.initTenant();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -130,7 +136,6 @@ const { hasAccessByCodes } = useAccess();
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Page :auto-content-height="true">
|
<Page :auto-content-height="true">
|
||||||
todo 新增修改删除与store同步 修改不显示密码
|
|
||||||
<BasicTable>
|
<BasicTable>
|
||||||
<template #toolbar-actions>
|
<template #toolbar-actions>
|
||||||
<span class="pl-[7px] text-[16px]">租户列表 </span>
|
<span class="pl-[7px] text-[16px]">租户列表 </span>
|
||||||
|
@ -11,6 +11,7 @@ import { useVbenForm } from '#/adapter';
|
|||||||
import { clientAdd, clientUpdate } from '#/api/system/client';
|
import { clientAdd, clientUpdate } from '#/api/system/client';
|
||||||
import { tenantInfo } from '#/api/system/tenant';
|
import { tenantInfo } from '#/api/system/tenant';
|
||||||
import { packageSelectList } from '#/api/system/tenant-package';
|
import { packageSelectList } from '#/api/system/tenant-package';
|
||||||
|
import { useTenantStore } from '#/store/tenant';
|
||||||
|
|
||||||
import { drawerSchema } from './data';
|
import { drawerSchema } from './data';
|
||||||
|
|
||||||
@ -70,10 +71,19 @@ const [BasicDrawer, drawerApi] = useVbenDrawer({
|
|||||||
const record = await tenantInfo(id);
|
const record = await tenantInfo(id);
|
||||||
await formApi.setValues(record);
|
await formApi.setValues(record);
|
||||||
}
|
}
|
||||||
|
formApi.updateSchema([
|
||||||
|
{
|
||||||
|
fieldName: 'packageId',
|
||||||
|
componentProps: {
|
||||||
|
disabled: isUpdate.value,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]);
|
||||||
drawerApi.drawerLoading(false);
|
drawerApi.drawerLoading(false);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const tenantStore = useTenantStore();
|
||||||
async function handleConfirm() {
|
async function handleConfirm() {
|
||||||
try {
|
try {
|
||||||
drawerApi.drawerLoading(true);
|
drawerApi.drawerLoading(true);
|
||||||
@ -85,6 +95,8 @@ async function handleConfirm() {
|
|||||||
await (isUpdate.value ? clientUpdate(data) : clientAdd(data));
|
await (isUpdate.value ? clientUpdate(data) : clientAdd(data));
|
||||||
emit('reload');
|
emit('reload');
|
||||||
await handleCancel();
|
await handleCancel();
|
||||||
|
// 重新加载租户信息
|
||||||
|
tenantStore.initTenant();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
} finally {
|
} finally {
|
||||||
|
Loading…
Reference in New Issue
Block a user