feat: There is no way the,

This commit is contained in:
Superman_Main
2021-11-29 22:20:47 +08:00
parent 1064e572be
commit 8bc370ad3c
3 changed files with 250 additions and 98 deletions
@@ -967,6 +967,8 @@
<script> <script>
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'
const sarType = 'BUSS' const sarType = 'BUSS'
export default { export default {
@@ -1552,6 +1554,21 @@ export default {
}, e => { }, e => {
}) })
}, },
getBusStandFileByAttId(attId) {
return new Promise((resolve, reject) => {
getBusStandFileByAttId({
attId
}).then(res => {
if (res.ok) {
resolve(res.data)
} else {
reject()
}
}).catch(e => {
reject(e)
})
})
},
openFileInPdf (attId, oldFileName) { openFileInPdf (attId, oldFileName) {
// 判断是否是图片格式,图片格式不预览,直接下载 // 判断是否是图片格式,图片格式不预览,直接下载
let index1 = oldFileName.lastIndexOf('.') let index1 = oldFileName.lastIndexOf('.')
@@ -1568,6 +1585,39 @@ export default {
} }
// 缺少文件 // 缺少文件
if (this.$hasPermission('43ae63abc1b64e6bd5cf3bb75b423bc2')) { if (this.$hasPermission('43ae63abc1b64e6bd5cf3bb75b423bc2')) {
if (fileSuffix === '.PDG' || fileSuffix === '.pdg') {
this.getBusStandFileByAttId(attId)
.then(res => {
if(res){
const editFileInfo = res
console.log(editFileInfo)
if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){
window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl)
}else {
const nowTime = new Date().getTime()
// window.open('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl)));
// window.open('/static/onlyOffice/onlinePreview.html?oldFileName=' + editFileInfo.oldFileName + '&fileType=' + editFileInfo.fileSuffix + '&attId=' + editFileInfo.id + '&fileUrl=' + editFileInfo.downLoadUrl + '&key=' + editFileInfo.id + nowTime+'&filePath='+editFileInfo.filePath+'&fileName='+editFileInfo.fileName)
}
// window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id))
}
// switch (res.convertState) {
// case 'ERROR':
// this.$message.warning('文档转换失败')
// break
// case 'LODING':
// this.$message.info('文档转换中,请稍后查看')
// break
// case 'SUCCESS':
// const { convertFileInfo } = res
// window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + convertFileInfo.id))
// break
// }
}).catch(e => {
console.log(e)
this.$message.warning('文件不存在,预览失败')
})
}else {
this.$http.get('lawss/sarBussStandFile/queryConvertAtt', { this.$http.get('lawss/sarBussStandFile/queryConvertAtt', {
attId: attId attId: attId
}, { }, {
@@ -1606,6 +1656,7 @@ export default {
}, e => { }, e => {
this.$message.error('文档未转换成功或本地读取不到该文档') this.$message.error('文档未转换成功或本地读取不到该文档')
}) })
}
} else { } else {
this.$message.error('没有在线预览文档权限!') this.$message.error('没有在线预览文档权限!')
} }
@@ -894,6 +894,8 @@
<script> <script>
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'
const sarType = 'LAWS_STAND' const sarType = 'LAWS_STAND'
export default { export default {
@@ -1471,6 +1473,21 @@ export default {
}, e => { }, e => {
}) })
}, },
getBusStandFileByAttId(attId) {
return new Promise((resolve, reject) => {
getBusStandFileByAttId({
attId
}).then(res => {
if (res.ok) {
resolve(res.data)
} else {
reject()
}
}).catch(e => {
reject(e)
})
})
},
openFileInPdf (attId, oldFileName) { openFileInPdf (attId, oldFileName) {
// 判断是否是图片格式,图片格式不预览,直接下载 // 判断是否是图片格式,图片格式不预览,直接下载
let index1 = oldFileName.lastIndexOf('.') let index1 = oldFileName.lastIndexOf('.')
@@ -1487,6 +1504,39 @@ export default {
} }
// 缺少文件 // 缺少文件
if (this.$hasPermission('fd83032ae5f41a0021b00e93c88edbbg')) { if (this.$hasPermission('fd83032ae5f41a0021b00e93c88edbbg')) {
if (fileSuffix === '.PDG' || fileSuffix === '.pdg') {
this.getBusStandFileByAttId(attId)
.then(res => {
if(res){
const editFileInfo = res
console.log(editFileInfo)
if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){
window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl)
}else {
const nowTime = new Date().getTime()
// window.open('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl)));
// window.open('/static/onlyOffice/onlinePreview.html?oldFileName=' + editFileInfo.oldFileName + '&fileType=' + editFileInfo.fileSuffix + '&attId=' + editFileInfo.id + '&fileUrl=' + editFileInfo.downLoadUrl + '&key=' + editFileInfo.id + nowTime+'&filePath='+editFileInfo.filePath+'&fileName='+editFileInfo.fileName)
}
// window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id))
}
// switch (res.convertState) {
// case 'ERROR':
// this.$message.warning('文档转换失败')
// break
// case 'LODING':
// this.$message.info('文档转换中,请稍后查看')
// break
// case 'SUCCESS':
// const { convertFileInfo } = res
// window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + convertFileInfo.id))
// break
// }
}).catch(e => {
console.log(e)
this.$message.warning('文件不存在,预览失败')
})
}else {
this.$http.get('lawss/sarLawsFile/queryConvertAtt', { this.$http.get('lawss/sarLawsFile/queryConvertAtt', {
attId: attId attId: attId
}, { }, {
@@ -1525,6 +1575,7 @@ export default {
}, e => { }, e => {
this.$message.error('文档未转换成功或本地读取不到该文档') this.$message.error('文档未转换成功或本地读取不到该文档')
}) })
}
} else { } else {
this.$message.error('没有在线预览文档权限!') this.$message.error('没有在线预览文档权限!')
} }
@@ -1405,6 +1405,8 @@ import CustomSVPPS from '@/components/CustomFormComponents/SVPPS'
import CustomOrg from '@/components/CustomFormComponents/OrgTree' import CustomOrg from '@/components/CustomFormComponents/OrgTree'
import {dateFormat} from '@/common/date' import {dateFormat} from '@/common/date'
import RelatedTermsSelect from './components/RelatedTermsSelect' import RelatedTermsSelect from './components/RelatedTermsSelect'
import { getBusStandFileByAttId } from 'api/process'
export default { export default {
name: 'OtherStandardDetails', name: 'OtherStandardDetails',
@@ -2442,6 +2444,21 @@ export default {
}, e => { }, e => {
}) })
}, },
getBusStandFileByAttId(attId) {
return new Promise((resolve, reject) => {
getBusStandFileByAttId({
attId
}).then(res => {
if (res.ok) {
resolve(res.data)
} else {
reject()
}
}).catch(e => {
reject(e)
})
})
},
openFileInPdf(attId, oldFileName) { openFileInPdf(attId, oldFileName) {
// 判断是否是图片格式,图片格式不预览,直接下载 // 判断是否是图片格式,图片格式不预览,直接下载
let index1 = oldFileName.lastIndexOf('.') let index1 = oldFileName.lastIndexOf('.')
@@ -2456,10 +2473,42 @@ export default {
this.downloadFile(attId) this.downloadFile(attId)
return true return true
} }
// 缺少文件 // 缺少文件
if (this.$route.params.pageType === 'INLAND_STAND') { if (this.$route.params.pageType === 'INLAND_STAND') {
if (this.$hasPermission('2d6ab9d465ab73d415194e1ca4313793')) { if (this.$hasPermission('2d6ab9d465ab73d415194e1ca4313793')) {
if (fileSuffix === '.PDG' || fileSuffix === '.pdg') {
this.getBusStandFileByAttId(attId)
.then(res => {
if(res){
const editFileInfo = res
console.log(editFileInfo)
if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){
window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl)
}else {
const nowTime = new Date().getTime()
// window.open('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl)));
// window.open('/static/onlyOffice/onlinePreview.html?oldFileName=' + editFileInfo.oldFileName + '&fileType=' + editFileInfo.fileSuffix + '&attId=' + editFileInfo.id + '&fileUrl=' + editFileInfo.downLoadUrl + '&key=' + editFileInfo.id + nowTime+'&filePath='+editFileInfo.filePath+'&fileName='+editFileInfo.fileName)
}
// window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id))
}
// switch (res.convertState) {
// case 'ERROR':
// this.$message.warning('文档转换失败')
// break
// case 'LODING':
// this.$message.info('文档转换中,请稍后查看')
// break
// case 'SUCCESS':
// const { convertFileInfo } = res
// window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + convertFileInfo.id))
// break
// }
}).catch(e => {
console.log(e)
this.$message.warning('文件不存在,预览失败')
})
}else {
this.$http.get('lawss/sarStandFile/queryConvertAtt', { this.$http.get('lawss/sarStandFile/queryConvertAtt', {
attId: attId attId: attId
}, { }, {
@@ -2500,6 +2549,7 @@ export default {
}, e => { }, e => {
this.$message.error('文档未转换成功或本地读取不到该文档') this.$message.error('文档未转换成功或本地读取不到该文档')
}) })
}
} else { } else {
this.$message.error('没有在线预览文档权限!') this.$message.error('没有在线预览文档权限!')
} }