无人机管理后台前端(已迁走)
张含笑
2025-09-19 e1cd733f46c68c7063345d27cb6481ce48ef0f6e
feat:调整高度
1 files modified
73 ■■■■ changed files
src/views/resource/components/spotDetails.vue 73 ●●●● patch | view | raw | blame | history
src/views/resource/components/spotDetails.vue
@@ -399,14 +399,55 @@
}
// 更新上一个和这一个信息
// function updateMapSpotInfo(nowEntity) {
//   const nowData = nowEntity.customInfo;
//   if (!nowEntity) return;
//   if (nowEntity.customInfo.id === lastEntity?.customInfo.id) return;
//   // 设置新的
//   nowEntity.polygon.material = Cesium.Color.RED.withAlpha(0);
//   nowEntity.polyline.material = Cesium.Color.RED;
//   // 重置上一个
//   if (lastEntity) {
//     const lastData = lastEntity.customInfo;
//     const originalFillColor =
//       lastData.is_exception === 2
//         ? Cesium.Color.RED.withAlpha(0.5)
//         : Cesium.Color.YELLOW.withAlpha(0.5);
//     const originalOutlineColor =
//       lastData.is_exception == 2 ? Cesium.Color.RED : Cesium.Color.YELLOW;
//     lastEntity.polygon.material = originalFillColor;
//     lastEntity.polygon.outlineColor = originalOutlineColor;
//     lastEntity.polyline.material = originalOutlineColor;
//   }
//   lastEntity = nowEntity;
//   const numbersWithCommas = nowData.dkfw.match(/\d+(\.\d+)?/g);
//   if (numbersWithCommas) {
//     // 解析经纬度数组
//     const groupedArr = numbersWithCommas.reduce((acc, val, index, src) => {
//       if (index % 2 === 0) acc.push(src.slice(index, index + 2));
//       return acc;
//     }, []);
//     const polygonCenter = getCenterPoint(groupedArr);
//     // 相机定位
//     homeViewer.value.scene.camera.setView({
//       destination: Cesium.Cartesian3.fromDegrees(
//         Number(polygonCenter.lng),
//         Number(polygonCenter.lat),
//         1500
//       ),
//     });
//   }
// }
function updateMapSpotInfo(nowEntity) {
  const nowData = nowEntity.customInfo;
  if (!nowEntity) return;
  if (nowEntity.customInfo.id === lastEntity?.customInfo.id) return;
  // 设置新的
  nowEntity.polygon.material = Cesium.Color.RED.withAlpha(0);
  nowEntity.polyline.material = Cesium.Color.RED;
  // 重置上一个
  if (lastEntity) {
    const lastData = lastEntity.customInfo;
    const originalFillColor =
@@ -415,7 +456,6 @@
        : Cesium.Color.YELLOW.withAlpha(0.5);
    const originalOutlineColor =
      lastData.is_exception == 2 ? Cesium.Color.RED : Cesium.Color.YELLOW;
    lastEntity.polygon.material = originalFillColor;
    lastEntity.polygon.outlineColor = originalOutlineColor;
    lastEntity.polyline.material = originalOutlineColor;
@@ -423,23 +463,20 @@
  lastEntity = nowEntity;
  const numbersWithCommas = nowData.dkfw.match(/\d+(\.\d+)?/g);
  if (numbersWithCommas) {
    // 解析经纬度数组
    const groupedArr = numbersWithCommas.reduce((acc, val, index, src) => {
      if (index % 2 === 0) acc.push(src.slice(index, index + 2));
      return acc;
    }, []);
    const polygonCenter = getCenterPoint(groupedArr);
    // 相机定位
    homeViewer.value.scene.camera.setView({
      destination: Cesium.Cartesian3.fromDegrees(
        Number(polygonCenter.lng),
        Number(polygonCenter.lat),
        1500
      ),
    const positionsData = [];
    for (let i = 0; i < numbersWithCommas.length; i += 2) {
      const lon = Number(numbersWithCommas[i]);
      const lat = Number(numbersWithCommas[i + 1]);
      positionsData.push([lon, lat, 10]);
    }
    flyVisual({
      positionsData: positionsData,
      viewer: homeViewer.value,
      multiple: 15,
      // pitch: -90
    });
  }
}
// 清空选中的数据
const clearSelect = () => {