import request from '@/utils/request';

//根据变电站Id查询巡视任务
export function getTaskByStationId(params:any){
  return request({
    url: '/patroltasks/task/getTaskByStationId' ,
    method: 'get',
    params:params
  });
}

//分页查询巡视任务执行情况
export function getTaskToDoList(params:any){
  return request({
    url: '/patroltasks/task-todo/getTaskToDoPage' ,
    method: 'get',
    params:params
  });
}
//查询巡视任务执行情况详情
export function getTaskToDo(params:any){
  return request({
    url: '/patroltasks/task-todo/getTaskToDo' ,
    method: 'get',
    params:params
  });
}

//分页查询检修计划
export function getTaskList(params:any){
  return request({
    url: '/patroltasks/examine-plan/getTaskList' ,
    method: 'get',
    params:params
  });
}

//新增检修计划
export function addExaminePlan(params:any){
  return request({
    url: '/patroltasks/examine-plan/addExaminePlan' ,
    method: 'post',
    data:params
  });
}
//修改检修计划
export function updateExaminePlan(params:any){
  return request({
    url: '/patroltasks/examine-plan/updateExaminePlan' ,
    method: 'post',
    data:params
  });
}


export function deleteExaminePlan(params: any) {
  return request({
      url: '/patroltasks/examine-plan/deleteExaminePlan',
      method: 'post',
      params: params
  });
}

//根据Id查询关联信息
export function getBindInfoById(params: any) {
  return request({
      url: '/patroltasks/examine-plan/getBindInfoById',
      method: 'get',
      params: params
  });
}
//设置检修计划是否启用
export function setExaminePlanStatus(params:any){
  return request({
    url: '/patroltasks/examine-plan/setExaminePlanStatus' ,
    method: 'post',
    params:params
  });
}

//获取区域下所有间隔
export function getSubstationBayByArea(params: any) {
  return request({
      url: '/basedata/substation/getSubstationBayByArea',
      method: 'get',
      params: params
  });
}

//获取通过间隔查部件
export function getComponentByBayId(params:any){
  return request({
    url: '/basedata/substation-maindevice/getComponentByBayId' ,
    method: 'get',
    params:params
  });
}
//查询变电站数据同步日志
export function querylog(params:any){
  return request({
    url: '/stationnode/translog/querylog' ,
    method: 'get',
    params:params
  });
}
//查询检修巡视点位
export function getBindExamineDevice(params:any){
  return request({
    url: '/patroltasks/examine-plan/getBindExamineDevice' ,
    method: 'get',
    params:params
  });
}