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 | 100 ++++++++++++++++++++++++++++++++++++-------------
1 files changed, 73 insertions(+), 27 deletions(-)
diff --git a/src/components/Wind/Map.vue b/src/components/Wind/Map.vue
index d69e54c..c2dc060 100644
--- a/src/components/Wind/Map.vue
+++ b/src/components/Wind/Map.vue
@@ -28,7 +28,20 @@
alt=""
@click="turnState"
>
- <span class="text_Time">{{ dateFormat }}</span>
+ <span class="text_Time">
+ <el-date-picker
+ v-model="selectData"
+ popper-class="tpc"
+ value-format="yyyy-MM-dd HH"
+ format="yyyy-MM-dd HH"
+ :clearable="false"
+ :editable="false"
+ type="datetime"
+ :picker-options="pickerOptions"
+ placeholder="������������������"
+ @change="changeData"
+ />
+ </span>
<img
class="drop-icon"
:src="turnImg"
@@ -396,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'],
@@ -432,7 +450,7 @@
// ������������������������������������������(���������������������������)
totalCount: 0,
// ������������������������������
- pageSizes: [10, 20, 30, 40],
+ pageSizes: [10, 50, 100, 200],
// ������������������������������������������
PageSize: 20,
factorOptions: [
@@ -507,6 +525,7 @@
turnImg: require('@/assets/images/regionalOverview/dropDown.png'),
showOrHidden: true,
dateFormat: '',
+ selectData: new Date(),
alarmTableVisible: false,
chooseTimeInfo: false, // ������������������������
chooseTime: false,
@@ -517,7 +536,8 @@
clickmac: '',
childerItem: {},
farterItem: {},
- indexsLaber: 0
+ indexsLaber: 0,
+ time: new Date()
}
},
computed: {
@@ -580,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) // ������������
@@ -672,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) {
@@ -705,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) {
@@ -1549,32 +1571,15 @@
console.log('level', level)
if (deviceDetails.a01008) {
var windDirs = dushu === '-' ? 0 : Number(dushu)
- console.log('windDirs', windDirs)
+ WWindUtil.windValueFormat(windDirs)
+ console.log('windDirs', WWindUtil.windValueFormat(windDirs))
windDeg = windDirs
windTip = 'inline'
if (windDirs === 0 || windDirs === '-') {
windDir = '-'
windTip = 'none'
- } else if (windDirs > 0 && windDirs < 90) {
- windDir = '���������'
- windTip = 'inline'
- } else if (windDirs === 90) {
- windDir = '������'
- windTip = 'inline'
- } else if (windDirs > 90 && windDirs < 180) {
- windDir = '���������'
- windTip = 'inline'
- } else if (windDirs === 180) {
- windDir = '������'
- windTip = 'inline'
- } else if (windDirs > 180 && windDirs < 270) {
- windDir = '���������'
- windTip = 'inline'
- } else if (windDirs === 270) {
- windDir = '������'
- windTip = 'inline'
- } else if (windDirs > 270 && windDirs < 360) {
- windDir = '���������'
+ } else {
+ windDir = WWindUtil.windValueFormat(windDirs)
windTip = 'inline'
}
}
@@ -1984,6 +1989,22 @@
// that.canvasWind(this.windJsonData)
// })
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()
},
// ������������������������
change (index) {
@@ -2454,11 +2475,36 @@
margin-top: 9px;
margin-left: 10px;
}
-
.text_Time {
float: left;
margin-left: 37px;
+ .el-date-editor{
+ width: 145px!important;
+ .el-input__prefix{
+ display: none!important;
+ }
+ .el-input__inner{
+ cursor: pointer;
+ font-size: 18px;
+ color: #fff;
+ padding: 0px!important;
+ border: none;
+ background: inherit;
+
+ }
+ }
}
+.tpc{
+ left: unset!important;
+ right: 60px;
+}
+.tpc .el-time-spinner__wrapper {
+ width:100% !important;
+}
+.tpc .el-scrollbar:nth-of-type(2) {
+ display: none !important;
+}
+
.my-div-icon {
font-size: 14px;
text-align: center;
--
Gitblit v1.8.0