Commit fc6a8f3b authored by 邓超's avatar 邓超

fix: 对大保存进行验证,修改bug

parent f2fb7dc9
Pipeline #64360 passed with stages
......@@ -100,6 +100,9 @@ const FlowChart = props => {
}, 0);
}
});
if (delNodes.length === 0) {
return;
}
DeleteFlowNodes({ ActivityIds: delNodes, LineIds: delLinks }).then(res => {
if (res.code === 0) {
message.success('删除成功');
......@@ -177,7 +180,7 @@ const FlowChart = props => {
setAddNodes([]);
setDeleteNode('');
setDeleteLine('');
setEditMsg({});
let dataList = lodash.cloneDeep(flowData);
console.log(dataList, 'dataList');
......@@ -282,7 +285,7 @@ const FlowChart = props => {
// 删除节点
const delNode = val => {
setShowLeaveTip(true);
leaveCallBack(true);
// leaveCallBack(true);
diagram.commandHandler.deleteSelection();
// if (val.LineId) {
// diagram.commandHandler.deleteSelection();
......@@ -1054,7 +1057,6 @@ const FlowChart = props => {
};
// 保存流程
const saveFlow = () => {
setButtonLoading(true);
let diagramObj = JSON.parse(diagram.model.toJson());
// let list = isRepeat(diagramObj.nodeDataArray, 'SerialNo');
......@@ -1066,9 +1068,41 @@ const FlowChart = props => {
// });
// return;
// }
let list = new Set([]);
console.log(list, '11111');
diagramObj.nodeDataArray.forEach(item => {
if ((item.NodeType === '20' || item.NodeType === '21') && item.RuleList) {
item.RuleList.forEach(ele => {
if (!ele.RuleName) {
list.add(item.NodeName);
return;
}
if (!ele.NextNodeId && ele.NextNodeId !== 0) {
list.add(item.NodeName);
return;
}
if (!ele.RuleContent) {
list.add(item.NodeName);
}
});
}
const newListLength = new Set(item.RuleList.map(ele => ele.NextNodeId)).size;
if (item.RuleList.length > newListLength) {
list.add(item.NodeName);
return;
}
item.CarbonCopyPeopleList = item.CarbonCopyPeopleList.map(ele => Number(ele.value));
});
console.log(list, '222');
if ([...list].length > 0) {
list.forEach(item => {
message.error(`请检查${item}规则配置`);
});
return;
}
setButtonLoading(true);
SaveNodeChange({
FlowId: flowID,
// DeleteNodes,
......
......@@ -22,6 +22,8 @@ const FlowModal = props => {
// 获取表单回显
const getFormData = () => {
form.setFieldsValue({ ...msg });
setFlag(flag + 1);
console.log(form.getFieldValue('Prefix'), 'fffff');
};
// 提交表单
const onFinish = () => {
......@@ -60,6 +62,11 @@ const FlowModal = props => {
}
});
};
const changeValue = (changedFields, allFields) => {
if (changedFields[0].name[0] === 'Prefix') {
setFlag(flag + 1);
}
};
return (
<Modal
title={`${modalType === 'edit' ? '编辑' : '创建'}流程`}
......@@ -69,7 +76,12 @@ const FlowModal = props => {
maskClosable={false}
destroyOnClose
>
<Form form={form} labelCol={{ span: 5 }} wrapperCol={{ span: 18 }}>
<Form
form={form}
labelCol={{ span: 5 }}
wrapperCol={{ span: 18 }}
onFieldsChange={changeValue}
>
<Form.Item
label="流程名称"
name="FlowName"
......@@ -113,12 +125,12 @@ const FlowModal = props => {
},
]}
>
<Input placeholder="请输入编码前缀" />
<Input placeholder="请输入编码前缀" maxLength={12} />
</Form.Item>
<Form.Item label="流程描述" name="Text">
<Input placeholder="请输入流程描述" />
</Form.Item>
<Form.Item label="流程结束" name="FlowEndBehavior">
<Form.Item label="流程结束" name="FlowEndBehavior" initialValue={0}>
<Radio.Group>
<Radio value={0}>不做任何事情</Radio>
<Radio value={1}>直接关闭事件</Radio>
......@@ -141,11 +153,16 @@ const FlowModal = props => {
</Form.Item>
<Form.Item label="编码样式" name="UseFixedCodingRule">
<Radio.Group>
<Radio value={false}>{msg.Coding12Text}</Radio>
<Radio value>{msg.CodingDefaultText}</Radio>
<Radio value={false}>
{form.getFieldValue('Prefix')}
{'000000000001'.slice(form.getFieldValue('Prefix')?.length)}(始终12位)
</Radio>
<Radio value>
{form.getFieldValue('Prefix')}-{new Date().getFullYear()}-0000001 (前缀长度 + 13 位)
</Radio>
</Radio.Group>
</Form.Item>
<Form.Item label="接口配置" name="interfaceConfig">
<Form.Item label="接口配置" name="InterfaceConfig">
<TextArea placeholder="请填写接口配置" />
</Form.Item>
</Form>
......
......@@ -37,12 +37,12 @@ const NodeModal = props => {
const refConfigView = useRef();
useEffect(() => {
console.log(editMsg, 'editMsgeditMsgeditMsg');
setActiveConfig('常用配置');
}, [editMsg]);
// 提交表单
const onFinish = () => {
console.log(refConfigSubprocess, 'refConfigSubprocess');
// 规则填写校验
let obj = {
...refConfigNodeMsg.current?.getParmar(),
......@@ -81,6 +81,13 @@ const NodeModal = props => {
return (
<>
<div className={styles.configContent}>
<div
className={styles.confgMsk}
style={{ display: JSON.stringify(editMsg) === '{}' || !editMsg ? 'block' : 'none' }}
onClick={() => {
message.error('请先选择节点');
}}
/>
<div
className={styles.tabBox}
style={{
......
......@@ -14,6 +14,15 @@
margin-left: 15px;
z-index: 10;
.confgMsk {
position: absolute;
width: 360px;
height: 100%;
right: 0;
top: 0;
z-index: 11;
}
.tabBox {
margin: auto;
// width: 70%;
......
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