feat: formTypes

This commit is contained in:
2025-09-17 10:52:11 +08:00
parent 57b87d49b4
commit 0a2a4e7707
2 changed files with 5 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
import { type TenantVO, deleteTenant } from "@/services/system/tenant/list";
import { ProColumns } from "@ant-design/pro-components";
import { ProColumns, ProFormColumnsType } from "@ant-design/pro-components";
import { DatePicker, Modal, Popconfirm } from "antd";
import { FormInstance } from "antd/lib";
import dayjs from "dayjs";
@@ -80,7 +80,7 @@ export const baseTenantColumns: ProColumns<TenantVO>[] = [
},
];
export const formColumns: any = [
export const formColumns = (type: string): ProFormColumnsType[] => [
{
title: "租户名",
dataIndex: "name",
@@ -140,7 +140,7 @@ export const formColumns: any = [
{
title: "用户名称",
dataIndex: "username",
hideInForm: true,
hideInForm: type === "update",
formItemProps: {
rules: [
{
@@ -159,7 +159,7 @@ export const formColumns: any = [
title: "用户密码",
dataIndex: "password",
valueType: "password",
hideInForm: true,
hideInForm: type === "update",
fieldProps: {
placeholder: "请输入用户密码",
autoComplete: "new-password",

View File

@@ -130,7 +130,7 @@ const TenantList = () => {
<ConfigurableDrawerForm
ref={configurableDrawerRef}
title={formStatusType[type]}
columns={formColumns}
columns={formColumns(type)}
onSubmit={handleSubmit}
/>
</>