15 lines
625 B
TypeScript
15 lines
625 B
TypeScript
/** 匹配层级标签颜色:完美绿、高配蓝系、低配橙、冲突/缺失红。 */
|
|
export function resolveConsignmentPriorityTagColor(label: string | null | undefined): string {
|
|
const value = String(label || '').trim()
|
|
if (!value) return 'default'
|
|
if (value === '完美匹配') return 'green'
|
|
if (value === '同钻高璀') return 'blue'
|
|
if (value === '高钻同璀') return 'cyan'
|
|
if (value === '高钻高璀') return 'geekblue'
|
|
if (value === '低配') return 'orange'
|
|
if (value.includes('冲突') || value.includes('缺失') || value.includes('不符')) {
|
|
return 'red'
|
|
}
|
|
return 'default'
|
|
}
|