fix(全局): bug修复
This commit is contained in:
parent
68a8c68041
commit
cc340ce8c5
|
@ -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 {
|
||||
|
|
|
@ -218,7 +218,7 @@
|
|||
slotName: 'paramType',
|
||||
hasRequired: true,
|
||||
typeOptions: typeOptions.value,
|
||||
width: 120,
|
||||
width: 130,
|
||||
},
|
||||
{
|
||||
title: 'apiTestDebug.paramValue',
|
||||
|
|
|
@ -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) {
|
||||
// 如果最后一条数据是默认数据,非用户添加更改的,说明是无效参数,删除最后一个
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 = '';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue