@xuda.io/xuda-worker-bundle-min 1.3.522 → 1.3.524

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.
Files changed (2) hide show
  1. package/index.js +57 -53
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -2984,15 +2984,14 @@ func.datasource.run_rows_form = async function (
2984
2984
  true,
2985
2985
  pre_init_fieldsP
2986
2986
  );
2987
- if (
2988
- (await func.datasource.get_field_init_count(
2989
- SESSION_ID,
2990
- dataSourceSession,
2991
- idx,
2992
- false,
2993
- _ds.oninit_triggers_to_run
2994
- )) > 0
2995
- ) {
2987
+ const init_count = await func.datasource.get_field_init_count(
2988
+ SESSION_ID,
2989
+ dataSourceSession,
2990
+ idx,
2991
+ false,
2992
+ _ds.oninit_triggers_to_run
2993
+ );
2994
+ if (init_count > 0) {
2996
2995
  await func.datasource.execute_field_init_events(
2997
2996
  SESSION_ID,
2998
2997
  dataSourceSession,
@@ -3095,58 +3094,63 @@ func.datasource.get_field_init_count = async function (
3095
3094
 
3096
3095
  _ds.dataSource_init_arr[rowIdP] = {};
3097
3096
  var ret = 0;
3098
- if (_ds.v.ViewFieldsObjs) {
3099
- for await (const field_obj of _view_obj.progFields) {
3100
- var fieldId = field_obj.data.field_id;
3097
+ // if (_ds.v.ViewFieldsObjs) {
3098
+ for await (const field_obj of _view_obj.progFields) {
3099
+ var fieldId = field_obj.data.field_id;
3101
3100
 
3102
- if (!field_obj.triggers) {
3101
+ if (!field_obj.triggers) {
3102
+ continue;
3103
+ }
3104
+ for await (const trigger_obj of field_obj.triggers) {
3105
+ if (
3106
+ oninit_triggers_to_runP &&
3107
+ !oninit_triggers_to_runP?.includes(trigger_obj.id)
3108
+ ) {
3103
3109
  continue;
3104
3110
  }
3105
- for await (const trigger_obj of field_obj.triggers) {
3106
- if (!oninit_triggers_to_runP?.includes(trigger_obj.id)) continue;
3107
- if (
3108
- trigger_obj.data.trigger === "oninit" &&
3109
- ["get_data", "set_data", "batch", "update", "raise_event"].includes(
3110
- trigger_obj.data.action
3111
- )
3112
- ) {
3113
- if (!trigger_obj.data.action) {
3114
- func.utils.debug_report(
3115
- SESSION_ID,
3116
- "_ds.get_field_init_count",
3117
- `Error initiating event for field: ${fieldId} prog: ${_ds.v.viewSourceDesc} row: ${rowIdP} reason: missing action`,
3118
- "E"
3119
- );
3120
- break;
3121
- }
3111
+ if (
3112
+ trigger_obj.data.trigger === "oninit" &&
3113
+ ["get_data", "set_data", "batch", "update", "raise_event"].includes(
3114
+ trigger_obj.data.action
3115
+ )
3116
+ ) {
3117
+ if (!trigger_obj.data.action) {
3118
+ func.utils.debug_report(
3119
+ SESSION_ID,
3120
+ "_ds.get_field_init_count",
3121
+ `Error initiating event for field: ${fieldId} prog: ${_ds.v.viewSourceDesc} row: ${rowIdP} reason: missing action`,
3122
+ "E"
3123
+ );
3124
+ break;
3125
+ }
3122
3126
 
3123
- if (trigger_obj.data.enabled) {
3124
- SESSION_OBJ[SESSION_ID].DS_GLB[
3125
- dataSourceSession
3126
- ].dataSource_init_arr[rowIdP][ret] = {
3127
- eventInfo: trigger_obj,
3128
- triggerId: trigger_obj.id,
3129
- fieldId: fieldId,
3130
- rowId: rowIdP,
3131
- colId: field_obj.id,
3132
- node_id: args.prog_id + "_" + trigger_obj.id + "_" + field_obj.id,
3133
- fieldProp: field_obj,
3134
- DEBUG_INFO_OBJ: {
3135
- module: _ds.viewModule,
3136
- action: "init field event",
3137
- prop: fieldId,
3138
- source: _ds.viewSourceDesc,
3139
- type: "event",
3140
- prog_id: args.prog_id,
3141
- dsSession: dataSourceSession,
3142
- },
3143
- };
3144
- ret++;
3145
- }
3127
+ if (trigger_obj.data.enabled) {
3128
+ SESSION_OBJ[SESSION_ID].DS_GLB[dataSourceSession].dataSource_init_arr[
3129
+ rowIdP
3130
+ ][ret] = {
3131
+ eventInfo: trigger_obj,
3132
+ triggerId: trigger_obj.id,
3133
+ fieldId: fieldId,
3134
+ rowId: rowIdP,
3135
+ colId: field_obj.id,
3136
+ node_id: args.prog_id + "_" + trigger_obj.id + "_" + field_obj.id,
3137
+ fieldProp: field_obj,
3138
+ DEBUG_INFO_OBJ: {
3139
+ module: _ds.viewModule,
3140
+ action: "init field event",
3141
+ prop: fieldId,
3142
+ source: _ds.viewSourceDesc,
3143
+ type: "event",
3144
+ prog_id: args.prog_id,
3145
+ dsSession: dataSourceSession,
3146
+ },
3147
+ };
3148
+ ret++;
3146
3149
  }
3147
3150
  }
3148
3151
  }
3149
3152
  }
3153
+ // }
3150
3154
  return ret;
3151
3155
  };
3152
3156
  func.datasource.get_view_events_count = async function (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/xuda-worker-bundle-min",
3
- "version": "1.3.522",
3
+ "version": "1.3.524",
4
4
  "description": "xuda framework min",
5
5
  "main": "index.js",
6
6
  "scripts": {