seed_menu.sql 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. -- =====================================================
  2. -- 菜单种子数据 - 匹配前端静态路由结构
  3. -- =====================================================
  4. -- 清空旧数据
  5. DELETE FROM t_role_menu WHERE role_id = 1;
  6. DELETE FROM t_role_menu WHERE menu_id IN (2001,2002,2003,2004,3001,3002,4001,4002,5001,5002);
  7. DELETE FROM t_menu WHERE id >= 100 AND id < 1200;
  8. DELETE FROM t_menu WHERE id IN (2001,2002,2003,2004,3001,3002,4001,4002,5001,5002);
  9. -- =====================================================
  10. -- 1. 数据概览 (Dashboard) - rank 1
  11. -- =====================================================
  12. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, icon, show_link, show_parent, `redirect`, keep_alive) VALUES
  13. (100, 0, 0, '数据概览', 'Dashboard', '/dashboard', '', 1, 'ri:dashboard-line', 1, 0, '/dashboard/index', 1);
  14. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  15. (101, 100, 0, '数据概览', 'Dashboard', '/dashboard/index', '', 1, 1, 0);
  16. -- =====================================================
  17. -- 2. 订单管理 (Order) - rank 2
  18. -- =====================================================
  19. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, icon, show_link, show_parent, `redirect`, keep_alive) VALUES
  20. (200, 0, 0, '订单管理', 'Order', '/order', '', 2, 'ri:file-list-2-line', 1, 1, '/order/list', 1);
  21. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  22. (201, 200, 0, '订单管理', 'OrderList', '/order/list', '', 1, 1, 0);
  23. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  24. (202, 200, 0, '退款管理', 'OrderRefund', '/order/refund', '', 2, 1, 0);
  25. -- =====================================================
  26. -- 3. 运营管理 (Operation) - rank 3
  27. -- =====================================================
  28. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, icon, show_link, show_parent, `redirect`, keep_alive) VALUES
  29. (300, 0, 0, '运营管理', 'Operation', '/operation', '', 3, 'ri:briefcase-4-line', 1, 1, '/operation/shop', 1);
  30. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  31. (301, 300, 0, '门店管理', 'ShopList', '/operation/shop', '', 1, 1, 0);
  32. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  33. (302, 300, 0, '设备管理', 'DeviceList', '/operation/device', '', 2, 1, 0);
  34. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  35. (303, 300, 0, '门店分布地图', 'DistributionMap', '/operation/distribution-map', '', 3, 1, 0);
  36. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  37. (304, 300, 0, '补货员管理', 'ReplenisherList', '/operation/replenisher', '', 4, 1, 0);
  38. -- =====================================================
  39. -- 4. 商品管理 (Product) - rank 4
  40. -- =====================================================
  41. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, icon, show_link, show_parent, `redirect`, keep_alive) VALUES
  42. (400, 0, 0, '商品管理', 'Product', '/product', '', 4, 'ri:inbox-line', 1, 1, '/product/list', 1);
  43. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  44. (401, 400, 0, '商品列表', 'ProductList', '/product/list', '', 1, 1, 0);
  45. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  46. (402, 400, 0, '新品申请', 'NewProductApply', '/product/new-apply', '', 2, 1, 0);
  47. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  48. (403, 400, 0, '商品总库', 'MasterLibrary', '/product/master-library', '', 3, 1, 0);
  49. -- =====================================================
  50. -- 5. 库存管理 (Inventory) - rank 5
  51. -- =====================================================
  52. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, icon, show_link, show_parent, `redirect`, keep_alive) VALUES
  53. (500, 0, 0, '库存管理', 'Inventory', '/inventory', '', 5, 'ri:stack-line', 1, 1, '/inventory/list', 1);
  54. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  55. (501, 500, 0, '库存列表', 'InventoryList', '/inventory/list', '', 1, 1, 0);
  56. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  57. (502, 500, 0, '库存变动', 'InventoryLogs', '/inventory/logs', '', 2, 1, 0);
  58. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  59. (503, 500, 0, '上货记录', 'StockRecords', '/inventory/records', '', 3, 1, 0);
  60. -- =====================================================
  61. -- 6. 客户管理 (Customer) - rank 6
  62. -- =====================================================
  63. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, icon, show_link, show_parent, `redirect`, keep_alive) VALUES
  64. (600, 0, 0, '客户管理', 'Customer', '/customer', '', 6, 'ri:user-heart-line', 1, 0, '/customer/list', 1);
  65. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  66. (601, 600, 0, '客户列表', 'CustomerList', '/customer/list', 'customer/index', 1, 1, 0);
  67. -- =====================================================
  68. -- 7. 分销管理 (Distribution) - rank 6
  69. -- =====================================================
  70. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, icon, show_link, show_parent, `redirect`, keep_alive) VALUES
  71. (700, 0, 0, '分销管理', 'Distribution', '/distribution', '', 6, 'ep:share', 1, 1, '/distribution/dashboard', 1);
  72. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  73. (701, 700, 0, '分销概览', 'DistributionDashboard', '/distribution/dashboard', '', 1, 1, 0);
  74. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  75. (702, 700, 0, '分销员管理', 'DistributionDistributor', '/distribution/distributor', '', 2, 1, 0);
  76. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  77. (703, 700, 0, '推荐记录', 'DistributionReferral', '/distribution/referral', '', 3, 1, 0);
  78. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  79. (704, 700, 0, '佣金记录', 'DistributionCommission', '/distribution/commission', '', 4, 1, 0);
  80. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  81. (705, 700, 0, '提现管理', 'DistributionWithdrawal', '/distribution/withdrawal', '', 5, 1, 0);
  82. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  83. (706, 700, 0, '月度报表', 'DistributionReport', '/distribution/report', '', 6, 1, 0);
  84. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  85. (707, 700, 0, '分销配置', 'DistributionConfig', '/distribution/config', '', 7, 1, 0);
  86. -- =====================================================
  87. -- 8. 营销中心 (Marketing) - rank 7
  88. -- =====================================================
  89. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, icon, show_link, show_parent, `redirect`, keep_alive) VALUES
  90. (800, 0, 0, '营销中心', 'Marketing', '/marketing', '', 7, 'ri:megaphone-line', 1, 1, '/marketing/activity', 1);
  91. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  92. (801, 800, 0, '活动管理', 'MarketingActivity', '/marketing/activity', '', 1, 1, 0);
  93. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  94. (802, 800, 0, '优惠券管理', 'MarketingCoupon', '/marketing/coupon', '', 2, 1, 0);
  95. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  96. (803, 800, 0, '用户优惠券', 'UserCouponList', '/marketing/user-coupon', '', 3, 1, 0);
  97. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  98. (804, 800, 0, '定时折扣', 'TimedDiscount', '/marketing/timed-discount', '', 4, 1, 0);
  99. -- 8.5 营销中心 → 数据统计 (三级菜单)
  100. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  101. (810, 800, 0, '数据统计', 'MarketingStatistics', '/marketing/statistics', '', 5, 1, 0);
  102. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  103. (811, 810, 0, '统计概览', 'StatisticsOverview', '/marketing/statistics/overview', '', 1, 1, 0);
  104. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  105. (812, 810, 0, '活动统计', 'ActivityStatistics', '/marketing/statistics/activity', '', 2, 1, 0);
  106. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  107. (813, 810, 0, '优惠券统计', 'CouponStatistics', '/marketing/statistics/coupon', '', 3, 1, 0);
  108. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  109. (814, 810, 0, '趋势分析', 'TrendAnalysis', '/marketing/statistics/trend', '', 4, 1, 0);
  110. -- =====================================================
  111. -- 9. 统计报表 (Statistics) - rank 8
  112. -- =====================================================
  113. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, icon, show_link, show_parent, `redirect`, keep_alive) VALUES
  114. (900, 0, 0, '统计报表', 'Statistics', '/statistics', '', 8, 'ri:bar-chart-grouped-line', 1, 1, '/statistics/overview', 1);
  115. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  116. (901, 900, 0, '统计概览', 'StatisticsOverview', '/statistics/overview', '', 1, 1, 0);
  117. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  118. (902, 900, 0, '品类销售统计', 'CategoryStatistics', '/statistics/category', '', 2, 1, 0);
  119. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  120. (903, 900, 0, '门店利润报表', 'ProfitStatistics', '/statistics/profit', '', 3, 1, 0);
  121. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  122. (904, 900, 0, '用户复购统计', 'RepurchaseStatistics', '/statistics/repurchase', '', 4, 1, 0);
  123. -- =====================================================
  124. -- 10. 系统设置 (System) - rank 8
  125. -- =====================================================
  126. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, icon, show_link, show_parent, `redirect`, keep_alive) VALUES
  127. (1000, 0, 0, '系统设置', 'System', '/system', '', 8, 'ri:settings-3-line', 1, 1, '/system/admin', 1);
  128. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  129. (1001, 1000, 0, '管理员管理', 'SystemAdmin', '/system/admin', '', 1, 1, 0);
  130. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  131. (1002, 1000, 0, '角色管理', 'SystemRole', '/system/role', '', 2, 1, 0);
  132. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  133. (1003, 1000, 0, '权限管理', 'SystemPermission', '/system/permission', '', 3, 1, 0);
  134. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  135. (1004, 1000, 0, '公告管理', 'SystemAnnouncement', '/system/announcement', '', 4, 1, 0);
  136. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  137. (1005, 1000, 0, '操作日志', 'SystemOperationLog', '/system/operation-log', '', 5, 1, 0);
  138. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  139. (1006, 1000, 0, '数据同步', 'SyncRecords', '/system/sync', '', 6, 1, 0);
  140. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  141. (1007, 1000, 0, '字典管理', 'SystemDict', '/system/dict', '', 7, 1, 0);
  142. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  143. (1008, 1000, 0, '菜单管理', 'SystemMenu', '/system/menu', '', 8, 1, 0);
  144. -- =====================================================
  145. -- 11. 设备层模版管理 (Layer Template) - rank 8
  146. -- =====================================================
  147. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, icon, show_link, show_parent, keep_alive) VALUES
  148. (1100, 0, 0, '设备层模版管理', 'LayerTemplate', '/layer-template', '', 8, 'ri:stack-line', 1, 0, 1);
  149. -- =====================================================
  150. -- 角色菜单关联:admin 角色(role_id=1)拥有所有菜单
  151. -- =====================================================
  152. INSERT INTO t_role_menu (id, role_id, menu_id) VALUES
  153. (90001, 1, 100), (90002, 1, 101),
  154. (90003, 1, 200), (90004, 1, 201), (90005, 1, 202),
  155. (90006, 1, 300), (90007, 1, 301), (90008, 1, 302), (90009, 1, 303), (90010, 1, 304),
  156. (90011, 1, 400), (90012, 1, 401), (90013, 1, 402),
  157. (90014, 1, 500), (90015, 1, 501), (90016, 1, 502), (90017, 1, 503),
  158. (90018, 1, 600), (90019, 1, 601),
  159. (90020, 1, 700), (90021, 1, 701), (90022, 1, 702), (90023, 1, 703), (90024, 1, 704), (90025, 1, 705), (90026, 1, 706), (90027, 1, 707),
  160. (90028, 1, 800), (90029, 1, 801), (90030, 1, 802), (90031, 1, 803), (90032, 1, 804),
  161. (90033, 1, 810), (90034, 1, 811), (90035, 1, 812), (90036, 1, 813), (90037, 1, 814),
  162. (90038, 1, 900), (90039, 1, 901), (90040, 1, 902), (90041, 1, 903), (90042, 1, 904),
  163. (90043, 1, 1000), (90044, 1, 1001), (90045, 1, 1002), (90046, 1, 1003), (90047, 1, 1004), (90048, 1, 1005), (90049, 1, 1006), (90050, 1, 1007), (90051, 1, 1008),
  164. (90052, 1, 1100),
  165. (90053, 1, 403);