From 0070297fe11ceb3a013721ae35ffd4ad56ad1065 Mon Sep 17 00:00:00 2001 From: gst <332882090@qq.com> Date: Tue, 11 Aug 2020 10:59:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E8=8A=82=E7=82=B9=E4=B8=BA=E5=AD=90?= =?UTF-8?q?=E9=83=A8=E9=97=A8=E6=97=B6=EF=BC=8C=E6=A0=91=E7=8A=B6=E7=BB=93?= =?UTF-8?q?=E6=9E=84=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/utils/ruoyi.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruoyi-ui/src/utils/ruoyi.js b/ruoyi-ui/src/utils/ruoyi.js index 462dc8f..87ba221 100644 --- a/ruoyi-ui/src/utils/ruoyi.js +++ b/ruoyi-ui/src/utils/ruoyi.js @@ -1,4 +1,4 @@ -/** +/** * 通用js方法封装处理 * Copyright (c) 2019 ruoyi */ @@ -128,7 +128,7 @@ export function handleTree(data, id, parentId, children, rootId) { id = id || 'id' parentId = parentId || 'parentId' children = children || 'children' - rootId = rootId || 0 + rootId = rootId || Math.min.apply(Math,data.map(item => { return item[parentId] })) || 0 //对源数据深度克隆 const cloneData = JSON.parse(JSON.stringify(data)) //循环所有项