基于若依的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.mfbz.cn/a/198565.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

基于SSM的社区团购系统设计与实现

末尾获取源码 开发语言&#xff1a;Java Java开发工具&#xff1a;JDK1.8 后端框架&#xff1a;SSM 前端&#xff1a;Vue 数据库&#xff1a;MySQL5.7和Navicat管理工具结合 服务器&#xff1a;Tomcat8.5 开发软件&#xff1a;IDEA / Eclipse 是否Maven项目&#xff1a;是 目录…

python基于YOLOv8全系列模型【n/s/m/l/x】开发构建不同参数量级的钢铁产业产品智能自动化检测识别系统

在前文的项目开发实践中&#xff0c;我们已经以钢铁产业产品缺陷检测数据场景为基准&#xff0c;陆续开发构建了多款目标检测模型&#xff0c;感兴趣的话可以自行阅读即可。 《YOLOv3老矣尚能战否&#xff1f;基于YOLOv3开发构建建钢铁产业产品智能自动化检测识别系统&#xf…

智能优化算法应用:基于人工蜂群算法无线传感器网络(WSN)覆盖优化 - 附代码

智能优化算法应用&#xff1a;基于人工蜂群算法无线传感器网络(WSN)覆盖优化 - 附代码 文章目录 智能优化算法应用&#xff1a;基于人工蜂群算法无线传感器网络(WSN)覆盖优化 - 附代码1.无线传感网络节点模型2.覆盖数学模型及分析3.人工蜂群算法4.实验参数设定5.算法结果6.参考…

中伟视界:AI智能分析盒子的人数统计AI算法通过什么算法模型可以解决重复统计的问题?

在AI盒子的人数统计中&#xff0c;常常会遇到重复统计的问题。当有多人同时出入视野范围时&#xff0c;传统的算法模型很难准确识别和计算人数&#xff0c;容易导致重复统计。为解决这一难题&#xff0c;AI算法模型可以采用多种方法来提高准确性并避免重复统计。 一种常用的解决…

【沐风老师】3DMAX拼图建模工具MaxPuzzle2D插件使用方法详解

MaxPuzzle2D拼图建模工具使用帮助 MaxPuzzle2D拼图建模工具&#xff0c;拼图建模“彩虹系列”插件&#xff0c;是一款用MAXScript脚本语言开发的3dMax拼图建模小工具&#xff0c;可以创建2D或3D的拼图图形阵列。这让需要拼图建模的设计师大大节省了时间。 MaxPuzzle2D工具界面&…

移动应用开发介绍及iOS方向学习路线(HUT移动组版)

移动应用开发介绍及iOS方向学习路线&#xff08;HUT移动组版&#xff09; 前言 ​ 作为一个HUT移动组待了一坤年&#xff08;两年半&#xff09;多的老人&#xff0c;在这里为还在考虑进哪个组的萌新们以及将来进组的新朋友提供一份关于移动应用开发介绍以及学习路线的白话文…

中间件安全:JBoss 反序列化命令执行漏洞.(CVE-2017-12149)

中间件安全&#xff1a;JBoss 反序列化命令执行漏洞.&#xff08;CVE-2017-12149&#xff09; JBoss 反序列化漏洞&#xff0c;该漏洞位于 JBoss 的 HttpInvoker 组件中的 ReadOnlyAccessFilter 过滤器中&#xff0c;其 doFilter 方法在没有进行任何安全检查和限制的情况下尝试…

神奇植物在哪里?文心大模型助力一秒读懂花草的“前世今生”

本期文心开发者说邀请到飞桨开发者技术专家谢杰航老师&#xff0c;分享如何利用AI技术构建风景园林行业的植物知识科普系统&#xff0c;接着还介绍了大模型应用的基本技术流程框架&#xff0c;多模态特征提取以及使用向量数据库的优势&#xff0c;使用飞桨星河社区运行向量数据…

SAP VL01N Error VL 367

在VL01N 创建交货单的时候&#xff0c;报错&#xff1a;An item with no delivery quantity is not permitted. Item will be deleted. 第一种情况&#xff1a; 1.首先MMBEcheck 可用库存&#xff0c;非限制使用库存是否充足 注意&#xff1a;这里框出来的交货库存也是非限制…

Python超级详细的变量命名规则

Python 需要使用标识符给变量命名&#xff0c;其实标识符就是用于给程序中变量、类、方法命名的符号&#xff08;简单来说&#xff0c;标识符就是合法的名字&#xff09;。 Python 语言的标识符必须以字母、下画线&#xff08;_&#xff09;开头&#xff0c;后面可以跟任意数目…

GitLab 登录中,LDAP和 Standard 验证有什么区别

在 GitLab 中&#xff0c;LDAP&#xff08;Lightweight Directory Access Protocol&#xff09;和 Standard 验证是两种不同的身份验证方法&#xff0c;它们有以下区别&#xff1a; LDAP&#xff08;Lightweight Directory Access Protocol&#xff09;身份验证&#xff1a; L…

Kafka事务机制:原理和实践

Kafka事务机制&#xff1a;原理和实践 Apache Kafka 是一个分布式流处理平台&#xff0c;广泛用于构建实时数据管道和流应用程序。它不仅以高吞吐量、可扩展性和容错能力著称&#xff0c;还提供了事务支持&#xff0c;以确保数据的完整性和一致性。在这篇博客中&#xff0c;我…

Android flutter项目 启动优化实战(一)使用benchmark分析项目

背景描述 启动时间是用户对应用的第一印象&#xff0c;较慢的加载会对用户的留存和互动造成负面影响 在刚上线的B端项目中&#xff1a; 1.提高启动速度能提高整体流程的效率 2.提高首次运行速度能提高应用推广的初体验效果 问题描述 项目刚上线没多久、目前存在冷启动过程存在…

C#:程序发布的大小控制

.net不讨喜有个大原因就是.net平台本身太大了&#xff0c;不同版本没有兼容性&#xff0c;程序依赖哪个版本用户就要安装哪个版本&#xff0c;除非你恰好用的是操作系统默认安装的版本——问题是不同版本操作系统默认安装的不一样。 所以打包程序就很头疼&#xff0c;不打包平台…

设备管理的方法与思路

阅读本文你将了解设备管理的思路与方法&#xff1a;一、制定全面的管理计划&#xff1b;二、标准化管理流程&#xff1b;三、设备维护与保养&#xff1b;四、风险管理与预防&#xff1b;五、引入数字化工具。 设备管理在生产制造领域是保障生产安全和效率的核心环节。通过引入…

Android Studio 模拟器设置独立窗口

目录 模拟器在窗口内部运行 设置成独立窗口 模拟器在窗口内部运行 操作起来十分不便 设置成独立窗口 Android Studio -> Preferences(Settings) -> Tools-> Emulator ->取消勾选 Launch in a tool window -> 点击右下角的 OK 按钮 -> 重启 Android Studio

初次尝到【C知道】的甜蜜

目录 一、场景描述 二、【C知道】使用 三、【C知道】的原理 四、【C知道】的坑 一、场景描述 最近有下面的需求&#xff1a; mysql如何通过命令查看指定表的存储引擎 习惯性在CSDN中搜文章&#xff0c;自己找。 皇天不负有心人&#xff0c;我找到了下面这个内容&#xff0…

食谱菜谱大全API接口

食谱菜谱大全API接口 一、食谱菜谱大全API接口二、使用步骤1、接口2、请求参数3、请求参数示例4、接口 返回示例 三、 如何获取appKey和uid1、申请appKey:2、获取appKey和uid 四、重要说明 一、食谱菜谱大全API接口 包含所有家用或者商用的食谱菜谱的API接口 二、使用步骤 1…

面试篇spark(spark core,spark sql,spark 优化)

一&#xff1a;为什么学习spark&#xff1f; 相比较map-reduce框架&#xff0c;spark的框架执行效率更加高效。 mapreduce的执行框架示意图。 spark执行框架示意图 spark的执行中间结果是存储在内存当中的&#xff0c;而hdfs的执行中间结果是存储在hdfs中的。所以在运算的时…

在centos7上源码安装nginx

1. 安装必要的编译工具和依赖项 在编译Nginx之前&#xff0c;你需要安装一些编译工具和依赖项。可以通过以下命令安装&#xff1a; yum install gcc-c pcre-devel zlib-devel make 2. 下载Nginx源代码 从Nginx官网下载最新的源代码。你可以使用wget命令来下载&#xff1a; …