import request from '@/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/nh/powerStation/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getLazyTree = (parentId,parentName,level) => {
  return request({
    url: '/nh/powerStation/lazy-tree',
    method: 'get',
    params: {
      parentId,
      parentName,
      level,
    }
  })
}

export const getTotalTree = () => {
  return request({
    url: '/nh/powerStation/total-tree',
    method: 'get',
    params: {
    }
  })
}

export const queryList = (params) => {
  return request({
    url: '/nh/powerStation/list',
    method: 'get',
    params: {
      ...params
    }
  })
}

export const mapSearch = (keyword) => {
  return request({
    url: '/nh/powerStation/mapSearch',
    method: 'get',
    params: {
      keyword
    }
  })
}

export const staticsHomeOverview = () => {
  return request({
    url: '/nh/powerStation/staticsHomeOverview',
    method: 'get'
  })
}

export const getStatusCount = () => {
  return request({
    url: '/nh/powerStation/staticsStatus',
    method: 'get'
  })
}

export const getMapDistribute = () => {
  return request({
    url: '/nh/powerStation/getMapDistribute',
    method: 'get'
  })
}

export const getDetail = (id) => {
  return request({
    url: '/nh/powerStation/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const powerGenerationTrends = (id,type,time) => {
  return request({
    url: '/nh/powerStation/powerGenerationTrends',
    method: 'get',
    params: {
      'entryId':id,
      "type":type,
      "time":time
    }
  })
}

export const projectCompanyGenerationData = (type) => {
  return request({
    url: '/nh/powerStation/projectCompanyGenerationData',
    method: 'get',
    params: {
      "type":type
    }
  })
}


export const powerGenerationTrendsHome = (type) => {
  return request({
    url: '/nh/powerStation/powerGenerationTrendsHome',
    method: 'get',
    params: {
      "type":type
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/nh/powerStation/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/nh/powerStation/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/nh/powerStation/submit',
    method: 'post',
    data: row
  })
}

//绑定服务商
export const bindingSite = (row) => {
  return request({
    url: '/nh/powerStation/bindingSite',
    method: 'post',
    params: row
  })
}

