import { defHttp } from '/@/utils/http/axios';
import {
  PageParams,
  operateList,
  sceneMoveParams,
  sceneControlParams,
  RentListGetResultModel,
  checkDownLoadResult,
  sceneDownloadResult,
  ResultDetail,
  addCameraParams,
  updateParams,
} from './model';
import { Result, FileStream } from '/#/axios';

enum Api {
  agentNewList = '/service/manage/agentNew/list',
  agentNewAdd = '/service/manage/agentNew/add',
  agentNewUpdate = '/service/manage/agentNew/update',
  agentNewDel = '/service/manage/agentNew/delete',
  checkUserName = '/service/manage/agentNew/checkUserName',
  logList = '/service/manage/agentNew/logList',
  export = '/service/manage/agentNew/export',
  addIncrementNum = '/service/manage/agentNew/addIncrementNum'
}

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

 export const agentNewList = (params: PageParams) =>
 defHttp.post<Result>({
   url: Api.agentNewList,
   params: params,
   headers: {
     // @ts-ignore
     ignoreCancelToken: true,
   },
 });
 export const agentNewAdd = (params: PageParams) =>
 defHttp.post<Result>({
   url: Api.agentNewAdd,
   params: params,
   headers: {
     // @ts-ignore
     ignoreCancelToken: true,
   },
 });
 export const agentNewDel = (params: PageParams) =>
 defHttp.post<Result>({
   url: Api.agentNewDel,
   params: params,
   headers: {
     // @ts-ignore
     ignoreCancelToken: true,
   },
 });
 export const agentNewUpdate = (params: PageParams) =>
 defHttp.post<Result>({
   url: Api.agentNewUpdate,
   params: params,
   headers: {
     // @ts-ignore
     ignoreCancelToken: true,
   },
 });
 export const addIncrementNum = (params: PageParams) =>
 defHttp.post<Result>({
   url: Api.addIncrementNum,
   params: params,
   headers: {
     // @ts-ignore
     ignoreCancelToken: true,
   },
 });
 export const checkUser = (params: PageParams) =>
 defHttp.get<Result>({
   url: Api.checkUserName,
   params: params,
   headers: {
     // @ts-ignore
     ignoreCancelToken: true,
   },
 });
 
export const logListApi = (params: PageParams) =>
 defHttp.post<Result>({
   url: Api.logList,
   params: params,
   headers: {
     // @ts-ignore
     ignoreCancelToken: true,
   },
 });
export const DownExport = (params: PageParams) =>
defHttp.downloadFile<FileStream>({
  url: Api.export,
  params: params,
  fileName:'经销商销售统计.xlsx',
  // data: params,
  headers: {
    // @ts-ignore
    ignoreCancelToken: true,
  },
  responseType: 'blob'
});
