提交 fc9367c8 作者: 温凯

fix:任务库处理

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