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

相关文章

通过Docker容器部署Python环境的全流程

《通过Docker容器部署Python环境的全流程》在现代化开发流程中,Docker因其轻量化、环境隔离和跨平台一致性的特性,已成为部署Python应用的标准工具,本文将详细演示如何通过Docker容... 目录引言一、docker与python的协同优势二、核心步骤详解三、进阶配置技巧四、生产环境最佳实践

MyBatis分页查询实战案例完整流程

《MyBatis分页查询实战案例完整流程》MyBatis是一个强大的Java持久层框架,支持自定义SQL和高级映射,本案例以员工工资信息管理为例,详细讲解如何在IDEA中使用MyBatis结合Page... 目录1. MyBATis框架简介2. 分页查询原理与应用场景2.1 分页查询的基本原理2.1.1 分

MyBatis Plus实现时间字段自动填充的完整方案

《MyBatisPlus实现时间字段自动填充的完整方案》在日常开发中,我们经常需要记录数据的创建时间和更新时间,传统的做法是在每次插入或更新操作时手动设置这些时间字段,这种方式不仅繁琐,还容易遗漏,... 目录前言解决目标技术栈实现步骤1. 实体类注解配置2. 创建元数据处理器3. 服务层代码优化填充机制详

Vue和React受控组件的区别小结

《Vue和React受控组件的区别小结》本文主要介绍了Vue和React受控组件的区别小结,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学... 目录背景React 的实现vue3 的实现写法一:直接修改事件参数写法二:通过ref引用 DOMVu

Java实现将HTML文件与字符串转换为图片

《Java实现将HTML文件与字符串转换为图片》在Java开发中,我们经常会遇到将HTML内容转换为图片的需求,本文小编就来和大家详细讲讲如何使用FreeSpire.DocforJava库来实现这一功... 目录前言核心实现:html 转图片完整代码场景 1:转换本地 HTML 文件为图片场景 2:转换 H

C#使用Spire.Doc for .NET实现HTML转Word的高效方案

《C#使用Spire.Docfor.NET实现HTML转Word的高效方案》在Web开发中,HTML内容的生成与处理是高频需求,然而,当用户需要将HTML页面或动态生成的HTML字符串转换为Wor... 目录引言一、html转Word的典型场景与挑战二、用 Spire.Doc 实现 HTML 转 Word1

mybatis-plus如何根据任意字段saveOrUpdateBatch

《mybatis-plus如何根据任意字段saveOrUpdateBatch》MyBatisPlussaveOrUpdateBatch默认按主键判断操作类型,若需按其他唯一字段(如agentId、pe... 目录使用场景方法源码方法改造首先在service层定义接口service层接口实现总结使用场景my

Vue3绑定props默认值问题

《Vue3绑定props默认值问题》使用Vue3的defineProps配合TypeScript的interface定义props类型,并通过withDefaults设置默认值,使组件能安全访问传入的... 目录前言步骤步骤1:使用 defineProps 定义 Props步骤2:设置默认值总结前言使用T

MyBatis-plus处理存储json数据过程

《MyBatis-plus处理存储json数据过程》文章介绍MyBatis-Plus3.4.21处理对象与集合的差异:对象可用内置Handler配合autoResultMap,集合需自定义处理器继承F... 目录1、如果是对象2、如果需要转换的是List集合总结对象和集合分两种情况处理,目前我用的MP的版本

JavaScript中比较两个数组是否有相同元素(交集)的三种常用方法

《JavaScript中比较两个数组是否有相同元素(交集)的三种常用方法》:本文主要介绍JavaScript中比较两个数组是否有相同元素(交集)的三种常用方法,每种方法结合实例代码给大家介绍的非常... 目录引言:为什么"相等"判断如此重要?方法1:使用some()+includes()(适合小数组)方法2