From d2c7092861b2c929384259b18ad6e414d787c99d Mon Sep 17 00:00:00 2001 From: Katherine Date: Tue, 20 Aug 2024 10:30:38 +0800 Subject: [PATCH] fix: error adjusting order of linkage rules (#5086) * fix: error adjusting order of linkage rules * fix: bug * style: style improve --- .../LinkageRules/ValueDynamicComponent.tsx | 21 +++++++++++++------ .../LinkageRules/components/LinkageHeader.tsx | 2 +- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/packages/core/client/src/schema-settings/LinkageRules/ValueDynamicComponent.tsx b/packages/core/client/src/schema-settings/LinkageRules/ValueDynamicComponent.tsx index 66ac45fa90..498b16ef0b 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'; @@ -45,7 +46,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) => { @@ -71,7 +72,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, { @@ -81,7 +82,16 @@ export const ValueDynamicComponent = (props: ValueDynamicComponentProps) => { const modeMap = { // 常量 constant: ( -
+
{React.createElement(DynamicComponent, { value: fieldValue?.value, schema, @@ -110,7 +120,6 @@ export const ValueDynamicComponent = (props: ValueDynamicComponentProps) => {
), }; - return ( - {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();