import { defHttp } from '/@/utils/http/axios';
import { PageParams } from './model';
import { Result } from '/#/axios';
import { getToken } from '/@/utils/auth';

const token = getToken();

enum Api {
  caseOverviewAdd = '/fusion/caseOverview/addOrUpdate',
  caseOverviewList = '/service/manage/caseOverview/list',
  caseOverviewCopy = '/service/manage/caseOverview/copy',
  caseOverviewRename = '/service/manage/caseOverview/rename',
  caseOverviewDel = '/service/manage/caseOverview/del',
  caseTabulationAdd = '/fusion/caseTabulation/addOrUpdate',
  caseTabulationList = '/service/manage/caseTabulation/list',
  caseTabulationCopy = '/service/manage/caseTabulation/copy',
  caseTabulationRename = '/service/manage/caseTabulation/rename',
  caseTabulationDel = '/service/manage/caseTabulation/del',
}

/**
 * @description: Get sample list value
 */
export const caseOverviewAdd = (params) =>
  defHttp.post<Result>({
    url: Api.caseOverviewAdd,
    params: params,
    // data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const caseOverviewList = (params: PageParams) =>
  defHttp.post<Result>({
    url: Api.caseOverviewList,
    params: params,
    // data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const caseTabulationAdd = (params) =>
  defHttp.post<Result>({
    url: Api.caseTabulationAdd,
    params: params,
    // data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const caseOverImgList = (params: PageParams) =>
  defHttp.post<Result>({
    url: params.tableType ? Api.caseTabulationList : Api.caseOverviewList,
    params: params,
    // data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const caseOverviewRename = (params) =>
  defHttp.post<Result>({
    url: Api.caseOverviewRename,
    params: params,
    // data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const caseOverviewCopy = (params) =>
  defHttp.post<Result>({
    url: Api.caseOverviewCopy,
    params: params,
    // data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const caseOverviewDel = (params) =>
  defHttp.post<Result>({
    url: Api.caseOverviewDel,
    params: params,
    // data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const caseTabulationList = (params: PageParams) =>
  defHttp.post<Result>({
    url: Api.caseTabulationList,
    params: params,
    // data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const caseTabulationRename = (params) =>
  defHttp.post<Result>({
    url: Api.caseTabulationRename,
    params: params,
    // data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const caseTabulationCopy = (params) =>
  defHttp.post<Result>({
    url: Api.caseTabulationCopy,
    params: params,
    // data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const caseTabulationDel = (params) =>
  defHttp.post<Result>({
    url: Api.caseTabulationDel,
    params: params,
    // data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
