import request from '@/utils/request'

// 查询主管任务配置列表
export function listSummaryTask(query) {
  return request({
    url: '/sfa/summaryTask/list',
    method: 'get',
    params: query
  })
}

// 查询主管任务配置详细
export function getSummaryTask(summaryId) {
  return request({
    url: '/sfa/summaryTask/' + summaryId,
    method: 'get'
  })
}

// 新增主管任务配置
export function addSummaryTask(data) {
  return request({
    url: '/sfa/summaryTask',
    method: 'post',
    data: data
  })
}
export function editPublish(data) {
  return request({
    url: '/sfa/summaryTask/editPublish',
    method: 'post',
    data: data
  })
}
// 修改主管任务配置
export function updateSummaryTask(data) {
  return request({
    url: '/sfa/summaryTask',
    method: 'put',
    data: data
  })
}

// 删除主管任务配置
export function userSummary(summaryId) {
  return request({
    url: '/sfa/userSummary/' + summaryId,
    method: 'delete'
  })
}
export function delSummaryTask(summaryId) {
  return request({
    url: '/sfa/summaryTask/' + summaryId,
    method: 'delete'
  })
}

//主管任务配置发布状态修改
export function changeSummaryTask(summaryId, status) {
  const data = {
    summaryId,
    status
  }
  return request({
    url: '/sfa/summaryTask/changeStatus',
    method: 'put',
    data: data
  })
}
