积累
八角啦
这个作者很懒,什么都没留下…
展开
-
Echarts自定义legend使用本地图片,自定义坐标轴
legend使用本地图片路径;修改y轴使用不同的图片;先定义一个对象,因为y轴需要用到rich配置项,只能为英文。y轴的data为data:['qt','gy','sf','zz']这样就实现完全自定义啦原创 2021-03-19 13:43:03 · 1440 阅读 · 0 评论 -
在echarts的tooltip里面再展示一个图表;自定义二echart的legend
tooltip: { backgroundColor: 'rgba(255,255,255,.9)', position: ['40%', '10%'], textStyle:{ color:'#000', }, formatter: function(param){ setTimeout(function(){ that.childRegByChart(param.name,"regChart")},100) var res = param.name .原创 2021-03-18 09:10:14 · 761 阅读 · 0 评论 -
实现移动端拖拽
<div class="aui-content aui-margin-b-15" id="conDiv" @mousedown="down" @touchstart="down" @mousemove="move" @touchmove="move" @mouseup="end" @touchend="end"></div> down() { let moveDiv = document.getElementById('box') this.flags = true;翻译 2021-03-10 13:53:09 · 144 阅读 · 0 评论 -
计算占比总和为100整
const calcPercentage = ((data) => { let total = 0 let temp = [] let obj = {} for (let key in data) { let num = !!data[key] ? (data[key].toString().split('.')[1]).substring(0,2) : 0 total += parseInt(data[key]) temp.push({ name: key,原创 2021-03-10 13:51:21 · 309 阅读 · 0 评论 -
判断数据中某一项对象的值是否存在重复
const ids = this.form.map(value=>value.ZJHM);const idsSet = new Set(ids);if(idsSet.size == ids.length){ console.log('不存在同个值')}else{ console.log('存在同个值') return}原创 2021-03-10 13:49:13 · 432 阅读 · 0 评论 -
去除富文本的标签和空格
let richText = ' <p style="font-size: 25px;color: white"> sdaflsjf的丰富及饿哦塞尔</p><span>dsfjlie</span>';/* 去除富文本中的html标签 *//* *、+限定符都是贪婪的,因为它们会尽可能多的匹配文字,只有在它们的后面加上一个?就可以实现非贪婪或最小匹配。*/let cont原创 2021-03-10 13:48:32 · 1014 阅读 · 0 评论 -
es6去重
const res = new Map();data.rows = data.rows.filter((a) => !res.has(a.RESOURCEID) && res.set(a.RESOURCEID, 1))原创 2021-03-10 13:46:25 · 56 阅读 · 0 评论 -
根据数组中的某个字段排序
response.push({'XZQNAME': '慈溪市', 'LMJ': CXSValue})var desc=function(a,b){return b['LMJ']-a['LMJ']};response.sort(desc)原创 2021-03-10 13:45:13 · 324 阅读 · 0 评论 -
对关键字进行搜索,并对搜索的字提亮显示
if(this.searchkeyword){ var reg = new RegExp(this.searchkeyword, "g"); var text = "<span style='color:red'>" + this.searchkeyword + "</span>" if (item.title.indexOf(this.searchkeyword) !== '-1') { item.title = item.title.replace(reg, text)原创 2021-03-10 13:43:02 · 132 阅读 · 2 评论 -
把new Date()格式化年-月-日
自定义方法dateFormat: function(date, format){ var o = { "M+" : date.getMonth()+1, //month "d+" : date.getDate(), //day "h+" : date.getHours(), //hour 24 "H+" : date.getHours(), //hour 24 "m+" : date.getMinutes(), //minute翻译 2021-03-10 13:37:28 · 1073 阅读 · 0 评论