征求意见详情-添加无法预览

This commit is contained in:
SUNJIABIN
2023-06-14 11:15:33 +08:00
parent 37f9da1b71
commit d90e43bc91
@@ -1,7 +1,7 @@
<template>
<div class="AddFileDetails">
<div class="left">
<iframe name = "iframeMap" id="iframeMapViewComponent" v-bind:src="'/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + $route.query.attId)"
<iframe name = "iframeMap" id="iframeMapViewComponent" v-bind:src="iframeUrl"
width="100%" height="100%"
frameborder="0" scrolling="no" ref="iframeDom"
></iframe>
@@ -53,6 +53,7 @@
data () {
return {
options: [],
iframeUrl:"",
opinionContent: { // 抽屉数据
partCode: '',
oldText: '',
@@ -125,8 +126,61 @@
}
}
},
previewShow(attId) {
this.iframeLoading = true
return new Promise((resolve, reject) => {
this.$http.get('lawss/sarStandFile/queryConvertAtt', {
attId: attId
}, {
_this: this
}, res => {
if (res.data) {
let fileObj = {}
fileObj.fileId = res.data.attId
fileObj.fileName = res.data.fileOldName
let fileList = []
let repeatData = 0
if (sessionStorage.getItem('fileInfo')) {
fileList = JSON.parse(sessionStorage.getItem('fileInfo'))
if (fileList != null && fileList.length > 0) {
for (let i = 0; i < fileList.length; i++) {
if (fileList[i].fileId === res.data.attId) {
repeatData = 1
break
}
}
if (repeatData === 0) {
fileList.push(fileObj)
fileList = JSON.stringify(fileList)
sessionStorage.setItem('fileInfo', fileList)
}
}
} else {
fileList.push(fileObj)
fileList = JSON.stringify(fileList)
sessionStorage.setItem('fileInfo', fileList)
}
this.iframeUrl = './static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + res.data.attId)
} else {
this.$message.error('文档未转换成功或该文档无法读取')
}
this.iframeLoading = false
this.$forceUpdate()
resolve(history)
}, e => {
this.iframeLoading = false
this.$forceUpdate()
resolve(history)
this.$message.error('文档未转换成功或该文档无法读取')
})
})
console.log(this.iframeUrl);
},
},
mounted() {
const attId = this.$route.query.attId
this.previewShow(attId)
this.$http.get('SarStandItems/sar-stand-items/querySarItemAndInterpretation', {
standId: this.$route.query.standId,
fileType: this.$route.query.fileType,