bc2e7b47 by 杨威
2 parents 39eb31fd 4c8e4c22
......@@ -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);
},
......