diff --git a/packages/core/client/src/schema-settings/LinkageRules/ValueDynamicComponent.tsx b/packages/core/client/src/schema-settings/LinkageRules/ValueDynamicComponent.tsx index 9851620cbb..5fd7647838 100644 --- a/packages/core/client/src/schema-settings/LinkageRules/ValueDynamicComponent.tsx +++ b/packages/core/client/src/schema-settings/LinkageRules/ValueDynamicComponent.tsx @@ -8,6 +8,7 @@ */ import { Input, Select } from 'antd'; +import { css } from '@emotion/css'; import React, { useCallback, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useFormBlockContext } from '../../block-provider/FormBlockProvider'; @@ -47,7 +48,7 @@ export const ValueDynamicComponent = (props: ValueDynamicComponentProps) => { blockCollectionName: collectionName, }); const constantStyle = useMemo(() => { - return { minWidth: 150, maxWidth: 430, marginLeft: 5 }; + return { minWidth: 150, maxWidth: 430 }; }, []); const handleChangeOfConstant = useCallback( (value) => { @@ -73,7 +74,7 @@ export const ValueDynamicComponent = (props: ValueDynamicComponentProps) => { [collectionName, mode, setValue], ); const textAreaStyle = useMemo(() => { - return { minWidth: 460 }; + return { minWidth: 460, borderRadius: 0 }; }, []); const compatScope = useMemo(() => { return compatOldVariables(scope, { @@ -83,7 +84,16 @@ export const ValueDynamicComponent = (props: ValueDynamicComponentProps) => { const modeMap = { // 常量 constant: ( -
+
{React.createElement(DynamicComponent, { value: fieldValue?.value, schema, @@ -140,7 +150,7 @@ export const ValueDynamicComponent = (props: ValueDynamicComponentProps) => { onChange={(value) => { setMode(value); setValue({ - mode: value, + mode: fieldValue?.mode, }); }} > @@ -150,7 +160,7 @@ export const ValueDynamicComponent = (props: ValueDynamicComponentProps) => { ))} - {modeMap[mode]} + {modeMap[fieldValue?.mode || mode]} ); }; diff --git a/packages/core/client/src/schema-settings/LinkageRules/components/LinkageHeader.tsx b/packages/core/client/src/schema-settings/LinkageRules/components/LinkageHeader.tsx index 29a9643ac1..25557b0b97 100644 --- a/packages/core/client/src/schema-settings/LinkageRules/components/LinkageHeader.tsx +++ b/packages/core/client/src/schema-settings/LinkageRules/components/LinkageHeader.tsx @@ -27,7 +27,7 @@ const LinkageRulesTitle = (props) => { const value = array?.field?.value[index]; return ( { ev.stopPropagation();