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

相关文章

HTML5中的Microdata与历史记录管理详解

《HTML5中的Microdata与历史记录管理详解》Microdata作为HTML5新增的一个特性,它允许开发者在HTML文档中添加更多的语义信息,以便于搜索引擎和浏览器更好地理解页面内容,本文将探... 目录html5中的Mijscrodata与历史记录管理背景简介html5中的Microdata使用M

html5的响应式布局的方法示例详解

《html5的响应式布局的方法示例详解》:本文主要介绍了HTML5中使用媒体查询和Flexbox进行响应式布局的方法,简要介绍了CSSGrid布局的基础知识和如何实现自动换行的网格布局,详细内容请阅读本文,希望能对你有所帮助... 一 使用媒体查询响应式布局        使用的参数@media这是常用的

HTML5表格语法格式详解

《HTML5表格语法格式详解》在HTML语法中,表格主要通过table、tr和td3个标签构成,本文通过实例代码讲解HTML5表格语法格式,感兴趣的朋友一起看看吧... 目录一、表格1.表格语法格式2.表格属性 3.例子二、不规则表格1.跨行2.跨列3.例子一、表格在html语法中,表格主要通过< tab

将Java项目提交到云服务器的流程步骤

《将Java项目提交到云服务器的流程步骤》所谓将项目提交到云服务器即将你的项目打成一个jar包然后提交到云服务器即可,因此我们需要准备服务器环境为:Linux+JDK+MariDB(MySQL)+Gi... 目录1. 安装 jdk1.1 查看 jdk 版本1.2 下载 jdk2. 安装 mariadb(my

Vue3组件中getCurrentInstance()获取App实例,但是返回null的解决方案

《Vue3组件中getCurrentInstance()获取App实例,但是返回null的解决方案》:本文主要介绍Vue3组件中getCurrentInstance()获取App实例,但是返回nu... 目录vue3组件中getCurrentInstajavascriptnce()获取App实例,但是返回n

JS+HTML实现在线图片水印添加工具

《JS+HTML实现在线图片水印添加工具》在社交媒体和内容创作日益频繁的今天,如何保护原创内容、展示品牌身份成了一个不得不面对的问题,本文将实现一个完全基于HTML+CSS构建的现代化图片水印在线工具... 目录概述功能亮点使用方法技术解析延伸思考运行效果项目源码下载总结概述在社交媒体和内容创作日益频繁的

前端CSS Grid 布局示例详解

《前端CSSGrid布局示例详解》CSSGrid是一种二维布局系统,可以同时控制行和列,相比Flex(一维布局),更适合用在整体页面布局或复杂模块结构中,:本文主要介绍前端CSSGri... 目录css Grid 布局详解(通俗易懂版)一、概述二、基础概念三、创建 Grid 容器四、定义网格行和列五、设置行

前端下载文件时如何后端返回的文件流一些常见方法

《前端下载文件时如何后端返回的文件流一些常见方法》:本文主要介绍前端下载文件时如何后端返回的文件流一些常见方法,包括使用Blob和URL.createObjectURL创建下载链接,以及处理带有C... 目录1. 使用 Blob 和 URL.createObjectURL 创建下载链接例子:使用 Blob

Vuex Actions多参数传递的解决方案

《VuexActions多参数传递的解决方案》在Vuex中,actions的设计默认只支持单个参数传递,这有时会限制我们的使用场景,下面我将详细介绍几种处理多参数传递的解决方案,从基础到高级,... 目录一、对象封装法(推荐)二、参数解构法三、柯里化函数法四、Payload 工厂函数五、TypeScript

如何高效移除C++关联容器中的元素

《如何高效移除C++关联容器中的元素》关联容器和顺序容器有着很大不同,关联容器中的元素是按照关键字来保存和访问的,而顺序容器中的元素是按它们在容器中的位置来顺序保存和访问的,本文介绍了如何高效移除C+... 目录一、简介二、移除给定位置的元素三、移除与特定键值等价的元素四、移除满足特android定条件的元