From 5808f76456ca0d40de5074f132b73a5a488e3e13 Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Tue, 09 Dec 2025 09:12:03 +0800
Subject: [PATCH] Merge branch 'refs/heads/feature/v9.0/9.0.1' into test

---
 src/views/job/components/TaskIntermediateContent/TaskIntermediateContent.vue |   85 ++++++++++++++++++++++++++++++++++++------
 1 files changed, 73 insertions(+), 12 deletions(-)

diff --git a/src/views/job/components/TaskIntermediateContent/TaskIntermediateContent.vue b/src/views/job/components/TaskIntermediateContent/TaskIntermediateContent.vue
index c01804a..bc543ab 100644
--- a/src/views/job/components/TaskIntermediateContent/TaskIntermediateContent.vue
+++ b/src/views/job/components/TaskIntermediateContent/TaskIntermediateContent.vue
@@ -3,17 +3,28 @@
 	<div class="task-intermediate-content">
 		<SearchBox @search="searchClick" @addTask="handleAddTask"></SearchBox>
 		<div class="task-table">
-			<el-table border :data="jobListData" class="custom-header" @cell-click="handleCellClick">
+			<el-table border :data="jobListData" class="custom-header">
 				<el-table-column label="序号" type="index" width="60">
 					<template #default="{ $index }">
 						{{ ($index + 1 + (jobListParams.current - 1) * jobListParams.size).toString().padStart(2,
 							'0') }}
 					</template>
 				</el-table-column>
-				<el-table-column prop="job_info_num" label="任务编号" show-overflow-tooltip align="center" />
-				<el-table-column prop="name" label="任务名称" show-overflow-tooltip align="center" />
-				<el-table-column prop="dept_name" label="所属部门" width="200" align="center" />
-				<el-table-column prop="device_names" label="所属机巢" />
+        <el-table-column prop="job_info_num" label="任务编号" width="160">
+          <template #default="scope">
+            <el-tooltip-copy :content="scope.row.job_info_num" :showCopyText="true">
+              {{scope.row.job_info_num}}
+            </el-tooltip-copy>
+          </template>
+        </el-table-column>
+        <el-table-column prop="name" label="任务名称" width="160">
+          <template #default="scope">
+            <el-tooltip-copy :content="scope.row.name" :showCopyText="true">
+              {{scope.row.name}}
+            </el-tooltip-copy>
+          </template>
+        </el-table-column>
+				<el-table-column prop="device_names" label="所属机巢" show-overflow-tooltip/>
 				<el-table-column prop="ai_type_str" label="关联算法" show-overflow-tooltip align="center" />
 				<el-table-column label="任务状态" align="center">
 					<template #default="scope">
@@ -58,6 +69,7 @@
 					</template>
 				</el-table-column>
 				<el-table-column prop="cycle_time_value" label="任务时间" show-overflow-tooltip />
+        <el-table-column prop="dept_name" label="创建部门" width="200" align="center" />
 				<el-table-column prop="creator_name" label="创建人" align="center" show-overflow-tooltip />
 				<el-table-column label="操作" width="200" align="center">
 					<template #default="scope">
@@ -73,9 +85,19 @@
 						<el-button icon="el-icon-view" type="text" @click="handleDetail(scope.row)">查看</el-button>
 					</template>
 				</el-table-column>
+        <template #empty>
+          <el-empty
+            class="custom-empty"
+            :image-size="100"
+          >
+            <template #description>
+              <span class="custom-text">暂无数据</span>
+            </template>
+          </el-empty>
+        </template>
 			</el-table>
 		</div>
-		<div class="pagination">
+		<div class="pagination" v-if="jobListData.length > 0">
 			<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"
@@ -88,11 +110,11 @@
 	<!-- <CurrentTaskDetails
 		v-if="isShowCurrentTaskDetails"
 		v-model:show="isShowCurrentTaskDetails"
-		:wayLineJodInfoId="rowData.id"
+		:wayLineJobInfoId="rowData.id"
 	/> -->
 	<!-- 历史任务详情 -->
-	<DeviceJobDetails v-if="isShowDeviceJobDetails" v-model:show="isShowDeviceJobDetails" :wayLineJodInfoId="rowData.id"
-		:batchNo="rowData.batch_no" />
+	<DeviceJobDetails v-if="isShowDeviceJobDetails" v-model:show="isShowDeviceJobDetails" :wayLineJobInfoId="rowData.id"
+		:batchNo="rowData.batch_no" :jobId="jobId"/>
 	<CancelTaskDialog ref="cancelTaskDialogRef" v-model:isShowCancelTask="isShowCancelTask" :row-data="rowData"
 		@refresh="getJobList" />
 </template>
@@ -101,12 +123,14 @@
 import SearchBox from '../SearchBox.vue'
 import AddTask from './AddTask.vue'
 // import CurrentTaskDetails from '@/components/CurrentTaskDetails/CurrentTaskDetails.vue'
-import { jobList, cancelJobs, taskReturnLines, returnHomeCluster } from '@/api/job/task'
+import { jobList, cancelJobs, taskReturnLines, returnHomeCluster, statusChangedApi } 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'
+import { inject, onBeforeUnmount } from 'vue';
+import ElTooltipCopy from '@/components/ElTooltipCopy.vue';
 const store = useStore()
 const singleUavHome = computed(() => store.state.home.singleUavHome)
 const jobListParams = reactive({
@@ -152,15 +176,22 @@
 
 // 查看当前任务详情 如果是一台机则显示详情 如果是多台机则进入集群调度(暂未开发)
 let rowData = ref({})
+const jobId = ref('')
 const handleDetail = row => {
 	if (!row.device_sns.length) return ElMessage.warning('没有device_sns')
-	if (row.device_sns.length !== 1) return ElMessage.success('即将跳转到集群调度')
 	rowData.value = row ? row : {}
+	if (row.device_sns.length > 1 && (row.status === 2 || row.status === 1)) {
+		const adminUrl = `${import.meta.env.VITE_APP_AREA_NAME}/command-center-dashboard/#/clusterScheduling`
+		const targetPath = `taskNo=${encodeURIComponent(rowData.value.job_info_num)}`
+		window.open(`${adminUrl}?${targetPath}`, '_blank')
+		return
+	}
+	jobId.value = rowData.value?.job_id
 	if (row.status === 2 || row.status === 1) {
 		// isShowCurrentTaskDetails.value = true
 		// 跳转大屏当前任务详情
 		const adminUrl = `${import.meta.env.VITE_APP_AREA_NAME}/command-center-dashboard/#/taskManage`
-		const targetPath = `id=${encodeURIComponent(rowData.value.id)}&batchNo=${encodeURIComponent(rowData.value.batch_no)}`
+		const targetPath = `id=${encodeURIComponent(rowData.value.id)}&batchNo=${encodeURIComponent(rowData.value.batch_no)}&dockSn=${encodeURIComponent(rowData.value.device_sns[0])}`
 		window.open(`${adminUrl}?${targetPath}`, '_blank')
 	} else {
 		isShowDeviceJobDetails.value = true
@@ -241,6 +272,20 @@
 	}
 }
 
+
+const changeKey = inject('changeKey')
+const jobUpdateKey = computed(() => store.state.common.jobUpdateKey)
+const deviceUpdateKey = computed(() => store.state.common.deviceUpdateKey)
+
+watch([jobUpdateKey,deviceUpdateKey],()=>{
+  getJobList()
+  changeKey.value++
+})
+
+onBeforeUnmount(() => {
+  // clearInterval(polling)
+})
+
 onMounted(() => {
 	// getJobList()
 })
@@ -263,7 +308,22 @@
 		flex: 1;
 		margin-top: 18px;
 		overflow: auto;
+    :deep(.el-scrollbar__view) {
+      height: 100%;
+    }
+    :deep(.el-table--fit,.el-scrollbar__view) {
+      height: 100%;
+    }
 	}
+
+  .custom-empty {
+    //font-family: Source Han Sans CN, Source Han Sans CN;
+    //margin-top: 15%;
+    //.custom-text {
+    //  color: #fff;
+    //  font-size: 16px;
+    //}
+  }
 
 	.btnItem {
 		height: 27px;
@@ -309,6 +369,7 @@
 
 	:deep(.el-pagination) {
 		display: flex;
+    padding: 20px 0;
 		justify-content: right;
 	}
 

--
Gitblit v1.9.3