Commit be3a5c2f authored by 邓超's avatar 邓超

fix: 流程时限配置,结束节点不让配置多个

parent e845b675
Pipeline #60825 passed with stages
...@@ -22,6 +22,7 @@ const Timelimit = props => { ...@@ -22,6 +22,7 @@ const Timelimit = props => {
const [modalType, setModalType] = useState(''); // 模态框是编辑还是修改的状态 const [modalType, setModalType] = useState(''); // 模态框是编辑还是修改的状态
const [editMsg, setEditMsg] = useState({}); // 保存编辑的信息 const [editMsg, setEditMsg] = useState({}); // 保存编辑的信息
const [title, setTitle] = useState(''); const [title, setTitle] = useState('');
const [finishNodes, setFinishNodes] = useState([]);
const [flowId, setFlowId] = useState(''); const [flowId, setFlowId] = useState('');
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
useEffect(() => { useEffect(() => {
...@@ -39,6 +40,8 @@ const Timelimit = props => { ...@@ -39,6 +40,8 @@ const Timelimit = props => {
setLoading(false); setLoading(false);
if (res.code === 0) { if (res.code === 0) {
setTableData(res.data); setTableData(res.data);
setFinishNodes(res.data.map(item => item.EndNode));
} }
}); });
}; };
...@@ -195,6 +198,7 @@ const Timelimit = props => { ...@@ -195,6 +198,7 @@ const Timelimit = props => {
title={title} title={title}
flowId={flowId} flowId={flowId}
modalType={modalType} modalType={modalType}
finishNodes={finishNodes}
handleCancel={() => setViewModal(false)} handleCancel={() => setViewModal(false)}
onSubumit={() => { onSubumit={() => {
setViewModal(false); setViewModal(false);
......
...@@ -9,14 +9,13 @@ import { Form, Modal, Input, notification, Select } from 'antd'; ...@@ -9,14 +9,13 @@ import { Form, Modal, Input, notification, Select } from 'antd';
const { Option } = Select; const { Option } = Select;
const AddModal = props => { const AddModal = props => {
const { onSubumit, handleCancel, visible, msg, flowId, modalType, title } = props; const { onSubumit, handleCancel, visible, msg, flowId, modalType, title, finishNodes } = props;
const [flowNodes, setFlowNodes] = useState([]); const [flowNodes, setFlowNodes] = useState([]);
const [timeLimitFlowNodes, setTimeLimitFlowNodes] = useState([]); const [timeLimitFlowNodes, setTimeLimitFlowNodes] = useState([]);
const [timeLimitFlowNodesEnd, setTimeLimitFlowNodesEnd] = useState([]); const [timeLimitFlowNodesEnd, setTimeLimitFlowNodesEnd] = useState([]);
const [startNodeIndex, setStartNodeIndex] = useState(null); const [startNodeIndex, setStartNodeIndex] = useState(null);
const [endNodeIndex, setEndNodeIndex] = useState(null); const [endNodeIndex, setEndNodeIndex] = useState(null);
const [keepTableName, setKeepTableName] = useState('');
const [keepData, setKeepData] = useState('');
const [form] = Form.useForm(); const [form] = Form.useForm();
useEffect(() => { useEffect(() => {
form.resetFields(); form.resetFields();
...@@ -215,7 +214,10 @@ const AddModal = props => { ...@@ -215,7 +214,10 @@ const AddModal = props => {
<Option <Option
value={item.Name} value={item.Name}
key={item.ID} key={item.ID}
disabled={startNodeIndex !== null && index <= startNodeIndex} disabled={
finishNodes.some(ele => item.Name === ele) ||
(startNodeIndex !== null && index <= startNodeIndex)
}
> >
{item.Name} {item.Name}
</Option> </Option>
......
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