|
@@ -1235,15 +1235,15 @@ export default {
|
|
|
case 'custom': // 自定义按钮
|
|
case 'custom': // 自定义按钮
|
|
|
break
|
|
break
|
|
|
case 'example': // 示例
|
|
case 'example': // 示例
|
|
|
- const { data } = await this.getRemoteByIdFunc(
|
|
|
|
|
|
|
+ const { data: data1 } = await this.getRemoteByIdFunc(
|
|
|
this.template.attrs.formExample
|
|
this.template.attrs.formExample
|
|
|
)
|
|
)
|
|
|
- console.log('data---->', data)
|
|
|
|
|
- if (fileTypes.images.includes(data.ext)) {
|
|
|
|
|
- this.file = data
|
|
|
|
|
|
|
+ console.log('data---->', data1)
|
|
|
|
|
+ if (fileTypes.images.includes(data1.ext)) {
|
|
|
|
|
+ this.file = data1
|
|
|
this.filePreviewVisible2 = false
|
|
this.filePreviewVisible2 = false
|
|
|
this.filePreviewVisible = true
|
|
this.filePreviewVisible = true
|
|
|
- } else if (data.ext === 'pdf' || data.ext === 'PDF') {
|
|
|
|
|
|
|
+ } else if (data1.ext === 'pdf' || data1.ext === 'PDF') {
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
const newTab = window.open()
|
|
const newTab = window.open()
|
|
|
const link = newTab.document.createElement('link')
|
|
const link = newTab.document.createElement('link')
|
|
@@ -1251,14 +1251,14 @@ export default {
|
|
|
BASE_API() +
|
|
BASE_API() +
|
|
|
SYSTEM_URL() +
|
|
SYSTEM_URL() +
|
|
|
'/file/download?attachmentId=' +
|
|
'/file/download?attachmentId=' +
|
|
|
- data.id
|
|
|
|
|
|
|
+ data1.id
|
|
|
const hasRole = localStorage.getItem('hasHighRole') || 0
|
|
const hasRole = localStorage.getItem('hasHighRole') || 0
|
|
|
link.rel = 'shortcut icon'
|
|
link.rel = 'shortcut icon'
|
|
|
link.type = 'image/x-icon'
|
|
link.type = 'image/x-icon'
|
|
|
link.href = 'favicon.ico'
|
|
link.href = 'favicon.ico'
|
|
|
// newTab.document.write('<link rel="icon" type="image/x-icon" href="favicon.ico">')
|
|
// newTab.document.write('<link rel="icon" type="image/x-icon" href="favicon.ico">')
|
|
|
newTab.document.write(
|
|
newTab.document.write(
|
|
|
- `<title>文件预览页-${data.fileName}</title>`
|
|
|
|
|
|
|
+ `<title>文件预览页-${data1.fileName}</title>`
|
|
|
)
|
|
)
|
|
|
newTab.document.write('<style>body { margin: 0px; }</style>')
|
|
newTab.document.write('<style>body { margin: 0px; }</style>')
|
|
|
newTab.document.head.appendChild(link)
|
|
newTab.document.head.appendChild(link)
|
|
@@ -1271,10 +1271,10 @@ export default {
|
|
|
)
|
|
)
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
|
- this.file.url = `${this.$onlyofficeApi}/file/download?attachmentId=${data.id}`
|
|
|
|
|
- this.file.editUrl = `${this.$onlyofficeApi}/file/editCallback?fileName=${data.fileName}&fileType=${data.ext}&id=${data.id}`
|
|
|
|
|
- this.file.title = data.fileName // 文件名称
|
|
|
|
|
- this.file.fileType = data.ext // 类型
|
|
|
|
|
|
|
+ this.file.url = `${this.$onlyofficeApi}/file/download?attachmentId=${data1.id}`
|
|
|
|
|
+ this.file.editUrl = `${this.$onlyofficeApi}/file/editCallback?fileName=${data1.fileName}&fileType=${data1.ext}&id=${data1.id}`
|
|
|
|
|
+ this.file.title = data1.fileName // 文件名称
|
|
|
|
|
+ this.file.fileType = data1.ext // 类型
|
|
|
this.filePreviewVisible = false
|
|
this.filePreviewVisible = false
|
|
|
this.filePreviewVisible2 = true
|
|
this.filePreviewVisible2 = true
|
|
|
}
|
|
}
|