liu
12 小时以前 c4b0e80dc52f75c54f671b2471c9fb1b6da25062
feat(hrm): 地图选点移除“定位到当前位置”

打卡地点统一由管理员搜索地址或点击地图选定,避免误用操作者当前位置。

Co-Authored-By: Claude <noreply@anthropic.com>
(cherry picked from commit 66c73d42d76d27dc687b6f9665ea473c979b69fa)
已修改1个文件
26 ■■■■■ 文件已修改
src/views/hrm/attendance/rule/modules/location-map-picker.vue 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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"