mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-08 06:59:26 +08:00
Merge branch 'next' into develop
This commit is contained in:
commit
84f4e6f309
@ -30,9 +30,15 @@ export const getDatePickerLabels = (props): string => {
|
|||||||
return isArr(labels) ? labels.join('~') : labels;
|
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) {
|
if (TitleRenderer) {
|
||||||
return <TitleRenderer value={value} />;
|
return <TitleRenderer value={value} collectionField={targetTitleCollectionField} />;
|
||||||
}
|
}
|
||||||
if (Array.isArray(labelUiSchema?.enum) && value) {
|
if (Array.isArray(labelUiSchema?.enum) && value) {
|
||||||
const opt: any = labelUiSchema.enum.find((option: any) => option.value === value);
|
const opt: any = labelUiSchema.enum.find((option: any) => option.value === value);
|
||||||
|
@ -169,7 +169,13 @@ const useEvents = (
|
|||||||
if (res) return out;
|
if (res) return out;
|
||||||
const targetTitleCollectionField = fields.find((v) => v.name === fieldNames.title);
|
const targetTitleCollectionField = fields.find((v) => v.name === fieldNames.title);
|
||||||
const targetTitle = plugin.getTitleFieldInterface(targetTitleCollectionField.interface);
|
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 = {
|
const event: Event = {
|
||||||
id: get(item, fieldNames.id || 'id'),
|
id: get(item, fieldNames.id || 'id'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user