import request from '@/utils/request'

// 查询分配信息列表
export function listActClassification(query) {
  return request({
    url: '/ActClassification/ActClassification/list',
    method: 'get',
    params: query
  })
}

//查询上级ID
export function savePid() {
    return request({
        url: '/ActClassification/ActClassification/savepid',
        method: 'get'
    })
}
// 查询分配信息详细
export function getActClassification(id) {
  return request({
    url: '/ActClassification/ActClassification/' + id,
    method: 'get'
  })
}

// 新增分配信息
export function addActClassification(data) {
  return request({
    url: '/ActClassification/ActClassification',
    method: 'post',
    data: data
  })
}

// 修改分配信息
export function updateActClassification(data) {
  return request({
    url: '/ActClassification/ActClassification',
    method: 'put',
    data: data
  })
}

// 删除分配信息
export function delActClassification(id) {
  return request({
    url: '/ActClassification/ActClassification/' + id,
    method: 'delete'
  })
}

// 导出分配信息
export function exportActClassification(query) {
  return request({
    url: '/ActClassification/ActClassification/export',
    method: 'get',
    params: query
  })
}

//启用
export function toggleEnable(id) {
    return request({
        url: `/ActClassification/ActClassification/${id}/enable?status=0`,
        method: 'put',
    })
}
//禁用
export function toggleDisable(id) {
    return request({
        url: `/ActClassification/ActClassification/${id}/disable?status=1`,
        method: 'put',
    })
}

export function getAllActClassifications(query) {
    return request({
        url: '/ActClassification/ActClassification/GetAll',
        method: 'get',
        params: query
    })
}

export function getSubActClassifications(parentId) {
    return request({
        url: `/ActClassification/ActClassification/GetSub` + parentId,
        method: 'get',
    })
}
