diff --git a/.env.local b/.env.local index 4549ca24..66161d67 100644 --- a/.env.local +++ b/.env.local @@ -4,9 +4,9 @@ NODE_ENV=development VITE_DEV=true # 请求路径 -# VITE_BASE_URL='http://10.10.7.132:48080' +VITE_BASE_URL='http://10.10.7.132:48080' # VITE_BASE_URL='http://10.10.100.15:48080' -VITE_BASE_URL='http://10.10.5.5:48080' +# VITE_BASE_URL='http://10.10.5.5:48080' # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务 VITE_UPLOAD_TYPE=server diff --git a/src/api/map/map.ts b/src/api/map/map.ts index 8a2682b9..1bb1cdce 100644 --- a/src/api/map/map.ts +++ b/src/api/map/map.ts @@ -255,3 +255,11 @@ export const getHouseLocationTypeList = async (params) => { params }) } + +//获取检测点距离 +export const getCheckDistance = async (params) => { + return await request.get({ + url: `/system/position-map-item/getCheckDistance`, + params + }) +} diff --git a/src/views/mapPage/realTimeMap/editMap.vue b/src/views/mapPage/realTimeMap/editMap.vue index 43356c08..36dd60cf 100644 --- a/src/views/mapPage/realTimeMap/editMap.vue +++ b/src/views/mapPage/realTimeMap/editMap.vue @@ -2171,15 +2171,16 @@ const generateDetectionPoint = async () => { state.contextMenu.currentItem const newId = await MapApi.getNodeId() - const distance = 2 / Number(imgBgObj.resolution) //距离米 + const distance = await MapApi.getCheckDistance() + const distanceValue = Number(distance) / Number(imgBgObj.resolution) //距离米 // 将弧度转换为角度(用于理解,实际计算仍使用弧度) const angle = locationYaw * (180 / Math.PI) // 根据角度和距离计算新的坐标 // 正东方向为0度,正北方向为90度,正西方向为180度,正南方向为-90度 - const newX = Number((Number(locationX) + distance * Math.cos(locationYaw)).toFixed(2)) - const newY = Number((Number(locationY) - distance * Math.sin(locationYaw)).toFixed(2)) + const newX = Number((Number(locationX) + distanceValue * Math.cos(locationYaw)).toFixed(2)) + const newY = Number((Number(locationY) - distanceValue * Math.sin(locationYaw)).toFixed(2)) //先校验这个点是否存在,比较一位小数 const isDuplicate = state.allMapPointInfo.some(