From d23d312d7066e96240292a344b5471bca563be68 Mon Sep 17 00:00:00 2001 From: zhutianqi Date: Thu, 23 Dec 2021 10:06:48 +0800 Subject: [PATCH] commit --- src/common/index.js | 7 +++ src/common/preview/index.js | 23 +++++++++ .../details/otherStandardDetails/index.vue | 17 +------ .../pages/creatProcess/bzdy/step1-1.vue | 34 +------------ .../pages/creatProcess/bzdy/step1.vue | 35 ++----------- .../pages/creatProcess/bzdy/step2.vue | 32 +----------- .../pages/creatProcess/bzdy/step3.vue | 51 ++----------------- .../pages/creatProcess/bzdy/step4.vue | 51 ++----------------- .../pages/creatProcess/bzdy/step5.vue | 34 +------------ .../pages/creatProcess/bzdy/step6.vue | 34 +------------ .../pages/creatProcess/bzdy/step7.vue | 33 +----------- .../pages/creatProcess/bzdy/step8.vue | 33 +----------- .../pages/creatProcess/bzdy/step9.vue | 33 +----------- .../pages/creatProcess/bzzqyj/step1-1.vue | 36 +------------ .../pages/creatProcess/bzzqyj/step1.vue | 36 +------------ .../pages/creatProcess/bzzqyj/step2.vue | 36 +------------ .../pages/creatProcess/bzzqyj/step3.vue | 36 +------------ .../pages/creatProcess/bzzqyj/step4-1.vue | 36 +------------ .../pages/creatProcess/bzzqyj/step4-2.vue | 36 +------------ .../pages/creatProcess/bzzqyj/step4.vue | 36 +------------ .../pages/creatProcess/bzzqyj/step5.vue | 36 +------------ .../pages/creatProcess/bzzqyj/step6.vue | 36 +------------ .../pages/creatProcess/bzzqyj/step7.vue | 36 +------------ .../pages/creatProcess/bzzqyj/step8.vue | 36 +------------ .../pages/creatProcess/bzzqyj/step9.vue | 36 +------------ 25 files changed, 77 insertions(+), 772 deletions(-) create mode 100644 src/common/preview/index.js diff --git a/src/common/index.js b/src/common/index.js index b0254e402..9e702c2e8 100644 --- a/src/common/index.js +++ b/src/common/index.js @@ -5,6 +5,8 @@ import base64 from './base64' import dateFormat from './date' import hasPermission from './hasPermission' +import preview from './preview' + // 表单验证 import verify from './verify' const install = function (Vue) { @@ -31,6 +33,11 @@ const install = function (Vue) { get () { return hasPermission } + }, + $preview: { + get () { + return preview + } } }) } diff --git a/src/common/preview/index.js b/src/common/preview/index.js new file mode 100644 index 000000000..d050e3a01 --- /dev/null +++ b/src/common/preview/index.js @@ -0,0 +1,23 @@ +/** + * 文件预览 + */ +import { onlyOfficeUrl } from '@/sysConfig' +import { getBusStandFileByAttId } from 'api/process' +export default attId => { + getBusStandFileByAttId({ + attId + }).then(res => { + if(res){ + const editFileInfo = res + 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) + } + } + }).catch(e => { + }) +} diff --git a/src/pages/details/otherStandardDetails/index.vue b/src/pages/details/otherStandardDetails/index.vue index 3706a9596..7a2fd5c71 100644 --- a/src/pages/details/otherStandardDetails/index.vue +++ b/src/pages/details/otherStandardDetails/index.vue @@ -2789,7 +2789,6 @@ export default { this.downloadFile(attId) return true } - // 缺少文件 if (this.$route.params.pageType === 'INLAND_STAND') { if (this.$hasPermission('2d6ab9d465ab73d415194e1ca4313793')) { @@ -2803,23 +2802,9 @@ export default { 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(onlyOfficeUrl+'/onlyOffice?oldFileName=' + editFileInfo.oldFileName + '&fileType=' + editFileInfo.fileSuffix + '&attId=' + editFileInfo.id + '&fileUrl=' + editFileInfo.downLoadUrl + '&key=' + editFileInfo.id + nowTime+'&filePath='+editFileInfo.filePath+'&fileName='+editFileInfo.fileName) + 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) } - // 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('文件不存在,预览失败') diff --git a/src/pages/processCenter/pages/creatProcess/bzdy/step1-1.vue b/src/pages/processCenter/pages/creatProcess/bzdy/step1-1.vue index 10dd436f3..4e254bf55 100644 --- a/src/pages/processCenter/pages/creatProcess/bzdy/step1-1.vue +++ b/src/pages/processCenter/pages/creatProcess/bzdy/step1-1.vue @@ -255,7 +255,7 @@ import ProcessHeader from '../../components/ProcessHeader' import ProcessFooter from '../../components/ProcessFooter' import ProcessTitle from '../../components/ProcessTitle' - import { saveTaskFirst, queryTaskFirst, getBusStandFileByAttId,taskDel } from 'api/process' + import { saveTaskFirst, queryTaskFirst,taskDel } from 'api/process' export default { name: "bzdyStep1-1", @@ -341,39 +341,9 @@ this.$message.warning('文件不存在,下载失败') } }, - getBusStandFileByAttId(attId) { - return new Promise((resolve, reject) => { - getBusStandFileByAttId({ - attId - }).then(res => { - if (res.ok) { - resolve(res.data) - } else { - reject() - } - }).catch(e => { - reject(e) - }) - }) - }, handlePreview(file) { const attId = file.attId - this.getBusStandFileByAttId(attId) - .then(res => { - if(res){ - const editFileInfo = res - if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){ - window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl) - }else if(editFileInfo.fileSuffix === 'pdf' || editFileInfo.fileSuffix === '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) - } - } - }).catch(e => { - this.$message.warning('文件不存在,预览失败') - }) + this.$preview(attId) }, foldForm() { this.foldFormFlag = !this.foldFormFlag diff --git a/src/pages/processCenter/pages/creatProcess/bzdy/step1.vue b/src/pages/processCenter/pages/creatProcess/bzdy/step1.vue index 3f9cd14c1..3c7b85390 100644 --- a/src/pages/processCenter/pages/creatProcess/bzdy/step1.vue +++ b/src/pages/processCenter/pages/creatProcess/bzdy/step1.vue @@ -257,7 +257,8 @@ import ProcessHeader from '../../components/ProcessHeader' import ProcessFooter from '../../components/ProcessFooter' import ProcessTitle from '../../components/ProcessTitle' import { saveTaskFirst } from 'api/process' -import { getBusStandFileByAttId,taskDel } from 'api/process' +import { taskDel } from 'api/process' +// import { onlyOfficeUrl } from '@/sysConfig' export default { name: "bzdyStep1", data() { @@ -344,39 +345,9 @@ export default { this.$message.warning('文件不存在,下载失败') } }, - getBusStandFileByAttId(attId) { - return new Promise((resolve, reject) => { - getBusStandFileByAttId({ - attId - }).then(res => { - if (res.ok) { - resolve(res.data) - } else { - reject() - } - }).catch(e => { - reject(e) - }) - }) - }, handlePreview(file) { const attId = file.attId - this.getBusStandFileByAttId(attId) - .then(res => { - if(res){ - const editFileInfo = res - if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){ - window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl) - }else if(editFileInfo.fileSuffix === 'pdf' || editFileInfo.fileSuffix === '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) - } - } - }).catch(e => { - this.$message.warning('文件不存在,预览失败') - }) + this.$preview(attId) }, foldForm() { this.foldFormFlag = !this.foldFormFlag diff --git a/src/pages/processCenter/pages/creatProcess/bzdy/step2.vue b/src/pages/processCenter/pages/creatProcess/bzdy/step2.vue index 28bb80758..60eb8e340 100644 --- a/src/pages/processCenter/pages/creatProcess/bzdy/step2.vue +++ b/src/pages/processCenter/pages/creatProcess/bzdy/step2.vue @@ -236,39 +236,9 @@ ProcessTitle }, methods: { - getBusStandFileByAttId(attId) { - return new Promise((resolve, reject) => { - getBusStandFileByAttId({ - attId - }).then(res => { - if (res.ok) { - resolve(res.data) - } else { - reject() - } - }).catch(e => { - reject(e) - }) - }) - }, clickButtonToUpload(file) { const attId = file.attId - this.getBusStandFileByAttId(attId) - .then(res => { - if(res){ - const editFileInfo = res - if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){ - window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl) - }else if(editFileInfo.fileSuffix === 'pdf' || editFileInfo.fileSuffix === '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) - } - } - }).catch(e => { - this.$message.warning('文件不存在,预览失败') - }) + this.$preview(attId) }, handleTransfer() { this.drawerModal = true diff --git a/src/pages/processCenter/pages/creatProcess/bzdy/step3.vue b/src/pages/processCenter/pages/creatProcess/bzdy/step3.vue index 19e3b24dd..cf5830f9f 100644 --- a/src/pages/processCenter/pages/creatProcess/bzdy/step3.vue +++ b/src/pages/processCenter/pages/creatProcess/bzdy/step3.vue @@ -246,7 +246,7 @@ import ProcessHeader from '../../components/ProcessHeader' import ProcessFooter from '../../components/ProcessFooter' import ProcessTitle from '../../components/ProcessTitle' - import {inboundLiaisonDetail,processCreateStand,saveTaskForPub,changeAssigneeNew,execTask,getBusStandFileByAttId} from 'api/process' + import {inboundLiaisonDetail,processCreateStand,saveTaskForPub,changeAssigneeNew,execTask} from 'api/process' import axios from "axios"; export default { @@ -295,58 +295,13 @@ ProcessTitle }, methods: { - getBusStandFileByAttId(attId) { - return new Promise((resolve, reject) => { - getBusStandFileByAttId({ - attId - }).then(res => { - if (res.ok) { - resolve(res.data) - } else { - reject() - } - }).catch(e => { - reject(e) - }) - }) - }, clickButtonToUpload2(file) { const attId = file - this.getBusStandFileByAttId(attId) - .then(res => { - if(res){ - const editFileInfo = res - if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){ - window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl) - }else if(editFileInfo.fileSuffix === 'pdf' || editFileInfo.fileSuffix === '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) - } - } - }).catch(e => { - this.$message.warning('文件不存在,预览失败') - }) + this.$preview(attId) }, clickButtonToUpload(file) { const attId = file.attId - this.getBusStandFileByAttId(attId) - .then(res => { - if(res){ - const editFileInfo = res - if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){ - window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl) - }else if(editFileInfo.fileSuffix === 'pdf' || editFileInfo.fileSuffix === '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) - } - } - }).catch(e => { - this.$message.warning('文件不存在,预览失败') - }) + this.$preview(attId) }, handleTransfer() { this.drawerModal = true diff --git a/src/pages/processCenter/pages/creatProcess/bzdy/step4.vue b/src/pages/processCenter/pages/creatProcess/bzdy/step4.vue index fff44ed08..9ddf7ef07 100644 --- a/src/pages/processCenter/pages/creatProcess/bzdy/step4.vue +++ b/src/pages/processCenter/pages/creatProcess/bzdy/step4.vue @@ -227,7 +227,7 @@ import ProcessHeader from '../../components/ProcessHeader' import ProcessFooter from '../../components/ProcessFooter' import ProcessTitle from '../../components/ProcessTitle' - import {inboundLiaisonDetail,processCreateStand,saveTaskForPub,changeAssigneeNew,getBusStandFileByAttId} from 'api/process' + import {inboundLiaisonDetail,processCreateStand,saveTaskForPub,changeAssigneeNew} from 'api/process' import axios from "axios"; export default { @@ -271,58 +271,13 @@ ProcessTitle }, methods: { - getBusStandFileByAttId(attId) { - return new Promise((resolve, reject) => { - getBusStandFileByAttId({ - attId - }).then(res => { - if (res.ok) { - resolve(res.data) - } else { - reject() - } - }).catch(e => { - reject(e) - }) - }) - }, clickButtonToUpload2(file) { const attId = file - this.getBusStandFileByAttId(attId) - .then(res => { - if(res){ - const editFileInfo = res - if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){ - window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl) - }else if(editFileInfo.fileSuffix === 'pdf' || editFileInfo.fileSuffix === '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) - } - } - }).catch(e => { - this.$message.warning('文件不存在,预览失败') - }) + this.$preview(attId) }, clickButtonToUpload(file) { const attId = file.attId - this.getBusStandFileByAttId(attId) - .then(res => { - if(res){ - const editFileInfo = res - if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){ - window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl) - }else if(editFileInfo.fileSuffix === 'pdf' || editFileInfo.fileSuffix === '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) - } - } - }).catch(e => { - this.$message.warning('文件不存在,预览失败') - }) + this.$preview(attId) }, handleTransfer() { this.drawerModal = true diff --git a/src/pages/processCenter/pages/creatProcess/bzdy/step5.vue b/src/pages/processCenter/pages/creatProcess/bzdy/step5.vue index 28e0de1af..6db8ba6af 100644 --- a/src/pages/processCenter/pages/creatProcess/bzdy/step5.vue +++ b/src/pages/processCenter/pages/creatProcess/bzdy/step5.vue @@ -233,7 +233,7 @@ import ProcessHeader from '../../components/ProcessHeader' import ProcessFooter from '../../components/ProcessFooter' import ProcessTitle from '../../components/ProcessTitle' - import {inboundLiaisonDetail,saveTaskForPub,changeAssigneeNew,getBusStandFileByAttId} from 'api/process' + import {inboundLiaisonDetail,saveTaskForPub,changeAssigneeNew} from 'api/process' import axios from "axios"; export default { @@ -272,39 +272,9 @@ ProcessTitle }, methods: { - getBusStandFileByAttId(attId) { - return new Promise((resolve, reject) => { - getBusStandFileByAttId({ - attId - }).then(res => { - if (res.ok) { - resolve(res.data) - } else { - reject() - } - }).catch(e => { - reject(e) - }) - }) - }, clickButtonToUpload2(file) { const attId = file - this.getBusStandFileByAttId(attId) - .then(res => { - if(res){ - const editFileInfo = res - if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){ - window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl) - }else if(editFileInfo.fileSuffix === 'pdf' || editFileInfo.fileSuffix === '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) - } - } - }).catch(e => { - this.$message.warning('文件不存在,预览失败') - }) + this.$preview(attId) }, handleTransfer() { this.drawerModal = true diff --git a/src/pages/processCenter/pages/creatProcess/bzdy/step6.vue b/src/pages/processCenter/pages/creatProcess/bzdy/step6.vue index 7a23b5b20..d8819f8f6 100644 --- a/src/pages/processCenter/pages/creatProcess/bzdy/step6.vue +++ b/src/pages/processCenter/pages/creatProcess/bzdy/step6.vue @@ -229,7 +229,7 @@ import ProcessHeader from '../../components/ProcessHeader' import ProcessFooter from '../../components/ProcessFooter' import ProcessTitle from '../../components/ProcessTitle' - import {inboundLiaisonDetail,changeAssigneeNew,getBusStandFileByAttId} from 'api/process' + import {inboundLiaisonDetail,changeAssigneeNew} from 'api/process' import axios from "axios"; export default { @@ -269,39 +269,9 @@ ProcessTitle }, methods: { - getBusStandFileByAttId(attId) { - return new Promise((resolve, reject) => { - getBusStandFileByAttId({ - attId - }).then(res => { - if (res.ok) { - resolve(res.data) - } else { - reject() - } - }).catch(e => { - reject(e) - }) - }) - }, clickButtonToUpload2(file) { const attId = file - this.getBusStandFileByAttId(attId) - .then(res => { - if(res){ - const editFileInfo = res - if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){ - window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl) - }else if(editFileInfo.fileSuffix === 'pdf' || editFileInfo.fileSuffix === '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) - } - } - }).catch(e => { - this.$message.warning('文件不存在,预览失败') - }) + this.$preview(attId) }, handleTransfer() { this.drawerModal = true diff --git a/src/pages/processCenter/pages/creatProcess/bzdy/step7.vue b/src/pages/processCenter/pages/creatProcess/bzdy/step7.vue index 4ac490a6f..536d2f62d 100644 --- a/src/pages/processCenter/pages/creatProcess/bzdy/step7.vue +++ b/src/pages/processCenter/pages/creatProcess/bzdy/step7.vue @@ -229,7 +229,7 @@ import ProcessHeader from '../../components/ProcessHeader' import ProcessFooter from '../../components/ProcessFooter' import ProcessTitle from '../../components/ProcessTitle' - import {inboundLiaisonDetail,changeAssigneeNew,getBusStandFileByAttId} from 'api/process' + import {inboundLiaisonDetail,changeAssigneeNew} from 'api/process' import axios from "axios"; export default { @@ -269,38 +269,9 @@ ProcessTitle }, methods: { - getBusStandFileByAttId(attId) { - return new Promise((resolve, reject) => { - getBusStandFileByAttId({ - attId - }).then(res => { - if (res.ok) { - resolve(res.data) - } else { - reject() - } - }).catch(e => { - reject(e) - }) - }) - }, clickButtonToUpload2(file) { const attId = file - this.getBusStandFileByAttId(attId) - .then(res => { - if(res){ - const editFileInfo = res - if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){ - window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl) - }else if(editFileInfo.fileSuffix === 'pdf' || editFileInfo.fileSuffix === '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)} - } - }).catch(e => { - this.$message.warning('文件不存在,预览失败') - }) + this.$preview(attId) }, handleTransfer() { this.drawerModal = true diff --git a/src/pages/processCenter/pages/creatProcess/bzdy/step8.vue b/src/pages/processCenter/pages/creatProcess/bzdy/step8.vue index 73792226e..fe192f15f 100644 --- a/src/pages/processCenter/pages/creatProcess/bzdy/step8.vue +++ b/src/pages/processCenter/pages/creatProcess/bzdy/step8.vue @@ -229,7 +229,7 @@ import ProcessHeader from '../../components/ProcessHeader' import ProcessFooter from '../../components/ProcessFooter' import ProcessTitle from '../../components/ProcessTitle' - import {inboundLiaisonDetail,changeAssigneeNew,getBusStandFileByAttId} from 'api/process' + import {inboundLiaisonDetail,changeAssigneeNew} from 'api/process' import axios from "axios"; export default { @@ -269,38 +269,9 @@ ProcessTitle }, methods: { - getBusStandFileByAttId(attId) { - return new Promise((resolve, reject) => { - getBusStandFileByAttId({ - attId - }).then(res => { - if (res.ok) { - resolve(res.data) - } else { - reject() - } - }).catch(e => { - reject(e) - }) - }) - }, clickButtonToUpload2(file) { const attId = file - this.getBusStandFileByAttId(attId) - .then(res => { - if(res){ - const editFileInfo = res - if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){ - window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl) - }else if(editFileInfo.fileSuffix === 'pdf' || editFileInfo.fileSuffix === '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)} - } - }).catch(e => { - this.$message.warning('文件不存在,预览失败') - }) + this.$preview(attId) }, handleTransfer() { this.drawerModal = true diff --git a/src/pages/processCenter/pages/creatProcess/bzdy/step9.vue b/src/pages/processCenter/pages/creatProcess/bzdy/step9.vue index 5bad71a2e..66f0438e5 100644 --- a/src/pages/processCenter/pages/creatProcess/bzdy/step9.vue +++ b/src/pages/processCenter/pages/creatProcess/bzdy/step9.vue @@ -229,7 +229,7 @@ import ProcessHeader from '../../components/ProcessHeader' import ProcessFooter from '../../components/ProcessFooter' import ProcessTitle from '../../components/ProcessTitle' - import {inboundLiaisonDetail,changeAssigneeNew,getBusStandFileByAttId} from 'api/process' + import {inboundLiaisonDetail,changeAssigneeNew} from 'api/process' import axios from "axios"; export default { @@ -269,38 +269,9 @@ ProcessTitle }, methods: { - getBusStandFileByAttId(attId) { - return new Promise((resolve, reject) => { - getBusStandFileByAttId({ - attId - }).then(res => { - if (res.ok) { - resolve(res.data) - } else { - reject() - } - }).catch(e => { - reject(e) - }) - }) - }, clickButtonToUpload2(file) { const attId = file - this.getBusStandFileByAttId(attId) - .then(res => { - if(res){ - const editFileInfo = res - if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){ - window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl) - }else if(editFileInfo.fileSuffix === 'pdf' || editFileInfo.fileSuffix === '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)} - } - }).catch(e => { - this.$message.warning('文件不存在,预览失败') - }) + this.$preview(attId) }, handleTransfer() { this.drawerModal = true diff --git a/src/pages/processCenter/pages/creatProcess/bzzqyj/step1-1.vue b/src/pages/processCenter/pages/creatProcess/bzzqyj/step1-1.vue index 59a68e8c5..a13c61b1b 100644 --- a/src/pages/processCenter/pages/creatProcess/bzzqyj/step1-1.vue +++ b/src/pages/processCenter/pages/creatProcess/bzzqyj/step1-1.vue @@ -359,7 +359,7 @@ import ProcessHeader from '../../components/ProcessHeader' import ProcessFooter from '../../components/ProcessFooter' import ProcessTitle from '../../components/ProcessTitle' -import {saveTaskFirst, queryTaskFirst,taskDel,getBusStandFileByAttId} from 'api/process' +import {saveTaskFirst, queryTaskFirst,taskDel} from 'api/process' export default { name: "bzzqyjStep1-1", @@ -490,41 +490,9 @@ export default { this.$message.warning('文件不存在,下载失败') } }, - getBusStandFileByAttId(attId) { // 预览 - return new Promise((resolve, reject) => { - getBusStandFileByAttId({ - attId - }).then(res => { - if (res.ok) { - resolve(res.data) - } else { - reject() - } - }).catch(e => { - reject(e) - }) - }) - }, fileLook(file) { // 预览 const attId = file.attId - this.getBusStandFileByAttId(attId) - .then(res => { - if(res){ - const editFileInfo = res - if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){ - window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl) - }else if(editFileInfo.fileSuffix === 'pdf' || editFileInfo.fileSuffix === '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('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl))); - 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) - } - // window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id)) - } - }).catch(e => { - this.$message.warning('文件不存在,预览失败') - }) + this.$preview(attId) }, beginImportFile (file) { var filename = file.name diff --git a/src/pages/processCenter/pages/creatProcess/bzzqyj/step1.vue b/src/pages/processCenter/pages/creatProcess/bzzqyj/step1.vue index 84ef62244..19a5a0e89 100644 --- a/src/pages/processCenter/pages/creatProcess/bzzqyj/step1.vue +++ b/src/pages/processCenter/pages/creatProcess/bzzqyj/step1.vue @@ -368,7 +368,7 @@ import ProcessHeader from '../../components/ProcessHeader' import ProcessFooter from '../../components/ProcessFooter' import ProcessTitle from '../../components/ProcessTitle' -import {saveTaskFirst, taskDel, getBusStandFileByAttId} from 'api/process' +import {saveTaskFirst, taskDel} from 'api/process' export default { name: "bzzqyjStep1", @@ -498,41 +498,9 @@ export default { this.$message.warning('文件不存在,下载失败') } }, - getBusStandFileByAttId(attId) { // 预览 - return new Promise((resolve, reject) => { - getBusStandFileByAttId({ - attId - }).then(res => { - if (res.ok) { - resolve(res.data) - } else { - reject() - } - }).catch(e => { - reject(e) - }) - }) - }, fileLook(file) { // 预览 const attId = file.attId - this.getBusStandFileByAttId(attId) - .then(res => { - if(res){ - const editFileInfo = res - if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){ - window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl) - }else if(editFileInfo.fileSuffix === 'pdf' || editFileInfo.fileSuffix === '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('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl))); - 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) - } - // window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id)) - } - }).catch(e => { - this.$message.warning('文件不存在,预览失败') - }) + this.$preview(attId) }, beginImportFile (file) { var filename = file.name diff --git a/src/pages/processCenter/pages/creatProcess/bzzqyj/step2.vue b/src/pages/processCenter/pages/creatProcess/bzzqyj/step2.vue index 35e69deea..60936b0b4 100644 --- a/src/pages/processCenter/pages/creatProcess/bzzqyj/step2.vue +++ b/src/pages/processCenter/pages/creatProcess/bzzqyj/step2.vue @@ -191,7 +191,7 @@ import ProcessHeader from "../../components/ProcessHeader"; import ProcessFooter from "../../components/ProcessFooter"; import ProcessTitle from "../../components/ProcessTitle"; -import { inboundLiaisonDetail, processCreateStand, saveTaskForPub, changeAssigneeNew,getBusStandFileByAttId} from "api/process"; +import { inboundLiaisonDetail, processCreateStand, saveTaskForPub, changeAssigneeNew} from "api/process"; import axios from "axios"; export default { @@ -246,41 +246,9 @@ export default { this.$message.warning('文件不存在,下载失败') } }, - getBusStandFileByAttId(attId) { // 预览 - return new Promise((resolve, reject) => { - getBusStandFileByAttId({ - attId - }).then(res => { - if (res.ok) { - resolve(res.data) - } else { - reject() - } - }).catch(e => { - reject(e) - }) - }) - }, fileLook(file) { // 预览 const attId = file.attId - this.getBusStandFileByAttId(attId) - .then(res => { - if(res){ - const editFileInfo = res - if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){ - window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl) - }else if(editFileInfo.fileSuffix === 'pdf' || editFileInfo.fileSuffix === '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('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl))); - 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) - } - // window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id)) - } - }).catch(e => { - this.$message.warning('文件不存在,预览失败') - }) + this.$preview(attId) }, handleTransfer() { this.drawerModal = true diff --git a/src/pages/processCenter/pages/creatProcess/bzzqyj/step3.vue b/src/pages/processCenter/pages/creatProcess/bzzqyj/step3.vue index cb2d058c5..9a65c8d99 100644 --- a/src/pages/processCenter/pages/creatProcess/bzzqyj/step3.vue +++ b/src/pages/processCenter/pages/creatProcess/bzzqyj/step3.vue @@ -332,7 +332,7 @@ import ProcessHeader from '../../components/ProcessHeader' import ProcessFooter from '../../components/ProcessFooter' import ProcessTitle from '../../components/ProcessTitle' - import {inboundLiaisonDetail, processCreateStand, saveTaskForPub,changeAssigneeNew,execTask,getBusStandFileByAttId} from 'api/process' + import {inboundLiaisonDetail, processCreateStand, saveTaskForPub,changeAssigneeNew,execTask} from 'api/process' import axios from "axios"; export default { @@ -408,41 +408,9 @@ this.$message.warning('文件不存在,下载失败') } }, - getBusStandFileByAttId(attId) { // 预览 - return new Promise((resolve, reject) => { - getBusStandFileByAttId({ - attId - }).then(res => { - if (res.ok) { - resolve(res.data) - } else { - reject() - } - }).catch(e => { - reject(e) - }) - }) - }, fileLook(file) { // 预览 const attId = file.attId - this.getBusStandFileByAttId(attId) - .then(res => { - if(res){ - const editFileInfo = res - if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){ - window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl) - }else if(editFileInfo.fileSuffix === 'pdf' || editFileInfo.fileSuffix === '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('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl))); - 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) - } - // window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id)) - } - }).catch(e => { - this.$message.warning('文件不存在,预览失败') - }) + this.$preview(attId) }, itermsConditionsClose () { this.itermsConditionsFlag = false diff --git a/src/pages/processCenter/pages/creatProcess/bzzqyj/step4-1.vue b/src/pages/processCenter/pages/creatProcess/bzzqyj/step4-1.vue index 556a26f14..cceba22a9 100644 --- a/src/pages/processCenter/pages/creatProcess/bzzqyj/step4-1.vue +++ b/src/pages/processCenter/pages/creatProcess/bzzqyj/step4-1.vue @@ -270,7 +270,7 @@ import ProcessHeader from '../../components/ProcessHeader' import ProcessFooter from '../../components/ProcessFooter' import ProcessTitle from '../../components/ProcessTitle' - import {inboundLiaisonDetail, processCreateStand,changeAssigneeNew,getBusStandFileByAttId} from 'api/process' + import {inboundLiaisonDetail, processCreateStand,changeAssigneeNew} from 'api/process' import axios from "axios"; export default { @@ -334,41 +334,9 @@ this.$message.warning('文件不存在,下载失败') } }, - getBusStandFileByAttId(attId) { // 预览 - return new Promise((resolve, reject) => { - getBusStandFileByAttId({ - attId - }).then(res => { - if (res.ok) { - resolve(res.data) - } else { - reject() - } - }).catch(e => { - reject(e) - }) - }) - }, fileLook(file) { // 预览 const attId = file.attId - this.getBusStandFileByAttId(attId) - .then(res => { - if(res){ - const editFileInfo = res - if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){ - window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl) - }else if(editFileInfo.fileSuffix === 'pdf' || editFileInfo.fileSuffix === '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('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl))); - 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) - } - // window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id)) - } - }).catch(e => { - this.$message.warning('文件不存在,预览失败') - }) + this.$preview(attId) }, checkedRole2(data) { this.form.bzfgId = data[0].id diff --git a/src/pages/processCenter/pages/creatProcess/bzzqyj/step4-2.vue b/src/pages/processCenter/pages/creatProcess/bzzqyj/step4-2.vue index 7d6c5b943..a8714fdf8 100644 --- a/src/pages/processCenter/pages/creatProcess/bzzqyj/step4-2.vue +++ b/src/pages/processCenter/pages/creatProcess/bzzqyj/step4-2.vue @@ -262,7 +262,7 @@ import ProcessHeader from '../../components/ProcessHeader' import ProcessFooter from '../../components/ProcessFooter' import ProcessTitle from '../../components/ProcessTitle' - import {inboundLiaisonDetail, processCreateStand,changeAssigneeNew,getBusStandFileByAttId} from 'api/process' + import {inboundLiaisonDetail, processCreateStand,changeAssigneeNew} from 'api/process' import axios from "axios"; export default { @@ -326,41 +326,9 @@ this.$message.warning('文件不存在,下载失败') } }, - getBusStandFileByAttId(attId) { // 预览 - return new Promise((resolve, reject) => { - getBusStandFileByAttId({ - attId - }).then(res => { - if (res.ok) { - resolve(res.data) - } else { - reject() - } - }).catch(e => { - reject(e) - }) - }) - }, fileLook(file) { // 预览 const attId = file.attId - this.getBusStandFileByAttId(attId) - .then(res => { - if(res){ - const editFileInfo = res - if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){ - window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl) - }else if(editFileInfo.fileSuffix === 'pdf' || editFileInfo.fileSuffix === '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('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl))); - 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) - } - // window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id)) - } - }).catch(e => { - this.$message.warning('文件不存在,预览失败') - }) + this.$preview(attId) }, checkedRole2(data) { this.form.bzfgId = data[0].id diff --git a/src/pages/processCenter/pages/creatProcess/bzzqyj/step4.vue b/src/pages/processCenter/pages/creatProcess/bzzqyj/step4.vue index b075d3044..39b8aaee5 100644 --- a/src/pages/processCenter/pages/creatProcess/bzzqyj/step4.vue +++ b/src/pages/processCenter/pages/creatProcess/bzzqyj/step4.vue @@ -342,7 +342,7 @@ import ProcessHeader from '../../components/ProcessHeader' import ProcessFooter from '../../components/ProcessFooter' import ProcessTitle from '../../components/ProcessTitle' -import {inboundLiaisonDetail, processCreateStand,changeAssigneeNew,getBusStandFileByAttId} from 'api/process' +import {inboundLiaisonDetail, processCreateStand,changeAssigneeNew} from 'api/process' import axios from "axios"; export default { @@ -418,41 +418,9 @@ export default { this.$message.warning('文件不存在,下载失败') } }, - getBusStandFileByAttId(attId) { // 预览 - return new Promise((resolve, reject) => { - getBusStandFileByAttId({ - attId - }).then(res => { - if (res.ok) { - resolve(res.data) - } else { - reject() - } - }).catch(e => { - reject(e) - }) - }) - }, fileLook(file) { // 预览 const attId = file.attId - this.getBusStandFileByAttId(attId) - .then(res => { - if(res){ - const editFileInfo = res - if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){ - window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl) - }else if(editFileInfo.fileSuffix === 'pdf' || editFileInfo.fileSuffix === '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('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl))); - 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) - } - // window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id)) - } - }).catch(e => { - this.$message.warning('文件不存在,预览失败') - }) + this.$preview(attId) }, handleSelectionChange(val) { this.idList = [] diff --git a/src/pages/processCenter/pages/creatProcess/bzzqyj/step5.vue b/src/pages/processCenter/pages/creatProcess/bzzqyj/step5.vue index e372f62f2..fd61e99d4 100644 --- a/src/pages/processCenter/pages/creatProcess/bzzqyj/step5.vue +++ b/src/pages/processCenter/pages/creatProcess/bzzqyj/step5.vue @@ -331,7 +331,7 @@ import ProcessHeader from "../../components/ProcessHeader"; import ProcessFooter from "../../components/ProcessFooter"; import ProcessTitle from "../../components/ProcessTitle"; - import { inboundLiaisonDetail, processCreateStand, saveTaskForPub, changeAssigneeNew,getBusStandFileByAttId } from "api/process"; + import { inboundLiaisonDetail, processCreateStand, saveTaskForPub, changeAssigneeNew } from "api/process"; import axios from "axios"; export default { @@ -404,41 +404,9 @@ this.$message.warning('文件不存在,下载失败') } }, - getBusStandFileByAttId(attId) { // 预览 - return new Promise((resolve, reject) => { - getBusStandFileByAttId({ - attId - }).then(res => { - if (res.ok) { - resolve(res.data) - } else { - reject() - } - }).catch(e => { - reject(e) - }) - }) - }, fileLook(file) { // 预览 const attId = file.attId - this.getBusStandFileByAttId(attId) - .then(res => { - if(res){ - const editFileInfo = res - if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){ - window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl) - }else if(editFileInfo.fileSuffix === 'pdf' || editFileInfo.fileSuffix === '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('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl))); - 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) - } - // window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id)) - } - }).catch(e => { - this.$message.warning('文件不存在,预览失败') - }) + this.$preview(attId) }, getItemList (standId, fileType) { // 查询分解单条款数据 this.$http.get('SarStandItems/sar-stand-items/querySarItemAndInterpretation', { diff --git a/src/pages/processCenter/pages/creatProcess/bzzqyj/step6.vue b/src/pages/processCenter/pages/creatProcess/bzzqyj/step6.vue index d973b4a6e..62758aff5 100644 --- a/src/pages/processCenter/pages/creatProcess/bzzqyj/step6.vue +++ b/src/pages/processCenter/pages/creatProcess/bzzqyj/step6.vue @@ -276,7 +276,7 @@ import ProcessHeader from "../../components/ProcessHeader"; import ProcessFooter from "../../components/ProcessFooter"; import ProcessTitle from "../../components/ProcessTitle"; -import { inboundLiaisonDetail, processCreateStand, changeAssigneeNew,getBusStandFileByAttId } from "api/process"; +import { inboundLiaisonDetail, processCreateStand, changeAssigneeNew } from "api/process"; import axios from "axios"; export default { @@ -342,41 +342,9 @@ export default { this.$message.warning('文件不存在,下载失败') } }, - getBusStandFileByAttId(attId) { // 预览 - return new Promise((resolve, reject) => { - getBusStandFileByAttId({ - attId - }).then(res => { - if (res.ok) { - resolve(res.data) - } else { - reject() - } - }).catch(e => { - reject(e) - }) - }) - }, fileLook(file) { // 预览 const attId = file.attId - this.getBusStandFileByAttId(attId) - .then(res => { - if(res){ - const editFileInfo = res - if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){ - window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl) - }else if(editFileInfo.fileSuffix === 'pdf' || editFileInfo.fileSuffix === '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('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl))); - 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) - } - // window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id)) - } - }).catch(e => { - this.$message.warning('文件不存在,预览失败') - }) + this.$preview(attId) }, itermsConditionsClose () { this.itermsConditionsFlag = false diff --git a/src/pages/processCenter/pages/creatProcess/bzzqyj/step7.vue b/src/pages/processCenter/pages/creatProcess/bzzqyj/step7.vue index 724bd6979..61c6afdde 100644 --- a/src/pages/processCenter/pages/creatProcess/bzzqyj/step7.vue +++ b/src/pages/processCenter/pages/creatProcess/bzzqyj/step7.vue @@ -276,7 +276,7 @@ import ProcessHeader from '../../components/ProcessHeader' import ProcessFooter from '../../components/ProcessFooter' import ProcessTitle from '../../components/ProcessTitle' -import {inboundLiaisonDetail, processCreateStand,changeAssigneeNew,getBusStandFileByAttId} from 'api/process' +import {inboundLiaisonDetail, processCreateStand,changeAssigneeNew} from 'api/process' import axios from "axios"; export default { @@ -339,41 +339,9 @@ export default { this.$message.warning('文件不存在,下载失败') } }, - getBusStandFileByAttId(attId) { // 预览 - return new Promise((resolve, reject) => { - getBusStandFileByAttId({ - attId - }).then(res => { - if (res.ok) { - resolve(res.data) - } else { - reject() - } - }).catch(e => { - reject(e) - }) - }) - }, fileLook(file) { // 预览 const attId = file.attId - this.getBusStandFileByAttId(attId) - .then(res => { - if(res){ - const editFileInfo = res - if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){ - window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl) - }else if(editFileInfo.fileSuffix === 'pdf' || editFileInfo.fileSuffix === '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('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl))); - 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) - } - // window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id)) - } - }).catch(e => { - this.$message.warning('文件不存在,预览失败') - }) + this.$preview(attId) }, itermsConditionsClose () { this.itermsConditionsFlag = false diff --git a/src/pages/processCenter/pages/creatProcess/bzzqyj/step8.vue b/src/pages/processCenter/pages/creatProcess/bzzqyj/step8.vue index a998ed79d..8c558717a 100644 --- a/src/pages/processCenter/pages/creatProcess/bzzqyj/step8.vue +++ b/src/pages/processCenter/pages/creatProcess/bzzqyj/step8.vue @@ -276,7 +276,7 @@ import ProcessHeader from '../../components/ProcessHeader' import ProcessFooter from '../../components/ProcessFooter' import ProcessTitle from '../../components/ProcessTitle' -import {inboundLiaisonDetail, processCreateStand,changeAssigneeNew,getBusStandFileByAttId} from 'api/process' +import {inboundLiaisonDetail, processCreateStand,changeAssigneeNew} from 'api/process' import axios from "axios"; export default { @@ -339,41 +339,9 @@ export default { this.$message.warning('文件不存在,下载失败') } }, - getBusStandFileByAttId(attId) { // 预览 - return new Promise((resolve, reject) => { - getBusStandFileByAttId({ - attId - }).then(res => { - if (res.ok) { - resolve(res.data) - } else { - reject() - } - }).catch(e => { - reject(e) - }) - }) - }, fileLook(file) { // 预览 const attId = file.attId - this.getBusStandFileByAttId(attId) - .then(res => { - if(res){ - const editFileInfo = res - if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){ - window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl) - }else if(editFileInfo.fileSuffix === 'pdf' || editFileInfo.fileSuffix === '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('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl))); - 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) - } - // window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id)) - } - }).catch(e => { - this.$message.warning('文件不存在,预览失败') - }) + this.$preview(attId) }, itermsConditionsClose () { this.itermsConditionsFlag = false diff --git a/src/pages/processCenter/pages/creatProcess/bzzqyj/step9.vue b/src/pages/processCenter/pages/creatProcess/bzzqyj/step9.vue index 13987a58e..664e3642e 100644 --- a/src/pages/processCenter/pages/creatProcess/bzzqyj/step9.vue +++ b/src/pages/processCenter/pages/creatProcess/bzzqyj/step9.vue @@ -276,7 +276,7 @@ import ProcessHeader from "../../components/ProcessHeader"; import ProcessFooter from "../../components/ProcessFooter"; import ProcessTitle from "../../components/ProcessTitle"; -import { inboundLiaisonDetail, processCreateStand, changeAssigneeNew,getBusStandFileByAttId } from "api/process"; +import { inboundLiaisonDetail, processCreateStand, changeAssigneeNew } from "api/process"; import axios from "axios"; export default { @@ -339,41 +339,9 @@ export default { this.$message.warning('文件不存在,下载失败') } }, - getBusStandFileByAttId(attId) { // 预览 - return new Promise((resolve, reject) => { - getBusStandFileByAttId({ - attId - }).then(res => { - if (res.ok) { - resolve(res.data) - } else { - reject() - } - }).catch(e => { - reject(e) - }) - }) - }, fileLook(file) { // 预览 const attId = file.attId - this.getBusStandFileByAttId(attId) - .then(res => { - if(res){ - const editFileInfo = res - if(editFileInfo.fileSuffix === 'pdg' || editFileInfo.fileSuffix === 'PDG'){ - window.open('book://ssreader/e0?url='+editFileInfo.downLoadUrl) - }else if(editFileInfo.fileSuffix === 'pdf' || editFileInfo.fileSuffix === '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('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl))); - 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) - } - // window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id)) - } - }).catch(e => { - this.$message.warning('文件不存在,预览失败') - }) + this.$preview(attId) }, itermsConditionsClose () { this.itermsConditionsFlag = false