설명 없음
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

get_menu.go 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package menu
  2. import (
  3. "context"
  4. "git.x2erp.com/qdy/go-base/ctx"
  5. "git.x2erp.com/qdy/go-base/logger"
  6. "git.x2erp.com/qdy/go-base/model/response"
  7. "git.x2erp.com/qdy/go-base/util"
  8. )
  9. // MenuItem 顶部菜单项结构
  10. type MenuItem struct {
  11. ID string `json:"id"`
  12. Name string `json:"name"`
  13. Icon string `json:"icon,omitempty"`
  14. Type string `json:"type"` // top-menu
  15. Route string `json:"route,omitempty"`
  16. }
  17. // GetTopMenu 获取顶部菜单
  18. func GetTopMenu(ctx context.Context, reqCtx *ctx.RequestContext) *response.QueryResult[[]MenuItem] {
  19. logger.Debug("GetTopMenu-开始获取顶部菜单")
  20. // 构建顶部菜单项
  21. menu := []MenuItem{
  22. {
  23. ID: "replenish",
  24. Name: "补货",
  25. Icon: "inventory_2", // 库存补充图标
  26. Type: "top-menu",
  27. Route: "/replenish",
  28. },
  29. {
  30. ID: "transfer",
  31. Name: "调拨",
  32. Icon: "swap_horiz", // 横向交换图标
  33. Type: "top-menu",
  34. Route: "/transfer",
  35. },
  36. {
  37. ID: "allocation",
  38. Name: "配货",
  39. Icon: "local_shipping", // 本地货运图标
  40. Type: "top-menu",
  41. Route: "/allocation",
  42. },
  43. {
  44. ID: "report",
  45. Name: "报表",
  46. Icon: "assessment", // 评估报表图标
  47. Type: "top-menu",
  48. Route: "/report",
  49. },
  50. }
  51. logger.Debug("返回顶部菜单结构")
  52. return util.CreateSuccessResultData(menu, reqCtx)
  53. }