From fa3d0d26b3b37af8761562ab32a31c49b6215c65 Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Mon, 21 Apr 2025 11:45:29 +0800
Subject: [PATCH] feat:调整统计图文字描述转向
---
src/views/SignMachineNest/MachineRight/InspectionRaskList.vue | 48 ++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 40 insertions(+), 8 deletions(-)
diff --git a/src/views/SignMachineNest/MachineRight/InspectionRaskList.vue b/src/views/SignMachineNest/MachineRight/InspectionRaskList.vue
index e0b8d20..2253d3b 100644
--- a/src/views/SignMachineNest/MachineRight/InspectionRaskList.vue
+++ b/src/views/SignMachineNest/MachineRight/InspectionRaskList.vue
@@ -9,7 +9,7 @@
<div :class="tabIndex === 2 ? 'active' : ''" @click="tabClick(2)">历史任务</div>
</div>
<div class="search-box">
- <el-input v-model="searchText" placeholder="请输入搜索内容" class="input-with-select">
+ <el-input v-model="searchText" placeholder="请输入关键字" class="input-with-select">
<template #append>
<el-button :icon="Search" @click="searchNickName" />
</template>
@@ -24,15 +24,14 @@
:infinite-scroll-disabled="busy"
infinite-scroll-immediate="true"
>
- >
<div class="item" v-for="(item, index) in tableList">
<div class="left" @click="taskClick(item)">
<div class="left-t">
- <span>{{ index + 1 }}.</span>
- {{ item.name }}
- <span class="status" :class="item.status === 2 ? 'active' : ''">
+ <div>{{ index + 1 }}.</div>
+ <div class="t-name">{{item.name}}</div>
+ <div class="status" :class="item.status === 2 ? 'active' : ''">
{{ getStatusText(item.status) }}
- </span>
+ </div>
</div>
<div class="left-b">
<img src="../../../assets/images/signMachineNest/machineRight/date.png" alt="" />
@@ -93,6 +92,7 @@
// 单个机巢信息
const singleUavHome = computed(() => store.state.home.singleUavHome)
+const osdVisible = computed(() => store.state.home.osdVisible);
const isMore = ref(true)
// 控制加载状态
@@ -201,6 +201,12 @@
const taskClick = item => {
if (tabIndex.value === 1) {
// 展示当前任务详情
+ if (!item?.device_sns.length) return ElMessage.warning('没有device_sns');
+ if (item?.device_sns?.length !== 1) {
+ // todo 后续开发
+ ElMessage.success('即将跳转到集群调度');
+ return
+ }
currentInfoId.value = item.wayline_job_info_id
isShowCurrentTaskDetails.value = true
} else {
@@ -212,9 +218,25 @@
watch([() => tabIndex.value, () => tableList.value], async ([newTabIndex, newTableList]) => {
if (newTabIndex == 1 && newTableList.length > 0) {
- await getTaskDetails(newTableList[0].wayline_job_info_id)
+ const params = {
+ // 航线信息id
+ wayLineJobInfoId:newTableList[0].wayline_job_info_id,
+ // 当前航线id
+ waylineJobId:newTableList[0].id,
+ }
+ await getTaskDetails(params)
}
})
+
+// 监听如果当前任务飞行完毕,当前任务即消失
+watch(() => store.state.home.deviceState, async (newValue) => {
+ const deviceInfo = newValue?.deviceInfo[osdVisible.value.sn];
+ if (!deviceInfo) return
+ // 重新刷新数据
+ if (deviceInfo?.mode_code === 14) {
+ getJobList()
+ }
+});
const { init: initTaskWayline, removeEntitys } = useTaskWayline()
@@ -312,13 +334,19 @@
.left {
cursor: pointer;
.left-t {
+ display: flex;
height: 24px;
font-size: 16px;
margin-bottom: 4px;
+ .t-name {
+ width: 180px;
+ white-space: nowrap; // 不换行
+ overflow: hidden; // 超出隐藏
+ text-overflow: ellipsis; // 显示省略号
+ }
.status {
text-align: center;
font-size: 12px;
- display: inline-block;
width: 48px;
height: 20px;
background: rgba(76, 166, 255, 0.08);
@@ -335,6 +363,10 @@
.left-b {
height: 21px;
line-height: 21px;
+ width: 260px; // 添加固定宽度
+ white-space: nowrap; // 不换行
+ overflow: hidden; // 超出隐藏
+ text-overflow: ellipsis; // 显示省略号
img {
width: 16px;
height: 16px;
--
Gitblit v1.9.3