From 81995263d6cdf1fa7992387765711d171a9f1e4f Mon Sep 17 00:00:00 2001 From: mamamiyear Date: Mon, 27 Oct 2025 14:49:16 +0800 Subject: [PATCH] feat: people add new filed 'contact' --- src/apis/types.ts | 1 + src/components/PeopleForm.tsx | 17 ++++++++++++++--- src/components/ResourceList.tsx | 7 +++++++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/apis/types.ts b/src/apis/types.ts index cae0ee4..55b740f 100644 --- a/src/apis/types.ts +++ b/src/apis/types.ts @@ -49,6 +49,7 @@ export interface People { age?: number; height?: number; marital_status?: string; + contact?: string; [key: string]: any; } diff --git a/src/components/PeopleForm.tsx b/src/components/PeopleForm.tsx index 80f5dbd..b0a4425 100644 --- a/src/components/PeopleForm.tsx +++ b/src/components/PeopleForm.tsx @@ -23,6 +23,7 @@ const PeopleForm: React.FC = ({ initialData }) => { const formData: any = {}; if (initialData.name) formData.name = initialData.name; + if (initialData.contact) formData.contact = initialData.contact; if (initialData.gender) formData.gender = initialData.gender; if (initialData.age) formData.age = initialData.age; if (initialData.height) formData.height = initialData.height; @@ -50,6 +51,7 @@ const PeopleForm: React.FC = ({ initialData }) => { marital_status: values.marital_status || undefined, introduction: values.introduction || {}, match_requirement: values.match_requirement || undefined, + contact: values.contact || undefined, }; console.log('提交人员数据:', peopleData); @@ -90,9 +92,18 @@ const PeopleForm: React.FC = ({ initialData }) => { onFinish={onFinish} > - - - + + + + + + + + + + + + diff --git a/src/components/ResourceList.tsx b/src/components/ResourceList.tsx index 42248d0..bbf1259 100644 --- a/src/components/ResourceList.tsx +++ b/src/components/ResourceList.tsx @@ -39,6 +39,7 @@ async function fetchResources(): Promise { height: person.height, marital_status: person.marital_status, introduction: person.introduction || {}, + contact: person.contact || '', })) || []; } catch (error: any) { @@ -554,6 +555,12 @@ const ResourceList: React.FC = () => { } as ColumnType, ] : []), + { + title: '联系人', + dataIndex: 'contact', + key: 'contact', + render: (v: string) => (v ? v : '-'), + } as ColumnType, ]; return (