Merge branch 'next' into develop

This commit is contained in:
nocobase[bot] 2024-12-14 15:04:02 +00:00
commit b10daeccde
4 changed files with 13 additions and 6 deletions

View File

@ -266,7 +266,11 @@ const PreviewCom = (props) => {
}; };
function areEqual(prevProps, nextProps) { function areEqual(prevProps, nextProps) {
return nextProps.name === prevProps.name && nextProps.sources === prevProps.sources; return (
nextProps.viewName === prevProps.viewName &&
nextProps.schema === prevProps.schema &&
nextProps.source === prevProps.source
);
} }
export const PreviewFields = React.memo(PreviewCom, areEqual); export const PreviewFields = React.memo(PreviewCom, areEqual);

View File

@ -73,7 +73,7 @@ export class ViewCollectionTemplate extends CollectionTemplate {
when: '{{isPG}}', when: '{{isPG}}',
fulfill: { fulfill: {
state: { state: {
value: "{{$deps[0].split('_')?.[0]}}", value: "{{$deps[0].split('@')?.[0]}}",
}, },
}, },
otherwise: { otherwise: {
@ -91,7 +91,7 @@ export class ViewCollectionTemplate extends CollectionTemplate {
when: '{{isPG}}', when: '{{isPG}}',
fulfill: { fulfill: {
state: { state: {
value: '{{$deps[0].match(/^([^_]+)_(.*)$/)?.[2]}}', value: "{{$deps[0].split('@')?.[1]}}",
}, },
}, },
otherwise: { otherwise: {
@ -125,6 +125,7 @@ export class ViewCollectionTemplate extends CollectionTemplate {
type: 'array', type: 'array',
'x-component': PreviewFields, 'x-component': PreviewFields,
'x-hidden': '{{ !createOnly }}', 'x-hidden': '{{ !createOnly }}',
'x-decorator': 'FormItem',
'x-reactions': { 'x-reactions': {
dependencies: ['name'], dependencies: ['name'],
fulfill: { fulfill: {
@ -133,6 +134,7 @@ export class ViewCollectionTemplate extends CollectionTemplate {
}, },
}, },
}, },
description: `{{t("Fields can only be used correctly if they are defined with an interface.")}}`,
}, },
preview: { preview: {
type: 'void', type: 'void',

View File

@ -1025,7 +1025,7 @@
"Ellipsis": "省略", "Ellipsis": "省略",
"Set block layout": "设置区块布局", "Set block layout": "设置区块布局",
"Add & Update": "添加 & 更新", "Add & Update": "添加 & 更新",
"Table size":"表格大小", "Table size": "表格大小",
"Hide column": "隐藏列", "Hide column": "隐藏列",
"In configuration mode, the entire column becomes transparent. In non-configuration mode, the entire column will be hidden. Even if the entire column is hidden, its configured default values and other settings will still take effect.": "在配置模式下,整个列会变为透明色。在非配置模式下,整个列将被隐藏。即使整个列被隐藏了,其配置的默认值和其他设置仍然有效。", "In configuration mode, the entire column becomes transparent. In non-configuration mode, the entire column will be hidden. Even if the entire column is hidden, its configured default values and other settings will still take effect.": "在配置模式下,整个列会变为透明色。在非配置模式下,整个列将被隐藏。即使整个列被隐藏了,其配置的默认值和其他设置仍然有效。",
"Plugin": "插件", "Plugin": "插件",
@ -1034,5 +1034,6 @@
"Package name": "包名", "Package name": "包名",
"Associate":"关联", "Associate":"关联",
"Please add or select record":"请添加或选择数据", "Please add or select record":"请添加或选择数据",
"No data":"暂无数据" "No data":"暂无数据",
"Fields can only be used correctly if they are defined with an interface.": "只有字段设置了interface字段才能正常使用"
} }

View File

@ -163,7 +163,7 @@ export const ConfigurationTable = () => {
const schema = item.schema; const schema = item.schema;
return { return {
label: schema ? `${schema}.${compile(item.name)}` : item.name, label: schema ? `${schema}.${compile(item.name)}` : item.name,
value: schema ? `${schema}_${item.name}` : item.name, value: schema ? `${schema}@${item.name}` : item.name,
}; };
}); });
}); });