import request from '@/utils/request'

export function getList(data) {
  return request({
    url: '/baseRole/query/company',
    method: 'get',
    params: data,
  })
}

export function create(data) {
  return request({
    url: '/baseRole/api/create',
    method: 'post',
    data: data,
  })
}

export function changeInfo(data) {
  return request({
    url: '/baseRole/api/changeInfo',
    method: 'post',
    data: data,
  })
}

export function compAndChildrenInfo(params) {
  return request({
    url: "/baseCompany/query/compAndChildrenInfo",
    method: "get",
    params
  });
}
// 通过公司ID获取部门列表
export function getDeptPageByCompId(params) {
  return request.get("/department/query/getDeptPageByCompId", {
    params: params
  });
}

// 获取角色详情
export function getRoleInfo(params) {
  return request.get("/baseRole/query/getRoleInfo", {
    params: params
  });
}

// 获取插件列表
export function getTenantlist(params) {
  return request.get("/tenantPlugin/query/pluginDetails", {
    params: params
  });
}

// 绑定资源
export function bindResources(data) {
  return request.post("/baseRole/api/bindResources", data);
}

// 绑定资源
export function getVessels(params) {
  return request.get("/baseStaff/query/staffPageByCondition", {
    params: params
  });
}

export function queryRoleSelectData(data) {
  return request({
    url: "/baseRole/query/queryRoleSelectData",
    method: "get",
    params: data
  });
}

export function addadmin(data) {
  return request({
    url: "/baseStaff/api/create", // 创建用户
    method: "post",
    data
  });
}

export function checkApp(data) {
  return request({
    url: "/commonUser/api/checkApp", // 创建用户
    method: "post",
    data
  });
}
export function staffInfo(params) {
  return request.get("/baseStaff/query/staffInfo", {
    params: params
  });
}

export function editInfo(data) {
  return request({
    url: "/commonUser/api/changeInfo",
    method: "post",
    data
  });
}
