diff --git a/frontend/src/api/modules/api-test/scenario.ts b/frontend/src/api/modules/api-test/scenario.ts index e8b1887ea0..ad6414228f 100644 --- a/frontend/src/api/modules/api-test/scenario.ts +++ b/frontend/src/api/modules/api-test/scenario.ts @@ -62,9 +62,10 @@ import { ScenarioDetail, ScenarioHistoryItem, ScenarioHistoryPageParams, + ScenarioStepResourceInfo, } from '@/models/apiTest/scenario'; import { AddModuleParams, CommonList, ModuleTreeNode, MoveModules, TransferFileParams } from '@/models/common'; -import { ApiScenarioStatus } from '@/enums/apiEnum'; +import { ApiScenarioStatus, ScenarioStepType } 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'; @@ -282,6 +283,6 @@ export function updateScenarioPro(id: string | number, priority: CaseLevel | und } // 获取跨项目信息 -export function getStepProjectInfo(id: string | number) { - return MSR.get({ url: GetStepProjectInfoUrl, params: id }); +export function getStepProjectInfo(id: string, type: ScenarioStepType) { + return MSR.get({ url: GetStepProjectInfoUrl, params: id, data: { resourceType: type } }); } diff --git a/frontend/src/api/requrls/api-test/scenario.ts b/frontend/src/api/requrls/api-test/scenario.ts index a37f7fbe29..f7c55dc6fb 100644 --- a/frontend/src/api/requrls/api-test/scenario.ts +++ b/frontend/src/api/requrls/api-test/scenario.ts @@ -19,7 +19,7 @@ export const GetSystemRequestUrl = '/api/scenario/get/system-request'; // 获取 export const FollowScenarioUrl = '/api/scenario/follow'; // 关注/取消关注接口场景 export const ScenarioScheduleConfigUrl = '/api/scenario/schedule-config'; // 场景定时任务 export const ScenarioScheduleConfigDeleteUrl = '/api/scenario/schedule-config-delete'; // 场景定时任务 -export const GetStepProjectInfoUrl = '/api/scenario/step/project-ifo'; // 获取跨项目信息 +export const GetStepProjectInfoUrl = '/api/scenario/step/resource-info'; // 获取跨项目信息 export const BatchRecycleScenarioUrl = '/api/scenario/batch-operation/delete-gc'; // 批量删除接口场景 export const BatchMoveScenarioUrl = '/api/scenario/batch-operation/move'; // 批量移动接口场景 export const BatchCopyScenarioUrl = '/api/scenario/batch-operation/copy'; // 批量复制接口场景 diff --git a/frontend/src/components/business/ms-add-attachment/index.vue b/frontend/src/components/business/ms-add-attachment/index.vue index d8c0c0b86b..91aef83bb9 100644 --- a/frontend/src/components/business/ms-add-attachment/index.vue +++ b/frontend/src/components/business/ms-add-attachment/index.vue @@ -48,7 +48,7 @@ @@ -90,6 +93,7 @@ import MsBaseTable from '@/components/pure/ms-table/base-table.vue'; import { MsTableDataItem } from '@/components/pure/ms-table/type'; import useTable from '@/components/pure/ms-table/useTable'; + import caseLevel from '@/components/business/ms-case-associate/caseLevel.vue'; import { MsTreeNodeData } from '@/components/business/ms-tree/types'; import apiMethodName from '@/views/api-test/components/apiMethodName.vue'; import apiStatus from '@/views/api-test/components/apiStatus.vue'; @@ -475,7 +479,7 @@ case 'scenario': default: routeName = ApiTestRouteEnum.API_TEST_SCENARIO; - query.sId = id; + query.id = id; break; } openNewPage(routeName, query); diff --git a/frontend/src/views/api-test/scenario/components/common/responsePopover.vue b/frontend/src/views/api-test/scenario/components/common/responsePopover.vue index 96c813a784..fefed43fda 100644 --- a/frontend/src/views/api-test/scenario/components/common/responsePopover.vue +++ b/frontend/src/views/api-test/scenario/components/common/responsePopover.vue @@ -98,7 +98,8 @@ step.stepType === ScenarioStepType.LOOP_CONTROLLER && step.config.loopType === ScenarioStepLoopTypeEnum.LOOP_COUNT && step.config.msCountController && - step.config.msCountController.loops > 0 + !Number.isNaN(step.config.msCountController.loops) && + Number(step.config.msCountController.loops) > 0 ) { // 循环控制器展示当前执行次数/总次数 const firstHasResultChild = step.children?.find((child) => { diff --git a/frontend/src/views/api-test/scenario/components/common/scriptOperationDrawer.vue b/frontend/src/views/api-test/scenario/components/common/scriptOperationDrawer.vue index aa72cb3892..90b9cc1714 100644 --- a/frontend/src/views/api-test/scenario/components/common/scriptOperationDrawer.vue +++ b/frontend/src/views/api-test/scenario/components/common/scriptOperationDrawer.vue @@ -19,11 +19,12 @@ v-model="scriptName" :placeholder="t('apiScenario.scriptOperationNamePlaceholder')" :max-length="255" + :disabled="isReadonly" size="small" />
- +
{{ t('apiScenario.executionResult') }}
@@ -88,6 +89,7 @@ const { t } = useI18n(); const visible = defineModel('visible', { required: true }); + const isReadonly = computed(() => props.step?.isQuoteScenarioStep); const currentLoop = ref(1); const currentResponse = computed(() => { if (props.step?.uniqueId) { diff --git a/frontend/src/views/api-test/scenario/components/config.ts b/frontend/src/views/api-test/scenario/components/config.ts index 76822b6bda..7f9a9677a1 100644 --- a/frontend/src/views/api-test/scenario/components/config.ts +++ b/frontend/src/views/api-test/scenario/components/config.ts @@ -16,7 +16,7 @@ export const defaultLoopController = { variable: '', // 变量名 }, msCountController: { - loops: 1, // 循环次数 + loops: '1', // 循环次数 loopTime: 0, // 循环间隔时间 }, whileController: { diff --git a/frontend/src/views/api-test/scenario/components/executeHistory.vue b/frontend/src/views/api-test/scenario/components/executeHistory.vue index e901d0d4c4..f20b5995af 100644 --- a/frontend/src/views/api-test/scenario/components/executeHistory.vue +++ b/frontend/src/views/api-test/scenario/components/executeHistory.vue @@ -10,14 +10,7 @@ @press-enter="loadExecuteHistoryList" />
- + @@ -27,12 +20,12 @@ trigger="click" @popup-visible-change="handleFilterHidden" > - +
{{ t(columnConfig.title as string) }}
-
+ + - +