Browse Source

fix: 编辑流水线时,传所有参数

pull/273/head
zhaowei 6 months ago
parent
commit
11c0c9ee4d
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      react-ui/src/pages/Pipeline/index.jsx

+ 5
- 5
react-ui/src/pages/Pipeline/index.jsx View File

@@ -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();


Loading…
Cancel
Save