import { defHttp } from '/@/utils/http/axios';
import { PageParams, ListGetResultModel, DelParams, roleParams, companyExcelParams } from './model';
import { Result, FileStream } from '/#/axios';

enum Api {
  buryPointList = '/service/manage/buryPoint/list',
  buryPointAdd = '/service/manage/buryPoint/add',
  buryPointDlt = '/service/manage/buryPoint/delete',
  userTotal = '/service/manage/data/userTotal',
  orderTotal = '/service/manage/data/orderTotal',
  userTrend = '/service/manage/data/userTrend',
  orderTrend = '/service/manage/data/orderTrend',
  cameraTrend = '/service/manage/data/cameraTrend',
  sceneTrend = '/service/manage/data/sceneTrend',
  sceneTotal = '/service/manage/data/sceneTotal',
  cameraExport = '/service/manage/order/camera/export',
  downExport = '/service/manage/order/down/export',
  incrementExport = '/service/manage/order/increment/export',
}

/**
 * @description: Get sample list value
 */

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

  export const buryPointAdd = (params: PageParams) =>
  defHttp.post<Result>({
    url: Api.buryPointAdd,
    params,
    data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
  export const buryPointDlt = (params: PageParams) =>
  defHttp.post<Result>({
    url: Api.buryPointDlt,
    params,
    data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
  export const userTotal = () =>
  defHttp.get<Result>({
    url: Api.userTotal,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
  export const userTrend = (params) =>
  defHttp.get<Result>({
    url: Api.userTrend,
    params,
    data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
  export const orderTotal = () =>
  defHttp.get<Result>({
    url: Api.orderTotal,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
  
  export const orderTrend = (params) =>
  defHttp.get<Result>({
    url: Api.orderTrend,
    params,
    data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
  
  export const cameraTrend = (params) =>
  defHttp.get<Result>({
    url: Api.cameraTrend,
    params,
    data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
  
  export const sceneTotal = () =>
  defHttp.get<Result>({
    url: Api.sceneTotal,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
  
  export const sceneTrend = (params) =>
  defHttp.get<Result>({
    url: Api.sceneTrend,
    params,
    data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
  
    
  export const cameraExport = (params) =>
  defHttp.downloadFile<FileStream>({
    url: Api.cameraExport,
    params: params,
    // data: params,
    fileName:'相机订单.xlsx',
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
    responseType: 'blob'
  });

  export const downExport = (params) =>
  defHttp.downloadFile<FileStream>({
    url: Api.downExport,
    params: params,
    // data: params,
    fileName:'下载订单.xlsx',
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
    responseType: 'blob'
  });

  export const incrementExport = (params) =>
  defHttp.downloadFile<FileStream>({
    url: Api.incrementExport,
    params: params,
    fileName:'权益订单.xlsx',
    // data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
    responseType: 'blob'
  });
