fix #294 by handling navItem string with function mapPageNameToCapitalUnifiedName()

This commit is contained in:
Cindy Chang
2024-06-05 14:42:24 +08:00
parent 5f0e12ef1a
commit 0df045c218
3 changed files with 40 additions and 15 deletions

View File

@@ -17,7 +17,7 @@
<li @click="onNavItemBtnClick($event, item)"
v-for="(item, index) in navViewData[navViewName]"
:key="index" class="nav-item"
:class="{'active': activePageComputedByRoute === item}">
:class="{'active': activePage === item}">
{{ item }}
</li>
</ul>
@@ -144,6 +144,9 @@ export default {
filterName: function(newVal, oldVal) {
this.filterName = newVal;
},
activePageComputedByRoute (newVal) {
console.log('activePageComputedByRoute newVal', newVal);
}
},
mounted() {
this.handleNavItemBtn();
@@ -178,22 +181,34 @@ export default {
switch (navItemCandidate) {
case 'MAP':
if(isCheckPage) this.$router.push({name: 'CheckMap', params: { type: type, fileId: fileId }});
else this.$router.push({name: 'Map', params: { type: type, fileId: fileId }});
if(isCheckPage) {
this.$router.push({name: 'CheckMap', params: { type: type, fileId: fileId }});
}
else {
this.$router.push({name: 'Map', params: { type: type, fileId: fileId }});
}
break;
case 'CONFORMANCE':
if(isCheckPage) this.$router.push({name: 'CheckConformance', params: { type: type, fileId: fileId }});
else this.$router.push({name: 'Conformance', params: { type: type, fileId: fileId }});
if(isCheckPage) { // Beware of Swal popup, it might disturb which is the current active page
this.$router.push({name: 'CheckConformance', params: { type: type, fileId: fileId }});
}
else { // Beware of Swal popup, it might disturb which is the current active page
this.$router.push({name: 'Conformance', params: { type: type, fileId: fileId }});
}
break
case 'PERFORMANCE':
if(isCheckPage) this.$router.push({name: 'CheckPerformance', params: { type: type, fileId: fileId }});
else this.$router.push({name: 'Performance', params: { type: type, fileId: fileId }});
if(isCheckPage) {
this.$router.push({name: 'CheckPerformance', params: { type: type, fileId: fileId }});
}
else {
this.$router.push({name: 'Performance', params: { type: type, fileId: fileId }});
}
break;
}
break;
case 'COMPARE':
break
}
};
},
/**
* Based on the route.name, decide the navViewName.
@@ -323,6 +338,7 @@ export default {
'setPrevioiusPage',
'setActivePage',
'setActivePageComputedByRoute',
'setIsPagePendingBoolean',
],),
},
}