소스 검색

2021-12-06 暂时完成了

East 3 년 전
부모
커밋
b0c5d86196
4개의 변경된 파일85개의 추가작업 그리고 37개의 파일을 삭제
  1. 11 2
      src/utils/chenApi.js
  2. 72 33
      src/views/Alarm/AlarmWarn.vue
  3. 1 1
      src/views/Alarm/EnvWarn.vue
  4. 1 1
      src/views/Alarm/SewageWarn.vue

+ 11 - 2
src/utils/chenApi.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-11-18 13:40:39
- * @LastEditTime: 2021-12-06 08:36:46
+ * @LastEditTime: 2021-12-06 14:34:27
  * @LastEditors: Please set LastEditors
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: \hyyfClient\src\utils\chenApi.js
@@ -243,4 +243,13 @@ export function getTodayAlarmRate(params) {
     method: 'get',
     params: params
   })
-}
+}
+
+// 报警信息列表
+export function getAlarmInfo(params) {
+  return axios({
+    url: '/produce/warningInfo/listWarningInfo',
+    method: 'post',
+    data: params
+  })
+}

+ 72 - 33
src/views/Alarm/AlarmWarn.vue

@@ -15,7 +15,8 @@
       :day="day"
       @setDay="setDay"
       @onClickType="onClickType"
-    ></x-form>
+    >
+    </x-form>
     <new-table
       :height="600"
       :title="title"
@@ -23,7 +24,7 @@
       :tableItems="tableItems"
       :shows="tableShows"
     >
-      <template #right>
+      <!-- <template #right>
         <el-button
           size="mini"
           type="primary"
@@ -32,7 +33,7 @@
           @click="digAll"
           >批量处理</el-button
         >
-      </template>
+      </template> -->
       <template #type="scope">
         <span v-if="scope.row.type === 1">环境报警</span>
         <span v-else>设备异常</span>
@@ -110,7 +111,11 @@ import XForm from "@/components/XForm";
 import NewTable from "@/components/newTable/NewTable";
 import TableFooter from "@/components/TableFooter";
 
-import { getOneWeekAlarm, getTodayAlarmRate } from "@/utils/chenApi.js";
+import {
+  getOneWeekAlarm,
+  getTodayAlarmRate,
+  getAlarmInfo,
+} from "@/utils/chenApi.js";
 
 export default {
   name: "AlarmWarn",
@@ -127,15 +132,15 @@ export default {
   data() {
     return {
       selectItems: [
-        {
-          id: 1,
-          type: "select",
-          label: "报警类型:",
-          placeholder: "请选择报警类型",
-          field: "areaId",
-          options: [],
-          col: 5,
-        },
+        // {
+        //   id: 1,
+        //   type: "select",
+        //   label: "报警类型:",
+        //   placeholder: "请选择报警类型",
+        //   field: "areaId",
+        //   options: [],
+        //   col: 5,
+        // },
         {
           id: 3,
           type: "text",
@@ -167,7 +172,7 @@ export default {
         {
           id: 7,
           type: "button",
-          text: "导出数据",
+          text: "查询",
           col: 2,
           click: "derive",
         },
@@ -194,38 +199,38 @@ export default {
       ],
       tableItems: [
         {
-          prop: "time",
+          prop: "warningTime",
           label: "报警时间",
           minWidth: "100",
-          slotName: "time",
+          slotName: "warningTime",
         },
         {
-          prop: "type",
+          prop: "warningName",
           label: "报警类型",
           minWidth: "100",
-          slotName: "type",
+          slotName: "warningName",
         },
         {
-          prop: "class",
-          label: "危险等级",
+          prop: "levelName",
+          label: "报警等级",
           minWidth: "100",
-          slotName: "class",
+          slotName: "levelName",
         },
         {
-          prop: "content",
+          prop: "msg",
           label: "报警内容",
           minWidth: "100",
-          slotName: "content",
-        },
-        {
-          label: "处理结果",
-          minWidth: "100",
-          slotName: "handler",
+          slotName: "msg",
         },
+        // {
+        //   label: "handler",
+        //   minWidth: "100",
+        //   slotName: "handler",
+        // },
       ],
       tableShows: {
         showIndex: false,
-        showSelect: true,
+        showSelect: false,
         defaultProp: "dig",
       },
       total: 0,
@@ -261,18 +266,26 @@ export default {
     // 修改size
     sizeChange(val) {
       this.pageSize = val;
-      this.init();
+      this.pageNum = 1;
+      this.initAlarmInfo();
     },
     // 修改页数
     pageChange(val) {
       this.pageNum = val;
-      this.init();
+      this.initAlarmInfo();
     },
     init() {},
     setDay(data) {
-      this.day = data;
+      this.day = data.type;
+      this.pageNum = 1;
+      this.initAlarmInfo();
+    },
+    onClickType(val) {
+      this.day = 4;
+      this.time = val.data.value1;
+      this.pageNum = 1;
+      this.initAlarmInfo();
     },
-    onClickType() {},
     dig(item) {
       this.digType = true;
       this.dialogVisible = true;
@@ -300,10 +313,36 @@ export default {
         }
       });
     },
+    // 报警列表
+    initAlarmInfo() {
+      let params;
+      if (this.day === 4) {
+        params = {
+          startDate: this.time[0],
+          endDate: this.time[1],
+          type: this.day,
+          current: this.pageNum,
+          size: this.pageSize,
+        };
+      } else {
+        params = {
+          type: this.day,
+          current: this.pageNum,
+          size: this.pageSize,
+        };
+      }
+      getAlarmInfo(params).then((res) => {
+        if (res.code === 10000) {
+          this.list = res.data.records;
+          this.total = res.data.total;
+        }
+      });
+    },
   },
   mounted() {
     this.initOneWeekAlarm(); // bar
     this.initTodayAlarmRate(); // pie
+    this.initAlarmInfo(); // list
   },
 };
 </script>

+ 1 - 1
src/views/Alarm/EnvWarn.vue

@@ -167,7 +167,7 @@ export default {
       });
     },
     setDay(data) {
-      this.day = data;
+      this.day = data.type;
       this.pageNum = 1;
       this.init();
     },

+ 1 - 1
src/views/Alarm/SewageWarn.vue

@@ -166,7 +166,7 @@ export default {
       });
     },
     setDay(data) {
-      this.day = data;
+      this.day = data.type;
       this.pageNum = 1;
       this.init();
     },