import request from '@/utils/request'

export function listAchievements(query) {
  return request({
    url: '/achievement/queryAchievement',
    method: 'post',
    data: query
  })
}

export function getAchievement(taskid) {
  return request({
    url: `/achievement/queryAchievement/${taskid}`,
    method: 'get',
  })
}

export function listWaterLevel(query) {
  return request({
    url: '/achievement/getWaterLevelList',
    method: 'post',
    data: query
  })
}

export function listScatterPlot(query) {
  return request({
    url: '/achievement/getScatterPlot',
    method: 'post',
    data: query
  })
}

export function listMeasureLine(data) {
  return request({
    url: '/reportData/getMeasureLine',
    method: 'get',
    params: data,
  })
}

export function getCarInfo(params) {
  return request({
    url: '/reportData/carInfo',
    method: 'get',
    params,
  })
}

export function getCarLocation(params) {
  return request({
    url: '/reportData/carLocation',
    method: 'get',
    params,
  })
}

export function getSiteRealTime(siteId) {
  return request({
    url: '/reportData/siteRealTime',
    method: 'get',
    params: { siteId },
  })
}

export function getTaskNotice(siteId, taskId) {
  return request({
    url: '/reportData/taskNotice',
    method: 'get',
    params: { siteId, taskId, page: 1, size: 10000 },
  })
}

export function taskAction(siteId, action) {
  return request({
    url: '/directive/taskStop',
    method: 'post',
    params: { siteId, action },
  })
}

export function manualMeasure(data) {
  return request({
    url: '/directive/manualMeasure',
    method: 'post',
    data,
  })
}

export function getWaterLevel(siteId) {
  return request({
    url: '/reportData/getWaterLevel',
    method: 'get',
    params: { siteId },
  })
}

export function getPointConfig(siteId) {
  return request({
    url: '/reportData/getPointConfig',
    method: 'get',
    params: { siteId },
  })
}

export function getLatestTask(siteId) {
  return request({
    url: '/reportData/getLatestTask',
    method: 'get',
    params: { siteId },
  })
}

export function getPointConfigByPlanid(siteId, planid) {
  return request({
    url: '/reportData/getPointConfigByPlanid',
    method: 'get',
    params: { siteId, planid },
  })
}
