diff --git a/frontend/src/api/modules/project-management/envManagement.ts b/frontend/src/api/modules/project-management/envManagement.ts index 4e8fcc12c6..8c91b6b17f 100644 --- a/frontend/src/api/modules/project-management/envManagement.ts +++ b/frontend/src/api/modules/project-management/envManagement.ts @@ -37,7 +37,7 @@ export function exportEnv(selectIds: string[]) { { isTransformResponse: false } ); } -export function editPosEnv(data: EnvListItem) { +export function editPosEnv(data: DragParam) { return MSR.post({ url: envURL.editPosEnvUrl, data }); } diff --git a/frontend/src/components/business/ms-assertion/comp/ResponseBodyTab.vue b/frontend/src/components/business/ms-assertion/comp/ResponseBodyTab.vue index b0935fb457..7c92e595ed 100644 --- a/frontend/src/components/business/ms-assertion/comp/ResponseBodyTab.vue +++ b/frontend/src/components/business/ms-assertion/comp/ResponseBodyTab.vue @@ -303,13 +303,7 @@
- +
@@ -362,25 +356,16 @@ (e: 'update:data', data: ExecuteConditionProcessor): void; (e: 'copy'): void; (e: 'delete', id: number): void; - (e: 'change'): void; + (e: 'change', param: Param): void; }>(); const { t } = useI18n(); const rootId = 0; // 1970-01-01 00:00:00 UTC - // const innerParams = defineModel('modelValue', { - // default: { - // jsonPath: [], - // xPath: { responseFormat: 'XML', data: [] }, - // script: { - // id: new Date().getTime(), - // processorType: RequestConditionProcessor.SCRIPT, - // scriptName: '断言脚本名称', - // enableCommonScript: false, - // params: [], - // }, - // }, - // }); - const innerParams = ref({ + const props = defineProps<{ + value: Param; + }>(); + + const defaultParamItem = { jsonPath: [], xPath: { responseFormat: 'XML', data: [] }, document: { @@ -408,6 +393,11 @@ scriptLanguage: RequestConditionScriptLanguage.JAVASCRIPT, script: new Date().getTime().toString(), }, + }; + + const innerParams = ref(props.value || defaultParamItem); + watchEffect(() => { + emit('change', innerParams.value); }); const activeTab = ref('document'); const extractParamsTableRef = ref>(); @@ -764,4 +754,7 @@ } } }; + const handleScriptChange = (data: ExecuteConditionProcessor) => { + innerParams.value.script = data; + }; diff --git a/frontend/src/components/business/ms-assertion/comp/ResponseHeaderTab.vue b/frontend/src/components/business/ms-assertion/comp/ResponseHeaderTab.vue index e8cf598796..ac883c229c 100644 --- a/frontend/src/components/business/ms-assertion/comp/ResponseHeaderTab.vue +++ b/frontend/src/components/business/ms-assertion/comp/ResponseHeaderTab.vue @@ -24,7 +24,7 @@ const innerParams = defineModel('modelValue', { default: [] }); const emit = defineEmits<{ - (e: 'change'): void; // 数据发生变化 + (e: 'change', val: any[]): void; // 数据发生变化 }>(); const defaultParamItem = { @@ -85,7 +85,7 @@ function handleParamTableChange(resultArr: any[], isInit?: boolean) { innerParams.value = [...resultArr]; if (!isInit) { - emit('change'); + emit('change', resultArr); } } diff --git a/frontend/src/components/business/ms-assertion/comp/ResponseTimeTab.vue b/frontend/src/components/business/ms-assertion/comp/ResponseTimeTab.vue index e694abfec2..d086b08541 100644 --- a/frontend/src/components/business/ms-assertion/comp/ResponseTimeTab.vue +++ b/frontend/src/components/business/ms-assertion/comp/ResponseTimeTab.vue @@ -4,18 +4,28 @@ {{ t('ms.assertion.responseTime') }} (ms) - + - diff --git a/frontend/src/components/business/ms-assertion/comp/ScriptTab.vue b/frontend/src/components/business/ms-assertion/comp/ScriptTab.vue index a3c8927675..43c7d1b488 100644 --- a/frontend/src/components/business/ms-assertion/comp/ScriptTab.vue +++ b/frontend/src/components/business/ms-assertion/comp/ScriptTab.vue @@ -1,246 +1,41 @@ diff --git a/frontend/src/components/business/ms-assertion/comp/StatusCodeTab.vue b/frontend/src/components/business/ms-assertion/comp/StatusCodeTab.vue index 9358a26a6d..f3e857afb2 100644 --- a/frontend/src/components/business/ms-assertion/comp/StatusCodeTab.vue +++ b/frontend/src/components/business/ms-assertion/comp/StatusCodeTab.vue @@ -2,28 +2,60 @@
{{ t('ms.assertion.statusCode') }}
- + {{ t(item.label) }}
- +
diff --git a/frontend/src/components/business/ms-assertion/comp/VariableTab.vue b/frontend/src/components/business/ms-assertion/comp/VariableTab.vue index d03b1d68c2..bb0a710c5e 100644 --- a/frontend/src/components/business/ms-assertion/comp/VariableTab.vue +++ b/frontend/src/components/business/ms-assertion/comp/VariableTab.vue @@ -1,19 +1,15 @@ diff --git a/frontend/src/views/project-management/environmental/components/envParams/AssertTab.vue b/frontend/src/views/project-management/environmental/components/envParams/AssertTab.vue index 6cce79493c..8bd6324d1a 100644 --- a/frontend/src/views/project-management/environmental/components/envParams/AssertTab.vue +++ b/frontend/src/views/project-management/environmental/components/envParams/AssertTab.vue @@ -4,16 +4,17 @@ diff --git a/frontend/src/views/project-management/environmental/index.vue b/frontend/src/views/project-management/environmental/index.vue index ac2c3246b6..d0a853a8ee 100644 --- a/frontend/src/views/project-management/environmental/index.vue +++ b/frontend/src/views/project-management/environmental/index.vue @@ -55,7 +55,12 @@
- +
{ + const handleEnvGroupPosChange = async (event: SortableEvent, type: EnvAuthTypeEnum) => { try { const { oldIndex, newIndex } = event; if (oldIndex === newIndex) { @@ -394,7 +400,11 @@ moveId: evnGroupList.value[_newIndex].id, moveMode: _oldIndex > _newIndex ? 'BEFORE' : 'AFTER', }; - await groupEditPosEnv(params); + if (type === EnvAuthTypeEnum.ENVIRONMENT) { + await editPosEnv(params); + } else if (type === EnvAuthTypeEnum.ENVIRONMENT_GROUP) { + await groupEditPosEnv(params); + } } catch (e) { // eslint-disable-next-line no-console console.error(e);