forked from drone/command-center-dashboard

chenyao
2025-04-09 cc1aacf766bc902001f460fdfce20a9ec2ea097d
src/views/TaskManage/TaskIntermediateContent/TaskIntermediateContent.vue
@@ -1,6 +1,6 @@
<!-- 任务统计表格 -->
<template>
  <SearchBox></SearchBox>
  <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">
@@ -15,9 +15,7 @@
      <el-table-column prop="ai_type_str" label="关联算法"  />
      <el-table-column prop="status" label="任务状态" >
        <template #default="scope">
          <el-tag :type="getStatusType(scope.row.status)">
            {{ getStatusText(scope.row.status) }}
          </el-tag>
          {{ scope.row.status ? getStatusText(scope.row.status) : ''  }}
        </template>
      </el-table-column>
      <el-table-column prop="industry_type_str" label="任务类型" />
@@ -42,22 +40,25 @@
      />
    </div>
  </div>
  <AddTask v-model:show="isShowAddTask" @refresh="searchClick"/>
</template>
<script setup>
import SearchBox from '../SearchBox.vue';
import AddTask from './AddTask.vue';
import { jobList } from '@/api/home/task';
const jobListParams = reactive({
  page: 1,
  limit: 10,
  searchParams:{}
});
const jobListData = ref([]);
const total = ref(0);
// 获取任务列表
const getJobList = () => {
  jobList({current:1,size:10}).then(res => {
  jobList(jobListParams).then(res => {
    if (res.data.code !== 0) return;
    jobListData.value = res.data.data.records;
    total.value = res.data.data.total;
@@ -104,6 +105,20 @@
  getJobList();
};
// 传参查询条件
const searchClick = (params) => {
  jobListParams.page = 1;
  jobListParams.limit = 10;
  jobListParams.searchParams = params;
  getJobList();
};
// 新建任务
const isShowAddTask = ref(false);
const handleAddTask = () => {
  isShowAddTask.value = true;
};
onMounted(() => {
  getJobList();
});
@@ -112,10 +127,10 @@
<style lang="scss" scoped>
.task-intermediate-content {
  position: absolute;
  top: 190px;
  width: calc(100% - 400px - 400px - 100px);
  left: 450px;
  height: 770px;
  top: 400px;
  width: calc(100% - 80px);
  left: 40px;
  height: 500px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;