From 0f14d934bb26eea5e6b52fc4371c8f45016540b2 Mon Sep 17 00:00:00 2001 From: baiqi Date: Wed, 15 May 2024 15:17:56 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=20Mock=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/business/ms-menu/index.vue | 21 +- .../src/components/pure/ms-avatar/index.vue | 17 +- frontend/src/models/apiTest/mock.ts | 1 + .../src/views/api-test/components/config.ts | 1 + .../components/management/api/apiTable.vue | 18 ++ .../components/management/api/index.vue | 10 + .../management/mock/mockDetailDrawer.vue | 24 +- .../management/mock/mockMatchRuleForm.vue | 3 +- .../management/mock/mockResponse.vue | 226 +++++++++++++++++- .../views/api-test/management/locale/en-US.ts | 2 + .../views/api-test/management/locale/zh-CN.ts | 2 + .../components/common/customApiDrawer.vue | 2 +- .../components/common/customCaseDrawer.vue | 2 +- 13 files changed, 296 insertions(+), 33 deletions(-) diff --git a/frontend/src/components/business/ms-menu/index.vue b/frontend/src/components/business/ms-menu/index.vue index b69f8feb78..e1b96681ca 100644 --- a/frontend/src/components/business/ms-menu/index.vue +++ b/frontend/src/components/business/ms-menu/index.vue @@ -394,17 +394,18 @@ class={['flex w-full items-center justify-between', collapsed.value ? 'h-[56px] w-[56px]' : '']} key="personalInfo" > - {collapsed.value ? ( -
- + { +
+ + {collapsed.value ? null : userStore.name}
- ) : ( -
- - {userStore.name} -
- )} - + } {collapsed.value ? null : } diff --git a/frontend/src/components/pure/ms-avatar/index.vue b/frontend/src/components/pure/ms-avatar/index.vue index a69fd4b9c5..e04bd64878 100644 --- a/frontend/src/components/pure/ms-avatar/index.vue +++ b/frontend/src/components/pure/ms-avatar/index.vue @@ -1,6 +1,6 @@ diff --git a/frontend/src/models/apiTest/mock.ts b/frontend/src/models/apiTest/mock.ts index dd2535701a..1b551b2fef 100644 --- a/frontend/src/models/apiTest/mock.ts +++ b/frontend/src/models/apiTest/mock.ts @@ -35,6 +35,7 @@ export interface MockResponse { useApiResponse: boolean; apiResponseId?: string; // useApiResponse 为 true 时必填 body: ResponseDefinitionBody; + delay: number; } // mock 信息-请求通用匹配规则 export interface MockMatchRuleCommon { diff --git a/frontend/src/views/api-test/components/config.ts b/frontend/src/views/api-test/components/config.ts index 56932425bb..b1e74b3c30 100644 --- a/frontend/src/views/api-test/components/config.ts +++ b/frontend/src/views/api-test/components/config.ts @@ -342,6 +342,7 @@ export const mockDefaultParams: MockParams = { sendAsBody: false, }, }, + delay: 0, }, apiDefinitionId: '', uploadFileIds: [], diff --git a/frontend/src/views/api-test/management/components/management/api/apiTable.vue b/frontend/src/views/api-test/management/components/management/api/apiTable.vue index 58893ec553..b705021e6e 100644 --- a/frontend/src/views/api-test/management/components/management/api/apiTable.vue +++ b/frontend/src/views/api-test/management/components/management/api/apiTable.vue @@ -112,6 +112,9 @@ +