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

南京个人网站建设excel网站建设

南京个人网站建设,excel网站建设,沈阳网站建设培训,科技创新可以被分成三种类型作者#xff1a;fyupeng 技术专栏#xff1a;☞ https://github.com/fyupeng 项目地址#xff1a;☞ https://github.com/fyupeng/distributed-blog-system-api 留给读者 本文 一、介绍 对于PDF预览#xff0c;有很多开发者都遇到过头疼的难题#xff0c;今天给大家介绍… 作者fyupeng 技术专栏☞ https://github.com/fyupeng 项目地址☞ https://github.com/fyupeng/distributed-blog-system-api 留给读者 本文 一、介绍 对于PDF预览有很多开发者都遇到过头疼的难题今天给大家介绍一个比较成熟的浏览器直接提供的预览嵌入Vue组件。 二、代码 快速使用 html渲染 el-dialog:lock-scrollfalsecustom-classimgPreview_dia:show-closetruetop5vhwidth90vwv-modeldialogVisiblefilePreview :fileUrlfileUrl width90vw height90vh/filePreview/el-dialogcss样式 .imgPreview_dia {border-radius: 0 !important;margin: 0;left: 5vw; }js 处理 const dialogVisible ref(false);const fileUrl ref();const handleYulan (index: number, row: object) {fileUrl.value // showDocFile() http://localhost:8086/machine/commonFile/notice/showDocFile ?fileId row.fileId pripid props.initData?.pripid time new Date().getTime();// fileUrl.value // showDocFile() // ?docId2516gid4055fb556a9c440590464017f28aae0etime1691460960121;dialogVisible.value true; };模板 后端处理 public Boolean showNoticeDocFile(String fileId, HttpServletResponse response) {FileInputStream input null;OutputStream output null;try {File file getNoticeDocRowFile(fileId);if (file null || !file.exists()) {return false;}input new FileInputStream(file);int i input.available(); // 得到文件大小byte[] data new byte[i];input.read(data); // 读数据response.setContentType(application/pdf); // 设置返回的文件类型response.addHeader(Content-Length, String.valueOf(data.length)); //文件大小output response.getOutputStream(); // 得到向客户端输出二进制数据的对象output.write(data); // 输出数据output.flush();file.delete();return true;} catch (Exception e) {logger.error(showFile文件信息回显失败fileId:{}, fileId, e);return false;} finally {try {if (input ! null)input.close();if (output ! null)output.close();} catch (IOException e) {logger.error(e.getMessage(), e);}}}前端处理 filePreview.vue templatediv classwrap v-loadingisLoadingdiv classpdf-containeriframeiddoc-iframe:srcurl:style{ width: prop.width, height: prop.height, background: #fff }classparintDetailDocrefiframeRef/iframe/div/div /templatescript langts setup import { ref, reactive, watch, defineProps, defineEmits, onMounted } from vue; import { ElMessage } from element-plus; const emits defineEmits([loaded]); const prop defineProps({fileUrl: {type: String,default: ,},width: {type: String,default: 800px,},height: {type: String,default: 800px,}, }); const isLoading ref(true); const url ref();watch(() prop.fileUrl,() {url.value prop.fileUrl;console.log(--------prop.fileUrl, prop.fileUrl);},{ immediate: true } ); onMounted(() {let iframeDom document.getElementById(doc-iframe) || {};iframeDom.onload function () {isLoading.value false;emits(loaded);}; }); /scriptstyle scoped .parintDetailDoc::-webkit-scrollbar {display: none; } .parintDetailDoc {border: none;max-width: 100%; } /style 三、总结 简洁、高效、实用
http://www.hkea.cn/news/14564568/

相关文章:

  • 深圳网络科技有限公司有哪些百度seo快速见效方法
  • 中国建设银行网站对公业务网站建设liluokj
  • 微网站 app 区别中国世达建筑公司排名
  • 湖南网站设计公司软装设计培训一般多少钱
  • 做标签的网站部门网站建设内容方案
  • 德宏做网站wordpress快速登录插件
  • 一流 北京网站建设小程序的定义
  • 微信建设小网站链接个人备案的域名拿来做经营网站
  • 网站域名在哪里wordpress子主题视频
  • 盐城网站开发代理北京广告设计公司
  • 招聘网站是怎么做推广wordpress2中文
  • 网站运营是什么岗位邢台网络运营中心处理中心
  • 谷歌网站地图生成网站开发文献综述
  • 美团网站建设总体需求与目标wordpress 用户徽标
  • h5商城网站是什么意思东莞常平邮政编码多少
  • 电子规划书商务网站建设镇江网站托管
  • 定制搭建网站wordpress 物流主题
  • 九江企业网站建设室内装修设计软件下载
  • 优惠券精选网站怎么做营销策划方案内容
  • 赣州网站设计有哪些网站建设信息在哪儿发布
  • dedecms 英文网站重庆seo优化公司
  • 电商网站人员配置网站 后台 安装
  • 聊城汽车网站建设图片生成网页链接在线
  • 做查工资的网站百度秒收网站
  • dedecms妇科医院wap网站模板 v1.0网站正在建设中页面 英文
  • 做网站 给源代码淄博外贸网站制作
  • 怎样注册免费网站广西建设职业技术学院教育网站
  • 杨凌做网站的自己做小程序开个社区团购
  • 长沙网站推it运维服务外包
  • 从网络全角度考量_写出建设一个大型电影网站规划方案金乡县住房和城乡建设局网站