@xuda.io/xuda-worker-bundle 1.3.2607 → 1.3.2608
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +15 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -563,7 +563,7 @@ func.runtime.bind.build_datasource_changes = function (dsSessionP, currentRecord
|
|
|
563
563
|
},
|
|
564
564
|
};
|
|
565
565
|
};
|
|
566
|
-
func.runtime.bind.resolve_field = async function (SESSION_ID, prog_id, dsSessionP, field_id) {
|
|
566
|
+
func.runtime.bind.resolve_field = async function (SESSION_ID, prog_id, dsSessionP, field_id, iterate_info) {
|
|
567
567
|
let _prog_id = prog_id;
|
|
568
568
|
let _dsP = dsSessionP;
|
|
569
569
|
let is_dynamic_field = false;
|
|
@@ -579,7 +579,20 @@ func.runtime.bind.resolve_field = async function (SESSION_ID, prog_id, dsSession
|
|
|
579
579
|
|
|
580
580
|
if (['_FOR_VAL', '_FOR_KEY'].includes(field_id)) {
|
|
581
581
|
is_dynamic_field = true;
|
|
582
|
-
|
|
582
|
+
if (iterate_info && (iterate_info.iterator_val === field_id || iterate_info.iterator_key === field_id)) {
|
|
583
|
+
const iter_value = iterate_info.iterator_val === field_id ? iterate_info._val : iterate_info._key;
|
|
584
|
+
const toType = function (obj) {
|
|
585
|
+
return {}.toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase();
|
|
586
|
+
};
|
|
587
|
+
field_prop = {
|
|
588
|
+
id: field_id,
|
|
589
|
+
data: { type: 'virtual', field_id },
|
|
590
|
+
props: { fieldType: typeof iter_value !== 'undefined' ? toType(iter_value) : 'string' },
|
|
591
|
+
value: iter_value,
|
|
592
|
+
};
|
|
593
|
+
} else {
|
|
594
|
+
field_prop = SESSION_OBJ[SESSION_ID]?.DS_GLB?.[_dsP]?.dynamic_fields?.[field_id];
|
|
595
|
+
}
|
|
583
596
|
} else {
|
|
584
597
|
field_prop = await find_in_view(field_id, _prog_id);
|
|
585
598
|
if (!field_prop) {
|