@xuda.io/xuda-worker-bundle-min 1.3.846 → 1.3.848
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 +42 -38
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -52,6 +52,11 @@ func.common.find_ROWID_idx = function (_ds, rowId) {
|
|
|
52
52
|
|
|
53
53
|
// Find the index of the object with the given _ROWID
|
|
54
54
|
const index = _ds.data_feed.rows.findIndex((item) => item._ROWID === rowId);
|
|
55
|
+
// }
|
|
56
|
+
// If the index is -1, the ROWID was not found, so throw an error
|
|
57
|
+
if (index === -1) {
|
|
58
|
+
throw new Error(`ROWID "${rowId}" not found`);
|
|
59
|
+
}
|
|
55
60
|
|
|
56
61
|
// Return the found index
|
|
57
62
|
return index;
|
|
@@ -2924,56 +2929,55 @@ func.datasource.render_fields_dataset = async function (
|
|
|
2924
2929
|
_ds.data_feed.rows.push({ _ROWID: _ds.currentRecordId });
|
|
2925
2930
|
row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
|
|
2926
2931
|
// console.error(err);
|
|
2927
|
-
}
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
for await (const val of _progFields) {
|
|
2931
|
-
try {
|
|
2932
|
-
var fieldId = val.data.field_id;
|
|
2933
|
-
|
|
2934
|
-
if (val.data.type === "virtual" || _ds.set_mode === "C") {
|
|
2935
|
-
if (typeof raw_data_row?.value?.[fieldId] !== "undefined") {
|
|
2936
|
-
// supports x=x+1
|
|
2937
|
-
_ds.data_feed.rows[row_idx][fieldId] = await get_value(
|
|
2938
|
-
fieldId,
|
|
2939
|
-
raw_data_row.value[fieldId]
|
|
2940
|
-
);
|
|
2941
|
-
continue;
|
|
2942
|
-
}
|
|
2932
|
+
}
|
|
2933
|
+
_ds.dataset_alias = {};
|
|
2943
2934
|
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
val.props?.propExpressions?.fieldValue,
|
|
2948
|
-
dataSourceSession,
|
|
2949
|
-
"update",
|
|
2950
|
-
args.rowIdP
|
|
2951
|
-
);
|
|
2952
|
-
_ds.data_feed.rows[row_idx][fieldId] = await get_value(
|
|
2953
|
-
fieldId,
|
|
2954
|
-
ret.result
|
|
2955
|
-
);
|
|
2956
|
-
continue;
|
|
2957
|
-
}
|
|
2935
|
+
for await (const val of _progFields) {
|
|
2936
|
+
try {
|
|
2937
|
+
var fieldId = val.data.field_id;
|
|
2958
2938
|
|
|
2939
|
+
if (val.data.type === "virtual" || _ds.set_mode === "C") {
|
|
2940
|
+
if (typeof raw_data_row?.value?.[fieldId] !== "undefined") {
|
|
2941
|
+
// supports x=x+1
|
|
2959
2942
|
_ds.data_feed.rows[row_idx][fieldId] = await get_value(
|
|
2960
2943
|
fieldId,
|
|
2961
|
-
|
|
2944
|
+
raw_data_row.value[fieldId]
|
|
2962
2945
|
);
|
|
2963
2946
|
continue;
|
|
2964
2947
|
}
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2948
|
+
|
|
2949
|
+
if (val.props?.propExpressions?.fieldValue) {
|
|
2950
|
+
let ret = await func.expression.get(
|
|
2951
|
+
SESSION_ID,
|
|
2952
|
+
val.props?.propExpressions?.fieldValue,
|
|
2953
|
+
dataSourceSession,
|
|
2954
|
+
"update",
|
|
2955
|
+
args.rowIdP
|
|
2956
|
+
);
|
|
2969
2957
|
_ds.data_feed.rows[row_idx][fieldId] = await get_value(
|
|
2970
2958
|
fieldId,
|
|
2971
|
-
|
|
2959
|
+
ret.result
|
|
2972
2960
|
);
|
|
2961
|
+
continue;
|
|
2973
2962
|
}
|
|
2974
|
-
|
|
2975
|
-
|
|
2963
|
+
|
|
2964
|
+
_ds.data_feed.rows[row_idx][fieldId] = await get_value(
|
|
2965
|
+
fieldId,
|
|
2966
|
+
val.props?.fieldValue
|
|
2967
|
+
);
|
|
2968
|
+
continue;
|
|
2969
|
+
}
|
|
2970
|
+
if (val.data.type === "table" || val.data.type === "datasource") {
|
|
2971
|
+
if (typeof raw_data_row.value[fieldId] === "undefined") {
|
|
2972
|
+
throw "field do not exist in data: " + fieldId;
|
|
2973
|
+
}
|
|
2974
|
+
_ds.data_feed.rows[row_idx][fieldId] = await get_value(
|
|
2975
|
+
fieldId,
|
|
2976
|
+
raw_data_row.value[fieldId]
|
|
2977
|
+
);
|
|
2976
2978
|
}
|
|
2979
|
+
} catch (err) {
|
|
2980
|
+
func.utils.debug_report(SESSION_ID, "Datasource", err, "E", null, _ds);
|
|
2977
2981
|
}
|
|
2978
2982
|
}
|
|
2979
2983
|
};
|