Browse Source

建设点位根据道路起点

dev
巴林闲侠 1 year ago
parent
commit
f04c791378
  1. 9
      web/client/src/sections/quanju/containers/footer/leadership/left/echarts/leftbottomecharts.js
  2. 21
      web/client/src/sections/quanju/containers/public/olMap.js

9
web/client/src/sections/quanju/containers/footer/leadership/left/echarts/leftbottomecharts.js

@ -17,9 +17,12 @@ const Leftbottomecharts = (props) => {
setCount(res.payload.data.construction.map((item, index) => { setCount(res.payload.data.construction.map((item, index) => {
let count = item.count let count = item.count
listData.forEach((s, i) => { listData.forEach((s, i) => {
if (s == '2022' && i == index) { if (s == '2021' && i == index) {
count = 78.7 count = 78.7
} else if (s == '2023' && i == index) { } else if (s == '2022' && i == index) {
// count = 78.7
}
else if (s == '2023' && i == index) {
count = 89.7 count = 89.7
} }
}) })
@ -151,7 +154,7 @@ const Leftbottomecharts = (props) => {
shadowBlur: 10, shadowBlur: 10,
}, },
}, },
data: flag ? count.map(v=>v.toFixed(3)) : value, data: flag ? count.map(v => v.toFixed(3)) : value,
}, },
], ],
}; };

21
web/client/src/sections/quanju/containers/public/olMap.js

@ -497,6 +497,8 @@ const OlMap = (props) => {
let renderIndex = 0 let renderIndex = 0
for (let res of roadRes) { for (let res of roadRes) {
const corData = projectList[renderIndex] const corData = projectList[renderIndex]
const corProjectRoadReport = roadProjectList.find(d => d.project_name == corData.entryName)
let roadPointPosition = []
if (res) { if (res) {
if (res.status == 200 && res.body && res.body.code == 1) { if (res.status == 200 && res.body && res.body.code == 1) {
const data = res.body.data const data = res.body.data
@ -563,13 +565,25 @@ const OlMap = (props) => {
selectStyle: { stroke: { width: 8, color: '#9933FF' } }, selectStyle: { stroke: { width: 8, color: '#9933FF' } },
layerName: 'geometry_build_road_' + renderIndex layerName: 'geometry_build_road_' + renderIndex
}); });
//
console.log(olMap, olMap.olLayer)
let feat = olMap.olLayer.geometryLayers['geometry_build_road_' + renderIndex].getSource().getFeatures()
if (feat.length > 0) {
let start = feat[0].getGeometry().getFirstCoordinate()
// let end = feat[feat.length - 1].getGeometry().getLastCoordinate()
console.log(start);
roadPointPosition = start
}
} }
} }
} }
} }
if (corData.roadCodeStart) { if (
roadPointPosition.length
// || corData.roadCodeStart
) {
// 画对应的巡查上报的点 // 画对应的巡查上报的点
const corProjectRoadReport = roadProjectList.find(d => d.project_name == corData.entryName)
if (corProjectRoadReport) { if (corProjectRoadReport) {
const d = corProjectRoadReport const d = corProjectRoadReport
olMap.addGeometryLayer({ olMap.addGeometryLayer({
@ -587,7 +601,8 @@ const OlMap = (props) => {
olMap.addOverlay('pointClickOpen', { olMap.addOverlay('pointClickOpen', {
id: 'pointClickOpen', id: 'pointClickOpen',
offset: [0, 4], // 偏移 offset: [0, 4], // 偏移
position: [d.longitude, d.latitude], // 坐标 // position: [d.longitude, d.latitude], // 坐标
position: roadPointPosition,
// position: [115.944220000000, 28.545380000000], // position: [115.944220000000, 28.545380000000],
autoPan: true, autoPan: true,
autoPanMargin: 100, autoPanMargin: 100,

Loading…
Cancel
Save