From 0590a8644d48b1fd05cb8bdb0a7bb68d4ef0d89b Mon Sep 17 00:00:00 2001 From: wangxiang <1827945911@qq.com> Date: Wed, 25 May 2022 17:12:30 +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 | 46 +++++++++++++++++------- kicc-ui/src/components/AMap/src/data.ts | 19 +++++----- 2 files changed, 44 insertions(+), 21 deletions(-) diff --git a/kicc-ui/src/components/AMap/src/Amap.vue b/kicc-ui/src/components/AMap/src/Amap.vue index 78c741c8..fb05dd86 100644 --- a/kicc-ui/src/components/AMap/src/Amap.vue +++ b/kicc-ui/src/components/AMap/src/Amap.vue @@ -18,15 +18,25 @@ :wrapperCol="{ style: { width: '100%', 'margin-right': '10px' } }" :model="mapState.modelRef" > + + + - + @@ -56,7 +66,7 @@ let map; let largeHospitalMarkerCluster; let smallHospitalMarkerCluster; - let specimenMarkerCluster; + let takeSpecimenCluster; const instance = getCurrentInstance(); const mapState = reactive({ loading: false, @@ -67,9 +77,10 @@ }, toggleStatus: true, modelRef: { + smallHospitalTakeId: '', largeHospitalId: '', smallHospitalId: '', - specimenMarkerId: '' + takeSpecimenId: '' } }); const AForm = Form; @@ -79,12 +90,10 @@ title: '地图任务列表', rowKey: 'id', dataSource: [{ + id: '001', taskName: '测试任务1' },{ - taskName: '测试任务2' - },{ - taskName: '测试任务2' - },{ + id: '002', taskName: '测试任务2' }], columns, @@ -234,7 +243,7 @@ smallHospitalMarkerCluster?.setData(smallHospitalPoints); // 收样员标记点 - specimenMarkerCluster = new AMap.MarkerCluster(map, [], { + takeSpecimenCluster = new AMap.MarkerCluster(map, [], { gridSize: 80, maxZoom: 14, renderMarker(ctx) { @@ -268,7 +277,7 @@ marker.setOffset(new AMap.Pixel(-18, -10)); } }); - specimenMarkerCluster.on('click', ctx => { + takeSpecimenCluster.on('click', ctx => { const { lnglat } = ctx; map.setZoomAndCenter(18, lnglat); }); @@ -276,7 +285,7 @@ lnglat: [v.lng, v.lat], ...v })); - specimenMarkerCluster?.setData(specimenPoints); + takeSpecimenCluster?.setData(specimenPoints); // 构造路线导航类 const driving = new AMap.Driving({ @@ -333,6 +342,19 @@ } } + /** 处理收取标本收养员搜索 */ + function handleTakeSpecimenSearch (value) { + // 查找当前下级医院数据 + const smallHospitalMap = smallHospitalMapList.find(item => item.id == value); + if (smallHospitalMap) { + // 定位当前发单点位置 + map.setZoomAndCenter(18, [smallHospitalMap.lng, smallHospitalMap.lat]); + + } else { + throw '查找不到发单点数据,请检查发单点!'; + } + } +