|
|
@@ -18,27 +18,14 @@
|
|
|
<div class=" panel_control">
|
|
|
<div class="pline">
|
|
|
<em>策略名称:</em>
|
|
|
- <el-input v-model="panel.tagname" placeholder=""></el-input>
|
|
|
+ <el-input v-model="panel.name" placeholder=""></el-input>
|
|
|
</div>
|
|
|
<div class="pline">
|
|
|
- <em>持续时间:</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-col :span="6"><em class="label_checked">
|
|
|
- <el-checkbox v-model="checked">信号录制</el-checkbox>
|
|
|
- </em></el-col>
|
|
|
+ <em class="label_checked" @click="turnRecord">
|
|
|
+ <img src="../assets/img/main/true.png" height="15" width="15" v-if="recordState"/>
|
|
|
+ <img src="../assets/img/main/false.png" height="15" width="15" v-else/>
|
|
|
+ 信号录制
|
|
|
+ </em>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="panel_row">
|
|
|
@@ -47,7 +34,7 @@
|
|
|
扫描选项
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="panel_row">
|
|
|
+ <div class="panel_row control_row">
|
|
|
<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>
|
|
|
@@ -80,36 +67,35 @@
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="Mac"
|
|
|
+ prop="agreement"
|
|
|
label="无线协议"
|
|
|
+ :formatter="filterWirelessTypeName"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="Xmax"
|
|
|
+ prop="begin"
|
|
|
label="起始频率"
|
|
|
+ sortable
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="Ymax"
|
|
|
+ prop="end"
|
|
|
label="截止频率"
|
|
|
+ sortable
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="Memo"
|
|
|
+ prop="distance"
|
|
|
label="扫描距离"
|
|
|
+ :formatter="filterDistanceName"
|
|
|
+ sortable
|
|
|
>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
<br>
|
|
|
- <!--<el-pagination-->
|
|
|
- <!--background-->
|
|
|
- <!--:total="pageination.total"-->
|
|
|
- <!--:page-size="pageination.pageItem"-->
|
|
|
- <!--@current-change="pageChange"-->
|
|
|
- <!--></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>
|
|
|
+ <el-button size="medium" type="primary" @click="cancleTactics">取消</el-button>
|
|
|
+ <el-button size="medium" type="primary" @click="confirmTactics">确定</el-button>
|
|
|
</div>
|
|
|
|
|
|
<dialog_referrer_list
|
|
|
@@ -121,31 +107,46 @@
|
|
|
>
|
|
|
<div class="dialogContent">
|
|
|
<el-row :gutter="24">
|
|
|
- <el-col :span="24">
|
|
|
+ <el-col :span="12">
|
|
|
<label>
|
|
|
无线协议
|
|
|
</label>
|
|
|
- <el-input v-model="dialog.mac" @keyup.native="autoCompleteMac"
|
|
|
- :disabled="dialog_type == 2"></el-input>
|
|
|
+ <!--单条添加与首页逻辑不同-->
|
|
|
+ <el-select v-model="scan.agreement" placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="item in agreement_options"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</el-col>
|
|
|
- <el-col :span="24">
|
|
|
+ <el-col :span="12">
|
|
|
<label>
|
|
|
扫描距离
|
|
|
</label>
|
|
|
- <el-input v-model="dialog.mac" @keyup.native="autoCompleteMac"
|
|
|
- :disabled="dialog_type == 2"></el-input>
|
|
|
+ <el-select v-model="scan.distance" placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="item in distance_options"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="24" v-if="scopeState">
|
|
|
<el-col :span="12">
|
|
|
<label>
|
|
|
起始频率
|
|
|
</label>
|
|
|
- <el-input v-model="dialog.tagname" type="number"></el-input>
|
|
|
+ <el-input v-model="scan.begin" type="number" placeholder="单位100K"></el-input>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<label>
|
|
|
截止频率
|
|
|
</label>
|
|
|
- <el-input v-model="dialog.tagname" type="number"></el-input>
|
|
|
+ <el-input v-model="scan.end" placeholder="单位100K"></el-input>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
@@ -157,24 +158,19 @@
|
|
|
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,
|
|
|
+ ScanStrategyAdd,
|
|
|
+ ScanStrategyEdit,
|
|
|
} from '../api/getApiRes.js'
|
|
|
|
|
|
let qs = require('qs');
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- // dialog
|
|
|
+ tid: 0,
|
|
|
dialog_state: false,
|
|
|
+ checked: false,
|
|
|
dialog_title: '',
|
|
|
dialog_type: '',//类型,1是添加,2是修改
|
|
|
dialog: {
|
|
|
@@ -200,18 +196,32 @@
|
|
|
CoordsId: 0,
|
|
|
status: 0,
|
|
|
},
|
|
|
+ scan: {
|
|
|
+ tactics: 0,
|
|
|
+ agreement: "",
|
|
|
+ begin: 0,
|
|
|
+ end: 0,
|
|
|
+ distance: 1,
|
|
|
+ cycle: 0,
|
|
|
+ },
|
|
|
+ scopeState: false,
|
|
|
+ agreement_options: WirelessType(),
|
|
|
+ distance_options: WirelessRange(),
|
|
|
+ recordState: true,
|
|
|
tabIndex: 0,
|
|
|
tabs: [
|
|
|
{name: '扫描策略新增', url: 'addTactics'},
|
|
|
],
|
|
|
// panel 配置项目
|
|
|
panel: {
|
|
|
+ name: '',
|
|
|
usercode: '',
|
|
|
username: '',
|
|
|
compname: '',
|
|
|
keyword: '',
|
|
|
USERCODE: '',
|
|
|
taskstatus: 99,
|
|
|
+ isRecording: true,
|
|
|
regionid: 0,
|
|
|
regionid2: '',
|
|
|
regionidOptions: [],
|
|
|
@@ -243,17 +253,308 @@
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- if (this.$route.query.RegionId) {
|
|
|
- this.panel.regionid = this.$route.query.RegionId;
|
|
|
- this.panel.tagname = this.$route.query.TagName;
|
|
|
+ if (this.$route.query.tid != 0) {
|
|
|
+ // 有tid是修改
|
|
|
+ this.readTacticsInfo();
|
|
|
}
|
|
|
|
|
|
- this.getTableQuery();
|
|
|
+ this.loading = false;
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ '$route': function (val) {
|
|
|
+ if (val.path == '/addtactics') {
|
|
|
+ this.readTacticsInfo();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ scan: {
|
|
|
+ handler(newName, oldName) {
|
|
|
+ if (parseInt(newName.begin) > 6000) {
|
|
|
+ this.$notify.error({
|
|
|
+ title: '错误',
|
|
|
+ message: '起始频率不能大于6000'
|
|
|
+ });
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (parseInt(newName.begin) < 0) {
|
|
|
+ this.$notify.error({
|
|
|
+ title: '错误',
|
|
|
+ message: '起始频率不能小于0'
|
|
|
+ });
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (parseInt(newName.end) > 6000) {
|
|
|
+ this.$notify.error({
|
|
|
+ title: '错误',
|
|
|
+ message: '截止频率不能大于6000'
|
|
|
+ });
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (parseInt(newName.end) < 0) {
|
|
|
+ this.$notify.error({
|
|
|
+ title: '错误',
|
|
|
+ message: '截止频率不能小于0'
|
|
|
+ });
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (parseInt(newName.end) < parseInt(newName.begin)) {
|
|
|
+ this.$notify.error({
|
|
|
+ title: '错误',
|
|
|
+ message: '截止频率不能小于起始频率'
|
|
|
+ });
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ // 0-6G现实范围
|
|
|
+ if (newName.agreement == "13") {
|
|
|
+ this.scopeState = true
|
|
|
+ } else {
|
|
|
+ this.scopeState = false
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ deep: true,
|
|
|
+ immediate: true
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
+ readTacticsInfo() {
|
|
|
+ let row = this.$route.query;
|
|
|
+ let rowVal = JSON.parse(row.Value);
|
|
|
+ this.tid = row.tid;
|
|
|
+ this.panel.name = row.name;
|
|
|
+ this.recordState = rowVal.IsRecording;
|
|
|
+ this.tableData = [];
|
|
|
+ let signalList = {};
|
|
|
+ let signAttr = '';
|
|
|
+ for (var i = 0; i < rowVal.SignalList.length; i++) {
|
|
|
+ signAttr = rowVal.SignalList[i];
|
|
|
+ signalList = {
|
|
|
+ agreement: signAttr.Type,
|
|
|
+ distance: signAttr.Range,
|
|
|
+ begin: 0,
|
|
|
+ end: 0,
|
|
|
+ };
|
|
|
+ this.tableData.push(signalList)
|
|
|
+ }
|
|
|
+ this.loading = false;
|
|
|
+ },
|
|
|
+ turnRecord() {
|
|
|
+ this.recordState = !this.recordState
|
|
|
+ },
|
|
|
handle(row, column, event) {
|
|
|
this.$refs.multipleTable.toggleRowSelection(row);
|
|
|
},
|
|
|
+ // 取消
|
|
|
+ cancleTactics() {
|
|
|
+ this.$confirm('是否取消当前扫描策略?', '取消操作', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.$router.push({path: '/tactics'});
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消'
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ confirmTactics() {
|
|
|
+ let tid = this.$route.query.tid;
|
|
|
+ if (tid == 0) {
|
|
|
+ // 新增
|
|
|
+ this.addTactitcs();
|
|
|
+ } else {
|
|
|
+ // 编辑
|
|
|
+ this.editTactitcs();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 新增
|
|
|
+ addTactitcs() {
|
|
|
+ let that = this;
|
|
|
+ // 校验数据
|
|
|
+ if (!this.panel.name) {
|
|
|
+ that.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '错了哦,策略名称不能为空',
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (this.panel.length > 8) {
|
|
|
+ that.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '错了哦,策略名称不能超过8个字',
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.tableData.length == 0) {
|
|
|
+ that.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '错了哦,扫描选项不能为空',
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ let freq06G = [];
|
|
|
+ let signalList = [];
|
|
|
+
|
|
|
+ // 有0-6g
|
|
|
+ let begin = 0;
|
|
|
+ let end = 0;
|
|
|
+ that.tableData.map(function (item) {
|
|
|
+ if (item.agreement == 13) {
|
|
|
+ freq06G = [
|
|
|
+ {
|
|
|
+ begin: parseInt(item.begin),
|
|
|
+ end: parseInt(item.end)
|
|
|
+ }
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ if (that.tableData.length == 0) {
|
|
|
+ that.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '无线协议不能为空!',
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ for (var i = 0; i < that.tableData.length; i++) {
|
|
|
+ signalList[i] = {
|
|
|
+ "range": that.tableData[i].distance,
|
|
|
+ "type": that.tableData[i].agreement
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 拼装value
|
|
|
+ let tacticsValue = {
|
|
|
+ freq06G: freq06G,
|
|
|
+ isRecording: this.recordState,
|
|
|
+ signalList: signalList,
|
|
|
+ };
|
|
|
+ tacticsValue = JSON.stringify(tacticsValue);
|
|
|
+ let param = {
|
|
|
+ token: localStorage.token,
|
|
|
+ name: this.panel.name,
|
|
|
+ memo: '',
|
|
|
+ value: tacticsValue
|
|
|
+ };
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
+ ScanStrategyAdd(postdata).then(res => {
|
|
|
+ let json = res;
|
|
|
+ if (json.Code == 0) {
|
|
|
+ that.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '扫描策略已新增!',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+
|
|
|
+ this.$router.push({path: '/tactics'});
|
|
|
+
|
|
|
+ } else {
|
|
|
+ that.$message.error(json.Memo);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ editTactitcs() {
|
|
|
+ let that = this;
|
|
|
+ // 校验数据
|
|
|
+ if (!this.panel.name) {
|
|
|
+ that.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '错了哦,策略名称不能为空',
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (this.panel.length > 8) {
|
|
|
+ that.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '错了哦,策略名称不能超过8个字',
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.tableData.length == 0) {
|
|
|
+ that.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '错了哦,扫描选项不能为空',
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ let freq06G = [];
|
|
|
+ let signalList = [];
|
|
|
+
|
|
|
+ // 有0-6g
|
|
|
+ let begin = 0;
|
|
|
+ let end = 0;
|
|
|
+ that.tableData.map(function (item) {
|
|
|
+ if (item.agreement == 13) {
|
|
|
+ freq06G = [
|
|
|
+ {
|
|
|
+ begin: parseInt(item.begin),
|
|
|
+ end: parseInt(item.end)
|
|
|
+ }
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ if (that.tableData.length == 0) {
|
|
|
+ that.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '无线协议不能为空!',
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ for (var i = 0; i < that.tableData.length; i++) {
|
|
|
+ signalList[i] = {
|
|
|
+ "range": that.tableData[i].distance,
|
|
|
+ "type": that.tableData[i].agreement
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 拼装value
|
|
|
+ let tacticsValue = {
|
|
|
+ freq06G: freq06G,
|
|
|
+ isRecording: this.recordState,
|
|
|
+ signalList: signalList,
|
|
|
+ };
|
|
|
+ tacticsValue = JSON.stringify(tacticsValue);
|
|
|
+ let param = {
|
|
|
+ token: localStorage.token,
|
|
|
+ id:this.tid,
|
|
|
+ name: this.panel.name,
|
|
|
+ memo: '',
|
|
|
+ value: tacticsValue
|
|
|
+ };
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
+ ScanStrategyEdit(postdata).then(res => {
|
|
|
+ let json = res;
|
|
|
+ if (json.Code == 0) {
|
|
|
+ that.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '扫描策略已修改!',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+
|
|
|
+ this.$router.push({path: '/tactics'});
|
|
|
+
|
|
|
+ } else {
|
|
|
+ that.$message.error(json.Memo);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 页面数据查询
|
|
|
getTableQuery() {
|
|
|
let that = this;
|
|
|
@@ -277,7 +578,6 @@
|
|
|
that.loading = false;
|
|
|
if (json.Rs) {
|
|
|
that.allTableData = json.Rs;
|
|
|
- console.log(json.Rs);
|
|
|
that.recordsTotal = json.Rs.length;
|
|
|
} else {
|
|
|
that.allTableData = [];
|
|
|
@@ -423,22 +723,13 @@
|
|
|
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.scan.tactics = '';
|
|
|
+ this.scan.agreement = "";
|
|
|
+ this.scan.begin = 0;
|
|
|
+ this.scan.end = 0;
|
|
|
+ this.scan.distance = 1;
|
|
|
+ this.scan.cycle = 0;
|
|
|
|
|
|
// 加载默认的平面图
|
|
|
// this.dialogGetGetChildRegionSelect(0, 1);
|
|
|
@@ -455,41 +746,22 @@
|
|
|
});
|
|
|
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('此操作将永久删除该设备, 是否继续?', '提示', {
|
|
|
+ let current = this.multipleSelection[0];
|
|
|
+ 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);
|
|
|
- }
|
|
|
- });
|
|
|
+ // 从列表删掉
|
|
|
+ var index = that.tableData.indexOf(current);
|
|
|
+ that.tableData.splice(index, 1);
|
|
|
}).catch(() => {
|
|
|
this.$message({
|
|
|
type: 'info',
|
|
|
message: '已取消删除'
|
|
|
});
|
|
|
});
|
|
|
+
|
|
|
},
|
|
|
editList() {
|
|
|
let that = this;
|
|
|
@@ -511,53 +783,15 @@
|
|
|
return false
|
|
|
}
|
|
|
this.dialog_state = true;
|
|
|
- this.dialog_title = '修改设备信息';
|
|
|
+ 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);
|
|
|
- // }
|
|
|
- // })
|
|
|
+ this.scan.agreement = row.agreement;
|
|
|
+ this.scan.distance = row.distance;
|
|
|
+ this.scan.begin = row.begin;
|
|
|
+ this.scan.end = row.end;
|
|
|
},
|
|
|
// 自动补全MAC
|
|
|
autoCompleteMac() {
|
|
|
@@ -569,30 +803,6 @@
|
|
|
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;
|
|
|
@@ -608,127 +818,101 @@
|
|
|
confirmAddEquip() {
|
|
|
let that = this;
|
|
|
// checkVal
|
|
|
- if (!that.dialog.mac) {
|
|
|
- this.$message.error('错了哦,mac不能为空');
|
|
|
+ if (!that.scan.agreement) {
|
|
|
+ this.$message.error('错了哦,无线协议不能为空');
|
|
|
return false
|
|
|
}
|
|
|
- if (!checkMac(that.dialog.mac)) {
|
|
|
- this.$message.error('错了哦,mac格式不正确');
|
|
|
+
|
|
|
+ if (parseInt(that.scan.begin) < 0) {
|
|
|
+ this.$message.error('错了哦,起始频率不能小于0');
|
|
|
return false
|
|
|
}
|
|
|
- if (!that.dialog.regionId) {
|
|
|
- this.$message.error('错了哦,所属区域不能为空');
|
|
|
+ if (parseInt(that.scan.end) > 6000) {
|
|
|
+ this.$message.error('错了哦,截止频率不能大于6000');
|
|
|
return false
|
|
|
}
|
|
|
- if (!that.dialog.tagname) {
|
|
|
- this.$message.error('错了哦,标签名不能为空');
|
|
|
+ if (parseInt(that.scan.end) < 0) {
|
|
|
+ this.$message.error('错了哦,截止频率不能小于0');
|
|
|
return false
|
|
|
}
|
|
|
- if (that.dialog.tagname.length > 20) {
|
|
|
- this.$message.error('错了哦,标签名不能超过20个字符');
|
|
|
+ if (parseInt(that.scan.end) < parseInt(that.scan.begin)) {
|
|
|
+ this.$message.error('错了哦,截止频率不能小于起始频率');
|
|
|
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);
|
|
|
- }
|
|
|
+ // 去掉已有的
|
|
|
+ let hasSelected = [];
|
|
|
+ that.allTableData.map(function (item) {
|
|
|
+ hasSelected.push(item.agreement)
|
|
|
});
|
|
|
+ if (!hasSelected.includes(that.scan.agreement)) {
|
|
|
+ let row = {
|
|
|
+ agreement: that.scan.agreement,
|
|
|
+ distance: that.scan.distance,
|
|
|
+ begin: that.scan.begin,
|
|
|
+ end: that.scan.end,
|
|
|
+ };
|
|
|
+ that.allTableData.push(row)
|
|
|
+ } else {
|
|
|
+ this.$message.error('当前协议已添加,请不要重复添加');
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ that.recordsTotal = that.recordsTotal + 1;
|
|
|
+ // 设置分页数据
|
|
|
+ that.setPaginations();
|
|
|
+ that.dialog_state = false;
|
|
|
},
|
|
|
// 提交修改设备信息
|
|
|
confirmEditEquip() {
|
|
|
let that = this;
|
|
|
- // checkVal
|
|
|
- if (!that.dialog.mac) {
|
|
|
- this.$message.error('错了哦,mac不能为空');
|
|
|
+ if (!that.scan.agreement) {
|
|
|
+ this.$message.error('错了哦,无线协议不能为空');
|
|
|
return false
|
|
|
}
|
|
|
- if (!checkMac(that.dialog.mac)) {
|
|
|
- this.$message.error('错了哦,mac格式不正确');
|
|
|
+ if (parseInt(that.scan.begin) < 0) {
|
|
|
+ this.$message.error('错了哦,起始频率不能小于0');
|
|
|
return false
|
|
|
}
|
|
|
-
|
|
|
- if (!that.dialog.regionId) {
|
|
|
- this.$message.error('错了哦,所属区域不能为空');
|
|
|
+ if (parseInt(that.scan.end) > 6000) {
|
|
|
+ this.$message.error('错了哦,截止频率不能大于6000');
|
|
|
return false
|
|
|
}
|
|
|
- if (!that.dialog.tagname) {
|
|
|
- this.$message.error('错了哦,标签名不能为空');
|
|
|
+ if (parseInt(that.scan.end) < 0) {
|
|
|
+ this.$message.error('错了哦,截止频率不能小于0');
|
|
|
return false
|
|
|
}
|
|
|
- if (that.dialog.tagname.length > 20) {
|
|
|
- this.$message.error('错了哦,标签名不能超过20个字符');
|
|
|
+ if (parseInt(that.scan.end) < parseInt(that.scan.begin)) {
|
|
|
+ this.$message.error('错了哦,截止频率不能小于起始频率');
|
|
|
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);
|
|
|
- }
|
|
|
+ // 去掉已有的
|
|
|
+ let hasSelected = [];
|
|
|
+ that.tableData.map(function (item) {
|
|
|
+ hasSelected.push(item.agreement)
|
|
|
});
|
|
|
+ if (!hasSelected.includes(that.scan.agreement)) {
|
|
|
+ let row = {
|
|
|
+ agreement: that.scan.agreement,
|
|
|
+ distance: that.scan.distance,
|
|
|
+ begin: that.scan.begin,
|
|
|
+ end: that.scan.end,
|
|
|
+ };
|
|
|
+ that.tableData.push(row);
|
|
|
+
|
|
|
+ // 当前编辑的那条再从列表删掉
|
|
|
+ let current = this.multipleSelection[0];
|
|
|
+ var index = that.tableData.indexOf(current);
|
|
|
+ that.tableData.splice(index, 1);
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.$message.error('当前协议已添加,请不要重复添加');
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ that.recordsTotal = that.recordsTotal + 1;
|
|
|
+ // 设置分页数据
|
|
|
+ // that.setPaginations();
|
|
|
+ that.dialog_state = false;
|
|
|
},
|
|
|
// 修改设备状态
|
|
|
getDetectorEditStatus(detectorid, status, text) {
|
|
|
@@ -754,91 +938,18 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 禁用
|
|
|
- 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: '已取消禁用'
|
|
|
- });
|
|
|
- });
|
|
|
+ // 过滤设备类型
|
|
|
+ filterWirelessTypeName(value, row, column) {
|
|
|
+ return filterWirelessType(column);
|
|
|
},
|
|
|
- // 获取区域位置的平面图
|
|
|
- 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;
|
|
|
- }
|
|
|
- });
|
|
|
+ filterDistanceName(value, row, column) {
|
|
|
+ return filterWirelessRangeText(column)
|
|
|
},
|
|
|
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
|
|
|
}
|
|
|
@@ -961,6 +1072,7 @@
|
|
|
background: #00FEFF;
|
|
|
margin-right: 10px;
|
|
|
}
|
|
|
+
|
|
|
.panel_row {
|
|
|
width: 100%;
|
|
|
overflow: hidden;
|
|
|
@@ -968,6 +1080,59 @@
|
|
|
margin: 0 auto;
|
|
|
padding-top: 20px;
|
|
|
padding-bottom: 10px;
|
|
|
- background: rgba(27,86,200,0.14)
|
|
|
+ background: rgba(27, 86, 200, 0.14)
|
|
|
+ }
|
|
|
+
|
|
|
+ .pline {
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .el-checkbox__label {
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .panel {
|
|
|
+ background: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ .panel_control {
|
|
|
+ padding-top: 5px;
|
|
|
+ padding-bottom: 5px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .control_row {
|
|
|
+ background: rgba(27, 86, 200, 0.4)
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .modal-body {
|
|
|
+ position: relative;
|
|
|
+ z-index: 1989;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .el-checkbox__inner {
|
|
|
+ z-index: 0 !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .modal-dialog {
|
|
|
+ margin-top: 10%;
|
|
|
+ min-height: 340px;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .modal-body .el-select {
|
|
|
+ width: 100%;
|
|
|
+ /*height: 40px;*/
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .modal .el-input__inner {
|
|
|
+ height: 40px;
|
|
|
+ /*height: 30px!important;*/
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .el-popper {
|
|
|
+ z-index: 6666;
|
|
|
+ }
|
|
|
+
|
|
|
+ .label_checked {
|
|
|
+ width: 140px !important;
|
|
|
}
|
|
|
</style>
|