fix 79572
This commit is contained in:
@@ -91,35 +91,36 @@
|
|||||||
</template>
|
</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}">
|
<template v-slot:relatedMaterial="{text, record}">
|
||||||
<a-tooltip overlay-class-name="tooltip-style">
|
<a v-if="text" class="link-a" @click="handleRelatedMaterialClick(record)">{{ $t('view') }}</a>
|
||||||
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
|
<div v-else class="table-text">{{ global.emptyLine }}</div>
|
||||||
<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>
|
||||||
|
|
||||||
</j-table>
|
</j-table>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 上传回显 -->
|
||||||
|
<upload-file ref="uploadFile" disabled></upload-file>
|
||||||
</a-card>
|
</a-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import JTable from '@/components/jero/JTable'
|
import JTable from '@/components/jero/JTable'
|
||||||
import { JeroListMixin } from '@/mixins/JeroListMixin'
|
import { JeroListMixin } from '@/mixins/JeroListMixin'
|
||||||
import Vue from 'vue'
|
import UploadFile from '@comp/UploadFile'
|
||||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
import { downFile } from '@api/manage'
|
||||||
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
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'EnterpriseStandardPublicize',
|
name: 'EnterpriseStandardPublicize',
|
||||||
components: { JTable },
|
components: { UploadFile, JTable },
|
||||||
mixins: [JeroListMixin],
|
mixins: [JeroListMixin],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
@@ -203,30 +204,9 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 点击相关材料
|
// fix79572 点击相关材料
|
||||||
handleRelatedMaterialClick (record) {
|
handleRelatedMaterialClick (record) {
|
||||||
// 截取文件后缀名
|
this.$refs.uploadFile.open(record.declareFile)
|
||||||
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)
|
|
||||||
},
|
},
|
||||||
// 导出
|
// 导出
|
||||||
handleExportXls (fileName) {
|
handleExportXls (fileName) {
|
||||||
|
|||||||
Reference in New Issue
Block a user