import { defHttp } from '@/utils/http/axios';

enum Api {
  getLeftTree = '/api/SysDataItem/Load',
  getRightTable = '/api/SysDataItemDetail/Load',
  addLeftItem = '/api/SysDataItem/Add',
  addRightItem = '/api/SysDataItemDetail/Add',
  delLeftItem = '/api/SysDataItem/Delete',
  delRightItem = '/api/SysDataItemDetail/Delete',
  editRightItem = '/api/SysDataItemDetail/Update',
}
export function getLeftTree() {
  return defHttp.get({ url: Api.getLeftTree });
}
export function getDictionaryType() {
  return defHttp.get({ url: Api.getLeftTree });
}
export function getDictionary(params) {
  return defHttp.get({ url: Api.getRightTable, params });
}
export function getRightTable(params) {
  return defHttp.get({ url: Api.getRightTable, params });
}
export function addLeftItem(params) {
  return defHttp.post({ url: Api.addLeftItem, params });
}
export function addRightItem(params) {
  return defHttp.post({ url: Api.addRightItem + '?code=' + params.itemCode, params });
}
export function delLeftItem(params) {
  return defHttp.post({ url: Api.delLeftItem + '?id=' + params.id });
}
export function delRightItem(params) {
  return defHttp.post({ url: Api.delRightItem + '?id=' + params.id });
}
export function editRightItem(params) {
  return defHttp.post({ url: Api.editRightItem, params });
}
