入会流程附件下载

This commit is contained in:
shenyanpei
2021-12-20 14:29:19 +08:00
parent 077aebcb8f
commit 731707bc4a
9 changed files with 378 additions and 71 deletions
+22 -15
View File
@@ -41,10 +41,10 @@
</div>
</template>
</el-calendar>
<!-- <div class="footer">
<el-tag style="background-color: #e6a23c;color: white">当天会议</el-tag>
<el-tag style="margin-left: 20px;background-color: #67c23a;color: white">我的会议</el-tag>
</div>-->
<!-- <div class="footer">
<el-tag style="background-color: #e6a23c;color: white">当天会议</el-tag>
<el-tag style="margin-left: 20px;background-color: #67c23a;color: white">我的会议</el-tag>
</div>-->
</el-card>
</el-col>
<el-col :span="12">
@@ -52,7 +52,7 @@
<div class="title_time">{{ timeDay.day || nowDate }}</div>
<span class="card_info_empty " v-if="todayData.length === 0">
<div style="text-align: center">
<img :src="require('@/assets/images/meeting.png')">
<img :src="require('@/assets/images/meeting.png')">
</div>
<div style="text-align: center;font-weight: bold;color: #99999a">暂无会议</div>
</span>
@@ -74,8 +74,13 @@
<div class="content_text">
<span>会议附件 :
<span v-if="item.files.length === 0">{{ '-' }}</span>
<span v-for="res in item.files" :key="res.id" style="color: #409EFF;" @click="previews(res.id)">
{{ res.name }} {{ ';'}}
<span v-else v-for="res in item.files" :key="res.id" style="color: #409EFF;" @click="previews(res.id)">
<a v-if="res.name.length > 30" style="cursor: pointer">
{{ res.name.slice(0, 30) + '...' }} {{ ';' }}
</a>
<a v-else style="cursor: pointer">
{{ res.name }} {{ ';' }}
</a>
</span>
</span>
</div>
@@ -87,7 +92,7 @@
</template>
<script>
import { meetingByMonth } from '@/api/unqualProcess.js'
import {meetingByMonth} from '@/api/unqualProcess.js'
export default {
name: "calendar",
@@ -121,10 +126,10 @@ export default {
let yy = new Date().getFullYear();
let mm = new Date().getMonth() + 1;
let dd = new Date().getDate();
if (mm<10) {
if (mm < 10) {
mm = this.padding0(mm, 2)
}
if (dd<10) {
if (dd < 10) {
dd = this.padding0(dd, 2)
}
this.nowDate = yy + '-' + mm + '-' + dd
@@ -177,8 +182,8 @@ export default {
this.resDate = res
this.dealMyDate()
this.todayData = []
this.resDate.forEach(item=>{
if (item.date.slice(0,10) === this.nowDate) {
this.resDate.forEach(item => {
if (item.date.slice(0, 10) === this.nowDate) {
this.todayData.push(item)
}
})
@@ -210,11 +215,11 @@ export default {
let yy = new Date().getFullYear();
let mm = new Date().getMonth() + 1;
let dd = new Date().getDate();
if (mm<10) {
if (mm < 10) {
mm = this.padding0(mm, 2)
}
this.formData.month = mm + '月'
if (dd<10) {
if (dd < 10) {
dd = this.padding0(dd, 2)
}
this.formData.year = yy + '年'
@@ -304,9 +309,10 @@ export default {
}
}
/deep/.el-calendar-table td.is-selected {
/deep/ .el-calendar-table td.is-selected {
background-color: #f9e3e3;
}
/deep/ .el-calendar__header {
display: none;
}
@@ -340,6 +346,7 @@ export default {
.card_info_empty {
margin-top: 50px;
}
.card_info {
height: 190px;
margin-top: 10px;
@@ -101,28 +101,27 @@
</el-col>
</el-row>
<el-form-item class="add-form-item" label="信息来源:" prop="infoSources">
<el-upload
style="width: 30%"
class="upload_style"
:disabled="acceptShow"
multiple
ref="uploadFile"
:action="uploadPath"
name="file"
:file-list="fileTextList"
accept=".ZIP, .zip, .docx, .DOCX, .xls, .xlsx, .pdf, .PDF"
:before-upload="handleBeforeUpload"
:before-remove="handleBeforeRemove"
:on-success="handleOnsuccess"
>
<el-button
type="primary"
class="common-button-primary"
@click="uploadFile"
size="mini">
点击上传
</el-button>
</el-upload>
<div v-if="rh_pageData.infoSources.length>0">
<div v-for="(item, index) in rh_pageData.infoSources" :key="index" style="margin-right: 5px; padding-left: 10px;color: #0c91e5;">
<a v-if="item.name.length > 30" style="cursor: pointer" @click="fileLook(item)">
{{ item.name.slice(0, 30) + '...' }} {{ ';' }}
</a>
<a v-else style="cursor: pointer" @click="fileLook(item)">{{ item.name }}</a>
<el-button
size="mini"
@click="filesUpload(item)"
icon="el-icon-download"
style="height: 25px; margin-left: 5px;"
></el-button>
</div>
</div>
<el-button
type="primary"
class="common-button-primary"
@click="uploadFile"
size="mini">
点击上传
</el-button>
</el-form-item>
<el-form-item class="add-form-item" label="协会构成:" prop="comityMake">
<el-form
@@ -363,6 +362,29 @@
</el-timeline>
</div>
</div>
<el-dialog width='400px' :visible.sync="fileMadel" title="上传附件">
<el-upload
class="upload-demo"
:disabled="acceptShow"
multiple
ref="uploadFile"
:action="uploadPath"
name="file"
drag
:file-list="rh_pageData.infoSources"
accept=".ZIP, .zip, .docx, .DOCX, .xls, .xlsx, .pdf, .PDF"
:before-upload="handleBeforeUpload"
:before-remove="handleBeforeRemove"
:on-success="handleOnsuccess"
>
<div style="padding: 20px 0">
<i class="el-icon-upload" style="color: #3399ff"></i>
<p>点击或拖拽上传文件</p>
</div>
</el-upload>
</el-dialog>
<ProcessFooter
show-save
show-submit
@@ -395,7 +417,8 @@ import ProcessTitle from '../../components/ProcessTitle'
import {
startProcess, saveTaskFirst,
completeTask, queryTaskFirst,
taskDel, workGroup,processBack
taskDel, workGroup, processBack,
getBusStandFileByAttId
} from '@/api/process.js'
export default {
@@ -408,6 +431,7 @@ export default {
data() {
return {
active: '1', // 默认显示
fileMadel: false,
rh_pageData: {
comityName: '',
comityNameOne: '',
@@ -547,8 +571,8 @@ export default {
});
},
//上传按钮
uploadFile(val) {
this.fileListData = val
uploadFile() {
this.fileMadel = true
},
// 文件上传限制条件
handleBeforeUpload(file) {
@@ -578,18 +602,17 @@ export default {
// 移除上传的文件
handleBeforeRemove(file, fileList) {
this.fileData = fileList
this.fileTextList.forEach((item, index) => {
this.rh_pageData.infoSources.forEach((item, index) => {
if (item.name === file.name || item.id === file.id) {
this.fileTextList.splice(index, 1)
this.rh_pageData.infoSources.splice(index, 1)
}
})
this.rh_pageData.infoSources = this.fileTextList
},
// 文件上传成功
handleOnsuccess(res, file, fileList) {
if (res.ok) {
if (this.fileTextList !== null) {
this.newDataList = this.fileTextList
if (this.rh_pageData.infoSources !== null) {
this.newDataList = this.rh_pageData.infoSources
this.newDataList.push({
id: res.data.attId,
name: res.data.name
@@ -600,7 +623,6 @@ export default {
name: res.data.name
})
}
this.fileListData.fileText = this.newDataList
this.rh_pageData.infoSources = this.newDataList
this.$message({
showClose: true,
@@ -611,6 +633,52 @@ export default {
}
},
// 文件预览
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.id
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('文件不存在,预览失败')
})
},
filesUpload (file) { // 下载
const attId = file.id
if (attId) {
window.location.href = '/api/att/attFile/downloadFileForSar?fileId=' + attId
} else {
this.$message.warning('文件不存在,下载失败')
}
},
/** 添加 */
add_comityTel() {
@@ -701,7 +769,7 @@ export default {
if (this.type === 'leaderUser') {
this.roleForm.leaderUser = data[0].name
this.roleForm.leaderUserId = data[0].id
} else if(this.type === 'engineerUser'){
} else if (this.type === 'engineerUser') {
this.roleForm.engineerUser = data[0].name
this.roleForm.engineerUserId = data[0].id
} else {
@@ -890,6 +958,9 @@ export default {
text-align: right;
}
/deep/.el-form-item__content{
margin-top: 3px;
}
/deep/ .el-table th {
padding: 0px;
}
@@ -72,12 +72,20 @@
<el-col :span="24">
<el-form-item class="add-form-item" label="信息来源:" prop="infoSources">
<span v-if="infoSourcesLength === 0">{{ '-' }}</span>
<span v-for="item in rh_pageData.infoSources" :key="item.id" style="color: #409EFF;" @click="previews(item.id)">
<a v-if="item.name.length > 30">
<div v-for="item in rh_pageData.infoSources" :key="item.id" style="color: #409EFF;">
<a v-if="item.name.length > 30" style="cursor: pointer" @click="fileLook(item)">
{{ item.name.slice(0,30) + '...' }} {{ ';' }}
</a>
<a v-else>{{ item.name }} {{ ';' }}</a>
</span>
<a v-else style="cursor: pointer" @click="fileLook(item)">
{{ item.name }} {{ ';' }}
</a>
<el-button
size="mini"
@click="previews(item.id)"
icon="el-icon-download"
style="height: 25px; margin-left: 5px;"
></el-button>
</div>
</el-form-item>
</el-col>
</el-row>
@@ -214,6 +222,7 @@ import ProcessTitle from "../../components/ProcessTitle";
import {
completeTask,
inboundLiaisonDetail,
getBusStandFileByAttId,
startProcess,
saveinboundTask,
saveTaskForPub,
@@ -318,7 +327,43 @@ export default {
handleTabs(name) {
this.active = name
},
// 预览
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.id
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('文件不存在,预览失败')
})
},
/** 点击对应附件进行下载*/
previews(val) {
let attId = val
@@ -72,12 +72,20 @@
<el-col :span="24">
<el-form-item class="add-form-item" label="信息来源:" prop="infoSources">
<span v-if="infoSourcesLength < 1">{{ '-' }}</span>
<span v-for="item in rh_pageData.infoSources" :key="item.id" style="color: #409EFF;" @click="previews(item.id)">
<a v-if="item.name.length > 30">
<div v-for="item in rh_pageData.infoSources" :key="item.id" style="color: #409EFF;">
<a v-if="item.name.length > 30" style="cursor: pointer" @click="fileLook(item)">
{{ item.name.slice(0,30) + '...' }} {{ ';' }}
</a>
<a v-else>{{ item.name }} {{ ';' }}</a>
</span>
<a v-else style="cursor: pointer" @click="fileLook(item)">
{{ item.name }} {{ ';' }}
</a>
<el-button
size="mini"
@click="previews(item.id)"
icon="el-icon-download"
style="height: 25px; margin-left: 5px;"
></el-button>
</div>
</el-form-item>
</el-col>
</el-row>
@@ -309,6 +317,7 @@ import ProcessTitle from "../../components/ProcessTitle";
import {
completeTask,
inboundLiaisonDetail,
getBusStandFileByAttId,
saveinboundTask,
saveTaskForPub,
} from "@/api/process.js"
@@ -557,6 +566,43 @@ export default {
this.fileMadel = false
}
},
// 预览
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.id
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('文件不存在,预览失败')
})
},
/** 点击对应附件进行下载*/
previews(val) {
let attId = val
@@ -72,12 +72,20 @@
<el-col :span="24">
<el-form-item class="add-form-item" label="信息来源:" prop="infoSources">
<span v-if="infoSourcesLength === 0">{{ '-' }}</span>
<span v-for="item in rh_pageData.infoSources" :key="item.id" style="color: #409EFF;" @click="previews(item.id)">
<a v-if="item.name.length > 30">
<div v-for="item in rh_pageData.infoSources" :key="item.id" style="color: #409EFF;">
<a v-if="item.name.length > 30" style="cursor: pointer" @click="fileLook(item)">
{{ item.name.slice(0,30) + '...' }} {{ ';' }}
</a>
<a v-else>{{ item.name }} {{ ';' }}</a>
</span>
<a v-else style="cursor: pointer" @click="fileLook(item)">
{{ item.name }} {{ ';' }}
</a>
<el-button
size="mini"
@click="previews(item.id)"
icon="el-icon-download"
style="height: 25px; margin-left: 5px;"
></el-button>
</div>
</el-form-item>
</el-col>
</el-row>
@@ -230,6 +238,7 @@ import {
completeTask,
inboundLiaisonDetail,
saveinboundTask,
getBusStandFileByAttId,
saveTaskForPub,
changeAssigneeNew
} from "@/api/process.js"
@@ -409,6 +418,43 @@ export default {
}
})
},
// 预览
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.id
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('文件不存在,预览失败')
})
},
/** 点击对应附件进行下载*/
previews(val) {
let attId = val
@@ -72,12 +72,20 @@
<el-col :span="24">
<el-form-item class="add-form-item" label="信息来源:" prop="infoSources">
<span v-if="infoSourcesLength === 0">{{ '-' }}</span>
<span v-for="item in rh_pageData.infoSources" :key="item.id" style="color: #409EFF;" @click="previews(item.id)">
<a v-if="item.name.length > 30">
<div v-for="item in rh_pageData.infoSources" :key="item.id" style="color: #409EFF;">
<a v-if="item.name.length > 30" style="cursor: pointer" @click="fileLook(item)">
{{ item.name.slice(0,30) + '...' }} {{ ';' }}
</a>
<a v-else>{{ item.name }} {{ ';' }}</a>
</span>
<a v-else style="cursor: pointer" @click="fileLook(item)">
{{ item.name }} {{ ';' }}
</a>
<el-button
size="mini"
@click="previews(item.id)"
icon="el-icon-download"
style="height: 25px; margin-left: 5px;"
></el-button>
</div>
</el-form-item>
</el-col>
</el-row>
@@ -268,6 +276,7 @@ import {
completeTask,
inboundLiaisonDetail,
saveinboundTask,
getBusStandFileByAttId,
saveTaskForPub,
changeAssigneeNew
} from "@/api/process.js"
@@ -448,6 +457,43 @@ export default {
})
},
// 预览
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.id
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('文件不存在,预览失败')
})
},
/** 点击对应附件进行下载*/
previews(val) {
@@ -72,12 +72,12 @@
<el-col :span="24">
<el-form-item class="add-form-item" label="信息来源:" prop="infoSources">
<span v-if="infoSourcesLength < 1">{{ '-' }}</span>
<span v-for="item in rh_pageData.infoSources" :key="item.id" style="color: #409EFF;" @click="previews(item.id)">
<div v-for="item in rh_pageData.infoSources" :key="item.id" style="color: #409EFF;" @click="previews(item.id)">
<a v-if="item.name.length > 30">
{{ item.name.slice(0,30) + '...' }} {{ ';' }}
</a>
<a v-else>{{ item.name }} {{ ';' }}</a>
</span>
</div>
</el-form-item>
</el-col>
</el-row>
@@ -75,12 +75,20 @@
<el-col :span="24">
<el-form-item class="add-form-item" label="信息来源:" prop="infoSources">
<span v-if="infoSourcesLength < 1">{{ '-' }}</span>
<span v-for="item in rh_pageData.infoSources" :key="item.id" style="color: #409EFF;" @click="previews(item.id)">
<a v-if="item.name.length > 30">
<div v-for="item in rh_pageData.infoSources" :key="item.id" style="color: #409EFF;">
<a v-if="item.name.length > 30" style="cursor: pointer" @click="fileLook(item)">
{{ item.name.slice(0,30) + '...' }} {{ ';' }}
</a>
<a v-else>{{ item.name }} {{ ';' }}</a>
</span>
<a v-else style="cursor: pointer" @click="fileLook(item)">
{{ item.name }} {{ ';' }}
</a>
<el-button
size="mini"
@click="previews(item.id)"
icon="el-icon-download"
style="height: 25px; margin-left: 5px;"
></el-button>
</div>
</el-form-item>
</el-col>
</el-row>
@@ -240,6 +248,7 @@ import {
completeTask,
inboundLiaisonDetail,
saveinboundTask,
getBusStandFileByAttId,
saveTaskForPub,
changeAssigneeNew
} from "@/api/process.js"
@@ -356,6 +365,43 @@ export default {
// this.rh_pageData.comityFileNum = this.fileTextList
})
},
// 预览
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.id
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('文件不存在,预览失败')
})
},
/** 点击对应附件进行下载*/
previews(val) {
let attId = val
@@ -65,7 +65,7 @@
{{ ch_pageData.feeKind || '-' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="10">
<el-form-item class="add-form-item" label="上传附件:" prop="uploadFile">
<span v-if="uploadFileLength < 1">{{ '-' }}</span>
<div v-for="item in ch_pageData.fileTextList" :key="item.id" style="color: #409EFF;">