// WFProcess 流程模版基本信息
import { defHttp } from '@/utils/http/axios';
import {
  caseFlowLogParams,
  flowLogModel,
  droneCaseDealModel,
  droneCaseDealParams,
  picListTaskParams,
  caseInfoParams,
  caseInfoModel,
} from './model/index';

enum Api {
  // 获取案件详情步骤条
  GetCaseFlowLog = '/api/DroneCaseinfo/GetCaseFlowLog',
  // 获取案件处理详情
  GetDroneCaseDeal = '/api/DroneCaseinfo/GetDroneCaseDeal',
  // 获取案件详情
  GetCaseInfo = '/api/DroneCaseinfo/GetCaseInfo',
  // 案件列表
  // LoadCaseInfoList = '/api/DroneCaseinfo/LoadCaseInfoList',
  LoadCaseInfoList = '/api/DroneCaseInfoSingle/LoadCaseInfoList',
  // 导出案件
  ExportCaseInfo = "/api/DroneCaseInfoSingle/DroneCaseInfoExport",
  // 案件统计列表
  // 获取GeoJson图层
  GetDroneGeoJson = '/api/DroneCaseinfo/GetDroneGeoJson',
  // 上报案件（案件判读保存）
  AddDroneCaseInfo = '/api/DroneCaseinfo/AddDroneCaseInfo',
  // 案件判读
  UpdateDroneCaseInfoIntact = '/api/DroneCaseinfo/UpdateDroneCaseInfoIntact',
  // 关闭案件
  CloseDroneCaseInfo = '/api/DroneCaseinfo/CloseDroneCaseInfo',
  // 上传图片任务列表
  PicListTask = '/api/DroneShpImageexif/ListTask',
  // 图片上传，创建任务
  PicAddTask = '/api/DroneShpImageexif/AddTask',
  // 图片上传
  AddImageexif = '/api/DroneShpImageexif/AddImageexif',
}

/**
 * @description: getCaseFlowLog
 */
export function getCaseFlowLog(params?: caseFlowLogParams) {
  return defHttp.get<flowLogModel>({ url: Api.GetCaseFlowLog, params });
}
/**
 * @description: getCaseFlowLog
 */
export function getDroneCaseDeal(params?: droneCaseDealParams) {
  return defHttp.get<droneCaseDealModel>({ url: Api.GetDroneCaseDeal, params });
}
/**
 * @description: getCaseFlowLog
 */
export function getCaseInfo(params?: caseFlowLogParams) {
  return defHttp.get<flowLogModel>({ url: Api.GetCaseInfo, params });
}
/**
 * @description: getCaseFlowLog
 */
export function getCaseInfoList(params?: caseInfoParams) {
  return defHttp.get<caseInfoModel>({ url: Api.LoadCaseInfoList, params });
}

export function exportCaseInfo(params:string){
  return defHttp.get<string>({ url: Api.ExportCaseInfo, params });
}
/**
 * @description: getCaseFlowLog
 */
export function getDroneGeoJson(params?: caseFlowLogParams) {
  return defHttp.get<flowLogModel>({ url: Api.GetDroneGeoJson, params });
}

export function addDroneCaseInfo(params) {
  return defHttp.post({
    url: Api.AddDroneCaseInfo,
    params,
  });
}
export function updateDroneCaseInfoIntact(params) {
  return defHttp.post({
    url: Api.UpdateDroneCaseInfoIntact,
    params,
  });
}
export function closeDroneCaseInfo(params?: caseFlowLogParams) {
  return defHttp.get<flowLogModel>({ url: Api.CloseDroneCaseInfo, params });
}

export function getPicListTask(params?: picListTaskParams) {
  return defHttp.get<flowLogModel>({ url: Api.PicListTask, params });
}

export function addPicTask(params) {
  return defHttp.post({
    url: Api.PicAddTask,
    params,
  });
}

export function addImageexif(params) {
  return defHttp.post({
    url: Api.AddImageexif,
    params,
  });
}
