Merge branch 'dev_20231219_preview' into 'master'
Dev 20231219 preview See merge request laws-foton-slrs/foton-laws-system-front!137
This commit is contained in:
+76
-20
@@ -1,35 +1,91 @@
|
|||||||
/**
|
/**
|
||||||
* 文件预览
|
* 文件预览
|
||||||
*/
|
*/
|
||||||
import { onlyOfficeUrl,kkFileViewUrl } from '@/sysConfig'
|
import { onlyOfficeUrl, kkFileViewUrl } from '@/sysConfig'
|
||||||
import { getBusStandFileByAttId } from 'api/process'
|
import { getBusStandFileByAttId } from 'api/process'
|
||||||
let Base64 = require('js-base64').Base64;
|
const Base64 = require('js-base64').Base64;
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { Loading } from "element-ui";
|
import { Loading } from 'element-ui';
|
||||||
|
import axios from '@/common/axiosV2'
|
||||||
|
import isMobile from '@/store/isMobile'
|
||||||
|
|
||||||
export default attId => {
|
// 获取转换为pdf的文件
|
||||||
|
function queryConvertAtt (data) {
|
||||||
|
return axios({
|
||||||
|
url: 'api/lawss/sarLawsFile/queryConvertAtt',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
async function preview (attId) {
|
||||||
const loading = Loading.service({
|
const loading = Loading.service({
|
||||||
lock: true,
|
lock: true,
|
||||||
text: '正在加载文件',
|
text: '正在加载文件',
|
||||||
spinner: 'el-icon-loading',
|
spinner: 'el-icon-loading',
|
||||||
})
|
})
|
||||||
getBusStandFileByAttId({
|
const res = await getBusStandFileByAttId({ attId })
|
||||||
attId
|
if (res.ok && res.data) {
|
||||||
}).then(res => {
|
const file = res.data
|
||||||
if(res){
|
if (file.fileSuffix.toLowerCase() === 'pdg') {
|
||||||
const editFileInfo = res.data
|
if (isMobile()) {
|
||||||
if(editFileInfo.fileSuffix.toLowerCase() === 'pdg'){
|
this.$message.warning('pdg文件,不支持手机端预览')
|
||||||
window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl)
|
} else {
|
||||||
}else if(editFileInfo.fileSuffix.toLowerCase() === 'pdf'){
|
window.open('book://ssreader/e0?url=' + file.downLoadUrl)
|
||||||
window.open('./static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id))
|
}
|
||||||
}else {
|
} else if (file.fileSuffix.toLowerCase() === 'pdf') {
|
||||||
const nowTime = new Date().getTime()
|
window.open('./static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + file.id))
|
||||||
// window.open(onlyOfficeUrl+'/onlyOffice?oldFileName=' + editFileInfo.oldFileName + '&fileType=' + editFileInfo.fileSuffix + '&attId=' + editFileInfo.id + '&fileUrl=' + editFileInfo.downLoadUrl + '&key=' + editFileInfo.id + nowTime+'&filePath='+editFileInfo.filePath+'&fileName='+editFileInfo.fileName)
|
} else {
|
||||||
window.open(kkFileViewUrl+'/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl)) + '&watermarkTxt=' + encodeURIComponent(store.getters.userInfo.userName));
|
// onlyoffice在线编辑文件转换为pdf预览 -> kkfileview预览乱码
|
||||||
|
if (file.onlined && file.onlined === 1) {
|
||||||
|
const res = await queryConvertAtt({ attId })
|
||||||
|
if (res.ok && res.data) {
|
||||||
|
window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + res.data.attId))
|
||||||
|
} else {
|
||||||
|
this.$message.error('文档未转换成功或本地读取不到该文档')
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
window.open(kkFileViewUrl + '/onlinePreview?url=' + encodeURIComponent(Base64.encode(file.downLoadUrl)) + '&watermarkTxt=' + encodeURIComponent(store.getters.userInfo.userName));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).finally(() => {
|
|
||||||
loading.close()
|
loading.close()
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default preview;
|
||||||
|
// export default (attId) => {
|
||||||
|
// const loading = Loading.service({
|
||||||
|
// lock: true,
|
||||||
|
// text: '正在加载文件',
|
||||||
|
// spinner: 'el-icon-loading',
|
||||||
|
// })
|
||||||
|
// getBusStandFileByAttId({
|
||||||
|
// attId
|
||||||
|
// }).then(res => {
|
||||||
|
// if(res) {
|
||||||
|
// const editFileInfo = res.data
|
||||||
|
// if(editFileInfo.fileSuffix.toLowerCase() === 'pdg') {
|
||||||
|
// window.open('book://ssreader/e0?url=' + editFileInfo.downLoadUrl)
|
||||||
|
// }else if(editFileInfo.fileSuffix.toLowerCase() === 'pdf') {
|
||||||
|
// window.open('./static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id))
|
||||||
|
// }else {
|
||||||
|
// // const nowTime = new Date().getTime()
|
||||||
|
// // window.open(onlyOfficeUrl+'/onlyOffice?oldFileName=' + editFileInfo.oldFileName + '&fileType=' + editFileInfo.fileSuffix + '&attId=' + editFileInfo.id + '&fileUrl=' + editFileInfo.downLoadUrl + '&key=' + editFileInfo.id + nowTime+'&filePath='+editFileInfo.filePath+'&fileName='+editFileInfo.fileName)
|
||||||
|
// if (res.data && res.data.onlined === 1) {
|
||||||
|
// queryConvertAtt({ attId }).then(res => {
|
||||||
|
// if (res.ok && res.data) {
|
||||||
|
// window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + res.data.attId))
|
||||||
|
// } else {
|
||||||
|
// this.$message.error('文档未转换成功或本地读取不到该文档')
|
||||||
|
// }
|
||||||
|
// }).catch(() => {
|
||||||
|
// this.$message.error('文档未转换成功或本地读取不到该文档')
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// window.open(kkFileViewUrl + '/onlinePreview?url=' + encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl)) + '&watermarkTxt=' + encodeURIComponent(store.getters.userInfo.userName));
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }).finally(() => {
|
||||||
|
// loading.close()
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<!-- eslint-disable -->
|
||||||
<!--企标详情页-->
|
<!--企标详情页-->
|
||||||
<template>
|
<template>
|
||||||
<div class="other-standard-details v-class" :class="{'hidden': !isMoreAwayBtn}">
|
<div class="other-standard-details v-class" :class="{'hidden': !isMoreAwayBtn}">
|
||||||
@@ -1341,6 +1342,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
/* eslint-disable */
|
||||||
import PutQuestionButton from '@/components/PutQuestionButton'
|
import PutQuestionButton from '@/components/PutQuestionButton'
|
||||||
import {dateFormat} from '../../../common/date'
|
import {dateFormat} from '../../../common/date'
|
||||||
import { getBusStandFileByAttId } from 'api/process'
|
import { getBusStandFileByAttId } from 'api/process'
|
||||||
@@ -2590,6 +2592,12 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
openFileInPdf (attId, oldFileName) {
|
openFileInPdf (attId, oldFileName) {
|
||||||
|
if (this.$hasPermission('43ae63abc1b64e6bd5cf3bb75b423bc2')) {
|
||||||
|
this.$preview(attId)
|
||||||
|
} else {
|
||||||
|
this.$message.error('没有在线预览文档权限!')
|
||||||
|
}
|
||||||
|
/*
|
||||||
// 判断是否是图片格式,图片格式不预览,直接下载
|
// 判断是否是图片格式,图片格式不预览,直接下载
|
||||||
let index1 = oldFileName.lastIndexOf('.')
|
let index1 = oldFileName.lastIndexOf('.')
|
||||||
let index2 = oldFileName.length
|
let index2 = oldFileName.length
|
||||||
@@ -2680,6 +2688,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.$message.error('没有在线预览文档权限!')
|
this.$message.error('没有在线预览文档权限!')
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
this.$http.get('lawss/sarBussionessStand/logBuss', {
|
this.$http.get('lawss/sarBussionessStand/logBuss', {
|
||||||
standCode: this.sarStandardsInfoEO.standCode,
|
standCode: this.sarStandardsInfoEO.standCode,
|
||||||
standName: this.sarStandardsInfoEO.standName
|
standName: this.sarStandardsInfoEO.standName
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<!-- eslint-disable -->
|
||||||
<!--政策详情页-->
|
<!--政策详情页-->
|
||||||
<template>
|
<template>
|
||||||
<div class="other-standard-details v-class" :class="{'hidden': !isMoreAwayBtn}">
|
<div class="other-standard-details v-class" :class="{'hidden': !isMoreAwayBtn}">
|
||||||
@@ -906,6 +907,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
/* eslint-disable */
|
||||||
import PutQuestionButton from '@/components/PutQuestionButton'
|
import PutQuestionButton from '@/components/PutQuestionButton'
|
||||||
import {dateFormat} from '../../../common/date'
|
import {dateFormat} from '../../../common/date'
|
||||||
import { getBusStandFileByAttId } from 'api/process'
|
import { getBusStandFileByAttId } from 'api/process'
|
||||||
@@ -1511,6 +1513,12 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
openFileInPdf (attId, oldFileName) {
|
openFileInPdf (attId, oldFileName) {
|
||||||
|
if (this.$hasPermission('fd83032ae5f41a0021b00e93c88edbbg')) {
|
||||||
|
this.$preview(attId)
|
||||||
|
} else {
|
||||||
|
this.$message.error('没有在线预览文档权限!')
|
||||||
|
}
|
||||||
|
/*
|
||||||
// 判断是否是图片格式,图片格式不预览,直接下载
|
// 判断是否是图片格式,图片格式不预览,直接下载
|
||||||
let index1 = oldFileName.lastIndexOf('.')
|
let index1 = oldFileName.lastIndexOf('.')
|
||||||
let index2 = oldFileName.length
|
let index2 = oldFileName.length
|
||||||
@@ -1601,6 +1609,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.$message.error('没有在线预览文档权限!')
|
this.$message.error('没有在线预览文档权限!')
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
},
|
},
|
||||||
showItemsModel (attField) {
|
showItemsModel (attField) {
|
||||||
this.fileType = attField
|
this.fileType = attField
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<!-- eslint-disable -->
|
||||||
<!--国内标准法规详情页-->
|
<!--国内标准法规详情页-->
|
||||||
<template>
|
<template>
|
||||||
<div :class="{'hidden': !isMoreAwayBtn}" class="other-standard-details v-class">
|
<div :class="{'hidden': !isMoreAwayBtn}" class="other-standard-details v-class">
|
||||||
@@ -1820,6 +1821,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
/* eslint-disable */
|
||||||
import PutQuestionButton from '@/components/PutQuestionButton'
|
import PutQuestionButton from '@/components/PutQuestionButton'
|
||||||
import CustomSVPPS from '@/components/CustomFormComponents/SVPPS'
|
import CustomSVPPS from '@/components/CustomFormComponents/SVPPS'
|
||||||
import CustomSelectArray from '@/components/CustomFormComponents/SelectArray'
|
import CustomSelectArray from '@/components/CustomFormComponents/SelectArray'
|
||||||
@@ -3269,6 +3271,14 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
openFileInPdf(attId, oldFileName) {
|
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 index1 = oldFileName.lastIndexOf('.')
|
||||||
let index2 = oldFileName.length
|
let index2 = oldFileName.length
|
||||||
@@ -3391,6 +3401,7 @@ export default {
|
|||||||
this.$message.error('没有在线预览文档权限!')
|
this.$message.error('没有在线预览文档权限!')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
if (this.$route.params.pageType === 'INLAND_STAND') {
|
if (this.$route.params.pageType === 'INLAND_STAND') {
|
||||||
let standNumber = this.sarStandardsInfoEO.standSortShow + ' ' + this.sarStandardsInfoEO.standNumber + '-' + this.sarStandardsInfoEO.standYear || this.sarStandardsInfoEO.standSort + ' ' + this.sarStandardsInfoEO.standNumber
|
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', {
|
this.$http.get('sarStandardsInfo/sar-standards-info/logInvalid', {
|
||||||
|
|||||||
@@ -2836,6 +2836,8 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
openFileInPdf(attId, oldFileName) {
|
openFileInPdf(attId, oldFileName) {
|
||||||
|
this.$preview(attId)
|
||||||
|
/*
|
||||||
// 判断是否是图片格式,图片格式不预览,直接下载
|
// 判断是否是图片格式,图片格式不预览,直接下载
|
||||||
let index1 = oldFileName.lastIndexOf('.')
|
let index1 = oldFileName.lastIndexOf('.')
|
||||||
let index2 = oldFileName.length
|
let index2 = oldFileName.length
|
||||||
@@ -2878,6 +2880,7 @@
|
|||||||
} else {
|
} else {
|
||||||
this.$message.warning('PDG文件,不支持手机端预览')
|
this.$message.warning('PDG文件,不支持手机端预览')
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
},
|
},
|
||||||
getFileInfo(fileId) {
|
getFileInfo(fileId) {
|
||||||
Axios({
|
Axios({
|
||||||
|
|||||||
@@ -1269,6 +1269,8 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
openFileInPdf(attId, oldFileName) {
|
openFileInPdf(attId, oldFileName) {
|
||||||
|
this.$preview(attId)
|
||||||
|
/*
|
||||||
// 判断是否是图片格式,图片格式不预览,直接下载
|
// 判断是否是图片格式,图片格式不预览,直接下载
|
||||||
let index1 = oldFileName.lastIndexOf('.')
|
let index1 = oldFileName.lastIndexOf('.')
|
||||||
let index2 = oldFileName.length
|
let index2 = oldFileName.length
|
||||||
@@ -1298,6 +1300,7 @@
|
|||||||
}else {
|
}else {
|
||||||
this.$message.warning('PDG文件,不支持手机端预览')
|
this.$message.warning('PDG文件,不支持手机端预览')
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
},
|
},
|
||||||
showItemsModel(attField) {
|
showItemsModel(attField) {
|
||||||
if (attField) {
|
if (attField) {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<!-- eslint-disable -->
|
||||||
<!--征求意见详情-->
|
<!--征求意见详情-->
|
||||||
<template>
|
<template>
|
||||||
<div class="consultationDetails">
|
<div class="consultationDetails">
|
||||||
@@ -270,6 +271,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
/* eslint-disable */
|
||||||
import { mapGetters } from "vuex";
|
import { mapGetters } from "vuex";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -570,7 +572,10 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleQueryPdf(file){
|
handleQueryPdf(file){
|
||||||
|
this.$preview(file.attId)
|
||||||
|
/*
|
||||||
window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + file.attId))
|
window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + file.attId))
|
||||||
|
*/
|
||||||
},
|
},
|
||||||
isVisible(e) {
|
isVisible(e) {
|
||||||
if (e.target.visibilityState === "visible") {
|
if (e.target.visibilityState === "visible") {
|
||||||
|
|||||||
Reference in New Issue
Block a user