From 3be2e099bbc05e902dfcfabc403ade0a2aba8ef4 Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Mon, 21 Jul 2025 15:12:44 +0800
Subject: [PATCH] feat:数据中心优化

---
 src/views/job/components/TaskIntermediateContent/TaskIntermediateContent.vue |   75 ++++++++++++++++++++-----------------
 1 files changed, 41 insertions(+), 34 deletions(-)

diff --git a/src/views/job/components/TaskIntermediateContent/TaskIntermediateContent.vue b/src/views/job/components/TaskIntermediateContent/TaskIntermediateContent.vue
index 64fd047..5b3a96a 100644
--- a/src/views/job/components/TaskIntermediateContent/TaskIntermediateContent.vue
+++ b/src/views/job/components/TaskIntermediateContent/TaskIntermediateContent.vue
@@ -17,6 +17,7 @@
 				<el-table-column prop="ai_type_str" label="关联算法" show-overflow-tooltip align="center" />
 				<el-table-column label="任务状态" align="center">
 					<template #default="scope">
+						<div class="base_f_c_c">
 						<span :style="{
 							color:
 								scope.row.status === 1
@@ -33,6 +34,16 @@
 						}">
 							{{ scope.row.status ? getStatusText(scope.row.status) : '' }}
 						</span>
+						<el-tooltip
+								class="item"
+								effect="dark"
+								:content="scope.row.reason"
+								placement="top"
+								popper-class="reasonNotFly ztzf-tooltip-box1"
+							>
+								<el-icon v-if="scope.row.status === 5 && scope.row.reason" color="#FF4848"><QuestionFilled /></el-icon>
+							</el-tooltip>
+						</div>
 					</template>
 				</el-table-column>
 				<el-table-column prop="is_circle_job" label="任务类型" align="center">
@@ -50,43 +61,25 @@
 				<el-table-column prop="creator_name" label="创建人" align="center" show-overflow-tooltip />
 				<el-table-column label="操作" width="200" align="center">
 					<template #default="scope">
-						<div
-							v-if="scope.row.status === 2"
-							class="btnItem"
-							link
-							type="primary"
-							@click="turnBack(scope.row)"
-						>
+						<!-- <el-button type="text" @click="rejectDetail(row.id)">驳回原因</el-button> -->
+						<el-button icon="el-icon-back" v-if="scope.row.status === 2" type="text"
+							@click="turnBack(scope.row)">
 							返航
-						</div>
-						<div
-							v-if="scope.row.status === 1"
-							class="btnItem"
-							link
-							type="primary"
-							@click="cancelTask(scope.row)"
-						>
+						</el-button>
+						<el-button icon="el-icon-close" v-if="scope.row.status === 1" type="text"
+							@click="cancelTask(scope.row)">
 							取消任务
-						</div>
-						<div class="btnItem" link type="primary" @click="handleDetail(scope.row)">查看</div>
+						</el-button>
+						<el-button icon="el-icon-view" type="text" @click="handleDetail(scope.row)">查看</el-button>
 					</template>
 				</el-table-column>
 			</el-table>
 		</div>
 		<div class="pagination">
-			<el-pagination
-				class="ztzf-pagination"
-				popper-class="custom-pagination-dropdown"
-				background
-				:page-sizes="[10, 20, 30, 40,50,100]"
-				:size="size"
-				v-model:current-page="jobListParams.current"
-				v-model:page-size="jobListParams.size"
-				layout="total, sizes, prev, pager, next, jumper"
-				:total="total"
-				@size-change="handleSizeChange"
-				@current-change="handleCurrentChange"
-			/>
+			<el-pagination class="ztzf-pagination" popper-class="custom-pagination-dropdown" background
+				:page-sizes="[10, 20, 30, 40, 50, 100]" :size="size" v-model:current-page="jobListParams.current"
+				v-model:page-size="jobListParams.size" layout="total, sizes, prev, pager, next, jumper" :total="total"
+				@size-change="handleSizeChange" @current-change="handleCurrentChange" />
 		</div>
 	</div>
 	<!-- 添加任务 -->
@@ -108,11 +101,12 @@
 import SearchBox from '../SearchBox.vue'
 import AddTask from './AddTask.vue'
 // import CurrentTaskDetails from '@/components/CurrentTaskDetails/CurrentTaskDetails.vue'
-import { jobList, cancelJobs, taskReturnLines } from '@/api/job/task'
+import { jobList, cancelJobs, taskReturnLines, returnHomeCluster } from '@/api/job/task'
 import { ElMessage } from 'element-plus'
 import DeviceJobDetails from '../DeviceJobDetails.vue'
 import CancelTaskDialog from '../CancelTaskDialog.vue'
 import { useStore } from 'vuex'
+import { cloneDeep } from 'lodash'
 const store = useStore()
 const singleUavHome = computed(() => store.state.home.singleUavHome)
 const jobListParams = reactive({
@@ -129,7 +123,15 @@
 
 // 获取任务列表
 const getJobList = () => {
-	jobList(jobListParams).then(res => {
+	const apiParams = {
+		...cloneDeep(jobListParams),
+		searchParams: {
+			...cloneDeep(jobListParams.searchParams),
+			status_list: jobListParams.searchParams.status || undefined,
+			status: undefined,
+		},
+	}
+	jobList(apiParams).then(res => {
 		if (res.data.code !== 0) return
 		jobListData.value = res.data.data.records
 		total.value = res.data.data.total
@@ -215,7 +217,12 @@
 }
 // 返航
 const turnBack = row => {
-	taskReturnLines(row.device_sns).then(res => {
+	if (row.returnStatus === '待机') return
+
+	if (row.returnStatus === '自动返航') return ElMessage.success('无人机返航中')
+
+	if (row.returnStatus === '自动降落') return ElMessage.success('无人机降落中')
+	returnHomeCluster(row.device_sns).then(res => {
 		if (res.data.code !== 0) return
 		ElMessage.success('返航操作成功')
 		getJobList()
@@ -233,7 +240,7 @@
 	flex: 1;
 	margin: 0 10px 10px 10px;
 	background-color: #ffffff;
-	padding: 20px;
+	padding: 10px 20px;
 	border-radius: 5px;
 	display: flex;
 	flex-direction: column;

--
Gitblit v1.9.3