fix: custom column title, same as form field title (#1745)

This commit is contained in:
李小斐 2023-04-23 18:29:17 +08:00 committed by GitHub
parent b1068f2d51
commit 6d693a5ab6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 11 additions and 4 deletions

View File

@ -492,6 +492,7 @@ export default {
"Dialog": "Dialog", "Dialog": "Dialog",
"Delete action": "Delete action", "Delete action": "Delete action",
"Custom column title": "Custom column title", "Custom column title": "Custom column title",
'Column title': 'column title',
"Original title: ": "Original title: ", "Original title: ": "Original title: ",
"Delete table column": "Delete table column", "Delete table column": "Delete table column",
"Skip required validation": "Skip required validation", "Skip required validation": "Skip required validation",

View File

@ -415,6 +415,7 @@ export default {
"Dialog": "ダイアログ", "Dialog": "ダイアログ",
"Delete action": "操作を削除", "Delete action": "操作を削除",
"Custom column title": "カスタムカラムタイトル", "Custom column title": "カスタムカラムタイトル",
'Column title': 'カラムタイトル',
"Original title: ": "元のタイトル: ", "Original title: ": "元のタイトル: ",
"Delete table column": "テーブルのカラムを削除", "Delete table column": "テーブルのカラムを削除",
"Skip required validation": "必須のバリデーションをスキップ", "Skip required validation": "必須のバリデーションをスキップ",

View File

@ -452,6 +452,7 @@ export default {
"Dialog": "Diálogo", "Dialog": "Diálogo",
"Delete action": "Excluir ação", "Delete action": "Excluir ação",
"Custom column title": "Título da coluna personalizado", "Custom column title": "Título da coluna personalizado",
'Column title': 'cabeçalho da coluna',
"Original title: ": "Título original: ", "Original title: ": "Título original: ",
"Delete table column": "Excluir coluna da tabela", "Delete table column": "Excluir coluna da tabela",
"Skip required validation": "Ignorar validação obrigatória", "Skip required validation": "Ignorar validação obrigatória",

View File

@ -357,6 +357,7 @@ export default {
"Dialog": "Диалог", "Dialog": "Диалог",
"Delete action": "Удалить действие", "Delete action": "Удалить действие",
"Custom column title": "Пользовательский заголовок колонки", "Custom column title": "Пользовательский заголовок колонки",
'Column title': 'заголовок столбца',
"Original title: ": "Заголовок по умолчанию: ", "Original title: ": "Заголовок по умолчанию: ",
"Delete table column": "Удалить колонку таблицы", "Delete table column": "Удалить колонку таблицы",
"Skip required validation": "Пропустить обязатеьную проверку", "Skip required validation": "Пропустить обязатеьную проверку",

View File

@ -356,6 +356,7 @@ export default {
"Dialog": "Pencere", "Dialog": "Pencere",
"Delete action": "İşlemi sil", "Delete action": "İşlemi sil",
"Custom column title": "Özel sütun başlığı", "Custom column title": "Özel sütun başlığı",
'Column title': 'Sütun başlığı',
"Original title: ": "Orjinal başlık: ", "Original title: ": "Orjinal başlık: ",
"Delete table column": "Tablo sütununu sil", "Delete table column": "Tablo sütununu sil",
"Skip required validation": "Zorunlu alan kontrollerini atla", "Skip required validation": "Zorunlu alan kontrollerini atla",

View File

@ -529,6 +529,7 @@ export default {
'Dialog': '对话框', 'Dialog': '对话框',
'Delete action': '删除操作', 'Delete action': '删除操作',
'Custom column title': '自定义列标题', 'Custom column title': '自定义列标题',
'Column title': '列标题',
'Original title: ': '原始标题: ', 'Original title: ': '原始标题: ',
'Delete table column': '删除列', 'Delete table column': '删除列',

View File

@ -6,11 +6,12 @@ import { GeneralSchemaDesigner, SchemaSettings } from '../../../schema-settings'
import { useCompile, useDesignable } from '../../hooks'; import { useCompile, useDesignable } from '../../hooks';
const useLabelFields = (collectionName?: any) => { const useLabelFields = (collectionName?: any) => {
// 需要在组件顶层调用
const compile = useCompile();
const { getCollectionFields } = useCollectionManager();
if (!collectionName) { if (!collectionName) {
return []; return [];
} }
const compile = useCompile();
const { getCollectionFields } = useCollectionManager();
const targetFields = getCollectionFields(collectionName); const targetFields = getCollectionFields(collectionName);
return targetFields return targetFields
?.filter?.((field) => field?.interface && !field?.target && field.type !== 'boolean' && !field.isForeignKey) ?.filter?.((field) => field?.interface && !field?.target && field.type !== 'boolean' && !field.isForeignKey)
@ -44,9 +45,9 @@ export const TableColumnDesigner = (props) => {
title: t('Custom column title'), title: t('Custom column title'),
properties: { properties: {
title: { title: {
// title: t('Column title'), title: t('Column title'),
default: columnSchema?.title, default: columnSchema?.title,
description: `${t('Original title: ')}${collectionField?.uiSchema?.title || fieldSchema?.title}`, description: `${t('Original field title: ')}${collectionField?.uiSchema?.title || fieldSchema?.title}`,
'x-decorator': 'FormItem', 'x-decorator': 'FormItem',
'x-component': 'Input', 'x-component': 'Input',
'x-component-props': {}, 'x-component-props': {},