|
|
|
@ -32,6 +32,21 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</a-form-item> -->
|
|
|
|
|
|
|
|
|
|
<!-- <a-form-item ref="name" label="选择项目" name="name">
|
|
|
|
|
<a-button type="primary" style="width:100%;" @click="selectAriLine" v-show="!submitForm.airLineId">
|
|
|
|
|
<PlusOutlined />
|
|
|
|
|
选择项目
|
|
|
|
|
</a-button>
|
|
|
|
|
|
|
|
|
|
<div class="select-item" v-show="submitForm.airLineId">
|
|
|
|
|
<div class="item-name">{{submitForm.taskAirLineName}}</div>
|
|
|
|
|
<div class="item-operate" @click="selectAriLine">
|
|
|
|
|
<MoreOutlined />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</a-form-item> -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a-form-item ref="name" label="选择航线" name="name">
|
|
|
|
|
<a-button type="primary" style="width:100%;" @click="selectAriLine" v-show="!submitForm.airLineId">
|
|
|
|
@ -92,12 +107,8 @@
|
|
|
|
|
</a-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a-form-item v-if="false" ref="accuracy" label="设置时间" name="accuracy">
|
|
|
|
|
<a-button type="primary" @click="handlerSetTime">选择时间</a-button>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
|
|
|
|
|
<!-- 单次定时 -->
|
|
|
|
|
<a-form-item v-if="submitForm.taskType == 1" ref="accuracy" label="设置时间" name="accuracy">
|
|
|
|
|
<a-form-item v-if="submitForm.taskType == 1" label="设置时间">
|
|
|
|
|
<a-date-picker v-model:value="onceTime" valueFormat="YYYY-M-D HH:mm:ss" style="width:100%;" show-time placeholder="选择时间" @change="onOnceTimeChange" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
|
|
|
|
@ -194,10 +205,17 @@
|
|
|
|
|
<div >
|
|
|
|
|
<a-button v-if="!paramValue" @click="resetForm" style="width:100%;">取消</a-button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div v-if="submitForm.status == 0">
|
|
|
|
|
<a-button style="width:100%;" type="primary" @click="onSubmit" v-if="props.workPlanStatus == 'create'">创建</a-button>
|
|
|
|
|
<a-button style="width:100%;" type="primary" @click="onSubmit" v-if="props.workPlanStatus == 'edit'">编辑</a-button>
|
|
|
|
|
<!-- <a-button style="width:100%;" type="primary" @click="onSubmit" v-if="props.workPlanStatus == 'edit'">编辑</a-button> -->
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div v-if="props.workPlanStatus == 'detail' && submitForm.status == 5">
|
|
|
|
|
<a-button style="width:100%;" type="primary" @click="toImageList()">结果</a-button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
@ -206,9 +224,11 @@
|
|
|
|
|
import { ref, defineEmits, defineProps, watch } from "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';
|
|
|
|
|
import { useRoute } from 'vue-router'
|
|
|
|
|
import { useRoute,useRouter } from 'vue-router'
|
|
|
|
|
const router = useRoute()
|
|
|
|
|
const routerer = useRouter();
|
|
|
|
|
const paramValue = router.query.taskid
|
|
|
|
|
|
|
|
|
|
const formRef = ref();
|
|
|
|
@ -231,9 +251,9 @@ const props = defineProps({
|
|
|
|
|
"taskDronePortName": null,
|
|
|
|
|
"taskDronePort": null,
|
|
|
|
|
"taskAirLine": null,
|
|
|
|
|
"returnAltitude": 0,
|
|
|
|
|
"lossOfControlAction": 0,
|
|
|
|
|
"continuationMode": null,
|
|
|
|
|
"returnAltitude": 20,
|
|
|
|
|
"lossOfControlAction": 1,
|
|
|
|
|
"continuationMode": 0,
|
|
|
|
|
"aiInspection": null,
|
|
|
|
|
"status": 0,
|
|
|
|
|
"periodicFormula": null,
|
|
|
|
@ -266,6 +286,38 @@ const props = defineProps({
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const submitForm = ref({
|
|
|
|
|
"id": null,
|
|
|
|
|
"taskName": null,
|
|
|
|
|
"taskType": 0,
|
|
|
|
|
"taskAirLineName": null,
|
|
|
|
|
"taskDronePortName": null,
|
|
|
|
|
"taskDronePort": null,
|
|
|
|
|
"taskAirLine": null,
|
|
|
|
|
"returnAltitude": 20,
|
|
|
|
|
"lossOfControlAction": 1,
|
|
|
|
|
"continuationMode": 0,
|
|
|
|
|
"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,
|
|
|
|
|
"externalTaskId": null,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const weekdays = ref([
|
|
|
|
|
{
|
|
|
|
@ -308,15 +360,25 @@ const handlerDisplayCronTime = ()=>{
|
|
|
|
|
let cronArray = props.formData.periodicFormula.split(" ");
|
|
|
|
|
console.log("cronArray",cronArray);
|
|
|
|
|
let days = cronArray[3].split("-")
|
|
|
|
|
|
|
|
|
|
repeatTime.value.date = [cronArray[6]+"-"+cronArray[4]+"-"+days[0], cronArray[6]+"-"+cronArray[4]+"-"+days[1]]
|
|
|
|
|
|
|
|
|
|
console.log(" repeatTime.value.date", repeatTime.value.date);
|
|
|
|
|
|
|
|
|
|
repeatTime.value.time = cronArray[2]+":"+cronArray[1]+":"+cronArray[0]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 去查看结果
|
|
|
|
|
const toImageList = () => {
|
|
|
|
|
console.log("formData",props.formData.id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
routerer.push({
|
|
|
|
|
path: '/system/mediaLibrary',
|
|
|
|
|
query: {
|
|
|
|
|
flightId:props.formData.id
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 回显时间
|
|
|
|
|
if(props.formData){
|
|
|
|
|
handlerDisplayCronTime();
|
|
|
|
@ -350,38 +412,6 @@ const handleCancel = () => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const submitForm = ref({
|
|
|
|
|
"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,
|
|
|
|
|
"externalTaskId": null
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(props.formData){
|
|
|
|
|
submitForm.value = props.formData
|
|
|
|
@ -488,50 +518,62 @@ const periodicFormulaOptions = ref([
|
|
|
|
|
},{
|
|
|
|
|
value:2,
|
|
|
|
|
label:"重复定时"
|
|
|
|
|
},{
|
|
|
|
|
value:3,
|
|
|
|
|
label:"继续执行"
|
|
|
|
|
}
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
const rules = {
|
|
|
|
|
|
|
|
|
|
"taskName":[
|
|
|
|
|
{ required: true, message: "计划名称不能为空!", trigger: "blur" },
|
|
|
|
|
],
|
|
|
|
|
"onceTime":[
|
|
|
|
|
{ required: true, message: "时间不能为空!", trigger: "blur" },
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const onSubmit =async () => {
|
|
|
|
|
const onSubmit = () => {
|
|
|
|
|
|
|
|
|
|
if(submitForm.value.taskType == 1){
|
|
|
|
|
onOnceTimeChange();
|
|
|
|
|
}
|
|
|
|
|
formRef.value.validate().then(
|
|
|
|
|
()=>{
|
|
|
|
|
|
|
|
|
|
if(submitForm.value.taskType == 2){
|
|
|
|
|
handleRepeatTypeChange();
|
|
|
|
|
}
|
|
|
|
|
if(submitForm.value.taskType == 1){
|
|
|
|
|
onOnceTimeChange();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(props.formData){
|
|
|
|
|
// 编辑
|
|
|
|
|
let data = {...submitForm.value}
|
|
|
|
|
|
|
|
|
|
let res = await editTask(data);
|
|
|
|
|
if(res){
|
|
|
|
|
message.success("操作成功!");
|
|
|
|
|
emit("successCreatePlan");
|
|
|
|
|
}else{
|
|
|
|
|
message.error("操作失败!");
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
if(paramValue){
|
|
|
|
|
submitForm.value.externalTaskId = paramValue
|
|
|
|
|
}
|
|
|
|
|
// 创建
|
|
|
|
|
let res = await addTask(submitForm.value);
|
|
|
|
|
if(res){
|
|
|
|
|
message.success("操作成功!");
|
|
|
|
|
emit("successCreatePlan");
|
|
|
|
|
}else{
|
|
|
|
|
message.error("操作失败!");
|
|
|
|
|
if(submitForm.value.taskType == 2){
|
|
|
|
|
handleRepeatTypeChange();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(props.formData){
|
|
|
|
|
// 编辑
|
|
|
|
|
let data = {...submitForm.value}
|
|
|
|
|
|
|
|
|
|
let res = editTask(data);
|
|
|
|
|
if(res){
|
|
|
|
|
message.success("操作成功!");
|
|
|
|
|
emit("successCreatePlan");
|
|
|
|
|
}else{
|
|
|
|
|
message.error("操作失败!");
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
if(paramValue){
|
|
|
|
|
submitForm.value.externalTaskId = paramValue
|
|
|
|
|
}
|
|
|
|
|
// 创建
|
|
|
|
|
let res = addTask(submitForm.value);
|
|
|
|
|
if(res){
|
|
|
|
|
message.success("操作成功!");
|
|
|
|
|
emit("successCreatePlan");
|
|
|
|
|
}else{
|
|
|
|
|
message.error("操作失败!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
).catch(()=>{
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const resetForm = () => {
|
|
|
|
@ -549,6 +591,10 @@ const togglePopover = (e)=> {
|
|
|
|
|
|
|
|
|
|
// 处理单次定时日期
|
|
|
|
|
const onOnceTimeChange = () => {
|
|
|
|
|
if(!onceTime.value){
|
|
|
|
|
message.warning("请设置任务定时时间");
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let time = new Date(onceTime.value);
|
|
|
|
|
|
|
|
|
@ -887,4 +933,12 @@ const handleRepeatTypeChange = ()=>{
|
|
|
|
|
::v-deep .ant-picker .ant-picker-input >input::placeholder{
|
|
|
|
|
color:#fff!important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*修改 a-input 浏览器自动填充文本颜色*/
|
|
|
|
|
/* 修改自动填充时的输入框样式 */
|
|
|
|
|
::v-deep .ant-input:-webkit-autofill {
|
|
|
|
|
-webkit-text-fill-color: #ffffff; /* 修改文字颜色(红色) */
|
|
|
|
|
transition: background-color 5000s ease-in-out 0s; /* 防止背景色闪烁 */
|
|
|
|
|
}
|
|
|
|
|
</style>
|