实现项目归档功能
This commit is contained in:
@@ -39,8 +39,8 @@
|
||||
@select="handleMenuSelect"
|
||||
class="nav-menu"
|
||||
>
|
||||
<el-menu-item index="upload">上传数据</el-menu-item>
|
||||
<el-menu-item index="config">参数配置</el-menu-item>
|
||||
<el-menu-item index="upload" :disabled="isArchiveLockedTab('upload')">上传数据</el-menu-item>
|
||||
<el-menu-item index="config" :disabled="isArchiveLockedTab('config')">参数配置</el-menu-item>
|
||||
<el-menu-item index="overview">结果总览</el-menu-item>
|
||||
<el-menu-item index="special">专项排查</el-menu-item>
|
||||
<el-menu-item index="detail">流水明细查询</el-menu-item>
|
||||
@@ -107,6 +107,11 @@ export default {
|
||||
projectStatusPollingLoading: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isProjectArchived() {
|
||||
return String(this.projectInfo.projectStatus) === "2";
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
"$route.params.projectId"(newId) {
|
||||
this.stopProjectStatusPolling();
|
||||
@@ -123,6 +128,10 @@ export default {
|
||||
},
|
||||
"projectInfo.projectStatus"() {
|
||||
this.syncProjectStatusPolling();
|
||||
const accessibleTab = this.resolveAccessibleTab(this.activeTab);
|
||||
if (accessibleTab !== this.activeTab) {
|
||||
this.setActiveTab(accessibleTab);
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
@@ -138,7 +147,16 @@ export default {
|
||||
const tab = (this.$route.query && this.$route.query.tab) || "";
|
||||
const validTabs = ["upload", "config", "overview", "special", "detail"];
|
||||
const targetTab = validTabs.includes(tab) ? tab : "upload";
|
||||
this.setActiveTab(targetTab);
|
||||
this.setActiveTab(this.resolveAccessibleTab(targetTab));
|
||||
},
|
||||
isArchiveLockedTab(tab) {
|
||||
return this.isProjectArchived && ["upload", "config"].includes(tab);
|
||||
},
|
||||
resolveAccessibleTab(tab) {
|
||||
if (this.isArchiveLockedTab(tab)) {
|
||||
return "overview";
|
||||
}
|
||||
return tab;
|
||||
},
|
||||
setActiveTab(index) {
|
||||
this.activeTab = index;
|
||||
@@ -319,6 +337,9 @@ export default {
|
||||
},
|
||||
/** 菜单选择事件 */
|
||||
handleMenuSelect(index) {
|
||||
if (this.isArchiveLockedTab(index)) {
|
||||
return;
|
||||
}
|
||||
console.log("菜单选择:", index);
|
||||
this.setActiveTab(index);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user