fix(接口测试): 接口详情变更历史无变更详情日志

--bug=1009209 --user=王孝刚 [ github#8776]接口详情-变更历史无变更详情日志
https://www.tapd.cn/55049933/s/1088966
This commit is contained in:
wxg0103 2021-12-31 10:32:10 +08:00 committed by 刘瑞斌
parent 5d0367895f
commit f2730dc27f
2 changed files with 14 additions and 3 deletions

View File

@ -220,6 +220,7 @@ export default {
showFollow: false,
beforeRequest: {},
compare: [],
isSave: false
}
},
props: {
@ -404,6 +405,7 @@ export default {
}
},
saveCase(row, hideAlert) {
this.isSave = true;
let tmp = JSON.parse(JSON.stringify(row));
this.isShowInput = false;
tmp.request.body = row.request.body;
@ -451,6 +453,7 @@ export default {
if (!row.message) {
this.$success(this.$t('commons.save_success'));
this.reload();
this.isSave = false;
//
if (this.api.source === "editCase") {
this.$emit('reLoadCase');
@ -459,6 +462,8 @@ export default {
this.$emit('refresh');
}
}
}, (error) => {
this.isSave = false;
});
},
saveTestCase(row, hideAlert) {
@ -472,9 +477,11 @@ export default {
this.addModule(row);
} else {
this.api.source = "editCase";
if (!this.isSave){
this.saveCase(row, hideAlert);
}
}
}
},
showInput(row) {
// row.type = "create";

View File

@ -38,6 +38,10 @@
},
methods: {
getDiff(v1, v2) {
if (this.detail.columnName==='request' && v1 && v2){
let delta = jsondiffpatch.diff(JSON.parse(v1) , JSON.parse(v2));
return formattersHtml.format(delta, JSON.parse(v1));
}
let delta = jsondiffpatch.diff(v1 , v2);
return formattersHtml.format(delta, v1);
},