diff --git a/src/modules/scheduling/SuggestionList.tsx b/src/modules/scheduling/SuggestionList.tsx new file mode 100644 index 0000000..b9e1dfc --- /dev/null +++ b/src/modules/scheduling/SuggestionList.tsx @@ -0,0 +1,129 @@ +import { ArrowRightLeft, AlertTriangle, CheckCircle } from 'lucide-react'; +import { motion } from 'motion/react'; +import type { SchedulingSuggestion } from './types'; +import Blur from '../../components/Blur'; + +interface Props { + suggestions: SchedulingSuggestion[]; + onSelect: (s: SchedulingSuggestion) => void; +} + +function fmtKm(value: number): string { + if (value >= 10000) return (value / 10000).toFixed(1) + '万'; + return value.toLocaleString(); +} + +export default function SuggestionList({ suggestions, onSelect }: Props) { + if (suggestions.length === 0) { + return ( +
+
+ +

暂无调度建议

+

所有车辆当前无需干预

+
+
+ ); + } + + return ( +
+ {/* Header */} +
+
+ 智能调度干预清单 + + {suggestions.length} + +
+ + {/* Rows */} +
+ {suggestions.map((s, idx) => { + const isHigh = s.priority === 'high' || s.type === 'rescue_hopeless'; + + return ( + onSelect(s)} + > +
+ {/* Priority icon */} +
+ {isHigh ? ( + + ) : ( + + )} +
+ + {/* Content */} +
+ {/* Top row: plate + badges */} +
+ + + {s.currentVehicle.plateNumber} + + + + {/* Type badge */} + + {s.type === 'rescue_hopeless' ? '无望达标' : '已达标'} + + + {/* Vehicle type badge */} + + {s.currentVehicle.vehicleType} + + + {/* Region badge */} + + {s.currentVehicle.region} + +
+ + {/* Info line */} +
+ + 客户:{' '} + + {s.currentVehicle.customer ?? '—'} + + + + 日均: {fmtKm(s.currentVehicle.customerAvgDaily)} KM + + + 完成率: {s.currentVehicle.completionRate}% + +
+
+ + {/* Right: candidate count */} +
+ {s.candidates.length} + +
+
+
+ ); + })} +
+
+ ); +}