|
|
@@ -11,31 +11,54 @@
|
|
|
<div class="panel-body">
|
|
|
<div class=" panel_control">
|
|
|
<div class="pline">
|
|
|
- <em>设备ID:</em>
|
|
|
- <el-input v-model="panel.tagname" placeholder=""></el-input>
|
|
|
+ <em>MAC地址:</em>
|
|
|
+ <el-input v-model="panel.mac" placeholder=""></el-input>
|
|
|
</div>
|
|
|
<div class="pline">
|
|
|
- <em>MAC地址:</em>
|
|
|
- <el-input v-model="panel.tagname" placeholder=""></el-input>
|
|
|
+ <em>设备类型 :</em>
|
|
|
+ <el-select v-model="panel.deviceType">
|
|
|
+ <el-option
|
|
|
+ v-for="item in panel.deviceTypeOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="pline">
|
|
|
+ <em>安全等级 :</em>
|
|
|
+ <el-select v-model="panel.level">
|
|
|
+ <el-option
|
|
|
+ v-for="item in panel.levelOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</div>
|
|
|
<div class="pline">
|
|
|
- <em>所属区域:</em>
|
|
|
- <el-select v-model="panel.regionid">
|
|
|
+ <em>探测器 :</em>
|
|
|
+ <el-select v-model="panel.detectorId">
|
|
|
<el-option
|
|
|
- v-for="item in panel.regionidOptions"
|
|
|
+ v-for="item in panel.detectorIdOptions"
|
|
|
:key="item.Id"
|
|
|
- :label="item.Name"
|
|
|
+ :label="item.TagName"
|
|
|
:value="item.Id">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</div>
|
|
|
<div class="pline">
|
|
|
- <el-button size="medium" type="primary" @click="query">查询</el-button>
|
|
|
+ <em>时间范围</em>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="panel.time1"
|
|
|
+ type="daterange"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期">
|
|
|
+ </el-date-picker>
|
|
|
</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 class="pline">
|
|
|
+ <el-button size="medium" type="primary" @click="query">查询</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -50,12 +73,7 @@
|
|
|
@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="序号"
|
|
|
@@ -65,38 +83,99 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="Mac"
|
|
|
- label="区域名称"
|
|
|
+ label="Mac"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="Oem"
|
|
|
+ label="品牌"
|
|
|
+ width="140"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <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="DetectorTag"
|
|
|
+ label="探测器"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="Xmax"
|
|
|
- label="长/m"
|
|
|
+ prop="DeviceType"
|
|
|
+ label="设备类型"
|
|
|
+ :formatter="filterType"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="Ymax"
|
|
|
- label="宽/m"
|
|
|
+ prop="BeginTs"
|
|
|
+ label="开始探测"
|
|
|
+ width="180"
|
|
|
+ :formatter="filterTime"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="Memo"
|
|
|
- label="备注"
|
|
|
+ prop="EndTs"
|
|
|
+ label="结束探测"
|
|
|
+ width="180"
|
|
|
+ :formatter="filterTime"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="address"
|
|
|
- label="操作记录"
|
|
|
- width="220"
|
|
|
+ prop="Down"
|
|
|
+ label="下载"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="Up"
|
|
|
+ label="上传"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="安全等级"
|
|
|
+ label="Level"
|
|
|
>
|
|
|
<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>-->
|
|
|
+ <span v-if="scope.row.Level == 1">安全</span>
|
|
|
+ <span v-if="scope.row.Level == 2" class="yellow">可疑</span>
|
|
|
+ <span v-if="scope.row.Level == 3" class="red">危险</span>
|
|
|
+ <span v-if="scope.row.Level == 4" class="red">危险</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="Rssi"
|
|
|
+ label="Rssi"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="Ssid"
|
|
|
+ label="Ssid"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tooltip class="item" effect="dark" :content="scope.row.Ssid" placement="top-start">
|
|
|
+ <span v-if="scope.row.Ssid">
|
|
|
+ {{ scope.row.Ssid.length > 9 ? scope.row.Ssid.substr(0,9)+'...' : scope.row.Ssid }}
|
|
|
+ </span>
|
|
|
+ <span v-else>
|
|
|
+ 未知
|
|
|
+ </span>
|
|
|
+
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="StaCount"
|
|
|
+ label="连接设备数"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
<br>
|
|
|
<el-pagination
|
|
|
@@ -105,116 +184,34 @@
|
|
|
: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,
|
|
|
+ DetectorLogQuery,
|
|
|
} 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: '',
|
|
|
- username: '',
|
|
|
- compname: '',
|
|
|
- keyword: '',
|
|
|
- USERCODE: '',
|
|
|
- taskstatus: 99,
|
|
|
- regionid: 0,
|
|
|
- regionid2: '',
|
|
|
- regionidOptions: [],
|
|
|
- regionidOptions2: [],
|
|
|
- options: [
|
|
|
- {value: 99, label: '全部'},
|
|
|
- {value: 1, label: '进行中'},
|
|
|
- {value: 2, label: '已完成'},
|
|
|
- ],
|
|
|
- time1: globalBt3(2),
|
|
|
+ mac: '',
|
|
|
+ deviceType: '',
|
|
|
+ level:'',
|
|
|
+ detectorId: '',
|
|
|
+ time1: globalBt3(1),
|
|
|
+ deviceTypeOptions: AllTypeOption(),
|
|
|
+ levelOptions: levelOptions(),
|
|
|
+ detectorIdOptions: [],
|
|
|
},
|
|
|
pageination: {
|
|
|
pageItem: 100,
|
|
|
@@ -232,46 +229,37 @@
|
|
|
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下所有检测设备
|
|
|
+ this.getDectorSelect();
|
|
|
+ let bt = parseInt(new Date(that.panel.time1[0]).getTime() / 1000);
|
|
|
+ let et = parseInt(new Date(that.panel.time1[1]).getTime() / 1000);
|
|
|
let param = {
|
|
|
token: localStorage.token,
|
|
|
mac: this.panel.mac,//
|
|
|
- regionId: that.panel.regionId,//
|
|
|
- name: that.panel.tagname,//标签名
|
|
|
- comid: 1,//
|
|
|
- start: 1,//
|
|
|
- tableMax: 9999,//
|
|
|
+ deviceType: that.panel.deviceType,//
|
|
|
+ level: that.panel.level,//标签名
|
|
|
+ bt: bt,//
|
|
|
+ et: et,//
|
|
|
+ offset: this.start,
|
|
|
+ limit: this.start + 100,//
|
|
|
};
|
|
|
let postdata = qs.stringify(param);
|
|
|
- DetectorList(postdata).then(res => {
|
|
|
+ DetectorLogQuery(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;
|
|
|
+ that.recordsTotal = json.AllCount;
|
|
|
} else {
|
|
|
that.allTableData = [];
|
|
|
that.recordsTotal = 0;
|
|
|
@@ -283,86 +271,35 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 获取下级列表
|
|
|
- getGeFullRegionSelect() {
|
|
|
+ // 获取探测器列表
|
|
|
+ getDectorSelect() {
|
|
|
let that = this;
|
|
|
let param = {
|
|
|
token: localStorage.token,
|
|
|
};
|
|
|
let postdata = qs.stringify(param);
|
|
|
- RegionList(postdata).then(res => {
|
|
|
+ DetectorList(postdata).then(res => {
|
|
|
let json = res;
|
|
|
if (json.Code == 0) {
|
|
|
if (!json.Rs) {
|
|
|
- that.$message.error('区域列表为空,请先添加有效区域');
|
|
|
+ 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;
|
|
|
+ that.panel.detectorIdOptions = json.Rs;
|
|
|
+ that.panel.detectorIdOptions.unshift({Id: 0, TagName: "全部", DisplayName: "全部"});
|
|
|
} 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.draw = 1;
|
|
|
+ this.start = 0;
|
|
|
+ this.pageination.pageIndex = 1;
|
|
|
this.getTableQuery();
|
|
|
this.$message.success('查询完毕');
|
|
|
},
|
|
|
-
|
|
|
handleSelectionChange(val) {
|
|
|
this.multipleSelection = val;
|
|
|
},
|
|
|
@@ -401,426 +338,19 @@
|
|
|
this.tableData = tables;
|
|
|
}
|
|
|
that.start = index * that.draw;
|
|
|
- // that.getTableQuery();
|
|
|
+ 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);
|
|
|
- }
|
|
|
+ },
|
|
|
+ // 过滤设备类型
|
|
|
+ filterType(value, row, column) {
|
|
|
+ return filterAllType(column);
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
// 'dialog.regionlevelOneId': function (val) {
|
|
|
@@ -832,16 +362,11 @@
|
|
|
}
|
|
|
},
|
|
|
},
|
|
|
- components: {
|
|
|
- dialog_referrer_list
|
|
|
- }
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
@import "../assets/css/panel.css";
|
|
|
- @import "../assets/css/dialog.css";
|
|
|
-
|
|
|
.tabs ul {
|
|
|
width: 168px;
|
|
|
float: left;
|