“yueshang” 2 år sedan
förälder
incheckning
d63b9318eb
1 ändrade filer med 44 tillägg och 24 borttagningar
  1. 44 24
      src/views/index.vue

+ 44 - 24
src/views/index.vue

@@ -95,7 +95,6 @@
             <bm-info-window
               :show="marker.show"
               :position="{ lng: marker.lng, lat: marker.lat }"
-
               @open="infoWindowOpen(marker)"
               @mouseout="infoWindowClose(marker)"
             >
@@ -138,10 +137,21 @@
                 </div>
               </div>
               <div v-else class="tankuang">
-                  <div v-if="iseyi!='noeyi'"><span class="dian-show">当前位置有恶意</span>{{ dianShow.type }}</div>
-                  <div><span class="dian-show">名称:</span>  {{ dianShow.name }}</div>
-                  <div v-if="iseyi!='noeyi'"><span class="dian-show">恶意类型:</span>  {{ dianShow.keyword }}</div>
-                  <div>{{ dianShow.time }}</div>
+                <div v-if="iseyi != 'noeyi'">
+                  <span class="dian-show">当前位置有恶意</span
+                  >{{ dianShow.type }}
+                </div>
+                <div>
+                  <span class="dian-show">名称:</span> {{ dianShow.name }}
+                </div>
+                <div>
+                  <span class="dian-show">Mac地址:</span> {{ dianShow.mac }}
+                </div>
+                <div v-if="iseyi != 'noeyi'">
+                  <span class="dian-show">恶意类型:</span>
+                  {{ dianShow.keyword }}
+                </div>
+                <div>{{ dianShow.time }}</div>
               </div>
             </bm-info-window>
           </bm-marker>
@@ -177,7 +187,7 @@
               <div class="title">恶意动态</div>
               <div
                 class="cont"
-                @click="lookPosition(items,'eyi')"
+                @click="lookPosition(items, 'eyi')"
                 v-for="(items, indexs) in realTimeDataY"
                 :key="indexs"
                 style="float: left"
@@ -208,7 +218,7 @@
               <div class="title">上报动态</div>
               <div
                 class="cont"
-                @click="lookPosition(items,'noeyi')"
+                @click="lookPosition(items, 'noeyi')"
                 v-for="(items, indexs) in realTimeDataN"
                 :key="indexs"
               >
@@ -276,7 +286,7 @@ export default {
       start: "",
       end: "",
       dianShow: {},
-      iseyi:''
+      iseyi: "",
     };
   },
   created() {
@@ -287,7 +297,7 @@ export default {
     // 头部数据
     this.getInfo();
     //实时信号
-    // this.realTimeInfo();
+    this.realTimeInfo();
     setInterval(() => {
       this.getInfo();
     }, 5 * 60 * 1000);
@@ -301,7 +311,7 @@ export default {
       window.WSObj.regWsCall("getxy", function (data) {
         if (data.illegal == "Y") {
           _this.realTimeDataY.unshift(data);
-          _this.$modal.msgError("发现一条恶意信息");
+          _this.$modal.msgError(`发现恶意${data.type} ${data.name} ${data.mac} ${data.time} `);
         } else if (data.illegal == "N") {
           _this.realTimeDataN.unshift(data);
         }
@@ -313,16 +323,26 @@ export default {
   mounted() {},
   methods: {
     //实时数据
-    // realTimeInfo() {
-    //   realTimeInfo().then((res) => {
-    //     this.realTimeData = res;
-    //     // this.$forceUpdate();
-    //   });
-    // },
-    lookPosition(items,iseyi) {
-        this.iseyi=iseyi
-      this.dianShow=items
-      console.log('itemssssssssss', items)
+    realTimeInfo() {
+      realTimeInfo().then((res) => {
+        console.log("resrealTimeInfo", res);
+        res.map((data) => {
+          {
+            if (data.illegal == "Y") {
+              this.realTimeDataY.unshift(data);
+            } else if (data.illegal == "N") {
+              this.realTimeDataN.unshift(data);
+            }
+            this.$forceUpdate();
+          }
+        });
+        // this.$forceUpdate();
+      });
+    },
+    lookPosition(items, iseyi) {
+      this.iseyi = iseyi;
+      this.dianShow = items;
+      console.log("itemssssssssss", items);
       if (items.lat == null || items.lng == null) {
         this.$message.error("坐标错误!");
         return;
@@ -377,7 +397,7 @@ export default {
     infoWindowClose(marker) {
       this.topData.info = this.topData.info.filter((i) => i.identify != 1);
       marker.show = false;
-      this.dianShow={}
+      this.dianShow = {};
       this.$forceUpdate();
     },
     //鼠标移动到点位上显示点位信息
@@ -670,7 +690,7 @@ export default {
 //实时信号
 .real-signal,
 .real-signal-n {
-  height: 252px;
+  height: 310px;
   overflow-y: auto;
   width: 400px;
   right: 24px;
@@ -721,9 +741,9 @@ export default {
 }
 .real-signal-n {
   right: 24px;
-  top: 300px;
+  top: 340px;
 }
-.dian-show{
+.dian-show {
   width: 150px;
 }
 </style>