This commit is contained in:
clay
2022-01-16 21:14:30 +08:00
parent 8e9cf7b833
commit b7897ba20e
18 changed files with 799 additions and 269 deletions

36
src/utils/sist.js Normal file
View File

@@ -0,0 +1,36 @@
/**
* @author: Clay
* @date: 2022/1/16 11:13
* @descriptionsist
* @email: clay@hchyun.com
*/
export function getParentNode(id){
let menuList = JSON.parse(sessionStorage.getItem("menu"));
for (let menu of menuList) {
for (let child of menu.children) {
if (id == item.encodeId){
menu.children=[]
child.children=[]
return {
stair:menu,
second:child,
}
}
for (let item of child.children) {
if (id == item.encodeId){
menu.children=[]
child.children=[]
item.children=[]
return {
stair:menu,
second:child,
three:item
}
}
}
}
}
return null
}