fix(租户管理): 修复租户编辑时过期时间处理错误

修复租户编辑时,从接口获取的 expireTime 字符串未转换为 dayjs 对象导致表单显示异常的问题。
同时移除未使用的 dayjs 导入和过期时间默认值注释,避免潜在的类型错误。
This commit is contained in:
dap
2026-01-29 20:42:09 +08:00
parent 585a543c8f
commit 330f2d81ed
2 changed files with 5 additions and 4 deletions

View File

@@ -3,8 +3,6 @@ import type { VxeGridProps } from '#/adapter/vxe-table';
import { getPopupContainer } from '@vben/utils';
import dayjs from 'dayjs';
import { z } from '#/adapter/form';
export const querySchema: FormSchemaGetter = () => [
@@ -73,7 +71,7 @@ export const columns: VxeGridProps['columns'] = [
},
];
const defaultExpireTime = dayjs().add(365, 'days').startOf('day');
// const defaultExpireTime = dayjs().add(365, 'days').startOf('day');
export const drawerSchema: FormSchemaGetter = () => [
{
@@ -188,7 +186,7 @@ export const drawerSchema: FormSchemaGetter = () => [
valueFormat: 'YYYY-MM-DD HH:mm:ss',
getPopupContainer,
},
defaultValue: defaultExpireTime,
// defaultValue: defaultExpireTime,
fieldName: 'expireTime',
help: `已经设置过期时间不允许重置为'无期限'\n即在开通时未设置无期限 以后都不允许设置`,
label: '过期时间',

View File

@@ -108,6 +108,9 @@ const [BasicDrawer, drawerApi] = useVbenDrawer({
tenantInfo(id),
setupPackageSelect(),
]);
record.expireTime = record.expireTime
? (dayjs(record.expireTime) as any)
: undefined;
await formApi.setValues(record);
} else {
await setupPackageSelect();