Commit fc6a8f3b authored by 邓超's avatar 邓超

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

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