vue+bpmn.js实现自定义流程图

效果图:

使用插件版本:

插件名称版本安装命令

bpmn-js

7.3.1

npm install bpmn-js@^7.3.1 --save-D

bpmn-js-properties-panel

0.37.2

npm install bpmn-js-properties-panel@^0.37.2 --save-D
camunda-bpmn-moddle4.5.0npm install camunda-bpmn-moddle@^4.5.0 --save-D

didi

5.0.0

npm install didi@^5.0.0

组件封装完整代码:

<template>
    <div>
        <!-- 流程图容器 -->
        <div class="container">
            <!-- 创建一个canvas画布 npmn-js是通过canvas实现绘图的,并设置ref让vue获取到element -->
            <div class="bpmn-canvas" ref="canvas"></div>
            <!-- 工具栏显示的地方 -->
            <div class="bpmn-js-properties-panel" id="js-properties-panel"></div>

            <panel v-if="bpmnModeler" :modeler="bpmnModeler" />
            <!-- 把操作按钮写在这里面 -->
            <div class="toolbar">
                <el-button type="primary" size="mini" @click="handleSave()">保存</el-button>
            </div>
        </div>
    </div>
</template>

<script>
// bpmn 相关依赖
import BpmnModeler from "bpmn-js/lib/Modeler";
// 左侧自定义工具栏
import BpmData from "./BpmData";
// 右侧自定义属性面板
import panel from "./PropertyPanel-right.vue";
// BPMN国际化
import customTranslate from '@/util/bpmn/customTranslate';
// 自定义汉化模块
var customTranslateModule = {
    translate: ['value', customTranslate]
}
import CustomPaletteProvider from './bpmn2'
export default {
    name: "basic",
    components: {
        panel
    },
    data(){
        return{
            bpmnModeler: null,
            element: null,
            bpmData: new BpmData(),
        }
    },
    created(){
        
    },
    mounted() {
        const canvas = this.$refs.canvas;
        // 生成实例
        this.bpmnModeler = new BpmnModeler({
            container: canvas,
            // 加入工具栏支持
            propertiesPanel: {
                parent: "#js-properties-panel"
            },
            additionalModules: [
                customTranslateModule,
                {
                    // labelEditingProvider: ["value", ''], //禁用节点编辑
                    // contextPadProvider: ["value", ''], //禁用图形菜单
                    // bendpoints: ["value", {}], //禁用连线拖动
                    zoomScroll: ["value", ''], //禁用滚动
                    // moveCanvas: ['value', ''], //禁用拖动整个流程图
                    // move: ['value', ''], //禁用单个图形拖动
                    paletteProvider: ['type', CustomPaletteProvider], // 左侧工具栏
                }
            ],
            // moddleExtensions: {
            //     camunda: camundaModdleDescriptor
            // }
        });
        // 新增流程定义
        this.createNewDiagram();
    },
    methods:{
        createNewDiagram() {
            const bpmnXmlStr = `
            <?xml version="1.0" encoding="UTF-8"?>
                <bpmn2:definitions xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="sample-diagram" targetNamespace="http://bpmn.io/schema/bpmn" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
                <bpmn2:process id="process1567044459787" name="流程1567044459787">
                    <bpmn2:documentation>描述</bpmn2:documentation>
                    <bpmn2:startEvent id="StartEvent_01ydzqe" name="开始">
                    <bpmn2:outgoing>SequenceFlow_1qw929z</bpmn2:outgoing>
                    </bpmn2:startEvent>
                    <bpmn2:sequenceFlow id="SequenceFlow_1qw929z" sourceRef="StartEvent_01ydzqe" targetRef="Task_1piqdk6" />
                    <bpmn2:userTask id="Task_1piqdk6" name="请假申请">
                    <bpmn2:incoming>SequenceFlow_1qw929z</bpmn2:incoming>
                    <bpmn2:outgoing>SequenceFlow_11h4o22</bpmn2:outgoing>
                    </bpmn2:userTask>
                    <bpmn2:exclusiveGateway id="ExclusiveGateway_0k39v3u">
                    <bpmn2:incoming>SequenceFlow_11h4o22</bpmn2:incoming>
                    <bpmn2:outgoing>SequenceFlow_1iu7pfe</bpmn2:outgoing>
                    <bpmn2:outgoing>SequenceFlow_04uqww2</bpmn2:outgoing>
                    </bpmn2:exclusiveGateway>
                    <bpmn2:sequenceFlow id="SequenceFlow_11h4o22" sourceRef="Task_1piqdk6" targetRef="ExclusiveGateway_0k39v3u" />
                    <bpmn2:sequenceFlow id="SequenceFlow_1iu7pfe" sourceRef="ExclusiveGateway_0k39v3u" targetRef="Task_10fqcwp" />
                    <bpmn2:userTask id="Task_10fqcwp" name="经理审批">
                    <bpmn2:incoming>SequenceFlow_1iu7pfe</bpmn2:incoming>
                    <bpmn2:outgoing>SequenceFlow_1xod8nh</bpmn2:outgoing>
                    </bpmn2:userTask>
                    <bpmn2:sequenceFlow id="SequenceFlow_04uqww2" sourceRef="ExclusiveGateway_0k39v3u" targetRef="Task_15n23yh" />
                    <bpmn2:userTask id="Task_15n23yh" name="总部审批">
                    <bpmn2:incoming>SequenceFlow_04uqww2</bpmn2:incoming>
                    <bpmn2:outgoing>SequenceFlow_0c8wrs4</bpmn2:outgoing>
                    </bpmn2:userTask>
                    <bpmn2:exclusiveGateway id="ExclusiveGateway_1sq33g6">
                    <bpmn2:incoming>SequenceFlow_0c8wrs4</bpmn2:incoming>
                    <bpmn2:incoming>SequenceFlow_1xod8nh</bpmn2:incoming>
                    <bpmn2:outgoing>SequenceFlow_0h8za82</bpmn2:outgoing>
                    </bpmn2:exclusiveGateway>
                    <bpmn2:sequenceFlow id="SequenceFlow_0c8wrs4" sourceRef="Task_15n23yh" targetRef="ExclusiveGateway_1sq33g6" />
                    <bpmn2:sequenceFlow id="SequenceFlow_1xod8nh" sourceRef="Task_10fqcwp" targetRef="ExclusiveGateway_1sq33g6" />
                    <bpmn2:endEvent id="EndEvent_0pnmjd3">
                    <bpmn2:incoming>SequenceFlow_0h8za82</bpmn2:incoming>
                    </bpmn2:endEvent>
                    <bpmn2:sequenceFlow id="SequenceFlow_0h8za82" sourceRef="ExclusiveGateway_1sq33g6" targetRef="EndEvent_0pnmjd3" />
                </bpmn2:process>
                <bpmndi:BPMNDiagram id="BPMNDiagram_1">
                    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="process1567044459787">
                    <bpmndi:BPMNShape id="StartEvent_01ydzqe_di" bpmnElement="StartEvent_01ydzqe">
                        <dc:Bounds x="532" y="72" width="36" height="36" />
                        <bpmndi:BPMNLabel>
                        <dc:Bounds x="539" y="53" width="22" height="14" />
                        </bpmndi:BPMNLabel>
                    </bpmndi:BPMNShape>
                    <bpmndi:BPMNEdge id="SequenceFlow_1qw929z_di" bpmnElement="SequenceFlow_1qw929z">
                        <di:waypoint x="550" y="108" />
                        <di:waypoint x="550" y="150" />
                    </bpmndi:BPMNEdge>
                    <bpmndi:BPMNShape id="UserTask_1qxjy46_di" bpmnElement="Task_1piqdk6">
                        <dc:Bounds x="500" y="150" width="100" height="80" />
                    </bpmndi:BPMNShape>
                    <bpmndi:BPMNShape id="ExclusiveGateway_0k39v3u_di" bpmnElement="ExclusiveGateway_0k39v3u" isMarkerVisible="true">
                        <dc:Bounds x="525" y="275" width="50" height="50" />
                    </bpmndi:BPMNShape>
                    <bpmndi:BPMNEdge id="SequenceFlow_11h4o22_di" bpmnElement="SequenceFlow_11h4o22">
                        <di:waypoint x="550" y="230" />
                        <di:waypoint x="550" y="275" />
                    </bpmndi:BPMNEdge>
                    <bpmndi:BPMNEdge id="SequenceFlow_1iu7pfe_di" bpmnElement="SequenceFlow_1iu7pfe">
                        <di:waypoint x="575" y="300" />
                        <di:waypoint x="680" y="300" />
                        <di:waypoint x="680" y="380" />
                    </bpmndi:BPMNEdge>
                    <bpmndi:BPMNShape id="UserTask_18pwui1_di" bpmnElement="Task_10fqcwp">
                        <dc:Bounds x="630" y="380" width="100" height="80" />
                    </bpmndi:BPMNShape>
                    <bpmndi:BPMNEdge id="SequenceFlow_04uqww2_di" bpmnElement="SequenceFlow_04uqww2">
                        <di:waypoint x="525" y="300" />
                        <di:waypoint x="430" y="300" />
                        <di:waypoint x="430" y="380" />
                    </bpmndi:BPMNEdge>
                    <bpmndi:BPMNShape id="UserTask_1j0us24_di" bpmnElement="Task_15n23yh">
                        <dc:Bounds x="380" y="380" width="100" height="80" />
                    </bpmndi:BPMNShape>
                    <bpmndi:BPMNShape id="ExclusiveGateway_1sq33g6_di" bpmnElement="ExclusiveGateway_1sq33g6" isMarkerVisible="true">
                        <dc:Bounds x="525" y="515" width="50" height="50" />
                    </bpmndi:BPMNShape>
                    <bpmndi:BPMNEdge id="SequenceFlow_0c8wrs4_di" bpmnElement="SequenceFlow_0c8wrs4">
                        <di:waypoint x="430" y="460" />
                        <di:waypoint x="430" y="540" />
                        <di:waypoint x="525" y="540" />
                    </bpmndi:BPMNEdge>
                    <bpmndi:BPMNEdge id="SequenceFlow_1xod8nh_di" bpmnElement="SequenceFlow_1xod8nh">
                        <di:waypoint x="680" y="460" />
                        <di:waypoint x="680" y="540" />
                        <di:waypoint x="575" y="540" />
                    </bpmndi:BPMNEdge>
                    <bpmndi:BPMNShape id="EndEvent_0pnmjd3_di" bpmnElement="EndEvent_0pnmjd3">
                        <dc:Bounds x="532" y="602" width="36" height="36" />
                    </bpmndi:BPMNShape>
                    <bpmndi:BPMNEdge id="SequenceFlow_0h8za82_di" bpmnElement="SequenceFlow_0h8za82">
                        <di:waypoint x="550" y="565" />
                        <di:waypoint x="550" y="602" />
                    </bpmndi:BPMNEdge>
                    </bpmndi:BPMNPlane>
                </bpmndi:BPMNDiagram>
                </bpmn2:definitions>
            `;
            // 将字符串转换成图显示出来
            this.bpmnModeler.importXML(bpmnXmlStr, err => {
                if (err) {
                    console.error(err);
                } else {
                    this.adjustPalette();
                }
            });
        },
        // 调整左侧工具栏排版
        adjustPalette() {
            try {
                // 获取 bpmn 设计器实例
                const canvas = this.$refs.canvas;
                const djsPalette = canvas.children[0].children[1].children[4];
                const djsPalStyle = {
                    width: "130px",
                    padding: "5px",
                    background: "white",
                    left: "20px",
                    borderRadius: 0
                };
                for (var key in djsPalStyle) {
                    djsPalette.style[key] = djsPalStyle[key];
                }
                const palette = djsPalette.children[0];
                const allGroups = palette.children;
                allGroups[0].style["display"] = "none";
                // 修改控件样式
                for (var gKey in allGroups) {
                    const group = allGroups[gKey];
                    for (var cKey in group.children) {
                        const control = group.children[cKey];
                        const controlStyle = {
                            display: "flex",
                            justifyContent: "flex-start",
                            alignItems: "center",
                            width: "100%",
                            padding: "5px"
                        };
                        if (control.className && control.dataset && control.className.indexOf("entry") !== -1) {
                            const controlProps = this.bpmData.getControl(control.dataset.action);
                            control.innerHTML = `<div style='font-size: 14px;font-weight:500;margin-left:15px;'>${
                                controlProps["title"]
                            }</div>`;
                            for (var csKey in controlStyle) {
                                control.style[csKey] = controlStyle[csKey];
                            }
                        }
                    }
                }
            } catch (e) {
                console.log(e);
            }
        },
        // 保存流程图
        handleSave(){
            // console.log(this.bpmnTemplate, "模板");
            this.bpmnModeler.saveXML({ format: true }, (err, xml) => {
                if (!err) {
                    console.log(xml);
                }
            });
        },
    },
}
</script>

<style lang="scss" scoped>
/*左边工具栏以及编辑节点的样式*/
@import "~bpmn-js/dist/assets/diagram-js.css";
@import "~bpmn-js/dist/assets/bpmn-font/css/bpmn.css";
@import "~bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css";
@import "~bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css";
.container {
    position: absolute;
    background-color: #ffffff;
    width: 97%;
    height: 570px;
    .bpmn-canvas {
        width: 100%;
        height: 570px;
    }
    .panel {
        position: absolute;
        right: 0;
        top: 50px;
        width: 300px;
    }
    .bjs-powered-by {
        display: none;
    }
    .toolbar {
        position: absolute;
        top: 20px;
        right: 350px;
        a {
        text-decoration: none;
        margin: 5px;
        color: #409eff;
        }
    }
}
</style>

新建 bpmnData.js 文件设置左侧图形工具:

/**PaletteProvider
 * 存储流程设计相关参数
 */

export default class BpmData {
    constructor () {
        this.controls = [] // 设计器控件
        this.init()
    }
    init () {
        this.controls = [
            { action: 'create.start-event', title: '开始' },
            { action: 'create.intermediate-event', title: '中间' },
            { action: 'create.end-event', title: '结束' },
            { action: 'create.exclusive-gateway', title: '条件' },
            { action: 'create.task', title: '任务' },
            { action: 'create.user-task', title: '用户任务' },
            { action: 'create.user-sign-task', title: '会签任务' },
            { action: 'create.subprocess-expanded', title: '子流程' },
            { action: 'create.data-object', title: '数据对象' },
            { action: 'create.data-store', title: '数据存储' },
            { action: 'create.participant-expanded', title: '扩展流程' },
            { action: 'create.group', title: '分组' }
        ]
    }
    // 获取控件配置信息
    getControl (action) {
        const result = this.controls.filter(item => item.action === action)
        return result[0] || {}
    }
}


新建 bpmn2.js 隐藏部分左侧不需要的工具图形:

import PaletteProvider from 'bpmn-js/lib/features/palette/PaletteProvider';

// 隐藏左侧工具栏部分的图形
export default class CustomPaletteProvider extends PaletteProvider {
  constructor(palette, create, elementFactory, spaceTool, lassoTool, handTool, globalConnect, translate) {
    super(palette, create, elementFactory, spaceTool, lassoTool, handTool, globalConnect, translate);
  }
  getPaletteEntries(element) {
    const entries = super.getPaletteEntries(element);
    // 隐藏指定类型的元素
    delete entries['create.intermediate-event']; // 中间
    delete entries['create.user-task']; // 用户任务
    delete entries['create.user-sign-task']; // 会签任务
    delete entries['create.subprocess-expanded'];// 子流程
    delete entries['create.data-object'];// 数据对象
    delete entries['create.data-store'];// 数据存储
    delete entries['create.participant-expanded'];// 扩展流程
    delete entries['create.group'];// 分组
    
    return entries;
  }
}

新建 PropertyPanel-right.vue 文件自定义右侧节点表单:

<template>
<div class="property-panel" ref="propertyPanel">
    <el-form :inline="true" :model="form" label-width="100px" size="small">
        <!-- <el-form-item label="节点ID">
            <el-input v-model="form.id" disabled></el-input>
        </el-form-item> -->
        <el-form-item label="节点名称">
            <el-input v-model="form.name" @input="nameChange" disabled style="width: 180px;"></el-input>
        </el-form-item>
        <el-form-item label="节点颜色">
            <el-color-picker v-model="form.color" @active-change="colorChange"></el-color-picker>
        </el-form-item>
        <!-- 任务节点允许选择人员 -->
        <el-form-item label="节点人员" v-if="userTask">
            <el-select v-model="form.userType" placeholder="请选择" @change="typeChange" style="width: 180px;">
                <el-option value="assignee" label="指定人员"></el-option>
                <el-option value="candidateUsers" label="候选人员"></el-option>
                <el-option value="candidateGroups" label="角色/岗位"></el-option>
            </el-select>
        </el-form-item>
        <!-- 指定人员 -->
        <el-form-item label="指定人员" v-if="userTask && form.userType === 'assignee'">
            <el-select v-model="form.assignee" placeholder="请选择" key="1" @change="(value) => addUser({assignee: value})">
            <el-option
                v-for="item in users"
                :key="item.value"
                :label="item.label"
                :value="item.value"
            ></el-option>
            </el-select>
        </el-form-item>
        <!-- 候选人员 -->
        <el-form-item label="候选人员" v-else-if="userTask && form.userType === 'candidateUsers'">
            <el-select v-model="form.candidateUsers" placeholder="请选择" key="2" multiple
            @change="(value) => addUser({candidateUsers: value.join(',') || value})">
            <el-option
                v-for="item in users"
                :key="item.value"
                :label="item.label"
                :value="item.value"
            ></el-option>
            </el-select>
        </el-form-item>
        <!-- 角色/岗位 -->
        <el-form-item label="角色/岗位" v-else-if="userTask && form.userType === 'candidateGroups'">
            <el-select v-model="form.candidateGroups" placeholder="请选择"
            @change="(value) => addUser({candidateGroups: value})">
            <el-option
                v-for="item in roles"
                :key="item.value"
                :label="item.label"
                :value="item.value"
            ></el-option>
            </el-select>
        </el-form-item>
        <!-- 分支允许添加条件 -->
        <el-form-item label="分支条件" v-if="sequenceFlow">
            <el-select v-model="form.user" placeholder="请选择">
            <el-option
                v-for="item in users"
                :key="item.value"
                :label="item.label"
                :value="item.value"
            ></el-option>
            </el-select>
        </el-form-item>
    </el-form>
</div>
</template>

<script>
export default {
name: "PropertyPanel",
props: {
    modeler: {
    type: Object,
    required: true
    }
},
computed: {
    userTask() {
    if (!this.element) {
        return;
    }
    return this.element.type === "bpmn:UserTask";
    },
    sequenceFlow() {
    if (!this.element) {
        return;
    }
    return this.element.type === "bpmn:SequenceFlow";
    }
},
data() {
    return {
    form: {
        id: "",
        name: "",
        color: null
    },
    element: {},
    users: [
        { value: "zhangsan", label: "张三" },
        { value: "lisi", label: "李四" },
        { value: "wangwu", label: "王五" }
    ],
    roles: [
        { value: "manager", label: "经理" },
        { value: "personnel", label: "人事" },
        { value: "charge", label: "主管" }
    ]
    };
},
mounted() {
    this.handleModeler();
},
methods: {
    handleModeler() {
    // 监听节点选择变化
    this.modeler.on("selection.changed", e => {
        const element = e.newSelection[0];
        this.element = element;
        console.log(this.element,'节点选择变化');
        if (!element) return;
        this.form = {
        ...element.businessObject,
        ...element.businessObject.$attrs
        };
        if (this.form.userType === "candidateUsers") {
        this.form["candidateUsers"] =
            this.form["candidateUsers"].split(",") || [];
        }
    });

    //  监听节点属性变化
    this.modeler.on("element.changed", e => {
        const { element } = e;
        if (!element) return;
        //  新增节点需要更新回属性面板
        if (element.id === this.form.id) {
        this.form.name = element.businessObject.name;
        this.form = { ...this.form };
        }
    });
    },
    // 属性面板名称,更新回流程节点
    nameChange(name) {
    const modeling = this.modeler.get("modeling");
    modeling.updateLabel(this.element, name);
    },
    // 属性面板颜色,更新回流程节点
    colorChange(color) {
    const modeling = this.modeler.get("modeling");
    modeling.setColor(this.element, {
        fill: null,
        stroke: color
    });
    modeling.updateProperties(this.element, { color: color });
    },
    // 任务节点配置人员
    addUser(properties) {
    this.updateProperties(
        Object.assign(properties, {
        userType: Object.keys(properties)[0]
        })
    );
    },
    // 切换人员类型
    typeChange() {
    const types = ["assignee", "candidateUsers", "candidateGroups"];
    types.forEach(type => {
        delete this.element.businessObject.$attrs[type];
        delete this.form[type];
    });
    },
    // 在这里我们封装一个通用的更新节点属性的方法
    updateProperties(properties) {
    const modeling = this.modeler.get("modeling");
    modeling.updateProperties(this.element, properties);
    }
}
};
</script>

<style lang="scss" scoped>
.property-panel {
position: absolute;
right: 0px;
top: 0px;
border-left: 1px solid #cccccc;
padding: 20px 0;
width: 300px;
height: 100%;
}
</style>

util 文件夹下新建 customTranslate.js 文件,进行流程图语言汉化:

import translations from './language-zh';
export default function customTranslate(template, replacements) {
    replacements = replacements || {};
    // Translate
    template = translations[template] || template;
    // Replace
    return template.replace(/{([^}]+)}/g, function(_, key) {
        return replacements[key] || '{' + key + '}';
    });
}

util 文件夹下新建 language-zh.js 文件,存放汉化语言包:

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':'完成条件'
};

最后页面引入即可使用:

<template>
    <div>
        <Bpmn></Bpmn>
    </div>
</template>

import Bpmn from './components/bpmn.vue'

export default {
    components: {
        Bpmn
    },
}

至此完成!!!

测试有效!!!感谢支持!!!

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

HCIA ——VLAN实验

一 、 实验需求 1.PC1和PC3所在接口为access接口&#xff1b;属于vlan 2 PC2-4-5-6处于同一网段&#xff1b;其中PC2可以访问PC4-5-6 PC4可以访问PC5不能访问PC6 PC5不能访问PC6 3.PC1-PC3与PC2-4-5-6不在同一个网段 4.所有PC均使用DHCP获取IP地址&#xff0c;且PC1可以正常访问…

使用ES检索PDF等文档的全栈方案之前端demo(end)

写在前面 通过之前的系列文章&#xff0c;整个ES搜索文件的流程与大的问题已经统统扫除了&#xff0c;既然是全栈流程&#xff0c;是不能缺少前端查询页面的&#xff0c;前端需简单实现一个用户输入查询关键词句&#xff0c;发起搜索&#xff0c;页面以表格形式展示查询的结果…

展览展示模型贴图都是怎么做的---模大狮模型网

展览展示模型的贴图制作通常涉及到以下几个步骤&#xff1a; 准备模型&#xff1a;首先确保展览展示模型的几何结构完整且符合设计要求。 UV展开&#xff1a;在3D建模软件中对模型进行UV展开&#xff0c;即将模型表面的各部分映射到二维平面上&#xff0c;以便后续贴图。 选择…

Node.js常用命令:了解Node.js的核心命令和用法

学习目标&#xff1a; 理解Node.js和npm的概念及其在开发中的作用&#xff1b;掌握Node.js的核心命令&#xff0c;包括node、npm、npx等&#xff1b;学会使用node命令来执行JavaScript文件和模块&#xff1b;熟悉npm命令&#xff0c;包括安装、更新、卸载依赖包等操作&#xf…

LeetCode每日一题——删除有序数组中的重复项

删除有序数组中的重复项OJ链接&#xff1a;26. 删除有序数组中的重复项 - 力扣&#xff08;LeetCode&#xff09; 题目&#xff1a; 思路&#xff1a; 题目要求每个数只能出现一次&#xff0c;然后返回新数组的长度。仔细一看&#xff0c;其实与我们之前的移除元素那道题十分…

政安晨:【使用 TensorFlow 和 Keras 为结构化数据构建和训练神经网络】(一)—— 单个神经元

政安晨的个人主页&#xff1a;政安晨 欢迎 &#x1f44d;点赞✍评论⭐收藏 收录专栏: 政安晨的机器学习笔记 希望政安晨的博客能够对您有所裨益&#xff0c;如有不足之处&#xff0c;欢迎在评论区提出指正&#xff01; 咱们在这篇文章中将了解与练习深度学习的构建模块--线性单…

云手机在海外电商中的应用优势

随着海外市场的不断拓展&#xff0c;电商行业对于高效、安全的工具需求日益增长。在这一背景下&#xff0c;云手机作为一种新型服务&#xff0c;为海外电商提供了强大的支持和便利。云手机对传统物理手机起到了非常好的延展和补充作用&#xff0c;拓展了更广泛的应用场景&#…

海外社交营销为什么用云手机?不用普通手机?

海外社交营销作为企业拓展海外市场的重要手段&#xff0c;正日益受到企业的青睐。云手机以其成本效益和全球性特征&#xff0c;成为海外社交营销领域的得力助手。那么&#xff0c;究竟是什么特性使得越来越多的企业选择利用云手机进行海外社交营销呢&#xff1f;下文将对此进行…

js检测数据类型方式(typeof instanceof Object.prototype.toString.call())

typeof 使用 typeof 检测数据类型&#xff0c;首先返回的都是一个字符串&#xff0c;其次字符串中包含了对应的数据类型&#xff1b; 缺点&#xff1a; typeof null "object"不能具体细分是数组、正则还是对象中其他值&#xff0c;使用 typeof 检测数据类型对于对…

图论02-并查集的实现(Java)

2.并查集理论基础 并查集的作用 将两个元素添加到一个集合中。 判断两个元素在不在同一个集合并查集的实现 1.DSU 类定义&#xff1a;DSU 类中包含一个整型数组 s 用来存储元素的父节点信息。2.DSU 构造函数&#xff1a; 构造函数 DSU(int size) 接受一个参数 size&#xff0…

简述JVM

文章目录 什么是JVMJVM的功能解释和运行内存管理即时编译 常见的JVM字节码文件的组成基本信息常量池字段方法属性 JVM的组成类加载器定义分类类加载器的双亲委派机制类的生命周期 运行时数据区域&#xff08;JVM管理的内存&#xff09;执行引擎&#xff08;主要介绍垃圾回收器&…

百度交易中台之系统对账篇

作者 | 天空 导读 introduction 百度交易中台作为集团移动生态战略的基础设施&#xff0c;面向收银交易与清分结算场景&#xff0c;赋能业务、提供高效交易生态搭建。目前支持百度体系内多个产品线&#xff0c;主要包括&#xff1a;度小店、小程序、地图打车、文心一言等。本文…

webpack中常见的Loader?解决了什么问题?

一、是什么 loader 用于对模块的"源代码"进行转换&#xff0c;在 import 或"加载"模块时预处理文件 webpack做的事情&#xff0c;仅仅是分析出各种模块的依赖关系&#xff0c;然后形成资源列表&#xff0c;最终打包生成到指定的文件中。如下图所示&#…

MFC界面美化第四篇----自绘list列表(重绘列表)

1.前言 最近发现读者对我的mfc美化的专栏比较感兴趣&#xff0c;因此在这里进行续写&#xff0c;这里我会计划写几个连续的篇章&#xff0c;包括对MFC按钮的美化&#xff0c;菜单栏的美化&#xff0c;标题栏的美化&#xff0c;list列表的美化&#xff0c;直到最后形成一个完整…

R语言:ggplot2做柱状图,随机生成颜色。

#加载包 > library(ggplot2) > library(tidyverse) > library(openxlsx) > library(reshape2) > library(RColorBrewer) > library(randomcoloR) > library(viridis) > set.seed(1233) #设立种子数。 > palette <- distinctColorPalette(30) …

Weblogic 弱口令 后台getshell漏洞 SSRF漏洞复现 SSRF漏洞绕过IP限制 任意文件上传漏洞复现(附源码)

Weblogic 弱口令 && 后台getshell漏洞 && SSRF漏洞复现 && SSRF漏洞绕过IP限制 && 任意文件上传漏洞复现(附源码)。 利用docker环境模拟了一个真实的weblogic环境,其后台存在一个弱口令,并且前台存在任意文件读取漏洞。 分别通过这两种漏…

Elasticsearch 悬挂索引解析与管理指南

在 Elasticsearch 的实战中&#xff0c;悬挂索引是一个既常见又容易引起困扰的概念。 今天&#xff0c;我将分享一次处理集群状态为RED&#xff0c;原因为DANGLING_INDEX_IMPORTED 的实战经验&#xff0c;深入探讨悬挂索引的定义、产生原因、管理方法&#xff0c;以及如何有效处…

【JVM】如何判断堆上的对象没有被引用?

如何判断堆上的对象没有被引用&#xff1f; 常见的有两种判断方法&#xff1a;引用计数法和可达性分析法。 引用计数法会为每个对象维护一个引用计数器&#xff0c;当对象被引用时加1&#xff0c;取消引用时减1。 引用计数法的缺点-循环引用 引用计数法的优点是实现简单&…

IText5填充PDF表单使用自定义字体中文生效而英文和数字不生效?

为什么使用IText5填充PDF时&#xff0c;使用自定义字体&#xff08;特别是某些新兴的字体&#xff09;时中文生效&#xff0c;英文和数字不生效&#xff1f; 查了相关资料&#xff0c;发现无果&#xff0c;或者都不生效。 看了api接口文档&#xff0c;发现有解决方案&#xf…

pytest ui自动化

chromedriver.exe 要对应已安装的chrome版本号