From 7e0e0b4445d3c03cc42005246fa879a4dc8e7e6d Mon Sep 17 00:00:00 2001
From: hanbaoshan <hanbaoshan@aiotlink.com>
Date: 星期五, 26 二月 2021 14:40:49 +0800
Subject: [PATCH] 朔黄事件标签弹窗调试;视频检索页筛选区字号颜色统一
---
src/pages/panoramicView/components/TracePlot.vue | 60 +++++++++++++++++++++++++++---------------------------------
1 files changed, 27 insertions(+), 33 deletions(-)
diff --git a/src/pages/panoramicView/components/TracePlot.vue b/src/pages/panoramicView/components/TracePlot.vue
index bf9d33e..1c91063 100644
--- a/src/pages/panoramicView/components/TracePlot.vue
+++ b/src/pages/panoramicView/components/TracePlot.vue
@@ -51,7 +51,7 @@
import { getSearchList } from '@/api/search';
import { getPanoramaPic } from "@/api/panorama";
export default {
- data () {
+ data() {
return {
cW: 0,
cH: 0,
@@ -68,7 +68,7 @@
pickerOptions: {
shortcuts: [{
text: '杩戜竴灏忔椂',
- onClick (picker) {
+ onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 60 * 60 * 1000);
@@ -76,7 +76,7 @@
}
}, {
text: '杩戜笁灏忔椂',
- onClick (picker) {
+ onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 60 * 60 * 1000 * 3);
@@ -84,7 +84,7 @@
}
}, {
text: '杩戝叚灏忔椂',
- onClick (picker) {
+ onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 60 * 60 * 1000 * 6);
@@ -106,18 +106,18 @@
isInvert: false,
}
},
- mounted () {
+ mounted() {
this.searchData();
//this.filterData();
this.getPanorama();
},
- beforeDestroy () {
+ beforeDestroy() {
console.log('beforeDestroy')
clearInterval(this.timer);
},
methods: {
- checkTime () {
+ checkTime() {
if (!this.searchTime) {
this.$notify({
type: 'warning',
@@ -125,6 +125,7 @@
});
return;
}
+ clearInterval(this.timer);
//鍒ゆ柇鏄惁鏄煡鍘嗗彶鏁版嵁
if (Date.parse(this.searchTime[1]) < Date.now()) {
this.filterData()
@@ -134,12 +135,13 @@
this.searchData();
}
},
- filterData () {
+ filterData() {
let _this = this;
var param = {
page: 1,
size: 5000,
searchTime: this.searchTime,
+ timeMark: null,
alarmlevel: [],
inputValue: '',
tabs: [],
@@ -147,7 +149,7 @@
treeNodes: [],
isAll: false
};
- clearInterval(this.timer);
+ //clearInterval(this.timer);
getSearchList(param).then(res => {
_this.actObjs = [];
if (!res.data.datalist) {
@@ -179,13 +181,13 @@
_this.drawTracePath();
})
},
- hideAllChange () {
+ hideAllChange() {
this.actObjs.forEach(target => {
target.isHide = this.isHideAll;
});
this.drawTracePath();
},
- invertChange () {
+ invertChange() {
console.log(this.isInvert)
this.actObjs.forEach(target => {
target.isHide = !target.isHide;
@@ -198,12 +200,12 @@
}
this.drawTracePath();
},
- checkTarget (item) {
+ checkTarget(item) {
item.isHide = !item.isHide;
this.isHideAll = item.isHide;
this.drawTracePath();
},
- getPanorama () {
+ getPanorama() {
let _this = this;
getPanoramaPic().then(res => {
let { panoramaPath, width, height } = res.data;
@@ -221,7 +223,8 @@
}
})
},
- drawTracePath () {
+ drawTracePath() {
+ console.log(this.actObjs)
let canvas = this.$refs['trackArea'];
let ctx = canvas.getContext('2d');
ctx.clearRect(0, 0, canvas.width, canvas.height);
@@ -253,7 +256,7 @@
}
})
},
- searchData () {
+ searchData() {
let _this = this;
var param = {
page: 1,
@@ -266,9 +269,14 @@
treeNodes: [],
isAll: false
};
+ if ((new Date() - _this.timeMark) < _this.intervalTime) {
+ return
+ }
getSearchList(param).then(res => {
+ _this.activeObjHashMap = {};
+ _this.actObjs = [];
if (!res.data.datalist) {
- _this.activeObjHashMap = {};
+ //_this.activeObjHashMap = {};
//_this.actObj = {};
_this.actObjs = [];
this.$notify({
@@ -298,7 +306,8 @@
//filterArr.push(obj)
});
- filterArr.forEach(item => {
+ //filterArr.forEach(item => {
+ res.data.datalist.forEach(item => {
item.activeObject.targetInfo.forEach(target => {
if (target.targetType == 'UniquelID') {
let attribute = JSON.parse(target.attribute);
@@ -323,15 +332,6 @@
_this.searchStartTimeStamp = Date.parse(_this.searchTime[0]);
_this.searchEndTimeStamp = Date.parse(_this.searchTime[1]);
- // for (var target in _this.actObj) {
- // _this.actObj[target] = _this.actObj[target].filter(item =>
- // item.timeStamp >= _this.searchStartTimeStamp && item.timeStamp <= _this.searchEndTimeStamp
- // )
- // if (_this.actObj[target].length == 0) {
- // delete _this.actObj[target]
- // }
- // }
-
for (var i = 0; i < _this.actObjs.length; i++) {
_this.actObjs[i].posInfo = _this.actObjs[i].posInfo.filter(item => item.timeStamp >= _this.searchStartTimeStamp && item.timeStamp <= _this.searchEndTimeStamp)
@@ -343,14 +343,8 @@
}
console.log(new Date(), _this.actObjs);
- // var keyArr = Object.keys(_this.actObj);
- // for (var i = 0; i < keyArr.length; i++) {
- // _this.actObj[keyArr[i]].forEach(dot => {
- // dot.color = _this.colorArr[i % 10];
- // })
- // }
- // console.log(new Date(), _this.actObj)
_this.drawTracePath();
+ _this.timeMark = new Date();
_this.timer = setTimeout(() => {
_this.searchData()
}, _this.intervalTime)
--
Gitblit v1.8.0