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

enum Api {
  listDepart = '/stm.common/action/listDepart',
  checklist = '/project.create/stProjectPrepare/checklist',
  addBatchProjectCheck = '/project.create/stProjectPrepare/addBatchProjectCheck',
  
  listDuty = '/stm.common/action/listDuty',
  addOneStep='/project.create/stProjectCre/addOneStep',
  addTwoStep='/project.create/stProjectCre/addTwoStep',
  add3Step='/project.create/stProjectCre/add3Step',
  add4Step = '/project.create/stProjectCre/add4Step',
  add5Step = '/project.create/stProjectCre/add5Step',
  add6Step='/project.create/stProjectCre/add6Step',
  add7Step = '/project.create/stProjectCre/add7Step',
  submitPrepate = '/project.create/stProjectCre/submitPrepate',
  queryPerpetratePageList = '/project.create/stProjectPrepare/queryPerpetratePageList',
  addPerpetrate = '/project.create/stProjectPrepare/addPerpetrate',
  deletePerpetrate = '/project.create/stProjectPrepare/deletePerpetrate',

  deleteProjectCheck = '/project.create/stProjectPrepare/deleteProjectCheck',

  queryNoCheckCount = '/project.create/stProjectPrepare/queryNoCheckCount',
  editProjectCheck = '/project.create/stProjectPrepare/editProjectCheck',
  editProjectCheckDuty = '/project.create/stProjectPrepare/editProjectDutyCheck',
  batchEditProjectDutyCheck = '/project.create/stProjectPrepare/batchEditProjectDutyCheck',
  queryNoDutyCount = '/project.create/stProjectPrepare/queryNoDutyCount',
  gatherlist = '/project.create/stProjectPrepare/gatherlist',
  queryNoGatherCount = '/project.create/stProjectPrepare/queryNoGatherCount',
  interviewlist = '/project.create/stProjectPrepare/interviewlist',
  queryNoInterviewCount = '/project.create/stProjectPrepare/queryNoInterviewCount',
  editProjectGatherCheck = '/project.create/stProjectPrepare/editProjectGatherCheck',
  batchEditProjectGatherCheck = '/project.create/stProjectPrepare/batchEditProjectGatherCheck',
  save2Submit = '/project.create/stProjectCre/save2Submit',
  projectImport = '/project.create/stProjectCre/projectImport',
  upFileProjectGatherCheck = '/project.create/stProjectPrepare/upFileProjectGatherCheck',
  editProjectPlan = '/project.create/stProjectPrepare/editProjectPlan',
  batchEditProjectPlan = '/project.create/stProjectPrepare/batchEditProjectPlan',
  exportGatherXls = '/project.create/stProjectPrepare/exportGatherXls',
  exportInterviewXls = '/project.create/stProjectPrepare/exportInterviewXls',
  addByActCollenct = '/project.create/stProjectPrepare/addByActCollenct',
}

export const getExportGatherXls = Api.exportGatherXls;
export const getExportInterviewXls = Api.exportInterviewXls;
/**
 * 列表接口
 * @param params
 */
export const listDepart = (params) =>
  defHttp.get({url: Api.listDepart, params});

export const checklist = (params) =>
  defHttp.get({url: Api.checklist, params});
export const gatherlist = (params) =>
  defHttp.get({url: Api.gatherlist, params});
export const interviewlist = (params) =>
  defHttp.get({url: Api.interviewlist, params});  

export const queryNoCheckCount = (params) =>
  defHttp.get({url: Api.queryNoCheckCount, params});  

export const queryNoDutyCount =  (params) =>
  defHttp.get({url: Api.queryNoDutyCount, params}); 

export const queryNoGatherCount = (params) =>
  defHttp.get({url: Api.queryNoGatherCount, params});  

export const queryNoInterviewCount = (params) =>
  defHttp.get({url: Api.queryNoInterviewCount, params});  

export const listDuty = (params) =>
  defHttp.get({url: Api.listDuty, params});

export const addPerpetrate = (params) => {
  return defHttp.post({url: Api.addPerpetrate, params});
}
export const deletePerpetrate = (params,handleSuccess) => {
  return defHttp.delete({url: Api.deletePerpetrate, params}, {joinParamsToUrl: true}).then(() => {
    handleSuccess();
  });
}

export const deleteProjectCheck = (params,handleSuccess) => {
  return defHttp.delete({url: Api.deleteProjectCheck, params}, {joinParamsToUrl: true}).then(() => {
    handleSuccess();
  });
}



export const addOneStep = (params) => {
  return defHttp.post({url: Api.addOneStep, params});
}
export const addTwoStep = (params) => {
  return defHttp.post({url: Api.addTwoStep, params});
}
export const add3Step = (params) => {
  return defHttp.post({url: Api.add3Step, params});
}
export const add4Step = (params) => {
  return defHttp.post({url: Api.add4Step, params});
}
export const add5Step = (params) => {
  return defHttp.post({url: Api.add5Step, params});
}
export const add6Step = (params) => {
  return defHttp.post({url: Api.add6Step, params});
}
export const add7Step = (params) => {
  return defHttp.post({url: Api.add7Step, params});
}
export const submitPrepate = (params) => {
  return defHttp.post({url: Api.submitPrepate, params});
}
export const save2Submit = (params) => {
  return defHttp.post({url: Api.save2Submit, params});
}
export const projectImport = (params) => {
  return defHttp.post({url: Api.projectImport, params});
}
export const queryPerpetratePageList = (params) =>
  defHttp.get({url: Api.queryPerpetratePageList, params});
export const editProjectCheck = (params) => {
  return defHttp.post({url: Api.editProjectCheck, params});
}
export const editProjectCheckDuty = (params) =>{
  return defHttp.post({url: Api.editProjectCheckDuty, params});
}
export const upFileProjectGatherCheck = (params) =>{
  return defHttp.post({url: Api.upFileProjectGatherCheck, params});
}
export const batchEditProjectDutyCheck = (params) =>{
  return defHttp.post({url: Api.batchEditProjectDutyCheck, params});
}

export const editProjectGatherCheck = (params) =>{
  return defHttp.post({url: Api.editProjectGatherCheck, params});
}

export const batchEditProjectGatherCheck = (params) =>{
  return defHttp.post({url: Api.batchEditProjectGatherCheck, params});
}

export const editProjectPlan = (params) =>{
  return defHttp.post({url: Api.editProjectPlan, params});
}

export const batchEditProjectPlan = (params) =>{
  return defHttp.post({url: Api.batchEditProjectPlan, params});
}

export const addBatchProjectCheck = (params,handleSuccess) =>{
  return defHttp.post({url: Api.addBatchProjectCheck, params}).then(() => {
    handleSuccess();
  });
}

export const addByActCollenct = (params,handleSuccess) =>{
  return defHttp.post({url: Api.addByActCollenct, params}).then(() => {
    handleSuccess();
  });
}








/**
 * truncate ST_PROJECT_ORG; 
truncate ST_PROJECT_USER; 
truncate ST_PROJECT_SYS; 
truncate ST_PROJECT_OUTSOURCER; 
truncate ST_PROJECT_XM;
truncate ST_PROJECT_ACT;
truncate ST_PROJECT_PERPETRATE;
truncate ST_PROJECT_CHECK;
truncate ST_PROJECT_GATHER;
truncate ST_PROJECT_INTERVIEW;
 */