diff --git a/src/components/cockpit/transientDetails/index.vue b/src/components/cockpit/transientDetails/index.vue index 618bd90..9f52e03 100644 --- a/src/components/cockpit/transientDetails/index.vue +++ b/src/components/cockpit/transientDetails/index.vue @@ -68,7 +68,8 @@ const prop = defineProps({ width: { type: [String, Number] }, height: { type: [String, Number] }, timeKey: { type: [String, Number] }, - timeValue: { type: Object } + timeValue: { type: Object }, + interval: { type: [String, Number] } }) const headerHeight = ref(57) @@ -119,9 +120,14 @@ const tableStore: any = new TableStore({ column: [], beforeSearchFun: () => { - if (!fullscreen.value && prop.timeValue && Array.isArray(prop.timeValue)) { - tableStore.table.params.searchBeginTime = prop.timeValue[0] - tableStore.table.params.searchEndTime = prop.timeValue[1] + if (!fullscreen.value) { + if (prop.interval == 3 && prop.timeValue && Array.isArray(prop.timeValue)) { + tableStore.table.params.searchBeginTime = prop.timeValue[0] + tableStore.table.params.searchEndTime = prop.timeValue[1] + } else { + tableStore.table.params.searchBeginTime = '2025-12-1' + tableStore.table.params.searchEndTime = '2025-12-31' + } } }, @@ -152,7 +158,13 @@ onMounted(() => { TableHeaderRef.value.setDatePicker([{ label: '月份', value: 3 }]) } if (fullscreen.value) { - TableHeaderRef.value.setInterval(3) + if (prop.interval == 3 && prop.timeValue && Array.isArray(prop.timeValue)) { + tableStore.table.params.searchBeginTime = prop.timeValue[0] || tableStore.table.params.searchBeginTime + tableStore.table.params.searchEndTime = prop.timeValue[1] || tableStore.table.params.searchEndTime + TableHeaderRef.value.setTimeInterval(prop.timeValue) + } else { + TableHeaderRef.value.setInterval(3) + } } tableStore.index() }) @@ -160,7 +172,16 @@ onMounted(() => { watch( () => prop.timeKey, val => { - tableStore.index() + // tableStore.index() + } +) + +watch( + () => prop.interval, + val => { + if (val == 3) { + tableStore.index() + } } ) watch( @@ -183,7 +204,7 @@ watch( ) // 电压暂降点击事件 -const descentClick = (item:any) => { +const descentClick = (item: any) => { transientListRef.value.open(item.name) }