瀏覽代碼

BUG修复

Koishi 1 年之前
父節點
當前提交
aa33a4e876

+ 11 - 6
src/components/alarmPopupa/index.vue

@@ -67,7 +67,7 @@
         }
       "
     >
-      <el-link type="primary" href="kacvascript:;">
+      <el-link type="primary" href="javascript:;">
         <!-- <el-icon color="#909399"><CaretBottom /></el-icon> -->
         <span style="margin-left: 6px" v-if="!isCollapse">点此折叠报警</span>
         <span style="margin-left: 6px; color: var(--el-color-danger)" v-else
@@ -147,7 +147,7 @@ export default {
               // 如果超过一定时间还没重置计时器,说明websocket与后端断开了
               this.showSocketLog && console.log("未收到心跳检测回复");
               // 关闭WebSocket
-              this.vueThis.socketObj.close();
+              this.vuethis.socketObj && this.socketObj.close();
             }, this.timeout);
           }, this.timeout);
         },
@@ -204,7 +204,7 @@ export default {
 
   unmounted() {
     this.socketLeaveFlag = true;
-    this.socketObj.close();
+    this.socketObj && this.socketObj.close();
   },
 
   methods: {
@@ -481,7 +481,7 @@ export default {
         // websocket重连
         this.socketReconnect();
       } else {
-        this.socketObj.close();
+        this.socketObj && this.socketObj.close();
       }
     },
 
@@ -559,6 +559,11 @@ export default {
         ts: alarmItem.ts,
         tsName: new Date(alarmItem.ts).formatDate("MM-dd hh:mm:ss"),
         fullTsName: new Date(alarmItem.ts).formatDate("yyyy-MM-dd hh:mm:ss"),
+        endts: alarmItem.endts,
+        endtsName:
+          alarmItem.endts > 0
+            ? new Date(alarmItem.endts).formatDate("yyyy-MM-dd hh:mm:ss")
+            : "",
         deviceId: alarmItem.deviceId,
         faultCause: alarmItem.faultCause,
         resolvent: alarmItem.resolvent,
@@ -599,7 +604,7 @@ export default {
       }
     },
 
-    goToAlertDescPage({ deviceId, alarmId, deviceType,alarmType }) {
+    goToAlertDescPage({ deviceId, alarmId, deviceType, alarmType }) {
       if (alarmType == "custom") {
         this.$router.push(
           `/safe/customWarning/${deviceId}/${alarmId}/${deviceType}`
@@ -613,7 +618,7 @@ export default {
           `/safe/historywaring/${deviceId}/${alarmId}/${deviceType}`
         );
       }
-    //   this.$router.push(`/safe/historywaring/${deviceId}/${alarmId}`);
+      //   this.$router.push(`/safe/historywaring/${deviceId}/${alarmId}`);
     },
 
     getConfigItem(lv) {

+ 9 - 2
src/pages/alarmConfig/bj_custom/custom.vue

@@ -206,11 +206,18 @@
     <div class="pagination">
       <el-pagination
         background
-        layout="total, prev, pager, next"
-        hide-on-single-page
+        layout="total, sizes, prev, pager, next"
         :current-page="query.pageNum"
         :page-size="query.pageSize"
+        :page-sizes="[4, 50, 100, 200, 500]"
         :total="total"
+        @size-change="
+          (value) => {
+            query.pageSize = value;
+            query.pageNum = 1;
+            getData();
+          }
+        "
         @current-change="handlePageChange"
       ></el-pagination>
     </div>

+ 15 - 3
src/pages/alarmConfig/bj_windturbine/windturbine.vue

@@ -158,11 +158,18 @@
     <div class="pagination">
       <el-pagination
         background
-        layout="total, prev, pager, next"
-        hide-on-single-page
+        layout="total, sizes, prev, pager, next"
         :current-page="query.pageNum"
         :page-size="query.pageSize"
+        :page-sizes="[4, 50, 100, 200, 500]"
         :total="total"
+        @size-change="
+          (value) => {
+            query.pageSize = value;
+            query.pageNum = 1;
+            getData();
+          }
+        "
         @current-change="handlePageChange"
       ></el-pagination>
     </div>
@@ -372,7 +379,12 @@ const export2Excel = async () => {
   });
 
   ElMessage.success(`导出成功!`);
-  outExportExcel(tableHeader, tableKey, res.data.records, "设备报警配置导出excel");
+  outExportExcel(
+    tableHeader,
+    tableKey,
+    res.data.records,
+    "设备报警配置导出excel"
+  );
 };
 // 模板下载
 const outExe = () => {

+ 3 - 0
src/pages/customWarning/index.vue

@@ -399,6 +399,7 @@ const state = reactive({
     // { title: "故障编码", code: "nemCode", width: "100" },
     // { title: "故障解决方法", code: "resolvent" },
     // { title: "级别", code: "rank", width: "80" },
+    { title: "报警解除时间", code: "endtsName", width: "150" },
     {
       title: "状态",
       code: "isCloseName",
@@ -414,6 +415,7 @@ const state = reactive({
     { title: "升压站", code: "stationname", width: "150" },
     { title: "报警信息", code: "description", width: "250" },
     // { title: "级别", code: "rank", width: "80" },
+    { title: "报警解除时间", code: "endtsName", width: "150" },
     {
       title: "状态",
       code: "isCloseName",
@@ -535,6 +537,7 @@ const getAlarmHistoryt = async () => {
   data?.ls?.forEach((ele) => {
     ele.isCloseName = ele.endts ? "已解除" : "未解除";
     ele.deviceTypeName = tableFilter(ele.deviceType);
+    ele.endtsName = formatTime(ele.endts);
   });
   state.tableData = data?.ls;
 };

+ 4 - 0
src/pages/safe/historywaring.vue

@@ -403,6 +403,7 @@ const state = reactive({
     // { title: "级别", code: "rank", width: "80" },
     { title: "故障编码", code: "nemCode", width: "100" },
     // { title: "故障解决方法", code: "resolvent" },
+    { title: "报警解除时间", code: "endtsName", width: "150" },
     {
       title: "状态",
       code: "isCloseName",
@@ -418,6 +419,7 @@ const state = reactive({
     { title: "升压站", code: "stationname", width: "150" },
     { title: "报警信息", code: "description" },
     // { title: "级别", code: "rank", width: "80" },
+    { title: "报警解除时间", code: "endtsName", width: "150" },
     {
       title: "状态",
       code: "isCloseName",
@@ -521,6 +523,7 @@ const componentList = computed(() => {
 const getWindturbineList = async () => {
   const { data } = await fetchWindturbineList(state.stationId);
   state.windturbineList = data;
+  state.modelId = modelList?.[0]?.id || "";
   await getAlarmHistoryt();
 };
 const query = reactive({
@@ -559,6 +562,7 @@ const getAlarmHistoryt = async () => {
         : ele.alarmType === "inverter"
         ? "光伏"
         : "";
+    ele.endtsName = formatTime(ele.endts);
   });
   state.tableData = data?.ls;
 };

+ 6 - 0
src/pages/safe/safecomponent.vue

@@ -141,6 +141,12 @@
             align="center"
             show-overflow-tooltip
           />
+          <el-table-column
+            prop="endtsName"
+            label="报警解除时间"
+            align="center"
+            show-overflow-tooltip
+          />
           <!-- <el-table-column
             prop="resolvent"
             label="报警解决方法"