From afb9e7c8c9865be6a73d19e35819b5aa6b8afbdd Mon Sep 17 00:00:00 2001
From: quanyawei <401863037@qq.com>
Date: Mon, 17 Jun 2024 15:05:29 +0800
Subject: [PATCH] fix: bug修改
---
src/components/Wind/Map.vue | 26 +++++++++++++++++++++++---
1 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/src/components/Wind/Map.vue b/src/components/Wind/Map.vue
index f66f6b1..c2dc060 100644
--- a/src/components/Wind/Map.vue
+++ b/src/components/Wind/Map.vue
@@ -37,6 +37,7 @@
:clearable="false"
:editable="false"
type="datetime"
+ :picker-options="pickerOptions"
placeholder="������������������"
@change="changeData"
/>
@@ -408,6 +409,11 @@
timerKey: '', // ���������������������������
map: null,
code: [],
+ pickerOptions: {
+ disabledDate: (time) => {
+ return time.getTime() > Date.now() - 1 * 24 * 3600 * 1000
+ },
+ },
latlng: [],
noneData: false,
params: ['PM10', 'PM2.5', 'SO2', 'NO2', 'CO', 'O3', 'TVOC'],
@@ -530,7 +536,8 @@
clickmac: '',
childerItem: {},
farterItem: {},
- indexsLaber: 0
+ indexsLaber: 0,
+ time: new Date()
}
},
computed: {
@@ -593,10 +600,10 @@
methods: {
// ������������������������������
getDayXQ (day) {
- var days = new Date().getDay() // ������
+ var days = new Date().getDay() // ������ // ������
var rq = '' // ������
if (day === 'today') {
- rq = this.newData(0)
+ rq = this.newData(0) // ������������
} else if (day === 'yesterday') {
days = (days + 7 - 1) % 7
rq = this.newData(-1) // ������������
@@ -685,6 +692,7 @@
inText2.innerHTML = times + ':00'
this.chooseTimeInfo = true // ���������������
this.chooseTime = true // ���������������
+ console.log('times', times)
if ((i + 1) / 24 < 1) {
this.nyr = this.newData(-2, 'nyr') + ' ' + times + ':00'
} else if ((i + 1) / 24 < 2 && (i + 1) / 24 >= 1) {
@@ -718,6 +726,7 @@
inText2.innerHTML = times + ':00'
this.chooseTimeInfo = true // ���������������
this.chooseTime = true // ���������������
+ console.log('times', times)
if (i / 24 < 1) {
this.nyr = this.newData(-2, 'nyr') + ' ' + times + ':00'
} else if (i / 24 < 2 && i / 24 >= 1) {
@@ -1982,8 +1991,19 @@
window.map = map
},
changeData (val) {
+ console.log(val)
this.nyr = val + ':00'
+ const date = new Date(this.nyr.replace(/(\d{4}-\d{2}-\d{2}) (\d{2})(?!\d)/, '$1 $2:00'))
+
+ console.log(date)
this.chooseTime = true
+ // var p1 = document.querySelector('.p1')
+ // var p2 = document.querySelector('.p2')
+ // var p3 = document.querySelector('.p3')
+ // this.time = date
+ // p3.innerHTML = this.getDayXQ('today')
+ // p2.innerHTML = this.getDayXQ('yesterday')
+ // p1.innerHTML = this.getDayXQ('beforeYea')
this.initData()
},
// ������������������������
--
Gitblit v1.8.0