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' });