feat:完善项目

This commit is contained in:
henry
2021-11-10 15:09:31 +08:00
parent 095bdcfe4c
commit 863edee71c
6 changed files with 161 additions and 5 deletions

View File

@ -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),
})