From 6442bd7641edf938432c3ab611ad81eaad40ea26 Mon Sep 17 00:00:00 2001 From: Jianguo-Genius Date: Wed, 17 Apr 2024 15:39:22 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E5=9C=BA=E6=99=AF=E8=A1=A8=E6=A0=BC=E6=94=AF=E6=8C=81=E6=8B=96?= =?UTF-8?q?=E6=8B=BD=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/modules/api-test/scenario.ts | 15 ++++++++++++++- frontend/src/api/requrls/api-test/scenario.ts | 3 ++- .../scenario/components/scenarioTable.vue | 14 ++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/frontend/src/api/modules/api-test/scenario.ts b/frontend/src/api/modules/api-test/scenario.ts index ced0cc0e66..213f9d36b9 100644 --- a/frontend/src/api/modules/api-test/scenario.ts +++ b/frontend/src/api/modules/api-test/scenario.ts @@ -14,6 +14,7 @@ import { DebugScenarioUrl, DeleteModuleUrl, DeleteScenarioUrl, + dragSortUrl, ExecuteHistoryUrl, ExecuteScenarioUrl, FollowScenarioUrl, @@ -64,7 +65,14 @@ import { ScenarioHistoryPageParams, ScenarioStepResourceInfo, } from '@/models/apiTest/scenario'; -import { AddModuleParams, CommonList, ModuleTreeNode, MoveModules, TransferFileParams } from '@/models/common'; +import { + AddModuleParams, + CommonList, + DragSortParams, + ModuleTreeNode, + MoveModules, + TransferFileParams, +} from '@/models/common'; import { ApiScenarioStatus, ScenarioStepType } from '@/enums/apiEnum'; import type { RequestParam as CaseRequestParam } from '@/views/api-test/components/requestComposition/index.vue'; @@ -278,6 +286,11 @@ export function updateScenarioStatus(id: string | number, status: ApiScenarioSta return MSR.get({ url: `${UpdateScenarioStatusUrl}/${id}/${status}` }); } +// 拖拽排序 +export function dragSort(data: DragSortParams) { + return MSR.post({ url: dragSortUrl, data }); +} + 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 f7c55dc6fb..31e1942e92 100644 --- a/frontend/src/api/requrls/api-test/scenario.ts +++ b/frontend/src/api/requrls/api-test/scenario.ts @@ -27,7 +27,8 @@ 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 dragSortUrl = '/api/scenario/edit/pos'; // 回收站相关 export const GetTrashModuleTreeUrl = '/api/scenario/module/trash/tree'; export const GetTrashModuleCountUrl = '/api/scenario/module/trash/count'; diff --git a/frontend/src/views/api-test/scenario/components/scenarioTable.vue b/frontend/src/views/api-test/scenario/components/scenarioTable.vue index eaabd3da5f..6e7293c821 100644 --- a/frontend/src/views/api-test/scenario/components/scenarioTable.vue +++ b/frontend/src/views/api-test/scenario/components/scenarioTable.vue @@ -28,6 +28,7 @@ v-on="propsEvent" @selected-change="handleTableSelect" @batch-action="handleTableBatch" + @drag-change="changeHandler" @module-change="loadScenarioList(false)" >