@ibiz-template/core 0.7.40 → 0.7.41-alpha.101

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 (62) hide show
  1. package/dist/index.esm.js +81 -15
  2. package/dist/index.system.min.js +1 -1
  3. package/out/context/index.d.ts.map +1 -1
  4. package/out/environment/environment.d.ts.map +1 -1
  5. package/out/environment/environment.js +8 -1
  6. package/out/error/http-error/http-error.d.ts +2 -2
  7. package/out/error/http-error/http-error.d.ts.map +1 -1
  8. package/out/interface/api/chat-message/i-api-chat-message.d.ts +63 -0
  9. package/out/interface/api/chat-message/i-api-chat-message.d.ts.map +1 -0
  10. package/out/interface/api/chat-message/i-api-chat-message.js +1 -0
  11. package/out/interface/api/chat-message/index.d.ts +2 -0
  12. package/out/interface/api/chat-message/index.d.ts.map +1 -0
  13. package/out/interface/api/chat-message/index.js +1 -0
  14. package/out/interface/api/environment/i-devtool-config.d.ts +11 -1
  15. package/out/interface/api/environment/i-devtool-config.d.ts.map +1 -1
  16. package/out/interface/api/environment/i-environment.d.ts +138 -1
  17. package/out/interface/api/environment/i-environment.d.ts.map +1 -1
  18. package/out/interface/api/ibizsys/i-app-data.d.ts +57 -0
  19. package/out/interface/api/ibizsys/i-app-data.d.ts.map +1 -0
  20. package/out/interface/api/ibizsys/i-app-data.js +1 -0
  21. package/out/interface/api/ibizsys/i-org-data.d.ts +1 -1
  22. package/out/interface/api/ibizsys/index.d.ts +1 -0
  23. package/out/interface/api/ibizsys/index.d.ts.map +1 -1
  24. package/out/interface/api/index.d.ts +1 -0
  25. package/out/interface/api/index.d.ts.map +1 -1
  26. package/out/interface/api/index.js +1 -0
  27. package/out/interface/api/utils/i-api-i18n.d.ts +9 -9
  28. package/out/interface/api/utils/index.d.ts +1 -0
  29. package/out/interface/api/utils/index.d.ts.map +1 -1
  30. package/out/interface/api/utils/message-center/base/i-message-base.d.ts +3 -3
  31. package/out/interface/api/utils/message-center/command/add-in-changed/i-command-add-in-changed.d.ts +1 -1
  32. package/out/interface/api/utils/message-center/command/async-action/i-command-async-action.d.ts +1 -1
  33. package/out/interface/api/utils/message-center/command/i-message-command.d.ts +1 -1
  34. package/out/interface/api/utils/message-center/command/internal-message/i-command-internal-message.d.ts +1 -1
  35. package/out/interface/api/utils/message-center/command/mark-open-data/i-command-mark-open-data.d.ts +1 -1
  36. package/out/interface/api/utils/message-center/common/i-message-center-event.d.ts +5 -0
  37. package/out/interface/api/utils/message-center/common/i-message-center-event.d.ts.map +1 -1
  38. package/out/interface/api/utils/message-center/common/i-portal-message.d.ts +3 -3
  39. package/out/interface/api/utils/message-center/console/i-message-console.d.ts +1 -1
  40. package/out/interface/api/utils/message-center/error/i-message-error.d.ts +1 -1
  41. package/out/interface/api/utils/message-center/i-message-center.d.ts +2 -2
  42. package/out/interface/api/utils/net/i-api-http-error.d.ts +39 -0
  43. package/out/interface/api/utils/net/i-api-http-error.d.ts.map +1 -0
  44. package/out/interface/api/utils/net/i-api-http-error.js +1 -0
  45. package/out/interface/api/utils/net/i-api-net.d.ts +1 -1
  46. package/out/interface/i-chat-message/i-chat-message.d.ts +2 -49
  47. package/out/interface/i-chat-message/i-chat-message.d.ts.map +1 -1
  48. package/out/utils/download-file/download-file.d.ts.map +1 -1
  49. package/out/utils/download-file/download-file.js +11 -1
  50. package/out/utils/interceptor/core-interceptor.js +2 -1
  51. package/out/utils/net/http-response.d.ts +2 -1
  52. package/out/utils/net/http-response.d.ts.map +1 -1
  53. package/out/utils/net/http-response.js +5 -1
  54. package/out/utils/net/net.d.ts +1 -1
  55. package/out/utils/net/net.d.ts.map +1 -1
  56. package/out/utils/net/net.js +8 -0
  57. package/out/utils/recursive/find-recursive-child.d.ts +20 -0
  58. package/out/utils/recursive/find-recursive-child.d.ts.map +1 -1
  59. package/out/utils/recursive/find-recursive-child.js +69 -7
  60. package/out/utils/string-util/string-util.d.ts.map +1 -1
  61. package/out/utils/string-util/string-util.js +2 -4
  62. package/package.json +4 -4
package/dist/index.esm.js CHANGED
@@ -3799,6 +3799,7 @@ var Environment = {
3799
3799
  // 配置示例 DefaultOSSCat=cat
3800
3800
  downloadFileUrl: "/ibizutil/download/{cat}",
3801
3801
  uploadFileUrl: "/ibizutil/upload/{cat}",
3802
+ defaultOSSCat: "",
3802
3803
  casLoginUrl: "",
3803
3804
  loginMode: "DEFAULT" /* DEFAULT */,
3804
3805
  menuPermissionMode: "MIXIN" /* MIXIN */,
@@ -3829,7 +3830,13 @@ var Environment = {
3829
3830
  enableAI: true,
3830
3831
  aMapSecurityJsCode: "",
3831
3832
  aMapKey: "",
3832
- runContainer: "FULLCODE"
3833
+ runContainer: "DYNAENGINE",
3834
+ mobWeChatAppId: "",
3835
+ isPortalApp: false,
3836
+ isEnableMobLoading: false,
3837
+ mobLoadingCaption: "",
3838
+ mobLoadingDescription: "",
3839
+ mobLoadingBackground: ""
3833
3840
  };
3834
3841
 
3835
3842
  // src/error/http-error/http-error.ts
@@ -4419,6 +4426,7 @@ var CoreInterceptor = class extends Interceptor {
4419
4426
  * @memberof CoreInterceptor
4420
4427
  */
4421
4428
  async onResponseError(error) {
4429
+ var _a;
4422
4430
  const { config, response } = error;
4423
4431
  if (this.instance && (response == null ? void 0 : response.status) === 401 && config && !config._retry && config.url && // 排除获取系统信息、应用数据、刷新 token 预定义接口
4424
4432
  (config.url.indexOf("/uaa/getbydcsystem/") === -1 || config.url.indexOf("/appdata") !== -1 || config.url.indexOf("/uaa/refresh_token/") !== -1)) {
@@ -4439,7 +4447,7 @@ var CoreInterceptor = class extends Interceptor {
4439
4447
  }
4440
4448
  const res = await ibiz.net.get(
4441
4449
  "/appdata",
4442
- ibiz.appUtil.getAppContext()
4450
+ (_a = ibiz.appUtil) == null ? void 0 : _a.getAppContext()
4443
4451
  );
4444
4452
  if (res && res.ok) {
4445
4453
  ibiz.appData = res.data;
@@ -5050,9 +5058,10 @@ var HttpResponse = class {
5050
5058
  * @param {unknown} [data] 返回的数据
5051
5059
  * @param {number} [status] 状态码 (默认为 200)
5052
5060
  * @param {string} [statusText] 状态描述 (默认为空字符)
5061
+ * @param {RawAxiosResponseHeaders | AxiosResponseHeaders} [headers] 响应头
5053
5062
  * @memberof HttpResponse
5054
5063
  */
5055
- constructor(data, status, statusText) {
5064
+ constructor(data, status, statusText, headers) {
5056
5065
  /**
5057
5066
  * @description 本地仿造响应
5058
5067
  * @memberof HttpResponse
@@ -5069,6 +5078,9 @@ var HttpResponse = class {
5069
5078
  if (this.status >= 200 && this.status < 300) {
5070
5079
  this.ok = true;
5071
5080
  }
5081
+ if (headers) {
5082
+ this.headers = headers;
5083
+ }
5072
5084
  }
5073
5085
  };
5074
5086
 
@@ -5375,6 +5387,9 @@ var Net = class {
5375
5387
  if (data && Object.prototype.hasOwnProperty.call(data, "srfversionid")) {
5376
5388
  params.srfversionid = data.srfversionid;
5377
5389
  }
5390
+ if (data && Object.prototype.hasOwnProperty.call(data, "srfmenuitem")) {
5391
+ delete data.srfmenuitem;
5392
+ }
5378
5393
  if (params && Object.prototype.hasOwnProperty.call(params, "srfdefdata")) {
5379
5394
  delete params.srfdefdata;
5380
5395
  }
@@ -5395,6 +5410,9 @@ var Net = class {
5395
5410
  if (params && Object.prototype.hasOwnProperty.call(params, "srfdefdata")) {
5396
5411
  delete params.srfdefdata;
5397
5412
  }
5413
+ if (params && Object.prototype.hasOwnProperty.call(params, "srfmenuitem")) {
5414
+ delete params.srfmenuitem;
5415
+ }
5398
5416
  {
5399
5417
  const urlSplit = url.split("?");
5400
5418
  urlSplit[0] = urlSplit[0].split("/").map((item) => encodeURIComponent(item)).join("/");
@@ -5446,10 +5464,8 @@ var StringUtil = class {
5446
5464
  if (notNilEmpty2(params)) {
5447
5465
  const strArr = str.match(this.paramsReg);
5448
5466
  strArr == null ? void 0 : strArr.forEach((_key) => {
5449
- const key = _key.slice(8, _key.length - 1);
5450
- if (params[key]) {
5451
- str = str.replace("${params.".concat(key, "}"), params[key]);
5452
- }
5467
+ const key = _key.slice(9, _key.length - 1);
5468
+ str = str.replace("${params.".concat(key, "}"), params[key] || "");
5453
5469
  });
5454
5470
  }
5455
5471
  if (notNilEmpty2(data)) {
@@ -5836,9 +5852,18 @@ function calcMimeByFileName(fileName) {
5836
5852
  case "tar":
5837
5853
  mime = "application/x-tar";
5838
5854
  break;
5839
- case "xlsx":
5855
+ case "xls":
5840
5856
  mime = "application/vnd.ms-excel";
5841
5857
  break;
5858
+ case "xlsx":
5859
+ mime = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
5860
+ break;
5861
+ case "pdf":
5862
+ mime = "application/pdf";
5863
+ break;
5864
+ case "html":
5865
+ mime = "text/html";
5866
+ break;
5842
5867
  default:
5843
5868
  mime = "";
5844
5869
  }
@@ -6119,9 +6144,11 @@ async function setRemoteStyle(url) {
6119
6144
  import { mergeDeepRight as mergeDeepRight2 } from "ramda";
6120
6145
  var IterateOpts = {
6121
6146
  /** 子集合属性数组 */
6122
- childrenFields: ["children"]
6147
+ childrenFields: ["children"],
6148
+ /** 是否跳出当前操作 */
6149
+ isBreak: false
6123
6150
  };
6124
- var BreakError = new Error("\u4E2D\u65AD\u64CD\u4F5C");
6151
+ var ReturnError = new Error("\u4E2D\u65AD\u64CD\u4F5C");
6125
6152
  function getChildField(parent, fields) {
6126
6153
  var _a;
6127
6154
  for (const field of fields) {
@@ -6130,14 +6157,25 @@ function getChildField(parent, fields) {
6130
6157
  }
6131
6158
  }
6132
6159
  }
6160
+ function getChildFieldObj(parent, fields) {
6161
+ for (const field of fields) {
6162
+ if (parent[field]) {
6163
+ return parent[field];
6164
+ }
6165
+ }
6166
+ }
6133
6167
  function _recursiveIterate(parent, callback, opts) {
6134
6168
  const { childrenFields } = mergeDeepRight2(IterateOpts, opts || {});
6135
6169
  const children = getChildField(parent, childrenFields);
6136
6170
  if (children == null ? void 0 : children.length) {
6137
- for (const child of children) {
6138
- const isBreak = callback(child, parent);
6139
- if (isBreak) {
6140
- throw BreakError;
6171
+ for (let i = 0; i < children.length; i++) {
6172
+ const child = children[i];
6173
+ const result = callback(child, parent);
6174
+ if (result) {
6175
+ if (opts == null ? void 0 : opts.isBreak) {
6176
+ break;
6177
+ }
6178
+ throw ReturnError;
6141
6179
  }
6142
6180
  recursiveIterate(child, callback, opts);
6143
6181
  }
@@ -6147,7 +6185,33 @@ function recursiveIterate(parent, callback, opts) {
6147
6185
  try {
6148
6186
  _recursiveIterate(parent, callback, opts);
6149
6187
  } catch (error) {
6150
- if (error !== BreakError) {
6188
+ if (error !== ReturnError) {
6189
+ throw error;
6190
+ }
6191
+ }
6192
+ }
6193
+ function _recursiveExecute(parent, callback, opts) {
6194
+ const { childrenFields } = mergeDeepRight2(IterateOpts, opts || {});
6195
+ const children = getChildFieldObj(parent, childrenFields);
6196
+ if (children) {
6197
+ for (let i = 0; i < Object.values(children).length; i++) {
6198
+ const child = Object.values(children)[i];
6199
+ const result = callback(child, parent);
6200
+ if (result) {
6201
+ if (opts == null ? void 0 : opts.isBreak) {
6202
+ break;
6203
+ }
6204
+ throw ReturnError;
6205
+ }
6206
+ _recursiveExecute(child, callback, opts);
6207
+ }
6208
+ }
6209
+ }
6210
+ function recursiveExecute(parent, callback, opts) {
6211
+ try {
6212
+ _recursiveExecute(parent, callback, opts);
6213
+ } catch (error) {
6214
+ if (error !== ReturnError) {
6151
6215
  throw error;
6152
6216
  }
6153
6217
  }
@@ -6492,6 +6556,7 @@ export {
6492
6556
  RuntimeModelError,
6493
6557
  StringUtil,
6494
6558
  UrlHelper,
6559
+ _recursiveExecute,
6495
6560
  awaitTimeout,
6496
6561
  base64ToBlob,
6497
6562
  base64ToStr,
@@ -6529,6 +6594,7 @@ export {
6529
6594
  mergeInLeft,
6530
6595
  onClickOutside,
6531
6596
  plus,
6597
+ recursiveExecute,
6532
6598
  recursiveIterate,
6533
6599
  resetAppCookie,
6534
6600
  selectFile,