fix(全局): bug修复

This commit is contained in:
baiqi 2024-04-18 19:40:32 +08:00 committed by 刘瑞斌
parent 68a8c68041
commit cc340ce8c5
5 changed files with 7 additions and 13 deletions

View File

@ -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 {

View File

@ -218,7 +218,7 @@
slotName: 'paramType',
hasRequired: true,
typeOptions: typeOptions.value,
width: 120,
width: 130,
},
{
title: 'apiTestDebug.paramValue',

View File

@ -134,7 +134,7 @@ export function filterKeyValParams<T>(
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<string, any>)[];
if (lastDataIsDefault) {
// 如果最后一条数据是默认数据,非用户添加更改的,说明是无效参数,删除最后一个

View File

@ -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,

View File

@ -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 = '';
}
}