Commit be3a5c2f authored by 邓超's avatar 邓超

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

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