import request from '@/utils/request'
import requestAuthorization from '@/utils/requestAuthorization'


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

// 新增
export function addFun(data) {
  return requestAuthorization({
    url: `/csc-szls-system-manage/user/authority_button/add`,
    method: 'post',
    data: data
  })
}

// 修改

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

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

  })
}

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

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

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

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

  export function deleteByIdFn(id,status) {
    return request({
      url: `/csc-szls-system-manage/user/authority_button/deleteById?id=${id}&status=${status}`,
      method: 'delete',
    })
  }

  export function unameExit(uname) {
    return request({
      url: `/csc-szls-system-manage/user/authority/getByUserName/${uname}`,
      method: 'get',
    })
  }
  

