From 9083f88541ee4ff2f859d32cf0ad9981c3d41291 Mon Sep 17 00:00:00 2001 From: dzl <863620989@qq.com> Date: Tue, 20 May 2025 14:30:52 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AA=91=E8=A1=8C=E8=BD=A8=E8=BF=B9=E5=B1=95?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ebike-operate/src/assets/endPoint.png | Bin 0 -> 2420 bytes ebike-operate/src/assets/startPoint.png | Bin 0 -> 1939 bytes .../RefundApplication/CyclingOrder/index.vue | 2 + .../orderinfo/CyclingTrajectory.vue | 139 +++++++++++------- .../orderinfo/OrderInfo.vue | 2 + 5 files changed, 90 insertions(+), 53 deletions(-) create mode 100644 ebike-operate/src/assets/endPoint.png create mode 100644 ebike-operate/src/assets/startPoint.png diff --git a/ebike-operate/src/assets/endPoint.png b/ebike-operate/src/assets/endPoint.png new file mode 100644 index 0000000000000000000000000000000000000000..9be56637bbe3d1d50ab8441c3f9810a8291fee6c GIT binary patch literal 2420 zcmV-)35)iLP)Px;E=fc|RCr$PS__aA)fGMWbE*$Bvk0*u1$QW#$c(1nTHgV6@S z6#xnVoF(9dBsxwk4@h7aBvlq5_I4gpYrH9N4v}IZu)48$dRDQKV=<;*lUgy=R6v?oYl0x$}%w1t=hV1%a(ynz>eEbYmc zq3S(vZVjUY5g=hiZUN)h05=aRv4(gERK2uXt(D;I zulu3T>XVS%p()}AbO^NsNQlT&0FT!p%)k`3hVhpTKw)dhv6I2iEIE(DICBvA+@+9H zXM^WF?Kwm?2Lc{4WbA$&GA#jYVZ|5->ky`6)YGLIW#FB=A$trw&z&ZeLd<&r`0(Gb zTXgVB-yohqdkq=ws6*%~fbZd-{`4n51b*x{=j9`IRDiDQ;+m)II~2U_HCJ3ZKzACr z3Q#SqG6Lp$iVh(4^l{(_>|TR`_dm#>pg|=NYo61h^&^4hsiw~qi!BUuMb1IDq}f$$aJS@XcJW_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['startTime'], endTime: record['endTime'], + ridePoint: record['ridePoint'], + returnPoint: record['returnPoint'], } formModelOrderInfo.value.openForm(params); } else { diff --git a/ebike-operate/src/views/form/cyclingorderrefund/orderinfo/CyclingTrajectory.vue b/ebike-operate/src/views/form/cyclingorderrefund/orderinfo/CyclingTrajectory.vue index eb61ff0..4de8537 100644 --- a/ebike-operate/src/views/form/cyclingorderrefund/orderinfo/CyclingTrajectory.vue +++ b/ebike-operate/src/views/form/cyclingorderrefund/orderinfo/CyclingTrajectory.vue @@ -5,23 +5,30 @@ > - + +
+ +
@@ -44,11 +51,42 @@ const props = defineProps({ }); const mapRef = ref(null); -const center = ref(config.map.center); -const control = ref({ scale: {}, zoom: { position: 'topRight', }, }); -const options = ref({ renderOptions: { renderOptions: true, } }); -const editorRef = ref(null); -const points = ref([]) +const polylineRef = ref(null); +const center = ref({ lat: 0, lng: 0 }); +const zoom = ref(16); + +const control = ref({ + scale: {}, + zoom: { + position: 'topRight', + }, +}); + +const geometriesLine = ref([]); +const geometriesPoint = ref([]); + +const styles = ref({ + polyline: { + color: '#2C68FF', // 线填充色 + borderWidth: 1, // 边线宽度 + borderColor: '#004EE1', // 边线颜色 + }, + markerStart: { + width: 40, + height: 40, + src: '/src/assets/startPoint.png' + }, + markerEnd: { + width: 40, + height: 40, + src: '/src/assets/endPoint.png' + }, +}); + +const options = ref({ + zIndex: 1, +}); + const onMapInited = () => { if (mapRef.value) { const windowWidth = window.innerWidth; @@ -71,47 +109,42 @@ const onMapInited = () => { return } if (res.data) { - points.value = res.data - loadGeometry(); + center.value = { lat: props.orderParams.ridePoint.split(",")[1], lng: props.orderParams.ridePoint.split(",")[0] } + const trajectory = [{ lat: props.orderParams.ridePoint.split(",")[1], lng: props.orderParams.ridePoint.split(",")[0] }]; + res.data.map(item => { + trajectory.push({ lat: item['latitude'], lng: item['longitude'] }) + }) + trajectory.push({ lat: props.orderParams.returnPoint.split(",")[1], lng: props.orderParams.returnPoint.split(",")[0] }) + geometriesLine.value = [ + { + id: 'polyline1', + styleId: 'polyline', + paths: trajectory, + properties: { + title: 'polyline', + }, + } + ] + + geometriesPoint.value = [ + { + styleId: 'markerStart', position: { + lat: parseFloat(props.orderParams.ridePoint.split(",")[1]), + lng: parseFloat(props.orderParams.ridePoint.split(",")[0]) + } + }, + { + styleId: 'markerEnd', position: { + lat: parseFloat(props.orderParams.returnPoint.split(",")[1]), + lng: parseFloat(props.orderParams.returnPoint.split(",")[0]) + } + }, + ] } }); } } }; -const loadGeometry = () => { - - if (points.value.length > 0) { - const circleGeometries = [];//editorRef.value.circle.getGeometries(); - if (circleGeometries.length > 0) { - circleGeometries.forEach((geometry) => { - editorRef.value.circle.remove(geometry); // 删除之前的图形数据 - }); - } - const trajectory = points.value.map(item => { - return new TMap.LatLng(item['latitude'], item['longitude']) - }) - const shapeId = getGUID() - circleGeometries.push({ - id: shapeId, - style: new TMap.PolylineStyle({ - 'color': '#blue', //线填充色 - 'width': 6, //折线宽度 - 'borderWidth': 5, //边线宽度 - 'borderColor': 'red', //边线颜色 - 'lineCap': 'round' //线端头方式 - }), - paths: trajectory, - center: new TMap.LatLng(points.value[0].latitude, points.value[0].longitude), - }); - editorRef.value.circle.setGeometries(circleGeometries); - //设置视野范围 - const mycircle = editorRef.value.circle.getGeometryById(shapeId); - const boundary = TMap.geometry.computeBoundingRectangle(mycircle.paths); - mapRef.value.map.fitBounds(boundary, { - padding: 100, // 设置地图边界的内边距 - }); - } -} diff --git a/ebike-operate/src/views/form/cyclingorderrefund/orderinfo/OrderInfo.vue b/ebike-operate/src/views/form/cyclingorderrefund/orderinfo/OrderInfo.vue index a7c0e8f..d3e22ff 100644 --- a/ebike-operate/src/views/form/cyclingorderrefund/orderinfo/OrderInfo.vue +++ b/ebike-operate/src/views/form/cyclingorderrefund/orderinfo/OrderInfo.vue @@ -43,6 +43,8 @@ const openForm = (params = {}) => { orderParams.value['ebikeCode'] = params['ebikeCode']; orderParams.value['startTime'] = params['startTime']; orderParams.value['endTime'] = params['endTime']; + orderParams.value['ridePoint'] = params['ridePoint']; + orderParams.value['returnPoint'] = params['returnPoint']; } };