import request from '@/utils/request'

const projectplan = (data) => {
  return request({
    url: `projectplan/listByPage?windpower=${data.windpower}&pagenum=${data.pagenum}&pagesize=${data.pagesize}`,
    method: 'get',
  })
}
const addProjectplan = (pairs) => {
  return request({
    url: `projectplan/add-modify-projectplan`,
    method: 'post',
    data: pairs,
  })
}
const removeProjectplan = (data) => {
  return request({
    url: `/projectplan/remove-projectplans/${data.id}`,
    method: 'delete',
  })
}
const wtls = (data) => {
  return request({
    url: `/back/wtls`,
    method: 'get',
  })
}

const indicators = (data) => {
  return request({
    url: `indicators/List?stationid=${data.windpowerstationid}&stationname=${data.name}&pageNum=${data.pagenum}&pageSize=${data.pagesize}`,
    method: 'get',
  })
}
const addIndicators = (pairs) => {
  return request({
    url: `indicators/add`,
    method: 'post',
    data: pairs,
  })
}
const removeIndicators = (data) => {
  return request({
    url: `/indicators/${data.id}`,
    method: 'delete',
  })
}
const newtreeTreels = (data) => {
  return request({
    url: `/newtree/treels?tag=${data.tag}`,
    method: 'get',
  })
}

// 可研电量
const projectstudy = (data) => {
  return request({
      url:`/projectstudy/List?windpower=${data.windpower}&pageNum=${data.pageNum}&pageSize=${data.pageSize}`,
      method:"get"
  })
}
const addProjectstudy = (pairs) => {
  return request({
    url: `/projectstudy/add`,
    method: 'post',
    data: pairs,
  })
}
const deleteProjectstudy = (data) => {
  return request({
    url: `/projectstudy/remove-study/${data.id}`,
    method: 'delete',
  })
}
const treels = (data) => {
  return request({
    url: `/newtree/treels`,
    method: 'get',
  })
}
export default {
  projectplan,
  addProjectplan,
  removeProjectplan,
  wtls,
  treels,
  indicators,
  addIndicators,
  removeIndicators,
  newtreeTreels,
  addProjectstudy,
  projectstudy,
  deleteProjectstudy,
}
