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

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

/** 删除 */
export const delCsckModelItemApi = (systemCode, systemVersion, reportCode, reportVersion, reportFrequency, itemName: string | number): Promise<IResponse> => {
  return request.postJson({ url: '/csck/spi/csck/CsckModelItem/CsckModelItemDelete', data: { systemCode, systemVersion, reportCode, reportVersion, reportFrequency, itemName } });
};

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

/** 查询单条数据 */
export const queryCsckModelItemApi = (systemCode, systemVersion, reportCode, reportVersion, reportFrequency, itemName: string | number): Promise<IResponse> => {
  return request.postJson({ url: '/csck/spi/csck/CsckModelItem/CsckModelItemQueryOne', data: { systemCode, systemVersion, reportCode, reportVersion, reportFrequency, itemName } });
};

/** 导入 */
export const importExcelApiUrl = '/csck/sui/csck/CsckModelItem/CsckModelItemImportExcel';

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