Changpeng Duan 4 år sedan
förälder
incheckning
7b3d1ae416

+ 5 - 0
src/api/getApiRes.js

@@ -171,3 +171,8 @@ export function ScanStrategyList(postdata) {
     let url = headapi + 'v1/ScanStrategy/List';
     return getApiBasic(url, postdata);
 }
+// 扫描策略详情
+export function ScanStrategyDetail(postdata) {
+    let url = headapi + 'v1/ScanStrategy/Detail';
+    return getApiBasic(url, postdata);
+}

BIN
src/assets/img/main/false.png


BIN
src/assets/img/main/true.png


+ 94 - 30
src/components/Task.vue

@@ -14,7 +14,7 @@
                 <el-col :span="24">
                     <el-col :span="6"><em class="label">扫描策略</em></el-col>
                     <el-col :span="18">
-                        <el-select v-model="scan.tactics" placeholder="请选择">
+                        <el-select v-model="scan.tactics" placeholder="请选择" @change="getScanStrategyDetail">
                             <el-option
                                     v-for="item in tactics_options"
                                     :key="item.Id"
@@ -63,10 +63,13 @@
                     </el-col>
                 </el-col>
                 <el-col :span="24">
-                    <el-col :span="6"><em class="label_checked">
-                        <el-checkbox v-model="isRecording">信号录制</el-checkbox>
-                    </em></el-col>
-                    <el-col :span="18">
+                    <el-col :span="12">
+                        <em class="label_checked" @click="turnRecord">
+                            <img src="../assets/img/main/true.png" height="15" width="15" v-if="recordState"/>
+                            <img src="../assets/img/main/false.png" height="15" width="15" v-else/>
+                            信号录制
+                        </em></el-col>
+                    <el-col :span="12">
                         <el-button type="primary" plain size="small" @click="startScan">开始扫描</el-button>
                     </el-col>
                 </el-col>
@@ -95,13 +98,20 @@
 
 <script>
     import Global from "../Global"
+    import {
+        ScanStrategyDetail,
+    } from '../api/getApiRes.js'
 
     let qs = require('qs');
     export default {
         data() {
             return {
+                items: [{
+                    state: 1
+                }],
                 scopeState: false,
-                isRecording: true,
+                isRecording: 1,
+                recordState: true,
                 scan: {
                     tactics: 0,
                     agreement: [],
@@ -117,18 +127,18 @@
                         Name: '自定义扫描'
                     }
                 ],
-                taskText:{
-                    BeginAt:'',
-                    DataSize:'0',
-                    Duration:'',
-                    IsStop:false,
+                taskText: {
+                    BeginAt: '',
+                    DataSize: '0',
+                    Duration: '',
+                    IsStop: false,
                 },
                 agreement_options: WirelessType(),
                 distance_options: WirelessRange(),
                 value: ''
             }
         },
-        props: ['taskInfo','taskResult'],
+        props: ['taskInfo', 'taskResult'],
         watch: {
             taskResult: {
                 handler(newName, oldName) {
@@ -142,8 +152,16 @@
             },
             taskInfo: {
                 handler(newName, oldName) {
-                    if(!newName.length) return false;
-                    this.tactics_options = newName;
+                    if (!newName.length) return false;
+                    this.tactics_options = [
+                        {
+                            Id: 0,
+                            Name: '自定义扫描'
+                        }
+                    ];
+                    for (var i = 0; i < newName.length; i++) {
+                        this.tactics_options.push(newName[i]);
+                    }
                 },
                 deep: true,
                 immediate: true
@@ -199,21 +217,25 @@
             }
         },
         methods: {
+            turnRecord(){
+                console.log(123);
+                this.recordState = !this.recordState
+            },
             // 扫描开始
             startScan() {
                 let that = this;
-                let freq06G =[];
-                let signalList =[];
+                let freq06G = [];
+                let signalList = [];
                 let token = localStorage.token;
-                if(that.scan.begin > 0){
+                if (that.scan.begin > 0) {
                     freq06G = [
                         {
-                            begin:parseInt(that.scan.begin),
+                            begin: parseInt(that.scan.begin),
                             end: parseInt(that.scan.end)
                         }
                     ]
                 }
-                if(that.scan.agreement.length == 0){
+                if (that.scan.agreement.length == 0) {
                     that.$message({
                         showClose: true,
                         message: '无线协议不能为空!',
@@ -221,7 +243,7 @@
                     });
                     return false
                 }
-                for(var i = 0; i < that.scan.agreement.length; i++) {
+                for (var i = 0; i < that.scan.agreement.length; i++) {
                     signalList[i] = {
                         "range": that.scan.distance,
                         "type": that.scan.agreement[i]
@@ -229,17 +251,51 @@
                 }
 
                 let Rs = {
-                    freq06G:freq06G,
-                    isRecording:this.isRecording,
-                    signalList:signalList,
+                    freq06G: freq06G,
+                    isRecording: this.recordState,
+                    signalList: signalList,
                     token: token
                 };
                 this.$emit('GetScanClick', Rs);//触发事件
             },
+            getScanStrategyDetail() {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    id: this.scan.tactics
+                };
+                let postdata = qs.stringify(param);
+                ScanStrategyDetail(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        // 无线协议
+                        that.scan.agreement = [];
+                        let row = '';
+                        for (var i = 0; i < json.Rs.Value.SignalList.length; i++) {
+                            row = json.Rs.Value.SignalList[i];
+                            that.scan.agreement.push(row.Type)
+                        }
+
+                        // 起始频率 与 截止频率
+                        if (json.Rs.Value.Freq06G[0]) {
+                            that.scan.begin = json.Rs.Value.Freq06G[0].Begin;
+                            that.scan.end = json.Rs.Value.Freq06G[0].End;
+                        }
+
+                        // 扫描距离
+                        that.scan.distance = json.Rs.Value.SignalList[0].Range;
+
+                        // 是否录制
+                        console.log(json.Rs.Value.IsRecording);
+                        that.recordState = json.Rs.Value.IsRecording;
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            }
         },
         filters: {
             filterIsStop: function (value) {
-                console.log(value);
                 if (!value) {
                     return "扫描中"
                 } else {
@@ -284,17 +340,19 @@
         overflow-y: scroll;
     }
 
-    .regionList::-webkit-scrollbar {/*滚动条整体样式*/
-        width: 5px;     /*高宽分别对应横竖滚动条的尺寸*/
+    .regionList::-webkit-scrollbar { /*滚动条整体样式*/
+        width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
         height: 1px;
     }
-    .regionList::-webkit-scrollbar-thumb {/*滚动条里面小方块*/
+
+    .regionList::-webkit-scrollbar-thumb { /*滚动条里面小方块*/
         border-radius: 5px;
-        -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
+        -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
         background: #6DC1FF;
     }
-    .regionList::-webkit-scrollbar-track {/*滚动条里面轨道*/
-        -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
+
+    .regionList::-webkit-scrollbar-track { /*滚动条里面轨道*/
+        -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
         border-radius: 5px;
         background: #6DC1FF;
     }
@@ -322,8 +380,13 @@
     }
 
     .label_checked {
+        width: 50%;
+        float: left;
         margin-left: 45px;
         line-height: 40px;
+        color: #fff;
+        font-size: 14px;
+        cursor: pointer;
     }
 
     .regionList button {
@@ -373,6 +436,7 @@
         color: #fff;
         margin-bottom: 3px;
     }
+
     /deep/ .el-tag.el-tag--info {
         float: left;
     }

+ 17 - 13
src/components/signMap.vue

@@ -20,7 +20,7 @@
                 <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)">
+                             <em class="types" @click="showToast(s.popover)" @mouseover="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"
@@ -45,17 +45,16 @@
                                       v-if="s.WirelessType == 11"/>
                                  <img src="../assets/img/signMap/800M.png" height="54" width="54"
                                       v-if="s.WirelessType == 12"/>
-
-                                    <img src="../assets/img/main/unknow.png" height="54" width="54"
-                                         v-if="s.WirelessType == 20"/>
-                                    <img src="../assets/img/main/cam.png" height="54" width="54"
-                                         v-if="s.WirelessType == 21"/>
-                                    <img src="../assets/img/main/unknow_w.png" height="54" width="54"
-                                         v-if="s.WirelessType == 22"/>
-                                    <img src="../assets/img/main/phone.png" height="54" width="54"
-                                         v-if="s.WirelessType == 23"/>
-                                    <img src="../assets/img/main/wifi_w.png" height="54" width="54"
-                                         v-if="s.WirelessType == 24"/>
+                                <img src="../assets/img/main/unknow.png" height="54" width="54"
+                                     v-if="s.WirelessType == 20"/>
+                                <img src="../assets/img/main/cam.png" height="54" width="54"
+                                     v-if="s.WirelessType == 21"/>
+                                <img src="../assets/img/main/unknow_w.png" height="54" width="54"
+                                     v-if="s.WirelessType == 22"/>
+                                <img src="../assets/img/main/phone.png" height="54" width="54"
+                                     v-if="s.WirelessType == 23"/>
+                                <img src="../assets/img/main/wifi_w.png" height="54" width="54"
+                                     v-if="s.WirelessType == 24"/>
                              </em>
                                 <s :class="[
                                 {'yd':s.WirelessType == 1 || s.WirelessType == 4 || s.WirelessType == 6},
@@ -116,7 +115,6 @@
                     if (!newName.Rs) {
                         return false
                     }
-                    console.log(newName);
                     this.scan = newName.Rs.Data;
                     this.XMax = newName.Rs.XMax;
                     this.YMax = newName.Rs.YMax;
@@ -129,6 +127,12 @@
                             Oem = item.Oem == '' ? "未知" : item.Oem;
                             Ssid = item.Ssid == '' ? "未知" : item.Ssid;
                             item.popover = "品牌:" + Oem + " SSID:" + Ssid;
+                            if (item.X < 0) {
+                                item.X = 10
+                            }
+                            if (item.Y < 0) {
+                                item.Y = 50
+                            }
                             // + "X:" + item.X + " Y:" + item.Y
                         })
                     }

+ 2 - 2
src/router/index.js

@@ -236,8 +236,8 @@ router.beforeEach((to, from, next) => {
         next();
     } else {
         //如果token存在,就正常跳转,如果不存在,则说明未登陆,则跳转到'login'
-        // isLogin ? next() : next("/login");
-        next();
+        isLogin ? next() : next("/login");
+        // next();
     }
 });
 

+ 3 - 8
src/views/Main.vue

@@ -46,10 +46,10 @@
             </transition>
         </div>
 
-        <el-dialog title="扫描结果" :visible.sync="dialogScanVisible" width="30%">
+        <el-dialog title="扫描设备启动状态" :visible.sync="dialogScanVisible" width="30%">
             <el-table :data="scanGridData">
                 <el-table-column property="Name" label="设备" align="center"></el-table-column>
-                <el-table-column property="State" label="结果" align="center"></el-table-column>
+                <el-table-column property="State" label="启动状态" align="center"></el-table-column>
             </el-table>
             <div slot="footer" class="dialog-footer">
                 <el-button @click="dialogScanVisible = false" size="small" type="primary">关闭</el-button>
@@ -370,12 +370,7 @@
                 ScanStrategyList(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
-                        json.Rs.push({
-                            Id: 0,
-                            Name: '自定义扫描'
-                        });
-                        // todo
-                        // this.taskInfo = json.Rs;
+                        this.taskInfo = json.Rs;
                     } else {
                         this.taskInfo = [];
                         that.$message.error(json.Memo);