From 197e80826e247a6bb6d2abb28eb398e6c2be8211 Mon Sep 17 00:00:00 2001 From: francis-fh Date: Thu, 4 Jun 2026 16:50:40 +0800 Subject: [PATCH] 11 --- src/pages/Management/List/index.tsx | 41 ++++++++++++++++++++++++++--- src/types/Management/list.d.ts | 7 +++-- 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/src/pages/Management/List/index.tsx b/src/pages/Management/List/index.tsx index 74b3ccd..717dd9c 100644 --- a/src/pages/Management/List/index.tsx +++ b/src/pages/Management/List/index.tsx @@ -42,6 +42,16 @@ const lyrhandleExport = async (values: API.ManagementList.ListParams) => { return false; } }; +const buildListSearchParams = (values: Record): API.ManagementList.ListParams => { + const { dateRange, ...rest } = values || {}; + const params = { ...rest } as API.ManagementList.ListParams; + if (dateRange?.[0] && dateRange?.[1]) { + params.startDate = dateRange[0]; + params.endDate = dateRange[1]; + } + return params; +}; + const handleRemoveOne = async (jobId: string) => { const hide = message.loading('正在删除'); if (!jobId) return true; @@ -111,6 +121,21 @@ function ManagementList() { } const columns: ProColumns[] = [ + { + title: '时间范围', + dataIndex: 'dateRange', + hideInTable: true, + valueType: 'dateRange', + fieldProps: { + format: 'YYYY-MM-DD', + }, + search: { + transform: (value) => ({ + startDate: value[0], + endDate: value[1], + }), + }, + }, { title: '岗位名称', dataIndex: 'jobTitle', @@ -221,6 +246,14 @@ function ManagementList() { align: 'center', hideInSearch: true, }, + { + title: '创建时间', + dataIndex: 'createTime', + valueType: 'dateTime', + align: 'center', + hideInSearch: true, + width: 180, + }, { title: '操作', hideInSearch: true, @@ -339,8 +372,8 @@ function ManagementList() { key="export" hidden={!access.hasPerms('system:user:export')} onClick={async () => { - const searchVal = formTableRef.current && formTableRef.current.getFieldsValue(); - handleExport(searchVal as API.ManagementList.ListParams); + const searchVal = formTableRef.current?.getFieldsValue(); + handleExport(buildListSearchParams(searchVal || {})); }} > @@ -351,8 +384,8 @@ function ManagementList() { key="export" hidden={!access.hasPerms('cms:jobApply:export')} onClick={async () => { - const searchVal = formTableRef.current && formTableRef.current.getFieldsValue(); - lyrhandleExport(searchVal as API.ManagementList.ListParams); + const searchVal = formTableRef.current?.getFieldsValue(); + lyrhandleExport(buildListSearchParams(searchVal || {})); }} > 录用人导出 diff --git a/src/types/Management/list.d.ts b/src/types/Management/list.d.ts index 836af01..d8097aa 100644 --- a/src/types/Management/list.d.ts +++ b/src/types/Management/list.d.ts @@ -27,8 +27,9 @@ declare namespace API.ManagementList { view?: number; release?: number; isPublish?: number; - jobType?:string; + jobType?: string; jobContactList?: ContactPerson[]; + createTime?: string; } export interface AddParams { @@ -53,7 +54,7 @@ declare namespace API.ManagementList { view?: number; release?: number; isPublish?: number; - jobType?:string; + jobType?: string; jobContactList?: ContactPerson[]; } @@ -63,6 +64,8 @@ declare namespace API.ManagementList { remark?: string; pageSize?: number; current?: number; + startDate?: string; + endDate?: string; } export interface ManageIdResult {