|
|
|
@ -29,15 +29,15 @@
|
|
|
|
|
</a-form-item>
|
|
|
|
|
|
|
|
|
|
<a-form-item ref="name" label="选择航线" name="name">
|
|
|
|
|
<a-button type="primary" style="width:100%;" @click="selectAriLine" v-show="!submitForm.taskAirLine">
|
|
|
|
|
<a-button type="primary" style="width:100%;" @click="selectAriLine" v-show="!submitForm.airLineId">
|
|
|
|
|
<PlusOutlined />
|
|
|
|
|
选择航线
|
|
|
|
|
</a-button>
|
|
|
|
|
|
|
|
|
|
<div class="select-item" v-show="submitForm.taskAirLine">
|
|
|
|
|
<div class="item-name">{{props.checkedAriLine.airLineName}}</div>
|
|
|
|
|
<div class="select-item" v-show="submitForm.airLineId">
|
|
|
|
|
<div class="item-name">{{submitForm.taskAirLineName}}</div>
|
|
|
|
|
<div class="item-operate">
|
|
|
|
|
<DeleteOutlined @click="submitForm.taskAirLine = null"/>
|
|
|
|
|
<MoreOutlined @click="selectAriLine"/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</a-form-item>
|
|
|
|
@ -49,9 +49,9 @@
|
|
|
|
|
</a-button>
|
|
|
|
|
|
|
|
|
|
<div class="select-item" v-show="submitForm.taskDronePort">
|
|
|
|
|
<div class="item-name">{{props.checkedDronePort.name}}</div>
|
|
|
|
|
<div class="item-name">{{submitForm.taskDronePortName}}</div>
|
|
|
|
|
<div class="item-operate">
|
|
|
|
|
<DeleteOutlined @click="submitForm.taskDronePort = null" />
|
|
|
|
|
<MoreOutlined @click="selectAircraft" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
@ -122,7 +122,7 @@
|
|
|
|
|
|
|
|
|
|
</a-form-item>
|
|
|
|
|
|
|
|
|
|
<a-form-item ref="outOfContact" label="完成动作" name="outOfContact" v-if="submitForm.lossOfControlAction == 'executeLostAction'">
|
|
|
|
|
<a-form-item ref="outOfContact" label="完成动作" name="outOfContact" v-if="submitForm.lossOfControlAction == 1">
|
|
|
|
|
<div class="radio-box">
|
|
|
|
|
<div v-for="(item,index) in continuationModeOptions" :key="index"
|
|
|
|
|
:class=" submitForm.continuationMode == item.value ? 'radio-item-active':'radio-item'"
|
|
|
|
@ -148,7 +148,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { ref, defineEmits, defineProps, watch } from "vue";
|
|
|
|
|
import { PlusOutlined,LeftOutlined,DeleteOutlined } from '@ant-design/icons-vue';
|
|
|
|
|
import { PlusOutlined,LeftOutlined,DeleteOutlined,MoreOutlined } from '@ant-design/icons-vue';
|
|
|
|
|
import { addTask,editTask } from "@/api/sys/workplan";
|
|
|
|
|
import { Modal, message } from 'ant-design-vue';
|
|
|
|
|
const formRef = ref();
|
|
|
|
@ -158,31 +158,63 @@ const props = defineProps(["checkedAriLine","checkedDronePort","formData"]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// const submitForm = ref({
|
|
|
|
|
// taskName:null, // 任务名称
|
|
|
|
|
// taskType:0, // 任务类型
|
|
|
|
|
// taskDronePort:null, // 执行机场s
|
|
|
|
|
// taskAirLine:null, // 航线id
|
|
|
|
|
// returnAltitude:0, // 返航高度
|
|
|
|
|
// lossOfControlAction:"executeLostAction", // 返航失控动作
|
|
|
|
|
// continuationMode:"goBack", // 续飞模式
|
|
|
|
|
// aiInspection:null, // AI巡检
|
|
|
|
|
// periodicFormula:0, // 周期公式
|
|
|
|
|
// airLineId:1, // 航线记录id
|
|
|
|
|
// waylinePrecisionType:0, // 任务精度
|
|
|
|
|
// taskAirLineName : null,
|
|
|
|
|
// taskDronePortName : null,
|
|
|
|
|
// })
|
|
|
|
|
const submitForm = ref({
|
|
|
|
|
taskName:null, // 任务名称
|
|
|
|
|
taskType:0, // 任务类型
|
|
|
|
|
taskDronePort:null, // 执行机场s
|
|
|
|
|
taskAirLine:null, // 航线id
|
|
|
|
|
returnAltitude:0, // 返航高度
|
|
|
|
|
lossOfControlAction:"executeLostAction", // 返航失控动作
|
|
|
|
|
continuationMode:"goBack", // 续飞模式
|
|
|
|
|
aiInspection:null, // AI巡检
|
|
|
|
|
periodicFormula:0, // 周期公式
|
|
|
|
|
airLineId:1, // 航线记录id
|
|
|
|
|
waylinePrecisionType:0, // 任务精度
|
|
|
|
|
"id": null,
|
|
|
|
|
"taskName": null,
|
|
|
|
|
"taskType": 0,
|
|
|
|
|
"taskAirLineName": null,
|
|
|
|
|
"taskDronePortName": null,
|
|
|
|
|
"taskDronePort": null,
|
|
|
|
|
"taskAirLine": null,
|
|
|
|
|
"returnAltitude": 0,
|
|
|
|
|
"lossOfControlAction": 0,
|
|
|
|
|
"continuationMode": null,
|
|
|
|
|
"aiInspection": null,
|
|
|
|
|
"status": 0,
|
|
|
|
|
"periodicFormula": null,
|
|
|
|
|
"airLineId": null,
|
|
|
|
|
"createId": 0,
|
|
|
|
|
"createTime": "",
|
|
|
|
|
"waylinePrecisionType": 0,
|
|
|
|
|
"scheduledStartTime": "",
|
|
|
|
|
"scheduledEndTime": "",
|
|
|
|
|
"executeTime": "",
|
|
|
|
|
"completedTime": "",
|
|
|
|
|
"planExecuteDuration": 0,
|
|
|
|
|
"actualExecuteDuration": 0,
|
|
|
|
|
"workspaceId": null,
|
|
|
|
|
"expectedFileCount": 0,
|
|
|
|
|
"uploadedFileCount": 0,
|
|
|
|
|
"flightId": null,
|
|
|
|
|
"reason": null
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(props.formData){
|
|
|
|
|
|
|
|
|
|
submitForm.value = props.formData
|
|
|
|
|
console.log("formData",props.formData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
watch(
|
|
|
|
|
()=>props.checkedAriLine,
|
|
|
|
|
(newVal,oldVal)=>{
|
|
|
|
|
submitForm.value.taskAirLine = newVal.airLineName;
|
|
|
|
|
submitForm.value.taskAirLineName = newVal.airLineName;
|
|
|
|
|
submitForm.value.airLineId = newVal.id;
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
@ -190,6 +222,8 @@ watch(
|
|
|
|
|
watch(
|
|
|
|
|
()=>props.checkedDronePort,
|
|
|
|
|
(newVal,oldVal)=>{
|
|
|
|
|
console.log("newVal",newVal);
|
|
|
|
|
submitForm.value.taskDronePortName = newVal.name;
|
|
|
|
|
submitForm.value.taskDronePort = newVal.id;
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
@ -235,10 +269,10 @@ const waylinePrecisionTypeOptions = ref([
|
|
|
|
|
// 飞行中失控
|
|
|
|
|
const lossOfControlActionOptions = ref([
|
|
|
|
|
{
|
|
|
|
|
value:'goContinue',
|
|
|
|
|
value:0,
|
|
|
|
|
label:"继续执行航线"
|
|
|
|
|
},{
|
|
|
|
|
value:'executeLostAction',
|
|
|
|
|
value:1,
|
|
|
|
|
label:"执行失控动作"
|
|
|
|
|
}
|
|
|
|
|
])
|
|
|
|
@ -246,14 +280,14 @@ const lossOfControlActionOptions = ref([
|
|
|
|
|
// 失控动作
|
|
|
|
|
const continuationModeOptions = ref([
|
|
|
|
|
{
|
|
|
|
|
value:"goBack",
|
|
|
|
|
value:0,
|
|
|
|
|
label:"返航"
|
|
|
|
|
},{
|
|
|
|
|
value:"landing",
|
|
|
|
|
label:"降落"
|
|
|
|
|
},{
|
|
|
|
|
value:"hover",
|
|
|
|
|
value:1,
|
|
|
|
|
label:"悬停"
|
|
|
|
|
},{
|
|
|
|
|
value:2,
|
|
|
|
|
label:"降落"
|
|
|
|
|
}
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
@ -282,7 +316,10 @@ const onSubmit =async () => {
|
|
|
|
|
|
|
|
|
|
if(props.formData){
|
|
|
|
|
// 编辑
|
|
|
|
|
let res = await editTask(submitForm.value);
|
|
|
|
|
let data = {...submitForm.value}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let res = await editTask(data);
|
|
|
|
|
if(res){
|
|
|
|
|
message.success("操作成功!");
|
|
|
|
|
emit("successCreatePlan");
|
|
|
|
|