+
+
+ {(fields) =>
+ fields.map(({ key, name, ...restField }) => (
+
+ {getParamComponent(
+ globalParam[name]['param_type'],
+ globalParam[name]['is_sensitive'],
+ )}
+
+ ))
+ }
+
+
- ))}
+ )}
);
diff --git a/react-ui/src/pages/Experiment/index.jsx b/react-ui/src/pages/Experiment/index.jsx
index ad9703c1..a93eccbc 100644
--- a/react-ui/src/pages/Experiment/index.jsx
+++ b/react-ui/src/pages/Experiment/index.jsx
@@ -119,22 +119,12 @@ function Experiment() {
};
// 创建或者编辑实验接口请求
const handleAddExperiment = async (values) => {
- const workflow_id = values['workflow_id'];
- let global_param = undefined;
- const pipeline = workflowList.find((v) => v.id === workflow_id);
- if (pipeline && pipeline.global_param) {
- const globalParamList = [...pipeline.global_param];
- for (const item of globalParamList) {
- item.param_value = values[item.param_name];
- values[item.param_name] = undefined;
- }
- global_param = JSON.stringify(globalParamList);
- }
- const params = {
- ...values,
- global_param,
- };
+ const global_param = JSON.stringify(values.global_param);
if (!experimentId) {
+ const params = {
+ ...values,
+ global_param,
+ };
const [res, _] = await to(postExperiment(params));
if (res) {
message.success('新建实验成功');
@@ -142,7 +132,7 @@ function Experiment() {
getList();
}
} else {
- const params = { ...values, id: experimentId };
+ const params = { ...values, global_param, id: experimentId };
const [res, _] = await to(putExperiment(params));
if (res) {
message.success('编辑实验成功');
@@ -431,14 +421,16 @@ function Experiment() {
rowExpandable: (record) => true,
}}
/>
-