117 nested refs intermediate

This commit is contained in:
msyu
2025-07-01 11:54:58 +03:00
parent 48b9fcf890
commit a0bc1476d6
3 changed files with 87 additions and 3 deletions
+13 -1
View File
@@ -86,6 +86,10 @@
<m:field>p.descr</m:field>
<m:field>p.man</m:field>
<m:field>p.sort</m:field>
<m:field>p.nested_ref</m:field>
<!--- <m:field>p.config::text as config</m:field> --->
<m:field>p.config::text</m:field><!--- в таком виде конфиг доступен для кода, но не выводится в респонсе --->
<m:field>null as nested_ref_data</m:field>
<m:field formatter=#request.castToBool#>(
select 1 from svc_operation_cfs_param m
join svc_operation om on (m.svc_operation_id=om.svc_operation_id)
@@ -117,7 +121,15 @@
<cfif len(trim(local.qCfsParam.value_list)) AND listLen(local.qCfsParam.value_list) EQ 1>
<cfset local.qCfsParam.default_value=local.qCfsParam.value_list/><!--- *** не очень красиво перетирать query, но делаем это довольно часто --->
</cfif>
</cfif>
<cfelseif len(local.qCfsParam.nested_ref)><!--- *** спрашивается, зачем нам изгаляться и возвращать замыкание, когда нам нужен json --->
<!--- <cfset var fNestedRef = generateClosure(local.qCfsParam.nested_ref, local.qCfsParam.config)/> --->
<cfset var args = {
"functionName":"#local.qCfsParam.nested_ref#",
"config":"#local.qCfsParam.config#"
}/>
<cfinvoke component="instance_operation_cfs_param" method="generateClosure" argumentCollection=#args# returnVariable="local.fNestedRef"/>
<cfset local.qCfsParam.nested_ref_data = local.fNestedRef() />
</cfif>
<cfif data_type EQ "map"><!--- *** частичное дублирование с instance_operation_cfs_param.processMap --->