From a63543a5c793c8954fa2f9da0ee4fb215c62d8c2 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期一, 20 五月 2024 10:26:46 +0800 Subject: [PATCH] !118 ♥️发布 5.2.0-BETA 公测版本 Merge pull request !118 from 疯狂的狮子Li/dev --- src/api/workflow/processInstance/index.ts | 136 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 136 insertions(+), 0 deletions(-) diff --git a/src/api/workflow/processInstance/index.ts b/src/api/workflow/processInstance/index.ts new file mode 100644 index 0000000..80f122f --- /dev/null +++ b/src/api/workflow/processInstance/index.ts @@ -0,0 +1,136 @@ +import request from '@/utils/request'; +import { ProcessInstanceQuery, ProcessInstanceVO } from '@/api/workflow/processInstance/types'; +import { AxiosPromise } from 'axios'; + +/** + * 鏌ヨ杩愯涓疄渚嬪垪琛� + * @param query + * @returns {*} + */ +export const getPageByRunning = (query: ProcessInstanceQuery): AxiosPromise<ProcessInstanceVO[]> => { + return request({ + url: '/workflow/processInstance/getPageByRunning', + method: 'get', + params: query + }); +}; + +/** + * 鏌ヨ宸插畬鎴愬疄渚嬪垪琛� + * @param query + * @returns {*} + */ +export const getPageByFinish = (query: ProcessInstanceQuery): AxiosPromise<ProcessInstanceVO[]> => { + return request({ + url: '/workflow/processInstance/getPageByFinish', + method: 'get', + params: query + }); +}; + +/** + * 閫氳繃娴佺▼瀹炰緥id鑾峰彇鍘嗗彶娴佺▼鍥� + */ +export const getHistoryImage = (processInstanceId: string) => { + return request({ + url: `/workflow/processInstance/getHistoryImage/${processInstanceId}` + '?t' + Math.random(), + method: 'get' + }); +}; + +/** + * 閫氳繃娴佺▼瀹炰緥id鑾峰彇鍘嗗彶娴佺▼鍥捐繍琛屼腑锛屽巻鍙茬瓑鑺傜偣 + */ +export const getHistoryList = (instanceId: string): AxiosPromise<Record<string, any>> => { + return request({ + url: `/workflow/processInstance/getHistoryList/${instanceId}` + '?t' + Math.random(), + method: 'get' + }); +}; + +/** + * 鑾峰彇瀹℃壒璁板綍 + * @param processInstanceId 娴佺▼瀹炰緥id + * @returns + */ +export const getHistoryRecord = (processInstanceId: string) => { + return request({ + url: `/workflow/processInstance/getHistoryRecord/${processInstanceId}`, + method: 'get' + }); +}; + +/** + * 浣滃簾 + * @param data 鍙傛暟 + * @returns + */ +export const deleteRunInstance = (data: object) => { + return request({ + url: `/workflow/processInstance/deleteRunInstance`, + method: 'post', + data: data + }); +}; + +/** + * 杩愯涓殑瀹炰緥 鍒犻櫎绋嬪疄渚嬶紝鍒犻櫎鍘嗗彶璁板綍锛屽垹闄や笟鍔′笌娴佺▼鍏宠仈淇℃伅 + * @param processInstanceId 娴佺▼瀹炰緥id + * @returns + */ +export const deleteRunAndHisInstance = (processInstanceId: string | string[]) => { + return request({ + url: `/workflow/processInstance/deleteRunAndHisInstance/${processInstanceId}`, + method: 'delete' + }); +}; + +/** + * 宸插畬鎴愮殑瀹炰緥 鍒犻櫎绋嬪疄渚嬶紝鍒犻櫎鍘嗗彶璁板綍锛屽垹闄や笟鍔′笌娴佺▼鍏宠仈淇℃伅 + * @param processInstanceId 娴佺▼瀹炰緥id + * @returns + */ +export const deleteFinishAndHisInstance = (processInstanceId: string | string[]) => { + return request({ + url: `/workflow/processInstance/deleteFinishAndHisInstance/${processInstanceId}`, + method: 'delete' + }); +}; + +/** + * 鍒嗛〉鏌ヨ褰撳墠鐧诲綍浜哄崟鎹� + * @param query + * @returns {*} + */ +export const getPageByCurrent = (query: ProcessInstanceQuery): AxiosPromise<ProcessInstanceVO[]> => { + return request({ + url: '/workflow/processInstance/getPageByCurrent', + method: 'get', + params: query + }); +}; + +/** + * 鎾ら攢娴佺▼ + * @param processInstanceId 娴佺▼瀹炰緥id + * @returns + */ +export const cancelProcessApply = (processInstanceId: string) => { + return request({ + url: `/workflow/processInstance/cancelProcessApply/${processInstanceId}`, + method: 'post' + }); +}; + +export default { + getPageByRunning, + getPageByFinish, + getHistoryImage, + getHistoryList, + getHistoryRecord, + deleteRunInstance, + deleteRunAndHisInstance, + deleteFinishAndHisInstance, + getPageByCurrent, + cancelProcessApply +}; -- Gitblit v1.9.3