实现项目归档功能

This commit is contained in:
wkc
2026-03-24 21:45:55 +08:00
parent bb49d78a3a
commit 294164a504
23 changed files with 680 additions and 87 deletions

View File

@@ -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);
},