11
This commit is contained in:
36
src/utils/sist.js
Normal file
36
src/utils/sist.js
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* @author: Clay
|
||||
* @date: 2022/1/16 11:13
|
||||
* @description:sist
|
||||
* @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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user