update kkfile预览
This commit is contained in:
@@ -66,9 +66,9 @@ const CAN_UPLOAD_FILE_TYPE = 'doc,docx,xls,xlsx,pdf,png,jpg'
|
||||
const Base64 = require('js-base64').Base64
|
||||
|
||||
// 支持预览的文件类型
|
||||
const CAN_PREVIEW_FILE_TYPE = ['pdf', 'image', 'doc', 'docx']
|
||||
// 不支持预览的文件后缀
|
||||
const CAN_PREVIEW_FILE_SUFFIX = ['xls', 'xlsx', 'ppt', 'pptx', 'txt', 'mp3', 'mp4', 'flv']
|
||||
const CAN_PREVIEW_FILE_TYPE = ['pdf', 'image']
|
||||
// 支持预览的文件后缀
|
||||
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'raw', 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'mp3', 'mp4', 'flv']
|
||||
|
||||
export default {
|
||||
name: 'UploadFile',
|
||||
@@ -305,7 +305,7 @@ export default {
|
||||
const fileSuffix = file.name ? file.name.split('.')[file.name.split('.').length - 1] : ''
|
||||
const canPreview = fileType ? CAN_PREVIEW_FILE_TYPE.every(tt => fileType.indexOf(tt) === -1) : CAN_PREVIEW_FILE_SUFFIX.some(tt => fileSuffix === tt)
|
||||
// 判断是否为可预览格式的文件
|
||||
if (canPreview) {
|
||||
if (!canPreview) {
|
||||
this.$message.loading(this.$t('uploadFile.cannotPreview')).then(() => {
|
||||
this.handleDownload(file)
|
||||
})
|
||||
@@ -436,15 +436,15 @@ export default {
|
||||
|
||||
// 索赔上传需要根据传入的值判断是否可以上传
|
||||
.upload-disabled {
|
||||
/deep/ .ant-upload{
|
||||
/deep/ .ant-upload {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
// 不可删除文件
|
||||
.delete-disabled {
|
||||
/deep/.ant-upload-list-item-card-actions {
|
||||
a:nth-child(2){
|
||||
/deep/ .ant-upload-list-item-card-actions {
|
||||
a:nth-child(2) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user