告警工单初始化

This commit is contained in:
mmc
2026-07-13 16:25:44 +08:00
parent e54dd4047a
commit 2b851831da
6 changed files with 245 additions and 110 deletions

View File

@@ -237,12 +237,28 @@ export function dataUrlToFile(dataUrl, fileName) {
// 错误来源
export const errorSourceOptions = [
{ label: '无人机', value: 'UAV' },
{ label: '割草机', value: 'MOWER' },
{ label: '其他', value: 'OTHERS' },
export const ERROR_SOURCE = {
UAV: 'UAV',
MOWER: 'MOWER',
OTHERS: 'OTHERS'
} as const;
];
export type ErrorSourceType = typeof ERROR_SOURCE[keyof typeof ERROR_SOURCE];
export const errorSourceOptions: Array<{
value: ErrorSourceType;
label: string;
}> = [
{ label: '无人机', value: ERROR_SOURCE.UAV },
{ label: '割草机', value: ERROR_SOURCE.MOWER },
{ label: '其他', value: ERROR_SOURCE.OTHERS },
];
export const getErrorSourceText = (source?: ErrorSourceType | string): string => {
if (!source) return "";
const target = errorSourceOptions.find((item) => item.value === source);
return target?.label ?? String(source);
};
// 错误等级
export const errorLevelOptions = [
@@ -296,9 +312,9 @@ export const workOrderTypeOptions: Array<{
{ value: WORK_ORDER_TYPE.UAV_ERROR, label: "无人机故障" },
{ value: WORK_ORDER_TYPE.INSPECTION_TASK, label: "巡检" },
{ value: WORK_ORDER_TYPE.COMPONENT_DEFECT, label: "光伏组件故障" },
{ value: WORK_ORDER_TYPE.CLEAN_TASK, label: "清洗任务" },
{ value: WORK_ORDER_TYPE.MAINTAIN_TASK, label: "维护任务" },
{ value: WORK_ORDER_TYPE.REPAIR_TASK, label: "维修任务" },
{ value: WORK_ORDER_TYPE.CLEAN_TASK, label: "清洗" },
{ value: WORK_ORDER_TYPE.MAINTAIN_TASK, label: "维护" },
{ value: WORK_ORDER_TYPE.REPAIR_TASK, label: "维修" },
{ value: WORK_ORDER_TYPE.OTHER, label: "其他" },
];