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

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

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

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

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

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

/** 同步导入 */
export const importExcelApiUrl = '/SuspiciousCaseVerify/sui/SuspiciousCaseVerify/SuspiciousCaseVerify/SuspiciousCaseVerifyImportExcel';

/** 异步导入 */
export const importExcelAsyncApiUrl = '/SuspiciousCaseVerify/sui/SuspiciousCaseVerify/SuspiciousCaseVerify/SuspiciousCaseVerifyImportAsyncExcel';

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

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

