@ibiz-template/core 0.7.41-alpha.12 → 0.7.41-alpha.138
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/dist/index.esm.js +94 -23
- package/dist/index.system.min.js +1 -1
- package/out/environment/environment.d.ts.map +1 -1
- package/out/environment/environment.js +10 -0
- package/out/error/http-error/http-error-factory.d.ts +1 -1
- package/out/error/http-error/http-error-factory.d.ts.map +1 -1
- package/out/error/http-error/http-error-factory.js +11 -1
- package/out/error/http-error/http-error.d.ts +2 -2
- package/out/error/http-error/http-error.d.ts.map +1 -1
- package/out/interface/api/chat-message/i-api-chat-message.d.ts +63 -0
- package/out/interface/api/chat-message/i-api-chat-message.d.ts.map +1 -0
- package/out/interface/api/chat-message/i-api-chat-message.js +1 -0
- package/out/interface/api/chat-message/index.d.ts +2 -0
- package/out/interface/api/chat-message/index.d.ts.map +1 -0
- package/out/interface/api/chat-message/index.js +1 -0
- package/out/interface/api/environment/i-devtool-config.d.ts +29 -1
- package/out/interface/api/environment/i-devtool-config.d.ts.map +1 -1
- package/out/interface/api/environment/i-environment.d.ts +146 -1
- package/out/interface/api/environment/i-environment.d.ts.map +1 -1
- package/out/interface/api/ibizsys/i-app-data.d.ts +57 -0
- package/out/interface/api/ibizsys/i-app-data.d.ts.map +1 -0
- package/out/interface/api/ibizsys/i-app-data.js +1 -0
- package/out/interface/api/ibizsys/i-org-data.d.ts +1 -1
- package/out/interface/api/ibizsys/index.d.ts +1 -0
- package/out/interface/api/ibizsys/index.d.ts.map +1 -1
- package/out/interface/api/index.d.ts +1 -0
- package/out/interface/api/index.d.ts.map +1 -1
- package/out/interface/api/index.js +1 -0
- package/out/interface/api/utils/i-api-i18n.d.ts +9 -9
- package/out/interface/api/utils/index.d.ts +1 -0
- package/out/interface/api/utils/index.d.ts.map +1 -1
- package/out/interface/api/utils/message-center/base/i-message-base.d.ts +3 -3
- package/out/interface/api/utils/message-center/command/add-in-changed/i-command-add-in-changed.d.ts +1 -1
- package/out/interface/api/utils/message-center/command/async-action/i-command-async-action.d.ts +1 -1
- package/out/interface/api/utils/message-center/command/i-message-command.d.ts +1 -1
- package/out/interface/api/utils/message-center/command/internal-message/i-command-internal-message.d.ts +1 -1
- package/out/interface/api/utils/message-center/command/mark-open-data/i-command-mark-open-data.d.ts +1 -1
- package/out/interface/api/utils/message-center/common/i-message-center-event.d.ts +5 -0
- package/out/interface/api/utils/message-center/common/i-message-center-event.d.ts.map +1 -1
- package/out/interface/api/utils/message-center/common/i-portal-message.d.ts +3 -3
- package/out/interface/api/utils/message-center/console/i-message-console.d.ts +1 -1
- package/out/interface/api/utils/message-center/error/i-message-error.d.ts +1 -1
- package/out/interface/api/utils/message-center/i-message-center.d.ts +2 -2
- package/out/interface/api/utils/net/i-api-http-error.d.ts +39 -0
- package/out/interface/api/utils/net/i-api-http-error.d.ts.map +1 -0
- package/out/interface/api/utils/net/i-api-http-error.js +1 -0
- package/out/interface/api/utils/net/i-api-net.d.ts +1 -1
- package/out/interface/i-chat-message/i-chat-message.d.ts +2 -49
- package/out/interface/i-chat-message/i-chat-message.d.ts.map +1 -1
- package/out/utils/download-file/download-file.d.ts.map +1 -1
- package/out/utils/download-file/download-file.js +5 -1
- package/out/utils/interceptor/core-interceptor.js +2 -1
- package/out/utils/net/http-response.d.ts +2 -1
- package/out/utils/net/http-response.d.ts.map +1 -1
- package/out/utils/net/http-response.js +5 -1
- package/out/utils/net/net.d.ts +1 -1
- package/out/utils/net/net.d.ts.map +1 -1
- package/out/utils/net/net.js +16 -6
- package/out/utils/recursive/find-recursive-child.d.ts +20 -0
- package/out/utils/recursive/find-recursive-child.d.ts.map +1 -1
- package/out/utils/recursive/find-recursive-child.js +69 -7
- package/out/utils/string-util/string-util.d.ts.map +1 -1
- package/out/utils/string-util/string-util.js +2 -4
- package/package.json +5 -4
- package/src/command/command-register.ts +121 -0
- package/src/command/command.ts +78 -0
- package/src/command/index.ts +8 -0
- package/src/command/utils/index.ts +2 -0
- package/src/command/utils/linked-list.ts +136 -0
- package/src/command/utils/util.ts +103 -0
- package/src/constant/core/core.ts +54 -0
- package/src/constant/emoji/emoji.ts +2929 -0
- package/src/constant/http-status-message/http-status-message.ts +18 -0
- package/src/constant/index.ts +4 -0
- package/src/constant/util/util.ts +3 -0
- package/src/context/index.ts +231 -0
- package/src/environment/environment.ts +67 -0
- package/src/error/http-error/entity-error.ts +29 -0
- package/src/error/http-error/http-error-factory.ts +33 -0
- package/src/error/http-error/http-error.ts +52 -0
- package/src/error/index.ts +7 -0
- package/src/error/model-error/model-error.ts +27 -0
- package/src/error/notice-error/notice-error.ts +16 -0
- package/src/error/runtime-error/runtime-error.ts +13 -0
- package/src/error/runtime-model-error/runtime-model-error.ts +27 -0
- package/src/ibizsys.ts +82 -0
- package/src/index.ts +14 -0
- package/src/install.ts +12 -0
- package/src/interface/api/chat-message/i-api-chat-message.ts +71 -0
- package/src/interface/api/chat-message/index.ts +1 -0
- package/src/interface/api/constant/index.ts +2 -0
- package/src/interface/api/constant/login-mode/login-mode.ts +25 -0
- package/src/interface/api/constant/menu-permission-mode/menu-permission-mode.ts +20 -0
- package/src/interface/api/environment/i-devtool-config.ts +76 -0
- package/src/interface/api/environment/i-environment.ts +532 -0
- package/src/interface/api/environment/index.ts +2 -0
- package/src/interface/api/global-param/i-api-context.ts +37 -0
- package/src/interface/api/global-param/i-global-param.ts +27 -0
- package/src/interface/api/global-param/index.ts +2 -0
- package/src/interface/api/ibizsys/i-api-ibizsys.ts +54 -0
- package/src/interface/api/ibizsys/i-app-data.ts +64 -0
- package/src/interface/api/ibizsys/i-org-data.ts +31 -0
- package/src/interface/api/ibizsys/index.ts +3 -0
- package/src/interface/api/index.ts +6 -0
- package/src/interface/api/utils/i-api-i18n.ts +56 -0
- package/src/interface/api/utils/index.ts +5 -0
- package/src/interface/api/utils/message-center/base/i-message-all.ts +8 -0
- package/src/interface/api/utils/message-center/base/i-message-base.ts +29 -0
- package/src/interface/api/utils/message-center/base/index.ts +2 -0
- package/src/interface/api/utils/message-center/command/add-in-changed/i-add-in-changed.ts +25 -0
- package/src/interface/api/utils/message-center/command/add-in-changed/i-command-add-in-changed.ts +16 -0
- package/src/interface/api/utils/message-center/command/async-action/i-command-async-action.ts +17 -0
- package/src/interface/api/utils/message-center/command/change/i-command-change.ts +8 -0
- package/src/interface/api/utils/message-center/command/create/i-command-create.ts +18 -0
- package/src/interface/api/utils/message-center/command/i-command-base.ts +23 -0
- package/src/interface/api/utils/message-center/command/i-message-command.ts +94 -0
- package/src/interface/api/utils/message-center/command/index.ts +20 -0
- package/src/interface/api/utils/message-center/command/internal-message/i-command-internal-message.ts +17 -0
- package/src/interface/api/utils/message-center/command/internal-message/i-internal-message.ts +132 -0
- package/src/interface/api/utils/message-center/command/mark-open-data/i-command-mark-open-data.ts +17 -0
- package/src/interface/api/utils/message-center/command/mark-open-data/i-mark-open-data.ts +47 -0
- package/src/interface/api/utils/message-center/command/remove/i-command-remove.ts +18 -0
- package/src/interface/api/utils/message-center/command/update/i-command-update.ts +18 -0
- package/src/interface/api/utils/message-center/common/i-app-data-entity.ts +16 -0
- package/src/interface/api/utils/message-center/common/i-message-center-event.ts +15 -0
- package/src/interface/api/utils/message-center/common/i-msg-meta-data.ts +13 -0
- package/src/interface/api/utils/message-center/common/i-portal-async-action.ts +144 -0
- package/src/interface/api/utils/message-center/common/i-portal-message.ts +84 -0
- package/src/interface/api/utils/message-center/common/index.ts +5 -0
- package/src/interface/api/utils/message-center/console/i-message-console.ts +17 -0
- package/src/interface/api/utils/message-center/error/i-message-error.ts +17 -0
- package/src/interface/api/utils/message-center/i-message-center.ts +53 -0
- package/src/interface/api/utils/message-center/index.ts +6 -0
- package/src/interface/api/utils/net/i-api-http-error.ts +43 -0
- package/src/interface/api/utils/net/i-api-net.ts +93 -0
- package/src/interface/api/utils/net/i-http-response.ts +67 -0
- package/src/interface/click-outside/click-outside.ts +51 -0
- package/src/interface/command/command/i-command-option.ts +47 -0
- package/src/interface/command/command/i-command.ts +68 -0
- package/src/interface/command/disposable/i-disposable.ts +12 -0
- package/src/interface/command/i-command-controller.ts +50 -0
- package/src/interface/command/index.ts +11 -0
- package/src/interface/context/index.ts +42 -0
- package/src/interface/error/index.ts +13 -0
- package/src/interface/i-chat-message/i-chat-message.ts +16 -0
- package/src/interface/ibizsys/i-ibizsys.ts +33 -0
- package/src/interface/ibizsys/index.ts +1 -0
- package/src/interface/index.ts +11 -0
- package/src/interface/utils/i-18n.ts +22 -0
- package/src/interface/utils/index.ts +1 -0
- package/src/locale/en/index.ts +30 -0
- package/src/locale/index.ts +2 -0
- package/src/locale/zh-CN/index.ts +28 -0
- package/src/params/params.ts +131 -0
- package/src/types.ts +26 -0
- package/src/utils/bit-mask/bit-mask.ts +87 -0
- package/src/utils/click-outside/click-outside.ts +108 -0
- package/src/utils/clone/clone.ts +38 -0
- package/src/utils/color/color.ts +84 -0
- package/src/utils/cookie-util/cookie-util.ts +192 -0
- package/src/utils/data-type/data-types.ts +93 -0
- package/src/utils/download-file/download-file.ts +110 -0
- package/src/utils/event/event.ts +69 -0
- package/src/utils/history-list/history-item.ts +41 -0
- package/src/utils/history-list/history-list.ts +137 -0
- package/src/utils/index.ts +24 -0
- package/src/utils/interceptor/core-interceptor.ts +127 -0
- package/src/utils/interceptor/index.ts +2 -0
- package/src/utils/interceptor/interceptor.ts +122 -0
- package/src/utils/logger/logger.ts +34 -0
- package/src/utils/message-center/base/message-all.ts +10 -0
- package/src/utils/message-center/base/message-base.ts +73 -0
- package/src/utils/message-center/command/add-in-changed/command-add-in-changed.ts +23 -0
- package/src/utils/message-center/command/async-action/command-async-action.ts +23 -0
- package/src/utils/message-center/command/change/command-change.ts +11 -0
- package/src/utils/message-center/command/command-base/command-base.ts +35 -0
- package/src/utils/message-center/command/create/command-create.ts +25 -0
- package/src/utils/message-center/command/internal-message/command-internal-message.ts +26 -0
- package/src/utils/message-center/command/mark-open-data/command-mark-open-data.ts +23 -0
- package/src/utils/message-center/command/message-command.ts +162 -0
- package/src/utils/message-center/command/remove/command-remove.ts +25 -0
- package/src/utils/message-center/command/update/command-update.ts +25 -0
- package/src/utils/message-center/console/message-console.ts +27 -0
- package/src/utils/message-center/error/message-error.ts +27 -0
- package/src/utils/message-center/index.ts +1 -0
- package/src/utils/message-center/message-center.ts +77 -0
- package/src/utils/namespace/namespace.ts +217 -0
- package/src/utils/net/http-response.ts +60 -0
- package/src/utils/net/net.ts +463 -0
- package/src/utils/recursive/find-recursive-child.ts +238 -0
- package/src/utils/string-util/string-util.ts +76 -0
- package/src/utils/style/remote-style.ts +17 -0
- package/src/utils/sync/await-timeout.ts +29 -0
- package/src/utils/sync/count-latch.ts +79 -0
- package/src/utils/sync/index.ts +2 -0
- package/src/utils/types/types.ts +24 -0
- package/src/utils/upload/select-file.ts +93 -0
- package/src/utils/upload/upload-file.ts +194 -0
- package/src/utils/url-helper/url-helper.ts +52 -0
- package/src/utils/util/util.ts +580 -0
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 */,
|
|
@@ -3824,12 +3825,21 @@ var Environment = {
|
|
|
3824
3825
|
devtoolConfig: {
|
|
3825
3826
|
studioBaseUrl: "https://open.ibizlab.cn/modeldesign/#/",
|
|
3826
3827
|
v9Mode: false,
|
|
3827
|
-
defaultMode: "close"
|
|
3828
|
+
defaultMode: "close",
|
|
3829
|
+
enableExternalPlugin: false,
|
|
3830
|
+
concurrentPluginCount: 1
|
|
3828
3831
|
},
|
|
3829
3832
|
enableAI: true,
|
|
3830
3833
|
aMapSecurityJsCode: "",
|
|
3831
3834
|
aMapKey: "",
|
|
3832
|
-
runContainer: "DYNAENGINE"
|
|
3835
|
+
runContainer: "DYNAENGINE",
|
|
3836
|
+
mobWeChatAppId: "",
|
|
3837
|
+
isPortalApp: false,
|
|
3838
|
+
isEnableMobLoading: false,
|
|
3839
|
+
mobLoadingCaption: "",
|
|
3840
|
+
mobLoadingDescription: "",
|
|
3841
|
+
mobLoadingBackground: "",
|
|
3842
|
+
isAdaptiveScreenWidth: false
|
|
3833
3843
|
};
|
|
3834
3844
|
|
|
3835
3845
|
// src/error/http-error/http-error.ts
|
|
@@ -3948,8 +3958,16 @@ var EntityError = class extends HttpError {
|
|
|
3948
3958
|
|
|
3949
3959
|
// src/error/http-error/http-error-factory.ts
|
|
3950
3960
|
var HttpErrorFactory = class {
|
|
3951
|
-
static getInstance(error) {
|
|
3961
|
+
static async getInstance(error) {
|
|
3952
3962
|
const { response } = error;
|
|
3963
|
+
if ((response == null ? void 0 : response.data) instanceof Blob) {
|
|
3964
|
+
const text = await response.data.text();
|
|
3965
|
+
try {
|
|
3966
|
+
response.data = JSON.parse(text);
|
|
3967
|
+
} catch (e) {
|
|
3968
|
+
response.data = { message: text };
|
|
3969
|
+
}
|
|
3970
|
+
}
|
|
3953
3971
|
if (!response || !response.data) {
|
|
3954
3972
|
return new HttpError(error);
|
|
3955
3973
|
}
|
|
@@ -4419,6 +4437,7 @@ var CoreInterceptor = class extends Interceptor {
|
|
|
4419
4437
|
* @memberof CoreInterceptor
|
|
4420
4438
|
*/
|
|
4421
4439
|
async onResponseError(error) {
|
|
4440
|
+
var _a;
|
|
4422
4441
|
const { config, response } = error;
|
|
4423
4442
|
if (this.instance && (response == null ? void 0 : response.status) === 401 && config && !config._retry && config.url && // 排除获取系统信息、应用数据、刷新 token 预定义接口
|
|
4424
4443
|
(config.url.indexOf("/uaa/getbydcsystem/") === -1 || config.url.indexOf("/appdata") !== -1 || config.url.indexOf("/uaa/refresh_token/") !== -1)) {
|
|
@@ -4439,7 +4458,7 @@ var CoreInterceptor = class extends Interceptor {
|
|
|
4439
4458
|
}
|
|
4440
4459
|
const res = await ibiz.net.get(
|
|
4441
4460
|
"/appdata",
|
|
4442
|
-
ibiz.appUtil.getAppContext()
|
|
4461
|
+
(_a = ibiz.appUtil) == null ? void 0 : _a.getAppContext()
|
|
4443
4462
|
);
|
|
4444
4463
|
if (res && res.ok) {
|
|
4445
4464
|
ibiz.appData = res.data;
|
|
@@ -5050,9 +5069,10 @@ var HttpResponse = class {
|
|
|
5050
5069
|
* @param {unknown} [data] 返回的数据
|
|
5051
5070
|
* @param {number} [status] 状态码 (默认为 200)
|
|
5052
5071
|
* @param {string} [statusText] 状态描述 (默认为空字符)
|
|
5072
|
+
* @param {RawAxiosResponseHeaders | AxiosResponseHeaders} [headers] 响应头
|
|
5053
5073
|
* @memberof HttpResponse
|
|
5054
5074
|
*/
|
|
5055
|
-
constructor(data, status, statusText) {
|
|
5075
|
+
constructor(data, status, statusText, headers) {
|
|
5056
5076
|
/**
|
|
5057
5077
|
* @description 本地仿造响应
|
|
5058
5078
|
* @memberof HttpResponse
|
|
@@ -5069,6 +5089,9 @@ var HttpResponse = class {
|
|
|
5069
5089
|
if (this.status >= 200 && this.status < 300) {
|
|
5070
5090
|
this.ok = true;
|
|
5071
5091
|
}
|
|
5092
|
+
if (headers) {
|
|
5093
|
+
this.headers = headers;
|
|
5094
|
+
}
|
|
5072
5095
|
}
|
|
5073
5096
|
};
|
|
5074
5097
|
|
|
@@ -5185,7 +5208,7 @@ var Net = class {
|
|
|
5185
5208
|
});
|
|
5186
5209
|
return this.doResponseResult(response);
|
|
5187
5210
|
} catch (error) {
|
|
5188
|
-
throw HttpErrorFactory.getInstance(error);
|
|
5211
|
+
throw await HttpErrorFactory.getInstance(error);
|
|
5189
5212
|
}
|
|
5190
5213
|
}
|
|
5191
5214
|
/**
|
|
@@ -5206,7 +5229,7 @@ var Net = class {
|
|
|
5206
5229
|
);
|
|
5207
5230
|
return this.doResponseResult(response);
|
|
5208
5231
|
} catch (error) {
|
|
5209
|
-
throw HttpErrorFactory.getInstance(error);
|
|
5232
|
+
throw await HttpErrorFactory.getInstance(error);
|
|
5210
5233
|
}
|
|
5211
5234
|
}
|
|
5212
5235
|
/**
|
|
@@ -5223,7 +5246,7 @@ var Net = class {
|
|
|
5223
5246
|
const response = await this.request(url, { method: "delete", headers });
|
|
5224
5247
|
return this.doResponseResult(response);
|
|
5225
5248
|
} catch (error) {
|
|
5226
|
-
throw HttpErrorFactory.getInstance(error);
|
|
5249
|
+
throw await HttpErrorFactory.getInstance(error);
|
|
5227
5250
|
}
|
|
5228
5251
|
}
|
|
5229
5252
|
/**
|
|
@@ -5245,7 +5268,7 @@ var Net = class {
|
|
|
5245
5268
|
});
|
|
5246
5269
|
return this.doResponseResult(response);
|
|
5247
5270
|
} catch (error) {
|
|
5248
|
-
throw HttpErrorFactory.getInstance(error);
|
|
5271
|
+
throw await HttpErrorFactory.getInstance(error);
|
|
5249
5272
|
}
|
|
5250
5273
|
}
|
|
5251
5274
|
/**
|
|
@@ -5262,7 +5285,7 @@ var Net = class {
|
|
|
5262
5285
|
});
|
|
5263
5286
|
return this.doResponseResult(response);
|
|
5264
5287
|
} catch (error) {
|
|
5265
|
-
throw HttpErrorFactory.getInstance(error);
|
|
5288
|
+
throw await HttpErrorFactory.getInstance(error);
|
|
5266
5289
|
}
|
|
5267
5290
|
}
|
|
5268
5291
|
/**
|
|
@@ -5292,7 +5315,7 @@ var Net = class {
|
|
|
5292
5315
|
if (this.waitRequest.has(key)) {
|
|
5293
5316
|
this.waitRequest.delete(key);
|
|
5294
5317
|
}
|
|
5295
|
-
throw HttpErrorFactory.getInstance(error);
|
|
5318
|
+
throw await HttpErrorFactory.getInstance(error);
|
|
5296
5319
|
}
|
|
5297
5320
|
}
|
|
5298
5321
|
/**
|
|
@@ -5378,6 +5401,12 @@ var Net = class {
|
|
|
5378
5401
|
if (data && Object.prototype.hasOwnProperty.call(data, "srfmenuitem")) {
|
|
5379
5402
|
delete data.srfmenuitem;
|
|
5380
5403
|
}
|
|
5404
|
+
if (data && Object.prototype.hasOwnProperty.call(data, "srfexportdataset")) {
|
|
5405
|
+
delete data.srfexportdataset;
|
|
5406
|
+
}
|
|
5407
|
+
if (data && Object.prototype.hasOwnProperty.call(data, "srfexportdatakey")) {
|
|
5408
|
+
delete data.srfexportdatakey;
|
|
5409
|
+
}
|
|
5381
5410
|
if (params && Object.prototype.hasOwnProperty.call(params, "srfdefdata")) {
|
|
5382
5411
|
delete params.srfdefdata;
|
|
5383
5412
|
}
|
|
@@ -5452,10 +5481,8 @@ var StringUtil = class {
|
|
|
5452
5481
|
if (notNilEmpty2(params)) {
|
|
5453
5482
|
const strArr = str.match(this.paramsReg);
|
|
5454
5483
|
strArr == null ? void 0 : strArr.forEach((_key) => {
|
|
5455
|
-
const key = _key.slice(
|
|
5456
|
-
|
|
5457
|
-
str = str.replace("${params.".concat(key, "}"), params[key]);
|
|
5458
|
-
}
|
|
5484
|
+
const key = _key.slice(9, _key.length - 1);
|
|
5485
|
+
str = str.replace("${params.".concat(key, "}"), params[key] || "");
|
|
5459
5486
|
});
|
|
5460
5487
|
}
|
|
5461
5488
|
if (notNilEmpty2(data)) {
|
|
@@ -5842,9 +5869,12 @@ function calcMimeByFileName(fileName) {
|
|
|
5842
5869
|
case "tar":
|
|
5843
5870
|
mime = "application/x-tar";
|
|
5844
5871
|
break;
|
|
5845
|
-
case "
|
|
5872
|
+
case "xls":
|
|
5846
5873
|
mime = "application/vnd.ms-excel";
|
|
5847
5874
|
break;
|
|
5875
|
+
case "xlsx":
|
|
5876
|
+
mime = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
5877
|
+
break;
|
|
5848
5878
|
case "pdf":
|
|
5849
5879
|
mime = "application/pdf";
|
|
5850
5880
|
break;
|
|
@@ -6131,9 +6161,11 @@ async function setRemoteStyle(url) {
|
|
|
6131
6161
|
import { mergeDeepRight as mergeDeepRight2 } from "ramda";
|
|
6132
6162
|
var IterateOpts = {
|
|
6133
6163
|
/** 子集合属性数组 */
|
|
6134
|
-
childrenFields: ["children"]
|
|
6164
|
+
childrenFields: ["children"],
|
|
6165
|
+
/** 是否跳出当前操作 */
|
|
6166
|
+
isBreak: false
|
|
6135
6167
|
};
|
|
6136
|
-
var
|
|
6168
|
+
var ReturnError = new Error("\u4E2D\u65AD\u64CD\u4F5C");
|
|
6137
6169
|
function getChildField(parent, fields) {
|
|
6138
6170
|
var _a;
|
|
6139
6171
|
for (const field of fields) {
|
|
@@ -6142,14 +6174,25 @@ function getChildField(parent, fields) {
|
|
|
6142
6174
|
}
|
|
6143
6175
|
}
|
|
6144
6176
|
}
|
|
6177
|
+
function getChildFieldObj(parent, fields) {
|
|
6178
|
+
for (const field of fields) {
|
|
6179
|
+
if (parent[field]) {
|
|
6180
|
+
return parent[field];
|
|
6181
|
+
}
|
|
6182
|
+
}
|
|
6183
|
+
}
|
|
6145
6184
|
function _recursiveIterate(parent, callback, opts) {
|
|
6146
6185
|
const { childrenFields } = mergeDeepRight2(IterateOpts, opts || {});
|
|
6147
6186
|
const children = getChildField(parent, childrenFields);
|
|
6148
6187
|
if (children == null ? void 0 : children.length) {
|
|
6149
|
-
for (
|
|
6150
|
-
const
|
|
6151
|
-
|
|
6152
|
-
|
|
6188
|
+
for (let i = 0; i < children.length; i++) {
|
|
6189
|
+
const child = children[i];
|
|
6190
|
+
const result = callback(child, parent);
|
|
6191
|
+
if (result) {
|
|
6192
|
+
if (opts == null ? void 0 : opts.isBreak) {
|
|
6193
|
+
break;
|
|
6194
|
+
}
|
|
6195
|
+
throw ReturnError;
|
|
6153
6196
|
}
|
|
6154
6197
|
recursiveIterate(child, callback, opts);
|
|
6155
6198
|
}
|
|
@@ -6159,7 +6202,33 @@ function recursiveIterate(parent, callback, opts) {
|
|
|
6159
6202
|
try {
|
|
6160
6203
|
_recursiveIterate(parent, callback, opts);
|
|
6161
6204
|
} catch (error) {
|
|
6162
|
-
if (error !==
|
|
6205
|
+
if (error !== ReturnError) {
|
|
6206
|
+
throw error;
|
|
6207
|
+
}
|
|
6208
|
+
}
|
|
6209
|
+
}
|
|
6210
|
+
function _recursiveExecute(parent, callback, opts) {
|
|
6211
|
+
const { childrenFields } = mergeDeepRight2(IterateOpts, opts || {});
|
|
6212
|
+
const children = getChildFieldObj(parent, childrenFields);
|
|
6213
|
+
if (children) {
|
|
6214
|
+
for (let i = 0; i < Object.values(children).length; i++) {
|
|
6215
|
+
const child = Object.values(children)[i];
|
|
6216
|
+
const result = callback(child, parent);
|
|
6217
|
+
if (result) {
|
|
6218
|
+
if (opts == null ? void 0 : opts.isBreak) {
|
|
6219
|
+
break;
|
|
6220
|
+
}
|
|
6221
|
+
throw ReturnError;
|
|
6222
|
+
}
|
|
6223
|
+
_recursiveExecute(child, callback, opts);
|
|
6224
|
+
}
|
|
6225
|
+
}
|
|
6226
|
+
}
|
|
6227
|
+
function recursiveExecute(parent, callback, opts) {
|
|
6228
|
+
try {
|
|
6229
|
+
_recursiveExecute(parent, callback, opts);
|
|
6230
|
+
} catch (error) {
|
|
6231
|
+
if (error !== ReturnError) {
|
|
6163
6232
|
throw error;
|
|
6164
6233
|
}
|
|
6165
6234
|
}
|
|
@@ -6504,6 +6573,7 @@ export {
|
|
|
6504
6573
|
RuntimeModelError,
|
|
6505
6574
|
StringUtil,
|
|
6506
6575
|
UrlHelper,
|
|
6576
|
+
_recursiveExecute,
|
|
6507
6577
|
awaitTimeout,
|
|
6508
6578
|
base64ToBlob,
|
|
6509
6579
|
base64ToStr,
|
|
@@ -6541,6 +6611,7 @@ export {
|
|
|
6541
6611
|
mergeInLeft,
|
|
6542
6612
|
onClickOutside,
|
|
6543
6613
|
plus,
|
|
6614
|
+
recursiveExecute,
|
|
6544
6615
|
recursiveIterate,
|
|
6545
6616
|
resetAppCookie,
|
|
6546
6617
|
selectFile,
|