import request from '@/utils/request'


// 获取已发布列表
export function getList(data) {
  return request({
    url: `/csc-szls-message/sysAnnouncement/authority/getPublishedPage`,
    method: 'post',
    data: data
  })
}
// 获取草稿列表
export function getDraftList(data) {
    return request({
      url: `/csc-szls-message/sysAnnouncement/authority/getDraftPage`,
      method: 'post',
      data: data
    })
  }

// 新增
export function addFun(data) {
  return request({
    url: `/csc-szls-message/sysAnnouncement/authority_button/add`,
    method: 'post',
    data: data
  })
}

// 删除
export function deleteFun(id) {
  return request({
    url: `/csc-szls-message/sysAnnouncement/authority_button/deleteById?id=${id}`,
    method: 'delete',
  })
}

// 修改

export function updateFun(data) {
  return request({
    url: `/csc-szls-message/sysAnnouncement/authority_button/update`,
    method: 'post',
    data: data
  })
}

// 查看
export function detailFun(id) {
  return request({
    url: `/csc-szls-message/sysAnnouncement/authority/getById/${id}`,
    method: 'get'

  })
}

export function getAllRole() {
    return request({
      url: `/csc-szls-system-manage/role/authority/getAll`,
      method: 'get',
    })
  }

export function getDepotAll(id) {
    return request({
        url: `/csc-szls-system-manage/basicsDepot/authority/getAll?depotId=${id}`,
        method: 'get',
    })
}

export function getDepotById(id) {
    return request({
        url: `/csc-szls-system-manage/basicsDepot/authority/getById/${id}`,
        method: 'get',
    })
}