fix(法规库详情): 统一预览方式

This commit is contained in:
zyn
2023-12-18 17:41:53 +08:00
parent 134a17c869
commit a2e6a74311
4 changed files with 34 additions and 0 deletions
@@ -1,3 +1,4 @@
<!-- eslint-disable -->
<!--企标详情页-->
<template>
<div class="other-standard-details v-class" :class="{'hidden': !isMoreAwayBtn}">
@@ -1341,6 +1342,7 @@
</div>
</template>
<script>
/* eslint-disable */
import PutQuestionButton from '@/components/PutQuestionButton'
import {dateFormat} from '../../../common/date'
import { getBusStandFileByAttId } from 'api/process'
@@ -2590,6 +2592,12 @@ export default {
})
},
openFileInPdf (attId, oldFileName) {
if (this.$hasPermission('43ae63abc1b64e6bd5cf3bb75b423bc2')) {
this.$preview(attId)
} else {
this.$message.error('没有在线预览文档权限!')
}
/*
// 判断是否是图片格式,图片格式不预览,直接下载
let index1 = oldFileName.lastIndexOf('.')
let index2 = oldFileName.length
@@ -2680,6 +2688,7 @@ export default {
} else {
this.$message.error('没有在线预览文档权限!')
}
*/
this.$http.get('lawss/sarBussionessStand/logBuss', {
standCode: this.sarStandardsInfoEO.standCode,
standName: this.sarStandardsInfoEO.standName
@@ -1,3 +1,4 @@
<!-- eslint-disable -->
<!--政策详情页-->
<template>
<div class="other-standard-details v-class" :class="{'hidden': !isMoreAwayBtn}">
@@ -906,6 +907,7 @@
</div>
</template>
<script>
/* eslint-disable */
import PutQuestionButton from '@/components/PutQuestionButton'
import {dateFormat} from '../../../common/date'
import { getBusStandFileByAttId } from 'api/process'
@@ -1511,6 +1513,12 @@ export default {
})
},
openFileInPdf (attId, oldFileName) {
if (this.$hasPermission('fd83032ae5f41a0021b00e93c88edbbg')) {
this.$preview(attId)
} else {
this.$message.error('没有在线预览文档权限!')
}
/*
// 判断是否是图片格式,图片格式不预览,直接下载
let index1 = oldFileName.lastIndexOf('.')
let index2 = oldFileName.length
@@ -1601,6 +1609,7 @@ export default {
} else {
this.$message.error('没有在线预览文档权限!')
}
*/
},
showItemsModel (attField) {
this.fileType = attField
@@ -1,3 +1,4 @@
<!-- eslint-disable -->
<!--国内标准法规详情页-->
<template>
<div :class="{'hidden': !isMoreAwayBtn}" class="other-standard-details v-class">
@@ -1820,6 +1821,7 @@
</div>
</template>
<script>
/* eslint-disable */
import PutQuestionButton from '@/components/PutQuestionButton'
import CustomSVPPS from '@/components/CustomFormComponents/SVPPS'
import CustomSelectArray from '@/components/CustomFormComponents/SelectArray'
@@ -3269,6 +3271,14 @@ export default {
})
},
openFileInPdf(attId, oldFileName) {
if (this.$route.params.pageType === 'INLAND_STAND' && this.$hasPermission('2d6ab9d465ab73d415194e1ca4313793')) {
this.$preview(attId)
} else if (this.$route.params.pageType === 'FOREIGN_STAND' && this.$hasPermission('ee684b4a9975f5d8a6dfe898c0332f98')) {
this.$preview(attId)
} else {
this.$message.error('没有在线预览文档权限!')
}
/*
// 判断是否是图片格式,图片格式不预览,直接下载
let index1 = oldFileName.lastIndexOf('.')
let index2 = oldFileName.length
@@ -3391,6 +3401,7 @@ export default {
this.$message.error('没有在线预览文档权限!')
}
}
*/
if (this.$route.params.pageType === 'INLAND_STAND') {
let standNumber = this.sarStandardsInfoEO.standSortShow + ' ' + this.sarStandardsInfoEO.standNumber + '-' + this.sarStandardsInfoEO.standYear || this.sarStandardsInfoEO.standSort + ' ' + this.sarStandardsInfoEO.standNumber
this.$http.get('sarStandardsInfo/sar-standards-info/logInvalid', {
@@ -1,3 +1,4 @@
<!-- eslint-disable -->
<!--征求意见详情-->
<template>
<div class="consultationDetails">
@@ -270,6 +271,7 @@
</template>
<script>
/* eslint-disable */
import { mapGetters } from "vuex";
export default {
@@ -570,7 +572,10 @@ export default {
})
},
handleQueryPdf(file){
this.$preview(file.attId)
/*
window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + file.attId))
*/
},
isVisible(e) {
if (e.target.visibilityState === "visible") {