@ibiz-template/runtime 0.7.41-alpha.137 → 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 +75 -21
- package/dist/index.system.min.js +1 -1
- package/out/app-hub.d.ts.map +1 -1
- package/out/app-hub.js +47 -21
- package/out/config/global-config.d.ts.map +1 -1
- package/out/config/global-config.js +1 -0
- package/out/interface/api/common/global-config/i-api-global-common-config.d.ts +6 -0
- package/out/interface/api/common/global-config/i-api-global-common-config.d.ts.map +1 -1
- package/out/interface/api/util/i-api-app-util.d.ts +6 -0
- package/out/interface/api/util/i-api-app-util.d.ts.map +1 -1
- package/out/interface/util/i-app-util/i-app-util.d.ts +7 -0
- package/out/interface/util/i-app-util/i-app-util.d.ts.map +1 -1
- package/out/utils/index.d.ts +1 -0
- package/out/utils/index.d.ts.map +1 -1
- package/out/utils/index.js +1 -0
- package/out/utils/task-util/task-util.d.ts +8 -0
- package/out/utils/task-util/task-util.d.ts.map +1 -0
- package/out/utils/task-util/task-util.js +38 -0
- package/package.json +3 -3
- package/src/app-hub.ts +51 -22
- package/src/config/global-config.ts +1 -0
- package/src/interface/api/common/global-config/i-api-global-common-config.ts +7 -0
- package/src/interface/api/util/i-api-app-util.ts +7 -0
- package/src/interface/util/i-app-util/i-app-util.ts +9 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/task-util/task-util.ts +45 -0
package/dist/index.esm.js
CHANGED
|
@@ -20014,7 +20014,8 @@ var GlobalConfig = class {
|
|
|
20014
20014
|
aiUploadMaxSize: 5242880,
|
|
20015
20015
|
aiAutoQuestion: true,
|
|
20016
20016
|
asyncImport: false,
|
|
20017
|
-
aiTopicStorageMode: "DEFAULT"
|
|
20017
|
+
aiTopicStorageMode: "DEFAULT",
|
|
20018
|
+
aiInputPlaceholder: ""
|
|
20018
20019
|
};
|
|
20019
20020
|
// 全局分页流布局配置
|
|
20020
20021
|
this.drtab = {
|
|
@@ -86155,6 +86156,32 @@ var WaterMarkUtil = class {
|
|
|
86155
86156
|
}
|
|
86156
86157
|
};
|
|
86157
86158
|
|
|
86159
|
+
// src/utils/task-util/task-util.ts
|
|
86160
|
+
async function runWithConcurrency(tasks, concurrency) {
|
|
86161
|
+
const results = new Array(tasks.length);
|
|
86162
|
+
const executing = /* @__PURE__ */ new Map();
|
|
86163
|
+
let currentIndex = 0;
|
|
86164
|
+
const runTask = async (index) => {
|
|
86165
|
+
try {
|
|
86166
|
+
const data = await tasks[index]();
|
|
86167
|
+
results[index] = data;
|
|
86168
|
+
} finally {
|
|
86169
|
+
executing.delete(index);
|
|
86170
|
+
}
|
|
86171
|
+
};
|
|
86172
|
+
while (currentIndex < tasks.length) {
|
|
86173
|
+
if (executing.size >= concurrency) {
|
|
86174
|
+
await Promise.race(executing.values());
|
|
86175
|
+
continue;
|
|
86176
|
+
}
|
|
86177
|
+
const index = currentIndex++;
|
|
86178
|
+
const taskPromise = runTask(index);
|
|
86179
|
+
executing.set(index, taskPromise);
|
|
86180
|
+
}
|
|
86181
|
+
await Promise.all(executing.values());
|
|
86182
|
+
return results;
|
|
86183
|
+
}
|
|
86184
|
+
|
|
86158
86185
|
// src/utils/map-util/map-util.ts
|
|
86159
86186
|
function getAreaLevelNum(areaLevel) {
|
|
86160
86187
|
return ["province", "city", "district", "township"].indexOf(areaLevel) + 2;
|
|
@@ -88734,28 +88761,50 @@ var AppHub = class {
|
|
|
88734
88761
|
* @memberof AppHub
|
|
88735
88762
|
*/
|
|
88736
88763
|
async loadMainExtensionPlugin() {
|
|
88737
|
-
|
|
88738
|
-
|
|
88739
|
-
|
|
88764
|
+
var _a3;
|
|
88765
|
+
const { enableExternalPlugin, concurrentPluginCount } = ibiz.appUtil.getRuntimeDevToolConfig();
|
|
88766
|
+
if (!enableExternalPlugin) {
|
|
88767
|
+
return;
|
|
88768
|
+
}
|
|
88769
|
+
let pluginListLength = 0;
|
|
88770
|
+
const res = await ibiz.net.axios({
|
|
88771
|
+
method: "get",
|
|
88772
|
+
url: "".concat(ibiz.env.baseUrl, "/").concat(ibiz.env.appId).concat(ibiz.env.remoteModelUrl, "/extension")
|
|
88773
|
+
});
|
|
88774
|
+
if (res.status === 200 && res.data) {
|
|
88775
|
+
pluginListLength = Number(res.data);
|
|
88776
|
+
}
|
|
88777
|
+
if (pluginListLength === 0)
|
|
88778
|
+
return;
|
|
88779
|
+
const pluginTasks = Array.from({ length: pluginListLength }, (_, i) => {
|
|
88780
|
+
const index = i + 1;
|
|
88740
88781
|
const suffix = index === 1 ? "" : "".concat(index);
|
|
88741
88782
|
const targetUrl = "".concat(ibiz.env.baseUrl, "/").concat(ibiz.env.appId).concat(ibiz.env.remoteModelUrl, "/ext").concat(suffix);
|
|
88742
|
-
|
|
88743
|
-
|
|
88744
|
-
|
|
88745
|
-
|
|
88746
|
-
|
|
88747
|
-
|
|
88748
|
-
|
|
88749
|
-
|
|
88750
|
-
|
|
88751
|
-
|
|
88752
|
-
|
|
88753
|
-
|
|
88754
|
-
|
|
88755
|
-
|
|
88756
|
-
|
|
88757
|
-
|
|
88758
|
-
|
|
88783
|
+
return async () => {
|
|
88784
|
+
try {
|
|
88785
|
+
await ibiz.plugin.loadPlugin({
|
|
88786
|
+
runtimeObject: true,
|
|
88787
|
+
rtobjectName: "ExtensionPlugin".concat(suffix),
|
|
88788
|
+
rtobjectRepo: targetUrl
|
|
88789
|
+
});
|
|
88790
|
+
return { ok: true, data: { index, targetUrl } };
|
|
88791
|
+
} catch (error) {
|
|
88792
|
+
return { ok: false, data: { index, targetUrl, error } };
|
|
88793
|
+
}
|
|
88794
|
+
};
|
|
88795
|
+
});
|
|
88796
|
+
const results = await runWithConcurrency(
|
|
88797
|
+
pluginTasks,
|
|
88798
|
+
concurrentPluginCount || 1
|
|
88799
|
+
);
|
|
88800
|
+
const errorResults = results.filter((result) => !(result == null ? void 0 : result.ok));
|
|
88801
|
+
if (errorResults && errorResults.length > 0) {
|
|
88802
|
+
ibiz.log.warn(
|
|
88803
|
+
ibiz.i18n.t("runtime.hub.noExtensionPlugin", {
|
|
88804
|
+
targetUrl: ((_a3 = errorResults[0].data) == null ? void 0 : _a3.targetUrl) || "Unknown"
|
|
88805
|
+
})
|
|
88806
|
+
);
|
|
88807
|
+
}
|
|
88759
88808
|
}
|
|
88760
88809
|
/**
|
|
88761
88810
|
* @description 加载指定子应用扩展插件
|
|
@@ -88764,6 +88813,10 @@ var AppHub = class {
|
|
|
88764
88813
|
* @memberof AppHub
|
|
88765
88814
|
*/
|
|
88766
88815
|
async loadSubExtensionPlugin(appId2) {
|
|
88816
|
+
const { enableExternalPlugin } = ibiz.appUtil.getRuntimeDevToolConfig();
|
|
88817
|
+
if (!enableExternalPlugin) {
|
|
88818
|
+
return;
|
|
88819
|
+
}
|
|
88767
88820
|
const targetUrl = "".concat(ibiz.env.baseUrl, "/").concat(ibiz.env.appId).concat(ibiz.env.remoteModelUrl, "/subapps/").concat(appId2, "/ext");
|
|
88768
88821
|
try {
|
|
88769
88822
|
await ibiz.plugin.loadPlugin({
|
|
@@ -94217,6 +94270,7 @@ export {
|
|
|
94217
94270
|
registerUILogicNodeProvider,
|
|
94218
94271
|
registerUILogicProvider,
|
|
94219
94272
|
registerViewProvider,
|
|
94273
|
+
runWithConcurrency,
|
|
94220
94274
|
selectAndImport,
|
|
94221
94275
|
strContain,
|
|
94222
94276
|
stringifyObj,
|