@ -0,0 +1,155 @@ |
|||||
|
'use strict'; |
||||
|
|
||||
|
async function lineGet (ctx) { |
||||
|
try { |
||||
|
const models = ctx.fs.dc.models; |
||||
|
const { fleet } = ctx.query; |
||||
|
const findOption = { |
||||
|
order: [['id', 'DESC']], |
||||
|
where: { |
||||
|
|
||||
|
}, |
||||
|
} |
||||
|
if (fleet) { |
||||
|
findOption.where.fleet = { $like: `%${fleet}%` } |
||||
|
} |
||||
|
|
||||
|
const roadRes = await models.BusLine.findAll(findOption) |
||||
|
|
||||
|
ctx.status = 200; |
||||
|
ctx.body = roadRes |
||||
|
} catch (error) { |
||||
|
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
||||
|
ctx.status = 400; |
||||
|
ctx.body = { |
||||
|
message: typeof error == 'string' ? error : undefined |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
async function lineEdit (ctx) { |
||||
|
try { |
||||
|
const models = ctx.fs.dc.models; |
||||
|
const data = ctx.request.body; |
||||
|
|
||||
|
if (!data.lineId) { |
||||
|
await models.BusLine.create(data) |
||||
|
} else { |
||||
|
await models.BusLine.update( |
||||
|
data, { |
||||
|
where: { |
||||
|
id: data.lineId |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
ctx.status = 204 |
||||
|
} catch (error) { |
||||
|
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
||||
|
ctx.status = 400; |
||||
|
ctx.body = { |
||||
|
message: typeof error == 'string' ? error : undefined |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
async function lineDel (ctx) { |
||||
|
try { |
||||
|
const models = ctx.fs.dc.models; |
||||
|
const { lineId } = ctx.params; |
||||
|
|
||||
|
await models.BusLine.destroy({ |
||||
|
where: { |
||||
|
id: lineId |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
ctx.status = 204 |
||||
|
} catch (error) { |
||||
|
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
||||
|
ctx.status = 400; |
||||
|
ctx.body = { |
||||
|
message: typeof error == 'string' ? error : undefined |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
async function carGet (ctx) { |
||||
|
try { |
||||
|
const models = ctx.fs.dc.models; |
||||
|
const { fleet } = ctx.query; |
||||
|
const findOption = { |
||||
|
order: [['id', 'DESC']], |
||||
|
where: { |
||||
|
|
||||
|
}, |
||||
|
} |
||||
|
if (fleet) { |
||||
|
findOption.where.fleet = { $like: `%${fleet}%` } |
||||
|
} |
||||
|
|
||||
|
const roadRes = await models.BusCar.findAll(findOption) |
||||
|
|
||||
|
ctx.status = 200; |
||||
|
ctx.body = roadRes |
||||
|
} catch (error) { |
||||
|
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
||||
|
ctx.status = 400; |
||||
|
ctx.body = { |
||||
|
message: typeof error == 'string' ? error : undefined |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
async function carEdit (ctx) { |
||||
|
try { |
||||
|
const models = ctx.fs.dc.models; |
||||
|
const data = ctx.request.body; |
||||
|
|
||||
|
if (!data.carId) { |
||||
|
await models.BusCar.create(data) |
||||
|
} else { |
||||
|
await models.BusCar.update( |
||||
|
data, { |
||||
|
where: { |
||||
|
id: data.carId |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
ctx.status = 204 |
||||
|
} catch (error) { |
||||
|
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
||||
|
ctx.status = 400; |
||||
|
ctx.body = { |
||||
|
message: typeof error == 'string' ? error : undefined |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
async function carDel (ctx) { |
||||
|
try { |
||||
|
const models = ctx.fs.dc.models; |
||||
|
const { carId } = ctx.params; |
||||
|
|
||||
|
await models.BusCar.destroy({ |
||||
|
where: { |
||||
|
id: carId |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
ctx.status = 204 |
||||
|
} catch (error) { |
||||
|
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
||||
|
ctx.status = 400; |
||||
|
ctx.body = { |
||||
|
message: typeof error == 'string' ? error : undefined |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
module.exports = { |
||||
|
lineGet, lineEdit, lineDel, |
||||
|
carGet, carEdit, carDel, |
||||
|
}; |
@ -0,0 +1,198 @@ |
|||||
|
'use strict'; |
||||
|
|
||||
|
const moment = require("moment"); |
||||
|
|
||||
|
const areaCode = { |
||||
|
"360121100000": "莲塘镇", |
||||
|
"360121101000": "向塘镇", |
||||
|
"360121102000": "三江镇", |
||||
|
"360121103000": "塘南镇", |
||||
|
"360121104000": "幽兰镇", |
||||
|
"360121105000": "蒋巷镇", |
||||
|
"360121106000": "武阳镇", |
||||
|
"360121107000": "冈上镇", |
||||
|
"360121108000": "广福镇", |
||||
|
"360121191000": "昌东镇", |
||||
|
"360121192000": "麻丘镇", |
||||
|
"360121200000": "泾口乡", |
||||
|
"360121201000": "南新乡", |
||||
|
"360121202000": "塔城乡", |
||||
|
"360121203000": "黄马乡", |
||||
|
"360121204000": "富山乡", |
||||
|
"360121205000": "东新乡", |
||||
|
"360121206000": "八一乡", |
||||
|
"360121403000": "小蓝经济开发区", |
||||
|
"360121471000": "银三角管理委员会", |
||||
|
"360121501000": "五星垦殖场", |
||||
|
"360121572000": "良种繁殖场", |
||||
|
} |
||||
|
|
||||
|
async function roadState (ctx) { |
||||
|
try { |
||||
|
const models = ctx.fs.dc.models; |
||||
|
const { userId } = ctx.fs.api; |
||||
|
|
||||
|
const roadRes = await models.Road.findAll({}) |
||||
|
const projectRoadRes = await models.Project.findAll({ |
||||
|
type: 'road', |
||||
|
}) |
||||
|
|
||||
|
const bridgeCount = await models.Bridge.count({}) |
||||
|
|
||||
|
let constructionYear = [] |
||||
|
for (let i = 0; constructionYear.length < 4; i++) { |
||||
|
constructionYear.push(moment().subtract(i, 'year').format('YYYY')) |
||||
|
} |
||||
|
constructionYear.reverse() |
||||
|
|
||||
|
const roadState = { |
||||
|
// 在建数量
|
||||
|
buildingRoad: 0, |
||||
|
// 已建数量
|
||||
|
buildedRoad: 0, |
||||
|
// 桥梁数量
|
||||
|
bridgeCount: bridgeCount, |
||||
|
// 涵洞数量
|
||||
|
culvertCount: 0, |
||||
|
// 施工统计
|
||||
|
construction: constructionYear.map(year => { |
||||
|
return { |
||||
|
year, |
||||
|
count: 0, |
||||
|
} |
||||
|
}), |
||||
|
// 乡镇统计
|
||||
|
townRoad: { |
||||
|
|
||||
|
}, |
||||
|
// 类型统计
|
||||
|
roadType: { |
||||
|
'县': 0, |
||||
|
'乡': 0, |
||||
|
'村': 0, |
||||
|
}, |
||||
|
// 在建项目统计
|
||||
|
townProject: { |
||||
|
|
||||
|
}, |
||||
|
// 等级统计
|
||||
|
roadLevel: { |
||||
|
|
||||
|
}, |
||||
|
// 养护周期
|
||||
|
curingPeriod: { |
||||
|
frequent: 0, |
||||
|
season: 0, |
||||
|
}, |
||||
|
// 绿化里程
|
||||
|
greenMileage: { |
||||
|
'县': { |
||||
|
canBeGreen: 0, |
||||
|
isGreen: 0, |
||||
|
}, |
||||
|
'乡': { |
||||
|
canBeGreen: 0, |
||||
|
isGreen: 0, |
||||
|
}, |
||||
|
'村': { |
||||
|
canBeGreen: 0, |
||||
|
isGreen: 0, |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
let roadCode = new Set() |
||||
|
|
||||
|
for (let r of roadRes) { |
||||
|
roadCode.add(r.routeCode) |
||||
|
|
||||
|
roadState.culvertCount += Number(r.numberOfCulverts) || 0; |
||||
|
|
||||
|
// 建成年份
|
||||
|
let buildYear = r.completionTime ? moment(r.completionTime).format('YYYY') : null |
||||
|
// 改建年份
|
||||
|
let rebuildYear = r.reconstructionTime ? moment(r.reconstructionTime).format('YYYY') : null |
||||
|
let corBuildConstruction = roadState.construction.find(item => item.year === buildYear) |
||||
|
if (corBuildConstruction) { |
||||
|
corBuildConstruction.count += Number(r.chainageMileage) || 0 |
||||
|
} |
||||
|
let corReBuildConstruction = roadState.construction.find(item => item.year === rebuildYear) |
||||
|
if (corReBuildConstruction) { |
||||
|
corReBuildConstruction.count += Number(r.chainageMileage) || 0 |
||||
|
} |
||||
|
|
||||
|
let townName = areaCode[r.townshipCode] || '其他' |
||||
|
if (roadState.townRoad[townName]) { |
||||
|
roadState.townRoad[townName].roadCode.add(r.routeCode) |
||||
|
roadState.townRoad[townName].mileage += Number(r.chainageMileage) || 0 |
||||
|
} else { |
||||
|
roadState.townRoad[townName] = { |
||||
|
roadCode: new Set([r.routeCode]), |
||||
|
mileage: Number(r.chainageMileage) || 0, |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
roadState.roadType[r.level] = (roadState.roadType[r.level] || 0) + (Number(r.chainageMileage) || 0) |
||||
|
|
||||
|
if (roadState.roadLevel[r.technicalLevel]) { |
||||
|
roadState.roadLevel[r.technicalLevel] += 1 |
||||
|
} else { |
||||
|
roadState.roadLevel[r.technicalLevel] = 1 |
||||
|
} |
||||
|
|
||||
|
if (r.curingTime) { |
||||
|
if (r.curingTime.indexOf('经常') > -1) { |
||||
|
roadState.curingPeriod.frequent += 1 |
||||
|
} else if (r.curingTime.indexOf('季节') > -1) { |
||||
|
roadState.curingPeriod.season += 1 |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
roadState.greenMileage[r.level].canBeGreen += (Number(r.greeningMileage) || 0) |
||||
|
roadState.greenMileage[r.level].isGreen += (Number(r.greeningMileaged) || 0) |
||||
|
} |
||||
|
|
||||
|
let corBuildConstruction2022 = roadState.construction.find(item => item.year == 2022) |
||||
|
|
||||
|
for (let p of projectRoadRes) { |
||||
|
if (p.type == 'road') { |
||||
|
|
||||
|
if (corBuildConstruction2022) { |
||||
|
corBuildConstruction2022.count += Number(p.projectMileage) || 0 |
||||
|
} |
||||
|
|
||||
|
if (p.done) { |
||||
|
roadState.buildedRoad += 1 |
||||
|
} else { |
||||
|
roadState.buildingRoad += 1 |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
let townName = p.buildUnit.replace('人民政府', '').replace('南昌县', '').replace('管委会', '') |
||||
|
if (roadState.townProject[townName]) { |
||||
|
roadState.townProject[townName] += 1 |
||||
|
} else { |
||||
|
roadState.townProject[townName] = 1 |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
roadState.buildedRoad += roadCode.size |
||||
|
for (let t of Object.keys(roadState.townRoad)) { |
||||
|
roadState.townRoad[t].roadCount = roadState.townRoad[t].roadCode.size |
||||
|
delete roadState.townRoad[t].roadCode |
||||
|
} |
||||
|
|
||||
|
ctx.status = 200 |
||||
|
ctx.body = roadState |
||||
|
} catch (error) { |
||||
|
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
||||
|
ctx.status = 400; |
||||
|
ctx.body = { |
||||
|
message: typeof error == 'string' ? error : undefined |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
module.exports = { |
||||
|
roadState, |
||||
|
}; |
@ -0,0 +1,42 @@ |
|||||
|
'use strict'; |
||||
|
|
||||
|
async function statistic (ctx) { |
||||
|
try { |
||||
|
const models = ctx.fs.dc.models; |
||||
|
const { userId } = ctx.fs.api; |
||||
|
const { projectType } = ctx.query; |
||||
|
|
||||
|
let findOption = { |
||||
|
where: { |
||||
|
reportType: 'conserve', |
||||
|
}, |
||||
|
attributes: ['id', 'road', 'time', 'projectType', 'projectType'], |
||||
|
include: [{ |
||||
|
model: models.User, |
||||
|
attributes: ['name'] |
||||
|
}], |
||||
|
} |
||||
|
|
||||
|
if (projectType) { |
||||
|
findOption.where.projectType = projectType; |
||||
|
} |
||||
|
|
||||
|
const reportRes = await await models.Report.findAll(findOption) |
||||
|
|
||||
|
ctx.status = 200 |
||||
|
ctx.body = { |
||||
|
processed: reportRes.length, |
||||
|
reportList: reportRes, |
||||
|
} |
||||
|
} catch (error) { |
||||
|
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
||||
|
ctx.status = 400; |
||||
|
ctx.body = { |
||||
|
message: typeof error == 'string' ? error : undefined |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
module.exports = { |
||||
|
statistic, |
||||
|
}; |
@ -0,0 +1,2 @@ |
|||||
|
'use strict'; |
||||
|
|
@ -0,0 +1,68 @@ |
|||||
|
'use strict'; |
||||
|
|
||||
|
async function overSpeedList (ctx) { |
||||
|
try { |
||||
|
const models = ctx.fs.dc.models; |
||||
|
const { userId } = ctx.fs.api; |
||||
|
|
||||
|
const overSpeedRes = await models.Overspeed.findAll({ |
||||
|
attributes: ['id', 'licensePlate', 'overrunRate', 'deductPoints', 'fine', 'processingTime'], |
||||
|
order: [['testTime', 'DESC']], |
||||
|
}) |
||||
|
|
||||
|
ctx.status = 200 |
||||
|
ctx.body = { |
||||
|
processed: overSpeedRes.filter(s => s.processingTime).length, |
||||
|
overSpeedList: overSpeedRes, |
||||
|
} |
||||
|
} catch (error) { |
||||
|
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
||||
|
ctx.status = 400; |
||||
|
ctx.body = { |
||||
|
message: typeof error == 'string' ? error : undefined |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
async function overSpeedProcessed (ctx) { |
||||
|
try { |
||||
|
const models = ctx.fs.dc.models; |
||||
|
const { userId } = ctx.fs.api; |
||||
|
|
||||
|
const overSpeedCountRes = await models.Overspeed.count({ |
||||
|
attributes: ['nameOfInspectionPoint'], |
||||
|
group: ['nameOfInspectionPoint'], |
||||
|
}) |
||||
|
const overSpeedCountProcessedRes = await models.Overspeed.count({ |
||||
|
attributes: ['nameOfInspectionPoint'], |
||||
|
where: { processingTime: { $ne: null } }, |
||||
|
group: ['nameOfInspectionPoint'], |
||||
|
}) |
||||
|
|
||||
|
let data = [] |
||||
|
for (let c of overSpeedCountRes) { |
||||
|
const corProcessed = overSpeedCountProcessedRes.find(d => d.nameOfInspectionPoint == c.nameOfInspectionPoint) |
||||
|
if (corProcessed) { |
||||
|
data.push({ |
||||
|
name: c.nameOfInspectionPoint, |
||||
|
processed: corProcessed.count, |
||||
|
total: c.count, |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
ctx.status = 200 |
||||
|
ctx.body = data |
||||
|
} catch (error) { |
||||
|
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
||||
|
ctx.status = 400; |
||||
|
ctx.body = { |
||||
|
message: typeof error == 'string' ? error : undefined |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
module.exports = { |
||||
|
overSpeedList, |
||||
|
overSpeedProcessed |
||||
|
}; |
@ -0,0 +1,102 @@ |
|||||
|
'use strict'; |
||||
|
|
||||
|
async function busCarLevelList (ctx) { |
||||
|
try { |
||||
|
const models = ctx.fs.dc.models; |
||||
|
const { userId } = ctx.fs.api; |
||||
|
|
||||
|
let data = [] |
||||
|
const busCarRes = await models.BusCar.findAll({ |
||||
|
attributes: ['id', 'company', 'fleet', 'vehicleLicensePlateNumber'], |
||||
|
}) |
||||
|
for (let c of busCarRes) { |
||||
|
const { company, fleet } = c |
||||
|
const corCompany = data.find(d => d.name === company) |
||||
|
if (!corCompany) { |
||||
|
data.push({ |
||||
|
name: company, |
||||
|
child: [{ |
||||
|
name: fleet, |
||||
|
child: [{ ...c.dataValues }] |
||||
|
}] |
||||
|
}) |
||||
|
} else { |
||||
|
const corFleet = corCompany.child.find(d => d.name === fleet) |
||||
|
if (!corFleet) { |
||||
|
corCompany.child.push({ |
||||
|
name: fleet, |
||||
|
child: [{ ...c.dataValues }] |
||||
|
}) |
||||
|
} else { |
||||
|
corFleet.child.push({ ...c.dataValues }) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
ctx.status = 200 |
||||
|
ctx.body = data |
||||
|
} catch (error) { |
||||
|
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
||||
|
ctx.status = 400; |
||||
|
ctx.body = { |
||||
|
message: typeof error == 'string' ? error : undefined |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
async function vehicleStatistic (ctx) { |
||||
|
try { |
||||
|
const models = ctx.fs.dc.models; |
||||
|
const { userId } = ctx.fs.api; |
||||
|
|
||||
|
const taxiBusiness = await models.MunicipalBusiness.findAll({ |
||||
|
where: { |
||||
|
type: '出租车' |
||||
|
}, |
||||
|
attributes: ['id', 'nameOfBusinessOwner'] |
||||
|
}) |
||||
|
const hazardousGoodsBusiness = await models.MunicipalBusiness.findAll({ |
||||
|
where: { |
||||
|
type: '危货' |
||||
|
}, |
||||
|
attributes: ['id', 'nameOfBusinessOwner'] |
||||
|
}) |
||||
|
const passengerTransport = await models.Statistic.findOne({ |
||||
|
where: { |
||||
|
type: 'vehicle' |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
const vehicleState = { |
||||
|
passengerTransport: passengerTransport ? passengerTransport.count : 0, |
||||
|
taxi: await models.MunicipalVehicle.count({ |
||||
|
where: { |
||||
|
type: '出租车' |
||||
|
}, |
||||
|
}), |
||||
|
hazardousGoods: await models.MunicipalVehicle.count({ |
||||
|
where: { |
||||
|
type: '危货' |
||||
|
} |
||||
|
}), |
||||
|
bus: await models.BusCar.count(), |
||||
|
taxiBusiness: taxiBusiness, |
||||
|
hazardousGoodsBusiness: hazardousGoodsBusiness, |
||||
|
} |
||||
|
|
||||
|
ctx.status = 200 |
||||
|
ctx.body = vehicleState |
||||
|
} catch (error) { |
||||
|
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
||||
|
ctx.status = 400; |
||||
|
ctx.body = { |
||||
|
message: typeof error == 'string' ? error : undefined |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
module.exports = { |
||||
|
busCarLevelList, |
||||
|
vehicleStatistic, |
||||
|
}; |
@ -0,0 +1,493 @@ |
|||||
|
/* eslint-disable*/ |
||||
|
'use strict'; |
||||
|
|
||||
|
module.exports = dc => { |
||||
|
const DataTypes = dc.ORM; |
||||
|
const sequelize = dc.orm; |
||||
|
const BusCar = sequelize.define("busCar", { |
||||
|
id: { |
||||
|
type: DataTypes.INTEGER, |
||||
|
allowNull: false, |
||||
|
defaultValue: null, |
||||
|
comment: null, |
||||
|
primaryKey: true, |
||||
|
field: "id", |
||||
|
autoIncrement: true, |
||||
|
unique: "bus_car_id_uindex" |
||||
|
}, |
||||
|
company: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "所属公司", |
||||
|
primaryKey: false, |
||||
|
field: "company", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
fleet: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "所属车队", |
||||
|
primaryKey: false, |
||||
|
field: "fleet", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
line: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "所属线路", |
||||
|
primaryKey: false, |
||||
|
field: "line", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
vehicleNumber: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "车辆编号", |
||||
|
primaryKey: false, |
||||
|
field: "vehicle_number", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
vehicleLicensePlateNumber: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "车辆牌照号", |
||||
|
primaryKey: false, |
||||
|
field: "vehicle_license_plate_number", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
operationCategory: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "运营类别", |
||||
|
primaryKey: false, |
||||
|
field: "operation_category", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
serviceLife: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "已使用年限", |
||||
|
primaryKey: false, |
||||
|
field: "service_life", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
engineModel: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "发动机型号", |
||||
|
primaryKey: false, |
||||
|
field: "engine_model", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
vehicleModel: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "车辆型号", |
||||
|
primaryKey: false, |
||||
|
field: "vehicle_model", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
vehicleCategory: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "车辆类别", |
||||
|
primaryKey: false, |
||||
|
field: "vehicle_category", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
vehicleStatus: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "车辆状态", |
||||
|
primaryKey: false, |
||||
|
field: "vehicle_status", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
dateOfEntry: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "入户日期", |
||||
|
primaryKey: false, |
||||
|
field: "date_of_entry", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
purchaseDate: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "购进日期", |
||||
|
primaryKey: false, |
||||
|
field: "purchase_date", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
energyConsumptionType: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "能耗类型", |
||||
|
primaryKey: false, |
||||
|
field: "energy_consumption_type", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
numberOfStandardUnits: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "标台数", |
||||
|
primaryKey: false, |
||||
|
field: "number_of_standard_units", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
maintenanceUnit: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "维保单位", |
||||
|
primaryKey: false, |
||||
|
field: "maintenance_unit", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
vehicleType: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "车辆类型", |
||||
|
primaryKey: false, |
||||
|
field: "vehicle_type", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
brandAndModel: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "厂牌型号", |
||||
|
primaryKey: false, |
||||
|
field: "brand_and_model", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
manufacturer: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "生产厂家", |
||||
|
primaryKey: false, |
||||
|
field: "manufacturer", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
drivingLicenseNo: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "行驶证编号", |
||||
|
primaryKey: false, |
||||
|
field: "driving_license_no", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
engineNumber: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "发动机编号", |
||||
|
primaryKey: false, |
||||
|
field: "engine_number", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
mainEnergyConsumption: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "主能耗", |
||||
|
primaryKey: false, |
||||
|
field: "main_energy_consumption", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
secondaryEnergyConsumption: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "副能耗", |
||||
|
primaryKey: false, |
||||
|
field: "secondary_energy_consumption", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
emissionStandard: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "排放标准", |
||||
|
primaryKey: false, |
||||
|
field: "emission_standard", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
startDate: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "启用日期", |
||||
|
primaryKey: false, |
||||
|
field: "start_date", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
lastTransferDate: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "最近一次调动日期", |
||||
|
primaryKey: false, |
||||
|
field: "last_transfer_date", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
conductor: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "车长", |
||||
|
primaryKey: false, |
||||
|
field: "conductor", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
vehicleWidth: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "车宽", |
||||
|
primaryKey: false, |
||||
|
field: "vehicle_width", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
carHeight: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "车高", |
||||
|
primaryKey: false, |
||||
|
field: "car_height", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
approvedPassengerCapacity: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "核定载客数", |
||||
|
primaryKey: false, |
||||
|
field: "approved_passenger_capacity", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
vehicleIdentificationNumber: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "车辆识别号", |
||||
|
primaryKey: false, |
||||
|
field: "vehicle_identification_number", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
gearboxBrand: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "变速箱品牌", |
||||
|
primaryKey: false, |
||||
|
field: "gearbox_brand", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
manualCarWashingFee: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "人工洗车费", |
||||
|
primaryKey: false, |
||||
|
field: "manual_car_washing_fee", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
laborCost: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "劳务费", |
||||
|
primaryKey: false, |
||||
|
field: "labor_cost", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
curbWeight: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "整备质量", |
||||
|
primaryKey: false, |
||||
|
field: "curb_weight", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
totalMass: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "总质量", |
||||
|
primaryKey: false, |
||||
|
field: "total_mass", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
airConditioningTemperature: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "空调温度", |
||||
|
primaryKey: false, |
||||
|
field: "air_conditioning_temperature", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
airConditionedCarOrNot: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "是否空调车", |
||||
|
primaryKey: false, |
||||
|
field: "air_conditioned_car_or_not", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
turnOnTheAirConditioningTemperature: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "开空调温度", |
||||
|
primaryKey: false, |
||||
|
field: "turn_on_the_air_conditioning_temperature", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
power: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "功率", |
||||
|
primaryKey: false, |
||||
|
field: "power", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
transmission: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "变速器", |
||||
|
primaryKey: false, |
||||
|
field: "transmission", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
seatingCapacity: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "座位数", |
||||
|
primaryKey: false, |
||||
|
field: "seating_capacity", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
airConditioningBrand: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "空调品牌", |
||||
|
primaryKey: false, |
||||
|
field: "air_conditioning_brand", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
seatType: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "座椅类型", |
||||
|
primaryKey: false, |
||||
|
field: "seat_type", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
tireSpecifications: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "轮胎规格", |
||||
|
primaryKey: false, |
||||
|
field: "tire_specifications", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
roadTransportCertificateNo: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "道路运输证号", |
||||
|
primaryKey: false, |
||||
|
field: "road_transport_certificate_no", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
parkingPoint: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "停放点", |
||||
|
primaryKey: false, |
||||
|
field: "parking_point", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
carWashingType: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "洗车类型", |
||||
|
primaryKey: false, |
||||
|
field: "car_washing_type", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
maintenanceFreeWheelEnd: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "免维护轮端", |
||||
|
primaryKey: false, |
||||
|
field: "maintenance_free_wheel_end", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
firstGuaranteeDate: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "首保日期", |
||||
|
primaryKey: false, |
||||
|
field: "first_guarantee_date", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
dateOfRenovation: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "整修日期", |
||||
|
primaryKey: false, |
||||
|
field: "date_of_renovation", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
motorVehicleOwner: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "机动车所有人", |
||||
|
primaryKey: false, |
||||
|
field: "motor_vehicle_owner", |
||||
|
autoIncrement: false |
||||
|
} |
||||
|
}, { |
||||
|
tableName: "bus_car", |
||||
|
comment: "", |
||||
|
indexes: [] |
||||
|
}); |
||||
|
dc.models.BusCar = BusCar; |
||||
|
return BusCar; |
||||
|
}; |
@ -0,0 +1,232 @@ |
|||||
|
/* eslint-disable*/ |
||||
|
'use strict'; |
||||
|
|
||||
|
module.exports = dc => { |
||||
|
const DataTypes = dc.ORM; |
||||
|
const sequelize = dc.orm; |
||||
|
const BusLine = sequelize.define("busLine", { |
||||
|
id: { |
||||
|
type: DataTypes.INTEGER, |
||||
|
allowNull: false, |
||||
|
defaultValue: null, |
||||
|
comment: null, |
||||
|
primaryKey: true, |
||||
|
field: "id", |
||||
|
autoIncrement: true, |
||||
|
unique: "bus_line_id_uindex" |
||||
|
}, |
||||
|
company: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "公司", |
||||
|
primaryKey: false, |
||||
|
field: "company", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
fleet: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "车队", |
||||
|
primaryKey: false, |
||||
|
field: "fleet", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
carCaptain: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "车队长", |
||||
|
primaryKey: false, |
||||
|
field: "car_captain", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
assistantCarCaptain: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "副车队长", |
||||
|
primaryKey: false, |
||||
|
field: "assistant_car_captain", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
officeLocation: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "办公地点", |
||||
|
primaryKey: false, |
||||
|
field: "office_location", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
lineName: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "线路名称", |
||||
|
primaryKey: false, |
||||
|
field: "line_name", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
lineType: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "线路类型", |
||||
|
primaryKey: false, |
||||
|
field: "line_type", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
lineDivision: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "线路划分", |
||||
|
primaryKey: false, |
||||
|
field: "line_division", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
gpsNumber: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "GPS编号", |
||||
|
primaryKey: false, |
||||
|
field: "gps_number", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
startingPointEndPoint: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "起点终点", |
||||
|
primaryKey: false, |
||||
|
field: "starting_point_end_point", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
numberOfVehicles: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "车辆数", |
||||
|
primaryKey: false, |
||||
|
field: "number_of_vehicles", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
totalKilometers: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "全程公里数", |
||||
|
primaryKey: false, |
||||
|
field: "total_kilometers", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
ticketPrice: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "票价", |
||||
|
primaryKey: false, |
||||
|
field: "ticket_price", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
openingTime: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "开通时间", |
||||
|
primaryKey: false, |
||||
|
field: "opening_time", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
runningTime: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "运行时间", |
||||
|
primaryKey: false, |
||||
|
field: "running_time", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
openingTimeSummer: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "开班时间夏令", |
||||
|
primaryKey: false, |
||||
|
field: "opening_time_summer", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
shiftClosingTimeSummer: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "收班时间夏令", |
||||
|
primaryKey: false, |
||||
|
field: "shift_closing_time_summer", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
openingTimeWinter: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "开班时间冬令", |
||||
|
primaryKey: false, |
||||
|
field: "opening_time_winter", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
shiftClosingTimeWinter: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "收班时间冬令", |
||||
|
primaryKey: false, |
||||
|
field: "shift_closing_time_winter", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
uplinkOfStationsAlongTheWay: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "沿途站点上行", |
||||
|
primaryKey: false, |
||||
|
field: "uplink_of_stations_along_the_way", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
downlinkOfStationsAlongTheWay: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "沿途站点下行", |
||||
|
primaryKey: false, |
||||
|
field: "downlink_of_stations_along_the_way", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
area: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "所属区域", |
||||
|
primaryKey: false, |
||||
|
field: "area", |
||||
|
autoIncrement: false |
||||
|
}, |
||||
|
remarks: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: true, |
||||
|
defaultValue: null, |
||||
|
comment: "备注", |
||||
|
primaryKey: false, |
||||
|
field: "remarks", |
||||
|
autoIncrement: false |
||||
|
} |
||||
|
}, { |
||||
|
tableName: "bus_line", |
||||
|
comment: "", |
||||
|
indexes: [] |
||||
|
}); |
||||
|
dc.models.BusLine = BusLine; |
||||
|
return BusLine; |
||||
|
}; |
@ -0,0 +1,26 @@ |
|||||
|
'use strict'; |
||||
|
|
||||
|
const operation = require('../../controllers/overview/operation'); |
||||
|
const management = require('../../controllers/overview/management'); |
||||
|
const build = require('../../controllers/overview/building'); |
||||
|
const conserve = require('../../controllers/overview/conserve'); |
||||
|
|
||||
|
module.exports = function (app, router, opts) { |
||||
|
app.fs.api.logAttr['GET/operation/car_level'] = { content: '获取公交车辆层级信息', visible: false }; |
||||
|
router.get('/operation/car_level', operation.busCarLevelList); |
||||
|
|
||||
|
app.fs.api.logAttr['GET/manage/overspeed'] = { content: '获取治超详情列', visible: false }; |
||||
|
router.get('/manage/overspeed', management.overSpeedList); |
||||
|
|
||||
|
app.fs.api.logAttr['GET/manage/overspeed/processed'] = { content: '获取治超监测点处理数据', visible: false }; |
||||
|
router.get('/manage/overspeed/processed', management.overSpeedProcessed); |
||||
|
|
||||
|
app.fs.api.logAttr['GET/build/road_state'] = { content: '获取道路统计', visible: false }; |
||||
|
router.get('/build/road_state', build.roadState); |
||||
|
|
||||
|
app.fs.api.logAttr['GET/conserve/statistic'] = { content: '获取道路养护统计及列表', visible: false }; |
||||
|
router.get('/conserve/statistic', conserve.statistic); |
||||
|
|
||||
|
app.fs.api.logAttr['GET/transportation/statistic'] = { content: '获取运政统计', visible: false }; |
||||
|
router.get('/transportation/statistic', operation.vehicleStatistic); |
||||
|
} |
@ -0,0 +1,9 @@ |
|||||
|
INSERT INTO statistic (name, count, type) values ('客运车', 0, 'vehicle'); |
||||
|
INSERT INTO statistic (name, count, type) values ('标线', 0, 'road_manage'); |
||||
|
INSERT INTO statistic (name, count, type) values ('人行道', 0, 'road_manage'); |
||||
|
INSERT INTO statistic (name, count, type) values ('标志牌', 0, 'road_manage'); |
||||
|
INSERT INTO statistic (name, count, type) values ('防护栏', 0, 'road_manage'); |
||||
|
INSERT INTO statistic (name, count, type) values ('检查井', 0, 'road_manage'); |
||||
|
INSERT INTO statistic (name, count, type) values ('雨水口', 0, 'road_manage'); |
||||
|
INSERT INTO statistic (name, count, type) values ('路排名', 0, 'road_manage'); |
||||
|
INSERT INTO statistic (name, count, type) values ('养护责任牌', 0, 'road_manage'); |
@ -1,4 +0,0 @@ |
|||||
-- ---------------------------- |
|
||||
-- Records of user |
|
||||
-- ---------------------------- |
|
||||
INSERT INTO "public"."user" VALUES (1, '管理员', 'SuperAdmin', 'e10adc3949ba59abbe56e057f20f883e', 1, 'f', NULL, NULL, NULL, TRUE); |
|
@ -0,0 +1,8 @@ |
|||||
|
-- ---------------------------- |
||||
|
-- Records of DEP |
||||
|
-- ---------------------------- |
||||
|
INSERT INTO "department" VALUES (1, '默认部门', NULL, false); |
||||
|
-- ---------------------------- |
||||
|
-- Records of user |
||||
|
-- ---------------------------- |
||||
|
INSERT INTO "user" VALUES (1, '管理员', 'SuperAdmin', 'e10adc3949ba59abbe56e057f20f883e', 1, 'f', NULL, NULL, NULL, TRUE); |
@ -0,0 +1,54 @@ |
|||||
|
{ |
||||
|
"所属公司": "company", |
||||
|
"所属车队": "fleet", |
||||
|
"所属线路": "line", |
||||
|
"车辆编号": "vehicleNumber", |
||||
|
"车辆牌照号": "vehicleLicensePlateNumber", |
||||
|
"运营类别": "operationCategory", |
||||
|
"已使用年限": "serviceLife", |
||||
|
"发动机型号": "engineModel", |
||||
|
"车辆型号": "vehicleModel", |
||||
|
"车辆类别": "vehicleCategory", |
||||
|
"车辆状态": "vehicleStatus", |
||||
|
"入户日期": "dateOfEntry", |
||||
|
"购进日期": "purchaseDate", |
||||
|
"能耗类型": "energyConsumptionType", |
||||
|
"标台数": "numberOfStandardUnits", |
||||
|
"维保单位": "maintenanceUnit", |
||||
|
"车辆类型": "vehicleType", |
||||
|
"厂牌型号": "brandAndModel", |
||||
|
"生产厂家": "manufacturer", |
||||
|
"行驶证编号": "drivingLicenseNo", |
||||
|
"发动机编号": "engineNumber", |
||||
|
"主能耗": "mainEnergyConsumption", |
||||
|
"副能耗": "secondaryEnergyConsumption", |
||||
|
"排放标准": "emissionStandard", |
||||
|
"启用日期": "startDate", |
||||
|
"最近一次调动日期": "lastTransferDate", |
||||
|
"车长": "conductor", |
||||
|
"车宽": "vehicleWidth", |
||||
|
"车高": "carHeight", |
||||
|
"核定载客数": "approvedPassengerCapacity", |
||||
|
"车辆识别号": "vehicleIdentificationNumber", |
||||
|
"变速箱品牌": "gearboxBrand", |
||||
|
"人工洗车费": "manualCarWashingFee", |
||||
|
"劳务费": "laborCost", |
||||
|
"整备质量": "curbWeight", |
||||
|
"总质量": "totalMass", |
||||
|
"空调温度": "airConditioningTemperature", |
||||
|
"是否空调车": "airConditionedCarOrNot", |
||||
|
"开空调温度": "turnOnTheAirConditioningTemperature", |
||||
|
"功率": "power", |
||||
|
"变速器": "transmission", |
||||
|
"座位数": "seatingCapacity", |
||||
|
"空调品牌": "airConditioningBrand", |
||||
|
"座椅类型": "seatType", |
||||
|
"轮胎规格": "tireSpecifications", |
||||
|
"道路运输证号": "roadTransportCertificateNo", |
||||
|
"停放点": "parkingPoint", |
||||
|
"洗车类型": "carWashingType", |
||||
|
"免维护轮端": "maintenanceFreeWheelEnd", |
||||
|
"首保日期": "firstGuaranteeDate", |
||||
|
"整修日期": "dateOfRenovation", |
||||
|
"机动车所有人": "motorVehicleOwner" |
||||
|
} |
@ -0,0 +1,54 @@ |
|||||
|
{ |
||||
|
"company": "所属公司", |
||||
|
"fleet": "所属车队", |
||||
|
"line": "所属线路", |
||||
|
"vehicleNumber": "车辆编号", |
||||
|
"vehicleLicensePlateNumber": "车辆牌照号", |
||||
|
"operationCategory": "运营类别", |
||||
|
"serviceLife": "已使用年限", |
||||
|
"engineModel": "发动机型号", |
||||
|
"vehicleModel": "车辆型号", |
||||
|
"vehicleCategory": "车辆类别", |
||||
|
"vehicleStatus": "车辆状态", |
||||
|
"dateOfEntry": "入户日期", |
||||
|
"purchaseDate": "购进日期", |
||||
|
"energyConsumptionType": "能耗类型", |
||||
|
"numberOfStandardUnits": "标台数", |
||||
|
"maintenanceUnit": "维保单位", |
||||
|
"vehicleType": "车辆类型", |
||||
|
"brandAndModel": "厂牌型号", |
||||
|
"manufacturer": "生产厂家", |
||||
|
"drivingLicenseNo": "行驶证编号", |
||||
|
"engineNumber": "发动机编号", |
||||
|
"mainEnergyConsumption": "主能耗", |
||||
|
"secondaryEnergyConsumption": "副能耗", |
||||
|
"emissionStandard": "排放标准", |
||||
|
"startDate": "启用日期", |
||||
|
"lastTransferDate": "最近一次调动日期", |
||||
|
"conductor": "车长", |
||||
|
"vehicleWidth": "车宽", |
||||
|
"carHeight": "车高", |
||||
|
"approvedPassengerCapacity": "核定载客数", |
||||
|
"vehicleIdentificationNumber": "车辆识别号", |
||||
|
"gearboxBrand": "变速箱品牌", |
||||
|
"manualCarWashingFee": "人工洗车费", |
||||
|
"laborCost": "劳务费", |
||||
|
"curbWeight": "整备质量", |
||||
|
"totalMass": "总质量", |
||||
|
"airConditioningTemperature": "空调温度", |
||||
|
"airConditionedCarOrNot": "是否空调车", |
||||
|
"turnOnTheAirConditioningTemperature": "开空调温度", |
||||
|
"power": "功率", |
||||
|
"transmission": "变速器", |
||||
|
"seatingCapacity": "座位数", |
||||
|
"airConditioningBrand": "空调品牌", |
||||
|
"seatType": "座椅类型", |
||||
|
"tireSpecifications": "轮胎规格", |
||||
|
"roadTransportCertificateNo": "道路运输证号", |
||||
|
"parkingPoint": "停放点", |
||||
|
"carWashingType": "洗车类型", |
||||
|
"maintenanceFreeWheelEnd": "免维护轮端", |
||||
|
"firstGuaranteeDate": "首保日期", |
||||
|
"dateOfRenovation": "整修日期", |
||||
|
"motorVehicleOwner": "机动车所有人" |
||||
|
} |
@ -0,0 +1,54 @@ |
|||||
|
{ |
||||
|
"所属公司": "company", |
||||
|
"所属车队": "fleet", |
||||
|
"所属线路": "line", |
||||
|
"车辆编号": "vehicle_number", |
||||
|
"车辆牌照号": "vehicle_license_plate_number", |
||||
|
"运营类别": "operation_category", |
||||
|
"已使用年限": "service_life", |
||||
|
"发动机型号": "engine_model", |
||||
|
"车辆型号": "vehicle_model", |
||||
|
"车辆类别": "vehicle_category", |
||||
|
"车辆状态": "vehicle_status", |
||||
|
"入户日期": "date_of_entry", |
||||
|
"购进日期": "purchase_date", |
||||
|
"能耗类型": "energy_consumption_type", |
||||
|
"标台数": "number_of_standard_units", |
||||
|
"维保单位": "maintenance_unit", |
||||
|
"车辆类型": "vehicle_type", |
||||
|
"厂牌型号": "brand_and_model", |
||||
|
"生产厂家": "manufacturer", |
||||
|
"行驶证编号": "driving_license_No", |
||||
|
"发动机编号": "engine_number", |
||||
|
"主能耗": "main_energy_consumption", |
||||
|
"副能耗": "secondary_energy_consumption", |
||||
|
"排放标准": "emission_standard", |
||||
|
"启用日期": "start_date", |
||||
|
"最近一次调动日期": "last_transfer_date", |
||||
|
"车长": "conductor", |
||||
|
"车宽": "vehicle_width", |
||||
|
"车高": "car_height", |
||||
|
"核定载客数": "approved_passenger_capacity", |
||||
|
"车辆识别号": "vehicle_identification_number", |
||||
|
"变速箱品牌": "gearbox_brand", |
||||
|
"人工洗车费": "manual_car_washing_fee", |
||||
|
"劳务费": "labor_cost", |
||||
|
"整备质量": "curb_weight", |
||||
|
"总质量": "total_mass", |
||||
|
"空调温度": "air_conditioning_temperature", |
||||
|
"是否空调车": "air_conditioned_car_or_not", |
||||
|
"开空调温度": "turn_on_the_air_conditioning_temperature", |
||||
|
"功率": "power", |
||||
|
"变速器": "transmission", |
||||
|
"座位数": "seating_capacity", |
||||
|
"空调品牌": "air_conditioning_brand", |
||||
|
"座椅类型": "seat_type", |
||||
|
"轮胎规格": "tire_specifications", |
||||
|
"道路运输证号": "road_Transport_Certificate_No", |
||||
|
"停放点": "parking_point", |
||||
|
"洗车类型": "car_washing_type", |
||||
|
"免维护轮端": "maintenance_free_wheel_end", |
||||
|
"首保日期": "first_guarantee_date", |
||||
|
"整修日期": "date_of_renovation", |
||||
|
"机动车所有人": "motor_vehicle_owner" |
||||
|
} |
@ -0,0 +1,58 @@ |
|||||
|
-- 公交车辆 |
||||
|
|
||||
|
CREATE TABLE if not exists "bus_car" ( id serial not null ); |
||||
|
|
||||
|
CREATE unique index if not exists bus_car_id_uindex |
||||
|
ON bus_car (id); alter TABLE bus_car add constraint bus_car_pk primary key (id); alter TABLE bus_car add Company varchar(1024); comment |
||||
|
ON column bus_car.Company is '所属公司'; alter TABLE bus_car add Fleet varchar(1024); comment |
||||
|
ON column bus_car.Fleet is '所属车队'; alter TABLE bus_car add Line varchar(1024); comment |
||||
|
ON column bus_car.Line is '所属线路'; alter TABLE bus_car add Vehicle_Number varchar(1024); comment |
||||
|
ON column bus_car.Vehicle_Number is '车辆编号'; alter TABLE bus_car add Vehicle_License_Plate_Number varchar(1024); comment |
||||
|
ON column bus_car.Vehicle_License_Plate_Number is '车辆牌照号'; alter TABLE bus_car add Operation_Category varchar(1024); comment |
||||
|
ON column bus_car.Operation_Category is '运营类别'; alter TABLE bus_car add Service_Life varchar(1024); comment |
||||
|
ON column bus_car.Service_Life is '已使用年限'; alter TABLE bus_car add Engine_Model varchar(1024); comment |
||||
|
ON column bus_car.Engine_Model is '发动机型号'; alter TABLE bus_car add Vehicle_Model varchar(1024); comment |
||||
|
ON column bus_car.Vehicle_Model is '车辆型号'; alter TABLE bus_car add Vehicle_Category varchar(1024); comment |
||||
|
ON column bus_car.Vehicle_Category is '车辆类别'; alter TABLE bus_car add Vehicle_Status varchar(1024); comment |
||||
|
ON column bus_car.Vehicle_Status is '车辆状态'; alter TABLE bus_car add Date_Of_Entry varchar(1024); comment |
||||
|
ON column bus_car.Date_Of_Entry is '入户日期'; alter TABLE bus_car add Purchase_Date varchar(1024); comment |
||||
|
ON column bus_car.Purchase_Date is '购进日期'; alter TABLE bus_car add Energy_Consumption_Type varchar(1024); comment |
||||
|
ON column bus_car.Energy_Consumption_Type is '能耗类型'; alter TABLE bus_car add Number_Of_Standard_Units varchar(1024); comment |
||||
|
ON column bus_car.Number_Of_Standard_Units is '标台数'; alter TABLE bus_car add Maintenance_Unit varchar(1024); comment |
||||
|
ON column bus_car.Maintenance_Unit is '维保单位'; alter TABLE bus_car add Vehicle_Type varchar(1024); comment |
||||
|
ON column bus_car.Vehicle_Type is '车辆类型'; alter TABLE bus_car add Brand_And_Model varchar(1024); comment |
||||
|
ON column bus_car.Brand_And_Model is '厂牌型号'; alter TABLE bus_car add Manufacturer varchar(1024); comment |
||||
|
ON column bus_car.Manufacturer is '生产厂家'; alter TABLE bus_car add Driving_License_No varchar(1024); comment |
||||
|
ON column bus_car.Driving_License_No is '行驶证编号'; alter TABLE bus_car add Engine_Number varchar(1024); comment |
||||
|
ON column bus_car.Engine_Number is '发动机编号'; alter TABLE bus_car add Main_Energy_Consumption varchar(1024); comment |
||||
|
ON column bus_car.Main_Energy_Consumption is '主能耗'; alter TABLE bus_car add Secondary_Energy_Consumption varchar(1024); comment |
||||
|
ON column bus_car.Secondary_Energy_Consumption is '副能耗'; alter TABLE bus_car add Emission_Standard varchar(1024); comment |
||||
|
ON column bus_car.Emission_Standard is '排放标准'; alter TABLE bus_car add Start_Date varchar(1024); comment |
||||
|
ON column bus_car.Start_Date is '启用日期'; alter TABLE bus_car add Last_Transfer_Date varchar(1024); comment |
||||
|
ON column bus_car.Last_Transfer_Date is '最近一次调动日期'; alter TABLE bus_car add Conductor varchar(1024); comment |
||||
|
ON column bus_car.Conductor is '车长'; alter TABLE bus_car add Vehicle_Width varchar(1024); comment |
||||
|
ON column bus_car.Vehicle_Width is '车宽'; alter TABLE bus_car add Car_Height varchar(1024); comment |
||||
|
ON column bus_car.Car_Height is '车高'; alter TABLE bus_car add Approved_Passenger_Capacity varchar(1024); comment |
||||
|
ON column bus_car.Approved_Passenger_Capacity is '核定载客数'; alter TABLE bus_car add Vehicle_Identification_Number varchar(1024); comment |
||||
|
ON column bus_car.Vehicle_Identification_Number is '车辆识别号'; alter TABLE bus_car add Gearbox_Brand varchar(1024); comment |
||||
|
ON column bus_car.Gearbox_Brand is '变速箱品牌'; alter TABLE bus_car add Manual_Car_Washing_Fee varchar(1024); comment |
||||
|
ON column bus_car.Manual_Car_Washing_Fee is '人工洗车费'; alter TABLE bus_car add Labor_Cost varchar(1024); comment |
||||
|
ON column bus_car.Labor_Cost is '劳务费'; alter TABLE bus_car add Curb_Weight varchar(1024); comment |
||||
|
ON column bus_car.Curb_Weight is '整备质量'; alter TABLE bus_car add Total_Mass varchar(1024); comment |
||||
|
ON column bus_car.Total_Mass is '总质量'; alter TABLE bus_car add Air_Conditioning_Temperature varchar(1024); comment |
||||
|
ON column bus_car.Air_Conditioning_Temperature is '空调温度'; alter TABLE bus_car add Air_Conditioned_Car_Or_Not varchar(1024); comment |
||||
|
ON column bus_car.Air_Conditioned_Car_Or_Not is '是否空调车'; alter TABLE bus_car add Turn_On_The_Air_Conditioning_Temperature varchar(1024); comment |
||||
|
ON column bus_car.Turn_On_The_Air_Conditioning_Temperature is '开空调温度'; alter TABLE bus_car add Power varchar(1024); comment |
||||
|
ON column bus_car.Power is '功率'; alter TABLE bus_car add Transmission varchar(1024); comment |
||||
|
ON column bus_car.Transmission is '变速器'; alter TABLE bus_car add Seating_Capacity varchar(1024); comment |
||||
|
ON column bus_car.Seating_Capacity is '座位数'; alter TABLE bus_car add Air_Conditioning_Brand varchar(1024); comment |
||||
|
ON column bus_car.Air_Conditioning_Brand is '空调品牌'; alter TABLE bus_car add Seat_Type varchar(1024); comment |
||||
|
ON column bus_car.Seat_Type is '座椅类型'; alter TABLE bus_car add Tire_Specifications varchar(1024); comment |
||||
|
ON column bus_car.Tire_Specifications is '轮胎规格'; alter TABLE bus_car add Road_Transport_Certificate_No varchar(1024); comment |
||||
|
ON column bus_car.Road_Transport_Certificate_No is '道路运输证号'; alter TABLE bus_car add Parking_Point varchar(1024); comment |
||||
|
ON column bus_car.Parking_Point is '停放点'; alter TABLE bus_car add Car_Washing_Type varchar(1024); comment |
||||
|
ON column bus_car.Car_Washing_Type is '洗车类型'; alter TABLE bus_car add Maintenance_Free_Wheel_End varchar(1024); comment |
||||
|
ON column bus_car.Maintenance_Free_Wheel_End is '免维护轮端'; alter TABLE bus_car add First_Guarantee_Date varchar(1024); comment |
||||
|
ON column bus_car.First_Guarantee_Date is '首保日期'; alter TABLE bus_car add Date_Of_Renovation varchar(1024); comment |
||||
|
ON column bus_car.Date_Of_Renovation is '整修日期'; alter TABLE bus_car add Motor_Vehicle_Owner varchar(1024); comment |
||||
|
ON column bus_car.Motor_Vehicle_Owner is '机动车所有人'; |
@ -0,0 +1,144 @@ |
|||||
|
import React, { useState, useEffect } from 'react' |
||||
|
import Taro, { useDidShow } from '@tarojs/taro' |
||||
|
import { View, Picker, Input, Image } from '@tarojs/components' |
||||
|
import moment from 'moment' |
||||
|
import './index.scss' |
||||
|
import NoData from '@/components/no-data/noData' |
||||
|
import request from '@/services/request' |
||||
|
import { getReportList } from '@/services/api'; |
||||
|
import chevronDown from '../../static/img/patrolView/chevron-down.png' |
||||
|
import searchIcon from '../../static/img/patrolView/search.png' |
||||
|
import cardImg from '../../static/img/patrolView/card-img.png' |
||||
|
import patrolIcon from '../../static/img/patrolView/patrol.svg' |
||||
|
import patrolActiveIcon from '../../static/img/patrolView/patrol-active.svg' |
||||
|
import conserveIcon from '../../static/img/patrolView/conserve.svg' |
||||
|
import conserveActiveIcon from '../../static/img/patrolView/conserve-active.svg' |
||||
|
|
||||
|
function Index() { |
||||
|
const [isPatrol, setIsPatrol] = useState(true) |
||||
|
const [datePicker, setDatePicker] = useState(moment().format('YYYY-MM-DD')) |
||||
|
const [listData, setListData] = useState([]) |
||||
|
const [inputSite, setInputSite] = useState('') |
||||
|
const [page, setPage] = useState(0) |
||||
|
const [total, setTotal] = useState(0) |
||||
|
const [num, setNum] = useState(Math.random()) |
||||
|
const [systemInfo, setSystemInfo] = useState('') |
||||
|
|
||||
|
const userInfo = Taro.getStorageSync('userInfo') || {}; |
||||
|
|
||||
|
function dealError(error) { |
||||
|
Taro.showToast({ |
||||
|
title: error, |
||||
|
icon: 'none', |
||||
|
duration: 1500 |
||||
|
}); |
||||
|
throw new Error(error); |
||||
|
} |
||||
|
useEffect(() => { |
||||
|
request.get(getReportList(),{}, { hideErrorToast: true, hideLoading: true }).then(res => { |
||||
|
if (res.statusCode == 200) { |
||||
|
console.log(res); |
||||
|
setListData(res.data) |
||||
|
return res.data; |
||||
|
} else { |
||||
|
dealError(res.data.message || '请求出错'); |
||||
|
} |
||||
|
}, err => { |
||||
|
dealError(err.message || '请求出错'); |
||||
|
}); |
||||
|
}, []) |
||||
|
|
||||
|
useDidShow(() => { |
||||
|
let refresh = Taro.getStorageSync('refresh'); // 返回列表需要刷新 |
||||
|
if (refresh) { |
||||
|
setPage(0) |
||||
|
setNum(Math.random()) |
||||
|
Taro.removeStorageSync('refresh'); // 返回列表需要刷新 |
||||
|
} |
||||
|
Taro.getSystemInfo({ |
||||
|
success: (res) => { |
||||
|
// windows | mac为pc端 |
||||
|
// android | ios为手机端 |
||||
|
setSystemInfo(res.platform); |
||||
|
} |
||||
|
}); |
||||
|
}) |
||||
|
|
||||
|
const onTypeChange = bool => { |
||||
|
setIsPatrol(bool) |
||||
|
} |
||||
|
|
||||
|
const onDateChange = e => { |
||||
|
setDatePicker(e.detail.value); |
||||
|
} |
||||
|
|
||||
|
const handleConfirm = () => { |
||||
|
setPage(0) |
||||
|
setListData([]); |
||||
|
setTotal(0); |
||||
|
setNum(Math.random()) |
||||
|
} |
||||
|
|
||||
|
const handleInput = e => { |
||||
|
setInputSite(e.detail.value); |
||||
|
if (!e.detail.value) { |
||||
|
setPage(0) |
||||
|
setListData([]); |
||||
|
setTotal(0); |
||||
|
setNum(Math.random()) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
return ( |
||||
|
<View> |
||||
|
<View className='type-box'> |
||||
|
<View className='item' onClick={() => onTypeChange(true)}> |
||||
|
<Image className='type-img' src={isPatrol ? patrolActiveIcon : patrolIcon} /> |
||||
|
<View style={{color: isPatrol ? '#346FC2': '#999999'}}>巡查</View> |
||||
|
</View> |
||||
|
<View className='line'></View> |
||||
|
<View className='item' onClick={() => onTypeChange(false)}> |
||||
|
<Image className='type-img' src={isPatrol ? conserveIcon : conserveActiveIcon} /> |
||||
|
<View style={{color: isPatrol ? '#999999': '#346FC2'}}>养护</View> |
||||
|
</View> |
||||
|
</View> |
||||
|
<View className='filter-box'> |
||||
|
<View className='filter-item'> |
||||
|
<View style={{ float: 'left', marginLeft: '20rpx', color: '#333' }}>日期:</View> |
||||
|
<Picker className='picker' style={{ overflow: 'hidden', float: 'left' }} mode='date' end={(systemInfo == 'windows' || systemInfo == 'mac') ? moment().add(1, 'd').format('YYYY-MM-DD') : moment().format('YYYY-MM-DD')} onChange={onDateChange}> |
||||
|
<View className='filter-name'>{datePicker || '请选择'}</View> |
||||
|
<Image className='filter-img' src={chevronDown} /> |
||||
|
</Picker> |
||||
|
</View> |
||||
|
<View class='head-search'> |
||||
|
<Image className='search-img' src={searchIcon} /> |
||||
|
<Input class='heard-search-input' value={inputSite} placeholder='请输入场所名称' onConfirm={handleConfirm} onInput={handleInput} /> |
||||
|
</View> |
||||
|
</View> |
||||
|
|
||||
|
<View style={{ marginTop: '110px' }}> |
||||
|
{ |
||||
|
listData && listData.length > 0 ? listData && listData.map((e, index) => { |
||||
|
return ( |
||||
|
<View className='cardBox' key={index} onClick={() => handleDetail(index)}> |
||||
|
<View className='card-item' > |
||||
|
<Image className='card-bg' src={cardImg} /> |
||||
|
<View className='card-position'> |
||||
|
<View className='card-title'>{e.road}</View> |
||||
|
<View style={{ float: 'left', width: '100%', fontSize: '28rpx', marginTop: '16rpx' }}> |
||||
|
<View style={{ float: 'left' }}>填报人:</View> |
||||
|
<View style={{ float: 'left' }}>{e.user.name}</View> |
||||
|
</View> |
||||
|
<View className='card-date'>{moment(e.time).format('YYYY-MM-DD HH:mm:ss')}</View> |
||||
|
</View> |
||||
|
</View> |
||||
|
</View> |
||||
|
) |
||||
|
}) : <NoData top='400rpx'></NoData> |
||||
|
} |
||||
|
</View> |
||||
|
</View> |
||||
|
) |
||||
|
} |
||||
|
|
||||
|
export default Index |
@ -0,0 +1,139 @@ |
|||||
|
page { |
||||
|
background-color: #f6f6f6; |
||||
|
|
||||
|
.type-box { |
||||
|
position: fixed; |
||||
|
top: 0px; |
||||
|
width: 100%; |
||||
|
z-index: 100; |
||||
|
background-color: #fff; |
||||
|
height: 80px; |
||||
|
display: flex; |
||||
|
justify-content: space-around; |
||||
|
align-items: center; |
||||
|
|
||||
|
.item { |
||||
|
flex-grow: 1; |
||||
|
display: flex; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
|
||||
|
.type-img { |
||||
|
width: 40px; |
||||
|
height: 40px; |
||||
|
margin: 0 10px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.line { |
||||
|
width: 1px; |
||||
|
height: 30px; |
||||
|
background-color: #f6f6f6; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.filter-box { |
||||
|
position: fixed; |
||||
|
top: 80px; |
||||
|
display: flex; |
||||
|
width: 100%; |
||||
|
z-index: 100; |
||||
|
background: #fff; |
||||
|
color: #999999; |
||||
|
font-size: 28rpx; |
||||
|
border-top: 2rpx solid #f6f6f6; |
||||
|
|
||||
|
.filter-item { |
||||
|
overflow: hidden; |
||||
|
height: 98rpx; |
||||
|
line-height: 98rpx; |
||||
|
flex: 1; |
||||
|
|
||||
|
.filter-name { |
||||
|
float: left; |
||||
|
// margin-left: 20rpx; |
||||
|
} |
||||
|
|
||||
|
.filter-img { |
||||
|
width: 14px; |
||||
|
height: 8px; |
||||
|
float: left; |
||||
|
margin: 46rpx 20rpx 18rpx 10rpx; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.head-search { |
||||
|
width: 400rpx; |
||||
|
display: flex; |
||||
|
background: #fff; |
||||
|
padding: 10rpx 26rpx 15rpx; |
||||
|
box-sizing: border-box; |
||||
|
border-radius: 50rpx; |
||||
|
box-shadow: 0 8rpx 10rpx 0rpx #00000008; |
||||
|
border: 2rpx solid #00000011; |
||||
|
height: 68rpx; |
||||
|
line-height: 68rpx; |
||||
|
margin: 14rpx 30rpx 14rpx 0; |
||||
|
|
||||
|
.search-img { |
||||
|
width: 36rpx; |
||||
|
height: 36rpx; |
||||
|
margin-top: 5rpx; |
||||
|
} |
||||
|
|
||||
|
.heard-search-input { |
||||
|
margin-left: 26rpx; |
||||
|
font-size: 28rpx; |
||||
|
width: 100%; |
||||
|
color: #333; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.cardBox { |
||||
|
width: 690rpx; |
||||
|
margin: 40rpx auto; |
||||
|
|
||||
|
.card-item { |
||||
|
position: relative; |
||||
|
margin-bottom: 10rpx; |
||||
|
|
||||
|
.card-bg { |
||||
|
width: 100%; |
||||
|
height: 260rpx; |
||||
|
display: block; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.card-position { |
||||
|
position: absolute; |
||||
|
top: 0; |
||||
|
left: 0; |
||||
|
width: 88%; |
||||
|
padding: 16rpx 0 16rpx 36rpx; |
||||
|
overflow: hidden; |
||||
|
text-align: justify; |
||||
|
|
||||
|
.card-title { |
||||
|
font-size: 28rpx; |
||||
|
color: #333333; |
||||
|
float: left; |
||||
|
margin-bottom: 30rpx; |
||||
|
width: 470rpx; |
||||
|
text-overflow: ellipsis; |
||||
|
white-space: nowrap; |
||||
|
overflow: hidden; |
||||
|
margin-top: 8rpx; |
||||
|
} |
||||
|
|
||||
|
.card-date { |
||||
|
float: left; |
||||
|
font-size: 28rpx; |
||||
|
color: #999999; |
||||
|
margin-top: 30rpx; |
||||
|
width: 100%; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
@ -1,45 +1,92 @@ |
|||||
.page { |
.page { |
||||
height: 100vh; |
height: 100vh; |
||||
background: #F0F2F5; |
background: #f6f6f6; |
||||
box-sizing: border-box; |
display: flex; |
||||
|
flex-direction: column; |
||||
.personal { |
|
||||
padding: 20px; |
.myBox { |
||||
|
width: 90%; |
||||
.info { |
height: 300rpx; |
||||
border-radius: 10px; |
margin: 30rpx auto; |
||||
background: #fff; |
background: url('../../static/img/my/card-bg.svg') no-repeat; |
||||
height: 30vh; |
background-size: 100%; |
||||
display: flex; |
border-radius: 8rpx; |
||||
flex-direction: column; |
|
||||
align-items: center; |
.my-top { |
||||
justify-content: center; |
overflow: hidden; |
||||
|
padding: 70rpx 0 28rpx 30rpx; |
||||
.icon { |
|
||||
width: 150px; |
.my-portrait { |
||||
height: 150px; |
width: 120rpx; |
||||
border-radius: 50%; |
height: 120rpx; |
||||
|
display: block; |
||||
|
float: left; |
||||
} |
} |
||||
|
|
||||
.name { |
.my-item { |
||||
font-size: 30px; |
float: left; |
||||
margin-top: 30px; |
margin-left: 32rpx; |
||||
|
width: 70%; |
||||
|
|
||||
|
.my-username { |
||||
|
font-size: 32rpx; |
||||
|
color: #FFFFFF; |
||||
|
margin-bottom: 24rpx; |
||||
|
margin-top: 6rpx; |
||||
|
display: -webkit-box; |
||||
|
-webkit-box-orient: vertical; |
||||
|
-webkit-line-clamp: 2; |
||||
|
overflow: hidden; |
||||
|
} |
||||
|
|
||||
|
.my-phone { |
||||
|
font-size: 28rpx; |
||||
|
font-weight: bold; |
||||
|
color: #FFFFFF; |
||||
|
} |
||||
} |
} |
||||
} |
} |
||||
|
} |
||||
|
|
||||
|
.box { |
||||
|
overflow: hidden; |
||||
|
background-color: #fff; |
||||
|
width: 100%; |
||||
|
height: 92rpx; |
||||
|
line-height: 92rpx; |
||||
|
|
||||
|
.box-img { |
||||
|
width: 52rpx; |
||||
|
height: 52rpx; |
||||
|
display: block; |
||||
|
float: left; |
||||
|
padding: 20rpx 20rpx 20rpx 30rpx; |
||||
|
} |
||||
|
|
||||
|
.box-txt { |
||||
|
float: left; |
||||
|
font-size: 28rpx; |
||||
|
color: #333333; |
||||
|
} |
||||
|
|
||||
|
.img { |
||||
|
width: 52rpx; |
||||
|
height: 52rpx; |
||||
|
display: block; |
||||
|
float: right; |
||||
|
padding: 20rpx 30rpx 20rpx 0; |
||||
|
} |
||||
} |
} |
||||
|
|
||||
.logout { |
.logout { |
||||
box-sizing: border-box; |
width: 550rpx; |
||||
width: 100vw; |
height: 80rpx; |
||||
margin-top: 50px; |
line-height: 80rpx; |
||||
padding: 0 20px; |
background: #346FC2; |
||||
|
border-radius: 8rpx; |
||||
.btn { |
font-size: 28rpx; |
||||
background: #fff; |
color: #FFFFFF; |
||||
font-size: 28px; |
margin: 98rpx auto 0; |
||||
padding: 8px 0; |
text-align: center; |
||||
} |
|
||||
} |
} |
||||
} |
} |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 889 B |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 174 B |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 543 B |
After Width: | Height: | Size: 373 B |
After Width: | Height: | Size: 1.6 KiB |
@ -0,0 +1,110 @@ |
|||||
|
import React from 'react' |
||||
|
import { useEffect, useRef } from 'react'; |
||||
|
import * as echarts from 'echarts'; |
||||
|
|
||||
|
const PieChart = (props) => { |
||||
|
|
||||
|
const { width, height, data, colorList, underColorList, total, text } = props |
||||
|
|
||||
|
const chartRef = useRef(null); |
||||
|
let name = [], emptyName = [] |
||||
|
// const name = data?.map(d)
|
||||
|
data?.forEach(d => { |
||||
|
name.push(d.name) |
||||
|
emptyName.push({ |
||||
|
name: '', |
||||
|
value: d.value |
||||
|
}) |
||||
|
}) |
||||
|
useEffect(() => { |
||||
|
let chartInstance = echarts.init(chartRef.current); |
||||
|
const option = { |
||||
|
tooltip: { |
||||
|
trigger: "item", |
||||
|
}, |
||||
|
legend: { |
||||
|
orient: "vertical", |
||||
|
itemWidth: 10, |
||||
|
itemHeight: 10, |
||||
|
right: '30%', |
||||
|
top: 'center', |
||||
|
align: 'left', |
||||
|
data: name, |
||||
|
textStyle: { |
||||
|
color: "#fff", |
||||
|
}, |
||||
|
}, |
||||
|
grid: { |
||||
|
left: '10%' |
||||
|
}, |
||||
|
// title: [
|
||||
|
// {
|
||||
|
// text: text,
|
||||
|
// top: "58%",
|
||||
|
// left: '16%',
|
||||
|
// textStyle: {
|
||||
|
// color: "#E9F7FF",
|
||||
|
// fontSize: 14,
|
||||
|
// },
|
||||
|
// },
|
||||
|
// {
|
||||
|
// text: total,
|
||||
|
// top: "40%",
|
||||
|
// left: '10%',
|
||||
|
// textStyle: {
|
||||
|
// fontSize: "30",
|
||||
|
// color: "#FFFFFF",
|
||||
|
// fontFamily: "YouSheBiaoTiHei",
|
||||
|
// },
|
||||
|
// },
|
||||
|
// ],
|
||||
|
series: [ |
||||
|
{ |
||||
|
name: "底层背景", |
||||
|
type: "pie", |
||||
|
hoverAnimation: false, |
||||
|
legendHoverLink: false, |
||||
|
radius: ["60%", "72%"], |
||||
|
center: ['25%', '50%'], |
||||
|
color: underColorList, |
||||
|
label: { |
||||
|
show: false |
||||
|
}, |
||||
|
labelLine: { |
||||
|
show: false |
||||
|
}, |
||||
|
tooltip: { |
||||
|
show: false, |
||||
|
}, |
||||
|
|
||||
|
data: emptyName, |
||||
|
}, |
||||
|
{ |
||||
|
name: "已绿化里程统计", |
||||
|
type: "pie", |
||||
|
radius: ["67%", "80%"], |
||||
|
center: ['25%', '50%'], |
||||
|
color: colorList, |
||||
|
label: { |
||||
|
show: false |
||||
|
}, |
||||
|
data: data, |
||||
|
}, |
||||
|
], |
||||
|
}; |
||||
|
|
||||
|
chartInstance.setOption(option); |
||||
|
window.addEventListener('resize', () => { |
||||
|
if (chartInstance) { |
||||
|
chartInstance.resize() |
||||
|
} |
||||
|
}) |
||||
|
}, []) |
||||
|
return ( |
||||
|
<div style={{ width: width || '100%', height: height || '100%' }}> |
||||
|
<div ref={chartRef} style={{ width: '100%', height: '100%' }}></div> |
||||
|
</div> |
||||
|
|
||||
|
) |
||||
|
} |
||||
|
export default PieChart |
@ -1,14 +1,39 @@ |
|||||
import React from 'react' |
import React from 'react' |
||||
import Module from '../../../public/module' |
import Module from '../../../public/module' |
||||
|
import PieChart from '../chart/pie-chart'; |
||||
|
|
||||
|
let data = [ |
||||
|
{ value: 435, name: "县道" }, |
||||
|
{ value: 679, name: "乡道" }, |
||||
|
{ value: 848, name: "村道" }, |
||||
|
] |
||||
|
let colorList = [ |
||||
|
"rgba(7,185,254,1)", |
||||
|
"rgba(28,96,254,1)", |
||||
|
"rgba(4,251,240,1)", |
||||
|
] |
||||
|
let underColorList = [ |
||||
|
"rgba(7,185,254,0.5)", |
||||
|
"rgba(28,96,254,0.5)", |
||||
|
"rgba(4,251,240,0.5)", |
||||
|
] |
||||
const LeftBottom = () => { |
const LeftBottom = () => { |
||||
const style = { height: "31%", marginTop: "3%" } |
const style = { height: "31%", marginTop: "3%" } |
||||
return ( |
return ( |
||||
<> |
<> |
||||
<Module style={style} title={"已绿化里程统计"}> |
<Module style={style} title={"已绿化里程统计"}> |
||||
|
{/* <div ref = {chartRef} style={{ width: '100%', height: '100%' }}></div> */} |
||||
</Module> |
<PieChart |
||||
</> |
data={data} |
||||
|
width='100%' |
||||
|
height='100%' |
||||
|
text='已绿化里程' |
||||
|
total={2344.13} |
||||
|
colorList={colorList} |
||||
|
underColorList={underColorList} |
||||
|
/> |
||||
|
</Module> |
||||
|
</> |
||||
) |
) |
||||
} |
} |
||||
export default LeftBottom |
export default LeftBottom |
@ -1,30 +1,228 @@ |
|||||
import { Col, Row } from 'antd' |
import { Col, Row } from 'antd' |
||||
import React from 'react' |
import React from 'react' |
||||
import { useEffect } from 'react' |
import { useEffect, useRef } from 'react' |
||||
import Module from '../../../public/module' |
import Module from '../../../public/module' |
||||
|
import * as echarts from 'echarts'; |
||||
|
|
||||
const LeftCenter = () => { |
const LeftCenter = () => { |
||||
const style = { height: "31%", marginTop: "3%" } |
const style = { height: "31%", marginTop: "3%" } |
||||
|
const chartRef = useRef(null); |
||||
|
useEffect(() => { |
||||
|
let chartInstance = echarts.init(chartRef.current); |
||||
|
let colorArray = [ |
||||
|
{ |
||||
|
top: "#07B9FE", |
||||
|
bottom: "#10274B", |
||||
|
}, |
||||
|
{ |
||||
|
top: "#1978E5", |
||||
|
bottom: " #10274B", |
||||
|
}, |
||||
|
{ |
||||
|
top: "#1978E5", |
||||
|
bottom: "#10274B", |
||||
|
}, |
||||
|
]; |
||||
|
const option = { |
||||
|
tooltip: { |
||||
|
show: true, |
||||
|
trigger: "axis", |
||||
|
axisPointer: { |
||||
|
type: "none", |
||||
|
}, |
||||
|
}, |
||||
|
grid: { |
||||
|
left: "5%", |
||||
|
top: "12%", |
||||
|
right: "5%", |
||||
|
bottom: "8%", |
||||
|
width:'92%', |
||||
|
containLabel: true, |
||||
|
}, |
||||
|
|
||||
useEffect(() => { |
xAxis: { |
||||
|
type: "value", |
||||
|
show: true, |
||||
|
position: "bottom", |
||||
|
axisTick: { |
||||
|
show: true, |
||||
|
lineStyle: { |
||||
|
color: "rgba(176,215,255,0.25)", |
||||
|
// type: "dashed",
|
||||
|
}, |
||||
|
}, |
||||
|
axisLine: { |
||||
|
show: false, |
||||
|
lineStyle: { |
||||
|
color: "rgba(216,240,255,0.8000)", |
||||
|
}, |
||||
|
}, |
||||
|
splitLine: { |
||||
|
show: true, |
||||
|
lineStyle: { |
||||
|
color: "rgba(176,215,255,0.25)", |
||||
|
type: "dashed", |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
yAxis: [ |
||||
|
{ |
||||
|
type: "category", |
||||
|
axisTick: { |
||||
|
show: false, |
||||
|
alignWithLabel: false, |
||||
|
length: 5, |
||||
|
}, |
||||
|
splitLine: { |
||||
|
//网格线
|
||||
|
show: false, |
||||
|
}, |
||||
|
inverse: true, //排序
|
||||
|
axisLine: { |
||||
|
show: false, |
||||
|
lineStyle: { |
||||
|
color: "rgba(176,215,255,0.8)", |
||||
|
}, |
||||
|
}, |
||||
|
zlevel: 100, |
||||
|
data: ["县级可绿化里程", "乡级可绿化里程", "村级可绿化里程"], |
||||
|
}, |
||||
|
{ |
||||
|
type: "category", |
||||
|
axisTick: { |
||||
|
show: false, |
||||
|
alignWithLabel: false, |
||||
|
length: 5, |
||||
|
}, |
||||
|
splitLine: { |
||||
|
//网格线
|
||||
|
show: false, |
||||
|
}, |
||||
|
axisLabel: { |
||||
|
show: true, |
||||
|
backgroundColor: { |
||||
|
image: 'assets/images/quanju/kelvhua_bdbg.png', |
||||
|
}, |
||||
|
width: 70, |
||||
|
height: 22, |
||||
|
color: '#D8F0FF', |
||||
|
margin:50, |
||||
|
verticalAlign: 'middle', |
||||
|
align: 'center', |
||||
|
textShadowColor:'#1AD0FF', |
||||
|
textShadowBlur:6, |
||||
|
fontSize:14 |
||||
|
// formatter:(f) =>{console.log('f:',f);}
|
||||
|
}, |
||||
|
inverse: true, //排序
|
||||
|
axisLine: { |
||||
|
show: false, |
||||
|
lineStyle: { |
||||
|
color: "rgba(176,215,255,0.8)", |
||||
|
}, |
||||
|
|
||||
}, []) |
}, |
||||
|
data: [60, 132, 89], |
||||
|
}, |
||||
|
], |
||||
|
series: [ |
||||
|
{ |
||||
|
name: '背景', |
||||
|
type: "bar", |
||||
|
barWidth: 3, |
||||
|
barGap: "100%", |
||||
|
barCategoryGap: "50%", |
||||
|
color: "#15356E", |
||||
|
data: [150, 150, 150, 150], |
||||
|
tooltip: { |
||||
|
show: false, |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
name: "", |
||||
|
type: "bar", |
||||
|
zlevel: 1, |
||||
|
barWidth: 3, |
||||
|
barGap: "-100%", |
||||
|
barCategoryGap: "50%", |
||||
|
data: [60, 132, 89], |
||||
|
label: { |
||||
|
show: true, |
||||
|
position: 'right', // 位置
|
||||
|
fontSize: 12, |
||||
|
lineHeight: 13, |
||||
|
distance: -2, |
||||
|
verticalAlign: "middle", |
||||
|
formatter: [ |
||||
|
'{a| }', |
||||
|
].join(''), // 这里是数据展示的时候显示的数据
|
||||
|
rich: { |
||||
|
a: { |
||||
|
backgroundColor: { |
||||
|
image: 'assets/images/quanju/circle2.png' |
||||
|
}, |
||||
|
width: 15, |
||||
|
height: 15, |
||||
|
align: 'left', |
||||
|
verticalAlign: "center", |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
itemStyle: { |
||||
|
normal: { |
||||
|
show: true, |
||||
|
color: function (params) { |
||||
|
return { |
||||
|
type: "linear", |
||||
|
colorStops: [ |
||||
|
{ |
||||
|
offset: 0, |
||||
|
color: colorArray[params.dataIndex].bottom, |
||||
|
}, |
||||
|
{ |
||||
|
offset: 1, |
||||
|
color: colorArray[params.dataIndex].top, |
||||
|
}, |
||||
|
|
||||
return ( |
|
||||
<> |
|
||||
<Module style={style} title={"可绿化里程统计"}> |
|
||||
|
|
||||
<Row align='middle' style={{ padding: 10 }}> |
], |
||||
<Col span={15}> |
// globalCoord: false,
|
||||
<img src='assets/images/quanju/kelvhua_icon.png' alt='icon' /> |
}; |
||||
<span style={{ color: '#C2EEFF', marginLeft: 5 }}>可绿化里程总数</span> |
}, |
||||
</Col> |
barBorderRadius: 70, |
||||
<Col span={9} style={{ fontSize: 28, fontFamily: 'YouSheBiaoTiHei', color: '#fff' }}>1234.123</Col> |
borderWidth: 0, |
||||
</Row> |
borderColor: "#333", |
||||
<div>图表</div> |
}, |
||||
|
}, |
||||
|
emphasis: { |
||||
|
disabled: true //禁止移入柱子改变颜色
|
||||
|
} |
||||
|
}, |
||||
|
], |
||||
|
}; |
||||
|
chartInstance.setOption(option); |
||||
|
window.addEventListener('resize',() =>{ |
||||
|
if(chartInstance) { |
||||
|
chartInstance.resize() |
||||
|
} |
||||
|
}) |
||||
|
}, []); |
||||
|
|
||||
</Module> |
return ( |
||||
</> |
<> |
||||
) |
<Module style={style} title={"可绿化里程统计"}> |
||||
|
|
||||
|
<Row align='middle' style={{ padding: '10px 3% 0px 15px' }}> |
||||
|
<Col span={15}> |
||||
|
<img src='assets/images/quanju/kelvhua_icon.png' alt='icon' /> |
||||
|
<span style={{ color: '#C2EEFF', marginLeft: 5 }}>可绿化里程总数</span> |
||||
|
</Col> |
||||
|
<Col span={9} style={{ fontSize: 24, fontFamily: 'YouSheBiaoTiHei', color: '#fff' }}>1234</Col> |
||||
|
</Row> |
||||
|
<div ref={chartRef} style={{ height: "14.5vh", width: "96%" }}></div> |
||||
|
|
||||
|
</Module> |
||||
|
</> |
||||
|
) |
||||
} |
} |
||||
export default LeftCenter |
export default LeftCenter |
@ -1,14 +1,42 @@ |
|||||
import React from 'react' |
import React from 'react' |
||||
import Module from '../../../public/module' |
import Module from '../../../public/module' |
||||
|
import PieChart from '../chart/pie-chart'; |
||||
|
|
||||
|
let data = [ |
||||
|
{ value: 435, name: "道路" }, |
||||
|
{ value: 679, name: "桥梁" }, |
||||
|
{ value: 848, name: "涵洞" }, |
||||
|
{ value: 666, name: "其他" }, |
||||
|
] |
||||
|
let colorList = [ |
||||
|
"rgba(7,185,254,1)", |
||||
|
"rgba(28,96,254,1)", |
||||
|
"rgba(4,251,240,1)", |
||||
|
"rgba(255,194,20,1)" |
||||
|
] |
||||
|
let underColorList = [ |
||||
|
"rgba(7,185,254,0.5)", |
||||
|
"rgba(28,96,254,0.5)", |
||||
|
"rgba(4,251,240,0.5)", |
||||
|
"rgba(255,194,20,0.5)" |
||||
|
] |
||||
const RightBottom = () => { |
const RightBottom = () => { |
||||
const style = { height: "31%", marginTop: "3%" } |
const style = { height: "31%", marginTop: "3%" } |
||||
return ( |
return ( |
||||
<> |
<> |
||||
<Module style={style} title={"养护完成情况"}> |
<Module style={style} title={"养护完成情况"}> |
||||
|
{/* <div ref = {chartRef} style={{ width: '100%', height: '100%' }}></div> */} |
||||
</Module> |
<PieChart |
||||
</> |
data={data} |
||||
|
width='100%' |
||||
|
height='100%' |
||||
|
text='养护总数' |
||||
|
total={2344.13} |
||||
|
colorList={colorList} |
||||
|
underColorList={underColorList} |
||||
|
/> |
||||
|
</Module> |
||||
|
</> |
||||
) |
) |
||||
} |
} |
||||
export default RightBottom |
export default RightBottom |
@ -1,8 +1,13 @@ |
|||||
import React from 'react' |
import React from 'react' |
||||
|
import Left from './left' |
||||
|
import Right from './right' |
||||
|
|
||||
const Operation = () => { |
const Operation = () => { |
||||
return ( |
return ( |
||||
<>运营</> |
<div style={{ display: 'flex', width: '100%',height: '100%',justifyContent: 'space-between' }}> |
||||
|
<Left /> |
||||
|
<Right /> |
||||
|
</div> |
||||
) |
) |
||||
} |
} |
||||
export default Operation |
export default Operation |
@ -0,0 +1,180 @@ |
|||||
|
import React, { useMemo, useState, useEffect } from 'react'; |
||||
|
import { SearchOutlined } from '@ant-design/icons'; |
||||
|
import { Col, Row, Input, Tree } from 'antd' |
||||
|
import Module from '../../public/module' |
||||
|
|
||||
|
const { Search } = Input; |
||||
|
const x = 3; |
||||
|
const y = 2; |
||||
|
const z = 1; |
||||
|
const defaultData = []; |
||||
|
|
||||
|
const generateData = (_level, _preKey, _tns) => { |
||||
|
const preKey = _preKey || '0'; |
||||
|
const tns = _tns || defaultData; |
||||
|
const children = []; |
||||
|
|
||||
|
for (let i = 0; i < x; i++) { |
||||
|
const key = `${preKey}-${i}`; |
||||
|
tns.push({ |
||||
|
title: key, |
||||
|
key, |
||||
|
}); |
||||
|
|
||||
|
if (i < y) { |
||||
|
children.push(key); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
if (_level < 0) { |
||||
|
return tns; |
||||
|
} |
||||
|
|
||||
|
const level = _level - 1; |
||||
|
children.forEach((key, index) => { |
||||
|
tns[index].children = []; |
||||
|
return generateData(level, key, tns[index].children); |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
generateData(z); |
||||
|
const dataList = []; |
||||
|
|
||||
|
const generateList = (data) => { |
||||
|
for (let i = 0; i < data.length; i++) { |
||||
|
const node = data[i]; |
||||
|
const { key } = node; |
||||
|
dataList.push({ |
||||
|
key, |
||||
|
title: key, |
||||
|
}); |
||||
|
|
||||
|
if (node.children) { |
||||
|
generateList(node.children); |
||||
|
} |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
generateList(defaultData); |
||||
|
|
||||
|
const getParentKey = (key, tree) => { |
||||
|
let parentKey; |
||||
|
|
||||
|
for (let i = 0; i < tree.length; i++) { |
||||
|
const node = tree[i]; |
||||
|
|
||||
|
if (node.children) { |
||||
|
if (node.children.some((item) => item.key === key)) { |
||||
|
parentKey = node.key; |
||||
|
} else if (getParentKey(key, node.children)) { |
||||
|
parentKey = getParentKey(key, node.children); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
return parentKey; |
||||
|
}; |
||||
|
|
||||
|
const Left = () => { |
||||
|
|
||||
|
useEffect(() => { |
||||
|
|
||||
|
}, []) |
||||
|
|
||||
|
const style = { height: "97%", marginTop: "3%" } |
||||
|
const [expandedKeys, setExpandedKeys] = useState([]); |
||||
|
const [searchValue, setSearchValue] = useState(''); |
||||
|
const [autoExpandParent, setAutoExpandParent] = useState(true); |
||||
|
|
||||
|
const onExpand = (newExpandedKeys) => { |
||||
|
setExpandedKeys(newExpandedKeys); |
||||
|
setAutoExpandParent(false); |
||||
|
}; |
||||
|
|
||||
|
const onChange = (e) => { |
||||
|
const { value } = e.target; |
||||
|
const newExpandedKeys = dataList |
||||
|
.map((item) => { |
||||
|
if (item.title.indexOf(value) > -1) { |
||||
|
return getParentKey(item.key, defaultData); |
||||
|
} |
||||
|
|
||||
|
return null; |
||||
|
}) |
||||
|
.filter((item, i, self) => item && self.indexOf(item) === i); |
||||
|
setExpandedKeys(newExpandedKeys); |
||||
|
setSearchValue(value); |
||||
|
setAutoExpandParent(true); |
||||
|
}; |
||||
|
|
||||
|
const treeData = useMemo(() => { |
||||
|
const loop = (data) => |
||||
|
data.map((item) => { |
||||
|
const strTitle = item.title; |
||||
|
const index = strTitle.indexOf(searchValue); |
||||
|
const beforeStr = strTitle.substring(0, index); |
||||
|
const afterStr = strTitle.slice(index + searchValue.length); |
||||
|
const title = |
||||
|
index > -1 ? ( |
||||
|
<span> |
||||
|
{beforeStr} |
||||
|
<span className="site-tree-search-value">{searchValue}</span> |
||||
|
{afterStr} |
||||
|
</span> |
||||
|
) : ( |
||||
|
<span>{strTitle}</span> |
||||
|
); |
||||
|
|
||||
|
if (item.children) { |
||||
|
return { |
||||
|
title, |
||||
|
key: item.key, |
||||
|
children: loop(item.children), |
||||
|
}; |
||||
|
} |
||||
|
|
||||
|
return { |
||||
|
title, |
||||
|
key: item.key, |
||||
|
}; |
||||
|
}); |
||||
|
|
||||
|
return loop(defaultData); |
||||
|
}, [searchValue]); |
||||
|
return ( |
||||
|
<div style={{ display: 'flex', flexDirection: 'column', width: "23%", height: "100%", marginLeft: "1%" }}> |
||||
|
<Module style={style} title={"公交车辆信息"}> |
||||
|
<div style={{ width: '90%', height: '96', margin: '2% 5%', }}> |
||||
|
<div style={{ border: '1px solid rgba(10, 114, 255, 1)', backgroundColor: 'rgba(10, 114, 255, 0.1)' }}> |
||||
|
<img src='assets/images/quanju/search.png' style={{ width: '5%', margin: '0 1.5% 1% 3.5%' }} /> |
||||
|
<Input |
||||
|
style={{ |
||||
|
width: '90%', |
||||
|
background: 'none', |
||||
|
backgroundColor: 'none', |
||||
|
color: 'rgba(216, 240, 255, 0.8)', |
||||
|
border: 'none', |
||||
|
boxShadow: 'none', |
||||
|
}} |
||||
|
placeholder="请输入车牌号" |
||||
|
onChange={onChange} |
||||
|
/> |
||||
|
</div> |
||||
|
<Tree |
||||
|
rootStyle={{ |
||||
|
background: 'none', |
||||
|
borderColor: 'none', |
||||
|
color: 'rgba(255, 255, 255, 1)' |
||||
|
}} |
||||
|
onExpand={onExpand} |
||||
|
expandedKeys={expandedKeys} |
||||
|
autoExpandParent={autoExpandParent} |
||||
|
treeData={treeData} |
||||
|
/> |
||||
|
</div> |
||||
|
</Module> |
||||
|
</div> |
||||
|
); |
||||
|
}; |
||||
|
|
||||
|
export default Left; |
@ -0,0 +1,9 @@ |
|||||
|
import React from 'react' |
||||
|
|
||||
|
const Right = () => { |
||||
|
return ( |
||||
|
<div style={{ display: 'flex', flexDirection: 'column', width: "23%", height: "100%", marginRight: "1%", }}>555555555 |
||||
|
</div> |
||||
|
) |
||||
|
} |
||||
|
export default Right |