Commit 9ea0f24d authored by 邓超's avatar 邓超

fix: 工作流编辑器网关配置

parent c2247cca
......@@ -370,7 +370,6 @@ const FlowChart = props => {
);
// 双击节点
const handlerDC = (e, node) => {
console.log(node.part, 'afdasdf');
setNodeKey(node.part.data.key);
setEditMsg(node.part.data);
setModalType('edit');
......@@ -378,7 +377,6 @@ const FlowChart = props => {
};
// 双击线
const addLineMsg = (e, node) => {
console.log(node.part.data, 'afdasdf');
// setLineId(node.part.data.__gohashid);
setLineMsg(node.part.data);
setLineVisible(true);
......@@ -444,7 +442,16 @@ const FlowChart = props => {
if (modalType === 'edit') {
// 编辑节点
let nodeData = diagram.model.findNodeDataForKey(nodeKey);
const { NodeName, NodeType, roleList, SerialNo, aheadHandle, NodeHandling, nodeDetail } = obj;
const {
NodeName,
NodeType,
roleList,
SerialNo,
aheadHandle,
NodeHandling,
nodeDetail,
RuleList,
} = obj;
nodeData.NodeName = NodeName;
nodeData.NodeType = NodeType;
nodeData.NodeId = nodeKey;
......@@ -453,6 +460,7 @@ const FlowChart = props => {
nodeData.aheadHandle = aheadHandle;
nodeData.NodeHandling = NodeHandling;
nodeData.nodeDetail = nodeDetail;
nodeData.RuleList = RuleList;
diagram.model.updateTargetBindings(nodeData);
}
// 关闭时进行数据比对看数据是否改变
......@@ -591,6 +599,7 @@ const FlowChart = props => {
</Spin>
</div>
<NodeModal
flowID={flowID}
visible={visible}
editMsg={editMsg}
newSerialNo={newSerialNo}
......@@ -598,6 +607,7 @@ const FlowChart = props => {
modalType={modalType}
handleCancel={() => setVisible(false)}
onSubumit={obj => nodeCallBack(obj)}
flowData={diagram ? JSON.parse(diagram.model.toJson()) : {}}
/>
{/* <LineModal
visible={lineVisible}
......
.titleBox {
color: #DCDCDC;
font-size: 14px;
}
.btnAddRule {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 31px;
margin: auto;
margin-top: 15px;
margin-bottom: 15px;
border: 1px dashed #188FFD;
border-radius: 3px;
color: #188FFD;
line-height: 31px;
text-align: center;
cursor: pointer;
}
.ruleContent {
width: 100%;
.ruleBox {
.ruleTitle {
display: flex;
justify-content: space-between;
margin-bottom: 15px;
align-items: center;
.textContet {
color: #FFA144;
font-size: 18px;
font-weight: 700;
}
.btnClose {}
}
.formBox {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
padding-left: 15px;
.label {
white-space: nowrap;
}
.item {
width: 100%;
}
}
.buttonBox {
padding-left: 15px;
width: 100%;
height: 34px;
display: flex;
justify-content: space-between;
align-items: center;
cursor: pointer;
.setButton {
width: 90%;
height: 100%;
line-height: 34px;
border: 2px solid #6A98FA;
text-align: center;
}
.addIcon {
height: 100%;
flex: 1;
border: 2px solid #6A98FA;
border-left: 0px;
text-align: center;
}
}
}
}
\ No newline at end of file
import React, { useEffect, useState } from 'react';
import { Modal, Input, Form } from 'antd';
import styles from './RuleConfig.less';
import Tree from '@/components/ExpendableTree';
const { TextArea } = Input;
const RuleConfig = props => {
const { visible, handleCancel, fieldList, onSubumit, RuleContent } = props;
const [rule, setRule] = useState([]);
const [treeData, setTreeData] = useState([]);
const [form] = Form.useForm();
useEffect(() => {
if (visible) {
console.log(RuleContent, 'fieldList');
setRule(RuleContent);
} else {
}
}, [visible]);
// 保存线配置
const onSave = () => {
onSubumit(rule);
};
// 处理树数据
const mapTree = (val, index) => {
return {
title: val.TableName,
key: val.TableName,
children: val.TableFieldNames.map(item => ({ title: item, key: item })),
};
};
const onSelect = e => {
console.log(e);
};
return (
<div>
<Modal
title="节点扭转规则配置"
visible={visible}
onOk={onSave}
width="860px"
onCancel={handleCancel}
maskClosable={false}
destroyOnClose
getContainer={false}
>
<div className={styles.configContent}>
<div className={styles.leftTree}>
<Tree
blockNode
// onSelect={onSelect}
treeData={fieldList.map((item, index) => mapTree(item, index))}
/>
</div>
<div className={styles.rightContent}>
<div className={styles.title}>符合以下条件时工单扭转到对应的节点</div>
<div className={styles.textAreaBox}>
<TextArea
autoSize={{ minRows: 19, maxRows: 19 }}
value={rule}
rows={4}
onChange={e => setRule(e.target.value)}
/>
</div>
<div className={styles.tipBox}>
<p>请从左侧面板选择字段或选项</p>
<p>{'支持英文模式下运算符(+、-、*、/、>、<、==、!=、<=、>=)及函数'}</p>
<p>参考场景:</p>
<p>当报销金额大于10000时,才能进入所选节点,则可将流转条件设置为:</p>
<p>{'报销金额>10000'}</p>
</div>
</div>
</div>
</Modal>
</div>
);
};
export default RuleConfig;
.configContent {
height: 600px;
display: flex;
.leftTree {
width: 250px;
height: 100%;
overflow-y: scroll;
}
}
\ No newline at end of file
......@@ -18,3 +18,6 @@ export const CreateOrUpdateNode = param =>
export const SaveNodeChange = param => post(`${PUBLISH_SERVICE}/WorkFlow/SaveNodeChange`, param);
// 删除流程
export const DeleteFlow = param => get(`${PUBLISH_SERVICE}/WorkFlow/DeleteFlow`, param);
// 获取流程节点级字段
export const GetFormDataSource = param =>
get(`${PUBLISH_SERVICE}/WorkFlow/GetFormDataSource`, param);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment