时间选择范围问题修复

This commit is contained in:
白菜
2025-08-16 23:15:33 +08:00
parent ffefc21d96
commit 5ea121abf0
5 changed files with 438 additions and 456 deletions

View File

@ -1,16 +1,15 @@
<template>
<uni-popup ref="popup" type="center" @maskClick="show = false">
<view class="chart-popup">
<uni-datetime-picker v-model="range" type="daterange" start="2000-01-01" :end="end" rangeSeparator="至"
@change="changeTime" />
<view class="button-group" style="text-align: center;margin-top:20px;">
<uni-datetime-picker v-model="range" type="daterange" :end="end" rangeSeparator="至" @change="changeTime"
style="margin-bottom: 10px;" />
<!-- <view class="button-group" style="text-align: center;margin-top:20px;">
<button type="default" size="mini" @click="onReset">重置</button>
<button type="primary" size="mini" @click="onSearch" style="margin-left: 20px;">搜索</button>
</view>
</view> -->
<view class="chart-container">
<qiun-data-charts type="line" :reload="show" :chartData="chartsData" :canvas2d="true"
canvasId="scrollcolumnid" :optsWatch='false' :inScrollView="true" :pageScrollTop="pageScrollTop"
:opts="options" :ontouch="true" />
<qiun-data-charts type="line" :reload="show" :chartData="chartsData" :optsWatch='false'
:inScrollView="true" :pageScrollTop="pageScrollTop" :opts="options" :ontouch="true" />
</view>
</view>
</uni-popup>
@ -44,7 +43,7 @@
},
show: false,
range: [],
end: "",
end: Date.now(),
siteId: '',
deviceId: '',
clusterDeviceId: '',
@ -74,6 +73,7 @@
},
changeTime(val) {
this.range = val || []
this.getData()
},
onReset() {
this.range = []
@ -149,13 +149,6 @@
console.log('this.chartsData', this.chartsData)
}
},
mounted() {
const now = new Date(),
year = now.getFullYear(),
month = now.getMonth() + 1,
day = now.getDate()
this.end = year + '-' + month + '-' + day
}
}
</script>