fix: 里程范围筛选接入后端
- 后端支持 mileageMin/mileageMax 查询参数 - 前端点击"完成筛选"时将里程范围提交到后端 - "重置所有"同时清除已应用的里程范围 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -154,6 +154,8 @@ app.get('/monitoring', (c) => {
|
||||
const customer = c.req.query('customer') || '';
|
||||
const project = c.req.query('project') || '';
|
||||
const entity = c.req.query('entity') || '';
|
||||
const mileageMin = c.req.query('mileageMin') || '';
|
||||
const mileageMax = c.req.query('mileageMax') || '';
|
||||
|
||||
let vehicles = monitoringCache.vehicles;
|
||||
|
||||
@@ -170,6 +172,8 @@ app.get('/monitoring', (c) => {
|
||||
if (customer) vehicles = vehicles.filter(v => v.customer === customer);
|
||||
if (project) vehicles = vehicles.filter(v => v.project === project);
|
||||
if (entity) vehicles = vehicles.filter(v => v.entity === entity);
|
||||
if (mileageMin) vehicles = vehicles.filter(v => v.dailyKm >= Number(mileageMin));
|
||||
if (mileageMax) vehicles = vehicles.filter(v => v.dailyKm <= Number(mileageMax));
|
||||
|
||||
const total = vehicles.length;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user