Merge branch 'next' into develop

This commit is contained in:
nocobase[bot] 2025-02-26 04:35:45 +00:00
commit 84f4e6f309
2 changed files with 15 additions and 3 deletions

View File

@ -30,9 +30,15 @@ export const getDatePickerLabels = (props): string => {
return isArr(labels) ? labels.join('~') : labels;
};
export const getLabelFormatValue = (labelUiSchema: ISchema, value: any, isTag = false, TitleRenderer?: any): any => {
export const getLabelFormatValue = (
labelUiSchema: ISchema,
value: any,
isTag = false,
targetTitleCollectionField,
TitleRenderer?: any,
): any => {
if (TitleRenderer) {
return <TitleRenderer value={value} />;
return <TitleRenderer value={value} collectionField={targetTitleCollectionField} />;
}
if (Array.isArray(labelUiSchema?.enum) && value) {
const opt: any = labelUiSchema.enum.find((option: any) => option.value === value);

View File

@ -169,7 +169,13 @@ const useEvents = (
if (res) return out;
const targetTitleCollectionField = fields.find((v) => v.name === fieldNames.title);
const targetTitle = plugin.getTitleFieldInterface(targetTitleCollectionField.interface);
const title = getLabelFormatValue(labelUiSchema, get(item, fieldNames.title), true, targetTitle?.TitleRenderer);
const title = getLabelFormatValue(
labelUiSchema,
get(item, fieldNames.title),
true,
targetTitleCollectionField,
targetTitle?.TitleRenderer,
);
const event: Event = {
id: get(item, fieldNames.id || 'id'),