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