添加 exportXlsHeaders、importExcelByEasyExcel、checkExcelByEasyExcel 接口, 用于下载模板、模板校验和 EasyExcel 导入。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
82 lines
3.0 KiB
TypeScript
82 lines
3.0 KiB
TypeScript
import { defHttp } from '/@/utils/http/axios';
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
|
const { createConfirm } = useMessage();
|
|
|
|
enum Api {
|
|
list = '/bg/fixcontact/fixedContact20260730/list',
|
|
save = '/bg/fixcontact/fixedContact20260730/add',
|
|
edit = '/bg/fixcontact/fixedContact20260730/edit',
|
|
deleteOne = '/bg/fixcontact/fixedContact20260730/delete',
|
|
deleteBatch = '/bg/fixcontact/fixedContact20260730/deleteBatch',
|
|
importExcel = '/bg/fixcontact/fixedContact20260730/importExcel',
|
|
exportXls = '/bg/fixcontact/fixedContact20260730/exportXls',
|
|
exportXlsHeaders = '/bg/fixcontact/fixedContact20260730/exportXlsHeaders',
|
|
importExcelByEasyExcel = '/bg/fixcontact/fixedContact20260730/importExcelByEasyExcel',
|
|
checkExcelByEasyExcel = '/bg/fixcontact/fixedContact20260730/checkExcelByEasyExcel',
|
|
queryById = '/bg/fixcontact/fixedContact20260730/queryById',
|
|
fixedContactFeedbackList = '/bg/fixcontact/fixedContact20260730/queryFixedContactFeedback20260730ByMainId',
|
|
}
|
|
|
|
export const getExportUrl = Api.exportXls;
|
|
export const getImportUrl = Api.importExcel;
|
|
export const getExportXlsHeadersUrl = Api.exportXlsHeaders;
|
|
export const getImportExcelByEasyExcelUrl = Api.importExcelByEasyExcel;
|
|
export const getCheckExcelByEasyExcelUrl = Api.checkExcelByEasyExcel;
|
|
|
|
export const list = (params) =>
|
|
defHttp.get({ url: Api.list, params });
|
|
|
|
export const deleteOne = (params, handleSuccess) => {
|
|
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
|
|
handleSuccess();
|
|
});
|
|
};
|
|
|
|
export const batchDelete = (params, handleSuccess) => {
|
|
createConfirm({
|
|
iconType: 'warning',
|
|
title: '确认删除',
|
|
content: '是否删除选中数据',
|
|
okText: '确认',
|
|
cancelText: '取消',
|
|
onOk: () => {
|
|
return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
|
|
handleSuccess();
|
|
});
|
|
},
|
|
});
|
|
};
|
|
|
|
export const saveOrUpdate = (params, isUpdate) => {
|
|
let url = isUpdate ? Api.edit : Api.save;
|
|
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
|
};
|
|
|
|
export const queryById = (id) =>
|
|
defHttp.get({ url: Api.queryById, params: { id } });
|
|
|
|
export const fixedContactFeedbackList = (params) => {
|
|
if (params['id']) {
|
|
return defHttp.get({ url: Api.fixedContactFeedbackList, params });
|
|
}
|
|
return Promise.resolve([]);
|
|
};
|
|
|
|
const BpmApi = {
|
|
saveBpmForm: '/bg/fixcontact/fixedContact20260730/saveBpmForm',
|
|
setBpmVariableLocal: '/act/process/setBpmVariableLocal',
|
|
};
|
|
|
|
export const saveBpmForm = (params) => {
|
|
return defHttp.post({ url: BpmApi.saveBpmForm, params }, { isTransformResponse: false });
|
|
};
|
|
|
|
export const setBpmVariableLocal = (params) => {
|
|
return defHttp.post({ url: BpmApi.setBpmVariableLocal, params }, { isTransformResponse: false });
|
|
};
|
|
|
|
export const withDrawFixContact = (params) => {
|
|
return defHttp.post({ url: '/bg/fixcontact/fixedContact20260730/withDrawFixContact', params }, { joinParamsToUrl: true, isTransformResponse: false });
|
|
};
|