From bcb67f336c2b352177884b8db6decc3fcf382bb0 Mon Sep 17 00:00:00 2001 From: jihongshun <1151753686@qq.com> Date: 星期四, 11 九月 2025 16:58:13 +0800 Subject: [PATCH] 航线模拟 差视锥体的head值和时间轴 --- src/views/system/project/components/addPorjectDialog.vue | 199 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 193 insertions(+), 6 deletions(-) diff --git a/src/views/system/project/components/addPorjectDialog.vue b/src/views/system/project/components/addPorjectDialog.vue index 9a082c5..659c0fd 100644 --- a/src/views/system/project/components/addPorjectDialog.vue +++ b/src/views/system/project/components/addPorjectDialog.vue @@ -12,6 +12,7 @@ <div class="chooseModel"> <div class="fontJust">璁惧鍒楄〃</div> <el-button @click="addDevice"> 鏂板</el-button> + <el-button @click="lineSet"> 鑸嚎璁剧疆</el-button> <el-table :data="tableData" max-height = '180' @@ -66,6 +67,73 @@ </el-dialog> <chooseDeviceDialog v-if="showDevice" @cancel ='cancel' @dealChooseArr="dealChooseArr" ></chooseDeviceDialog> <chooseModelDialog v-if="showModel" @cancelModel ='cancelModel' @receiveModel="receiveModel" :deviceId="deviceId"></chooseModelDialog> + <el-drawer + title="鑸嚎璁剧疆" + :visible.sync="drawer" + direction="rtl"> + <el-form :model="ruleForm" ref="ruleForm" label-width="100px" class="demo-ruleForm"> + <el-form-item label="璧烽鐖崌" prop="flyToWaylineMode"> + <el-select v-model="ruleForm.flyToWaylineMode" placeholder="璧烽鐖崌"> + <el-option v-for="dict in dji_fly_type" :key="dict.value" :label="dict.label" + :value="dict.value"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鍏ㄥ眬鑸嚎閫熷害" prop="autoFlightSpeed"> + <div class="speed-control"> + <el-input-number + v-model="ruleForm.autoFlightSpeed" + :min="1" + :max="15" + :step="1" + controls-position="both" + @change="handleChangeAutoFlightSpeed" + /> + <span class="unit">m/s</span> + </div> + </el-form-item> + <el-form-item label="璧烽閫熷害" prop="globalTransitionalSpeed"> + <div class="speed-control"> + <el-input-number + v-model="ruleForm.globalTransitionalSpeed" + :min="1" + :max="15" + :step="1" + controls-position="both" + @change="handleChangeGlobalTransitionalSpeed" + /> + <span class="unit">m/s</span> + </div> + </el-form-item> + <el-form-item label="鑸偣绫诲瀷" prop="globalWaypointTurnMode"> + <el-select v-model="ruleForm.globalWaypointTurnMode" placeholder="鑸偣绫诲瀷"> + <el-option v-for="dict in dji_global_waypoint_turn_mode" :key="dict.value" :label="dict.label" + :value="dict.value"></el-option> + </el-select> + </el-form-item> + <el-form-item label="椋炶鍣ㄥ亸鑸妯″紡" prop="mappingHeadingMode"> + <el-select v-model="ruleForm.mappingHeadingMode" placeholder="椋炶鍣ㄥ亸鑸妯″紡"> + <el-option v-for="dict in dji_mapping_heading_mode" :key="dict.value" :label="dict.label" + :value="dict.value"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鑸偣闂翠簯鍙颁刊浠拌鎺у埗妯″紡" prop="gimbalPitchMode"> + <el-select v-model="ruleForm.gimbalPitchMode" placeholder="椋炶鍣ㄥ亸鑸妯″紡"> + <el-option v-for="dict in dji_gimbal_pitch_mode" :key="dict.value" :label="dict.label" + :value="dict.value"></el-option> + </el-select> + </el-form-item> + <el-form-item label="瀹屾垚鍔ㄤ綔" prop="finishAction"> + <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> + </el-form-item> + <el-form-item> + <el-button type="primary" @click="submitForm('ruleForm')">淇濆瓨</el-button> + <el-button @click="resetForm('ruleForm')">鍙栨秷</el-button> + </el-form-item> + </el-form> + </el-drawer> </div> </template> <script> @@ -81,6 +149,80 @@ chooseDeviceDialog, chooseModelDialog }, + props: { + model_dji_execute_typetype: { + type: Array, + default() { + return [] + } + }, + dji_execute_type: { + type: Array, + default() { + return [] + } + }, + dji_finish_type: { + type: Array, + default() { + return [] + } + }, + dji_fly_type: { + type: Array, + default() { + return [] + } + }, + dji_exitlost_type: { + type: Array, + default() { + return [] + } + }, + dji_drone_value_type: { + type: Array, + default() { + return [] + } + }, + dji_template_type: { + type: Array, + default() { + return [] + } + }, + dji_execute_height_type: { + type: Array, + default() { + return [] + } + }, + dji_auto_flight_speed: { + type: Array, + default() { + return [] + } + }, + dji_global_waypoint_turn_mode: { + type: Array, + default() { + return [] + } + }, + dji_mapping_heading_mode: { + type: Array, + default() { + return [] + } + }, + dji_gimbal_pitch_mode: { + type: Array, + default() { + return [] + } + }, + }, data(){ return{ dialogVisible :true, @@ -93,7 +235,13 @@ showDevice:false, multipleSelection: [], showModel:false, - deviceId:null + deviceId:null, + drawer:false, + ruleForm:{ + autoFlightSpeed:14, + globalTransitionalSpeed:15 + }, + } }, methods:{ @@ -102,6 +250,8 @@ this.$emit('close') }, flyToLocal(row){ + + console.log(row) const position = Cesium.Cartesian3.fromDegrees(row.longitude,row.latitude, row.deviceHeight); // rotationAngle = Cesium.Math.toRadians(row.face) || Cesium.Math.toRadians(0) rotationAngle = Cesium.Math.toRadians(row.face) || Cesium.Math.toRadians(0) @@ -128,7 +278,7 @@ verticalOrigin: Cesium.VerticalOrigin.BOTTOM, horizontalOrigin: Cesium.HorizontalOrigin.CENTER, font: '28px Helvetica', - outlineColor: Cesium.Color.BLUE, + outlineColor: Cesium.Color.RED, outlineWidth: 3, fillColor: Cesium.Color.fromCssColorString('#FFFFFF'), //44c3cc text: row.deviceName, @@ -347,7 +497,8 @@ label: groundPoint.targetName, longitude: groundPoint.longitude, latitude: groundPoint.latitude, - height: groundPoint.height + height: groundPoint.height, + actions:groundPoint.actions }] : []; // 鐢熸垚绌轰腑鐐� @@ -449,7 +600,7 @@ position: groundPos, point: { pixelSize: 6, - color: Cesium.Color.BLUE + color: Cesium.Color.RED }, label: { text: groundPoint.label || '', @@ -470,7 +621,7 @@ positions: [airPos, groundPos], width: 2, material: new Cesium.PolylineDashMaterialProperty({ - color: Cesium.Color.BLUE, + color: Cesium.Color.RED, dashLength: 8 }) } @@ -550,6 +701,7 @@ }, submit(){ console.log(this.treeData) + console.log(this.ruleForm) const routePointList = []; @@ -561,6 +713,7 @@ latitude: airPoint.latitude, height: airPoint.height, isStartAndEndPoint: false, + actions:airPoint.children[0].actions || [], coordinatePointReq: { height: airPoint.children[0].height, latitude:airPoint.children[0].latitude, @@ -580,15 +733,49 @@ let params = { routePointList:routePointList } + this.ruleForm.routePointList = routePointList + console.log(this.ruleForm) console.log('鐢熸垚鑸嚎') - buildKmz(params).then(res=>{ + 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 + }, + handleChangeAutoFlightSpeed(value){ + console.log(value) + this.ruleForm.autoFlightSpeed = value + }, + handleChangeGlobalTransitionalSpeed(value){ + console.log(value) + this.ruleForm.globalTransitionalSpeed = value + }, + submitForm(formName) { + this.$refs[formName].validate((valid) => { + if (valid) { + // alert('submit!'); + console.log(this.ruleForm) + this.drawer = false + } else { + console.log('error submit!!'); + return false; + } + }); + }, + resetForm(){ + this.drawer = false } } } -- Gitblit v1.9.3