Files
lingniu-vehicle-ingest/vehicle-data-platform/apps/web/src/domain/qualityIssue.ts
2026-07-04 04:42:12 +08:00

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;
}