|
|
|
@ -18,7 +18,6 @@
|
|
|
|
|
</a-form-item>
|
|
|
|
|
|
|
|
|
|
<a-form-item ref="name" label="任务类型" name="taskType">
|
|
|
|
|
|
|
|
|
|
<div class="radio-box">
|
|
|
|
|
<div v-for="(item,index) in taskTypeOptions" :key="index"
|
|
|
|
|
:class=" submitForm.taskType == item.value ? 'radio-item-active':'radio-item'"
|
|
|
|
@ -57,25 +56,37 @@
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</a-form-item>
|
|
|
|
|
<!--
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a-form-item ref="accuracy" label="任务精度" name="accuracy">
|
|
|
|
|
<a-radio-group v-model:value="submitForm.accuracy" button-style="solid">
|
|
|
|
|
<a-radio-button :value="1">高精度RTK</a-radio-button>
|
|
|
|
|
<a-radio-button :value="2">GNSS</a-radio-button>
|
|
|
|
|
</a-radio-group>
|
|
|
|
|
</a-form-item> -->
|
|
|
|
|
|
|
|
|
|
<!-- <a-form-item ref="accuracy" label="任务策略" name="accuracy">
|
|
|
|
|
<a-radio-group v-model:value="submitForm.periodicFormula" button-style="solid">
|
|
|
|
|
<a-radio-button :value="1">立即</a-radio-button>
|
|
|
|
|
<a-radio-button :value="2">单次定时</a-radio-button>
|
|
|
|
|
<a-radio-button :value="3">重复定时</a-radio-button>
|
|
|
|
|
<a-radio-button :value="4">继续执行</a-radio-button>
|
|
|
|
|
</a-radio-group>
|
|
|
|
|
</a-form-item> -->
|
|
|
|
|
|
|
|
|
|
<div class="radio-box">
|
|
|
|
|
<div v-for="(item,index) in waylinePrecisionTypeOptions" :key="index"
|
|
|
|
|
:class=" submitForm.waylinePrecisionType == item.value ? 'radio-item-active':'radio-item'"
|
|
|
|
|
@click="submitForm.waylinePrecisionType = item.value"
|
|
|
|
|
>
|
|
|
|
|
{{item.label}}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</a-form-item>
|
|
|
|
|
|
|
|
|
|
<a-form-item ref="accuracy" label="任务策略" name="accuracy">
|
|
|
|
|
|
|
|
|
|
<div class="radio-box">
|
|
|
|
|
<div v-for="(item,index) in periodicFormulaOptions" :key="index"
|
|
|
|
|
:class=" submitForm.periodicFormula == item.value ? 'radio-item-active':'radio-item'"
|
|
|
|
|
@click="submitForm.periodicFormula = item.value"
|
|
|
|
|
>
|
|
|
|
|
{{item.label}}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</a-form-item>
|
|
|
|
|
|
|
|
|
|
<div style="display:flex;color:#fff;font-size:12px;padding:20px 0px;">
|
|
|
|
|
<div style="flex:1;">智能最佳返航路线</div>
|
|
|
|
|
<div style="flex:1;">智能巡检</div>
|
|
|
|
|
<div>
|
|
|
|
|
<a-switch v-model:checked="submitForm.aiInspection"
|
|
|
|
|
checked-color="#3A57E8"
|
|
|
|
@ -111,7 +122,7 @@
|
|
|
|
|
|
|
|
|
|
</a-form-item>
|
|
|
|
|
|
|
|
|
|
<a-form-item ref="outOfContact" label="完成动作" name="outOfContact">
|
|
|
|
|
<a-form-item ref="outOfContact" label="完成动作" name="outOfContact" v-if="submitForm.lossOfControlAction == 'executeLostAction'">
|
|
|
|
|
<div class="radio-box">
|
|
|
|
|
<div v-for="(item,index) in continuationModeOptions" :key="index"
|
|
|
|
|
:class=" submitForm.continuationMode == item.value ? 'radio-item-active':'radio-item'"
|
|
|
|
@ -122,32 +133,30 @@
|
|
|
|
|
</div>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
|
|
|
|
|
<div style="display:flex;color:#fff;font-size:12px;padding:20px 0px;color:#fff;">
|
|
|
|
|
<div style="flex:1;">自动断点续飞</div>
|
|
|
|
|
<div>
|
|
|
|
|
<a-switch v-model:checked="submitForm.breakFly" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a-form-item :wrapper-col="{ span: 24, offset: 0 }">
|
|
|
|
|
<a-button @click="resetForm" style="width:44%;">取消</a-button>
|
|
|
|
|
<a-button style="margin-left: 10px;width:48%;" type="primary" @click="onSubmit">确定</a-button>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
|
|
|
|
|
</a-form>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="footer-container">
|
|
|
|
|
<div>
|
|
|
|
|
<a-button @click="resetForm" style="width:100%;">取消</a-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<a-button style="width:100%;" type="primary" @click="onSubmit">确定</a-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { ref, defineEmits, defineProps, watch } from "vue";
|
|
|
|
|
import { PlusOutlined,LeftOutlined,DeleteOutlined } from '@ant-design/icons-vue';
|
|
|
|
|
import { addTask } from "@/api/sys/workplan";
|
|
|
|
|
import { addTask,editTask } from "@/api/sys/workplan";
|
|
|
|
|
import { Modal, message } from 'ant-design-vue';
|
|
|
|
|
const formRef = ref();
|
|
|
|
|
const labelCol = { span: 24 };
|
|
|
|
|
const wrapperCol = { span: 24 };
|
|
|
|
|
const props = defineProps(["checkedAriLine","checkedDronePort"]);
|
|
|
|
|
const props = defineProps(["checkedAriLine","checkedDronePort","formData"]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const submitForm = ref({
|
|
|
|
|
taskName:null, // 任务名称
|
|
|
|
@ -158,10 +167,18 @@ const submitForm = ref({
|
|
|
|
|
lossOfControlAction:"executeLostAction", // 返航失控动作
|
|
|
|
|
continuationMode:"goBack", // 续飞模式
|
|
|
|
|
aiInspection:null, // AI巡检
|
|
|
|
|
periodicFormula:null, // 周期公式
|
|
|
|
|
periodicFormula:0, // 周期公式
|
|
|
|
|
airLineId:1, // 航线记录id
|
|
|
|
|
waylinePrecisionType:0, // 任务精度
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(props.formData){
|
|
|
|
|
|
|
|
|
|
submitForm.value = props.formData
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
watch(
|
|
|
|
|
()=>props.checkedAriLine,
|
|
|
|
|
(newVal,oldVal)=>{
|
|
|
|
@ -183,7 +200,6 @@ const removeAirLine = ()=>{
|
|
|
|
|
props.checkedAriLine.value = {};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const selectAriLine = ()=> {
|
|
|
|
|
emit("selectAriLine",true)
|
|
|
|
|
}
|
|
|
|
@ -197,9 +213,22 @@ const taskTypeOptions = ref([
|
|
|
|
|
{
|
|
|
|
|
value:0,
|
|
|
|
|
label:"普通任务"
|
|
|
|
|
},{
|
|
|
|
|
},
|
|
|
|
|
// {
|
|
|
|
|
// value:1,
|
|
|
|
|
// label:"蛙跳任务"
|
|
|
|
|
// }
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
// 任务精度
|
|
|
|
|
const waylinePrecisionTypeOptions = ref([
|
|
|
|
|
{
|
|
|
|
|
value:0,
|
|
|
|
|
label:"高精度RTK"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value:1,
|
|
|
|
|
label:"蛙跳任务"
|
|
|
|
|
label:"GNSS"
|
|
|
|
|
}
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
@ -231,16 +260,16 @@ const continuationModeOptions = ref([
|
|
|
|
|
// 周期公式
|
|
|
|
|
const periodicFormulaOptions = ref([
|
|
|
|
|
{
|
|
|
|
|
value:"goBack",
|
|
|
|
|
value:0,
|
|
|
|
|
label:"立即"
|
|
|
|
|
},{
|
|
|
|
|
value:"landing",
|
|
|
|
|
value:1,
|
|
|
|
|
label:"单次定时"
|
|
|
|
|
},{
|
|
|
|
|
value:"hover",
|
|
|
|
|
value:2,
|
|
|
|
|
label:"重复定时"
|
|
|
|
|
},{
|
|
|
|
|
value:"hover",
|
|
|
|
|
value:3,
|
|
|
|
|
label:"继续执行"
|
|
|
|
|
}
|
|
|
|
|
])
|
|
|
|
@ -251,24 +280,28 @@ const rules = {
|
|
|
|
|
|
|
|
|
|
const onSubmit =async () => {
|
|
|
|
|
|
|
|
|
|
console.log("submitForm",submitForm.value)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let res = await addTask(submitForm.value);
|
|
|
|
|
|
|
|
|
|
if(res){
|
|
|
|
|
|
|
|
|
|
message.success("操作成功!");
|
|
|
|
|
|
|
|
|
|
emit("successCreatePlan");
|
|
|
|
|
if(props.formData){
|
|
|
|
|
// 编辑
|
|
|
|
|
let res = await editTask(submitForm.value);
|
|
|
|
|
if(res){
|
|
|
|
|
message.success("操作成功!");
|
|
|
|
|
emit("successCreatePlan");
|
|
|
|
|
}else{
|
|
|
|
|
message.error("操作失败!");
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
message.error("操作失败!");
|
|
|
|
|
// 创建
|
|
|
|
|
let res = await addTask(submitForm.value);
|
|
|
|
|
if(res){
|
|
|
|
|
message.success("操作成功!");
|
|
|
|
|
emit("successCreatePlan");
|
|
|
|
|
}else{
|
|
|
|
|
message.error("操作失败!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
formRef.value.validate().then(() => {
|
|
|
|
|
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
console.log('error', error);
|
|
|
|
|
});
|
|
|
|
@ -292,9 +325,24 @@ const resetForm = () => {
|
|
|
|
|
}
|
|
|
|
|
.body-container{
|
|
|
|
|
width:100%;
|
|
|
|
|
height: calc( 100% - 60px);
|
|
|
|
|
padding:0px;
|
|
|
|
|
margin:0px;
|
|
|
|
|
height: calc( 100% - 110px);
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.footer-container{
|
|
|
|
|
padding:20px;
|
|
|
|
|
width: calc( 100% - 10px);
|
|
|
|
|
position:absolute;
|
|
|
|
|
bottom:0px;
|
|
|
|
|
left:0px;
|
|
|
|
|
display:flex;
|
|
|
|
|
gap:20px;
|
|
|
|
|
}
|
|
|
|
|
.footer-container div{
|
|
|
|
|
flex:1;
|
|
|
|
|
}
|
|
|
|
|
.ant-form-item{
|
|
|
|
|
margin-bottom:12px;
|
|
|
|
|
}
|
|
|
|
|