This commit is contained in:
zhutianqi
2021-12-14 18:34:52 +08:00
parent ebd324f445
commit 360351f3ff
6 changed files with 380 additions and 61 deletions
@@ -46,20 +46,26 @@
v-model="form.modelNameList"
clearable
></el-input>
<div v-if="form.modelList.length > 0" class="fileClass" style="display: flex;">
<div v-for="(item, index) in form.modelList" :key="index" @click="fileUpload" style="margin-right: 5px;">
{{ item.name }}
<div v-if="form.modelList.length > 0" style="display: flex;">
<div v-for="(item, index) in form.modelList" :key="index" style="margin-right: 5px;">
<div class="fileClass" @click="handlePreview(item)" style="display: flex; align-items: center;">
{{ item.name }}
<el-button
size="small"
@click="clickButtonToUpload(item)"
icon="el-icon-upload"
style="height: 32px; margin-left: 5px;"
></el-button>
</div>
</div>
</div>
<div v-else>
<el-button
type="primary"
class="common-button-primary"
@click="fileUpload"
size="mini">
点击上传
</el-button>
</div>
<el-button
type="primary"
class="common-button-primary"
@click="fileUpload"
size="mini">
点击上传
</el-button>
</el-form-item>
<el-form-item label="相关附件" prop="modelNameList" class="add-form-item form-item-disabled">
<el-input
@@ -68,12 +74,20 @@
v-model="form.fjNameList"
clearable
></el-input>
<div v-if="form.fjList.length > 0" class="fileClass" style="display: flex;">
<div v-for="(item, index) in form.fjList" :key="index" @click="fileUpload2" style="margin-right: 5px;">
{{ item.name }}
<div v-if="form.fjList.length > 0" style="display: flex;">
<div v-for="(item, index) in form.fjList" :key="index" style="margin-right: 5px;">
<div class="fileClass" @click="handlePreview(item)" style="display: flex; align-items: center;">
{{ item.name }}
<el-button
size="small"
@click="clickButtonToUpload(item)"
icon="el-icon-upload"
style="height: 32px; margin-left: 5px;"
></el-button>
</div>
</div>
</div>
<div v-else>
<div>
<el-button
type="primary"
class="common-button-primary"
@@ -241,7 +255,7 @@
import ProcessHeader from '../../components/ProcessHeader'
import ProcessFooter from '../../components/ProcessFooter'
import ProcessTitle from '../../components/ProcessTitle'
import { saveTaskFirst, queryTaskFirst } from 'api/process'
import { saveTaskFirst, queryTaskFirst, getBusStandFileByAttId } from 'api/process'
export default {
name: "bzdyStep1-1",
@@ -319,6 +333,50 @@
ProcessTitle
},
methods: {
clickButtonToUpload (file) {
const attId = file.attId
if (attId) {
window.location.href = '/api/att/attFile/downloadFileForSar?fileId=' + attId
} else {
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('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl)));
window.open('/static/onlyOffice/onlinePreview.html?oldFileName=' + editFileInfo.oldFileName + '&fileType=' + editFileInfo.fileSuffix + '&attId=' + editFileInfo.id + '&fileUrl=' + editFileInfo.downLoadUrl + '&key=' + editFileInfo.id + nowTime+'&filePath='+editFileInfo.filePath+'&fileName='+editFileInfo.fileName)
}
// window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id))
}
}).catch(e => {
this.$message.warning('文件不存在,预览失败')
})
},
foldForm() {
this.foldFormFlag = !this.foldFormFlag
},
@@ -24,7 +24,7 @@
<el-collapse-transition>
<div class="prc-content-border" v-if="foldFormFlag === false">
<el-row :gutter="24">
<el-col :span="12">
<el-col :span="24">
<el-form-item label="调研标题" prop="title" class="add-form-item form-item-disabled">
<el-input
v-model="form.title"
@@ -46,20 +46,26 @@
v-model="form.modelNameList"
clearable
></el-input>
<div v-if="form.modelList.length > 0" class="fileClass" style="display: flex;">
<div v-for="(item, index) in form.modelList" :key="index" @click="fileUpload" style="margin-right: 5px;">
{{ item.name }}
<div v-if="form.modelList.length > 0" style="display: flex;">
<div v-for="(item, index) in form.modelList" :key="index" style="margin-right: 5px;">
<div class="fileClass" @click="handlePreview(item)" style="display: flex; align-items: center;">
{{ item.name }}
<el-button
size="small"
@click="clickButtonToUpload(item)"
icon="el-icon-upload"
style="height: 32px; margin-left: 5px;"
></el-button>
</div>
</div>
</div>
<div v-else>
<el-button
type="primary"
class="common-button-primary"
@click="fileUpload"
size="mini">
点击上传
</el-button>
</div>
<el-button
type="primary"
class="common-button-primary"
@click="fileUpload"
size="mini">
点击上传
</el-button>
</el-form-item>
<el-form-item label="相关附件" prop="modelNameList" class="add-form-item form-item-disabled">
<el-input
@@ -68,12 +74,20 @@
v-model="form.fjNameList"
clearable
></el-input>
<div v-if="form.fjList.length > 0" class="fileClass" style="display: flex;">
<div v-for="(item, index) in form.fjList" :key="index" @click="fileUpload2" style="margin-right: 5px;">
{{ item.name }}
<div v-if="form.fjList.length > 0" style="display: flex;">
<div v-for="(item, index) in form.fjList" :key="index" style="margin-right: 5px;">
<div class="fileClass" @click="handlePreview(item)" style="display: flex; align-items: center;">
{{ item.name }}
<el-button
size="small"
@click="clickButtonToUpload(item)"
icon="el-icon-upload"
style="height: 32px; margin-left: 5px;"
></el-button>
</div>
</div>
</div>
<div v-else>
<div>
<el-button
type="primary"
class="common-button-primary"
@@ -243,6 +257,7 @@ import ProcessHeader from '../../components/ProcessHeader'
import ProcessFooter from '../../components/ProcessFooter'
import ProcessTitle from '../../components/ProcessTitle'
import { saveTaskFirst } from 'api/process'
import { getBusStandFileByAttId } from 'api/process'
export default {
name: "bzdyStep1",
@@ -321,6 +336,50 @@ export default {
ProcessTitle
},
methods: {
clickButtonToUpload (file) {
const attId = file.attId
if (attId) {
window.location.href = '/api/att/attFile/downloadFileForSar?fileId=' + attId
} else {
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('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl)));
window.open('/static/onlyOffice/onlinePreview.html?oldFileName=' + editFileInfo.oldFileName + '&fileType=' + editFileInfo.fileSuffix + '&attId=' + editFileInfo.id + '&fileUrl=' + editFileInfo.downLoadUrl + '&key=' + editFileInfo.id + nowTime+'&filePath='+editFileInfo.filePath+'&fileName='+editFileInfo.fileName)
}
// window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id))
}
}).catch(e => {
this.$message.warning('文件不存在,预览失败')
})
},
foldForm() {
this.foldFormFlag = !this.foldFormFlag
},
@@ -375,7 +434,7 @@ export default {
var fileSuffix = filename.substring(index1, index2)
// const fileSuffix = file.name.split('.')[1] // 后缀名
// 判断上传文件格式
if (fileSuffix === '.ppt' || fileSuffix === '.docx' || fileSuffix === '.DOCX' || fileSuffix === '.PPT' || fileSuffix === '.xls' || fileSuffix === '.xlsx') {
if (fileSuffix === '.ppt' || fileSuffix === '.docx' || fileSuffix === '.DOCX' || fileSuffix === '.PPT' || fileSuffix === '.xls' || fileSuffix === '.xlsx' || fileSuffix === '.XLS' || fileSuffix === '.XLSX') {
return true
} else {
this.$message.error('文件' + file.name + '格式不正确,请上传PPT,DOCX,XLS文件')
@@ -24,7 +24,7 @@
<el-collapse-transition>
<div class="prc-content-border" v-if="foldFormFlag === false">
<el-row :gutter="24">
<el-col :span="12">
<el-col :span="24">
<el-form-item label="调研标题" prop="title" class="add-form-item form-item-disabled">
<el-input
disabled
@@ -43,8 +43,14 @@
</el-form-item>
<el-form-item label="调研模板" prop="model" class="add-form-item form-item-disabled">
<div v-if="form.modelList.length > 0" style="display: flex;">
<div v-for="(item, index) in form.modelList" class="fileClass" :key="index" style="margin-right: 5px;" @click="updateFile(item)">
<div v-for="(item, index) in form.modelList" class="fileClass" :key="index" style="margin-right: 5px;" @click="clickButtonToUpload(item)">
{{ item.name }}
<el-button
size="small"
@click="updateFile(item)"
icon="el-icon-upload"
style="height: 32px; margin-left: 5px;"
></el-button>
</div>
</div>
<div v-else>
@@ -53,8 +59,14 @@
</el-form-item>
<el-form-item label="相关附件" prop="model" class="add-form-item form-item-disabled">
<div v-if="form.fjList.length > 0" style="display: flex;">
<div v-for="(item, index) in form.fjList" class="fileClass" :key="index" style="margin-right: 5px;" @click="updateFile(item)">
<div v-for="(item, index) in form.fjList" class="fileClass" :key="index" style="margin-right: 5px;" @click="clickButtonToUpload(item)">
{{ item.name }}
<el-button
size="small"
@click="updateFile(item)"
icon="el-icon-upload"
style="height: 32px; margin-left: 5px;"
></el-button>
</div>
</div>
<div v-else>
@@ -180,7 +192,7 @@
import ProcessHeader from '../../components/ProcessHeader'
import ProcessFooter from '../../components/ProcessFooter'
import ProcessTitle from '../../components/ProcessTitle'
import {inboundLiaisonDetail,processCreateStand,saveTaskForPub,changeAssigneeNew} from 'api/process'
import {inboundLiaisonDetail,processCreateStand,saveTaskForPub,changeAssigneeNew,getBusStandFileByAttId} from 'api/process'
import axios from "axios";
export default {
@@ -224,6 +236,42 @@
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('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl)));
window.open('/static/onlyOffice/onlinePreview.html?oldFileName=' + editFileInfo.oldFileName + '&fileType=' + editFileInfo.fileSuffix + '&attId=' + editFileInfo.id + '&fileUrl=' + editFileInfo.downLoadUrl + '&key=' + editFileInfo.id + nowTime+'&filePath='+editFileInfo.filePath+'&fileName='+editFileInfo.fileName)
}
// window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id))
}
}).catch(e => {
this.$message.warning('文件不存在,预览失败')
})
},
handleTransfer() {
this.drawerModal = true
},
@@ -24,7 +24,7 @@
<el-collapse-transition>
<div class="prc-content-border" v-if="foldFormFlag === false">
<el-row :gutter="24">
<el-col :span="12">
<el-col :span="24">
<el-form-item label="调研标题" prop="title" class="add-form-item form-item-disabled">
<el-input
disabled
@@ -43,8 +43,14 @@
</el-form-item>
<el-form-item label="调研模板" prop="model" class="add-form-item form-item-disabled">
<div v-if="form.modelList.length > 0" style="display: flex;">
<div v-for="(item, index) in form.modelList" class="fileClass" :key="index" style="margin-right: 5px;" @click="updateFile(item)">
<div v-for="(item, index) in form.modelList" class="fileClass" :key="index" style="margin-right: 5px;" @click="clickButtonToUpload(item)">
{{ item.name }}
<el-button
size="small"
@click="updateFile(item)"
icon="el-icon-upload"
style="height: 32px; margin-left: 5px;"
></el-button>
</div>
</div>
<div v-else>
@@ -53,8 +59,14 @@
</el-form-item>
<el-form-item label="相关附件" prop="model" class="add-form-item form-item-disabled">
<div v-if="form.fjList.length > 0" style="display: flex;">
<div v-for="(item, index) in form.fjList" class="fileClass" :key="index" style="margin-right: 5px;" @click="updateFile(item)">
<div v-for="(item, index) in form.fjList" class="fileClass" :key="index" style="margin-right: 5px;" @click="clickButtonToUpload(item)">
{{ item.name }}
<el-button
size="small"
@click="updateFile(item)"
icon="el-icon-upload"
style="height: 32px; margin-left: 5px;"
></el-button>
</div>
</div>
<div v-else>
@@ -72,7 +84,7 @@
</ProcessTitle>
<div class="prc-content-border">
<el-row :gutter="24">
<el-col :span="12">
<el-col :span="24">
<el-form-item label="调研结果" prop="fileName" class="add-form-item form-item-disabled">
<el-input
disabled
@@ -80,8 +92,14 @@
v-model="form.fileName"
clearable
></el-input>
<div v-if="form.fileName" @click="fileUpload" class="fileClass">
<div v-if="form.fileName" @click="clickButtonToUpload2(form.fileId)" class="fileClass">
{{ form.fileName }}
<el-button
size="small"
@click="updateFile(form)"
icon="el-icon-upload"
style="height: 32px; margin-left: 5px;"
></el-button>
</div>
<div v-else>
<el-button
@@ -230,7 +248,7 @@
import ProcessHeader from '../../components/ProcessHeader'
import ProcessFooter from '../../components/ProcessFooter'
import ProcessTitle from '../../components/ProcessTitle'
import {inboundLiaisonDetail,processCreateStand,saveTaskForPub,changeAssigneeNew,execTask} from 'api/process'
import {inboundLiaisonDetail,processCreateStand,saveTaskForPub,changeAssigneeNew,execTask,getBusStandFileByAttId} from 'api/process'
import axios from "axios";
export default {
@@ -279,6 +297,63 @@
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('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl)));
window.open('/static/onlyOffice/onlinePreview.html?oldFileName=' + editFileInfo.oldFileName + '&fileType=' + editFileInfo.fileSuffix + '&attId=' + editFileInfo.id + '&fileUrl=' + editFileInfo.downLoadUrl + '&key=' + editFileInfo.id + nowTime+'&filePath='+editFileInfo.filePath+'&fileName='+editFileInfo.fileName)
}
// window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id))
}
}).catch(e => {
this.$message.warning('文件不存在,预览失败')
})
},
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('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl)));
window.open('/static/onlyOffice/onlinePreview.html?oldFileName=' + editFileInfo.oldFileName + '&fileType=' + editFileInfo.fileSuffix + '&attId=' + editFileInfo.id + '&fileUrl=' + editFileInfo.downLoadUrl + '&key=' + editFileInfo.id + nowTime+'&filePath='+editFileInfo.filePath+'&fileName='+editFileInfo.fileName)
}
// window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id))
}
}).catch(e => {
this.$message.warning('文件不存在,预览失败')
})
},
handleTransfer() {
this.drawerModal = true
},
@@ -323,7 +398,7 @@
}, e => {})
},
updateFile (item) {
window.location.href = '/api/att/attFile/downloadFile?fileId=' + item.id
window.location.href = '/api/att/attFile/downloadFile?fileId=' + item.fileId
},
// 导入按钮 上传之前的钩子
beginImportFile (file) {
@@ -24,7 +24,7 @@
<el-collapse-transition>
<div class="prc-content-border" v-if="foldFormFlag === false">
<el-row :gutter="24">
<el-col :span="12">
<el-col :span="24">
<el-form-item label="调研标题" prop="title" class="add-form-item form-item-disabled">
<el-input
disabled
@@ -43,8 +43,14 @@
</el-form-item>
<el-form-item label="调研模板" prop="model" class="add-form-item form-item-disabled">
<div v-if="form.modelList.length > 0" style="display: flex;">
<div v-for="(item, index) in form.modelList" class="fileClass" :key="index" style="margin-right: 5px;" @click="updateFile(item.id)">
<div v-for="(item, index) in form.modelList" class="fileClass" :key="index" style="margin-right: 5px;" @click="clickButtonToUpload(item)">
{{ item.name }}
<el-button
size="small"
@click="updateFile(item)"
icon="el-icon-upload"
style="height: 32px; margin-left: 5px;"
></el-button>
</div>
</div>
<div v-else>
@@ -53,22 +59,28 @@
</el-form-item>
<el-form-item label="相关附件" prop="model" class="add-form-item form-item-disabled">
<div v-if="form.fjList.length > 0" style="display: flex;">
<div v-for="(item, index) in form.fjList" class="fileClass" :key="index" style="margin-right: 5px;" @click="updateFile(item)">
<div v-for="(item, index) in form.fjList" class="fileClass" :key="index" style="margin-right: 5px;" @click="clickButtonToUpload(item)">
{{ item.name }}
<el-button
size="small"
@click="updateFile(item)"
icon="el-icon-upload"
style="height: 32px; margin-left: 5px;"
></el-button>
</div>
</div>
<div v-else>
- -
</div>
</el-form-item>
<el-form-item label="调研结果" prop="fileName" class="add-form-item form-item-disabled">
<div v-if="form.file" class="fileClass" @click="updateFile(form.file)">
{{ form.fileName }}
</div>
<div v-else>
- -
</div>
</el-form-item>
<!-- <el-form-item label="调研结果" prop="fileName" class="add-form-item form-item-disabled">-->
<!-- <div v-if="form.file" class="fileClass" @click="updateFile(form.file)">-->
<!-- {{ form.fileName }}-->
<!-- </div>-->
<!-- <div v-else>-->
<!-- - - -->
<!-- </div>-->
<!-- </el-form-item>-->
</el-col>
</el-row>
</div>
@@ -82,8 +94,18 @@
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="调研结果" prop="fileName" class="add-form-item form-item-disabled">
<div v-if="form.file" class="fileClass" @click="updateFile(form.file)">
{{ form.fileName }}
<div v-if="form.file" class="fileClass">
<div style="display: flex;">
<div @click="clickButtonToUpload2(form.fileId)">
{{ form.fileName }}
</div>
<el-button
size="small"
@click="updateFile(form.fileId)"
icon="el-icon-upload"
style="height: 32px; margin-left: 5px;"
></el-button>
</div>
</div>
<div v-else>
- -
@@ -205,7 +227,7 @@
import ProcessHeader from '../../components/ProcessHeader'
import ProcessFooter from '../../components/ProcessFooter'
import ProcessTitle from '../../components/ProcessTitle'
import {inboundLiaisonDetail,processCreateStand,saveTaskForPub,changeAssigneeNew} from 'api/process'
import {inboundLiaisonDetail,processCreateStand,saveTaskForPub,changeAssigneeNew,getBusStandFileByAttId} from 'api/process'
import axios from "axios";
export default {
@@ -249,6 +271,63 @@
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('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl)));
window.open('/static/onlyOffice/onlinePreview.html?oldFileName=' + editFileInfo.oldFileName + '&fileType=' + editFileInfo.fileSuffix + '&attId=' + editFileInfo.id + '&fileUrl=' + editFileInfo.downLoadUrl + '&key=' + editFileInfo.id + nowTime+'&filePath='+editFileInfo.filePath+'&fileName='+editFileInfo.fileName)
}
// window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id))
}
}).catch(e => {
this.$message.warning('文件不存在,预览失败')
})
},
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('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(editFileInfo.downLoadUrl)));
window.open('/static/onlyOffice/onlinePreview.html?oldFileName=' + editFileInfo.oldFileName + '&fileType=' + editFileInfo.fileSuffix + '&attId=' + editFileInfo.id + '&fileUrl=' + editFileInfo.downLoadUrl + '&key=' + editFileInfo.id + nowTime+'&filePath='+editFileInfo.filePath+'&fileName='+editFileInfo.fileName)
}
// window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + editFileInfo.id))
}
}).catch(e => {
this.$message.warning('文件不存在,预览失败')
})
},
handleTransfer() {
this.drawerModal = true
},
@@ -350,6 +429,7 @@
this.json = data || data.form
this.form.file = data.fileId || data.form.fileId
this.form.fileName = data.fileName || data.form.fileName
this.form.fileId = data.fileId || data.form.fileId
this.form.modelList = data.modelList || data.form.modelList
this.form.fjList = data.fjList || data.form.fjList
}).catch(e => {