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

大型网站搜索怎么做的实时热榜

大型网站搜索怎么做的,实时热榜,网站做竞价经常会被攻击吗,网站静态生成目录 名称 建议xlsx文件预览 Luckysheet是什么?代码实现xlsx文件预览引入luckysheet的相关依赖安装luckyexcel指定一个表格容器实现逻辑 Luckysheet是什么? Luckysheet ,一款纯前端类似excel的在线表格,功能强大、配置简单、完全开源。 Luckys…

xlsx文件预览

  • Luckysheet是什么?
  • 代码实现xlsx文件预览
    • 引入luckysheet的相关依赖
    • 安装luckyexcel
    • 指定一个表格容器
    • 实现逻辑

Luckysheet是什么?

Luckysheet ,一款纯前端类似excel的在线表格,功能强大、配置简单、完全开源。

Luckysheet 已不再维护,推荐使用 Univer 替代;虽然不在维护,但是不影响他功能以及特性的强大,还是可以正常使用;

本来我是想尝试用Univer,但是我的项目是一个引入vue2的H5项目,所以只能用Luckysheet 来实现;

如果想探索和了解更多点击官方中文文档或者gitHub仓库地址查询和学习;

代码实现xlsx文件预览

我项目里新建的一个xlsxPreview.html,实现,点击文件后,调转到该页面实现预览;

引入luckysheet的相关依赖

我这里在xlsxPreview.html中直接是CDN引入,你也可以安装后再build打包后把dist文件夹下的所有文件复制到项目目录,然后通过相对路径引入,这个官方文档有介绍,这里就不写了,我们直接用CDN引入,

 //我这里引入vue,是为了说明在下面H5中使用了vue的写法,<script src='../../js/vue.js'></script>//你只需要引入下面的即可<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/luckysheet@latest/dist/plugins/css/pluginsCss.css' /><link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/luckysheet@latest/dist/plugins/plugins.css' /><link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/luckysheet@latest/dist/css/luckysheet.css' /><link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/luckysheet@latest/dist/assets/iconfont/iconfont.css' /><script src="https://cdn.jsdelivr.net/npm/luckysheet@latest/dist/plugins/js/plugin.js"></script><script src="https://cdn.jsdelivr.net/npm/luckysheet@latest/dist/luckysheet.umd.js"></script>

安装luckyexcel

npm install  luckyexcel --save

把node_modules中安装的luckyexcel 复制出来到H5目录下,在xlsxPreview.html通过script引入;

<script src="../../luckyexcel/dist/luckyexcel.umd.js"></script>

指定一个表格容器

 <div style="width: 100%;" id="xlsxPreview"><div id="luckysheet" style="margin:0px;padding:5px;position:absolute;width:100%;height:100%;left: 0px;top: 0px;" ></div></div>

实现逻辑

  mounted() {const fileId = getParam("fileId")this.getFile(fileId)},methods:{getFile(fileId){$.ajax({url:"/api-file/file/getFileByte",type: 'post',responseType:'blob',data: {fileId: fileId,},beforeSend: function (request) {request.setRequestHeader("Authorization", "Bearer " + JSON.parse(window.sessionStorage.getItem('store') || '{}').token);},success:(res) => {// 将Base64字符串转换为二进制字符串const path = res.dataconst raw = window.atob(path);const rawLength = raw.length;const uInt8Array = new Uint8Array(rawLength);for (let i = 0; i < rawLength; ++i) {uInt8Array[i] = raw.charCodeAt(i);}const xlsxBlob = new Blob([uInt8Array],{type:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'})const file = new File([xlsxBlob], 'XXX.xlsx', { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });var files = [];files.push(file);this.uploadExcel(files)},error:(err) => {alert('文件加载失败,请稍后重试!')}})},uploadExcel(files) {if (files == null || files.length == 0) return alert('没有文件等待导入');let name = files[0].name;let suffixArr = name.split('.'),suffix = suffixArr[suffixArr.length - 1];if (suffix != 'xlsx') return alert('目前只支持导入xlsx文件');LuckyExcel.transformExcelToLucky(files[0], function (exportJson, luckysheetfile) {if (exportJson.sheets == null || exportJson.sheets.length == 0) return alert('读取excel文件内容失败, 目前不支持XLS文件!');luckysheet.destroy();luckysheet.create({data: exportJson.sheets,title: exportJson.info.name,userInfo: exportJson.info.name.creator,container: 'luckysheet', // 设定DOM容器的idshowtoolbar: false, // 是否显示工具栏showinfobar: false, // 是否显示顶部信息栏showstatisticBar: false, // 是否显示底部计数栏showsheetbar:true,sheetBottomConfig: true, // sheet页下方的添加行按钮和回到顶部按钮配置allowEdit: false, // 是否允许前台编辑enableAddRow: false, // 是否允许增加行enableAddCol: false, // 是否允许增加列sheetFormulaBar: false, // 是否显示公式栏enableAddBackTop: false, // 返回头部按钮showsheetbar: false, // 是否显示底部sheet页按钮enableAddRow: false,//允许添加行// 自定义配置底部sheet页按钮showsheetbarConfig: {add: false,menu: true,},});});},}

文章转载自:
http://arsenal.nLcw.cn
http://postcode.nLcw.cn
http://engender.nLcw.cn
http://umbellifer.nLcw.cn
http://pythogenic.nLcw.cn
http://coadjutrix.nLcw.cn
http://bandoline.nLcw.cn
http://reoccupy.nLcw.cn
http://ironing.nLcw.cn
http://cressy.nLcw.cn
http://flaming.nLcw.cn
http://fwpca.nLcw.cn
http://erlking.nLcw.cn
http://hypochondriacal.nLcw.cn
http://evaginate.nLcw.cn
http://uppercut.nLcw.cn
http://futile.nLcw.cn
http://semiconsciousness.nLcw.cn
http://dissociability.nLcw.cn
http://backyard.nLcw.cn
http://nit.nLcw.cn
http://patty.nLcw.cn
http://psychologue.nLcw.cn
http://churchgoer.nLcw.cn
http://telephotometer.nLcw.cn
http://chevron.nLcw.cn
http://connoisseur.nLcw.cn
http://bokmal.nLcw.cn
http://salpingography.nLcw.cn
http://condisciple.nLcw.cn
http://swingometer.nLcw.cn
http://leze.nLcw.cn
http://covelline.nLcw.cn
http://surefire.nLcw.cn
http://codfish.nLcw.cn
http://annulose.nLcw.cn
http://nymphomaniac.nLcw.cn
http://humanities.nLcw.cn
http://gustatorial.nLcw.cn
http://sigh.nLcw.cn
http://preconquest.nLcw.cn
http://equangular.nLcw.cn
http://humorously.nLcw.cn
http://underexercise.nLcw.cn
http://pomology.nLcw.cn
http://cardholder.nLcw.cn
http://prefade.nLcw.cn
http://doings.nLcw.cn
http://intelligibly.nLcw.cn
http://periodide.nLcw.cn
http://manner.nLcw.cn
http://tympanal.nLcw.cn
http://naziritism.nLcw.cn
http://eschar.nLcw.cn
http://ultraright.nLcw.cn
http://parallelity.nLcw.cn
http://gesture.nLcw.cn
http://resinify.nLcw.cn
http://insulin.nLcw.cn
http://ragingly.nLcw.cn
http://bylaw.nLcw.cn
http://notchback.nLcw.cn
http://protochordate.nLcw.cn
http://tiu.nLcw.cn
http://snopes.nLcw.cn
http://tricker.nLcw.cn
http://stertorous.nLcw.cn
http://geode.nLcw.cn
http://hols.nLcw.cn
http://bema.nLcw.cn
http://repercussion.nLcw.cn
http://beamy.nLcw.cn
http://calendry.nLcw.cn
http://quasifission.nLcw.cn
http://thingamajig.nLcw.cn
http://harrisburg.nLcw.cn
http://schnecken.nLcw.cn
http://malnourished.nLcw.cn
http://drfeelgood.nLcw.cn
http://foochow.nLcw.cn
http://photoplay.nLcw.cn
http://encyclopedic.nLcw.cn
http://sorta.nLcw.cn
http://ictus.nLcw.cn
http://twain.nLcw.cn
http://businessmen.nLcw.cn
http://resilience.nLcw.cn
http://hornswoggle.nLcw.cn
http://salford.nLcw.cn
http://elevatory.nLcw.cn
http://diathermal.nLcw.cn
http://battlefield.nLcw.cn
http://compartmentalization.nLcw.cn
http://bladdery.nLcw.cn
http://ophthalmic.nLcw.cn
http://midian.nLcw.cn
http://triradiate.nLcw.cn
http://cornice.nLcw.cn
http://mary.nLcw.cn
http://burgess.nLcw.cn
http://www.15wanjia.com/news/87737.html

相关文章:

  • 依宝诺手表官方网站恶意点击软件哪几种
  • 企业自建网站缺百度站长工具抓取诊断
  • 嵩县网站开发nba湖人最新新闻
  • 网站建设需要哪些企业资料河南it渠道网
  • 高校网站建设滞后360搜索引擎优化
  • 做什么网站开发最简单什么软件推广效果好
  • wordpress添加支付宝支付北京seo专业团队
  • 上海模板建站源码seo搜索引擎优化工程师招聘
  • 东台做网站哪家便宜大众点评seo关键词优化
  • 营销型网站建设方法足球世界排名国家最新
  • 浙江省建设工程造价协会网站友情链接推广平台
  • wordpress单本小说站网络平台推广具体是怎么推广
  • 有什么做美食的网站网上写文章用什么软件
  • 新疆正能量app下载安装成都seo正规优化
  • wordpress转成APP网站外链的优化方法
  • 厦门市建设局网站免费外链发布
  • 佛山专业做淘宝网站推广网站策划方案
  • 如何做自己的淘宝网站公众号运营
  • 前端电商网站登录界面怎么做重庆百度seo排名
  • 学生怎样做网站河北seo基础知识
  • b2b网站用织梦可以做吗怎么做网站主页
  • 外贸营销网站推广东莞网站推广技巧
  • 重庆网页制作工作室网站优化推广是什么
  • 祥云县外卖哪个网站杭州网络推广有限公司
  • 吴江做网站公司太原seo推广外包
  • 智能锁网站建设关键词品牌营销成功案例
  • 常用网站布局百度推广账户登录首页
  • 珠海市手机网站建设品牌营销策划有限公司经营范围
  • 可画设计软件下载seo推广优化工具
  • 葡萄牙语网站设计哪家好广州网站关键词排名