johnsen 2 месяцев назад
Родитель
Сommit
36ff2f2da7
1 измененных файлов с 11 добавлено и 11 удалено
  1. 11 11
      src/business/platform/data/templaterender/templates/list.vue

+ 11 - 11
src/business/platform/data/templaterender/templates/list.vue

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