mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-01 18:52:20 +08:00
fix: uischema i18n
This commit is contained in:
parent
05f5530232
commit
cbbd4a1db8
@ -129,7 +129,7 @@ export const DefaultSettingsIcon: React.FC<DefaultSettingsIconProps> = ({
|
|||||||
title: t('Confirm Delete'),
|
title: t('Confirm Delete'),
|
||||||
icon: <ExclamationCircleOutlined />,
|
icon: <ExclamationCircleOutlined />,
|
||||||
content: t('Are you sure you want to delete this item? This action cannot be undone.'),
|
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',
|
okType: 'primary',
|
||||||
cancelText: t('Cancel'),
|
cancelText: t('Cancel'),
|
||||||
async onOk() {
|
async onOk() {
|
||||||
|
@ -14,6 +14,7 @@ import { FlowModel } from '../../../../models';
|
|||||||
import { StepDefinition } from '../../../../types';
|
import { StepDefinition } from '../../../../types';
|
||||||
import { resolveDefaultParams, resolveUiSchema, compileUiSchema, getT } from '../../../../utils';
|
import { resolveDefaultParams, resolveUiSchema, compileUiSchema, getT } from '../../../../utils';
|
||||||
import { StepSettingContextProvider, StepSettingContextType, useStepSettingContext } from './StepSettingContext';
|
import { StepSettingContextProvider, StepSettingContextType, useStepSettingContext } from './StepSettingContext';
|
||||||
|
import { toJS } from '@formily/reactive';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查步骤是否已经有了所需的配置值
|
* 检查步骤是否已经有了所需的配置值
|
||||||
@ -174,8 +175,8 @@ const openRequiredParamsStepFormDialog = async ({
|
|||||||
const resolvedStepUiSchema = await resolveUiSchema(stepUiSchema, paramsContext);
|
const resolvedStepUiSchema = await resolveUiSchema(stepUiSchema, paramsContext);
|
||||||
|
|
||||||
// 合并uiSchema,确保step的uiSchema优先级更高
|
// 合并uiSchema,确保step的uiSchema优先级更高
|
||||||
const mergedUiSchema = { ...resolvedActionUiSchema };
|
const mergedUiSchema = { ...toJS(resolvedActionUiSchema) };
|
||||||
Object.entries(resolvedStepUiSchema).forEach(([fieldKey, schema]) => {
|
Object.entries(toJS(resolvedStepUiSchema)).forEach(([fieldKey, schema]) => {
|
||||||
if (mergedUiSchema[fieldKey]) {
|
if (mergedUiSchema[fieldKey]) {
|
||||||
mergedUiSchema[fieldKey] = { ...mergedUiSchema[fieldKey], ...schema };
|
mergedUiSchema[fieldKey] = { ...mergedUiSchema[fieldKey], ...schema };
|
||||||
} else {
|
} else {
|
||||||
|
@ -13,6 +13,7 @@ import React from 'react';
|
|||||||
import { StepSettingsDialogProps } from '../../../../types';
|
import { StepSettingsDialogProps } from '../../../../types';
|
||||||
import { resolveDefaultParams, resolveUiSchema, compileUiSchema, getT } from '../../../../utils';
|
import { resolveDefaultParams, resolveUiSchema, compileUiSchema, getT } from '../../../../utils';
|
||||||
import { StepSettingContextProvider, StepSettingContextType, useStepSettingContext } from './StepSettingContext';
|
import { StepSettingContextProvider, StepSettingContextType, useStepSettingContext } from './StepSettingContext';
|
||||||
|
import { toJS } from '@formily/reactive';
|
||||||
|
|
||||||
const SchemaField = createSchemaField();
|
const SchemaField = createSchemaField();
|
||||||
|
|
||||||
@ -82,8 +83,8 @@ const openStepSettingsDialog = async ({
|
|||||||
const resolvedStepUiSchema = await resolveUiSchema(stepUiSchema, paramsContext);
|
const resolvedStepUiSchema = await resolveUiSchema(stepUiSchema, paramsContext);
|
||||||
|
|
||||||
// 合并uiSchema,确保step的uiSchema优先级更高
|
// 合并uiSchema,确保step的uiSchema优先级更高
|
||||||
const mergedUiSchema = { ...resolvedActionUiSchema };
|
const mergedUiSchema = { ...toJS(resolvedActionUiSchema) };
|
||||||
Object.entries(resolvedStepUiSchema).forEach(([fieldKey, schema]) => {
|
Object.entries(toJS(resolvedStepUiSchema)).forEach(([fieldKey, schema]) => {
|
||||||
if (mergedUiSchema[fieldKey]) {
|
if (mergedUiSchema[fieldKey]) {
|
||||||
mergedUiSchema[fieldKey] = { ...mergedUiSchema[fieldKey], ...schema };
|
mergedUiSchema[fieldKey] = { ...mergedUiSchema[fieldKey], ...schema };
|
||||||
} else {
|
} else {
|
||||||
|
@ -14,6 +14,7 @@ import { useTranslation } from 'react-i18next';
|
|||||||
import { StepSettingsDrawerProps } from '../../../../types';
|
import { StepSettingsDrawerProps } from '../../../../types';
|
||||||
import { resolveDefaultParams, resolveUiSchema, compileUiSchema, getT } from '../../../../utils';
|
import { resolveDefaultParams, resolveUiSchema, compileUiSchema, getT } from '../../../../utils';
|
||||||
import { StepSettingContextProvider, StepSettingContextType, useStepSettingContext } from './StepSettingContext';
|
import { StepSettingContextProvider, StepSettingContextType, useStepSettingContext } from './StepSettingContext';
|
||||||
|
import { toJS } from '@formily/reactive';
|
||||||
|
|
||||||
const SchemaField = createSchemaField();
|
const SchemaField = createSchemaField();
|
||||||
|
|
||||||
@ -82,8 +83,8 @@ const openStepSettingsDrawer = async ({
|
|||||||
const resolvedStepUiSchema = await resolveUiSchema(stepUiSchema, paramsContext);
|
const resolvedStepUiSchema = await resolveUiSchema(stepUiSchema, paramsContext);
|
||||||
|
|
||||||
// 合并uiSchema,确保step的uiSchema优先级更高
|
// 合并uiSchema,确保step的uiSchema优先级更高
|
||||||
const mergedUiSchema = { ...resolvedActionUiSchema };
|
const mergedUiSchema = { ...toJS(resolvedActionUiSchema) };
|
||||||
Object.entries(resolvedStepUiSchema).forEach(([fieldKey, schema]) => {
|
Object.entries(toJS(resolvedStepUiSchema)).forEach(([fieldKey, schema]) => {
|
||||||
if (mergedUiSchema[fieldKey]) {
|
if (mergedUiSchema[fieldKey]) {
|
||||||
mergedUiSchema[fieldKey] = { ...mergedUiSchema[fieldKey], ...schema };
|
mergedUiSchema[fieldKey] = { ...mergedUiSchema[fieldKey], ...schema };
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user