From 5fb9b926e4c46f85af7f4f847ffecd23d405c9c7 Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Fri, 15 Mar 2024 14:55:37 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=9C=BA=E6=99=AF=E5=8F=98=E6=9B=B4=E5=8E=86?= =?UTF-8?q?=E5=8F=B2tab&=E6=89=A7=E8=A1=8C=E5=8E=86=E5=8F=B2tab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/modules/api-test/scenario.ts | 16 ++ frontend/src/api/requrls/api-test/scenario.ts | 3 + frontend/src/enums/apiEnum.ts | 11 + frontend/src/models/apiTest/scenario.ts | 40 ++++ .../scenario/components/changeHistory.vue | 93 +++++++- .../scenario/components/executeHistory.vue | 221 +++++++++++++++++- .../scenario/components/executeStatus.vue | 68 ++++++ .../views/api-test/scenario/detail/index.vue | 7 +- .../views/api-test/scenario/locale/en-US.ts | 22 ++ .../views/api-test/scenario/locale/zh-CN.ts | 21 ++ 10 files changed, 496 insertions(+), 6 deletions(-) create mode 100644 frontend/src/views/api-test/scenario/components/executeStatus.vue diff --git a/frontend/src/api/modules/api-test/scenario.ts b/frontend/src/api/modules/api-test/scenario.ts index bd45a21c00..b0bb8df65b 100644 --- a/frontend/src/api/modules/api-test/scenario.ts +++ b/frontend/src/api/modules/api-test/scenario.ts @@ -6,10 +6,12 @@ import { BatchMoveScenarioUrl, BatchRecycleScenarioUrl, DeleteModuleUrl, + ExecuteHistoryUrl, GetModuleCountUrl, GetModuleTreeUrl, MoveModuleUrl, RecycleScenarioUrl, + ScenarioHistoryUrl, ScenarioPageUrl, UpdateModuleUrl, UpdateScenarioUrl, @@ -23,6 +25,10 @@ import { ApiScenarioModuleUpdateParams, ApiScenarioPageParams, ApiScenarioUpdateDTO, + ExecuteHistoryItem, + ExecutePageParams, + ScenarioHistoryItem, + ScenarioHistoryPageParams, } from '@/models/apiTest/scenario'; import { AddModuleParams, CommonList, ModuleTreeNode, MoveModules } from '@/models/common'; @@ -101,3 +107,13 @@ export function batchOptionScenario( export function batchEditScenario(params: ApiScenarioBatchEditParams) { return MSR.post({ url: BatchEditScenarioUrl, params }); } + +// 场景执行历史接口 +export function getExecuteHistory(data: ExecutePageParams) { + return MSR.post>({ url: ExecuteHistoryUrl, data }); +} + +// 场景变更历史接口 +export function getScenarioHistory(data: ScenarioHistoryPageParams) { + return MSR.post>({ url: ScenarioHistoryUrl, data }); +} diff --git a/frontend/src/api/requrls/api-test/scenario.ts b/frontend/src/api/requrls/api-test/scenario.ts index ed8a8bed4b..ba0cd88f71 100644 --- a/frontend/src/api/requrls/api-test/scenario.ts +++ b/frontend/src/api/requrls/api-test/scenario.ts @@ -33,3 +33,6 @@ export const BatchEditScenarioUrl = '/api/scenario/batch-operation/edit'; // 批 // export const GetDefinitionScheduleUrl = '/api/scenario/schedule/get'; // 接口场景-定时同步-查询 // export const DeleteDefinitionScheduleUrl = '/api/scenario/schedule/delete'; // 接口场景-定时同步-删除 // export const DebugDefinitionUrl = '/api/scenario/debug'; // 接口场景-调试 + +export const ExecuteHistoryUrl = '/api/scenario/execute/page'; // 场景执行历史 +export const ScenarioHistoryUrl = '/api/scenario/operation-history/page'; // 场景变更历史 diff --git a/frontend/src/enums/apiEnum.ts b/frontend/src/enums/apiEnum.ts index 09daa3bbba..5698cfd47e 100644 --- a/frontend/src/enums/apiEnum.ts +++ b/frontend/src/enums/apiEnum.ts @@ -267,3 +267,14 @@ export enum ScenarioAddStepActionType { SCRIPT_OPERATION = 'SCRIPT_OPERATION', WAIT_TIME = 'WAIT_TIME', } + +// 接口场景-执行结果状态 +export enum ExecuteStatusFilters { + PENDING = 'PENDING', + RUNNING = 'RUNNING', + RERUNNING = 'RERUNNING', + ERROR = 'ERROR', + SUCCESS = 'SUCCESS', + FAKE_ERROR = 'FAKE_ERROR', + STOPPED = 'STOPPED', +} diff --git a/frontend/src/models/apiTest/scenario.ts b/frontend/src/models/apiTest/scenario.ts index 7835595461..61fe301428 100644 --- a/frontend/src/models/apiTest/scenario.ts +++ b/frontend/src/models/apiTest/scenario.ts @@ -131,3 +131,43 @@ export interface ApiScenarioBatchEditParams extends BatchOptionParams { export interface ApiScenarioBatchDeleteParams extends BatchApiParams { deleteAll: boolean; } + +// 场景-执行历史-请求参数 +export interface ExecutePageParams extends TableQueryParams { + id: string; +} + +// 场景-执行历史-请求参数 +export interface ExecuteHistoryItem { + id: string; + num: string; + name: string; + operationUser: string; + createUser: string; + startTime: number; + status: string; + triggerMode: string; +} + +// 场景-变更历史列表查询参数 +export interface ScenarioHistoryPageParams extends TableQueryParams { + projectId: string; + sourceId: string; + createUser: string; + types: string[]; + modules: string[]; +} + +// 场景-变更历史列表项 +export interface ScenarioHistoryItem { + id: number; + projectId: string; + createTime: number; + createUser: string; + sourceId: string; + type: string; + module: string; + refId: number; + createUserName: string; + versionName: string; +} diff --git a/frontend/src/views/api-test/scenario/components/changeHistory.vue b/frontend/src/views/api-test/scenario/components/changeHistory.vue index 208d5d487d..90a1c03b27 100644 --- a/frontend/src/views/api-test/scenario/components/changeHistory.vue +++ b/frontend/src/views/api-test/scenario/components/changeHistory.vue @@ -1,7 +1,96 @@ - + diff --git a/frontend/src/views/api-test/scenario/components/executeHistory.vue b/frontend/src/views/api-test/scenario/components/executeHistory.vue index 514abb1fda..2dd9467062 100644 --- a/frontend/src/views/api-test/scenario/components/executeHistory.vue +++ b/frontend/src/views/api-test/scenario/components/executeHistory.vue @@ -1,7 +1,224 @@ - + diff --git a/frontend/src/views/api-test/scenario/components/executeStatus.vue b/frontend/src/views/api-test/scenario/components/executeStatus.vue new file mode 100644 index 0000000000..b14816d134 --- /dev/null +++ b/frontend/src/views/api-test/scenario/components/executeStatus.vue @@ -0,0 +1,68 @@ + + + + + diff --git a/frontend/src/views/api-test/scenario/detail/index.vue b/frontend/src/views/api-test/scenario/detail/index.vue index 7bf36f98bd..61a3b64e76 100644 --- a/frontend/src/views/api-test/scenario/detail/index.vue +++ b/frontend/src/views/api-test/scenario/detail/index.vue @@ -72,14 +72,17 @@ :title="t('apiScenario.executeHistory')" class="px-[24px] py-[16px]" > - + - +