摘要: export const nonempty = (val = '', replaceVal = '') => { // if (!val || val == 'null' || val == 'undefined') { // return replaceVal; // } else { // re 阅读全文
posted @ 2021-11-09 10:00 小夜猫啊 阅读(297) 评论(0) 推荐(0) 编辑
摘要: 最大值 Math.max.apply(Math, array.map(item=>item.num)) 最小值 Math.min.apply(Math, array.map(item=>item.num})) 阅读全文
posted @ 2021-10-22 16:16 小夜猫啊 阅读(131) 评论(0) 推荐(0) 编辑
摘要: // 使用刚指定的配置项和数据显示图表。 myChart2.setOption(option); //设置默认选中高亮部分 let index = 0; myChart2.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: 0 阅读全文
posted @ 2021-07-08 13:48 小夜猫啊 阅读(531) 评论(0) 推荐(0) 编辑
摘要: // 适配100倍 1rem = 100px fnResize(); window.onresize = function() { fnResize(); window.addEventListener("resize", fnResize); }; function fnResize() { le 阅读全文
posted @ 2021-06-21 09:18 小夜猫啊 阅读(36) 评论(0) 推荐(0) 编辑
摘要: <div id="main" class="filter"> <ul> <li> <div class="street">区管项目</div> <img class="arrow_bot" src="../../img/bot.png" alt=""> <img class="arrow_top" 阅读全文
posted @ 2021-06-21 09:17 小夜猫啊 阅读(31) 评论(0) 推荐(0) 编辑
摘要: 数组对象按某属性去重 uniqueFun(arr, type) { const res = new Map(); return arr.filter((a) => !res.has(a[type]) && res.set(a[type], 1)); }, var alllist = that.uni 阅读全文
posted @ 2021-06-01 09:23 小夜猫啊 阅读(186) 评论(0) 推荐(0) 编辑
摘要: var obj1 = [{ "id": 980550455852, "model": "XQG70-S1208FW", "color": "白", "invStatusName": "正品", "bactualQty": 10947, "brealyQty": 11000, "bavailQty": 阅读全文
posted @ 2021-05-28 10:17 小夜猫啊 阅读(56) 评论(0) 推荐(0) 编辑
摘要: 解决办法: window.addEventListener("resize", function() { myChart.resize(); //myChart指自己定义的echartsDom对象 myChart2.resize(); myChart3.resize(); myChart4.resi 阅读全文
posted @ 2021-05-27 09:29 小夜猫啊 阅读(124) 评论(0) 推荐(0) 编辑
摘要: let arr = [1,2,2,4,null,null,'3','abc',3,5,4,1,2,2,4,null,null,'3','abc',3,5,4] 1. 利用对象的 key 唯一 众所周知,对象的key不可重复,否则后者将覆盖前者。利用该特性,实现数组去重,遍历数组,将数组的每一项做为对 阅读全文
posted @ 2021-05-26 16:24 小夜猫啊 阅读(450) 评论(0) 推荐(0) 编辑
摘要: echarts图表隐藏后,宽高会丢失,导致再显示后图表变小, 解决办法 在画图表后加上 $(window).resize(myChart3.resize); 然后在显示时加上 $(window).trigger('resize'); 阅读全文
posted @ 2021-04-28 13:38 小夜猫啊 阅读(438) 评论(0) 推荐(0) 编辑