做国外百科知识网站,做网站赚钱 知乎,代运营公司介绍,招生代理平台更多ruoyi-nbcio功能请看演示系统
gitee源代码地址
前后端代码#xff1a; https://gitee.com/nbacheng/ruoyi-nbcio
演示地址#xff1a;RuoYi-Nbcio后台管理系统 这一节主要是对每个流程节点的字段规则设置与操作规则设置#xff0c;目前也是只针对自定义业务表单。 1、…更多ruoyi-nbcio功能请看演示系统
gitee源代码地址
前后端代码 https://gitee.com/nbacheng/ruoyi-nbcio
演示地址RuoYi-Nbcio后台管理系统 这一节主要是对每个流程节点的字段规则设置与操作规则设置目前也是只针对自定义业务表单。 1、前端部分 流程规则的修改界面
!-- 修改流程规则对话框 --el-dialog :titletitle :visible.syncruleOpen width600px append-to-bodyel-tabs tab-positiontop v-modelactiveName :valueform tab-clickchangeTabel-tab-pane label表单配置 nameform el-table :header-cell-style{background:#f5f6f6} :datacustomRuleList border stylewidth: 100%el-table-column proptitle show-overflow-tooltip label表单字段template slot-scopescopespan v-ifscope.row.colCode stylecolor: #c75450 * /spanspan{{ scope.row.colName }}/span/template/el-table-columnel-table-column propreadOnly label只读 width80template slotheader slot-scopescopeel-radio label1 v-modelpermSelect changeallSelect(1)只读/el-radio/templatetemplate slot-scopescopeel-radio v-modelscope.row.attribute label1 :namescope.row.colCode/el-radio/template/el-table-columnel-table-column propeditable label可编辑 width90template slotheader slot-scopescopeel-radio label2 v-modelpermSelect changeallSelect(2)可编辑/el-radio/templatetemplate slot-scopescopeel-radio v-modelscope.row.attribute label2 :namescope.row.colCode/el-radio/template/el-table-columnel-table-column prophide label隐藏 width80template slotheader slot-scopescopeel-radio label0 v-modelpermSelect changeallSelect(0)隐藏/el-radio/templatetemplate slot-scopescopeel-radio v-modelscope.row.attribute label0 :namescope.row.colCode/el-radio/template/el-table-column/el-table/el-tab-paneel-tab-pane label操作权限 nameoperateel-table :header-cell-style{background:#f5f6f6} :dataoperateRuleList border stylewidth: 100%el-table-column proptitle show-overflow-tooltip label表单字段template slot-scopescopespan v-ifscope.row.id stylecolor: #c75450 * /spanspan{{ scope.row.opeName }}/span/template/el-table-columnel-table-column prophide label关闭 width100template slotheader slot-scopescopeel-switch v-modeloperateSelect :active-value1 :inactive-value0 active-text关闭inactive-text开启 changeallOperate/el-switch/templatetemplate slot-scopescopeel-switch refelswitch v-modelscope.row.isEnable :active-value1:inactive-value0 active-text关闭 inactive-text开启 changechangeOperate(scope.row)/el-switch/template/el-table-column/el-table/el-tab-pane /el-tabsdiv slotfooter classdialog-footerel-button :loadingbuttonLoading typeprimary clicksubmitRuleForm确 定/el-buttonel-button clickcancel取 消/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部分
OverrideTransactional(rollbackFor Exception.class)public WfRuleVo queryConfigRule(WfFlowConfigBo bo) {WfRuleVo ruleVo new WfRuleVo();//获取自定义表单规则列表if(bo.getAppType().equalsIgnoreCase(ZDYYW)) { //自定义业务ListWfCustomRuleVo 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();ListGenTableColumn tableColumnList genTableService.selectGenTableColumnListByTableId(tableId);if(ObjectUtils.isNotEmpty(tableColumnList)) {long i 0L;ListWfCustomRuleVo customAddRuleList new ArrayListWfCustomRuleVo();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)) {}//获取操作规则列表ListWfOperateRuleVo operateRuleList operateRuleMapper.selectRuleByConfigId(bo.getId());if(ObjectUtils.isNotEmpty(operateRuleList) operateRuleList.size()0) {ruleVo.setOperateRuleVoList(operateRuleList);}else {//为空添加默认操作表单规则设置//从字典里获取操作类型ListSysDictData sysDictDataList sysDictDataMapper.selectDictDataListByDictType(wf_oper_type);if(ObjectUtils.isNotEmpty(sysDictDataList)) {long i 0L;ListWfOperateRuleVo operateAddRuleList new ArrayListWfOperateRuleVo();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;}
更新部分
OverrideTransactional(rollbackFor Exception.class)public Boolean updateConfigRule(WfRuleVo vo) {ListWfCustomRuleVo customRuleList vo.getCustomRuleVoList();ListWfOperateRuleVo 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、效果图如下