import { request } from 'umi';

function menutreepage(params) {
  return request('/saasbase/api​/menu/getmenutreepage', {
    method: 'post',
    data: params,
  });
}

function enable(params) {
  return request(`/saasbase/api​/menu/enable?Id=${params}`);
}

function disable(params) {
  return request(`/saasbase/api/menu/disable?Id=${params}`);
}

function remove(params) {
  return request(`/saasbase/api​/menu/delete`, {
    method: 'post',
    data: params,
  });
}

function add(params) {
  return request(`/saasbase/api​/menu/add`, {
    method: 'post',
    data: params,
  });
}
function update(params) {
  return request(`/saasbase/api​/menu/update`, {
    method: 'post',
    data: params,
  });
}

function trees() {
  return request(`​/saasbase/api/menu/menutrees?getType=ALL`, {
    method: 'Get',
  });
}

function  getDicData(code) {
  return request(`/saasbase/api/select/getdictvalue/?TypeCode=${code}`);
}

export default { menutreepage, trees, enable, disable, add, remove, update,getDicData };
