@xuda.io/xuda-worker-bundle-min 1.3.1097 → 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 +48 -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,
|
|
@@ -8689,6 +8691,7 @@ func.events.execute = async function (
|
|
|
8689
8691
|
// }
|
|
8690
8692
|
|
|
8691
8693
|
func.events.delete_job(SESSION_ID, jobNoP);
|
|
8694
|
+
return _ds_new
|
|
8692
8695
|
}
|
|
8693
8696
|
},
|
|
8694
8697
|
set_data: async function () {
|
|
@@ -8697,7 +8700,7 @@ func.events.execute = async function (
|
|
|
8697
8700
|
batch: async function () {
|
|
8698
8701
|
const result = await this.get_data();
|
|
8699
8702
|
debugger
|
|
8700
|
-
await set_outputField(SESSION_ID, elementP, triggerP, functionP, dsSessionP, result);
|
|
8703
|
+
// await set_outputField(SESSION_ID, elementP, triggerP, functionP, dsSessionP, result);
|
|
8701
8704
|
return result
|
|
8702
8705
|
|
|
8703
8706
|
},
|
|
@@ -8849,7 +8852,7 @@ func.events.execute = async function (
|
|
|
8849
8852
|
|
|
8850
8853
|
const api_ret = await func.api.call_project_api(_prog_id, params_obj);
|
|
8851
8854
|
|
|
8852
|
-
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);
|
|
8853
8856
|
|
|
8854
8857
|
// if (output_field) {
|
|
8855
8858
|
// let datasource_changes = {};
|