diff --git a/.env.development b/.env.development index a70988f..dc6093f 100644 --- a/.env.development +++ b/.env.development @@ -25,3 +25,6 @@ VITE_GLOB_API_URL_PREFIX= # 表单设计器微前端地址 VITE_APP_SUB_form-design = '//localhost:7101' + +# 工作流设计器微前端地址 +VITE_APP_SUB_workflow-design = '//localhost:7102' diff --git a/.env.production b/.env.production index e9a39af..c4019fe 100644 --- a/.env.production +++ b/.env.production @@ -37,4 +37,7 @@ VITE_USE_PWA = false VITE_LEGACY = false # 表单设计器微前端地址 -VITE_APP_SUB_form-design = '//kicc.kanglailab.com:7101' +VITE_APP_SUB_form-design = '//kicc.kanglailab.com:3001' + +# 工作流设计器微前端地址 +VITE_APP_SUB_workflow-design = '//kicc.kanglailab.com:3002' diff --git a/.env.test b/.env.test index 45470a6..b3e979d 100644 --- a/.env.test +++ b/.env.test @@ -40,3 +40,6 @@ VITE_LEGACY = false # 表单设计器微前端地址 VITE_APP_SUB_form-design = '//192.168.3.10:7101' + +# 工作流设计器微前端地址 +VITE_APP_SUB_workflow-design = '//192.168.3.10:7102' diff --git a/src/api/platform/workflow/controller/model.ts b/src/api/platform/workflow/controller/model.ts new file mode 100644 index 0000000..fa3ebcb --- /dev/null +++ b/src/api/platform/workflow/controller/model.ts @@ -0,0 +1,29 @@ +/** + * 提供api模板规范代码参考,请尽量保证编写代码风格跟模板规范代码一致 + * Copyright © 2023-2023 海豚生态开源社区 All rights reserved. + * author wangxiang4 + */ +import { WorkflowModelResult, WorkflowModelParams, WorkflowModel } from '/@/api/platform/workflow/entity/workflowModel'; +import { defHttp } from '/@/utils/http/axios'; +import { downloadByUrl } from '/@/utils/file/download'; +import { useGlobSetting } from '/@/hooks/setting'; +const { apiUrl } = useGlobSetting(); + +enum Api { + list = '/workflow_proxy/workflow/model/list', + getBpmnXml = '/workflow_proxy/workflow/model/getBpmnXml', + del = '/workflow_proxy/workflow/model/remove', + copy = '/workflow_proxy/workflow/model/copy', + deploy = '/workflow_proxy/workflow/model/deploy', + save = '/workflow_proxy/workflow/model/saveModel', + bpmnXmlDownload = '/workflow_proxy/workflow/model/bpmnXmlDownload' +} + +export const listModel = (params?: Partial) => defHttp.get({url: Api.list, params}, { isReturnResultResponse: true }); +export const getModel = (modelId: string) => defHttp.get({url: `${Api.getBpmnXml}/${modelId}` }); +export const delModel = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` }); +export const copyModel = (modelId: string)=> defHttp.post({ url: `${Api.copy}/${modelId}` }); +export const deployModel = (modelId: string, category: string)=> defHttp.post({ url: Api.deploy, params: { id: modelId, category } }); +export const saveModel = (modelId: string, params: Recordable)=> defHttp.post({url: `${Api.save}/${modelId}`, data: params}); +export const bpmnXmlDownload = (modelId: string, fileName?: string) => Promise.resolve(downloadByUrl({ url: `${apiUrl}${Api.bpmnXmlDownload}/${modelId}`, fileName: fileName })); + diff --git a/src/api/platform/workflow/controller/process.ts b/src/api/platform/workflow/controller/process.ts new file mode 100644 index 0000000..20e9007 --- /dev/null +++ b/src/api/platform/workflow/controller/process.ts @@ -0,0 +1,43 @@ +/** + * 提供api模板规范代码参考,请尽量保证编写代码风格跟模板规范代码一致 + * Copyright © 2023-2023 海豚生态开源社区 All rights reserved. + * author wangxiang4 + */ +import { ProcessDefinitionInfoResult } from '/@/api/platform/workflow/entity/processDefinitionInfo'; +import { ProcessInstanceInfoResult } from '/@/api/platform/workflow/entity/processInstanceInfo'; +import { Workflow } from '/@/api/platform/workflow/entity/workflow'; +import { defHttp } from '/@/utils/http/axios'; + +enum Api { + list = '/workflow_proxy/workflow/process/list', + exist = '/workflow_proxy/workflow/process/exist', + runList = '/workflow_proxy/workflow/process/runList', + historyList = '/workflow_proxy/workflow/process/historyList', + getFlowChart = '/workflow_proxy/workflow/process/getFlowChart', + setProcessCategory = '/workflow_proxy/workflow/process/setProcessCategory', + setProcessInstanceStatus = '/workflow_proxy/workflow/process/setProcessInstanceStatus', + removeDeployment = '/workflow_proxy/workflow/process/removeDeployment', + removeProcessInstance = '/workflow_proxy/workflow/process/removeProcessInstance', + undoProcessInstance = '/workflow_proxy/workflow/process/undoProcessInstance', + stopProcessInstance = '/workflow_proxy/workflow/process/stopProcessInstance', + queryProcessStatus = '/workflow_proxy/workflow/process/queryProcessStatus', + selfProcessInstanceList = '/workflow_proxy/workflow/process/selfProcessInstanceList', + startProcessDefinition = '/workflow_proxy/workflow/process/startProcessDefinition', + removeHistoryProcessIns = '/workflow_proxy/workflow/process/removeHistoryProcessIns', +} + +export const listProcessDef = (params?: Recordable) => defHttp.get({ url: Api.list, params }, { isReturnResultResponse: true }); +export const exist = (processDefKey: string) => defHttp.get({url: `${Api.exist}/${processDefKey}` }); +export const listProcessRun = (params?: Recordable) => defHttp.get({ url: Api.runList, params }, { isReturnResultResponse: true }); +export const listProcessHistory = (params?: Recordable) => defHttp.get({ url: Api.historyList, params }, { isReturnResultResponse: true }); +export const getFlowChart = (processDefId: string) => defHttp.get({url: `${Api.getFlowChart}/${processDefId}` }); +export const setProcessCategory = (processDefKeys: string | string[], category: string) => defHttp.put({url: Api.setProcessCategory, params: { processDefKeys, category } }); +export const setProcessInstanceStatus = (processDefKeys: string | string[], status: string) => defHttp.put({url: Api.setProcessInstanceStatus, params: { processDefKeys, status } }); +export const removeDeployment = (ids: string) => defHttp.delete({ url: `${Api.removeDeployment}/${ids}` }); +export const removeProcessInstance = (processDefKeys: string | string[], reason: string) => defHttp.delete({url: Api.removeProcessInstance, params: { processDefKeys, reason } }); +export const undoProcessInstance = (processInsId: string) => defHttp.put({ url: `${Api.undoProcessInstance}/${processInsId}` }); +export const stopProcessInstance = (processInsId: string, message: string) => defHttp.put({ url: Api.stopProcessInstance, params: { processInsId, message } }); +export const queryProcessStatus = (processInsId: string) => defHttp.get({ url: `${Api.queryProcessStatus}/${processInsId}`} ); +export const selfProcessInstanceList = (params: Recordable) => defHttp.get({ url: Api.selfProcessInstanceList, params }); +export const startProcessDefinition = (workflow: Workflow) => defHttp.post({ url: Api.startProcessDefinition, data: workflow }); +export const removeHistoryProcessIns = (ids: string) => defHttp.delete({ url: `${Api.removeHistoryProcessIns}${ids}` }); diff --git a/src/api/platform/workflow/entity/activityCommentInfo.ts b/src/api/platform/workflow/entity/activityCommentInfo.ts new file mode 100644 index 0000000..53048eb --- /dev/null +++ b/src/api/platform/workflow/entity/activityCommentInfo.ts @@ -0,0 +1,7 @@ +export interface ActivityCommentInfo { + mesName: string; + mesCode: string; + mesLevel: string; + message: string; + [key: string]: any; +} diff --git a/src/api/platform/workflow/entity/historicActivityInstance.ts b/src/api/platform/workflow/entity/historicActivityInstance.ts new file mode 100644 index 0000000..6533a96 --- /dev/null +++ b/src/api/platform/workflow/entity/historicActivityInstance.ts @@ -0,0 +1,19 @@ +export interface HistoricActivityInstance { + id: string; + activityId: string; + activityName: string; + activityType: string; + processDefinitionId: string; + processInstanceId: string; + executionId: string; + taskId: string; + calledProcessInstanceId: string; + assignee: string; + startTime: string; + endTime: string; + durationInMillis: string; + deleteReason: string; + tenantId: string; + time: string; + [key: string]: any; +} diff --git a/src/api/platform/workflow/entity/historyTaskInfo.ts b/src/api/platform/workflow/entity/historyTaskInfo.ts new file mode 100644 index 0000000..9f1f595 --- /dev/null +++ b/src/api/platform/workflow/entity/historyTaskInfo.ts @@ -0,0 +1,28 @@ +import type { R } from '/#/axios'; +import type { Page } from '/@/api/common/data/entity'; +import type { TaskInfo } from './taskInfo'; + +export type HistoryTaskInfoParams = Page & HistoryTaskInfo; + +export interface HistoryTaskInfo { + id: string; + name: string; + assignee: string; + executionId: string; + taskDefKey: string; + processDefId: string; + processInsId: string; + processDefName: string; + rollBack: boolean; + comment: string; + mesName: string; + mesCode: string; + mesLevel: string; + createTime: string; + endTime: string; + taskInfo: TaskInfo; + vars: Recordable; + [key:string]: any; +} + +export type HistoryTaskInfoResult = R; diff --git a/src/api/platform/workflow/entity/processDefinitionInfo.ts b/src/api/platform/workflow/entity/processDefinitionInfo.ts new file mode 100644 index 0000000..b9e34fd --- /dev/null +++ b/src/api/platform/workflow/entity/processDefinitionInfo.ts @@ -0,0 +1,20 @@ +import type { R } from '/#/axios'; +import type { Page } from '/@/api/common/data/entity'; + +export type ProcessDefinitionInfoParams = Page & ProcessDefinitionInfo; + +export interface ProcessDefinitionInfo { + id: string; + category: string; + key: string; + name: string; + version: string; + resourceName: string; + diagramResourceName: string; + deploymentId: string; + suspend: string; + deploymentTime: number; + [key:string]: any; +} + +export type ProcessDefinitionInfoResult = R; diff --git a/src/api/platform/workflow/entity/processInstanceInfo.ts b/src/api/platform/workflow/entity/processInstanceInfo.ts new file mode 100644 index 0000000..85e1cde --- /dev/null +++ b/src/api/platform/workflow/entity/processInstanceInfo.ts @@ -0,0 +1,28 @@ +import type { R } from '/#/axios'; +import type { Page } from '/@/api/common/data/entity'; +import type { TaskInfo } from './taskInfo'; +import type { HistoryTaskInfo } from './historyTaskInfo'; + +export type ProcessInstanceInfoParams = Page & ProcessInstanceInfo; + +export interface ProcessInstanceInfo { + processInsId: string; + processDefId: string; + processDefKey: string; + processDefName: string; + version: number; + startTime: string; + endTime: string; + activityId: string; + taskName: string; + deleteReason: string; + taskInfo: TaskInfo; + mesName: string; + mesCode: string; + mesLevel: string; + historyTaskInfo: HistoryTaskInfo; + vars: Recordable; + [key:string]: any; +} + +export type ProcessInstanceInfoResult = R; diff --git a/src/api/platform/workflow/entity/taskInfo.ts b/src/api/platform/workflow/entity/taskInfo.ts new file mode 100644 index 0000000..38b9fd8 --- /dev/null +++ b/src/api/platform/workflow/entity/taskInfo.ts @@ -0,0 +1,19 @@ +import type { R } from '/#/axios'; +import type { Page } from '/@/api/common/data/entity'; + +export type TaskInfoParams = Page & TaskInfo; + +export interface TaskInfo { + id: string; + name: string; + assignee: string; + executionId: string; + taskDefKey: string; + createTime: string; + processDefId: string; + processInsId: string; + processDefKey: string; + [key:string]: any; +} + +export type TaskInfoResult = R; diff --git a/src/api/platform/workflow/entity/workflow.ts b/src/api/platform/workflow/entity/workflow.ts new file mode 100644 index 0000000..3563bbe --- /dev/null +++ b/src/api/platform/workflow/entity/workflow.ts @@ -0,0 +1,23 @@ +import type { ActivityCommentInfo } from './activityCommentInfo'; +import type { HistoricActivityInstance } from './historicActivityInstance'; + +export interface Workflow { + taskId: string; + taskName: string; + taskDefKey: string; + assignee: string; + assigneeName: string; + formKey: string; + formType: string; + formReadOnly: boolean; + title: string; + processInsId: string; + processDefId: string; + processDefKey: string; + businessId: string; + businessTable: string; + vars: Recordable; + activityCommentInfo: ActivityCommentInfo; + historicActivityInstance: HistoricActivityInstance; + [key:string]: any; +} diff --git a/src/api/platform/workflow/entity/workflowModel.ts b/src/api/platform/workflow/entity/workflowModel.ts new file mode 100644 index 0000000..74c2ef0 --- /dev/null +++ b/src/api/platform/workflow/entity/workflowModel.ts @@ -0,0 +1,26 @@ +import type { R } from '/#/axios'; +import type { Page } from '/@/api/common/data/entity'; +import type { ProcessDefinitionInfo } from './processDefinitionInfo'; + +export type WorkflowModelParams = Page & WorkflowModel; + +export interface WorkflowModel { + id: string; + name: string; + modelKey: string; + description: string; + modelComment: string; + createTime: string; + createById: string; + updateTime: string; + updateById: string; + version: number; + modelEditorJson: string; + thumbnail: Blob; + modelType: number; + tenantId: string; + processDefinition: ProcessDefinitionInfo; + [key:string]: any; +} + +export type WorkflowModelResult = R; diff --git a/src/api/platform/workflow/extension/controller/processCategory.ts b/src/api/platform/workflow/extension/controller/processCategory.ts new file mode 100644 index 0000000..cd2f7dd --- /dev/null +++ b/src/api/platform/workflow/extension/controller/processCategory.ts @@ -0,0 +1,25 @@ +/** + * 提供api模板规范代码参考,请尽量保证编写代码风格跟模板规范代码一致 + * Copyright © 2023-2023 海豚生态开源社区 All rights reserved. + * author wangxiang4 + */ +import { FormCategory, FormCategoryParams, FormCategoryResult } from '/@/api/platform/workflow/extension/entity/formCategory'; +import { defHttp } from '/@/utils/http/axios'; + +enum Api { + list = '/workflow_proxy/workflow/extension/formCategory/list', + get = '/workflow_proxy/workflow/extension/formCategory', + save = '/workflow_proxy/workflow/extension/formCategory/save', + edit = '/workflow_proxy/workflow/extension/formCategory/update', + del = '/workflow_proxy/workflow/extension/formCategory/remove', +} + +export const listFormCategory = (params?: Partial) => defHttp.get({ url: Api.list, params }); + +export const addFormCategory = (params: Partial)=> defHttp.post({ url: Api.save ,data: params }); + +export const editFormCategory = (params: Partial) => defHttp.put({ url: Api.edit, data: params }); + +export const getFormCategory = (id: string) => defHttp.get({ url: `${Api.get}/${id}` }); + +export const delFormCategory = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` }); diff --git a/src/api/platform/workflow/extension/entity/processCategory.ts b/src/api/platform/workflow/extension/entity/processCategory.ts new file mode 100644 index 0000000..ec1ad15 --- /dev/null +++ b/src/api/platform/workflow/extension/entity/processCategory.ts @@ -0,0 +1,10 @@ +import type { R } from '/#/axios'; +import type { TreeEntity, Page } from '/@/api/common/data/entity'; + +export type FormCategoryParams = Page & FormCategory; + +export interface FormCategory extends TreeEntity { + [key: string]: any; +} + +export type FormCategoryResult = R; diff --git a/src/views/workflow/model/helper/ProcessCategoryModal.vue b/src/views/workflow/model/helper/ProcessCategoryModal.vue new file mode 100644 index 0000000..8b91f87 --- /dev/null +++ b/src/views/workflow/model/helper/ProcessCategoryModal.vue @@ -0,0 +1,60 @@ + + diff --git a/src/views/workflow/model/helper/WorkflowModelDesign.vue b/src/views/workflow/model/helper/WorkflowModelDesign.vue new file mode 100644 index 0000000..0d6f724 --- /dev/null +++ b/src/views/workflow/model/helper/WorkflowModelDesign.vue @@ -0,0 +1,116 @@ + + diff --git a/src/views/workflow/model/index.vue b/src/views/workflow/model/index.vue new file mode 100644 index 0000000..3884eb8 --- /dev/null +++ b/src/views/workflow/model/index.vue @@ -0,0 +1,253 @@ + + + diff --git a/src/views/workflow/model/model.data.ts b/src/views/workflow/model/model.data.ts new file mode 100644 index 0000000..c265f35 --- /dev/null +++ b/src/views/workflow/model/model.data.ts @@ -0,0 +1,64 @@ +import { BasicColumn, FormSchema } from '/@/components/Table'; +import { h } from 'vue'; +import { Tag } from 'ant-design-vue'; + +export const columns: BasicColumn[] = [ + { + title: '流程名称', + dataIndex: 'name', + }, + { + title: '流程KEY', + dataIndex: ['formCategory', 'name'], + }, + { + title: '分类', + dataIndex: ['formDefinitionJson', 'version'], + width: 200, + customRender: ({ record }) => { + return record.formDefinitionJson?.version ? + h(Tag, {color: 'success'}, () => record.formDefinitionJson?.version): + h(Tag, {color: 'red'}, () => '暂无版本号'); + } + }, + { + title: '流程版本', + dataIndex: ['formDefinitionJson', 'status'], + width: 200, + customRender: ({ record }) => { + return record.formDefinitionJson?.status == '1' ? + h(Tag, { color: 'success' }, () => '已发布'): + h(Tag, { color: 'red' }, () => '未发布'); + } + }, + { + title: '流程状态', + dataIndex: ['formDefinitionJson', 'isPrimary'], + width: 200, + customRender: ({ record }) => { + return record.formDefinitionJson?.isPrimary == '1' ? + h(Tag, { color: 'success' }, () => '主版本'): + h(Tag, { color: 'red' }, () => '非主版本'); + } + }, + { + title: '更新时间', + dataIndex: ['formDefinitionJson', 'isPrimary'], + width: 200, + customRender: ({ record }) => { + return record.formDefinitionJson?.isPrimary == '1' ? + h(Tag, { color: 'success' }, () => '主版本'): + h(Tag, { color: 'red' }, () => '非主版本'); + } + } +]; + +export const searchFormSchema: FormSchema[] = [ + { + label: '流程名称', + field: 'categoryId', + slot: 'categoryId', + component: 'Input', + colProps: { span: 8 } + } +];