监测点框位置,tab切换缓存
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user