fix(接口测试): 修复场景提示未保存的缺陷

--bug=1023368 --user=王孝刚 【接口测试】github#21804接口自动化,场景没有编辑,却提示未保存
https://www.tapd.cn/55049933/s/1338541
This commit is contained in:
wxg0103 2023-02-20 16:11:47 +08:00 committed by wxg0103
parent f0455328ea
commit 96adbdf83e
1 changed files with 25 additions and 2 deletions

View File

@ -491,6 +491,7 @@ export default {
}
},
deleteResourceIds(array) {
//
if (array instanceof Array && array.length > 0) {
array.forEach((item) => {
if (item.currentScenarioId && item.currentScenarioId.length > 0) {
@ -499,6 +500,12 @@ export default {
if (item.resourceId) {
delete item.resourceId;
}
if (item.showExtend) {
delete item.showExtend;
}
if (item.isCopy) {
delete item.isCopy;
}
if (item.method) {
delete item.method;
}
@ -508,12 +515,28 @@ export default {
if (item.ctimeout >= 0) {
delete item.ctimeout;
}
if (item.rest && item.rest.length === 0) {
if (item.rest && item.rest.length <= 1) {
delete item.rest;
}
if (item.arguments && item.arguments.length === 0) {
if (item.headers && item.headers.length <= 1) {
delete item.headers;
}
if (item.arguments && item.arguments.length <= 1) {
delete item.arguments;
}
if (item.arguments && item.arguments.length > 0) {
item.arguments.forEach((arg) => {
if (!arg.isEdit || arg.isEdit) {
delete arg.isEdit;
}
});
}
if (item.parameters && item.parameters.length <= 1) {
delete item.parameters;
}
if (item.customizeReq || !item.customizeReq) {
delete item.customizeReq;
}
if (item.id) {
delete item.id;
}