@xuda.io/xuda-worker-bundle-min 1.3.788 → 1.3.790
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 +41 -28
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1899,6 +1899,8 @@ func.datasource.prepare = async function (
|
|
|
1899
1899
|
IS_DATASOURCE_REFRESH = true;
|
|
1900
1900
|
|
|
1901
1901
|
try {
|
|
1902
|
+
if (!_ds.v) _ds.v = {};
|
|
1903
|
+
|
|
1902
1904
|
delete _ds.v.old_dataSource; // to eliminate parse error
|
|
1903
1905
|
delete _ds.rows_found;
|
|
1904
1906
|
_ds.raw_data = {};
|
|
@@ -2065,7 +2067,7 @@ func.datasource.execute = async function (
|
|
|
2065
2067
|
if (tree_ret.menuType === "get_data") {
|
|
2066
2068
|
return 1;
|
|
2067
2069
|
}
|
|
2068
|
-
ret = _ds.
|
|
2070
|
+
ret = _ds.progDataSource?.dataSourceLimit;
|
|
2069
2071
|
|
|
2070
2072
|
if (prog_obj.progDataSource?.dataSourceLoopExp) {
|
|
2071
2073
|
ret = (
|
|
@@ -2084,7 +2086,7 @@ func.datasource.execute = async function (
|
|
|
2084
2086
|
const calc_batch_loops = async () => {
|
|
2085
2087
|
if (
|
|
2086
2088
|
!prog_obj.progDataSource?.dataSourceType ||
|
|
2087
|
-
_ds.
|
|
2089
|
+
_ds.progDataSource.dataSourceType === "none"
|
|
2088
2090
|
) {
|
|
2089
2091
|
_ds.v.batch_loops = await get_limit();
|
|
2090
2092
|
return false;
|
|
@@ -2408,7 +2410,7 @@ func.datasource.execute = async function (
|
|
|
2408
2410
|
0,
|
|
2409
2411
|
_ds.api_rendered_output.length - 1
|
|
2410
2412
|
);
|
|
2411
|
-
if (Number(_ds.
|
|
2413
|
+
if (Number(_ds.progDataSource?.dataSourceLimit) === 1) {
|
|
2412
2414
|
_ds.api_rendered_output = str;
|
|
2413
2415
|
} else {
|
|
2414
2416
|
_ds.api_rendered_output = "[" + str + "]";
|
|
@@ -2493,7 +2495,7 @@ func.datasource.execute = async function (
|
|
|
2493
2495
|
case "set_data":
|
|
2494
2496
|
if (
|
|
2495
2497
|
!prog_obj.progDataSource?.dataSourceType ||
|
|
2496
|
-
_ds.
|
|
2498
|
+
_ds.progDataSource.dataSourceType !== "table" ||
|
|
2497
2499
|
!_ds._dataSourceTableId
|
|
2498
2500
|
) {
|
|
2499
2501
|
return func.utils.debug_report(
|
|
@@ -2729,7 +2731,7 @@ func.datasource.render_fields_dataset = async function (
|
|
|
2729
2731
|
var fieldType = view_field_obj?.props?.fieldType;
|
|
2730
2732
|
let table_field_obj;
|
|
2731
2733
|
if (view_field_obj.data.type === "table" && field_id !== "REDUCE_VALUE") {
|
|
2732
|
-
if (!_ds.
|
|
2734
|
+
if (!_ds.progDataSource?.dataSourceTableId) {
|
|
2733
2735
|
return func.utils.debug_report(
|
|
2734
2736
|
SESSION_ID,
|
|
2735
2737
|
"Datasource",
|
|
@@ -2850,7 +2852,7 @@ func.datasource.render_fields_form = async function (
|
|
|
2850
2852
|
data
|
|
2851
2853
|
) {
|
|
2852
2854
|
var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[dataSourceSession];
|
|
2853
|
-
var v = _ds.v;
|
|
2855
|
+
// var v = _ds.v;
|
|
2854
2856
|
|
|
2855
2857
|
const _progFields = await func.datasource.get_progFields(
|
|
2856
2858
|
SESSION_ID,
|
|
@@ -3007,7 +3009,7 @@ func.datasource.run_rows_form = async function (
|
|
|
3007
3009
|
) {
|
|
3008
3010
|
var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[dataSourceSession];
|
|
3009
3011
|
if (!_ds) return;
|
|
3010
|
-
var v = _ds.v;
|
|
3012
|
+
// var v = _ds.v;
|
|
3011
3013
|
|
|
3012
3014
|
var val = _ds.v.raw_data.rows[rowIdxP];
|
|
3013
3015
|
|
|
@@ -3039,7 +3041,7 @@ func.datasource.run_rows_form = async function (
|
|
|
3039
3041
|
SESSION_ID,
|
|
3040
3042
|
dataSourceSession,
|
|
3041
3043
|
"form",
|
|
3042
|
-
_ds.
|
|
3044
|
+
_ds.progDataSource.dataSourceSortScript,
|
|
3043
3045
|
idx,
|
|
3044
3046
|
sort_index
|
|
3045
3047
|
);
|
|
@@ -3047,7 +3049,7 @@ func.datasource.run_rows_form = async function (
|
|
|
3047
3049
|
SESSION_ID,
|
|
3048
3050
|
dataSourceSession,
|
|
3049
3051
|
"form",
|
|
3050
|
-
_ds.
|
|
3052
|
+
_ds.progDataSource.dataSourceGroupByScript,
|
|
3051
3053
|
idx,
|
|
3052
3054
|
sort_index
|
|
3053
3055
|
);
|
|
@@ -3063,10 +3065,10 @@ func.datasource.run_rows_form = async function (
|
|
|
3063
3065
|
_ds.rows_found--;
|
|
3064
3066
|
_ds.viewRangeExp_rows_deleted++;
|
|
3065
3067
|
};
|
|
3066
|
-
if (_ds.
|
|
3068
|
+
if (_ds.progDataSource?.dataSourceFiltersScript) {
|
|
3067
3069
|
var res = await func.datasource.validate_viewRange(
|
|
3068
3070
|
SESSION_ID,
|
|
3069
|
-
_ds.
|
|
3071
|
+
_ds.progDataSource.dataSourceFiltersScript,
|
|
3070
3072
|
dataSourceSession,
|
|
3071
3073
|
idx,
|
|
3072
3074
|
"form"
|
|
@@ -3082,10 +3084,10 @@ func.datasource.run_rows_form = async function (
|
|
|
3082
3084
|
}
|
|
3083
3085
|
await sort_form();
|
|
3084
3086
|
|
|
3085
|
-
if (_ds.
|
|
3087
|
+
if (_ds.progDataSource?.dataSourceLocateScript) {
|
|
3086
3088
|
var res = func.datasource.validate_viewLocate(
|
|
3087
3089
|
SESSION_ID,
|
|
3088
|
-
_ds.
|
|
3090
|
+
_ds.progDataSource.dataSourceLocateScript,
|
|
3089
3091
|
dataSourceSession,
|
|
3090
3092
|
idx,
|
|
3091
3093
|
"form"
|
|
@@ -3094,7 +3096,7 @@ func.datasource.run_rows_form = async function (
|
|
|
3094
3096
|
_ds.locatedRecordId = idx;
|
|
3095
3097
|
}
|
|
3096
3098
|
}
|
|
3097
|
-
if (_ds.
|
|
3099
|
+
if (_ds.progDataSource?.dataSourceFiltersScript) {
|
|
3098
3100
|
return;
|
|
3099
3101
|
}
|
|
3100
3102
|
};
|
|
@@ -3553,7 +3555,7 @@ func.datasource.get_event_interval_arr = function (
|
|
|
3553
3555
|
typeP
|
|
3554
3556
|
) {
|
|
3555
3557
|
var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[dataSourceSession];
|
|
3556
|
-
var v = _ds.v;
|
|
3558
|
+
// var v = _ds.v;
|
|
3557
3559
|
var arr = [];
|
|
3558
3560
|
|
|
3559
3561
|
var ret = 0;
|
|
@@ -4487,8 +4489,8 @@ func.datasource.interval = function (session_id, dsSessionP, typeP) {
|
|
|
4487
4489
|
var SESSION_ID = session_id;
|
|
4488
4490
|
var interval = [];
|
|
4489
4491
|
var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[dsSessionP];
|
|
4490
|
-
var ds = _ds;
|
|
4491
|
-
var v = ds.v;
|
|
4492
|
+
// var ds = _ds;
|
|
4493
|
+
// var v = ds.v;
|
|
4492
4494
|
// var arr = func.datasource.get_event_interval_arr(
|
|
4493
4495
|
// SESSION_ID,
|
|
4494
4496
|
// dsSessionP,
|
|
@@ -4555,8 +4557,8 @@ func.datasource.interval = function (session_id, dsSessionP, typeP) {
|
|
|
4555
4557
|
func.datasource.server_cron = function (session_id) {
|
|
4556
4558
|
var SESSION_ID = session_id;
|
|
4557
4559
|
var jobs = [];
|
|
4558
|
-
var ds = SESSION_OBJ[SESSION_ID].DS_GLB[0];
|
|
4559
|
-
var v = ds.v;
|
|
4560
|
+
// var ds = SESSION_OBJ[SESSION_ID].DS_GLB[0];
|
|
4561
|
+
// var v = ds.v;
|
|
4560
4562
|
var arr = func.datasource.get_event_interval_arr(
|
|
4561
4563
|
SESSION_ID,
|
|
4562
4564
|
0,
|
|
@@ -4624,14 +4626,14 @@ func.datasource.get_viewLoops = async function (
|
|
|
4624
4626
|
if (batch_source === "db_data") ret = _.size(data.rows);
|
|
4625
4627
|
if (batch_source === "array" || batch_source === "csv") ret = data.length;
|
|
4626
4628
|
if (batch_source === "json") ret = Object.keys(data).length;
|
|
4627
|
-
if (_ds.
|
|
4629
|
+
if (_ds.progDataSource?.dataSourceLimit) {
|
|
4628
4630
|
if (
|
|
4629
4631
|
batch_source !== "no_data" &&
|
|
4630
|
-
Number(_ds.
|
|
4632
|
+
Number(_ds.progDataSource?.dataSourceLimit) < ret
|
|
4631
4633
|
) {
|
|
4632
|
-
ret = Number(_ds.
|
|
4634
|
+
ret = Number(_ds.progDataSource.dataSourceLimit);
|
|
4633
4635
|
}
|
|
4634
|
-
if (!batch_source) ret = Number(_ds.
|
|
4636
|
+
if (!batch_source) ret = Number(_ds.progDataSource.dataSourceLimit);
|
|
4635
4637
|
}
|
|
4636
4638
|
if (prog_obj.progDataSource?.dataSourceLoopExp) {
|
|
4637
4639
|
var n = (
|
|
@@ -4666,7 +4668,7 @@ func.datasource.set_VIEW_data = async function (SESSION_ID, args, _ds) {
|
|
|
4666
4668
|
_ds.v.dataSourceSrcType = view.dataSourceSrcType;
|
|
4667
4669
|
_ds.v.viewExitExp = view.dataSourceExitScript;
|
|
4668
4670
|
|
|
4669
|
-
if (view.progDataSource) _ds.
|
|
4671
|
+
if (view.progDataSource) _ds.progDataSource = view.progDataSource;
|
|
4670
4672
|
|
|
4671
4673
|
_ds.v.viewIndex = view?.progDataSource?.dataSourceIndexesObj;
|
|
4672
4674
|
|
|
@@ -4684,8 +4686,8 @@ func.datasource.set_VIEW_data = async function (SESSION_ID, args, _ds) {
|
|
|
4684
4686
|
if (view.progEvents) _ds.v.progEvents = view.progEvents;
|
|
4685
4687
|
|
|
4686
4688
|
_ds._progDataSource_fields = [];
|
|
4687
|
-
if (_ds.
|
|
4688
|
-
let ret = func.expression.parse(JSON.stringify(_ds.
|
|
4689
|
+
if (_ds.progDataSource) {
|
|
4690
|
+
let ret = func.expression.parse(JSON.stringify(_ds.progDataSource));
|
|
4689
4691
|
_ds._progDataSource_fields = ret.map((e) => {
|
|
4690
4692
|
if (e.fieldId) return e.fieldId;
|
|
4691
4693
|
});
|
|
@@ -8370,18 +8372,29 @@ func.events.execute = async function (
|
|
|
8370
8372
|
SESSION_ID,
|
|
8371
8373
|
"xuda-event-javascript-module.mjs"
|
|
8372
8374
|
);
|
|
8373
|
-
|
|
8375
|
+
|
|
8376
|
+
return await module.run_javascript(
|
|
8377
|
+
SESSION_ID,
|
|
8378
|
+
jobNoP,
|
|
8379
|
+
dsSession,
|
|
8380
|
+
`(async function($elm) {
|
|
8381
|
+
${refIdP.value}
|
|
8382
|
+
})(document.querySelector(\`[xu-ui-id=${elementP}]\`))`
|
|
8383
|
+
);
|
|
8374
8384
|
},
|
|
8375
8385
|
execute_evaluate_javascript: async function () {
|
|
8376
8386
|
const module = await func.common.get_module(
|
|
8377
8387
|
SESSION_ID,
|
|
8378
8388
|
"xuda-event-javascript-module.mjs"
|
|
8379
8389
|
);
|
|
8390
|
+
|
|
8380
8391
|
return await module.run_javascript(
|
|
8381
8392
|
SESSION_ID,
|
|
8382
8393
|
jobNoP,
|
|
8383
|
-
refIdP,
|
|
8384
8394
|
dsSession,
|
|
8395
|
+
`(async function($elm) {
|
|
8396
|
+
${refIdP.value}
|
|
8397
|
+
})(document.querySelector(\`[xu-ui-id=${elementP}]\`))`,
|
|
8385
8398
|
true
|
|
8386
8399
|
);
|
|
8387
8400
|
},
|