npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

bpmn-painter

v1.0.0

Published

使用vue2.x和element实现bpmn流程设计器

Downloads

105

Readme

bpmn-painter

使用bpmn.jselement-ui实现工作流绘制器。

安装

使用npm进行安装

npm i bpmn-painter

使用yarn进行安装

yarn add bpmn-painter

快速上手

全局引入

main.js中引入:

import Vue from 'vue'
import App from './App.vue'
import ElementUI from 'element-ui'
import BpmnPainter from 'bpmn-painter'
import 'element-ui/lib/theme-chalk/index.css'
import 'bpmn-painter/dist/bpmn-painter.css' // 组件整体样式
import 'bpmn-painter/package/assets/scss/default.scss' // 在用户项目中覆盖组件内的样式

Vue.use(BpmnPainter)
Vue.use(ElementUI)

new Vue({
  el: '#app',
  render: h => h(App)
})

在组件中引入:

<template>
  <bpmn-painter></bpmn-painter>
</template>
<script>
import BpmnPainter from 'bpmn-painter'
import 'bpmn-painter/dist/bpmn-painter.css'
import 'bpmn-painter/package/assets/scss/default.scss'

export default {
  components: { BpmnPainter }
}
</script>

内置shape

组件内默认提供五个paletteshape节点,可以通过一个数据对象进行配置。

<template>
  <bpmn-painter :data="data"></bpmn-painter>
</template>
<script>
export default {
  data() {
    return {
      data: [
        {
          action: 'create.wechat-subscription-official-accounts',
          image: '图片路径',
          title: '订阅微信公众号',
          type: 'bpmn:StartEvent',
          group: 'event'
        },
        {
          action: 'create.automatically-reply-to-subscriber-messages',
          image: '图片路径',
          title: '自动回复订阅用户消息',
          type: 'bpmn:ServiceTask',
          group: 'activity'
        },
        {
          action: 'create.click-to-send-template-message',
          image: '图片路径',
          title: '点击链接回复模板消息',
          type: 'bpmn:ServiceTask',
          group: 'activity'
        },
        {
          action: 'create.click-the-greeting-link',
          image: '图片路径',
          title: '点击问候链接',
          type: 'bpmn:UserTask',
          group: 'activity'
        },
        {
          action: 'create.end-process',
          image: '图片路径',
          title: '结束流程',
          type: 'bpmn:EndEvent',
          group: 'event'
        }
      ]
    } 
  }
}
</script>

配置信息

|字段|说明 |:----|:----| |action|项目中用于关联paletterenderproperies。| |image|图片路径,可以使用网络资源和本地资源。用于在paletterender中显示时使用。| |title|paletteshape组件的标题。| |type|指定该shape节点组件的类型。类型为bpmn官方提供的类型。| |group|分组,允许对paletteshape组件进行分组操作。|

保存获得xml和配置信息

<template>
  <bpmn-painter @save="save"></bpmn-painter>
</template>
<script>
export default {
  methods: {
    save(data) {
      console.log(data)
    }
  }
}
</script>

返回数据信息

|字断|说明 |:----|:----| |xml|绘制完成的xml。| |params|返回所有节点的配置信息。|