From 984b0dc2b1df6335f86e44a8f2fd1f997789fa02 Mon Sep 17 00:00:00 2001 From: shenyanpei Date: Thu, 23 Dec 2021 09:35:59 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=97=A5=E5=8E=86=E4=BC=9A=E8=AE=AE?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/localTool/standCalendar/index.vue | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/pages/localTool/standCalendar/index.vue b/src/pages/localTool/standCalendar/index.vue index 108d53c8d..06d16e9c9 100644 --- a/src/pages/localTool/standCalendar/index.vue +++ b/src/pages/localTool/standCalendar/index.vue @@ -41,10 +41,10 @@ - + @@ -81,8 +81,8 @@
会议附件 : {{ '-' }} -
- +
+ {{ res.name.slice(0, 30) + '...' }} {{ ';' }} @@ -508,7 +508,7 @@ export default { this.editMeetForm.contents this.editMeetForm.contents = [] if (this.editMeetForm.content !== '') { - this.editMeetForm.content.split(';').forEach(item => { + this.editMeetForm.content.split(';').forEach(item => { this.editMeetForm.contents.push({ meetingTheme: item }) @@ -713,13 +713,13 @@ export default { let contentData = [] if (this.editMeetForm.contents.length > 0) { this.editMeetForm.contents.forEach(item => { - if (item.meetingTheme.length > 0){ + if (item.meetingTheme.length > 0) { contentData.push(item.meetingTheme) } }) } let editForm = { - attend: JSON.stringify( this.editMeetForm.attend), + attend: JSON.stringify(this.editMeetForm.attend), content: contentData.join(';'), id: this.editMeetForm.id, date: this.editMeetForm.date, @@ -729,7 +729,7 @@ export default { place: this.editMeetForm.place } this.loading = true - updateMeet(editForm).then(res=>{ + updateMeet(editForm).then(res => { if (true) { this.$message.success("编辑成功"); this.meetFlag = false From 13813bae99bedf9bc6b611ade43347306f14f2a9 Mon Sep 17 00:00:00 2001 From: shenyanpei Date: Thu, 23 Dec 2021 09:57:13 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=A4=9A=E6=96=87=E4=BB=B6=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/process.js | 1 + .../pages/creatProcess/bzhHd-rh/step1.vue | 17 ++++++- .../pages/creatProcess/bzhHh-hh/step1.vue | 48 ++++++++++++++++++- .../pages/creatProcess/wfhxzg/step4.vue | 17 ++++++- 4 files changed, 80 insertions(+), 3 deletions(-) diff --git a/src/api/process.js b/src/api/process.js index 6bb77e017..d0084423b 100644 --- a/src/api/process.js +++ b/src/api/process.js @@ -731,6 +731,7 @@ export function updateMeet(data) { }) } +// 上传接口 export function upFile(data) { return axios({ url: '/api/att/attFile/upload', diff --git a/src/pages/processCenter/pages/creatProcess/bzhHd-rh/step1.vue b/src/pages/processCenter/pages/creatProcess/bzhHd-rh/step1.vue index 9e1878abd..c20d0296d 100644 --- a/src/pages/processCenter/pages/creatProcess/bzhHd-rh/step1.vue +++ b/src/pages/processCenter/pages/creatProcess/bzhHd-rh/step1.vue @@ -375,6 +375,7 @@ drag :file-list="rh_pageData.infoSources" accept=".ZIP, .zip, .docx, .DOCX, .xls, .xlsx, .pdf, .PDF" + :http-request="httpRequest" :before-upload="handleBeforeUpload" :before-remove="handleBeforeRemove" :on-success="handleOnsuccess" @@ -426,7 +427,7 @@ import { startProcess, saveTaskFirst, completeTask, queryTaskFirst, taskDel, workGroup, processBack, - getBusStandFileByAttId + getBusStandFileByAttId,upFile } from '@/api/process.js' export default { @@ -620,6 +621,20 @@ export default { } }) }, + httpRequest(params) { + const file = params.file + // 根据后台需求数据格式 + const form = new FormData() + // 文件对象 + form.append("file", file) + upFile(form).then(res=>{ + if (res.ok) { + this.handleOnsuccess(res) + } else { + this.$message.warning('上传失败') + } + }) + }, // 文件上传成功 handleOnsuccess(res, file, fileList) { if (res.ok) { diff --git a/src/pages/processCenter/pages/creatProcess/bzhHh-hh/step1.vue b/src/pages/processCenter/pages/creatProcess/bzhHh-hh/step1.vue index 321baa576..01a2d8b5b 100644 --- a/src/pages/processCenter/pages/creatProcess/bzhHh-hh/step1.vue +++ b/src/pages/processCenter/pages/creatProcess/bzhHh-hh/step1.vue @@ -128,6 +128,7 @@ name="file" :file-list="upOtherData" accept=".ZIP, .zip, .docx, .DOCX, .xls, .xlsx, .pdf, .PDF" + :http-request="httpRequestOther" :before-upload="beforeUploadOther" :before-remove="beforeRemoveOther" :on-success="onsuccessOther" @@ -203,6 +204,7 @@ name="file" :file-list="reData" accept=".ZIP, .zip, .docx, .DOCX, .xls, .xlsx, .pdf, .PDF" + :http-request="httpRequest" :before-upload="handleBeforeUpload" :before-remove="handleBeforeRemove" :on-success="handleOnsuccess" @@ -224,6 +226,7 @@ name="file" :file-list="themeData" accept=".ZIP, .zip, .docx, .DOCX, .xls, .xlsx, .pdf, .PDF" + :http-request="httpRequestTheme" :before-upload="beforeUploadTheme" :before-remove="beforeRemoveTheme" :on-success="onsuccessTheme" @@ -239,7 +242,7 @@ import ProcessHeader from '../../components/ProcessHeader' import ProcessFooter from '../../components/ProcessFooter' import ProcessTitle from '../../components/ProcessTitle' -import { saveTaskFirst, completeTask, inboundLiaisonDetail} from '@/api/process.js' +import { saveTaskFirst, completeTask, inboundLiaisonDetail,upFile} from '@/api/process.js' export default { components: { @@ -386,6 +389,20 @@ export default { this.reData = this.fileListData.material this.upDialog = true }, + httpRequest(params) { + const file = params.file + // 根据后台需求数据格式 + const form = new FormData() + // 文件对象 + form.append("file", file) + upFile(form).then(res=>{ + if (res.ok) { + this.handleOnsuccess(res) + } else { + this.$message.warning('上传失败') + } + }) + }, // 文件上传成功 handleOnsuccess(res, file, fileList) { if (res.ok) { @@ -460,6 +477,20 @@ export default { this.upThemeDialog = true }, + httpRequestTheme(params) { + const file = params.file + // 根据后台需求数据格式 + const form = new FormData() + // 文件对象 + form.append("file", file) + upFile(form).then(res=>{ + if (res.ok) { + this.onsuccessTheme(res) + } else { + this.$message.warning('上传失败') + } + }) + }, // 文件上传成功 onsuccessTheme(res, file, fileList) { if (res.ok) { @@ -521,6 +552,21 @@ export default { }, /** 其他资料上传 */ + + httpRequestOther(params) { + const file = params.file + // 根据后台需求数据格式 + const form = new FormData() + // 文件对象 + form.append("file", file) + upFile(form).then(res=>{ + if (res.ok) { + this.onsuccessOther(res) + } else { + this.$message.warning('上传失败') + } + }) + }, // 文件上传成功 onsuccessOther(res, file, fileList) { if (res.ok) { diff --git a/src/pages/processCenter/pages/creatProcess/wfhxzg/step4.vue b/src/pages/processCenter/pages/creatProcess/wfhxzg/step4.vue index 179d194a0..49403e042 100644 --- a/src/pages/processCenter/pages/creatProcess/wfhxzg/step4.vue +++ b/src/pages/processCenter/pages/creatProcess/wfhxzg/step4.vue @@ -51,6 +51,7 @@ name="file" :file-list="fileTextList" accept=".ZIP, .zip, .docx, .DOCX, .xls, .xlsx" + :http-request="httpRequest" :before-upload="handleBeforeUpload" :before-remove="handleBeforeRemove" :on-remove="handleONRemove" @@ -178,7 +179,7 @@ import ProcessHeader from '../../components/ProcessHeader' import ProcessFooter from '../../components/ProcessFooter' import ProcessTitle from '../../components/ProcessTitle' -import {inboundLiaisonDetail, completeTask, saveTaskForPub, changeAssigneeNew,execTask} from "@/api/process" +import {inboundLiaisonDetail, completeTask, saveTaskForPub, changeAssigneeNew,execTask,upFile} from "@/api/process" export default { name: "wfhxzgStep4", @@ -298,6 +299,20 @@ export default { uploadFile (val) { this.fileListData = val }, + httpRequest(params) { + const file = params.file + // 根据后台需求数据格式 + const form = new FormData() + // 文件对象 + form.append("file", file) + upFile(form).then(res=>{ + if (res.ok) { + this.handleOnsuccess(res) + } else { + this.$message.warning('上传失败') + } + }) + }, // 文件上传成功 handleOnsuccess(res, file, fileList) { if (res.ok) { From d23d312d7066e96240292a344b5471bca563be68 Mon Sep 17 00:00:00 2001 From: zhutianqi Date: Thu, 23 Dec 2021 10:06:48 +0800 Subject: [PATCH 3/4] 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 From 23078474261a7ba1393ed414cf97ddc2c549a7d6 Mon Sep 17 00:00:00 2001 From: zhutianqi Date: Thu, 23 Dec 2021 10:08:50 +0800 Subject: [PATCH 4/4] commit --- src/components/CustomFormComponents/File.vue | 53 ++++++++------------ 1 file changed, 20 insertions(+), 33 deletions(-) diff --git a/src/components/CustomFormComponents/File.vue b/src/components/CustomFormComponents/File.vue index dba1a65e4..fb95df303 100644 --- a/src/components/CustomFormComponents/File.vue +++ b/src/components/CustomFormComponents/File.vue @@ -353,39 +353,26 @@ export default { this.$message.warning('文件不存在,下载失败') } } else { - this.getBusStandFileByAttId(attId) - .then(res => { - console.log(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 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)) - } - // 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('文件不存在,预览失败') - }) + this.$preview(attId) + // this.getBusStandFileByAttId(attId) + // .then(res => { + // console.log(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 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 => { + // console.log(e) + // this.$message.warning('文件不存在,预览失败') + // }) } },