fix(测试跟踪): 修复测试用例上传附件报错的问题

This commit is contained in:
shiziyuan9527 2020-10-19 14:02:06 +08:00
parent 8a31d89503
commit d1fa9ca32a
2 changed files with 12 additions and 4 deletions

View File

@ -1,7 +1,9 @@
package io.metersphere.commons.constants; package io.metersphere.commons.constants;
public enum FileType { public enum FileType {
JMX(".jmx"), CSV(".csv"), JSON(".json"), PDF(".pdf"), JPG(".jpg"), PNG(".png"); JMX(".jmx"), CSV(".csv"), JSON(".json"), PDF(".pdf"),
JPG(".jpg"), PNG(".png"), JPEG(".jpeg"), DOC(".doc"),
XLSX(".xlsx"), DOCX(".docx");
// 保存后缀 // 保存后缀
private String suffix; private String suffix;

View File

@ -213,16 +213,17 @@
<el-row style="margin-top: 15px;margin-bottom: 10px"> <el-row style="margin-top: 15px;margin-bottom: 10px">
<el-col :offset="2" :span="20">附件: <el-col :offset="2" :span="20">附件:
<el-upload <el-upload
accept=".jpg,.jpeg,.png,.xlsx,.doc,.pdf,.docx"
action="" action=""
:show-file-list="false" :show-file-list="false"
:before-upload="beforeUpload" :before-upload="beforeUpload"
:http-request="handleUpload" :http-request="handleUpload"
:on-exceed="handleExceed" :on-exceed="handleExceed"
multiple multiple
:limit="3" :limit="8"
:file-list="fileList"> :file-list="fileList">
<el-button icon="el-icon-plus" size="mini"></el-button> <el-button icon="el-icon-plus" size="mini"></el-button>
<!-- <span slot="tip" class="el-upload__tip"></span>--> <span slot="tip" class="el-upload__tip"> 只能上传jpgjpegpngdocxdocpdfxlsx文件 </span>
</el-upload> </el-upload>
</el-col> </el-col>
</el-row> </el-row>
@ -488,7 +489,9 @@ export default {
result: '' result: ''
}]; }];
this.form.remark = ''; this.form.remark = '';
this.form.uploadList = []; this.uploadList = [];
this.fileList = [];
this.tableData = [];
this.$emit("refresh"); this.$emit("refresh");
return; return;
} }
@ -628,6 +631,9 @@ export default {
desc: '', desc: '',
result: '' result: ''
}]; }];
this.uploadList = [];
this.fileList = [];
this.tableData = [];
return true; return true;
}); });
} }