[update] 文件上传展示上传格式和大小
This commit is contained in:
@@ -205,6 +205,9 @@ module.exports = {
|
||||
designEngineer: 'Design engineer',
|
||||
pleaseUpload: 'Please upload',
|
||||
supportingMaterial: 'Supporting material',
|
||||
support: 'You can upload files in ',
|
||||
formatUpload: ' formats. ',
|
||||
theSizeIs: 'The size is ',
|
||||
// 树右键
|
||||
treeRight: {
|
||||
addFolder: 'Create New Folder',
|
||||
|
||||
@@ -222,6 +222,9 @@ module.exports = {
|
||||
designEngineer: '设计工程师',
|
||||
pleaseUpload: '请上传',
|
||||
supportingMaterial: '佐证材料',
|
||||
support: '支持',
|
||||
formatUpload: '格式上传,',
|
||||
theSizeIs: '大小为',
|
||||
// 标准字段
|
||||
standardField: {
|
||||
standardEnglishName: '标准英文名称',
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
<p class="ant-upload-text">
|
||||
{{ $t('uploadFile.clickOrDragUpload') }}
|
||||
</p>
|
||||
<p class="tips">{{ tips }}</p>
|
||||
</a-upload-dragger>
|
||||
|
||||
<div id="images">
|
||||
@@ -62,7 +63,7 @@ const FILE_TYPE_IMGS = ['jpg', 'jpeg', 'png']
|
||||
const FILE_TYPE_PDF = 'pdf'
|
||||
|
||||
// 本系统限制可以上传的文件格式
|
||||
const CAN_UPLOAD_FILE_TYPE = 'pdf,docx,doc,xlsx,xls,ppt,pptx,jpg,jpeg,png,avi,wmv,mov,rm,mp4,cad'
|
||||
const CAN_UPLOAD_FILE_TYPE = 'pdf,docx,doc,xlsx,xls,ppt,pptx,jpg,jpeg,png'
|
||||
|
||||
const Base64 = require('js-base64').Base64
|
||||
|
||||
@@ -138,7 +139,7 @@ export default {
|
||||
fileMaxSize: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 500
|
||||
default: 20
|
||||
}
|
||||
},
|
||||
data () {
|
||||
@@ -165,6 +166,9 @@ export default {
|
||||
},
|
||||
complistType () {
|
||||
return this.fileType === FILE_TYPE_IMG ? 'picture-card' : 'text'
|
||||
},
|
||||
tips () {
|
||||
return this.$t('support') + this.fileType.split(',').map(item => '.'+item).join('、') + this.$t('formatUpload') + this.$t('theSizeIs') + this.fileMaxSize + 'MB'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -454,4 +458,8 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tips {
|
||||
word-break: break-word;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
:backDepart="true"
|
||||
:treeOpera="true" />
|
||||
<!-- 8, 上传文件 -->
|
||||
<a-button v-else-if="item.fieldShowType === FieldType.FILE_UP.value" type="primary" class="button-text"
|
||||
<a-button v-else-if="item.fieldShowType === FieldType.FILE_UP.value" type="primary" ghost class="button-text"
|
||||
@click="clickButtonToUpload(item)">
|
||||
{{
|
||||
(formInline[item.dbFieldName] === 'null' || formInline[item.dbFieldName] === ''
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
<a-icon type="upload" />
|
||||
{{ text ? text : $t('clickToUpload') }}
|
||||
</a-button>
|
||||
<p>{{ tips }}</p>
|
||||
</slot>
|
||||
</template>
|
||||
</a-upload>
|
||||
@@ -64,7 +65,7 @@ const FILE_TYPE_PDF = 'pdf'
|
||||
const Base64 = require('js-base64').Base64
|
||||
|
||||
// 本系统限制可以上传的文件格式
|
||||
const CAN_UPLOAD_FILE_TYPE = 'pdf,docx,doc,xlsx,xls,ppt,pptx,jpg,jpeg,png,avi,wmv,mov,rm,mp4,cad'
|
||||
const CAN_UPLOAD_FILE_TYPE = 'pdf,docx,doc,xlsx,xls,ppt,pptx,jpg,jpeg,png'
|
||||
|
||||
// 支持预览的文件后缀
|
||||
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx']
|
||||
@@ -165,7 +166,7 @@ export default {
|
||||
fileMaxSize: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 500
|
||||
default: 20
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -202,6 +203,9 @@ export default {
|
||||
},
|
||||
complistType () {
|
||||
return this.fileType === FILE_TYPE_IMG ? 'picture-card' : 'text'
|
||||
},
|
||||
tips () {
|
||||
return this.$t('support') + this.fileType.split(',').map(item => '.'+item).join('、') + this.$t('formatUpload') + this.$t('theSizeIs') + this.fileMaxSize + 'MB'
|
||||
}
|
||||
},
|
||||
created () {
|
||||
|
||||
Reference in New Issue
Block a user