Commit 900f24c7 by chenwq

feat: 添加导出参数函数以支持完整筛选字段导出

1 parent 2b32d867
Pipeline #468 for 900f24c7 failed in 0 seconds
......@@ -99,6 +99,39 @@ function toParams(
return { ...toFilters(filters, status), currentPage, pageSize } as LeadSearchParams;
}
/**
* 老系统异步导出要求完整保留筛选字段:未填写的字符串传空串,多选项传空数组。
* 下载中心会把业务 method 一并写入 exportParam,随后提交任务并按 uuid 查询结果。
*/
function toExportParams(filters: Filters, status: string): Record<string, unknown> {
const createTimeRange = filters.createTimeRange;
const lastFollowUpTimeRange = filters.lastFollowUpTimeRange;
return {
cluesNo: filters.cluesNo ?? '',
carOwnerName: filters.carOwnerName ?? '',
carOwnerPhone: filters.carOwnerPhone ?? '',
sellerMerchantIdList: filters.sellerMerchantIdList ?? [],
sellerName: filters.sellerName ?? '',
customerIntentLevelList: filters.customerIntentLevelList ?? [],
followTimeStatusList: filters.followTimeStatusList ?? [],
enterTimeStart: createTimeRange ? createTimeRange[0].format('YYYY-MM-DD HH:mm:ss') : '',
enterTimeEnd: createTimeRange ? createTimeRange[1].format('YYYY-MM-DD 23:59:59') : '',
latestFollowTimeStart: lastFollowUpTimeRange
? lastFollowUpTimeRange[0].format('YYYY-MM-DD HH:mm:ss')
: '',
latestFollowTimeEnd: lastFollowUpTimeRange
? lastFollowUpTimeRange[1].format('YYYY-MM-DD 23:59:59')
: '',
conversionName: filters.conversionName ?? '',
enterType: filters.enterType ?? '',
carModel: filters.carModel ?? '',
...(status ? { cluesStatusList: [status] } : {}),
currentPage: 1,
server_provider_type: 'gsc',
server_provider_name: 'gsc-vcp-web-facade',
};
}
/** menu_code 1002602 · 线索管理 · usedcar:lead:view */
export default function Leads() {
const { canPoint } = useAccess();
......@@ -321,9 +354,9 @@ export default function Leads() {
downloadCenter.asyncExport({
source: 'usedcar',
sourceLabel: '二手车管理 / 线索管理 / 线索导出',
label: '线索导出',
label: '线索管理列表',
method: '/clues/exportAsync',
params: toParams(filters, status, 1, page.size),
params: toExportParams(filters, status),
dedupeKey: 'leads-export',
}),
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!