From 4fb905d2af3a695a6720111e8ca3708fc6d2034f Mon Sep 17 00:00:00 2001 From: hanbaoshan <hanbaoshan@aiotlink.com> Date: 星期二, 29 十二月 2020 18:40:09 +0800 Subject: [PATCH] 轨迹图人员筛选移除隐藏全部 --- src/scripts/util.js | 19 ++++++++++++++++++- 1 files changed, 18 insertions(+), 1 deletions(-) diff --git a/src/scripts/util.js b/src/scripts/util.js index 19cd19d..2f4261f 100644 --- a/src/scripts/util.js +++ b/src/scripts/util.js @@ -249,6 +249,22 @@ } } +//鎷嗗垎浜岀淮鏁扮粍 +const chunkArr = (arr, size = 1)=>{ + if (arr.length == 0) return; + const tempContainer = []; + let innerArr = []; + arr.forEach(item => { + if (innerArr.length == 0) { + tempContainer.push(innerArr); + } + innerArr.push(item); + if (innerArr.length == size) { + innerArr = []; + } + }); + return tempContainer; +} export { thisRouterObjFn, json2url, @@ -264,5 +280,6 @@ guid, cloneDeep, getYearWeek, - getContainerRect + getContainerRect, + chunkArr } -- Gitblit v1.8.0