import { defHttp } from '@/utils/http/axios';
enum Api {
  LoadTaskClueFill = '/api/DroneCaseInfoLzwjf/LoadTaskClueFill',
  // 线索收藏
  AddTaskFavorite = '/api/DroneCaseInfoLzwjf/AddTaskFavorite',
  // 取消收藏
  CancelTaskFavorite = '/api/DroneCaseInfoLzwjf/DeleteTaskCase',
  // 获取待办任务统计数据
  LoadTaskCount = '/api/DroneCaseInfoLzwjf/LoadTaskCount',
  //   获取线索信息统计数据
  LoadDroneCaseInfoCount = '/api/DroneCaseInfoLzwjf/LoadDroneCaseInfoCount',
  // 分页获取线索信息列表
  LoadDroneCaseInfoDetail = '/api/DroneCaseInfoLzwjf/LoadTasklList',
  // 分页获取任务信息列表
  LoadTaskDetailList = '/api/DroneCaseInfoLzwjf/LoadTaskDetailList',
  // 收藏线索
  AddCaseFavorite = '/api/DroneCaseInfoLzwjf/AddCaseFavorite',
  // 获取收藏线索列表
  FavoriteCaseList = '/api/DroneCaseInfoLzwjf/FavoriteCaseList',
  DeleteFavoriteCase = '/api/DroneCaseInfoLzwjf/DeleteFavoriteCase',
  // 获取线索详情
  GetCaseInfoById = '/api/DroneCaseInfoLzwjf/GetCaseInfoById',
  // 更新线索行政区划
  UpdateDroneCaseInfo = '/api/DroneCaseInfoLzwjf/UpdateDroneCaseInfo',
  // 督办流程
  Supervise = '/api/WFProcess/Supervise',
  // 获取部门父级
  LoadParents = '/api/Orgs/LoadParents',
  // 审核列表收藏
  AddtaskFavorite = '/api/DroneCaseInfoLzwjf/AddtaskFavorite',
  // 审核列表删除收藏
  DeleteTaskCase = '/api/DroneCaseInfoLzwjf/DeleteTaskCase',
  // 获取当前账号可以看见的乡镇
  loadStreet = '/api/DroneCaseInfoLzwjf/loadStreet',
  // 违法处理，待办任务列表
  LoadTaskIllegalDetailList = '/api/DroneCaseInfoLzwjf/LoadTaskIllegalDetailList',
  // 分割线索
  SplitCase = '/api/DroneCaseInfoLzwjf/CaseSplit',
  // 恢复还原
  RecoverCase = '/api/DroneCaseInfoLzwjf/CaseRecover',
  // 获取线索中心点
  GetPolygonCenter = '/api/DroneCaseInfoLzwjf/GetCenterPoints',
  // 获取用户访问机构权限
  GetUserOrgs = '/api/Check/GetOrgs',
  // 获取案件图片坐标、方位角信息
  LoadCaseImgList = "/api/DroneCaseInfoSingle/LoadCaseImgList",
  // 线索列表
  LoadCaseInfoTuBanList = '/api/DroneCaseInfoLzwjf/LoadCaseInfoTuBanList',
  CaseOffence = '/api/DroneCaseInfoLzwjf/CaseOffenceLzgdjf',
  LoadCaseInfoListOffence = '/api/DroneCaseInfoLzwjf/LoadCaseInfoListOffence',
}
export function LoadTaskClueFill(params){
  return defHttp.get({ url: Api.LoadTaskClueFill, params });
}
export function AddTaskFavorite(params){
  return defHttp.post({ url: Api.AddTaskFavorite, params });
}
export function CancelTaskFavorite(params){
  return defHttp.post({ url: Api.CancelTaskFavorite, data: params });
}

export function getLoadTaskCount(params?) {
  return defHttp.get({ url: Api.LoadTaskCount, params });
}
export function getLoadStreet() {
  return defHttp.get({ url: Api.loadStreet });
}

/**
 * @description: getCaseFlowLog
 */
export function getLoadDroneCaseInfoCount(params) {
  return defHttp.get({ url: Api.LoadDroneCaseInfoCount, params });
}

/**
 * @description: getCaseFlowLog
 */
export function getLoadDroneCaseInfoDetail(params) {
  return defHttp.get({ url: Api.LoadDroneCaseInfoDetail, params });
}
/**
 * @description: getCaseFlowLog
 */
export function getLoadTaskDetailList(params) {
  return defHttp.get({ url: Api.LoadTaskDetailList, params });
}

export function addCaseFavorite(params) {
  return defHttp.post({ url: Api.AddCaseFavorite, params });
}
export function addTaskFavorite(params?: { taskId: string; favoriteUserId: string }) {
  return defHttp.post({ url: Api.AddtaskFavorite, params });
}
export function deleteFavoriteCase(params: string) {
  return defHttp.post({ url: Api.DeleteFavoriteCase, data: params });
}
export function deleteTaskCase(params: string) {
  return defHttp.post({ url: Api.DeleteTaskCase, data: params });
}

export function getFavoriteCaseList(params?: { uid: string }) {
  return defHttp.get({ url: Api.FavoriteCaseList, params });
}
export function getInspectionAuditCaseInfoById(params?: { id: string }) {
  return defHttp.get({ url: Api.GetCaseInfoById, params });
}
export const updateDroneCaseInfo = (params) =>
  defHttp.post({ url: Api.UpdateDroneCaseInfo, params });

export const updateSupervise = (params: { id: string; supervise: number }) =>
  defHttp.post({ url: `${Api.Supervise}?id=${params.id}&supervise=${params.supervise}`, params });

export const getLoadParents = (params: { childId: Number }) =>
  defHttp.get({ url: `${Api.LoadParents}?childId=${params.childId}` });

export function getLoadTaskIllegalDetailList(params) {
  return defHttp.get({ url: Api.LoadTaskIllegalDetailList, params });
}

export function splitCase(params){
  return defHttp.post({ url: Api.SplitCase, data: params });
}

export function recoverCase(params){
  return defHttp.post({ url: Api.RecoverCase, data: params });
}

export function getPolygonCenter(params){
  return defHttp.get({ url: Api.GetPolygonCenter, params });
}

export function getUserOrgs(params){
  return defHttp.get({ url: Api.GetUserOrgs, params });
}


export function getLoadCaseImgList(params){
  return defHttp.get({
    url: Api.LoadCaseImgList,
    params,
  });
}
export function loadCaseInfoTuBanList(params) {
  return defHttp.get({
    url: Api.LoadCaseInfoTuBanList,
    params,
  });
}
export const getCaseOffence = (params) =>
  defHttp.get({ url: Api.CaseOffence, params });
export const getLoadCaseInfoListOffence = (params) =>
  defHttp.get({ url: Api.LoadCaseInfoListOffence, params });