提交优化55,60
This commit is contained in:
parent
36adff7ab2
commit
3a358e7ac3
|
@ -75,7 +75,7 @@ export default {
|
||||||
maxFile: Number,
|
maxFile: Number,
|
||||||
accept: {
|
accept: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '.jpg,.png,.doc,.docx,.pdf,.txt,.jpeg'
|
default: '.txt,.csv'
|
||||||
},
|
},
|
||||||
autoUpload: { // 自动上传
|
autoUpload: { // 自动上传
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
|
@ -200,6 +200,13 @@ export default {
|
||||||
this.$message.warning("请先选择上传的模式");
|
this.$message.warning("请先选择上传的模式");
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
const isValidExtension = this.accept.split(',').some(ext =>
|
||||||
|
file.name.toLowerCase().endsWith(ext)
|
||||||
|
);
|
||||||
|
if (!isValidExtension) {
|
||||||
|
this.$message.error(file.name+'文件类型错误阻止上传!');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
// 开始执行上传逻辑
|
// 开始执行上传逻辑
|
||||||
const currentRow = this.tableDate.find((row) => row.uid === file.uid)
|
const currentRow = this.tableDate.find((row) => row.uid === file.uid)
|
||||||
if (currentRow) {
|
if (currentRow) {
|
||||||
|
|
|
@ -75,7 +75,7 @@ export default {
|
||||||
maxFile: Number,
|
maxFile: Number,
|
||||||
accept: {
|
accept: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '.jpg,.png,.doc,.docx,.pdf,.txt,.jpeg'
|
default: '.jpg,.png,.doc,.docx,.pdf,.txt,.jpeg,.bmp,.mp4,.avi,.wmv,.mkv,.flv,.mp3,.sql,.db,.dmp,.xls,.xlsx,.wps,.et,.csv,.xml,.json,.other'
|
||||||
},
|
},
|
||||||
autoUpload: { // 自动上传
|
autoUpload: { // 自动上传
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
|
@ -209,10 +209,18 @@ export default {
|
||||||
this.$message.error('文件目录选择异常请刷新页面')
|
this.$message.error('文件目录选择异常请刷新页面')
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if(this.taskId.length <= 0){
|
// if(this.taskId.length <= 0){
|
||||||
// this.$message.error('请选择任务')
|
// this.$message.error('请选择任务')
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
|
const isValidExtension = this.accept.split(',').some(ext =>
|
||||||
|
file.name.toLowerCase().endsWith(ext)
|
||||||
|
);
|
||||||
|
if (!isValidExtension) {
|
||||||
|
this.$message.error(file.name+'文件类型错误阻止上传!');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
const currentRow = this.tableDate.find((row) => row.uid === file.uid)
|
const currentRow = this.tableDate.find((row) => row.uid === file.uid)
|
||||||
if (currentRow) {
|
if (currentRow) {
|
||||||
// 当前上传进度归0
|
// 当前上传进度归0
|
||||||
|
|
|
@ -226,7 +226,6 @@ import { taskCreate,
|
||||||
}
|
}
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
that.confirmLoading = false;
|
that.confirmLoading = false;
|
||||||
that.close();
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user