feat: formTypes
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { type TenantVO, deleteTenant } from "@/services/system/tenant/list";
|
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 { DatePicker, Modal, Popconfirm } from "antd";
|
||||||
import { FormInstance } from "antd/lib";
|
import { FormInstance } from "antd/lib";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
@@ -80,7 +80,7 @@ export const baseTenantColumns: ProColumns<TenantVO>[] = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export const formColumns: any = [
|
export const formColumns = (type: string): ProFormColumnsType[] => [
|
||||||
{
|
{
|
||||||
title: "租户名",
|
title: "租户名",
|
||||||
dataIndex: "name",
|
dataIndex: "name",
|
||||||
@@ -140,7 +140,7 @@ export const formColumns: any = [
|
|||||||
{
|
{
|
||||||
title: "用户名称",
|
title: "用户名称",
|
||||||
dataIndex: "username",
|
dataIndex: "username",
|
||||||
hideInForm: true,
|
hideInForm: type === "update",
|
||||||
formItemProps: {
|
formItemProps: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
@@ -159,7 +159,7 @@ export const formColumns: any = [
|
|||||||
title: "用户密码",
|
title: "用户密码",
|
||||||
dataIndex: "password",
|
dataIndex: "password",
|
||||||
valueType: "password",
|
valueType: "password",
|
||||||
hideInForm: true,
|
hideInForm: type === "update",
|
||||||
fieldProps: {
|
fieldProps: {
|
||||||
placeholder: "请输入用户密码",
|
placeholder: "请输入用户密码",
|
||||||
autoComplete: "new-password",
|
autoComplete: "new-password",
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ const TenantList = () => {
|
|||||||
<ConfigurableDrawerForm
|
<ConfigurableDrawerForm
|
||||||
ref={configurableDrawerRef}
|
ref={configurableDrawerRef}
|
||||||
title={formStatusType[type]}
|
title={formStatusType[type]}
|
||||||
columns={formColumns}
|
columns={formColumns(type)}
|
||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in New Issue
Block a user