fix: шаблон названия резолвит массив id справочника в отображаемые значения

This commit is contained in:
2026-07-22 14:04:39 +03:00
parent 52bec07413
commit 72de9a25fb

View File

@@ -402,6 +402,13 @@ export function formatFieldValueForTitle(val: any, fieldType?: string, ctx?: Fie
if (typeof val === 'string') {
try { parsedVal = JSON.parse(val); } catch { parsedVal = val; }
}
// Handle array (multi-select)
if (Array.isArray(parsedVal)) {
return parsedVal
.map((v) => formatFieldValueForTitle(v, fieldType, ctx, fieldOptions))
.filter(Boolean)
.join(', ');
}
// Try to resolve via tableRowMap first
if (ctx?.tableRowMap && fieldOptions) {
const parsedOpts = safeParseOptions(fieldOptions);