Browse Source

已完成

Changpeng Duan 4 năm trước cách đây
mục cha
commit
466c3b6d70
8 tập tin đã thay đổi với 118 bổ sung74 xóa
  1. 12 2
      README.md
  2. 32 31
      src/api/Navs.js
  3. 5 0
      src/api/getApiRes.js
  4. 7 3
      src/components/Task.vue
  5. 12 9
      src/components/signMap.vue
  6. 40 7
      src/views/Main.vue
  7. 2 2
      src/views/signEquip.vue
  8. 8 20
      src/views/task.vue

+ 12 - 2
README.md

@@ -8,11 +8,21 @@
 01/30
 todo
 
+
+
+
+<s>
+1.
 /ScheduledTask/Edit
 接口效果不是编辑,而是直接添加了
 
+2.
+Index/DevList 返回的Level是4
+Index/MonitorArea 有时候返回空值,状态不一致。偶尔复现
 
-
+3.
+DetectorControl/WirelessTaskList
+返回值里range的type是0,改成别的值,0无意义
 
 1.监控区域查询,没有宽高返回值
 2.监控区域删除接口
@@ -22,7 +32,7 @@ todo
 6.检测记录统计图
 7.无线信号统计图
 8.设置(缓)
-
+</s>
 
 ##安装:  
 

+ 32 - 31
src/api/Navs.js

@@ -280,38 +280,39 @@ let navs = [{
                 "icon": "home_icon"
             },
         ]
-    }, {
-        "clmid": "10",
-        "spclmid": "0",
-        "ordno": "1",
-        "c_level": "1",
-        "clmcode": "index",
-        "clmname": "系统设定",
-        "clmurl": "",
-        "prname": "",
-        "en": "1",
-        "show": "1",
-        "grouplist": "2,5",
-        "memo": "",
-        "icon": "icon_setting",
-        "childs": [
-            {
-                "clmid": "61",
-                "spclmid": "0",
-                "ordno": "0",
-                "c_level": "2",
-                "clmcode": "front_index",
-                "clmname": "系统设定",
-                "clmurl": "/setting",
-                "prname": null,
-                "en": "1",
-                "show": "1",
-                "grouplist": "2,5",
-                "memo": null,
-                "icon": "home_icon"
-            },
-        ]
     },
+    // {
+    //     "clmid": "10",
+    //     "spclmid": "0",
+    //     "ordno": "1",
+    //     "c_level": "1",
+    //     "clmcode": "index",
+    //     "clmname": "系统设定",
+    //     "clmurl": "",
+    //     "prname": "",
+    //     "en": "1",
+    //     "show": "1",
+    //     "grouplist": "2,5",
+    //     "memo": "",
+    //     "icon": "icon_setting",
+    //     "childs": [
+    //         {
+    //             "clmid": "61",
+    //             "spclmid": "0",
+    //             "ordno": "0",
+    //             "c_level": "2",
+    //             "clmcode": "front_index",
+    //             "clmname": "系统设定",
+    //             "clmurl": "/setting",
+    //             "prname": null,
+    //             "en": "1",
+    //             "show": "1",
+    //             "grouplist": "2,5",
+    //             "memo": null,
+    //             "icon": "home_icon"
+    //         },
+    //     ]
+    // },
 ];
 
 export default navs;

+ 5 - 0
src/api/getApiRes.js

@@ -286,3 +286,8 @@ export function ScheduledTaskList(postdata) {
     let url = headapi + 'v1/ScheduledTask/List';
     return getApiBasic(url, postdata);
 }
+// 停止无线扫描
+export function WirelessStop(postdata) {
+    let url = headapi + 'v1/DetectorControl/WirelessStop';
+    return getApiBasic(url, postdata);
+}

+ 7 - 3
src/components/Task.vue

@@ -76,7 +76,8 @@
                             信号录制
                         </em></el-col>
                     <el-col :span="12">
-                        <el-button type="primary" plain size="small" @click="startScan">开始扫描</el-button>
+                        <el-button type="primary" plain size="small" @click="startScan" v-if="taskText.IsStop">开始扫描</el-button>
+                        <el-button type="primary" plain size="small" @click="stopScan" v-else>停止扫描</el-button>
                     </el-col>
                 </el-col>
                 <ul class="scan_detail">
@@ -146,6 +147,7 @@
         },
         props: ['taskInfo', 'taskResult'],
         watch: {
+            // 扫描状态加载
             taskResult: {
                 handler(newName, oldName) {
                     this.taskText.BeginAt = newName.BeginAt;
@@ -223,7 +225,6 @@
                         });
                         return false
                     }
-
                     // 0-6G现实范围
                     if (newName.agreement.indexOf(13) > -1) {
                         this.scopeState = true
@@ -268,7 +269,6 @@
                         "type": that.scan.agreement[i]
                     }
                 }
-
                 let Rs = {
                     duration:parseInt(this.scan.duration),
                     freq06G: freq06G,
@@ -278,6 +278,10 @@
                 };
                 this.$emit('GetScanClick', Rs);//触发事件
             },
+            // 停止扫描
+            stopScan(){
+                this.$emit('stopScan');//触发事件
+            },
             getScanStrategyDetail() {
                 let that = this;
                 let param = {

+ 12 - 9
src/components/signMap.vue

@@ -13,14 +13,14 @@
                  @click="cancle_screen"/>
         </div>
         <div :class="[{'signMapList':true},{'full_state':full_state}]">
-            <div class="tips" v-if="scan == ''">
+            <div class="tips" v-if="scanState">
                 <span>请开始扫描</span>
             </div>
-            <div class="signMapListBg">
+            <div class="signMapListBg" >
                 <span v-for="s in scan"
                       :style="{ left: s.X*ruleX - errorX +'PX', top: s.Y *ruleY - errorY +'PX'}"
                 >
-                             <em class="types" @click="showToast(s.popover)" @mouseover="showToast(s.popover)">
+                             <em class="types" @click="showToast(s.popover)" @mouseover="showToast(s.popover)"  v-if="!scanState">
                                  <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"
@@ -95,7 +95,8 @@
                 screen_full: false,
                 checked: true,
                 full_state: false,
-                scan: [],
+                scanState:false,
+                scan: {},
                 XMax: 56,
                 YMax: 56,
                 xLimit: 2,
@@ -115,15 +116,17 @@
                     if (!newName.Rs) {
                         return false
                     }
-                    this.scan = newName.Rs.Data;
-                    this.XMax = newName.Rs.XMax;
-                    this.YMax = newName.Rs.YMax;
+                    this.scanState = newName.Rs.IsStop;
+                    console.log(  this.scanState);
+                    this.scan = newName.Rs.Chart.Data;
+                    this.XMax = newName.Rs.Chart.XMax;
+                    this.YMax = newName.Rs.Chart.YMax;
                     this.xLimit = parseInt(this.XMax / 28);
                     this.yLimit = parseInt(this.YMax / 12);
                     let Oem = "未知";
                     let Ssid = "未知";
-                    if (this.scan) {
-                        this.scan.map(function (item) {
+                    if (this.scan.Chart) {
+                        this.scan.Chart.map(function (item) {
                             Oem = item.Oem == '' ? "未知" : item.Oem;
                             Ssid = item.Ssid == '' ? "未知" : item.Ssid;
                             item.popover = "品牌:" + Oem + " SSID:" + Ssid;

+ 40 - 7
src/views/Main.vue

@@ -11,7 +11,8 @@
                 <Detecter :detecter-list="detectorList"></Detecter>
             </div>
             <div class="cube">
-                <Task :task-info="taskInfo" :task-result="taskResult" @GetScanClick="ClickGetScan"></Task>
+                <Task :task-info="taskInfo" :task-result="taskResult" @GetScanClick="ClickGetScan"
+                      @stopScan="clickStopScan"></Task>
             </div>
         </div>
         <div :class="[{'md':true},{'bigMd':!showLeft}]">
@@ -83,6 +84,7 @@
         WirelessStatus,
         ScanStrategyList,
         WirelessStart,
+        WirelessStop,
     } from '../api/getApiRes.js'
     import {mapGetters, mapActions, mapState} from "vuex";
     import Global from "../Global"
@@ -95,8 +97,8 @@
                 WifiRs: {},
                 ScanRs: {},
                 signList: {
-                    title:'',
-                    Rs:null
+                    title: '',
+                    Rs: ''
                 },
                 totalRs: [],
                 equipRs: [],
@@ -259,6 +261,39 @@
                     }
                 })
             },
+            clickStopScan() {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    regionId: that.CurrentRegionId,
+                };
+                let postdata = qs.stringify(param);
+                this.$confirm('此操作将停止该区域扫描, 是否继续?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    WirelessStop(postdata).then(res => {
+                        let json = res;
+                        if (json.Code == 0) {
+                            that.$message({
+                                showClose: true,
+                                message: '区域扫描已停止!',
+                                type: 'success'
+                            });
+                            this.ClickGetInfo(that.CurrentRegionId, this.selectName )
+
+                        } else {
+                            that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                        }
+                    });
+                }).catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消停止区域扫描'
+                    });
+                });
+            },
             showScanRresult(Rs) {
                 let that = this;
                 that.dialogScanVisible = true;
@@ -292,15 +327,13 @@
                 MonitorArea(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
-                        if (!json.Rs.Data) {
+                        if (!json.Rs.Chart.Data) {
                             return false
                         } else {
                             that.signList.Rs = json.Rs;
                         }
                     } else {
-                        that.signList.Rs = {
-                                Data: []
-                        };
+                        that.signList.Rs = '';
                         that.$message.error(json.Memo);
                     }
                 })

+ 2 - 2
src/views/signEquip.vue

@@ -370,7 +370,7 @@
                         that.loading = false;
                         if (json.Rs) {
                             that.allTableData = json.Rs;
-                            that.recordsTotal = json.Rs.length;
+                            that.recordsTotal = json.AllCount;
                         } else {
                             that.allTableData = [];
                             that.recordsTotal = 0;
@@ -542,7 +542,7 @@
                     this.tableData = tables;
                 }
                 that.start = index * that.draw;
-                // that.getTableQuery();
+                that.getTableQuery();
             },
             // 自动排序
             sortChange(params) {

+ 8 - 20
src/views/task.vue

@@ -129,20 +129,6 @@
                     <span v-if="scope.row.Status == 3" style="color: white">无任务</span>
                 </template>
             </el-table-column>
-            <!--<el-table-column-->
-            <!--prop="address"-->
-            <!--label="操作记录"-->
-            <!--width="220"-->
-            <!--&gt;-->
-            <!--<template slot-scope="scope">-->
-            <!--&lt;!&ndash;<el-button class="" type="text" @click="goPhoneRecord(scope.row)">手机信号记录</el-button>&ndash;&gt;-->
-            <!--<el-button class="" type="primary" size="small" @click="goWifiRecord(scope.row)">监测记录</el-button>-->
-            <!--&lt;!&ndash;<el-button v-if="scope.row.Status == 1" class="yellow" type="text" @click="pauseRow(scope.row)">禁用&ndash;&gt;-->
-            <!--&lt;!&ndash;</el-button>&ndash;&gt;-->
-            <!--&lt;!&ndash;<el-button v-if="scope.row.Status == 0" class="green" type="text" @click="runRow(scope.row)">启用&ndash;&gt;-->
-            <!--&lt;!&ndash;</el-button>&ndash;&gt;-->
-            <!--</template>-->
-            <!--</el-table-column>-->
         </el-table>
         <br>
         <el-pagination
@@ -303,12 +289,14 @@
                         if (json.Rs) {
                             // 把起始频率回填 todo
                             json.Rs.map(function (item) {
-                                item.Config.SignalList.map(function (row) {
-                                    if (row.Type == 13) {
-                                        row.begin = item.Config.Scan06GRange[0].Begin;
-                                        row.end = item.Config.Scan06GRange[0].End;
-                                    }
-                                })
+                                if(  item.Config.SignalList){
+                                    item.Config.SignalList.map(function (row) {
+                                        if (row.Type == 13) {
+                                            row.begin = item.Config.Scan06GRange[0].Begin;
+                                            row.end = item.Config.Scan06GRange[0].End;
+                                        }
+                                    })
+                                }
                             });
 
                             that.allTableData = json.Rs;