import http from '@/utils/request'

// 获取路由全集
export function getRouters (data) {
  return http.post('/authentication/tmenu/list', data)
}

// 获取路由全集
export function getMenuTree () {
  return http.post('/authentication/company/package/menu/tree')
}

// 获取用户动态路由
export function getMenu2 (data) {
  return http.post('/authentication/user/getMenu2', data)
}

// 获取用户动态路由 用户级别自定义
// export function getMenu3 (data) {
//   return http.post('/authentication/user/getMenu3', data)
// }

// 工作台模块列表
export function getWorkbenchList () {
  return http.post('/authentication/user/menu/list')
}

// 工作台模块删除
export function deleteWorkbench (data) {
  return http.post('/authentication/user/menu/del', data)
}

// 工作台模块批量删除
export function deleteWorkbenchAll (data) {
  return http.post('/authentication/user/menu/del/all', data)
}

// 工作台模块编辑
export function saveWorkbench (data) {
  return http.post('/authentication/user/menu/save', data)
}

// 工作台模块批量编辑
export function saveWorkbenchAll (data) {
  return http.post('/authentication/user/menu/save/all', data)
}

// 获取详情
export function getRoutersDetail (data) {
  return http.post('/authentication/tmenu/detail', data)
}

// 保存菜单
export function saveMenu (data) {
  return http.post('/authentication/tmenu/save', data)
}

// 批量保存菜单
export function saveMenuAll (data) {
  return http.post('/authentication/tmenu/save/all', data)
}

// 删除菜单
export function deleteMenu (data) {
  return http.post('/authentication/tmenu/del', data)
}

// 导入菜单
export function importMenu (data) {
  return http.upload('/authentication/tmenu/import', data)
}

// 导出菜单
export function exportMenu (data) {
  return http.post('/authentication/tmenu/export', data)
}

// 获取租户套餐
export function getCompanyPackage (data) {
  return http.post('/authentication/company/package/list', data)
}

// 保存租户套餐
export function saveCompanyPackage (data) {
  return http.post('/authentication/company/package/save', data)
}

// 获取租户套餐详情
export function getCompanyDetails (data) {
  return http.post('/authentication/company/package/detail', data)
}

// 获取租户分页列表
export function getCompanyInfoPage (data) {
  return http.get('/authentication/companyinfo/page', data)
}

// 角色列表
export function getRoleList (data) {
  return http.post('/authentication/role/list', data)
}

// 角色详情
export function getRoleDetails (data) {
  return http.post('/authentication/role/detail', data)
}

// 自身角色列表
export function getOwnList (data) {
  return http.post('/authentication/tmenu/user/own/list', data)
}

// 保存角色
export function saveRole (data) {
  return http.post('/authentication/role/save', data)
}

// 删除角色
export function deleteRole (data) {
  return http.post('/authentication/role/del', data)
}

// 公司冻结和启用
export function companyStateChange (data) {
  return http.post('/authentication/companyinfo/disable', data)
}

// 公司冻结和启用
export function companyOperateState (data) {
  return http.post('/authentication/companyinfo/operate/state2', data)
}

// 追加租户套餐
export function companyPackageAppend (data) {
  return http.post('/authentication/company/package/append', data)
}

// 根据id获取响应的组件列表
export function getMenuChisById (data) {
  return http.post('/authentication/tmenu/chis', data)
}

// 保存数据权限
export function saveDataPermission (data) {
  return http.post('/authentication/role/data/config/item/batch/save', data)
}

// 获取数据权限
export function getDataPermission (data) {
  return http.post('/authentication/role/data/config/item/list', data)
}
