@xuda.io/runtime-bundle 1.0.717 → 1.0.719
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/js/xuda-runtime-bundle.js +170 -186
- package/js/xuda-runtime-bundle.min.js +1 -1
- package/js/xuda-runtime-slim.js +167 -183
- package/js/xuda-runtime-slim.min.es.js +167 -183
- package/js/xuda-runtime-slim.min.js +1 -1
- package/js/xuda-server-bundle.min.mjs +1 -1
- package/js/xuda-server-bundle.mjs +6 -33
- package/js/xuda-worker-bundle.js +6 -33
- package/js/xuda-worker-bundle.min.js +1 -1
- package/package.json +1 -1
|
@@ -28009,7 +28009,7 @@ func.datasource.create = async function (
|
|
|
28009
28009
|
rowIdP,
|
|
28010
28010
|
jobNoP,
|
|
28011
28011
|
calling_trigger_prop,
|
|
28012
|
-
|
|
28012
|
+
screen_param,
|
|
28013
28013
|
NA_isInitP,
|
|
28014
28014
|
NA_callingSourceP,
|
|
28015
28015
|
calling_jobP,
|
|
@@ -28042,7 +28042,6 @@ func.datasource.create = async function (
|
|
|
28042
28042
|
parameters_obj_inP,
|
|
28043
28043
|
static_refreshP,
|
|
28044
28044
|
worker_id,
|
|
28045
|
-
parameters_raw_obj,
|
|
28046
28045
|
};
|
|
28047
28046
|
|
|
28048
28047
|
var IS_DATASOURCE_REFRESH = null;
|
|
@@ -28178,7 +28177,7 @@ func.datasource.create = async function (
|
|
|
28178
28177
|
args.rowIdP,
|
|
28179
28178
|
args.jobNoP,
|
|
28180
28179
|
args.calling_trigger_prop,
|
|
28181
|
-
|
|
28180
|
+
null,
|
|
28182
28181
|
null,
|
|
28183
28182
|
null,
|
|
28184
28183
|
args.calling_jobP,
|
|
@@ -28219,7 +28218,7 @@ func.datasource.create = async function (
|
|
|
28219
28218
|
return done(SESSION_ID, jsonP.dsSession, true);
|
|
28220
28219
|
});
|
|
28221
28220
|
};
|
|
28222
|
-
func.datasource.prepare = async function (SESSION_ID, prog_id, dataSourceNoP, parentDataSourceNoP, containerIdP, rowIdP, jobNoP, calling_trigger_prop,
|
|
28221
|
+
func.datasource.prepare = async function (SESSION_ID, prog_id, dataSourceNoP, parentDataSourceNoP, containerIdP, rowIdP, jobNoP, calling_trigger_prop, NA_screen_param, NA_isInitP, callingSourceP, calling_jobP, NA_screen_dsP, is_panelP, parameters_obj_inP, static_refreshP, run_atP, worker_id) {
|
|
28223
28222
|
const set_parameters = async function () {
|
|
28224
28223
|
var _session = SESSION_OBJ[SESSION_ID];
|
|
28225
28224
|
const get_Out_parameters = async function (fieldIdP, located_field_param_idxP, param_row_idP) {
|
|
@@ -28348,7 +28347,6 @@ func.datasource.prepare = async function (SESSION_ID, prog_id, dataSourceNoP, pa
|
|
|
28348
28347
|
static_refreshP,
|
|
28349
28348
|
run_atP,
|
|
28350
28349
|
worker_id,
|
|
28351
|
-
parameters_raw_obj,
|
|
28352
28350
|
};
|
|
28353
28351
|
|
|
28354
28352
|
var dataSourceSession = null;
|
|
@@ -28970,8 +28968,8 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
|
|
|
28970
28968
|
}
|
|
28971
28969
|
|
|
28972
28970
|
// initiated with Update but no rows found
|
|
28973
|
-
if (tree_obj.crudMode === 'U' && tree_obj.allowCreate && !_ds?.data_feed?.rows?.length) {
|
|
28974
|
-
|
|
28971
|
+
// if (tree_obj.crudMode === 'U' && tree_obj.allowCreate && !_ds?.data_feed?.rows?.length) {
|
|
28972
|
+
if (tree_obj.crudMode === 'U' && tree_obj.allowCreate && !_raw_data_rows?.length) {
|
|
28975
28973
|
_ds.set_mode = 'C';
|
|
28976
28974
|
// _raw_data_rows[glb.newRecord] = [{ _ROWID: "newRecord" }];
|
|
28977
28975
|
|
|
@@ -29267,7 +29265,7 @@ func.datasource.run_events_functions = async function (SESSION_ID, dataSourceSes
|
|
|
29267
29265
|
clearInterval(interval);
|
|
29268
29266
|
resolve(job_num);
|
|
29269
29267
|
}
|
|
29270
|
-
if (i >
|
|
29268
|
+
if (i > 20) {
|
|
29271
29269
|
console.error('deadlock detected');
|
|
29272
29270
|
clearInterval(interval);
|
|
29273
29271
|
resolve(job_num);
|
|
@@ -30005,18 +30003,6 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
|
|
|
30005
30003
|
|
|
30006
30004
|
if (!fields_changed.includes(field_id)) {
|
|
30007
30005
|
fields_changed.push(field_id);
|
|
30008
|
-
|
|
30009
|
-
///// REFRESH PARAMETERS IN
|
|
30010
|
-
// for (const [_dsSession, _ds] of Object.entries(_session.DS_GLB)) {
|
|
30011
|
-
// if (_ds.args.parameters_raw_obj) {
|
|
30012
|
-
// for (const [key, exp] of Object.entries(_ds.args.parameters_raw_obj)) {
|
|
30013
|
-
// if (exp.includes(field_id)) {
|
|
30014
|
-
// let ret = await func.expression.get(SESSION_ID, exp, _dsSession, 'parameters');
|
|
30015
|
-
// _ds.in_parameters[key].value = ret.result;
|
|
30016
|
-
// }
|
|
30017
|
-
// }
|
|
30018
|
-
// }
|
|
30019
|
-
// }
|
|
30020
30006
|
}
|
|
30021
30007
|
if (!datasource_changed.includes(dataSource)) {
|
|
30022
30008
|
datasource_changed.push(dataSource);
|
|
@@ -30063,19 +30049,6 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
|
|
|
30063
30049
|
datasource_changed[0], // refresh the current datasource only
|
|
30064
30050
|
);
|
|
30065
30051
|
}
|
|
30066
|
-
// ///// REFRESH PARAMETERS IN
|
|
30067
|
-
// if (fields_changed.length) {
|
|
30068
|
-
// for (const [_dsSession, _ds] of Object.entries(_session.DS_GLB)) {
|
|
30069
|
-
// if (_ds.args.parameters_raw_obj) {
|
|
30070
|
-
// for (const [key, val] of Object.entries(_ds.args.parameters_raw_obj)) {
|
|
30071
|
-
// if (fields_changed.includes(val)) {
|
|
30072
|
-
// let ret = await func.expression.get(SESSION_ID, '@' + val, _dsSession, 'parameters');
|
|
30073
|
-
// _ds.in_parameters[val].value = ret.result;
|
|
30074
|
-
// }
|
|
30075
|
-
// }
|
|
30076
|
-
// }
|
|
30077
|
-
// }
|
|
30078
|
-
// }
|
|
30079
30052
|
}
|
|
30080
30053
|
resolve();
|
|
30081
30054
|
});
|
|
@@ -30870,7 +30843,7 @@ func.datasource.get_args_property_value = async function (SESSION_ID, dsSession,
|
|
|
30870
30843
|
return _value;
|
|
30871
30844
|
};
|
|
30872
30845
|
func.UI.screen = {};
|
|
30873
|
-
func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callingDataSource_objP, $callingContainerP, triggerIdP, rowIdP, jobNoP, is_panelP, parameters_obj_inP, source_functionP, call_screen_propertiesP, refreshed_ds
|
|
30846
|
+
func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callingDataSource_objP, $callingContainerP, triggerIdP, rowIdP, jobNoP, is_panelP, parameters_obj_inP, source_functionP, call_screen_propertiesP, refreshed_ds) {
|
|
30874
30847
|
if (!prog_id) return console.error('program is empty');
|
|
30875
30848
|
let screen_ret = await func.utils.get_screen_obj(SESSION_ID, prog_id);
|
|
30876
30849
|
if (!screen_ret) return console.error('program is not a screen object');
|
|
@@ -30923,7 +30896,6 @@ func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callin
|
|
|
30923
30896
|
screenInfo,
|
|
30924
30897
|
call_screen_propertiesP,
|
|
30925
30898
|
parentDataSourceNoP: _session.DS_GLB?.[callingDataSource_objP?.dsSession]?.dsSession || callingDataSource_objP?.parentDataSourceNo || 0,
|
|
30926
|
-
parameters_raw_obj,
|
|
30927
30899
|
};
|
|
30928
30900
|
|
|
30929
30901
|
switch (screen_type) {
|
|
@@ -31090,7 +31062,7 @@ func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callin
|
|
|
31090
31062
|
rowIdP,
|
|
31091
31063
|
jobNoP,
|
|
31092
31064
|
null,
|
|
31093
|
-
|
|
31065
|
+
null,
|
|
31094
31066
|
null,
|
|
31095
31067
|
null,
|
|
31096
31068
|
null,
|
|
@@ -31697,200 +31669,212 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
|
|
|
31697
31669
|
}
|
|
31698
31670
|
};
|
|
31699
31671
|
|
|
31700
|
-
func.UI.screen.
|
|
31701
|
-
|
|
31702
|
-
|
|
31703
|
-
|
|
31704
|
-
|
|
31705
|
-
|
|
31706
|
-
|
|
31707
|
-
|
|
31708
|
-
}
|
|
31709
|
-
}
|
|
31710
|
-
|
|
31711
|
-
const panels_obj = await func.UI.utils.get_panels_wrapper_from_dom(SESSION_ID, $(SESSION_OBJ[SESSION_ID].root_element), false);
|
|
31712
|
-
|
|
31713
|
-
for await (const [parent_element_ui_id, panel_val] of Object.entries(panels_obj)) {
|
|
31714
|
-
const progDataSource_str = JSON.stringify(panel_val.prog_doc.progDataSource);
|
|
31715
|
-
|
|
31716
|
-
var found, refresh_reason, refresh_details;
|
|
31717
|
-
if (fields_changed_arr) {
|
|
31718
|
-
if (fields_changed_datasource && panel_val._ds.dsSession <= Number(fields_changed_datasource)) {
|
|
31719
|
-
continue;
|
|
31720
|
-
}
|
|
31721
|
-
for (const field_id of fields_changed_arr) {
|
|
31722
|
-
// get panel attributes
|
|
31723
|
-
const _attributes = panel_val?.panelXuAttributes || {};
|
|
31672
|
+
// func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr, datasource_changed, fields_changed_datasource) {
|
|
31673
|
+
// // check the main program
|
|
31674
|
+
// if (fields_changed_datasource) {
|
|
31675
|
+
// const _session = SESSION_OBJ[SESSION_ID];
|
|
31676
|
+
// const _ds = _session.DS_GLB[fields_changed_datasource];
|
|
31677
|
+
// const prog_doc = await func.utils.DOCS_OBJ.get(SESSION_ID, _ds.prog_id);
|
|
31678
|
+
// const progDataSource_str = JSON.stringify(prog_doc.progDataSource);
|
|
31679
|
+
// for (const field_id of fields_changed_arr || []) {
|
|
31724
31680
|
|
|
31725
|
-
|
|
31726
|
-
|
|
31681
|
+
// }
|
|
31682
|
+
// }
|
|
31727
31683
|
|
|
31728
|
-
|
|
31729
|
-
refresh_reason = `program ${_attributes['xu-exp:program']} ${field_id} changed `;
|
|
31730
|
-
refresh_details = _attributes;
|
|
31731
|
-
break;
|
|
31732
|
-
}
|
|
31684
|
+
// const panels_obj = await func.UI.utils.get_panels_wrapper_from_dom(SESSION_ID, $(SESSION_OBJ[SESSION_ID].root_element), false);
|
|
31733
31685
|
|
|
31734
|
-
|
|
31735
|
-
|
|
31736
|
-
for (const [attr, value] of Object.entries(_attributes)) {
|
|
31737
|
-
const pattern = /xu-exp:(\w+)/;
|
|
31738
|
-
const match = attr.match(pattern);
|
|
31686
|
+
// for await (const [parent_element_ui_id, panel_val] of Object.entries(panels_obj)) {
|
|
31687
|
+
// const progDataSource_str = JSON.stringify(panel_val.prog_doc.progDataSource);
|
|
31739
31688
|
|
|
31740
|
-
|
|
31741
|
-
|
|
31742
|
-
|
|
31743
|
-
|
|
31744
|
-
|
|
31745
|
-
|
|
31746
|
-
|
|
31747
|
-
|
|
31748
|
-
// search parameter in field in the target program's progDataSource
|
|
31749
|
-
found = progDataSource_str?.includes('@' + parameter_in_field_id);
|
|
31689
|
+
// var found, refresh_reason, refresh_details;
|
|
31690
|
+
// if (fields_changed_arr) {
|
|
31691
|
+
// if (fields_changed_datasource && panel_val._ds.dsSession <= Number(fields_changed_datasource)) {
|
|
31692
|
+
// continue;
|
|
31693
|
+
// }
|
|
31694
|
+
// for (const field_id of fields_changed_arr) {
|
|
31695
|
+
// // get panel attributes
|
|
31696
|
+
// const _attributes = panel_val?.panelXuAttributes || {};
|
|
31750
31697
|
|
|
31751
|
-
|
|
31752
|
-
|
|
31753
|
-
refresh_details = panel_val?.prog_doc?.progDataSource;
|
|
31698
|
+
// // detect if program changed
|
|
31699
|
+
// found = _attributes['xu-exp:program']?.includes('@' + field_id);
|
|
31754
31700
|
|
|
31755
|
-
|
|
31756
|
-
|
|
31701
|
+
// if (found) {
|
|
31702
|
+
// refresh_reason = `program ${_attributes['xu-exp:program']} ${field_id} changed `;
|
|
31703
|
+
// refresh_details = _attributes;
|
|
31704
|
+
// break;
|
|
31705
|
+
// }
|
|
31757
31706
|
|
|
31758
|
-
|
|
31759
|
-
|
|
31707
|
+
// // _attributes holds also info of parameters in code_in: @code
|
|
31708
|
+
// // search field changed in panel call send parameters exp
|
|
31709
|
+
// for (const [attr, value] of Object.entries(_attributes)) {
|
|
31710
|
+
// const pattern = /xu-exp:(\w+)/;
|
|
31711
|
+
// const match = attr.match(pattern);
|
|
31760
31712
|
|
|
31761
|
-
|
|
31762
|
-
|
|
31763
|
-
|
|
31713
|
+
// if (!match) {
|
|
31714
|
+
// // continue if attribute is not expression
|
|
31715
|
+
// continue;
|
|
31716
|
+
// }
|
|
31717
|
+
// // code_in
|
|
31718
|
+
// const parameter_in_field_id = match?.[1];
|
|
31719
|
+
// // @code
|
|
31720
|
+
// if (value.includes(field_id)) {
|
|
31721
|
+
// // search parameter in field in the target program's progDataSource
|
|
31722
|
+
// found = progDataSource_str?.includes('@' + parameter_in_field_id);
|
|
31723
|
+
|
|
31724
|
+
// if (found) {
|
|
31725
|
+
// refresh_reason = `field ${field_id} in progDataSource parameter_in changed`;
|
|
31726
|
+
// refresh_details = panel_val?.prog_doc?.progDataSource;
|
|
31727
|
+
|
|
31728
|
+
// break;
|
|
31729
|
+
// }
|
|
31764
31730
|
|
|
31765
|
-
|
|
31766
|
-
|
|
31767
|
-
}
|
|
31768
|
-
}
|
|
31731
|
+
// // found = find_field_in_progUi(prog_doc.progUi, parameter_in_field_id, 'xu-for');
|
|
31732
|
+
// found = func.UI.find_field_in_progUi_attributes(panel_val.prog_doc.progUi, parameter_in_field_id, 'xu-for').length;
|
|
31769
31733
|
|
|
31770
|
-
|
|
31734
|
+
// if (found) {
|
|
31735
|
+
// refresh_reason = `field ${field_id} in progUi xu-for parameter_in changed`;
|
|
31736
|
+
// refresh_details = found;
|
|
31771
31737
|
|
|
31772
|
-
|
|
31773
|
-
|
|
31774
|
-
|
|
31775
|
-
|
|
31776
|
-
refresh_details = panel_val?.prog_doc?.progDataSource;
|
|
31738
|
+
// break;
|
|
31739
|
+
// }
|
|
31740
|
+
// }
|
|
31741
|
+
// }
|
|
31777
31742
|
|
|
31778
|
-
|
|
31779
|
-
}
|
|
31743
|
+
// if (found) break;
|
|
31780
31744
|
|
|
31781
|
-
|
|
31782
|
-
|
|
31783
|
-
|
|
31784
|
-
|
|
31745
|
+
// // search field changed in the target program's progDataSource // @code
|
|
31746
|
+
// found = progDataSource_str?.includes('@' + field_id);
|
|
31747
|
+
// if (found) {
|
|
31748
|
+
// refresh_reason = `field ${field_id} in progDataSource changed`;
|
|
31749
|
+
// refresh_details = panel_val?.prog_doc?.progDataSource;
|
|
31785
31750
|
|
|
31786
|
-
|
|
31787
|
-
|
|
31751
|
+
// break;
|
|
31752
|
+
// }
|
|
31788
31753
|
|
|
31789
|
-
|
|
31790
|
-
|
|
31791
|
-
|
|
31792
|
-
|
|
31793
|
-
}
|
|
31754
|
+
// found = func.UI.find_field_in_progUi_attributes(panel_val.prog_doc.progUi, field_id, 'xu-for').length;
|
|
31755
|
+
// if (found) {
|
|
31756
|
+
// refresh_reason = `field ${field_id} in progUi xu-for changed`;
|
|
31757
|
+
// refresh_details = found;
|
|
31794
31758
|
|
|
31795
|
-
|
|
31796
|
-
|
|
31797
|
-
refresh_reason = `panel datasource ${datasource_changed} changed`;
|
|
31798
|
-
refresh_details = '';
|
|
31759
|
+
// break;
|
|
31760
|
+
// }
|
|
31799
31761
|
|
|
31800
|
-
|
|
31801
|
-
|
|
31802
|
-
|
|
31803
|
-
|
|
31804
|
-
|
|
31805
|
-
if (_session.engine_mode === 'live_preview') {
|
|
31806
|
-
console.info('========= refresh info ==============');
|
|
31807
|
-
console.info('reason:', refresh_reason);
|
|
31808
|
-
console.info('details:', refresh_details);
|
|
31809
|
-
console.info('panel:', panel_val);
|
|
31810
|
-
console.info('=====================================');
|
|
31811
|
-
}
|
|
31812
|
-
const $div_elm = panel_val.$panel_div;
|
|
31813
|
-
const wrapper_data = $div_elm.data();
|
|
31762
|
+
// if (found) {
|
|
31763
|
+
// break;
|
|
31764
|
+
// }
|
|
31765
|
+
// }
|
|
31766
|
+
// }
|
|
31814
31767
|
|
|
31815
|
-
|
|
31768
|
+
// if (datasource_changed) {
|
|
31769
|
+
// if (panel_val._ds.dsSession == datasource_changed) {
|
|
31770
|
+
// refresh_reason = `panel datasource ${datasource_changed} changed`;
|
|
31771
|
+
// refresh_details = '';
|
|
31816
31772
|
|
|
31817
|
-
|
|
31818
|
-
|
|
31819
|
-
|
|
31820
|
-
|
|
31821
|
-
|
|
31822
|
-
|
|
31823
|
-
|
|
31824
|
-
|
|
31773
|
+
// found = true;
|
|
31774
|
+
// }
|
|
31775
|
+
// }
|
|
31776
|
+
// if (found) {
|
|
31777
|
+
// const _session = SESSION_OBJ[SESSION_ID];
|
|
31778
|
+
// if (_session.engine_mode === 'live_preview') {
|
|
31779
|
+
// console.info('========= refresh info ==============');
|
|
31780
|
+
// console.info('reason:', refresh_reason);
|
|
31781
|
+
// console.info('details:', refresh_details);
|
|
31782
|
+
// console.info('panel:', panel_val);
|
|
31783
|
+
// console.info('=====================================');
|
|
31784
|
+
// }
|
|
31785
|
+
// const $div_elm = panel_val.$panel_div;
|
|
31786
|
+
// const wrapper_data = $div_elm.data();
|
|
31787
|
+
|
|
31788
|
+
// if (_.isEmpty(wrapper_data)) continue;
|
|
31789
|
+
|
|
31790
|
+
// try {
|
|
31791
|
+
// const ts = Date.now();
|
|
31792
|
+
// // remove old panel content
|
|
31793
|
+
// $.each(panel_val.ids, async function (key, val) {
|
|
31794
|
+
// $("[xu-ui-id='" + val + "']")
|
|
31795
|
+
// .attr('xu-ui-id', val + ts)
|
|
31796
|
+
// .removeData();
|
|
31797
|
+
// });
|
|
31825
31798
|
|
|
31826
|
-
|
|
31827
|
-
|
|
31799
|
+
// let refreshed_ds;
|
|
31800
|
+
// // check if ds exist and deleted by garbage collector
|
|
31828
31801
|
|
|
31829
|
-
|
|
31830
|
-
|
|
31831
|
-
|
|
31832
|
-
|
|
31833
|
-
|
|
31802
|
+
// if (_session.DS_GLB[panel_val._ds.dsSession]) {
|
|
31803
|
+
// refreshed_ds = panel_val._ds.dsSession;
|
|
31804
|
+
// }
|
|
31805
|
+
// for await (const item of wrapper_data.xuData.node_org.children) {
|
|
31806
|
+
// if (item.tagName !== 'xu-panel') continue;
|
|
31834
31807
|
|
|
31835
|
-
|
|
31836
|
-
|
|
31837
|
-
|
|
31838
|
-
|
|
31839
|
-
|
|
31840
|
-
|
|
31841
|
-
|
|
31842
|
-
|
|
31843
|
-
|
|
31844
|
-
|
|
31845
|
-
|
|
31846
|
-
|
|
31847
|
-
|
|
31848
|
-
|
|
31849
|
-
|
|
31808
|
+
// const new_$div = await func.UI.screen.render_ui_tree(
|
|
31809
|
+
// SESSION_ID,
|
|
31810
|
+
// $div_elm, // the wrapper
|
|
31811
|
+
// _.cloneDeep(item), // _.cloneDeep(wrapper_data.xuData.node_org.children[0]), // the xu-panel node
|
|
31812
|
+
// {},
|
|
31813
|
+
// wrapper_data.xuData.paramsP, // the wrapper params
|
|
31814
|
+
// null,
|
|
31815
|
+
// null,
|
|
31816
|
+
// wrapper_data.xuData.key, // the wrapper key
|
|
31817
|
+
// refreshed_ds, // the refreshed_ds
|
|
31818
|
+
// wrapper_data.xuData.parent_node, // the wrapper parent node
|
|
31819
|
+
// null,
|
|
31820
|
+
// wrapper_data.xuData.$root_container, // the wrapper root container
|
|
31821
|
+
// );
|
|
31822
|
+
// }
|
|
31850
31823
|
|
|
31851
|
-
|
|
31852
|
-
|
|
31853
|
-
|
|
31854
|
-
|
|
31855
|
-
|
|
31856
|
-
|
|
31857
|
-
|
|
31858
|
-
|
|
31859
|
-
|
|
31860
|
-
|
|
31861
|
-
};
|
|
31824
|
+
// // remove old panel content
|
|
31825
|
+
// $.each(panel_val.ids, async function (key, val) {
|
|
31826
|
+
// $("[xu-ui-id='" + val + ts + "']").remove();
|
|
31827
|
+
// });
|
|
31828
|
+
// } catch (error) {
|
|
31829
|
+
// debugger;
|
|
31830
|
+
// }
|
|
31831
|
+
// // continue;
|
|
31832
|
+
// }
|
|
31833
|
+
// }
|
|
31834
|
+
// };
|
|
31862
31835
|
|
|
31863
31836
|
const get_params_obj_new = async function (SESSION_ID, prog_id, nodeP, dsSession) {
|
|
31864
31837
|
const _prog = await func.utils.VIEWS_OBJ.get(SESSION_ID, prog_id);
|
|
31865
31838
|
if (!_prog) return;
|
|
31866
31839
|
|
|
31867
31840
|
// get in parameters
|
|
31868
|
-
|
|
31869
|
-
params_raw = {};
|
|
31841
|
+
var params_obj = {};
|
|
31870
31842
|
if (_prog?.properties?.progParams) {
|
|
31871
31843
|
for await (const [key, val] of Object.entries(_prog.properties.progParams)) {
|
|
31872
31844
|
if (!['in', 'out'].includes(val.data.dir)) continue;
|
|
31873
31845
|
|
|
31874
31846
|
if (nodeP.attributes) {
|
|
31875
31847
|
if (nodeP.attributes[val.data.parameter]) {
|
|
31876
|
-
|
|
31848
|
+
params_obj[val.data.parameter] = nodeP.attributes[val.data.parameter];
|
|
31877
31849
|
} else if (nodeP.attributes[`xu-exp:${val.data.parameter}`]) {
|
|
31878
31850
|
if (val.data.dir == 'out') {
|
|
31879
31851
|
// only reference
|
|
31880
|
-
|
|
31852
|
+
params_obj[val.data.parameter] = nodeP.attributes[`xu-exp:${val.data.parameter}`].replaceAll('@', '');
|
|
31881
31853
|
} else {
|
|
31882
31854
|
// in parameter
|
|
31883
31855
|
let ret = await func.expression.get(SESSION_ID, nodeP.attributes[`xu-exp:${val.data.parameter}`], dsSession, 'parameters');
|
|
31884
|
-
|
|
31885
|
-
params_raw[val.data.parameter] = nodeP.attributes[`xu-exp:${val.data.parameter}`];
|
|
31856
|
+
params_obj[val.data.parameter] = ret.result;
|
|
31886
31857
|
}
|
|
31887
31858
|
}
|
|
31859
|
+
|
|
31860
|
+
// if (parameters_obj_inP?.[val.data.parameter].fx) {
|
|
31861
|
+
// let ret = await func.expression.get(
|
|
31862
|
+
// SESSION_ID,
|
|
31863
|
+
// parameters_obj_inP?.[val.data.parameter].fx,
|
|
31864
|
+
// dsSession,
|
|
31865
|
+
// "parameters"
|
|
31866
|
+
// );
|
|
31867
|
+
// params_obj[val.data.parameter] = ret.result;
|
|
31868
|
+
// } else {
|
|
31869
|
+
// params_obj[val.data.parameter] =
|
|
31870
|
+
// parameters_obj_inP?.[val.data.parameter].value;
|
|
31871
|
+
// }
|
|
31888
31872
|
continue;
|
|
31889
31873
|
}
|
|
31890
31874
|
console.warn(`Warning: Program ${_prog.properties.menuName} expected In parameter: ${val.data.parameter} but received null instead`);
|
|
31891
31875
|
}
|
|
31892
31876
|
}
|
|
31893
|
-
return
|
|
31877
|
+
return params_obj;
|
|
31894
31878
|
};
|
|
31895
31879
|
|
|
31896
31880
|
func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, xu_func, $elm, val, is_init, refreshed_ds) {
|
|
@@ -31907,8 +31891,8 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
31907
31891
|
const init_program = async function () {
|
|
31908
31892
|
async function render_panel() {
|
|
31909
31893
|
const prog_id = val.value?.prog || val.value;
|
|
31910
|
-
const
|
|
31911
|
-
let ret_panel = await func.UI.screen.init(SESSION_ID, prog_id, paramsP.screenId, _ds, $elm, null, _ds.currentRecordId, null, true,
|
|
31894
|
+
const param_obj = await get_params_obj_new(SESSION_ID, prog_id, nodeP, paramsP.dsSessionP);
|
|
31895
|
+
let ret_panel = await func.UI.screen.init(SESSION_ID, prog_id, paramsP.screenId, _ds, $elm, null, _ds.currentRecordId, null, true, param_obj, 'initXu_panel', undefined, prog_id !== _ds.prog_id ? null : refreshed_ds);
|
|
31912
31896
|
ret = { $new_div: ret_panel };
|
|
31913
31897
|
$container.data().xuData.xuPanelProps = $elm.data().xuAttributes;
|
|
31914
31898
|
$container.data().xuData.xuPanelData = ret_panel.data();
|
|
@@ -31957,8 +31941,8 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
31957
31941
|
const program = val.value?.prog || val.value;
|
|
31958
31942
|
var $wrapper = $('<div>');
|
|
31959
31943
|
var $div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, nodeP.attributes, null, null, null, $wrapper, '');
|
|
31960
|
-
const
|
|
31961
|
-
let ret_init = await func.UI.screen.init(SESSION_ID, program, paramsP.screenId, _ds, $div, null, _ds.currentRecordId, jobNoP, true,
|
|
31944
|
+
const param_obj = await get_params_obj_new(SESSION_ID, program, nodeP, paramsP.dsSessionP);
|
|
31945
|
+
let ret_init = await func.UI.screen.init(SESSION_ID, program, paramsP.screenId, _ds, $div, null, _ds.currentRecordId, jobNoP, true, param_obj, 'alterXu_panel');
|
|
31962
31946
|
ret = {
|
|
31963
31947
|
$new_div: ret_init,
|
|
31964
31948
|
abort: true,
|