fix(接口测试): csv上传后清空预览信息

--bug=1013355 --user=王孝刚 【接口测试】github#13766,场景变量里添加多个CVS时,预览页的信息没有及时清空
https://www.tapd.cn/55049933/s/1161591
This commit is contained in:
wxg0103 2022-05-20 19:28:53 +08:00 committed by f2c-ci-robot[bot]
parent 16f6c419de
commit 3f902545d7
2 changed files with 15 additions and 3 deletions

View File

@ -124,16 +124,25 @@
}
this.loading = false;
},
cleanPreview() {
this.allData = [];
this.columns = [];
this.previewData = [];
},
step(results, parser) {
if(this.allData.length < 500) {
if (this.allData.length < 500) {
this.allData.push(results.data);
}else{
} else {
this.showMessage = true;
}
},
handleClick() {
let config = {complete: this.complete, step: this.step, delimiter: this.editData.delimiter ? this.editData.delimiter : ","};
let config = {
complete: this.complete,
step: this.step,
delimiter: this.editData.delimiter ? this.editData.delimiter : ","
};
this.allData = [];
//
if (this.editData.files && this.editData.files.length > 0 && this.editData.files[0].file) {

View File

@ -368,6 +368,9 @@ export default {
this.editData = {delimiter: ",", quotedData: 'false', files: []};
this.editData.type = this.selectType;
this.showDelete = false;
if (this.editData.type === 'CSV') {
this.$refs.csv.cleanPreview();
}
this.$refs.variableTable.cancelCurrentRow();
},
confirmVariable() {