From ecb6cadc3f016cf9968f48e0cc77479a1e56365b Mon Sep 17 00:00:00 2001 From: hanbaoshan <hanbaoshan@aiotlink.com> Date: 星期日, 20 十二月 2020 17:32:06 +0800 Subject: [PATCH] 标定添加关联摄像机tab,绘制区域组件参数更新 --- 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