main
徐景良 1 month ago
parent 85684ea385
commit b92c4f624a

@ -2,6 +2,9 @@ import { defHttp } from '@/utils/http/axios';
enum Api{
// 项目
GetWorkspaceList = '/api/Manage/GetWorkspaceList',
// 任务
GetTaskPageList = '/api/Manage/GetTaskPageList',
AddTask = '/api/Manage/AddTask',
@ -32,6 +35,11 @@ enum Api{
}
// 项目
export function getWorkspaceList(){
return defHttp.get({ url: Api.GetTaskPageList, params });
}
// 任务
export function getTaskPageList(params) {
return defHttp.get({ url: Api.GetTaskPageList, params });

@ -351,6 +351,8 @@ const handlerCreateAirLineForm = (form)=>{
airLineForm.value = form
airLineForm.value.folder = globalFolder.value;
console.log("airLineFor121m",airLineForm.value);
}
const successCreatePlan = ()=>{

@ -1,7 +1,10 @@
<template>
<div class="container">
<div class="title" @click="closeAirLine()">
<LeftOutlined v-show="props.title=='线'" /> {{props.title}}
<div class="title">
<span @click="closeAirLine()">
<LeftOutlined v-show="props.title=='线'" /> {{props.title}}
</span>
</div>
<div class="filter-container">
<div>
@ -13,9 +16,10 @@
@change="getAirList"
>
<a-select-option :value="null">全部机型</a-select-option>
<a-select-option :value="2">经纬 M30 系列</a-select-option>
<a-select-option :value="3">Mavic 3 行业系列</a-select-option>
<a-select-option :value="4">Matrice 3D 系列</a-select-option>
<a-select-option :value="'M30'">经纬 M30 系列</a-select-option>
<a-select-option :value="'Mavic 3'">Mavic 3 系列</a-select-option>
<a-select-option :value="'Mavic 3D'">Mavic 3D 系列</a-select-option>
<a-select-option :value="'Matrce 4TD'">Matrce 4TD 系列</a-select-option>
</a-select>
</div>
@ -52,7 +56,7 @@
<a-input-search
v-model:value="pageQuery.AirLineName"
@search="getAirList"
placeholder="输入线名称"
placeholder="输入线名称"
/>
</div>
@ -60,9 +64,20 @@
<div class="file-container">
<div class="tip">
<div class="info">文件夹</div>
<div @click="createFolder" v-show="props.title != '选择航线'">
<FileAddOutlined />
</div>
<a-tooltip trigger="click" placement="bottom">
<template #title>
<div class="create-folder-contatiner">
<a-input size="small" v-model:value="createFolderForm.folderName" placeholder="请输入文件名称" style="background:red;"></a-input>
<a-button type="primary" size="small" @click="createFolder"></a-button>
</div>
</template>
<div v-show="props.title != '选择航线'">
<FileAddOutlined />
</div>
</a-tooltip>
</div>
<div>
<a-directory-tree
@ -200,7 +215,7 @@
</div>
<!-- 创建目录弹窗 -->
<Modal
<!-- <Modal
title="添加目录"
:open="visible"
@ok="handleGetData"
@ -214,7 +229,7 @@
<div> 文件名称</div>
<a-input v-model:value="createFolderForm.folderName"></a-input>
</div>
</Modal>
</Modal> -->
</div>
</template>
<script lang="ts" setup>
@ -515,8 +530,6 @@
});
}
//
const visible = ref(false);
const createFolderForm = ref({
@ -524,10 +537,14 @@
parentId:currentFolder.value
})
const createFolder = () => {
visible.value = true;
handleGetData();
}
const handleGetData =async ()=>{
if(!createFolderForm.value.folderName){
message.warning("文件夹名称不能为空!");
return null;
}
createFolderForm.value.parentId = currentFolder.value
@ -632,6 +649,11 @@
border-top:1px solid rgba(204, 204, 204, 0.219) ;
height: calc( 100% - 120px);
}
.create-folder-contatiner{
padding:10px;
display:flex;
gap:20px;
}
.file-container{
width:240px;

@ -13,9 +13,10 @@
placeholder="全部机型"
>
<a-select-option value="jack">全部机型</a-select-option>
<a-select-option value="lucy">经纬 M30 系列</a-select-option>
<a-select-option value="disabled">Mavic 3 行业系列</a-select-option>
<a-select-option value="Yiminghe">Matrice 3D 系列</a-select-option>
<a-select-option value="M30">经纬 M30 系列</a-select-option>
<a-select-option value=">Mavic 3">Mavic 3 系列</a-select-option>
<a-select-option value="Matrice 3D">Matrice 3D 系列</a-select-option>
<a-select-option value="Matrice 4TD">Matrice 4TD 系列</a-select-option>
</a-select>
</div>

@ -83,7 +83,7 @@
const airType = ref([
{
name:"Matrice 4D 系列",
value:"Matrice 4D 系列",
value:"Matrice 4D",
checked:false,
}
])
@ -127,6 +127,8 @@
"wpml": null,
"taskOffLng": 0,
"taskOffLat": 0,
"uavType":null,
"uavModel":null,
"folder": null
})
@ -184,18 +186,18 @@
})
//
// airType.value?.forEach((item,index)=>{
// if(item.checked){
// createAirLineForm.value.airType = item.name;
// }
// })
airType.value?.forEach((item,index)=>{
if(item.checked){
createAirLineForm.value.uavType = item.value;
}
})
//
// airModel.value?.forEach((item,index)=>{
// if(item.checked){
// createAirLineForm.value.airModel = item.name;
// }
// })
airModel.value?.forEach((item,index)=>{
if(item.checked){
createAirLineForm.value.uavModel = item.value;
}
})
}

@ -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>

@ -59,9 +59,9 @@
<a href="javascript:;">详情</a>
</a-menu-item>
<a-menu-item @click="createWorkPlan(item)" v-if="item.status == 0">
<!-- <a-menu-item @click="createWorkPlan(item)" v-if="item.status == 0">
<a href="javascript:;">编辑</a>
</a-menu-item>
</a-menu-item> -->
<a-menu-item @click="deletePlan(item.id)" v-if="item.status == 0">
<a href="javascript:;">删除</a>
@ -86,7 +86,7 @@
<script lang="ts" setup>
import { UserOutlined,PlusOutlined,FileAddOutlined,LeftOutlined,ImportOutlined,MoreOutlined,EditOutlined } from '@ant-design/icons-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import {ref,defineEmits,defineProps,createVNode,watch} from 'vue'
import {ref,defineEmits,defineProps,createVNode,watch,defineExpose } from 'vue'
import { Modal, message } from 'ant-design-vue';
import { getTaskPageList, deleteTask,executeFlyTask,pendingFlyTask } from '@/api/sys/workplan';
import { statusOptions } from '@/components/illegalmining/util';
@ -125,6 +125,11 @@ import { statusOptions } from '@/components/illegalmining/util';
getTaskList();
defineExpose({
getTaskList
})
const deletePlan = async (id) => {
Modal.confirm({
title: '是否确认删除?',

@ -11,7 +11,7 @@
<!-- 工作计划列表 -->
<div v-if="planListShow" style="width:360px;height: calc( 100vh - 144px);flex:1;">
<planList :planListShow="planListShow" @planDetail="planDetail" @createWorkPlan="toCreateWorkPlan" ></planList>
<planList ref="planListRef" :planListShow="planListShow" @planDetail="planDetail" @createWorkPlan="toCreateWorkPlan" ></planList>
</div>
<!-- 创建计划 -->
@ -198,12 +198,14 @@ const handlerCreateairLineForm = (info)=>{
airLineForm.value = info
}
const planListRef = ref(null);
const successCreatePlan = ()=>{
workPlanFormShow.value = false;
ariLineShow.value = false;
aircraftShow.value = false;
planListShow.value = true;
planListRef.value.getTaskList();
}

Loading…
Cancel
Save