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

今天的新闻是什么优化网络搜索引擎

今天的新闻是什么,优化网络搜索引擎,太原seo关键词优化,seo三人行论坛一、安装依赖 npm install xlsx 二、引用依赖 import XLSX from xlsx 三、代码实现 1、注意&#xff1a;函数 analysis 中reader.readAsBinaryString(file)&#xff0c;file的数据格式如图所示 2、示例代码 <!-- 项目使用的前端框架为非流行框架&#xff0c;主要关注…

一、安装依赖

npm install xlsx

二、引用依赖

import XLSX from 'xlsx'

三、代码实现

1、注意:函数 analysis 中reader.readAsBinaryString(file),file的数据格式如图所示

2、示例代码 

<!-- 项目使用的前端框架为非流行框架,主要关注JS实现逻辑即可 -->
<template><div><ta-upload:accept="upload.accept":fileList="upload.fileList":beforeUpload="beforeUpload":remove="uploadRemove"style="margin: 0 8px;"><ta-button>选择附件</ta-button></ta-upload><ta-tablehaveSnsize="small":columns="columns":data-source="dataSource":scroll="{x: 1600, y: 400}"showOverflowTooltip></ta-table></div>
</template>
<script>
import XLSX from 'xlsx'export default {data () {return {columns: [{ title: '医保目录编码', dataIndex: 'hilistCode', width: 300, align: 'center' },{ title: '医保目录名称', dataIndex: 'hilistName', width: 200, align: 'center' },{ title: '参保所属医保区划', dataIndex: 'insuAdmdvs', width: 200, align: 'center' },{ title: '医疗收费项目类别', dataIndex: 'medChrgitmType', width: 200, align: 'center' },{ title: '收费项目等级', dataIndex: 'chrgitmLv', width: 150, align: 'center' },{ title: '目录类别', dataIndex: 'listType', width: 200, align: 'center' },{ title: '限复方使用类型', dataIndex: 'lmtCpndType', width: 200, align: 'center' },{ title: '计价单位', dataIndex: 'prcunt', width: 200, align: 'center' },{ title: '计价说明', dataIndex: 'pricDscr', width: 200, align: 'center' },{ title: '医疗服务项目输出', dataIndex: 'servitemOupt', width: 200, align: 'center' },{ title: '价格构成', dataIndex: 'pricComp', width: 200, align: 'center' },{ title: '费用类型口径', dataIndex: 'feeTypeCali', width: 200, align: 'center' },{ title: '开始时间', dataIndex: 'begndate', width: 200, align: 'center' },{ title: '结束时间', dataIndex: 'enddate', width: 200, align: 'center' }],dataSource: [],upload: {accept: '.xls,.xlsx',fileList: []}}},computed: {uploadTypeErrorMessage () {return `只能上传 ${this.upload.accept.split(',')} 格式的文件`;}},methods: {beforeUpload (file) {if(!['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'].includes(file.type)) {this.$message.error(this.uploadTypeErrorMessage);return false;}this.upload.fileList.length>0?this.upload.fileList.splice(0, 1, file):this.upload.fileList.push(file);this.analysis(file).then(res => { if (res && res.length > 0){let list = [];res[0].sheet.forEach(d => {let data = {};Object.keys(d).filter(k => k!=='序号').forEach(k => { //过滤掉根本不需要的列,根据自己情况写let column = this.columns.find(li => li.title===k);if(column) {data[column.dataIndex] = d[k];}});if(Object.keys(data).length>0) {list.push(data);}});this.dataSource = list;}});return false;},analysis (file){return new Promise(function (resolve) {const reader = new FileReader()reader.onload = function (e){const json = XLSX.read(e.target.result, {type: 'binary'});resolve(json.SheetNames.map(sheetName => {return {sheetName: sheetName,sheet: XLSX.utils.sheet_to_json(json.Sheets[sheetName])};}));};reader.readAsBinaryString(file);});},uploadRemove (file) {let index = this.upload.fileList.findIndex(li =>li.uid===file.uid);if(index> -1) {this.upload.fileList.splice(index, 1);this.dataSource = [];}}},mounted () {this.dataSource = [];this.upload.fileList = [];}
}
</script>

四、参考文章

前端使用xlsx插件读取excel文件数据 - yingzi__block - 博客园


文章转载自:

http://rKtsPJ2T.dzyxr.cn
http://fbaHKiq1.dzyxr.cn
http://jfQwY4kw.dzyxr.cn
http://dZ23RjOJ.dzyxr.cn
http://PDZ7Szyk.dzyxr.cn
http://jRbjizT9.dzyxr.cn
http://qY0nfSin.dzyxr.cn
http://rg1thuYa.dzyxr.cn
http://2NcythHQ.dzyxr.cn
http://LYzOSC56.dzyxr.cn
http://dWvpmHKJ.dzyxr.cn
http://Te9IbkXz.dzyxr.cn
http://rpwa4ajD.dzyxr.cn
http://wzxGX713.dzyxr.cn
http://5pBGWNJ2.dzyxr.cn
http://W8gxNi7t.dzyxr.cn
http://JbxWLDdi.dzyxr.cn
http://HTtTUsKW.dzyxr.cn
http://KgmS1b3T.dzyxr.cn
http://tI0sucDa.dzyxr.cn
http://EsShc0bq.dzyxr.cn
http://lkunVHsr.dzyxr.cn
http://KmOoNIQ3.dzyxr.cn
http://acRJPJJ7.dzyxr.cn
http://zTL9mV9d.dzyxr.cn
http://XlATtaPB.dzyxr.cn
http://P4eUfzyE.dzyxr.cn
http://gT2N9lpZ.dzyxr.cn
http://wP632tQh.dzyxr.cn
http://IBGuH1ro.dzyxr.cn
http://www.dtcms.com/wzjs/750841.html

相关文章:

  • 做电影资讯网站算侵权吗有一个网站专门做促销小游戏
  • 网站开发地图板块浮动软件开发定制app
  • 如何建设部网站查职称部门网站 法规制度 建设情况
  • 家具网站开发任务书营销手机软件开发定制
  • 建筑公司网站图片天津市区县档案部门网站建设指导意见
  • 简单的网站更新 关键词优化 关键词互联wordpress 网站卡
  • 帝国网站管理系统前台百度流量推广项目
  • 网上购物网站网站建设分析介绍类网站建设策划书范文
  • 北京网站搭建公司排行松岗营销型网站建设
  • 小网站模板下载 迅雷下载 迅雷下载不了昆山 网站运营
  • 怎么做淘宝联盟网站推广大航母网站建设流程
  • 西宁企业网站营销推广惠民建设局网站
  • 佛山制作做网站html5自适应网站源码
  • nginx网站301重定向怎么做软件技术适合女生学吗
  • dw做汽车网站域名审核怎么做返利网站
  • 宁波市网站排名优化大气集团网站源码
  • 苏州免费自助建站网站建设保定做网站开发的公司有哪些
  • 怎么建网站 做app软件溧阳网站建设制作
  • 珠海市住房和城乡建设局网站平面设计专业学校排名
  • 请人用wordpress建站假期网站的网页
  • 东莞哪家网站建设比较好安徽安庆区号
  • 网站后台是什么意思简述网站推广的意义和方法
  • php网站开发笔试题嵌入式系统开发
  • 怎么把个人做的网站上传到网上wordpress python采集器
  • 怎样在谷歌上建设网站响应式网站cms
  • 微信公众号涨粉 网站wordpress用qq
  • 网站页面设计 颜色 背景 要求为什么网站开发成本高
  • 深圳专业优定软件网站建设朋友圈广告推广平台
  • 免费网站 推广网站腾讯云域名备案需要提供网站建设方案书
  • 翔安区建设局网站做网站过程视频