From 8914f05c9391078254347c1ec44106d9f88b6879 Mon Sep 17 00:00:00 2001 From: baiqi Date: Thu, 14 Nov 2024 16:51:30 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E4=BB=BB=E5=8A=A1=E4=B8=AD=E5=BF=83):=20?= =?UTF-8?q?=E9=87=8D=E8=B7=91&=E6=8E=A5=E5=8F=A3=E7=94=A8=E4=BE=8B/?= =?UTF-8?q?=E5=9C=BA=E6=99=AF/=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E5=8E=86=E5=8F=B2=E7=9A=84=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/modules/api-test/management.ts | 4 +- .../api/modules/taskCenter/organization.ts | 6 + .../src/api/modules/taskCenter/project.ts | 6 + frontend/src/api/modules/taskCenter/system.ts | 6 + frontend/src/api/requrls/taskCenter.ts | 3 + frontend/src/models/apiTest/management.ts | 13 - frontend/src/models/apiTest/scenario.ts | 9 +- frontend/src/models/taskCenter.ts | 6 +- .../case/tabContent/tabCaseExecuteHistory.vue | 41 +- .../scenario/components/executeHistory.vue | 18 +- .../components/index/reviewTable.vue | 7 + .../component/caseExecuteResultDrawer.vue | 22 +- .../component/caseTaskDetailTable.vue | 36 +- .../taskCenter/component/caseTaskTable.vue | 56 +-- .../component/scenarioExecuteResultDrawer.vue | 23 +- .../component}/reportDrawer.vue | 0 .../system-card/reportDetailTable.vue | 2 +- .../testPlan/detail/executeHistory/index.vue | 14 +- .../testPlan/detail/executeResultDrawer.vue | 352 ++++++++++++++++++ 19 files changed, 510 insertions(+), 114 deletions(-) rename frontend/src/views/test-plan/{testPlan/detail => report/component}/reportDrawer.vue (100%) create mode 100644 frontend/src/views/test-plan/testPlan/detail/executeResultDrawer.vue diff --git a/frontend/src/api/modules/api-test/management.ts b/frontend/src/api/modules/api-test/management.ts index 493a1cb713..e8a892e46b 100644 --- a/frontend/src/api/modules/api-test/management.ts +++ b/frontend/src/api/modules/api-test/management.ts @@ -122,7 +122,6 @@ import { ApiCaseChangeHistoryParams, ApiCaseDependencyParams, ApiCaseDetail, - ApiCaseExecuteHistoryItem, ApiCaseExecuteHistoryParams, ApiCasePageParams, type ApiCaseStatisticsItem, @@ -158,6 +157,7 @@ import { UpdateScheduleParams, } from '@/models/apiTest/management'; import type { BatchEditMockParams, MockDetail, MockParams, UpdateMockParams } from '@/models/apiTest/mock'; +import type { ExecuteHistoryItem } from '@/models/apiTest/scenario'; import type { AddModuleParams, BatchApiParams, @@ -605,7 +605,7 @@ export function batchExecuteCase(data: ApiCaseBatchExecuteParams) { // 获取接口用例-执行历史 export function getApiCaseExecuteHistory(data: ApiCaseExecuteHistoryParams) { - return MSR.post>({ url: GetExecuteHistoryUrl, data }); + return MSR.post>({ url: GetExecuteHistoryUrl, data }); } // 获取接口用例-变更历史 diff --git a/frontend/src/api/modules/taskCenter/organization.ts b/frontend/src/api/modules/taskCenter/organization.ts index b393a60806..7bd7794cec 100644 --- a/frontend/src/api/modules/taskCenter/organization.ts +++ b/frontend/src/api/modules/taskCenter/organization.ts @@ -19,6 +19,7 @@ import { organizationStopTaskUrl, organizationTaskCenterResourcePoolsUrl, organizationTaskOrderUrl, + organizationTaskRerunUrl, } from '@/api/requrls/taskCenter'; import type { CommonList, TableQueryParams } from '@/models/common'; @@ -127,3 +128,8 @@ export function organizationBatchTaskReportList(data: TaskCenterBatchParams) { export function organizationProjectOptions() { return MSR.get({ url: organizationProjectOptionsUrl }); } + +// 组织任务-重跑 +export function organizationTaskRerun(id: string) { + return MSR.get({ url: `${organizationTaskRerunUrl}/${id}` }); +} diff --git a/frontend/src/api/modules/taskCenter/project.ts b/frontend/src/api/modules/taskCenter/project.ts index 03d6118311..f14456823a 100644 --- a/frontend/src/api/modules/taskCenter/project.ts +++ b/frontend/src/api/modules/taskCenter/project.ts @@ -18,6 +18,7 @@ import { projectStopTaskUrl, projectTaskCenterResourcePoolsUrl, projectTaskOrderUrl, + projectTaskRerunUrl, scheduleProCenterListUrl, } from '@/api/requrls/taskCenter'; @@ -127,3 +128,8 @@ export function projectEditCron(cron: string, id: string) { export function projectBatchTaskReportList(data: TaskCenterBatchParams) { return MSR.post>({ url: projectBatchTaskReportUrl, data }); } + +// 项目任务-重跑 +export function projectTaskRerun(id: string) { + return MSR.get({ url: `${projectTaskRerunUrl}/${id}` }); +} diff --git a/frontend/src/api/modules/taskCenter/system.ts b/frontend/src/api/modules/taskCenter/system.ts index 8da5ab69c4..9383d45291 100644 --- a/frontend/src/api/modules/taskCenter/system.ts +++ b/frontend/src/api/modules/taskCenter/system.ts @@ -21,6 +21,7 @@ import { systemStopTaskUrl, systemTaskCenterResourcePoolsUrl, systemTaskOrderUrl, + systemTaskRerunUrl, } from '@/api/requrls/taskCenter'; import type { CommonList, TableQueryParams } from '@/models/common'; @@ -141,3 +142,8 @@ export function systemOrgOptions() { export function systemProjectOptions() { return MSR.get({ url: systemProjectOptionsUrl }); } + +// 系统任务-重跑 +export function systemTaskRerun(id: string) { + return MSR.get({ url: `${systemTaskRerunUrl}/${id}` }); +} diff --git a/frontend/src/api/requrls/taskCenter.ts b/frontend/src/api/requrls/taskCenter.ts index f95e080208..02e83ebb84 100644 --- a/frontend/src/api/requrls/taskCenter.ts +++ b/frontend/src/api/requrls/taskCenter.ts @@ -17,6 +17,7 @@ export const projectBatchOpenTaskUrl = '/project/task-center/schedule/batch-enab export const projectBatchCloseTaskUrl = '/project/task-center/schedule/batch-disable'; // 项目-任务中心-系统后台任务-批量关闭任务 export const projectEditCronUrl = '/project/task-center/schedule/update-cron'; // 项目-任务中心-系统后台任务-编辑 cron 表达式 export const projectBatchTaskReportUrl = '/project/task-center/exec-task/batch/page'; // 项目-任务中心-批量任务报告列表 +export const projectTaskRerunUrl = '/project/task-center/exec-task/rerun'; // 项目-任务中心-重跑 export const systemScheduleListUrl = '/system/task-center/schedule/page'; // 系统任务-系统后台任务列表 export const systemExecuteTaskListUrl = '/system/task-center/exec-task/page'; // 系统任务-执行任务列表 @@ -39,6 +40,7 @@ export const systemEditCronUrl = '/system/task-center/schedule/update-cron'; // export const systemBatchTaskReportUrl = '/system/task-center/exec-task/batch/page'; // 系统任务-批量任务报告列表 export const systemProjectOptionsUrl = '/system/task-center/project/options'; // 系统任务-项目列表 export const systemOrgOptionsUrl = '/system/task-center/organization/options'; // 系统任务-组织列表 +export const systemTaskRerunUrl = '/system/task-center/exec-task/rerun'; // 系统任务-任务中心-重跑 export const organizationScheduleListUrl = '/organization/task-center/schedule/page'; // 组织任务-系统后台任务列表 export const organizationExecuteTaskListUrl = '/organization/task-center/exec-task/page'; // 组织任务-执行任务列表 @@ -59,3 +61,4 @@ export const organizationBatchCloseTaskUrl = '/organization/task-center/schedule export const organizationEditCronUrl = '/organization/task-center/schedule/update-cron'; // 组织任务-系统后台任务-编辑 cron 表达式 export const organizationBatchTaskReportUrl = '/organization/task-center/exec-task/batch/page'; // 组织任务-批量任务报告列表 export const organizationProjectOptionsUrl = '/organization/task-center/project/options'; // 组织任务-项目列表 +export const organizationTaskRerunUrl = '/organization/task-center/exec-task/rerun'; // 组织任务-任务中心-重跑 diff --git a/frontend/src/models/apiTest/management.ts b/frontend/src/models/apiTest/management.ts index f2bf13268e..8e4051027e 100644 --- a/frontend/src/models/apiTest/management.ts +++ b/frontend/src/models/apiTest/management.ts @@ -404,19 +404,6 @@ export interface ApiCaseChangeHistoryParams extends TableQueryParams { export interface ApiCaseDependencyParams extends TableQueryParams { resourceId: string; } - -// 用例-执行历史-请求参数 -export interface ApiCaseExecuteHistoryItem { - id: string; - num: string; - name: string; - operationUser: string; - createUser: string; - startTime: number; - status: RequestCaseStatus; - triggerMode: string; - deleted: boolean; -} export interface syncItem { header: boolean; body: boolean; diff --git a/frontend/src/models/apiTest/scenario.ts b/frontend/src/models/apiTest/scenario.ts index cee3b93fed..135a89b43d 100644 --- a/frontend/src/models/apiTest/scenario.ts +++ b/frontend/src/models/apiTest/scenario.ts @@ -18,6 +18,7 @@ import { ScenarioStepType, WhileConditionType, } from '@/enums/apiEnum'; +import type { ExecuteResultEnum, ExecuteStatusEnum } from '@/enums/taskCenter'; import { BatchApiParams, TableQueryParams } from '../common'; import { @@ -193,8 +194,14 @@ export interface ExecuteHistoryItem { operationUser: string; createUser: string; startTime: number; - status: string; + status: ExecuteResultEnum; triggerMode: string; + execStatus: ExecuteStatusEnum; + deleted: boolean; + historyDeleted: boolean; + integrated: boolean; + testPlanId?: string; + testPlanNum?: string; } // 场景-变更历史列表查询参数 diff --git a/frontend/src/models/taskCenter.ts b/frontend/src/models/taskCenter.ts index 8344e2386d..4a92c68895 100644 --- a/frontend/src/models/taskCenter.ts +++ b/frontend/src/models/taskCenter.ts @@ -1,4 +1,4 @@ -import type { ExecuteStatusEnum, ExecuteTaskType, ExecuteTriggerMode } from '@/enums/taskCenter'; +import type { ExecuteResultEnum, ExecuteStatusEnum, ExecuteTaskType, ExecuteTriggerMode } from '@/enums/taskCenter'; import type { TableQueryParams } from './common'; @@ -37,7 +37,7 @@ export interface TaskCenterTaskItem { taskName: string; status: string; // 执行状态 caseCount: number; - result: string; // 执行结果 + result: ExecuteResultEnum; // 执行结果 taskType: ExecuteTaskType; // 任务类型 resourceId: string; triggerMode: ExecuteTriggerMode; // 执行方式 @@ -61,7 +61,7 @@ export interface TaskCenterTaskDetailItem { resourceName: string; taskOrigin: string; // 任务来源 status: ExecuteStatusEnum; // 执行状态 - result: string; // 执行结果 + result: ExecuteResultEnum; // 执行结果 resourcePoolId: string; // 资源池ID resourcePoolNode: string; // 资源池节点 resourceType: string; // 资源类型 diff --git a/frontend/src/views/api-test/management/components/management/case/tabContent/tabCaseExecuteHistory.vue b/frontend/src/views/api-test/management/components/management/case/tabContent/tabCaseExecuteHistory.vue index 88dc30f30c..c8598dc0e2 100644 --- a/frontend/src/views/api-test/management/components/management/case/tabContent/tabCaseExecuteHistory.vue +++ b/frontend/src/views/api-test/management/components/management/case/tabContent/tabCaseExecuteHistory.vue @@ -63,7 +63,15 @@ - + + +