src/views/hotMap/components/selectHour.vue | ●●●●● patch | view | raw | blame | history | |
src/views/hotMap/index.vue | ●●●●● patch | view | raw | blame | history |
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 () { 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,