From 1f1b43f10864c3096e74884c663aa6b788838e01 Mon Sep 17 00:00:00 2001 From: teukkk Date: Fri, 15 Mar 2024 17:53:38 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8E=A5=E5=8F=A3=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=94=A8=E4=BE=8B&=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/modules/api-test/management.ts | 48 +++- .../src/api/requrls/api-test/management.ts | 8 +- .../components/pure/ms-detail-card/index.vue | 2 +- frontend/src/models/apiTest/management.ts | 6 +- .../components/requestComposition/index.vue | 65 ++++-- .../components/environmentSelect.vue | 88 +++++++ .../components/management/api/index.vue | 7 + .../management/api/preview/index.vue | 120 ++++++---- .../components/management/case/caseDetail.vue | 45 ++++ .../components/management/case/caseTable.vue | 83 +++++-- .../case/createAndEditCaseDrawer.vue | 218 ++++++++++++++++++ .../components/management/case/index.vue | 140 ++++++++++- .../components/management/index.vue | 8 +- .../views/api-test/management/locale/en-US.ts | 2 + .../views/api-test/management/locale/zh-CN.ts | 2 + 15 files changed, 740 insertions(+), 102 deletions(-) create mode 100644 frontend/src/views/api-test/management/components/environmentSelect.vue create mode 100644 frontend/src/views/api-test/management/components/management/case/caseDetail.vue create mode 100644 frontend/src/views/api-test/management/components/management/case/createAndEditCaseDrawer.vue diff --git a/frontend/src/api/modules/api-test/management.ts b/frontend/src/api/modules/api-test/management.ts index 25a7af5848..0d37c2f494 100644 --- a/frontend/src/api/modules/api-test/management.ts +++ b/frontend/src/api/modules/api-test/management.ts @@ -16,6 +16,7 @@ import { BatchUpdateDefinitionUrl, CasePageUrl, CheckDefinitionScheduleUrl, + DebugCaseUrl, DebugDefinitionUrl, DefinitionMockPageUrl, DefinitionPageUrl, @@ -28,6 +29,7 @@ import { DeleteRecycleApiUrl, DeleteRecycleCaseUrl, ExecuteCaseUrl, + GetCaseDetailUrl, GetChangeHistoryUrl, GetDefinitionDetailUrl, GetDefinitionScheduleUrl, @@ -52,14 +54,18 @@ import { SortDefinitionUrl, SwitchDefinitionScheduleUrl, ToggleFollowDefinitionUrl, + TransferFileCaseUrl, + TransferFileModuleOptionCaseUrl, TransferFileModuleOptionUrl, TransferFileUrl, UpdateCasePriorityUrl, UpdateCaseStatusUrl, + UpdateCaseUrl, UpdateDefinitionScheduleUrl, UpdateDefinitionUrl, UpdateMockStatusUrl, UpdateModuleUrl, + UploadTempFileCaseUrl, UploadTempFileUrl, } from '@/api/requrls/api-test/management'; @@ -68,8 +74,11 @@ import { AddApiCaseParams, ApiCaseBatchEditParams, ApiCaseBatchExecuteParams, - ApiCaseBatchParams, ApiCaseChangeHistoryParams, ApiCaseDependencyParams, - ApiCaseDetail, ApiCaseExecuteHistoryParams, + ApiCaseBatchParams, + ApiCaseChangeHistoryParams, + ApiCaseDependencyParams, + ApiCaseDetail, + ApiCaseExecuteHistoryParams, ApiCasePageParams, ApiDefinitionBatchDeleteParams, ApiDefinitionBatchMoveParams, @@ -102,7 +111,8 @@ import { CommonList, DragSortParams, ModuleTreeNode, - MoveModules, TableQueryParams, + MoveModules, + TableQueryParams, TransferFileParams, } from '@/models/common'; @@ -358,6 +368,36 @@ export function dragSort(data: DragSortParams) { return MSR.post({ url: SortCaseUrl, data }); } +// 更新接口用例 +export function updateCase(data: AddApiCaseParams) { + return MSR.post({ url: UpdateCaseUrl, data }); +} + +// 接口用例调试 +export function debugCase(data: ExecuteRequestParams) { + return MSR.post({ url: DebugCaseUrl, data }); +} + +// 文件转存 +export function transferFileCase(data: TransferFileParams) { + return MSR.post({ url: TransferFileCaseUrl, data }); +} + +// 文件转存目录 +export function getTransferOptionsCase(projectId: string) { + return MSR.get({ url: TransferFileModuleOptionCaseUrl, params: projectId }); +} + +// 上传文件 +export function uploadTempFileCase(file: File) { + return MSR.uploadFile({ url: UploadTempFileCaseUrl }, { fileList: [file] }, 'file'); +} + +// 获取接口用例详情 +export function getCaseDetail(id: string) { + return MSR.get({ url: GetCaseDetailUrl, params: id }); +} + /** * 接口用例回收站 */ @@ -419,4 +459,4 @@ export function getApiCaseChangeHistory(data: ApiCaseChangeHistoryParams) { // 获取接口用例-依赖关系 export function getApiCaseDependency(data: ApiCaseDependencyParams) { return MSR.post({ url: GetDependencyUrl, data }); -} \ No newline at end of file +} diff --git a/frontend/src/api/requrls/api-test/management.ts b/frontend/src/api/requrls/api-test/management.ts index a5972a1f1f..1bd53cb892 100644 --- a/frontend/src/api/requrls/api-test/management.ts +++ b/frontend/src/api/requrls/api-test/management.ts @@ -55,12 +55,18 @@ export const GetTrashModuleCountUrl = '/api/definition/module/trash/count'; // // --------------------用例 export const CasePageUrl = '/api/case/page'; // 接口用例列表 +export const UpdateCaseUrl = '/api/case/update'; // 接口用例更新 export const UpdateCaseStatusUrl = '/api/case/update-status'; // 接口用例更新状态 export const UpdateCasePriorityUrl = '/api/case/update-priority'; // 接口用例更新等级 export const DeleteCaseUrl = '/api/case/delete-to-gc'; // 删除接口用例 export const BatchDeleteCaseUrl = '/api/case/batch/delete-to-gc'; // 批量删除接口用例 export const BatchEditCaseUrl = '/api/case/batch/edit'; // 批量编辑接口用例 export const SortCaseUrl = '/api/case/edit/pos'; // 接口用例拖拽 +export const DebugCaseUrl = '/api/case/debug'; // 接口用例调试 +export const TransferFileCaseUrl = '/api/case/transfer'; // 文件转存 +export const TransferFileModuleOptionCaseUrl = '/api/case/transfer/options'; // 文件转存目录 +export const UploadTempFileCaseUrl = '/api/case/upload/temp/file'; // 临时文件上传 +export const GetCaseDetailUrl = '/api/case/get-detail'; // 获取接口用例详情 export const GetEnvListUrl = '/api/test/env-list'; // 接口测试-环境列表 export const BatchExecuteCaseUrl = '/api/case/batch/run'; // 批量执行接口用例 export const ExecuteCaseUrl = '/api/case/run/'; // 单独执行接口用例 @@ -68,8 +74,6 @@ export const GetExecuteHistoryUrl = 'api/case/execute/page'; // 获取用的执 export const GetDependencyUrl = '/api/case/get-reference'; // 获取用例的依赖关系 export const GetChangeHistoryUrl = '/api/case/operation-history/page'; // 获取用例的依赖关系 - - /** * 接口用例回收站 */ diff --git a/frontend/src/components/pure/ms-detail-card/index.vue b/frontend/src/components/pure/ms-detail-card/index.vue index 10c0625204..6c70380243 100644 --- a/frontend/src/components/pure/ms-detail-card/index.vue +++ b/frontend/src/components/pure/ms-detail-card/index.vue @@ -1,6 +1,6 @@
-
+
@@ -95,8 +96,8 @@ v-if=" props.isDefinition && (requestVModel.isNew - ? hasAnyPermission([props.permissionMap.create]) - : hasAnyPermission([props.permissionMap.update])) + ? props.permissionMap && hasAnyPermission([props.permissionMap.create]) + : props.permissionMap && hasAnyPermission([props.permissionMap.update])) " > @@ -122,8 +123,8 @@
-
+
-
+
@@ -286,7 +287,7 @@ -