@ibiz-template/core 0.7.41-alpha.7 → 0.7.41-alpha.78

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 (54) hide show
  1. package/dist/index.esm.js +70 -38
  2. package/dist/index.system.min.js +1 -1
  3. package/out/context/index.d.ts +0 -6
  4. package/out/context/index.d.ts.map +1 -1
  5. package/out/context/index.js +0 -29
  6. package/out/environment/environment.d.ts.map +1 -1
  7. package/out/environment/environment.js +7 -0
  8. package/out/error/http-error/http-error.d.ts +2 -2
  9. package/out/error/http-error/http-error.d.ts.map +1 -1
  10. package/out/interface/api/chat-message/i-api-chat-message.d.ts +63 -0
  11. package/out/interface/api/chat-message/i-api-chat-message.d.ts.map +1 -0
  12. package/out/interface/api/chat-message/i-api-chat-message.js +1 -0
  13. package/out/interface/api/chat-message/index.d.ts +2 -0
  14. package/out/interface/api/chat-message/index.d.ts.map +1 -0
  15. package/out/interface/api/chat-message/index.js +1 -0
  16. package/out/interface/api/environment/i-devtool-config.d.ts +11 -1
  17. package/out/interface/api/environment/i-devtool-config.d.ts.map +1 -1
  18. package/out/interface/api/environment/i-environment.d.ts +138 -1
  19. package/out/interface/api/environment/i-environment.d.ts.map +1 -1
  20. package/out/interface/api/index.d.ts +1 -0
  21. package/out/interface/api/index.d.ts.map +1 -1
  22. package/out/interface/api/index.js +1 -0
  23. package/out/interface/api/utils/i-api-i18n.d.ts +9 -9
  24. package/out/interface/api/utils/index.d.ts +1 -0
  25. package/out/interface/api/utils/index.d.ts.map +1 -1
  26. package/out/interface/api/utils/message-center/base/i-message-base.d.ts +3 -3
  27. package/out/interface/api/utils/message-center/command/add-in-changed/i-command-add-in-changed.d.ts +1 -1
  28. package/out/interface/api/utils/message-center/command/async-action/i-command-async-action.d.ts +1 -1
  29. package/out/interface/api/utils/message-center/command/i-message-command.d.ts +1 -1
  30. package/out/interface/api/utils/message-center/command/internal-message/i-command-internal-message.d.ts +1 -1
  31. package/out/interface/api/utils/message-center/command/mark-open-data/i-command-mark-open-data.d.ts +1 -1
  32. package/out/interface/api/utils/message-center/common/i-message-center-event.d.ts +5 -0
  33. package/out/interface/api/utils/message-center/common/i-message-center-event.d.ts.map +1 -1
  34. package/out/interface/api/utils/message-center/console/i-message-console.d.ts +1 -1
  35. package/out/interface/api/utils/message-center/error/i-message-error.d.ts +1 -1
  36. package/out/interface/api/utils/message-center/i-message-center.d.ts +2 -2
  37. package/out/interface/api/utils/net/i-api-http-error.d.ts +39 -0
  38. package/out/interface/api/utils/net/i-api-http-error.d.ts.map +1 -0
  39. package/out/interface/api/utils/net/i-api-http-error.js +1 -0
  40. package/out/interface/context/index.d.ts +0 -6
  41. package/out/interface/context/index.d.ts.map +1 -1
  42. package/out/interface/i-chat-message/i-chat-message.d.ts +2 -49
  43. package/out/interface/i-chat-message/i-chat-message.d.ts.map +1 -1
  44. package/out/utils/download-file/download-file.d.ts.map +1 -1
  45. package/out/utils/download-file/download-file.js +11 -1
  46. package/out/utils/interceptor/core-interceptor.js +2 -1
  47. package/out/utils/net/net.d.ts +1 -1
  48. package/out/utils/net/net.d.ts.map +1 -1
  49. package/out/utils/recursive/find-recursive-child.d.ts +20 -0
  50. package/out/utils/recursive/find-recursive-child.d.ts.map +1 -1
  51. package/out/utils/recursive/find-recursive-child.js +69 -7
  52. package/out/utils/string-util/string-util.d.ts.map +1 -1
  53. package/out/utils/string-util/string-util.js +2 -4
  54. package/package.json +4 -4
package/dist/index.esm.js CHANGED
@@ -3511,16 +3511,6 @@ var HttpStatusMessageConst = {
3511
3511
 
3512
3512
  // src/context/index.ts
3513
3513
  import { clone } from "ramda";
3514
- var presetContext = [
3515
- "srfappid",
3516
- "srfsimple",
3517
- "srfviewid",
3518
- "srfrunmode",
3519
- "srfreadonly",
3520
- "srfnavctrlid",
3521
- "srfsessionid",
3522
- "srfnavlogicid"
3523
- ];
3524
3514
  var IBizContext = class _IBizContext {
3525
3515
  /**
3526
3516
  * Creates an instance of IBizContext.
@@ -3600,20 +3590,6 @@ var IBizContext = class _IBizContext {
3600
3590
  });
3601
3591
  return result;
3602
3592
  }
3603
- /**
3604
- * @description 返回没有预置字段的上下文
3605
- * @returns {*} {IData}
3606
- * @memberof IBizContext
3607
- */
3608
- getTempContext() {
3609
- const result = {};
3610
- Object.keys(this).forEach((key) => {
3611
- if (!presetContext.includes(key)) {
3612
- result[key] = this[key];
3613
- }
3614
- });
3615
- return result;
3616
- }
3617
3593
  /**
3618
3594
  * @description 销毁当前上下文对象
3619
3595
  * @memberof IBizContext
@@ -3823,6 +3799,7 @@ var Environment = {
3823
3799
  // 配置示例 DefaultOSSCat=cat
3824
3800
  downloadFileUrl: "/ibizutil/download/{cat}",
3825
3801
  uploadFileUrl: "/ibizutil/upload/{cat}",
3802
+ defaultOSSCat: "",
3826
3803
  casLoginUrl: "",
3827
3804
  loginMode: "DEFAULT" /* DEFAULT */,
3828
3805
  menuPermissionMode: "MIXIN" /* MIXIN */,
@@ -3853,7 +3830,13 @@ var Environment = {
3853
3830
  enableAI: true,
3854
3831
  aMapSecurityJsCode: "",
3855
3832
  aMapKey: "",
3856
- runContainer: "DYNAENGINE"
3833
+ runContainer: "DYNAENGINE",
3834
+ mobWeChatAppId: "",
3835
+ isPortalApp: false,
3836
+ isEnableMobLoading: false,
3837
+ mobLoadingCaption: "",
3838
+ mobLoadingDescription: "",
3839
+ mobLoadingBackground: ""
3857
3840
  };
3858
3841
 
3859
3842
  // src/error/http-error/http-error.ts
@@ -4443,6 +4426,7 @@ var CoreInterceptor = class extends Interceptor {
4443
4426
  * @memberof CoreInterceptor
4444
4427
  */
4445
4428
  async onResponseError(error) {
4429
+ var _a;
4446
4430
  const { config, response } = error;
4447
4431
  if (this.instance && (response == null ? void 0 : response.status) === 401 && config && !config._retry && config.url && // 排除获取系统信息、应用数据、刷新 token 预定义接口
4448
4432
  (config.url.indexOf("/uaa/getbydcsystem/") === -1 || config.url.indexOf("/appdata") !== -1 || config.url.indexOf("/uaa/refresh_token/") !== -1)) {
@@ -4463,7 +4447,7 @@ var CoreInterceptor = class extends Interceptor {
4463
4447
  }
4464
4448
  const res = await ibiz.net.get(
4465
4449
  "/appdata",
4466
- ibiz.appUtil.getAppContext()
4450
+ (_a = ibiz.appUtil) == null ? void 0 : _a.getAppContext()
4467
4451
  );
4468
4452
  if (res && res.ok) {
4469
4453
  ibiz.appData = res.data;
@@ -5476,10 +5460,8 @@ var StringUtil = class {
5476
5460
  if (notNilEmpty2(params)) {
5477
5461
  const strArr = str.match(this.paramsReg);
5478
5462
  strArr == null ? void 0 : strArr.forEach((_key) => {
5479
- const key = _key.slice(8, _key.length - 1);
5480
- if (params[key]) {
5481
- str = str.replace("${params.".concat(key, "}"), params[key]);
5482
- }
5463
+ const key = _key.slice(9, _key.length - 1);
5464
+ str = str.replace("${params.".concat(key, "}"), params[key] || "");
5483
5465
  });
5484
5466
  }
5485
5467
  if (notNilEmpty2(data)) {
@@ -5866,9 +5848,18 @@ function calcMimeByFileName(fileName) {
5866
5848
  case "tar":
5867
5849
  mime = "application/x-tar";
5868
5850
  break;
5869
- case "xlsx":
5851
+ case "xls":
5870
5852
  mime = "application/vnd.ms-excel";
5871
5853
  break;
5854
+ case "xlsx":
5855
+ mime = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
5856
+ break;
5857
+ case "pdf":
5858
+ mime = "application/pdf";
5859
+ break;
5860
+ case "html":
5861
+ mime = "text/html";
5862
+ break;
5872
5863
  default:
5873
5864
  mime = "";
5874
5865
  }
@@ -6149,9 +6140,11 @@ async function setRemoteStyle(url) {
6149
6140
  import { mergeDeepRight as mergeDeepRight2 } from "ramda";
6150
6141
  var IterateOpts = {
6151
6142
  /** 子集合属性数组 */
6152
- childrenFields: ["children"]
6143
+ childrenFields: ["children"],
6144
+ /** 是否跳出当前操作 */
6145
+ isBreak: false
6153
6146
  };
6154
- var BreakError = new Error("\u4E2D\u65AD\u64CD\u4F5C");
6147
+ var ReturnError = new Error("\u4E2D\u65AD\u64CD\u4F5C");
6155
6148
  function getChildField(parent, fields) {
6156
6149
  var _a;
6157
6150
  for (const field of fields) {
@@ -6160,14 +6153,25 @@ function getChildField(parent, fields) {
6160
6153
  }
6161
6154
  }
6162
6155
  }
6156
+ function getChildFieldObj(parent, fields) {
6157
+ for (const field of fields) {
6158
+ if (parent[field]) {
6159
+ return parent[field];
6160
+ }
6161
+ }
6162
+ }
6163
6163
  function _recursiveIterate(parent, callback, opts) {
6164
6164
  const { childrenFields } = mergeDeepRight2(IterateOpts, opts || {});
6165
6165
  const children = getChildField(parent, childrenFields);
6166
6166
  if (children == null ? void 0 : children.length) {
6167
- for (const child of children) {
6168
- const isBreak = callback(child, parent);
6169
- if (isBreak) {
6170
- throw BreakError;
6167
+ for (let i = 0; i < children.length; i++) {
6168
+ const child = children[i];
6169
+ const result = callback(child, parent);
6170
+ if (result) {
6171
+ if (opts == null ? void 0 : opts.isBreak) {
6172
+ break;
6173
+ }
6174
+ throw ReturnError;
6171
6175
  }
6172
6176
  recursiveIterate(child, callback, opts);
6173
6177
  }
@@ -6177,7 +6181,33 @@ function recursiveIterate(parent, callback, opts) {
6177
6181
  try {
6178
6182
  _recursiveIterate(parent, callback, opts);
6179
6183
  } catch (error) {
6180
- if (error !== BreakError) {
6184
+ if (error !== ReturnError) {
6185
+ throw error;
6186
+ }
6187
+ }
6188
+ }
6189
+ function _recursiveExecute(parent, callback, opts) {
6190
+ const { childrenFields } = mergeDeepRight2(IterateOpts, opts || {});
6191
+ const children = getChildFieldObj(parent, childrenFields);
6192
+ if (children) {
6193
+ for (let i = 0; i < Object.values(children).length; i++) {
6194
+ const child = Object.values(children)[i];
6195
+ const result = callback(child, parent);
6196
+ if (result) {
6197
+ if (opts == null ? void 0 : opts.isBreak) {
6198
+ break;
6199
+ }
6200
+ throw ReturnError;
6201
+ }
6202
+ _recursiveExecute(child, callback, opts);
6203
+ }
6204
+ }
6205
+ }
6206
+ function recursiveExecute(parent, callback, opts) {
6207
+ try {
6208
+ _recursiveExecute(parent, callback, opts);
6209
+ } catch (error) {
6210
+ if (error !== ReturnError) {
6181
6211
  throw error;
6182
6212
  }
6183
6213
  }
@@ -6522,6 +6552,7 @@ export {
6522
6552
  RuntimeModelError,
6523
6553
  StringUtil,
6524
6554
  UrlHelper,
6555
+ _recursiveExecute,
6525
6556
  awaitTimeout,
6526
6557
  base64ToBlob,
6527
6558
  base64ToStr,
@@ -6559,6 +6590,7 @@ export {
6559
6590
  mergeInLeft,
6560
6591
  onClickOutside,
6561
6592
  plus,
6593
+ recursiveExecute,
6562
6594
  recursiveIterate,
6563
6595
  resetAppCookie,
6564
6596
  selectFile,