import request from '@/utils/request'

// 查询检测计划列表
export function listPlan(query) {
  return request({
    url: '/task/plan/list',
    method: 'get',
    params: query
  })
}

export function pointList(query) {
  return request({
    url: '/task/plan/pointList',
    method: 'get',
    params: query
  })
}


// 查询检测计划详细
export function getPlan(id) {
  return request({
    url: '/task/plan/' + id,
    method: 'get'
  })
}

export function getAllPlan() {
  return request({
    url: '/task/plan/allPlan',
    method: 'get'
  })
}

// 新增检测计划
export function addPlan(data) {
  return request({
    url: '/task/plan',
    method: 'post',
    data: data
  })
}


// 校验检测计划
export function checkPlan() {
  return request({
    url: '/task/plan/checkPlan',
    method: 'post'
  })
}

// 修改检测计划
export function updatePlan(data) {
  return request({
    url: '/task/plan',
    method: 'put',
    data: data
  })
}

// 删除检测计划
export function delPlan(id) {
  return request({
    url: '/task/plan/' + id,
    method: 'delete'
  })
}

export function addCheckpoints(data) {
  return request({
    url: '/task/plan/addCheckpoints',
    method: 'post',
    data: data
  })
}

export function removeCheckPoints(data) {
  return request({
    url: '/task/plan/removeCheckPoints',
    method: 'delete',
    data: data
  })
}


