接通历史项目导入前端提交链路

This commit is contained in:
wkc
2026-03-29 09:56:46 +08:00
parent d6457491e8
commit a019abb950
3 changed files with 33 additions and 3 deletions

View File

@@ -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`

View File

@@ -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() {

View File

@@ -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");