feat: people add new filed 'contact'
This commit is contained in:
@@ -49,6 +49,7 @@ export interface People {
|
|||||||
age?: number;
|
age?: number;
|
||||||
height?: number;
|
height?: number;
|
||||||
marital_status?: string;
|
marital_status?: string;
|
||||||
|
contact?: string;
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ const PeopleForm: React.FC<PeopleFormProps> = ({ initialData }) => {
|
|||||||
const formData: any = {};
|
const formData: any = {};
|
||||||
|
|
||||||
if (initialData.name) formData.name = initialData.name;
|
if (initialData.name) formData.name = initialData.name;
|
||||||
|
if (initialData.contact) formData.contact = initialData.contact;
|
||||||
if (initialData.gender) formData.gender = initialData.gender;
|
if (initialData.gender) formData.gender = initialData.gender;
|
||||||
if (initialData.age) formData.age = initialData.age;
|
if (initialData.age) formData.age = initialData.age;
|
||||||
if (initialData.height) formData.height = initialData.height;
|
if (initialData.height) formData.height = initialData.height;
|
||||||
@@ -50,6 +51,7 @@ const PeopleForm: React.FC<PeopleFormProps> = ({ initialData }) => {
|
|||||||
marital_status: values.marital_status || undefined,
|
marital_status: values.marital_status || undefined,
|
||||||
introduction: values.introduction || {},
|
introduction: values.introduction || {},
|
||||||
match_requirement: values.match_requirement || undefined,
|
match_requirement: values.match_requirement || undefined,
|
||||||
|
contact: values.contact || undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log('提交人员数据:', peopleData);
|
console.log('提交人员数据:', peopleData);
|
||||||
@@ -90,9 +92,18 @@ const PeopleForm: React.FC<PeopleFormProps> = ({ initialData }) => {
|
|||||||
onFinish={onFinish}
|
onFinish={onFinish}
|
||||||
>
|
>
|
||||||
|
|
||||||
<Form.Item name="name" label="姓名" rules={[{ required: true, message: '请输入姓名' }]}>
|
<Row gutter={[12, 12]}>
|
||||||
<Input placeholder="如:张三" />
|
<Col xs={24} md={12}>
|
||||||
</Form.Item>
|
<Form.Item name="name" label="姓名" rules={[{ required: true, message: '请输入姓名' }]}>
|
||||||
|
<Input placeholder="如:张三" />
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
<Col xs={24} md={12}>
|
||||||
|
<Form.Item name="contact" label="联系人">
|
||||||
|
<Input placeholder="如:李四(可留空)" />
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
|
||||||
<Row gutter={[12, 12]}>
|
<Row gutter={[12, 12]}>
|
||||||
<Col xs={24} md={6}>
|
<Col xs={24} md={6}>
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ async function fetchResources(): Promise<Resource[]> {
|
|||||||
height: person.height,
|
height: person.height,
|
||||||
marital_status: person.marital_status,
|
marital_status: person.marital_status,
|
||||||
introduction: person.introduction || {},
|
introduction: person.introduction || {},
|
||||||
|
contact: person.contact || '',
|
||||||
})) || [];
|
})) || [];
|
||||||
|
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
@@ -554,6 +555,12 @@ const ResourceList: React.FC = () => {
|
|||||||
} as ColumnType<Resource>,
|
} as ColumnType<Resource>,
|
||||||
]
|
]
|
||||||
: []),
|
: []),
|
||||||
|
{
|
||||||
|
title: '联系人',
|
||||||
|
dataIndex: 'contact',
|
||||||
|
key: 'contact',
|
||||||
|
render: (v: string) => (v ? v : '-'),
|
||||||
|
} as ColumnType<Resource>,
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user