Browse Source

互联网-社管一张图-定位,坐标为空点击确定时,提示“坐标异常!”,应该改下提示语(坐标为空时,提示语需求让改成:请输入坐标)

CzRger 1 year ago
parent
commit
c34bcbc9e5
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/views/gis/layout/tools/position.vue

+ 5 - 1
src/views/gis/layout/tools/position.vue

@@ -169,7 +169,11 @@ export default defineComponent({
       const lonS = state.cusTransfer.format.isEast ? 1 : -1
       const latS = state.cusTransfer.format.isSouth ? -1 : 1
       const coor = [lonS * convertGPSToXY(state.cusTransfer.format[state.cusTransfer.tab].lon1, state.cusTransfer.format[state.cusTransfer.tab].lon2, state.cusTransfer.format[state.cusTransfer.tab].lon3), latS * convertGPSToXY(state.cusTransfer.format[state.cusTransfer.tab].lat1, state.cusTransfer.format[state.cusTransfer.tab].lat2, state.cusTransfer.format[state.cusTransfer.tab].lat3)]
-      props.mapFunc.toLocation({position: coor})
+      if (coor[0] && coor[1]) {
+        props.mapFunc.toLocation({position: coor})
+      } else {
+        ElMessage.warning('请输入坐标!')
+      }
     }
     onMounted(() => {
       if (props.transfer) {