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) {
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
<a-button type="primary" style='width: 73px;margin-right: 50px' @click="last">{{ $t('last') }}</a-button>
|
||||
<a-button type="primary" style='width: 73px' @click='next'>{{ $t('next') }}</a-button>
|
||||
</div>
|
||||
<uploadFile ref="uploadFile" :accept="'.doc,.docx,.pdf'" @uploadSuccess="uploadSuccess"></uploadFile>
|
||||
<uploadFile ref="uploadFile" :acceptcode="'doc,docx,pdf'" @uploadSuccess="uploadSuccess"></uploadFile>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user