import { Request, Response } from 'express'; const carInfo = [ { id: 1, vehicleIndex: 'C', brand: '东风', type: '车型', vehicleLoad: '半载', vehicleLevel: 1, category: 1, classification: 1, wheelbase: 20, frontGauge: 20, backGauge: 20, steeringSystem: 1, frontSuspensionForm: 1, backSuspensionForm: 1, particularYear: null, country: null, energy: null, }, { id: 2, vehicleIndex: 'A', brand: 'wow', type: null, vehicleLoad: '全载', vehicleLevel: 2, category: 2, classification: 3, wheelbase: 50, frontGauge: 40, backGauge: 30, steeringSystem: 2, frontSuspensionForm: 4, backSuspensionForm: 3, particularYear: 2019, country: '中国', energy: '汽油', }, { id: 5, vehicleIndex: 'C', brand: '北风', type: '车型', vehicleLoad: '半载', vehicleLevel: 3, category: 3, classification: 4, wheelbase: 40, frontGauge: 20, backGauge: 30, steeringSystem: 3, frontSuspensionForm: 2, backSuspensionForm: 4, particularYear: 2020, country: '日本', energy: '植物油', }, { id: 6, vehicleIndex: 'B', brand: '东风', type: '车型', vehicleLoad: '半载', vehicleLevel: 2, category: 3, classification: 3, wheelbase: 30, frontGauge: 30, backGauge: 40, steeringSystem: 4, frontSuspensionForm: 3, backSuspensionForm: 3, particularYear: 2020, country: '德国', energy: '石油', }, { id: 7, vehicleIndex: 'C', brand: '西风', type: '车型', vehicleLoad: '全载', vehicleLevel: 1, category: 2, classification: 3, wheelbase: 50, frontGauge: 40, backGauge: 30, steeringSystem: 2, frontSuspensionForm: 4, backSuspensionForm: 3, particularYear: 2019, country: '中国', energy: '汽油', }, { id: 8, vehicleIndex: 'B', brand: '南风', type: '车型', vehicleLoad: '全载', vehicleLevel: 3, category: 3, classification: 3, wheelbase: 40, frontGauge: 20, backGauge: 20, steeringSystem: 2, frontSuspensionForm: 3, backSuspensionForm: 2, particularYear: 2018, country: '德国', energy: '柴油', }, { id: 9, vehicleIndex: 'D', brand: 'test', type: null, vehicleLoad: null, vehicleLevel: null, category: null, classification: null, wheelbase: null, frontGauge: null, backGauge: null, steeringSystem: null, frontSuspensionForm: null, backSuspensionForm: null, particularYear: null, country: null, energy: null, }, { id: 10, vehicleIndex: null, brand: 'test1', type: null, vehicleLoad: null, vehicleLevel: null, category: null, classification: null, wheelbase: null, frontGauge: null, backGauge: null, steeringSystem: null, frontSuspensionForm: null, backSuspensionForm: null, particularYear: null, country: null, energy: null, }, { id: 11, vehicleIndex: null, brand: 'test', type: null, vehicleLoad: null, vehicleLevel: null, category: null, classification: null, wheelbase: null, frontGauge: null, backGauge: null, steeringSystem: null, frontSuspensionForm: null, backSuspensionForm: null, particularYear: null, country: null, energy: null, }, ]; export default { 'POST /api/api/vehicleInfo/getCarDataList': (req: Request, res: Response) => { const data = req.body.brand ? carInfo.filter((item) => item.brand.indexOf(req.body.brand) > -1) : carInfo; res.send({ code: 200, msg: 'success', data: { list: data, count: data.length, }, }); }, };