From 6b988bd582bfcd17fee48c476a5a6e5cc172b0d5 Mon Sep 17 00:00:00 2001
From: baoshiwei <baoshiwei@shlanbao.cn>
Date: 星期三, 12 三月 2025 10:08:33 +0800
Subject: [PATCH] dev-2

---
 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..6d5e53b
--- /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 = (businessKey: string) => {
+  return request({
+    url: `/workflow/processInstance/getHistoryImage/${businessKey}` + '?t' + Math.random(),
+    method: 'get'
+  });
+};
+
+/**
+ * 閫氳繃涓氬姟id鑾峰彇鍘嗗彶娴佺▼鍥捐繍琛屼腑锛屽巻鍙茬瓑鑺傜偣
+ */
+export const getHistoryList = (businessKey: string): AxiosPromise<Record<string, any>> => {
+  return request({
+    url: `/workflow/processInstance/getHistoryList/${businessKey}` + '?t' + Math.random(),
+    method: 'get'
+  });
+};
+
+/**
+ * 鑾峰彇瀹℃壒璁板綍
+ * @param businessKey 涓氬姟id
+ * @returns
+ */
+export const getHistoryRecord = (businessKey: string | number) => {
+  return request({
+    url: `/workflow/processInstance/getHistoryRecord/${businessKey}`,
+    method: 'get'
+  });
+};
+
+/**
+ * 浣滃簾
+ * @param data 鍙傛暟
+ * @returns
+ */
+export const deleteRunInstance = (data: object) => {
+  return request({
+    url: `/workflow/processInstance/deleteRunInstance`,
+    method: 'post',
+    data: data
+  });
+};
+
+/**
+ * 杩愯涓殑瀹炰緥 鍒犻櫎绋嬪疄渚嬶紝鍒犻櫎鍘嗗彶璁板綍锛屽垹闄や笟鍔′笌娴佺▼鍏宠仈淇℃伅
+ * @param businessKey 涓氬姟id
+ * @returns
+ */
+export const deleteRunAndHisInstance = (businessKey: string | string[]) => {
+  return request({
+    url: `/workflow/processInstance/deleteRunAndHisInstance/${businessKey}`,
+    method: 'delete'
+  });
+};
+
+/**
+ * 宸插畬鎴愮殑瀹炰緥 鍒犻櫎绋嬪疄渚嬶紝鍒犻櫎鍘嗗彶璁板綍锛屽垹闄や笟鍔′笌娴佺▼鍏宠仈淇℃伅
+ * @param businessKey 涓氬姟id
+ * @returns
+ */
+export const deleteFinishAndHisInstance = (businessKey: string | string[]) => {
+  return request({
+    url: `/workflow/processInstance/deleteFinishAndHisInstance/${businessKey}`,
+    method: 'delete'
+  });
+};
+
+/**
+ * 鍒嗛〉鏌ヨ褰撳墠鐧诲綍浜哄崟鎹�
+ * @param query
+ * @returns {*}
+ */
+export const getPageByCurrent = (query: ProcessInstanceQuery): AxiosPromise<ProcessInstanceVO[]> => {
+  return request({
+    url: '/workflow/processInstance/getPageByCurrent',
+    method: 'get',
+    params: query
+  });
+};
+
+/**
+ * 鎾ら攢娴佺▼
+ * @param businessKey 涓氬姟id
+ * @returns
+ */
+export const cancelProcessApply = (businessKey: string) => {
+  return request({
+    url: `/workflow/processInstance/cancelProcessApply/${businessKey}`,
+    method: 'post'
+  });
+};
+
+export default {
+  getPageByRunning,
+  getPageByFinish,
+  getHistoryImage,
+  getHistoryList,
+  getHistoryRecord,
+  deleteRunInstance,
+  deleteRunAndHisInstance,
+  deleteFinishAndHisInstance,
+  getPageByCurrent,
+  cancelProcessApply
+};

--
Gitblit v1.9.3