瀏覽代碼

报警记录模块BUG修复、预警查询模块BUG修复、首页弹窗跳转BUG修复

Koishi 1 年之前
父節點
當前提交
6aaef67e8e
共有 4 個文件被更改,包括 26 次插入7 次删除
  1. 10 3
      src/components/alarmPopupa/index.vue
  2. 1 1
      src/pages/customWarning/index.vue
  3. 13 1
      src/pages/safe/historywaring.vue
  4. 2 2
      src/router/index.js

+ 10 - 3
src/components/alarmPopupa/index.vue

@@ -570,6 +570,7 @@ export default {
         characteristic: alarmItem.characteristic,
         code: alarmItem.code,
         wpName: alarmItem.wpName,
+        stationId: alarmItem.stationid,
       };
 
       if (
@@ -604,21 +605,27 @@ export default {
       }
     },
 
-    goToAlertDescPage({ deviceId, alarmId, deviceType, alarmType }) {
+    goToAlertDescPage({
+      deviceId,
+      alarmId,
+      deviceType,
+      alarmType,
+      ts,
+      stationId,
+    }) {
       if (alarmType == "custom") {
         this.$router.push(
           `/safe/customWarning/${deviceId}/${alarmId}/${deviceType}`
         );
       } else if (alarmType == "booststation") {
         this.$router.push(
-          `/safe/historywaring/${wpName}/${alarmId}/${deviceType}`
+          `/safe/historywaring/${stationId}/${alarmId}/${deviceType}/${ts}`
         );
       } else {
         this.$router.push(
           `/safe/historywaring/${deviceId}/${alarmId}/${deviceType}`
         );
       }
-      //   this.$router.push(`/safe/historywaring/${deviceId}/${alarmId}`);
     },
 
     getConfigItem(lv) {

+ 1 - 1
src/pages/customWarning/index.vue

@@ -537,7 +537,7 @@ const getAlarmHistoryt = async () => {
   data?.ls?.forEach((ele) => {
     ele.isCloseName = ele.endts ? "已解除" : "未解除";
     ele.deviceTypeName = tableFilter(ele.deviceType);
-    ele.endtsName = formatTime(ele.endts);
+    ele.endtsName = ele.endts > 0 ? formatTime(ele.endts) : "";
   });
   state.tableData = data?.ls;
 };

+ 13 - 1
src/pages/safe/historywaring.vue

@@ -312,6 +312,12 @@ onMounted(() => {
     state.typeVal = route.params.typeVal || "booststation";
   }
   state.isshowwindturbineName = state.typeVal == "booststation" ? false : true;
+  if (route.params.ts) {
+    state.dateTime = [
+      `${dayjs(Number(route.params.ts)).format("YYYY-MM-DD")} 00:00:00`,
+      dayjs(Number(route.params.ts)).format("YYYY-MM-DD HH:mm:ss"),
+    ];
+  }
   getStationList();
   getequipmentmodel_list();
   getfetchRelatePart();
@@ -394,6 +400,7 @@ const state = reactive({
   endDate: null,
   tableData: [],
   isshowwindturbineName: true,
+  ts: "",
   tableHeader: [
     { title: "时间", code: "ts", width: "150" },
     { title: "场站", code: "stationname", width: "150" },
@@ -452,6 +459,9 @@ const getStationList = async () => {
   } else {
     state.stationId = data[0]?.id;
   }
+
+  state.stationId = route.params.stationId || state.stationId;
+  route.params.stationId ? (state.modelId = modelList?.[0]?.id || "") : "";
 };
 
 watch(
@@ -476,12 +486,14 @@ watch(
       state.typeVal = route.params.typeVal || "windturbine";
     } else {
       state.stationName = route.params.deviceId;
+      state.stationId = route.params.stationId;
       state.deviceId = "";
       state.alarmId = route.params.alarmId || "";
       state.typeVal = route.params.typeVal || "booststation";
     }
     state.isshowwindturbineName =
       state.typeVal == "booststation" ? false : true;
+    getStationList();
   },
   {
     deep: true,
@@ -562,7 +574,7 @@ const getAlarmHistoryt = async () => {
         : ele.alarmType === "inverter"
         ? "光伏"
         : "";
-    ele.endtsName = formatTime(ele.endts);
+    ele.endtsName = ele.endts > 0 ? formatTime(ele.endts) : "";
   });
   state.tableData = data?.ls;
 };

+ 2 - 2
src/router/index.js

@@ -64,7 +64,7 @@ const routes = [
               ),
           },
           {
-            path: "/safe/historywaring/:deviceId?/:alarmId?/:typeVal?",
+            path: "/safe/historywaring/:deviceId?/:alarmId?/:typeVal?/:ts?",
             name: "safehistorywaring",
             isshow: "super_admin,common",
             meta: {
@@ -77,7 +77,7 @@ const routes = [
               ),
           },
           {
-            path: "/safe/customWarning/:deviceId?/:alarmId?/:typeVal?",
+            path: "/safe/customWarning/:deviceId?/:alarmId?/:typeVal?/:ts?",
             name: "customWarning",
             isshow: "super_admin,common",
             meta: {