From cbbd4a1db895f75b8420bd13278d941d6e96728c Mon Sep 17 00:00:00 2001 From: gchust Date: Sat, 28 Jun 2025 21:23:53 +0800 Subject: [PATCH] fix: uischema i18n --- .../settings/wrappers/contextual/DefaultSettingsIcon.tsx | 2 +- .../wrappers/contextual/StepRequiredSettingsDialog.tsx | 5 +++-- .../settings/wrappers/contextual/StepSettingsDialog.tsx | 5 +++-- .../settings/wrappers/contextual/StepSettingsDrawer.tsx | 5 +++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/core/flow-engine/src/components/settings/wrappers/contextual/DefaultSettingsIcon.tsx b/packages/core/flow-engine/src/components/settings/wrappers/contextual/DefaultSettingsIcon.tsx index bb08660cb6..455561b2d2 100644 --- a/packages/core/flow-engine/src/components/settings/wrappers/contextual/DefaultSettingsIcon.tsx +++ b/packages/core/flow-engine/src/components/settings/wrappers/contextual/DefaultSettingsIcon.tsx @@ -129,7 +129,7 @@ export const DefaultSettingsIcon: React.FC = ({ title: t('Confirm Delete'), icon: , content: t('Are you sure you want to delete this item? This action cannot be undone.'), - okText: t('Confirm Delete'), + okText: t('Confirm'), okType: 'primary', cancelText: t('Cancel'), async onOk() { diff --git a/packages/core/flow-engine/src/components/settings/wrappers/contextual/StepRequiredSettingsDialog.tsx b/packages/core/flow-engine/src/components/settings/wrappers/contextual/StepRequiredSettingsDialog.tsx index c30e9d0da3..467a271a28 100644 --- a/packages/core/flow-engine/src/components/settings/wrappers/contextual/StepRequiredSettingsDialog.tsx +++ b/packages/core/flow-engine/src/components/settings/wrappers/contextual/StepRequiredSettingsDialog.tsx @@ -14,6 +14,7 @@ import { FlowModel } from '../../../../models'; import { StepDefinition } from '../../../../types'; import { resolveDefaultParams, resolveUiSchema, compileUiSchema, getT } from '../../../../utils'; import { StepSettingContextProvider, StepSettingContextType, useStepSettingContext } from './StepSettingContext'; +import { toJS } from '@formily/reactive'; /** * 检查步骤是否已经有了所需的配置值 @@ -174,8 +175,8 @@ const openRequiredParamsStepFormDialog = async ({ const resolvedStepUiSchema = await resolveUiSchema(stepUiSchema, paramsContext); // 合并uiSchema,确保step的uiSchema优先级更高 - const mergedUiSchema = { ...resolvedActionUiSchema }; - Object.entries(resolvedStepUiSchema).forEach(([fieldKey, schema]) => { + const mergedUiSchema = { ...toJS(resolvedActionUiSchema) }; + Object.entries(toJS(resolvedStepUiSchema)).forEach(([fieldKey, schema]) => { if (mergedUiSchema[fieldKey]) { mergedUiSchema[fieldKey] = { ...mergedUiSchema[fieldKey], ...schema }; } else { diff --git a/packages/core/flow-engine/src/components/settings/wrappers/contextual/StepSettingsDialog.tsx b/packages/core/flow-engine/src/components/settings/wrappers/contextual/StepSettingsDialog.tsx index 8509ecba9c..0bd86dea38 100644 --- a/packages/core/flow-engine/src/components/settings/wrappers/contextual/StepSettingsDialog.tsx +++ b/packages/core/flow-engine/src/components/settings/wrappers/contextual/StepSettingsDialog.tsx @@ -13,6 +13,7 @@ import React from 'react'; import { StepSettingsDialogProps } from '../../../../types'; import { resolveDefaultParams, resolveUiSchema, compileUiSchema, getT } from '../../../../utils'; import { StepSettingContextProvider, StepSettingContextType, useStepSettingContext } from './StepSettingContext'; +import { toJS } from '@formily/reactive'; const SchemaField = createSchemaField(); @@ -82,8 +83,8 @@ const openStepSettingsDialog = async ({ const resolvedStepUiSchema = await resolveUiSchema(stepUiSchema, paramsContext); // 合并uiSchema,确保step的uiSchema优先级更高 - const mergedUiSchema = { ...resolvedActionUiSchema }; - Object.entries(resolvedStepUiSchema).forEach(([fieldKey, schema]) => { + const mergedUiSchema = { ...toJS(resolvedActionUiSchema) }; + Object.entries(toJS(resolvedStepUiSchema)).forEach(([fieldKey, schema]) => { if (mergedUiSchema[fieldKey]) { mergedUiSchema[fieldKey] = { ...mergedUiSchema[fieldKey], ...schema }; } else { diff --git a/packages/core/flow-engine/src/components/settings/wrappers/contextual/StepSettingsDrawer.tsx b/packages/core/flow-engine/src/components/settings/wrappers/contextual/StepSettingsDrawer.tsx index f0c7be7631..f794d9e8d9 100644 --- a/packages/core/flow-engine/src/components/settings/wrappers/contextual/StepSettingsDrawer.tsx +++ b/packages/core/flow-engine/src/components/settings/wrappers/contextual/StepSettingsDrawer.tsx @@ -14,6 +14,7 @@ import { useTranslation } from 'react-i18next'; import { StepSettingsDrawerProps } from '../../../../types'; import { resolveDefaultParams, resolveUiSchema, compileUiSchema, getT } from '../../../../utils'; import { StepSettingContextProvider, StepSettingContextType, useStepSettingContext } from './StepSettingContext'; +import { toJS } from '@formily/reactive'; const SchemaField = createSchemaField(); @@ -82,8 +83,8 @@ const openStepSettingsDrawer = async ({ const resolvedStepUiSchema = await resolveUiSchema(stepUiSchema, paramsContext); // 合并uiSchema,确保step的uiSchema优先级更高 - const mergedUiSchema = { ...resolvedActionUiSchema }; - Object.entries(resolvedStepUiSchema).forEach(([fieldKey, schema]) => { + const mergedUiSchema = { ...toJS(resolvedActionUiSchema) }; + Object.entries(toJS(resolvedStepUiSchema)).forEach(([fieldKey, schema]) => { if (mergedUiSchema[fieldKey]) { mergedUiSchema[fieldKey] = { ...mergedUiSchema[fieldKey], ...schema }; } else {