Browse Source

feat:更新

wangshan 2 years ago
parent
commit
2079e15a8a
1 changed files with 17 additions and 3 deletions
  1. 17 3
      service/workDesktop.go

+ 17 - 3
service/workDesktop.go

@@ -80,9 +80,14 @@ func RenewWorkDesktopMenuModeOrCommonly(in *WorkDesktopComprehensiveReq) (r *Wor
 					}
 					childMenus = map[int][]*entity.JYMenu{}
 				)
+				//是否存在父级
+				parentIsExists := map[int]bool{}
 				for _, mv := range *menuData {
+					//id
+					id := MC.IntAll(mv["id"])
 					//parentId
 					parentId := MC.IntAll(mv["parentid"])
+					parentIsExists[id] = true
 					menu := &entity.JYMenu{
 						Id:             MC.IntAll(mv["id"]),
 						Name:           MC.ObjToString(mv["name"]),
@@ -120,10 +125,19 @@ func RenewWorkDesktopMenuModeOrCommonly(in *WorkDesktopComprehensiveReq) (r *Wor
 							menu.AdditionalInfo = additional
 						}
 					}
-					if menu.Level == 4 {
-						childMenus[parentId] = append(childMenus[parentId], menu)
+					//外网不一致,
+					if "work_menu" == entity.ConfigJson.WorkTableOut {
+						if parentIsExists[parentId] {
+							childMenus[parentId] = append(childMenus[parentId], menu)
+						} else {
+							m.MenuTree = append(m.MenuTree, menu)
+						}
 					} else {
-						m.MenuTree = append(m.MenuTree, menu)
+						if menu.Level == 4 {
+							childMenus[parentId] = append(childMenus[parentId], menu)
+						} else {
+							m.MenuTree = append(m.MenuTree, menu)
+						}
 					}
 				}
 				//常用功能格式化