diff --git a/react-ui/src/pages/Pipeline/components/GlobalParamsDrawer/index.less b/react-ui/src/pages/Pipeline/components/GlobalParamsDrawer/index.less index 913419c0..b1681d74 100644 --- a/react-ui/src/pages/Pipeline/components/GlobalParamsDrawer/index.less +++ b/react-ui/src/pages/Pipeline/components/GlobalParamsDrawer/index.less @@ -1,20 +1,29 @@ -.form_item_block { +.form-item { position: relative; padding-top: 40px; border-bottom: 1px dashed rgba(20, 49, 179, 0.12); + + &__delete-button { + position: absolute; + top: 5px; + right: 0; + } + + :global { + .anticon.anticon-question-circle { + margin-top: -14px; + } + } } -.delete_button { - position: absolute; - top: 5px; - right: 0; -} -.add_button_form_item { + +.form-item-add { margin-top: 15px; &:first-child { margin-top: 0; } -} -.add_button_form_item .add_button { - padding: 0; + + &__add-button { + padding: 0; + } } diff --git a/react-ui/src/pages/Pipeline/components/GlobalParamsDrawer/index.tsx b/react-ui/src/pages/Pipeline/components/GlobalParamsDrawer/index.tsx index e61423fd..4966f265 100644 --- a/react-ui/src/pages/Pipeline/components/GlobalParamsDrawer/index.tsx +++ b/react-ui/src/pages/Pipeline/components/GlobalParamsDrawer/index.tsx @@ -55,14 +55,14 @@ const GlobalParamsDrawer = forwardRef( getContainer={false} onClose={onClose} open={open} - width={420} + width={520} >
@@ -70,7 +70,7 @@ const GlobalParamsDrawer = forwardRef( {(fields, { add, remove }) => ( <> {fields.map(({ key, name, ...restField }) => ( -
+
))} - +
-
+
{ const afterOpenChange = () => { if (!open) { - console.log('zzzz', form.getFieldsValue()); + // console.log('zzzzz', form.getFieldsValue()); const control_strategy = form.getFieldValue('control_strategy'); const in_parameters = form.getFieldValue('in_parameters'); const out_parameters = form.getFieldValue('out_parameters'); diff --git a/react-ui/src/pages/Pipeline/editPipeline/utils.tsx b/react-ui/src/pages/Pipeline/editPipeline/utils.tsx index bfa233f6..b96e90b9 100644 --- a/react-ui/src/pages/Pipeline/editPipeline/utils.tsx +++ b/react-ui/src/pages/Pipeline/editPipeline/utils.tsx @@ -1,4 +1,5 @@ import { PipelineGlobalParam } from '@/types'; +import { parseJsonText } from '@/utils'; import { Graph, INode } from '@antv/g6'; import { type MenuProps } from 'antd'; @@ -66,14 +67,3 @@ export function createMenuItems( ...nodes, ]; } - -function parseJsonText(text?: string | null): any | null { - if (!text) { - return null; - } - try { - return JSON.parse(text); - } catch (error) { - return null; - } -} diff --git a/react-ui/src/utils/index.ts b/react-ui/src/utils/index.ts index 15e8082c..9086aa38 100644 --- a/react-ui/src/utils/index.ts +++ b/react-ui/src/utils/index.ts @@ -14,3 +14,15 @@ export function getNameByCode(list: any[], code: any) { }); return name; } + +// 解析 json 字符串 +export function parseJsonText(text?: string | null): any | null { + if (!text) { + return null; + } + try { + return JSON.parse(text); + } catch (error) { + return null; + } +}