From 752208da02d0744829d686a0c9a485fd82b4f2b5 Mon Sep 17 00:00:00 2001 From: kkfluous Date: Sat, 28 Mar 2026 15:09:19 +0800 Subject: [PATCH] fix: replace 3 operations sections with exact prototype code Co-Authored-By: Claude Opus 4.6 (1M context) --- src/App.tsx | 486 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 277 insertions(+), 209 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 752019a..60f7041 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -33,6 +33,8 @@ export default function App() { customer?: string; isColdChain?: boolean; isTrailer?: boolean; + type?: string; + source?: string; } | null>(null); // Data state @@ -128,8 +130,30 @@ export default function App() { if (cat === 'Operating') params.category = 'Operating'; if (showPlateNumbers.manager) params.manager = showPlateNumbers.manager; if (showPlateNumbers.customer) params.customer = showPlateNumbers.customer; - if (showPlateNumbers.isColdChain !== undefined) params.isColdChain = String(showPlateNumbers.isColdChain); - if (showPlateNumbers.isTrailer !== undefined) params.isTrailer = String(showPlateNumbers.isTrailer); + if (!showPlateNumbers.type) { + if (showPlateNumbers.isColdChain !== undefined) params.isColdChain = String(showPlateNumbers.isColdChain); + if (showPlateNumbers.isTrailer !== undefined) params.isTrailer = String(showPlateNumbers.isTrailer); + } + // Map prototype's type field to backend vehicleType + if (showPlateNumbers.type) { + if (showPlateNumbers.type === '4.5T') { + if (showPlateNumbers.isColdChain === true) { + params.vehicleType = '4.5T冷链'; + } else if (showPlateNumbers.isColdChain === false) { + params.vehicleType = '4.5T普货'; + } + } else if (showPlateNumbers.type === '18T') { + params.vehicleType = '18T'; + } else if (showPlateNumbers.type === '49T') { + params.vehicleType = '49T'; + } else if (showPlateNumbers.type === '其他车型') { + if (showPlateNumbers.isTrailer === true) { + params.isTrailer = 'true'; + } else if (showPlateNumbers.isTrailer === false) { + params.vehicleType = '其他'; + } + } + } fetchVehicleList(params) .then(setModalVehicles) .catch(() => setModalVehicles([])) @@ -860,8 +884,9 @@ export default function App() { + {/* Department Operations Statistics */} -
+
@@ -871,9 +896,9 @@ export default function App() {
- +
- {/* Overall Total Summary (Compact) */} + {/* Overall Total Summary (Compact) - Moved to Top */}
@@ -894,7 +919,9 @@ export default function App() {
平均出勤 - + + {'—'} +
@@ -902,13 +929,13 @@ export default function App() { {/* Controls Row: Toggles Left, Filter Right */}
- -
- +
- setCustomerFilters(prev => ({ ...prev, customer: e.target.value }))} @@ -1705,9 +1772,9 @@ export default function App() {
- setCustomerFilters(prev => ({ ...prev, manager: e.target.value }))} @@ -1718,7 +1785,7 @@ export default function App() {
- setCustomerFilters(prev => ({ ...prev, department: e.target.value }))} @@ -1740,7 +1807,7 @@ export default function App() {
-