fix(接口自动化): 场景CSV变量文件删除二次确认

This commit is contained in:
fit2-zhao 2021-11-11 15:15:05 +08:00 committed by fit2-zhao
parent ec0fbfa500
commit 2382fe05b9
2 changed files with 20 additions and 13 deletions

View File

@ -65,24 +65,31 @@ export default {
};
this.result = this.$request(conf).then(response => {
const content = response.data;
if(content && this.parameter.files[0]) {
if (content && this.parameter.files[0]) {
downloadFile(this.parameter.files[0].name, content);
}
});
}
},
handleRemove(file) {
this.$refs.upload.handleRemove(file);
for (let i = 0; i < this.parameter.files.length; i++) {
let fileName = file.file ? file.file.name : file.name;
let paramFileName = this.parameter.files[i].file ?
this.parameter.files[i].file.name : this.parameter.files[i].name;
if (fileName === paramFileName) {
this.parameter.files.splice(i, 1);
this.$refs.upload.handleRemove(file);
break;
this.$alert('是否确认删除CSV文件【 ' + file.name + " 】?", '', {
confirmButtonText: this.$t('commons.confirm'),
callback: (action) => {
if (action === 'confirm') {
this.$refs.upload.handleRemove(file);
for (let i = 0; i < this.parameter.files.length; i++) {
let fileName = file.file ? file.file.name : file.name;
let paramFileName = this.parameter.files[i].file ?
this.parameter.files[i].file.name : this.parameter.files[i].name;
if (fileName === paramFileName) {
this.parameter.files.splice(i, 1);
this.$refs.upload.handleRemove(file);
break;
}
}
}
}
}
});
},
exceed() {
this.$warning(this.$t('test_track.case.import.upload_limit_count'));

View File

@ -301,13 +301,13 @@ export default {
let message = "";
ids.forEach(row => {
const v = this.variables.find(d => d.id === row);
if (v && v.type === 'CSV' && v.name) {
if (v.name) {
message += v.name + ";";
}
});
if (message !== "") {
message = message.substr(0, message.length - 1);
this.$alert('是否确认删除CSV:【 ' + message + " 】?", '', {
this.$alert('是否确认删除变量:【 ' + message + " 】?", '', {
confirmButtonText: this.$t('commons.confirm'),
callback: (action) => {
if (action === 'confirm') {