From f99807c9489639be25e9a277bd92c8ff021e37f5 Mon Sep 17 00:00:00 2001 From: quanyawei <401863037@qq.com> Date: Mon, 18 Dec 2023 13:52:08 +0800 Subject: [PATCH] fix:热力图播放 --- src/views/hotMap/index.vue | 9 +++++---- src/views/hotMap/components/selectHour.vue | 13 ++++++++++++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/views/hotMap/components/selectHour.vue b/src/views/hotMap/components/selectHour.vue index 13839ff..1d60226 100644 --- a/src/views/hotMap/components/selectHour.vue +++ b/src/views/hotMap/components/selectHour.vue @@ -21,7 +21,7 @@ <script> // ���������������������������������������������������������js������������������js���json������������������������������ // ���������import������������������from'������������������'; - +import dayjs from 'dayjs' export default { // import ��������������������������������������������������� components: {}, @@ -63,6 +63,10 @@ this.endPlaceholderData = '������������������' this.format = 'yyyy-MM-dd HH' this.valueFormat = 'yyyy-MM-dd HH' + this.value1 = [ + dayjs().subtract(3, 'day').format('YYYY-MM-DD HH'), + dayjs().format('YYYY-MM-DD HH') + ] } else if (nv === 'daterange') { this.startPlaceholderData = '������������' this.endPlaceholderData = '������������' @@ -78,7 +82,14 @@ }, // ������������ - ��������������������������������� this ��������� created () { + console.log('this.value1', this.value1) // this.currentHour() + if (this.dataType === 'datetimerange') { + this.value1 = [ + dayjs().subtract(3, 'day').format('YYYY-MM-DD HH'), + dayjs().format('YYYY-MM-DD HH') + ] + } }, methods: { sendPicker () { diff --git a/src/views/hotMap/index.vue b/src/views/hotMap/index.vue index 9d5c190..5756426 100644 --- a/src/views/hotMap/index.vue +++ b/src/views/hotMap/index.vue @@ -130,7 +130,6 @@ handler: function (newVal, oldVal) { console.log('newVal', newVal === '') if (newVal !== '') { - this.map.clearMap() this.init1() this.map.setCity(newVal) if (!!this.formInline.starTime && !!this.formInline.endTime) { @@ -145,7 +144,6 @@ if (this.markerList.length > 0) { console.log('2222', this.map.getAllOverlays('marker')) this.map.remove(this.markerList) - this.map.clearMap() this.markerList = [] // this.markerClusterer = null } @@ -229,10 +227,11 @@ }) .then(res => { if (res.data !== '0') { + // this.map.remove(this.heatmap) if (this.heatmap === null) { this.createHeatMap() } - this.map.clearMap() + this.heatMapData = [] this.heatMapData = res.data this.heatmap.setDataSet({ data: this.heatMapData, @@ -358,9 +357,11 @@ onSubmit () { if (!!this.formInline.city && !!this.formInline.starTime && !!this.formInline.endTime) { + this.map.clearMap() this.getDayListData() this.getData(this.formInline.starTime) - this.map.setZoom(12) + this.init1() + // this.map.setZoom(12) } else { this.$message({ showClose: true, -- Gitblit v1.8.0