提交 d510a1ff 作者: 翁进城

feat: 机库任务基本完成

上级 9975a12b
...@@ -98,7 +98,7 @@ export default { ...@@ -98,7 +98,7 @@ export default {
}, },
}, },
created() { created() {
this.rootNode.$emit("changeHangarTaskTab", { this.rootNode.$emit("hangarChangeTaskTab", {
type: 1, type: 1,
}); });
}, },
...@@ -134,7 +134,7 @@ export default { ...@@ -134,7 +134,7 @@ export default {
onChangeLine(data) { onChangeLine(data) {
this.selectedAirway = data; this.selectedAirway = data;
if (data) { if (data) {
this.rootNode.$emit("addHangarTask", { this.rootNode.$emit("hangarAddTask", {
type: 1, //1: 日常任务 2.定时任务 3.周期任务 type: 1, //1: 日常任务 2.定时任务 3.周期任务
airway: data, //航线数据 airway: data, //航线数据
callback: (id) => { callback: (id) => {
......
<template>
<div class="task-add">
<div class="task-add-header" v-interact>
<div class="header__title">定时任务</div>
<div class="header-right">
<div class="header-right__close" @click="$emit('close')">关闭</div>
</div>
</div>
<div class="task-add-main">
<el-form ref="form" :model="form" label-width="100px">
<el-form-item label="执行日期" prop="date" required>
<el-date-picker
v-model="form.date"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
size="mini"
popper-class="mmc"
></el-date-picker>
</el-form-item>
<el-form-item label="执行时间" prop="time" required>
<el-time-picker
is-range
v-model="form.time"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
placeholder="选择时间范围"
size="mini"
popper-class="mmc"
></el-time-picker>
</el-form-item>
<el-form-item label="任务名称" required>
<el-select v-model="form.normalTaskId" size="mini" popper-class="mmc" style="width:100%">
<el-option :label="item.name" :value="item.id" v-for="(item, index) in taskList.normal"></el-option>
</el-select>
</el-form-item>
</el-form>
</div>
<div class="task-add-btn">
<div class="task-add__btn" @click="onConfirm">确认</div>
</div>
</div>
</template>
<script>
import { mapState, mapActions } from "vuex";
import { AirLine } from "../../../../../../../../../../../../api";
export default {
name: "TaskAdd",
inject: ["rootNode"],
data() {
return {
form: {
date: [],
time: [],
normalTaskId: "",
},
};
},
computed: {
...mapState("MMCFlightControlCenter/hangar", ["taskList"]),
...mapState("MMCFlightControlCenter", ["airwayEntities"]),
/**
* 选择的日常任务数据
*/
selectedTask() {
let find = this.taskList.normal.find((item) => {
return item.id === this.form.normalTaskId;
});
return find;
},
},
watch: {
selectedTask: {
async handler(newVal, oldVal) {
//清除旧的航线并渲染新航线
let find = this.airwayEntities.find(
(item1) => oldVal?.airwayId === item1.airwayId
);
if (find) {
this.clearAirwayEntities({ id: find.airwayId });
}
//渲染新航线
if (newVal) {
await this.getAirway(newVal);
let airway = JSON.parse(newVal.airway.content);
this.createAirwayEntities({
polyline: airway.content,
id: newVal.airwayId,
});
}
},
},
},
methods: {
...mapActions("MMCFlightControlCenter", [
"createAirwayEntities",
"clearAirwayEntities",
]),
/**
* 将任务中航线对象补充完整
*/
async getAirway(item) {
if (!item.airway) {
let res = await AirLine.routeDetail({
id: item?.airwayId,
});
if (res.code === 200) {
this.$set(item, "airway", res.data);
}
}
},
/**
* 确认事件
*/
onConfirm() {
this.$refs["form"].validate((valid) => {
if (valid) {
this.rootNode.$emit("hangarAddTask", {
type: 3, //1: 日常任务 2.定时任务 3.周期任务
taskList: [this.form], //任务数据
}); // 根节点发送机库任务新增事件
this.$emit("close");
} else {
return false;
}
});
},
},
};
</script>
<style lang="scss" scoped>
.task-add {
height: 286px;
background: rgba(9, 32, 87, 0.7);
border: 1px solid #70daf9;
position: absolute;
top: -5px;
left: 550px;
width: 512x;
z-index: 1;
display: flex;
flex-direction: column;
gap: 5px;
padding-bottom: 20px;
&.more {
height: 376px;
}
.task-add-header {
flex-shrink: 0;
display: flex;
justify-content: space-between;
align-items: center;
height: 32px;
background-image: linear-gradient(
180deg,
#9198ff,
rgba(45, 81, 153, 0.22) 40%,
#05091a
);
border: 1px solid #70daf9;
box-shadow: inset 0 0 10px 2px #3f9dff;
padding: 0 20px;
.header__title {
font-family: MicrosoftYaHei-Bold;
font-size: 16px;
color: #70daf9;
letter-spacing: 0;
font-weight: 700;
}
.header-right {
display: flex;
gap: 20px;
font-family: MicrosoftYaHei;
font-size: 16px;
color: #70daf9;
letter-spacing: 0;
font-weight: 400;
.header-right__close {
font-size: 16px;
cursor: pointer;
}
}
}
.task-add-main {
padding: 20px 20px 0 10px;
}
.task-add-btn {
flex-shrink: 0;
.task-add__btn {
margin: auto;
width: 122px;
height: 32px;
cursor: pointer;
text-align: center;
background-image: linear-gradient(
180deg,
#9198ff,
rgba(45, 81, 153, 0.22) 40%,
#05091a
);
border: 1px solid #70daf9;
box-shadow: inset 0 0 10px 2px #3f9dff;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
}
}
.task-add-more {
background-color: rgba(13, 82, 143, 0.6);
height: 24px;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
}
}
</style>
\ No newline at end of file
<template>
<div class="timed-task">
<div class="timed-task-header">
<div class="header__column flex2">名称</div>
<div class="header__column flex2">时间</div>
<div class="header__column">状态</div>
<div class="header__column flex2">操作</div>
</div>
<div class="timed-task-main">
<div class="row" v-for="item in taskListAll" :key="item.id">
<div class="row__column flex2">
<el-tooltip class="item" effect="dark" :content="item.name" placement="top-start">
<span>{{item.name}}</span>
</el-tooltip>
</div>
<div class="row__column flex2">{{item.time}}</div>
<div class="row__column" style="color: rgb(255, 189, 54);">{{item.status}}</div>
<div class="row__column flex2 ctrl">
<el-tooltip content="查看" placement="top">
<span
class="icon-chakan1 iconfont icon"
style="color: #ffffff; font-size: 10px;"
@click="onSwitchAirway(item)"
></span>
</el-tooltip>
<!-- <el-tooltip content="历史" placement="top">
<img class="icon" style="width: 15px;" src="../../assets/images/history.png" />
</el-tooltip>-->
<!-- <el-tooltip content="禁用" v-if="!item.enable" placement="top">
<img class="icon" style="width: 18px;" src="../../assets/images/enable.png" />
</el-tooltip>
<el-tooltip content="启用" v-if="item.enable" placement="top">
<img class="icon" style="width: 15px;" src="../../assets/images/able.png" />
</el-tooltip>-->
<el-tooltip content="删除" placement="top">
<span class="icon-shanchu iconfont icon" @click="onDelAirway(item)"></span>
</el-tooltip>
</div>
</div>
</div>
<div class="task-add-btn">
<div class="task-add__btn" @click="showTaskAdd = true">创建周期任务</div>
</div>
<TaskAdd v-if="showTaskAdd" @close="showTaskAdd = false"></TaskAdd>
</div>
</template>
<script>
import { mapState, mapActions } from "vuex";
import { AirLine } from "../../../../../../../../../../api";
import TaskAdd from "./components/taskAdd";
export default {
name: "hangarTimedTask",
components: {
TaskAdd,
},
inject: ["rootNode"],
data() {
return {
showTaskAdd: false,
};
},
computed: {
...mapState("MMCFlightControlCenter", ["airwayEntities"]),
...mapState("MMCFlightControlCenter/hangar", [
"hangarRealTimeData",
"hangar",
"taskList",
]),
taskListAll() {
return this.taskList.period || [];
},
},
beforeDestroy() {
this.clearAirwayEntities();
},
methods: {
...mapActions("MMCFlightControlCenter", [
"createAirwayEntities",
"clearAirwayEntities",
]),
/**
* 将任务中航线对象补充完整
*/
async getAirway(item) {
if (!item.airway) {
let res = await AirLine.routeDetail({
id: item?.airwayId,
});
if (res.code === 200) {
item.airway = res.data;
}
}
},
/**
* 显示或隐藏航线
*/
async onSwitchAirway(item) {
await this.getAirway(item);
let find = this.airwayEntities.find(
(item1) => item1.airwayId === item.airwayId
);
if (find) {
this.clearAirwayEntities({ id: find.airwayId });
} else {
let airway = JSON.parse(item.airway.content);
this.createAirwayEntities({
polyline: airway.content,
id: item.airwayId,
});
}
},
async onDelAirway(item) {
try {
await this.$confirm("请确认是否删除该任务?", "安全确认", {
cancelButtonText: "取消",
confirmButtonText: "确定",
customClass: "uav_controlPane",
showClose: false,
});
this.rootNode.$emit("hangarDelTask", {
task: item,
type: 3, // 1: 日常任务 2: 定时任务 3:周期任务
});
} catch (e) {
console.log(e);
}
},
},
};
</script>
<style lang="scss" scoped>
.timed-task {
height: 100%;
display: flex;
flex-direction: column;
padding: 5px 10px 5px;
gap: 8px;
box-sizing: border-box;
.timed-task-header {
display: flex;
flex-shrink: 0;
font-family: MicrosoftYaHei-Bold;
font-size: 14px;
color: #b5e5ff;
padding: 5px 0;
letter-spacing: 0;
font-weight: 700;
background: rgba(87, 96, 138, 0.2);
border: 1px solid rgba(207, 234, 255, 0.33);
gap: 3px;
.header__column {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
&.flex2 {
flex: 2;
}
}
}
.timed-task-main {
color: #fff;
overflow-y: auto;
flex: 1;
.row {
display: flex;
color: #fff;
background: url("../../assets/images/listBg.png");
background-repeat: no-repeat;
background-size: 100% 100%;
height: 33px;
line-height: 33px;
padding-left: 4px;
margin-bottom: 16px;
gap: 3px;
.row__column {
flex: 1;
text-align: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
&.flex2 {
flex: 2;
}
&.ctrl {
display: flex;
justify-content: center;
align-items: center;
gap: 5px;
.icon {
cursor: pointer;
}
}
}
}
}
.task-add-btn {
text-align: center;
.task-add__btn {
width: 122px;
height: 32px;
text-align: center;
line-height: 32px;
margin: 0 auto;
margin-bottom: 10px;
background-image: linear-gradient(
180deg,
#9198ff,
rgba(45, 81, 153, 0.22) 40%,
#05091a
);
border: 1px solid #70daf9;
box-shadow: inset 0 0 10px 2px #3f9dff;
cursor: pointer;
color: #fff;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="task-add" :class="{more: showMore}">
<div class="task-add-header" v-interact>
<div class="header__title">定时任务</div>
<div class="header-right">
<div class="header-right__add" @click="onTaskAdd">
<span class="iconfont icon-zengjia"></span>添加任务
</div>
<div class="header-right__close" @click="$emit('close')">关闭</div>
</div>
</div>
<div class="task-add-main">
<div class="main-item" v-for="(item, index) in list" :key="index">
<el-date-picker
v-model="item.time"
size="mini"
popper-class="mmc"
type="datetime"
placeholder="选择时间"
value-format="yyyy-MM-dd HH:mm:ss"
></el-date-picker>任务名称
<el-select
v-model="item.normalTaskId"
size="mini"
popper-class="mmc"
@change="onChangeTask(item)"
>
<el-option :label="item.name" :value="item.id" v-for="(item, index) in taskList.normal"></el-option>
</el-select>
<el-input class="input" size="mini" :value="item.airway ? item.airway.name : ''" disabled />
<el-tooltip content="删除" placement="top">
<span class="icon-shanchu iconfont" @click="onDelTask(index)"></span>
</el-tooltip>
<el-tooltip content="查看" placement="top">
<span
class="icon-chakan1 iconfont"
style="font-size: 10px;"
@click="onSwitchAirway(item)"
></span>
</el-tooltip>
</div>
</div>
<div class="task-add-btn">
<div class="task-add__btn" @click="onConfirm">确认</div>
</div>
<div class="task-add-more" @click="showMore = !showMore">
<img src="../../../../assets/images/xb.png" width="15" />
</div>
</div>
</template>
<script>
import { mapState, mapActions } from "vuex";
import { AirLine } from "../../../../../../../../../../../../api";
export default {
name: "TaskAdd",
inject: ["rootNode"],
data() {
return {
list: [
/* {
time: '',
normalTaskId: '',
airwayId: ''
} */
],
showMore: false,
};
},
computed: {
...mapState("MMCFlightControlCenter/hangar", ["taskList"]),
...mapState("MMCFlightControlCenter", ["airwayEntities"]),
},
methods: {
...mapActions("MMCFlightControlCenter", [
"createAirwayEntities",
"clearAirwayEntities",
]),
/**
* 将任务中航线对象补充完整
*/
async getAirway(item) {
if (!item.airway) {
let res = await AirLine.routeDetail({
id: item?.airwayId,
});
if (res.code === 200) {
this.$set(item, "airway", res.data);
}
}
},
/**
* 显示或隐藏航线
*/
async onSwitchAirway(item) {
await this.getAirway(item);
let find = this.airwayEntities.find(
(item1) => item1.airwayId === item.airwayId
);
if (find) {
this.clearAirwayEntities({ id: find.airwayId });
} else {
let airway = JSON.parse(item.airway.content);
this.createAirwayEntities({
polyline: airway.content,
id: item.airwayId,
});
}
},
/**
* 添加新任务
*/
onTaskAdd(item) {
this.list.push({
time: "",
normalTaskId: "",
airwayId: "",
});
},
/**
* 任务内容更改
*/
async onChangeTask(item) {
let normalTask = this.selectedTask(item.normalTaskId);
item.airwayId = normalTask.airwayId;
this.getAirway(item);
},
/**
* 删除的任务
*/
onDelTask(index) {
this.list = this.list.filter((item, i) => i !== index);
},
/**
* 选择的日常任务数据
*/
selectedTask(normalTaskId) {
let find = this.taskList.normal.find((item) => {
return item.id === normalTaskId;
});
return find;
},
/**
* 确认事件
*/
onConfirm() {
this.rootNode.$emit("hangarAddTask", {
type: 2, //1: 日常任务 2.定时任务 3.周期任务
taskList: this.list, //任务数据
}); // 根节点发送机库任务新增事件
this.$emit('close');
},
},
};
</script>
<style lang="scss" scoped>
.task-add {
height: 250px;
background: rgba(9, 32, 87, 0.7);
border: 1px solid #70daf9;
position: absolute;
top: -5px;
left: 550px;
width: 700px;
z-index: 1;
display: flex;
flex-direction: column;
gap: 5px;
&.more {
height: 376px;
}
.task-add-header {
flex-shrink: 0;
display: flex;
justify-content: space-between;
align-items: center;
height: 32px;
background-image: linear-gradient(
180deg,
#9198ff,
rgba(45, 81, 153, 0.22) 40%,
#05091a
);
border: 1px solid #70daf9;
box-shadow: inset 0 0 10px 2px #3f9dff;
padding: 0 20px;
.header__title {
font-family: MicrosoftYaHei-Bold;
font-size: 16px;
color: #70daf9;
letter-spacing: 0;
font-weight: 700;
}
.header-right {
display: flex;
gap: 20px;
font-family: MicrosoftYaHei;
font-size: 16px;
color: #70daf9;
letter-spacing: 0;
font-weight: 400;
.header-right__add {
font-size: 12px;
display: flex;
align-items: center;
cursor: pointer;
}
.header-right__close {
font-size: 16px;
cursor: pointer;
}
}
}
.task-add-main {
padding: 20px 20px 0 10px;
flex: 1;
overflow-y: auto;
.main-item::v-deep {
margin-bottom: 20px;
display: flex;
align-items: center;
font-size: 15px;
color: #fff;
gap: 5px;
.el-date-editor {
width: 188px;
}
.el-select {
width: 200px;
}
.input {
width: 150px;
}
.iconfont {
color: rgb(67, 222, 255);
cursor: pointer;
}
}
}
.task-add-btn {
flex-shrink: 0;
.task-add__btn {
margin: auto;
width: 122px;
height: 32px;
cursor: pointer;
text-align: center;
background-image: linear-gradient(
180deg,
#9198ff,
rgba(45, 81, 153, 0.22) 40%,
#05091a
);
border: 1px solid #70daf9;
box-shadow: inset 0 0 10px 2px #3f9dff;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
}
}
.task-add-more {
background-color: rgba(13, 82, 143, 0.6);
height: 24px;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
}
}
</style>
\ No newline at end of file
...@@ -23,32 +23,44 @@ ...@@ -23,32 +23,44 @@
@click="onSwitchAirway(item)" @click="onSwitchAirway(item)"
></span> ></span>
</el-tooltip> </el-tooltip>
<el-tooltip content="历史" placement="top"> <!-- <el-tooltip content="历史" placement="top">
<img class="icon" style="width: 15px;" src="../../assets/images/history.png" /> <img class="icon" style="width: 15px;" src="../../assets/images/history.png" />
</el-tooltip> </el-tooltip>-->
<el-tooltip content="禁用" v-if="!item.enable" placement="top"> <!-- <el-tooltip content="禁用" v-if="!item.enable" placement="top">
<img class="icon" style="width: 18px;" src="../../assets/images/enable.png" /> <img class="icon" style="width: 18px;" src="../../assets/images/enable.png" />
</el-tooltip> </el-tooltip>
<el-tooltip content="启用" v-if="item.enable" placement="top"> <el-tooltip content="启用" v-if="item.enable" placement="top">
<img class="icon" style="width: 15px;" src="../../assets/images/able.png" /> <img class="icon" style="width: 15px;" src="../../assets/images/able.png" />
</el-tooltip> </el-tooltip>-->
<el-tooltip content="删除" placement="top"> <el-tooltip content="删除" placement="top">
<span class="icon-shanchu iconfont icon"></span> <span class="icon-shanchu iconfont icon" @click="onDelAirway(item)"></span>
</el-tooltip> </el-tooltip>
</div> </div>
</div> </div>
</div> </div>
<div class="task-add-btn">
<div class="task-add__btn" @click="showTaskAdd = true">创建定时任务</div>
</div>
<TaskAdd v-if="showTaskAdd" @close="showTaskAdd = false"></TaskAdd>
</div> </div>
</template> </template>
<script> <script>
import { mapState, mapActions } from "vuex"; import { mapState, mapActions } from "vuex";
import { AirLine } from "../../../../../../../../../../api"; import { AirLine } from "../../../../../../../../../../api";
import TaskAdd from "./components/taskAdd";
export default { export default {
name: "hangarTimedTask", name: "hangarTimedTask",
components: {
TaskAdd,
},
inject: ["rootNode"],
data() { data() {
return {}; return {
showTaskAdd: false,
};
}, },
computed: { computed: {
...mapState("MMCFlightControlCenter", ["airwayEntities"]), ...mapState("MMCFlightControlCenter", ["airwayEntities"]),
...@@ -61,7 +73,7 @@ export default { ...@@ -61,7 +73,7 @@ export default {
return this.taskList.timed || []; return this.taskList.timed || [];
}, },
}, },
beforeDestroy(){ beforeDestroy() {
this.clearAirwayEntities(); this.clearAirwayEntities();
}, },
methods: { methods: {
...@@ -72,7 +84,7 @@ export default { ...@@ -72,7 +84,7 @@ export default {
/** /**
* 将任务中航线对象补充完整 * 将任务中航线对象补充完整
*/ */
async getAirway(item){ async getAirway(item) {
if (!item.airway) { if (!item.airway) {
let res = await AirLine.routeDetail({ let res = await AirLine.routeDetail({
id: item?.airwayId, id: item?.airwayId,
...@@ -87,7 +99,9 @@ export default { ...@@ -87,7 +99,9 @@ export default {
*/ */
async onSwitchAirway(item) { async onSwitchAirway(item) {
await this.getAirway(item); await this.getAirway(item);
let find = this.airwayEntities.find((item1) => item1.airwayId === item.airwayId); let find = this.airwayEntities.find(
(item1) => item1.airwayId === item.airwayId
);
if (find) { if (find) {
this.clearAirwayEntities({ id: find.airwayId }); this.clearAirwayEntities({ id: find.airwayId });
} else { } else {
...@@ -98,6 +112,22 @@ export default { ...@@ -98,6 +112,22 @@ export default {
}); });
} }
}, },
async onDelAirway(item) {
try {
await this.$confirm("请确认是否删除该任务?", "安全确认", {
cancelButtonText: "取消",
confirmButtonText: "确定",
customClass: "uav_controlPane",
showClose: false,
});
this.rootNode.$emit("hangarDelTask", {
task: item,
type: 2, // 1: 日常任务 2: 定时任务 3:周期任务
});
} catch (e) {
console.log(e);
}
},
}, },
}; };
</script> </script>
...@@ -177,5 +207,28 @@ export default { ...@@ -177,5 +207,28 @@ export default {
} }
} }
} }
.task-add-btn {
text-align: center;
.task-add__btn {
width: 122px;
height: 32px;
text-align: center;
line-height: 32px;
margin: 0 auto;
margin-bottom: 10px;
background-image: linear-gradient(
180deg,
#9198ff,
rgba(45, 81, 153, 0.22) 40%,
#05091a
);
border: 1px solid #70daf9;
box-shadow: inset 0 0 10px 2px #3f9dff;
cursor: pointer;
color: #fff;
}
}
} }
</style> </style>
\ No newline at end of file
...@@ -31,12 +31,14 @@ ...@@ -31,12 +31,14 @@
<script> <script>
import NormalTask from './components/normalTask'; import NormalTask from './components/normalTask';
import TimedTask from './components/timedTask'; import TimedTask from './components/timedTask';
import PeriodTask from './components/periodTask';
export default { export default {
name: "hangarTaskList", name: "hangarTaskList",
components: { components: {
NormalTask, NormalTask,
TimedTask TimedTask,
PeriodTask
}, },
data() { data() {
return { return {
......
...@@ -161,7 +161,7 @@ export default { ...@@ -161,7 +161,7 @@ export default {
this.$message.error("该机库中没有无人机!"); this.$message.error("该机库中没有无人机!");
} }
this.rootNode.$emit('changeHangar', this.hangar); //根节点发出机库更换事件 this.rootNode.$emit('hangarChange', this.hangar); //根节点发出机库更换事件
} else { } else {
this.$store.commit("MMCFlightControlCenter/hangar/setState", { this.$store.commit("MMCFlightControlCenter/hangar/setState", {
key: "showPanel", key: "showPanel",
...@@ -171,7 +171,7 @@ export default { ...@@ -171,7 +171,7 @@ export default {
key: "hangar", key: "hangar",
value: null, value: null,
}); });
this.rootNode.$emit('changeHangar', null); this.rootNode.$emit('hangarChange', null);
} }
if (this.showPanel) { if (this.showPanel) {
this.$store.commit("MMCFlightControlCenter/setState", { this.$store.commit("MMCFlightControlCenter/setState", {
......
...@@ -186,7 +186,6 @@ export default { ...@@ -186,7 +186,6 @@ export default {
position: absolute; position: absolute;
top: 70px; top: 70px;
right: 30px; right: 30px;
z-index: 1;
.control-list::v-deep { .control-list::v-deep {
display: flex; display: flex;
......
...@@ -179,6 +179,15 @@ export default { ...@@ -179,6 +179,15 @@ export default {
border: 1px solid #2b56b7; border: 1px solid #2b56b7;
} }
.el-range-input {
background-color: transparent;
color: #fff;
}
.el-range-separator {
color: #fff;
}
.el-dialog__body { .el-dialog__body {
button:nth-child(2) { button:nth-child(2) {
box-shadow: inset 0 0 5px #00ffff; box-shadow: inset 0 0 5px #00ffff;
...@@ -370,6 +379,10 @@ export default { ...@@ -370,6 +379,10 @@ export default {
right: -1px; right: -1px;
} }
} }
.el-form-item__label {
color: #fff;
}
} }
.mmc { .mmc {
...@@ -462,5 +475,87 @@ export default { ...@@ -462,5 +475,87 @@ export default {
padding: 0; padding: 0;
} }
} }
.el-popper {
background: rgba(9, 32, 87, 1) !important;
}
// 日期选择器组件
&.el-date-range-picker,
&.el-date-picker {
border: none !important;
.el-picker-panel__body-wrapper {
background: #0d224f;
border: 1px solid #00aeff;
color: #fff;
.el-month-table td.current:not(.disabled) .cell {
color: #00aeff !important;
}
.el-input__inner {
color: #fff;
border: 1px solid #00aeff;
}
.el-date-table td.disabled div {
background-color: transparent;
}
.el-date-table th {
// border-bottom: solid 1px #00aeff;
color: #fff;
}
.el-date-table td.in-range div {
background-color: #00aeff;
}
.el-date-picker__header-label {
color: #fff;
}
.el-input--small .el-input__inner {
background-color: #0d224f;
}
.el-picker-panel__icon-btn {
color: #fff;
}
}
.el-picker-panel__footer {
background-color: #0d224f !important;
}
.popper__arrow {
border-bottom-color: #00aeff !important;
border-top-color: #00aeff !important;
}
.popper__arrow::after {
border-top-color: #0d224f !important;
border-bottom-color: #0d224f !important;
}
.el-button.el-button--mini.is-plain,
.el-button.is-disabled.is-plain {
background-color: transparent !important;
border: none;
color: #00aeff;
}
.el-time-spinner__item {
color: #00eaff;
}
.el-time-panel__btn {
color: #fff;
&.confirm {
color: #409eff;
}
}
}
} }
</style> </style>
\ No newline at end of file
...@@ -31,10 +31,11 @@ ...@@ -31,10 +31,11 @@
:airwayList="airwayList" :airwayList="airwayList"
:scene="scene ? 0 : 1" :scene="scene ? 0 : 1"
@uavStartTask="onUAVStartTask" @uavStartTask="onUAVStartTask"
@changeHangar="onChangeHangar" @hangarChange="onHangarChange"
@changeHangarTaskTab="onChangeHangarTaskTab" @hangarChangeTaskTab="onHangarChangeTaskTab"
@hangarStartTask="hangarStartTask" @hangarStartTask="hangarStartTask"
@addHangarTask="onAddHangarTask" @hangarAddTask="onHangarAddTask"
@hangarDelTask="onHangarDelTask"
></MMCFlightControlCenter> ></MMCFlightControlCenter>
</div> </div>
</div> </div>
...@@ -176,8 +177,8 @@ export default { ...@@ -176,8 +177,8 @@ export default {
/** /**
* 更换机库事件 * 更换机库事件
*/ */
onChangeHangar(hangar) { onHangarChange(hangar) {
console.log("onChangeHangar"); console.log("onHangarChange");
if (hangar) { if (hangar) {
this.hangarTaskList = { this.hangarTaskList = {
// 常态 // 常态
...@@ -205,16 +206,13 @@ export default { ...@@ -205,16 +206,13 @@ export default {
], ],
// 周期 // 周期
period: [ period: [
/* { {
name: '任务', name: "任务",
id: 1, id: 1,
time: '', //定时与周期的时间 time: "2024-04-28 01:00:00 2024-05-28 01:00:00", //定时与周期的时间
status: '', 任务状态 status: "未执行", //任务状态
airway: { airwayId: 105,
name: '航线名称', },
id: 1
}
} */
], ],
}; };
} }
...@@ -224,25 +222,62 @@ export default { ...@@ -224,25 +222,62 @@ export default {
* @param {Object} param * @param {Object} param
* @param {number} param.type 1: 日常任务 2: 定时任务 3:周期任务 * @param {number} param.type 1: 日常任务 2: 定时任务 3:周期任务
* @param {Object} param.airway 航线数据 * @param {Object} param.airway 航线数据
* @param {Function} params.callback 回调,参数为更新后新增的任务id * @param {Function} params.callback 回调,参数为更新后新增的任务id, 仅日常任务有用
* @param {Array} param.taskList 定时与周期任务创建的任务数组
*/ */
onAddHangarTask({ type, airway, callback }) { onHangarAddTask({ type, airway, callback, taskList }) {
console.log("onAddHangarTask", type, airway); console.log("onHangarAddTask", type, airway, taskList);
let id = Date.now(); switch (type) {
this.hangarTaskList.normal.push({ case 1: {
name: "任务" + id, let id = Date.now();
id: id, this.hangarTaskList.normal.push({
airwayId: airway.id, name: "任务" + id,
}); id: id,
callback(id); airwayId: airway.id,
});
callback(id);
break;
}
case 2: {
let id = Date.now();
let _taskList = taskList.map((item, i) => {
return {
...item,
id: id + String(i),
status: "未执行",
name: "任务" + (this.hangarTaskList.timed.length + 1),
};
});
this.hangarTaskList.timed =
this.hangarTaskList.timed.concat(_taskList);
break;
}
case 3: {
let id = Date.now();
let _taskList = taskList.map((item, i) => {
return {
...item,
id: id + String(i),
status: "未执行",
name: "任务" + (this.hangarTaskList.period.length + 1),
time: `${item.date[0]} ${item.time[0]} ${item.date[1]} ${item.time[1]}`
};
});
this.hangarTaskList.period =
this.hangarTaskList.period.concat(_taskList);
break;
}
}
}, },
/** /**
* 机库任务tab更改事件 * 机库任务tab更改事件
* @param {object} param * @param {object} param
* @param {number} param.type 1: 日常任务 2: 定时任务 3:周期任务 * @param {number} param.type 1: 日常任务 2: 定时任务 3:周期任务
*/ */
onChangeHangarTaskTab({ type }) { onHangarChangeTaskTab({ type }) {
console.log("onChangeHangarTaskTab", type); console.log("onHangarChangeTaskTab", type);
}, },
/** /**
* 机库开始任务 * 机库开始任务
...@@ -254,6 +289,28 @@ export default { ...@@ -254,6 +289,28 @@ export default {
hangarStartTask({ type, hangar, task, airway }) { hangarStartTask({ type, hangar, task, airway }) {
console.log("hangarStartTask", type, hangar, task, airway); console.log("hangarStartTask", type, hangar, task, airway);
}, },
/**
* 删除机库任务
* @param {object} param
* @parma {number} param.type 1: 日常任务 2: 定时任务 3:周期任务
* @param {object} param.task 任务对象
*/
onHangarDelTask({ type, task }) {
console.log("onHangarDelTask", type, task);
switch (type) {
case 2:
this.hangarTaskList.timed = this.hangarTaskList.timed.filter(
(item) => item.id !== task.id
);
break;
case 3:
this.hangarTaskList.period = this.hangarTaskList.period.filter(
(item) => item.id !== task.id
);
break;
}
},
async login() { async login() {
let formData = new FormData(); let formData = new FormData();
formData.append("userAccount", this.account); formData.append("userAccount", this.account);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论