基于若依的ruoyi-nbcio流程管理系统增加流程节点配置(三)

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

gitee源代码地址

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

演示地址:RuoYi-Nbcio后台管理系统

     这一节主要是对每个流程节点的字段规则设置与操作规则设置,目前也是只针对自定义业务表单。

    1、前端部分

    流程规则的修改界面

<!-- 修改流程规则对话框 --><el-dialog :title="title" :visible.sync="ruleOpen" width="600px" append-to-body><el-tabs tab-position="top" v-model="activeName" :value="'form'" @tab-click="changeTab"><el-tab-pane label="表单配置" name="form" ><el-table :header-cell-style="{background:'#f5f6f6'}" :data="customRuleList" border style="width: 100%"><el-table-column prop="title" show-overflow-tooltip label="表单字段"><template slot-scope="scope"><span v-if="scope.row.colCode" style="color: #c75450"> * </span><span>{{ scope.row.colName }}</span></template></el-table-column><el-table-column prop="readOnly" label="只读" width="80"><template slot="header" slot-scope="scope"><el-radio label="1" v-model="permSelect" @change="allSelect('1')">只读</el-radio></template><template slot-scope="scope"><el-radio v-model="scope.row.attribute" label="1" :name="scope.row.colCode"></el-radio></template></el-table-column><el-table-column prop="editable" label="可编辑" width="90"><template slot="header" slot-scope="scope"><el-radio label="2" v-model="permSelect" @change="allSelect('2')">可编辑</el-radio></template><template slot-scope="scope"><el-radio v-model="scope.row.attribute" label="2" :name="scope.row.colCode"></el-radio></template></el-table-column><el-table-column prop="hide" label="隐藏" width="80"><template slot="header" slot-scope="scope"><el-radio label="0" v-model="permSelect" @change="allSelect('0')">隐藏</el-radio></template><template slot-scope="scope"><el-radio v-model="scope.row.attribute" label="0" :name="scope.row.colCode"></el-radio></template></el-table-column></el-table></el-tab-pane><el-tab-pane label="操作权限" name="operate"><el-table :header-cell-style="{background:'#f5f6f6'}" :data="operateRuleList" border style="width: 100%"><el-table-column prop="title" show-overflow-tooltip label="表单字段"><template slot-scope="scope"><span v-if="scope.row.id" style="color: #c75450"> * </span><span>{{ scope.row.opeName }}</span></template></el-table-column><el-table-column prop="hide" label="关闭" width="100"><template slot="header" slot-scope="scope"><el-switch v-model="operateSelect" :active-value="'1'" :inactive-value="'0'" active-text="关闭"inactive-text="开启" @change="allOperate"></el-switch></template><template slot-scope="scope"><el-switch ref="elswitch" v-model="scope.row.isEnable" :active-value="'1'":inactive-value="'0'" active-text="关闭" inactive-text="开启" @change="changeOperate(scope.row)"></el-switch></template></el-table-column></el-table></el-tab-pane ></el-tabs><div slot="footer" class="dialog-footer"><el-button :loading="buttonLoading" type="primary" @click="submitRuleForm">确 定</el-button><el-button @click="cancel">取 消</el-button></div></el-dialog>

获取流程规则数据

/** 修改规则操作 */handleRule(row) {this.loading = true;console.log("handleRule row=",row);getConfigRule(row).then(response => {this.loading = false;console.log("getConfigRule response=",response);this.customRuleList = response.data.customRuleVoList;this.operateRuleList = response.data.operateRuleVoList;this.activeName = "form";this.ruleOpen = true;this.title = "修改节点规则";});},

流程规则数据修改

/** 提交按钮 */submitRuleForm() {this.buttonLoading = true;let ruleVo = {customRuleVoList: this.customRuleList,operateRuleVoList: this.operateRuleList}updateConfigRule(ruleVo).then(response => {this.$modal.msgSuccess("修改成功");this.ruleOpen = false;this.getList();}).finally(() => {this.buttonLoading = false;});},

2、后端部分

     先查询,没有就增加,queryConfigRule部分

@Override@Transactional(rollbackFor = Exception.class)public WfRuleVo queryConfigRule(WfFlowConfigBo bo) {WfRuleVo ruleVo = new WfRuleVo();//获取自定义表单规则列表if(bo.getAppType().equalsIgnoreCase("ZDYYW")) { //自定义业务List<WfCustomRuleVo> customRuleList = customRuleMapper.selectRuleByConfigId(bo.getId());if(ObjectUtils.isNotEmpty(customRuleList) && customRuleList.size()>0) {ruleVo.setCustomRuleVoList(customRuleList);	}else {//为空添加默认表单规则设置if(StringUtils.isNotEmpty(bo.getFormKey())) {//获取自定义表信息Long formId = Convert.toLong(StringUtils.substringAfter(bo.getFormKey(), "key_"));WfCustomFormVo customFormVo = customFormService.queryById(formId);if(ObjectUtils.isNotEmpty(customFormVo)) {Long tableId = customFormVo.getTableId();List<GenTableColumn> tableColumnList = genTableService.selectGenTableColumnListByTableId(tableId);if(ObjectUtils.isNotEmpty(tableColumnList)) {long i = 0L;List<WfCustomRuleVo> customAddRuleList = new ArrayList<WfCustomRuleVo>();for(GenTableColumn tableColumn : tableColumnList) {WfCustomRuleBo customRuleBo = new WfCustomRuleBo();WfCustomRuleVo customRuleVo = new WfCustomRuleVo();customRuleBo.setColCode(tableColumn.getColumnName());customRuleBo.setColName(tableColumn.getColumnComment());customRuleBo.setConfigId(bo.getId());customRuleBo.setJavaField(tableColumn.getJavaField());customRuleBo.setJavaType(tableColumn.getJavaType());customRuleBo.setAttribute("1"); //默认只读i = i + 1;customRuleBo.setSort(i);customRuleService.insertByBo(customRuleBo);BeanUtils.copyProperties(customRuleBo, customRuleVo);customAddRuleList.add(customRuleVo);}ruleVo.setCustomRuleVoList(customAddRuleList);}}}}} else if(bo.getAppType().equalsIgnoreCase("OA")) {}//获取操作规则列表List<WfOperateRuleVo> operateRuleList = operateRuleMapper.selectRuleByConfigId(bo.getId());if(ObjectUtils.isNotEmpty(operateRuleList) && operateRuleList.size()>0) {ruleVo.setOperateRuleVoList(operateRuleList);}else {//为空添加默认操作表单规则设置//从字典里获取操作类型List<SysDictData> sysDictDataList = sysDictDataMapper.selectDictDataListByDictType("wf_oper_type");if(ObjectUtils.isNotEmpty(sysDictDataList)) {long i = 0L;List<WfOperateRuleVo> operateAddRuleList = new ArrayList<WfOperateRuleVo>();for(SysDictData sysDictData : sysDictDataList) {WfOperateRuleBo operateRuleBo = new WfOperateRuleBo();WfOperateRuleVo operateRuleVo = new WfOperateRuleVo();operateRuleBo.setConfigId(bo.getId());operateRuleBo.setOpeType(sysDictData.getDictValue());operateRuleBo.setOpeName(sysDictData.getDictLabel());if(StringUtils.equalsAnyIgnoreCase(sysDictData.getDictValue(), "agree")    ||StringUtils.equalsAnyIgnoreCase(sysDictData.getDictValue(), "delegate") ||StringUtils.equalsAnyIgnoreCase(sysDictData.getDictValue(), "transfer") ||StringUtils.equalsAnyIgnoreCase(sysDictData.getDictValue(), "reback")   ||StringUtils.equalsAnyIgnoreCase(sysDictData.getDictValue(), "reject")) {operateRuleBo.setIsEnable("1"); //默认上面的操作开启}else {operateRuleBo.setIsEnable("0"); //其它默认关闭}i = i + 1;operateRuleBo.setSort(i);operateRuleService.insertByBo(operateRuleBo);BeanUtils.copyProperties(operateRuleBo, operateRuleVo);operateAddRuleList.add(operateRuleVo);}ruleVo.setOperateRuleVoList(operateAddRuleList);}}return ruleVo;}

更新部分

@Override@Transactional(rollbackFor = Exception.class)public Boolean updateConfigRule(WfRuleVo vo) {List<WfCustomRuleVo> customRuleList = vo.getCustomRuleVoList();List<WfOperateRuleVo> operateRuleList = vo.getOperateRuleVoList();if(ObjectUtils.isNotEmpty(customRuleList) && ObjectUtils.isNotEmpty(operateRuleList) ) {for(WfCustomRuleVo customRuleVo : customRuleList) {WfCustomRuleBo customRuleBo = new WfCustomRuleBo();BeanUtils.copyProperties(customRuleVo,customRuleBo);customRuleService.updateByBo(customRuleBo);}for(WfOperateRuleVo operateRuleVo : operateRuleList) {WfOperateRuleBo operateRuleBo = new WfOperateRuleBo();BeanUtils.copyProperties(operateRuleVo,operateRuleBo);operateRuleService.updateByBo(operateRuleBo);}return true;}return false;}

3、效果图如下:

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

元素在盒模型居中的情况

在CSS中&#xff0c;有多种方法可以使元素在盒模型中居中。下面列举了一些常见的情况和相应的解决方案&#xff1a; 水平居中&#xff1a;文本 text-align: center; 适用于&#xff1a;行内元素和文本。 水平居中&#xff1a;块级元素 margin-left: auto; margin-right: auto…

Day35| Leetcode 860. 柠檬水找零 Leetcode 406. 根据身高重建队列 Leetcode 452. 用最少数量的箭引爆气球

Leetcode 860. 柠檬水找零 题目链接 860 柠檬水找零 本题目比较简单&#xff0c;我一开始并没有看出有需要贪心的地方&#xff0c;看了一下解析&#xff1a; 局部最优&#xff1a;遇到账单20&#xff0c;优先消耗美元10&#xff0c;完成本次找零。全局最优&#xff1a;完成…

c语言编程题经典100例——(36~40例)

1&#xff0c;实现快速排序算法。 下面是用C语言实现快速排序算法的示例代码&#xff1a; #include <stdio.h> void swap(int* a, int* b) { int t *a; *a *b; *b t; } int partition(int arr[], int low, int high) { int pivot arr[high]; int i (low …

如何设置带有密码的excel只读模式?

Excel只读模式大家都不陌生&#xff0c;那大家知道带有密码的只读模式吗&#xff1f;今天给大家分享如何设置带有密码的只读模式。 打开excel文件&#xff0c;将文件进行【另存为】设置&#xff0c;然后停留在保存路径的界面中&#xff0c;我们点击下面的工具 – 常规选项 在常…

浅谈数据资产价值评估

加gzh"大数据食铁兽“&#xff0c;了解更多大数据信息 数据是资产&#xff0c;是当前时代大背景下毋庸置疑的。随着科技的发展&#xff0c;数据的重要性越来越受到人们的关注。对于企业来说&#xff0c;数据是非常重要的资产&#xff0c;它可以为企业提供决策依据、增加市…

20天GMV超过百万美金!桌下迷你跑步机在TikTok Shop美国站热销

上周总GMV达到1.59亿美元&#xff0c;达到历史新高&#xff0c;是美国站自开通以来首次单周出单达到亿级&#xff1b;日均出单1660万美元&#xff0c;单日出单最高达2820万美元&#xff1b; 截至11月19日&#xff0c;GMV Top 5 的商品分类排名依次为&#xff1a;美妆个护、女士…

【论文复现】RoSteALS: Robust Steganography using Autoencoder Latent Space-2023-CVPR

代码链接&#xff1a;https://github.com/TuBui/RoSteALS 一定要按照dockerfile&#xff0c;requirements.txt和requirements2.txt配置环境 需要补充的库&#xff1a; pip安装&#xff1a;omegaconf slack slackclient bchlib (0.14.0版本) einops imagenet-c conda安装&…

4、stable diffusion

github 安装anaconda环境 conda env create -f environment.yaml conda activate ldm安装依赖 conda install pytorch1.12.1 torchvision0.13.1 torchaudio0.12.1 cudatoolkit11.3 -c pytorch pip install transformers4.19.2 diffusers invisible-watermark pip install -e…

C++学习之路(十一)C++ 用Qt5实现一个工具箱(增加一个进制转换器功能)- 示例代码拆分讲解

上篇文章&#xff0c;我们用 Qt5 实现了在小工具箱中添加了《时间戳转换功能》功能。为了继续丰富我们的工具箱&#xff0c;今天我们就再增加一个平时经常用到的功能吧&#xff0c;就是「 进制转换 」功能。下面我们就来看看如何来规划开发一个这样的小功能并且添加到我们的工具…

抖音本地生活服务商申请要多久审核通过?

近年来&#xff0c;随着互联网的普及和社交媒体的兴起&#xff0c;本地生活服务行业也迎来了巨大的发展机遇。作为最受欢迎的短视频平台之一&#xff0c;抖音也不例外。抖音本地生活服务商申请要多久审核通过&#xff1f;这是许多想要加入抖音本地服务行业的人们最关心的问题之…

Docker—共享应用程序

现在您已经构建了一个映像&#xff0c;可以共享它。要共享Docker映像&#xff0c;您必须使用Docker注册表。默认注册表是Docker Hub&#xff0c;是您使用的所有图像的来源。 Docker ID&#xff08;Docker标识&#xff09; Docker ID允许您访问Docker Hub&#xff0c;这是世界上…

绩效考核的基础及基本内容

人力资源是企业的第一资源&#xff0c;员工绩效水平决定着人力资源价值的实现程度&#xff0c;绩效是企业永远的重点&#xff0c;没有绩效&#xff0c;一切无从谈起。很多企业在实施考核时扩大了绩效考核的积极作用&#xff0c;并没有考虑企业对绩效考核负面效应的承载能力&…

深入了解Java8新特性-日期时间API:OffsetDateTime类

阅读建议 嗨&#xff0c;伙计&#xff01;刷到这篇文章咱们就是有缘人&#xff0c;在阅读这篇文章前我有一些建议&#xff1a; 本篇文章大概24000多字&#xff0c;预计阅读时间长需要20分钟。本篇文章的实战性、理论性较强&#xff0c;是一篇质量分数较高的技术干货文章&…

easyExcel自定义导出,指定列,设置请求头背景色,加入合计行,设置合计行字体,背景色等等

效果图 1.引入easyExcel pom <dependency><groupId>com.alibaba</groupId><artifactId>easyexcel</artifactId><version>3.3.1</version></dependency> 2.工具类-自定义样式handler-CustomCellWriteHandler import java.util…

信号分析仪-4024CA频谱分析仪 频率范围9kHz~9GHz

01 4024CA频谱分析仪 产品综述&#xff1a; 4024CA频谱分析仪是一款专为外场测试而设计的大宽带手持式实时频谱分析仪&#xff0c;最大实时分析带宽达到120MHz&#xff0c;具有实时频谱分析、5G NR解调分析、LTE FDD/TDD解调分析、GSM/EDGE解调分析、定向分析等多种测量功能…

【数据库连接池】01:连接池初始化

连接池初始化 OVERVIEW 连接池初始化1.Connection类Connection.hConnection.cpp 2.CommonConnectionPool类CommonConnectionPool.hCommonConnectionPool.cpp 1.Connection类 封装Connection类&#xff0c;在该类内调用mysql提供的接口实现对数据库的增删改查&#xff0c; Con…

QT6 Creator编译KDDockWidgets并部署到QT

为什么使用KDDockWidgets 为什么使用KDDockWidgets呢&#xff1f; 首先它是一个优秀的开源dock库&#xff0c;弥补QDockWidget的不足&#xff0c;详情见官网。 其次它支持QML&#xff0c;这是我最终选择这个dock库的主要原因&#xff0c;因为最近在考虑将前端界面用QML做&…

观鹤笔记1

>> 夜里无光&#xff0c;但他眼睛里有一泓粼粼泛光的泉。哪怕他自己穿得很单薄&#xff0c;身子看起来冷得发僵&#xff0c;可那份在受刑前夜仍然能安坐于墙角的平静&#xff0c;却令杨婉觉得有些温暖。 入人世&#xff0c;虽重伤而不嫉。 邓瑛的这种人性&#xff0c;在2…

SSM训练营管理系统开发mysql数据库web结构java编程计算机网页源码eclipse项目

一、源码特点 SSM 训练营管理系统是一套完善的信息系统&#xff0c;结合springMVC框架完成本系统&#xff0c;对理解JSP java编程开发语言有帮助系统采用SSM框架&#xff08;MVC模式开发&#xff09;&#xff0c;系统具有完整的源代码和数据库&#xff0c;系 统主要采用B/S模…

金字塔原理

金字塔原理 来自于麦肯锡公司的第一位女性咨询顾问芭芭拉•明托的著作《金字塔原理》。 原理介绍 此原理是一种重点突出、逻辑清晰、主次分明的逻辑思路、表达方式和规范动作。 金字塔的基本结构是&#xff1a;中心思想明确&#xff0c;结论先行&#xff0c;以上统下&#xff…