diff --git a/src/api/workflow/definition/index.ts b/src/api/workflow/definition/index.ts new file mode 100644 index 0000000..9f8fb3a --- /dev/null +++ b/src/api/workflow/definition/index.ts @@ -0,0 +1,114 @@ +import request from '@/utils/request'; +import { definitionQuery, definitionVO, definitionXmlVO } from '@/api/workflow/definition/types'; +import { AxiosPromise } from 'axios'; + +/** + * 获取流程定义列表 + * @param query 流程实例id + * @returns + */ +export const listDefinition = (query: definitionQuery): AxiosPromise => { + return request({ + url: `/workflow/definition/list`, + method: 'get', + params: query + }); +}; +/** + * 按照流程定义key获取流程定义 + * @param processInstanceId 流程实例id + * @returns + */ +export const getListByKey = (key: string) => { + return request({ + url: `/workflow/definition/getListByKey/${key}`, + method: 'get' + }); +}; + +/** + * 通过流程定义id获取流程图 + */ +export const definitionImage = (definitionId: string): AxiosPromise => { + return request({ + url: `/workflow/definition/definitionImage/${definitionId}` + '?t' + Math.random(), + method: 'get' + }); +}; + +/** + * 通过流程定义id获取xml + * @param definitionId 流程定义id + * @returns + */ +export const definitionXml = (definitionId: string): AxiosPromise => { + return request({ + url: `/workflow/definition/definitionXml/${definitionId}`, + method: 'get' + }); +}; + +/** + * 删除流程定义 + * @param deploymentId 部署id + * @param definitionId 流程定义id + * @returns + */ +export const deleteDefinition = (deploymentId: string | string[], definitionId: string | string[]) => { + return request({ + url: `/workflow/definition/${deploymentId}/${definitionId}`, + method: 'delete' + }); +}; + +/** + * 挂起/激活 + * @param definitionId 流程定义id + * @returns + */ +export const updateDefinitionState = (definitionId: string) => { + return request({ + url: `/workflow/definition/updateDefinitionState/${definitionId}`, + method: 'put' + }); +}; + +/** + * 流程定义转换为模型 + * @param definitionId 流程定义id + * @returns + */ +export const convertToModel = (definitionId: string) => { + return request({ + url: `/workflow/definition/convertToModel/${definitionId}`, + method: 'put' + }); +}; + +/** + * 通过zip或xml部署流程定义 + * @returns + */ +export function deployProcessFile(data: any) { + return request({ + url: '/workflow/definition/deployByFile', + method: 'post', + data: data, + headers: { + repeatSubmit: false + } + }); +} + +/** + * 迁移流程 + * @param currentdefinitionId + * @param fromdefinitionId + * @returns + */ +export const migrationDefinition = (currentdefinitionId: string, fromdefinitionId: string) => { + return request({ + url: `/workflow/definition/migrationDefinition/${currentdefinitionId}/${fromdefinitionId}`, + method: 'put' + }); +}; diff --git a/src/api/workflow/processDefinition/types.ts b/src/api/workflow/definition/types.ts similarity index 57% rename from src/api/workflow/processDefinition/types.ts rename to src/api/workflow/definition/types.ts index 979ec25..dd5c309 100644 --- a/src/api/workflow/processDefinition/types.ts +++ b/src/api/workflow/definition/types.ts @@ -5,16 +5,14 @@ export interface ProcessDefinitionQuery extends PageQuery { categoryCode?: string; } -export interface ProcessDefinitionVO extends BaseEntity { +export interface FlowDefinitionVo extends BaseEntity { id: string; - name: string; - key: string; - version: number; - suspensionState: number; - resourceName: string; - diagramResourceName: string; - deploymentId: string; - deploymentTime: string; + flowName: string; + flowCode: string; + version: string; + isPublish: number; + createTime: Date; + updateTime: Date; wfDefinitionConfigVo: DefinitionConfigVO; } diff --git a/src/api/workflow/processDefinition/index.ts b/src/api/workflow/processDefinition/index.ts deleted file mode 100644 index c063120..0000000 --- a/src/api/workflow/processDefinition/index.ts +++ /dev/null @@ -1,114 +0,0 @@ -import request from '@/utils/request'; -import { ProcessDefinitionQuery, ProcessDefinitionVO, definitionXmlVO } from '@/api/workflow/processDefinition/types'; -import { AxiosPromise } from 'axios'; - -/** - * 获取流程定义列表 - * @param query 流程实例id - * @returns - */ -export const listProcessDefinition = (query: ProcessDefinitionQuery): AxiosPromise => { - return request({ - url: `/workflow/processDefinition/list`, - method: 'get', - params: query - }); -}; -/** - * 按照流程定义key获取流程定义 - * @param processInstanceId 流程实例id - * @returns - */ -export const getListByKey = (key: string) => { - return request({ - url: `/workflow/processDefinition/getListByKey/${key}`, - method: 'get' - }); -}; - -/** - * 通过流程定义id获取流程图 - */ -export const definitionImage = (processDefinitionId: string): AxiosPromise => { - return request({ - url: `/workflow/processDefinition/definitionImage/${processDefinitionId}` + '?t' + Math.random(), - method: 'get' - }); -}; - -/** - * 通过流程定义id获取xml - * @param processDefinitionId 流程定义id - * @returns - */ -export const definitionXml = (processDefinitionId: string): AxiosPromise => { - return request({ - url: `/workflow/processDefinition/definitionXml/${processDefinitionId}`, - method: 'get' - }); -}; - -/** - * 删除流程定义 - * @param deploymentId 部署id - * @param processDefinitionId 流程定义id - * @returns - */ -export const deleteProcessDefinition = (deploymentId: string | string[], processDefinitionId: string | string[]) => { - return request({ - url: `/workflow/processDefinition/${deploymentId}/${processDefinitionId}`, - method: 'delete' - }); -}; - -/** - * 挂起/激活 - * @param processDefinitionId 流程定义id - * @returns - */ -export const updateDefinitionState = (processDefinitionId: string) => { - return request({ - url: `/workflow/processDefinition/updateDefinitionState/${processDefinitionId}`, - method: 'put' - }); -}; - -/** - * 流程定义转换为模型 - * @param processDefinitionId 流程定义id - * @returns - */ -export const convertToModel = (processDefinitionId: string) => { - return request({ - url: `/workflow/processDefinition/convertToModel/${processDefinitionId}`, - method: 'put' - }); -}; - -/** - * 通过zip或xml部署流程定义 - * @returns - */ -export function deployProcessFile(data: any) { - return request({ - url: '/workflow/processDefinition/deployByFile', - method: 'post', - data: data, - headers: { - repeatSubmit: false - } - }); -} - -/** - * 迁移流程 - * @param currentProcessDefinitionId - * @param fromProcessDefinitionId - * @returns - */ -export const migrationDefinition = (currentProcessDefinitionId: string, fromProcessDefinitionId: string) => { - return request({ - url: `/workflow/processDefinition/migrationDefinition/${currentProcessDefinitionId}/${fromProcessDefinitionId}`, - method: 'put' - }); -}; diff --git a/src/api/workflow/processInstance/index.ts b/src/api/workflow/processInstance/index.ts index 6d5e53b..784185e 100644 --- a/src/api/workflow/processInstance/index.ts +++ b/src/api/workflow/processInstance/index.ts @@ -118,7 +118,7 @@ export const getPageByCurrent = (query: ProcessInstanceQuery): AxiosPromise { return request({ url: `/workflow/processInstance/cancelProcessApply/${businessKey}`, - method: 'post' + method: 'put' }); }; diff --git a/src/api/workflow/task/types.ts b/src/api/workflow/task/types.ts index 0425a1a..92b6cf2 100644 --- a/src/api/workflow/task/types.ts +++ b/src/api/workflow/task/types.ts @@ -12,33 +12,20 @@ export interface ParticipantVo { candidateName: string[]; claim: boolean; } - -export interface TaskVO extends BaseEntity { - id: string; - name: string; - description?: string; - priority: number; - owner?: string; - assignee?: string | number; - assigneeName?: string; - processInstanceId: string; - executionId: string; - taskDefinitionId?: any; - processDefinitionId: string; - endTime?: string; - taskDefinitionKey: string; - dueDate?: string; - category?: any; - parentTaskId?: any; - tenantId: string; - claimTime?: string; - businessStatus?: string; - businessStatusName?: string; - processDefinitionName?: string; - processDefinitionKey?: string; - participantVo?: ParticipantVo; - multiInstance?: boolean; - businessKey?: string; +export interface FlowTaskVO { + id: string | number; + createTime?: Date; + updateTime?: Date; + tenantId?: string; + definitionId?: string; + instanceId: string; + flowName: string; + businessId: string; + nodeCode: string; + nodeName: string; + flowCode: string; + flowStatus: string; + nodeType: number; wfNodeConfigVo?: NodeConfigVO; wfDefinitionConfigVo?: DefinitionConfigVO; } diff --git a/src/api/workflow/workflowCommon/index.ts b/src/api/workflow/workflowCommon/index.ts index 63ce318..a827d8d 100644 --- a/src/api/workflow/workflowCommon/index.ts +++ b/src/api/workflow/workflowCommon/index.ts @@ -2,28 +2,39 @@ import { RouterJumpVo } from '@/api/workflow/workflowCommon/types'; export default { routerJump(routerJumpVo: RouterJumpVo, proxy) { - if (routerJumpVo.wfNodeConfigVo && routerJumpVo.wfNodeConfigVo.formType === 'static' && routerJumpVo.wfNodeConfigVo.wfFormManageVo) { - proxy.$tab.closePage(proxy.$route); - proxy.$router.push({ - path: `${routerJumpVo.wfNodeConfigVo.wfFormManageVo.router}`, - query: { - id: routerJumpVo.businessKey, - type: routerJumpVo.type, - taskId: routerJumpVo.taskId - } - }); - } else if (routerJumpVo.wfNodeConfigVo && routerJumpVo.wfNodeConfigVo.formType === 'dynamic' && routerJumpVo.wfNodeConfigVo.wfFormManageVo) { - proxy.$tab.closePage(proxy.$route); - proxy.$router.push({ - path: `${routerJumpVo.wfNodeConfigVo.wfFormManageVo.router}`, - query: { - id: routerJumpVo.businessKey, - type: routerJumpVo.type, - taskId: routerJumpVo.taskId - } - }); - } else { - proxy?.$modal.msgError('请到模型配置菜单!'); - } + proxy.$tab.closePage(proxy.$route); + console.log(routerJumpVo); + proxy.$router.push({ + path: `/workflow/leaveEdit/index`, + query: { + id: routerJumpVo.businessKey, + type: routerJumpVo.type, + taskId: routerJumpVo.taskId + } + }); + + // if (routerJumpVo.wfNodeConfigVo && routerJumpVo.wfNodeConfigVo.formType === 'static' && routerJumpVo.wfNodeConfigVo.wfFormManageVo) { + // proxy.$tab.closePage(proxy.$route); + // proxy.$router.push({ + // path: `${routerJumpVo.wfNodeConfigVo.wfFormManageVo.router}`, + // query: { + // id: routerJumpVo.businessKey, + // type: routerJumpVo.type, + // taskId: routerJumpVo.taskId + // } + // }); + // } else if (routerJumpVo.wfNodeConfigVo && routerJumpVo.wfNodeConfigVo.formType === 'dynamic' && routerJumpVo.wfNodeConfigVo.wfFormManageVo) { + // proxy.$tab.closePage(proxy.$route); + // proxy.$router.push({ + // path: `${routerJumpVo.wfNodeConfigVo.wfFormManageVo.router}`, + // query: { + // id: routerJumpVo.businessKey, + // type: routerJumpVo.type, + // taskId: routerJumpVo.taskId + // } + // }); + // } else { + // proxy?.$modal.msgError('请到模型配置菜单!'); + // } } }; diff --git a/src/api/workflow/workflowCommon/types.ts b/src/api/workflow/workflowCommon/types.ts index 0f1ef1f..e2dd5e3 100644 --- a/src/api/workflow/workflowCommon/types.ts +++ b/src/api/workflow/workflowCommon/types.ts @@ -5,7 +5,7 @@ export interface RouterJumpVo { wfNodeConfigVo: NodeConfigVO; wfDefinitionConfigVo: DefinitionConfigVO; businessKey: string; - taskId: string; + taskId: string | number; type: string; } diff --git a/src/views/workflow/processDefinition/index.vue b/src/views/workflow/processDefinition/index.vue index 1dacb80..1aa2617 100644 --- a/src/views/workflow/processDefinition/index.vue +++ b/src/views/workflow/processDefinition/index.vue @@ -54,8 +54,8 @@ - - + + @@ -167,8 +167,8 @@ - - + + @@ -252,20 +252,20 @@