bug67280
This commit is contained in:
@@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'file',
|
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() {
|
data() {
|
||||||
return {
|
return {
|
||||||
visible: false,
|
visible: false,
|
||||||
@@ -89,13 +89,13 @@
|
|||||||
console.log(file)
|
console.log(file)
|
||||||
this.fileTypeSatus = true
|
this.fileTypeSatus = true
|
||||||
//根据格式拦截
|
//根据格式拦截
|
||||||
if(this.accept){
|
if(this.acceptcode){
|
||||||
let fileNames = file.name.split('.')
|
let fileNames = file.name.split('.')
|
||||||
let fileType = fileNames[fileNames.length - 1].toLocaleLowerCase()
|
let fileType = fileNames[fileNames.length - 1].toLocaleLowerCase()
|
||||||
let extList = this.accept.split(',')
|
let extList = this.acceptcode.split(',')
|
||||||
if (!extList.find((item) => item == fileType)) {
|
if (!extList.find((item) => item == fileType)) {
|
||||||
this.$message.error(this.$t('uploadOnly') + this.accept + this.$t('type'))
|
this.$message.error(this.$t('uploadOnly') + this.acceptcode + this.$t('type'))
|
||||||
reject(false)
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.isMultiple) {
|
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;margin-right: 50px' @click="last">{{ $t('last') }}</a-button>
|
||||||
<a-button type="primary" style='width: 73px' @click='next'>{{ $t('next') }}</a-button>
|
<a-button type="primary" style='width: 73px' @click='next'>{{ $t('next') }}</a-button>
|
||||||
</div>
|
</div>
|
||||||
<uploadFile ref="uploadFile" :accept="'.doc,.docx,.pdf'" @uploadSuccess="uploadSuccess"></uploadFile>
|
<uploadFile ref="uploadFile" :acceptcode="'doc,docx,pdf'" @uploadSuccess="uploadSuccess"></uploadFile>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user