解析模板

This commit is contained in:
cwchen 2025-11-27 14:54:08 +08:00
parent 7dfa5ed0a7
commit 8e1e74067d
2 changed files with 45 additions and 7 deletions

View File

@ -214,7 +214,7 @@ export default {
proId: decryptWithSM4(this.$route.query.proId),
bidId: decryptWithSM4(this.$route.query.bidId),
activeMainTab: 'project',
defaultSubTab: 'response',
defaultSubTab: '', // AnalysisResultPanel
analysisData: {},
tenderDocumentUrl: '',
tenderDocumentTitle: '',
@ -348,7 +348,16 @@ export default {
},
handleMainTabClick(tab) {
this.activeMainTab = tab.name
this.handleMainTabChange(tab.name, '')
//
const currentMainTab = this.mainTabs.find(t => t.name === tab.name)
const firstSubTab = currentMainTab && currentMainTab.subTabs && currentMainTab.subTabs.length > 0
? currentMainTab.subTabs[0].name
: ''
// defaultSubTab
this.$nextTick(() => {
this.defaultSubTab = firstSubTab
})
this.handleMainTabChange(tab.name, firstSubTab)
},
handleMainTabChange(mainTab, subTab) {
console.log('主标签切换:', mainTab, subTab)

View File

@ -151,23 +151,52 @@ export default {
}
},
data() {
// defaultSubTab
const initialSubTab = this.defaultSubTab || this.getDefaultSubTab(this.defaultMainTab)
return {
activeMainTab: this.defaultMainTab,
activeSubTab: this.defaultSubTab || this.getDefaultSubTab(this.defaultMainTab),
activeSubTab: initialSubTab,
}
},
watch: {
defaultMainTab(newVal) {
this.activeMainTab = newVal
this.activeSubTab = this.getDefaultSubTab(newVal)
defaultMainTab(newVal, oldVal) {
if (newVal !== oldVal) {
this.activeMainTab = newVal
//
const firstSubTab = this.getDefaultSubTab(newVal)
if (firstSubTab) {
this.activeSubTab = firstSubTab
} else {
this.activeSubTab = ''
}
}
},
defaultSubTab(newVal, oldVal) {
// defaultSubTab activeSubTab
if (newVal && newVal !== oldVal) {
this.activeSubTab = newVal
} else if (!newVal) {
//
this.activeSubTab = this.getDefaultSubTab(this.activeMainTab)
}
},
hideMainTabs(newVal) {
if (newVal) {
//
this.activeSubTab = this.getDefaultSubTab(this.defaultMainTab)
if (!this.defaultSubTab) {
this.activeSubTab = this.getDefaultSubTab(this.defaultMainTab)
} else {
this.activeSubTab = this.defaultSubTab
}
}
}
},
created() {
// activeSubTab
if (!this.activeSubTab) {
this.activeSubTab = this.getDefaultSubTab(this.activeMainTab)
}
},
methods: {
handleMainTabClick(tab) {
//