import { defHttp } from '/@/utils/http/axios';
enum Api {
  getComplicationList = '/biz/sys/complication/query/page',
  complicationAdd = '/biz/sys/complication/add',
  complicationEdit = '/biz/sys/complication/edit',
  complicationById = '/biz/sys/complication/detail',
  complicationDelById = '/biz/sys/complication/removeByIds',
  complicationExplad = '/biz/sys/complicationExplain/query/list',
  noteFieldList = '/biz/sys/complication/field/query/list',
  addComplicationExplain = '/biz/sys/complicationExplain/add',
  complicationExplainById = '/biz/sys/complicationExplain/detail',
  complicationExplainEdit = '/biz/sys/complicationExplain/edit',
  perComplicationExplain = '/biz/sys/complication/field/preview',
  complicationExplainDel = '/biz/sys/complicationExplain/removeByIds',
  complicationExport = '/biz/sys/complication/export',
}

export const getComplicationList = (params?: object) => {
  return defHttp.post({ url: Api.getComplicationList, params: params });
};

export const complicationAdd = (params?: object) => {
  return defHttp.post({ url: Api.complicationAdd, params: params });
};

export const complicationEdit = (params?: object) => {
  return defHttp.post({ url: Api.complicationEdit, params: params });
};

export const complicationById = (id?: string | number, params?: object) => {
  return defHttp.get({ url: Api.complicationById + '/' + id, params: params });
};

export const complicationDelById = (params?: object) => {
  return defHttp.post({ url: Api.complicationDelById, params: params });
};

export const getNoteList = (params?: object) => {
  return defHttp.post({ url: Api.complicationExplad + '/' + params.ids });
};

export const getNoteFieldList = () => {
  return defHttp.post({ url: Api.noteFieldList });
};

export const addComplicationExplain = (params?: object) => {
  return defHttp.post({ url: Api.addComplicationExplain, params: params });
};

export const getComplicationExplainById = (id?: string | number, params?: object) => {
  return defHttp.get({ url: Api.complicationExplainById + '/' + id, params: params });
};

export const editComplicationExplain = (params?: object) => {
  return defHttp.post({ url: Api.complicationExplainEdit, params: params });
};

export const perComplicationExplain = (context: string) => {
  console.log(context);
  return defHttp.post({ url: Api.perComplicationExplain, data: context });
};

export const complicationExplainDelById = (params?: object) => {
  return defHttp.post({ url: Api.complicationExplainDel, data: params });
};

export const complicationExport = (params?: object) => {
  return defHttp.post({ url: Api.complicationExport, data: params });
};
