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

相关文章

MyBatis-Plus 自动赋值实体字段最佳实践指南

《MyBatis-Plus自动赋值实体字段最佳实践指南》MyBatis-Plus通过@TableField注解与填充策略,实现时间戳、用户信息、逻辑删除等字段的自动填充,减少手动赋值,提升开发效率与... 目录1. MyBATis-Plus 自动赋值概述1.1 适用场景1.2 自动填充的原理1.3 填充策略

Spring Boot 中的默认异常处理机制及执行流程

《SpringBoot中的默认异常处理机制及执行流程》SpringBoot内置BasicErrorController,自动处理异常并生成HTML/JSON响应,支持自定义错误路径、配置及扩展,如... 目录Spring Boot 异常处理机制详解默认错误页面功能自动异常转换机制错误属性配置选项默认错误处理

Spring Boot从main方法到内嵌Tomcat的全过程(自动化流程)

《SpringBoot从main方法到内嵌Tomcat的全过程(自动化流程)》SpringBoot启动始于main方法,创建SpringApplication实例,初始化上下文,准备环境,刷新容器并... 目录1. 入口:main方法2. SpringApplication初始化2.1 构造阶段3. 运行阶

mybatis-plus QueryWrapper中or,and的使用及说明

《mybatis-plusQueryWrapper中or,and的使用及说明》使用MyBatisPlusQueryWrapper时,因同时添加角色权限固定条件和多字段模糊查询导致数据异常展示,排查发... 目录QueryWrapper中or,and使用列表中还要同时模糊查询多个字段经过排查这就导致只要whe

从入门到精通详解LangChain加载HTML内容的全攻略

《从入门到精通详解LangChain加载HTML内容的全攻略》这篇文章主要为大家详细介绍了如何用LangChain优雅地处理HTML内容,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 目录引言:当大语言模型遇见html一、HTML加载器为什么需要专门的HTML加载器核心加载器对比表二

使用Go实现文件复制的完整流程

《使用Go实现文件复制的完整流程》本案例将实现一个实用的文件操作工具:将一个文件的内容完整复制到另一个文件中,这是文件处理中的常见任务,比如配置文件备份、日志迁移、用户上传文件转存等,文中通过代码示例... 目录案例说明涉及China编程知识点示例代码代码解析示例运行练习扩展小结案例说明我们将通过标准库 os

升级至三频BE12000! 华硕ROG魔盒Pro路由器首发拆解评测

《升级至三频BE12000!华硕ROG魔盒Pro路由器首发拆解评测》华硕前两天推出新一代电竞无线路由器——ROG魔盒Pro(StrixGR7Pro),该产品在无线规格、硬件配置及功能设计上实现全... 作为路由器行业的T1梯队厂商,华硕近期发布了新旗舰华硕ROG魔盒Pro,除了保留DIY属性以外,高达120

Ubuntu 24.04启用root图形登录的操作流程

《Ubuntu24.04启用root图形登录的操作流程》Ubuntu默认禁用root账户的图形与SSH登录,这是为了安全,但在某些场景你可能需要直接用root登录GNOME桌面,本文以Ubuntu2... 目录一、前言二、准备工作三、设置 root 密码四、启用图形界面 root 登录1. 修改 GDM 配

MyBatis-Plus通用中等、大量数据分批查询和处理方法

《MyBatis-Plus通用中等、大量数据分批查询和处理方法》文章介绍MyBatis-Plus分页查询处理,通过函数式接口与Lambda表达式实现通用逻辑,方法抽象但功能强大,建议扩展分批处理及流式... 目录函数式接口获取分页数据接口数据处理接口通用逻辑工具类使用方法简单查询自定义查询方法总结函数式接口

Android kotlin中 Channel 和 Flow 的区别和选择使用场景分析

《Androidkotlin中Channel和Flow的区别和选择使用场景分析》Kotlin协程中,Flow是冷数据流,按需触发,适合响应式数据处理;Channel是热数据流,持续发送,支持... 目录一、基本概念界定FlowChannel二、核心特性对比数据生产触发条件生产与消费的关系背压处理机制生命周期