From a4f567dc31840c9c55cb71bd05d9811d8ec51f1c Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Tue, 2 Apr 2024 17:27:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E5=9C=BA=E6=99=AF=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/modules/api-test/scenario.ts | 14 ++++ frontend/src/api/requrls/api-test/scenario.ts | 2 + .../components/management/api/apiTable.vue | 9 ++- .../components/management/api/index.vue | 21 ++++- .../components/management/case/caseTable.vue | 10 ++- .../components/management/index.vue | 2 +- .../scenario/components/scenarioTable.vue | 77 +++++++++++++++---- .../src/views/api-test/scenario/index.vue | 1 + 8 files changed, 115 insertions(+), 21 deletions(-) diff --git a/frontend/src/api/modules/api-test/scenario.ts b/frontend/src/api/modules/api-test/scenario.ts index c4049a99e7..12ca3b29f7 100644 --- a/frontend/src/api/modules/api-test/scenario.ts +++ b/frontend/src/api/modules/api-test/scenario.ts @@ -1,3 +1,5 @@ +import type { CaseLevel } from '@/components/business/ms-case-associate/types'; + import MSR from '@/api/http/index'; import { AddModuleUrl, @@ -34,6 +36,8 @@ import { ScenarioTrashPageUrl, ScenarioUploadTempFileUrl, UpdateModuleUrl, + UpdateScenarioPriorityUrl, + UpdateScenarioStatusUrl, UpdateScenarioUrl, } from '@/api/requrls/api-test/scenario'; @@ -58,6 +62,7 @@ import { ScenarioHistoryPageParams, } from '@/models/apiTest/scenario'; import { AddModuleParams, CommonList, ModuleTreeNode, MoveModules, TransferFileParams } from '@/models/common'; +import { ApiScenarioStatus } from '@/enums/apiEnum'; import type { RequestParam as CaseRequestParam } from '@/views/api-test/components/requestComposition/index.vue'; import type { RequestParam } from '@/views/api-test/scenario/components/common/customApiDrawer.vue'; @@ -264,3 +269,12 @@ export function getSystemRequest(data: GetSystemRequestParams) { export function followScenario(id: string | number) { return MSR.get({ url: FollowScenarioUrl, params: id }); } + +// 更新场景状态 +export function updateScenarioStatus(id: string | number, status: ApiScenarioStatus | undefined) { + return MSR.get({ url: `${UpdateScenarioStatusUrl}/${id}/${status}` }); +} + +export function updateScenarioPro(id: string | number, priority: CaseLevel | undefined) { + return MSR.get({ url: `${UpdateScenarioPriorityUrl}/${id}/${priority}` }); +} diff --git a/frontend/src/api/requrls/api-test/scenario.ts b/frontend/src/api/requrls/api-test/scenario.ts index c31a1c8983..ae012050ec 100644 --- a/frontend/src/api/requrls/api-test/scenario.ts +++ b/frontend/src/api/requrls/api-test/scenario.ts @@ -24,6 +24,8 @@ export const BatchMoveScenarioUrl = '/api/scenario/batch-operation/move'; // 批 export const BatchCopyScenarioUrl = '/api/scenario/batch-operation/copy'; // 批量复制接口场景 export const BatchEditScenarioUrl = '/api/scenario/batch-operation/edit'; // 批量编辑接口场景 export const BatchRunScenarioUrl = '/api/scenario/batch-operation/run'; // 批量执行接口场景 +export const UpdateScenarioPriorityUrl = '/api/scenario/update-priority'; // 场景更新等级 +export const UpdateScenarioStatusUrl = '/api/scenario/update-status'; // 场景更新状态 // 回收站相关 export const GetTrashModuleTreeUrl = '/api/scenario/module/trash/tree'; diff --git a/frontend/src/views/api-test/management/components/management/api/apiTable.vue b/frontend/src/views/api-test/management/components/management/api/apiTable.vue index 99f4c3c487..9fa1a54991 100644 --- a/frontend/src/views/api-test/management/components/management/api/apiTable.vue +++ b/frontend/src/views/api-test/management/components/management/api/apiTable.vue @@ -368,6 +368,7 @@ 'PROJECT_API_DEFINITION:READ+DELETE', 'PROJECT_API_DEFINITION:READ+ADD', 'PROJECT_API_DEFINITION:READ+EXECUTE', + 'PROJECT_API_DEFINITION:READ+UPDATE', ]) ); let columns: MsTableColumn = [ @@ -465,9 +466,13 @@ scroll: { x: '100%' }, tableKey: props.readOnly ? undefined : TableKeyEnum.API_TEST, showSetting: !props.readOnly, - selectable: true, + selectable: hasAnyPermission([ + 'PROJECT_API_DEFINITION:READ+DELETE', + 'PROJECT_API_DEFINITION:READ+EXECUTE', + 'PROJECT_API_DEFINITION:READ+UPDATE', + ]), showSelectAll: !props.readOnly, - draggable: props.readOnly ? undefined : { type: 'handle', width: 32 }, + draggable: hasAnyPermission(['PROJECT_API_DEFINITION:READ+UPDATE']) ? { type: 'handle', width: 32 } : undefined, heightUsed: 308, showSubdirectory: true, }, diff --git a/frontend/src/views/api-test/management/components/management/api/index.vue b/frontend/src/views/api-test/management/components/management/api/index.vue index 023dbbc39f..a2bbfbedd0 100644 --- a/frontend/src/views/api-test/management/components/management/api/index.vue +++ b/frontend/src/views/api-test/management/components/management/api/index.vue @@ -30,7 +30,11 @@ > {{ t('apiTestManagement.execute') }} - + {{ t('common.edit') }} +