监测点框位置,tab切换缓存

This commit is contained in:
sjl
2025-11-14 08:42:07 +08:00
parent e655611954
commit 0a52d1afae
3 changed files with 46 additions and 13 deletions

View File

@@ -5,7 +5,7 @@
<MonitoringPointTab
ref="monitoringPointTabRef"
:active="activeTab === 'pollutionReport'"
@initialized="handleTabInitialized"
/>
</el-tab-pane>
@@ -13,7 +13,7 @@
<SubstationTab
ref="substationTabRef"
:active="activeTab === 'anotherReport'"
@initialized="handleTabInitialized"
/>
</el-tab-pane>
</el-tabs>
@@ -25,26 +25,25 @@ import { ref } from 'vue'
import MonitoringPointTab from './MonitoringPointTab.vue'
import SubstationTab from './SubstationTab.vue'
defineOptions({
name: 'harmonic-boot/qydetailedAnalysis/pollutionReport'
})
const activeTab = ref('pollutionReport')
const monitoringPointTabRef = ref()
const substationTabRef = ref()
const tabInitialized = ref({
pollutionReport: false,
anotherReport: false
})
const handleTabChange = (tabName: string) => {
if (!tabInitialized.value[tabName]) {
if (tabName === 'pollutionReport' && monitoringPointTabRef.value) {
monitoringPointTabRef.value.refresh()
} else if (tabName === 'anotherReport' && substationTabRef.value) {
substationTabRef.value.refresh()
}
}
}
const handleTabInitialized = (tabName: string) => {
tabInitialized.value[tabName] = true
}
</script>