@xuda.io/xuda-worker-bundle-min 1.3.2438 → 1.3.2439
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 +16 -3
- 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) {
|
|
@@ -663,7 +676,7 @@ func.runtime.bind.update_reference_source_array = async function (options) {
|
|
|
663
676
|
if (field_type === 'object' && options.val_is_reference_field) {
|
|
664
677
|
let obj_item = new_arr[arr_idx];
|
|
665
678
|
let e_exp = options.expression_value.replace(options.bind_field_id, 'obj_item');
|
|
666
|
-
eval(e_exp +
|
|
679
|
+
eval(e_exp + `=${JSON.stringify(options.value)}`);
|
|
667
680
|
new_arr[arr_idx] = obj_item;
|
|
668
681
|
} else {
|
|
669
682
|
new_arr[arr_idx] = options.value;
|