diff --git a/frontend/src/views/api-test/components/paramTable.vue b/frontend/src/views/api-test/components/paramTable.vue index 2d8fd709ac..e4aa8b6b37 100644 --- a/frontend/src/views/api-test/components/paramTable.vue +++ b/frontend/src/views/api-test/components/paramTable.vue @@ -841,15 +841,7 @@ } return item; }); - const lastTwoIsSame = - (arr.length === 1 && !hasNoIdItem) || - (arr.length >= 2 && filterKeyValParams([arr[arr.length - 2]], arr[arr.length - 1]).lastDataIsDefault); - if ( - hasNoIdItem && - !filterKeyValParams(arr, props.defaultParamItem).lastDataIsDefault && - !props.isTreeTable && - !lastTwoIsSame // 为了判断最后俩行是否一致(因为下拉框切换会新增一行一样的数据,此时最后一条数据与默认数据是不一样的) - ) { + if (hasNoIdItem && !filterKeyValParams(arr, props.defaultParamItem).lastDataIsDefault && !props.isTreeTable) { addTableLine(arr.length - 1, false, true); } } else { diff --git a/frontend/src/views/api-test/components/requestComposition/body.vue b/frontend/src/views/api-test/components/requestComposition/body.vue index 84fe895409..63f8e73252 100644 --- a/frontend/src/views/api-test/components/requestComposition/body.vue +++ b/frontend/src/views/api-test/components/requestComposition/body.vue @@ -218,7 +218,7 @@ slotName: 'paramType', hasRequired: true, typeOptions: typeOptions.value, - width: 120, + width: 130, }, { title: 'apiTestDebug.paramValue', diff --git a/frontend/src/views/api-test/components/utils.ts b/frontend/src/views/api-test/components/utils.ts index 7be51af6e7..40c5c30b9c 100644 --- a/frontend/src/views/api-test/components/utils.ts +++ b/frontend/src/views/api-test/components/utils.ts @@ -134,7 +134,7 @@ export function filterKeyValParams( delete lastData.enable; delete defaultParam.id; delete defaultParam.enable; - const lastDataIsDefault = isEqual(lastData, defaultParam); + const lastDataIsDefault = isEqual(lastData, defaultParam) || lastData.key === ''; let validParams: (T & Record)[]; if (lastDataIsDefault) { // 如果最后一条数据是默认数据,非用户添加更改的,说明是无效参数,删除最后一个 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 f1be52ebd7..dfb2705e4e 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 @@ -146,7 +146,6 @@ import { ProtocolItem } from '@/models/apiTest/common'; import { ApiDefinitionDetail } from '@/models/apiTest/management'; import { ModuleTreeNode } from '@/models/common'; - import { EnvConfig } from '@/models/projectManagement/environmental'; import { RequestAuthType, RequestComposition, diff --git a/frontend/src/views/project-management/fileManagement/components/popConfirm.vue b/frontend/src/views/project-management/fileManagement/components/popConfirm.vue index a9e6278bb9..1fb96d253a 100644 --- a/frontend/src/views/project-management/fileManagement/components/popConfirm.vue +++ b/frontend/src/views/project-management/fileManagement/components/popConfirm.vue @@ -116,6 +116,7 @@ () => props.visible, (val) => { innerVisible.value = val; + form.value.field = props.fieldConfig?.field || ''; } ); @@ -124,6 +125,8 @@ (val) => { if (!val) { emit('close'); + } else { + form.value.field = props.fieldConfig?.field || ''; } emit('update:visible', val); } @@ -205,7 +208,7 @@ function reset(val: boolean) { if (!val) { - formRef.value?.resetFields(); + formRef.value?.clearValidate(); form.value.field = ''; } }