From bb098c9b2fc32d9b5258cac953cadb74c453228f Mon Sep 17 00:00:00 2001 From: teukkk Date: Thu, 10 Oct 2024 16:34:35 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E9=AB=98=E7=BA=A7=E7=AD=9B=E9=80=89-=E5=9C=BA=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/enums/advancedFilterEnum.ts | 1 + frontend/src/models/apiTest/scenario.ts | 4 - .../components/management/case/caseTable.vue | 8 +- .../api-test/scenario/components/config.ts | 11 + .../components/scenarioModuleTree.vue | 1 + .../scenario/components/scenarioTable.vue | 315 +++++++++++------- .../src/views/api-test/scenario/index.vue | 9 +- 7 files changed, 226 insertions(+), 123 deletions(-) diff --git a/frontend/src/enums/advancedFilterEnum.ts b/frontend/src/enums/advancedFilterEnum.ts index 45dfff627e..30c4c6421b 100644 --- a/frontend/src/enums/advancedFilterEnum.ts +++ b/frontend/src/enums/advancedFilterEnum.ts @@ -29,6 +29,7 @@ export enum FilterType { export enum ViewTypeEnum { FUNCTIONAL_CASE = 'functional-case', API_DEFINITION = 'api-definition', + API_SCENARIO = 'api-scenario', REVIEW_FUNCTIONAL_CASE = 'review-functional-case', API_CASE = 'api-case', API_MOCK = 'api-mock', diff --git a/frontend/src/models/apiTest/scenario.ts b/frontend/src/models/apiTest/scenario.ts index 67ed8cfe62..fb6ba259d7 100644 --- a/frontend/src/models/apiTest/scenario.ts +++ b/frontend/src/models/apiTest/scenario.ts @@ -176,10 +176,6 @@ export interface ExecutePageParams extends TableQueryParams { id: string; } -export interface ApiScenarioBatchParam extends BatchActionQueryParams { - moduleIds: string[]; -} - // 场景-执行历史-请求参数 export interface ExecuteHistoryItem { id: string; diff --git a/frontend/src/views/api-test/management/components/management/case/caseTable.vue b/frontend/src/views/api-test/management/components/management/case/caseTable.vue index b5530f0f6b..501ec74434 100644 --- a/frontend/src/views/api-test/management/components/management/case/caseTable.vue +++ b/frontend/src/views/api-test/management/components/management/case/caseTable.vue @@ -761,7 +761,13 @@ { title: 'case.caseEnvironment', dataIndex: 'environmentName', - type: FilterType.INPUT, + type: FilterType.SELECT, + selectProps: { + labelKey: 'name', + valueKey: 'id', + multiple: true, + options: appStore.envList, + }, }, { title: 'common.tag', diff --git a/frontend/src/views/api-test/scenario/components/config.ts b/frontend/src/views/api-test/scenario/components/config.ts index 6082cb5bbb..81b555c3fc 100644 --- a/frontend/src/views/api-test/scenario/components/config.ts +++ b/frontend/src/views/api-test/scenario/components/config.ts @@ -1,3 +1,5 @@ +import { useI18n } from '@/hooks/useI18n'; + import { type CsvVariable, Scenario, ScenarioStepConfig } from '@/models/apiTest/scenario'; import { ApiScenarioStatus, @@ -7,6 +9,15 @@ import { WhileConditionType, } from '@/enums/apiEnum'; +const { t } = useI18n(); + +// 场景状态选项 +export const scenarioStatusOptions = [ + { label: t('apiTestManagement.processing'), value: ApiScenarioStatus.UNDERWAY }, + { label: t('apiTestManagement.deprecate'), value: ApiScenarioStatus.DEPRECATED }, + { label: t('apiTestManagement.done'), value: ApiScenarioStatus.COMPLETED }, +]; + // 循环控制器 export const defaultLoopController = { loopType: ScenarioStepLoopTypeEnum.LOOP_COUNT, diff --git a/frontend/src/views/api-test/scenario/components/scenarioModuleTree.vue b/frontend/src/views/api-test/scenario/components/scenarioModuleTree.vue index cf63633bfd..dc8699f072 100644 --- a/frontend/src/views/api-test/scenario/components/scenarioModuleTree.vue +++ b/frontend/src/views/api-test/scenario/components/scenarioModuleTree.vue @@ -446,6 +446,7 @@ }); defineExpose({ refresh, + setActiveFolder, initModuleCount, }); diff --git a/frontend/src/views/api-test/scenario/components/scenarioTable.vue b/frontend/src/views/api-test/scenario/components/scenarioTable.vue index 11bf0a517b..d6a7357e4a 100644 --- a/frontend/src/views/api-test/scenario/components/scenarioTable.vue +++ b/frontend/src/views/api-test/scenario/components/scenarioTable.vue @@ -1,35 +1,27 @@