feat: 菜品成本分析模块 - 10个Tab + 31个分析API + 7个调整管理API

- 后端: 新增 cost-analysis.ts 路由,含31个分析端点和7个调整管理端点
- 前端: 新增 CostAnalysisPage 主页面 + 10个Tab组件
  - Tab1-9: 成本总览/菜品盈利/原料差异/BOM配方/供应链/包装耗材/数据质量/门店成本/可视化探索
  - Tab10: 调整管理(诊断快照+调整记录+效果验证)
- 修复: 毛利率和损耗率从简单平均改为加权计算
- 新增: Tabs组件、侧边栏菜单项、路由注册
- 新增: 3张数据库表(诊断快照/调整记录/验证结果)
This commit is contained in:
freedakgmail
2026-07-28 16:56:45 +08:00
parent 722db28d06
commit 3d89baf65d
22 changed files with 4137 additions and 5 deletions
+11 -4
View File
@@ -9,6 +9,7 @@
"version": "1.0.0",
"dependencies": {
"@tanstack/react-query": "^5.51.1",
"@types/react-leaflet": "^2.8.3",
"axios": "^1.7.2",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
@@ -1379,14 +1380,12 @@
"version": "7946.0.16",
"resolved": "https://registry.npmmirror.com/@types/geojson/-/geojson-7946.0.16.tgz",
"integrity": "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==",
"dev": true,
"license": "MIT"
},
"node_modules/@types/leaflet": {
"version": "1.9.21",
"resolved": "https://registry.npmmirror.com/@types/leaflet/-/leaflet-1.9.21.tgz",
"integrity": "sha512-TbAd9DaPGSnzp6QvtYngntMZgcRk+igFELwR2N99XZn7RXUdKgsXMR+28bUO0rPsWp8MIu/f47luLIQuSLYv/w==",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/geojson": "*"
@@ -1406,14 +1405,12 @@
"version": "15.7.15",
"resolved": "https://registry.npmmirror.com/@types/prop-types/-/prop-types-15.7.15.tgz",
"integrity": "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==",
"dev": true,
"license": "MIT"
},
"node_modules/@types/react": {
"version": "18.3.31",
"resolved": "https://registry.npmmirror.com/@types/react/-/react-18.3.31.tgz",
"integrity": "sha512-vfEqpXTvwT91yhmwdfouStN2hSKwTvyRs8qpLfADyrq/kxDw0hZM7Wk9Ug1FELj8hIby+S/+kQCSRFF32nv2Qw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/prop-types": "*",
@@ -1430,6 +1427,16 @@
"@types/react": "^18.0.0"
}
},
"node_modules/@types/react-leaflet": {
"version": "2.8.3",
"resolved": "https://registry.npmmirror.com/@types/react-leaflet/-/react-leaflet-2.8.3.tgz",
"integrity": "sha512-MeBQnVQe6ikw8dkuZE4F96PvMdQeilZG6/ekk5XxhkSzU3lofedULn3UR/6G0uIHjbRazi4DA8LnLACX0bPhBg==",
"license": "MIT",
"dependencies": {
"@types/leaflet": "*",
"@types/react": "*"
}
},
"node_modules/@vitejs/plugin-react": {
"version": "4.7.0",
"resolved": "https://registry.npmmirror.com/@vitejs/plugin-react/-/plugin-react-4.7.0.tgz",