release-v1.0 #1
@ -18,6 +18,7 @@
|
||||
<!-- 上传-->
|
||||
<input v-show="false" ref="fileRef" id="fileFolder" type="file" @change="handleFolderUpload" webkitdirectory
|
||||
multiple="multiple" />
|
||||
<div slot="tip" class="el-upload__tip" >只能上传{{acceptType}}格式</div>
|
||||
</el-upload>
|
||||
<div v-show="progressFlag" class="head-img">
|
||||
<el-progress :text-inside="true" :stroke-width="14" :percentage="progressPercent" status="success"></el-progress>
|
||||
@ -460,17 +461,28 @@ export default {
|
||||
|
||||
|
||||
async handleFolderUpload(event) {
|
||||
let self = this
|
||||
const files = Array.from(event.target.files);
|
||||
this.totalFiles = files.length;
|
||||
this.uploadedCount = 0;
|
||||
this.progressFlag = true;
|
||||
let failCount = 0;
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
const file = files[i];
|
||||
const fileExtension = file.name.slice(file.name.lastIndexOf('.')).toLowerCase();
|
||||
|
||||
// 校验文件格式
|
||||
if (!self.acceptType.includes(fileExtension)) {
|
||||
failCount++;
|
||||
this.$message.error('文件格式不支持: ' + file.name);
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
await this.uploadFolderFile(
|
||||
{
|
||||
data: null,
|
||||
file: files[i]
|
||||
file: file
|
||||
}
|
||||
);
|
||||
this.uploadedCount++;
|
||||
|
@ -355,7 +355,7 @@
|
||||
deptOptions:[],
|
||||
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传文件服务器地址
|
||||
fileData: null,
|
||||
acceptType: ".txt,.doc,.docx,.pdf,.mp4,.zip,.rar,.7z,.png,.jpg,.jpeg",
|
||||
acceptType: ".txt,.doc,.docx,.pdf,.mp4,.avi,.rmvb,.zip,.rar,.7z,.png,.jpg,.jpeg,.bmp",
|
||||
editStatus: true,
|
||||
toolDataInfo: [],
|
||||
dataFile: [],
|
||||
|
@ -464,7 +464,7 @@ export default {
|
||||
curDeptName: null,
|
||||
|
||||
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传文件服务器地址
|
||||
acceptType: ".txt,.doc,.docx,.pdf,.mp4,.zip,.rar,.7z,.png,.jpg,.jpeg",
|
||||
acceptType: ".txt,.doc,.docx,.pdf,.mp4,.avi,.rmvb,.zip,.rar,.7z,.png,.jpg,.jpeg,.bmp",
|
||||
dataFile: [],
|
||||
detailBoolean: false,
|
||||
attachmentList: [],
|
||||
|
Loading…
x
Reference in New Issue
Block a user