import { request } from 'umi';
import { getDataBaseUrl } from '@/global_data';
export default {
  /** 查询企业信息*/
  companyPage(data) {
    return request(getDataBaseUrl()+`/api/company/companypage`, {
      method: 'POST',
      data: data,
    });
  },
  /** 添加企业信息*/
  addCompany(data) {
    return request(getDataBaseUrl()+`/api/company/add`, {
      method: 'POST',
      data: data,
    });
  },
  /** 修改企业信息*/
  updateCompany(data) {
    return request(getDataBaseUrl()+`/api/company/update`, {
      method: 'POST',
      data: data,
    });
  },
  /** 删除企业信息*/
  removeCompany(data) {
    return request(getDataBaseUrl()+`/api/company/delete`, {
      method: 'POST',
      data: data,
    });
  },
  /** 企业信息停用*/
  Enable(Id) {
    return request(getDataBaseUrl()+`/api/company/enable/?Id=${Id}`, {
      method: 'Get',
    });
  },
  /** 企业信息启用*/
  Disable(Id) {
    return request(getDataBaseUrl()+`/api/company/disable/?Id=${Id}`, {
      method: 'Get',
    });
  },
  /** 添加角色菜单信息*/
  addRoleMenu(data){
    return request(getDataBaseUrl()+`/api/roles/addorupdatemenurole`,{
      method: 'POST',
      data: data,
    });
  },
  /** 查询功能菜单*/
  GetMenu(params) {
    return request(getDataBaseUrl()+`​/api/menu/menuparmytrees?getType=${params.getType}&&type=${params.type}`,
    {
      method: 'Get',
    });
  },
  /** 获取角色菜单*/
  GetRoleMenu(params) {
    return request(getDataBaseUrl()+`/api/roles/getmenurole/?RoleId=${params}`);
  },
  /** 授权菜单功能获取数据*/
  menutreepage(params) {
    return request(getDataBaseUrl()+'/api​/menu/getmenutreepage', {
      method: 'post',
      data: params,
    });
  }
};
