From c9e0ab6e5150243d1e193a0f919a55f3c327710c Mon Sep 17 00:00:00 2001 From: hanbaoshan <hanbaoshan@aiotlink.com> Date: 星期二, 29 十二月 2020 10:52:34 +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