From a753b87c1f7b0d96a0e97c26833abeb3ccdbe488 Mon Sep 17 00:00:00 2001 From: wkc <978997012@qq.com> Date: Thu, 5 Mar 2026 16:20:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B7=B2=E5=AE=8C=E6=88=90/=E5=B7=B2?= =?UTF-8?q?=E5=BD=92=E6=A1=A3=E6=9F=A5=E7=9C=8B=E7=BB=93=E6=9E=9C=E7=9B=B4?= =?UTF-8?q?=E8=BE=BE=E7=BB=93=E6=9E=9C=E6=80=BB=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/views/ccdiProject/detail.vue | 35 +++++++++++++++-------- ruoyi-ui/src/views/ccdiProject/index.vue | 6 ++-- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/ruoyi-ui/src/views/ccdiProject/detail.vue b/ruoyi-ui/src/views/ccdiProject/detail.vue index 7647a0c..0b26519 100644 --- a/ruoyi-ui/src/views/ccdiProject/detail.vue +++ b/ruoyi-ui/src/views/ccdiProject/detail.vue @@ -100,15 +100,37 @@ export default { if (newId) { this.projectId = newId; this.projectInfo.projectId = newId; + this.initActiveTabFromRoute(); this.initPageData(); } }, + "$route.query.tab"() { + this.initActiveTabFromRoute(); + }, }, created() { // 初始化页面数据 + this.initActiveTabFromRoute(); this.initPageData(); }, methods: { + initActiveTabFromRoute() { + 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); + }, + setActiveTab(index) { + this.activeTab = index; + const componentMap = { + upload: "UploadData", + config: "ParamConfig", + overview: "PreliminaryCheck", + special: "SpecialCheck", + detail: "DetailQuery", + }; + this.currentComponent = componentMap[index] || "UploadData"; + }, /** 初始化页面数据 */ initPageData() { // 这里应该从API获取项目详细信息 @@ -208,18 +230,7 @@ export default { /** 菜单选择事件 */ handleMenuSelect(index) { console.log("菜单选择:", index); - this.activeTab = index; - - // 组件映射 - const componentMap = { - upload: "UploadData", - config: "ParamConfig", - overview: "PreliminaryCheck", - special: "SpecialCheck", - detail: "DetailQuery", - }; - - this.currentComponent = componentMap[index] || "UploadData"; + this.setActiveTab(index); }, /** UploadData 组件:菜单切换 */ handleMenuChange({ key, route }) { diff --git a/ruoyi-ui/src/views/ccdiProject/index.vue b/ruoyi-ui/src/views/ccdiProject/index.vue index 61e90bf..afb68f7 100644 --- a/ruoyi-ui/src/views/ccdiProject/index.vue +++ b/ruoyi-ui/src/views/ccdiProject/index.vue @@ -234,8 +234,10 @@ export default { }, /** 查看结果 */ handleViewResult(row) { - console.log("查看结果:", row); - this.$modal.msgInfo("查看项目结果: " + row.projectName); + this.$router.push({ + path: `/ccdiProject/detail/${row.projectId}`, + query: { tab: "overview" }, + }); }, /** 重新分析 */ handleReAnalyze(row) {