feat:完善项目
This commit is contained in:
@ -24,6 +24,7 @@ type (
|
||||
InstanceIdentityInfo struct {
|
||||
ID string `json:"id"`
|
||||
*model2.SysMenuBasic
|
||||
ParentID string `json:"parent_id"`
|
||||
Checked bool `json:"checked"`
|
||||
Children []*InstanceIdentityInfo `json:"children"`
|
||||
}
|
||||
@ -67,9 +68,18 @@ func TreeIdentity(iModel model2.IModel, src []*model.SysMenuScene, parentID uint
|
||||
for _, v := range src {
|
||||
if v.ParentID == parentID {
|
||||
iModel.SetID(v.ID)
|
||||
id := iModel.GetEncodeID()
|
||||
|
||||
_parentID := "0"
|
||||
|
||||
if v.ParentID > 0 {
|
||||
iModel.SetID(v.ParentID)
|
||||
_parentID = iModel.GetEncodeID()
|
||||
}
|
||||
out = append(out, &InstanceIdentityInfo{
|
||||
ID: iModel.GetEncodeID(),
|
||||
ID: id,
|
||||
SysMenuBasic: v.SysMenuBasic,
|
||||
ParentID: _parentID,
|
||||
Checked: v.SceneID > 0,
|
||||
Children: TreeIdentity(iModel, src, v.ID),
|
||||
})
|
||||
|
Reference in New Issue
Block a user