From 649c7efb1314e773559c334c81cbea385bdb49cc Mon Sep 17 00:00:00 2001 From: wangxiang <1827945911@qq.com> Date: Fri, 9 Sep 2022 07:07:35 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=91=20=E4=BA=A4=E6=8E=A5=E7=82=B9?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=9C=B0=E5=9B=BE=E6=95=B0=E6=8D=AE=E4=B9=9F?= =?UTF-8?q?=E8=83=BD=E5=B1=95=E7=A4=BA=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AMap/src/AMapDesigner/index.vue | 10 +++++++--- src/components/AMap/src/components/MapPointModal.vue | 1 - 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/AMap/src/AMapDesigner/index.vue b/src/components/AMap/src/AMapDesigner/index.vue index a63417a..713a93a 100644 --- a/src/components/AMap/src/AMapDesigner/index.vue +++ b/src/components/AMap/src/AMapDesigner/index.vue @@ -481,10 +481,12 @@ function complete () { if (map) { map.on('complete', () => { - mapState.loading = false; - mapState.first = true; setMapDataJson(mapProps.options); handleSetCourierUserList(); + nextTick(() => { + mapState.loading = false; + mapState.first = true; + }); }); } } @@ -509,7 +511,7 @@ }); watch([() => mapState.mapData.sendOrderId, () => mapState.mapData.sendOrderTaskType], ([sendOrderIdValue,sendOrderTaskTypeValue], [sendOrderIdOldValue, sendOrderTaskTypeOldValue]) => { - if (!sendOrderIdValue || !sendOrderTaskTypeValue) return; + if (!sendOrderIdValue || !sendOrderTaskTypeValue || !mapState.first) return false; if (isEmpty(mapState.mapData.mapTask)) { mapState.mapData.mapTask.push({ name: '系统创建:发单任务', @@ -706,6 +708,7 @@ } }); setTableData(mapState.mapData.mapTask); + console.log(1111111111); drawMapNavigate(concat(mapState.mapData.mapLogisticPoint, mapState.mapData.mapTaskPresetLogisticPoint)); }); } @@ -744,6 +747,7 @@ /** 绘制地图导航路线 */ function drawMapNavigate(points: MapLogisticPoint[] = []) { + console.log(222222222222); if (isEmpty(points) && mapState.mapData.courierUserId && mapState.mapData.courierLng && mapState.mapData.courierLat) throw console.warn('检查到当前起点数据为空或标记点集合为空,请选择起点!'); points = points.filter(item => item.lng && item.lat); diff --git a/src/components/AMap/src/components/MapPointModal.vue b/src/components/AMap/src/components/MapPointModal.vue index 313d576..8e70d1d 100644 --- a/src/components/AMap/src/components/MapPointModal.vue +++ b/src/components/AMap/src/components/MapPointModal.vue @@ -95,7 +95,6 @@ onEnd: ({ newIndex, oldIndex }) => { const currRow = state.mapData.mapLogisticPoint?.splice(oldIndex!, 1)[0]; state.mapData.mapLogisticPoint?.splice(newIndex!, 0, currRow); - AMapDesignerEl.value?.drawMapNavigate(concat(state.mapData.mapLogisticPoint, state.mapData.mapTaskPresetLogisticPoint)); }, ghostClass: 'ghostGrid' });