@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
|
@@ -2900,7 +2900,7 @@ func.datasource.create = async function (
|
|
|
2900
2900
|
rowIdP,
|
|
2901
2901
|
jobNoP,
|
|
2902
2902
|
calling_trigger_prop,
|
|
2903
|
-
|
|
2903
|
+
screen_param,
|
|
2904
2904
|
NA_isInitP,
|
|
2905
2905
|
NA_callingSourceP,
|
|
2906
2906
|
calling_jobP,
|
|
@@ -2933,7 +2933,6 @@ func.datasource.create = async function (
|
|
|
2933
2933
|
parameters_obj_inP,
|
|
2934
2934
|
static_refreshP,
|
|
2935
2935
|
worker_id,
|
|
2936
|
-
parameters_raw_obj,
|
|
2937
2936
|
};
|
|
2938
2937
|
|
|
2939
2938
|
var IS_DATASOURCE_REFRESH = null;
|
|
@@ -3069,7 +3068,7 @@ func.datasource.create = async function (
|
|
|
3069
3068
|
args.rowIdP,
|
|
3070
3069
|
args.jobNoP,
|
|
3071
3070
|
args.calling_trigger_prop,
|
|
3072
|
-
|
|
3071
|
+
null,
|
|
3073
3072
|
null,
|
|
3074
3073
|
null,
|
|
3075
3074
|
args.calling_jobP,
|
|
@@ -3110,7 +3109,7 @@ func.datasource.create = async function (
|
|
|
3110
3109
|
return done(SESSION_ID, jsonP.dsSession, true);
|
|
3111
3110
|
});
|
|
3112
3111
|
};
|
|
3113
|
-
func.datasource.prepare = async function (SESSION_ID, prog_id, dataSourceNoP, parentDataSourceNoP, containerIdP, rowIdP, jobNoP, calling_trigger_prop,
|
|
3112
|
+
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) {
|
|
3114
3113
|
const set_parameters = async function () {
|
|
3115
3114
|
var _session = SESSION_OBJ[SESSION_ID];
|
|
3116
3115
|
const get_Out_parameters = async function (fieldIdP, located_field_param_idxP, param_row_idP) {
|
|
@@ -3239,7 +3238,6 @@ func.datasource.prepare = async function (SESSION_ID, prog_id, dataSourceNoP, pa
|
|
|
3239
3238
|
static_refreshP,
|
|
3240
3239
|
run_atP,
|
|
3241
3240
|
worker_id,
|
|
3242
|
-
parameters_raw_obj,
|
|
3243
3241
|
};
|
|
3244
3242
|
|
|
3245
3243
|
var dataSourceSession = null;
|
|
@@ -3861,8 +3859,8 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
|
|
|
3861
3859
|
}
|
|
3862
3860
|
|
|
3863
3861
|
// initiated with Update but no rows found
|
|
3864
|
-
if (tree_obj.crudMode === 'U' && tree_obj.allowCreate && !_ds?.data_feed?.rows?.length) {
|
|
3865
|
-
|
|
3862
|
+
// if (tree_obj.crudMode === 'U' && tree_obj.allowCreate && !_ds?.data_feed?.rows?.length) {
|
|
3863
|
+
if (tree_obj.crudMode === 'U' && tree_obj.allowCreate && !_raw_data_rows?.length) {
|
|
3866
3864
|
_ds.set_mode = 'C';
|
|
3867
3865
|
// _raw_data_rows[glb.newRecord] = [{ _ROWID: "newRecord" }];
|
|
3868
3866
|
|
|
@@ -4158,7 +4156,7 @@ func.datasource.run_events_functions = async function (SESSION_ID, dataSourceSes
|
|
|
4158
4156
|
clearInterval(interval);
|
|
4159
4157
|
resolve(job_num);
|
|
4160
4158
|
}
|
|
4161
|
-
if (i >
|
|
4159
|
+
if (i > 20) {
|
|
4162
4160
|
console.error('deadlock detected');
|
|
4163
4161
|
clearInterval(interval);
|
|
4164
4162
|
resolve(job_num);
|
|
@@ -4896,18 +4894,6 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
|
|
|
4896
4894
|
|
|
4897
4895
|
if (!fields_changed.includes(field_id)) {
|
|
4898
4896
|
fields_changed.push(field_id);
|
|
4899
|
-
|
|
4900
|
-
///// REFRESH PARAMETERS IN
|
|
4901
|
-
// for (const [_dsSession, _ds] of Object.entries(_session.DS_GLB)) {
|
|
4902
|
-
// if (_ds.args.parameters_raw_obj) {
|
|
4903
|
-
// for (const [key, exp] of Object.entries(_ds.args.parameters_raw_obj)) {
|
|
4904
|
-
// if (exp.includes(field_id)) {
|
|
4905
|
-
// let ret = await func.expression.get(SESSION_ID, exp, _dsSession, 'parameters');
|
|
4906
|
-
// _ds.in_parameters[key].value = ret.result;
|
|
4907
|
-
// }
|
|
4908
|
-
// }
|
|
4909
|
-
// }
|
|
4910
|
-
// }
|
|
4911
4897
|
}
|
|
4912
4898
|
if (!datasource_changed.includes(dataSource)) {
|
|
4913
4899
|
datasource_changed.push(dataSource);
|
|
@@ -4954,19 +4940,6 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
|
|
|
4954
4940
|
datasource_changed[0], // refresh the current datasource only
|
|
4955
4941
|
);
|
|
4956
4942
|
}
|
|
4957
|
-
// ///// REFRESH PARAMETERS IN
|
|
4958
|
-
// if (fields_changed.length) {
|
|
4959
|
-
// for (const [_dsSession, _ds] of Object.entries(_session.DS_GLB)) {
|
|
4960
|
-
// if (_ds.args.parameters_raw_obj) {
|
|
4961
|
-
// for (const [key, val] of Object.entries(_ds.args.parameters_raw_obj)) {
|
|
4962
|
-
// if (fields_changed.includes(val)) {
|
|
4963
|
-
// let ret = await func.expression.get(SESSION_ID, '@' + val, _dsSession, 'parameters');
|
|
4964
|
-
// _ds.in_parameters[val].value = ret.result;
|
|
4965
|
-
// }
|
|
4966
|
-
// }
|
|
4967
|
-
// }
|
|
4968
|
-
// }
|
|
4969
|
-
// }
|
|
4970
4943
|
}
|
|
4971
4944
|
resolve();
|
|
4972
4945
|
});
|
|
@@ -8911,7 +8884,7 @@ func.UI.find_field_in_progUi_attributes = function (progUi, field_id, prop, tag_
|
|
|
8911
8884
|
return elm_nodes;
|
|
8912
8885
|
};
|
|
8913
8886
|
func.UI.screen = {};
|
|
8914
|
-
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
|
|
8887
|
+
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) {
|
|
8915
8888
|
if (!prog_id) return console.error('program is empty');
|
|
8916
8889
|
let screen_ret = await func.utils.get_screen_obj(SESSION_ID, prog_id);
|
|
8917
8890
|
if (!screen_ret) return console.error('program is not a screen object');
|
|
@@ -8964,7 +8937,6 @@ func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callin
|
|
|
8964
8937
|
screenInfo,
|
|
8965
8938
|
call_screen_propertiesP,
|
|
8966
8939
|
parentDataSourceNoP: _session.DS_GLB?.[callingDataSource_objP?.dsSession]?.dsSession || callingDataSource_objP?.parentDataSourceNo || 0,
|
|
8967
|
-
parameters_raw_obj,
|
|
8968
8940
|
};
|
|
8969
8941
|
|
|
8970
8942
|
switch (screen_type) {
|
|
@@ -9131,7 +9103,7 @@ func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callin
|
|
|
9131
9103
|
rowIdP,
|
|
9132
9104
|
jobNoP,
|
|
9133
9105
|
null,
|
|
9134
|
-
|
|
9106
|
+
null,
|
|
9135
9107
|
null,
|
|
9136
9108
|
null,
|
|
9137
9109
|
null,
|
|
@@ -9738,200 +9710,212 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
|
|
|
9738
9710
|
}
|
|
9739
9711
|
};
|
|
9740
9712
|
|
|
9741
|
-
func.UI.screen.
|
|
9742
|
-
|
|
9743
|
-
|
|
9744
|
-
|
|
9745
|
-
|
|
9746
|
-
|
|
9747
|
-
|
|
9748
|
-
|
|
9749
|
-
}
|
|
9750
|
-
}
|
|
9713
|
+
// func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr, datasource_changed, fields_changed_datasource) {
|
|
9714
|
+
// // check the main program
|
|
9715
|
+
// if (fields_changed_datasource) {
|
|
9716
|
+
// const _session = SESSION_OBJ[SESSION_ID];
|
|
9717
|
+
// const _ds = _session.DS_GLB[fields_changed_datasource];
|
|
9718
|
+
// const prog_doc = await func.utils.DOCS_OBJ.get(SESSION_ID, _ds.prog_id);
|
|
9719
|
+
// const progDataSource_str = JSON.stringify(prog_doc.progDataSource);
|
|
9720
|
+
// for (const field_id of fields_changed_arr || []) {
|
|
9751
9721
|
|
|
9752
|
-
|
|
9722
|
+
// }
|
|
9723
|
+
// }
|
|
9753
9724
|
|
|
9754
|
-
|
|
9755
|
-
const progDataSource_str = JSON.stringify(panel_val.prog_doc.progDataSource);
|
|
9725
|
+
// const panels_obj = await func.UI.utils.get_panels_wrapper_from_dom(SESSION_ID, $(SESSION_OBJ[SESSION_ID].root_element), false);
|
|
9756
9726
|
|
|
9757
|
-
|
|
9758
|
-
|
|
9759
|
-
if (fields_changed_datasource && panel_val._ds.dsSession <= Number(fields_changed_datasource)) {
|
|
9760
|
-
continue;
|
|
9761
|
-
}
|
|
9762
|
-
for (const field_id of fields_changed_arr) {
|
|
9763
|
-
// get panel attributes
|
|
9764
|
-
const _attributes = panel_val?.panelXuAttributes || {};
|
|
9727
|
+
// for await (const [parent_element_ui_id, panel_val] of Object.entries(panels_obj)) {
|
|
9728
|
+
// const progDataSource_str = JSON.stringify(panel_val.prog_doc.progDataSource);
|
|
9765
9729
|
|
|
9766
|
-
|
|
9767
|
-
|
|
9730
|
+
// var found, refresh_reason, refresh_details;
|
|
9731
|
+
// if (fields_changed_arr) {
|
|
9732
|
+
// if (fields_changed_datasource && panel_val._ds.dsSession <= Number(fields_changed_datasource)) {
|
|
9733
|
+
// continue;
|
|
9734
|
+
// }
|
|
9735
|
+
// for (const field_id of fields_changed_arr) {
|
|
9736
|
+
// // get panel attributes
|
|
9737
|
+
// const _attributes = panel_val?.panelXuAttributes || {};
|
|
9768
9738
|
|
|
9769
|
-
|
|
9770
|
-
|
|
9771
|
-
refresh_details = _attributes;
|
|
9772
|
-
break;
|
|
9773
|
-
}
|
|
9739
|
+
// // detect if program changed
|
|
9740
|
+
// found = _attributes['xu-exp:program']?.includes('@' + field_id);
|
|
9774
9741
|
|
|
9775
|
-
|
|
9776
|
-
|
|
9777
|
-
|
|
9778
|
-
|
|
9779
|
-
|
|
9742
|
+
// if (found) {
|
|
9743
|
+
// refresh_reason = `program ${_attributes['xu-exp:program']} ${field_id} changed `;
|
|
9744
|
+
// refresh_details = _attributes;
|
|
9745
|
+
// break;
|
|
9746
|
+
// }
|
|
9780
9747
|
|
|
9781
|
-
|
|
9782
|
-
|
|
9783
|
-
|
|
9784
|
-
|
|
9785
|
-
|
|
9786
|
-
const parameter_in_field_id = match?.[1];
|
|
9787
|
-
// @code
|
|
9788
|
-
if (value.includes(field_id)) {
|
|
9789
|
-
// search parameter in field in the target program's progDataSource
|
|
9790
|
-
found = progDataSource_str?.includes('@' + parameter_in_field_id);
|
|
9748
|
+
// // _attributes holds also info of parameters in code_in: @code
|
|
9749
|
+
// // search field changed in panel call send parameters exp
|
|
9750
|
+
// for (const [attr, value] of Object.entries(_attributes)) {
|
|
9751
|
+
// const pattern = /xu-exp:(\w+)/;
|
|
9752
|
+
// const match = attr.match(pattern);
|
|
9791
9753
|
|
|
9792
|
-
|
|
9793
|
-
|
|
9794
|
-
|
|
9754
|
+
// if (!match) {
|
|
9755
|
+
// // continue if attribute is not expression
|
|
9756
|
+
// continue;
|
|
9757
|
+
// }
|
|
9758
|
+
// // code_in
|
|
9759
|
+
// const parameter_in_field_id = match?.[1];
|
|
9760
|
+
// // @code
|
|
9761
|
+
// if (value.includes(field_id)) {
|
|
9762
|
+
// // search parameter in field in the target program's progDataSource
|
|
9763
|
+
// found = progDataSource_str?.includes('@' + parameter_in_field_id);
|
|
9795
9764
|
|
|
9796
|
-
|
|
9797
|
-
|
|
9765
|
+
// if (found) {
|
|
9766
|
+
// refresh_reason = `field ${field_id} in progDataSource parameter_in changed`;
|
|
9767
|
+
// refresh_details = panel_val?.prog_doc?.progDataSource;
|
|
9798
9768
|
|
|
9799
|
-
|
|
9800
|
-
|
|
9769
|
+
// break;
|
|
9770
|
+
// }
|
|
9801
9771
|
|
|
9802
|
-
|
|
9803
|
-
|
|
9804
|
-
refresh_details = found;
|
|
9772
|
+
// // found = find_field_in_progUi(prog_doc.progUi, parameter_in_field_id, 'xu-for');
|
|
9773
|
+
// found = func.UI.find_field_in_progUi_attributes(panel_val.prog_doc.progUi, parameter_in_field_id, 'xu-for').length;
|
|
9805
9774
|
|
|
9806
|
-
|
|
9807
|
-
|
|
9808
|
-
|
|
9809
|
-
}
|
|
9775
|
+
// if (found) {
|
|
9776
|
+
// refresh_reason = `field ${field_id} in progUi xu-for parameter_in changed`;
|
|
9777
|
+
// refresh_details = found;
|
|
9810
9778
|
|
|
9811
|
-
|
|
9779
|
+
// break;
|
|
9780
|
+
// }
|
|
9781
|
+
// }
|
|
9782
|
+
// }
|
|
9812
9783
|
|
|
9813
|
-
|
|
9814
|
-
found = progDataSource_str?.includes('@' + field_id);
|
|
9815
|
-
if (found) {
|
|
9816
|
-
refresh_reason = `field ${field_id} in progDataSource changed`;
|
|
9817
|
-
refresh_details = panel_val?.prog_doc?.progDataSource;
|
|
9784
|
+
// if (found) break;
|
|
9818
9785
|
|
|
9819
|
-
|
|
9820
|
-
|
|
9786
|
+
// // search field changed in the target program's progDataSource // @code
|
|
9787
|
+
// found = progDataSource_str?.includes('@' + field_id);
|
|
9788
|
+
// if (found) {
|
|
9789
|
+
// refresh_reason = `field ${field_id} in progDataSource changed`;
|
|
9790
|
+
// refresh_details = panel_val?.prog_doc?.progDataSource;
|
|
9821
9791
|
|
|
9822
|
-
|
|
9823
|
-
|
|
9824
|
-
refresh_reason = `field ${field_id} in progUi xu-for changed`;
|
|
9825
|
-
refresh_details = found;
|
|
9792
|
+
// break;
|
|
9793
|
+
// }
|
|
9826
9794
|
|
|
9827
|
-
|
|
9828
|
-
|
|
9795
|
+
// found = func.UI.find_field_in_progUi_attributes(panel_val.prog_doc.progUi, field_id, 'xu-for').length;
|
|
9796
|
+
// if (found) {
|
|
9797
|
+
// refresh_reason = `field ${field_id} in progUi xu-for changed`;
|
|
9798
|
+
// refresh_details = found;
|
|
9829
9799
|
|
|
9830
|
-
|
|
9831
|
-
|
|
9832
|
-
}
|
|
9833
|
-
}
|
|
9834
|
-
}
|
|
9800
|
+
// break;
|
|
9801
|
+
// }
|
|
9835
9802
|
|
|
9836
|
-
|
|
9837
|
-
|
|
9838
|
-
|
|
9839
|
-
|
|
9803
|
+
// if (found) {
|
|
9804
|
+
// break;
|
|
9805
|
+
// }
|
|
9806
|
+
// }
|
|
9807
|
+
// }
|
|
9840
9808
|
|
|
9841
|
-
|
|
9842
|
-
|
|
9843
|
-
|
|
9844
|
-
|
|
9845
|
-
const _session = SESSION_OBJ[SESSION_ID];
|
|
9846
|
-
if (_session.engine_mode === 'live_preview') {
|
|
9847
|
-
console.info('========= refresh info ==============');
|
|
9848
|
-
console.info('reason:', refresh_reason);
|
|
9849
|
-
console.info('details:', refresh_details);
|
|
9850
|
-
console.info('panel:', panel_val);
|
|
9851
|
-
console.info('=====================================');
|
|
9852
|
-
}
|
|
9853
|
-
const $div_elm = panel_val.$panel_div;
|
|
9854
|
-
const wrapper_data = $div_elm.data();
|
|
9809
|
+
// if (datasource_changed) {
|
|
9810
|
+
// if (panel_val._ds.dsSession == datasource_changed) {
|
|
9811
|
+
// refresh_reason = `panel datasource ${datasource_changed} changed`;
|
|
9812
|
+
// refresh_details = '';
|
|
9855
9813
|
|
|
9856
|
-
|
|
9814
|
+
// found = true;
|
|
9815
|
+
// }
|
|
9816
|
+
// }
|
|
9817
|
+
// if (found) {
|
|
9818
|
+
// const _session = SESSION_OBJ[SESSION_ID];
|
|
9819
|
+
// if (_session.engine_mode === 'live_preview') {
|
|
9820
|
+
// console.info('========= refresh info ==============');
|
|
9821
|
+
// console.info('reason:', refresh_reason);
|
|
9822
|
+
// console.info('details:', refresh_details);
|
|
9823
|
+
// console.info('panel:', panel_val);
|
|
9824
|
+
// console.info('=====================================');
|
|
9825
|
+
// }
|
|
9826
|
+
// const $div_elm = panel_val.$panel_div;
|
|
9827
|
+
// const wrapper_data = $div_elm.data();
|
|
9857
9828
|
|
|
9858
|
-
|
|
9859
|
-
const ts = Date.now();
|
|
9860
|
-
// remove old panel content
|
|
9861
|
-
$.each(panel_val.ids, async function (key, val) {
|
|
9862
|
-
$("[xu-ui-id='" + val + "']")
|
|
9863
|
-
.attr('xu-ui-id', val + ts)
|
|
9864
|
-
.removeData();
|
|
9865
|
-
});
|
|
9829
|
+
// if (_.isEmpty(wrapper_data)) continue;
|
|
9866
9830
|
|
|
9867
|
-
|
|
9868
|
-
|
|
9831
|
+
// try {
|
|
9832
|
+
// const ts = Date.now();
|
|
9833
|
+
// // remove old panel content
|
|
9834
|
+
// $.each(panel_val.ids, async function (key, val) {
|
|
9835
|
+
// $("[xu-ui-id='" + val + "']")
|
|
9836
|
+
// .attr('xu-ui-id', val + ts)
|
|
9837
|
+
// .removeData();
|
|
9838
|
+
// });
|
|
9869
9839
|
|
|
9870
|
-
|
|
9871
|
-
|
|
9872
|
-
}
|
|
9873
|
-
for await (const item of wrapper_data.xuData.node_org.children) {
|
|
9874
|
-
if (item.tagName !== 'xu-panel') continue;
|
|
9840
|
+
// let refreshed_ds;
|
|
9841
|
+
// // check if ds exist and deleted by garbage collector
|
|
9875
9842
|
|
|
9876
|
-
|
|
9877
|
-
|
|
9878
|
-
|
|
9879
|
-
|
|
9880
|
-
|
|
9881
|
-
wrapper_data.xuData.paramsP, // the wrapper params
|
|
9882
|
-
null,
|
|
9883
|
-
null,
|
|
9884
|
-
wrapper_data.xuData.key, // the wrapper key
|
|
9885
|
-
refreshed_ds, // the refreshed_ds
|
|
9886
|
-
wrapper_data.xuData.parent_node, // the wrapper parent node
|
|
9887
|
-
null,
|
|
9888
|
-
wrapper_data.xuData.$root_container, // the wrapper root container
|
|
9889
|
-
);
|
|
9890
|
-
}
|
|
9843
|
+
// if (_session.DS_GLB[panel_val._ds.dsSession]) {
|
|
9844
|
+
// refreshed_ds = panel_val._ds.dsSession;
|
|
9845
|
+
// }
|
|
9846
|
+
// for await (const item of wrapper_data.xuData.node_org.children) {
|
|
9847
|
+
// if (item.tagName !== 'xu-panel') continue;
|
|
9891
9848
|
|
|
9892
|
-
|
|
9893
|
-
|
|
9894
|
-
|
|
9895
|
-
|
|
9896
|
-
|
|
9897
|
-
|
|
9898
|
-
|
|
9899
|
-
|
|
9900
|
-
|
|
9901
|
-
|
|
9902
|
-
|
|
9849
|
+
// const new_$div = await func.UI.screen.render_ui_tree(
|
|
9850
|
+
// SESSION_ID,
|
|
9851
|
+
// $div_elm, // the wrapper
|
|
9852
|
+
// _.cloneDeep(item), // _.cloneDeep(wrapper_data.xuData.node_org.children[0]), // the xu-panel node
|
|
9853
|
+
// {},
|
|
9854
|
+
// wrapper_data.xuData.paramsP, // the wrapper params
|
|
9855
|
+
// null,
|
|
9856
|
+
// null,
|
|
9857
|
+
// wrapper_data.xuData.key, // the wrapper key
|
|
9858
|
+
// refreshed_ds, // the refreshed_ds
|
|
9859
|
+
// wrapper_data.xuData.parent_node, // the wrapper parent node
|
|
9860
|
+
// null,
|
|
9861
|
+
// wrapper_data.xuData.$root_container, // the wrapper root container
|
|
9862
|
+
// );
|
|
9863
|
+
// }
|
|
9864
|
+
|
|
9865
|
+
// // remove old panel content
|
|
9866
|
+
// $.each(panel_val.ids, async function (key, val) {
|
|
9867
|
+
// $("[xu-ui-id='" + val + ts + "']").remove();
|
|
9868
|
+
// });
|
|
9869
|
+
// } catch (error) {
|
|
9870
|
+
// debugger;
|
|
9871
|
+
// }
|
|
9872
|
+
// // continue;
|
|
9873
|
+
// }
|
|
9874
|
+
// }
|
|
9875
|
+
// };
|
|
9903
9876
|
|
|
9904
9877
|
const get_params_obj_new = async function (SESSION_ID, prog_id, nodeP, dsSession) {
|
|
9905
9878
|
const _prog = await func.utils.VIEWS_OBJ.get(SESSION_ID, prog_id);
|
|
9906
9879
|
if (!_prog) return;
|
|
9907
9880
|
|
|
9908
9881
|
// get in parameters
|
|
9909
|
-
|
|
9910
|
-
params_raw = {};
|
|
9882
|
+
var params_obj = {};
|
|
9911
9883
|
if (_prog?.properties?.progParams) {
|
|
9912
9884
|
for await (const [key, val] of Object.entries(_prog.properties.progParams)) {
|
|
9913
9885
|
if (!['in', 'out'].includes(val.data.dir)) continue;
|
|
9914
9886
|
|
|
9915
9887
|
if (nodeP.attributes) {
|
|
9916
9888
|
if (nodeP.attributes[val.data.parameter]) {
|
|
9917
|
-
|
|
9889
|
+
params_obj[val.data.parameter] = nodeP.attributes[val.data.parameter];
|
|
9918
9890
|
} else if (nodeP.attributes[`xu-exp:${val.data.parameter}`]) {
|
|
9919
9891
|
if (val.data.dir == 'out') {
|
|
9920
9892
|
// only reference
|
|
9921
|
-
|
|
9893
|
+
params_obj[val.data.parameter] = nodeP.attributes[`xu-exp:${val.data.parameter}`].replaceAll('@', '');
|
|
9922
9894
|
} else {
|
|
9923
9895
|
// in parameter
|
|
9924
9896
|
let ret = await func.expression.get(SESSION_ID, nodeP.attributes[`xu-exp:${val.data.parameter}`], dsSession, 'parameters');
|
|
9925
|
-
|
|
9926
|
-
params_raw[val.data.parameter] = nodeP.attributes[`xu-exp:${val.data.parameter}`];
|
|
9897
|
+
params_obj[val.data.parameter] = ret.result;
|
|
9927
9898
|
}
|
|
9928
9899
|
}
|
|
9900
|
+
|
|
9901
|
+
// if (parameters_obj_inP?.[val.data.parameter].fx) {
|
|
9902
|
+
// let ret = await func.expression.get(
|
|
9903
|
+
// SESSION_ID,
|
|
9904
|
+
// parameters_obj_inP?.[val.data.parameter].fx,
|
|
9905
|
+
// dsSession,
|
|
9906
|
+
// "parameters"
|
|
9907
|
+
// );
|
|
9908
|
+
// params_obj[val.data.parameter] = ret.result;
|
|
9909
|
+
// } else {
|
|
9910
|
+
// params_obj[val.data.parameter] =
|
|
9911
|
+
// parameters_obj_inP?.[val.data.parameter].value;
|
|
9912
|
+
// }
|
|
9929
9913
|
continue;
|
|
9930
9914
|
}
|
|
9931
9915
|
console.warn(`Warning: Program ${_prog.properties.menuName} expected In parameter: ${val.data.parameter} but received null instead`);
|
|
9932
9916
|
}
|
|
9933
9917
|
}
|
|
9934
|
-
return
|
|
9918
|
+
return params_obj;
|
|
9935
9919
|
};
|
|
9936
9920
|
|
|
9937
9921
|
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) {
|
|
@@ -9948,8 +9932,8 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
9948
9932
|
const init_program = async function () {
|
|
9949
9933
|
async function render_panel() {
|
|
9950
9934
|
const prog_id = val.value?.prog || val.value;
|
|
9951
|
-
const
|
|
9952
|
-
let ret_panel = await func.UI.screen.init(SESSION_ID, prog_id, paramsP.screenId, _ds, $elm, null, _ds.currentRecordId, null, true,
|
|
9935
|
+
const param_obj = await get_params_obj_new(SESSION_ID, prog_id, nodeP, paramsP.dsSessionP);
|
|
9936
|
+
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);
|
|
9953
9937
|
ret = { $new_div: ret_panel };
|
|
9954
9938
|
$container.data().xuData.xuPanelProps = $elm.data().xuAttributes;
|
|
9955
9939
|
$container.data().xuData.xuPanelData = ret_panel.data();
|
|
@@ -9998,8 +9982,8 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
9998
9982
|
const program = val.value?.prog || val.value;
|
|
9999
9983
|
var $wrapper = $('<div>');
|
|
10000
9984
|
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, '');
|
|
10001
|
-
const
|
|
10002
|
-
let ret_init = await func.UI.screen.init(SESSION_ID, program, paramsP.screenId, _ds, $div, null, _ds.currentRecordId, jobNoP, true,
|
|
9985
|
+
const param_obj = await get_params_obj_new(SESSION_ID, program, nodeP, paramsP.dsSessionP);
|
|
9986
|
+
let ret_init = await func.UI.screen.init(SESSION_ID, program, paramsP.screenId, _ds, $div, null, _ds.currentRecordId, jobNoP, true, param_obj, 'alterXu_panel');
|
|
10003
9987
|
ret = {
|
|
10004
9988
|
$new_div: ret_init,
|
|
10005
9989
|
abort: true,
|