Changpeng Duan 4 anni fa
parent
commit
1fa28cac65
4 ha cambiato i file con 44 aggiunte e 31 eliminazioni
  1. 9 3
      src/Global.js
  2. 2 1
      src/components/Task.vue
  3. 21 12
      src/components/signMap.vue
  4. 12 15
      src/views/Main.vue

+ 9 - 3
src/Global.js

@@ -391,15 +391,21 @@ filterTimeToString = function (value) {
     return result;
 };
 filterTimeToShortString = function (value) {
-    let date = new Date(value);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
+    let date = new Date(value - 8 * 60 * 60 * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
     let year = date.getFullYear(),
         month = ("0" + (date.getMonth() + 1)).slice(-2),
-        sdate = ("0" + date.getDate()).slice(-2),
+        sdate = ("0" + (date.getDate() - 1)).slice(-2),
         hour = ("0" + date.getHours()).slice(-2),
         minute = ("0" + date.getMinutes()).slice(-2),
         second = ("0" + date.getSeconds()).slice(-2);
     // 拼接
-    let result =  hour + ":" + minute + ":" + second;
+    let result = '';
+    if (date.getDate() > 1) {
+        result = sdate + '天 ' + hour + ":" + minute + ":" + second;
+    } else {
+        result = hour + ":" + minute + ":" + second;
+    }
+
     // 返回
     return result;
 };

+ 2 - 1
src/components/Task.vue

@@ -239,7 +239,8 @@
         },
         filters: {
             filterIsStop: function (value) {
-                if (value) {
+                console.log(value);
+                if (!value) {
                     return "扫描中"
                 } else {
                     return "已停止";

+ 21 - 12
src/components/signMap.vue

@@ -20,14 +20,7 @@
                 <span v-for="s in scan"
                       :style="{ left: s.X*ruleX - errorX +'PX', top: s.Y *ruleY - errorY +'PX'}"
                 >
-                      <el-popover
-                              placement="top-start"
-                              title="详细信息"
-                              width="200"
-                              trigger="hover"
-                              :content="s.popover">
-                        <div slot="reference">
-                             <em class="types">
+                             <em class="types" @click="showToast(s.popover)">
                                  <img src="../assets/img/signMap/ydgsm.png" height="54" width="54"
                                       v-if="s.WirelessType == 1"/>
                                  <img src="../assets/img/signMap/ltgsm.png" height="54" width="54"
@@ -71,8 +64,6 @@
                                 {'qt':s.WirelessType == 9 || s.WirelessType == 10 || s.WirelessType == 11|| s.WirelessType == 12},
                                 ]"
                                 >{{s.WirelessType | typeName}}</s>
-                        </div>
-                     </el-popover>
                 </span>
             </div>
             <div class="right_rule">
@@ -83,6 +74,16 @@
                 <span>0</span>
                 <span v-for="i in XMax" v-if="i % xLimit == 0">{{i}}</span>
             </div>
+            <el-dialog
+                    title="提示"
+                    :visible.sync="dialogVisible"
+                    width="30%"
+            >
+                <span>{{dialogText}}</span>
+                <span slot="footer" class="dialog-footer">
+    <el-button @click="dialogVisible = false" size="mini" type="primary">关闭</el-button>
+  </span>
+            </el-dialog>
         </div>
     </div>
 </template>
@@ -91,6 +92,7 @@
     export default {
         data() {
             return {
+                dialogVisible: false,
                 screen_full: false,
                 checked: true,
                 full_state: false,
@@ -104,15 +106,17 @@
                 errorX: 20,
                 errorY: 20,
                 title: '扫描结果',
+                dialogText: '',
             }
         },
         props: ['signList'],
         watch: {
             signList: {
                 handler(newName, oldName) {
-                    if(!newName.Rs){
+                    if (!newName.Rs) {
                         return false
                     }
+                    console.log(newName);
                     this.scan = newName.Rs.Data;
                     this.XMax = newName.Rs.XMax;
                     this.YMax = newName.Rs.YMax;
@@ -124,7 +128,8 @@
                         this.scan.map(function (item) {
                             Oem = item.Oem == '' ? "未知" : item.Oem;
                             Ssid = item.Ssid == '' ? "未知" : item.Ssid;
-                            item.popover = "品牌:" + Oem + " SSID:" + Ssid + "X:" + item.X + " Y:" + item.Y
+                            item.popover = "品牌:" + Oem + " SSID:" + Ssid;
+                            // + "X:" + item.X + " Y:" + item.Y
                         })
                     }
                 },
@@ -188,6 +193,10 @@
                     notice.notice_show("浏览器不支持全屏API或已被禁用", null, null, null, true, true);
                 }
             },
+            showToast(text) {
+                this.dialogVisible = true;
+                this.dialogText = text;
+            }
         },
         filters: {
             typeName: function (value) {

+ 12 - 15
src/views/Main.vue

@@ -235,7 +235,6 @@
             ClickGetInfo(Id, name) {
                 this.selectName = name;
                 this.signList.title = name;
-                console.log( this.signList);
                 this.CurrentRegionId = Id;
                 this.getDetectorList(Id);
                 this.getRegion06G(Id);
@@ -292,20 +291,18 @@
                 let postdata = qs.stringify(param);
                 MonitorArea(postdata).then(res => {
                     let json = res;
-                    // if (json.Code == 0) {
-                    //     if (!json.Rs.Data) {
-                    //         return false
-                    //     } else {
-                    //         that.signList = json;
-                    //     }
-                    // } else {
-                    //     that.signList = {
-                    //         Rs: {
-                    //             Data: []
-                    //         }
-                    //     };
-                        // that.$message.error(json.Memo);
-                    // }
+                    if (json.Code == 0) {
+                        if (!json.Rs.Data) {
+                            return false
+                        } else {
+                            that.signList.Rs = json.Rs;
+                        }
+                    } else {
+                        that.signList.Rs = {
+                                Data: []
+                        };
+                        that.$message.error(json.Memo);
+                    }
                 })
             },
             getNetDevMonitor(id) {