当前位置: 首页 > news >正文

金华网站建设工程网站建设百度添加到桌面

金华网站建设工程网站建设,百度添加到桌面,网站的总规划书,购物类网站kkFileView - 在线文件预览kkFileView官网 - kkFileView使用Spring Boot搭建,易上手和部署,基本支持主流办公文档的在线预览,如doc,docx,Excel,pdf,txt,zip,rar,图片等等https://kkfileview.keking.cn/zh-cn/docs/usage.html业务场景&#xf…

kkFileView - 在线文件预览kkFileView官网 - kkFileView使用Spring Boot搭建,易上手和部署,基本支持主流办公文档的在线预览,如doc,docx,Excel,pdf,txt,zip,rar,图片等等icon-default.png?t=N7T8https://kkfileview.keking.cn/zh-cn/docs/usage.html业务场景:需要点击按钮,弹出弹框预览pdf文件

这里使用的是3.x.x 版本,需要下载base64

3.x.x 版本 # 示例

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/js-base64@3.6.0/base64.min.js"></script>var originUrl = 'http://127.0.0.1:8080/filedownload?fileId=1'; //要预览文件的访问地址
var previewUrl = originUrl + '&fullfilename=test.txt'
window.open('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(Base64.encode(previewUrl)));

 

 

配置baseUrl,如果是生产环境,走 location.origin 浏览器的当前地址,它包含了协议、域名和端口号,否则走项目配置中设置的环境变量 VITE_APP_API_URL  的值。

替换示例的文件地址,打开弹窗时把地址传给弹窗,弹窗里使用iframe

// 预览const handleClickOpenPreview = (row) => {if (row.fileState === '无') returnconst baseUrl = import.meta.env.PROD ? location.origin : import.meta.env.VITE_APP_API_URL// const originUrl = baseUrl + '/hs/document/downloadWord' + '?fileName=010001_20231015_1697332623776.docx'// const previewUrl = originUrl + '&fullfilename=010001_20231015_1697332623776.docx'// window.open('http://100.100.120.147:8012/preview/onlinePreview?url=' + encodeURIComponent(Base64.encode(previewUrl)));// window.open(baseUrl + '/preview/onlinePreview?url=' + encodeURIComponent(Base64.encode(previewUrl)));const originUrl = baseUrl + '/hs/document/downloadWord' + `?fileName=${row.fileName}`const previewUrl = originUrl + `&fullfilename=${row.fileName}`const url = baseUrl + '/preview/onlinePreview?url=' + encodeURIComponent(Base64.encode(previewUrl))state.PreViewFileDialogRef.open(row, url) // 把url传给弹窗}

 弹窗页

<template><PatrolDialog :show="show" @close="show = false" DeleteFooterBtn width="1370px" top="5vh"><template #title><div class="dialog-title"><img :src="weatherStationIcon" />预览</div></template><div class="formPart"><el-dropdown trigger="click" @command="handleClickExport" size="small"><span class="el-dropdown-link"><i class="icon iconfont icon-daochu" style="color: var(--gdky-primary-color);"></i></span><template #dropdown><el-dropdown-menu><el-dropdown-item command="word">word</el-dropdown-item><el-dropdown-item command="pdf">pdf</el-dropdown-item></el-dropdown-menu></template></el-dropdown><!-- 在弹窗中显示的内容 --><iframe :src="pageUrl" width="100%" height="800px" class="file"></iframe></div></PatrolDialog>
</template><script>
import { reactive, toRefs, computed, watch } from 'vue'
import PatrolDialog from '@/views/Components/PatrolDialog.vue'
import weatherStationIcon from '@/assets/imgs/title_img.png'
import { exportWord, exportPdf } from '@/api/PlatTool/CustomModules/HeatSourceDispatch/index'export default {components: {PatrolDialog},setup(_, { emit }) {const state = reactive({show: false,weatherStationIcon, // iconcurRow: null,pageUrl: "",})const methods = {// 打开弹窗async open(curRow, url) {state.show = true;state.curRow = curRow;state.pageUrl = url},// 导出handleClickExport(command) {if (command === "word") {exportWord({ fileName: state.curRow.fileName })} else {exportPdf({ fileName: state.curRow.pdfFileName })}}}return {...toRefs(state),...methods,}}
}
</script>
<style lang='less' scoped>
.dialog-title {display: flex;font-size: 16px;font-family: MicrosoftYaHeiSemibold;color: var(--gdky-main-content-color);line-height: 24px;padding-bottom: var(--base-padding);img {margin-right: 8px;}
}.formPart {display: flex;flex-direction: column;flex: 1;height: 100%;.file {display: flex;justify-content: center;align-items: center;margin-left: -15px;position: relative;}.el-dropdown-link {position: absolute;top: 5px;right: 88px;z-index: 999;}
}
</style><style lang="less">
.g-dark {.formPart {.el-dropdown-link {}}
}
</style>

http://www.khdw.cn/news/59835.html

相关文章:

  • web怎样插入自己做的网站seo包括什么
  • 网站建设公司服网站优化基本技巧
  • 网站建设营销排名方案网页制作培训网站
  • 佳木斯建设局网站百度seo优化分析
  • 哪些做展架图的网站好深圳网
  • 网站前端设计要做什么的信息流广告优化师培训
  • 成都网站设计公司哪家好站长工具权重查询
  • 外贸网站模板下载西安网站优化推广方案
  • 新疆网站建设咨询电脑优化大师有用吗
  • 手机销售网站模板关键词挖掘站网
  • 免费学设计的网站百度如何优化
  • 做结婚请柬网站有那些网球排名即时最新排名
  • asp做bs网站怎么写网页百度广告联盟
  • 网站怎么做动效搜索网站哪个好
  • 有什么教做甜品的网站站长工具 seo查询
  • 软件开发工程师是程序员吗专业seo站长工具全面查询网站
  • 农业信息门户网站建设方案百度2020新版下载
  • 咸阳网站开发公司官网模板
  • 青岛专业建设网站湖南今日新闻最新头条
  • 网站banner制作中国大数据平台官网
  • 一个网站域名一年要多少钱seo关键词优化推广报价表
  • 科技服务公司网站模版青岛网站制作seo
  • 做厂房出租有那些推广网站网络舆情管理
  • dw网站建设的常用技术网店推广实训系统
  • 自己做网站的准备工作爱站网站长seo综合查询
  • 做英文网站多少钱各类资源关键词
  • 鼓楼网站seo搜索引擎优化考拉seo
  • 做设计怎么进公司网站seo技术外包公司
  • 佳木斯万达建设网站企业关键词优化公司
  • 美食网站设计论文武汉百度seo排名