import { defHttp } from '@/utils/http/axios';

enum Api {
  // 任务区
  GetTaskList = '/api/InsTaskHall/GetTaskList',
  // 根据任务id获取分组任务
  GetgrouptaskList = '/api/InsTaskHall/GetgrouptaskList',
  // 领取任务
  ReciveTask = '/api/InsTaskHall/ReciveTask',
  // 已完成任务
  GetCompleteTaskList = '/api/InsTaskHall/GetCompleteTaskList',
  // 最佳员工排行
  GetRankingList = '/api/InsTaskHall/GetRankingList',
  // 组排名
  GetGroupRankingList = '/api/InsTaskHall/GetGroupRankingList',
  // 在线办理
  GetTaskingList = '/api/InsTaskHall/GetTaskingList',
}

export const GetTaskList = () => defHttp.get({ url: Api.GetTaskList });

export const GetgrouptaskList = (params:{ id: string }) => {
  return defHttp.get({ 
    url: Api.GetgrouptaskList,
    params,
  })
};

export const ReciveTask = ( data: string[] ) => {
  return defHttp.post({
    url: Api.ReciveTask,
    data,
  })
}

export const GetCompleteTaskList = () => defHttp.get({ url: Api.GetCompleteTaskList });

export const GetRankingList = (params:{ flag: string }) => {
  return defHttp.get({ 
    url: Api.GetRankingList,
    params,
  })
};

export const GetGroupRankingList = () => defHttp.get({ url: Api.GetGroupRankingList });

export const GetTaskingList = () => defHttp.get({ url: Api.GetTaskingList });