36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
const issueLabels: Record<string, string> = {
|
|
NO_SOURCE: '暂无数据来源',
|
|
VIN_MISSING: 'VIN 缺失',
|
|
LINK_GAP: '链路间断',
|
|
FIELD_MISSING: '字段缺失'
|
|
};
|
|
|
|
const protocolLabels: Record<string, string> = {
|
|
VEHICLE_SERVICE: '车辆服务',
|
|
GB32960: 'GB32960',
|
|
JT808: 'JT808',
|
|
YUTONG_MQTT: '宇通 MQTT'
|
|
};
|
|
|
|
export const qualityProtocolOptions = [
|
|
{ value: 'VEHICLE_SERVICE', label: protocolLabels.VEHICLE_SERVICE },
|
|
{ value: 'GB32960', label: protocolLabels.GB32960 },
|
|
{ value: 'JT808', label: protocolLabels.JT808 },
|
|
{ value: 'YUTONG_MQTT', label: protocolLabels.YUTONG_MQTT }
|
|
];
|
|
|
|
export const qualityIssueOptions = [
|
|
{ value: 'NO_SOURCE', label: issueLabels.NO_SOURCE },
|
|
{ value: 'VIN_MISSING', label: issueLabels.VIN_MISSING },
|
|
{ value: 'LINK_GAP', label: issueLabels.LINK_GAP },
|
|
{ value: 'FIELD_MISSING', label: issueLabels.FIELD_MISSING }
|
|
];
|
|
|
|
export function qualityIssueLabel(issueType: string) {
|
|
return issueLabels[issueType] ?? issueType;
|
|
}
|
|
|
|
export function qualityProtocolLabel(protocol: string) {
|
|
return protocolLabels[protocol] ?? protocol;
|
|
}
|