mirror of
https://gitee.com/dapppp/ruoyi-plus-vben5.git
synced 2026-04-01 01:33:24 +08:00
fix(租户管理): 修复租户编辑时过期时间处理错误
修复租户编辑时,从接口获取的 expireTime 字符串未转换为 dayjs 对象导致表单显示异常的问题。 同时移除未使用的 dayjs 导入和过期时间默认值注释,避免潜在的类型错误。
This commit is contained in:
@@ -3,8 +3,6 @@ import type { VxeGridProps } from '#/adapter/vxe-table';
|
|||||||
|
|
||||||
import { getPopupContainer } from '@vben/utils';
|
import { getPopupContainer } from '@vben/utils';
|
||||||
|
|
||||||
import dayjs from 'dayjs';
|
|
||||||
|
|
||||||
import { z } from '#/adapter/form';
|
import { z } from '#/adapter/form';
|
||||||
|
|
||||||
export const querySchema: FormSchemaGetter = () => [
|
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 = () => [
|
export const drawerSchema: FormSchemaGetter = () => [
|
||||||
{
|
{
|
||||||
@@ -188,7 +186,7 @@ export const drawerSchema: FormSchemaGetter = () => [
|
|||||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||||
getPopupContainer,
|
getPopupContainer,
|
||||||
},
|
},
|
||||||
defaultValue: defaultExpireTime,
|
// defaultValue: defaultExpireTime,
|
||||||
fieldName: 'expireTime',
|
fieldName: 'expireTime',
|
||||||
help: `已经设置过期时间不允许重置为'无期限'\n即在开通时未设置无期限 以后都不允许设置`,
|
help: `已经设置过期时间不允许重置为'无期限'\n即在开通时未设置无期限 以后都不允许设置`,
|
||||||
label: '过期时间',
|
label: '过期时间',
|
||||||
|
|||||||
@@ -108,6 +108,9 @@ const [BasicDrawer, drawerApi] = useVbenDrawer({
|
|||||||
tenantInfo(id),
|
tenantInfo(id),
|
||||||
setupPackageSelect(),
|
setupPackageSelect(),
|
||||||
]);
|
]);
|
||||||
|
record.expireTime = record.expireTime
|
||||||
|
? (dayjs(record.expireTime) as any)
|
||||||
|
: undefined;
|
||||||
await formApi.setValues(record);
|
await formApi.setValues(record);
|
||||||
} else {
|
} else {
|
||||||
await setupPackageSelect();
|
await setupPackageSelect();
|
||||||
|
|||||||
Reference in New Issue
Block a user