@xuda.io/xuda-worker-bundle-min 1.3.1098 → 1.3.1099
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 +47 -45
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -5092,6 +5092,51 @@ func.datasource.update_changes_for_out_parameter = async function (
|
|
|
5092
5092
|
}
|
|
5093
5093
|
}
|
|
5094
5094
|
};
|
|
5095
|
+
|
|
5096
|
+
func.datasource.set_outputField = async function (SESSION_ID, elementP, triggerP, functionP, dsSessionP, result) {
|
|
5097
|
+
var _session = SESSION_OBJ[SESSION_ID];
|
|
5098
|
+
|
|
5099
|
+
const output_field = await get_args_property_value("outputField");
|
|
5100
|
+
|
|
5101
|
+
// if (!output_field) {
|
|
5102
|
+
// func.utils.debug_report(
|
|
5103
|
+
// SESSION_ID,
|
|
5104
|
+
// "func.events.execute",
|
|
5105
|
+
// `${elementP} >${triggerP} >${functionP} > Output field not defined`,
|
|
5106
|
+
// "W"
|
|
5107
|
+
// );
|
|
5108
|
+
|
|
5109
|
+
// }
|
|
5110
|
+
|
|
5111
|
+
|
|
5112
|
+
|
|
5113
|
+
if (output_field) {
|
|
5114
|
+
let datasource_changes = {};
|
|
5115
|
+
|
|
5116
|
+
let ret_get_value = await func.datasource.get_value(
|
|
5117
|
+
SESSION_ID,
|
|
5118
|
+
output_field,
|
|
5119
|
+
dsSessionP
|
|
5120
|
+
);
|
|
5121
|
+
if (ret_get_value.found) {
|
|
5122
|
+
let _ds = _session.DS_GLB[ret_get_value.dsSessionP];
|
|
5123
|
+
if (!datasource_changes[_ds.dsSession]) {
|
|
5124
|
+
datasource_changes[_ds.dsSession] = {};
|
|
5125
|
+
}
|
|
5126
|
+
if (
|
|
5127
|
+
!datasource_changes[_ds.dsSession][ret_get_value.currentRecordId]
|
|
5128
|
+
) {
|
|
5129
|
+
datasource_changes[_ds.dsSession][ret_get_value.currentRecordId] =
|
|
5130
|
+
{};
|
|
5131
|
+
}
|
|
5132
|
+
datasource_changes[_ds.dsSession][ret_get_value.currentRecordId][
|
|
5133
|
+
output_field
|
|
5134
|
+
] = result;
|
|
5135
|
+
await func.datasource.update(SESSION_ID, datasource_changes);
|
|
5136
|
+
}
|
|
5137
|
+
}
|
|
5138
|
+
|
|
5139
|
+
}
|
|
5095
5140
|
func.utils = {};
|
|
5096
5141
|
|
|
5097
5142
|
func.utils.debug = {};
|
|
@@ -8092,50 +8137,7 @@ func.events.execute = async function (
|
|
|
8092
8137
|
return _value;
|
|
8093
8138
|
};
|
|
8094
8139
|
|
|
8095
|
-
const set_outputField = async function (SESSION_ID, elementP, triggerP, functionP, dsSessionP, result) {
|
|
8096
|
-
var _session = SESSION_OBJ[SESSION_ID];
|
|
8097
|
-
|
|
8098
|
-
const output_field = await get_args_property_value("outputField");
|
|
8099
|
-
|
|
8100
|
-
// if (!output_field) {
|
|
8101
|
-
// func.utils.debug_report(
|
|
8102
|
-
// SESSION_ID,
|
|
8103
|
-
// "func.events.execute",
|
|
8104
|
-
// `${elementP} >${triggerP} >${functionP} > Output field not defined`,
|
|
8105
|
-
// "W"
|
|
8106
|
-
// );
|
|
8107
|
-
|
|
8108
|
-
// }
|
|
8109
8140
|
|
|
8110
|
-
|
|
8111
|
-
|
|
8112
|
-
if (output_field) {
|
|
8113
|
-
let datasource_changes = {};
|
|
8114
|
-
|
|
8115
|
-
let ret_get_value = await func.datasource.get_value(
|
|
8116
|
-
SESSION_ID,
|
|
8117
|
-
output_field,
|
|
8118
|
-
dsSessionP
|
|
8119
|
-
);
|
|
8120
|
-
if (ret_get_value.found) {
|
|
8121
|
-
let _ds = _session.DS_GLB[ret_get_value.dsSessionP];
|
|
8122
|
-
if (!datasource_changes[_ds.dsSession]) {
|
|
8123
|
-
datasource_changes[_ds.dsSession] = {};
|
|
8124
|
-
}
|
|
8125
|
-
if (
|
|
8126
|
-
!datasource_changes[_ds.dsSession][ret_get_value.currentRecordId]
|
|
8127
|
-
) {
|
|
8128
|
-
datasource_changes[_ds.dsSession][ret_get_value.currentRecordId] =
|
|
8129
|
-
{};
|
|
8130
|
-
}
|
|
8131
|
-
datasource_changes[_ds.dsSession][ret_get_value.currentRecordId][
|
|
8132
|
-
output_field
|
|
8133
|
-
] = result;
|
|
8134
|
-
await func.datasource.update(SESSION_ID, datasource_changes);
|
|
8135
|
-
}
|
|
8136
|
-
}
|
|
8137
|
-
|
|
8138
|
-
}
|
|
8139
8141
|
var args = {
|
|
8140
8142
|
prog_id: refIdP?.prog,
|
|
8141
8143
|
screenIdP: refIdP?.prog,
|
|
@@ -8698,7 +8700,7 @@ func.events.execute = async function (
|
|
|
8698
8700
|
batch: async function () {
|
|
8699
8701
|
const result = await this.get_data();
|
|
8700
8702
|
debugger
|
|
8701
|
-
await set_outputField(SESSION_ID, elementP, triggerP, functionP, dsSessionP, result);
|
|
8703
|
+
// await set_outputField(SESSION_ID, elementP, triggerP, functionP, dsSessionP, result);
|
|
8702
8704
|
return result
|
|
8703
8705
|
|
|
8704
8706
|
},
|
|
@@ -8850,7 +8852,7 @@ func.events.execute = async function (
|
|
|
8850
8852
|
|
|
8851
8853
|
const api_ret = await func.api.call_project_api(_prog_id, params_obj);
|
|
8852
8854
|
|
|
8853
|
-
await set_outputField(SESSION_ID, elementP, triggerP, functionP, dsSessionP, api_ret);
|
|
8855
|
+
await func.datasource.set_outputField(SESSION_ID, elementP, triggerP, functionP, dsSessionP, api_ret);
|
|
8854
8856
|
|
|
8855
8857
|
// if (output_field) {
|
|
8856
8858
|
// let datasource_changes = {};
|