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

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

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

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

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

/** 同步导入 */
export const importExcelApiUrl = '/KytzStatistics/sui/KytzStatistics/KytzStatistics/KytzStatisticsImportExcel';

/** 异步导入 */
export const importExcelAsyncApiUrl = '/KytzStatistics/sui/KytzStatistics/KytzStatistics/KytzStatisticsImportAsyncExcel';

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

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

