release-v1.0 #1
@ -18,6 +18,7 @@
|
|||||||
<!-- 上传-->
|
<!-- 上传-->
|
||||||
<input v-show="false" ref="fileRef" id="fileFolder" type="file" @change="handleFolderUpload" webkitdirectory
|
<input v-show="false" ref="fileRef" id="fileFolder" type="file" @change="handleFolderUpload" webkitdirectory
|
||||||
multiple="multiple" />
|
multiple="multiple" />
|
||||||
|
<div slot="tip" class="el-upload__tip" >只能上传{{acceptType}}格式</div>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<div v-show="progressFlag" class="head-img">
|
<div v-show="progressFlag" class="head-img">
|
||||||
<el-progress :text-inside="true" :stroke-width="14" :percentage="progressPercent" status="success"></el-progress>
|
<el-progress :text-inside="true" :stroke-width="14" :percentage="progressPercent" status="success"></el-progress>
|
||||||
@ -460,17 +461,28 @@ export default {
|
|||||||
|
|
||||||
|
|
||||||
async handleFolderUpload(event) {
|
async handleFolderUpload(event) {
|
||||||
|
let self = this
|
||||||
const files = Array.from(event.target.files);
|
const files = Array.from(event.target.files);
|
||||||
this.totalFiles = files.length;
|
this.totalFiles = files.length;
|
||||||
this.uploadedCount = 0;
|
this.uploadedCount = 0;
|
||||||
this.progressFlag = true;
|
this.progressFlag = true;
|
||||||
let failCount = 0;
|
let failCount = 0;
|
||||||
for (let i = 0; i < files.length; i++) {
|
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 {
|
try {
|
||||||
await this.uploadFolderFile(
|
await this.uploadFolderFile(
|
||||||
{
|
{
|
||||||
data: null,
|
data: null,
|
||||||
file: files[i]
|
file: file
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
this.uploadedCount++;
|
this.uploadedCount++;
|
||||||
|
@ -355,7 +355,7 @@
|
|||||||
deptOptions:[],
|
deptOptions:[],
|
||||||
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传文件服务器地址
|
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传文件服务器地址
|
||||||
fileData: null,
|
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,
|
editStatus: true,
|
||||||
toolDataInfo: [],
|
toolDataInfo: [],
|
||||||
dataFile: [],
|
dataFile: [],
|
||||||
|
@ -464,7 +464,7 @@ export default {
|
|||||||
curDeptName: null,
|
curDeptName: null,
|
||||||
|
|
||||||
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传文件服务器地址
|
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: [],
|
dataFile: [],
|
||||||
detailBoolean: false,
|
detailBoolean: false,
|
||||||
attachmentList: [],
|
attachmentList: [],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user