import request from '@/utils/request'


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

export function gettask(id) {
  return request({
    url: `/supervision/task/${id}/`,
    method: 'get'
  })
}

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

export function updatetask(id, data) {
  return request({
    url: `/supervision/task/${id}/`,
    method: 'put',
    data
  })
}

export function deletetask(id, data) {
  return request({
    url: `/supervision/task/${id}/`,
    method: 'delete',
    data
  })
}

export function inittask(id, data) {
  return request({
    url: `/supervision/task/${id}/init/`,
    method: 'post',
    data
  })
}


export function gettaskcontents(id) {
  return request({
    url: `/supervision/task/${id}/contents/`,
    method: 'get'
  })
}

export function gettaskdepts(id) {
  return request({
    url: `/supervision/task/${id}/depts/`,
    method: 'get'
  })
}

export function starttask(id) {
  return request({
    url: `/supervision/task/${id}/start/`,
    method: 'put'
  })
}

export function closetask(id) {
  return request({
    url: `/supervision/task/${id}/close/`,
    method: 'put'
  })
}

export function gettaskdeptall(id) {
  return request({
    url: `/supervision/task/${id}/deptall/`,
    method: 'get'
  })
}