对接文档翻译
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<div>
|
||||
<a-modal v-model="visible" :maskClosable="false" :footer="[]" :title="title">
|
||||
<a-upload-dragger
|
||||
accept='*.*'
|
||||
:accept='accept'
|
||||
:disabled="disabled"
|
||||
class="ant-upload-list"
|
||||
:class="{'uploadFile':isUploadFile}"
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
export default {
|
||||
name: 'file',
|
||||
props: ['disableds', 'disabled', 'thisFileUploadUrl', 'readonly', 'thisFileType', 'isUploadFile', 'isMultiple'],
|
||||
props: ['disableds', 'disabled', 'thisFileUploadUrl', 'readonly', 'thisFileType', 'isUploadFile', 'isMultiple', 'restrictUploads'],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
@@ -48,7 +48,8 @@
|
||||
myfileList: [],
|
||||
isLoding: false,
|
||||
cut: '',
|
||||
multiple: true
|
||||
multiple: true,
|
||||
accept: ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -67,6 +68,7 @@
|
||||
if (this.isMultiple) {
|
||||
this.multiple = false
|
||||
}
|
||||
this.accept = this.restrictUploads ? '.docx,.doc' : '*.*'
|
||||
// console.log(this.thisFileType,this.thisFileSize,this.thisFileUploadUrl);
|
||||
},
|
||||
methods: {
|
||||
@@ -84,10 +86,23 @@
|
||||
},
|
||||
beforeUpload(file, fileList) {
|
||||
// let thisFileType = this.thisFileType.replace(/\s+/g, "");
|
||||
console.log(file)
|
||||
this.fileTypeSatus = true
|
||||
if (this.isMultiple) {
|
||||
if ((this.myfileList && this.myfileList.length == 1) || this.myfileList && this.myfileList.length > 1) {
|
||||
this.$message.warning('只能上传一个文件')
|
||||
this.$message.warning(this.$t('onlyOnefileUploaded'))
|
||||
return false
|
||||
}
|
||||
}
|
||||
if (this.restrictUploads) {
|
||||
let fileName = file.name
|
||||
let index1 = fileName.lastIndexOf('.')
|
||||
let index2 = fileName.length
|
||||
let fileSuffix = fileName.substring(index1, index2)
|
||||
if (fileSuffix == '.docx' || fileSuffix == '.doc') {
|
||||
|
||||
} else {
|
||||
this.$message.warning(this.$t('onlyFilesUploaded'))
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user