4c8e4c22 by weimo934

feat(fjcl):添加文件预览

1 parent 0a706607
......@@ -162,3 +162,17 @@ export function getFileLis(glbsm) {
}
})
}
/**
* 获取文件预览地址
*/
export function loadFile(url) {
return request({
url:"/file/loadImage",
method:'get',
params:{
url
}
})
}
......
......@@ -32,7 +32,7 @@
<td class="lx">{{item.filepostfix}}</td>
<td class="cz">
<span @click="downloadFile(item.fileurl)">下载</span>
<span>预览</span>
<span @click="loadFile(item.fileurl)">预览</span>
</td>
</tr>
</table>
......@@ -40,7 +40,7 @@
</template>
<script>
import {insertFile, getFileLis, downloadFile} from "./../../../api/common"
import {insertFile, getFileLis, downloadFile,loadFile} from "./../../../api/common"
import {Message} from "element-ui"
export default {
......@@ -83,6 +83,13 @@
this.getFileList(this.filesData.glbsm)
},
methods: {
loadFile(url){
loadFile(url).then(res=>{
if (res.success) {
window.open(res.message)
}
})
},
downloadFile(url) {
window.open(`/api/file/download?url=`+url);
},
......