Browse Source

🚀 修复地图完成回调地图存在不会触发

master
wangxiang 3 years ago
parent
commit
7f1a4f57fd
  1. 12
      src/components/AMap/src/AMapDesigner/index.vue
  2. 4
      src/views/common/mapLogistic/index.vue

12
src/components/AMap/src/AMapDesigner/index.vue

@ -495,12 +495,10 @@
/** 地图创建完成(动画关闭) */ /** 地图创建完成(动画关闭) */
function complete () { function complete () {
if (map) { if (map) {
map.on('complete', () => { setMapDataJson(mapProps.options);
setMapDataJson(mapProps.options); handleSetCourierUserList();
handleSetCourierUserList(); mapState.loading = false;
mapState.loading = false; mapState.first = true;
mapState.first = true;
});
} }
} }
@ -512,7 +510,7 @@
if (!mapProps.toolbarControl) mapState.toggleOperatePanelClass.toolbarHeight = 0; if (!mapProps.toolbarControl) mapState.toggleOperatePanelClass.toolbarHeight = 0;
}); });
watch(toRefs(mapProps).options, (newValue) => { watch(toRefs(mapProps).options, (newValue) => {
if (mapState.first) { if (mapState.first && newValue) {
setMapDataJson(newValue); setMapDataJson(newValue);
handleSetCourierUserList(); handleSetCourierUserList();
} }

4
src/views/common/mapLogistic/index.vue

@ -2,9 +2,9 @@
<div> <div>
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<template #toolbar> <template #toolbar>
<a-button type="primary" <!--<a-button type="primary"
@click="() => {}" @click="() => {}"
>预览</a-button> >预览</a-button>-->
<a-button type="primary" <a-button type="primary"
@click="handleAdd" @click="handleAdd"
>新增</a-button> >新增</a-button>

Loading…
Cancel
Save