import request from '@/utils/request'


// 获取列表
export function getList(data) {
  return request({
    url: `/csc-szls-message/sysEarlywarning/authority/getPage`,
    method: 'post',
    data: data
  })
}

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

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

// 修改

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

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

  })
}

// 启用
export function enableWarn(id) {
  return request({
    url: `/csc-szls-message/sysEarlywarning/authority_button/enableWarn?id=${id}`,
    method: 'get'

  })
}

// 停止     
export function stopWarn(id) {
  return request({
    url: `/csc-szls-message/sysEarlywarning/authority_button/stopWarn?id=${id}`,
    method: 'get'

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

export function gerPersonByRole(id) {
  return request({
    url: `/csc-szls-system-manage/user/getUsersByRoleIds?roleIds=${id}`,
    method: 'get',
  })
}
