fix(接口测试): 修复sql请求结果集未及时更新问题

--bug=1022508 --user=赵勇 【接口测试】sql请求,执行后修改sql再执行,响应内容没有更新 https://www.tapd.cn/55049933/s/1332530
This commit is contained in:
fit2-zhao 2023-02-07 16:32:35 +08:00 committed by fit2-zhao
parent 93c3f5ed8a
commit 983d6be64f
1 changed files with 19 additions and 9 deletions

View File

@ -34,17 +34,27 @@ export default {
body: String,
},
created() {
if (!this.body) {
return;
}
let rowArray = this.body.split('\n');
//
if (rowArray.length > 100) {
rowArray = rowArray.slice(0, 100);
}
this.getTableData(rowArray);
this.init();
},
watch: {
body() {
this.init();
},
},
methods: {
init() {
if (!this.body) {
return;
}
this.tables = [];
this.titles = [];
let rowArray = this.body.split('\n');
//
if (rowArray.length > 100) {
rowArray = rowArray.slice(0, 100);
}
this.getTableData(rowArray);
},
getTableData(rowArray) {
let titles;
let result = [];