Ver código fonte

全套设计稿已GET

Changpeng Duan 4 anos atrás
pai
commit
e4e032abd3

+ 79 - 1
src/Global.js

@@ -272,6 +272,66 @@ filterWirelessType = function (value) {
     }
 };
 
+filterAllType = function (value) {
+    switch (parseInt(value)) {
+        case 0:
+            return "未知";
+            break;
+        case 1:
+            return "移动GSM";
+            break;
+        case 2:
+            return "联通GSM";
+            break;
+        case 3:
+            return "电信CDMA";
+            break;
+        case 4:
+            return "移动3G";
+            break;
+        case 5:
+            return "联通3G";
+            break;
+        case 6:
+            return "移动4G";
+            break;
+        case 7:
+            return "联通4G";
+            break;
+        case 8:
+            return "电信4G";
+            break;
+        case 9:
+            return "433M/315M";
+            break;
+        case 10:
+            return "WIFI2.4G";
+            break;
+        case 11:
+            return "ISM2.4G";
+            break;
+        case 12:
+            return "800M";
+            break;
+        case 20:
+            return "其他";
+            break
+        case 21:
+            return "摄像头";
+            break
+        case 22:
+            return "热点";
+            break
+        case 23:
+            return "手机";
+            break
+        case 24:
+            return "其他";
+            break
+
+    }
+};
+
 WirelessRange = function () {
     let option = [
         {
@@ -326,4 +386,22 @@ filterTimeToString = function (value) {
     let result = year + "-" + month + "-" + sdate + " " + hour + ":" + minute + ":" + second;
     // 返回
     return result;
-}
+};
+
+// handle = function(row, column, event) {
+//     // list -- 已选的数据
+//     let index = this.list.findIndex(item => {
+//         // 判断已选数组中是否已存在该条数据
+//         return item.id == row.id
+//     })
+//     if (index == -1) {
+//         // 如果未存在,设置已选状态,并在list中添加这条数据
+//         this.$refs.multipleTable.toggleRowSelection(row, true); //设置复选框为选中状态
+//         this.list.push(row)
+//     } else {
+//         // 如果已存在,设置未选状态,并在list中删除这条数据
+//         this.$refs.multipleTable.toggleRowSelection(row, false); //设置复选框为未选状态
+//         this.list.splice(index, 1)
+//     }
+//
+// }

+ 5 - 0
src/api/getApiRes.js

@@ -151,3 +151,8 @@ export function WirelessMonitor(postdata) {
     let url = headapi + 'v1/Index/WirelessMonitor';
     return getApiBasic(url, postdata);
 }
+// 区域安全状态和无线设备列表
+export function DevList(postdata) {
+    let url = headapi + 'v1/Index/DevList';
+    return getApiBasic(url, postdata);
+}

+ 4 - 7
src/components/BigRader.vue

@@ -17,10 +17,10 @@
                 <div class="zoom62 cn top8"></div>
                 <div class="zoom7 dn top9"></div>
             </div>
-            <div class="zoom8" v-if="RaderState == 0">
+            <div class="zoom8" v-if="RaderState == 1">
                 <img src="../assets/img/bigRadar2/safe.png" height="47" width="40"/><span class="status">环境安全</span>
             </div>
-            <div class="zoom9" v-if="RaderState >= 1">
+            <div class="zoom9" v-else>
                 <img src="../assets/img/main/waning.png" alt="">
                 <span class="warning">发现可疑信号</span>
             </div>
@@ -36,9 +36,7 @@
     export default {
         data() {
             return {
-                seconds: 0,
                 RaderState: 2,
-                timeShow: ' 00 : 00 : 00',
                 dotLists: [],
             }
         },
@@ -50,9 +48,8 @@
         watch: {
             totalRs: function (val) {
                 let that = this;
-                console.log(val);
-                if (val.Rs.Data) {
-                    that.RaderState = val.Rs.Data.length;
+                if (val) {
+                    that.RaderState = val.LEVEL;
                 } else {
                     that.RaderState = 0
                 }

+ 11 - 12
src/components/DetcotrRecord.vue

@@ -37,15 +37,15 @@
 
             </el-table>
             <br>
-            <div v-show="allTableData.length != 0">
-                <el-pagination
-                        background
-                        layout="prev, pager, next"
-                        :total="pageination.total"
-                        :page-size="pageination.pageItem"
-                        @current-change="pageChange"
-                ></el-pagination>
-            </div>
+            <!--<div v-show="allTableData.length != 0">-->
+            <!--<el-pagination-->
+            <!--background-->
+            <!--layout="prev, pager, next"-->
+            <!--:total="pageination.total"-->
+            <!--:page-size="pageination.pageItem"-->
+            <!--@current-change="pageChange"-->
+            <!--&gt;</el-pagination>-->
+            <!--</div>-->
         </div>
     </div>
 </template>
@@ -85,7 +85,6 @@
                         this.recordsTotal = 0;
                     } else {
                         this.allTableData = val.Rs;
-                        console.log(this.allTableData);
                         this.recordsTotal = val.Rs.length;
                     }
                     // 设置分页数据
@@ -139,10 +138,10 @@
                 console.log(params)
             },
             // 过滤设备类型
-            filterWirelessTypeName(value) {
+            filterWirelessTypeName(value, row, column) {
                 return filterWirelessType(value.WirelessType);
             },
-            filterTime(value) {
+            filterTime(value, row, column) {
                 return filterTimeToString(value.UpdateAtMilleSec);
             }
         }

+ 49 - 47
src/components/HistoryRecord.vue

@@ -2,9 +2,9 @@
     <div class="historyRecord">
         <div class="">
             <div class="sum-title">
-                {{historyRs.title}}
+                {{historyRs.Title}}
             </div>
-            <span class="link" @click="link(historyRs.url)">
+            <span class="link" @click="link(historyRs.Url)">
                 more+
             </span>
             <el-table
@@ -13,54 +13,47 @@
                     :default-sort="{prop: 'date', order: 'descending'}"
                     style="width: 100%">
                 <el-table-column
-                        prop="Name"
+                        prop="Oem"
                         label="名称"
                         width="140"
                         align="center"
                 >
                     <template slot-scope="scope">
-                        <i :class="[{'blue':scope.row.DangerLevel == -1},{'yellow':scope.row.DangerLevel != -1}]"></i>
-                        <el-tooltip class="item" effect="dark" :content="scope.row.Name" placement="top-start">
-                            <span>
-                                    {{ scope.row.Name.length > 9 ?  scope.row.Name.substr(0,9)+'...' : scope.row.Name }}
+                        <el-tooltip class="item" effect="dark" :content="scope.row.Oem" placement="top-start">
+                            <span v-if="scope.row.Oem">
+                                    {{ scope.row.Oem.length > 9 ?  scope.row.Oem.substr(0,9)+'...' : scope.row.Oem }}
                             </span>
+                            <span v-else>
+                                未知
+                            </span>
+
                         </el-tooltip>
                     </template>
                 </el-table-column>
                 <el-table-column
-                        prop="Ctime"
+                        prop="UpdateAt"
                         label="时间"
                         sortable
-                        :formatter="filterFmtDate"
+                        :formatter="filterTime"
                 >
                 </el-table-column>
                 <el-table-column
-                        prop="Location"
-                        label="位置"
-                        width="">
-                    <template slot-scope="scope">
-                        <el-tooltip class="item" effect="dark" :content="scope.row.Location" placement="top-start">
-                            <span>
-                                    {{ scope.row.Location.length > 6 ?  scope.row.Location.substr(0,6)+'...' : scope.row.Location }}
-                            </span>
-                        </el-tooltip>
-                    </template>
-                </el-table-column>
-                <el-table-column
-                        prop="SignaType"
-                        label="类型">
+                        prop="Type"
+                        label="类型"
+                        :formatter="filterType"
+                >
                 </el-table-column>
             </el-table>
             <br>
-            <div v-show="allTableData.length != 0">
-                <el-pagination
-                        background
-                        layout="prev, pager, next"
-                        :total="pageination.total"
-                        :page-size="pageination.pageItem"
-                        @current-change="pageChange"
-                ></el-pagination>
-            </div>
+            <!--<div v-show="allTableData.length != 0">-->
+            <!--<el-pagination-->
+            <!--background-->
+            <!--layout="prev, pager, next"-->
+            <!--:total="pageination.total"-->
+            <!--:page-size="pageination.pageItem"-->
+            <!--@current-change="pageChange"-->
+            <!--&gt;</el-pagination>-->
+            <!--</div>-->
         </div>
     </div>
 </template>
@@ -92,19 +85,22 @@
         },
         props: ['historyRs'],
         watch: {
-            historyRs: function (val) {
-                this.loading = false;
-
-                if (!val.Rs) {
-                    this.allTableData = [];
-                    this.recordsTotal = 0;
-                } else {
-                    this.allTableData = val.Rs;
-                    this.recordsTotal = val.Rs.length;
-                }
-
-                // 设置分页数据
-                this.setPaginations();
+            historyRs: {
+                handler(val, oldName) {
+                    console.log(val);
+                    this.loading = false;
+                    if (!val.Rs) {
+                        this.allTableData = [];
+                        this.recordsTotal = 0;
+                    } else {
+                        this.allTableData = val.Rs;
+                        this.recordsTotal = val.Rs.length;
+                    }
+                    // 设置分页数据
+                    this.setPaginations();
+                },
+                deep: true,
+                immediate: true
             },
         },
         methods: {
@@ -155,7 +151,13 @@
                 let that = this;
                 return globalfmtDate2(column, 11, 8);
             },
-            // 过滤金额
+            // 过滤设备类型
+            filterType(value, row, column) {
+                return filterAllType(column);
+            },
+            filterTime(value, row, column) {
+                return filterTimeToString(column);
+            }
         }
         ,
     }
@@ -194,7 +196,7 @@
         position: relative;
         bottom: 20px;
         width: 100%;
-        height: 110px;
+        height: 130px;
         overflow: hidden;
         display: block;
         margin: 0 auto;

+ 11 - 12
src/components/RunTimeRecord.vue

@@ -51,15 +51,15 @@
 
             </el-table>
             <br>
-            <div v-show="allTableData.length != 0">
-                <el-pagination
-                        background
-                        layout="prev, pager, next"
-                        :total="pageination.total"
-                        :page-size="pageination.pageItem"
-                        @current-change="pageChange"
-                ></el-pagination>
-            </div>
+            <!--<div v-show="allTableData.length != 0">-->
+                <!--<el-pagination-->
+                        <!--background-->
+                        <!--layout="prev, pager, next"-->
+                        <!--:total="pageination.total"-->
+                        <!--:page-size="pageination.pageItem"-->
+                        <!--@current-change="pageChange"-->
+                <!--&gt;</el-pagination>-->
+            <!--</div>-->
         </div>
     </div>
 </template>
@@ -99,7 +99,6 @@
                         this.recordsTotal = 0;
                     } else {
                         this.allTableData = val.Rs;
-                        console.log(this.allTableData);
                         this.recordsTotal = val.Rs.length;
                     }
                     // 设置分页数据
@@ -153,10 +152,10 @@
                 console.log(params)
             },
             // 过滤设备类型
-            filterType(value) {
+            filterType(value, row, column) {
                 return filterDetctorType(value.Type);
             },
-            filterTime(value) {
+            filterTime(value, row, column) {
                 return filterTimeToString(value.UpdateAtMilleSec);
             }
         }

+ 1 - 1
src/components/signMap.vue

@@ -139,7 +139,7 @@
         },
         filters: {
             typeName: function (value) {
-                return filterWirelessType(value)
+                return filterAllType(value)
             },
         },
     }

+ 42 - 0
src/router/index.js

@@ -134,6 +134,48 @@ const routes = [
                 meta: {
                     title: "无线设备管理",
                 }
+            },{
+                path: '/tactics',
+                name: 'tactics',
+                component: () => import('@/views/tactics.vue'),
+                meta: {
+                    title: "扫描策略管理",
+                }
+            },{
+                path: '/plan',
+                name: 'plan',
+                component: () => import('@/views/plan.vue'),
+                meta: {
+                    title: "任务计划管理",
+                }
+            },{
+                path: '/task',
+                name: 'task',
+                component: () => import('@/views/task.vue'),
+                meta: {
+                    title: "扫描任务管理",
+                }
+            },{
+                path: '/statistics',
+                name: 'statistics',
+                component: () => import('@/views/statistics.vue'),
+                meta: {
+                    title: "监控记录统计",
+                }
+            },{
+                path: '/wirelessStatics',
+                name: 'wirelessStatics',
+                component: () => import('@/views/wirelessStatics.vue'),
+                meta: {
+                    title: "无线信号统计",
+                }
+            },{
+                path: '/addTactics',
+                name: 'addTactics',
+                component: () => import('@/views/addTactics.vue'),
+                meta: {
+                    title: "新增策略",
+                }
             },
         ]
     }, {

+ 10 - 4
src/views/Equip.vue

@@ -51,6 +51,7 @@
             </div>
         </div>
         <el-table
+
                 :data="tableData"
                 is-horizontal-resize
                 :default-sort="{prop: 'date', order: 'descending'}"
@@ -59,6 +60,8 @@
                 class=""
                 @selection-change="handleSelectionChange"
                 stripe
+                ref="multipleTable"
+                @row-click="handle"
         >
             <el-table-column
                     type="selection"
@@ -551,8 +554,8 @@
 
                 let param = {
                     token: localStorage.token,
-                    detectorid: detectorid,
-                    status: 9,//0禁用1启用9删除
+                    id: detectorid,
+                    status: 4,//设备状态 1:正常 2:禁用 3:维修 4:删除
                 };
                 let postdata = qs.stringify(param);
 
@@ -561,7 +564,7 @@
                     cancelButtonText: '取消',
                     type: 'warning'
                 }).then(() => {
-                    DetectorEditStatus(postdata).then(res => {
+                    DetectorEdit(postdata).then(res => {
                         let json = res;
                         if (json.Code == 0) {
                             that.$message({
@@ -801,7 +804,7 @@
                     memo: that.dialog.memo,
                     coordsType: 1,//坐标状态 0:禁用, 1:启用, 9:删除,没有就传0
                     coordsID: that.dialog.CoordsId,
-                    status: that.dialog.status,
+                    status: 1,
                 };
 
                 let postdata = qs.stringify(param);
@@ -919,6 +922,9 @@
             },
             filterTime(val, row, column) {
                 return nonTfmtDate(column,10);
+            },
+            handle(row, column, event) {
+                this.$refs.multipleTable.toggleRowSelection(row);
             }
         },
         watch: {

+ 3 - 1
src/views/Index.vue

@@ -14,7 +14,7 @@
                     </keep-alive>
                 </el-main>
                 <el-footer>
-                    <p class="footerP">Copyright © 2020 <a href="http://signal.tickdig.com:85/#/">HTTP://SIGNAL.TICKDIG.COM/</a> TICKDIG 版权所有</p>
+                    <p class="footerP">Copyright © 2020-2021 专用场所无线信号安全监控系统 版权所有</p>
                 </el-footer>
             </el-container>
         </el-container>
@@ -202,6 +202,8 @@
     .footerP {
         margin: 5px 0;
         padding: 0;
+        color: #004272;
+        font-size: 14px;
     }
 
     .footerP a {

+ 28 - 4
src/views/Main.vue

@@ -69,6 +69,7 @@
         MonitorArea,
         NetDevMonitor,
         WirelessMonitor,
+        DevList,
     } from '../api/getApiRes.js'
     import {mapGetters, mapActions, mapState} from "vuex";
     import Global from "../Global"
@@ -80,14 +81,17 @@
                 WifiRs: {},
                 ScanRs: {},
                 signList: {},
-                historyRs: [],
                 totalRs: [],
                 equipRs: [],
                 regionList: [],
                 detectorList: [],
                 showLeft: true,
                 regionId: '',
-                runtimeRs: {
+                historyRs: {
+                    Title: '区域无线设备列表',
+                    Url: 'runTime',
+                    Rs: [],
+                }, runtimeRs: {
                     Title: '实时监控详情',
                     Url: 'runTime',
                     Rs: [],
@@ -141,6 +145,7 @@
                             this.getMonitorArea(json.Rs[0].Id);
                             this.getNetDevMonitor(json.Rs[0].Id);
                             this.getWirelessMonitor(json.Rs[0].Id);
+                            this.getDevList(json.Rs[0].Id);
                         }
                     } else {
                         that.$message.error(json.Memo);
@@ -189,6 +194,7 @@
                 this.getMonitorArea(Id);
                 this.getNetDevMonitor(Id);
                 this.getWirelessMonitor(Id);
+                this.getDevList(Id);
             },
             getRegion06G(id) {
                 let that = this;
@@ -219,10 +225,8 @@
                     let json = res;
                     if (json.Code == 0) {
                         this.signList = json;
-                        this.totalRs = json;
                     } else {
                         this.signList = {};
-                        this.totalRs = {};
                         that.$message.error(json.Memo);
                     }
                 })
@@ -260,6 +264,26 @@
                         that.$message.error(json.Memo);
                     }
                 })
+            },
+            getDevList(id) {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    regionId: id,
+                    limit: 6,
+                };
+                let postdata = qs.stringify(param);
+                DevList(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        this.historyRs.Rs = json.Rs.List;
+                        this.totalRs = json.Rs;
+                    } else {
+                        this.historyRs.Rs = [];
+                        this.totalRs = [];
+                        that.$message.error(json.Memo);
+                    }
+                })
             }
         },
         components: {

+ 839 - 132
src/views/Record.vue

@@ -1,91 +1,202 @@
 <template>
-    <div>
+    <div class="content">
+        <div class="tabs">
+            <ul>
+                <li v-for="(tab,i) in tabs" @click="goTab(tab.url)" :class="{'active':tabIndex == i}">
+                    {{tab.name}}
+                </li>
+            </ul>
+        </div>
         <div class="panel">
-            <h5 class="panel-title">手机信号监测记录</h5>
             <div class="panel-body">
                 <div class=" panel_control">
-                    <el-row :gutter="20">
-                        <el-col :span="4">
-                            <em>起始:</em>
-                            <el-date-picker
-                                    class="panel_data"
-                                    v-model="panel.time1[0]"
-                                    type="date"
-                                    placeholder="起始日期">
-                            </el-date-picker>
-                        </el-col>
-                        <el-col :span="4">
-                            <em>截止:</em>
-                            <el-date-picker
-                                    class="panel_data"
-                                    v-model="panel.time1[1]"
-                                    type="date"
-                                    placeholder="截止日期">
-                            </el-date-picker>
-                        </el-col>
-                        <el-col :span="4">
-                            <em>用户账号:</em>
-                            <el-input v-model="panel.USERCODE" placeholder="请输入用户账号"></el-input>
-                        </el-col>
-                        <el-col :span="4">
-                            <em>关键词:</em>
-                            <el-input v-model="panel.keyword" placeholder="请输入关键词"></el-input>
-                        </el-col>
-                        <el-col :span="4">
-                            <em>状态:</em>
-                            <el-select v-model="panel.taskstatus">
-                                <el-option
-                                        v-for="item in panel.options"
-                                        :key="item.value"
-                                        :label="item.label"
-                                        :value="item.value">
-                                </el-option>
-                            </el-select>
-                        </el-col>
-                        <el-col :span="4">
-                            <el-button size="small" type="primary" @click="query">查询</el-button>
-                        </el-col>
-                    </el-row>
+                    <div class="pline">
+                        <em>设备ID:</em>
+                        <el-input v-model="panel.tagname" placeholder=""></el-input>
+                    </div>
+                    <div class="pline">
+                        <em>MAC地址:</em>
+                        <el-input v-model="panel.tagname" placeholder=""></el-input>
+                    </div>
+                    <div class="pline">
+                        <em>所属区域:</em>
+                        <el-select v-model="panel.regionid">
+                            <el-option
+                                    v-for="item in panel.regionidOptions"
+                                    :key="item.Id"
+                                    :label="item.Name"
+                                    :value="item.Id">
+                            </el-option>
+                        </el-select>
+                    </div>
+                    <div class="pline">
+                        <el-button size="medium" type="primary" @click="query">查询</el-button>
+                    </div>
+                    <div class="pline pull-right">
+                        <el-button size="medium" type="primary" @click="addList">添加</el-button>
+                        <el-button size="medium" type="primary" @click="editList">修改</el-button>
+                        <el-button size="medium" type="primary" @click="delList">删除</el-button>
+                    </div>
                 </div>
             </div>
         </div>
-            <el-table
-                    :data="tableData"
-                    class=""
-                    stripe
-                    >
-                <el-table-column
-                        prop="date"
-                        label="日期"
-                        width="180">
-                </el-table-column>
-                <el-table-column
-                        prop="name"
-                        label="姓名"
-                        width="180">
-                </el-table-column>
-                <el-table-column
-                        prop="address"
-                        label="地址">
-                </el-table-column>
-            </el-table>
-            <br>
-            <el-pagination
-                    background
-                    :total="pageination.total"
-                    :page-size="pageination.pageItem"
-                    @current-change="pageChange"
-            ></el-pagination>
-    </div>
+        <el-table
+                :data="tableData"
+                is-horizontal-resize
+                :default-sort="{prop: 'date', order: 'descending'}"
+                v-loading="loading"
+                element-loading-background="rgba(0, 0, 0, 0.8)"
+                class=""
+                @selection-change="handleSelectionChange"
+                stripe
+                ref="multipleTable"
+                @row-click="handle"
+        >
+            <el-table-column
+                    type="selection"
+                    width="55">
+            </el-table-column>
+            <el-table-column
+                    type="index"
+                    label="序号"
+                    width="60"
+                    sortable
+            >
+            </el-table-column>
+            <el-table-column
+                    prop="Mac"
+                    label="区域名称"
+            >
+            </el-table-column>
+            <el-table-column
+                    prop="Xmax"
+                    label="长/m"
+            >
+            </el-table-column>
+            <el-table-column
+                    prop="Ymax"
+                    label="宽/m"
+            >
+            </el-table-column>
+            <el-table-column
+                    prop="Memo"
+                    label="备注"
+            >
+            </el-table-column>
+            <el-table-column
+                    prop="address"
+                    label="操作记录"
+                    width="220"
+            >
+                <template slot-scope="scope">
+                    <!--<el-button class="" type="text" @click="goPhoneRecord(scope.row)">手机信号记录</el-button>-->
+                    <el-button class="" type="primary" size="small" @click="goWifiRecord(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)">启用-->
+                    <!--</el-button>-->
+                </template>
+            </el-table-column>
+        </el-table>
+        <br>
+        <el-pagination
+                background
+                :total="pageination.total"
+                :page-size="pageination.pageItem"
+                @current-change="pageChange"
+        ></el-pagination>
 
+        <dialog_referrer_list
+                :show="dialog_state"
+                :title="dialog_title"
+                :large="true"
+                @dialog_cancel="dialog_cancel"
+                @dialog_ok="dialog_ok"
+        >
+            <div class="dialogContent">
+                <el-row :gutter="24">
+                    <el-col :span="24">
+                        <label>
+                            区域名称
+                        </label>
+                        <el-input v-model="dialog.mac" @keyup.native="autoCompleteMac"
+                                  :disabled="dialog_type == 2"></el-input>
+                    </el-col>
+                    <el-col :span="12">
+                        <label>
+                            长/m
+                        </label>
+                        <el-input v-model="dialog.tagname"></el-input>
+                    </el-col>
+                    <el-col :span="12">
+                        <label>
+                            宽/m
+                        </label>
+                        <el-input v-model="dialog.tagname"></el-input>
+                    </el-col>
+                    <el-col :span="24">
+                        <label>
+                            备注
+                        </label>
+                        <el-input v-model="dialog.memo"  type="textarea"></el-input>
+                    </el-col>
+                </el-row>
+            </div>
+        </dialog_referrer_list>
+    </div>
 </template>
 
 <script>
     import Global from '../Global.js'
+    import dialog_referrer_list from '../components/dialog_referrer_list'
+    import {
+        DetectorQuery,
+        GetChildRegionSelect,
+        DetectorEditStatus,
+        RegionPictureGetByRegionId,
+        DetectorAdd,
+        RegionList,
+        DetectorList,
+        DetectorEdit,
+        GetDetectorCoords,
+        GeFullRegionSelect,
+    } from '../api/getApiRes.js'
 
+    let qs = require('qs');
     export default {
         data() {
             return {
+                // dialog
+                dialog_state: false,
+                dialog_title: '',
+                dialog_type: '',//类型,1是添加,2是修改
+                dialog: {
+                    mac: '',
+                    comId: 1,
+                    regionlevelOneId: 0,
+                    regionId: 0,
+                    tagname: '',
+                    longitude: 0,
+                    latitude: 0,
+                    HardwareVersion: '',
+                    FirmwareVersion: '',
+                    FirmwareScanM4Version: '',
+                    FirmwareScanM0Version: '',
+                    purchasesrc: '',
+                    location: '',
+                    coords_memo: '',
+                    memo: '',
+                    plateImgSrc: '',
+                    regionlevelOneIdOptions: [],
+                    regionIdRoomOptions: [],
+                    points: [],
+                    CoordsId: 0,
+                    status: 0,
+                },
+                tabIndex: 0,
+                tabs: [
+                    {name: '探测记录管理', url: 'record'},
+                ],
                 // panel 配置项目
                 panel: {
                     usercode: '',
@@ -94,82 +205,166 @@
                     keyword: '',
                     USERCODE: '',
                     taskstatus: 99,
+                    regionid: 0,
+                    regionid2: '',
+                    regionidOptions: [],
+                    regionidOptions2: [],
                     options: [
                         {value: 99, label: '全部'},
                         {value: 1, label: '进行中'},
                         {value: 2, label: '已完成'},
                     ],
-                    time1: globalBt(),
+                    time1: globalBt3(2),
                 },
                 pageination: {
                     pageItem: 100,
                     pageoptions: pageOptions(),
-                    total: 100,
+                    total: 500,
                     pageIndex: 1,
                 },
-                tableData: [{
-                    date: '2016-05-02',
-                    name: '王小虎',
-                    address: '上海市普陀区金沙江路 1518 弄'
-                }, {
-                    date: '2016-05-04',
-                    name: '王小虎',
-                    address: '上海市普陀区金沙江路 1517 弄'
-                }, {
-                    date: '2016-05-01',
-                    name: '王小虎',
-                    address: '上海市普陀区金沙江路 1519 弄'
-                }, {
-                    date: '2016-05-03',
-                    name: '王小虎',
-                    address: '上海市普陀区金沙江路 1516 弄'
-                }]
+                draw: 1,
+                start: 0,
+                recordsTotal: 0,
+                tableData: [],
+                allTableData: [],
+                limit: '10',
+                multipleSort: false,
+                loading: true,
+                fileList: [],
+                multipleSelection: [],
+                detectedmac: '',
             }
         },
         mounted() {
+            if (this.$route.query.RegionId) {
+                this.panel.regionid = this.$route.query.RegionId;
+                this.panel.tagname = this.$route.query.TagName;
+            }
+
             this.getTableQuery();
         },
         methods: {
+            handle(row, column, event) {
+                this.$refs.multipleTable.toggleRowSelection(row);
+            },
+            // 页面数据查询
+            getTableQuery() {
+                let that = this;
+                // this.getGetChildRegionSelect(0, 1);
+                this.getGeFullRegionSelect();
+                that.loading = true;
+                // 查询检测设备。上级区域id,区域id必传。regionid传0,查询supregionid对应所有子区域的检测设备。 如果supregionid,regionid都传0,默认查询企业ID下所有检测设备
+                let param = {
+                    token: localStorage.token,
+                    mac: this.panel.mac,//
+                    regionId: that.panel.regionId,//
+                    name: that.panel.tagname,//标签名
+                    comid: 1,//
+                    start: 1,//
+                    tableMax: 9999,//
+                };
+                let postdata = qs.stringify(param);
+                DetectorList(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.loading = false;
+                        if (json.Rs) {
+                            that.allTableData = json.Rs;
+                            console.log(json.Rs);
+                            that.recordsTotal = json.Rs.length;
+                        } else {
+                            that.allTableData = [];
+                            that.recordsTotal = 0;
+                        }
+                        // 设置分页数据
+                        that.setPaginations();
+                    } else {
+                        that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                    }
+                })
+            },
+            // 获取下级列表
+            getGeFullRegionSelect() {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                };
+                let postdata = qs.stringify(param);
+                RegionList(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        if (!json.Rs) {
+                            that.$message.error('区域列表为空,请先添加有效区域');
+                            return false
+                        }
+                        that.panel.regionidOptions = json.Rs;
+                        that.panel.regionidOptions.unshift({Id: 0, Name: "全部", DisplayName: "全部"});
+                    } else {
+                        that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                    }
+                })
+            },
+            // dialog获取下级列表
+            dialoggetGeFullRegionSelect() {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                };
+                let postdata = qs.stringify(param);
+                RegionList(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.dialog.regionlevelOneIdOptions = json.Rs;
+                        that.dialog.regionId = json.Rs[0].Id;
+                    } else {
+                        that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                    }
+                })
+            },
+            // dialog获取区域下级菜单
+            dialogGetGetChildRegionSelect(regionId, level) {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    regionId: regionId,
+                };
+                let postdata = qs.stringify(param);
+                RegionList(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.dialog.regionlevelOneIdOptions = json.Rs;
+                        that.dialog.regionlevelOneId = regionId;
+                        // if (level == 1) {
+                        //     console.log(json.Rs);
+                        //     that.dialog.regionlevelOneIdOptions = json.Rs;
+                        //     that.dialog.regionlevelOneId = regionId;
+                        // } else {
+                        //     if (json.Rs) {
+                        //         console.log(123);
+                        //         that.dialog.regionIdRoomOptions = json.Rs;
+                        //         that.dialog.regionId = regionId;
+                        //     } else {
+                        //         that.dialog.regionIdRoomOptions = [];
+                        //         that.dialog.regionId = '';
+                        //     }
+                        // }
+                    } else {
+                        that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                    }
+                })
+            },
+            // 跳转tab页面
+            goTab(url) {
+                this.$router.push({path: url});
+            },
             // 查询按钮
             query() {
                 this.getTableQuery();
                 this.$message.success('查询完毕');
             },
-            // 页面数据查询
-            getTableQuery() {
-                // let that = this;
-                // that.loading = true;
-                // let url = headapi + '?ctl=ajax&mod=dial&act=taskListQuery';//获取
-                // let param = {
-                //     'taskstatus': that.panel.taskstatus,
-                //     'bt': globaltime2String(that.panel.time1[0]),
-                //     'et': globaltime2String(that.panel.time1[1]),
-                //     'KEYWORD': that.panel.keyword,
-                //     'USERCODE': that.panel.USERCODE,
-                // };
-                // let JSON = '';
-                // let postdata = qs.stringify(param);
-                // axios.post(url, postdata)
-                //     .then(function (response) {
-                //         JSON = response.data;
-                //         that.loading = false;
-                //         that.allTableData = JSON.rs;
-                //         that.recordsTotal = JSON.rs.length;
-                //         // 设置分页数据
-                //         that.setPaginations();
-                //     })
-                //     .catch(function (error) {
-                //         console.log(error);
-                //     });
-            },
-            // 导出excel
-            btnExpAll() {
-                let that = this;
-                let url = headapi + '?ctl=ajax&mod=czgl&act=czcx_excel';//获取
-                let bt = globaltime2String(that.panel.time1[0]);
-                let et = globaltime2String(that.panel.time1[1]);
-                let usercode = that.panel.usercode;
-                window.location = url + '&bt=' + bt + '&et=' + et + '&usercode=' + usercode;
+
+            handleSelectionChange(val) {
+                this.multipleSelection = val;
             },
             // 设置分页数据
             setPaginations() {
@@ -188,7 +383,7 @@
                     return index < that.pageination.pageItem;
                 });
                 that.draw = that.pageination.pageItem;
-                that.getTableQuery();
+                // that.getTableQuery();
             },
             // 翻页
             pageChange(pageIndex) {
@@ -206,7 +401,7 @@
                     this.tableData = tables;
                 }
                 that.start = index * that.draw;
-                that.getTableQuery();
+                // that.getTableQuery();
             },
             // 自动排序
             sortChange(params) {
@@ -214,19 +409,531 @@
             },
             // 过滤时间
             filterFmtDate(value, row, column) {
-                let that = this;
                 return globalfmtDate(column, 11);
             },
-            // 过滤金额
-            filterMoney(value, row, column) {
+            addList() {
+                this.dialog_state = true;
+                this.dialog_title = '添加监控区域';
+                this.dialog_type = 1;
+
+                // 重载地区列表
+                this.getGeFullRegionSelect();
+
+                // clear dialog
+                this.dialog.mac = '';
+                this.dialog.regionId = '';
+                this.dialog.tagname = '';
+                this.dialog.HardwareVersion = '';
+                this.dialog.FirmwareVersion = '';
+                this.dialog.FirmwareScanM4Version = '';
+                this.dialog.FirmwareScanM0Version = '';
+                this.dialog.location = '';
+                this.dialog.purchasesrc = '';
+                this.dialog.memo = '';
+                this.dialog.coords_memo = '';
+                this.dialog.points = [{}];
+
+                // 加载默认的平面图
+                // this.dialogGetGetChildRegionSelect(0, 1);
+                this.dialoggetGeFullRegionSelect()
+            },
+            delList() {
                 let that = this;
-                return parseFloat(column).toFixed(2);
+                // checkNum
+                if (!this.multipleSelection.length) {
+                    that.$message({
+                        showClose: true,
+                        message: '错了哦,需要先选中至少一条记录',
+                        type: 'error'
+                    });
+                    return false
+                }
+                let detectorid = that.multipleSelection[0].Id;
+
+                let param = {
+                    token: localStorage.token,
+                    detectorid: detectorid,
+                    status: 9,//0禁用1启用9删除
+                };
+                let postdata = qs.stringify(param);
+
+                this.$confirm('此操作将永久删除该设备, 是否继续?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    DetectorEditStatus(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: '已取消删除'
+                    });
+                });
+            },
+            editList() {
+                let that = this;
+                // checkNum
+                if (!this.multipleSelection.length) {
+                    this.$message({
+                        showClose: true,
+                        message: '错了哦,需要先选中一条记录',
+                        type: 'error'
+                    });
+                    return false
+                }
+                if (this.multipleSelection.length > 1) {
+                    this.$message({
+                        showClose: true,
+                        message: '错了哦,只能选中一条记录',
+                        type: 'error'
+                    });
+                    return false
+                }
+                this.dialog_state = true;
+                this.dialog_title = '修改设备信息';
+                this.dialog_type = 2;
+
+                // 读取本条记录
+                let row = this.multipleSelection[0];
+                this.dialog.eqId = row.Id;
+                this.dialog.mac = row.Mac;
+                this.dialog.regionId = row.RegionId;
+                this.dialog.tagname = row.TagName;
+                this.dialog.HardwareVersion = row.HardwareVersion;
+                this.dialog.FirmwareVersion = row.FirmwareVersion;
+                this.dialog.FirmwareScanM4Version = row.FirmwareScanM4Version;
+                this.dialog.FirmwareScanM0Version = row.FirmwareScanM0Version;
+                this.dialog.location = row.Location;
+                this.dialog.purchasesrc = row.PurchaseSrc;
+                this.dialog.memo = row.Memo;
+                this.dialog.regionlevelOneId = row.RegionId;
+                this.dialog.status = row.Status;
+                // this.dialog.coords_memo = row.coords_memo;
+
+                // 重载地区列表
+                this.getGeFullRegionSelect();
+
+                that.dialog.points = [{x: row.X, y: row.Y}];
+
+                // let param = {
+                //     token: localStorage.token,
+                //     detectorId: row.Id,
+                // };
+                // let postdata = qs.stringify(param);
+                // GetDetectorCoords(postdata).then(res => {
+                //     let json = res;
+                //     if (json.Code == 0) {
+                //         if (json.Rs.length != 0) {
+                //             console.log(json.Rs[0]);
+                //             // that.dialog.points = [{x: json.Rs[0].X, y: json.Rs[0].Y}];
+                //             that.dialog.points = [{x: json.Rs.X, y: json.Rs.Y}];
+                //             // that.dialog.CoordsId = json.Rs[0].CoordsId;
+                //             // that.dialog.coords_memo = json.Rs[0].Memo;
+                //         } else {
+                //             that.dialog.points = [{x: 0, y: 0}];
+                //             that.dialog.CoordsId = 0;
+                //         }
+                //     } else {
+                //         that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                //     }
+                // })
+            },
+            // 自动补全MAC
+            autoCompleteMac() {
+                let text = this.dialog.mac;
+                if (text.length == 2 || text.length == 5 || text.length == 8 || text.length == 11 || text.length == 14) {
+                    this.dialog.mac = this.dialog.mac.toUpperCase() + ":"
+                }
+                if (text.length > 14) {
+                    this.dialog.mac = this.dialog.mac.toUpperCase()
+                }
+            },
+            // 探测记录
+            goPhoneRecord(row) {
+                this.$router.push({
+                    path: '/phoneSign',
+                    query:
+                        {
+                            detectorid: row.Id,
+                            comId: 1,
+                            regionId: row.RegionId,
+                        }
+                });
+            },
+            // 探测记录
+            goWifiRecord(row) {
+                this.$router.push({
+                    path: '/wifiSign',
+                    query:
+                        {
+                            detectorid: row.Id,
+                            comId: 1,
+                            regionId: row.RegionId,
+                        }
+                });
+            },
+            dialog_cancel() {
+                let that = this;
+                that.dialog_state = false;
+            },
+            dialog_ok() {
+                if (this.dialog_type == 1) {
+                    this.confirmAddEquip();
+                } else {
+                    this.confirmEditEquip();
+                }
+            },
+            // 提交增加新设备
+            confirmAddEquip() {
+                let that = this;
+                // checkVal
+                if (!that.dialog.mac) {
+                    this.$message.error('错了哦,mac不能为空');
+                    return false
+                }
+                if (!checkMac(that.dialog.mac)) {
+                    this.$message.error('错了哦,mac格式不正确');
+                    return false
+                }
+                if (!that.dialog.regionId) {
+                    this.$message.error('错了哦,所属区域不能为空');
+                    return false
+                }
+                if (!that.dialog.tagname) {
+                    this.$message.error('错了哦,标签名不能为空');
+                    return false
+                }
+                if (that.dialog.tagname.length > 20) {
+                    this.$message.error('错了哦,标签名不能超过20个字符');
+                    return false
+                }
+                this.selectRegionLabel(that.dialog.regionId);
+                let param = {
+                    token: localStorage.token,
+                    mac: that.dialog.mac,
+                    comId: 1,
+                    regionId: that.dialog.regionId,
+                    name: that.dialog.tagname,
+                    HardwareVersion: that.dialog.HardwareVersion,
+                    FirmwareVersion: that.dialog.FirmwareVersion,
+                    FirmwareScanM4Version: that.dialog.FirmwareScanM4Version,
+                    FirmwareScanM0Version: that.dialog.FirmwareScanM0Version,
+                    location: that.dialog.location,
+                    purchasesrc: that.dialog.purchasesrc,
+                    x: that.dialog.points[0].x,
+                    y: that.dialog.points[0].y,
+                    // coords_memo: that.dialog.coords_memo,
+                    memo: that.dialog.memo,
+                };
+                let postdata = qs.stringify(param);
+                DetectorAdd(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);
+                    }
+                });
+            },
+            // 提交修改设备信息
+            confirmEditEquip() {
+                let that = this;
+                // checkVal
+                if (!that.dialog.mac) {
+                    this.$message.error('错了哦,mac不能为空');
+                    return false
+                }
+                if (!checkMac(that.dialog.mac)) {
+                    this.$message.error('错了哦,mac格式不正确');
+                    return false
+                }
+
+                if (!that.dialog.regionId) {
+                    this.$message.error('错了哦,所属区域不能为空');
+                    return false
+                }
+                if (!that.dialog.tagname) {
+                    this.$message.error('错了哦,标签名不能为空');
+                    return false
+                }
+                if (that.dialog.tagname.length > 20) {
+                    this.$message.error('错了哦,标签名不能超过20个字符');
+                    return false
+                }
+                this.selectRegionLabel(that.dialog.regionId);
+                let param = {
+                    token: localStorage.token,
+                    id: that.dialog.eqId,
+                    mac: that.dialog.mac,
+                    comId: 1,
+                    regionId: that.dialog.regionId,
+                    name: that.dialog.tagname,
+                    HardwareVersion: that.dialog.HardwareVersion,
+                    FirmwareVersion: that.dialog.FirmwareVersion,
+                    FirmwareScanM4Version: that.dialog.FirmwareScanM4Version,
+                    FirmwareScanM0Version: that.dialog.FirmwareScanM0Version,
+                    location: that.dialog.location,
+                    purchasesrc: that.dialog.purchasesrc,
+                    x: that.dialog.points[0].x,
+                    y: that.dialog.points[0].y,
+                    coords_memo: that.dialog.coords_memo,
+                    memo: that.dialog.memo,
+                    coordsType: 1,//坐标状态 0:禁用, 1:启用, 9:删除,没有就传0
+                    coordsID: that.dialog.CoordsId,
+                    status: that.dialog.status,
+                };
+
+                let postdata = qs.stringify(param);
+                DetectorEdit(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);
+                    }
+                });
+            },
+            // 修改设备状态
+            getDetectorEditStatus(detectorid, status, text) {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    detectorid: detectorid,
+                    status: status,
+                };
+                let postdata = qs.stringify(param);
+                DetectorEditStatus(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.$message({
+                            showClose: true,
+                            message: text + '成功!',
+                            type: 'success'
+                        });
+                        // table 重载
+                        that.getTableQuery();
+                    } else {
+                        that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                    }
+                })
+            },
+            // 禁用
+            pauseRow(row) {
+                let that = this;
+                this.$confirm('是否禁用' + row.TagName + '设备?', '禁用操作', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    that.getDetectorEditStatus(row.Id, 0, '禁用');
+                }).catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消禁用'
+                    });
+                });
+            },
+            // 获取区域位置的平面图
+            getRegionPictureGetByRegionId(regionID) {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    regionID: regionID,
+                    regionId: regionID,
+                };
+                let postdata = qs.stringify(param);
+                that.dialog.plateImgSrc = '../assets/img/main/grid.png'
+                // RegionPictureGetByRegionId(postdata).then(res => {
+                //     let json = res;
+                //     that.dialog.plateImgSrc = '';
+                //     if (json.Code == 0) {
+                //         that.dialog.plateImgSrc = json.EncodeString;
+                //     } else {
+                //         that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                //     }
+                // })
+            },
+            // 启用
+            runRow(row) {
+                console.log(row);
+                let that = this;
+                this.$confirm('是否启用' + row.TagName + '设备?', '启用操作', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    that.getDetectorEditStatus(row.Id, 1, '启用');
+                }).catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消启用'
+                    });
+                });
+            },
+            // 添加探测器位置的点坐标
+            addPoint(e) {
+                let x = e.offsetX;
+                let y = e.offsetY;
+                this.dialog.points = [{x: x, y: y}];
+            },
+            // 获取位置的文字内容
+            selectRegionLabel(id) {
+                let that = this;
+                let selectedWorkName = {};
+                // selectedWorkName = that.dialog.regionIdRoomOptions.filter(item => {
+                selectedWorkName = that.dialog.regionlevelOneIdOptions.filter(item => {
+                    if (item.Id === id) {
+                        console.log(item.Name);
+                        that.dialog.location = item.Name;
+                    }
+                });
+            },
+            filterTime(val, row, column) {
+                return nonTfmtDate(column, 10);
+            }
+        },
+        watch: {
+            // 'dialog.regionlevelOneId': function (val) {
+            //     this.dialogGetGetChildRegionSelect(val, 2)
+            // },
+            'dialog.regionId': function (val) {
+                if (val) {
+                    this.getRegionPictureGetByRegionId(val);
+                }
             },
         },
+        components: {
+            dialog_referrer_list
+        }
     }
 </script>
 
 <style scoped>
     @import "../assets/css/panel.css";
+    @import "../assets/css/dialog.css";
 
+    .tabs ul {
+        width: 168px;
+        float: left;
+    }
+
+    table span {
+        cursor: pointer;
+    }
+
+    .down_btn {
+        float: left;
+    }
+
+    .content {
+        width: 98%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        padding-left: 20px;
+    }
+
+    .selectStyle {
+        width: 100%;
+        color: #005EA2;
+    }
+
+    .selectStyle ::placeholder {
+        color: #005EA2;
+    }
+
+    /deep/ .modal .el-select .el-input .el-select__caret {
+        position: relative;
+        top: 35px;
+    }
+
+    .imgContianer {
+        width: 100%;
+        height: 340px;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+    }
+
+    .imgContianer img {
+        width: 100%;
+        height: 100%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+    }
+
+    .pointers {
+        position: relative;
+        bottom: 340px;
+        width: 100%;
+        height: 100%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+    }
+
+    .imgContianer i {
+        position: relative;
+        width: 10px;
+        height: 10px;
+        float: left;
+        border-radius: 250px;
+        background: #FFDD00;
+    }
+
+    /deep/ .modal-dialog {
+        height: 80px;
+        margin-top: 20px;
+    }
+
+    /deep/ textarea {
+        color: #6DC1FF;
+    }
+
+    /deep/ .el-table__empty-text {
+        color: #015B9E;
+    }
+
+    /deep/ .el-input.is-disabled .el-input__inner {
+        background-color: #015B9E;
+    }
+
+    .red {
+        color: red;
+    }
+
+    .yellow {
+        color: #fd0;
+    }
 </style>

+ 232 - 0
src/views/Recordbak.vue

@@ -0,0 +1,232 @@
+<template>
+    <div>
+        <div class="panel">
+            <h5 class="panel-title">手机信号监测记录</h5>
+            <div class="panel-body">
+                <div class=" panel_control">
+                    <el-row :gutter="20">
+                        <el-col :span="4">
+                            <em>起始:</em>
+                            <el-date-picker
+                                    class="panel_data"
+                                    v-model="panel.time1[0]"
+                                    type="date"
+                                    placeholder="起始日期">
+                            </el-date-picker>
+                        </el-col>
+                        <el-col :span="4">
+                            <em>截止:</em>
+                            <el-date-picker
+                                    class="panel_data"
+                                    v-model="panel.time1[1]"
+                                    type="date"
+                                    placeholder="截止日期">
+                            </el-date-picker>
+                        </el-col>
+                        <el-col :span="4">
+                            <em>用户账号:</em>
+                            <el-input v-model="panel.USERCODE" placeholder="请输入用户账号"></el-input>
+                        </el-col>
+                        <el-col :span="4">
+                            <em>关键词:</em>
+                            <el-input v-model="panel.keyword" placeholder="请输入关键词"></el-input>
+                        </el-col>
+                        <el-col :span="4">
+                            <em>状态:</em>
+                            <el-select v-model="panel.taskstatus">
+                                <el-option
+                                        v-for="item in panel.options"
+                                        :key="item.value"
+                                        :label="item.label"
+                                        :value="item.value">
+                                </el-option>
+                            </el-select>
+                        </el-col>
+                        <el-col :span="4">
+                            <el-button size="small" type="primary" @click="query">查询</el-button>
+                        </el-col>
+                    </el-row>
+                </div>
+            </div>
+        </div>
+            <el-table
+                    :data="tableData"
+                    class=""
+                    stripe
+                    >
+                <el-table-column
+                        prop="date"
+                        label="日期"
+                        width="180">
+                </el-table-column>
+                <el-table-column
+                        prop="name"
+                        label="姓名"
+                        width="180">
+                </el-table-column>
+                <el-table-column
+                        prop="address"
+                        label="地址">
+                </el-table-column>
+            </el-table>
+            <br>
+            <el-pagination
+                    background
+                    :total="pageination.total"
+                    :page-size="pageination.pageItem"
+                    @current-change="pageChange"
+            ></el-pagination>
+    </div>
+
+</template>
+
+<script>
+    import Global from '../Global.js'
+
+    export default {
+        data() {
+            return {
+                // panel 配置项目
+                panel: {
+                    usercode: '',
+                    username: '',
+                    compname: '',
+                    keyword: '',
+                    USERCODE: '',
+                    taskstatus: 99,
+                    options: [
+                        {value: 99, label: '全部'},
+                        {value: 1, label: '进行中'},
+                        {value: 2, label: '已完成'},
+                    ],
+                    time1: globalBt(),
+                },
+                pageination: {
+                    pageItem: 100,
+                    pageoptions: pageOptions(),
+                    total: 100,
+                    pageIndex: 1,
+                },
+                tableData: [{
+                    date: '2016-05-02',
+                    name: '王小虎',
+                    address: '上海市普陀区金沙江路 1518 弄'
+                }, {
+                    date: '2016-05-04',
+                    name: '王小虎',
+                    address: '上海市普陀区金沙江路 1517 弄'
+                }, {
+                    date: '2016-05-01',
+                    name: '王小虎',
+                    address: '上海市普陀区金沙江路 1519 弄'
+                }, {
+                    date: '2016-05-03',
+                    name: '王小虎',
+                    address: '上海市普陀区金沙江路 1516 弄'
+                }]
+            }
+        },
+        mounted() {
+            this.getTableQuery();
+        },
+        methods: {
+            // 查询按钮
+            query() {
+                this.getTableQuery();
+                this.$message.success('查询完毕');
+            },
+            // 页面数据查询
+            getTableQuery() {
+                // let that = this;
+                // that.loading = true;
+                // let url = headapi + '?ctl=ajax&mod=dial&act=taskListQuery';//获取
+                // let param = {
+                //     'taskstatus': that.panel.taskstatus,
+                //     'bt': globaltime2String(that.panel.time1[0]),
+                //     'et': globaltime2String(that.panel.time1[1]),
+                //     'KEYWORD': that.panel.keyword,
+                //     'USERCODE': that.panel.USERCODE,
+                // };
+                // let JSON = '';
+                // let postdata = qs.stringify(param);
+                // axios.post(url, postdata)
+                //     .then(function (response) {
+                //         JSON = response.data;
+                //         that.loading = false;
+                //         that.allTableData = JSON.rs;
+                //         that.recordsTotal = JSON.rs.length;
+                //         // 设置分页数据
+                //         that.setPaginations();
+                //     })
+                //     .catch(function (error) {
+                //         console.log(error);
+                //     });
+            },
+            // 导出excel
+            btnExpAll() {
+                let that = this;
+                let url = headapi + '?ctl=ajax&mod=czgl&act=czcx_excel';//获取
+                let bt = globaltime2String(that.panel.time1[0]);
+                let et = globaltime2String(that.panel.time1[1]);
+                let usercode = that.panel.usercode;
+                window.location = url + '&bt=' + bt + '&et=' + et + '&usercode=' + usercode;
+            },
+            // 设置分页数据
+            setPaginations() {
+                // 分页属性
+                let that = this;
+                that.pageination.total = that.recordsTotal;
+                // 默认分页
+                that.tableData = that.allTableData.filter((item, index) => {
+                    return index < that.pageination.pageItem;
+                });
+            },
+            // 每页显示数量
+            handleSizeChange() {
+                let that = this;
+                that.tableData = that.allTableData.filter((item, index) => {
+                    return index < that.pageination.pageItem;
+                });
+                that.draw = that.pageination.pageItem;
+                that.getTableQuery();
+            },
+            // 翻页
+            pageChange(pageIndex) {
+                let that = this;
+                // 获取当前页
+                let index = that.pageination.pageItem * (pageIndex - 1);
+                // 数据总数
+                let nums = that.pageination.pageItem * pageIndex;
+                // 容器
+                let tables = [];
+                for (var i = index; i < nums; i++) {
+                    if (that.allTableData[i]) {
+                        tables.push(that.allTableData[i])
+                    }
+                    this.tableData = tables;
+                }
+                that.start = index * that.draw;
+                that.getTableQuery();
+            },
+            // 自动排序
+            sortChange(params) {
+                console.log(params)
+            },
+            // 过滤时间
+            filterFmtDate(value, row, column) {
+                let that = this;
+                return globalfmtDate(column, 11);
+            },
+            // 过滤金额
+            filterMoney(value, row, column) {
+                let that = this;
+                return parseFloat(column).toFixed(2);
+            },
+        },
+    }
+</script>
+
+<style scoped>
+    @import "../assets/css/panel.css";
+
+</style>

+ 8 - 3
src/views/Region.vue

@@ -30,6 +30,8 @@
                 class=""
                 @selection-change="handleSelectionChange"
                 stripe
+                ref="multipleTable"
+                @row-click="handle"
         >
             <el-table-column
                     type="selection"
@@ -118,7 +120,7 @@
                         <label>
                             备注
                         </label>
-                        <el-input v-model="dialog.memo"  type="textarea"></el-input>
+                        <el-input v-model="dialog.memo" type="textarea"></el-input>
                     </el-col>
                 </el-row>
             </div>
@@ -224,6 +226,9 @@
             this.getTableQuery();
         },
         methods: {
+            handle(row, column, event) {
+                this.$refs.multipleTable.toggleRowSelection(row);
+            },
             // 页面数据查询
             getTableQuery() {
                 let that = this;
@@ -417,10 +422,10 @@
             delList() {
                 let that = this;
                 // checkNum
-                if (!this.multipleSelection.length) {
+                if (!this.multipleSelection.length && this.multipleSelection.length != 1) {
                     that.$message({
                         showClose: true,
-                        message: '错了哦,需要先选中至少一条记录',
+                        message: '错了哦,需要先选中一条记录',
                         type: 'error'
                     });
                     return false

+ 957 - 0
src/views/addTactics.vue

@@ -0,0 +1,957 @@
+<template>
+    <div class="content">
+        <div class="tabs">
+            <ul>
+                <li v-for="(tab,i) in tabs" @click="goTab(tab.url)" :class="{'active':tabIndex == i}">
+                    {{tab.name}}
+                </li>
+            </ul>
+        </div>
+        <div class="panel">
+            <div class="panel-body">
+                <div class=" panel_control">
+                    <div class="panel_title">
+                        <i></i>
+                        基本信息
+                    </div>
+                </div>
+                <div class=" panel_control">
+                    <div class="pline">
+                        <em>设备ID:</em>
+                        <el-input v-model="panel.tagname" placeholder=""></el-input>
+                    </div>
+                    <div class="pline">
+                        <em>MAC地址:</em>
+                        <el-input v-model="panel.tagname" placeholder=""></el-input>
+                    </div>
+                    <div class="pline">
+                        <em>所属区域:</em>
+                        <el-select v-model="panel.regionid">
+                            <el-option
+                                    v-for="item in panel.regionidOptions"
+                                    :key="item.Id"
+                                    :label="item.Name"
+                                    :value="item.Id">
+                            </el-option>
+                        </el-select>
+                    </div>
+                </div>
+                <div class="panel_control">
+                    <div class="panel_title">
+                        <i></i>
+                        扫描选项
+                    </div>
+                </div>
+                <div class="panel_control">
+                    <div class="pline">
+                        <el-button size="medium" type="primary" @click="query">查询</el-button>
+                    </div>
+                    <div class="pline pull-right">
+                        <el-button size="medium" type="primary" @click="addList">添加</el-button>
+                        <el-button size="medium" type="primary" @click="editList">修改</el-button>
+                        <el-button size="medium" type="primary" @click="delList">删除</el-button>
+                    </div>
+                </div>
+            </div>
+        </div>
+        <el-table
+                :data="tableData"
+                is-horizontal-resize
+                :default-sort="{prop: 'date', order: 'descending'}"
+                v-loading="loading"
+                element-loading-background="rgba(0, 0, 0, 0.8)"
+                class=""
+                @selection-change="handleSelectionChange"
+                stripe
+                ref="multipleTable"
+                @row-click="handle"
+        >
+            <el-table-column
+                    type="selection"
+                    width="55">
+            </el-table-column>
+            <el-table-column
+                    type="index"
+                    label="序号"
+                    width="60"
+                    sortable
+            >
+            </el-table-column>
+            <el-table-column
+                    prop="Mac"
+                    label="区域名称"
+            >
+            </el-table-column>
+            <el-table-column
+                    prop="Xmax"
+                    label="长/m"
+            >
+            </el-table-column>
+            <el-table-column
+                    prop="Ymax"
+                    label="宽/m"
+            >
+            </el-table-column>
+            <el-table-column
+                    prop="Memo"
+                    label="备注"
+            >
+            </el-table-column>
+            <el-table-column
+                    prop="address"
+                    label="操作记录"
+                    width="220"
+            >
+                <template slot-scope="scope">
+                    <!--<el-button class="" type="text" @click="goPhoneRecord(scope.row)">手机信号记录</el-button>-->
+                    <el-button class="" type="primary" size="small" @click="goWifiRecord(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)">启用-->
+                    <!--</el-button>-->
+                </template>
+            </el-table-column>
+        </el-table>
+        <br>
+        <!--<el-pagination-->
+                <!--background-->
+                <!--:total="pageination.total"-->
+                <!--:page-size="pageination.pageItem"-->
+                <!--@current-change="pageChange"-->
+        <!--&gt;</el-pagination>-->
+        <div class="btm_control">
+            <el-button size="medium" type="primary" @click="addList">取消</el-button>
+            <el-button size="medium" type="primary" @click="editList">确定</el-button>
+        </div>
+
+        <dialog_referrer_list
+                :show="dialog_state"
+                :title="dialog_title"
+                :large="true"
+                @dialog_cancel="dialog_cancel"
+                @dialog_ok="dialog_ok"
+        >
+            <div class="dialogContent">
+                <el-row :gutter="24">
+                    <el-col :span="24">
+                        <label>
+                            区域名称
+                        </label>
+                        <el-input v-model="dialog.mac" @keyup.native="autoCompleteMac"
+                                  :disabled="dialog_type == 2"></el-input>
+                    </el-col>
+                    <el-col :span="12">
+                        <label>
+                            长/m
+                        </label>
+                        <el-input v-model="dialog.tagname"></el-input>
+                    </el-col>
+                    <el-col :span="12">
+                        <label>
+                            宽/m
+                        </label>
+                        <el-input v-model="dialog.tagname"></el-input>
+                    </el-col>
+                    <el-col :span="24">
+                        <label>
+                            备注
+                        </label>
+                        <el-input v-model="dialog.memo"  type="textarea"></el-input>
+                    </el-col>
+                </el-row>
+            </div>
+        </dialog_referrer_list>
+    </div>
+</template>
+
+<script>
+    import Global from '../Global.js'
+    import dialog_referrer_list from '../components/dialog_referrer_list'
+    import {
+        DetectorQuery,
+        GetChildRegionSelect,
+        DetectorEditStatus,
+        RegionPictureGetByRegionId,
+        DetectorAdd,
+        RegionList,
+        DetectorList,
+        DetectorEdit,
+        GetDetectorCoords,
+        GeFullRegionSelect,
+    } from '../api/getApiRes.js'
+
+    let qs = require('qs');
+    export default {
+        data() {
+            return {
+                // dialog
+                dialog_state: false,
+                dialog_title: '',
+                dialog_type: '',//类型,1是添加,2是修改
+                dialog: {
+                    mac: '',
+                    comId: 1,
+                    regionlevelOneId: 0,
+                    regionId: 0,
+                    tagname: '',
+                    longitude: 0,
+                    latitude: 0,
+                    HardwareVersion: '',
+                    FirmwareVersion: '',
+                    FirmwareScanM4Version: '',
+                    FirmwareScanM0Version: '',
+                    purchasesrc: '',
+                    location: '',
+                    coords_memo: '',
+                    memo: '',
+                    plateImgSrc: '',
+                    regionlevelOneIdOptions: [],
+                    regionIdRoomOptions: [],
+                    points: [],
+                    CoordsId: 0,
+                    status: 0,
+                },
+                tabIndex: 0,
+                tabs: [
+                    {name: '扫描策略新增', url: 'addTactics'},
+                ],
+                // panel 配置项目
+                panel: {
+                    usercode: '',
+                    username: '',
+                    compname: '',
+                    keyword: '',
+                    USERCODE: '',
+                    taskstatus: 99,
+                    regionid: 0,
+                    regionid2: '',
+                    regionidOptions: [],
+                    regionidOptions2: [],
+                    options: [
+                        {value: 99, label: '全部'},
+                        {value: 1, label: '进行中'},
+                        {value: 2, label: '已完成'},
+                    ],
+                    time1: globalBt3(2),
+                },
+                pageination: {
+                    pageItem: 100,
+                    pageoptions: pageOptions(),
+                    total: 500,
+                    pageIndex: 1,
+                },
+                draw: 1,
+                start: 0,
+                recordsTotal: 0,
+                tableData: [],
+                allTableData: [],
+                limit: '10',
+                multipleSort: false,
+                loading: true,
+                fileList: [],
+                multipleSelection: [],
+                detectedmac: '',
+            }
+        },
+        mounted() {
+            if (this.$route.query.RegionId) {
+                this.panel.regionid = this.$route.query.RegionId;
+                this.panel.tagname = this.$route.query.TagName;
+            }
+
+            this.getTableQuery();
+        },
+        methods: {
+            handle(row, column, event) {
+                this.$refs.multipleTable.toggleRowSelection(row);
+            },
+            // 页面数据查询
+            getTableQuery() {
+                let that = this;
+                // this.getGetChildRegionSelect(0, 1);
+                this.getGeFullRegionSelect();
+                that.loading = true;
+                // 查询检测设备。上级区域id,区域id必传。regionid传0,查询supregionid对应所有子区域的检测设备。 如果supregionid,regionid都传0,默认查询企业ID下所有检测设备
+                let param = {
+                    token: localStorage.token,
+                    mac: this.panel.mac,//
+                    regionId: that.panel.regionId,//
+                    name: that.panel.tagname,//标签名
+                    comid: 1,//
+                    start: 1,//
+                    tableMax: 9999,//
+                };
+                let postdata = qs.stringify(param);
+                DetectorList(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.loading = false;
+                        if (json.Rs) {
+                            that.allTableData = json.Rs;
+                            console.log(json.Rs);
+                            that.recordsTotal = json.Rs.length;
+                        } else {
+                            that.allTableData = [];
+                            that.recordsTotal = 0;
+                        }
+                        // 设置分页数据
+                        that.setPaginations();
+                    } else {
+                        that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                    }
+                })
+            },
+            // 获取下级列表
+            getGeFullRegionSelect() {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                };
+                let postdata = qs.stringify(param);
+                RegionList(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        if (!json.Rs) {
+                            that.$message.error('区域列表为空,请先添加有效区域');
+                            return false
+                        }
+                        that.panel.regionidOptions = json.Rs;
+                        that.panel.regionidOptions.unshift({Id: 0, Name: "全部", DisplayName: "全部"});
+                    } else {
+                        that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                    }
+                })
+            },
+            // dialog获取下级列表
+            dialoggetGeFullRegionSelect() {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                };
+                let postdata = qs.stringify(param);
+                RegionList(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.dialog.regionlevelOneIdOptions = json.Rs;
+                        that.dialog.regionId = json.Rs[0].Id;
+                    } else {
+                        that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                    }
+                })
+            },
+            // dialog获取区域下级菜单
+            dialogGetGetChildRegionSelect(regionId, level) {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    regionId: regionId,
+                };
+                let postdata = qs.stringify(param);
+                RegionList(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.dialog.regionlevelOneIdOptions = json.Rs;
+                        that.dialog.regionlevelOneId = regionId;
+                        // if (level == 1) {
+                        //     console.log(json.Rs);
+                        //     that.dialog.regionlevelOneIdOptions = json.Rs;
+                        //     that.dialog.regionlevelOneId = regionId;
+                        // } else {
+                        //     if (json.Rs) {
+                        //         console.log(123);
+                        //         that.dialog.regionIdRoomOptions = json.Rs;
+                        //         that.dialog.regionId = regionId;
+                        //     } else {
+                        //         that.dialog.regionIdRoomOptions = [];
+                        //         that.dialog.regionId = '';
+                        //     }
+                        // }
+                    } else {
+                        that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                    }
+                })
+            },
+            // 跳转tab页面
+            goTab(url) {
+                this.$router.push({path: url});
+            },
+            // 查询按钮
+            query() {
+                this.getTableQuery();
+                this.$message.success('查询完毕');
+            },
+
+            handleSelectionChange(val) {
+                this.multipleSelection = val;
+            },
+            // 设置分页数据
+            setPaginations() {
+                // 分页属性
+                let that = this;
+                that.pageination.total = that.recordsTotal;
+                // 默认分页
+                that.tableData = that.allTableData.filter((item, index) => {
+                    return index < that.pageination.pageItem;
+                });
+            },
+            // 每页显示数量
+            handleSizeChange() {
+                let that = this;
+                that.tableData = that.allTableData.filter((item, index) => {
+                    return index < that.pageination.pageItem;
+                });
+                that.draw = that.pageination.pageItem;
+                // that.getTableQuery();
+            },
+            // 翻页
+            pageChange(pageIndex) {
+                let that = this;
+                // 获取当前页
+                let index = that.pageination.pageItem * (pageIndex - 1);
+                // 数据总数
+                let nums = that.pageination.pageItem * pageIndex;
+                // 容器
+                let tables = [];
+                for (var i = index; i < nums; i++) {
+                    if (that.allTableData[i]) {
+                        tables.push(that.allTableData[i])
+                    }
+                    this.tableData = tables;
+                }
+                that.start = index * that.draw;
+                // that.getTableQuery();
+            },
+            // 自动排序
+            sortChange(params) {
+                console.log(params)
+            },
+            // 过滤时间
+            filterFmtDate(value, row, column) {
+                return globalfmtDate(column, 11);
+            },
+            addList() {
+                this.dialog_state = true;
+                this.dialog_title = '添加监控区域';
+                this.dialog_type = 1;
+
+                // 重载地区列表
+                this.getGeFullRegionSelect();
+
+                // clear dialog
+                this.dialog.mac = '';
+                this.dialog.regionId = '';
+                this.dialog.tagname = '';
+                this.dialog.HardwareVersion = '';
+                this.dialog.FirmwareVersion = '';
+                this.dialog.FirmwareScanM4Version = '';
+                this.dialog.FirmwareScanM0Version = '';
+                this.dialog.location = '';
+                this.dialog.purchasesrc = '';
+                this.dialog.memo = '';
+                this.dialog.coords_memo = '';
+                this.dialog.points = [{}];
+
+                // 加载默认的平面图
+                // this.dialogGetGetChildRegionSelect(0, 1);
+                this.dialoggetGeFullRegionSelect()
+            },
+            delList() {
+                let that = this;
+                // checkNum
+                if (!this.multipleSelection.length) {
+                    that.$message({
+                        showClose: true,
+                        message: '错了哦,需要先选中至少一条记录',
+                        type: 'error'
+                    });
+                    return false
+                }
+                let detectorid = that.multipleSelection[0].Id;
+
+                let param = {
+                    token: localStorage.token,
+                    detectorid: detectorid,
+                    status: 9,//0禁用1启用9删除
+                };
+                let postdata = qs.stringify(param);
+
+                this.$confirm('此操作将永久删除该设备, 是否继续?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    DetectorEditStatus(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: '已取消删除'
+                    });
+                });
+            },
+            editList() {
+                let that = this;
+                // checkNum
+                if (!this.multipleSelection.length) {
+                    this.$message({
+                        showClose: true,
+                        message: '错了哦,需要先选中一条记录',
+                        type: 'error'
+                    });
+                    return false
+                }
+                if (this.multipleSelection.length > 1) {
+                    this.$message({
+                        showClose: true,
+                        message: '错了哦,只能选中一条记录',
+                        type: 'error'
+                    });
+                    return false
+                }
+                this.dialog_state = true;
+                this.dialog_title = '修改设备信息';
+                this.dialog_type = 2;
+
+                // 读取本条记录
+                let row = this.multipleSelection[0];
+                this.dialog.eqId = row.Id;
+                this.dialog.mac = row.Mac;
+                this.dialog.regionId = row.RegionId;
+                this.dialog.tagname = row.TagName;
+                this.dialog.HardwareVersion = row.HardwareVersion;
+                this.dialog.FirmwareVersion = row.FirmwareVersion;
+                this.dialog.FirmwareScanM4Version = row.FirmwareScanM4Version;
+                this.dialog.FirmwareScanM0Version = row.FirmwareScanM0Version;
+                this.dialog.location = row.Location;
+                this.dialog.purchasesrc = row.PurchaseSrc;
+                this.dialog.memo = row.Memo;
+                this.dialog.regionlevelOneId = row.RegionId;
+                this.dialog.status = row.Status;
+                // this.dialog.coords_memo = row.coords_memo;
+
+                // 重载地区列表
+                this.getGeFullRegionSelect();
+
+                that.dialog.points = [{x: row.X, y: row.Y}];
+
+                // let param = {
+                //     token: localStorage.token,
+                //     detectorId: row.Id,
+                // };
+                // let postdata = qs.stringify(param);
+                // GetDetectorCoords(postdata).then(res => {
+                //     let json = res;
+                //     if (json.Code == 0) {
+                //         if (json.Rs.length != 0) {
+                //             console.log(json.Rs[0]);
+                //             // that.dialog.points = [{x: json.Rs[0].X, y: json.Rs[0].Y}];
+                //             that.dialog.points = [{x: json.Rs.X, y: json.Rs.Y}];
+                //             // that.dialog.CoordsId = json.Rs[0].CoordsId;
+                //             // that.dialog.coords_memo = json.Rs[0].Memo;
+                //         } else {
+                //             that.dialog.points = [{x: 0, y: 0}];
+                //             that.dialog.CoordsId = 0;
+                //         }
+                //     } else {
+                //         that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                //     }
+                // })
+            },
+            // 自动补全MAC
+            autoCompleteMac() {
+                let text = this.dialog.mac;
+                if (text.length == 2 || text.length == 5 || text.length == 8 || text.length == 11 || text.length == 14) {
+                    this.dialog.mac = this.dialog.mac.toUpperCase() + ":"
+                }
+                if (text.length > 14) {
+                    this.dialog.mac = this.dialog.mac.toUpperCase()
+                }
+            },
+            // 探测记录
+            goPhoneRecord(row) {
+                this.$router.push({
+                    path: '/phoneSign',
+                    query:
+                        {
+                            detectorid: row.Id,
+                            comId: 1,
+                            regionId: row.RegionId,
+                        }
+                });
+            },
+            // 探测记录
+            goWifiRecord(row) {
+                this.$router.push({
+                    path: '/wifiSign',
+                    query:
+                        {
+                            detectorid: row.Id,
+                            comId: 1,
+                            regionId: row.RegionId,
+                        }
+                });
+            },
+            dialog_cancel() {
+                let that = this;
+                that.dialog_state = false;
+            },
+            dialog_ok() {
+                if (this.dialog_type == 1) {
+                    this.confirmAddEquip();
+                } else {
+                    this.confirmEditEquip();
+                }
+            },
+            // 提交增加新设备
+            confirmAddEquip() {
+                let that = this;
+                // checkVal
+                if (!that.dialog.mac) {
+                    this.$message.error('错了哦,mac不能为空');
+                    return false
+                }
+                if (!checkMac(that.dialog.mac)) {
+                    this.$message.error('错了哦,mac格式不正确');
+                    return false
+                }
+                if (!that.dialog.regionId) {
+                    this.$message.error('错了哦,所属区域不能为空');
+                    return false
+                }
+                if (!that.dialog.tagname) {
+                    this.$message.error('错了哦,标签名不能为空');
+                    return false
+                }
+                if (that.dialog.tagname.length > 20) {
+                    this.$message.error('错了哦,标签名不能超过20个字符');
+                    return false
+                }
+                this.selectRegionLabel(that.dialog.regionId);
+                let param = {
+                    token: localStorage.token,
+                    mac: that.dialog.mac,
+                    comId: 1,
+                    regionId: that.dialog.regionId,
+                    name: that.dialog.tagname,
+                    HardwareVersion: that.dialog.HardwareVersion,
+                    FirmwareVersion: that.dialog.FirmwareVersion,
+                    FirmwareScanM4Version: that.dialog.FirmwareScanM4Version,
+                    FirmwareScanM0Version: that.dialog.FirmwareScanM0Version,
+                    location: that.dialog.location,
+                    purchasesrc: that.dialog.purchasesrc,
+                    x: that.dialog.points[0].x,
+                    y: that.dialog.points[0].y,
+                    // coords_memo: that.dialog.coords_memo,
+                    memo: that.dialog.memo,
+                };
+                let postdata = qs.stringify(param);
+                DetectorAdd(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);
+                    }
+                });
+            },
+            // 提交修改设备信息
+            confirmEditEquip() {
+                let that = this;
+                // checkVal
+                if (!that.dialog.mac) {
+                    this.$message.error('错了哦,mac不能为空');
+                    return false
+                }
+                if (!checkMac(that.dialog.mac)) {
+                    this.$message.error('错了哦,mac格式不正确');
+                    return false
+                }
+
+                if (!that.dialog.regionId) {
+                    this.$message.error('错了哦,所属区域不能为空');
+                    return false
+                }
+                if (!that.dialog.tagname) {
+                    this.$message.error('错了哦,标签名不能为空');
+                    return false
+                }
+                if (that.dialog.tagname.length > 20) {
+                    this.$message.error('错了哦,标签名不能超过20个字符');
+                    return false
+                }
+                this.selectRegionLabel(that.dialog.regionId);
+                let param = {
+                    token: localStorage.token,
+                    id: that.dialog.eqId,
+                    mac: that.dialog.mac,
+                    comId: 1,
+                    regionId: that.dialog.regionId,
+                    name: that.dialog.tagname,
+                    HardwareVersion: that.dialog.HardwareVersion,
+                    FirmwareVersion: that.dialog.FirmwareVersion,
+                    FirmwareScanM4Version: that.dialog.FirmwareScanM4Version,
+                    FirmwareScanM0Version: that.dialog.FirmwareScanM0Version,
+                    location: that.dialog.location,
+                    purchasesrc: that.dialog.purchasesrc,
+                    x: that.dialog.points[0].x,
+                    y: that.dialog.points[0].y,
+                    coords_memo: that.dialog.coords_memo,
+                    memo: that.dialog.memo,
+                    coordsType: 1,//坐标状态 0:禁用, 1:启用, 9:删除,没有就传0
+                    coordsID: that.dialog.CoordsId,
+                    status: that.dialog.status,
+                };
+
+                let postdata = qs.stringify(param);
+                DetectorEdit(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);
+                    }
+                });
+            },
+            // 修改设备状态
+            getDetectorEditStatus(detectorid, status, text) {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    detectorid: detectorid,
+                    status: status,
+                };
+                let postdata = qs.stringify(param);
+                DetectorEditStatus(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.$message({
+                            showClose: true,
+                            message: text + '成功!',
+                            type: 'success'
+                        });
+                        // table 重载
+                        that.getTableQuery();
+                    } else {
+                        that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                    }
+                })
+            },
+            // 禁用
+            pauseRow(row) {
+                let that = this;
+                this.$confirm('是否禁用' + row.TagName + '设备?', '禁用操作', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    that.getDetectorEditStatus(row.Id, 0, '禁用');
+                }).catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消禁用'
+                    });
+                });
+            },
+            // 获取区域位置的平面图
+            getRegionPictureGetByRegionId(regionID) {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    regionID: regionID,
+                    regionId: regionID,
+                };
+                let postdata = qs.stringify(param);
+                that.dialog.plateImgSrc = '../assets/img/main/grid.png'
+                // RegionPictureGetByRegionId(postdata).then(res => {
+                //     let json = res;
+                //     that.dialog.plateImgSrc = '';
+                //     if (json.Code == 0) {
+                //         that.dialog.plateImgSrc = json.EncodeString;
+                //     } else {
+                //         that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                //     }
+                // })
+            },
+            // 启用
+            runRow(row) {
+                console.log(row);
+                let that = this;
+                this.$confirm('是否启用' + row.TagName + '设备?', '启用操作', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    that.getDetectorEditStatus(row.Id, 1, '启用');
+                }).catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消启用'
+                    });
+                });
+            },
+            // 添加探测器位置的点坐标
+            addPoint(e) {
+                let x = e.offsetX;
+                let y = e.offsetY;
+                this.dialog.points = [{x: x, y: y}];
+            },
+            // 获取位置的文字内容
+            selectRegionLabel(id) {
+                let that = this;
+                let selectedWorkName = {};
+                // selectedWorkName = that.dialog.regionIdRoomOptions.filter(item => {
+                selectedWorkName = that.dialog.regionlevelOneIdOptions.filter(item => {
+                    if (item.Id === id) {
+                        console.log(item.Name);
+                        that.dialog.location = item.Name;
+                    }
+                });
+            },
+            filterTime(val, row, column) {
+                return nonTfmtDate(column, 10);
+            }
+        },
+        watch: {
+            // 'dialog.regionlevelOneId': function (val) {
+            //     this.dialogGetGetChildRegionSelect(val, 2)
+            // },
+            'dialog.regionId': function (val) {
+                if (val) {
+                    this.getRegionPictureGetByRegionId(val);
+                }
+            },
+        },
+        components: {
+            dialog_referrer_list
+        }
+    }
+</script>
+
+<style scoped>
+    @import "../assets/css/panel.css";
+    @import "../assets/css/dialog.css";
+
+    .tabs ul {
+        width: 168px;
+        float: left;
+    }
+
+    table span {
+        cursor: pointer;
+    }
+
+    .down_btn {
+        float: left;
+    }
+
+    .content {
+        width: 98%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        padding-left: 20px;
+    }
+
+    .selectStyle {
+        width: 100%;
+        color: #005EA2;
+    }
+
+    .selectStyle ::placeholder {
+        color: #005EA2;
+    }
+
+    /deep/ .modal .el-select .el-input .el-select__caret {
+        position: relative;
+        top: 35px;
+    }
+
+    .imgContianer {
+        width: 100%;
+        height: 340px;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+    }
+
+    .imgContianer img {
+        width: 100%;
+        height: 100%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+    }
+
+    .pointers {
+        position: relative;
+        bottom: 340px;
+        width: 100%;
+        height: 100%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+    }
+
+    .imgContianer i {
+        position: relative;
+        width: 10px;
+        height: 10px;
+        float: left;
+        border-radius: 250px;
+        background: #FFDD00;
+    }
+
+    /deep/ .modal-dialog {
+        height: 80px;
+        margin-top: 20px;
+    }
+
+    /deep/ textarea {
+        color: #6DC1FF;
+    }
+
+    /deep/ .el-table__empty-text {
+        color: #015B9E;
+    }
+
+    /deep/ .el-input.is-disabled .el-input__inner {
+        background-color: #015B9E;
+    }
+
+    .red {
+        color: red;
+    }
+
+    .yellow {
+        color: #fd0;
+    }
+</style>

+ 940 - 0
src/views/plan.vue

@@ -0,0 +1,940 @@
+<template>
+    <div class="content">
+        <div class="tabs">
+            <ul>
+                <li v-for="(tab,i) in tabs" @click="goTab(tab.url)" :class="{'active':tabIndex == i}">
+                    {{tab.name}}
+                </li>
+            </ul>
+        </div>
+        <div class="panel">
+            <div class="panel-body">
+                <div class=" panel_control">
+                    <div class="pline">
+                        <em>设备ID:</em>
+                        <el-input v-model="panel.tagname" placeholder=""></el-input>
+                    </div>
+                    <div class="pline">
+                        <em>MAC地址:</em>
+                        <el-input v-model="panel.tagname" placeholder=""></el-input>
+                    </div>
+                    <div class="pline">
+                        <em>所属区域:</em>
+                        <el-select v-model="panel.regionid">
+                            <el-option
+                                    v-for="item in panel.regionidOptions"
+                                    :key="item.Id"
+                                    :label="item.Name"
+                                    :value="item.Id">
+                            </el-option>
+                        </el-select>
+                    </div>
+                    <div class="pline">
+                        <el-button size="medium" type="primary" @click="query">查询</el-button>
+                    </div>
+                    <div class="pline pull-right">
+                        <el-button size="medium" type="primary" @click="addList">添加</el-button>
+                        <el-button size="medium" type="primary" @click="editList">修改</el-button>
+                        <el-button size="medium" type="primary" @click="delList">删除</el-button>
+                    </div>
+                </div>
+            </div>
+        </div>
+        <el-table
+                :data="tableData"
+                is-horizontal-resize
+                :default-sort="{prop: 'date', order: 'descending'}"
+                v-loading="loading"
+                element-loading-background="rgba(0, 0, 0, 0.8)"
+                class=""
+                @selection-change="handleSelectionChange"
+                stripe
+                ref="multipleTable"
+                @row-click="handle"
+        >
+            <el-table-column
+                    type="selection"
+                    width="55">
+            </el-table-column>
+            <el-table-column
+                    type="index"
+                    label="序号"
+                    width="60"
+                    sortable
+            >
+            </el-table-column>
+            <el-table-column
+                    prop="Mac"
+                    label="区域名称"
+            >
+            </el-table-column>
+            <el-table-column
+                    prop="Xmax"
+                    label="长/m"
+            >
+            </el-table-column>
+            <el-table-column
+                    prop="Ymax"
+                    label="宽/m"
+            >
+            </el-table-column>
+            <el-table-column
+                    prop="Memo"
+                    label="备注"
+            >
+            </el-table-column>
+            <el-table-column
+                    prop="address"
+                    label="操作记录"
+                    width="220"
+            >
+                <template slot-scope="scope">
+                    <!--<el-button class="" type="text" @click="goPhoneRecord(scope.row)">手机信号记录</el-button>-->
+                    <el-button class="" type="primary" size="small" @click="goWifiRecord(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)">启用-->
+                    <!--</el-button>-->
+                </template>
+            </el-table-column>
+        </el-table>
+        <br>
+        <el-pagination
+                background
+                :total="pageination.total"
+                :page-size="pageination.pageItem"
+                @current-change="pageChange"
+        ></el-pagination>
+
+        <!--<el-button class="down_btn" type="primary" @click="goPoster(scope.row)">下载驱动器todo</el-button>-->
+        <dialog_referrer_list
+                :show="dialog_state"
+                :title="dialog_title"
+                :large="true"
+                @dialog_cancel="dialog_cancel"
+                @dialog_ok="dialog_ok"
+        >
+            <div class="dialogContent">
+                <el-row :gutter="24">
+                    <el-col :span="24">
+                        <label>
+                            区域名称
+                        </label>
+                        <el-input v-model="dialog.mac" @keyup.native="autoCompleteMac"
+                                  :disabled="dialog_type == 2"></el-input>
+                    </el-col>
+                    <el-col :span="12">
+                        <label>
+                            长/m
+                        </label>
+                        <el-input v-model="dialog.tagname"></el-input>
+                    </el-col>
+                    <el-col :span="12">
+                        <label>
+                            宽/m
+                        </label>
+                        <el-input v-model="dialog.tagname"></el-input>
+                    </el-col>
+                    <el-col :span="24">
+                        <label>
+                            备注
+                        </label>
+                        <el-input v-model="dialog.memo"  type="textarea"></el-input>
+                    </el-col>
+                </el-row>
+            </div>
+        </dialog_referrer_list>
+    </div>
+</template>
+
+<script>
+    import Global from '../Global.js'
+    import dialog_referrer_list from '../components/dialog_referrer_list'
+    import {
+        DetectorQuery,
+        GetChildRegionSelect,
+        DetectorEditStatus,
+        RegionPictureGetByRegionId,
+        DetectorAdd,
+        RegionList,
+        DetectorList,
+        DetectorEdit,
+        GetDetectorCoords,
+        GeFullRegionSelect,
+    } from '../api/getApiRes.js'
+
+    let qs = require('qs');
+    export default {
+        data() {
+            return {
+                // dialog
+                dialog_state: false,
+                dialog_title: '',
+                dialog_type: '',//类型,1是添加,2是修改
+                dialog: {
+                    mac: '',
+                    comId: 1,
+                    regionlevelOneId: 0,
+                    regionId: 0,
+                    tagname: '',
+                    longitude: 0,
+                    latitude: 0,
+                    HardwareVersion: '',
+                    FirmwareVersion: '',
+                    FirmwareScanM4Version: '',
+                    FirmwareScanM0Version: '',
+                    purchasesrc: '',
+                    location: '',
+                    coords_memo: '',
+                    memo: '',
+                    plateImgSrc: '',
+                    regionlevelOneIdOptions: [],
+                    regionIdRoomOptions: [],
+                    points: [],
+                    CoordsId: 0,
+                    status: 0,
+                },
+                tabIndex: 0,
+                tabs: [
+                    {name: '任务计划管理', url: 'plan'},
+                ],
+                // panel 配置项目
+                panel: {
+                    usercode: '',
+                    username: '',
+                    compname: '',
+                    keyword: '',
+                    USERCODE: '',
+                    taskstatus: 99,
+                    regionid: 0,
+                    regionid2: '',
+                    regionidOptions: [],
+                    regionidOptions2: [],
+                    options: [
+                        {value: 99, label: '全部'},
+                        {value: 1, label: '进行中'},
+                        {value: 2, label: '已完成'},
+                    ],
+                    time1: globalBt3(2),
+                },
+                pageination: {
+                    pageItem: 100,
+                    pageoptions: pageOptions(),
+                    total: 500,
+                    pageIndex: 1,
+                },
+                draw: 1,
+                start: 0,
+                recordsTotal: 0,
+                tableData: [],
+                allTableData: [],
+                limit: '10',
+                multipleSort: false,
+                loading: true,
+                fileList: [],
+                multipleSelection: [],
+                detectedmac: '',
+            }
+        },
+        mounted() {
+            if (this.$route.query.RegionId) {
+                this.panel.regionid = this.$route.query.RegionId;
+                this.panel.tagname = this.$route.query.TagName;
+            }
+
+            this.getTableQuery();
+        },
+        methods: {
+            handle(row, column, event) {
+                this.$refs.multipleTable.toggleRowSelection(row);
+            },
+            // 页面数据查询
+            getTableQuery() {
+                let that = this;
+                // this.getGetChildRegionSelect(0, 1);
+                this.getGeFullRegionSelect();
+                that.loading = true;
+                // 查询检测设备。上级区域id,区域id必传。regionid传0,查询supregionid对应所有子区域的检测设备。 如果supregionid,regionid都传0,默认查询企业ID下所有检测设备
+                let param = {
+                    token: localStorage.token,
+                    mac: this.panel.mac,//
+                    regionId: that.panel.regionId,//
+                    name: that.panel.tagname,//标签名
+                    comid: 1,//
+                    start: 1,//
+                    tableMax: 9999,//
+                };
+                let postdata = qs.stringify(param);
+                DetectorList(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.loading = false;
+                        if (json.Rs) {
+                            that.allTableData = json.Rs;
+                            console.log(json.Rs);
+                            that.recordsTotal = json.Rs.length;
+                        } else {
+                            that.allTableData = [];
+                            that.recordsTotal = 0;
+                        }
+                        // 设置分页数据
+                        that.setPaginations();
+                    } else {
+                        that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                    }
+                })
+            },
+            // 获取下级列表
+            getGeFullRegionSelect() {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                };
+                let postdata = qs.stringify(param);
+                RegionList(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        if (!json.Rs) {
+                            that.$message.error('区域列表为空,请先添加有效区域');
+                            return false
+                        }
+                        that.panel.regionidOptions = json.Rs;
+                        that.panel.regionidOptions.unshift({Id: 0, Name: "全部", DisplayName: "全部"});
+                    } else {
+                        that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                    }
+                })
+            },
+            // dialog获取下级列表
+            dialoggetGeFullRegionSelect() {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                };
+                let postdata = qs.stringify(param);
+                RegionList(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.dialog.regionlevelOneIdOptions = json.Rs;
+                        that.dialog.regionId = json.Rs[0].Id;
+                    } else {
+                        that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                    }
+                })
+            },
+            // dialog获取区域下级菜单
+            dialogGetGetChildRegionSelect(regionId, level) {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    regionId: regionId,
+                };
+                let postdata = qs.stringify(param);
+                RegionList(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.dialog.regionlevelOneIdOptions = json.Rs;
+                        that.dialog.regionlevelOneId = regionId;
+                        // if (level == 1) {
+                        //     console.log(json.Rs);
+                        //     that.dialog.regionlevelOneIdOptions = json.Rs;
+                        //     that.dialog.regionlevelOneId = regionId;
+                        // } else {
+                        //     if (json.Rs) {
+                        //         console.log(123);
+                        //         that.dialog.regionIdRoomOptions = json.Rs;
+                        //         that.dialog.regionId = regionId;
+                        //     } else {
+                        //         that.dialog.regionIdRoomOptions = [];
+                        //         that.dialog.regionId = '';
+                        //     }
+                        // }
+                    } else {
+                        that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                    }
+                })
+            },
+            // 跳转tab页面
+            goTab(url) {
+                this.$router.push({path: url});
+            },
+            // 查询按钮
+            query() {
+                this.getTableQuery();
+                this.$message.success('查询完毕');
+            },
+
+            handleSelectionChange(val) {
+                this.multipleSelection = val;
+            },
+            // 设置分页数据
+            setPaginations() {
+                // 分页属性
+                let that = this;
+                that.pageination.total = that.recordsTotal;
+                // 默认分页
+                that.tableData = that.allTableData.filter((item, index) => {
+                    return index < that.pageination.pageItem;
+                });
+            },
+            // 每页显示数量
+            handleSizeChange() {
+                let that = this;
+                that.tableData = that.allTableData.filter((item, index) => {
+                    return index < that.pageination.pageItem;
+                });
+                that.draw = that.pageination.pageItem;
+                // that.getTableQuery();
+            },
+            // 翻页
+            pageChange(pageIndex) {
+                let that = this;
+                // 获取当前页
+                let index = that.pageination.pageItem * (pageIndex - 1);
+                // 数据总数
+                let nums = that.pageination.pageItem * pageIndex;
+                // 容器
+                let tables = [];
+                for (var i = index; i < nums; i++) {
+                    if (that.allTableData[i]) {
+                        tables.push(that.allTableData[i])
+                    }
+                    this.tableData = tables;
+                }
+                that.start = index * that.draw;
+                // that.getTableQuery();
+            },
+            // 自动排序
+            sortChange(params) {
+                console.log(params)
+            },
+            // 过滤时间
+            filterFmtDate(value, row, column) {
+                return globalfmtDate(column, 11);
+            },
+            addList() {
+                this.dialog_state = true;
+                this.dialog_title = '添加监控区域';
+                this.dialog_type = 1;
+
+                // 重载地区列表
+                this.getGeFullRegionSelect();
+
+                // clear dialog
+                this.dialog.mac = '';
+                this.dialog.regionId = '';
+                this.dialog.tagname = '';
+                this.dialog.HardwareVersion = '';
+                this.dialog.FirmwareVersion = '';
+                this.dialog.FirmwareScanM4Version = '';
+                this.dialog.FirmwareScanM0Version = '';
+                this.dialog.location = '';
+                this.dialog.purchasesrc = '';
+                this.dialog.memo = '';
+                this.dialog.coords_memo = '';
+                this.dialog.points = [{}];
+
+                // 加载默认的平面图
+                // this.dialogGetGetChildRegionSelect(0, 1);
+                this.dialoggetGeFullRegionSelect()
+            },
+            delList() {
+                let that = this;
+                // checkNum
+                if (!this.multipleSelection.length) {
+                    that.$message({
+                        showClose: true,
+                        message: '错了哦,需要先选中至少一条记录',
+                        type: 'error'
+                    });
+                    return false
+                }
+                let detectorid = that.multipleSelection[0].Id;
+
+                let param = {
+                    token: localStorage.token,
+                    detectorid: detectorid,
+                    status: 9,//0禁用1启用9删除
+                };
+                let postdata = qs.stringify(param);
+
+                this.$confirm('此操作将永久删除该设备, 是否继续?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    DetectorEditStatus(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: '已取消删除'
+                    });
+                });
+            },
+            editList() {
+                let that = this;
+                // checkNum
+                if (!this.multipleSelection.length) {
+                    this.$message({
+                        showClose: true,
+                        message: '错了哦,需要先选中一条记录',
+                        type: 'error'
+                    });
+                    return false
+                }
+                if (this.multipleSelection.length > 1) {
+                    this.$message({
+                        showClose: true,
+                        message: '错了哦,只能选中一条记录',
+                        type: 'error'
+                    });
+                    return false
+                }
+                this.dialog_state = true;
+                this.dialog_title = '修改设备信息';
+                this.dialog_type = 2;
+
+                // 读取本条记录
+                let row = this.multipleSelection[0];
+                this.dialog.eqId = row.Id;
+                this.dialog.mac = row.Mac;
+                this.dialog.regionId = row.RegionId;
+                this.dialog.tagname = row.TagName;
+                this.dialog.HardwareVersion = row.HardwareVersion;
+                this.dialog.FirmwareVersion = row.FirmwareVersion;
+                this.dialog.FirmwareScanM4Version = row.FirmwareScanM4Version;
+                this.dialog.FirmwareScanM0Version = row.FirmwareScanM0Version;
+                this.dialog.location = row.Location;
+                this.dialog.purchasesrc = row.PurchaseSrc;
+                this.dialog.memo = row.Memo;
+                this.dialog.regionlevelOneId = row.RegionId;
+                this.dialog.status = row.Status;
+                // this.dialog.coords_memo = row.coords_memo;
+
+                // 重载地区列表
+                this.getGeFullRegionSelect();
+
+                that.dialog.points = [{x: row.X, y: row.Y}];
+
+                // let param = {
+                //     token: localStorage.token,
+                //     detectorId: row.Id,
+                // };
+                // let postdata = qs.stringify(param);
+                // GetDetectorCoords(postdata).then(res => {
+                //     let json = res;
+                //     if (json.Code == 0) {
+                //         if (json.Rs.length != 0) {
+                //             console.log(json.Rs[0]);
+                //             // that.dialog.points = [{x: json.Rs[0].X, y: json.Rs[0].Y}];
+                //             that.dialog.points = [{x: json.Rs.X, y: json.Rs.Y}];
+                //             // that.dialog.CoordsId = json.Rs[0].CoordsId;
+                //             // that.dialog.coords_memo = json.Rs[0].Memo;
+                //         } else {
+                //             that.dialog.points = [{x: 0, y: 0}];
+                //             that.dialog.CoordsId = 0;
+                //         }
+                //     } else {
+                //         that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                //     }
+                // })
+            },
+            // 自动补全MAC
+            autoCompleteMac() {
+                let text = this.dialog.mac;
+                if (text.length == 2 || text.length == 5 || text.length == 8 || text.length == 11 || text.length == 14) {
+                    this.dialog.mac = this.dialog.mac.toUpperCase() + ":"
+                }
+                if (text.length > 14) {
+                    this.dialog.mac = this.dialog.mac.toUpperCase()
+                }
+            },
+            // 探测记录
+            goPhoneRecord(row) {
+                this.$router.push({
+                    path: '/phoneSign',
+                    query:
+                        {
+                            detectorid: row.Id,
+                            comId: 1,
+                            regionId: row.RegionId,
+                        }
+                });
+            },
+            // 探测记录
+            goWifiRecord(row) {
+                this.$router.push({
+                    path: '/wifiSign',
+                    query:
+                        {
+                            detectorid: row.Id,
+                            comId: 1,
+                            regionId: row.RegionId,
+                        }
+                });
+            },
+            dialog_cancel() {
+                let that = this;
+                that.dialog_state = false;
+            },
+            dialog_ok() {
+                if (this.dialog_type == 1) {
+                    this.confirmAddEquip();
+                } else {
+                    this.confirmEditEquip();
+                }
+            },
+            // 提交增加新设备
+            confirmAddEquip() {
+                let that = this;
+                // checkVal
+                if (!that.dialog.mac) {
+                    this.$message.error('错了哦,mac不能为空');
+                    return false
+                }
+                if (!checkMac(that.dialog.mac)) {
+                    this.$message.error('错了哦,mac格式不正确');
+                    return false
+                }
+                if (!that.dialog.regionId) {
+                    this.$message.error('错了哦,所属区域不能为空');
+                    return false
+                }
+                if (!that.dialog.tagname) {
+                    this.$message.error('错了哦,标签名不能为空');
+                    return false
+                }
+                if (that.dialog.tagname.length > 20) {
+                    this.$message.error('错了哦,标签名不能超过20个字符');
+                    return false
+                }
+                this.selectRegionLabel(that.dialog.regionId);
+                let param = {
+                    token: localStorage.token,
+                    mac: that.dialog.mac,
+                    comId: 1,
+                    regionId: that.dialog.regionId,
+                    name: that.dialog.tagname,
+                    HardwareVersion: that.dialog.HardwareVersion,
+                    FirmwareVersion: that.dialog.FirmwareVersion,
+                    FirmwareScanM4Version: that.dialog.FirmwareScanM4Version,
+                    FirmwareScanM0Version: that.dialog.FirmwareScanM0Version,
+                    location: that.dialog.location,
+                    purchasesrc: that.dialog.purchasesrc,
+                    x: that.dialog.points[0].x,
+                    y: that.dialog.points[0].y,
+                    // coords_memo: that.dialog.coords_memo,
+                    memo: that.dialog.memo,
+                };
+                let postdata = qs.stringify(param);
+                DetectorAdd(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);
+                    }
+                });
+            },
+            // 提交修改设备信息
+            confirmEditEquip() {
+                let that = this;
+                // checkVal
+                if (!that.dialog.mac) {
+                    this.$message.error('错了哦,mac不能为空');
+                    return false
+                }
+                if (!checkMac(that.dialog.mac)) {
+                    this.$message.error('错了哦,mac格式不正确');
+                    return false
+                }
+
+                if (!that.dialog.regionId) {
+                    this.$message.error('错了哦,所属区域不能为空');
+                    return false
+                }
+                if (!that.dialog.tagname) {
+                    this.$message.error('错了哦,标签名不能为空');
+                    return false
+                }
+                if (that.dialog.tagname.length > 20) {
+                    this.$message.error('错了哦,标签名不能超过20个字符');
+                    return false
+                }
+                this.selectRegionLabel(that.dialog.regionId);
+                let param = {
+                    token: localStorage.token,
+                    id: that.dialog.eqId,
+                    mac: that.dialog.mac,
+                    comId: 1,
+                    regionId: that.dialog.regionId,
+                    name: that.dialog.tagname,
+                    HardwareVersion: that.dialog.HardwareVersion,
+                    FirmwareVersion: that.dialog.FirmwareVersion,
+                    FirmwareScanM4Version: that.dialog.FirmwareScanM4Version,
+                    FirmwareScanM0Version: that.dialog.FirmwareScanM0Version,
+                    location: that.dialog.location,
+                    purchasesrc: that.dialog.purchasesrc,
+                    x: that.dialog.points[0].x,
+                    y: that.dialog.points[0].y,
+                    coords_memo: that.dialog.coords_memo,
+                    memo: that.dialog.memo,
+                    coordsType: 1,//坐标状态 0:禁用, 1:启用, 9:删除,没有就传0
+                    coordsID: that.dialog.CoordsId,
+                    status: that.dialog.status,
+                };
+
+                let postdata = qs.stringify(param);
+                DetectorEdit(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);
+                    }
+                });
+            },
+            // 修改设备状态
+            getDetectorEditStatus(detectorid, status, text) {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    detectorid: detectorid,
+                    status: status,
+                };
+                let postdata = qs.stringify(param);
+                DetectorEditStatus(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.$message({
+                            showClose: true,
+                            message: text + '成功!',
+                            type: 'success'
+                        });
+                        // table 重载
+                        that.getTableQuery();
+                    } else {
+                        that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                    }
+                })
+            },
+            // 禁用
+            pauseRow(row) {
+                let that = this;
+                this.$confirm('是否禁用' + row.TagName + '设备?', '禁用操作', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    that.getDetectorEditStatus(row.Id, 0, '禁用');
+                }).catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消禁用'
+                    });
+                });
+            },
+            // 获取区域位置的平面图
+            getRegionPictureGetByRegionId(regionID) {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    regionID: regionID,
+                    regionId: regionID,
+                };
+                let postdata = qs.stringify(param);
+                that.dialog.plateImgSrc = '../assets/img/main/grid.png'
+                // RegionPictureGetByRegionId(postdata).then(res => {
+                //     let json = res;
+                //     that.dialog.plateImgSrc = '';
+                //     if (json.Code == 0) {
+                //         that.dialog.plateImgSrc = json.EncodeString;
+                //     } else {
+                //         that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                //     }
+                // })
+            },
+            // 启用
+            runRow(row) {
+                console.log(row);
+                let that = this;
+                this.$confirm('是否启用' + row.TagName + '设备?', '启用操作', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    that.getDetectorEditStatus(row.Id, 1, '启用');
+                }).catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消启用'
+                    });
+                });
+            },
+            // 添加探测器位置的点坐标
+            addPoint(e) {
+                let x = e.offsetX;
+                let y = e.offsetY;
+                this.dialog.points = [{x: x, y: y}];
+            },
+            // 获取位置的文字内容
+            selectRegionLabel(id) {
+                let that = this;
+                let selectedWorkName = {};
+                // selectedWorkName = that.dialog.regionIdRoomOptions.filter(item => {
+                selectedWorkName = that.dialog.regionlevelOneIdOptions.filter(item => {
+                    if (item.Id === id) {
+                        console.log(item.Name);
+                        that.dialog.location = item.Name;
+                    }
+                });
+            },
+            filterTime(val, row, column) {
+                return nonTfmtDate(column, 10);
+            }
+        },
+        watch: {
+            // 'dialog.regionlevelOneId': function (val) {
+            //     this.dialogGetGetChildRegionSelect(val, 2)
+            // },
+            'dialog.regionId': function (val) {
+                if (val) {
+                    this.getRegionPictureGetByRegionId(val);
+                }
+            },
+        },
+        components: {
+            dialog_referrer_list
+        }
+    }
+</script>
+
+<style scoped>
+    @import "../assets/css/panel.css";
+    @import "../assets/css/dialog.css";
+
+    .tabs ul {
+        width: 168px;
+        float: left;
+    }
+
+    table span {
+        cursor: pointer;
+    }
+
+    .down_btn {
+        float: left;
+    }
+
+    .content {
+        width: 98%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        padding-left: 20px;
+    }
+
+    .selectStyle {
+        width: 100%;
+        color: #005EA2;
+    }
+
+    .selectStyle ::placeholder {
+        color: #005EA2;
+    }
+
+    /deep/ .modal .el-select .el-input .el-select__caret {
+        position: relative;
+        top: 35px;
+    }
+
+    .imgContianer {
+        width: 100%;
+        height: 340px;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+    }
+
+    .imgContianer img {
+        width: 100%;
+        height: 100%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+    }
+
+    .pointers {
+        position: relative;
+        bottom: 340px;
+        width: 100%;
+        height: 100%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+    }
+
+    .imgContianer i {
+        position: relative;
+        width: 10px;
+        height: 10px;
+        float: left;
+        border-radius: 250px;
+        background: #FFDD00;
+    }
+
+    /deep/ .modal-dialog {
+        height: 80px;
+        margin-top: 20px;
+    }
+
+    /deep/ textarea {
+        color: #6DC1FF;
+    }
+
+    /deep/ .el-table__empty-text {
+        color: #015B9E;
+    }
+
+    /deep/ .el-input.is-disabled .el-input__inner {
+        background-color: #015B9E;
+    }
+
+    .red {
+        color: red;
+    }
+
+    .yellow {
+        color: #fd0;
+    }
+</style>

+ 5 - 0
src/views/signEquip.vue

@@ -49,6 +49,8 @@
                 class=""
                 @selection-change="handleSelectionChange"
                 stripe
+                ref="multipleTable"
+                @row-click="handle"
         >
             <el-table-column
                     type="selection"
@@ -243,6 +245,9 @@
             this.getTableQuery();
         },
         methods: {
+            handle(row, column, event) {
+                this.$refs.multipleTable.toggleRowSelection(row);
+            },
             // 页面数据查询
             getTableQuery() {
                 let that = this;

+ 13 - 0
src/views/statistics.vue

@@ -0,0 +1,13 @@
+<template>
+
+</template>
+
+<script>
+    export default {
+        name: "statistics"
+    }
+</script>
+
+<style scoped>
+
+</style>

+ 915 - 0
src/views/tactics.vue

@@ -0,0 +1,915 @@
+<template>
+    <div class="content">
+        <div class="tabs">
+            <ul>
+                <li v-for="(tab,i) in tabs" @click="goTab(tab.url)" :class="{'active':tabIndex == i}">
+                    {{tab.name}}
+                </li>
+            </ul>
+        </div>
+        <div class="panel">
+            <div class="panel-body">
+                <div class=" panel_control">
+                    <div class="pline">
+                        <em>策略名称:</em>
+                        <el-input v-model="panel.tagname" placeholder=""></el-input>
+                    </div>
+                    <div class="pline">
+                        <el-button size="medium" type="primary" @click="query">查询</el-button>
+                    </div>
+                    <div class="pline pull-right">
+                        <el-button size="medium" type="primary" @click="addList">添加</el-button>
+                        <el-button size="medium" type="primary" @click="editList">修改</el-button>
+                        <el-button size="medium" type="primary" @click="delList">删除</el-button>
+                    </div>
+                </div>
+            </div>
+        </div>
+        <el-table
+                :data="tableData"
+                is-horizontal-resize
+                :default-sort="{prop: 'date', order: 'descending'}"
+                v-loading="loading"
+                element-loading-background="rgba(0, 0, 0, 0.8)"
+                class=""
+                @selection-change="handleSelectionChange"
+                stripe
+                ref="multipleTable"
+                @row-click="handle"
+        >
+            <el-table-column
+                    type="selection"
+                    width="55">
+            </el-table-column>
+            <el-table-column
+                    type="index"
+                    label="序号"
+                    width="60"
+                    sortable
+            >
+            </el-table-column>
+            <el-table-column
+                    prop="Mac"
+                    label="区域名称"
+            >
+            </el-table-column>
+            <el-table-column type="expand">
+                <template slot-scope="props">
+                    <el-table
+                            :data="props.row"
+                            style="width: 100%">
+                        <el-table-column
+                                prop="date"
+                                label="日期"
+                                width="180">
+                        </el-table-column>
+                        <el-table-column
+                                prop="name"
+                                label="姓名"
+                                width="180">
+                        </el-table-column>
+                        <el-table-column
+                                prop="address"
+                                label="地址">
+                        </el-table-column>
+                    </el-table>
+                </template>
+            </el-table-column>
+            <el-table-column
+                    prop="Xmax"
+                    label="长/m"
+            >
+            </el-table-column>
+            <el-table-column
+                    prop="Ymax"
+                    label="宽/m"
+            >
+            </el-table-column>
+            <el-table-column
+                    prop="Memo"
+                    label="备注"
+            >
+            </el-table-column>
+            <el-table-column
+                    prop="address"
+                    label="操作记录"
+                    width="220"
+            >
+                <template slot-scope="scope">
+                    <!--<el-button class="" type="text" @click="goPhoneRecord(scope.row)">手机信号记录</el-button>-->
+                    <el-button class="" type="primary" size="small" @click="goWifiRecord(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)">启用-->
+                    <!--</el-button>-->
+                </template>
+            </el-table-column>
+        </el-table>
+        <br>
+        <el-pagination
+                background
+                :total="pageination.total"
+                :page-size="pageination.pageItem"
+                @current-change="pageChange"
+        ></el-pagination>
+
+        <dialog_referrer_list
+                :show="dialog_state"
+                :title="dialog_title"
+                :large="true"
+                @dialog_cancel="dialog_cancel"
+                @dialog_ok="dialog_ok"
+        >
+            <div class="dialogContent">
+                <el-row :gutter="24">
+                    <el-col :span="24">
+                        <label>
+                            区域名称
+                        </label>
+                        <el-input v-model="dialog.mac" @keyup.native="autoCompleteMac"
+                                  :disabled="dialog_type == 2"></el-input>
+                    </el-col>
+                    <el-col :span="12">
+                        <label>
+                            长/m
+                        </label>
+                        <el-input v-model="dialog.tagname"></el-input>
+                    </el-col>
+                    <el-col :span="12">
+                        <label>
+                            宽/m
+                        </label>
+                        <el-input v-model="dialog.tagname"></el-input>
+                    </el-col>
+                    <el-col :span="24">
+                        <label>
+                            备注
+                        </label>
+                        <el-input v-model="dialog.memo" type="textarea"></el-input>
+                    </el-col>
+                </el-row>
+            </div>
+        </dialog_referrer_list>
+    </div>
+</template>
+
+<script>
+    import Global from '../Global.js'
+    import dialog_referrer_list from '../components/dialog_referrer_list'
+    import {
+        DetectorQuery,
+        GetChildRegionSelect,
+        DetectorEditStatus,
+        RegionPictureGetByRegionId,
+        DetectorAdd,
+        RegionList,
+        DetectorList,
+        DetectorEdit,
+        GetDetectorCoords,
+        GeFullRegionSelect,
+    } from '../api/getApiRes.js'
+
+    let qs = require('qs');
+    export default {
+        data() {
+            return {
+                // dialog
+                dialog_state: false,
+                dialog_title: '',
+                dialog_type: '',//类型,1是添加,2是修改
+                dialog: {
+                    mac: '',
+                    comId: 1,
+                    regionlevelOneId: 0,
+                    regionId: 0,
+                    tagname: '',
+                    longitude: 0,
+                    latitude: 0,
+                    HardwareVersion: '',
+                    FirmwareVersion: '',
+                    FirmwareScanM4Version: '',
+                    FirmwareScanM0Version: '',
+                    purchasesrc: '',
+                    location: '',
+                    coords_memo: '',
+                    memo: '',
+                    plateImgSrc: '',
+                    regionlevelOneIdOptions: [],
+                    regionIdRoomOptions: [],
+                    points: [],
+                    CoordsId: 0,
+                    status: 0,
+                },
+                tabIndex: 0,
+                tabs: [
+                    {name: '扫描策略管理', url: 'tactics'},
+                ],
+                // panel 配置项目
+                panel: {
+                    usercode: '',
+                    username: '',
+                    compname: '',
+                    keyword: '',
+                    USERCODE: '',
+                    taskstatus: 99,
+                    regionid: 0,
+                    regionid2: '',
+                    regionidOptions: [],
+                    regionidOptions2: [],
+                    options: [
+                        {value: 99, label: '全部'},
+                        {value: 1, label: '进行中'},
+                        {value: 2, label: '已完成'},
+                    ],
+                    time1: globalBt3(2),
+                },
+                pageination: {
+                    pageItem: 100,
+                    pageoptions: pageOptions(),
+                    total: 500,
+                    pageIndex: 1,
+                },
+                draw: 1,
+                start: 0,
+                recordsTotal: 0,
+                tableData: [],
+                allTableData: [],
+                limit: '10',
+                multipleSort: false,
+                loading: true,
+                fileList: [],
+                multipleSelection: [],
+                detectedmac: '',
+            }
+        },
+        mounted() {
+            if (this.$route.query.RegionId) {
+                this.panel.regionid = this.$route.query.RegionId;
+                this.panel.tagname = this.$route.query.TagName;
+            }
+
+            this.getTableQuery();
+        },
+        methods: {
+            handle(row, column, event) {
+                this.$refs.multipleTable.toggleRowSelection(row);
+            },
+            // 页面数据查询
+            getTableQuery() {
+                let that = this;
+                // this.getGetChildRegionSelect(0, 1);
+                this.getGeFullRegionSelect();
+                that.loading = true;
+                // 查询检测设备。上级区域id,区域id必传。regionid传0,查询supregionid对应所有子区域的检测设备。 如果supregionid,regionid都传0,默认查询企业ID下所有检测设备
+                let param = {
+                    token: localStorage.token,
+                    mac: this.panel.mac,//
+                    regionId: that.panel.regionId,//
+                    name: that.panel.tagname,//标签名
+                    comid: 1,//
+                    start: 1,//
+                    tableMax: 9999,//
+                };
+                let postdata = qs.stringify(param);
+                DetectorList(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.loading = false;
+                        if (json.Rs) {
+                            that.allTableData = json.Rs;
+                            console.log(json.Rs);
+                            that.recordsTotal = json.Rs.length;
+                        } else {
+                            that.allTableData = [];
+                            that.recordsTotal = 0;
+                        }
+                        // 设置分页数据
+                        that.setPaginations();
+                    } else {
+                        that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                    }
+                })
+            },
+            // 获取下级列表
+            getGeFullRegionSelect() {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                };
+                let postdata = qs.stringify(param);
+                RegionList(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        if (!json.Rs) {
+                            that.$message.error('区域列表为空,请先添加有效区域');
+                            return false
+                        }
+                        that.panel.regionidOptions = json.Rs;
+                        that.panel.regionidOptions.unshift({Id: 0, Name: "全部", DisplayName: "全部"});
+                    } else {
+                        that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                    }
+                })
+            },
+            // dialog获取下级列表
+            dialoggetGeFullRegionSelect() {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                };
+                let postdata = qs.stringify(param);
+                RegionList(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.dialog.regionlevelOneIdOptions = json.Rs;
+                        that.dialog.regionId = json.Rs[0].Id;
+                    } else {
+                        that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                    }
+                })
+            },
+            // dialog获取区域下级菜单
+            dialogGetGetChildRegionSelect(regionId, level) {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    regionId: regionId,
+                };
+                let postdata = qs.stringify(param);
+                RegionList(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.dialog.regionlevelOneIdOptions = json.Rs;
+                        that.dialog.regionlevelOneId = regionId;
+                        // if (level == 1) {
+                        //     console.log(json.Rs);
+                        //     that.dialog.regionlevelOneIdOptions = json.Rs;
+                        //     that.dialog.regionlevelOneId = regionId;
+                        // } else {
+                        //     if (json.Rs) {
+                        //         console.log(123);
+                        //         that.dialog.regionIdRoomOptions = json.Rs;
+                        //         that.dialog.regionId = regionId;
+                        //     } else {
+                        //         that.dialog.regionIdRoomOptions = [];
+                        //         that.dialog.regionId = '';
+                        //     }
+                        // }
+                    } else {
+                        that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                    }
+                })
+            },
+            // 跳转tab页面
+            goTab(url) {
+                this.$router.push({path: url});
+            },
+            // 查询按钮
+            query() {
+                this.getTableQuery();
+                this.$message.success('查询完毕');
+            },
+
+            handleSelectionChange(val) {
+                this.multipleSelection = val;
+            },
+            // 设置分页数据
+            setPaginations() {
+                // 分页属性
+                let that = this;
+                that.pageination.total = that.recordsTotal;
+                // 默认分页
+                that.tableData = that.allTableData.filter((item, index) => {
+                    return index < that.pageination.pageItem;
+                });
+            },
+            // 每页显示数量
+            handleSizeChange() {
+                let that = this;
+                that.tableData = that.allTableData.filter((item, index) => {
+                    return index < that.pageination.pageItem;
+                });
+                that.draw = that.pageination.pageItem;
+                // that.getTableQuery();
+            },
+            // 翻页
+            pageChange(pageIndex) {
+                let that = this;
+                // 获取当前页
+                let index = that.pageination.pageItem * (pageIndex - 1);
+                // 数据总数
+                let nums = that.pageination.pageItem * pageIndex;
+                // 容器
+                let tables = [];
+                for (var i = index; i < nums; i++) {
+                    if (that.allTableData[i]) {
+                        tables.push(that.allTableData[i])
+                    }
+                    this.tableData = tables;
+                }
+                that.start = index * that.draw;
+                // that.getTableQuery();
+            },
+            // 自动排序
+            sortChange(params) {
+                console.log(params)
+            },
+            // 过滤时间
+            filterFmtDate(value, row, column) {
+                return globalfmtDate(column, 11);
+            },
+            addList() {
+                this.$router.push(
+                    {
+                        path: '/addTactics', query: {tid: 0}
+                    }
+                )
+            },
+            delList() {
+                let that = this;
+                // checkNum
+                if (!this.multipleSelection.length) {
+                    that.$message({
+                        showClose: true,
+                        message: '错了哦,需要先选中至少一条记录',
+                        type: 'error'
+                    });
+                    return false
+                }
+                let detectorid = that.multipleSelection[0].Id;
+
+                let param = {
+                    token: localStorage.token,
+                    detectorid: detectorid,
+                    status: 9,//0禁用1启用9删除
+                };
+                let postdata = qs.stringify(param);
+
+                this.$confirm('此操作将永久删除该设备, 是否继续?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    DetectorEditStatus(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: '已取消删除'
+                    });
+                });
+            },
+            editList() {
+                let that = this;
+                // checkNum
+                if (!this.multipleSelection.length) {
+                    this.$message({
+                        showClose: true,
+                        message: '错了哦,需要先选中一条记录',
+                        type: 'error'
+                    });
+                    return false
+                }
+                if (this.multipleSelection.length > 1) {
+                    this.$message({
+                        showClose: true,
+                        message: '错了哦,只能选中一条记录',
+                        type: 'error'
+                    });
+                    return false
+                }
+                this.dialog_state = true;
+                this.dialog_title = '修改设备信息';
+                this.dialog_type = 2;
+
+                // 读取本条记录
+                let row = this.multipleSelection[0];
+                this.dialog.eqId = row.Id;
+                this.dialog.mac = row.Mac;
+                this.dialog.regionId = row.RegionId;
+                this.dialog.tagname = row.TagName;
+                this.dialog.HardwareVersion = row.HardwareVersion;
+                this.dialog.FirmwareVersion = row.FirmwareVersion;
+                this.dialog.FirmwareScanM4Version = row.FirmwareScanM4Version;
+                this.dialog.FirmwareScanM0Version = row.FirmwareScanM0Version;
+                this.dialog.location = row.Location;
+                this.dialog.purchasesrc = row.PurchaseSrc;
+                this.dialog.memo = row.Memo;
+                this.dialog.regionlevelOneId = row.RegionId;
+                this.dialog.status = row.Status;
+                // this.dialog.coords_memo = row.coords_memo;
+
+                // 重载地区列表
+                this.getGeFullRegionSelect();
+
+                that.dialog.points = [{x: row.X, y: row.Y}];
+                this.$router.push(
+                    {
+                        path: '/addtactics', query: {tid: row.id}
+                    }
+                );
+            },
+            // 自动补全MAC
+            autoCompleteMac() {
+                let text = this.dialog.mac;
+                if (text.length == 2 || text.length == 5 || text.length == 8 || text.length == 11 || text.length == 14) {
+                    this.dialog.mac = this.dialog.mac.toUpperCase() + ":"
+                }
+                if (text.length > 14) {
+                    this.dialog.mac = this.dialog.mac.toUpperCase()
+                }
+            },
+            // 探测记录
+            goPhoneRecord(row) {
+                this.$router.push({
+                    path: '/phoneSign',
+                    query:
+                        {
+                            detectorid: row.Id,
+                            comId: 1,
+                            regionId: row.RegionId,
+                        }
+                });
+            },
+            // 探测记录
+            goWifiRecord(row) {
+                this.$router.push({
+                    path: '/wifiSign',
+                    query:
+                        {
+                            detectorid: row.Id,
+                            comId: 1,
+                            regionId: row.RegionId,
+                        }
+                });
+            },
+            dialog_cancel() {
+                let that = this;
+                that.dialog_state = false;
+            },
+            dialog_ok() {
+                if (this.dialog_type == 1) {
+                    this.confirmAddEquip();
+                } else {
+                    this.confirmEditEquip();
+                }
+            },
+            // 提交增加新设备
+            confirmAddEquip() {
+                let that = this;
+                // checkVal
+                if (!that.dialog.mac) {
+                    this.$message.error('错了哦,mac不能为空');
+                    return false
+                }
+                if (!checkMac(that.dialog.mac)) {
+                    this.$message.error('错了哦,mac格式不正确');
+                    return false
+                }
+                if (!that.dialog.regionId) {
+                    this.$message.error('错了哦,所属区域不能为空');
+                    return false
+                }
+                if (!that.dialog.tagname) {
+                    this.$message.error('错了哦,标签名不能为空');
+                    return false
+                }
+                if (that.dialog.tagname.length > 20) {
+                    this.$message.error('错了哦,标签名不能超过20个字符');
+                    return false
+                }
+                this.selectRegionLabel(that.dialog.regionId);
+                let param = {
+                    token: localStorage.token,
+                    mac: that.dialog.mac,
+                    comId: 1,
+                    regionId: that.dialog.regionId,
+                    name: that.dialog.tagname,
+                    HardwareVersion: that.dialog.HardwareVersion,
+                    FirmwareVersion: that.dialog.FirmwareVersion,
+                    FirmwareScanM4Version: that.dialog.FirmwareScanM4Version,
+                    FirmwareScanM0Version: that.dialog.FirmwareScanM0Version,
+                    location: that.dialog.location,
+                    purchasesrc: that.dialog.purchasesrc,
+                    x: that.dialog.points[0].x,
+                    y: that.dialog.points[0].y,
+                    // coords_memo: that.dialog.coords_memo,
+                    memo: that.dialog.memo,
+                };
+                let postdata = qs.stringify(param);
+                DetectorAdd(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);
+                    }
+                });
+            },
+            // 提交修改设备信息
+            confirmEditEquip() {
+                let that = this;
+                // checkVal
+                if (!that.dialog.mac) {
+                    this.$message.error('错了哦,mac不能为空');
+                    return false
+                }
+                if (!checkMac(that.dialog.mac)) {
+                    this.$message.error('错了哦,mac格式不正确');
+                    return false
+                }
+
+                if (!that.dialog.regionId) {
+                    this.$message.error('错了哦,所属区域不能为空');
+                    return false
+                }
+                if (!that.dialog.tagname) {
+                    this.$message.error('错了哦,标签名不能为空');
+                    return false
+                }
+                if (that.dialog.tagname.length > 20) {
+                    this.$message.error('错了哦,标签名不能超过20个字符');
+                    return false
+                }
+                this.selectRegionLabel(that.dialog.regionId);
+                let param = {
+                    token: localStorage.token,
+                    id: that.dialog.eqId,
+                    mac: that.dialog.mac,
+                    comId: 1,
+                    regionId: that.dialog.regionId,
+                    name: that.dialog.tagname,
+                    HardwareVersion: that.dialog.HardwareVersion,
+                    FirmwareVersion: that.dialog.FirmwareVersion,
+                    FirmwareScanM4Version: that.dialog.FirmwareScanM4Version,
+                    FirmwareScanM0Version: that.dialog.FirmwareScanM0Version,
+                    location: that.dialog.location,
+                    purchasesrc: that.dialog.purchasesrc,
+                    x: that.dialog.points[0].x,
+                    y: that.dialog.points[0].y,
+                    coords_memo: that.dialog.coords_memo,
+                    memo: that.dialog.memo,
+                    coordsType: 1,//坐标状态 0:禁用, 1:启用, 9:删除,没有就传0
+                    coordsID: that.dialog.CoordsId,
+                    status: that.dialog.status,
+                };
+
+                let postdata = qs.stringify(param);
+                DetectorEdit(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);
+                    }
+                });
+            },
+            // 修改设备状态
+            getDetectorEditStatus(detectorid, status, text) {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    detectorid: detectorid,
+                    status: status,
+                };
+                let postdata = qs.stringify(param);
+                DetectorEditStatus(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.$message({
+                            showClose: true,
+                            message: text + '成功!',
+                            type: 'success'
+                        });
+                        // table 重载
+                        that.getTableQuery();
+                    } else {
+                        that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                    }
+                })
+            },
+            // 禁用
+            pauseRow(row) {
+                let that = this;
+                this.$confirm('是否禁用' + row.TagName + '设备?', '禁用操作', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    that.getDetectorEditStatus(row.Id, 0, '禁用');
+                }).catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消禁用'
+                    });
+                });
+            },
+            // 获取区域位置的平面图
+            getRegionPictureGetByRegionId(regionID) {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    regionID: regionID,
+                    regionId: regionID,
+                };
+                let postdata = qs.stringify(param);
+                that.dialog.plateImgSrc = '../assets/img/main/grid.png'
+                // RegionPictureGetByRegionId(postdata).then(res => {
+                //     let json = res;
+                //     that.dialog.plateImgSrc = '';
+                //     if (json.Code == 0) {
+                //         that.dialog.plateImgSrc = json.EncodeString;
+                //     } else {
+                //         that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                //     }
+                // })
+            },
+            // 启用
+            runRow(row) {
+                console.log(row);
+                let that = this;
+                this.$confirm('是否启用' + row.TagName + '设备?', '启用操作', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    that.getDetectorEditStatus(row.Id, 1, '启用');
+                }).catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消启用'
+                    });
+                });
+            },
+            // 添加探测器位置的点坐标
+            addPoint(e) {
+                let x = e.offsetX;
+                let y = e.offsetY;
+                this.dialog.points = [{x: x, y: y}];
+            },
+            // 获取位置的文字内容
+            selectRegionLabel(id) {
+                let that = this;
+                let selectedWorkName = {};
+                // selectedWorkName = that.dialog.regionIdRoomOptions.filter(item => {
+                selectedWorkName = that.dialog.regionlevelOneIdOptions.filter(item => {
+                    if (item.Id === id) {
+                        console.log(item.Name);
+                        that.dialog.location = item.Name;
+                    }
+                });
+            },
+            filterTime(val, row, column) {
+                return nonTfmtDate(column, 10);
+            }
+        }
+        ,
+        watch: {
+            // 'dialog.regionlevelOneId': function (val) {
+            //     this.dialogGetGetChildRegionSelect(val, 2)
+            // },
+            'dialog.regionId':
+
+                function (val) {
+                    if (val) {
+                        this.getRegionPictureGetByRegionId(val);
+                    }
+                }
+
+            ,
+        }
+        ,
+        components: {
+            dialog_referrer_list
+        }
+    }
+</script>
+
+<style scoped>
+    @import "../assets/css/panel.css";
+    @import "../assets/css/dialog.css";
+
+    .tabs ul {
+        width: 168px;
+        float: left;
+    }
+
+    table span {
+        cursor: pointer;
+    }
+
+    .down_btn {
+        float: left;
+    }
+
+    .content {
+        width: 98%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        padding-left: 20px;
+    }
+
+    .selectStyle {
+        width: 100%;
+        color: #005EA2;
+    }
+
+    .selectStyle ::placeholder {
+        color: #005EA2;
+    }
+
+    /deep/ .modal .el-select .el-input .el-select__caret {
+        position: relative;
+        top: 35px;
+    }
+
+    .imgContianer {
+        width: 100%;
+        height: 340px;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+    }
+
+    .imgContianer img {
+        width: 100%;
+        height: 100%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+    }
+
+    .pointers {
+        position: relative;
+        bottom: 340px;
+        width: 100%;
+        height: 100%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+    }
+
+    .imgContianer i {
+        position: relative;
+        width: 10px;
+        height: 10px;
+        float: left;
+        border-radius: 250px;
+        background: #FFDD00;
+    }
+
+    /deep/ .modal-dialog {
+        height: 80px;
+        margin-top: 20px;
+    }
+
+    /deep/ textarea {
+        color: #6DC1FF;
+    }
+
+    /deep/ .el-table__empty-text {
+        color: #015B9E;
+    }
+
+    /deep/ .el-input.is-disabled .el-input__inner {
+        background-color: #015B9E;
+    }
+
+    .red {
+        color: red;
+    }
+
+    .yellow {
+        color: #fd0;
+    }
+</style>

+ 940 - 0
src/views/task.vue

@@ -0,0 +1,940 @@
+<template>
+    <div class="content">
+        <div class="tabs">
+            <ul>
+                <li v-for="(tab,i) in tabs" @click="goTab(tab.url)" :class="{'active':tabIndex == i}">
+                    {{tab.name}}
+                </li>
+            </ul>
+        </div>
+        <div class="panel">
+            <div class="panel-body">
+                <div class=" panel_control">
+                    <div class="pline">
+                        <em>设备ID:</em>
+                        <el-input v-model="panel.tagname" placeholder=""></el-input>
+                    </div>
+                    <div class="pline">
+                        <em>MAC地址:</em>
+                        <el-input v-model="panel.tagname" placeholder=""></el-input>
+                    </div>
+                    <div class="pline">
+                        <em>所属区域:</em>
+                        <el-select v-model="panel.regionid">
+                            <el-option
+                                    v-for="item in panel.regionidOptions"
+                                    :key="item.Id"
+                                    :label="item.Name"
+                                    :value="item.Id">
+                            </el-option>
+                        </el-select>
+                    </div>
+                    <div class="pline">
+                        <el-button size="medium" type="primary" @click="query">查询</el-button>
+                    </div>
+                    <div class="pline pull-right">
+                        <el-button size="medium" type="primary" @click="addList">添加</el-button>
+                        <el-button size="medium" type="primary" @click="editList">修改</el-button>
+                        <el-button size="medium" type="primary" @click="delList">删除</el-button>
+                    </div>
+                </div>
+            </div>
+        </div>
+        <el-table
+                :data="tableData"
+                is-horizontal-resize
+                :default-sort="{prop: 'date', order: 'descending'}"
+                v-loading="loading"
+                element-loading-background="rgba(0, 0, 0, 0.8)"
+                class=""
+                @selection-change="handleSelectionChange"
+                stripe
+                ref="multipleTable"
+                @row-click="handle"
+        >
+            <el-table-column
+                    type="selection"
+                    width="55">
+            </el-table-column>
+            <el-table-column
+                    type="index"
+                    label="序号"
+                    width="60"
+                    sortable
+            >
+            </el-table-column>
+            <el-table-column
+                    prop="Mac"
+                    label="区域名称"
+            >
+            </el-table-column>
+            <el-table-column
+                    prop="Xmax"
+                    label="长/m"
+            >
+            </el-table-column>
+            <el-table-column
+                    prop="Ymax"
+                    label="宽/m"
+            >
+            </el-table-column>
+            <el-table-column
+                    prop="Memo"
+                    label="备注"
+            >
+            </el-table-column>
+            <el-table-column
+                    prop="address"
+                    label="操作记录"
+                    width="220"
+            >
+                <template slot-scope="scope">
+                    <!--<el-button class="" type="text" @click="goPhoneRecord(scope.row)">手机信号记录</el-button>-->
+                    <el-button class="" type="primary" size="small" @click="goWifiRecord(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)">启用-->
+                    <!--</el-button>-->
+                </template>
+            </el-table-column>
+        </el-table>
+        <br>
+        <el-pagination
+                background
+                :total="pageination.total"
+                :page-size="pageination.pageItem"
+                @current-change="pageChange"
+        ></el-pagination>
+
+        <!--<el-button class="down_btn" type="primary" @click="goPoster(scope.row)">下载驱动器todo</el-button>-->
+        <dialog_referrer_list
+                :show="dialog_state"
+                :title="dialog_title"
+                :large="true"
+                @dialog_cancel="dialog_cancel"
+                @dialog_ok="dialog_ok"
+        >
+            <div class="dialogContent">
+                <el-row :gutter="24">
+                    <el-col :span="24">
+                        <label>
+                            区域名称
+                        </label>
+                        <el-input v-model="dialog.mac" @keyup.native="autoCompleteMac"
+                                  :disabled="dialog_type == 2"></el-input>
+                    </el-col>
+                    <el-col :span="12">
+                        <label>
+                            长/m
+                        </label>
+                        <el-input v-model="dialog.tagname"></el-input>
+                    </el-col>
+                    <el-col :span="12">
+                        <label>
+                            宽/m
+                        </label>
+                        <el-input v-model="dialog.tagname"></el-input>
+                    </el-col>
+                    <el-col :span="24">
+                        <label>
+                            备注
+                        </label>
+                        <el-input v-model="dialog.memo"  type="textarea"></el-input>
+                    </el-col>
+                </el-row>
+            </div>
+        </dialog_referrer_list>
+    </div>
+</template>
+
+<script>
+    import Global from '../Global.js'
+    import dialog_referrer_list from '../components/dialog_referrer_list'
+    import {
+        DetectorQuery,
+        GetChildRegionSelect,
+        DetectorEditStatus,
+        RegionPictureGetByRegionId,
+        DetectorAdd,
+        RegionList,
+        DetectorList,
+        DetectorEdit,
+        GetDetectorCoords,
+        GeFullRegionSelect,
+    } from '../api/getApiRes.js'
+
+    let qs = require('qs');
+    export default {
+        data() {
+            return {
+                // dialog
+                dialog_state: false,
+                dialog_title: '',
+                dialog_type: '',//类型,1是添加,2是修改
+                dialog: {
+                    mac: '',
+                    comId: 1,
+                    regionlevelOneId: 0,
+                    regionId: 0,
+                    tagname: '',
+                    longitude: 0,
+                    latitude: 0,
+                    HardwareVersion: '',
+                    FirmwareVersion: '',
+                    FirmwareScanM4Version: '',
+                    FirmwareScanM0Version: '',
+                    purchasesrc: '',
+                    location: '',
+                    coords_memo: '',
+                    memo: '',
+                    plateImgSrc: '',
+                    regionlevelOneIdOptions: [],
+                    regionIdRoomOptions: [],
+                    points: [],
+                    CoordsId: 0,
+                    status: 0,
+                },
+                tabIndex: 0,
+                tabs: [
+                    {name: '扫描任务管理', url: 'task'},
+                ],
+                // panel 配置项目
+                panel: {
+                    usercode: '',
+                    username: '',
+                    compname: '',
+                    keyword: '',
+                    USERCODE: '',
+                    taskstatus: 99,
+                    regionid: 0,
+                    regionid2: '',
+                    regionidOptions: [],
+                    regionidOptions2: [],
+                    options: [
+                        {value: 99, label: '全部'},
+                        {value: 1, label: '进行中'},
+                        {value: 2, label: '已完成'},
+                    ],
+                    time1: globalBt3(2),
+                },
+                pageination: {
+                    pageItem: 100,
+                    pageoptions: pageOptions(),
+                    total: 500,
+                    pageIndex: 1,
+                },
+                draw: 1,
+                start: 0,
+                recordsTotal: 0,
+                tableData: [],
+                allTableData: [],
+                limit: '10',
+                multipleSort: false,
+                loading: true,
+                fileList: [],
+                multipleSelection: [],
+                detectedmac: '',
+            }
+        },
+        mounted() {
+            if (this.$route.query.RegionId) {
+                this.panel.regionid = this.$route.query.RegionId;
+                this.panel.tagname = this.$route.query.TagName;
+            }
+
+            this.getTableQuery();
+        },
+        methods: {
+            handle(row, column, event) {
+                this.$refs.multipleTable.toggleRowSelection(row);
+            },
+            // 页面数据查询
+            getTableQuery() {
+                let that = this;
+                // this.getGetChildRegionSelect(0, 1);
+                this.getGeFullRegionSelect();
+                that.loading = true;
+                // 查询检测设备。上级区域id,区域id必传。regionid传0,查询supregionid对应所有子区域的检测设备。 如果supregionid,regionid都传0,默认查询企业ID下所有检测设备
+                let param = {
+                    token: localStorage.token,
+                    mac: this.panel.mac,//
+                    regionId: that.panel.regionId,//
+                    name: that.panel.tagname,//标签名
+                    comid: 1,//
+                    start: 1,//
+                    tableMax: 9999,//
+                };
+                let postdata = qs.stringify(param);
+                DetectorList(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.loading = false;
+                        if (json.Rs) {
+                            that.allTableData = json.Rs;
+                            console.log(json.Rs);
+                            that.recordsTotal = json.Rs.length;
+                        } else {
+                            that.allTableData = [];
+                            that.recordsTotal = 0;
+                        }
+                        // 设置分页数据
+                        that.setPaginations();
+                    } else {
+                        that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                    }
+                })
+            },
+            // 获取下级列表
+            getGeFullRegionSelect() {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                };
+                let postdata = qs.stringify(param);
+                RegionList(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        if (!json.Rs) {
+                            that.$message.error('区域列表为空,请先添加有效区域');
+                            return false
+                        }
+                        that.panel.regionidOptions = json.Rs;
+                        that.panel.regionidOptions.unshift({Id: 0, Name: "全部", DisplayName: "全部"});
+                    } else {
+                        that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                    }
+                })
+            },
+            // dialog获取下级列表
+            dialoggetGeFullRegionSelect() {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                };
+                let postdata = qs.stringify(param);
+                RegionList(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.dialog.regionlevelOneIdOptions = json.Rs;
+                        that.dialog.regionId = json.Rs[0].Id;
+                    } else {
+                        that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                    }
+                })
+            },
+            // dialog获取区域下级菜单
+            dialogGetGetChildRegionSelect(regionId, level) {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    regionId: regionId,
+                };
+                let postdata = qs.stringify(param);
+                RegionList(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.dialog.regionlevelOneIdOptions = json.Rs;
+                        that.dialog.regionlevelOneId = regionId;
+                        // if (level == 1) {
+                        //     console.log(json.Rs);
+                        //     that.dialog.regionlevelOneIdOptions = json.Rs;
+                        //     that.dialog.regionlevelOneId = regionId;
+                        // } else {
+                        //     if (json.Rs) {
+                        //         console.log(123);
+                        //         that.dialog.regionIdRoomOptions = json.Rs;
+                        //         that.dialog.regionId = regionId;
+                        //     } else {
+                        //         that.dialog.regionIdRoomOptions = [];
+                        //         that.dialog.regionId = '';
+                        //     }
+                        // }
+                    } else {
+                        that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                    }
+                })
+            },
+            // 跳转tab页面
+            goTab(url) {
+                this.$router.push({path: url});
+            },
+            // 查询按钮
+            query() {
+                this.getTableQuery();
+                this.$message.success('查询完毕');
+            },
+
+            handleSelectionChange(val) {
+                this.multipleSelection = val;
+            },
+            // 设置分页数据
+            setPaginations() {
+                // 分页属性
+                let that = this;
+                that.pageination.total = that.recordsTotal;
+                // 默认分页
+                that.tableData = that.allTableData.filter((item, index) => {
+                    return index < that.pageination.pageItem;
+                });
+            },
+            // 每页显示数量
+            handleSizeChange() {
+                let that = this;
+                that.tableData = that.allTableData.filter((item, index) => {
+                    return index < that.pageination.pageItem;
+                });
+                that.draw = that.pageination.pageItem;
+                // that.getTableQuery();
+            },
+            // 翻页
+            pageChange(pageIndex) {
+                let that = this;
+                // 获取当前页
+                let index = that.pageination.pageItem * (pageIndex - 1);
+                // 数据总数
+                let nums = that.pageination.pageItem * pageIndex;
+                // 容器
+                let tables = [];
+                for (var i = index; i < nums; i++) {
+                    if (that.allTableData[i]) {
+                        tables.push(that.allTableData[i])
+                    }
+                    this.tableData = tables;
+                }
+                that.start = index * that.draw;
+                // that.getTableQuery();
+            },
+            // 自动排序
+            sortChange(params) {
+                console.log(params)
+            },
+            // 过滤时间
+            filterFmtDate(value, row, column) {
+                return globalfmtDate(column, 11);
+            },
+            addList() {
+                this.dialog_state = true;
+                this.dialog_title = '添加监控区域';
+                this.dialog_type = 1;
+
+                // 重载地区列表
+                this.getGeFullRegionSelect();
+
+                // clear dialog
+                this.dialog.mac = '';
+                this.dialog.regionId = '';
+                this.dialog.tagname = '';
+                this.dialog.HardwareVersion = '';
+                this.dialog.FirmwareVersion = '';
+                this.dialog.FirmwareScanM4Version = '';
+                this.dialog.FirmwareScanM0Version = '';
+                this.dialog.location = '';
+                this.dialog.purchasesrc = '';
+                this.dialog.memo = '';
+                this.dialog.coords_memo = '';
+                this.dialog.points = [{}];
+
+                // 加载默认的平面图
+                // this.dialogGetGetChildRegionSelect(0, 1);
+                this.dialoggetGeFullRegionSelect()
+            },
+            delList() {
+                let that = this;
+                // checkNum
+                if (!this.multipleSelection.length) {
+                    that.$message({
+                        showClose: true,
+                        message: '错了哦,需要先选中至少一条记录',
+                        type: 'error'
+                    });
+                    return false
+                }
+                let detectorid = that.multipleSelection[0].Id;
+
+                let param = {
+                    token: localStorage.token,
+                    detectorid: detectorid,
+                    status: 9,//0禁用1启用9删除
+                };
+                let postdata = qs.stringify(param);
+
+                this.$confirm('此操作将永久删除该设备, 是否继续?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    DetectorEditStatus(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: '已取消删除'
+                    });
+                });
+            },
+            editList() {
+                let that = this;
+                // checkNum
+                if (!this.multipleSelection.length) {
+                    this.$message({
+                        showClose: true,
+                        message: '错了哦,需要先选中一条记录',
+                        type: 'error'
+                    });
+                    return false
+                }
+                if (this.multipleSelection.length > 1) {
+                    this.$message({
+                        showClose: true,
+                        message: '错了哦,只能选中一条记录',
+                        type: 'error'
+                    });
+                    return false
+                }
+                this.dialog_state = true;
+                this.dialog_title = '修改设备信息';
+                this.dialog_type = 2;
+
+                // 读取本条记录
+                let row = this.multipleSelection[0];
+                this.dialog.eqId = row.Id;
+                this.dialog.mac = row.Mac;
+                this.dialog.regionId = row.RegionId;
+                this.dialog.tagname = row.TagName;
+                this.dialog.HardwareVersion = row.HardwareVersion;
+                this.dialog.FirmwareVersion = row.FirmwareVersion;
+                this.dialog.FirmwareScanM4Version = row.FirmwareScanM4Version;
+                this.dialog.FirmwareScanM0Version = row.FirmwareScanM0Version;
+                this.dialog.location = row.Location;
+                this.dialog.purchasesrc = row.PurchaseSrc;
+                this.dialog.memo = row.Memo;
+                this.dialog.regionlevelOneId = row.RegionId;
+                this.dialog.status = row.Status;
+                // this.dialog.coords_memo = row.coords_memo;
+
+                // 重载地区列表
+                this.getGeFullRegionSelect();
+
+                that.dialog.points = [{x: row.X, y: row.Y}];
+
+                // let param = {
+                //     token: localStorage.token,
+                //     detectorId: row.Id,
+                // };
+                // let postdata = qs.stringify(param);
+                // GetDetectorCoords(postdata).then(res => {
+                //     let json = res;
+                //     if (json.Code == 0) {
+                //         if (json.Rs.length != 0) {
+                //             console.log(json.Rs[0]);
+                //             // that.dialog.points = [{x: json.Rs[0].X, y: json.Rs[0].Y}];
+                //             that.dialog.points = [{x: json.Rs.X, y: json.Rs.Y}];
+                //             // that.dialog.CoordsId = json.Rs[0].CoordsId;
+                //             // that.dialog.coords_memo = json.Rs[0].Memo;
+                //         } else {
+                //             that.dialog.points = [{x: 0, y: 0}];
+                //             that.dialog.CoordsId = 0;
+                //         }
+                //     } else {
+                //         that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                //     }
+                // })
+            },
+            // 自动补全MAC
+            autoCompleteMac() {
+                let text = this.dialog.mac;
+                if (text.length == 2 || text.length == 5 || text.length == 8 || text.length == 11 || text.length == 14) {
+                    this.dialog.mac = this.dialog.mac.toUpperCase() + ":"
+                }
+                if (text.length > 14) {
+                    this.dialog.mac = this.dialog.mac.toUpperCase()
+                }
+            },
+            // 探测记录
+            goPhoneRecord(row) {
+                this.$router.push({
+                    path: '/phoneSign',
+                    query:
+                        {
+                            detectorid: row.Id,
+                            comId: 1,
+                            regionId: row.RegionId,
+                        }
+                });
+            },
+            // 探测记录
+            goWifiRecord(row) {
+                this.$router.push({
+                    path: '/wifiSign',
+                    query:
+                        {
+                            detectorid: row.Id,
+                            comId: 1,
+                            regionId: row.RegionId,
+                        }
+                });
+            },
+            dialog_cancel() {
+                let that = this;
+                that.dialog_state = false;
+            },
+            dialog_ok() {
+                if (this.dialog_type == 1) {
+                    this.confirmAddEquip();
+                } else {
+                    this.confirmEditEquip();
+                }
+            },
+            // 提交增加新设备
+            confirmAddEquip() {
+                let that = this;
+                // checkVal
+                if (!that.dialog.mac) {
+                    this.$message.error('错了哦,mac不能为空');
+                    return false
+                }
+                if (!checkMac(that.dialog.mac)) {
+                    this.$message.error('错了哦,mac格式不正确');
+                    return false
+                }
+                if (!that.dialog.regionId) {
+                    this.$message.error('错了哦,所属区域不能为空');
+                    return false
+                }
+                if (!that.dialog.tagname) {
+                    this.$message.error('错了哦,标签名不能为空');
+                    return false
+                }
+                if (that.dialog.tagname.length > 20) {
+                    this.$message.error('错了哦,标签名不能超过20个字符');
+                    return false
+                }
+                this.selectRegionLabel(that.dialog.regionId);
+                let param = {
+                    token: localStorage.token,
+                    mac: that.dialog.mac,
+                    comId: 1,
+                    regionId: that.dialog.regionId,
+                    name: that.dialog.tagname,
+                    HardwareVersion: that.dialog.HardwareVersion,
+                    FirmwareVersion: that.dialog.FirmwareVersion,
+                    FirmwareScanM4Version: that.dialog.FirmwareScanM4Version,
+                    FirmwareScanM0Version: that.dialog.FirmwareScanM0Version,
+                    location: that.dialog.location,
+                    purchasesrc: that.dialog.purchasesrc,
+                    x: that.dialog.points[0].x,
+                    y: that.dialog.points[0].y,
+                    // coords_memo: that.dialog.coords_memo,
+                    memo: that.dialog.memo,
+                };
+                let postdata = qs.stringify(param);
+                DetectorAdd(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);
+                    }
+                });
+            },
+            // 提交修改设备信息
+            confirmEditEquip() {
+                let that = this;
+                // checkVal
+                if (!that.dialog.mac) {
+                    this.$message.error('错了哦,mac不能为空');
+                    return false
+                }
+                if (!checkMac(that.dialog.mac)) {
+                    this.$message.error('错了哦,mac格式不正确');
+                    return false
+                }
+
+                if (!that.dialog.regionId) {
+                    this.$message.error('错了哦,所属区域不能为空');
+                    return false
+                }
+                if (!that.dialog.tagname) {
+                    this.$message.error('错了哦,标签名不能为空');
+                    return false
+                }
+                if (that.dialog.tagname.length > 20) {
+                    this.$message.error('错了哦,标签名不能超过20个字符');
+                    return false
+                }
+                this.selectRegionLabel(that.dialog.regionId);
+                let param = {
+                    token: localStorage.token,
+                    id: that.dialog.eqId,
+                    mac: that.dialog.mac,
+                    comId: 1,
+                    regionId: that.dialog.regionId,
+                    name: that.dialog.tagname,
+                    HardwareVersion: that.dialog.HardwareVersion,
+                    FirmwareVersion: that.dialog.FirmwareVersion,
+                    FirmwareScanM4Version: that.dialog.FirmwareScanM4Version,
+                    FirmwareScanM0Version: that.dialog.FirmwareScanM0Version,
+                    location: that.dialog.location,
+                    purchasesrc: that.dialog.purchasesrc,
+                    x: that.dialog.points[0].x,
+                    y: that.dialog.points[0].y,
+                    coords_memo: that.dialog.coords_memo,
+                    memo: that.dialog.memo,
+                    coordsType: 1,//坐标状态 0:禁用, 1:启用, 9:删除,没有就传0
+                    coordsID: that.dialog.CoordsId,
+                    status: that.dialog.status,
+                };
+
+                let postdata = qs.stringify(param);
+                DetectorEdit(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);
+                    }
+                });
+            },
+            // 修改设备状态
+            getDetectorEditStatus(detectorid, status, text) {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    detectorid: detectorid,
+                    status: status,
+                };
+                let postdata = qs.stringify(param);
+                DetectorEditStatus(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.$message({
+                            showClose: true,
+                            message: text + '成功!',
+                            type: 'success'
+                        });
+                        // table 重载
+                        that.getTableQuery();
+                    } else {
+                        that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                    }
+                })
+            },
+            // 禁用
+            pauseRow(row) {
+                let that = this;
+                this.$confirm('是否禁用' + row.TagName + '设备?', '禁用操作', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    that.getDetectorEditStatus(row.Id, 0, '禁用');
+                }).catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消禁用'
+                    });
+                });
+            },
+            // 获取区域位置的平面图
+            getRegionPictureGetByRegionId(regionID) {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    regionID: regionID,
+                    regionId: regionID,
+                };
+                let postdata = qs.stringify(param);
+                that.dialog.plateImgSrc = '../assets/img/main/grid.png'
+                // RegionPictureGetByRegionId(postdata).then(res => {
+                //     let json = res;
+                //     that.dialog.plateImgSrc = '';
+                //     if (json.Code == 0) {
+                //         that.dialog.plateImgSrc = json.EncodeString;
+                //     } else {
+                //         that.$message.error(json.Memo + ',错误代码:' + json.Code);
+                //     }
+                // })
+            },
+            // 启用
+            runRow(row) {
+                console.log(row);
+                let that = this;
+                this.$confirm('是否启用' + row.TagName + '设备?', '启用操作', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    that.getDetectorEditStatus(row.Id, 1, '启用');
+                }).catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消启用'
+                    });
+                });
+            },
+            // 添加探测器位置的点坐标
+            addPoint(e) {
+                let x = e.offsetX;
+                let y = e.offsetY;
+                this.dialog.points = [{x: x, y: y}];
+            },
+            // 获取位置的文字内容
+            selectRegionLabel(id) {
+                let that = this;
+                let selectedWorkName = {};
+                // selectedWorkName = that.dialog.regionIdRoomOptions.filter(item => {
+                selectedWorkName = that.dialog.regionlevelOneIdOptions.filter(item => {
+                    if (item.Id === id) {
+                        console.log(item.Name);
+                        that.dialog.location = item.Name;
+                    }
+                });
+            },
+            filterTime(val, row, column) {
+                return nonTfmtDate(column, 10);
+            }
+        },
+        watch: {
+            // 'dialog.regionlevelOneId': function (val) {
+            //     this.dialogGetGetChildRegionSelect(val, 2)
+            // },
+            'dialog.regionId': function (val) {
+                if (val) {
+                    this.getRegionPictureGetByRegionId(val);
+                }
+            },
+        },
+        components: {
+            dialog_referrer_list
+        }
+    }
+</script>
+
+<style scoped>
+    @import "../assets/css/panel.css";
+    @import "../assets/css/dialog.css";
+
+    .tabs ul {
+        width: 168px;
+        float: left;
+    }
+
+    table span {
+        cursor: pointer;
+    }
+
+    .down_btn {
+        float: left;
+    }
+
+    .content {
+        width: 98%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        padding-left: 20px;
+    }
+
+    .selectStyle {
+        width: 100%;
+        color: #005EA2;
+    }
+
+    .selectStyle ::placeholder {
+        color: #005EA2;
+    }
+
+    /deep/ .modal .el-select .el-input .el-select__caret {
+        position: relative;
+        top: 35px;
+    }
+
+    .imgContianer {
+        width: 100%;
+        height: 340px;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+    }
+
+    .imgContianer img {
+        width: 100%;
+        height: 100%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+    }
+
+    .pointers {
+        position: relative;
+        bottom: 340px;
+        width: 100%;
+        height: 100%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+    }
+
+    .imgContianer i {
+        position: relative;
+        width: 10px;
+        height: 10px;
+        float: left;
+        border-radius: 250px;
+        background: #FFDD00;
+    }
+
+    /deep/ .modal-dialog {
+        height: 80px;
+        margin-top: 20px;
+    }
+
+    /deep/ textarea {
+        color: #6DC1FF;
+    }
+
+    /deep/ .el-table__empty-text {
+        color: #015B9E;
+    }
+
+    /deep/ .el-input.is-disabled .el-input__inner {
+        background-color: #015B9E;
+    }
+
+    .red {
+        color: red;
+    }
+
+    .yellow {
+        color: #fd0;
+    }
+</style>

+ 14 - 0
src/views/wirelessStatics.vue

@@ -0,0 +1,14 @@
+<template>
+<div>
+    123
+</div>
+</template>
+
+<script>
+    export default {
+    }
+</script>
+
+<style scoped>
+
+</style>