fix(接口测试): 解决场景变量里上传csv文件,上传一个之后,再上传一个 就不行了

--bug=1010094--user=郭雨琦【ID1010094】【接口测试】场景变量里上传csv文件,上传一个之后,再上传一个 就不行了
This commit is contained in:
guoyuqi 2022-01-28 14:32:14 +08:00 committed by CountryBuilder
parent 976e4cae5f
commit a511362258
1 changed files with 5 additions and 4 deletions

View File

@ -307,7 +307,7 @@
}, },
updateParameters(v) { updateParameters(v) {
this.editData = JSON.parse(JSON.stringify(v)); this.editData = JSON.parse(JSON.stringify(v));
this.upDateFiles(); this.updateFiles();
let datas = []; let datas = [];
this.variables.forEach(item => { this.variables.forEach(item => {
if(item.id === v.id){ if(item.id === v.id){
@ -347,7 +347,7 @@
this.$emit('setVariables', saveVariables, this.headers); this.$emit('setVariables', saveVariables, this.headers);
}, },
addVariable() { addVariable() {
this.editData = {delimiter: ",", quotedData: 'false'}; this.editData = {delimiter: ",", quotedData: 'false',files:[]};
this.editData.type = this.selectType; this.editData.type = this.selectType;
this.showDelete = false; this.showDelete = false;
this.$refs.variableTable.cancelCurrentRow(); this.$refs.variableTable.cancelCurrentRow();
@ -366,6 +366,7 @@
this.addVariable(); this.addVariable();
this.$refs.variableTable.cancelCurrentRow(); this.$refs.variableTable.cancelCurrentRow();
} }
this.$success(this.$t('commons.save_success'));
}, },
cancelVariable() { cancelVariable() {
this.$refs.variableTable.cancelCurrentRow(); this.$refs.variableTable.cancelCurrentRow();
@ -468,10 +469,10 @@
handleRowClick(row) { handleRowClick(row) {
// //
this.editData = JSON.parse(JSON.stringify(row)); this.editData = JSON.parse(JSON.stringify(row));
this.upDateFiles(); this.updateFiles();
this.showDelete = true; this.showDelete = true;
}, },
upDateFiles(){ updateFiles(){
this.variables.forEach(item => { this.variables.forEach(item => {
if(item.id === this.editData.id){ if(item.id === this.editData.id){
this.editData.files = item.files this.editData.files = item.files