vue3集成bpmn

文章目录

  • 前言
  • 一、依赖
  • 二、汉化配置
    • 1.引入文件
    • 2.样式文件
  • 总结


前言

vue3 集成bpmn 配置工作流

一、依赖

"bpmn-js": "^7.3.1",
"bpmn-js-properties-panel": "^0.37.2",
"bpmn-moddle": "^6.0.0",
"camunda-bpmn-moddle": "^4.5.0",
"diagram-js-minimap": "2.0.4"

二、汉化配置

export default {// Labels"Activate the global connect tool": "激活全局连接工具","Append {type}": "追加 {type}","Append EndEvent": "追加 结束事件 ","Append Task": "追加 任务","Append Gateway": "追加 网关","Append Intermediate/Boundary Event": "追加 中间/边界 事件","Add Lane above": "在上面添加道","Divide into two Lanes": "分割成两个道","Divide into three Lanes": "分割成三个道","Add Lane below": "在下面添加道","Append compensation activity": "追加补偿活动","Change type": "修改类型","Connect using Association": "使用关联连接","Connect using Sequence/MessageFlow or Association":"使用顺序/消息流或者关联连接","Connect using DataInputAssociation": "使用数据输入关联连接","Remove": "移除","Activate the hand tool": "激活抓手工具","Activate the lasso tool": "激活套索工具","Activate the create/remove space tool": "激活创建/删除空间工具","Create expanded SubProcess": "创建扩展子过程","Create IntermediateThrowEvent/BoundaryEvent": "创建中间抛出事件/边界事件","Create Pool/Participant": "创建池/参与者","Parallel Multi Instance": "并行多重事件","Sequential Multi Instance": "时序多重事件","DataObjectReference": "数据对象参考","DataStoreReference": "数据存储参考","Loop": "循环","Ad-hoc": "即席","Create {type}": "创建 {type}","Create Task": "创建任务","Create StartEvent": "创建开始事件","Create EndEvent": "创建结束事件","Create Group": "创建组","Task": "任务","Send Task": "发送任务","Receive Task": "接收任务","User Task": "用户任务","Manual Task": "手工任务","Business Rule Task": "业务规则任务","Service Task": "服务任务","Script Task": "脚本任务","Call Activity": "调用活动","Sub Process (collapsed)": "子流程(折叠的)","Sub Process (expanded)": "子流程(展开的)","Start Event": "开始事件","StartEvent": "开始事件","Intermediate Throw Event": "中间事件","End Event": "结束事件","EndEvent": "结束事件","Create Gateway": "创建网关","GateWay": "网关","Create Intermediate/Boundary Event": "创建中间/边界事件","Message Start Event": "消息开始事件","Timer Start Event": "定时开始事件","Conditional Start Event": "条件开始事件","Signal Start Event": "信号开始事件","Error Start Event": "错误开始事件","Escalation Start Event": "升级开始事件","Compensation Start Event": "补偿开始事件","Message Start Event (non-interrupting)": "消息开始事件(非中断)","Timer Start Event (non-interrupting)": "定时开始事件(非中断)","Conditional Start Event (non-interrupting)": "条件开始事件(非中断)","Signal Start Event (non-interrupting)": "信号开始事件(非中断)","Escalation Start Event (non-interrupting)": "升级开始事件(非中断)","Message Intermediate Catch Event": "消息中间捕获事件","Message Intermediate Throw Event": "消息中间抛出事件","Timer Intermediate Catch Event": "定时中间捕获事件","Escalation Intermediate Throw Event": "升级中间抛出事件","Conditional Intermediate Catch Event": "条件中间捕获事件","Link Intermediate Catch Event": "链接中间捕获事件","Link Intermediate Throw Event": "链接中间抛出事件","Compensation Intermediate Throw Event": "补偿中间抛出事件","Signal Intermediate Catch Event": "信号中间捕获事件","Signal Intermediate Throw Event": "信号中间抛出事件","Message End Event": "消息结束事件","Escalation End Event": "定时结束事件","Error End Event": "错误结束事件","Cancel End Event": "取消结束事件","Compensation End Event": "补偿结束事件","Signal End Event": "信号结束事件","Terminate End Event": "终止结束事件","Message Boundary Event": "消息边界事件","Message Boundary Event (non-interrupting)": "消息边界事件(非中断)","Timer Boundary Event": "定时边界事件","Timer Boundary Event (non-interrupting)": "定时边界事件(非中断)","Escalation Boundary Event": "升级边界事件","Escalation Boundary Event (non-interrupting)": "升级边界事件(非中断)","Conditional Boundary Event": "条件边界事件","Conditional Boundary Event (non-interrupting)": "条件边界事件(非中断)","Error Boundary Event": "错误边界事件","Cancel Boundary Event": "取消边界事件","Signal Boundary Event": "信号边界事件","Signal Boundary Event (non-interrupting)": "信号边界事件(非中断)","Compensation Boundary Event": "补偿边界事件","Exclusive Gateway": "互斥网关","Parallel Gateway": "并行网关","Inclusive Gateway": "相容网关","Complex Gateway": "复杂网关","Event based Gateway": "事件网关","Transaction": "转运","Sub Process": "子流程","Event Sub Process": "事件子流程","Collapsed Pool": "折叠池","Expanded Pool": "展开池",// Errors"no parent for {element} in {parent}": "在{parent}里,{element}没有父类","no shape type specified": "没有指定的形状类型","flow elements must be children of pools/participants":"流元素必须是池/参与者的子类","out of bounds release": "out of bounds release","more than {count} child lanes": "子道大于{count} ","element required": "元素不能为空","diagram not part of bpmn:Definitions": "流程图不符合bpmn规范","no diagram to display": "没有可展示的流程图","no process or collaboration to display": "没有可展示的流程/协作","element {element} referenced by {referenced}#{property} not yet drawn":"由{referenced}#{property}引用的{element}元素仍未绘制","already rendered {element}": "{element} 已被渲染","failed to import {element}": "导入{element}失败",//属性面板的参数"Id": "编号","Name": "名称","General": "常规","Details": "详情","Message Name": "消息名称","Message": "消息","Initiator": "创建者","Asynchronous Continuations": "持续异步","Asynchronous Before": "异步前","Asynchronous After": "异步后","Job Configuration": "工作配置","Exclusive": "排除","Job Priority": "工作优先级","Retry Time Cycle": "重试时间周期","Documentation": "文档","Element Documentation": "元素文档","History Configuration": "历史配置","History Time To Live": "历史的生存时间","Forms": "表单","Form Key": "表单key","Form Fields": "表单字段","Business Key": "业务key","Form Field": "表单字段","ID": "编号","Type": "类型","Label": "名称","Default Value": "默认值","Validation": "校验","Add Constraint": "添加约束","Config": "配置","Properties": "属性","Add Property": "添加属性","Value": "值","Add": "添加","Values": "值","Add Value": "添加值","Listeners": "监听器","Execution Listener": "执行监听","Event Type": "事件类型","Listener Type": "监听器类型","Java Class": "Java类","Expression": "表达式","Must provide a value": "必须提供一个值","Delegate Expression": "代理表达式","Script": "脚本","Script Format": "脚本格式","Script Type": "脚本类型","Inline Script": "内联脚本","External Script": "外部脚本","Resource": "资源","Field Injection": "字段注入","Extensions": "扩展","Input/Output": "输入/输出","Input Parameters": "输入参数","Output Parameters": "输出参数","Parameters": "参数","Output Parameter": "输出参数","Timer Definition Type": "定时器定义类型","Timer Definition": "定时器定义","Date": "日期","Duration": "持续","Cycle": "循环","Signal": "信号","Signal Name": "信号名称","Escalation": "升级","Error": "错误","Link Name": "链接名称","Condition": "条件名称","Variable Name": "变量名称","Variable Event": "变量事件","Specify more than one variable change event as a comma separated list.":"多个变量事件以逗号隔开","Wait for Completion": "等待完成","Activity Ref": "活动参考","Version Tag": "版本标签","Executable": "可执行文件","External Task Configuration": "扩展任务配置","Task Priority": "任务优先级","External": "外部","Connector": "连接器","Must configure Connector": "必须配置连接器","Connector Id": "连接器编号","Implementation": "实现方式","Field Injections": "字段注入","Fields": "字段","Result Variable": "结果变量","Topic": "主题","Configure Connector": "配置连接器","Input Parameter": "输入参数","Assignee": "代理人","Candidate Users": "候选用户","Candidate Groups": "候选组","Due Date": "到期时间","Follow Up Date": "跟踪日期","Priority": "优先级","The follow up date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)":"跟踪日期必须符合EL表达式,如: ${someDate} ,或者一个ISO标准日期,如:2015-06-26T09:54:00","The due date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)":"跟踪日期必须符合EL表达式,如: ${someDate} ,或者一个ISO标准日期,如:2015-06-26T09:54:00","Variables": "变量","Candidate Starter Configuration": "候选开始配置","Task Listener": "任务监听器","Candidate Starter Groups": "候选开始组","Candidate Starter Users": "候选开始用户","Tasklist Configuration": "任务列表配置","Startable": "启动","Specify more than one group as a comma separated list.":"指定多个组,用逗号分隔","Specify more than one user as a comma separated list.":"指定多个用户,用逗号分隔","This maps to the process definition key.": "这会映射为流程定义的键","CallActivity Type": "调用活动类型","Condition Type": "条件类型","Create UserTask": "创建用户任务","Create CallActivity": "创建调用活动","Called Element": "调用元素","Create DataObjectReference": "创建数据对象引用","Create DataStoreReference": "创建数据存储引用","Multi Instance": "多实例","Loop Cardinality": "实例数量","Collection": "任务参与人列表","Element Variable": "元素变量","Completion Condition": "完成条件","Open minimap": "打开小地图","Close minimap": "关闭小地图",
};
import translations from "./zh";export default function customTranslate(template, replacements) {replacements = replacements || {};// Translatetemplate = translations[template] || template;// Replacereturn template.replace(/{([^}]+)}/g, function(_, key) {let str = replacements[key];if (translations[replacements[key]] !== null &&translations[replacements[key]] !== "undefined") {// eslint-disable-next-line no-mixed-spaces-and-tabsstr = translations[replacements[key]];// eslint-disable-next-line no-mixed-spaces-and-tabs}return str || "{" + key + "}";});
}

1.引入文件

代码如下(示例):

import { onMounted,reactive, markRaw} from 'vue';
// bpmn-js相关
import 'bpmn-js/dist/assets/diagram-js.css'; // 左边工具栏以及编辑节点的样式
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css';
import BpmnModeler from 'bpmn-js/lib/Modeler';
// bpmn-js-properties-panel相关
import 'bpmn-js-properties-panel/dist/assets/bpmn-js-properties-panel.css'
import propertiesPanelModule from 'bpmn-js-properties-panel'
import propertiesProviderModule from 'bpmn-js-properties-panel/lib/provider/camunda'
import camundaModdleDescriptor from 'camunda-bpmn-moddle/resources/camunda'
// 引入汉化js
import translate from '@/assets/bpmn/translate.js'
// import {reactive, ref} from "vue/dist/vue";
const bpmn = reactive({bpmnModeler:null
})
onMounted(() => {var customTranslateModule = {translate: ['value', translate]}const containerEl = document.getElementById('container');const bpmnModeler = markRaw(new BpmnModeler({container: containerEl,// 添加控制板propertiesPanel: {parent: '#js-properties-panel'},// 右侧属性面板additionalModules: [propertiesPanelModule,propertiesProviderModule,customTranslateModule],moddleExtensions: {camunda: camundaModdleDescriptor}}));bpmnModeler.createDiagram(() => {bpmnModeler.get('canvas').zoom('fit-viewport');});bpmn.bpmnModeler =bpmnModeler})

2.样式文件

如下(示例):

<style>
.containerBox {height: calc(100vh - 160px);margin-top: 30px;
}.containerBox #container {height: calc(100vh - 160px);border: 1px solid rgb(121, 121, 121);
}.bpp-properties-panel [type=text] {box-sizing: border-box;
}.panel {width: 350px;position: absolute;top: 1px;right: 50px;height: 100%;overflow: auto;
}/* 右下角logo */
.bjs-powered-by {display: none;
}
</style>

总结

在这里插入图片描述
提示:这里对文章进行总结:
例如:以上就是今天要讲的内容,本文仅仅简单介绍了pandas的使用,而pandas提供了大量能使我们快速便捷地处理数据的函数和方法。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/460952.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

手把手教你玩转蓝牙模块(原理+驱动)

head: title: 手把手教你玩转蓝牙模块&#xff08;原理驱动&#xff09; description: 手把手教你玩转蓝牙模块&#xff08;原理驱动&#xff09; 作为嵌入式开发工程师&#xff0c;蓝牙模块怎能少呢&#xff1f; 蓝牙模块广泛应用在各种电子器件&#xff0c;比如手机、蓝牙耳…

安全技术和防火墙

安全技术 防火墙&#xff1a;防止外面进来&#xff0c;帮忙过滤筛选流量 防水墙&#xff1a;防止从里面出去 防火墙的分类 按保护范围分类 1.主机防火墙&#xff08;服务范围为当前一台主机&#xff09; 2.网络防火墙&#xff08;服务范围为防火墙一侧的局域网&#xff09; 按…

Linux---线程

线程概念 在一个程序里的一个执行路线就叫做线程&#xff08;thread&#xff09;。更准确的定义是&#xff1a;线程是“一个进程内部的控制序列” 一切进程至少都有一个执行线程 线程在进程内部运行&#xff0c;本质是在进程地址空间内运行 在Linux系统中&#xff0c;在CPU眼中…

【C++】友元、初始化列表、内部类、static修饰成员详解

文章目录 前言1. 构造函数不为人知的那些事1.1 构造函数体赋值1.2 初始化列表1.3 explicit关键字 2. static成员2.1 概念2.2 特性2.3 小总结 3. C11 成员变量初始化新用法4. 友元4.1 友元函数4.2 友元类 5. 内部类5.1概念及特性 总结 前言 提示&#xff1a;这里可以添加本文要…

Springboot+vue的社区智慧养老监护管理平台设计与实现(有报告),Javaee项目,springboot vue前后端分离项目

演示视频&#xff1a; Springbootvue的社区智慧养老监护管理平台设计与实现&#xff08;有报告&#xff09;&#xff0c;Javaee项目&#xff0c;springboot vue前后端分离项目 项目介绍&#xff1a; 本文设计了一个基于Springbootvue的前后端分离的社区智慧养老监护管理平台设…

ZigBee学习——在官方例程上实现串口通信

Z-Stack版本为3.0.2 IAR版本为10.10.1 文章目录 一、添加头文件二、定义接收缓冲区三、编写Uart初始化函数四、编写串口回调函数五、函数声明六、函数调用七、可能遇到的问题(function “halUartInit“ has no prototype) 以下所有操作都是在APP层进行&#xff0c;也就是这个文…

【GAMES101】Lecture 19 透镜

目录 理想的薄透镜 模糊 利用透镜模型做光线追踪 景深&#xff08;Depth of Field&#xff09; 理想的薄透镜 在实际的相机中都是用的一组透镜来作为这个镜头 这个因为真实的棱镜无法将光线真正聚焦到一个点上&#xff0c;它只能聚在一堆上 所以方便研究提出了一种理想化的…

复旦大学NLP团队发布86页大模型Agent综述

复旦大学自然语言处理团队&#xff08;FudanNLP&#xff09;发布了一篇长达86页的综述论文&#xff0c;探讨了基于大型语言模型的智能代理的现状和未来。该论文从AI Agent的历史出发&#xff0c;全面梳理了基于大型语言模型的智能代理现状&#xff0c;包括LLM-based Agent的背景…

【lesson48】进程通信之system V(信号量)

文章目录 信号量理解 信号量理解 为了进程通信—>我们需要让不同的进程看到同一份资源---->我们之前讲的所有通信方式&#xff0c;本质都是优先解决一个问题&#xff1a;让不同的进程看到同一份资源。 让不同的进程看到了同一份资源&#xff0c;但是也带来了一些问题&a…

2024年【广东省安全员B证第四批(项目负责人)】考试及广东省安全员B证第四批(项目负责人)考试题

题库来源&#xff1a;安全生产模拟考试一点通公众号小程序 广东省安全员B证第四批&#xff08;项目负责人&#xff09;考试考前必练&#xff01;安全生产模拟考试一点通每个月更新广东省安全员B证第四批&#xff08;项目负责人&#xff09;考试题题目及答案&#xff01;多做几…

零基础学Python(8)— 流程控制语句(上)

前言&#xff1a;Hello大家好&#xff0c;我是小哥谈。流程控制语句是编程语言中用于控制程序执行流程的语句&#xff0c;本节课就带大家认识下Python语言中常见的流程控制语句&#xff01;~&#x1f308; 目录 &#x1f680;1.程序结构 &#x1f680;2.最简单的if语句 &a…

Linux基础I/O(中)——重定向

重定向 根据上一篇的文章我们知道&#xff0c;文件描述符是什么。 0->stdin; 1->stdout; 2->stderr; 如果我们新打开一个文件的话&#xff0c;该文件描述符为3&#xff0c;如下图&#xff1a; &#xff1a;&#xff1a;“ 如果我先close(1),再打开一个文件,根据之前的…