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

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

/** 删除 */
export const delCsckModelDetailTargetApi = (params: { modelId; fieldCode; systemVersion: string | number }): Promise<IResponse> => {
  return request.postJson({ url: '/csck/spi/csck/CsckModelDetailTarget/CsckModelDetailTargetDelete', data: params });
};

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

/** 查询单条数据 */
export const queryCsckModelDetailTargetApi = (params: { modelId; fieldCode; systemVersion: string | number }): Promise<IResponse> => {
  return request.postJson({ url: '/csck/spi/csck/CsckModelDetailTarget/CsckModelDetailTargetQueryOne', data: params });
};

/** 导入 */
export const importExcelApiUrl = '/csck/sui/csck/CsckModelDetailTarget/CsckModelDetailTargetImportExcel';

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