import { http } from '@/utils/http/axios';
import type {
  TaskExecutionTableData,
  TaskManagementItemResponse,
  DoingTaskExecutionTableDataResponse,
  DoneTaskExecutionTableDataResponse,
} from '@/types/task-execution/tableData';
/**
 * 获取任务管理表格数据
 */
export function getTaskManagementTableData() {
  return http.request<TaskExecutionTableData[]>(
    {
      url: '/admin/task/getTaskManagementList',
      method: 'get',
    },
    {
      ignoreTargetTenantId: true,
    },
  );
}

/**
 * 获取任务管理详情
 */
export function getTaskManagementItem(id: number) {
  return http.request<TaskManagementItemResponse>(
    {
      url: '/admin/task/getTaskManagementItem',
      method: 'get',
      params: {
        id,
      },
    },
    {
      ignoreTargetTenantId: true,
    },
  );
}
/**
 * 获取任务执行进行中表格数据
 */
export function getTaskExecutionDoingTableData() {
  return http.request<DoingTaskExecutionTableDataResponse[]>(
    {
      url: '/admin/task/getTaskDoingList',
      method: 'get',
    },
    {
      ignoreTargetTenantId: true,
    },
  );
}

/**
 * 获取任务执行已完成表格数据
 */
export function getTaskExecutionDoneTableData() {
  return http.request<DoneTaskExecutionTableDataResponse[]>(
    {
      url: 'admin/task/getTaskDoneList',
      method: 'get',
    },
    {
      ignoreTargetTenantId: true,
    },
  );
}
