[update] 标准法规符合性排查中佐证材料查看改成弹框查看

This commit is contained in:
lideqin
2024-07-17 16:43:34 +08:00
parent 5051fb9cc6
commit bad09e00ef
5 changed files with 39 additions and 72 deletions
-6
View File
@@ -242,12 +242,6 @@ export const EvaluationResult = {
TO_BE_VERIFIED: { text: '待验证', value: '4' } TO_BE_VERIFIED: { text: '待验证', value: '4' }
} }
// 法规符合性排查流程-新增方式
export const AddType = {
SELECT_STANDARD: { text: '选择标准', value: '1' },
MANUAL_ADD: { text: '手动新增', value: '2' }
}
// 标准解读流程-是否分发 // 标准解读流程-是否分发
export const IsDistribute = { export const IsDistribute = {
REJECT: { text: '驳回', value: 0 }, // 分发节点驳回时用 REJECT: { text: '驳回', value: 0 }, // 分发节点驳回时用
@@ -86,20 +86,13 @@
<!-- 佐证材料 --> <!-- 佐证材料 -->
<template v-slot:material="text, record"> <template v-slot:material="text, record">
<a-tooltip overlay-class-name="tooltip-style"> <a v-if="text" class="link-a" @click="handleMaterialClick(record)">{{ $t('view') }}</a>
<template slot="title">{{ text || text === 0 ? record.material_dictText : global.emptyLine }}</template> <div v-else class="table-text">{{ global.emptyLine }}</div>
<a v-if="text" class="link-a" @click="previewFile(record)">{{ record.material_dictText }}</a>
<div v-else class="table-text">{{ global.emptyLine }}</div>
</a-tooltip>
</template> </template>
</a-table> </a-table>
<!-- 预览图片的容器 --> <!-- 文件列表查看 -->
<div id="images"> <upload-file ref="uploadFile" disabled></upload-file>
<div class="image" v-viewer="{movable: false}">
<img v-show="image" :src="imageUrl">
</div>
</div>
</j-modal> </j-modal>
</template> </template>
@@ -112,6 +105,7 @@ import { kkFilePreview } from '@/utils/kkFilePreview'
import { downloadFile, getFileAccessHttpUrl } from '@/api/manage' import { downloadFile, getFileAccessHttpUrl } from '@/api/manage'
import { queryDepartTreeList } from '../../../../api/api' import { queryDepartTreeList } from '../../../../api/api'
import { ACCESS_TOKEN } from '@/store/mutation-types' import { ACCESS_TOKEN } from '@/store/mutation-types'
import UploadFile from '@/components/UploadFile'
// 支持预览的文件后缀 // 支持预览的文件后缀
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']
@@ -120,6 +114,7 @@ const FILE_TYPE_PDF = 'pdf'
export default { export default {
name: 'AssessmentLookModal', name: 'AssessmentLookModal',
components: { UploadFile },
mixins: [JeroListMixin], mixins: [JeroListMixin],
data () { data () {
return { return {
@@ -274,41 +269,8 @@ export default {
const text = option.componentOptions.propsData.title || option.componentOptions.propsData.label const text = option.componentOptions.propsData.title || option.componentOptions.propsData.label
return text.toLowerCase().indexOf(input.toLowerCase()) >= 0 return text.toLowerCase().indexOf(input.toLowerCase()) >= 0
}, },
previewFile (record) { handleMaterialClick (record) {
// 截取文件后缀名 this.$refs.uploadFile.open(record.material)
const fileSuffix = record.material_dictText ? record.material_dictText.split('.')[record.material_dictText.split('.').length - 1].toLowerCase() : ''
const canPreview = CAN_PREVIEW_FILE_SUFFIX.some(tt => fileSuffix.toLowerCase() === tt)
// 判断是否为可预览格式的文件
if (!canPreview) {
this.$message.loading('该文件类型不支持预览,正在为您准备下载...').then(() => {
this.handleDownload(record)
})
return
}
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${record.material}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${record.material_dictText}`
// 图片预览,使用自己添加的组件
if (canPreview && FILE_TYPE_IMGS.includes(fileSuffix)) {
this.imageUrl = getFileAccessHttpUrl(record.material)
// 获取viewer实例
const viewer = this.$el.querySelector('.image').$viewer
// 调用show方法进行显示预览图
viewer.show()
// this.$refs.imagePreviewModal.open(file)
return
}
// pdf预览
if (canPreview && FILE_TYPE_PDF.includes(fileSuffix)) {
const url = previewPdf(record.material)
window.open(url)
return
}
// 其余可预览文件仍使用KKFile进行预览
kkFilePreview(fileFullUrl)
},
// 下载
handleDownload (record) {
// 下载文件
downloadFile(`/sys/common/download/${record.material}`, record.material_dictText)
}, },
handleCancel () { handleCancel () {
this.close() this.close()
@@ -15,24 +15,25 @@
<!-- 佐证材料 --> <!-- 佐证材料 -->
<template v-slot:material="{text, record}"> <template v-slot:material="{text, record}">
<a-tooltip overlay-class-name="tooltip-style"> <a v-if="text" class="link-a" @click="handleMaterialClick(record)">{{ $t('view') }}</a>
<template slot="title">{{ text || text === 0 ? record.material_dictText : global.emptyLine }}</template> <div v-else class="table-text">{{ global.emptyLine }}</div>
<a v-if="text" class="link-a" @click="previewFile(record)">{{ record.material_dictText }}</a>
<div v-else class="table-text">{{ global.emptyLine }}</div>
</a-tooltip>
</template> </template>
</j-table> </j-table>
<!-- 文件列表查看 -->
<upload-file ref="uploadFile" disabled></upload-file>
</div> </div>
</template> </template>
<script> <script>
import JTable from '@/components/jero/JTable' import JTable from '@/components/jero/JTable'
import UploadFile from '@/components/UploadFile'
export default { export default {
name: 'FinishAuditBaseInfo', name: 'FinishAuditBaseInfo',
components: { components: {
JTable JTable,
UploadFile
}, },
data () { data () {
return { return {
@@ -185,10 +186,13 @@ export default {
}, },
// 外层获取数据要过校验,返回false表示没有通过校验 // 外层获取数据要过校验,返回false表示没有通过校验
async getDataValidate () { async getDataValidate () {
let data = {} const data = {}
data.detailInfoList = JSON.parse(JSON.stringify(this.dataSource)) data.detailInfoList = JSON.parse(JSON.stringify(this.dataSource))
return data return data
}, },
handleMaterialClick (record) {
this.$refs.uploadFile.open(record.material)
},
handleTableChange (pagination, filters, sorter) { handleTableChange (pagination, filters, sorter) {
// 分页、排序、筛选变化时触发 // 分页、排序、筛选变化时触发
this.ipagination = pagination this.ipagination = pagination
@@ -22,11 +22,8 @@
<!-- 佐证材料 --> <!-- 佐证材料 -->
<template v-slot:material="{text, record}"> <template v-slot:material="{text, record}">
<a-tooltip overlay-class-name="tooltip-style"> <a v-if="text" class="link-a" @click="handleMaterialClick(record)">{{ $t('view') }}</a>
<template slot="title">{{ text || text === 0 ? record.material_dictText : global.emptyLine }}</template> <div v-else class="table-text">{{ global.emptyLine }}</div>
<a v-if="text" class="link-a" @click="previewFile(record)">{{ record.material_dictText }}</a>
<div v-else class="table-text">{{ global.emptyLine }}</div>
</a-tooltip>
</template> </template>
<!-- 操作栏 --> <!-- 操作栏 -->
@@ -96,6 +93,8 @@
</a-form-model> </a-form-model>
<!-- 编辑弹框 --> <!-- 编辑弹框 -->
<main-finder-collect-edit-modal ref="editRef" @ok="editOk"/> <main-finder-collect-edit-modal ref="editRef" @ok="editOk"/>
<!-- 文件列表查看 -->
<upload-file ref="uploadFile" disabled></upload-file>
</div> </div>
</template> </template>
@@ -104,10 +103,11 @@ import JTable from '@/components/jero/JTable'
import UserSelection from '@/components/selection/UserSelection' import UserSelection from '@/components/selection/UserSelection'
import { downFile } from '../../../../api/manage' import { downFile } from '../../../../api/manage'
import MainFinderCollectEditModal from './MainFinderCollectEditModal' import MainFinderCollectEditModal from './MainFinderCollectEditModal'
import UploadFile from '@/components/UploadFile'
export default { export default {
name: 'MainFinderCollectBaseInfo', name: 'MainFinderCollectBaseInfo',
components: { JTable, UserSelection, MainFinderCollectEditModal }, components: { JTable, UserSelection, MainFinderCollectEditModal, UploadFile },
props: { props: {
disabled: { disabled: {
type: Boolean, type: Boolean,
@@ -319,6 +319,9 @@ export default {
handleTableChange (pagination) { handleTableChange (pagination) {
this.ipagination = pagination this.ipagination = pagination
}, },
handleMaterialClick (record) {
this.$refs.uploadFile.open(record.material)
},
handleExportXls (fileName, fileSuffix = '.xls') { handleExportXls (fileName, fileSuffix = '.xls') {
if (!fileName || typeof fileName !== 'string') { if (!fileName || typeof fileName !== 'string') {
fileName = this.$t('exportFile') fileName = this.$t('exportFile')
@@ -22,25 +22,26 @@
<!-- 佐证材料 --> <!-- 佐证材料 -->
<template v-slot:material="{text, record}"> <template v-slot:material="{text, record}">
<a-tooltip overlay-class-name="tooltip-style"> <a v-if="text" class="link-a" @click="handleMaterialClick(record)">{{ $t('view') }}</a>
<template slot="title">{{ text || text === 0 ? record.material_dictText : global.emptyLine }}</template> <div v-else class="table-text">{{ global.emptyLine }}</div>
<a v-if="text" class="link-a" @click="previewFile(record)">{{ record.material_dictText }}</a>
<div v-else class="table-text">{{ global.emptyLine }}</div>
</a-tooltip>
</template> </template>
</j-table> </j-table>
<!-- 文件列表查看 -->
<upload-file ref="uploadFile" disabled></upload-file>
</div> </div>
</template> </template>
<script> <script>
import JTable from '@/components/jero/JTable' import JTable from '@/components/jero/JTable'
import { downFile } from '../../../../api/manage' import { downFile } from '../../../../api/manage'
import UploadFile from '@/components/UploadFile'
export default { export default {
name: 'MainFinderSingleAuditBaseInfo', name: 'MainFinderSingleAuditBaseInfo',
components: { components: {
JTable JTable,
UploadFile
}, },
props: { props: {
disabled: { disabled: {
@@ -203,13 +204,16 @@ export default {
}, },
// 外层获取数据要过校验,返回false表示没有通过校验 // 外层获取数据要过校验,返回false表示没有通过校验
async getDataValidate () { async getDataValidate () {
let data = {} const data = {}
data.detailInfoList = JSON.parse(JSON.stringify(this.dataSource)) data.detailInfoList = JSON.parse(JSON.stringify(this.dataSource))
return data return data
}, },
handleTableChange (pagination) { handleTableChange (pagination) {
this.ipagination = pagination this.ipagination = pagination
}, },
handleMaterialClick (record) {
this.$refs.uploadFile.open(record.material)
},
handleExportXls (fileName, fileSuffix = '.xls') { handleExportXls (fileName, fileSuffix = '.xls') {
if (!fileName || typeof fileName !== 'string') { if (!fileName || typeof fileName !== 'string') {
fileName = this.$t('exportFile') fileName = this.$t('exportFile')