diff --git a/frontend/src/components/pure/ms-detail-card/index.vue b/frontend/src/components/pure/ms-detail-card/index.vue index 7eddc34c05..83ec70136d 100644 --- a/frontend/src/components/pure/ms-detail-card/index.vue +++ b/frontend/src/components/pure/ms-detail-card/index.vue @@ -100,9 +100,7 @@ .ms-detail-card { @apply relative flex flex-col; - padding: 16px; border-radius: var(--border-radius-small); - background-color: var(--color-text-n9); gap: 8px; .ms-detail-card-title { @apply flex items-center justify-between overflow-hidden; diff --git a/frontend/src/enums/routeEnum.ts b/frontend/src/enums/routeEnum.ts index 6121fb7a64..66b0573de5 100644 --- a/frontend/src/enums/routeEnum.ts +++ b/frontend/src/enums/routeEnum.ts @@ -3,6 +3,7 @@ export enum ApiTestRouteEnum { API_TEST_DEBUG_MANAGEMENT = 'apiTestDebug', API_TEST_MANAGEMENT = 'apiTestManagement', API_TEST_MANAGEMENT_RECYCLE = 'apiTestManagementRecycle', + API_TEST_MANAGEMENT_CASE_DETAIL = 'apiTestManagementCaseDetail', API_TEST_SCENARIO = 'apiTestScenario', API_TEST_SCENARIO_RECYCLE = 'apiTestScenarioRecycle', API_TEST_REPORT = 'apiTestReport', diff --git a/frontend/src/router/routes/modules/apiTest.ts b/frontend/src/router/routes/modules/apiTest.ts index 67e57619f3..aa0f8c09c2 100644 --- a/frontend/src/router/routes/modules/apiTest.ts +++ b/frontend/src/router/routes/modules/apiTest.ts @@ -64,6 +64,26 @@ const ApiTest: AppRouteRecordRaw = { ], }, }, + // 接口定义-API-用例-用例列表详情 + { + path: 'caseDetail', + name: ApiTestRouteEnum.API_TEST_MANAGEMENT_CASE_DETAIL, + component: () => import('@/views/api-test/management/components/management/case/apiCaseDetail.vue'), + meta: { + locale: 'case.apiCaseDetail', + roles: ['PROJECT_API_DEFINITION:READ'], + breadcrumbs: [ + { + name: ApiTestRouteEnum.API_TEST_MANAGEMENT, + locale: 'case.apiCaseList', + }, + { + name: ApiTestRouteEnum.API_TEST_MANAGEMENT_CASE_DETAIL, + locale: 'case.apiCaseDetail', + }, + ], + }, + }, { path: 'scenario', name: ApiTestRouteEnum.API_TEST_SCENARIO, diff --git a/frontend/src/views/api-test/components/config.ts b/frontend/src/views/api-test/components/config.ts index 950d1c8e0e..4d6f8b99f8 100644 --- a/frontend/src/views/api-test/components/config.ts +++ b/frontend/src/views/api-test/components/config.ts @@ -1,6 +1,7 @@ import { cloneDeep } from 'lodash-es'; import { EQUAL } from '@/components/pure/ms-advance-filter'; +import { RequestParam } from '@/views/api-test/components/requestComposition/index.vue'; import { useI18n } from '@/hooks/useI18n'; @@ -18,14 +19,18 @@ import type { MockParams } from '@/models/apiTest/mock'; import { FullResponseAssertionType, RequestAssertionCondition, + RequestAuthType, RequestBodyFormat, RequestCaseStatus, + RequestComposition, RequestContentTypeEnum, + RequestDefinitionStatus, RequestExtractEnvType, RequestExtractExpressionEnum, RequestExtractExpressionRuleType, RequestExtractResultMatchingRule, RequestExtractScope, + RequestMethods, RequestParamsType, ResponseBodyFormat, ResponseBodyXPathAssertionFormat, @@ -432,3 +437,74 @@ export const lastReportStatusListOptions = computed(() => { }; }); }); + +// api下的创建用例弹窗也用到了defaultCaseParams +const initDefaultId = `case-${Date.now()}`; +export const defaultCaseParams: RequestParam = { + id: initDefaultId, + type: 'case', + moduleId: '', + protocol: 'HTTP', + tags: [], + description: '', + priority: 'P0', + status: RequestDefinitionStatus.PROCESSING, + url: '', + activeTab: RequestComposition.HEADER, + closable: true, + method: RequestMethods.GET, + headers: [], + body: cloneDeep(defaultBodyParams), + query: [], + rest: [], + polymorphicName: '', + name: '', + path: '', + projectId: '', + uploadFileIds: [], + linkFileIds: [], + authConfig: { + authType: RequestAuthType.NONE, + basicAuth: { + userName: '', + password: '', + }, + digestAuth: { + userName: '', + password: '', + }, + }, + children: [ + { + polymorphicName: 'MsCommonElement', // 协议多态名称,写死MsCommonElement + assertionConfig: { + enableGlobal: true, + assertions: [], + }, + postProcessorConfig: { + enableGlobal: true, + processors: [], + }, + preProcessorConfig: { + enableGlobal: true, + processors: [], + }, + }, + ], + otherConfig: { + connectTimeout: 60000, + responseTimeout: 60000, + certificateAlias: '', + followRedirects: true, + autoRedirects: false, + }, + responseActiveTab: ResponseComposition.BODY, + response: cloneDeep(defaultResponse), + responseDefinition: [cloneDeep(defaultResponseItem)], + isNew: true, + unSaved: false, + executeLoading: false, + preDependency: [], // 前置依赖 + postDependency: [], // 后置依赖 + errorMessageInfo: {}, +}; diff --git a/frontend/src/views/api-test/management/components/management/api/preview/detail.vue b/frontend/src/views/api-test/management/components/management/api/preview/detail.vue index 49a8ab4029..a56b5d03b2 100644 --- a/frontend/src/views/api-test/management/components/management/api/preview/detail.vue +++ b/frontend/src/views/api-test/management/components/management/api/preview/detail.vue @@ -2,14 +2,29 @@
@@ -258,13 +273,13 @@