feat(mileage): 区域与车牌列表级联,并自动剔除越界车牌
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

- 后端: 选中 region 时基于该区域车辆重算 filters,车牌列表只展示该区域
- 前端: filterOptions.plates 收窄后自动从已选车牌中剔除不属于新区域的项

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
kkfluous
2026-04-29 15:31:12 +08:00
parent e0c609168e
commit cab86556f3
2 changed files with 14 additions and 0 deletions

View File

@@ -201,6 +201,14 @@ export default function MonitoringView() {
loadFirstPage();
}, [loadFirstPage]);
// 区域级联plate 选项收窄后,剔除已选但已不属于该区域的车牌
useEffect(() => {
if (filterPlates.length === 0) return;
const valid = new Set(filterOptions.plates);
const next = filterPlates.filter(p => valid.has(p));
if (next.length !== filterPlates.length) setFilterPlates(next);
}, [filterOptions.plates, filterPlates]);
// 下载当前筛选结果为 xlsx
const handleDownload = useCallback(async () => {
if (exporting) return;