From bbe33e5fd87e5961fdab804bfb0b4cf354e0c5b2 Mon Sep 17 00:00:00 2001
From: ZZJ <zzjdsg2300@163.com>
Date: 星期三, 24 十一月 2021 10:00:17 +0800
Subject: [PATCH] 地图接口

---
 src/pages/internetEquipment/module/historyModule.vue |  179 +++++++++++++++++++++++++++++++----------------------------
 1 files changed, 94 insertions(+), 85 deletions(-)

diff --git a/src/pages/internetEquipment/module/historyModule.vue b/src/pages/internetEquipment/module/historyModule.vue
index 874b256..ce928fe 100644
--- a/src/pages/internetEquipment/module/historyModule.vue
+++ b/src/pages/internetEquipment/module/historyModule.vue
@@ -1,104 +1,113 @@
 <template>
   <div class="history-module">
-      <div class="title">鍘嗗彶鎶ヨ</div>
-      <div class="history-item" 
-      v-for="(item,index) in warnArrProcess"
-      :key="index">
-        <warnDescription  
-        :warnDes="{code:item.code,
-        time:item.time,
-        warn:item.warn}"/>
-        <div 
-        class="button" 
-        @click="process(item)">澶勭悊</div>
-      </div>
-      <processWarn 
-      v-if="activeWarn" 
-      :warnObj="activeWarn" 
-      @close="close" 
-      @save="save"/>
-      <div class="mask"  v-if="activeWarn"/>
+    <div class="title">鍘嗗彶鎶ヨ</div>
+    <div
+      class="history-item"
+      v-for="(item, index) in warnArrProcess"
+      :key="index"
+    >
+      <warnDescription
+        :warnDes="{
+          code: item.device_sn,
+          time: item.updated_at,
+          warn: item.isLowBattery == 1 ? '浣庣數閲忛璀�' : '瀹炴椂鎶撴媿棰勮',
+        }"
+      />
+      <div class="button" @click="process(item)">澶勭悊</div>
+    </div>
+    <processWarn
+      v-if="activeWarn"
+      :warnObj="activeWarn"
+      @close="close"
+      @save="save"
+    />
+    <div class="mask" v-if="activeWarn" />
   </div>
 </template>
 
 <script>
-import warnDescription from '@/pages/internetEquipment/components/warnDescription'
-import processWarn from '@/pages/internetEquipment/components/processWarn'
+import warnDescription from "@/pages/internetEquipment/components/warnDescription";
+import processWarn from "@/pages/internetEquipment/components/processWarn";
+import { handleWarn } from "@/api/helemt";
+
 export default {
-    data (){
-        return {
-            activeWarn:null
-        }
+  data() {
+    return {
+      activeWarn: null,
+    };
+  },
+  props: {
+    warnArr: {
+      type: Array,
     },
-    props :{
-        warnArr : {
-            type: Array
-        }
+  },
+  components: {
+    warnDescription,
+    processWarn,
+  },
+  computed: {
+    warnArrProcess() {
+      return this.warnArr.filter((item) => item.status != 1);
     },
-    components :{
-        warnDescription,
-        processWarn
+  },
+  methods: {
+    process(item) {
+      this.activeWarn = item;
     },
-    computed :{
-        warnArrProcess(){
-            return this.warnArr.filter(item=>!item.processed)
-        }
+    close() {
+      this.activeWarn = null;
     },
-    methods: {
-        process(item){
-            this.activeWarn = item
-        },
-        close(){
-            this.activeWarn =null
-        },
-        save(item) {
-            this.$set(item,'processed',true)
-            this.close()
-        }
-    }
-}
+    save(item) {
+      console.log(item);
+      handleWarn({ id: item.id }).then((res) => {
+        this.$set(item, "status", 1);
+        this.close();
+      });
+    },
+  },
+};
 </script>
 
 <style scoped lang="scss">
 .history-module {
-    padding: 20px;
-    width: 280px;
-    height: 292px;
-    background-color: #fff;
-    box-shadow: 0px 2px 10px rgba(141, 164, 187, 0.25);
-    border-radius: 15px;
-    overflow-y: scroll;
+  padding: 20px;
+  width: 280px;
+  height: 292px;
+  background-color: #fff;
+  box-shadow: 0px 2px 10px rgba(141, 164, 187, 0.25);
+  border-radius: 15px;
+  overflow-y: scroll;
 
-    .title {
-        margin-bottom: 10px;
-        font-size: 14px;
-        font-weight: 700;
-        text-align: left;
+  .title {
+    margin-bottom: 10px;
+    font-size: 14px;
+    font-weight: 700;
+    text-align: left;
+  }
+
+  .history-item {
+    display: flex;
+    width: 240px;
+    height: 74px;
+    margin-bottom: 4px;
+    align-items: center;
+    justify-content: space-between;
+    background: #f9fafc;
+    border-radius: 10px;
+    padding: 0 10px;
+    .button {
+      width: 54px;
+      height: 20px;
+      background: #cfeee0;
+      border-radius: 30px;
+      font-size: 12px;
+      line-height: 20px;
+      color: #11aa66;
+      cursor: pointer;
     }
+  }
 
-    .history-item {
-        display: flex;
-        width: 240px;
-        height: 74px;
-        margin-bottom: 4px;
-        align-items: center;
-        justify-content: space-between;
-        background: #F9FAFC;
-        border-radius: 10px;
-        padding: 0 10px;
-        .button {
-            width: 54px;
-            height: 20px;
-            background: #CFEEE0;
-            border-radius: 30px;
-            font-size: 12px;
-            line-height: 20px;
-            color: #11AA66;
-            cursor: pointer;
-        }
-    }
-
-    .mask {
+  .mask {
     position: fixed;
     top: 0;
     bottom: 0;
@@ -107,7 +116,7 @@
     text-align: center;
     z-index: 1;
     background-color: black;
-    opacity: .5;
-    }
+    opacity: 0.5;
+  }
 }
 </style>
\ No newline at end of file

--
Gitblit v1.8.0