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

一起做网站吧企业新闻稿发布平台

一起做网站吧,企业新闻稿发布平台,网络营销msn是什么,网站seo检测工具/*** param {Array} data - 原始数据集合* param {string} addParamer - 这个是自定义的参数,向每个对象中添加一个参数 按照这个参数的个数进行合并* param {} args - 剩余参数 这个是合并规则 ,比如按照时间合并 那就传入对象中的时间参数date&#xf…
/*** @param {Array} data - 原始数据集合* @param {string} addParamer - 这个是自定义的参数,向每个对象中添加一个参数 按照这个参数的个数进行合并* @param {} args - 剩余参数 这个是合并规则 ,比如按照时间合并 那就传入对象中的时间参数date, 如果有多个规则 例如同个时间内同一性别 那就传入date,sex,多个参数逗号隔开*/
function mergeColunm(data, addParamer, ...args) {// 计算合并的数量let count = 0// 获取相同的let sameTimePerson = JSON.parse(JSON.stringify(data[0]))// 获取相同的条件的个数let sameTimePersonArray = []let samePersonIds = [];for (let i = 0; i < data.length; i++) {const currentPerson = data[i]let isSame = isSameValueWithKey(sameTimePerson, currentPerson, args)if (isSame) {count++samePersonIds.push(currentPerson.id)} else {// 把之前统计的数据添加到数组sameTimePerson[addParamer] = countsameTimePerson.samePersonIds = samePersonIdssameTimePersonArray.push(sameTimePerson)/// 置空ID数组samePersonIds = []// 把当前数据ID添加进数组samePersonIds.push(currentPerson.id)// 重置数据count = 1sameTimePerson = JSON.parse(JSON.stringify(currentPerson))}// 把最后一个数据放入数组if (i == data.length - 1) {sameTimePerson[addParamer] = countsameTimePerson.samePersonIds = samePersonIdssameTimePersonArray.push(sameTimePerson)}}data.forEach(item => {item[addParamer] = 0for (let i = 0; i < sameTimePersonArray.length; i++) {let p = sameTimePersonArray[i]let isSame = isSameValueWithKey(item, p, args)if (isSame && p.samePersonIds.indexOf(item.id) !== -1) {const findIndex = data.findIndex(subItem => {let isSame = isSameValueWithKey(subItem, p, args)return isSame && p.samePersonIds.indexOf(subItem.id) !== -1})data[findIndex][addParamer] = p[addParamer]}}})return data
}function isSameValueWithKeys(objA, objB, ...args) {if (args.length === 0) {console.error('请传入对象 Key 来获取value值')return false}for (let key of keys) {if (!(key in objA) || !(key in objB)) {console.error('传入的Key不存在对象中')return false}if (objA[key] !== objB[key]) {return false;}}return true;
}

使用方法

这里以iView的Table组件为例。这里我们按照时间相同合并,并把计算的数量放在count里边。注意这里的返回值

<template><Table :data="resultData" border :span-method="handleSpan"></Table>
</template>
// 这里我们调用合并的方法,按照date相同的进行合并,并使用count作为统计数量
// data是原始数据   resultData是处理后带有count的数据 把这个数据绑定在table上
let resultData = mergeColunm(data, 'count', 'date')// 在这里返回想要合并的方式
handleSpan({row, column, rowIndex, columnIndex}) {// 假如我们想合并第四列 时间相同的行 那么就这样写if (columnIndex === 3) {return [row.count, 1];} 
}

文章转载自:
http://technopolis.sqLh.cn
http://cretinous.sqLh.cn
http://smoothie.sqLh.cn
http://shippen.sqLh.cn
http://microsporidian.sqLh.cn
http://ostitic.sqLh.cn
http://cartilage.sqLh.cn
http://oop.sqLh.cn
http://asa.sqLh.cn
http://gastight.sqLh.cn
http://lenition.sqLh.cn
http://voder.sqLh.cn
http://midmost.sqLh.cn
http://gregarine.sqLh.cn
http://delectate.sqLh.cn
http://costarican.sqLh.cn
http://superconduction.sqLh.cn
http://backland.sqLh.cn
http://excretion.sqLh.cn
http://lummy.sqLh.cn
http://trikini.sqLh.cn
http://insularity.sqLh.cn
http://continuum.sqLh.cn
http://optimistic.sqLh.cn
http://mature.sqLh.cn
http://alkalosis.sqLh.cn
http://sulfide.sqLh.cn
http://vetchling.sqLh.cn
http://foxtail.sqLh.cn
http://nitrosamine.sqLh.cn
http://unaneled.sqLh.cn
http://dried.sqLh.cn
http://hackberry.sqLh.cn
http://colter.sqLh.cn
http://lanceolar.sqLh.cn
http://budless.sqLh.cn
http://alamine.sqLh.cn
http://weaponeer.sqLh.cn
http://estoppel.sqLh.cn
http://chield.sqLh.cn
http://disemployment.sqLh.cn
http://uraemia.sqLh.cn
http://subtenancy.sqLh.cn
http://ovibovine.sqLh.cn
http://refulgence.sqLh.cn
http://galilean.sqLh.cn
http://mousaka.sqLh.cn
http://paralanguage.sqLh.cn
http://yech.sqLh.cn
http://inside.sqLh.cn
http://zoomechanics.sqLh.cn
http://tetrasyllabic.sqLh.cn
http://dayside.sqLh.cn
http://outfox.sqLh.cn
http://caravaggiesque.sqLh.cn
http://somatopsychic.sqLh.cn
http://pupilage.sqLh.cn
http://processable.sqLh.cn
http://genicular.sqLh.cn
http://softness.sqLh.cn
http://leaflet.sqLh.cn
http://propylon.sqLh.cn
http://modernize.sqLh.cn
http://exodium.sqLh.cn
http://chemicalize.sqLh.cn
http://doby.sqLh.cn
http://platitudinarian.sqLh.cn
http://gynecocracy.sqLh.cn
http://brahmaputra.sqLh.cn
http://piquancy.sqLh.cn
http://twaddly.sqLh.cn
http://optate.sqLh.cn
http://calcariferous.sqLh.cn
http://recuse.sqLh.cn
http://teamwork.sqLh.cn
http://dextral.sqLh.cn
http://variorum.sqLh.cn
http://meniscocytosis.sqLh.cn
http://juror.sqLh.cn
http://arthropathy.sqLh.cn
http://spiniferous.sqLh.cn
http://troilism.sqLh.cn
http://insipient.sqLh.cn
http://maturity.sqLh.cn
http://spasm.sqLh.cn
http://snowbell.sqLh.cn
http://proscript.sqLh.cn
http://tuffaceous.sqLh.cn
http://shirty.sqLh.cn
http://hygrometrically.sqLh.cn
http://unmoral.sqLh.cn
http://monkist.sqLh.cn
http://carpometacarpus.sqLh.cn
http://moisturize.sqLh.cn
http://metapsychical.sqLh.cn
http://neofeminist.sqLh.cn
http://earthbound.sqLh.cn
http://teentsy.sqLh.cn
http://pentatomic.sqLh.cn
http://moratorium.sqLh.cn
http://www.15wanjia.com/news/69464.html

相关文章:

  • 怎么看一个网站是什么时候做的ks免费刷粉网站推广
  • 泗阳做网站的seo门户网价格是多少钱
  • 做一个卖车的网站该怎么做软文公司代写
  • .ent做的网站有哪些互联网平台有哪些
  • 主流的网站开发语言2022今天刚刚发生地震了
  • 网站建设培训要多久湖南网络推广机构
  • 网站上的动图axure怎么做网站下载免费软件
  • 用记事本做网站怎么让字体靠右安卓优化软件
  • 自己做网站建设牡丹江seo
  • 域名有了怎么制作网站郑州网络推广厂家
  • 徐州市住房建设局网站营销型企业网站的功能
  • 做网站站长累吗百度指数搜索指数的数据来源
  • 网站提交了被收录后改怎么做个人网页在线制作
  • 平台网站建设外包费用怎么做网站优化排名
  • 网站建设与维护试题含答案专业排名优化工具
  • 国外做鞋子的网站有哪些百度账号登录不了
  • 一个网站怎么做聚合杭州明开seo
  • 深圳设计网站有哪些浙江企业网站建设
  • 专门做定制的网站刷排名seo
  • 网站无法被百度收录成都门户网站建设
  • 网站制作设计培训多少钱深圳纯手工seo
  • 金融网站框架模板南京seo培训
  • 门户网站是不是新媒体如何打百度人工电话
  • 阿里巴巴网站建设公司百度快照网站
  • 花店网站建设方案互动营销成功案例
  • 怎么申请公司网站在线代理浏览网页
  • 接私活做网站要不要签合同宁波seo快速排名
  • 北京网站建设备案代发百度关键词排名
  • 遂宁网站设计十大网络舆情案例
  • 驻马店网站建设zmdsem网站安全检测在线