import request from '@/utils/request'

export function listPlan(query) {
  return request({
    url: '/core/drillPlan/list',
    method: 'get',
    params: query
  })
}

export function getPlan(id) {
  return request({
    url: '/core/drillPlan/' + id,
    method: 'get'
  })
}

export function addPlan(data) {
  return request({
    url: '/core/drillPlan',
    method: 'post',
    data: data
  })
}

export function updatePlan(data) {
  return request({
    url: '/core/drillPlan',
    method: 'put',
    data: data
  })
}

export function delPlan(id) {
  return request({
    url: '/core/drillPlan/' + id,
    method: 'delete'
  })
}

//获取教育培训计划角色列表
export function listPlanRole(query) {
  return request({
    url: '/core/drillPlan/role/list',
    method: 'get',
    params: query
  })
}

//获取角色列表
export function roleList(query) {
  return request({
    url: '/system/role/all',
    method: 'get',
    params: {
      orgType: query
    }
  })
}

//下发计划
export function publishPlan(id) {
  return request({
    url: '/core/drillPlan/publish/' + id,
    method: 'get'
  })
}

