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