|
|
@@ -11,15 +11,7 @@
|
|
|
<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>
|
|
|
+ <em>扫描区域:</em>
|
|
|
<el-select v-model="panel.regionid">
|
|
|
<el-option
|
|
|
v-for="item in panel.regionidOptions"
|
|
|
@@ -29,6 +21,17 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</div>
|
|
|
+ <div class="pline">
|
|
|
+ <em>扫描策略:</em>
|
|
|
+ <el-select v-model="panel.scanStrategyId">
|
|
|
+ <el-option
|
|
|
+ v-for="item in panel.scanStrategyIdOptions"
|
|
|
+ :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>
|
|
|
@@ -64,38 +67,55 @@
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="Mac"
|
|
|
+ prop="RegionName"
|
|
|
label="区域名称"
|
|
|
+ sortable
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="Xmax"
|
|
|
- label="长/m"
|
|
|
+ prop="Begin"
|
|
|
+ label="开始时间"
|
|
|
+ :formatter="filterTime"
|
|
|
+ sortable
|
|
|
>
|
|
|
</el-table-column>
|
|
|
+
|
|
|
<el-table-column
|
|
|
- prop="Ymax"
|
|
|
- label="宽/m"
|
|
|
+ prop="Duration"
|
|
|
+ label="持续时间(秒)"
|
|
|
+ sortable
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="Memo"
|
|
|
- label="备注"
|
|
|
+ prop="InterDays"
|
|
|
+ label="间隔天数"
|
|
|
+ sortable
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="address"
|
|
|
- label="操作记录"
|
|
|
- width="220"
|
|
|
+ prop="ExecCount"
|
|
|
+ label="已执行次数"
|
|
|
+ sortable
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="ScanStrategyName"
|
|
|
+ label="扫描策略"
|
|
|
+ sortable
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="UserName"
|
|
|
+ label="创建者"
|
|
|
+ sortable
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="CreateAt"
|
|
|
+ label="创建时间"
|
|
|
+ :formatter="filterTime"
|
|
|
+ sortable
|
|
|
>
|
|
|
- <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>
|
|
|
@@ -116,30 +136,59 @@
|
|
|
>
|
|
|
<div class="dialogContent">
|
|
|
<el-row :gutter="24">
|
|
|
- <el-col :span="24">
|
|
|
+ <el-col :span="12">
|
|
|
+ <label>
|
|
|
+ *区域
|
|
|
+ </label>
|
|
|
+ <el-select v-model="dialog.regionid">
|
|
|
+ <el-option
|
|
|
+ v-for="item in dialog.regionidOptions"
|
|
|
+ :key="item.Id"
|
|
|
+ :label="item.Name"
|
|
|
+ :value="item.Id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
+ <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="dialog.scanStrategyId">
|
|
|
+ <el-option
|
|
|
+ v-for="item in dialog.scanStrategyIdOptions"
|
|
|
+ :key="item.Id"
|
|
|
+ :label="item.Name"
|
|
|
+ :value="item.Id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<label>
|
|
|
- 长/m
|
|
|
+ *开始时间
|
|
|
</label>
|
|
|
- <el-input v-model="dialog.tagname"></el-input>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="dialog.bt"
|
|
|
+ type="date"
|
|
|
+ placeholder="选择日期">
|
|
|
+ </el-date-picker>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<label>
|
|
|
- 宽/m
|
|
|
+ *扫描时间
|
|
|
</label>
|
|
|
- <el-input v-model="dialog.tagname"></el-input>
|
|
|
+ <el-input v-model="dialog.duration" type="number"></el-input>
|
|
|
</el-col>
|
|
|
- <el-col :span="24">
|
|
|
+ <el-col :span="12">
|
|
|
+ <label>
|
|
|
+ *间隔天数
|
|
|
+ </label>
|
|
|
+ <el-input v-model="dialog.interDays" type="number" placeholder="0为单次扫描"></el-input>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
<label>
|
|
|
- 备注
|
|
|
+ *备注
|
|
|
</label>
|
|
|
- <el-input v-model="dialog.memo" type="textarea"></el-input>
|
|
|
+ <el-input v-model="dialog.memo" type="text"></el-input>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
@@ -151,16 +200,12 @@
|
|
|
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,
|
|
|
+ ScheduledTaskList,
|
|
|
+ ScanStrategyListDetail,
|
|
|
+ ScheduledTaskAdd,
|
|
|
} from '../api/getApiRes.js'
|
|
|
|
|
|
let qs = require('qs');
|
|
|
@@ -173,26 +218,14 @@
|
|
|
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: '',
|
|
|
+ regionid: '',
|
|
|
+ scanStrategyId: '',
|
|
|
+ bt: globalBt3(0)[0],
|
|
|
+ duration: 0,
|
|
|
+ interDays: 0,
|
|
|
memo: '',
|
|
|
- plateImgSrc: '',
|
|
|
- regionlevelOneIdOptions: [],
|
|
|
- regionIdRoomOptions: [],
|
|
|
- points: [],
|
|
|
- CoordsId: 0,
|
|
|
- status: 0,
|
|
|
+ regionidOptions: [],
|
|
|
+ scanStrategyIdOptions: [],
|
|
|
},
|
|
|
tabIndex: 0,
|
|
|
tabs: [
|
|
|
@@ -200,16 +233,17 @@
|
|
|
],
|
|
|
// panel 配置项目
|
|
|
panel: {
|
|
|
+ scanStrategyId: '',
|
|
|
usercode: '',
|
|
|
username: '',
|
|
|
compname: '',
|
|
|
keyword: '',
|
|
|
USERCODE: '',
|
|
|
taskstatus: 99,
|
|
|
- regionid: 0,
|
|
|
+ regionid: "",
|
|
|
regionid2: '',
|
|
|
regionidOptions: [],
|
|
|
- regionidOptions2: [],
|
|
|
+ scanStrategyIdOptions: [],
|
|
|
options: [
|
|
|
{value: 99, label: '全部'},
|
|
|
{value: 1, label: '进行中'},
|
|
|
@@ -237,11 +271,6 @@
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- if (this.$route.query.RegionId) {
|
|
|
- this.panel.regionid = this.$route.query.RegionId;
|
|
|
- this.panel.tagname = this.$route.query.TagName;
|
|
|
- }
|
|
|
-
|
|
|
this.getTableQuery();
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -251,27 +280,21 @@
|
|
|
// 页面数据查询
|
|
|
getTableQuery() {
|
|
|
let that = this;
|
|
|
- // this.getGetChildRegionSelect(0, 1);
|
|
|
this.getGeFullRegionSelect();
|
|
|
+ this.getGeFullScanStrategySelect();
|
|
|
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,//
|
|
|
+ scanStrategyId: this.panel.scanStrategyId,//
|
|
|
+ regionId: that.panel.regionid,//
|
|
|
};
|
|
|
let postdata = qs.stringify(param);
|
|
|
- DetectorList(postdata).then(res => {
|
|
|
+ ScheduledTaskList(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 = [];
|
|
|
@@ -284,7 +307,7 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 获取下级列表
|
|
|
+ // 获取扫描区域列表
|
|
|
getGeFullRegionSelect() {
|
|
|
let that = this;
|
|
|
let param = {
|
|
|
@@ -299,56 +322,49 @@
|
|
|
return false
|
|
|
}
|
|
|
that.panel.regionidOptions = json.Rs;
|
|
|
- that.panel.regionidOptions.unshift({Id: 0, Name: "全部", DisplayName: "全部"});
|
|
|
+ that.dialog.regionidOptions = json.Rs;
|
|
|
+ that.panel.regionidOptions.unshift({Id: "", Name: "全部", DisplayName: "全部"});
|
|
|
+ that.dialog.regionidOptions.shift();
|
|
|
} else {
|
|
|
that.$message.error(json.Memo + ',错误代码:' + json.Code);
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // dialog获取下级列表
|
|
|
- dialoggetGeFullRegionSelect() {
|
|
|
+ // 获取扫描策略下拉列表
|
|
|
+ getGeFullScanStrategySelect() {
|
|
|
let that = this;
|
|
|
let param = {
|
|
|
token: localStorage.token,
|
|
|
};
|
|
|
let postdata = qs.stringify(param);
|
|
|
- RegionList(postdata).then(res => {
|
|
|
+ ScanStrategyListDetail(postdata).then(res => {
|
|
|
let json = res;
|
|
|
if (json.Code == 0) {
|
|
|
- that.dialog.regionlevelOneIdOptions = json.Rs;
|
|
|
- that.dialog.regionId = json.Rs[0].Id;
|
|
|
+ if (!json.Rs) {
|
|
|
+ that.$message.error('区域列表为空,请先添加有效区域');
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ that.panel.scanStrategyIdOptions = json.Rs;
|
|
|
+ that.dialog.scanStrategyIdOptions = json.Rs;
|
|
|
+ that.panel.scanStrategyIdOptions.unshift({Id: "", Name: "全部", DisplayName: "全部"});
|
|
|
+ that.dialog.scanStrategyIdOptions.shift();
|
|
|
} else {
|
|
|
that.$message.error(json.Memo + ',错误代码:' + json.Code);
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // dialog获取区域下级菜单
|
|
|
- dialogGetGetChildRegionSelect(regionId, level) {
|
|
|
+ // dialog获取下级列表
|
|
|
+ dialoggetGeFullRegionSelect() {
|
|
|
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 = '';
|
|
|
- // }
|
|
|
- // }
|
|
|
+ that.dialog.regionId = json.Rs[0].Id;
|
|
|
} else {
|
|
|
that.$message.error(json.Memo + ',错误代码:' + json.Code);
|
|
|
}
|
|
|
@@ -363,7 +379,6 @@
|
|
|
this.getTableQuery();
|
|
|
this.$message.success('查询完毕');
|
|
|
},
|
|
|
-
|
|
|
handleSelectionChange(val) {
|
|
|
this.multipleSelection = val;
|
|
|
},
|
|
|
@@ -414,29 +429,19 @@
|
|
|
},
|
|
|
addList() {
|
|
|
this.dialog_state = true;
|
|
|
- this.dialog_title = '添加监控区域';
|
|
|
+ this.dialog_title = '添加任务计划';
|
|
|
this.dialog_type = 1;
|
|
|
|
|
|
// 重载地区列表
|
|
|
this.getGeFullRegionSelect();
|
|
|
-
|
|
|
+ this.getGeFullScanStrategySelect();
|
|
|
// 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.regionid = '';
|
|
|
+ this.dialog.scanStrategyId = '';
|
|
|
+ this.dialog.bt = globalBt3(0)[0];
|
|
|
+ this.dialog.duration = 0;
|
|
|
+ this.dialog.interDays = 0;
|
|
|
this.dialog.memo = '';
|
|
|
- this.dialog.coords_memo = '';
|
|
|
- this.dialog.points = [{}];
|
|
|
-
|
|
|
- // 加载默认的平面图
|
|
|
- // this.dialogGetGetChildRegionSelect(0, 1);
|
|
|
- this.dialoggetGeFullRegionSelect()
|
|
|
},
|
|
|
delList() {
|
|
|
let that = this;
|
|
|
@@ -602,46 +607,50 @@
|
|
|
confirmAddEquip() {
|
|
|
let that = this;
|
|
|
// checkVal
|
|
|
- if (!that.dialog.mac) {
|
|
|
- this.$message.error('错了哦,mac不能为空');
|
|
|
+ if (!that.dialog.regionid) {
|
|
|
+ this.$message.error('错了哦,区域不能为空');
|
|
|
return false
|
|
|
}
|
|
|
- if (!checkMac(that.dialog.mac)) {
|
|
|
- this.$message.error('错了哦,mac格式不正确');
|
|
|
+ if (!that.dialog.scanStrategyId) {
|
|
|
+ this.$message.error('错了哦,扫描策略不能为空');
|
|
|
return false
|
|
|
}
|
|
|
- if (!that.dialog.regionId) {
|
|
|
- this.$message.error('错了哦,所属区域不能为空');
|
|
|
+ if (!that.dialog.bt) {
|
|
|
+ this.$message.error('错了哦,开始时间不能为空');
|
|
|
return false
|
|
|
}
|
|
|
- if (!that.dialog.tagname) {
|
|
|
- this.$message.error('错了哦,标签名不能为空');
|
|
|
+ if (!that.dialog.duration) {
|
|
|
+ this.$message.error('错了哦,扫描时间不能为空');
|
|
|
return false
|
|
|
}
|
|
|
- if (that.dialog.tagname.length > 20) {
|
|
|
- this.$message.error('错了哦,标签名不能超过20个字符');
|
|
|
+ if (that.dialog.duration.length > 86400) {
|
|
|
+ this.$message.error('错了哦,扫描时间不能超过86400秒(24小时)');
|
|
|
return false
|
|
|
}
|
|
|
- this.selectRegionLabel(that.dialog.regionId);
|
|
|
+ console.log(that.dialog.interDays);
|
|
|
+ if (that.dialog.interDays == '') {
|
|
|
+ this.$message.error('错了哦,间隔天数不能为空');
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ if (that.dialog.memo) {
|
|
|
+ if (that.dialog.memo.length > 200) {
|
|
|
+ this.$message.error('错了哦,备注不能超过200字');
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(nonTfmtDate(that.dialog.bt,10));
|
|
|
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,
|
|
|
+ scanStrategyId: that.dialog.scanStrategyId,
|
|
|
+ regionId: that.dialog.regionid,
|
|
|
+ bt: nonTfmtDate(that.dialog.bt,10),
|
|
|
+ duration: that.dialog.duration,
|
|
|
+ interDays: that.dialog.interDays,
|
|
|
memo: that.dialog.memo,
|
|
|
};
|
|
|
let postdata = qs.stringify(param);
|
|
|
- DetectorAdd(postdata).then(res => {
|
|
|
+ ScheduledTaskAdd(postdata).then(res => {
|
|
|
let json = res;
|
|
|
if (json.Code == 0) {
|
|
|
that.$message({
|
|
|
@@ -820,13 +829,10 @@
|
|
|
});
|
|
|
},
|
|
|
filterTime(val, row, column) {
|
|
|
- return nonTfmtDate(column, 10);
|
|
|
+ return nonTfmtDate(column, 11);
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
- // 'dialog.regionlevelOneId': function (val) {
|
|
|
- // this.dialogGetGetChildRegionSelect(val, 2)
|
|
|
- // },
|
|
|
'dialog.regionId': function (val) {
|
|
|
if (val) {
|
|
|
this.getRegionPictureGetByRegionId(val);
|
|
|
@@ -937,4 +943,12 @@
|
|
|
.yellow {
|
|
|
color: #fd0;
|
|
|
}
|
|
|
+
|
|
|
+ /deep/ .modal-dialog .el-select {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ .modal-dialog .el-date-editor {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
</style>
|