import { defHttp } from '/@/utils/http/axios';
import { PageParams, ListGetResultModel, DelParams, roleParams, companyExcelParams } from './model';
import { Result, FileStream } from '/#/axios';
let qjurl = window.location.host == 'v4-uat.4dkankan.com'?'https://test.4dkankan.com':''
let dkurl = window.location.host == 'v4-uat.4dkankan.com'?'https://v4-test.4dkankan.com':''
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',
  workType = '/qjkankan/api/age/report/work',
  workTrend = '/qjkankan/api/age/report/workTrend',
  qjuserTrend = '/qjkankan/api/age/report/userTrend',
  volumeTrend = '/qjkankan/api/age/report/volumeTrend',
  roomData = '/takelook/roomData',
  takeLookTop5 = '/takelook/takeLookTop5',
  roomVisitData = '/takelook/roomVisitData',
}

/**
 * @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 roomVisitData = (params) =>
  defHttp.post<Result>({
    url: dkurl + Api.roomVisitData,
    data: params,
    headers: {
      // @ts-ignore
      withToken: false,
      ignoreCancelToken: true,
    },
  });
  export const takeLookTop5 = (params) =>
  defHttp.get<Result>({
    url: dkurl + Api.takeLookTop5,
    params,
    data: params,
    headers: {
      // @ts-ignore
      withToken: false,
      ignoreCancelToken: true
    },
  });
  export const roomData = (params) =>
  defHttp.get<Result>({
    url: dkurl + Api.roomData,
    params,
    data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
      withToken: false,
    },
  });
  export const workType = (params) =>
  defHttp.get<Result>({
    url: qjurl + Api.workType,
    params,
    data: params,
    headers: {
      // @ts-ignore
      appId: 'BDA385EC848C1A425F746869011C8D23',
      ignoreCancelToken: true,
    },
  });
    
  export const workTrend = (params) =>
  defHttp.post<Result>({
    url: qjurl + Api.workTrend,
    params,
    data: params,
    headers: {
      // @ts-ignore
      appId: 'BDA385EC848C1A425F746869011C8D23',
      ignoreCancelToken: true,
    },
  });    
  export const qjuserTrend = (params) =>
  defHttp.post<Result>({
    url: qjurl + Api.qjuserTrend,
    params,
    data: params,
    headers: {
      // @ts-ignore
      appId: 'BDA385EC848C1A425F746869011C8D23',
      ignoreCancelToken: true,
    },
  });    
  export const volumeTrend = (params) =>
  defHttp.post<Result>({
    url: qjurl + Api.volumeTrend,
    params,
    data: params,
    headers: {
      // @ts-ignore
      appId: 'BDA385EC848C1A425F746869011C8D23',
      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'
  });
