Commit b671c4e2 by chenwq

优化录线索人员字段的选项处理,提取常量并简化渲染逻辑

1 parent 8472f9bc
Pipeline #587 for b671c4e2 failed in 0 seconds
...@@ -57,6 +57,10 @@ const FOLLOW_STATUS = [ ...@@ -57,6 +57,10 @@ const FOLLOW_STATUS = [
{ value: '2', label: '已超期' }, { value: '2', label: '已超期' },
{ value: '0', label: '正常' }, { value: '0', label: '正常' },
]; ];
const ENTER_TYPES = [
{ value: '1', label: '销售' },
{ value: '2', label: '评估师' },
];
const levelDescription: Record<string, string> = { const levelDescription: Record<string, string> = {
O: '客情回复,确认交车时间', O: '客情回复,确认交车时间',
H: '1日内跟进', H: '1日内跟进',
...@@ -250,10 +254,7 @@ export default function Leads() { ...@@ -250,10 +254,7 @@ export default function Leads() {
name: 'enterType', name: 'enterType',
label: '录线索人员', label: '录线索人员',
type: 'select', type: 'select',
options: [ options: ENTER_TYPES,
{ value: '1', label: '销售' },
{ value: '2', label: '评估师' },
],
}, },
{ {
name: 'carModel', name: 'carModel',
...@@ -361,7 +362,7 @@ export default function Leads() { ...@@ -361,7 +362,7 @@ export default function Leads() {
title: '录线索人员', title: '录线索人员',
dataIndex: 'enterType', dataIndex: 'enterType',
width: 120, width: 120,
render: (v: unknown) => (String(v) === '1' ? '销售' : String(v) === '2' ? '评估师' : '-'), render: enterTypeText,
}, },
{ title: '评估师', dataIndex: 'conversionName', width: 120, render: (v: unknown) => v || '-' }, { title: '评估师', dataIndex: 'conversionName', width: 120, render: (v: unknown) => v || '-' },
]; ];
...@@ -483,3 +484,7 @@ function followResultText(value: unknown): string { ...@@ -483,3 +484,7 @@ function followResultText(value: unknown): string {
)[Number(value)] ?? '其他' )[Number(value)] ?? '其他'
); );
} }
function enterTypeText(value: unknown): string {
return ENTER_TYPES.find((option) => option.value === String(value))?.label ?? '-';
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!