bug67280
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
|
||||
export default {
|
||||
name: 'file',
|
||||
props: ['disableds', 'disabled', 'thisFileUploadUrl','accept', 'readonly', 'thisFileType', 'isUploadFile', 'isMultiple', 'restrictUploads', 'Uploadable'],
|
||||
props: ['disableds', 'disabled', 'thisFileUploadUrl','acceptcode', 'readonly', 'thisFileType', 'isUploadFile', 'isMultiple', 'restrictUploads', 'Uploadable'],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
@@ -89,13 +89,13 @@
|
||||
console.log(file)
|
||||
this.fileTypeSatus = true
|
||||
//根据格式拦截
|
||||
if(this.accept){
|
||||
if(this.acceptcode){
|
||||
let fileNames = file.name.split('.')
|
||||
let fileType = fileNames[fileNames.length - 1].toLocaleLowerCase()
|
||||
let extList = this.accept.split(',')
|
||||
let extList = this.acceptcode.split(',')
|
||||
if (!extList.find((item) => item == fileType)) {
|
||||
this.$message.error(this.$t('uploadOnly') + this.accept + this.$t('type'))
|
||||
reject(false)
|
||||
this.$message.error(this.$t('uploadOnly') + this.acceptcode + this.$t('type'))
|
||||
return false
|
||||
}
|
||||
}
|
||||
if (this.isMultiple) {
|
||||
|
||||
Reference in New Issue
Block a user