回退vxe版本

This commit is contained in:
gexinzhineng/gxzn27
2023-04-03 15:26:56 +08:00
parent 87a5ddfd2c
commit 0e578f8d0a
178 changed files with 12350 additions and 8340 deletions

View File

@ -276,7 +276,7 @@ export const handleTree = (data: any[], id?: string, parentId?: string, children
export const handleTree2 = (data, id, parentId, children, rootId) => {
id = id || 'id'
parentId = parentId || 'parentId'
// children = children || 'children'
children = children || 'children'
rootId =
rootId ||
Math.min(
@ -285,16 +285,16 @@ export const handleTree2 = (data, id, parentId, children, rootId) => {
})
) ||
0
// 对源数据深度克隆
//对源数据深度克隆
const cloneData = JSON.parse(JSON.stringify(data))
// 循环所有项
//循环所有项
const treeData = cloneData.filter((father) => {
const branchArr = cloneData.filter((child) => {
// 返回每一项的子级数组
//返回每一项的子级数组
return father[id] === child[parentId]
})
branchArr.length > 0 ? (father.children = branchArr) : ''
// 返回第一层
//返回第一层
return father[parentId] === rootId
})
return treeData !== '' ? treeData : data