ruoyi-nbcio-plus基于vue3的flowable流程元素选择区面板的升级修改

本文主要是介绍ruoyi-nbcio-plus基于vue3的flowable流程元素选择区面板的升级修改,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

更多ruoyi-nbcio功能请看演示系统

gitee源代码地址

前后端代码: https://gitee.com/nbacheng/ruoyi-nbcio

演示地址:RuoYi-Nbcio后台管理系统 http://122.227.135.243:9666/

更多nbcio-boot功能请看演示系统 

gitee源代码地址

后端代码: https://gitee.com/nbacheng/nbcio-boot

前端代码:https://gitee.com/nbacheng/nbcio-vue.git

在线演示(包括H5) : http://122.227.135.243:9888

1、流程面板ProcessPalette.vue的原有vue2代码如下:

<template><div class="my-process-palette"><p>简易palette</p><el-collapse><el-collapse-item title="任务" name="1"><!--  可以简化。。。 --><div class="custom-button" @click="createElement($event, 'Task')" @mousedown="createElement($event, 'Task')">任务</div><div class="custom-button" @click="createElement($event, 'UserTask')" @mousedown="createElement($event, 'UserTask')">用户任务</div><div class="custom-button" @click="createElement($event, 'SendTask')" @mousedown="createElement($event, 'SendTask')">发送任务</div><div class="custom-button" @click="createElement($event, 'ReceiveTask')" @mousedown="createElement($event, 'ReceiveTask')">接收任务</div><div class="custom-button" @click="createElement($event, 'ScriptTask')" @mousedown="createElement($event, 'ScriptTask')">脚本任务</div><div class="custom-button" @click="createElement($event, 'ServiceTask')" @mousedown="createElement($event, 'ServiceTask')">服务任务</div></el-collapse-item><el-collapse-item title="网关" name="2"><div class="custom-button" @click="createElement($event, 'Gateway')" @mousedown="createElement($event, 'Gateway')">网关</div></el-collapse-item><el-collapse-item title="开始" name="3"><div class="custom-button" @click="createElement($event, 'StartEvent')" @mousedown="createElement($event, 'StartEvent')">开始</div></el-collapse-item><el-collapse-item title="结束" name="4"><div class="custom-button" @click="createElement($event, 'EndEvent')" @mousedown="createElement($event, 'EndEvent')">结束</div></el-collapse-item><el-collapse-item title="工具" name="5"><div class="custom-button" @click="startTool($event, 'handTool')" @mousedown="startTool($event, 'handTool')">手型工具</div><div class="custom-button" @click="startTool($event, 'lassoTool')" @mousedown="startTool($event, 'lassoTool')">框选工具</div><div class="custom-button" @click="startTool($event, 'connectTool')" @mousedown="startTool($event, 'connectTool')">连线工具</div></el-collapse-item></el-collapse></div>
</template><script>
import { assign } from 'min-dash';export default {name: 'MyProcessPalette',data() {return {};},mounted() {},methods: {createElement(event, type, options = {}) {const ElementFactory = window.bpmnInstances.elementFactory;const create = window.bpmnInstances.modeler.get('create');const shape = ElementFactory.createShape(assign({ type: `bpmn:${type}` }, options));if (options) {shape.businessObject.di.isExpanded = options.isExpanded;}create.start(event, shape);},startTool(event, type) {if (type === 'handTool') {window.bpmnInstances.modeler.get('handTool').activateHand(event);}if (type === 'lassoTool') {window.bpmnInstances.modeler.get('lassoTool').activateSelection(event);}if (type === 'connectTool') {window.bpmnInstances.modeler.get('globalConnect').toggle(event);}}}
};
</script><style scoped lang="scss">
.my-process-palette {box-sizing: border-box;padding: 8px;.custom-button {box-sizing: border-box;padding: 4px 8px;border-radius: 4px;border: 1px solid rgba(24, 144, 255, 0.8);cursor: pointer;margin-bottom: 8px;&:first-child {margin-top: 8px;}}
}
</style>

2、修改后的vue3代码如下:
 

<template><div class="my-process-palette"><p>简易palette</p><el-collapse><el-collapse-item title="任务" name="1"><!--  可以简化。。。 --><div class="custom-button" @click="createElement($event, 'Task')" @mousedown="createElement($event, 'Task')">任务</div><div class="custom-button" @click="createElement($event, 'UserTask')" @mousedown="createElement($event, 'UserTask')">用户任务</div><div class="custom-button" @click="createElement($event, 'SendTask')" @mousedown="createElement($event, 'SendTask')">发送任务</div><div class="custom-button" @click="createElement($event, 'ReceiveTask')" @mousedown="createElement($event, 'ReceiveTask')">接收任务</div><div class="custom-button" @click="createElement($event, 'ScriptTask')" @mousedown="createElement($event, 'ScriptTask')">脚本任务</div><div class="custom-button" @click="createElement($event, 'ServiceTask')" @mousedown="createElement($event, 'ServiceTask')">服务任务</div></el-collapse-item><el-collapse-item title="网关" name="2"><div class="custom-button" @click="createElement($event, 'Gateway')" @mousedown="createElement($event, 'Gateway')">网关</div></el-collapse-item><el-collapse-item title="开始" name="3"><div class="custom-button" @click="createElement($event, 'StartEvent')" @mousedown="createElement($event, 'StartEvent')">开始</div></el-collapse-item><el-collapse-item title="结束" name="4"><div class="custom-button" @click="createElement($event, 'EndEvent')" @mousedown="createElement($event, 'EndEvent')">结束</div></el-collapse-item><el-collapse-item title="工具" name="5"><div class="custom-button" @click="startTool($event, 'handTool')" @mousedown="startTool($event, 'handTool')">手型工具</div><div class="custom-button" @click="startTool($event, 'lassoTool')" @mousedown="startTool($event, 'lassoTool')">框选工具</div><div class="custom-button" @click="startTool($event, 'connectTool')" @mousedown="startTool($event, 'connectTool')">连线工具</div></el-collapse-item></el-collapse></div>
</template><script lang="ts" setup>import { assign } from 'min-dash';defineOptions({ name: 'MyProcessPalette' })const bpmnInstances = () => (window as any)?.bpmnInstancesconst createElement = (event, type, options = {}) => {const ElementFactory = bpmnInstances().elementFactory;const create = bpmnInstances().modeler.get('create');const shape = ElementFactory.createShape(assign({ type: `bpmn:${type}` }, options));if (options) {shape.businessObject.di.isExpanded = options.isExpanded;}create.start(event, shape);}const startTool = (event, type) => {if (type === 'handTool') {bpmnInstances().modeler.get('handTool').activateHand(event);}if (type === 'lassoTool') {bpmnInstances().modeler.get('lassoTool').activateSelection(event);}if (type === 'connectTool') {bpmnInstances().modeler.get('globalConnect').toggle(event);}}
</script><style scoped lang="scss">
.my-process-palette {box-sizing: border-box;padding: 8px;.custom-button {box-sizing: border-box;padding: 4px 8px;border-radius: 4px;border: 1px solid rgba(24, 144, 255, 0.8);cursor: pointer;margin-bottom: 8px;&:first-child {margin-top: 8px;}}
}
</style>

3、界面,不过这个目前去掉了,没有再用

这篇关于ruoyi-nbcio-plus基于vue3的flowable流程元素选择区面板的升级修改的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/877356

相关文章

CSS place-items: center解析与用法详解

《CSSplace-items:center解析与用法详解》place-items:center;是一个强大的CSS简写属性,用于同时控制网格(Grid)和弹性盒(Flexbox)... place-items: center; 是一个强大的 css 简写属性,用于同时控制 网格(Grid) 和 弹性盒(F

CSS实现元素撑满剩余空间的五种方法

《CSS实现元素撑满剩余空间的五种方法》在日常开发中,我们经常需要让某个元素占据容器的剩余空间,本文将介绍5种不同的方法来实现这个需求,并分析各种方法的优缺点,感兴趣的朋友一起看看吧... css实现元素撑满剩余空间的5种方法 在日常开发中,我们经常需要让某个元素占据容器的剩余空间。这是一个常见的布局需求

CSS Anchor Positioning重新定义锚点定位的时代来临(最新推荐)

《CSSAnchorPositioning重新定义锚点定位的时代来临(最新推荐)》CSSAnchorPositioning是一项仍在草案中的新特性,由Chrome125开始提供原生支持需... 目录 css Anchor Positioning:重新定义「锚定定位」的时代来了! 什么是 Anchor Pos

CSS中的Static、Relative、Absolute、Fixed、Sticky的应用与详细对比

《CSS中的Static、Relative、Absolute、Fixed、Sticky的应用与详细对比》CSS中的position属性用于控制元素的定位方式,不同的定位方式会影响元素在页面中的布... css 中的 position 属性用于控制元素的定位方式,不同的定位方式会影响元素在页面中的布局和层叠关

HTML5 getUserMedia API网页录音实现指南示例小结

《HTML5getUserMediaAPI网页录音实现指南示例小结》本教程将指导你如何利用这一API,结合WebAudioAPI,实现网页录音功能,从获取音频流到处理和保存录音,整个过程将逐步... 目录1. html5 getUserMedia API简介1.1 API概念与历史1.2 功能与优势1.3

SpringBoot整合Flowable实现工作流的详细流程

《SpringBoot整合Flowable实现工作流的详细流程》Flowable是一个使用Java编写的轻量级业务流程引擎,Flowable流程引擎可用于部署BPMN2.0流程定义,创建这些流程定义的... 目录1、流程引擎介绍2、创建项目3、画流程图4、开发接口4.1 Java 类梳理4.2 查看流程图4

SQL Server修改数据库名及物理数据文件名操作步骤

《SQLServer修改数据库名及物理数据文件名操作步骤》在SQLServer中重命名数据库是一个常见的操作,但需要确保用户具有足够的权限来执行此操作,:本文主要介绍SQLServer修改数据... 目录一、背景介绍二、操作步骤2.1 设置为单用户模式(断开连接)2.2 修改数据库名称2.3 查找逻辑文件名

Python UV安装、升级、卸载详细步骤记录

《PythonUV安装、升级、卸载详细步骤记录》:本文主要介绍PythonUV安装、升级、卸载的详细步骤,uv是Astral推出的下一代Python包与项目管理器,主打单一可执行文件、极致性能... 目录安装检查升级设置自动补全卸载UV 命令总结 官方文档详见:https://docs.astral.sh/

苹果macOS 26 Tahoe主题功能大升级:可定制图标/高亮文本/文件夹颜色

《苹果macOS26Tahoe主题功能大升级:可定制图标/高亮文本/文件夹颜色》在整体系统设计方面,macOS26采用了全新的玻璃质感视觉风格,应用于Dock栏、应用图标以及桌面小部件等多个界面... 科技媒体 MACRumors 昨日(6 月 13 日)发布博文,报道称在 macOS 26 Tahoe 中

全面解析HTML5中Checkbox标签

《全面解析HTML5中Checkbox标签》Checkbox是HTML5中非常重要的表单元素之一,通过合理使用其属性和样式自定义方法,可以为用户提供丰富多样的交互体验,这篇文章给大家介绍HTML5中C... 在html5中,Checkbox(复选框)是一种常用的表单元素,允许用户在一组选项中选择多个项目。本