Commit 9535d5fa0346db8da9824affeb6333418b241860

Authored by loveumiko
1 parent fd4941e9

fix: 修改设备位置自动获取当前位置和产品的样式修改

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