fix 79572
This commit is contained in:
@@ -91,35 +91,36 @@
|
||||
</template>
|
||||
|
||||
<!-- 相关材料 -->
|
||||
<!--<template v-slot:relatedMaterial="{text, record}">-->
|
||||
<!-- <a-tooltip overlay-class-name="tooltip-style">-->
|
||||
<!-- <template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>-->
|
||||
<!-- <a v-if="text" class="link-a" @click="handleRelatedMaterialClick(record)">{{ text }}</a>-->
|
||||
<!-- <div v-else class="table-text">{{ global.emptyLine }}</div>-->
|
||||
<!-- </a-tooltip>-->
|
||||
<!--</template>-->
|
||||
|
||||
<!-- 相关材料 -->
|
||||
<template v-slot:relatedMaterial="{text, record}">
|
||||
<a-tooltip overlay-class-name="tooltip-style">
|
||||
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
|
||||
<a v-if="text" class="link-a" @click="handleRelatedMaterialClick(record)">{{ text }}</a>
|
||||
<div v-else class="table-text">{{ global.emptyLine }}</div>
|
||||
</a-tooltip>
|
||||
<a v-if="text" class="link-a" @click="handleRelatedMaterialClick(record)">{{ $t('view') }}</a>
|
||||
<div v-else class="table-text">{{ global.emptyLine }}</div>
|
||||
</template>
|
||||
|
||||
</j-table>
|
||||
</div>
|
||||
<!-- 上传回显 -->
|
||||
<upload-file ref="uploadFile" disabled></upload-file>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import JTable from '@/components/jero/JTable'
|
||||
import { JeroListMixin } from '@/mixins/JeroListMixin'
|
||||
import Vue from 'vue'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
import { previewPdf } from '@/utils/previewPdf'
|
||||
import { getFileAccessHttpUrl } from '@/api/manage'
|
||||
import { downFile } from '../../../api/manage'
|
||||
|
||||
const FILE_TYPE_IMGS = ['jpg', 'jpeg', 'png', 'raw']
|
||||
const FILE_TYPE_PDF = 'pdf'
|
||||
const Base64 = require('js-base64').Base64
|
||||
import UploadFile from '@comp/UploadFile'
|
||||
import { downFile } from '@api/manage'
|
||||
|
||||
export default {
|
||||
name: 'EnterpriseStandardPublicize',
|
||||
components: { JTable },
|
||||
components: { UploadFile, JTable },
|
||||
mixins: [JeroListMixin],
|
||||
data () {
|
||||
return {
|
||||
@@ -203,30 +204,9 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
// 点击相关材料
|
||||
// fix79572 点击相关材料
|
||||
handleRelatedMaterialClick (record) {
|
||||
// 截取文件后缀名
|
||||
const fileSuffix = record.declareFileName ? record.declareFileName.split('.')[record.declareFileName.split('.').length - 1] : ''
|
||||
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${record.declareFile}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${record.declareFileName}`
|
||||
// 图片预览,使用自己添加的组件
|
||||
if (FILE_TYPE_IMGS.includes(fileSuffix)) {
|
||||
this.imageUrl = getFileAccessHttpUrl(record.declareFile)
|
||||
// 获取viewer实例
|
||||
const viewer = this.$el.querySelector('.image').$viewer
|
||||
// 调用show方法进行显示预览图
|
||||
viewer.show()
|
||||
// this.$refs.imagePreviewModal.open(file)
|
||||
return
|
||||
}
|
||||
// pdf预览
|
||||
if (FILE_TYPE_PDF.includes(fileSuffix)) {
|
||||
const url = previewPdf(record.declareFile)
|
||||
window.open(url)
|
||||
return
|
||||
}
|
||||
// 其余可预览文件仍使用KKFile进行预览
|
||||
const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
|
||||
window.open(url)
|
||||
this.$refs.uploadFile.open(record.declareFile)
|
||||
},
|
||||
// 导出
|
||||
handleExportXls (fileName) {
|
||||
|
||||
Reference in New Issue
Block a user