import request from '@/config/axios';
import type { TableData } from './types';
import {delJRCPRiskLevelQueryListApi} from "@/api/amld/JRCPRiskLevelQuery/JRCPRiskLevelQuery";

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

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

/** 删除 */
export const delJRCPVerifyApi = (pkid?: string): Promise<IResponse> => {
  return request.postJson({ url: '/JRCPVerify/spi/JRCPVerify/JrcpVerify/JrcpVerifyDelete', data: { pkid } });
};

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

/** 查询单条数据 */
export const queryJRCPVerifyApi = (pkid?: string): Promise<IResponse> => {
  return request.postJson({ url: '/JRCPVerify/spi/JRCPVerify/JrcpVerify/JrcpVerifyQueryOne', data: { pkid } });
};

/** 同步导入 */
export const importExcelApiUrl = '/JRCPVerify/sui/JRCPVerify/JrcpVerify/JrcpVerifyImportExcel';

/** 异步导入 */
export const importExcelAsyncApiUrl = '/JRCPVerify/sui/JRCPVerify/JrcpVerify/JrcpVerifyImportAsyncExcel';

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

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

