import request from '@/utils/request'

export function getList(query) {
  return request({
    url: '/patrol/task/list',
    method: 'get',
    params: query
  })
}
export function getChangeStatus(query) {
  return request({
    url: '/patrol/task/changeStatus',
    method: 'get',
    params: query
  })
}

export function postRemove(query) {
  return request({
    url: `/patrol/task/remove/${query}`,
    method: 'post',
  })
}

export function getPatroltypeList(query) {
  return request({
    url: `/basedata/patrolpointmnt/patroltype/list`,
    method: 'get',
    params: query,
  })
}

export function getAreaList(query, type = 0) {
  if (type == 0) {
    return request({
      url: `/basedata/area/list`,
      method: 'get',
    })
  } else {
    return request({
      url: `/basedata/area/list?areaIdS=${query}`,
      method: 'get',
    })
  }
}
export function getProDeviceTreeSelect(query) {
  return request({
    url: `/basedata/prodevmnt/device/getProDeviceTreeSelect?areaIdS=${query}`,
    method: 'get',
  })
}
export function getTreeProMainDevicePatrolEquSelect(query) {
  return request({
    url: `/basedata/prodevmnt/device/treeProMainDevicePatrolEquSelect?deviceIdAll=${query}`,
    method: 'get',
  })
}
// 复制任务
export function getCopyTask(query) {
  return request({
    url: `/patrol/task/copyTask`,
    method: 'get',
    params: query
  })
}
// 立即执行
export function getControlChange(query) {
  return request({
    url: `/patrol/taskstatus/controlChange`,
    method: 'get',
    params: query
  })
}
// 任务下发
export function getTaskIsSue(query) {
  return request({
    url: `/patrol/task/issue`,
    method: 'get',
    params: query
  })
}
