forked from drone/command-center-dashboard

罗广辉
2025-04-21 2800fa4f32f3900509cb4d6eefaf2bfaf54efdd7
src/views/TaskManage/TaskIntermediateContent/TaskIntermediateContent.vue
@@ -19,11 +19,11 @@
        <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'
            <span :style="{
              color: scope.row.status === 1 ? '#ffe17e' :
                     scope.row.status === 2 ? '#ffa768' :
                     scope.row.status === 3 ? '#8effac' :
                     scope.row.status === 5 ? '#ff8e8e':''
            }">
              {{ scope.row.status ? getStatusText(scope.row.status) : '' }}
            </span>
@@ -35,7 +35,7 @@
                  <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="create_time" label="任务时间" />
        <el-table-column prop="creator_name" label="创建人" />
        <el-table-column label="操作" >
          <template #default="scope">
@@ -59,14 +59,24 @@
  <!-- 添加任务 -->
  <AddTask v-model:show="isShowAddTask" @refresh="searchClick"/>
  <!-- 当前任务详情 -->
  <CurrentTaskDetails v-model:show="isShowCurrentTaskDetails" :rowData="rowData"/>
  <CurrentTaskDetails
      v-if="isShowCurrentTaskDetails"
      v-model:show="isShowCurrentTaskDetails"
      :id="rowData.id"/>
   <!-- 历史任务详情 -->
  <DeviceJobDetails
      v-if="isShowDeviceJobDetails"
      v-model:show="isShowDeviceJobDetails"
      :wayLineJodInfoId="rowData.id"/>
</template>
<script setup>
import SearchBox from '../SearchBox.vue';
import AddTask from './AddTask.vue';
import CurrentTaskDetails from './CurrentTaskDetails.vue';
import CurrentTaskDetails from '@/components/CurrentTaskDetails/CurrentTaskDetails.vue';
import { jobList } from '@/api/home/task';
import { ElMessage } from 'element-plus'
import DeviceJobDetails from '@/components/DeviceJobDetails/DeviceJobDetails.vue'
const jobListParams = reactive({
  current: 1,
@@ -75,6 +85,8 @@
});
const jobListData = ref([]);
const total = ref(0);
let isShowDeviceJobDetails = ref(false);
let isShowCurrentTaskDetails = ref(false);
// 获取任务列表
const getJobList = () => {
@@ -89,7 +101,7 @@
  const statusMap = {
    1: '待执行',
    2: '执行中',
    3: '已完成',
    3: '已执行',
    4: '已取消',
    5: '执行失败'
  };
@@ -97,11 +109,16 @@
};
// 查看当前任务详情 如果是一台机则显示详情 如果是多台机则进入集群调度(暂未开发)
let isShowCurrentTaskDetails = ref(false);
let rowData = ref({});
const handleDetail = (row) => {
  isShowCurrentTaskDetails.value = true;
  rowData.value = row? 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.status === 2 || row.status === 1){
      isShowCurrentTaskDetails.value = true;
   } else{
      isShowDeviceJobDetails.value = true
   }
};
// 分页大小改变