feat:完善项目
This commit is contained in:
@ -44,15 +44,11 @@ func (c *Instance) tree(iModel model2.IModel, src []*model2.SysMenu, parentID ui
|
||||
|
||||
for _, v := range src {
|
||||
if v.ParentID == parentID {
|
||||
parentID := "0"
|
||||
iModel.SetID(v.ParentID)
|
||||
|
||||
if v.ParentID > 0 {
|
||||
iModel.SetID(v.ParentID)
|
||||
parentID = iModel.GetEncodeID()
|
||||
}
|
||||
out = append(out, &InstanceInfo{
|
||||
ID: v.GetEncodeID(),
|
||||
ParentID: parentID,
|
||||
ParentID: iModel.GetEncodeID(),
|
||||
SysMenu: v,
|
||||
Children: c.tree(iModel, src, v.ID),
|
||||
})
|
||||
@ -70,16 +66,11 @@ func TreeIdentity(iModel model2.IModel, src []*model.SysMenuScene, parentID uint
|
||||
iModel.SetID(v.ID)
|
||||
id := iModel.GetEncodeID()
|
||||
|
||||
_parentID := "0"
|
||||
|
||||
if v.ParentID > 0 {
|
||||
iModel.SetID(v.ParentID)
|
||||
_parentID = iModel.GetEncodeID()
|
||||
}
|
||||
iModel.SetID(v.ParentID)
|
||||
out = append(out, &InstanceIdentityInfo{
|
||||
ID: id,
|
||||
SysMenuBasic: v.SysMenuBasic,
|
||||
ParentID: _parentID,
|
||||
ParentID: iModel.GetEncodeID(),
|
||||
Checked: v.SceneID > 0,
|
||||
Children: TreeIdentity(iModel, src, v.ID),
|
||||
})
|
||||
|
Reference in New Issue
Block a user