liu
9 小时以前 c4b0e80dc52f75c54f671b2471c9fb1b6da25062
src/views/hrm/attendance/rule/modules/location-map-picker.vue
@@ -267,31 +267,6 @@
  }
}
function handleCurrentLocation() {
  if (!navigator.geolocation) {
    message.warning('当前浏览器不支持定位');
    return;
  }
  loading.value = true;
  navigator.geolocation.getCurrentPosition(
    async (position) => {
      const [longitude, latitude] = wgs84ToBd09(
        position.coords.longitude,
        position.coords.latitude,
      );
      await selectBaiduLocation(longitude, latitude);
      loading.value = false;
    },
    () => {
      message.warning(
        '定位失败,请开启浏览器定位权限(非 localhost 环境需使用 HTTPS)',
      );
      loading.value = false;
    },
    { enableHighAccuracy: true, maximumAge: 0, timeout: 15_000 },
  );
}
async function initializeMap() {
  if (!hasMapConfig.value || !mapContainer.value) {
    return;
@@ -384,7 +359,6 @@
        @press-enter="handleSearch"
      />
      <Button :loading="loading" @click="handleSearch">搜索地址</Button>
      <Button @click="handleCurrentLocation">定位到当前位置</Button>
    </div>
    <div
      ref="mapContainer"