import request from '@/utils/request'

// 查询任务列表
export function listTask(query) {
  return request({
    url: '/sfa/task/list',
    method: 'get',
    params: query
  })
}

// 查询任务详细
export function getTask(taskId) {
  return request({
    url: '/sfa/task/' + taskId,
    method: 'get'
  })
}

// 新增任务
export function addTask(data) {
  return request({
    url: '/sfa/task/addTask',
    method: 'post',
    data: data
  })
}

// 修改任务
export function updateTask(data) {
  return request({
    url: '/sfa/task/editTask',
    method: 'post',
    data: data
  })
}

// 删除任务
export function delTask(taskId) {
  return request({
    url: '/sfa/task/' + taskId,
    method: 'delete'
  })
}
// 软删除任务
export function softRemove(query) {
  return request({
    url: '/sfa/task/softRemove',
    method: 'get',
    params: query
  })
}
// 删除采集项
export function removeTaskCollectionItem(query) {
  return request({
    url: '/sfa/task/removeTaskCollectionItem',
    method: 'delete',
    params: query
  })
}
// 修改任务中采集项排序
export function updateTaskCollectionItemSort(data) {
  return request({
    url: '/sfa/task/updateTaskCollectionItemSort',
    method: 'post',
    data: data
  })
}
