Commit 521455cc by 张杰

v1.6.0版本需求

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