From da21fe61c8d8d22ca1b6244b233fbce9e2dc5814 Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期五, 27 十月 2023 09:16:35 +0800
Subject: [PATCH] 统计页面

---
 src/views/smoke/alarm/index.vue |   50 ++++++++++++++++++++++++--------------------------
 1 files changed, 24 insertions(+), 26 deletions(-)

diff --git a/src/views/smoke/alarm/index.vue b/src/views/smoke/alarm/index.vue
index dc098df..45ec584 100644
--- a/src/views/smoke/alarm/index.vue
+++ b/src/views/smoke/alarm/index.vue
@@ -15,16 +15,20 @@
         :data="tableData"
         :row-class-name="tableRowClassName"
       >
-        <el-table-column label="搴忓彿" type="index" width="60px">
+        <el-table-column label="搴忓彿" type="index" min-width="2">
         </el-table-column>
-        <el-table-column prop="AcquitAtStr" label="鏃堕棿" width="120px">
+        <el-table-column prop="MN" label="璁惧缂栫爜" min-width="2">
         </el-table-column>
-        <el-table-column prop="MsgTypeStr" label="娑堟伅绫诲瀷" width="180px">
+        <el-table-column prop="AcquitAtStr" label="鏃堕棿" min-width="3">
         </el-table-column>
-        <el-table-column prop="Content" label="娑堟伅鍐呭" width="100px">
+        <el-table-column prop="MsgTypeStr" label="娑堟伅绫诲瀷" min-width="2">
+        </el-table-column>
+        <!-- <el-table-column prop="Addr" label="鍦板潃" min-width="4">
+        </el-table-column> -->
+        <el-table-column prop="Content" label="娑堟伅鍐呭" min-width="8">
         </el-table-column>
 
-        <el-table-column prop="operation" label="鎿嶄綔" width="550px">
+        <el-table-column prop="operation" label="鎿嶄綔" min-width="3">
           <template slot-scope="scope">
             <div class="operation">
               <span @click="handleUpload(scope.row)">涓婃姤</span>
@@ -67,6 +71,7 @@
       totalNum: 0,
       pageSize: 10,
       currentPage: 1,
+      params: {},
     };
   },
   components: { MyHeader },
@@ -75,28 +80,24 @@
   },
   methods: {
     getAlarmList(seachData) {
-      let params;
       if (seachData) {
-        params = this.getParam(seachData);
+        this.params = this.getParam(seachData);
       } else {
-        params = {
+        this.params = {
           pageNum: this.currentPage,
           pageSize: this.pageSize,
         };
       }
 
       realTimeApi
-        .findAlarmList(params)
+        .findAlarmList(this.params)
         .then(({ list, total }) => {
           list.forEach((e) => {
             e.AcquitAtStr = this.dateFormat(
               "YYYY-mm-dd HH:MM",
               new Date(e.AcquitAt)
             );
-            e.FanStatusStr = this.FanStatusStr(e.FanStatus);
-            e.FilterStatusStr = this.FanStatusStr(e.FilterStatus);
-            e.OnlineStatusStr = this.OnlineStatusStr(e.OnlineStatus);
-            e.StatusStr = this.StatusStr(e.Status);
+            e.MsgTypeStr = this.MsgTypeStr(e.MsgType);
           });
           this.tableData = list;
           this.totalNum = total;
@@ -117,13 +118,13 @@
             type: "application/vnd.ms-excel;charset=utf-8",
           });
           if (window.navigator.msSaveBlob) {
-            window.navigator.msSaveBlob(blob, deathdate + "瀹炴椂鏁版嵁" + ".xls");
+            window.navigator.msSaveBlob(blob, deathdate + "鎶ヨ淇℃伅" + ".xls");
           } else {
             const url = window.URL.createObjectURL(blob);
             const link = document.createElement("a");
             link.style.display = "none";
             link.href = url;
-            link.download = deathdate + "瀹炴椂鏁版嵁" + ".xls";
+            link.download = deathdate + "鎶ヨ淇℃伅" + ".xls";
             document.body.appendChild(link);
             link.click();
             document.body.removeChild(link);
@@ -135,15 +136,10 @@
     getParam(seachData) {
       let params;
       if (seachData) {
-        const seachParams = seachData.seachData;
+        const seachParams = seachData.seachData || seachData;
         params = {
-          owner: seachParams.owner == undefined ? null : seachParams.owner,
-          onlineStatus:
-            seachParams.onlineStatus == undefined
-              ? null
-              : seachParams.onlineStatus,
-          status: seachParams.status == undefined ? null : seachParams.status,
-          type: seachParams.type == undefined ? null : seachParams.type,
+          msgType:
+            seachParams.msgType == undefined ? null : seachParams.msgType,
           startTime:
             seachParams.alarmTime == undefined
               ? null
@@ -159,6 +155,8 @@
                   seachParams.alarmTime[1]
                 ),
         };
+        params.pageNum = this.currentPage;
+        params.pageSize = this.pageSize;
       }
       return params;
     },
@@ -184,17 +182,17 @@
     // 褰撳墠椤垫敼鍙樿Е鍙戜簨浠�
     changeCurrentPage(page) {
       this.currentPage = page;
-      this.getRealTimeList();
+      this.getAlarmList(this.params);
     },
     // 涓婁竴椤电偣鍑讳簨浠�
     handlePrev(page) {
       this.currentPage = page;
-      this.getRealTimeList();
+      this.getAlarmList(this.params);
     },
     // 涓嬩竴椤电偣鍑讳簨浠�
     handleNext(page) {
       this.currentPage = page;
-      this.getRealTimeList();
+      this.getAlarmList(this.params);
     },
     dateFormat(fmt, date) {
       let ret;

--
Gitblit v1.8.0