From 814935649f6f2010e56a2c5a039d1c166f820195 Mon Sep 17 00:00:00 2001 From: wangxiang <1827945911@qq.com> Date: Tue, 31 May 2022 16:55:46 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=88=20=E7=BC=96=E5=86=99=E9=AB=98?= =?UTF-8?q?=E5=BE=B7=E5=9C=B0=E5=9B=BE=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kicc-ui/src/components/AMap/src/Amap.vue | 32 +++++++++++++++++++++--- kicc-ui/tsconfig.json | 2 +- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/kicc-ui/src/components/AMap/src/Amap.vue b/kicc-ui/src/components/AMap/src/Amap.vue index fb05dd86..020eaa6e 100644 --- a/kicc-ui/src/components/AMap/src/Amap.vue +++ b/kicc-ui/src/components/AMap/src/Amap.vue @@ -67,6 +67,7 @@ let largeHospitalMarkerCluster; let smallHospitalMarkerCluster; let takeSpecimenCluster; + let scanTakeSpecimenCircleRange; const instance = getCurrentInstance(); const mapState = reactive({ loading: false, @@ -124,8 +125,9 @@ AMapLoader.load({ key: mapConfig.amapKey, version: '2.0', - plugins: ['AMap.MarkerCluster', 'AMap.RectangleEditor', 'AMap.Driving'] + plugins: ['AMap.MarkerCluster', 'AMap.Driving'] }).then(AMap => { + // 创建地图实例 map = new AMap.Map(instance.refs.mapview, mapConfig.options); map.plugin(['AMap.ToolBar', 'AMap.MapType', 'AMap.ControlBar', 'AMap.Scale'], () => { @@ -292,6 +294,21 @@ map: map, panel: instance.refs.mapPanel }); + + // 扫描收样员园形范围 + scanTakeSpecimenCircleRange = new AMap.Circle({ + radius: 2000, + borderWeight: 3, + strokeColor: '#3600ff', + strokeOpacity: 0.2, + strokeWeight: 6, + fillOpacity: 0.4, + strokeStyle: 'dashed', + strokeDasharray: [8, 8], + fillColor: '#1791fc', + zIndex: 50 + }); + // 根据起终点经纬度规划驾车导航路线 driving.search(new AMap.LngLat(112.913864, 28.295114), new AMap.LngLat(112.918119, 28.282891), { waypoints:[new AMap.LngLat(112.919165, 28.289924)] @@ -347,8 +364,17 @@ // 查找当前下级医院数据 const smallHospitalMap = smallHospitalMapList.find(item => item.id == value); if (smallHospitalMap) { - // 定位当前发单点位置 - map.setZoomAndCenter(18, [smallHospitalMap.lng, smallHospitalMap.lat]); + // 绘制20公里,园形矢量图,并且检测这个范围内是否有收样员 + map.remove(scanTakeSpecimenCircleRange); + scanTakeSpecimenCircleRange.setCenter([smallHospitalMap.lng, smallHospitalMap.lat]); + map.add(scanTakeSpecimenCircleRange); + map.setFitView([ scanTakeSpecimenCircleRange ]); + // 查找园圈内的收样员 + const specimenLngLat = new AMap.LngLat(116.403984,39.907535); + + if (scanTakeSpecimenCircleRange.contains()) { + + } } else { throw '查找不到发单点数据,请检查发单点!'; diff --git a/kicc-ui/tsconfig.json b/kicc-ui/tsconfig.json index 8ba5933c..041136f3 100644 --- a/kicc-ui/tsconfig.json +++ b/kicc-ui/tsconfig.json @@ -28,7 +28,7 @@ "noImplicitAny": false, "skipLibCheck": true, "types": ["vite/client"], - "typeRoots": ["./node_modules/@types/", "./types"], + "typeRoots": ["./node_modules/@types/", "./types", "./node_modules/@amap/amap-jsapi-loader/src"], "removeComments": true, "paths": { "/@/*": ["src/*"],