Commit 521455cc by 张杰

v1.6.0版本需求

1 parent 58c1133e
...@@ -146,4 +146,9 @@ export const GET_DEVICEINFO_BYSNS = params => { ...@@ -146,4 +146,9 @@ export const GET_DEVICEINFO_BYSNS = params => {
// 批量查询设备位置点 // 批量查询设备位置点
export const GET_DEVICE_LOCATION = params => { export const GET_DEVICE_LOCATION = params => {
return request(params, '/trialdrive/monitor/vehiclelocation', 'get') return request(params, '/trialdrive/monitor/vehiclelocation', 'get')
}
// 批量查询设备在线状态
export const GET_MONITOR_ONLINELIST = params => {
return request(params, '/devicemonitor/monitor/onlinelist', 'get')
} }
\ No newline at end of file \ No newline at end of file
...@@ -174,9 +174,9 @@ export default { ...@@ -174,9 +174,9 @@ export default {
form: { form: {
locationType: 1, locationType: 1,
triggerType: 3, triggerType: 3,
shapeType: 2, shapeType: 1,
radius: 1000, radius: 1000,
status: 1, enableStatus:1
}, },
rules: { rules: {
fenceName: [ fenceName: [
...@@ -243,7 +243,10 @@ export default { ...@@ -243,7 +243,10 @@ export default {
}); });
}, },
pickDate(beforeDays) {}, pickDate(beforeDays) {},
submit() {}, // 保存围栏信息
submit() {
},
updateFenceRadius(radius) {}, updateFenceRadius(radius) {},
// 在地图上画圆形围栏 // 在地图上画圆形围栏
......
...@@ -178,13 +178,12 @@ import mapService from "@/utils/mapService.js"; ...@@ -178,13 +178,12 @@ import mapService from "@/utils/mapService.js";
import "@/utils/mapEvent.js"; import "@/utils/mapEvent.js";
import EventBus from "@/event-bus"; import EventBus from "@/event-bus";
import { services } from "@/api"; import { services } from "@/api";
import mock from "../../mock";
const MONITOR_SERVICE = services.monitor; const MONITOR_SERVICE = services.monitor;
import { CONSTANT } from "@/constant"; import { CONSTANT } from "@/constant";
import MapControll from "./MapControll.vue"; import MapControll from "./MapControll.vue";
import { exportExcel } from "@/utils"; import { exportExcel } from "@/utils";
import AMapLoader from "@amap/amap-jsapi-loader"; import { GET_MONITOR_ONLINELIST } from "@/api/services/monitor";
export default { export default {
data() { data() {
let checkFilename = (rule, vaule, cb) => { let checkFilename = (rule, vaule, cb) => {
...@@ -540,7 +539,7 @@ export default { ...@@ -540,7 +539,7 @@ export default {
} }
} }
let isArray = Array.isArray(nodeData); let isArray = Array.isArray(nodeData);
return resolve(isArray?nodeData:[]); return resolve(isArray ? nodeData : []);
if (node.level === 0) { if (node.level === 0) {
return resolve([{ name: "region1" }, { name: "region2" }]); return resolve([{ name: "region1" }, { name: "region2" }]);
...@@ -844,27 +843,25 @@ export default { ...@@ -844,27 +843,25 @@ export default {
type: "error", type: "error",
message: "监控设备数最大100台,无法添加", message: "监控设备数最大100台,无法添加",
}); });
} else { return false;
if (this.monitorList[item.sn]) { }
if (!_this.currentMessage) { if (this.monitorList[item.sn] && !_this.currentMessage) {
_this.currentMessage = this.$message({ _this.currentMessage = this.$message({
type: "error", type: "error",
message: "该列表中有设备正在监控中,请勿重复监控", message: "该列表中有设备正在监控中,请勿重复监控",
onClose: function () { onClose: function () {
_this.currentMessage = ""; _this.currentMessage = "";
}, },
}); });
} return false;
} else {
this.resetRefreshCount = true;
this.monitorList.count++;
item.eLocateType = "gpsLocation";
this.monitorList[item.sn] = item;
this.monitorList.itemArr.unshift(item.sn);
console.log(this.monitorList.itemArr);
this.getPositionData();
}
} }
this.resetRefreshCount = true;
this.monitorList.count++;
item.eLocateType = "gpsLocation";
this.monitorList[item.sn] = item;
this.monitorList.itemArr.unshift(item.sn);
console.log(this.monitorList.itemArr);
this.getPositionData();
}, },
// standNoMonitor(item){ // standNoMonitor(item){
// this.resetRefreshCount = true; // this.resetRefreshCount = true;
...@@ -963,6 +960,8 @@ export default { ...@@ -963,6 +960,8 @@ export default {
_this.checkedKeys = []; _this.checkedKeys = [];
this.$refs.tree.setCheckedKeys([]); this.$refs.tree.setCheckedKeys([]);
}, },
// 获取设备位置点
getPositionData(arr) { getPositionData(arr) {
/* let _this = this; /* let _this = this;
arr = arr.filter((item)=>this.monitorList[item.sn]); */ arr = arr.filter((item)=>this.monitorList[item.sn]); */
...@@ -1118,31 +1117,40 @@ export default { ...@@ -1118,31 +1117,40 @@ export default {
}, },
// 展示更多 // 展示更多
showMore(node,data) { showMore(node, data) {
console.log(data) console.log(data);
console.log(node); console.log(node);
console.log(this.treeDataList) console.log(this.treeDataList);
let o = this.treeDataList['u' + data.parentId]; let o = this.treeDataList["u" + data.parentId];
// 不存在 // 不存在
if(!o){ if (!o) {
return false; return false;
} }
let len = o.data.length; let len = o.data.length;
let curr = o.idx||1; let curr = o.idx || 1;
// 判断是否有下一页 // 判断是否有下一页
if(len>curr*10){ if (len > curr * 10) {
return true return true;
}else{ } else {
return false; return false;
} }
}, },
// 加载下一页 // 加载下一页
loadNext(node,data){ loadNext(node, data) {
console.log(data) console.log(data);
} },
// 获取设备在线状态
getDevinceStatus(sns) {
let obj = this.monitorList;
let list = obj.itemArr || [];
let oParams = {};
oParams.sns = sns;
GET_MONITOR_ONLINELIST(oParams).then((res) => {});
},
}, },
created() { created() {
if (window.AMap) { if (window.AMap) {
......
...@@ -268,6 +268,7 @@ MapService.prototype = { ...@@ -268,6 +268,7 @@ MapService.prototype = {
// 车辆监控-查看位置点 // 车辆监控-查看位置点
bindMonitorInfoWindow: function (marker, map, info, isInfoOpen, isInfoAutoMove) { bindMonitorInfoWindow: function (marker, map, info, isInfoOpen, isInfoAutoMove) {
console.log(info)
var self = this; var self = this;
var infoDiv = document.createElement('div'); var infoDiv = document.createElement('div');
infoDiv.innerHTML = self.createMonitorInfo(info); infoDiv.innerHTML = self.createMonitorInfo(info);
...@@ -408,10 +409,11 @@ MapService.prototype = { ...@@ -408,10 +409,11 @@ MapService.prototype = {
} }
} }
// 跳转到轨迹回放页面 // 跳转到电子围栏页面 无线设备不能跳转电子围栏 isSource:1有线,其他无线
let fenceBtn = infoDiv.querySelector('[data-fence]'); let fenceBtn = infoDiv.querySelector('[data-fence]');
if (fenceBtn) { if (fenceBtn && info.isSource == 1) {
fenceBtn.onclick = function () { fenceBtn.onclick = function () {
mapService.openPage(`#/monitor/fence?${queryCode}`) mapService.openPage(`#/monitor/fence?${queryCode}`)
} }
} }
...@@ -520,6 +522,8 @@ MapService.prototype = { ...@@ -520,6 +522,8 @@ MapService.prototype = {
zoomOut: function () { zoomOut: function () {
this.map.zoomOut(); this.map.zoomOut();
}, },
// 监控弹框
createMonitorInfo: function (info) { createMonitorInfo: function (info) {
/*var _html = '<h3 class="uimap-info-title">'+ info.name+'/'+ info.standNo +'</h3><div class="uimap-info-ct"><p><span><i class="fa fa-inbox"></i></span>'+ info.sn +'</p>'; /*var _html = '<h3 class="uimap-info-title">'+ info.name+'/'+ info.standNo +'</h3><div class="uimap-info-ct"><p><span><i class="fa fa-inbox"></i></span>'+ info.sn +'</p>';
if(info.time){ if(info.time){
...@@ -572,7 +576,6 @@ MapService.prototype = { ...@@ -572,7 +576,6 @@ MapService.prototype = {
</span></p> </span></p>
<p><i class="icon icon-info_device_status"></i> 设备状态: <span class="des" data-status></span></p> <p><i class="icon icon-info_device_status"></i> 设备状态: <span class="des" data-status></span></p>
<p data-alarm> <p data-alarm>
<button type="button" class="el-button el-button--mini el-button--primary" data-alarmoff>断电</button> <button type="button" class="el-button el-button--mini el-button--primary" data-alarmoff>断电</button>
<button type="button" class="el-button el-button--mini el-button--primary" data-alarmlight>光感</button> <button type="button" class="el-button el-button--mini el-button--primary" data-alarmlight>光感</button>
</p> </p>
...@@ -609,8 +612,6 @@ MapService.prototype = { ...@@ -609,8 +612,6 @@ MapService.prototype = {
} }
</p> </p>
<p class="redirect-row"> <p class="redirect-row">
<a class="redirect-btn" id="monitor_btn_history" data-history>历史停留</a>
<a class="redirect-btn" id="btn_resident" data-resident>常驻地</a>
<a class="redirect-btn" id="btn_replay" data-replay>轨迹回放</a> <a class="redirect-btn" id="btn_replay" data-replay>轨迹回放</a>
<a class="redirect-btn" id="btn_fence" data-fence>电子围栏</a> <a class="redirect-btn" id="btn_fence" data-fence>电子围栏</a>
</p> </p>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!