Code Monkey home page Code Monkey logo

miyuesc / bpmn-process-designer Goto Github PK

View Code? Open in Web Editor NEW
1.5K 30.0 450.0 13.07 MB

Base on Vue 2.x and ElementUI,基于 Bpmn.js、Vue 2.x 和 ElementUI 的流程编辑器(前端部分),支持监听器,扩展属性,表单等配置,可自由扩展

Home Page: https://miyuesc.github.io/process-designer-v2/

License: Apache License 2.0

JavaScript 70.98% HTML 0.23% Vue 24.57% SCSS 4.22%
vue vuejs bpmn-js bpmn element-ui process elementui demo

bpmn-process-designer's Introduction

Hello ! I'm MiyueFE.

👨🏻‍💻 关于我

  • 2017 年毕业于 重庆邮电大学 网络工程专业
  • 2019 年正式开始从事前端开发工作
  • 我目前居住在重庆, 也希望以后能一直在重庆工作和生活

💬 联系我

Juejin Zhihu Twitter QQmail

🧠 编码状态

Stats Top Langs

🔧 技术栈与工具

Webpack TypeScript Sass Less npm html5 Nodejs Vue
Docker github actions git WebStorm MarkDown

🔓 主要开源项目

🎁 Projects ⭐ Stars 📚 Forks 🛎 Issues
Bpmn Process Designer:Vue 2 + JS 的 Bpmn 绘制工具 GitHub stars Gitee stars GitHub fork Gitee fork Issues
Bpmn Process Designer:Vue 3 + TS 的 Bpmn 绘制工具 GitHub stars Gitee stars GitHub fork Gitee fork Issues
Data visualization:Vue 3 自定义大屏可视化项目 GitHub stars Gitee stars GitHub stars Gitee fork Issues

🔓 其他开源项目

🎁 Projects ⭐ Description 💻 Website
Useful Code:Vue 组件、函数、CSS 动画、开发资源收集 包含简易钉钉流程组件、任务看板、Vue 大屏数据组件、echarts 图表集、常用数据处理函数等内容 https://miyuesc.github.io/useful-code/
Native Juejin App: 掘金非官方小程序 原生微信小程序,主要包含个人数据中心,沸点,文章,已购买小册等 -
Daily Juejin Tea Extension: 每日掘金下午茶辅助扩展程序 读取已打开的掘金文章页面,快速生成下午茶消息和表格信息 -
chibivue-zh: chibivue 中文翻译 日文仓库 chibivue:一步一步开始编写一个 vue.js 的中文翻译仓库 https://miyuesc.github.io/chibivue-zh/
auto-sync-blog: 个人掘金文章统计助手 自动抓取用户所有掘金文章与专栏,按照发布年月、分类、标签生成 vitepress 统计博客 https://miyuesc.github.io/auto-sync-blog/

image-20240117164127927 Bpmn-js 相关工具库

🎁 Projects
⭐ Description ☄ Downloads ✨ License
diagram-js-grid-bg A visual grid backgroud for diagram-js, base on diagram-js-grid.
基于 diagram-js-grid 的 SVG 网格背景,可用于diagram-js的相关项目,例如 bpmn-js、dmn-js 等。
NPM Downloads NPM License
diagram-js-context-pad An element context menu component for diagram-js/bpmn-js use, base on diagram-js/lib/features/context-pad.
一个提供给 diagram-js/bpmn-js 使用的元素上下文菜单组件,基于 diagram-js/lib/features/context-pad
NPM Downloads NPM License
diagram-js-accordion-palette A palette that supports folding and unfolding, provided for diagram-js use。Base on diagram-js/palette
一个支持折叠展开的调色板,提供给 diagram-js 使用。基于 diagram-js 本身的 Palette。
NPM Downloads NPM License
bpmn-js-i18n-zh Chinese internationalization resources for bpmn-js.
关于 bpmn-js-properties-panel 的中文支持。
NPM Downloads NPM License
bpmn-js-external-label-modeling A bpmn-js plugin used to render Label tags outside of nodes.
一个用来将Label标签渲染在节点外部的bpmn-js插件。
NPM Downloads NPM License

image-20240117163833000 闭源项目

🎁 Projects
⭐ Description 💻 Website
vue-bpmn-process-designer 基于 Vue 3 和 Typescript 的 BPMN 流程图编辑器,支持配置条件渲染、Popover 弹窗、自定义面板、多 Modeler 共存、函数式多元素插入等。 https://bpmn.miyuefe.cn

visitors

bpmn-process-designer's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bpmn-process-designer's Issues

请教边界事件之类的扩展问题

大佬好,想咨询个问题,我想扩展下图的一个场景,该怎么扩展呢,跟issues #31 实现不太一样
1648432127(1)
截图来自Camunda Modeler
此节点的XML文件如下:
`<bpmn:boundaryEvent id="Event_1i22ehq" attachedToRef="Activity_1pv2sy7">

  <bpmn:timerEventDefinition id="TimerEventDefinition_0demg1p">

    <bpmn:timeDate xsi:type="bpmn:tFormalExpression">xx</bpmn:timeDate>

  </bpmn:timerEventDefinition>

</bpmn:boundaryEvent>`

我曾尝试通过window.bpmnInstances.moddle.create("bpmn:boundaryEvent") 或者window.bpmnInstances.moddle.create("bpmn:timerEventDefinition")这种方式创建
报错如下图
image

"Error: unknown type <bpmn:boundaryEvent>"

MyPropertiesPanel中使用了window作为全局bpmnInstances的管理欠佳

window.bpmnInstances = {
modeler: this.bpmnModeler,
modeling: this.bpmnModeler.get("modeling"),
moddle: this.bpmnModeler.get("moddle"),
eventBus: this.bpmnModeler.get("eventBus"),
bpmnFactory: this.bpmnModeler.get("bpmnFactory"),
elementFactory: this.bpmnModeler.get("elementFactory"),
elementRegistry: this.bpmnModeler.get("elementRegistry"),
replace: this.bpmnModeler.get("replace"),
selection: this.bpmnModeler.get("selection")
};
——————————————————————————————————————————————————
以上代码是否可用vuex解决,不影响全局状态的话,加上namespace

隐藏label事件github上拉的代码没生效,在线demo上生效

尝试去修改了下,发现改成以下代码也可以隐藏label

code

   changeLabelVisibleStatus(status) {
      this.addis.labelVisible = status ? { paletteProvider: ["value", ""] } : false;
      //this.addis.customRenderer = status ? CustomRenderer : false;
      this.reloadProcessDesigner();
    }

Bpmn.js 常见问题(新问题可在此提出评论)

1. 创建/更新元素属性,或者导出文件时报错 cannot read property 'isGeneric'

输入图片说明

原因:
常见于 Vue 项目。由于更新时 Bpmn 接收的参数类型应该为 ModdleElement 类型,但是在编写组件时将对应的数据保存进了 data() { return { } } 的某个数据中,所以被 vue 进行了响应式处理,更改了原型与属性,导致无法解析。

解决:
data () { } 中使用 _ 或者 $ 符号作为开头,或者不在 data 中进行声明直接对 this 进行赋值,可避免被响应式处理。

2. 导入xml或者创建新标签/属性时报错 Uncaught Error: unknown type xxx:xxx

输入图片说明

原因:
当前选用的表述文件(一个 json 文件, 比如该项目中 package/process-designer/plugins/descriptor/ 下的三个文件)不支持该标签/属性

解决:
根据需要的标签/属性类型,在对应的描述文件类增加对应的标签/属性。具体描述文件格式参见 bpmn 自定义解析文件

3. 更改元素/连线颜色

1. modeler 模式

直接使用 modeling.setColor(els, option) 方法更改元素颜色或者其他属性。

2. viewer 模式

  1. 使用 canvas.addMarker(elId, marker) 为元素添加一个 class 类名,之后为该类添加 css 样式。
  2. 使用 overlays.add(elId, option) 为元素添加一个遮罩层,为遮罩层添加 css 样式。

viewer 模式下的方式在 modeler 模式也可以使用。

重构的v2分支版本,用户任务该怎么添加节点审批用户呢

重构的v2分支版本,用户任务该怎么添加节点审批用户呢
而且用户任务也没有任务监听器,只有执行监听器
如何在用户任务上挂载外部表单呢?
image

如何在事件组件上添加条件,例如定时事件等?
如何在服务任务上添加指定需要执行的服务属性呢?
能出一期操作文档吗?

子流程不能返回

折叠的子流程点击右下角去画子流程,不能回到之前的主流程上

元素的ID属性无法更改

目前看元素以及流程图的定义ID都是自动生成的,且无法更改.
但实际使用场景可能是自定义输入的所以看有没有啥办法更改

选择用户bug

如果用change监听,每次选择用户后下拉框会被关闭,建议改成visible-change监听

MyProcessDesigner作为子组件引用使用时,动态修改其value prop时,PropertiesPenel下的ElementBaseInfo组件属性未及时同步

使用Vue Devtools修改App中ControlForm中的value属性,以使MyProcessDesigner组件重新渲染流程设计器
使用Vue Devtools修改App中ControlForm中的value属性
修改后的渲染结果出现多组件之间状态不一致的情况
修改后的渲染结果出现多组件状态不一致的情况

默认初始化的xml内容
<?xml version="1.0" encoding="UTF-8"?> <bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" id="diagram_Process_1618819111033" targetNamespace="http://bpmn.io/schema/bpmn" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> <bpmn2:process id="Process_1618819111033" name="业务流程_1618819111033" isExecutable="true" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1618819111033" /> </bpmndi:BPMNDiagram> </bpmn2:definitions>

通过Vue Devtool修改后的value值
<?xml version="1.0" encoding="UTF-8"?> <bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" id="diagram_Process_1618819111033" targetNamespace="http://bpmn.io/schema/bpmn" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> <bpmn2:process id="Process_1618819111033" name="修改名称后的业务流程_1618819111033" isExecutable="true" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1618819111033" /> </bpmndi:BPMNDiagram> </bpmn2:definitions>

注意bpmn2:process元素中的name属性,经过调试,发现再次this.bpmnModeler.importXML(xml)后,似乎window.bpmnInstances.bpmnElement
未同步修改为新的对象。

请问<servicetask>的属性怎么添加?

flowable强制要求servicetask必有的几个属性,用这个没法从页面添加。扩展属性不行。比如

<servicetask id="t1" class="cn.Delegate"/>

中的class属性。

Extended attribute loss

Enter the page for the first time, drag a task, change it to "Call task", add an extension property after saving, click the canvas, click the call task again, the extension property that was just added disappeared
As shown in the figure:
GIF 2022-3-8 10-11-21

当选择流程引擎是activiti时,报错unknown type <activiti:FormData>

vue.runtime.esm.js?2b0e:1888

vue.runtime.esm.js?2b0e:619

   [Vue warn]: Error in nextTick: "Error: unknown type <activiti:FormData>"

found in

---> at package/penal/form/ElementForm.vue
at packages/collapse/src/collapse-item.vue
at packages/collapse/src/collapse.vue
at package/penal/PropertiesPanel.vue


——————————————————————————————
Error: unknown type activiti:FormData
at Registry.mapTypes (index.esm.js?8475:518:1)
at Registry.getEffectiveDescriptor (index.esm.js?8475:543:1)
at BpmnModdle.Moddle.getType (index.esm.js?8475:768:1)
at BpmnModdle.Moddle.create (index.esm.js?8475:736:1)
at VueComponent.resetFormList (ElementForm.vue?d075:204:1)
at VueComponent.eval (ElementForm.vue?d075:191:1)
at Array.eval (vue.runtime.esm.js?2b0e:1980:1)
at flushCallbacks (vue.runtime.esm.js?2b0e:1906:1)

——————————————————————————————————

prefix切换问题

请问我把prefix切换成activiti,预览的xml为什么还是flowable版本的?

LogicFlow 正在寻找公司外部 contributor

hi, miyuesc:
我是开源项目 LogicFlow 的运营同学。LogicFlow 是流程可视化的前端框架,其核心是流程图的编辑器。在 github 关注到你正在做的 bpmn-process-designer 项目,不知道你是否对参与开源的流程可视化项目感兴趣,在此我代表 LogicFlow 项目组对你发出诚挚的邀请~
如果感兴趣的话,可以微信(logic-flow)联系我,期待~
因为在 github 上的联系方式添加你为好友失败,请原谅我用 issue 的方式联系你

关于 LogicFlow 更多可以参考
github:https://github.com/didi/LogicFlow
官网:http://logic-flow.org/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.