seed_menu.sql 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, icon, show_link, show_parent, `redirect`, keep_alive) VALUES
  61. (505, 500, 0, '设备补货单', 'ReplenishmentOrder', '/inventory/replenishment-order', '', 4, 'ep:shopping-cart', 1, 0, '/inventory/replenishment-order/list', 1);
  62. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  63. (506, 505, 0, '补货单列表', 'ReplenishmentOrderList', '/inventory/replenishment-order/list', 'replenishment-order/index', 1, 1, 0);
  64. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  65. (507, 505, 0, '补货单详情', 'ReplenishmentOrderDetail', '/inventory/replenishment-order/detail', 'replenishment-order/detail', 2, 0, 0);
  66. -- =====================================================
  67. -- 6. 客户管理 (Customer) - rank 6
  68. -- =====================================================
  69. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, icon, show_link, show_parent, `redirect`, keep_alive) VALUES
  70. (600, 0, 0, '客户管理', 'Customer', '/customer', '', 6, 'ri:user-heart-line', 1, 0, '/customer/list', 1);
  71. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  72. (601, 600, 0, '客户列表', 'CustomerList', '/customer/list', 'customer/index', 1, 1, 0);
  73. -- =====================================================
  74. -- 7. 分销管理 (Distribution) - rank 6
  75. -- =====================================================
  76. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, icon, show_link, show_parent, `redirect`, keep_alive) VALUES
  77. (700, 0, 0, '分销管理', 'Distribution', '/distribution', '', 6, 'ep:share', 1, 1, '/distribution/dashboard', 1);
  78. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  79. (701, 700, 0, '分销概览', 'DistributionDashboard', '/distribution/dashboard', '', 1, 1, 0);
  80. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  81. (702, 700, 0, '分销员管理', 'DistributionDistributor', '/distribution/distributor', '', 2, 1, 0);
  82. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  83. (703, 700, 0, '推荐记录', 'DistributionReferral', '/distribution/referral', '', 3, 1, 0);
  84. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  85. (704, 700, 0, '佣金记录', 'DistributionCommission', '/distribution/commission', '', 4, 1, 0);
  86. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  87. (705, 700, 0, '提现管理', 'DistributionWithdrawal', '/distribution/withdrawal', '', 5, 1, 0);
  88. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  89. (706, 700, 0, '月度报表', 'DistributionReport', '/distribution/report', '', 6, 1, 0);
  90. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  91. (707, 700, 0, '分销配置', 'DistributionConfig', '/distribution/config', '', 7, 1, 0);
  92. -- =====================================================
  93. -- 8. 营销中心 (Marketing) - rank 7
  94. -- =====================================================
  95. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, icon, show_link, show_parent, `redirect`, keep_alive) VALUES
  96. (800, 0, 0, '营销中心', 'Marketing', '/marketing', '', 7, 'ri:megaphone-line', 1, 1, '/marketing/activity', 1);
  97. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  98. (801, 800, 0, '活动管理', 'MarketingActivity', '/marketing/activity', '', 1, 1, 0);
  99. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  100. (802, 800, 0, '优惠券管理', 'MarketingCoupon', '/marketing/coupon', '', 2, 1, 0);
  101. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  102. (803, 800, 0, '用户优惠券', 'UserCouponList', '/marketing/user-coupon', '', 3, 1, 0);
  103. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  104. (804, 800, 0, '定时折扣', 'TimedDiscount', '/marketing/timed-discount', '', 4, 1, 0);
  105. -- 8.5 营销中心 → 数据统计 (三级菜单)
  106. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  107. (810, 800, 0, '数据统计', 'MarketingStatistics', '/marketing/statistics', '', 5, 1, 0);
  108. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  109. (811, 810, 0, '统计概览', 'StatisticsOverview', '/marketing/statistics/overview', '', 1, 1, 0);
  110. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  111. (812, 810, 0, '活动统计', 'ActivityStatistics', '/marketing/statistics/activity', '', 2, 1, 0);
  112. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  113. (813, 810, 0, '优惠券统计', 'CouponStatistics', '/marketing/statistics/coupon', '', 3, 1, 0);
  114. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  115. (814, 810, 0, '趋势分析', 'TrendAnalysis', '/marketing/statistics/trend', '', 4, 1, 0);
  116. -- =====================================================
  117. -- 9. 统计报表 (Statistics) - rank 8
  118. -- =====================================================
  119. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, icon, show_link, show_parent, `redirect`, keep_alive) VALUES
  120. (900, 0, 0, '统计报表', 'Statistics', '/statistics', '', 8, 'ri:bar-chart-grouped-line', 1, 1, '/statistics/overview', 1);
  121. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  122. (901, 900, 0, '统计概览', 'StatisticsOverview', '/statistics/overview', '', 1, 1, 0);
  123. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  124. (902, 900, 0, '品类销售统计', 'CategoryStatistics', '/statistics/category', '', 2, 1, 0);
  125. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  126. (903, 900, 0, '门店利润报表', 'ProfitStatistics', '/statistics/profit', '', 3, 1, 0);
  127. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  128. (904, 900, 0, '用户复购统计', 'RepurchaseStatistics', '/statistics/repurchase', '', 4, 1, 0);
  129. -- =====================================================
  130. -- 10. 系统设置 (System) - rank 8
  131. -- =====================================================
  132. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, icon, show_link, show_parent, `redirect`, keep_alive) VALUES
  133. (1000, 0, 0, '系统设置', 'System', '/system', '', 8, 'ri:settings-3-line', 1, 1, '/system/admin', 1);
  134. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  135. (1001, 1000, 0, '管理员管理', 'SystemAdmin', '/system/admin', '', 1, 1, 0);
  136. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  137. (1002, 1000, 0, '角色管理', 'SystemRole', '/system/role', '', 2, 1, 0);
  138. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  139. (1003, 1000, 0, '权限管理', 'SystemPermission', '/system/permission', '', 3, 1, 0);
  140. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  141. (1004, 1000, 0, '公告管理', 'SystemAnnouncement', '/system/announcement', '', 4, 1, 0);
  142. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  143. (1005, 1000, 0, '操作日志', 'SystemOperationLog', '/system/operation-log', '', 5, 1, 0);
  144. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  145. (1006, 1000, 0, '数据同步', 'SyncRecords', '/system/sync', '', 6, 1, 0);
  146. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  147. (1007, 1000, 0, '字典管理', 'SystemDict', '/system/dict', '', 7, 1, 0);
  148. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, show_link, show_parent) VALUES
  149. (1008, 1000, 0, '菜单管理', 'SystemMenu', '/system/menu', '', 8, 1, 0);
  150. -- =====================================================
  151. -- 11. 设备层模版管理 (Layer Template) - rank 8
  152. -- =====================================================
  153. INSERT INTO t_menu (id, parent_id, menu_type, title, name, path, component, `rank`, icon, show_link, show_parent, keep_alive) VALUES
  154. (1100, 0, 0, '设备层模版管理', 'LayerTemplate', '/layer-template', '', 8, 'ri:stack-line', 1, 0, 1);
  155. -- =====================================================
  156. -- 角色菜单关联:admin 角色(role_id=1)拥有所有菜单
  157. -- =====================================================
  158. INSERT INTO t_role_menu (id, role_id, menu_id) VALUES
  159. (90001, 1, 100), (90002, 1, 101),
  160. (90003, 1, 200), (90004, 1, 201), (90005, 1, 202),
  161. (90006, 1, 300), (90007, 1, 301), (90008, 1, 302), (90009, 1, 303), (90010, 1, 304),
  162. (90011, 1, 400), (90012, 1, 401), (90013, 1, 402),
  163. (90014, 1, 500), (90015, 1, 501), (90016, 1, 502), (90017, 1, 503), (90053, 1, 505), (90054, 1, 506), (90055, 1, 507),
  164. (90018, 1, 600), (90019, 1, 601),
  165. (90020, 1, 700), (90021, 1, 701), (90022, 1, 702), (90023, 1, 703), (90024, 1, 704), (90025, 1, 705), (90026, 1, 706), (90027, 1, 707),
  166. (90028, 1, 800), (90029, 1, 801), (90030, 1, 802), (90031, 1, 803), (90032, 1, 804),
  167. (90033, 1, 810), (90034, 1, 811), (90035, 1, 812), (90036, 1, 813), (90037, 1, 814),
  168. (90038, 1, 900), (90039, 1, 901), (90040, 1, 902), (90041, 1, 903), (90042, 1, 904),
  169. (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),
  170. (90052, 1, 1100),
  171. (90053, 1, 403);