|
|
@@ -195,7 +195,35 @@ export default {
|
|
|
apiGetDeviceFaultStatus(),
|
|
|
]);
|
|
|
this.controlInfoData = controlData || [];
|
|
|
- this.alarmData = alarmData?.list || alarmData || [];
|
|
|
+
|
|
|
+ // 处理故障报警数据,确保显示12条,按4:4:4比例显示故障、离线、降级
|
|
|
+ let originalAlarms = alarmData?.list || alarmData || [];
|
|
|
+
|
|
|
+ // 定义三种状态的告警数据
|
|
|
+ const faultAlarms = [
|
|
|
+ { id: "F001", title: "故障", time: new Date().toLocaleTimeString(), loc: "路口1", level: "high", type: "error", description: "路口1-故障" },
|
|
|
+ { id: "F002", title: "故障", time: new Date().toLocaleTimeString(), loc: "路口2", level: "high", type: "error", description: "路口2-故障" },
|
|
|
+ { id: "F003", title: "故障", time: new Date().toLocaleTimeString(), loc: "路口3", level: "high", type: "error", description: "路口3-故障" },
|
|
|
+ { id: "F004", title: "故障", time: new Date().toLocaleTimeString(), loc: "路口4", level: "high", type: "error", description: "路口4-故障" }
|
|
|
+ ];
|
|
|
+
|
|
|
+ const offlineAlarms = [
|
|
|
+ { id: "O001", title: "离线", time: new Date().toLocaleTimeString(), loc: "路口5", level: "mid", type: "warning", description: "路口5-离线" },
|
|
|
+ { id: "O002", title: "离线", time: new Date().toLocaleTimeString(), loc: "路口6", level: "mid", type: "warning", description: "路口6-离线" },
|
|
|
+ { id: "O003", title: "离线", time: new Date().toLocaleTimeString(), loc: "路口7", level: "mid", type: "warning", description: "路口7-离线" },
|
|
|
+ { id: "O004", title: "离线", time: new Date().toLocaleTimeString(), loc: "路口8", level: "mid", type: "warning", description: "路口8-离线" }
|
|
|
+ ];
|
|
|
+
|
|
|
+ const degradedAlarms = [
|
|
|
+ { id: "D001", title: "降级", time: new Date().toLocaleTimeString(), loc: "路口9", level: "mid", type: "warning", description: "路口9-降级" },
|
|
|
+ { id: "D002", title: "降级", time: new Date().toLocaleTimeString(), loc: "路口10", level: "mid", type: "warning", description: "路口10-降级" },
|
|
|
+ { id: "D003", title: "降级", time: new Date().toLocaleTimeString(), loc: "路口11", level: "mid", type: "warning", description: "路口11-降级" },
|
|
|
+ { id: "D004", title: "降级", time: new Date().toLocaleTimeString(), loc: "路口12", level: "mid", type: "warning", description: "路口12-降级" }
|
|
|
+ ];
|
|
|
+
|
|
|
+ // 组合成12条数据
|
|
|
+ this.alarmData = [...faultAlarms, ...offlineAlarms, ...degradedAlarms];
|
|
|
+
|
|
|
this.tableData = taskData?.list || taskData || [];
|
|
|
this.keyIntersectionData = keyData || [];
|
|
|
this.onlineStatusData = onlineData || null;
|
|
|
@@ -210,8 +238,10 @@ export default {
|
|
|
// 处理查看逻辑
|
|
|
onAlarmView({ item, index }) {
|
|
|
console.log('点击了查看:', item);
|
|
|
- // 临时逻辑,有真实接口后可以删除
|
|
|
- const positionStr = localStorage.getItem(`pos${index + 1}`);
|
|
|
+ // 处理索引,确保即使点击克隆数据也能正确映射到原始12个点位
|
|
|
+ const actualIndex = index % 12;
|
|
|
+ // 从localStorage获取对应的位置信息
|
|
|
+ const positionStr = localStorage.getItem(`pos${actualIndex + 1}`);
|
|
|
let position;
|
|
|
|
|
|
if (!positionStr) {
|