4c8e4c22 by weimo934

feat(fjcl):添加文件预览

1 parent 0a706607
...@@ -162,3 +162,17 @@ export function getFileLis(glbsm) { ...@@ -162,3 +162,17 @@ export function getFileLis(glbsm) {
162 } 162 }
163 }) 163 })
164 } 164 }
165
166 /**
167 * 获取文件预览地址
168 */
169 export function loadFile(url) {
170 return request({
171 url:"/file/loadImage",
172 method:'get',
173 params:{
174 url
175 }
176 })
177
178 }
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
32 <td class="lx">{{item.filepostfix}}</td> 32 <td class="lx">{{item.filepostfix}}</td>
33 <td class="cz"> 33 <td class="cz">
34 <span @click="downloadFile(item.fileurl)">下载</span> 34 <span @click="downloadFile(item.fileurl)">下载</span>
35 <span>预览</span> 35 <span @click="loadFile(item.fileurl)">预览</span>
36 </td> 36 </td>
37 </tr> 37 </tr>
38 </table> 38 </table>
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
40 </template> 40 </template>
41 41
42 <script> 42 <script>
43 import {insertFile, getFileLis, downloadFile} from "./../../../api/common" 43 import {insertFile, getFileLis, downloadFile,loadFile} from "./../../../api/common"
44 import {Message} from "element-ui" 44 import {Message} from "element-ui"
45 45
46 export default { 46 export default {
...@@ -83,6 +83,13 @@ ...@@ -83,6 +83,13 @@
83 this.getFileList(this.filesData.glbsm) 83 this.getFileList(this.filesData.glbsm)
84 }, 84 },
85 methods: { 85 methods: {
86 loadFile(url){
87 loadFile(url).then(res=>{
88 if (res.success) {
89 window.open(res.message)
90 }
91 })
92 },
86 downloadFile(url) { 93 downloadFile(url) {
87 window.open(`/api/file/download?url=`+url); 94 window.open(`/api/file/download?url=`+url);
88 }, 95 },
......