176 lines
5.0 KiB
TypeScript
176 lines
5.0 KiB
TypeScript
import {defHttp} from '/@/utils/http/axios';
|
|
import { useMessage } from "/@/hooks/web/useMessage";
|
|
import { startProcessSchedules } from '/@/api/common/api';
|
|
|
|
const { createConfirm } = useMessage();
|
|
|
|
enum Api {
|
|
list = '/bgpartymatter/bgPartymatter/list',
|
|
save= '/bgpartymatter/bgPartymatter/add',
|
|
edit= '/bgpartymatter/bgPartymatter/edit',
|
|
deleteOne = '/bgpartymatter/bgPartymatter/delete',
|
|
deleteBatch = '/bgpartymatter/bgPartymatter/deleteBatch',
|
|
importExcel = '/bgpartymatter/bgPartymatter/importExcel',
|
|
exportXls = '/bgpartymatter/bgPartymatter/exportXls',
|
|
importExcelByEasyExcel = '/bgpartymatter/bgPartymatter/importExcelByEasyExcel',
|
|
checkExcelByEasyExcel = '/bgpartymatter/bgPartymatter/checkExcelByEasyExcel',
|
|
exportXlsByEasyExcel = '/bgpartymatter/bgPartymatter/exportXlsByEasyExcel',
|
|
exportXlsHeaders = '/bgpartymatter/bgPartymatter/exportXlsHeaders',
|
|
saveBpmForm = '/bgpartymatter/bgPartymatter/saveBpmForm',
|
|
setProcessVariable = '/act/process/setProcessVariable',
|
|
setBpmVariableLocal = '/act/process/setBpmVariableLocal',
|
|
bgPartymatterFeedbackList = '/bgpartymatter/bgPartymatter/listBgPartymatterFeedbackByMainId',
|
|
bgPartymatterFeedbackSave= '/bgpartymatter/bgPartymatter/addBgPartymatterFeedback',
|
|
bgPartymatterFeedbackEdit= '/bgpartymatter/bgPartymatter/editBgPartymatterFeedback',
|
|
bgPartymatterFeedbackDelete = '/bgpartymatter/bgPartymatter/deleteBgPartymatterFeedback',
|
|
bgPartymatterFeedbackDeleteBatch = '/bgpartymatter/bgPartymatter/deleteBatchBgPartymatterFeedback',
|
|
statusStats = '/bgpartymatter/bgPartymatter/statusStats',
|
|
}
|
|
/**
|
|
* 导出api
|
|
* @param params
|
|
*/
|
|
export const getExportUrl = Api.exportXls;
|
|
|
|
/**
|
|
* 导入api
|
|
*/
|
|
export const getImportUrl = Api.importExcel;
|
|
|
|
/**
|
|
* EasyExcel 导入 api
|
|
*/
|
|
export const getImportExcelByEasyExcelUrl = Api.importExcelByEasyExcel;
|
|
|
|
/**
|
|
* EasyExcel 校验 api
|
|
*/
|
|
export const getCheckExcelByEasyExcelUrl = Api.checkExcelByEasyExcel;
|
|
|
|
/**
|
|
* EasyExcel 导出 api
|
|
*/
|
|
export const getExportXlsByEasyExcelUrl = Api.exportXlsByEasyExcel;
|
|
|
|
/**
|
|
* EasyExcel 仅导出表头 api(模板下载)
|
|
*/
|
|
export const getExportXlsHeadersUrl = Api.exportXlsHeaders;
|
|
|
|
/**
|
|
* 列表接口
|
|
* @param params
|
|
*/
|
|
export const list = (params) =>
|
|
defHttp.get({ url: Api.list, params });
|
|
|
|
export const statusStats = (params) =>
|
|
defHttp.get({ url: Api.statusStats, params });
|
|
|
|
/**
|
|
* 删除单个
|
|
*/
|
|
export const deleteOne = (params,handleSuccess) => {
|
|
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
|
|
handleSuccess();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 批量删除
|
|
* @param params
|
|
*/
|
|
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();
|
|
});
|
|
}
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 保存或者更新
|
|
* @param params
|
|
*/
|
|
export const saveOrUpdate = (params, isUpdate) => {
|
|
let url = isUpdate ? Api.edit : Api.save;
|
|
return defHttp.post({ url: url, params },{ isTransformResponse: false });
|
|
}
|
|
|
|
export const saveBpmForm = (params) => {
|
|
return defHttp.post({ url: Api.saveBpmForm, params }, { isTransformResponse: false });
|
|
}
|
|
|
|
export const setProcessVariable = (params) => {
|
|
return defHttp.post({ url: Api.setProcessVariable, params }, { isTransformResponse: false });
|
|
}
|
|
|
|
export const setBpmVariableLocal = (params) => {
|
|
return defHttp.post({ url: Api.setBpmVariableLocal, params }, { isTransformResponse: false });
|
|
}
|
|
|
|
/**
|
|
* 列表接口
|
|
* @param params
|
|
*/
|
|
export const bgPartymatterFeedbackList = (params) => {
|
|
if(params['mainId']){
|
|
return defHttp.get({ url: Api.bgPartymatterFeedbackList, params });
|
|
}
|
|
return Promise.resolve({});
|
|
}
|
|
|
|
/**
|
|
* 删除单个
|
|
*/
|
|
export const bgPartymatterFeedbackDelete = (params,handleSuccess) => {
|
|
return defHttp.delete({ url: Api.bgPartymatterFeedbackDelete, params }, { joinParamsToUrl: true }).then(() => {
|
|
handleSuccess();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 批量删除
|
|
* @param params
|
|
*/
|
|
export const bgPartymatterFeedbackDeleteBatch = (params, handleSuccess) => {
|
|
createConfirm({
|
|
iconType: 'warning',
|
|
title: '确认删除',
|
|
content: '是否删除选中数据',
|
|
okText: '确认',
|
|
cancelText: '取消',
|
|
onOk: () => {
|
|
return defHttp.delete({ url: Api.bgPartymatterFeedbackDeleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
|
|
handleSuccess();
|
|
});
|
|
}
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 保存或者更新
|
|
* @param params
|
|
*/
|
|
export const bgPartymatterFeedbackSaveOrUpdate = (params, isUpdate) => {
|
|
let url = isUpdate ? Api.bgPartymatterFeedbackEdit : Api.bgPartymatterFeedbackSave;
|
|
return defHttp.post({ url: url, params },{ isTransformResponse: false });
|
|
}
|
|
|
|
/**
|
|
* 导入
|
|
*/
|
|
export const bgPartymatterFeedbackImportUrl = '/bgpartymatter/bgPartymatter/importBgPartymatterFeedback'
|
|
|
|
/**
|
|
* 导出
|
|
*/
|
|
export const bgPartymatterFeedbackExportXlsUrl = '/bgpartymatter/bgPartymatter/exportBgPartymatterFeedback'
|