GithubHelp home page GithubHelp logo

ningsy1017 / bpmn-process-designer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from miyuesc/bpmn-process-designer

0.0 1.0 0.0 1.61 MB

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

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

License: Apache License 2.0

JavaScript 23.06% HTML 0.45% Vue 73.57% SCSS 2.92%

bpmn-process-designer's Introduction

Bpmn Process Designer


针对之前的版本存在的问题,第二版采用了在 window 对象下添加新的命名空间来保存对应的实例对象。

原因是因为 通过 Props 传参会被 vue 进行响应式处理,会更改原对象的原型链指向。

更新后的流程设计器暂时还没有实现表单项的配置,后面会迭代上来。在原来的基础上增加了全局信号与全局消息事件,至于有新的需求的话,欢迎提 issue,或者关注公众号在后台提给我。


A process designer that depends on bpmn.js , Vue 2.x and ElementUI.

一个基于 bpmn.jsVue 2.xElementUI 开发的流程设计器。

You can view and edit BPMN 2.0 diagrams in the browser.

您可以使用它在浏览器上查看和编辑符合 BPMN 2.0 规范的流程文件。

For on line demo, please visit MiyueFE Blog

在线demo请访问 MiyueFE Blog

码云同步镜像请访问 Gitee/MiyueSC Process Designer

如果您对增加其他功能有建议,或者找到了原有功能的不足之处,您可以通过 issue 或者文末的公众号向我反馈,我会在第一时间对问题作出反馈或者更新。

再次感谢您的支持!

1. 安装依赖 Installation

npm install
// or yarn install

2. 运行 Quick Start

npm run demo
// or yarn run demo

3. 文档说明 Documentation

3.1 MyProcessDesigner

3.1.1 Attributes

Attribute Description Type Accepted Values Default
value/v-model 初始化流程对应的 xml 字符串 String - -
translations 翻译文件 Object - zh.js
additionalModel 自定义的附加模块 Object[] / Object - -
moddleExtension 自定义的扩展模块 Object - -
onlyCustomizeAddi 仅使用开发时的自定义附加模块 Boolean - false
onlyCustomizeModdle 仅使用开发时的自定义扩展模块 Boolean - false
prefix 流程引擎对应扩展属性前缀 String camunda, activiti, flowable camunda
events 需要使用的事件列表,可用事件见 Bpmn.js 中文文档 Array - [element.click]
headerButtonSize 头部按钮组的大小 String "default", "medium", "small", "mini" small

3.1.2 Events

Event Name Description Callback Parameters
init-finished 流程实例等初始化完成之后 modeler
change 流程发生可监听的改变时 ( EventBus.on("commandStack.changed")) XMLString
destroy 组件准备销毁时,此时流程实例已经销毁 modeler
BpmnEvents Like element.click, will replace . to - (ex: "element.click" => "element-click" ). If you want to use an event, you must add the event name to the "events" parameter
传入参数 events 对应的事件发生时触发,会将 events 数组内部的事件名称中的 . 替换成 - 来适配 vue 的自定义监听事件。比如 "element.click" 会变成 element-click
element, InternalEventInstance

3.1.3 Methods

Method Name Parameters Description
downloadProcessAsXml name: string = "diagram" 下载文件为 ${name}.xml 格式的文件
downloadProcessAsBpmn name: string = "diagram" 下载文件为 ${name}.bpmn 格式的文件
downloadProcessAsSvg name: string = "diagram" 下载文件为 ${name}.svg 格式的文件
processRedo - 恢复上次操作
processUndo - 撤销本次操作
processZoomIn newZoom: number = 0.1 按照指定倍率缩小视图(小数点后两位)
processZoomOut newZoom: number = 1 按照指定倍率放大视图(小数点后两位)
processZoomTo newZoom: number = 1 缩放视图到指定倍率
processReZoom - 重置缩放倍率并居中显示全部元素
processRestart - 重置所有编辑过程并清空画布
createNewDiagram xml: string 重新导入新的xml字符串

3.2 MyProcessPenal

3.2.1 Attributes

Attribute Description Type Accepted Values Default
bpmn-modeler 初始化生成的 modeler 实例,必须 Object - -
prefix 流程引擎对应扩展属性前缀 String camunda, activiti, flowable camunda
width 侧边栏宽度 Number - 480

4. 运行截图

4.1 初始界面

image-20210422140659561

4.2 监听器

image-20210422140728176

image-20210422140805725

4.3 扩展属性

image-20210422140906725

4.4 流转路径配置

image-20210422140924114

4.5 任务配置

image-20210422141009316

4.6 多实例任务

image-20210422141035638

4.8 表单配置

image-20210422141220571

image-20210422141354311

4.9 预览

image-20210422140939414

5. 功能说明

  1. 工具栏:包含常见操作,比如打开文件、下载文件、预览、对齐方式、缩放管理、撤销删除等
  2. 常规信息:id、名称、扩展属性、元素文档
  3. 特殊节点属性:
    1. 流程全局消息与信号
    2. 执行监听器
    3. 用户任务节点 任务监听器
    4. 表单配置
    5. 任务配置
    6. 多实例任务
    7. 流转条件
  4. 内置常用 camundaflowableactiviti 解析文件
  5. 自定义左侧元素栏 platte 与弹出菜单 contentPad 示例模块
  6. 自定义渲染方法 renderer 模块实例

友情赞助

偷偷丢个赞赏码吧~~~~

微信:如果对您有帮助,您可以请我喝杯咖啡~~

支付宝:如果对您有帮助,您可以请我喝杯咖啡~~

学习交流

如果您觉得这些文章对您有帮助,想和我一起学习,欢迎您关注我的微信订阅号。

订阅号名称:前端小白MiyueFE

订阅号:前端小白MiyueFE

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.