From a019abb950ca5c29833843feb2db7273bc12c3d9 Mon Sep 17 00:00:00 2001 From: wkc <978997012@qq.com> Date: Sun, 29 Mar 2026 09:56:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E9=80=9A=E5=8E=86=E5=8F=B2=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E5=AF=BC=E5=85=A5=E5=89=8D=E7=AB=AF=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E9=93=BE=E8=B7=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...3-29-project-import-history-plan-record.md | 7 +++++++ ruoyi-ui/src/views/ccdiProject/index.vue | 8 ++++--- ...project-import-history-submit-flow.test.js | 21 +++++++++++++++++++ 3 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 ruoyi-ui/tests/unit/project-import-history-submit-flow.test.js diff --git a/docs/reports/implementation/2026-03-29-project-import-history-plan-record.md b/docs/reports/implementation/2026-03-29-project-import-history-plan-record.md index b64b384d..94b0de73 100644 --- a/docs/reports/implementation/2026-03-29-project-import-history-plan-record.md +++ b/docs/reports/implementation/2026-03-29-project-import-history-plan-record.md @@ -57,3 +57,10 @@ - 在 `CcdiFileUploadServiceImpl#validateDeleteRecord` 中优先拦截 `sourceType = HISTORY_IMPORT` 的记录,返回“历史导入文件不支持删除” - 扩展历史导入服务测试与文件删除测试,锁定自动重算与禁删行为 - 完成后端回归验证:`mvn -pl ccdi-project -am -Dtest=CcdiProjectControllerTest,CcdiProjectControllerContractTest,CcdiProjectServiceImplTest,CcdiProjectHistoryImportServiceImplTest,CcdiFileUploadServiceImplTest,CcdiBankStatementMapperXmlTest -Dsurefire.failIfNoSpecifiedTests=false test` + +### 2026-03-29 Task 1 前端提交跳转链路接通 + +- 保持 `ruoyi-ui/src/api/ccdiProject.js` 中真实 `/ccdi/project/history` 与 `/ccdi/project/import` 接口不变 +- 调整 `ruoyi-ui/src/views/ccdiProject/index.vue` 的 `handleSubmitImport`,成功后提示“历史项目导入任务已开始”、关闭弹窗、刷新列表并跳转到新项目详情页 +- 新增 `ruoyi-ui/tests/unit/project-import-history-submit-flow.test.js`,锁定真实接口地址、成功提示文案与详情页跳转路径 +- 验证命令:`cd ruoyi-ui && node tests/unit/project-import-history-submit-flow.test.js` diff --git a/ruoyi-ui/src/views/ccdiProject/index.vue b/ruoyi-ui/src/views/ccdiProject/index.vue index 1794f28f..9ad7599c 100644 --- a/ruoyi-ui/src/views/ccdiProject/index.vue +++ b/ruoyi-ui/src/views/ccdiProject/index.vue @@ -206,11 +206,13 @@ export default { this.importDialogVisible = false; }, /** 提交导入 */ - handleSubmitImport(data) { - console.log("导入历史项目:", data); - this.$modal.msgSuccess("项目导入成功"); + handleSubmitImport(project) { + this.$modal.msgSuccess("历史项目导入任务已开始"); this.importDialogVisible = false; this.getList(); + this.$router.push({ + path: `/ccdiProject/detail/${project.projectId}`, + }); }, /** 创建季度初核 */ handleCreateQuarterly() { diff --git a/ruoyi-ui/tests/unit/project-import-history-submit-flow.test.js b/ruoyi-ui/tests/unit/project-import-history-submit-flow.test.js new file mode 100644 index 00000000..3e419a49 --- /dev/null +++ b/ruoyi-ui/tests/unit/project-import-history-submit-flow.test.js @@ -0,0 +1,21 @@ +const assert = require("assert"); +const fs = require("fs"); +const path = require("path"); + +const apiPath = path.resolve(__dirname, "../../src/api/ccdiProject.js"); +const indexPath = path.resolve(__dirname, "../../src/views/ccdiProject/index.vue"); + +const apiSource = fs.readFileSync(apiPath, "utf8"); +const indexSource = fs.readFileSync(indexPath, "utf8"); + +assert(apiSource.includes("url: '/ccdi/project/history'"), "应接通历史项目列表真实接口"); +assert(apiSource.includes("url: '/ccdi/project/import'"), "应接通历史项目导入真实接口"); +assert(indexSource.includes("this.$router.push({"), "导入成功后应跳转到详情页"); +assert( + indexSource.includes("path: `/ccdiProject/detail/${project.projectId}`") + || indexSource.includes("path: `/ccdiProject/detail/${data.projectId}`"), + "导入成功后应跳转到新项目详情页" +); +assert(indexSource.includes("历史项目导入任务已开始"), "成功提示文案应说明历史导入任务已开始"); + +console.log("project-import-history-submit-flow test passed");