监测点列表详情

This commit is contained in:
stt
2025-11-12 09:51:28 +08:00
parent 25971e5239
commit 384ea90acd
5 changed files with 567 additions and 111 deletions

View File

@@ -14,8 +14,6 @@
ref="datePickerRef"
:nextFlag="nextFlag"
:theCurrentTime="theCurrentTime"
:initialInterval="initialInterval"
:initialTimeValue="initialTimeValue"
@change="handleDatePickerChange"
></DatePicker>
</el-form-item>
@@ -90,8 +88,6 @@ interface Props {
theCurrentTime?: boolean //控制时间前3天展示上个月时间
showReset?: boolean //是否显示重置
showExport?: boolean //导出控制
initialInterval?: 3
initialTimeValue?: undefined
}
const props = withDefaults(defineProps<Props>(), {
@@ -101,14 +97,11 @@ const props = withDefaults(defineProps<Props>(), {
nextFlag: false,
theCurrentTime: true,
showReset: true,
showExport: false,
initialInterval: 3,
initialTimeValue: undefined
showExport: false
})
// 处理 DatePicker 值变化事件
const handleDatePickerChange = (value: any) => {
// 将值缓存到 timeCache
if (value) {
timeCacheStore.setCache(route.path, value.interval, value.timeValue)
@@ -139,15 +132,6 @@ const headerFormSecondStyleClose = {
onMounted(() => {
// 设置初始值到 DatePicker
if (props.datePicker && datePickerRef.value) {
// 如果有传入的初始值,则设置到 DatePicker
if (props.initialInterval !== undefined) {
datePickerRef.value.setInterval(props.initialInterval)
}
if (props.initialTimeValue) {
datePickerRef.value.timeValue = props.initialTimeValue
}
// 从缓存中获取值并设置
const cached = timeCacheStore.getCache(route.path)
if (cached) {
@@ -245,12 +229,29 @@ const onResetForm = () => {
const setInterval = (val: any) => {
datePickerRef.value.setInterval(val)
}
const setTimeInterval = (val: any) => {
datePickerRef.value.timeValue = val
tableStore.table.params.searchBeginTime = val[0]
tableStore.table.params.searchEndTime = val[1]
tableStore.table.params.startTime = val[0]
tableStore.table.params.endTime = val[1]
}
// 导出
const onExport = () => {
tableStore.onTableAction('export', { showAllFlag: true })
}
defineExpose({ onComSearch, areaRef, setDatePicker, setInterval, datePickerRef, showSelectChange, computedSearchRow })
defineExpose({
onComSearch,
areaRef,
setDatePicker,
setInterval,
setTimeInterval,
datePickerRef,
showSelectChange,
computedSearchRow
})
</script>
<style scoped lang="scss">