From a9fcce241344fa752357d8c26c27ec6de2da083f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Mon, 9 Dec 2024 23:30:05 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/workflow/definition/index.ts | 19 +-- src/api/workflow/definitionConfig/index.ts | 14 ++- src/api/workflow/instance/index.ts | 101 ++++++++++++++++ .../{processInstance => instance}/types.ts | 0 src/api/workflow/processInstance/index.ts | 109 ------------------ src/api/workflow/task/index.ts | 22 ++-- src/components/BpmnView/index.vue | 2 +- src/components/Process/approvalRecord.vue | 2 +- src/components/Process/processMeddle.vue | 6 +- src/components/Process/submitVerify.vue | 6 +- src/views/workflow/leave/index.vue | 2 +- .../workflow/processDefinition/index.vue | 22 +--- src/views/workflow/processInstance/index.vue | 12 +- src/views/workflow/task/myDocument.vue | 8 +- src/views/workflow/task/taskCopyList.vue | 4 +- src/views/workflow/task/taskFinish.vue | 4 +- src/views/workflow/task/taskWaiting.vue | 4 +- 17 files changed, 163 insertions(+), 174 deletions(-) create mode 100644 src/api/workflow/instance/index.ts rename src/api/workflow/{processInstance => instance}/types.ts (100%) delete mode 100644 src/api/workflow/processInstance/index.ts diff --git a/src/api/workflow/definition/index.ts b/src/api/workflow/definition/index.ts index 4a8e64b..5a9446b 100644 --- a/src/api/workflow/definition/index.ts +++ b/src/api/workflow/definition/index.ts @@ -1,5 +1,5 @@ import request from '@/utils/request'; -import { FlowDefinitionQuery, FlowDefinitionVo, definitionXmlVO, FlowDefinitionForm } from '@/api/workflow/definition/types'; +import { FlowDefinitionQuery, definitionXmlVO, FlowDefinitionForm } from '@/api/workflow/definition/types'; import { AxiosPromise } from 'axios'; /** @@ -55,10 +55,13 @@ export const deleteDefinition = (id: string | string[]) => { * @param definitionId 流程定义id * @returns */ -export const updateDefinitionState = (definitionId: string, activityStatus: boolean) => { +export const active = (definitionId: string, activityStatus: boolean) => { return request({ - url: `/workflow/definition/updateDefinitionState/${definitionId}/${activityStatus}`, - method: 'put' + url: `/workflow/definition/active/${definitionId}`, + method: 'put', + params: { + activityStatus: activityStatus + } }); }; @@ -66,9 +69,9 @@ export const updateDefinitionState = (definitionId: string, activityStatus: bool * 通过zip或xml部署流程定义 * @returns */ -export function importDefinition(data: any) { +export function importDef(data: any) { return request({ - url: '/workflow/definition/importDefinition', + url: '/workflow/definition/importDef', method: 'post', data: data, headers: { @@ -131,9 +134,9 @@ export const add = (data: FlowDefinitionForm) => { * @param id 流程定义id * @returns */ -export const copyDef = (id: string) => { +export const copy = (id: string) => { return request({ - url: `/workflow/definition/copyDef/${id}`, + url: `/workflow/definition/copy/${id}`, method: 'post' }); }; diff --git a/src/api/workflow/definitionConfig/index.ts b/src/api/workflow/definitionConfig/index.ts index d34bf05..d72ab8c 100644 --- a/src/api/workflow/definitionConfig/index.ts +++ b/src/api/workflow/definitionConfig/index.ts @@ -8,7 +8,7 @@ import { DefinitionConfigVO, DefinitionConfigForm } from '@/api/workflow/definit */ export const getByDefId = (definitionId: string | number): AxiosPromise => { return request({ - url: '/workflow/definitionConfig/getByDefId/' + definitionId, + url: '/workflow/defConfig/getByDefId/' + definitionId, method: 'get' }); }; @@ -19,7 +19,7 @@ export const getByDefId = (definitionId: string | number): AxiosPromise { return request({ - url: '/workflow/definitionConfig/saveOrUpdate', + url: '/workflow/defConfig/saveOrUpdate', method: 'post', data: data }); @@ -31,7 +31,7 @@ export const saveOrUpdate = (data: DefinitionConfigForm) => { */ export const deldefinitionConfig = (id: string | number | Array) => { return request({ - url: '/workflow/definitionConfig/' + id, + url: '/workflow/defConfig/' + id, method: 'delete' }); }; @@ -43,7 +43,11 @@ export const deldefinitionConfig = (id: string | number | Array */ export const getByTableNameNotDefId = (tableName: string, definitionId: string | number) => { return request({ - url: `/workflow/definitionConfig/getByTableNameNotDefId/${tableName}/${definitionId}`, - method: 'get' + url: `/workflow/defConfig/getByTableNameNotDefId`, + method: 'get', + params: { + tableName: tableName, + definitionId: definitionId + } }); }; diff --git a/src/api/workflow/instance/index.ts b/src/api/workflow/instance/index.ts new file mode 100644 index 0000000..b58883c --- /dev/null +++ b/src/api/workflow/instance/index.ts @@ -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 => { + return request({ + url: '/workflow/instance/pageByRunning', + method: 'get', + params: query + }); +}; + +/** + * 查询已完成实例列表 + * @param query + * @returns {*} + */ +export const pageByFinish = (query: FlowInstanceQuery): AxiosPromise => { + return request({ + url: '/workflow/instance/pageByFinish', + method: 'get', + params: query + }); +}; + +/** + * 通过业务id获取历史流程图 + */ +export const flowImage = (businessKey: string | number) => { + return request({ + url: `/workflow/instance/flowImage/${businessKey}` + '?t' + Math.random(), + method: 'get' + }); +}; + +/** + * 分页查询当前登录人单据 + * @param query + * @returns {*} + */ +export const pageByCurrent = (query: FlowInstanceQuery): AxiosPromise => { + 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) => { + 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 + }); +}; diff --git a/src/api/workflow/processInstance/types.ts b/src/api/workflow/instance/types.ts similarity index 100% rename from src/api/workflow/processInstance/types.ts rename to src/api/workflow/instance/types.ts diff --git a/src/api/workflow/processInstance/index.ts b/src/api/workflow/processInstance/index.ts deleted file mode 100644 index b82c829..0000000 --- a/src/api/workflow/processInstance/index.ts +++ /dev/null @@ -1,109 +0,0 @@ -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 => { - return request({ - url: '/workflow/processInstance/getPageByRunning', - method: 'get', - params: query - }); -}; - -/** - * 查询已完成实例列表 - * @param query - * @returns {*} - */ -export const getPageByFinish = (query: ProcessInstanceQuery): AxiosPromise => { - return request({ - url: '/workflow/processInstance/getPageByFinish', - method: 'get', - params: query - }); -}; - -/** - * 通过业务id获取历史流程图 - */ -export const getFlowImage = (businessKey: string | number) => { - return request({ - url: `/workflow/processInstance/getFlowImage/${businessKey}` + '?t' + Math.random(), - method: 'get' - }); -}; - -/** - * 分页查询当前登录人单据 - * @param query - * @returns {*} - */ -export const getPageByCurrent = (query: ProcessInstanceQuery): AxiosPromise => { - return request({ - url: '/workflow/processInstance/getPageByCurrent', - method: 'get', - params: query - }); -}; - -/** - * 撤销流程 - * @param data 参数 - * @returns - */ -export const cancelProcessApply = (data: any) => { - return request({ - url: `/workflow/processInstance/cancelProcessApply`, - method: 'put', - data: data - }); -}; - -/** - * 获取流程变量 - * @param businessKey 业务id - * @returns - */ -export const getInstanceVariable = (instanceId: string) => { - return request({ - url: `/workflow/processInstance/getInstanceVariable/${instanceId}`, - method: 'get' - }); -}; - -/** - * 删除 - * @param instanceIds 流程实例id - * @returns - */ -export const deleteByInstanceIds = (instanceIds: Array | string | number) => { - return request({ - url: `/workflow/processInstance/deleteByInstanceIds/${instanceIds}`, - method: 'delete' - }); -}; -/** - * 作废流程 - * @param data 参数 - * @returns - */ -export const processInvalid = (data: any) => { - return request({ - url: `/workflow/processInstance/processInvalid`, - method: 'post', - data: data - }); -}; - -export default { - getPageByRunning, - getPageByFinish, - getFlowImage, - getPageByCurrent, - cancelProcessApply -}; diff --git a/src/api/workflow/task/index.ts b/src/api/workflow/task/index.ts index 25441a4..947406e 100644 --- a/src/api/workflow/task/index.ts +++ b/src/api/workflow/task/index.ts @@ -7,9 +7,9 @@ import { TaskQuery, FlowTaskVO, TaskOperationBo } from '@/api/workflow/task/type * @param query * @returns {*} */ -export const getPageByTaskWait = (query: TaskQuery): AxiosPromise => { +export const pageByTaskWait = (query: TaskQuery): AxiosPromise => { return request({ - url: '/workflow/task/getPageByTaskWait', + url: '/workflow/task/pageByTaskWait', method: 'get', params: query }); @@ -20,9 +20,9 @@ export const getPageByTaskWait = (query: TaskQuery): AxiosPromise * @param query * @returns {*} */ -export const getPageByTaskFinish = (query: TaskQuery): AxiosPromise => { +export const pageByTaskFinish = (query: TaskQuery): AxiosPromise => { return request({ - url: '/workflow/task/getPageByTaskFinish', + url: '/workflow/task/pageByTaskFinish', method: 'get', params: query }); @@ -33,9 +33,9 @@ export const getPageByTaskFinish = (query: TaskQuery): AxiosPromise => { +export const pageByTaskCopy = (query: TaskQuery): AxiosPromise => { return request({ - url: '/workflow/task/getPageByTaskCopy', + url: '/workflow/task/pageByTaskCopy', method: 'get', params: query }); @@ -111,16 +111,16 @@ export const backProcess = (data: any): any => { * @param taskId * @returns */ -export const getTaskById = (taskId: string) => { +export const getTask = (taskId: string) => { return request({ - url: '/workflow/task/getTaskById/' + taskId, + url: '/workflow/task/getTask/' + taskId, method: 'get' }); }; /** * 修改任务办理人 - * @param taskIds + * @param taskIdList * @param userId * @returns */ @@ -219,9 +219,9 @@ export const taskOperation = (data: TaskOperationBo, operation: string) => { * @param taskId 任务id * @returns */ -export const getUserListTaskId = (taskId: string | number) => { +export const currentTaskAllUser = (taskId: string | number) => { return request({ - url: `/workflow/task/getUserListTaskId/${taskId}`, + url: `/workflow/task/currentTaskAllUser/${taskId}`, method: 'get' }); }; diff --git a/src/components/BpmnView/index.vue b/src/components/BpmnView/index.vue index c5e0c7b..845d41e 100644 --- a/src/components/BpmnView/index.vue +++ b/src/components/BpmnView/index.vue @@ -40,7 +40,7 @@ import { ModuleDeclaration } from 'didi'; import type { Canvas, ModdleElement } from 'bpmn'; import EventBus from 'diagram-js/lib/core/EventBus'; import Overlays from 'diagram-js/lib/features/overlays/Overlays'; -import processApi from '@/api/workflow/processInstance/index'; +import processApi from '@/api/workflow/instance/index'; const canvas = ref(); const modeler = ref(); diff --git a/src/components/Process/approvalRecord.vue b/src/components/Process/approvalRecord.vue index 6d5d0c1..17e166d 100644 --- a/src/components/Process/approvalRecord.vue +++ b/src/components/Process/approvalRecord.vue @@ -56,7 +56,7 @@