init:first commit of plus-ui
This commit is contained in:
101
src/api/workflow/instance/index.ts
Normal file
101
src/api/workflow/instance/index.ts
Normal file
@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import { FlowInstanceQuery, FlowInstanceVO } from '@/api/workflow/instance/types';
|
||||
import { AxiosPromise } from 'axios';
|
||||
|
||||
/**
|
||||
* 查询运行中实例列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export const pageByRunning = (query: FlowInstanceQuery): AxiosPromise<FlowInstanceVO[]> => {
|
||||
return request({
|
||||
url: '/workflow/instance/pageByRunning',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询已完成实例列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export const pageByFinish = (query: FlowInstanceQuery): AxiosPromise<FlowInstanceVO[]> => {
|
||||
return request({
|
||||
url: '/workflow/instance/pageByFinish',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 通过业务id获取历史流程图
|
||||
*/
|
||||
export const flowImage = (businessId: string | number) => {
|
||||
return request({
|
||||
url: `/workflow/instance/flowImage/${businessId}` + '?t' + Math.random(),
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 分页查询当前登录人单据
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export const pageByCurrent = (query: FlowInstanceQuery): AxiosPromise<FlowInstanceVO[]> => {
|
||||
return request({
|
||||
url: '/workflow/instance/pageByCurrent',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 撤销流程
|
||||
* @param data 参数
|
||||
* @returns
|
||||
*/
|
||||
export const cancelProcessApply = (data: any) => {
|
||||
return request({
|
||||
url: `/workflow/instance/cancelProcessApply`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取流程变量
|
||||
* @param instanceId 实例id
|
||||
* @returns
|
||||
*/
|
||||
export const instanceVariable = (instanceId: string | number) => {
|
||||
return request({
|
||||
url: `/workflow/instance/instanceVariable/${instanceId}`,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param instanceIds 流程实例id
|
||||
* @returns
|
||||
*/
|
||||
export const deleteByInstanceIds = (instanceIds: Array<string | number> | string | number) => {
|
||||
return request({
|
||||
url: `/workflow/instance/deleteByInstanceIds/${instanceIds}`,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 作废流程
|
||||
* @param data 参数
|
||||
* @returns
|
||||
*/
|
||||
export const invalid = (data: any) => {
|
||||
return request({
|
||||
url: `/workflow/instance/invalid`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
26
src/api/workflow/instance/types.ts
Normal file
26
src/api/workflow/instance/types.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import { FlowTaskVO } from '@/api/workflow/task/types';
|
||||
|
||||
export interface FlowInstanceQuery extends PageQuery {
|
||||
category?: string | number;
|
||||
nodeName?: string;
|
||||
flowCode?: string;
|
||||
flowName?: string;
|
||||
createByIds?: string[] | number[];
|
||||
businessId?: string;
|
||||
}
|
||||
|
||||
export interface FlowInstanceVO extends BaseEntity {
|
||||
id: string | number;
|
||||
definitionId: string;
|
||||
flowName: string;
|
||||
flowCode: string;
|
||||
version: string;
|
||||
businessId: string;
|
||||
activityStatus: number;
|
||||
tenantId: string;
|
||||
createTime: string;
|
||||
createBy: string;
|
||||
flowStatus: string;
|
||||
flowStatusName: string;
|
||||
flowTaskList: FlowTaskVO[];
|
||||
}
|
Reference in New Issue
Block a user