Procházet zdrojové kódy

信号图表
添加策略增加持续时间

Changpeng Duan před 4 roky
rodič
revize
7264299741
3 změnil soubory, kde provedl 125 přidání a 3 odebrání
  1. 22 0
      src/components/Task.vue
  2. 59 1
      src/views/addTactics.vue
  3. 44 2
      src/views/signEquip.vue

+ 22 - 0
src/components/Task.vue

@@ -49,6 +49,12 @@
                         <el-input v-model="scan.end" placeholder="单位100K"></el-input>
                     </el-col>
                 </el-col>
+                <el-col :span="24">
+                    <el-col :span="6"><em class="label">持续时间</em></el-col>
+                    <el-col :span="18">
+                        <el-input v-model="scan.duration" type="number" placeholder="单位 秒"></el-input>
+                    </el-col>
+                </el-col>
                 <el-col :span="24">
                     <el-col :span="6"><em class="label">扫描距离</em></el-col>
                     <el-col :span="18">
@@ -119,6 +125,7 @@
                     end: 0,
                     distance: 1,
                     cycle: 0,
+                    duration: 0,
                 },
                 tactics_options: [
                     {
@@ -195,6 +202,20 @@
                         });
                         return false
                     }
+                    if (parseInt(newName.duration) < 0) {
+                        this.$notify.error({
+                            title: '错误',
+                            message: '持续时间不能小于0'
+                        });
+                        return false
+                    }
+                    if (parseInt(newName.duration) > 86400) {
+                        this.$notify.error({
+                            title: '错误',
+                            message: '持续时间不能超过86400秒(24小时)'
+                        });
+                        return false
+                    }
                     if (parseInt(newName.end) < parseInt(newName.begin)) {
                         this.$notify.error({
                             title: '错误',
@@ -249,6 +270,7 @@
                 }
 
                 let Rs = {
+                    duration:parseInt(this.scan.duration),
                     freq06G: freq06G,
                     isRecording: this.recordState,
                     signalList: signalList,

+ 59 - 1
src/views/addTactics.vue

@@ -20,6 +20,10 @@
                         <em>策略名称:</em>
                         <el-input v-model="panel.name" placeholder=""></el-input>
                     </div>
+                    <div class="pline">
+                        <em>持续时间:</em>
+                        <el-input v-model="panel.duration" type="number" placeholder="单位 秒"></el-input>
+                    </div>
                     <div class="pline">
                         <em class="label_checked" @click="turnRecord">
                             <img src="../assets/img/main/true.png" height="15" width="15" v-if="recordState"/>
@@ -203,6 +207,7 @@
                     end: 0,
                     distance: 1,
                     cycle: 0,
+                    duration: 0,
                 },
                 scopeState: false,
                 agreement_options: WirelessType(),
@@ -232,6 +237,7 @@
                         {value: 2, label: '已完成'},
                     ],
                     time1: globalBt3(2),
+                    duration: 0,
                 },
                 pageination: {
                     pageItem: 100,
@@ -266,6 +272,26 @@
                     this.readTacticsInfo();
                 }
             },
+            panel: {
+                handler(newName, oldName) {
+                    if (parseInt(newName.duration) < 0) {
+                        this.$notify.error({
+                            title: '错误',
+                            message: '持续时间不能小于0'
+                        });
+                        return false
+                    }
+                    if (parseInt(newName.duration) > 86400) {
+                        this.$notify.error({
+                            title: '错误',
+                            message: '持续时间不能超过86400秒(24小时)'
+                        });
+                        return false
+                    }
+                },
+                deep: true,
+                immediate: true
+            },
             scan: {
                 handler(newName, oldName) {
                     if (parseInt(newName.begin) > 6000) {
@@ -303,6 +329,20 @@
                         });
                         return false
                     }
+                    if (parseInt(newName.duration) < 0) {
+                        this.$notify.error({
+                            title: '错误',
+                            message: '持续时间不能小于0'
+                        });
+                        return false
+                    }
+                    if (parseInt(newName.duration) > 86400) {
+                        this.$notify.error({
+                            title: '错误',
+                            message: '持续时间不能超过86400秒(24小时)'
+                        });
+                        return false
+                    }
 
                     // 0-6G现实范围
                     if (newName.agreement == "13") {
@@ -399,6 +439,23 @@
                     return false
                 }
 
+                if (parseInt(this.panel.duration) < 0) {
+                    that.$message({
+                        showClose: true,
+                        message: '错了哦,持续时间不能小于0',
+                        type: 'error'
+                    });
+                    return false
+                }
+                if (parseInt(this.panel.duration) > 86400) {
+                    that.$message({
+                        showClose: true,
+                        message: '错了哦,持续时间不能超过86400秒(24小时)',
+                        type: 'error'
+                    });
+                    return false
+                }
+
                 let freq06G = [];
                 let signalList = [];
 
@@ -434,6 +491,7 @@
 
                 // 拼装value
                 let tacticsValue = {
+                    duration: parseInt(this.panel.duration),
                     freq06G: freq06G,
                     isRecording: this.recordState,
                     signalList: signalList,
@@ -533,7 +591,7 @@
                 tacticsValue = JSON.stringify(tacticsValue);
                 let param = {
                     token: localStorage.token,
-                    id:this.tid,
+                    id: this.tid,
                     name: this.panel.name,
                     memo: '',
                     value: tacticsValue

+ 44 - 2
src/views/signEquip.vue

@@ -185,7 +185,11 @@
             >
                 <template slot-scope="scope">
                     <!--<el-button class="" type="primary" size="small" @click="goWifiRecord(scope.row)">监测记录</el-button>-->
-                    <el-button class="" type="primary" size="small" @click="markEquip(scope.row)">标记设备</el-button>
+                    <el-button class="" type="primary" size="small" v-if="scope.row.RltLevel != 1" @click="markEquip(scope.row)">标记设备</el-button>
+
+                    <el-button class="" type="danger" size="small" v-if="scope.row.RltLevel == 1" @click="removeMark(scope.row)">移除标记</el-button>
+
+
                     <el-button v-if="scope.row.Status == 1" class="yellow" type="text" @click="pauseRow(scope.row)">禁用
                     </el-button>
                     <el-button v-if="scope.row.Status == 0" class="green" type="text" @click="runRow(scope.row)">启用
@@ -262,6 +266,7 @@
         DetectorEdit,
         GetDetectorCoords,
         GeFullRegionSelect,
+        DetectorKnownRemove,
         DetectorKnownEdit,
         DetectorNetDevList
     } from '../api/getApiRes.js'
@@ -383,6 +388,42 @@
                 this.dialog_state = true;
                 this.dialog.id = row.Id;
             },
+            // 移除标记
+            removeMark(row){
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    id : row.Id,
+                };
+                let postdata = qs.stringify(param);
+
+                this.$confirm('此操作将永久移除该标记, 是否继续?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    DetectorKnownRemove(postdata).then(res => {
+                        let json = res;
+                        if (json.Code == 0) {
+                            that.$message({
+                                showClose: true,
+                                message: '选中的标记已移除!',
+                                type: 'success'
+                            });
+                            // 重载列表
+                            that.getTableQuery();
+                            that.dialog_state = false;
+                        } else {
+                            that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                        }
+                    });
+                }).catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消移除'
+                    });
+                });
+            },
             // 获取下级列表
             getGeFullRegionSelect() {
                 let that = this;
@@ -696,9 +737,10 @@
             // 提交增加新设备
             confirmAddEquip() {
                 let that = this;
+                let id =  that.dialog.id.toString();
                 let param = {
                     token: localStorage.token,
-                    id: that.dialog.id,
+                    id:id,
                     dangerLevel: that.dialog.dangerLevel,
                     deviceType: that.dialog.deviceType,
                     memo: that.dialog.memo,