import request from '@/config/axios';
import type { TableData } from './types';

/** 获取表格数据 */
export const getJyqdStatisticsListApi = (data: any) => {
  return request.postJson({ url: '/JyqdStatistics/spi/JyqdStatistics/JyqdStatistics/JyqdStatisticsQueryPage', data });
};

/** 批量删除 */
export const delJyqdStatisticsListApi = (list: string[] | number[]): Promise<IResponse> => {
  const _list = list.map(v => {
    return {
    };
  });
  return request.postJson({
    url: '/JyqdStatistics/spi/JyqdStatistics/JyqdStatistics/JyqdStatisticsBatchDelete',
    data: {
      list: _list,
    },
  });
};

/** 删除 */
export const delJyqdStatisticsApi = (): Promise<IResponse> => {
  return request.postJson({ url: '/JyqdStatistics/spi/JyqdStatistics/JyqdStatistics/JyqdStatisticsDelete', data: {  } });
};

/** 保存 */
export const saveJyqdStatisticsApi = (data: Partial<TableData>): Promise<IResponse> => {
  return request.postJson({ url: '/JyqdStatistics/spi/JyqdStatistics/JyqdStatistics/JyqdStatisticsSave', data });
};

/** 查询单条数据 */
export const queryJyqdStatisticsApi = (): Promise<IResponse> => {
  return request.postJson({ url: '/JyqdStatistics/spi/JyqdStatistics/JyqdStatistics/JyqdStatisticsQueryOne', data: {  } });
};

/** 同步导入 */
export const importExcelApiUrl = '/JyqdStatistics/sui/JyqdStatistics/JyqdStatistics/JyqdStatisticsImportExcel';

/** 异步导入 */
export const importExcelAsyncApiUrl = '/JyqdStatistics/sui/JyqdStatistics/JyqdStatistics/JyqdStatisticsImportAsyncExcel';

/** 导出 */
export const exportExcelApi = (params: any) => {
  return request.doExport({ url: '/JyqdStatistics/sdi/JyqdStatistics/JyqdStatistics/JyqdStatisticsExportXls', params });
};

/** 获取某个字典 */
export const getCsckCheckType = ({ paramName, systemCode }): Promise<IResponse> => {
  return request.postJson({
    url: '/param/spi/param/systemparam',
    data: {
      paramName: paramName,
      systemCode: systemCode,
    },
  });
};

