提交优化55,60

This commit is contained in:
RenCheng 2025-05-10 13:45:28 +08:00
parent 36adff7ab2
commit 3a358e7ac3
3 changed files with 17 additions and 3 deletions

View File

@ -75,7 +75,7 @@ export default {
maxFile: Number,
accept: {
type: String,
default: '.jpg,.png,.doc,.docx,.pdf,.txt,.jpeg'
default: '.txt,.csv'
},
autoUpload: { //
type: Boolean,
@ -200,6 +200,13 @@ export default {
this.$message.warning("请先选择上传的模式");
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)
if (currentRow) {

View File

@ -75,7 +75,7 @@ export default {
maxFile: Number,
accept: {
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: { //
type: Boolean,
@ -209,10 +209,18 @@ export default {
this.$message.error('文件目录选择异常请刷新页面')
return;
}
// if(this.taskId.length <= 0){
// this.$message.error('')
// 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)
if (currentRow) {
// 0

View File

@ -226,7 +226,6 @@ import { taskCreate,
}
}).finally(() => {
that.confirmLoading = false;
that.close();
})
}
}