|
|
|
@@ -24,7 +24,7 @@ const { TextArea } = Input; |
|
|
|
const Pipeline = () => { |
|
|
|
const [form] = Form.useForm(); |
|
|
|
const navigate = useNavigate(); |
|
|
|
const [formId, setFormId] = useState(null); |
|
|
|
const [editRecord, setEditRecord] = useState(null); |
|
|
|
const [dialogTitle, setDialogTitle] = useState('新建流水线'); |
|
|
|
const [pipeList, setPipeList] = useState([]); |
|
|
|
const [total, setTotal] = useState(0); |
|
|
|
@@ -75,7 +75,7 @@ const Pipeline = () => { |
|
|
|
if (ret.code === 200) { |
|
|
|
form.resetFields(); |
|
|
|
form.setFieldsValue({ ...ret.data }); |
|
|
|
setFormId(ret.data.id); |
|
|
|
setEditRecord(ret.data); |
|
|
|
setDialogTitle('编辑流水线'); |
|
|
|
setIsModalOpen(true); |
|
|
|
} |
|
|
|
@@ -99,7 +99,7 @@ const Pipeline = () => { |
|
|
|
// 显示 modal |
|
|
|
const showModal = () => { |
|
|
|
form.resetFields(); |
|
|
|
setFormId(null); |
|
|
|
setEditRecord(null); |
|
|
|
setDialogTitle('新建流水线'); |
|
|
|
setIsModalOpen(true); |
|
|
|
}; |
|
|
|
@@ -111,8 +111,8 @@ const Pipeline = () => { |
|
|
|
|
|
|
|
// 表单提交 |
|
|
|
const onFinish = (values) => { |
|
|
|
if (formId) { |
|
|
|
editWorkflow({ ...values, id: formId }).then((ret) => { |
|
|
|
if (editRecord) { |
|
|
|
editWorkflow({ ...editRecord, ...values }).then((ret) => { |
|
|
|
setIsModalOpen(false); |
|
|
|
message.success('编辑成功'); |
|
|
|
getList(); |
|
|
|
|