jihongshun
2025-09-17 cafc98632e2df166a25976d9c1cd77a94efaa3a9
项目创建默认参数 变倍
已修改2个文件
119 ■■■■ 文件已修改
src/views/system/flightRouteSimulation/index.vue 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/project/components/addPorjectDialog.vue 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/flightRouteSimulation/index.vue
@@ -5,10 +5,19 @@
    file:mr-4 file:py-2 file:px-4
    file:rounded-md file:border-0
    file:text-sm file:font-semibold
    file:bg-blue-50 file:text-blue-700
    file:bg-blue-50 file:text-blue-700
    hover:file:bg-blue-100">
    <CesiumMap style="height: 790px;" :showAnimation = true :showCesiumCompass = true :cesiumId="'cesiumContainer'"></CesiumMap>
    <CesiumMap style="height: 324px;width: 576px;" :showAnimation = false :showCesiumCompass = false :showCrosshair = true :cesiumId="'cesiumContainerYY'" class="eagleye"></CesiumMap>
    <!-- 使用 ElementUI 的 Slider 替代变倍轴 -->
    <div class="zoom-ui-container">
       <!-- 中间黄色准星框 -->
    <div
      class="reticle"
      :style="{ width: boxWidth + 'px', height: boxHeight + 'px' }"
    ></div>
      <!-- 左下角倍率信息 -->
    </div>
   </div>
</template>
@@ -103,7 +112,7 @@
      roll: 0,           // 相机的 roll (滚转)
      aspectRatio: 1.0,  // 纵横比
      color: '#FF0000',  // 视锥体颜色
      id: 'frustumOutline',
      id: 'frustumOutline',//视锥体ID
      positionProperty : new Cesium.SampledPositionProperty(),
      orientation : new Cesium.SampledProperty(Cesium.Quaternion),//无人机朝向
      // sztOrientation : new Cesium.SampledProperty(Cesium.Quaternion),//云台朝向
@@ -111,11 +120,23 @@
      holderPitchProperty : new Cesium.SampledProperty(Number),//云台朝向pitch
      holderRollProperty : new Cesium.SampledProperty(Number),//云台朝向roll
      holderZoomProperty : new Cesium.SampledProperty(Number),//变倍
      currentZoom:1,
      filename :''
      currentZoom:1,//视锥体变倍
      filename :'',//文件名字 然后读取时间轴日期
      zoomRatio: 1,//默认变倍数
      minZoom: 1,//最小变倍
      maxZoom: 56,//最大变倍
      baseBoxSize: 576,//默认box宽度
    }
  },
  mounted() {
  },
  computed: {
    boxWidth() {
      return this.baseBoxSize / this.zoomRatio;
    },
    boxHeight() {
      return (this.baseBoxSize *(9/16)) / this.zoomRatio; // 高度保持 4:3 比例
    }
  },
  methods: {
    async handleKMZUpload(event) {
@@ -196,6 +217,15 @@
      setTimeout(()=>{
        this.showGZ()
      },1000)
      this.flyPoint()
    },
    flyPoint(){
      let lon = this.waypoints[0].lng
      let lat = this.waypoints[0].lat
      let height  = 5000
      window['cesiumContainer'].viewer.camera.flyTo({
        destination : Cesium.Cartesian3.fromDegrees(lon, lat, height)
    });
    },
    // 读取文件为ArrayBuffer
    readFileAsArrayBuffer(file) {
@@ -563,6 +593,7 @@
        const  holderZoom = this.holderZoomProperty.getValue(currentTime)
        if(holderZoom) {
          this.currentZoom = holderZoom ==1? 1 :(holderZoom  /23.76237623)
          this.zoomRatio = holderZoom ==1? 1 :(holderZoom  /23.76237623)
        }
        
        this.updateFrustum();
@@ -615,6 +646,44 @@
.eagleye{
  position: absolute;
  right: 30px;
  bottom: 50px;
  bottom: 55px;
  border: 1px solid white;
}
</style>
<style scoped>
.zoom-ui-container {
  width: 576px;
  height: 324px;
  position: absolute;
  right: 30px;
  bottom: 55px;
  /* background-color: red; */
  z-index: 9;
}
/* 黄色准星框 */
.reticle {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 2px dashed orange;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
/* ElementUI 滑块样式区域 */
.zoom-bar-slider {
  position: absolute;
  right: 20px;
  top: 50px;
  height: 200px;
}
/* 左下角倍率标签 */
.zoom-info {
  position: absolute;
  bottom: 35px;
  left: 340px;
}
</style>
src/views/system/project/components/addPorjectDialog.vue
@@ -123,7 +123,7 @@
          </el-select>
        </el-form-item>
         <el-form-item label="完成动作" prop="finishAction">
          <el-select v-model="ruleForm.finishAction" placeholder="起飞爬升">
          <el-select v-model="ruleForm.finishAction" placeholder="完成动作">
            <el-option v-for="dict in dji_finish_type" :key="dict.value" :label="dict.label"
              :value="dict.value"></el-option>
          </el-select>
@@ -238,8 +238,13 @@
        deviceId:null,
        drawer:false,
        ruleForm:{
          autoFlightSpeed:14,
          globalTransitionalSpeed:15
          flyToWaylineMode:'safely',
          autoFlightSpeed:10,
          globalTransitionalSpeed:10,
          globalWaypointTurnMode:'toPointAndStopWithDiscontinuityCurvature',
          mappingHeadingMode:'followWayline',
          gimbalPitchMode:'usePointSetting',
          finishAction:'goHome',
        },
        
    }
@@ -716,6 +721,7 @@
            height: airPoint.height,
            isStartAndEndPoint: false,
            actions:airPoint.children[0].actions || [],
            waypointName: airPoint.label,
            coordinatePointReq: {
                height: airPoint.children[0].height,
                latitude:airPoint.children[0].latitude,
@@ -738,20 +744,20 @@
      this.ruleForm.routePointList = routePointList
      console.log(this.ruleForm)
      console.log('生成航线')
      buildKmz(this.ruleForm).then(res=>{
        if(res.code == 200) {
           this.$message({
              message: '生成航线成功',
              type: 'success'
            })
            const link = document.createElement('a');
            link.href = res.msg;  // 设置下载链接
            // link.download = 'filename.ext';  // 可选:指定文件名
            document.body.appendChild(link);  // 将链接添加到 DOM
            link.click();  // 模拟点击下载
            document.body.removeChild(link);  // 下载后移除链接
        }
      })
      // buildKmz(this.ruleForm).then(res=>{
      //   if(res.code == 200) {
      //      this.$message({
      //         message: '生成航线成功',
      //         type: 'success'
      //       })
      //       const link = document.createElement('a');
      //       link.href = res.msg;  // 设置下载链接
      //       // link.download = 'filename.ext';  // 可选:指定文件名
      //       document.body.appendChild(link);  // 将链接添加到 DOM
      //       link.click();  // 模拟点击下载
      //       document.body.removeChild(link);  // 下载后移除链接
      //   }
      // })
    },
    lineSet(){
      this.drawer =true