import { request } from 'umi';

export default {
  /** 查询企业信息*/
  companyPage(data) {
    return request(`/kitchen/api/company/companypage`, {
      method: 'POST',
      data: data,
    });
  },
  /** 添加企业信息*/
  addCompany(data) {
    return request(`/kitchen/api/company/add`, {
      method: 'POST',
      data: data,
    });
  },
  /** 修改企业信息*/
  updateCompany(data) {
    return request(`/kitchen/api/company/update`, {
      method: 'PUT',
      data: data,
    });
  },
  /** 删除企业信息*/
  removeCompany(data) {
    return request(`/kitchen/api/company/delete`, {
      method: 'DELETE',
      data: data,
    });
  },
  /** 企业信息停用*/
  Enable(Id) {
    return request(`/kitchen/api/company/enable/?Id=${Id}`, {
      method: 'Get',
    });
  },
  /** 企业信息启用*/
  Disable(Id) {
    return request(`/kitchen/api/company/disable/?Id=${Id}`, {
      method: 'Get',
    });
  },
  /** 添加角色菜单信息*/
  addRoleMenu(data){
    return request(`/kitchen/api/role/addorupdatemenurole`,{
      method: 'POST',
      data: data,
    });
  },
  /** 查询功能菜单*/
  GetMenu(params) {
    return request(`​/kitchen/api/select/menutree/?GetType=${params}`);
  },
  /** 获取角色菜单*/
  GetRoleMenu(params) {
    return request(`/kitchen/api/role/getmenurole/?RoleId=${params}`);
  },
  /** 授权菜单功能获取数据*/
  menutreepage(params) {
    return request('/kitchen/api​/menu/getmenutreepage', {
      method: 'post',
      data: params,
    });
  }
};
