From a7e6761ba0cfccdf33ed552eb2d3b783c8e4ab4a Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Wed, 16 Apr 2025 20:49:12 +0800
Subject: [PATCH] feat:事件弹窗显示调整

---
 src/views/TaskManage/TaskIntermediateContent/TaskIntermediateContent.vue |  149 ++++++++++++++++++++++++++++---------------------
 1 files changed, 86 insertions(+), 63 deletions(-)

diff --git a/src/views/TaskManage/TaskIntermediateContent/TaskIntermediateContent.vue b/src/views/TaskManage/TaskIntermediateContent/TaskIntermediateContent.vue
index 299a8f3..da720d5 100644
--- a/src/views/TaskManage/TaskIntermediateContent/TaskIntermediateContent.vue
+++ b/src/views/TaskManage/TaskIntermediateContent/TaskIntermediateContent.vue
@@ -1,39 +1,55 @@
 <!-- 任务统计表格 -->
 <template>
-  <SearchBox @search="searchClick" @addTask="handleAddTask"></SearchBox>
   <div class="task-intermediate-content">
-    <el-table :data="jobListData" style="width: 100%" height="calc(100vh - 180px)">
-      <el-table-column label="序号" width="60">
-        <template #default="scope">
-          {{ (jobListParams.current - 1) * jobListParams.size + scope.$index + 1 }}
-        </template>
-      </el-table-column>
-      <el-table-column prop="job_info_num" label="任务编号" />
-      <el-table-column prop="name" label="任务名称"  />
-      <el-table-column prop="dept_name" label="所属部门"  />
-      <el-table-column prop="device_names" label="所属机巢"  />
-      <el-table-column prop="ai_type_str" label="关联算法"  />
-      <el-table-column label="任务状态" >
-        <template #default="scope">
-          {{ scope.row.status ? getStatusText(scope.row.status) : ''  }}
-        </template>
-      </el-table-column>
-      <el-table-column prop="industry_type_str" label="任务类型" />
-      <el-table-column prop="event_number" label="关联事件" />
-      <el-table-column prop="begin_time" label="任务时间" />
-      <el-table-column prop="creator_name" label="创建人" />
-      <el-table-column label="操作" >
-        <template #default="scope">
-          <el-button link type="primary" @click="handleDetail(scope.row)">查看</el-button>
-        </template>
-      </el-table-column>
-    </el-table>
+    <SearchBox @search="searchClick" @addTask="handleAddTask"></SearchBox>
+    <div class="task-table ztzf-table">
+      <el-table :data="jobListData"
+        :row-class-name="tableRowClassName"
+        :row-style="{ height: '54px', fontSize: '14px', 'text-align': 'center' }"
+        :header-cell-style="{ 'text-align': 'center', height: '36px', fontSize: '14px' }">
+        <el-table-column label="序号" type="index" width="60">
+            <template #default="{ $index }">
+              {{ ($index + 1).toString().padStart(2, '0') }}
+            </template>
+          </el-table-column>
+        <el-table-column prop="job_info_num" label="任务编号" show-overflow-tooltip />
+        <el-table-column prop="name" label="任务名称" show-overflow-tooltip />
+        <el-table-column prop="dept_name" label="所属部门"  />
+        <el-table-column prop="device_names" label="所属机巢"  />
+        <el-table-column prop="ai_type_str" label="关联算法" show-overflow-tooltip />
+        <el-table-column label="任务状态" >
+          <template #default="scope">
+            <span :style="{
+              color: scope.row.status === 1 ? '#e36913' :
+                     scope.row.status === 2 ? '#ffc398' :
+                     scope.row.status === 3 ? '#afd9fb' :
+                     scope.row.status === 4 ? '#11c4ff' : '8cfea7'
+            }">
+              {{ scope.row.status ? getStatusText(scope.row.status) : '' }}
+            </span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="industry_type_str" label="任务类型" />
+        <el-table-column prop="event_number" label="关联事件">
+					<template #default="scope">
+						<span>{{ scope.row.event_number ? scope.row.event_number : '/' }}</span>
+					</template>
+				</el-table-column>
+        <el-table-column prop="begin_time" label="任务时间" />
+        <el-table-column prop="creator_name" label="创建人" />
+        <el-table-column label="操作" >
+          <template #default="scope">
+            <el-button class="current-details" link type="primary" @click="handleDetail(scope.row)">查看</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
     <div class="pagination">
-      <el-pagination
+      <el-pagination class="ztzf-pagination"
         v-model:current-page="jobListParams.current"
         v-model:page-size="jobListParams.size"
         :page-sizes="[10, 20, 30, 50]"
-        layout="total, sizes, prev, pager, next"
+        layout="prev, pager, next, sizes, jumper"
         :total="total"
         @size-change="handleSizeChange"
         @current-change="handleCurrentChange"
@@ -49,8 +65,9 @@
 <script setup>
 import SearchBox from '../SearchBox.vue';
 import AddTask from './AddTask.vue';
-import CurrentTaskDetails from './CurrentTaskDetails.vue';
+import CurrentTaskDetails from './CurrentTaskDetails/CurrentTaskDetails.vue';
 import { jobList } from '@/api/home/task';
+import { ElMessage } from 'element-plus'
 
 const jobListParams = reactive({
   current: 1,
@@ -72,7 +89,7 @@
 const getStatusText = (status) => {
   const statusMap = {
     1: '待执行',
-    2: '执行中',  
+    2: '执行中',
     3: '已完成',
     4: '已取消',
     5: '执行失败'
@@ -84,8 +101,12 @@
 let isShowCurrentTaskDetails = ref(false);
 let rowData = ref({});
 const handleDetail = (row) => {
-  isShowCurrentTaskDetails.value = true;
-  rowData.value = row? row : {};
+	if (row.device_sns.length === 1){
+		isShowCurrentTaskDetails.value = true;
+		rowData.value = row? row : {};
+	}else{
+		ElMessage.warning('即将跳转到集群调度');
+	}
 };
 
 // 分页大小改变
@@ -114,6 +135,14 @@
   isShowAddTask.value = true;
 };
 
+const tableRowClassName = ({ row, rowIndex }) => {
+	if (rowIndex % 2 === 1) {
+		return 'warning-row'
+	} else {
+		return 'success-row'
+	}
+}
+
 onMounted(() => {
   getJobList();
 });
@@ -121,38 +150,32 @@
 
 <style lang="scss" scoped>
 .task-intermediate-content {
-  position: absolute;
-  top: 400px;
-  width: calc(100% - 80px);
-  left: 40px;
-  height: 500px;
-  display: flex;
-  flex-direction: column;
-  justify-content: space-between;
-  
-  :deep(.el-table) {
-    background-color: transparent;
-    --el-table-tr-bg-color: transparent;
-    --el-table-border-color: rgba(255, 255, 255, 0.1);
-    --el-table-header-bg-color: rgba(31, 62, 122, 0.5);
-    --el-table-header-text-color: #fff;
-    --el-table-text-color: #fff;
-    .el-table__body tr:hover > td {
-      background-color: rgba(31, 62, 122, 0.3) !important;
-    }
+  margin: 16px 38px 16px 38px;
+  background: linear-gradient( 27deg, #1F3E7A 0%, rgba(31,62,122,0.35) 79%, rgba(31,62,122,0) 100%);
+  padding: 14px 18px;
+  // 表格
+  .task-table {
+    height: 528px;
+    margin-top: 18px;
+    overflow: auto;
   }
 
-  .pagination {
-    padding: 20px 0;
+  .current-details {
+    width: 53px;
+    height: 27px;
+    background: #001F4E;
+    border-radius: 0px 0px 0px 0px;
+    border: 1px solid #51A8FF;
+  }
+
+  // 分页
+  :deep(.el-pagination) {
     display: flex;
-    justify-content: flex-end;
-    
-    :deep(.el-pagination) {
-      --el-pagination-bg-color: transparent;
-      --el-pagination-text-color: #fff;
-      --el-pagination-button-color: #fff;
-      --el-pagination-hover-color: #409eff;
-    }
+    justify-content: center;
+  }
+  :deep(.el-pagination button) {
+    background: center center no-repeat none !important;
+    color: #8eb8ea !important;
   }
 }
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.9.3