import axios from '@/common/axiosV2' export function getFileAttId (data) { this.getBusStandFileByAttId(data) .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('文件不存在,预览失败') }) } export function getBusStandFileByAttId(data) { return axios({ url: 'api/att/attFile/getBusStandFileByAttId', method: 'get', params: data }) }