From 4395d9fb225ae92f6c7f4854101644c9f267ffcc Mon Sep 17 00:00:00 2001 From: qiaoxinjiu Date: Wed, 22 Apr 2026 10:00:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=B5=8B=E8=AF=95=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E5=8A=9F=E8=83=BD=EF=BC=8C=E7=B3=BB=E7=BB=9F=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=EF=BC=8C=E6=94=AF=E6=8C=81=E5=A4=9A=E4=B8=AA=E8=A7=92?= =?UTF-8?q?=E8=89=B2=EF=BC=8C=E5=88=86=E9=85=8D=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .plan/MEVsZvRZopyrJGc3cNsiN.md | 129 +++++++ Jenkins.txt | 2 +- config/index.js | 9 +- src/App.vue | 26 +- src/api/CreateDtapi.js | 10 +- src/api/Userapi.js | 6 +- src/api/caseApi.js | 122 ++++++ src/api/dataFactoryApi.js | 66 ++++ src/api/planApi.js | 98 +++++ src/api/productApi.js | 33 ++ src/api/projectApi.js | 91 +++++ src/api/rbacApi.js | 169 +++++++++ src/api/reportApi.js | 28 ++ src/components/Home.vue | 141 ++++++- src/components/System/MenuManage.vue | 322 ++++++++++++++++ src/components/System/RoleManage.vue | 353 +++++++++++++++++ src/components/System/UserManage.vue | 358 ++++++++++++++++++ .../TestPlatform/Case/CaseEditor.vue | 116 ++++++ src/components/TestPlatform/Case/CaseList.vue | 110 ++++++ .../TestPlatform/Case/CaseReview.vue | 64 ++++ .../DataFactory/BuilderEditor.vue | 82 ++++ .../TestPlatform/DataFactory/BuilderList.vue | 100 +++++ .../TestPlatform/DataFactory/MockService.vue | 72 ++++ .../TestPlatform/DataFactory/TaskHistory.vue | 55 +++ .../TestPlatform/Plan/PlanBuilder.vue | 69 ++++ .../TestPlatform/Plan/PlanExecute.vue | 114 ++++++ src/components/TestPlatform/Plan/PlanList.vue | 106 ++++++ .../TestPlatform/Plan/PlanProgress.vue | 73 ++++ .../TestPlatform/Product/ProductList.vue | 223 +++++++++++ .../TestPlatform/Project/ProjectDetail.vue | 55 +++ .../TestPlatform/Project/ProjectList.vue | 247 ++++++++++++ .../TestPlatform/Project/ProjectSettings.vue | 281 ++++++++++++++ .../TestPlatform/Report/ReportList.vue | 104 +++++ .../TestPlatform/Report/ReportViewer.vue | 58 +++ .../TestPlatform/common/JsonViewer.vue | 40 ++ .../common/KeyValueDescriptions.vue | 37 ++ .../TestPlatform/common/PageSection.vue | 39 ++ src/components/User/Login.vue | 71 +++- src/components/User/Register.vue | 73 ++-- src/router/index.js | 140 +++++++ src/utils/request.js | 9 +- src/vuex/store.js | 19 +- 42 files changed, 4239 insertions(+), 81 deletions(-) create mode 100644 .plan/MEVsZvRZopyrJGc3cNsiN.md create mode 100644 src/api/caseApi.js create mode 100644 src/api/dataFactoryApi.js create mode 100644 src/api/planApi.js create mode 100644 src/api/productApi.js create mode 100644 src/api/projectApi.js create mode 100644 src/api/rbacApi.js create mode 100644 src/api/reportApi.js create mode 100644 src/components/System/MenuManage.vue create mode 100644 src/components/System/RoleManage.vue create mode 100644 src/components/System/UserManage.vue create mode 100644 src/components/TestPlatform/Case/CaseEditor.vue create mode 100644 src/components/TestPlatform/Case/CaseList.vue create mode 100644 src/components/TestPlatform/Case/CaseReview.vue create mode 100644 src/components/TestPlatform/DataFactory/BuilderEditor.vue create mode 100644 src/components/TestPlatform/DataFactory/BuilderList.vue create mode 100644 src/components/TestPlatform/DataFactory/MockService.vue create mode 100644 src/components/TestPlatform/DataFactory/TaskHistory.vue create mode 100644 src/components/TestPlatform/Plan/PlanBuilder.vue create mode 100644 src/components/TestPlatform/Plan/PlanExecute.vue create mode 100644 src/components/TestPlatform/Plan/PlanList.vue create mode 100644 src/components/TestPlatform/Plan/PlanProgress.vue create mode 100644 src/components/TestPlatform/Product/ProductList.vue create mode 100644 src/components/TestPlatform/Project/ProjectDetail.vue create mode 100644 src/components/TestPlatform/Project/ProjectList.vue create mode 100644 src/components/TestPlatform/Project/ProjectSettings.vue create mode 100644 src/components/TestPlatform/Report/ReportList.vue create mode 100644 src/components/TestPlatform/Report/ReportViewer.vue create mode 100644 src/components/TestPlatform/common/JsonViewer.vue create mode 100644 src/components/TestPlatform/common/KeyValueDescriptions.vue create mode 100644 src/components/TestPlatform/common/PageSection.vue diff --git a/.plan/MEVsZvRZopyrJGc3cNsiN.md b/.plan/MEVsZvRZopyrJGc3cNsiN.md new file mode 100644 index 0000000..76aa048 --- /dev/null +++ b/.plan/MEVsZvRZopyrJGc3cNsiN.md @@ -0,0 +1,129 @@ +# 前端实现计划:测试平台页面与接口 + +## 1. 现状确认 +- 当前项目不是 React 18 + TypeScript,而是 **Vue 2 + Element UI + vue-router + vuex + axios**。 +- 已有页面以“效能平台/造数工具”为主,目录集中在: + - `src/components/` + - `src/api/` + - `src/router/index.js` +- 已存在一套造数相关接口封装:`src/api/CreateDtapi.js` +- 已存在基础布局页:`src/components/Home.vue` +- 因此本次应遵循**现有 Vue 2 结构**落地,不直接按你给出的 React 目录硬切,否则与当前代码库不兼容。 + +## 2. 实施目标 +按你提供的详细设计,在当前项目结构下补齐并升级前端代码,重点实现: +- 测试平台导航结构 +- 项目/用例/计划/报告/造数 五大功能入口页面 +- 对应 API 封装层 +- 页面级列表、详情、表单、执行、报告查看等基础交互 +- 复用当前 Element UI 风格,保持现有代码可运行 + +## 3. 实施范围拆分 + +### 阶段 A:基础设施与路由改造 +1. 梳理现有路由与导航。 +2. 扩展左侧菜单,新增模块入口: + - 项目管理 + - 用例管理 + - 测试计划 + - 测试报告 + - 造数工厂 +3. 在 `src/router/index.js` 注册对应页面路由。 +4. 保留现有造数页面入口,避免破坏已有功能。 + +### 阶段 B:API 服务层补齐 +1. 新增 API 文件,按你给出的接口定义封装: + - `src/api/projectApi.js` + - `src/api/caseApi.js` + - `src/api/planApi.js` + - `src/api/reportApi.js` + - `src/api/dataFactoryApi.js` +2. 统一复用 `src/utils/request.js`。 +3. 尽量映射到 REST 风格路径,例如: + - `/api/v1/projects/{projectId}/cases` + - `/api/v1/projects/{projectId}/plans` + - `/api/v1/projects/{projectId}/reports` + - `/api/v1/projects/{projectId}/data/*` +4. 对分页、详情、创建、更新、执行、导出等接口做最小可用封装。 + +### 阶段 C:页面骨架实现 +在 `src/components/` 下新增测试平台模块页面,优先做可运行页面骨架与核心交互: + +1. 项目模块 + - `src/components/TestPlatform/Project/ProjectList.vue` + - `src/components/TestPlatform/Project/ProjectDetail.vue` + - `src/components/TestPlatform/Project/ProjectSettings.vue` + +2. 用例模块 + - `src/components/TestPlatform/Case/CaseList.vue` + - `src/components/TestPlatform/Case/CaseEditor.vue` + - `src/components/TestPlatform/Case/CaseReview.vue` + +3. 测试计划模块 + - `src/components/TestPlatform/Plan/PlanList.vue` + - `src/components/TestPlatform/Plan/PlanBuilder.vue` + - `src/components/TestPlatform/Plan/PlanExecute.vue` + - `src/components/TestPlatform/Plan/PlanProgress.vue` + +4. 报告模块 + - `src/components/TestPlatform/Report/ReportList.vue` + - `src/components/TestPlatform/Report/ReportViewer.vue` + +5. 造数模块升级 + - 保留现有 `CreateData/*` + - 新增测试平台语义下页面: + - `src/components/TestPlatform/DataFactory/BuilderList.vue` + - `src/components/TestPlatform/DataFactory/BuilderEditor.vue` + - `src/components/TestPlatform/DataFactory/TaskHistory.vue` + - `src/components/TestPlatform/DataFactory/MockService.vue` + +### 阶段 D:公共组件抽取 +新增可复用基础组件,减少页面重复: +- `src/components/TestPlatform/common/JsonViewer.vue` +- `src/components/TestPlatform/common/KeyValueDescriptions.vue` +- `src/components/TestPlatform/common/PageSection.vue` + +### 阶段 E:联调友好处理 +1. 页面初版支持后端未完成时的容错: + - 空数据态 + - 请求失败提示 + - 默认 projectId 占位 +2. 不引入新依赖,避免额外安装。 +3. 保持接口函数独立,后续联调时只需替换 URL 或参数格式。 + +## 4. 执行顺序 +1. 先改路由与主页导航。 +2. 再补 API 封装。 +3. 再按模块逐步落页面: + - 项目 + - 用例 + - 计划 + - 报告 + - 造数 +4. 最后做公共组件复用与样式收口。 + +## 5. 每阶段交付物 +- 阶段 A:可点击进入的菜单与路由 +- 阶段 B:完整接口文件 +- 阶段 C:各模块页面可打开、可发请求、可展示表格/表单 +- 阶段 D:重复 UI 收敛 +- 阶段 E:整体自检,确保不破坏原有功能 + +## 6. 风险与约束 +- 当前代码库是旧版 Vue 2 工程,不能直接生成 React/TSX 代码。 +- 你的接口设计是目标态,实际后端返回结构可能与设计不完全一致,因此前端会适当做字段兼容。 +- 由于当前 `request.js` 已固定 `baseURL`,本次先复用,不额外改动接口基础配置,避免影响现有功能。 + +## 7. 本次建议执行策略 +按“先骨架、再细化”的方式推进: +- 第一步:完成导航、路由、API 文件、页面骨架 +- 第二步:优先把列表页和详情/编辑页做成可联调版本 +- 第三步:再补计划执行、报告查看、造数编排等复杂交互 + +## 8. 下一步实际执行内容 +获批后,我将从以下顺序开始落地: +1. 修改 `src/components/Home.vue` 增加测试平台菜单 +2. 修改 `src/router/index.js` 注册测试平台路由 +3. 新增五类 API 文件 +4. 新增项目/用例/计划/报告/造数页面骨架 +5. 检查并修正页面间跳转与基础请求 diff --git a/Jenkins.txt b/Jenkins.txt index eefc74f..94ed1c8 100644 --- a/Jenkins.txt +++ b/Jenkins.txt @@ -23,7 +23,7 @@ pipeline { DEPLOY_PORT = '22' DEPLOY_USER = 'user' CONTAINER_NAME = 'effekt-interface-frontend' - HOST_PORT = '8080' + HOST_PORT = '8881' CONTAINER_PORT = '80' } diff --git a/config/index.js b/config/index.js index e2c3467..7cd288c 100644 --- a/config/index.js +++ b/config/index.js @@ -10,7 +10,12 @@ module.exports = { // Paths assetsSubDirectory: 'static', assetsPublicPath: '/', - proxyTable: {}, + proxyTable: { + '/it/api': { + target: 'http://192.168.11.46:5010', + changeOrigin: true + } + }, // Various Dev Server settings // host: '172.19.29.63', // can be overwritten by process.env.HOST @@ -18,7 +23,7 @@ module.exports = { port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined autoOpenBrowser: false, errorOverlay: true, - notifyOnErrors: true, + notifyOnErrors: false, poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- diff --git a/src/App.vue b/src/App.vue index 1b89d05..30b67fb 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,16 +5,30 @@ + + diff --git a/src/components/System/RoleManage.vue b/src/components/System/RoleManage.vue new file mode 100644 index 0000000..ce8d4c0 --- /dev/null +++ b/src/components/System/RoleManage.vue @@ -0,0 +1,353 @@ + + + + + + + created() { + this.fetchList() + } +} + + +reated() { + this.fetchList() + } +} + + diff --git a/src/components/System/UserManage.vue b/src/components/System/UserManage.vue new file mode 100644 index 0000000..9c5acbb --- /dev/null +++ b/src/components/System/UserManage.vue @@ -0,0 +1,358 @@ + + + + + diff --git a/src/components/TestPlatform/Case/CaseEditor.vue b/src/components/TestPlatform/Case/CaseEditor.vue new file mode 100644 index 0000000..dd71055 --- /dev/null +++ b/src/components/TestPlatform/Case/CaseEditor.vue @@ -0,0 +1,116 @@ + + + + + diff --git a/src/components/TestPlatform/Case/CaseList.vue b/src/components/TestPlatform/Case/CaseList.vue new file mode 100644 index 0000000..3ba2a13 --- /dev/null +++ b/src/components/TestPlatform/Case/CaseList.vue @@ -0,0 +1,110 @@ + + + + + diff --git a/src/components/TestPlatform/Case/CaseReview.vue b/src/components/TestPlatform/Case/CaseReview.vue new file mode 100644 index 0000000..e7a15f7 --- /dev/null +++ b/src/components/TestPlatform/Case/CaseReview.vue @@ -0,0 +1,64 @@ + + + + + diff --git a/src/components/TestPlatform/DataFactory/BuilderEditor.vue b/src/components/TestPlatform/DataFactory/BuilderEditor.vue new file mode 100644 index 0000000..c41ecfd --- /dev/null +++ b/src/components/TestPlatform/DataFactory/BuilderEditor.vue @@ -0,0 +1,82 @@ + + + + + diff --git a/src/components/TestPlatform/DataFactory/BuilderList.vue b/src/components/TestPlatform/DataFactory/BuilderList.vue new file mode 100644 index 0000000..ec8b05d --- /dev/null +++ b/src/components/TestPlatform/DataFactory/BuilderList.vue @@ -0,0 +1,100 @@ + + + + + +style> diff --git a/src/components/TestPlatform/DataFactory/MockService.vue b/src/components/TestPlatform/DataFactory/MockService.vue new file mode 100644 index 0000000..7a58934 --- /dev/null +++ b/src/components/TestPlatform/DataFactory/MockService.vue @@ -0,0 +1,72 @@ + + + + + diff --git a/src/components/TestPlatform/DataFactory/TaskHistory.vue b/src/components/TestPlatform/DataFactory/TaskHistory.vue new file mode 100644 index 0000000..f8c9cb7 --- /dev/null +++ b/src/components/TestPlatform/DataFactory/TaskHistory.vue @@ -0,0 +1,55 @@ + + + + + diff --git a/src/components/TestPlatform/Plan/PlanBuilder.vue b/src/components/TestPlatform/Plan/PlanBuilder.vue new file mode 100644 index 0000000..d5d5852 --- /dev/null +++ b/src/components/TestPlatform/Plan/PlanBuilder.vue @@ -0,0 +1,69 @@ + + + + + diff --git a/src/components/TestPlatform/Plan/PlanExecute.vue b/src/components/TestPlatform/Plan/PlanExecute.vue new file mode 100644 index 0000000..2278c95 --- /dev/null +++ b/src/components/TestPlatform/Plan/PlanExecute.vue @@ -0,0 +1,114 @@ + + + + + diff --git a/src/components/TestPlatform/Plan/PlanList.vue b/src/components/TestPlatform/Plan/PlanList.vue new file mode 100644 index 0000000..91290dd --- /dev/null +++ b/src/components/TestPlatform/Plan/PlanList.vue @@ -0,0 +1,106 @@ + + + + + diff --git a/src/components/TestPlatform/Plan/PlanProgress.vue b/src/components/TestPlatform/Plan/PlanProgress.vue new file mode 100644 index 0000000..47ae1b2 --- /dev/null +++ b/src/components/TestPlatform/Plan/PlanProgress.vue @@ -0,0 +1,73 @@ + + + + + diff --git a/src/components/TestPlatform/Product/ProductList.vue b/src/components/TestPlatform/Product/ProductList.vue new file mode 100644 index 0000000..f180f76 --- /dev/null +++ b/src/components/TestPlatform/Product/ProductList.vue @@ -0,0 +1,223 @@ + + + + + diff --git a/src/components/TestPlatform/Project/ProjectDetail.vue b/src/components/TestPlatform/Project/ProjectDetail.vue new file mode 100644 index 0000000..4e10fd5 --- /dev/null +++ b/src/components/TestPlatform/Project/ProjectDetail.vue @@ -0,0 +1,55 @@ + + + + + diff --git a/src/components/TestPlatform/Project/ProjectList.vue b/src/components/TestPlatform/Project/ProjectList.vue new file mode 100644 index 0000000..0c3a4cb --- /dev/null +++ b/src/components/TestPlatform/Project/ProjectList.vue @@ -0,0 +1,247 @@ + + + + + diff --git a/src/components/TestPlatform/Project/ProjectSettings.vue b/src/components/TestPlatform/Project/ProjectSettings.vue new file mode 100644 index 0000000..16d8399 --- /dev/null +++ b/src/components/TestPlatform/Project/ProjectSettings.vue @@ -0,0 +1,281 @@ + + + + + diff --git a/src/components/TestPlatform/Report/ReportList.vue b/src/components/TestPlatform/Report/ReportList.vue new file mode 100644 index 0000000..279bc24 --- /dev/null +++ b/src/components/TestPlatform/Report/ReportList.vue @@ -0,0 +1,104 @@ + + + + + diff --git a/src/components/TestPlatform/Report/ReportViewer.vue b/src/components/TestPlatform/Report/ReportViewer.vue new file mode 100644 index 0000000..0adb7c5 --- /dev/null +++ b/src/components/TestPlatform/Report/ReportViewer.vue @@ -0,0 +1,58 @@ + + + + + diff --git a/src/components/TestPlatform/common/JsonViewer.vue b/src/components/TestPlatform/common/JsonViewer.vue new file mode 100644 index 0000000..a114af6 --- /dev/null +++ b/src/components/TestPlatform/common/JsonViewer.vue @@ -0,0 +1,40 @@ + + + + + diff --git a/src/components/TestPlatform/common/KeyValueDescriptions.vue b/src/components/TestPlatform/common/KeyValueDescriptions.vue new file mode 100644 index 0000000..30e67b5 --- /dev/null +++ b/src/components/TestPlatform/common/KeyValueDescriptions.vue @@ -0,0 +1,37 @@ + + + diff --git a/src/components/TestPlatform/common/PageSection.vue b/src/components/TestPlatform/common/PageSection.vue new file mode 100644 index 0000000..34f40a3 --- /dev/null +++ b/src/components/TestPlatform/common/PageSection.vue @@ -0,0 +1,39 @@ + + + + + diff --git a/src/components/User/Login.vue b/src/components/User/Login.vue index 5f2e55d..e7d49a2 100644 --- a/src/components/User/Login.vue +++ b/src/components/User/Login.vue @@ -12,7 +12,7 @@   + placeholder="用户名" + @keyup.enter="handleLogin">
  @@ -34,14 +35,13 @@ type="password" size="25" autocomplete="off" - placeholder="密码"> + placeholder="密码" + @keyup.enter="handleLogin">
- - 注册 - + 注册
@@ -49,31 +49,70 @@