|
@ -54,13 +54,20 @@ async function roadState (ctx) { |
|
|
bridgeCount: bridgeRes.length, |
|
|
bridgeCount: bridgeRes.length, |
|
|
// 涵洞数量
|
|
|
// 涵洞数量
|
|
|
culvertCount: 0, |
|
|
culvertCount: 0, |
|
|
// 施工统计
|
|
|
// 施工统计 已建
|
|
|
construction: constructionYear.map(year => { |
|
|
construction: constructionYear.map(year => { |
|
|
return { |
|
|
return { |
|
|
year, |
|
|
year, |
|
|
count: 0, |
|
|
count: 0, |
|
|
} |
|
|
} |
|
|
}), |
|
|
}), |
|
|
|
|
|
// 施工统计 改建
|
|
|
|
|
|
constructionRebuild: constructionYear.map(year => { |
|
|
|
|
|
return { |
|
|
|
|
|
year, |
|
|
|
|
|
count: 0, |
|
|
|
|
|
} |
|
|
|
|
|
}), |
|
|
// 乡镇统计
|
|
|
// 乡镇统计
|
|
|
townRoad: { |
|
|
townRoad: { |
|
|
|
|
|
|
|
@ -128,7 +135,7 @@ async function roadState (ctx) { |
|
|
if (corBuildConstruction) { |
|
|
if (corBuildConstruction) { |
|
|
corBuildConstruction.count += Number(r.chainageMileage) || 0 |
|
|
corBuildConstruction.count += Number(r.chainageMileage) || 0 |
|
|
} |
|
|
} |
|
|
let corReBuildConstruction = roadState.construction.find(item => item.year === rebuildYear) |
|
|
let corReBuildConstruction = roadState.constructionRebuild.find(item => item.year === rebuildYear) |
|
|
if (corReBuildConstruction) { |
|
|
if (corReBuildConstruction) { |
|
|
corReBuildConstruction.count += Number(r.chainageMileage) || 0 |
|
|
corReBuildConstruction.count += Number(r.chainageMileage) || 0 |
|
|
} |
|
|
} |
|
|