jihongshun
7 天以前 d8662fba10c3aab8366f46a216b9c2fc615901d2
设备增加海拔字段
已修改2个文件
21 ■■■■■ 文件已修改
src/views/system/device/components/deviceDialog.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/project/components/addPorjectDialog.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/device/components/deviceDialog.vue
@@ -20,6 +20,9 @@
            <el-input v-model="form.face" placeholder="请输入朝向"  style="width:90%;"/>
            <i class="el-icon-map-location" @click="gettiles3dCam" title="预览"></i>
          </el-form-item>
          <el-form-item label="海拔高度" prop="altitude">
            <el-input v-model="form.altitude" placeholder="请输入海拔高度" />
          </el-form-item>
        </el-form>
      </template>
      <template slot="cesium">
@@ -85,13 +88,13 @@
            this.$refs.cesiumMapSelctPoint.showPickPoint({
              longitude: +this.form.longitude,
              latitude: +this.form.latitude,
              height: +this.form.height,
              deviceHeight: +this.form.deviceHeight,
            })
            console.log(this.modelListData)
            let url = this.modelListData.filter(item=>item.id == this.form.modelId)[0].modelRoute
            console.log(url)
            this.modelUrl = url
            const position = Cesium.Cartesian3.fromDegrees(this.form.longitude, this.form.latitude, this.form.height);
            const position = Cesium.Cartesian3.fromDegrees(this.form.longitude, this.form.latitude, this.form.deviceHeight);
            console.log(position)
            // 设置模型方向(可选)
            let model = viewer.entities.getById("MyModel");
@@ -131,18 +134,19 @@
      console.log(data)
      this.$set(this.form, 'longitude', data.longitude)
      this.$set(this.form, 'latitude', data.latitude)
      this.$set(this.form, 'height', data.altitude)
      this.$set(this.form, 'deviceHeight', data.altitude)
      this.$refs.form.validateField('longitude')
      this.$refs.form.validateField('latitude')
      this.$refs.form.validateField('height')
      this.$refs.form.validateField('deviceHeight')
    },
    submitForm() {
      this.$refs["form"].validate(valid => {
        console.log(this.form)
        this.form.longitude = Number(this.form.longitude)
        this.form.latitude = Number(this.form.latitude)
        this.form.height = Number(this.form.height)
        this.form.deviceHeight = Number(this.form.deviceHeight)
        this.form.face = Number(this.form.face)
        this.form.altitude = Number(this.form.altitude) || 0
        if (valid) {
          this.$api.save('tower/device/', 'id', Object.assign({}, this.form)).then(res => {
            this.form = {}
@@ -185,13 +189,13 @@
        this.$message.error("请输入纬度");
        return;
      }
      if (!this.form.height) {
      if (!this.form.deviceHeight) {
        this.$message.error("请输入高度");
        return;
      }
      //动态经纬度朝向 加载模型位置预览
      // const position = Cesium.Cartesian3.fromDegrees(0, 0, 0);
      const position = Cesium.Cartesian3.fromDegrees(this.form.longitude, this.form.latitude, this.form.height);
      const position = Cesium.Cartesian3.fromDegrees(this.form.longitude, this.form.latitude, this.form.deviceHeight);
      // 设置模型方向(可选)
      // const heading = Cesium.Math.toRadians(135); // 朝东南方向
      let model = viewer.entities.getById("MyModel");
src/views/system/project/components/addPorjectDialog.vue
@@ -100,7 +100,7 @@
    },
    flyToLocal(row){
      console.log(row)
       const position = Cesium.Cartesian3.fromDegrees(row.longitude,row.latitude, row.altitude);
       const position = Cesium.Cartesian3.fromDegrees(row.longitude,row.latitude, row.deviceHeight);
      // 设置模型方向(可选)
      const heading = Cesium.Math.toRadians(row.face); // 朝东南方向
@@ -412,6 +412,7 @@
            routePointIndex: routePointList.length,
            longitude: airPoint.longitude,
            latitude: airPoint.latitude,
            height: airPoint.height,
            isStartAndEndPoint: false,
          });
        });