diff --git a/package.json b/package.json index b911cd6..223af4f 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,6 @@ "animate.css": "4.1.1", "await-to-js": "3.0.0", "axios": "1.7.8", - "bpmn-js": "16.4.0", "crypto-js": "4.2.0", "diagram-js": "12.3.0", "didi": "9.0.2", diff --git a/src/api/system/dept/index.ts b/src/api/system/dept/index.ts index 7e097fd..f16cb2c 100644 --- a/src/api/system/dept/index.ts +++ b/src/api/system/dept/index.ts @@ -1,6 +1,6 @@ import request from '@/utils/request'; import { AxiosPromise } from 'axios'; -import { DeptForm, DeptQuery, DeptVO } from './types'; +import {DeptForm, DeptQuery, DeptTreeVO, DeptVO} from './types'; // 查询部门列表 export const listDept = (query?: DeptQuery) => { @@ -11,6 +11,17 @@ export const listDept = (query?: DeptQuery) => { }); }; +/** + * 通过deptIds查询部门 + * @param deptIds + */ +export const optionSelect = (deptIds: (number | string)[]): AxiosPromise => { + return request({ + url: '/system/dept/optionselect?deptIds=' + deptIds, + method: 'get' + }); +}; + // 查询部门列表(排除节点) export const listDeptExcludeChild = (deptId: string | number): AxiosPromise => { return request({ @@ -28,7 +39,7 @@ export const getDept = (deptId: string | number): AxiosPromise => { }; // 查询部门下拉树结构 -export const treeselect = (): AxiosPromise => { +export const treeselect = (): AxiosPromise => { return request({ url: '/system/dept/treeselect', method: 'get' diff --git a/src/api/workflow/category/index.ts b/src/api/workflow/category/index.ts index e9723b0..b6a83ea 100644 --- a/src/api/workflow/category/index.ts +++ b/src/api/workflow/category/index.ts @@ -1,6 +1,6 @@ import request from '@/utils/request'; import { AxiosPromise } from 'axios'; -import { CategoryVO, CategoryForm, CategoryQuery } from '@/api/workflow/category/types'; +import { CategoryVO, CategoryForm, CategoryQuery, CategoryTreeVO } from '@/api/workflow/category/types'; /** * 查询流程分类列表 @@ -18,11 +18,11 @@ export const listCategory = (query?: CategoryQuery): AxiosPromise /** * 查询流程分类详细 - * @param id + * @param categoryId */ -export const getCategory = (id: string | number): AxiosPromise => { +export const getCategory = (categoryId: string | number): AxiosPromise => { return request({ - url: '/workflow/category/' + id, + url: '/workflow/category/' + categoryId, method: 'get' }); }; @@ -53,11 +53,24 @@ export const updateCategory = (data: CategoryForm) => { /** * 删除流程分类 - * @param id + * @param categoryId */ -export const delCategory = (id: string | number | Array) => { +export const delCategory = (categoryId: string | number | Array) => { return request({ - url: '/workflow/category/' + id, + url: '/workflow/category/' + categoryId, method: 'delete' }); }; + +/** + * 获取流程分类树列表 + * @param query 流程实例id + * @returns + */ +export const categoryTree = (query?: CategoryForm): AxiosPromise => { + return request({ + url: `/workflow/category/categoryTree`, + method: 'get', + params: query + }); +}; diff --git a/src/api/workflow/category/types.ts b/src/api/workflow/category/types.ts index 414fa55..a093073 100644 --- a/src/api/workflow/category/types.ts +++ b/src/api/workflow/category/types.ts @@ -1,18 +1,16 @@ +export interface CategoryTreeVO { + id: number | string; + label: string; + parentId: number | string; + weight: number; + children: CategoryTreeVO[]; +} export interface CategoryVO { - /** - * 主键 - */ - id: string; /** - * 分类名称 + * 流程分类ID */ - categoryName: string; - - /** - * 分类编码 - */ - categoryCode: string; + categoryId: string | number; /** * 父级id @@ -20,48 +18,55 @@ export interface CategoryVO { parentId: string | number; /** - * 排序 + * 流程分类名称 */ - sortNum: number; + categoryName: string; - children?: CategoryVO[]; + /** + * 显示顺序 + */ + orderNum: number; + + /** + * 创建时间 + */ + createTime: string; + + /** + * 子对象 + */ + children: CategoryVO[]; } export interface CategoryForm extends BaseEntity { - /** - * 主键 - */ - id?: string | number; /** - * 分类名称 + * 流程分类ID + */ + categoryId?: string | number; + + /** + * 流程分类名称 */ categoryName?: string; /** - * 分类编码 - */ - categoryCode?: string; - - /** - * 父级id + * 父流程分类id */ parentId?: string | number; /** - * 排序 + * 显示顺序 */ - sortNum?: number; + orderNum?: number; + } -export interface CategoryQuery extends PageQuery { +export interface CategoryQuery { + /** - * 分类名称 + * 流程分类名称 */ categoryName?: string; - /** - * 分类编码 - */ - categoryCode?: string; } diff --git a/src/api/workflow/definition/index.ts b/src/api/workflow/definition/index.ts new file mode 100644 index 0000000..49e6ee8 --- /dev/null +++ b/src/api/workflow/definition/index.ts @@ -0,0 +1,170 @@ +import request from '@/utils/request'; +import { FlowDefinitionQuery, definitionXmlVO, FlowDefinitionForm, FlowDefinitionVo } from '@/api/workflow/definition/types'; +import { AxiosPromise } from 'axios'; + +/** + * 获取流程定义列表 + * @param query 流程实例id + * @returns + */ +export const listDefinition = (query: FlowDefinitionQuery): AxiosPromise => { + return request({ + url: `/workflow/definition/list`, + method: 'get', + params: query + }); +}; + +/** + * 查询未发布的流程定义列表 + * @param query 流程实例id + * @returns + */ +export const unPublishList = (query: FlowDefinitionQuery): AxiosPromise => { + return request({ + url: `/workflow/definition/unPublishList`, + method: 'get', + params: query + }); +}; + +/** + * 通过流程定义id获取xml + * @param definitionId 流程定义id + * @returns + */ +export const definitionXml = (definitionId: string): AxiosPromise => { + return request({ + url: `/workflow/definition/definitionXml/${definitionId}`, + method: 'get' + }); +}; + +/** + * 删除流程定义 + * @param id 流程定义id + * @returns + */ +export const deleteDefinition = (id: string | string[]) => { + return request({ + url: `/workflow/definition/${id}`, + method: 'delete' + }); +}; + +/** + * 挂起/激活 + * @param definitionId 流程定义id + * @param activityStatus 状态 + * @returns + */ +export const active = (definitionId: string, activityStatus: boolean) => { + return request({ + url: `/workflow/definition/active/${definitionId}`, + method: 'put', + params: { + active: activityStatus + } + }); +}; + +/** + * 通过zip或xml部署流程定义 + * @returns + */ +export function importDef(data: any) { + return request({ + url: '/workflow/definition/importDef', + method: 'post', + data: data, + headers: { + repeatSubmit: false + } + }); +} + +/** + * 发布流程定义 + * @param id 流程定义id + * @returns + */ +export const publish = (id: string) => { + return request({ + url: `/workflow/definition/publish/${id}`, + method: 'put' + }); +}; + +/** + * 取消发布流程定义 + * @param id 流程定义id + * @returns + */ +export const unPublish = (id: string) => { + return request({ + url: `/workflow/definition/unPublish/${id}`, + method: 'put' + }); +}; + +/** + * 获取流程定义xml字符串 + * @param id 流程定义id + * @returns + */ +export const xmlString = (id: string) => { + return request({ + url: `/workflow/definition/xmlString/${id}`, + method: 'get' + }); +}; + +/** + * 新增 + * @param data 参数 + * @returns + */ +export const add = (data: FlowDefinitionForm) => { + return request({ + url: `/workflow/definition`, + method: 'post', + data: data + }); +}; + +/** + * 修改 + * @param data 参数 + * @returns + */ +export const edit = (data: FlowDefinitionForm) => { + return request({ + url: `/workflow/definition`, + method: 'put', + data: data + }); +}; + +/** + * 查询详情 + * @param id 参数 + * @returns + */ +export const getInfo = (id: number | string) => { + return request({ + url: `/workflow/definition/${id}`, + method: 'get' + }); +}; + +/** + * 复制流程定义 + * @param id 流程定义id + * @returns + */ +export const copy = (id: string) => { + return request({ + url: `/workflow/definition/copy/${id}`, + method: 'post' + }); +}; diff --git a/src/api/workflow/definition/types.ts b/src/api/workflow/definition/types.ts new file mode 100644 index 0000000..5de7f77 --- /dev/null +++ b/src/api/workflow/definition/types.ts @@ -0,0 +1,31 @@ +export interface FlowDefinitionQuery extends PageQuery { + flowCode?: string; + flowName?: string; + category: string | number; + isPublish?: number; +} + +export interface FlowDefinitionVo { + id: string; + flowName: string; + flowCode: string; + formPath: string; + version: string; + isPublish: number; + activityStatus: number; + createTime: Date; + updateTime: Date; +} + +export interface FlowDefinitionForm { + id: string; + flowName: string; + flowCode: string; + category: string; + formPath: string; +} + +export interface definitionXmlVO { + xml: string[]; + xmlStr: string; +} diff --git a/src/api/workflow/definitionConfig/index.ts b/src/api/workflow/definitionConfig/index.ts deleted file mode 100644 index d34bf05..0000000 --- a/src/api/workflow/definitionConfig/index.ts +++ /dev/null @@ -1,49 +0,0 @@ -import request from '@/utils/request'; -import { AxiosPromise } from 'axios'; -import { DefinitionConfigVO, DefinitionConfigForm } from '@/api/workflow/definitionConfig/types'; - -/** - * 查询表单配置详细 - * @param definitionId - */ -export const getByDefId = (definitionId: string | number): AxiosPromise => { - return request({ - url: '/workflow/definitionConfig/getByDefId/' + definitionId, - method: 'get' - }); -}; - -/** - * 新增表单配置 - * @param data - */ -export const saveOrUpdate = (data: DefinitionConfigForm) => { - return request({ - url: '/workflow/definitionConfig/saveOrUpdate', - method: 'post', - data: data - }); -}; - -/** - * 删除表单配置 - * @param id - */ -export const deldefinitionConfig = (id: string | number | Array) => { - return request({ - url: '/workflow/definitionConfig/' + id, - method: 'delete' - }); -}; - -/** - * 查询流程定义配置排除当前查询的流程定义 - * @param tableName - * @param definitionId - */ -export const getByTableNameNotDefId = (tableName: string, definitionId: string | number) => { - return request({ - url: `/workflow/definitionConfig/getByTableNameNotDefId/${tableName}/${definitionId}`, - method: 'get' - }); -}; diff --git a/src/api/workflow/definitionConfig/types.ts b/src/api/workflow/definitionConfig/types.ts deleted file mode 100644 index 7627403..0000000 --- a/src/api/workflow/definitionConfig/types.ts +++ /dev/null @@ -1,102 +0,0 @@ -import { FormManageVO } from '@/api/workflow/formManage/types'; - -export interface DefinitionConfigVO { - /** - * 主键 - */ - id: string | number; - - /** - * 表名 - */ - tableName?: string; - - /** - * 流程定义ID - */ - definitionId: string | number; - - /** - * 流程KEY - */ - processKey: string; - - /** - * 流程版本 - */ - version?: string | number; - - /** - * 备注 - */ - remark: string; - - /** - * 表单管理 - */ - wfFormManageVo: FormManageVO; -} - -export interface DefinitionConfigForm extends BaseEntity { - /** - * 主键 - */ - id?: string | number; - - /** - * 表名 - */ - tableName?: string; - - /** - * 流程定义ID - */ - definitionId?: string | number; - - /** - * 流程KEY - */ - processKey?: string; - - /** - * 流程版本 - */ - version?: string | number; - - /** - * 备注 - */ - remark?: string; - - /** - * 表单管理 - */ - wfFormManageVo?: FormManageVO; -} - -export interface DefinitionConfigQuery extends PageQuery { - /** - * 表名 - */ - tableName?: string; - - /** - * 流程定义ID - */ - definitionId?: string | number; - - /** - * 流程KEY - */ - processKey?: string; - - /** - * 流程版本 - */ - version?: string | number; - - /** - * 表单管理 - */ - wfFormManageVo: FormManageVO; -} diff --git a/src/api/workflow/formManage/index.ts b/src/api/workflow/formManage/index.ts deleted file mode 100644 index 6c5ec60..0000000 --- a/src/api/workflow/formManage/index.ts +++ /dev/null @@ -1,76 +0,0 @@ -import request from '@/utils/request'; -import { AxiosPromise } from 'axios'; -import { FormManageVO, FormManageForm, FormManageQuery } from '@/api/workflow/formManage/types'; - -/** - * 查询表单管理列表 - * @param query - * @returns {*} - */ - -export const listFormManage = (query?: FormManageQuery): AxiosPromise => { - return request({ - url: '/workflow/formManage/list', - method: 'get', - params: query - }); -}; - -/** - * 查询表单管理列表 - * @param query - * @returns {*} - */ - -export const selectListFormManage = (): AxiosPromise => { - return request({ - url: '/workflow/formManage/list/selectList', - method: 'get' - }); -}; - -/** - * 查询表单管理详细 - * @param id - */ -export const getFormManage = (id: string | number): AxiosPromise => { - return request({ - url: '/workflow/formManage/' + id, - method: 'get' - }); -}; - -/** - * 新增表单管理 - * @param data - */ -export const addFormManage = (data: FormManageForm) => { - return request({ - url: '/workflow/formManage', - method: 'post', - data: data - }); -}; - -/** - * 修改表单管理 - * @param data - */ -export const updateFormManage = (data: FormManageForm) => { - return request({ - url: '/workflow/formManage', - method: 'put', - data: data - }); -}; - -/** - * 删除表单管理 - * @param id - */ -export const delFormManage = (id: string | number | Array) => { - return request({ - url: '/workflow/formManage/' + id, - method: 'delete' - }); -}; diff --git a/src/api/workflow/formManage/types.ts b/src/api/workflow/formManage/types.ts deleted file mode 100644 index b9dc1d8..0000000 --- a/src/api/workflow/formManage/types.ts +++ /dev/null @@ -1,69 +0,0 @@ -export interface FormManageVO { - /** - * 主键 - */ - id: string | number; - - /** - * 表单名称 - */ - formName: string; - - /** - * 表单类型 - */ - formType: string; - /** - * 表单类型名称 - */ - formTypeName: string; - - /** - * 路由地址/表单ID - */ - router: string; - - /** - * 备注 - */ - remark: string; -} - -export interface FormManageForm extends BaseEntity { - /** - * 主键 - */ - id?: string | number; - - /** - * 表单名称 - */ - formName?: string; - - /** - * 表单类型 - */ - formType?: string; - - /** - * 路由地址/表单ID - */ - router?: string; - - /** - * 备注 - */ - remark?: string; -} - -export interface FormManageQuery extends PageQuery { - /** - * 表单名称 - */ - formName?: string; - - /** - * 表单类型 - */ - formType?: string; -} diff --git a/src/api/workflow/instance/index.ts b/src/api/workflow/instance/index.ts new file mode 100644 index 0000000..42d748d --- /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 = (businessId: string | number) => { + return request({ + url: `/workflow/instance/flowImage/${businessId}` + '?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/instance/types.ts b/src/api/workflow/instance/types.ts new file mode 100644 index 0000000..a12dab3 --- /dev/null +++ b/src/api/workflow/instance/types.ts @@ -0,0 +1,26 @@ +import { FlowTaskVO } from '@/api/workflow/task/types'; + +export interface FlowInstanceQuery extends PageQuery { + category?: string | number; + nodeName?: string; + flowCode?: string; + flowName?: string; + createByIds?: string[] | number[]; + businessId?: string; +} + +export interface FlowInstanceVO extends BaseEntity { + id: string | number; + definitionId: string; + flowName: string; + flowCode: string; + version: string; + businessId: string; + activityStatus: number; + tenantId: string; + createTime: string; + createBy: string; + flowStatus: string; + flowStatusName: string; + flowTaskList: FlowTaskVO[]; +} diff --git a/src/api/workflow/model/index.ts b/src/api/workflow/model/index.ts deleted file mode 100644 index 1ca8b19..0000000 --- a/src/api/workflow/model/index.ts +++ /dev/null @@ -1,104 +0,0 @@ -import request from '@/utils/request'; -import { AxiosPromise } from 'axios'; -import { ModelForm, ModelQuery, ModelVO } from '@/api/workflow/model/types'; - -/** - * 查询模型列表 - * @param query - * @returns {*} - */ -export const listModel = (query: ModelQuery): AxiosPromise => { - return request({ - url: '/workflow/model/list', - method: 'get', - params: query - }); -}; - -/** - * 查询模型信息 - * @param query - * @returns {*} - */ -export const getInfo = (id: string): AxiosPromise => { - return request({ - url: '/workflow/model/getInfo/' + id, - method: 'get' - }); -}; - -/** - * 新增模型 - * @param data - * @returns {*} - */ -export const addModel = (data: ModelForm): AxiosPromise => { - return request({ - url: '/workflow/model/save', - method: 'post', - data: data - }); -}; - -/** - * 修改模型信息 - * @param data - * @returns {*} - */ -export function update(data: ModelForm): AxiosPromise { - return request({ - url: '/workflow/model/update', - method: 'put', - data: data - }); -} - -/** - * 修改模型信息 - * @param data - * @returns {*} - */ -export function editModelXml(data: ModelForm): AxiosPromise { - return request({ - url: '/workflow/model/editModelXml', - method: 'put', - data: data - }); -} - -/** - * 按id删除模型 - * @returns {*} - * @param id 模型id - */ -export function delModel(id: string | string[]): AxiosPromise { - return request({ - url: '/workflow/model/' + id, - method: 'delete' - }); -} - -/** - * 模型部署 - * @returns {*} - * @param id 模型id - */ -export const modelDeploy = (id: string): AxiosPromise => { - return request({ - url: `/workflow/model/modelDeploy/${id}`, - method: 'post' - }); -}; - -/** - * 复制模型 - * @param data - * @returns {*} - */ -export const copyModel = (data: ModelForm): AxiosPromise => { - return request({ - url: '/workflow/model/copyModel', - method: 'post', - data: data - }); -}; diff --git a/src/api/workflow/model/types.ts b/src/api/workflow/model/types.ts deleted file mode 100644 index 77f947d..0000000 --- a/src/api/workflow/model/types.ts +++ /dev/null @@ -1,66 +0,0 @@ -export interface ModelForm { - id: string; - name: string; - key: string; - categoryCode: string; - xml: string; - svg: string; - description: string; -} - -export interface ModelQuery extends PageQuery { - name?: string; - key?: string; - categoryCode?: string; -} - -export interface OriginalPersistentState { - metaInfo: string; - editorSourceValueId: string; - createTime: string; - deploymentId?: string; - name: string; - tenantId: string; - category?: string; - version: number; - editorSourceExtraValueId?: string; - key: string; - lastUpdateTime: string; -} - -export interface PersistentState { - metaInfo: string; - editorSourceValueId: string; - createTime: string; - deploymentId?: string; - name: string; - tenantId: string; - category?: string; - version: number; - editorSourceExtraValueId?: string; - key: string; - lastUpdateTime: string; -} - -export interface ModelVO { - id: string; - revision: number; - originalPersistentState: OriginalPersistentState; - name: string; - key: string; - category?: string; - createTime: string; - lastUpdateTime: string; - version: number; - metaInfo: string; - deploymentId?: string; - editorSourceValueId: string; - editorSourceExtraValueId?: string; - tenantId: string; - persistentState: PersistentState; - revisionNext: number; - idPrefix: string; - inserted: boolean; - updated: boolean; - deleted: boolean; -} diff --git a/src/api/workflow/nodeConfig/types.ts b/src/api/workflow/nodeConfig/types.ts deleted file mode 100644 index a55fc91..0000000 --- a/src/api/workflow/nodeConfig/types.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { FormManageVO } from '@/api/workflow/formManage/types'; - -export interface NodeConfigVO { - /** - * 主键 - */ - id: string | number; - - /** - * 表单id - */ - formId: string | number; - - /** - * 表单类型 - */ - formType: string; - - /** - * 节点名称 - */ - nodeName: string; - - /** - * 节点id - */ - nodeId: string | number; - - /** - * 流程定义id - */ - definitionId: string | number; - - /** - * 表单管理 - */ - wfFormManageVo: FormManageVO; -} 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/processDefinition/types.ts b/src/api/workflow/processDefinition/types.ts deleted file mode 100644 index 979ec25..0000000 --- a/src/api/workflow/processDefinition/types.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { DefinitionConfigVO } from '@/api/workflow/definitionConfig/types'; -export interface ProcessDefinitionQuery extends PageQuery { - key?: string; - name?: string; - categoryCode?: string; -} - -export interface ProcessDefinitionVO extends BaseEntity { - id: string; - name: string; - key: string; - version: number; - suspensionState: number; - resourceName: string; - diagramResourceName: string; - deploymentId: string; - deploymentTime: string; - wfDefinitionConfigVo: DefinitionConfigVO; -} - -export interface definitionXmlVO { - xml: string[]; - xmlStr: string; -} diff --git a/src/api/workflow/processInstance/index.ts b/src/api/workflow/processInstance/index.ts deleted file mode 100644 index 6d5e53b..0000000 --- a/src/api/workflow/processInstance/index.ts +++ /dev/null @@ -1,136 +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 getHistoryImage = (businessKey: string) => { - return request({ - url: `/workflow/processInstance/getHistoryImage/${businessKey}` + '?t' + Math.random(), - method: 'get' - }); -}; - -/** - * 通过业务id获取历史流程图运行中,历史等节点 - */ -export const getHistoryList = (businessKey: string): AxiosPromise> => { - 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 => { - 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 -}; diff --git a/src/api/workflow/processInstance/types.ts b/src/api/workflow/processInstance/types.ts deleted file mode 100644 index 99d0511..0000000 --- a/src/api/workflow/processInstance/types.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { TaskVO } from '@/api/workflow/task/types'; - -export interface ProcessInstanceQuery extends PageQuery { - categoryCode?: string; - name?: string; - key?: string; - startUserId?: string; - businessKey?: string; -} - -export interface ProcessInstanceVO extends BaseEntity { - id: string; - processDefinitionId: string; - processDefinitionName: string; - processDefinitionKey: string; - processDefinitionVersion: string; - deploymentId: string; - businessKey: string; - isSuspended?: any; - tenantId: string; - startTime: string; - endTime?: string; - startUserId: string; - businessStatus: string; - businessStatusName: string; - taskVoList: TaskVO[]; -} diff --git a/src/api/workflow/task/index.ts b/src/api/workflow/task/index.ts index d29de30..55ede45 100644 --- a/src/api/workflow/task/index.ts +++ b/src/api/workflow/task/index.ts @@ -1,15 +1,15 @@ import request from '@/utils/request'; import { AxiosPromise } from 'axios'; -import { TaskQuery, TaskVO } from '@/api/workflow/task/types'; +import { TaskQuery, FlowTaskVO, TaskOperationBo } from '@/api/workflow/task/types'; /** * 查询待办列表 * @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 => * @param query * @returns {*} */ -export const getPageByTaskCopy = (query: TaskQuery): AxiosPromise => { +export const pageByTaskCopy = (query: TaskQuery): AxiosPromise => { return request({ - url: '/workflow/task/getPageByTaskCopy', + url: '/workflow/task/pageByTaskCopy', method: 'get', params: query }); @@ -46,9 +46,9 @@ export const getPageByTaskCopy = (query: TaskQuery): AxiosPromise => { * @param query * @returns {*} */ -export const getPageByAllTaskWait = (query: TaskQuery): AxiosPromise => { +export const pageByAllTaskWait = (query: TaskQuery): AxiosPromise => { return request({ - url: '/workflow/task/getPageByAllTaskWait', + url: '/workflow/task/pageByAllTaskWait', method: 'get', params: query }); @@ -59,9 +59,9 @@ export const getPageByAllTaskWait = (query: TaskQuery): AxiosPromise = * @param query * @returns {*} */ -export const getPageByAllTaskFinish = (query: TaskQuery): AxiosPromise => { +export const pageByAllTaskFinish = (query: TaskQuery): AxiosPromise => { return request({ - url: '/workflow/task/getPageByAllTaskFinish', + url: '/workflow/task/pageByAllTaskFinish', method: 'get', params: query }); @@ -93,30 +93,6 @@ export const completeTask = (data: object) => { }); }; -/** - * 认领任务 - * @param taskId - * @returns {*} - */ -export const claim = (taskId: string): any => { - return request({ - url: '/workflow/task/claim/' + taskId, - method: 'post' - }); -}; - -/** - * 归还任务 - * @param taskId - * @returns {*} - */ -export const returnTask = (taskId: string): any => { - return request({ - url: '/workflow/task/returnTask/' + taskId, - method: 'post' - }); -}; - /** * 任务驳回 * @param data @@ -135,61 +111,24 @@ 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 data - * @returns - */ -export const addMultiInstanceExecution = (data: any) => { - return request({ - url: '/workflow/task/addMultiInstanceExecution', - method: 'post', - data: data - }); -}; - -/** - * 减签 - * @param data - * @returns - */ -export const deleteMultiInstanceExecution = (data: any) => { - return request({ - url: '/workflow/task/deleteMultiInstanceExecution', - method: 'post', - data: data - }); -}; - /** * 修改任务办理人 - * @param taskIds + * @param taskIdList * @param userId * @returns */ -export const updateAssignee = (taskIds: Array, userId: string) => { +export const updateAssignee = (taskIdList: Array, userId: string) => { return request({ - url: `/workflow/task/updateAssignee/${taskIds}/${userId}`, - method: 'put' - }); -}; - -/** - * 转办任务 - * @returns - */ -export const transferTask = (data: any) => { - return request({ - url: `/workflow/task/transferTask`, - method: 'post', - data: data + url: `/workflow/task/updateAssignee/${userId}`, + method: 'put', + data: taskIdList }); }; @@ -205,60 +144,37 @@ export const terminationTask = (data: any) => { }); }; -/** - * 查询流程变量 - * @returns - */ -export const getInstanceVariable = (taskId: string) => { - return request({ - url: `/workflow/task/getInstanceVariable/${taskId}`, - method: 'get' - }); -}; - /** * 获取可驳回得任务节点 * @returns */ -export const getTaskNodeList = (processInstanceId: string) => { +export const getBackTaskNode = (definitionId: string, nodeCode: string) => { return request({ - url: `/workflow/task/getTaskNodeList/${processInstanceId}`, + url: `/workflow/task/getBackTaskNode/${definitionId}/${nodeCode}`, method: 'get' }); }; /** - * 委托任务 + * 任务操作 操作类型,委派 delegateTask、转办 transferTask、加签 addSignature、减签 reductionSignature * @returns */ -export const delegateTask = (data: any) => { +export const taskOperation = (data: TaskOperationBo, operation: string) => { return request({ - url: `/workflow/task/delegateTask`, + url: `/workflow/task/taskOperation/${operation}`, method: 'post', data: data }); }; /** - * 查询工作流任务用户选择加签人员 - * @param taskId - * @returns {*} + * 获取当前任务办理人 + * @param taskId 任务id + * @returns */ -export const getTaskUserIdsByAddMultiInstance = (taskId: string) => { +export const currentTaskAllUser = (taskId: string | number) => { return request({ - url: '/workflow/task/getTaskUserIdsByAddMultiInstance/' + taskId, - method: 'get' - }); -}; - -/** - * 查询工作流选择减签人员 - * @param taskId - * @returns {*} - */ -export const getListByDeleteMultiInstance = (taskId: string) => { - return request({ - url: '/workflow/task/getListByDeleteMultiInstance/' + taskId, + url: `/workflow/task/currentTaskAllUser/${taskId}`, method: 'get' }); }; diff --git a/src/api/workflow/task/types.ts b/src/api/workflow/task/types.ts index 0425a1a..8ea803b 100644 --- a/src/api/workflow/task/types.ts +++ b/src/api/workflow/task/types.ts @@ -1,9 +1,8 @@ -import { NodeConfigVO } from '@/api/workflow/nodeConfig/types'; -import { DefinitionConfigVO } from '@/api/workflow/definitionConfig/types'; export interface TaskQuery extends PageQuery { - name?: string; - processDefinitionKey?: string; - processDefinitionName?: string; + nodeName?: string; + flowCode?: string; + flowName?: string; + createByIds?: string[] | number[]; } export interface ParticipantVo { @@ -12,38 +11,38 @@ 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; - wfNodeConfigVo?: NodeConfigVO; - wfDefinitionConfigVo?: DefinitionConfigVO; +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; + formCustom: string; + formPath: string; + nodeType: number; + nodeRatio: string | number; + version?: string; } export interface VariableVo { key: string; value: string; } + +export interface TaskOperationBo { + //委派/转办人的用户ID(必填,准对委派/转办人操作) + userId?: string; + //加签/减签人的用户ID列表(必填,针对加签/减签操作) + userIds?: string[]; + //任务ID(必填) + taskId: string | number; + //意见或备注信息(可选) + message?: string; +} diff --git a/src/api/workflow/workflowCommon/index.ts b/src/api/workflow/workflowCommon/index.ts index 63ce318..0f5ce1b 100644 --- a/src/api/workflow/workflowCommon/index.ts +++ b/src/api/workflow/workflowCommon/index.ts @@ -2,28 +2,14 @@ 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); + proxy.$router.push({ + path: routerJumpVo.formPath, + query: { + id: routerJumpVo.businessId, + type: routerJumpVo.type, + taskId: routerJumpVo.taskId + } + }); } }; diff --git a/src/api/workflow/workflowCommon/types.ts b/src/api/workflow/workflowCommon/types.ts index 0f1ef1f..3e7a71d 100644 --- a/src/api/workflow/workflowCommon/types.ts +++ b/src/api/workflow/workflowCommon/types.ts @@ -1,16 +1,13 @@ -import { NodeConfigVO } from '@/api/workflow/nodeConfig/types'; -import { DefinitionConfigVO } from '@/api/workflow/definitionConfig/types'; - export interface RouterJumpVo { - wfNodeConfigVo: NodeConfigVO; - wfDefinitionConfigVo: DefinitionConfigVO; - businessKey: string; - taskId: string; + businessId: string; + taskId: string | number; type: string; + formCustom: string; + formPath: string; } export interface StartProcessBo { - businessKey: string | number; - tableName: string; + businessId: string | number; + flowCode: string; variables: any; } diff --git a/src/assets/styles/variables.module.scss b/src/assets/styles/variables.module.scss index e5cd95d..3aa871b 100644 --- a/src/assets/styles/variables.module.scss +++ b/src/assets/styles/variables.module.scss @@ -14,11 +14,6 @@ --tableHeaderBg: #f8f8f9; --tableHeaderTextColor: #515a6e; - // 工作流 - --bpmn-panel-border: #eeeeee; - --bpmn-panel-box-shadow: #cccccc; - --bpmn-panel-bar-background-color: #f5f7fa; - // ele --brder-color: #e8e8e8; @@ -78,11 +73,6 @@ html.dark { --vxe-table-border-color: #37373a; --vxe-toolbar-background-color: #37373a; - // 工作流 - --bpmn-panel-border: #37373a; - --bpmn-panel-box-shadow: #37373a; - --bpmn-panel-bar-background-color: #37373a; - // ele --brder-color: #37373a; } diff --git a/src/bpmn/assets/defaultXML.ts b/src/bpmn/assets/defaultXML.ts deleted file mode 100644 index dff0349..0000000 --- a/src/bpmn/assets/defaultXML.ts +++ /dev/null @@ -1,23 +0,0 @@ -function generateRandomValue() { - // 生成一个随机数 - const randomValue = Math.random().toString(36).slice(2, 12); - return `Process_${randomValue}`; -} - -const cartage: string = 'default'; -export default ` - - - - - - - - - - - - - - -`; diff --git a/src/bpmn/assets/lang/zh.ts b/src/bpmn/assets/lang/zh.ts deleted file mode 100644 index ee0c5de..0000000 --- a/src/bpmn/assets/lang/zh.ts +++ /dev/null @@ -1,126 +0,0 @@ -export const NodeName = { - 'bpmn:Process': '流程', - 'bpmn:StartEvent': '开始事件', - 'bpmn:IntermediateThrowEvent': '中间事件', - 'bpmn:Task': '任务', - 'bpmn:SendTask': '发送任务', - 'bpmn:ReceiveTask': '接收任务', - 'bpmn:UserTask': '用户任务', - 'bpmn:ManualTask': '手工任务', - 'bpmn:BusinessRuleTask': '业务规则任务', - 'bpmn:ServiceTask': '服务任务', - 'bpmn:ScriptTask': '脚本任务', - 'bpmn:EndEvent': '结束事件', - 'bpmn:SequenceFlow': '流程线', - 'bpmn:ExclusiveGateway': '互斥网关', - 'bpmn:ParallelGateway': '并行网关', - 'bpmn:InclusiveGateway': '相容网关', - 'bpmn:ComplexGateway': '复杂网关', - 'bpmn:EventBasedGateway': '事件网关', - 'bpmn:Participant': '池/参与者', - 'bpmn:SubProcess': '子流程', - 'bpmn:DataObjectReference': '数据对象引用', - 'bpmn:DataStoreReference': '数据存储引用', - 'bpmn:Group': '组' -}; - -export default { - 'Activate hand tool': '启动手动工具', - 'Activate lasso tool': '启动 Lasso 工具', - 'Activate create/remove space tool': '启动创建/删除空间工具', - 'Activate global connect tool': '启动全局连接工具', - 'Ad-hoc': 'Ad-hoc', - 'Add lane above': '在上方添加泳道', - 'Add lane below': '在下方添加泳道', - 'Business rule task': '规则任务', - 'Call activity': '引用流程', - 'Compensation end event': '结束补偿事件', - 'Compensation intermediate throw event': '中间补偿抛出事件', - 'Complex gateway': '复杂网关', - 'Conditional intermediate catch event': '中间条件捕获事件', - 'Conditional start event (non-interrupting)': '条件启动事件 (非中断)', - 'Conditional start event': '条件启动事件', - 'Connect using association': '文本关联', - 'Connect using sequence/message flow or association': '消息关联', - 'Change element': '更改元素', - 'Change type': '更改类型', - 'Create data object reference': '创建数据对象引用', - 'Create data store reference': '创建数据存储引用', - 'Create expanded sub-process': '创建可折叠子流程', - 'Create pool/participant': '创建池/参与者', - 'Collection': '集合', - 'Connect using data input association': '数据输入关联', - 'Data store reference': '数据存储引用', - 'Data object reference': '数据对象引用', - 'Divide into two lanes': '分成两个泳道', - 'Divide into three lanes': '分成三个泳道', - 'End event': '结束事件', - 'Error end event': '结束错误事件', - 'Escalation end event': '结束升级事件', - 'Escalation intermediate throw event': '中间升级抛出事件', - 'Event sub-process': '事件子流程', - 'Event-based gateway': '事件网关', - 'Exclusive gateway': '互斥网关', - 'Empty pool/participant (removes content)': '清空池/参与者 (删除内容)', - 'Empty pool/participant': '清空池/参与者', - 'Expanded pool/participant': '展开池/参与者', - 'Inclusive gateway': '相容网关', - 'Intermediate throw event': '中间抛出事件', - 'Loop': '循环', - 'Link intermediate catch event': '中间链接捕获事件', - 'Link intermediate throw event': '中间链接抛出事件', - 'Manual task': '手动任务', - 'Message end event': '结束消息事件', - 'Message intermediate catch event': '中间消息捕获事件', - 'Message intermediate throw event': '中间消息抛出事件', - 'Message start event': '消息启动事件', - 'Parallel gateway': '并行网关', - 'Parallel multi-instance': '并行多实例', - 'Participant multiplicity': '参与者多重性', - 'Receive task': '接受任务', - 'Remove': '移除', - 'Script task': '脚本任务', - 'Send task': '发送任务', - 'Sequential multi-instance': '串行多实例', - 'Service task': '服务任务', - 'Signal end event': '结束信号事件', - 'Signal intermediate catch event': '中间信号捕获事件', - 'Signal intermediate throw event': '中间信号抛出事件', - 'Signal start event (non-interrupting)': '信号启动事件 (非中断)', - 'Signal start event': '信号启动事件', - 'Start event': '开始事件', - 'Sub-process (collapsed)': '可折叠子流程', - 'Sub-process (expanded)': '可展开子流程', - 'Sub rocess': '子流程', - 'Task': '任务', - 'Transaction': '事务', - 'Terminate end event': '终止边界事件', - 'Timer intermediate catch event': '中间定时捕获事件', - 'Timer start event (non-interrupting)': '定时启动事件 (非中断)', - 'Timer start event': '定时启动事件', - 'User task': '用户任务', - 'Create start event': '创建开始事件', - 'Create gateway': '创建网关', - 'Create intermediate/boundary event': '创建中间/边界事件', - 'Create end event': '创建结束事件', - 'Create group': '创建组', - 'Create startEvent': '开始节点', - 'Create endEvent': '结束节点', - 'Create exclusiveGateway': '互斥网关', - 'Create parallelGateway': '并行网关', - 'Create task': '任务节点', - 'Create userTask': '用户任务节点', - 'Condition type': '条件类型', - 'Append end event': '追加结束事件节点', - 'Append gateway': '追加网关节点', - 'Append task': '追加任务', - 'Append user task': '追加用户任务节点', - 'Append text annotation': '追加文本注释', - 'Append intermediate/boundary event': '追加中间或边界事件', - 'Append receive task': '追加接收任务节点', - 'Append message intermediate catch event': '追加中间消息捕获事件', - 'Append timer intermediate catch event': '追加中间定时捕获事件', - 'Append conditional intermediate catch event': '追加中间条件捕获事件', - 'Append signal intermediate catch event': '追加中间信号捕获事件', - 'flow elements must be children of pools/participants': '流程元素必须是池/参与者的子元素' -}; diff --git a/src/bpmn/assets/moddle/flowable.ts b/src/bpmn/assets/moddle/flowable.ts deleted file mode 100644 index de959a6..0000000 --- a/src/bpmn/assets/moddle/flowable.ts +++ /dev/null @@ -1,1250 +0,0 @@ -export default { - 'name': 'Flowable', - 'uri': 'http://flowable.org/bpmn', - 'prefix': 'flowable', - 'xml': { - 'tagAlias': 'lowerCase' - }, - 'associations': [], - 'types': [ - { - 'name': 'flowable:extCandidateUsers', - 'isAbstract': true, - 'extends': [], - 'superClass': ['Element'], - 'meta': { - 'allowedIn': ['*'] - }, - 'properties': [ - { - 'name': 'body', - 'type': 'String', - 'isBody': true - } - ] - }, - { - 'name': 'flowable:extAssignee', - 'isAbstract': true, - 'extends': [], - 'superClass': ['Element'], - 'meta': { - 'allowedIn': ['*'] - }, - 'properties': [ - { - 'name': 'body', - 'type': 'String', - 'isBody': true - } - ] - }, - { - 'name': 'flowable:property', - 'superClass': ['Element'], - 'properties': [ - { - 'name': 'id', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'name', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'value', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'flowable:properties', - 'isAbstract': true, - 'extends': [], - 'superClass': ['Element'], - 'meta': { - 'allowedIn': ['*'] - }, - 'properties': [ - { - 'name': 'values', - 'type': 'flowable:property', - 'isMany': true - } - ] - }, - { - 'name': 'InOutBinding', - 'superClass': ['Element'], - 'isAbstract': true, - 'properties': [ - { - 'name': 'source', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'sourceExpression', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'target', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'businessKey', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'local', - 'isAttr': true, - 'type': 'Boolean', - 'default': false - }, - { - 'name': 'variables', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'In', - 'superClass': ['InOutBinding'], - 'meta': { - 'allowedIn': ['bpmn:CallActivity'] - } - }, - { - 'name': 'Out', - 'superClass': ['InOutBinding'], - 'meta': { - 'allowedIn': ['bpmn:CallActivity'] - } - }, - { - 'name': 'AsyncCapable', - 'isAbstract': true, - 'extends': ['bpmn:Activity', 'bpmn:Gateway', 'bpmn:Event'], - 'properties': [ - { - 'name': 'async', - 'isAttr': true, - 'type': 'Boolean', - 'default': false - }, - { - 'name': 'asyncBefore', - 'isAttr': true, - 'type': 'Boolean', - 'default': false - }, - { - 'name': 'asyncAfter', - 'isAttr': true, - 'type': 'Boolean', - 'default': false - }, - { - 'name': 'exclusive', - 'isAttr': true, - 'type': 'Boolean', - 'default': true - } - ] - }, - { - 'name': 'flowable:in', - 'superClass': ['Element'], - 'properties': [ - { - 'name': 'source', - 'type': 'string', - 'isAttr': true - }, - { - 'name': 'target', - 'type': 'string', - 'isAttr': true - } - ] - }, - { - 'name': 'flowable:out', - 'superClass': ['Element'], - 'properties': [ - { - 'name': 'source', - 'type': 'string', - 'isAttr': true - }, - { - 'name': 'target', - 'type': 'string', - 'isAttr': true - } - ] - }, - { - 'name': 'BoundaryEvent', - 'superClass': ['CatchEvent'], - 'properties': [ - { - 'name': 'cancelActivity', - 'default': true, - 'isAttr': true, - 'type': 'Boolean' - }, - { - 'name': 'attachedToRef', - 'type': 'Activity', - 'isAttr': true, - 'isReference': true - } - ] - }, - { - 'name': 'JobPriorized', - 'isAbstract': true, - 'extends': ['bpmn:Process', 'flowable:AsyncCapable'], - 'properties': [ - { - 'name': 'jobPriority', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'SignalEventDefinition', - 'isAbstract': true, - 'extends': ['bpmn:SignalEventDefinition'], - 'properties': [ - { - 'name': 'async', - 'isAttr': true, - 'type': 'Boolean', - 'default': false - } - ] - }, - { - 'name': 'ErrorEventDefinition', - 'isAbstract': true, - 'extends': ['bpmn:ErrorEventDefinition'], - 'properties': [ - { - 'name': 'errorCodeVariable', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'errorMessageVariable', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'Error', - 'isAbstract': true, - 'extends': ['bpmn:Error'], - 'properties': [ - { - 'name': 'flowable:errorMessage', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'PotentialStarter', - 'superClass': ['Element'], - 'properties': [ - { - 'name': 'resourceAssignmentExpression', - 'type': 'bpmn:ResourceAssignmentExpression' - } - ] - }, - { - 'name': 'UserTask', - 'isAbstract': true, - 'extends': ['bpmn:UserTask'], - 'properties': [ - { - 'name': 'timerEventDefinition', - 'type': 'Expression' - }, - { - 'name': 'multiInstanceLoopCharacteristics', - 'type': 'MultiInstanceLoopCharacteristics' - } - ] - }, - { - 'name': 'StartEvent', - 'isAbstract': true, - 'extends': ['bpmn:StartEvent'], - 'properties': [ - { - 'name': 'timerEventDefinition', - 'type': 'Expression' - } - ] - }, - { - 'name': 'FormSupported', - 'isAbstract': true, - 'extends': ['bpmn:StartEvent', 'bpmn:UserTask'], - 'properties': [ - { - 'name': 'formHandlerClass', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'formKey', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'TemplateSupported', - 'isAbstract': true, - 'extends': ['bpmn:Process', 'bpmn:FlowElement'], - 'properties': [ - { - 'name': 'modelerTemplate', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'Initiator', - 'isAbstract': true, - 'extends': ['bpmn:StartEvent'], - 'properties': [ - { - 'name': 'initiator', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'ScriptTask', - 'isAbstract': true, - 'extends': ['bpmn:ScriptTask'], - 'properties': [ - { - 'name': 'resultVariable', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'resource', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'Process', - 'isAbstract': true, - 'extends': ['bpmn:Process'], - 'properties': [ - { - 'name': 'candidateStarterGroups', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'candidateStarterUsers', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'versionTag', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'historyTimeToLive', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'isStartableInTasklist', - 'isAttr': true, - 'type': 'Boolean', - 'default': true - } - ] - }, - { - 'name': 'EscalationEventDefinition', - 'isAbstract': true, - 'extends': ['bpmn:EscalationEventDefinition'], - 'properties': [ - { - 'name': 'escalationCodeVariable', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'FormalExpression', - 'isAbstract': true, - 'extends': ['bpmn:FormalExpression'], - 'properties': [ - { - 'name': 'resource', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'Assignable', - 'extends': ['bpmn:UserTask'], - 'properties': [ - { - 'name': 'candidateGroups', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'dueDate', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'followUpDate', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'priority', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'CallActivity', - 'extends': ['bpmn:CallActivity'], - 'properties': [ - { - 'name': 'calledElementBinding', - 'isAttr': true, - 'type': 'String', - 'default': 'latest' - }, - { - 'name': 'calledElementVersion', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'calledElementVersionTag', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'calledElementTenantId', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'caseRef', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'caseBinding', - 'isAttr': true, - 'type': 'String', - 'default': 'latest' - }, - { - 'name': 'caseVersion', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'caseTenantId', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'variableMappingClass', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'variableMappingDelegateExpression', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'ServiceTaskLike', - 'extends': ['bpmn:ServiceTask', 'bpmn:BusinessRuleTask', 'bpmn:SendTask', 'bpmn:MessageEventDefinition'], - 'properties': [ - { - 'name': 'expression', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'class', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'delegateExpression', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'resultVariable', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'ExclusiveGateway', - 'isAbstract': true, - 'extends': ['bpmn:ExclusiveGateway'], - 'properties': [ - { - 'name': 'serviceClass', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'DmnCapable', - 'extends': ['bpmn:BusinessRuleTask'], - 'properties': [ - { - 'name': 'decisionRef', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'decisionRefBinding', - 'isAttr': true, - 'type': 'String', - 'default': 'latest' - }, - { - 'name': 'decisionRefVersion', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'mapDecisionResult', - 'isAttr': true, - 'type': 'String', - 'default': 'resultList' - }, - { - 'name': 'decisionRefTenantId', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'ExternalCapable', - 'extends': ['flowable:ServiceTaskLike'], - 'properties': [ - { - 'name': 'type', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'topic', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'TaskPriorized', - 'extends': ['bpmn:Process', 'flowable:ExternalCapable'], - 'properties': [ - { - 'name': 'taskPriority', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'Properties', - 'superClass': ['Element'], - 'meta': { - 'allowedIn': ['*'] - }, - 'properties': [ - { - 'name': 'values', - 'type': 'Property', - 'isMany': true - } - ] - }, - { - 'name': 'Property', - 'superClass': ['Element'], - 'properties': [ - { - 'name': 'id', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'name', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'value', - 'type': 'String', - 'isAttr': true - } - ] - }, - { - 'name': 'Connector', - 'superClass': ['Element'], - 'meta': { - 'allowedIn': ['flowable:ServiceTaskLike'] - }, - 'properties': [ - { - 'name': 'inputOutput', - 'type': 'InputOutput' - }, - { - 'name': 'connectorId', - 'type': 'String' - } - ] - }, - { - 'name': 'InputOutput', - 'superClass': ['Element'], - 'meta': { - 'allowedIn': ['bpmn:FlowNode', 'flowable:Connector'] - }, - 'properties': [ - { - 'name': 'inputOutput', - 'type': 'InputOutput' - }, - { - 'name': 'connectorId', - 'type': 'String' - }, - { - 'name': 'inputParameters', - 'isMany': true, - 'type': 'InputParameter' - }, - { - 'name': 'outputParameters', - 'isMany': true, - 'type': 'OutputParameter' - } - ] - }, - { - 'name': 'InputOutputParameter', - 'properties': [ - { - 'name': 'name', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'value', - 'isBody': true, - 'type': 'String' - }, - { - 'name': 'definition', - 'type': 'InputOutputParameterDefinition' - } - ] - }, - { - 'name': 'InputOutputParameterDefinition', - 'isAbstract': true - }, - { - 'name': 'List', - 'superClass': ['InputOutputParameterDefinition'], - 'properties': [ - { - 'name': 'items', - 'isMany': true, - 'type': 'InputOutputParameterDefinition' - } - ] - }, - { - 'name': 'Map', - 'superClass': ['InputOutputParameterDefinition'], - 'properties': [ - { - 'name': 'entries', - 'isMany': true, - 'type': 'Entry' - } - ] - }, - { - 'name': 'Entry', - 'properties': [ - { - 'name': 'key', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'value', - 'isBody': true, - 'type': 'String' - }, - { - 'name': 'definition', - 'type': 'InputOutputParameterDefinition' - } - ] - }, - { - 'name': 'Value', - 'superClass': ['InputOutputParameterDefinition'], - 'properties': [ - { - 'name': 'id', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'name', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'value', - 'isBody': true, - 'type': 'String' - } - ] - }, - { - 'name': 'Script', - 'superClass': ['InputOutputParameterDefinition'], - 'properties': [ - { - 'name': 'scriptFormat', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'resource', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'value', - 'isBody': true, - 'type': 'String' - } - ] - }, - { - 'name': 'Field', - 'superClass': ['Element'], - 'meta': { - 'allowedIn': ['flowable:ServiceTaskLike', 'flowable:ExecutionListener', 'flowable:TaskListener'] - }, - 'properties': [ - { - 'name': 'name', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'expression', - 'isAttr': true, - 'type': 'expression' - }, - { - 'name': 'string', - 'type': 'string' - }, - { - 'name': 'stringValue', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'string', - 'superClass': ['Element'], - 'meta': { - 'allowedIn': ['flowable:Field'] - }, - 'properties': [ - { - 'name': 'body', - 'isBody': true, - 'type': 'String' - } - ] - }, - { - 'name': 'expression', - 'superClass': ['Element'], - 'meta': { - 'allowedIn': ['flowable:Field'] - }, - 'properties': [ - { - 'name': 'body', - 'isBody': true, - 'type': 'String' - } - ] - }, - { - 'name': 'InputParameter', - 'superClass': ['InputOutputParameter'] - }, - { - 'name': 'OutputParameter', - 'superClass': ['InputOutputParameter'] - }, - { - 'name': 'Collectable', - 'isAbstract': true, - 'extends': ['bpmn:MultiInstanceLoopCharacteristics'], - 'superClass': ['flowable:AsyncCapable'], - 'properties': [ - { - 'name': 'collection', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'elementVariable', - 'isAttr': true, - 'type': 'String' - } - ] - }, - { - 'name': 'SequenceFlow', - 'superClass': ['FlowElement'], - 'properties': [ - { - 'name': 'isImmediate', - 'isAttr': true, - 'type': 'Boolean' - }, - { - 'name': 'conditionExpression', - 'type': 'Expression' - }, - { - 'name': 'sourceRef', - 'type': 'FlowNode', - 'isAttr': true, - 'isReference': true - }, - { - 'name': 'targetRef', - 'type': 'FlowNode', - 'isAttr': true, - 'isReference': true - } - ] - }, - { - 'name': 'MultiInstanceLoopCharacteristics', - 'superClass': ['LoopCharacteristics'], - 'properties': [ - { - 'name': 'isSequential', - 'default': false, - 'isAttr': true, - 'type': 'Boolean' - }, - { - 'name': 'behavior', - 'type': 'MultiInstanceBehavior', - 'default': 'All', - 'isAttr': true - }, - { - 'name': 'loopCardinality', - 'type': 'Expression', - 'xml': { - 'serialize': 'xsi:type' - } - }, - { - 'name': 'loopDataInputRef', - 'type': 'ItemAwareElement', - 'isReference': true - }, - { - 'name': 'loopDataOutputRef', - 'type': 'ItemAwareElement', - 'isReference': true - }, - { - 'name': 'inputDataItem', - 'type': 'DataInput', - 'xml': { - 'serialize': 'property' - } - }, - { - 'name': 'outputDataItem', - 'type': 'DataOutput', - 'xml': { - 'serialize': 'property' - } - }, - { - 'name': 'complexBehaviorDefinition', - 'type': 'ComplexBehaviorDefinition', - 'isMany': true - }, - { - 'name': 'completionCondition', - 'type': 'Expression', - 'xml': { - 'serialize': 'xsi:type' - } - }, - { - 'name': 'oneBehaviorEventRef', - 'type': 'EventDefinition', - 'isAttr': true, - 'isReference': true - }, - { - 'name': 'noneBehaviorEventRef', - 'type': 'EventDefinition', - 'isAttr': true, - 'isReference': true - } - ] - }, - { - 'name': 'FailedJobRetryTimeCycle', - 'superClass': ['Element'], - 'meta': { - 'allowedIn': ['flowable:AsyncCapable', 'bpmn:MultiInstanceLoopCharacteristics'] - }, - 'properties': [ - { - 'name': 'body', - 'isBody': true, - 'type': 'String' - } - ] - }, - { - 'name': 'ExecutionListener', - 'superClass': ['Element'], - 'meta': { - 'allowedIn': [ - 'bpmn:Task', - 'bpmn:ServiceTask', - 'bpmn:UserTask', - 'bpmn:BusinessRuleTask', - 'bpmn:ScriptTask', - 'bpmn:ReceiveTask', - 'bpmn:ManualTask', - 'bpmn:ExclusiveGateway', - 'bpmn:SequenceFlow', - 'bpmn:ParallelGateway', - 'bpmn:InclusiveGateway', - 'bpmn:EventBasedGateway', - 'bpmn:StartEvent', - 'bpmn:IntermediateCatchEvent', - 'bpmn:IntermediateThrowEvent', - 'bpmn:EndEvent', - 'bpmn:BoundaryEvent', - 'bpmn:CallActivity', - 'bpmn:SubProcess', - 'bpmn:Process' - ] - }, - 'properties': [ - { - 'name': 'expression', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'class', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'delegateExpression', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'event', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'script', - 'type': 'Script' - }, - { - 'name': 'fields', - 'type': 'Field', - 'isMany': true - } - ] - }, - { - 'name': 'TaskListener', - 'superClass': ['Element'], - 'meta': { - 'allowedIn': ['bpmn:UserTask'] - }, - 'properties': [ - { - 'name': 'expression', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'class', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'delegateExpression', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'event', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'script', - 'type': 'Script' - }, - { - 'name': 'fields', - 'type': 'Field', - 'isMany': true - } - ] - }, - { - 'name': 'FormProperty', - 'superClass': ['Element'], - 'meta': { - 'allowedIn': ['bpmn:StartEvent', 'bpmn:UserTask'] - }, - 'properties': [ - { - 'name': 'id', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'name', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'type', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'required', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'readable', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'writable', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'variable', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'expression', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'datePattern', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'default', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'values', - 'type': 'Value', - 'isMany': true - } - ] - }, - { - 'name': 'FormData', - 'superClass': ['Element'], - 'meta': { - 'allowedIn': ['bpmn:StartEvent', 'bpmn:UserTask'] - }, - 'properties': [ - { - 'name': 'fields', - 'type': 'FormField', - 'isMany': true - }, - { - 'name': 'businessKey', - 'type': 'String', - 'isAttr': true - } - ] - }, - { - 'name': 'FormField', - 'superClass': ['Element'], - 'properties': [ - { - 'name': 'id', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'label', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'type', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'datePattern', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'defaultValue', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'properties', - 'type': 'Properties' - }, - { - 'name': 'validation', - 'type': 'Validation' - }, - { - 'name': 'values', - 'type': 'Value', - 'isMany': true - } - ] - }, - { - 'name': 'Validation', - 'superClass': ['Element'], - 'properties': [ - { - 'name': 'constraints', - 'type': 'Constraint', - 'isMany': true - } - ] - }, - { - 'name': 'Constraint', - 'superClass': ['Element'], - 'properties': [ - { - 'name': 'name', - 'type': 'String', - 'isAttr': true - }, - { - 'name': 'config', - 'type': 'String', - 'isAttr': true - } - ] - }, - { - 'name': 'ConditionalEventDefinition', - 'isAbstract': true, - 'extends': ['bpmn:ConditionalEventDefinition'], - 'properties': [ - { - 'name': 'variableName', - 'isAttr': true, - 'type': 'String' - }, - { - 'name': 'variableEvent', - 'isAttr': true, - 'type': 'String' - } - ] - } - ], - 'emumerations': [] -}; diff --git a/src/bpmn/assets/module/ContextPad/CustomContextPadProvider.ts b/src/bpmn/assets/module/ContextPad/CustomContextPadProvider.ts deleted file mode 100644 index 13ccf50..0000000 --- a/src/bpmn/assets/module/ContextPad/CustomContextPadProvider.ts +++ /dev/null @@ -1,138 +0,0 @@ -import ContextPadProvider from 'bpmn-js/lib/features/context-pad/ContextPadProvider'; -import { Injector } from 'didi'; -import EventBus from 'diagram-js/lib/core/EventBus'; -import ContextPad from 'diagram-js/lib/features/context-pad/ContextPad'; -import Modeling from 'bpmn-js/lib/features/modeling/Modeling.js'; -import ElementFactory from 'bpmn-js/lib/features/modeling/ElementFactory'; -import Connect from 'diagram-js/lib/features/connect/Connect'; -import Create from 'diagram-js/lib/features/create/Create'; -import PopupMenu from 'diagram-js/lib/features/popup-menu/PopupMenu'; -import Canvas from 'diagram-js/lib/core/Canvas'; -import Rules from 'diagram-js/lib/features/rules/Rules'; -import { Element, Shape } from 'diagram-js/lib/model/Types'; -import BpmnFactory from 'bpmn-js/lib/features/modeling/BpmnFactory'; -import modeler from '@/store/modules/modeler'; - -// @Description: 增强元素连线事件 - -class CustomContextPadProvider extends ContextPadProvider { - private _contextPad: ContextPad; - private _modeling: Modeling; - private _elementFactory: ElementFactory; - private _autoPlace: any; - private _connect: Connect; - private _create: Create; - private _popupMenu: PopupMenu; - private _canvas: Canvas; - private _rules: Rules; - - constructor( - config: any, - injector: Injector, - eventBus: EventBus, - contextPad: ContextPad, - modeling: Modeling, - elementFactory: ElementFactory, - connect: Connect, - create: Create, - popupMenu: PopupMenu, - canvas: Canvas, - rules: Rules, - translate - ) { - // @ts-expect-error 忽略异常 - super(config, injector, eventBus, contextPad, modeling, elementFactory, connect, create, popupMenu, canvas, rules, translate); - - this._contextPad = contextPad; - this._modeling = modeling; - this._elementFactory = elementFactory; - this._connect = connect; - this._create = create; - this._popupMenu = popupMenu; - this._canvas = canvas; - this._rules = rules; - - this._autoPlace = injector.get('autoPlace', false); - } - - getContextPadEntries(element: Element) { - const actions: Record = {}; - - const appendUserTask = (event: Event, element: Shape) => { - const shape = this._elementFactory.createShape({ type: 'bpmn:UserTask' }); - this._create.start(event, shape, { - source: element - }); - }; - - const appendMultiInstanceUserTask = (event: Event, element: Shape) => { - const store = modeler(); - const bpmnFactory = store.getModeler().get('bpmnFactory') as BpmnFactory; - const businessObject = bpmnFactory.create('bpmn:UserTask', { - // name: '多实例用户任务', - isForCompensation: false - }); - businessObject.loopCharacteristics = bpmnFactory.create('bpmn:MultiInstanceLoopCharacteristics'); - // 创建 Shape - const shape = this._elementFactory.createShape({ - type: 'bpmn:UserTask', - businessObject: businessObject - }); - this._create.start(event, shape, { source: element }); - }; - - const appendTask = this._autoPlace - ? (event, element) => { - const bpmnFactory: BpmnFactory | undefined = modeler().getModeler().get('bpmnFactory'); - const businessObject = bpmnFactory.create('bpmn:UserTask', { - // name: '多实例用户任务',// 右键创建显示 - isForCompensation: false - }); - - // 创建多实例属性并分配给用户任务的 loopCharacteristics - businessObject.loopCharacteristics = bpmnFactory.create('bpmn:MultiInstanceLoopCharacteristics'); - - // 创建 Shape - const shape = this._elementFactory.createShape({ - type: 'bpmn:UserTask', - businessObject: businessObject - }); - - this._autoPlace.append(element, shape); - } - : appendMultiInstanceUserTask; - - const append = this._autoPlace - ? (event: Event, element: Shape) => { - const shape = this._elementFactory.createShape({ type: 'bpmn:UserTask' }); - this._autoPlace.append(element, shape); - } - : appendUserTask; - - // // 添加创建用户任务按钮 - actions['append.append-user-task'] = { - group: 'model', - className: 'bpmn-icon-user-task', - title: '用户任务', - action: { - dragstart: appendUserTask, - click: append - } - }; - - // 添加创建多实例用户任务按钮 - actions['append.append-multi-instance-user-task'] = { - group: 'model', - className: 'bpmn-icon-user', // 你可以使用多实例用户任务的图标 bpmn-icon-user bpmn-icon-user-task - title: '多实例用户任务', - action: { - dragstart: appendMultiInstanceUserTask, - click: appendTask - } - }; - - return actions; - } -} - -export default CustomContextPadProvider; diff --git a/src/bpmn/assets/module/Palette/CustomPaletteProvider.ts b/src/bpmn/assets/module/Palette/CustomPaletteProvider.ts deleted file mode 100644 index 8556d9b..0000000 --- a/src/bpmn/assets/module/Palette/CustomPaletteProvider.ts +++ /dev/null @@ -1,109 +0,0 @@ -import { assign } from 'min-dash'; -import PaletteProvider from 'bpmn-js/lib/features/palette/PaletteProvider'; -import ElementFactory from 'bpmn-js/lib/features/modeling/ElementFactory'; -import Create from 'diagram-js/lib/features/create/Create'; -import SpaceTool from 'diagram-js/lib/features/space-tool/SpaceTool'; -import LassoTool from 'diagram-js/lib/features/lasso-tool/LassoTool'; -import HandTool from 'diagram-js/lib/features/hand-tool/HandTool'; -import GlobalConnect from 'diagram-js/lib/features/global-connect/GlobalConnect'; -import Palette from 'diagram-js/lib/features/palette/Palette'; -import modeler from '@/store/modules/modeler'; -import BpmnFactory from 'bpmn-js/lib/features/modeling/BpmnFactory'; - -// @Description: 增强左侧面板 -class CustomPaletteProvider extends PaletteProvider { - private readonly _palette: Palette; - private readonly _create: Create; - private readonly _elementFactory: ElementFactory; - private readonly _spaceTool: SpaceTool; - private readonly _lassoTool: LassoTool; - private readonly _handTool: HandTool; - private readonly _globalConnect: GlobalConnect; - private readonly _translate: any; - - constructor(palette, create, elementFactory, spaceTool, lassoTool, handTool, globalConnect, translate) { - super(palette, create, elementFactory, spaceTool, lassoTool, handTool, globalConnect, translate); - this._palette = palette; - this._create = create; - this._elementFactory = elementFactory; - this._spaceTool = spaceTool; - this._lassoTool = lassoTool; - this._handTool = handTool; - this._globalConnect = globalConnect; - this._translate = translate; - } - - getPaletteEntries() { - const actions = {}, - create = this._create, - elementFactory = this._elementFactory, - translate = this._translate; - - function createAction(type: string, group: string, className: string, title: string, options?: object) { - function createListener(event) { - const shape = elementFactory.createShape(assign({ type: type }, options)); - if (options) { - !shape.businessObject.di && (shape.businessObject.di = {}); - shape.businessObject.di.isExpanded = (options as { [key: string]: any }).isExpanded; - } - create.start(event, shape, null); - } - const shortType = type.replace(/^bpmn:/, ''); - return { - group: group, - className: className, - title: title || translate('Create {type}', { type: shortType }), - action: { - dragstart: createListener, - click: createListener - } - }; - } - - function createMultiInstanceUserTask(event) { - const bpmnFactory: BpmnFactory | undefined = modeler().getBpmnFactory(); - // 创建一个 bpmn:UserTask - const userTask = bpmnFactory.create('bpmn:UserTask', { - // name: '多实例用户任务', // 在画板中显示字段 - isForCompensation: false - }); - // 将多实例属性分配给 bpmn:UserTask 的 loopCharacteristics - userTask.loopCharacteristics = bpmnFactory.create('bpmn:MultiInstanceLoopCharacteristics'); - const customUserTask = elementFactory.createShape({ - type: 'bpmn:UserTask', - businessObject: userTask // 分配创建的 userTask 到 businessObject - }); - create.start(event, customUserTask, {}); - } - - assign(actions, { - 'create.parallel-gateway': createAction('bpmn:ParallelGateway', 'gateway', 'bpmn-icon-gateway-parallel', '并行网关'), - 'create.event-base-gateway': createAction('bpmn:EventBasedGateway', 'gateway', 'bpmn-icon-gateway-eventbased', '事件网关'), - // 分组线 - 'gateway-separator': { - group: 'gateway', - separator: true - }, - 'create.user-task': createAction('bpmn:UserTask', 'activity', 'bpmn-icon-user-task', '创建用户任务'), - 'create.multi-instance-user-task': { - group: 'activity', - type: 'bpmn:UserTask', - className: 'bpmn-icon-user task-multi-instance', - title: '创建多实例用户任务', - action: { - click: createMultiInstanceUserTask, - dragstart: createMultiInstanceUserTask - } - }, - 'task-separator': { - group: 'activity', - separator: true - } - }); - return actions; - } -} - -CustomPaletteProvider['$inject'] = ['palette', 'create', 'elementFactory', 'spaceTool', 'lassoTool', 'handTool', 'globalConnect', 'translate']; - -export default CustomPaletteProvider; diff --git a/src/bpmn/assets/module/Renderer/CustomRenderer.ts b/src/bpmn/assets/module/Renderer/CustomRenderer.ts deleted file mode 100644 index 6a4eb1a..0000000 --- a/src/bpmn/assets/module/Renderer/CustomRenderer.ts +++ /dev/null @@ -1,56 +0,0 @@ -import BaseRenderer from 'diagram-js/lib/draw/BaseRenderer'; -import { - append as svgAppend, - attr as svgAttr, - create as svgCreate, - select as svgSelect, - selectAll as svgSelectAll, - clone as svgClone, - clear as svgClear, - remove as svgRemove -} from 'tiny-svg'; - -const HIGH_PRIORITY = 1500; -export default class CustomRenderer extends BaseRenderer { - bpmnRenderer: BaseRenderer; - modeling: any; - constructor(eventBus, bpmnRenderer, modeling) { - super(eventBus, HIGH_PRIORITY); - this.bpmnRenderer = bpmnRenderer; - this.modeling = modeling; - } - canRender(element) { - // ignore labels - return !element.labelTarget; - } - - /** - * 自定义节点图形 - * @param {*} parentNode 当前元素的svgNode - * @param {*} element - * @returns - */ - drawShape(parentNode, element) { - const shape = this.bpmnRenderer.drawShape(parentNode, element); - const { type, width, height } = element; - // 开始 填充绿色 - if (type === 'bpmn:StartEvent') { - svgAttr(shape, { fill: '#77DF6D' }); - return shape; - } - if (type === 'bpmn:EndEvent') { - svgAttr(shape, { fill: '#EE7B77' }); - return shape; - } - if (type === 'bpmn:UserTask') { - svgAttr(shape, { fill: '#A9C4F8' }); - return shape; - } - return shape; - } - - getShapePath(shape) { - return this.bpmnRenderer.getShapePath(shape); - } -} -CustomRenderer['$inject'] = ['eventBus', 'bpmnRenderer']; diff --git a/src/bpmn/assets/module/Translate/index.ts b/src/bpmn/assets/module/Translate/index.ts deleted file mode 100644 index 6b52dae..0000000 --- a/src/bpmn/assets/module/Translate/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -import zh from '../../lang/zh'; - -const customTranslate = (template: any, replacements: any) => { - replacements = replacements || {}; - template = zh[template] || template; - return template.replace(/{([^}]+)}/g, function (_: any, key: any) { - return replacements[key] || '{' + key + '}'; - }); -}; - -export const translateModule = { - translate: ['value', customTranslate] -}; - -export default translateModule; diff --git a/src/bpmn/assets/module/index.ts b/src/bpmn/assets/module/index.ts deleted file mode 100644 index 55f6b9f..0000000 --- a/src/bpmn/assets/module/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -// 翻译模块 -import TranslationModule from './Translate'; -import { ModuleDeclaration } from 'didi'; -import CustomPaletteProvider from './Palette/CustomPaletteProvider'; -import CustomRenderer from './Renderer/CustomRenderer'; -import CustomContextPadProvider from './ContextPad/CustomContextPadProvider'; - -const Module: ModuleDeclaration[] = [ - { - __init__: ['customPaletteProvider', 'customContextPadProvider', 'customRenderer'], - customPaletteProvider: ['type', CustomPaletteProvider], - customRenderer: ['type', CustomRenderer], - customContextPadProvider: ['type', CustomContextPadProvider] - }, - TranslationModule -]; -export default Module; diff --git a/src/bpmn/assets/showConfig.ts b/src/bpmn/assets/showConfig.ts deleted file mode 100644 index 853eb35..0000000 --- a/src/bpmn/assets/showConfig.ts +++ /dev/null @@ -1,50 +0,0 @@ -export default { - 'bpmn:EndEvent': {}, - 'bpmn:StartEvent': { - initiator: true, - formKey: true - }, - 'bpmn:UserTask': { - allocationType: true, - specifyDesc: true, - multipleUserAuditType: true, - async: true, - priority: true, - skipExpression: true, - dueDate: true, - taskListener: true, - executionListener: true - }, - 'bpmn:ServiceTask': { - async: true, - skipExpression: true, - isForCompensation: true, - triggerable: true, - class: true - }, - 'bpmn:ScriptTask': { - async: true, - isForCompensation: true, - autoStoreVariables: true - }, - 'bpmn:ManualTask': { - async: true, - isForCompensation: true - }, - 'bpmn:ReceiveTask': { - async: true, - isForCompensation: true - }, - 'bpmn:SendTask': { - async: true, - isForCompensation: true - }, - 'bpmn:BusinessRuleTask': { - async: true, - isForCompensation: true, - ruleVariablesInput: true, - rules: true, - resultVariable: true, - exclude: true - } -}; diff --git a/src/bpmn/assets/style/index.scss b/src/bpmn/assets/style/index.scss deleted file mode 100644 index 3c92792..0000000 --- a/src/bpmn/assets/style/index.scss +++ /dev/null @@ -1,284 +0,0 @@ -.djs-palette { - width: 300px; - - .bpmn-icon-hand-tool:hover { - &:after { - content: '启动手动工具'; - position: absolute; - left: 45px; - width: 120px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - .bpmn-icon-lasso-tool:hover { - &:after { - content: '启动套索工具'; - position: absolute; - left: 100px; - width: 120px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - .bpmn-icon-space-tool:hover { - &:after { - content: '启动创建/删除空间工具'; - position: absolute; - left: 45px; - width: 170px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - .bpmn-icon-connection-multi:hover { - &:after { - content: '启动全局连接工具'; - position: absolute; - left: 100px; - width: 140px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - .bpmn-icon-start-event-none:hover { - &:after { - content: '创建开始事件'; - position: absolute; - left: 45px; - width: 120px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - .bpmn-icon-intermediate-event-none:hover { - &:after { - content: '创建中间/边界事件'; - position: absolute; - left: 100px; - width: 140px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - .bpmn-icon-end-event-none:hover { - &:after { - content: '创建结束事件'; - position: absolute; - left: 45px; - width: 120px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - .bpmn-icon-gateway-none:hover { - &:after { - content: '创建网关'; - position: absolute; - left: 100px; - width: 90px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - .bpmn-icon-gateway-parallel:hover { - &:after { - content: '创建并行网关'; - position: absolute; - left: 45px; - width: 120px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - .bpmn-icon-gateway-eventbased:hover { - &:after { - content: '创建事件网关'; - position: absolute; - left: 100px; - width: 120px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - .bpmn-icon-task:hover { - &:after { - content: '创建任务'; - position: absolute; - left: 45px; - width: 80px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - .bpmn-icon-subprocess-expanded:hover { - &:after { - content: '创建可折叠子流程'; - position: absolute; - left: 100px; - width: 140px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - .bpmn-icon-user-task:hover { - &:after { - content: '创建用户任务'; - position: absolute; - left: 45px; - width: 120px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - - .task-multi-instance:hover { - &:after { - content: '创建多实例用户任务'; - position: absolute; - left: 100px; - width: 160px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - .bpmn-icon-participant:hover { - &:after { - content: '创建泳池/泳道'; - position: absolute; - left: 45px; - width: 120px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - .bpmn-icon-data-object { - display: none; - &:hover { - &:after { - content: '创建数据对象'; - position: absolute; - left: 45px; - width: 120px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - } - .bpmn-icon-data-store { - display: none; - &:hover { - &:after { - content: '创建数据存储'; - position: absolute; - left: 100px; - width: 120px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - } - .bpmn-icon-group { - display: none; - &:hover { - &:after { - content: '创建分组'; - position: absolute; - left: 100px; - width: 100px; - font-size: 15px; - font-weight: bold; - color: #3a84de; - border-radius: 2px; - border: 1px solid #cccccc; - background-color: #fafafa; - opacity: 0.8; - } - } - } -} diff --git a/src/bpmn/hooks/usePanel.ts b/src/bpmn/hooks/usePanel.ts deleted file mode 100644 index ace579b..0000000 --- a/src/bpmn/hooks/usePanel.ts +++ /dev/null @@ -1,145 +0,0 @@ -import showConfig from '../assets/showConfig'; -import type { ModdleElement } from 'bpmn'; -import useModelerStore from '@/store/modules/modeler'; -import { MultiInstanceTypeEnum } from '@/enums/bpmn/IndexEnums'; -interface Options { - element: ModdleElement; -} - -export default (ops: Options) => { - const { element } = ops; - const { getModeling, getModdle } = useModelerStore(); - const modeling = getModeling(); - const moddle = getModdle(); - - /** - * 当前节点类型 - */ - const elementType = computed(() => { - const bizObj = element.businessObject; - return bizObj.eventDefinitions ? bizObj.eventDefinitions[0].$type : bizObj.$type; - }); - - /** - * 用于控制面板字段显示与隐藏的配置 - */ - const config = computed(() => showConfig[elementType.value] || {}); - - /** - * 创建一个节点 - * @param elementType 节点类型 - * @param properties 属性 - * @param parent 父节点 - */ - const createModdleElement = (elementType: string, properties: any, parent: ModdleElement) => { - const element = moddle.create(elementType, properties); - parent && (element.$parent = parent); - return element; - }; - - /** - * 获取扩展属性,如果不存在会自动创建 - */ - const getExtensionElements = (create = true) => { - let extensionElements = element.businessObject.get('extensionElements'); - if (!extensionElements && create) { - extensionElements = createModdleElement('bpmn:ExtensionElements', { values: [] }, element.businessObject); - modeling.updateModdleProperties(element, element.businessObject, { extensionElements }); - } - return extensionElements; - }; - - /** - * 获取extensionElements下的properties - * @param extensionElements 可选参数,默认获取当前Element下的extensionElements下的Properties - */ - const getPropertiesElements = (extensionElements?: ModdleElement) => { - if (!extensionElements) { - extensionElements = getExtensionElements(); - } - let propertiesElements = extensionElements.values.find((item) => item.$type === 'flowable:properties'); - if (!propertiesElements) { - propertiesElements = createModdleElement('flowable:properties', { values: [] }, extensionElements); - modeling.updateModdleProperties(element, extensionElements, { - values: [...extensionElements.get<[]>('values'), propertiesElements] - }); - } - return propertiesElements; - }; - - /** - * 更新节点属性 - * @param properties 属性值 - */ - const updateProperties = (properties: any) => { - modeling.updateProperties(element, properties); - }; - - /** - * 更新节点信息 - * @param updateElement 需要更新的节点 - * @param properties 属性 - */ - const updateModdleProperties = (updateElement, properties: any) => { - modeling.updateModdleProperties(element, updateElement, properties); - }; - - /** - * 更新Property属性 - * @param name key值 - * @param value 值 - */ - const updateProperty = (name: string, value: string) => { - const propertiesElements = getPropertiesElements(); - - let propertyElements = propertiesElements.values.find((item) => item.name === name); - if (!propertyElements) { - propertyElements = createModdleElement('flowable:property', { name: name, value: value }, propertiesElements); - modeling.updateModdleProperties(element, propertiesElements, { - values: [...propertiesElements.get('values'), propertyElements] - }); - } else { - propertyElements.name = name; - propertyElements.value = value; - } - return propertyElements; - }; - - const idChange = (newVal: string) => { - if (newVal) { - updateProperties({ id: newVal }); - } - }; - const nameChange = (newVal: string) => { - if (newVal) { - updateProperties({ name: newVal }); - } - }; - const formKeyChange = (newVal: string) => { - updateProperties({ formKey: newVal }); - }; - const constant = { - MultiInstanceType: [ - { id: '373d4b81-a0d1-4eb8-8685-0d2fb1b468e2', label: '无', value: MultiInstanceTypeEnum.NONE }, - { id: 'b5acea7c-b7e5-46b0-8778-390db091bdab', label: '串行', value: MultiInstanceTypeEnum.SERIAL }, - { id: 'b4f0c683-1ccc-43c4-8380-e1b998986caf', label: '并行', value: MultiInstanceTypeEnum.PARALLEL } - ] - }; - - return { - elementType, - constant, - showConfig: config, - - updateProperties, - updateProperty, - updateModdleProperties, - - createModdleElement, - idChange, - nameChange, - formKeyChange, - getExtensionElements, - getPropertiesElements - }; -}; diff --git a/src/bpmn/hooks/useParseElement.ts b/src/bpmn/hooks/useParseElement.ts deleted file mode 100644 index e1a6054..0000000 --- a/src/bpmn/hooks/useParseElement.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { ModdleElement } from 'bpmn'; - -interface Options { - element: ModdleElement; -} - -interface Data { - id: string; -} - -export default (ops: Options) => { - const { element } = ops; - - const parseData = (): T => { - const result = { - ...element.businessObject, - ...element.businessObject.$attrs - }; - - // 移除flowable前缀,格式化数组 - for (const key in result) { - if (key.indexOf('flowable:') === 0) { - const newKey = key.replace('flowable:', ''); - result[newKey] = result[key]; - delete result[key]; - } - } - return { ...result } as T; - }; - - return { - parseData - }; -}; diff --git a/src/bpmn/index.vue b/src/bpmn/index.vue deleted file mode 100644 index 15437c8..0000000 --- a/src/bpmn/index.vue +++ /dev/null @@ -1,496 +0,0 @@ - - - - - diff --git a/src/bpmn/panel/GatewayPanel.vue b/src/bpmn/panel/GatewayPanel.vue deleted file mode 100644 index 20cc134..0000000 --- a/src/bpmn/panel/GatewayPanel.vue +++ /dev/null @@ -1,68 +0,0 @@ - - - - diff --git a/src/bpmn/panel/ParticipantPanel.vue b/src/bpmn/panel/ParticipantPanel.vue deleted file mode 100644 index b1d42e6..0000000 --- a/src/bpmn/panel/ParticipantPanel.vue +++ /dev/null @@ -1,68 +0,0 @@ - - - - diff --git a/src/bpmn/panel/ProcessPanel.vue b/src/bpmn/panel/ProcessPanel.vue deleted file mode 100644 index 9e118e2..0000000 --- a/src/bpmn/panel/ProcessPanel.vue +++ /dev/null @@ -1,71 +0,0 @@ - - - - - diff --git a/src/bpmn/panel/SequenceFlowPanel.vue b/src/bpmn/panel/SequenceFlowPanel.vue deleted file mode 100644 index eac8227..0000000 --- a/src/bpmn/panel/SequenceFlowPanel.vue +++ /dev/null @@ -1,95 +0,0 @@ - - - - diff --git a/src/bpmn/panel/StartEndPanel.vue b/src/bpmn/panel/StartEndPanel.vue deleted file mode 100644 index bde1212..0000000 --- a/src/bpmn/panel/StartEndPanel.vue +++ /dev/null @@ -1,67 +0,0 @@ - - - - diff --git a/src/bpmn/panel/SubProcessPanel.vue b/src/bpmn/panel/SubProcessPanel.vue deleted file mode 100644 index 3490fff..0000000 --- a/src/bpmn/panel/SubProcessPanel.vue +++ /dev/null @@ -1,193 +0,0 @@ - - - - diff --git a/src/bpmn/panel/TaskPanel.vue b/src/bpmn/panel/TaskPanel.vue deleted file mode 100644 index a42de8a..0000000 --- a/src/bpmn/panel/TaskPanel.vue +++ /dev/null @@ -1,491 +0,0 @@ - - - - diff --git a/src/bpmn/panel/index.vue b/src/bpmn/panel/index.vue deleted file mode 100644 index 445571a..0000000 --- a/src/bpmn/panel/index.vue +++ /dev/null @@ -1,110 +0,0 @@ - - - - diff --git a/src/bpmn/panel/property/DueDate.vue b/src/bpmn/panel/property/DueDate.vue deleted file mode 100644 index 882766b..0000000 --- a/src/bpmn/panel/property/DueDate.vue +++ /dev/null @@ -1,252 +0,0 @@ - - - diff --git a/src/bpmn/panel/property/ExecutionListener.vue b/src/bpmn/panel/property/ExecutionListener.vue deleted file mode 100644 index 3c584cb..0000000 --- a/src/bpmn/panel/property/ExecutionListener.vue +++ /dev/null @@ -1,308 +0,0 @@ - - - - diff --git a/src/bpmn/panel/property/ListenerParam.vue b/src/bpmn/panel/property/ListenerParam.vue deleted file mode 100644 index 21c6de1..0000000 --- a/src/bpmn/panel/property/ListenerParam.vue +++ /dev/null @@ -1,121 +0,0 @@ - - - - - diff --git a/src/bpmn/panel/property/TaskListener.vue b/src/bpmn/panel/property/TaskListener.vue deleted file mode 100644 index 9a32c47..0000000 --- a/src/bpmn/panel/property/TaskListener.vue +++ /dev/null @@ -1,310 +0,0 @@ - - - - diff --git a/src/components/BpmnDesign/index.vue b/src/components/BpmnDesign/index.vue deleted file mode 100644 index 1f84516..0000000 --- a/src/components/BpmnDesign/index.vue +++ /dev/null @@ -1,71 +0,0 @@ - - - - - diff --git a/src/components/BpmnView/index.vue b/src/components/BpmnView/index.vue deleted file mode 100644 index c5e0c7b..0000000 --- a/src/components/BpmnView/index.vue +++ /dev/null @@ -1,411 +0,0 @@ - - - - - diff --git a/src/components/Process/approvalRecord.vue b/src/components/Process/approvalRecord.vue index bb4ed91..baf86a7 100644 --- a/src/components/Process/approvalRecord.vue +++ b/src/components/Process/approvalRecord.vue @@ -2,39 +2,49 @@
- - + +
- - + + - + - - - - - + + + + + diff --git a/src/components/Process/processMeddle.vue b/src/components/Process/processMeddle.vue new file mode 100644 index 0000000..7224755 --- /dev/null +++ b/src/components/Process/processMeddle.vue @@ -0,0 +1,207 @@ + + diff --git a/src/components/Process/submitVerify.vue b/src/components/Process/submitVerify.vue index 09fc82e..4c2ea88 100644 --- a/src/components/Process/submitVerify.vue +++ b/src/components/Process/submitVerify.vue @@ -3,47 +3,47 @@ - 站内信 - 邮件 - 短信 + 站内信 + 邮件 + 短信 - - + + - {{ user.userName }} + {{ user.nickName }} - + @@ -54,14 +54,14 @@ - + - + - - + + @@ -83,6 +83,19 @@ + +
+ + + + + + + +
+
@@ -90,18 +103,17 @@ import { ref } from 'vue'; import { ComponentInternalInstance } from 'vue'; import { ElForm } from 'element-plus'; -import { completeTask, backProcess, getTaskById, transferTask, terminationTask, getTaskNodeList, delegateTask } from '@/api/workflow/task'; +import { completeTask, backProcess, getTask, taskOperation, terminationTask, getBackTaskNode, currentTaskAllUser } from '@/api/workflow/task'; import UserSelect from '@/components/UserSelect'; -import MultiInstanceUser from '@/components/Process/multiInstanceUser.vue'; + const { proxy } = getCurrentInstance() as ComponentInternalInstance; import { UserVO } from '@/api/system/user/types'; -import { TaskVO } from '@/api/workflow/task/types'; +import { FlowTaskVO, TaskOperationBo } from '@/api/workflow/task/types'; + const userSelectCopyRef = ref>(); const transferTaskRef = ref>(); const delegateTaskRef = ref>(); - -//加签组件 -const multiInstanceUserRef = ref>(); +const multiInstanceUserRef = ref>(); const props = defineProps({ taskVariables: { @@ -119,65 +131,53 @@ const taskId = ref(''); const selectCopyUserList = ref([]); //抄送人id const selectCopyUserIds = ref(undefined); -// 驳回是否显示 +//可减签的人员 +const deleteUserList = ref([]); +//驳回是否显示 const backVisible = ref(false); const backLoading = ref(true); const backButtonDisabled = ref(true); // 可驳回得任务节点 const taskNodeList = ref([]); //任务 -const task = ref({ +const task = ref({ id: undefined, - name: undefined, - description: undefined, - priority: undefined, - owner: undefined, - assignee: undefined, - assigneeName: undefined, - processInstanceId: undefined, - executionId: undefined, - taskDefinitionId: undefined, - processDefinitionId: undefined, - endTime: undefined, - taskDefinitionKey: undefined, - dueDate: undefined, - category: undefined, - parentTaskId: undefined, + createTime: undefined, + updateTime: undefined, tenantId: undefined, - claimTime: undefined, - businessStatus: undefined, - businessStatusName: undefined, - processDefinitionName: undefined, - processDefinitionKey: undefined, - participantVo: undefined, - multiInstance: undefined, - businessKey: undefined, - wfNodeConfigVo: undefined + definitionId: undefined, + instanceId: undefined, + flowName: undefined, + businessId: undefined, + nodeCode: undefined, + nodeName: undefined, + flowCode: undefined, + flowStatus: undefined, + formCustom: undefined, + formPath: undefined, + nodeType: undefined, + nodeRatio: undefined }); -//加签 减签标题 -const title = ref(''); const dialog = reactive({ visible: false, title: '提示' }); - +//减签弹窗 +const deleteSignatureVisible = ref(false); const form = ref>({ taskId: undefined, message: undefined, variables: {}, messageType: ['1'], - wfCopyList: [] + flowCopyList: [] }); const backForm = ref>({ taskId: undefined, - targetActivityId: undefined, + nodeCode: undefined, message: undefined, variables: {}, messageType: ['1'] }); -const closeDialog = () => { - dialog.visible = false; -}; //打开弹窗 const openDialog = (id?: string) => { selectCopyUserIds.value = undefined; @@ -189,7 +189,7 @@ const openDialog = (id?: string) => { loading.value = true; buttonDisabled.value = true; nextTick(() => { - getTaskById(taskId.value).then((response) => { + getTask(taskId.value).then((response) => { task.value = response.data; loading.value = false; buttonDisabled.value = false; @@ -205,15 +205,15 @@ const handleCompleteTask = async () => { form.value.taskId = taskId.value; form.value.taskVariables = props.taskVariables; if (selectCopyUserList.value && selectCopyUserList.value.length > 0) { - let wfCopyList = []; + let flowCopyList = []; selectCopyUserList.value.forEach((e) => { let copyUser = { userId: e.userId, userName: e.nickName }; - wfCopyList.push(copyUser); + flowCopyList.push(copyUser); }); - form.value.wfCopyList = wfCopyList; + form.value.flowCopyList = flowCopyList; } await proxy?.$modal.confirm('是否确认提交?'); loading.value = true; @@ -236,11 +236,11 @@ const handleBackProcessOpen = async () => { backVisible.value = true; backLoading.value = true; backButtonDisabled.value = true; - let data = await getTaskNodeList(task.value.processInstanceId); + let data = await getBackTaskNode(task.value.definitionId, task.value.nodeCode); taskNodeList.value = data.data; backLoading.value = false; backButtonDisabled.value = false; - backForm.value.targetActivityId = taskNodeList.value[0].nodeId; + backForm.value.nodeCode = taskNodeList.value[0].nodeCode; }; /** 驳回流程 */ const handleBackProcess = async () => { @@ -249,7 +249,10 @@ const handleBackProcess = async () => { loading.value = true; backLoading.value = true; backButtonDisabled.value = true; - await backProcess(backForm.value).finally(() => (loading.value = false)); + await backProcess(backForm.value).finally(() => { + loading.value = false; + buttonDisabled.value = false; + }); dialog.visible = false; backLoading.value = false; backButtonDisabled.value = false; @@ -282,18 +285,48 @@ const handleCopyCloseTag = (user: UserVO) => { selectCopyUserIds.value = selectCopyUserList.value.map((item) => item.userId).join(','); }; //加签 -const addMultiInstanceUser = () => { - if (multiInstanceUserRef.value) { - title.value = '加签人员'; - multiInstanceUserRef.value.getAddMultiInstanceList(taskId.value, []); +const openMultiInstanceUser = async () => { + multiInstanceUserRef.value.open(); +}; +//加签 +const addMultiInstanceUser = async (data) => { + if (data && data.length > 0) { + const taskOperationBo = reactive({ + userIds: data.map((e) => e.userId), + taskId: taskId.value, + message: form.value.message + }); + await proxy?.$modal.confirm('是否确认提交?'); + loading.value = true; + buttonDisabled.value = true; + await taskOperation(taskOperationBo, 'addSignature').finally(() => { + loading.value = false; + buttonDisabled.value = false; + }); + dialog.visible = false; + emits('submitCallback'); + proxy?.$modal.msgSuccess('操作成功'); + } else { + proxy?.$modal.msgWarning('请选择用户!'); } }; //减签 -const deleteMultiInstanceUser = () => { - if (multiInstanceUserRef.value) { - title.value = '减签人员'; - multiInstanceUserRef.value.getDeleteMultiInstanceList(taskId.value); - } +const deleteMultiInstanceUser = async (row) => { + await proxy?.$modal.confirm('是否确认提交?'); + loading.value = true; + buttonDisabled.value = true; + const taskOperationBo = reactive({ + userIds: [row.userId], + taskId: taskId.value, + message: form.value.message + }); + await taskOperation(taskOperationBo, 'reductionSignature').finally(() => { + loading.value = false; + buttonDisabled.value = false; + }); + dialog.visible = false; + emits('submitCallback'); + proxy?.$modal.msgSuccess('操作成功'); }; //打开转办 const openTransferTask = () => { @@ -302,15 +335,18 @@ const openTransferTask = () => { //转办 const handleTransferTask = async (data) => { if (data && data.length > 0) { - let params = { - taskId: taskId.value, + const taskOperationBo = reactive({ userId: data[0].userId, - comment: form.value.message - }; + taskId: taskId.value, + message: form.value.message + }); await proxy?.$modal.confirm('是否确认提交?'); loading.value = true; buttonDisabled.value = true; - await transferTask(params).finally(() => (loading.value = false)); + await taskOperation(taskOperationBo, 'transferTask').finally(() => { + loading.value = false; + buttonDisabled.value = false; + }); dialog.visible = false; emits('submitCallback'); proxy?.$modal.msgSuccess('操作成功'); @@ -326,15 +362,18 @@ const openDelegateTask = () => { //委托 const handleDelegateTask = async (data) => { if (data && data.length > 0) { - let params = { - taskId: taskId.value, + const taskOperationBo = reactive({ userId: data[0].userId, - nickName: data[0].nickName - }; + taskId: taskId.value, + message: form.value.message + }); await proxy?.$modal.confirm('是否确认提交?'); loading.value = true; buttonDisabled.value = true; - await delegateTask(params).finally(() => (loading.value = false)); + await taskOperation(taskOperationBo, 'delegateTask').finally(() => { + loading.value = false; + buttonDisabled.value = false; + }); dialog.visible = false; emits('submitCallback'); proxy?.$modal.msgSuccess('操作成功'); @@ -343,7 +382,7 @@ const handleDelegateTask = async (data) => { } }; //终止任务 -const handleTerminationTask = async (data) => { +const handleTerminationTask = async () => { let params = { taskId: taskId.value, comment: form.value.message @@ -351,11 +390,24 @@ const handleTerminationTask = async (data) => { await proxy?.$modal.confirm('是否确认终止?'); loading.value = true; buttonDisabled.value = true; - await terminationTask(params).finally(() => (loading.value = false)); + await terminationTask(params).finally(() => { + loading.value = false; + buttonDisabled.value = false; + }); dialog.visible = false; emits('submitCallback'); proxy?.$modal.msgSuccess('操作成功'); }; +const handleTaskUser = async () => { + let data = await currentTaskAllUser(taskId.value); + deleteUserList.value = data.data; + if (deleteUserList.value && deleteUserList.value.length > 0) { + deleteUserList.value.forEach((e) => { + e.nodeName = task.value.nodeName; + }); + } + deleteSignatureVisible.value = true; +}; /** * 对外暴露子组件方法 diff --git a/src/components/UserSelect/index.vue b/src/components/UserSelect/index.vue index 4b93bb3..937a395 100644 --- a/src/components/UserSelect/index.vue +++ b/src/components/UserSelect/index.vue @@ -43,7 +43,7 @@ @@ -100,14 +100,14 @@ diff --git a/src/views/workflow/leave/index.vue b/src/views/workflow/leave/index.vue index 1708b64..64f0c57 100644 --- a/src/views/workflow/leave/index.vue +++ b/src/views/workflow/leave/index.vue @@ -31,7 +31,7 @@ - + @@ -56,38 +56,28 @@ - + @@ -99,7 +89,7 @@ diff --git a/src/views/workflow/processDefinition/components/processPreview.vue b/src/views/workflow/processDefinition/components/processPreview.vue deleted file mode 100644 index 19a95df..0000000 --- a/src/views/workflow/processDefinition/components/processPreview.vue +++ /dev/null @@ -1,45 +0,0 @@ - - - diff --git a/src/views/workflow/processDefinition/design.vue b/src/views/workflow/processDefinition/design.vue new file mode 100644 index 0000000..cb11045 --- /dev/null +++ b/src/views/workflow/processDefinition/design.vue @@ -0,0 +1,52 @@ + + + + + diff --git a/src/views/workflow/processDefinition/index.vue b/src/views/workflow/processDefinition/index.vue index 6c686bf..38ba903 100644 --- a/src/views/workflow/processDefinition/index.vue +++ b/src/views/workflow/processDefinition/index.vue @@ -10,7 +10,7 @@ class="mt-2" node-key="id" :data="categoryOptions" - :props="{ label: 'categoryName', children: 'children' }" + :props="{ label: 'label', children: 'children' }" :expand-on-click-node="false" :filter-node-method="filterNode" highlight-current @@ -24,11 +24,11 @@
- - + + - - + + 搜索 @@ -41,94 +41,87 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - @@ -138,9 +131,9 @@
点击上传,选择BPMN流程文件
@@ -162,88 +155,35 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -251,53 +191,32 @@ diff --git a/src/views/workflow/processInstance/index.vue b/src/views/workflow/processInstance/index.vue index 084cf13..140cdaf 100644 --- a/src/views/workflow/processInstance/index.vue +++ b/src/views/workflow/processInstance/index.vue @@ -10,7 +10,7 @@ class="mt-2" node-key="id" :data="categoryOptions" - :props="{ label: 'categoryName', children: 'children' }" + :props="{ label: 'label', children: 'children' }" :expand-on-click-node="false" :filter-node-method="filterNode" highlight-current @@ -20,23 +20,31 @@
-
- - - 运行中 - 已完成 - - -
+
- - - + + + + 选择申请人 + - - + + + + + + + + 搜索 @@ -55,66 +63,74 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -122,6 +138,7 @@ + @@ -133,42 +150,55 @@ - - - + + + + +
+ +
+
+
+ + + +
diff --git a/vite.config.ts b/vite.config.ts index 97c8d9d..e125e36 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -64,16 +64,6 @@ export default defineConfig(({ mode, command }: ConfigEnv): UserConfig => { 'echarts', 'vue-i18n', '@vueup/vue-quill', - 'bpmn-js/lib/Viewer', - 'bpmn-js/lib/Modeler.js', - 'bpmn-js-properties-panel', - 'min-dash', - 'diagram-js/lib/navigation/movecanvas', - 'diagram-js/lib/navigation/zoomscroll', - 'bpmn-js/lib/features/palette/PaletteProvider', - 'bpmn-js/lib/features/context-pad/ContextPadProvider', - 'diagram-js/lib/draw/BaseRenderer', - 'tiny-svg', 'image-conversion', 'element-plus/es/components/**/css' ]