From 301b8ffda463eb52e641eeff1b51032c5521e0b8 Mon Sep 17 00:00:00 2001 From: MeterSphere Bot <78466014+metersphere-bot@users.noreply.github.com> Date: Mon, 12 Feb 2024 16:51:33 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E8=AF=95=E5=8F=82=E6=95=B0=E5=AF=B9?= =?UTF-8?q?=E9=BD=90=E6=94=B6=E5=B0=BE=20(#28886)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: BAIQI <443543832@qq.com> --- frontend/README.md | 39 --- .../ms-assertion/comp/VariableTab.vue | 4 +- .../ms-common-script/insertCommonScript.vue | 85 +++--- .../ms-common-script/ms-addScriptDrawer.vue | 4 +- .../ms-common-script/ms-script-menu.vue | 7 +- .../ms-common-script/scriptDefined.vue | 49 ++-- .../business/ms-common-script/utils.ts | 14 +- .../components/pure/ms-code-editor/index.vue | 14 +- .../components/pure/ms-code-editor/types.ts | 5 + .../src/components/pure/ms-list/index.vue | 2 +- .../components/pure/ms-table/base-table.vue | 36 ++- frontend/src/mock/api-test.ts | 112 -------- frontend/src/mock/index.ts | 10 - frontend/src/mock/message-box.ts | 84 ------ frontend/src/mock/system/project.ts | 55 ---- frontend/src/mock/system/resourcePool.ts | 161 ----------- frontend/src/mock/system/user.ts | 254 ------------------ frontend/src/mock/user.ts | 7 - frontend/src/models/apiTest/debug.ts | 14 +- frontend/src/utils/setup-mock.ts | 83 ------ .../api-test/components/condition/content.vue | 74 +++-- .../api-test/components/condition/list.vue | 41 ++- .../api-test/debug/components/debug/body.vue | 1 + .../api-test/debug/components/debug/index.vue | 29 +- .../api-test/debug/components/moduleTree.vue | 5 +- .../src/views/api-test/debug/locale/en-US.ts | 1 + .../src/views/api-test/debug/locale/zh-CN.ts | 1 + .../commonScript/locale/en-US.ts | 29 +- .../commonScript/locale/zh-CN.ts | 31 +-- .../components/allParams/index.vue | 6 +- .../components/requestHeader/index.vue | 2 +- 31 files changed, 270 insertions(+), 989 deletions(-) delete mode 100644 frontend/src/mock/api-test.ts delete mode 100644 frontend/src/mock/index.ts delete mode 100644 frontend/src/mock/message-box.ts delete mode 100644 frontend/src/mock/system/project.ts delete mode 100644 frontend/src/mock/system/resourcePool.ts delete mode 100644 frontend/src/mock/system/user.ts delete mode 100644 frontend/src/mock/user.ts delete mode 100644 frontend/src/utils/setup-mock.ts diff --git a/frontend/README.md b/frontend/README.md index 18a38ce666..0e841e0e48 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -400,45 +400,6 @@ export interface LoginRes { -## -mock - -提供全局接口数据 mock 功能,避免因为调试而修改请求代码导致出现问题,按功能模块划分文件,通过`index.ts`暴露,示例如下: - -```typescript -import MOCK from '@/utils/setup-mock'; - -import './user'; -``` - -```typescript -import { mock } from '@/utils/setup-mock'; -import { RequestEnum } from '@/enums/httpEnum'; - -const getProjectList = () => { - return [ - { - id: '0283f238hf2', - num: 0, - organizationId: 'v3v4h434c3', - name: '发了多少', - description: 'string', - createTime: 0, - updateTime: 0, - updateUser: 'string', - createUser: 'string', - deleteTime: 0, - deleted: true, - deleteUser: 'string', - enable: true, - }, - ]; -}; - -mock(RequestEnum.GET, '/system/project/list', getProjectList(), 200); -``` - - - ## -router 项目路由管理模块,入口文件`index.ts`注册并暴露全部路由,以模块命名文件夹划分模块路由放置在`routes/*`下;`guard/*`下放置路由导航控制,包含权限、登录重定向等;`app-menus/index.ts`为菜单相关的路由信息;`constants.ts`定义路由常量,包括路由白名单、重定向路由名、默认主页路由信息等 diff --git a/frontend/src/components/business/ms-assertion/comp/VariableTab.vue b/frontend/src/components/business/ms-assertion/comp/VariableTab.vue index 49e5df6328..d03b1d68c2 100644 --- a/frontend/src/components/business/ms-assertion/comp/VariableTab.vue +++ b/frontend/src/components/business/ms-assertion/comp/VariableTab.vue @@ -52,8 +52,8 @@ const columns: ParamTableColumn[] = [ { title: 'ms.assertion.variableName', // 变量名 - dataIndex: 'name', - slotName: 'name', + dataIndex: 'key', + slotName: 'key', showInTable: true, showDrag: true, options: responseHeaderOption, diff --git a/frontend/src/components/business/ms-common-script/insertCommonScript.vue b/frontend/src/components/business/ms-common-script/insertCommonScript.vue index f1239cafb0..e4296a1825 100644 --- a/frontend/src/components/business/ms-common-script/insertCommonScript.vue +++ b/frontend/src/components/business/ms-common-script/insertCommonScript.vue @@ -1,8 +1,12 @@