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

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

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

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

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

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

/** 同步导入 */
export const importExcelApiUrl = '/AmlRuleAutoslayError/sui/AmlRuleAutoslayError/AmlRuleAutoslayError/AmlRuleAutoslayErrorImportExcel';

/** 异步导入 */
export const importExcelAsyncApiUrl = '/AmlRuleAutoslayError/sui/AmlRuleAutoslayError/AmlRuleAutoslayError/AmlRuleAutoslayErrorImportAsyncExcel';

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

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

