update kkfile预览
This commit is contained in:
Vendored
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
window._CONFIG = {}
|
window._CONFIG = {}
|
||||||
window._CONFIG.domianURL = '/laws-sinotruk' // 路由转发 devServer
|
window._CONFIG.domianURL = '/laws-sinotruk' // 路由转发 devServer
|
||||||
window._CONFIG.domianWebSocketURL = 'http://localhost:8080'
|
window._CONFIG.domianWebSocketURL = 'http://localhost:8184/laws-sinotruk'
|
||||||
// 单点登录地址
|
// 单点登录地址
|
||||||
window._CONFIG.staticDomainURL = window._CONFIG.domianURL + '/sys/common/download'
|
window._CONFIG.staticDomainURL = window._CONFIG.domianURL + '/sys/common/download'
|
||||||
window._CONFIG.pdfDomainURL = window._CONFIG.domianURL + '/sys/common/pdf/pdfPreviewIframe'
|
window._CONFIG.pdfDomainURL = window._CONFIG.domianURL + '/sys/common/pdf/pdfPreviewIframe'
|
||||||
|
|||||||
@@ -29,8 +29,10 @@ import { downloadFile, getFileAccessHttpUrl } from '../api/manage.js'
|
|||||||
import { previewPdf } from '../utils/previewPdf.js'
|
import { previewPdf } from '../utils/previewPdf.js'
|
||||||
import { Base64 } from 'js-base64'
|
import { Base64 } from 'js-base64'
|
||||||
|
|
||||||
|
// 支持预览的文件类型
|
||||||
|
const CAN_PREVIEW_FILE_TYPE = ['pdf', 'image']
|
||||||
// 支持预览的文件后缀
|
// 支持预览的文件后缀
|
||||||
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'raw', 'pdf', 'docx', 'doc']
|
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'raw', 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'mp3', 'mp4', 'flv']
|
||||||
const FILE_TYPE_IMGS = ['jpg', 'jpeg', 'png', 'raw']
|
const FILE_TYPE_IMGS = ['jpg', 'jpeg', 'png', 'raw']
|
||||||
const FILE_TYPE_PDF = 'pdf'
|
const FILE_TYPE_PDF = 'pdf'
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ import { Base64 } from 'js-base64'
|
|||||||
import FlowChartModal from './FlowChartModal.vue'
|
import FlowChartModal from './FlowChartModal.vue'
|
||||||
|
|
||||||
// 支持预览的文件后缀
|
// 支持预览的文件后缀
|
||||||
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'raw', 'pdf', 'docx', 'doc']
|
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'raw', 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'mp3', 'mp4', 'flv']
|
||||||
const FILE_TYPE_IMGS = ['jpg', 'jpeg', 'png', 'raw']
|
const FILE_TYPE_IMGS = ['jpg', 'jpeg', 'png', 'raw']
|
||||||
const FILE_TYPE_PDF = 'pdf'
|
const FILE_TYPE_PDF = 'pdf'
|
||||||
|
|
||||||
|
|||||||
@@ -66,9 +66,9 @@ const CAN_UPLOAD_FILE_TYPE = 'doc,docx,xls,xlsx,pdf,png,jpg'
|
|||||||
const Base64 = require('js-base64').Base64
|
const Base64 = require('js-base64').Base64
|
||||||
|
|
||||||
// 支持预览的文件类型
|
// 支持预览的文件类型
|
||||||
const CAN_PREVIEW_FILE_TYPE = ['pdf', 'image', 'doc', 'docx']
|
const CAN_PREVIEW_FILE_TYPE = ['pdf', 'image']
|
||||||
// 不支持预览的文件后缀
|
// 支持预览的文件后缀
|
||||||
const CAN_PREVIEW_FILE_SUFFIX = ['xls', 'xlsx', 'ppt', 'pptx', 'txt', 'mp3', 'mp4', 'flv']
|
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'raw', 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'mp3', 'mp4', 'flv']
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'UploadFile',
|
name: 'UploadFile',
|
||||||
@@ -305,7 +305,7 @@ export default {
|
|||||||
const fileSuffix = file.name ? file.name.split('.')[file.name.split('.').length - 1] : ''
|
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)
|
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.$message.loading(this.$t('uploadFile.cannotPreview')).then(() => {
|
||||||
this.handleDownload(file)
|
this.handleDownload(file)
|
||||||
})
|
})
|
||||||
@@ -436,15 +436,15 @@ export default {
|
|||||||
|
|
||||||
// 索赔上传需要根据传入的值判断是否可以上传
|
// 索赔上传需要根据传入的值判断是否可以上传
|
||||||
.upload-disabled {
|
.upload-disabled {
|
||||||
/deep/ .ant-upload{
|
/deep/ .ant-upload {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 不可删除文件
|
// 不可删除文件
|
||||||
.delete-disabled {
|
.delete-disabled {
|
||||||
/deep/.ant-upload-list-item-card-actions {
|
/deep/ .ant-upload-list-item-card-actions {
|
||||||
a:nth-child(2){
|
a:nth-child(2) {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ const Base64 = require('js-base64').Base64
|
|||||||
// 支持预览的文件类型
|
// 支持预览的文件类型
|
||||||
const CAN_PREVIEW_FILE_TYPE = ['pdf', 'image']
|
const CAN_PREVIEW_FILE_TYPE = ['pdf', 'image']
|
||||||
// 支持预览的文件后缀
|
// 支持预览的文件后缀
|
||||||
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'raw', 'pdf', 'docx', 'doc']
|
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'raw', 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'mp3', 'mp4', 'flv']
|
||||||
const uidGenerator = () => {
|
const uidGenerator = () => {
|
||||||
return '-' + parseInt(Math.random() * 10000 + 1, 10)
|
return '-' + parseInt(Math.random() * 10000 + 1, 10)
|
||||||
}
|
}
|
||||||
@@ -402,7 +402,7 @@ export default {
|
|||||||
const fileType = file.type
|
const fileType = file.type
|
||||||
// 截取文件后缀名
|
// 截取文件后缀名
|
||||||
const fileSuffix = file.name ? file.name.split('.')[file.name.split('.').length - 1].toLowerCase() : ''
|
const fileSuffix = file.name ? file.name.split('.')[file.name.split('.').length - 1].toLowerCase() : ''
|
||||||
const canPreview = fileType ? CAN_PREVIEW_FILE_TYPE.some(tt => fileType.indexOf(tt) !== -1) : CAN_PREVIEW_FILE_SUFFIX.some(tt => fileSuffix === tt)
|
const canPreview = fileType ? CAN_PREVIEW_FILE_TYPE.some(tt => fileType.indexOf(tt) !== -1) : CAN_PREVIEW_FILE_SUFFIX.some(tt => fileSuffix.toLowerCase() === tt)
|
||||||
// 判断是否为可预览格式的文件
|
// 判断是否为可预览格式的文件
|
||||||
if (!canPreview) {
|
if (!canPreview) {
|
||||||
this.$message.loading('该文件类型不支持预览,正在为您准备下载...').then(() => {
|
this.$message.loading('该文件类型不支持预览,正在为您准备下载...').then(() => {
|
||||||
@@ -428,7 +428,7 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 其余可预览文件仍使用KKFile进行预览
|
// 其余可预览文件仍使用KKFile进行预览
|
||||||
const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
|
const url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + encodeURIComponent(Base64.encode(fileFullUrl))
|
||||||
window.open(url)
|
window.open(url)
|
||||||
},
|
},
|
||||||
getFileUrl (fileId) {
|
getFileUrl (fileId) {
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ import { getFileInfo } from '@/api/api'
|
|||||||
import { previewPdf } from '@/utils/previewPdf'
|
import { previewPdf } from '@/utils/previewPdf'
|
||||||
|
|
||||||
// 支持预览的文件后缀
|
// 支持预览的文件后缀
|
||||||
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'raw', 'pdf', 'docx', 'doc']
|
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'raw', 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'mp3', 'mp4', 'flv']
|
||||||
const FILE_TYPE_IMGS = ['jpg', 'jpeg', 'png', 'raw']
|
const FILE_TYPE_IMGS = ['jpg', 'jpeg', 'png', 'raw']
|
||||||
const FILE_TYPE_PDF = 'pdf'
|
const FILE_TYPE_PDF = 'pdf'
|
||||||
const Base64 = require('js-base64').Base64
|
const Base64 = require('js-base64').Base64
|
||||||
|
|||||||
@@ -160,8 +160,10 @@ import { previewPdf } from '@/utils/previewPdf'
|
|||||||
import { getFileAccessHttpUrl } from '@/api/manage'
|
import { getFileAccessHttpUrl } from '@/api/manage'
|
||||||
import { getFileInfo } from '../../../../api/api'
|
import { getFileInfo } from '../../../../api/api'
|
||||||
|
|
||||||
|
// 支持预览的文件类型
|
||||||
|
const CAN_PREVIEW_FILE_TYPE = ['pdf', 'image']
|
||||||
// 支持预览的文件后缀
|
// 支持预览的文件后缀
|
||||||
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'raw', 'pdf', 'docx', 'doc']
|
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'raw', 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'mp3', 'mp4', 'flv']
|
||||||
const FILE_TYPE_IMGS = ['jpg', 'jpeg', 'png', 'raw']
|
const FILE_TYPE_IMGS = ['jpg', 'jpeg', 'png', 'raw']
|
||||||
const FILE_TYPE_PDF = 'pdf'
|
const FILE_TYPE_PDF = 'pdf'
|
||||||
const Base64 = require('js-base64').Base64
|
const Base64 = require('js-base64').Base64
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ import UserSelectModal from '@comp/selection/UserSelectModal'
|
|||||||
import StandardResolutionSheetModal from '@views/standardRegulationLibrary/commonPage/modules/StandardResolutionSheetModal'
|
import StandardResolutionSheetModal from '@views/standardRegulationLibrary/commonPage/modules/StandardResolutionSheetModal'
|
||||||
|
|
||||||
// 支持预览的文件后缀
|
// 支持预览的文件后缀
|
||||||
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'raw', 'pdf', 'docx', 'doc']
|
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'raw', 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'mp3', 'mp4', 'flv']
|
||||||
const FILE_TYPE_IMGS = ['jpg', 'jpeg', 'png', 'raw']
|
const FILE_TYPE_IMGS = ['jpg', 'jpeg', 'png', 'raw']
|
||||||
const FILE_TYPE_PDF = 'pdf'
|
const FILE_TYPE_PDF = 'pdf'
|
||||||
const Base64 = require('js-base64').Base64
|
const Base64 = require('js-base64').Base64
|
||||||
|
|||||||
@@ -76,7 +76,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="detail-page-process-manuscript-file-operate">
|
<div class="detail-page-process-manuscript-file-operate">
|
||||||
<!-- 下载-->
|
<!-- 下载-->
|
||||||
<a-button type="link" icon="download" v-has="btnPermission.download" @click="handleWatermarkedDownload(file)">{{ $t('download') }}
|
<a-button type="link" icon="download" v-has="btnPermission.download" @click="handleWatermarkedDownload(file)">
|
||||||
|
{{ $t('download') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
<!-- 无水印下载-->
|
<!-- 无水印下载-->
|
||||||
<a-button type="link" v-has="btnPermission.unwatermarkedDownload" @click="handleDownload(file)">
|
<a-button type="link" v-has="btnPermission.unwatermarkedDownload" @click="handleDownload(file)">
|
||||||
@@ -164,8 +165,9 @@ const OverseasApi = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 支持预览的文件后缀
|
// 支持预览的文件后缀
|
||||||
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'raw', 'pdf', 'docx', 'doc']
|
const CAN_PREVIEW_FILE_SUFFIX = ['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'mp3', 'mp4', 'flv', 'pdf', 'jpg', 'jpeg', 'png', 'raw']
|
||||||
const FILE_TYPE_PDF = 'pdf'
|
const FILE_TYPE_PDF = 'pdf'
|
||||||
|
const FILE_TYPE_IMGS = ['jpg', 'jpeg', 'png', 'raw']
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'StandardDetailPage',
|
name: 'StandardDetailPage',
|
||||||
@@ -366,6 +368,7 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/download/${file.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}`
|
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/download/${file.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}`
|
||||||
|
console.log(fileFullUrl)
|
||||||
// 图片预览,使用自己添加的组件
|
// 图片预览,使用自己添加的组件
|
||||||
if (canPreview && FILE_TYPE_IMGS.includes(fileSuffix.toLowerCase())) {
|
if (canPreview && FILE_TYPE_IMGS.includes(fileSuffix.toLowerCase())) {
|
||||||
this.imageUrl = getFileAccessHttpUrl(file.id)
|
this.imageUrl = getFileAccessHttpUrl(file.id)
|
||||||
|
|||||||
Reference in New Issue
Block a user