openxiangda 1.0.38 → 1.0.39

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.
@@ -1214,6 +1214,30 @@ var createPageSdk = (context) => {
1214
1214
  order: Array.isArray(params.order) ? params.order : params.order ? [params.order] : void 0
1215
1215
  }
1216
1216
  });
1217
+ },
1218
+ stats: (code, params = {}) => {
1219
+ const dataViewCode = String(code || "").trim();
1220
+ if (!dataViewCode) {
1221
+ throw new Error("\u6570\u636E\u89C6\u56FE code \u4E0D\u80FD\u4E3A\u7A7A");
1222
+ }
1223
+ return request({
1224
+ path: buildAppPath(
1225
+ context,
1226
+ params.appType,
1227
+ `/v1/data-views/${encodePathSegment(dataViewCode)}/stats.json`
1228
+ ),
1229
+ method: "post",
1230
+ body: {
1231
+ fields: params.fields,
1232
+ filters: serializeSearchExpression(params.filters),
1233
+ having: serializeSearchExpression(params.having),
1234
+ conditionType: params.conditionType,
1235
+ searchKeyWord: params.searchKeyWord,
1236
+ currentPage: params.currentPage,
1237
+ pageSize: params.pageSize,
1238
+ order: Array.isArray(params.order) ? params.order : params.order ? [params.order] : void 0
1239
+ }
1240
+ });
1217
1241
  }
1218
1242
  };
1219
1243
  const notification = {
@@ -1294,7 +1318,8 @@ var createPageSdk = (context) => {
1294
1318
  runtimeParams.formUuid || descriptor.formUuid || ""
1295
1319
  ).trim();
1296
1320
  switch (descriptor.type) {
1297
- case "dataView.query": {
1321
+ case "dataView.query":
1322
+ case "dataView.stats": {
1298
1323
  const dataViewCode = String(
1299
1324
  runtimeParams.code || runtimeParams.dataViewCode || descriptor.code || descriptor.dataViewCode || descriptor.viewCode || descriptor.key || ""
1300
1325
  ).trim();
@@ -1305,11 +1330,22 @@ var createPageSdk = (context) => {
1305
1330
  filters: mergeSearchExpressions(
1306
1331
  descriptor.defaultFilter,
1307
1332
  runtimeParams.filters
1333
+ ),
1334
+ having: mergeSearchExpressions(
1335
+ descriptor.defaultHaving || descriptor.having,
1336
+ runtimeParams.having
1308
1337
  )
1309
1338
  };
1310
1339
  delete queryParams.code;
1311
1340
  delete queryParams.dataViewCode;
1312
1341
  delete queryParams.viewCode;
1342
+ if (descriptor.type === "dataView.stats") {
1343
+ return dataView.stats(
1344
+ dataViewCode,
1345
+ queryParams
1346
+ );
1347
+ }
1348
+ delete queryParams.having;
1313
1349
  return dataView.query(
1314
1350
  dataViewCode,
1315
1351
  queryParams