diff --git a/src/components/cockpit/indicatorFittingChart/index.vue b/src/components/cockpit/indicatorFittingChart/index.vue index d265983..72bdefd 100644 --- a/src/components/cockpit/indicatorFittingChart/index.vue +++ b/src/components/cockpit/indicatorFittingChart/index.vue @@ -30,10 +30,10 @@ import { log } from 'console' const prop = defineProps({ w: { type: [String, Number] }, - h: { type: [String, Number]}, - width: { type: [String, Number]}, - height: { type: [String, Number]}, - timeKey: { type: [String, Number]}, + h: { type: [String, Number] }, + width: { type: [String, Number] }, + height: { type: [String, Number] }, + timeKey: { type: [String, Number] }, timeValue: { type: Object } }) const OverLimitDetailsRef = ref() @@ -59,12 +59,11 @@ const fullscreen = computed(() => { const selectChange = (showSelect: any, height: any, datePickerValue?: any) => { headerHeight.value = height - // 如果有传入 datePicker 的值 - // if (datePickerValue) { - // // 更新表格参数 - // tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0] - // tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1] - // } + if (datePickerValue && datePickerValue.timeValue) { + // 更新时间参数 + tableStore.table.params.searchBeginTime = datePickerValue.timeValue[0] + tableStore.table.params.searchEndTime = datePickerValue.timeValue[1] + } } const tableStore: any = new TableStore({ @@ -105,23 +104,8 @@ const tableStore: any = new TableStore({ { title: '主要存在的电能质量问题', field: 'problems', minWidth: '150', showOverflow: true } ], beforeSearchFun: () => { - // 尝试从缓存获取时间值 - let beginTime, endTime - - if (fullscreen.value) { - const cached = timeCacheStore.getCache(route.path) - if (cached && cached.timeValue) { - beginTime = cached.timeValue[0] - endTime = cached.timeValue[1] - } - } - - console.log('beginTime0000', beginTime) - console.log('prop.timeValue?.[0]111', prop.timeValue?.[0]) - - // 如果缓存中没有则使用默认值 - tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] - tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] + tableStore.table.params.searchBeginTime = tableStore.table.params.searchBeginTime ?? prop.timeValue?.[0] + tableStore.table.params.searchEndTime = tableStore.table.params.searchEndTime ?? prop.timeValue?.[1] }, loadCallback: () => { tableStore.table.height = `calc(${prop.height} - 80px)` diff --git a/src/components/table/header/index.vue b/src/components/table/header/index.vue index a1914a3..def8090 100644 --- a/src/components/table/header/index.vue +++ b/src/components/table/header/index.vue @@ -103,9 +103,9 @@ const props = withDefaults(defineProps(), { // 处理 DatePicker 值变化事件 const handleDatePickerChange = (value: any) => { // 将值缓存到 timeCache - if (value) { - timeCacheStore.setCache(route.path, value.interval, value.timeValue) - } + // if (value) { + // timeCacheStore.setCache(route.path, value.interval, value.timeValue) + // } // 将 datePicker 的变化传递给父组件 emit('selectChange', true, tableHeader.value.offsetHeight, value)