import request from '@assets/js/utils/request'
/* -------------- 数据权限接口--------------------*/
/* 获取角色管理列表*/
export function getAuthInterfaceTree(data) {
  return request({
    url:
      '/bidprocurement/common-user/user/authData/getAuthInterfaceTree',
    method: 'post',
    data
  })
}
/* 带搜索获取角色管理列表*/
export function getAuthInterfaceTreeBySearch(data) {
  return request({
    url:
      '/bidprocurement/common-user/user/authData/getAuthInterfaceTreeBySearch',
    method: 'post',
    data
  })
}
/* 节点权限列表*/
export function getAuthDataPages(data) {
  return request({
    url:
      '/bidprocurement/common-user/user/authData/getAuthDataPages',
    method: 'post',
    data
  })
}
/* 新增或编辑授权接口*/
export function saveAuthData(data) {
  return request({
    url:
      '/bidprocurement/common-user/user/authData/saveAuthData',
    method: 'post',
    data
  })
}
/* 删除*/
export function remove(data) {
  return request({
    url:
      '/bidprocurement/common-user/user/authData/remove',
    method: 'post',
    data
  })
}
/* 获取节点信息*/
export function queryAuthData(data) {
  return request({
    url:
      '/bidprocurement/common-user/user/authData/queryAuthData?id=' + data,
    method: 'post'
  })
}
/* -------------- 接口权限接口--------------------*/
/* 获取接口管理列表*/
export function getAuthfaceTree(data) {
  return request({
    url:
      '/bidprocurement/common-user/user/authInterface/getAuthInterfaceTree',
    method: 'post',
    data
  })
}
/* 搜索节点信息*/
export function authInterfaceBySearch(data) {
  return request({
    url:
      '/bidprocurement/common-user/user/authInterface/getAuthInterfaceTreeBySearch',
    method: 'post',
    data
  })
}
/* 获取节点信息*/
export function GetqueryAuthInterface(data) {
  return request({
    url:
      '/bidprocurement/common-user/user/authInterface/queryAuthInterface?id=' + data,
    method: 'post'
  })
}
/* 删除*/
export function authInterRemove(data) {
  return request({
    url:
      '/bidprocurement/common-user/user/authInterface/remove',
    method: 'post',
    data
  })
}
/* -------------- 角色权限接口--------------------*/

/* 获取角色列表*/
export function getRoleList(data) {
  return request({
    url:
      '/bidprocurement/common-user/user/role/getRoleList',
    method: 'post',
    data
  })
}
/* 添加角色*/
export function addRole(data) {
  return request({
    url:
      '/bidprocurement/common-user/user/role/addRole',
    method: 'post',
    data
  })
}
/* 修改角色*/
export function updateRole(data) {
  return request({
    url:
      '/bidprocurement/common-user/user/role/updateRole',
    method: 'post',
    data
  })
}
/* 删除角色*/
export function deleteRole(data) {
  return request({
    url:
      '/bidprocurement/common-user/user/role/deleteRole?id=' + data,
    method: 'post'
  })
}
/* 批量删除角色*/
export function batchDeleteRole(data) {
  return request({
    url:
      '/bidprocurement/common-user/user/role/batch/deleteRole',
    method: 'post',
    data
  })
}
/* 获取当前角色下的菜单权限列表*/
export function getFunction(data) {
  return request({
    url:
      '/bidprocurement/common-user/user/roleFunction/getFunction?id=' + data,
    method: 'post'
  })
}
/* 获取权限被选中的数据和接口列表*/
export function getHasAuthRole(data) {
  return request({
    url:
      '/bidprocurement/common-user/user/authRole/getHasAuthRole',
    method: 'post',
    data
  })
}
/* 新增或编辑菜单授权接口*/
export function setFunction(data) {
  return request({
    url:
      '/bidprocurement/common-user//user/roleFunction/setFunction',
    method: 'post',
    data
  })
}
/* 新增或编辑数据和接口授权接口*/
export function saveAuthRole(data) {
  return request({
    url:
      '/bidprocurement/common-user/user/authRole/saveAuthRole',
    method: 'post',
    data
  })
}
