提交 fc9367c8 作者: 温凯

fix:任务库处理

上级 a4fd3ae7
......@@ -211,17 +211,19 @@ export default {
<style lang="scss" scoped>
.task-add::v-deep {
min-height: 232px;
position: fixed;
top: 20%; /* 设置为 0 */
left: 0; /* 设置为 0 */
right: 0; /* 设置为 0 */
bottom: 0; /* 设置为 0 */
margin: auto; /* 自动边距实现居中 */
width: 660px;
z-index: 1;
display: flex;
flex-direction: column;
gap: 5px;
position: fixed;
max-height: 400px;
top: -24%;
overflow-y: auto;
left: 0;
right: 0;
bottom: 0;
margin: auto;
width: 660px;
z-index: 1;
display: flex;
flex-direction: column;
gap: 5px;
.task-add-header {
flex-shrink: 0;
......
......@@ -58,7 +58,11 @@
</div>
<div class="row__column flex2 ctrl">
<el-tooltip content="查看" placement="top">
<i class="el-icon-position" style @click="onSwitchAirway(item)"></i>
<i
class="el-icon-position"
style
@click="onSwitchAirway(item, true)"
></i>
</el-tooltip>
<el-tooltip content="计划安排" placement="top">
<i class="el-icon-date" @click="onOpenPlan(item)"></i>
......@@ -129,6 +133,8 @@ export default {
timeHandle: null,
selectedTask: null, //选中的任务
loading: false,
executeFlightRouteId: null,
airwayId: null,
};
},
computed: {
......@@ -147,6 +153,10 @@ export default {
type: {
immediate: true,
handler() {
// 切换任务列表时清空航线
this.clearAirwayEntities();
this.airwayId = null;
this.executeFlightRouteId = null;
this.rootNode.$emit("hangarTaskTabChange", {
type: this.type,
});
......@@ -196,23 +206,36 @@ export default {
/**
* 更新任务列表
*/
getTaskList() {
this.rootNode.$emit("taskListGet", {
pageNo: 1,
pageSize: 100,
type: this.type, // 0: 日常任务 1.定时任务 2.周期任务
taskStatus: 11, //筛选掉审核未通过的
hangar: this.hangar,
putDevice: 2,
callback: (res) => {
if (res.taskType == this.type) {
this.taskListAll = res.records || [];
} else {
this.taskListAll = [];
}
},
});
},
getTaskList() {
const params = {
pageNo: 1,
pageSize: 100,
type: this.type, // 0: 日常任务, 1: 定时任务, 2: 周期任务
taskStatus: 11, // 筛选掉审核未通过的
hangar: this.hangar,
putDevice: 2,
callback: this.handleTaskListResponse.bind(this),
};
this.rootNode.$emit("taskListGet", params);
},
handleTaskListResponse(res) {
if (res.taskType !== this.type || res.records.length === 0) {
this.taskListAll = [];
return;
}
this.taskListAll = res.records.sort((a, b) => {
const aIsExecuting = a.status === "执行中";
const bIsExecuting = b.status === "执行中";
return aIsExecuting === bIsExecuting ? 0 : (aIsExecuting ? -1 : 1);
});
const executeFlightRoute = this.taskListAll.find(item => item.status === "执行中");
if (executeFlightRoute && this.executeFlightRouteId !== executeFlightRoute.airwayId) {
this.executeFlightRouteId = executeFlightRoute.airwayId;
this.onSwitchAirway(executeFlightRoute);
}
},
/**
* 显示或隐藏航线
*/
......@@ -225,11 +248,19 @@ export default {
);
if (find) {
this.clearAirwayEntities({ id: airway.id });
if (this.airwayId != airway.id) {
this.createAirwayEntities({
polyline: airway.content,
id: airway.id,
});
this.airwayId = airway.id;
}
} else {
this.createAirwayEntities({
polyline: airway.content,
id: airway.id,
});
this.airwayId = airway.id;
}
},
});
......
......@@ -301,7 +301,7 @@ export default {
position: fixed;
width: 670px;
height: 143px;
top: 20%; /* 设置为 0 */
top:-50%; /* 设置为 0 */
left: 0; /* 设置为 0 */
right: 0; /* 设置为 0 */
bottom: 0; /* 设置为 0 */
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论