Showing
1 changed file
with
7 additions
and
8 deletions
| @@ -48,9 +48,8 @@ | @@ -48,9 +48,8 @@ | ||
| 48 | @cancel="handleCancel" | 48 | @cancel="handleCancel" |
| 49 | centered | 49 | centered |
| 50 | > | 50 | > |
| 51 | - <div> | ||
| 52 | - | ||
| 53 | - <Spin :spinning="spinning"> | 51 | + <div> |
| 52 | + <Spin :spinning="spinning"> | ||
| 54 | <Form :label-col="labelCol" :colon="false" :rules="rules" :model="positionState"> | 53 | <Form :label-col="labelCol" :colon="false" :rules="rules" :model="positionState"> |
| 55 | <Row :gutter="20" class="mt-4"> | 54 | <Row :gutter="20" class="mt-4"> |
| 56 | <Col :span="20"> | 55 | <Col :span="20"> |
| @@ -89,8 +88,8 @@ | @@ -89,8 +88,8 @@ | ||
| 89 | </Row> | 88 | </Row> |
| 90 | </Form> | 89 | </Form> |
| 91 | <div ref="wrapRef" style="height: 300px; width: 90%" class="ml-6"></div> | 90 | <div ref="wrapRef" style="height: 300px; width: 90%" class="ml-6"></div> |
| 92 | - </div> | ||
| 93 | - </Spin> | 91 | + </Spin> |
| 92 | + </div> | ||
| 94 | </Modal> | 93 | </Modal> |
| 95 | <DeptDrawer @register="registerModal" @success="handleSuccess" /> | 94 | <DeptDrawer @register="registerModal" @success="handleSuccess" /> |
| 96 | </div> | 95 | </div> |
| @@ -226,7 +225,7 @@ | @@ -226,7 +225,7 @@ | ||
| 226 | }; | 225 | }; |
| 227 | 226 | ||
| 228 | // 地图的弹框 | 227 | // 地图的弹框 |
| 229 | - const spinning = ref<boolean>(false); | 228 | + const spinning = ref<boolean>(true); |
| 230 | const visible = ref(false); | 229 | const visible = ref(false); |
| 231 | const selectPosition = async () => { | 230 | const selectPosition = async () => { |
| 232 | visible.value = true; | 231 | visible.value = true; |
| @@ -246,6 +245,7 @@ | @@ -246,6 +245,7 @@ | ||
| 246 | positionState.latitude = res?.center.lat || '30.54855093076791'; | 245 | positionState.latitude = res?.center.lat || '30.54855093076791'; |
| 247 | var pt = new BMap.Point(positionState.longitude, positionState.latitude); | 246 | var pt = new BMap.Point(positionState.longitude, positionState.latitude); |
| 248 | getAddrByPoint(pt); | 247 | getAddrByPoint(pt); |
| 248 | + spinning.value = false; | ||
| 249 | }); | 249 | }); |
| 250 | } else { | 250 | } else { |
| 251 | await getLocation.getCurrentPosition(function (res) { | 251 | await getLocation.getCurrentPosition(function (res) { |
| @@ -254,13 +254,12 @@ | @@ -254,13 +254,12 @@ | ||
| 254 | positionState.latitude = res?.latitude || '30.54855093076791'; | 254 | positionState.latitude = res?.latitude || '30.54855093076791'; |
| 255 | var pt = new BMap.Point(positionState.longitude, positionState.latitude); | 255 | var pt = new BMap.Point(positionState.longitude, positionState.latitude); |
| 256 | getAddrByPoint(pt); | 256 | getAddrByPoint(pt); |
| 257 | + spinning.value = false; | ||
| 257 | }); | 258 | }); |
| 258 | } | 259 | } |
| 259 | } catch (err) { | 260 | } catch (err) { |
| 260 | console.log(err, 'err'); | 261 | console.log(err, 'err'); |
| 261 | createMessage.error('获取定位失败'); | 262 | createMessage.error('获取定位失败'); |
| 262 | - } finally { | ||
| 263 | - spinning.value = false; | ||
| 264 | } | 263 | } |
| 265 | initMap(positionState.longitude, positionState.latitude); | 264 | initMap(positionState.longitude, positionState.latitude); |
| 266 | } else { | 265 | } else { |