87 lines
3.5 KiB
Vue
87 lines
3.5 KiB
Vue
import { defHttp } from '/@/utils/http/axios';
|
||
|
||
/**
|
||
* 审批流设计 API
|
||
* @author GHT
|
||
* @date 2026-05-29 for:【QH-MES审批流设计】新增审批流可视化设计
|
||
*/
|
||
enum Api {
|
||
list = '/xslmes/approvalFlow/list',
|
||
save = '/xslmes/approvalFlow/add',
|
||
edit = '/xslmes/approvalFlow/edit',
|
||
get = '/xslmes/approvalFlow/queryById',
|
||
saveDesign = '/xslmes/approvalFlow/saveDesign',
|
||
updateStatus = '/xslmes/approvalFlow/updateStatus',
|
||
delete = '/xslmes/approvalFlow/delete',
|
||
deleteBatch = '/xslmes/approvalFlow/deleteBatch',
|
||
// update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】当前页设计上下文-----
|
||
designContext = '/xslmes/approvalFlow/designContext',
|
||
// update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】当前页设计上下文-----
|
||
// update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】业务表可选回调动作-----
|
||
bizActions = '/xslmes/approvalFlow/bizActions',
|
||
// update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】业务表可选回调动作-----
|
||
}
|
||
|
||
/**
|
||
* 分页列表查询
|
||
*/
|
||
export const getApprovalFlowList = (params) => defHttp.get({ url: Api.list, params });
|
||
|
||
/**
|
||
* 新增/编辑基本信息
|
||
*/
|
||
export const saveOrUpdateApprovalFlow = (params, isUpdate) => {
|
||
const url = isUpdate ? Api.edit : Api.save;
|
||
return defHttp.post({ url, params });
|
||
};
|
||
|
||
/**
|
||
* 通过 id 查询(含流程设计 JSON)
|
||
*/
|
||
export const getApprovalFlowById = (params) => defHttp.get({ url: Api.get, params });
|
||
|
||
/**
|
||
* 保存流程设计(节点树 JSON)
|
||
*/
|
||
export const saveApprovalFlowDesign = (params) => defHttp.post({ url: Api.saveDesign, params });
|
||
|
||
/**
|
||
* 发布 / 停用
|
||
*/
|
||
export const updateApprovalFlowStatus = (params) => defHttp.post({ url: Api.updateStatus, params }, { joinParamsToUrl: true });
|
||
|
||
/**
|
||
* 删除
|
||
*/
|
||
export const deleteApprovalFlow = (params, handleSuccess) => {
|
||
return defHttp.delete({ url: Api.delete, data: params }, { joinParamsToUrl: true }).then(() => {
|
||
handleSuccess();
|
||
});
|
||
};
|
||
|
||
/**
|
||
* 批量删除
|
||
*/
|
||
export const batchDeleteApprovalFlow = (params, handleSuccess) => {
|
||
return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
|
||
handleSuccess();
|
||
});
|
||
};
|
||
|
||
// update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】当前页设计上下文(解析阶段字段+取/建草稿流程)-----
|
||
/**
|
||
* 获取当前功能页的审批流设计上下文:
|
||
* 返回 { routePath, bizTable, bizTableName, stages[], flow },
|
||
* stages 为识别到的阶段字段(校对/审核/审批/分发/抄送),flow 为可直接进入设计器的流程记录。
|
||
*/
|
||
export const getApprovalDesignContext = (routePath: string) => defHttp.get({ url: Api.designContext, params: { routePath } });
|
||
// update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】当前页设计上下文(解析阶段字段+取/建草稿流程)-----
|
||
|
||
// update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】业务表可选回调动作(后端@ApprovalBizAction注解扫描)-----
|
||
/**
|
||
* 查询某业务表已标注 @ApprovalBizAction 的可选回调动作,供节点「回调接口」下拉选择。
|
||
* 返回 [{ name, url, method, table, phase, perms }]
|
||
*/
|
||
export const getApprovalBizActions = (table: string) => defHttp.get({ url: Api.bizActions, params: { table } });
|
||
// update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】业务表可选回调动作-----
|