@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 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
- let index = 1;
88738
- let success = true;
88739
- do {
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
- try {
88743
- await ibiz.plugin.loadPlugin({
88744
- runtimeObject: true,
88745
- rtobjectName: "ExtensionPlugin".concat(suffix),
88746
- rtobjectRepo: targetUrl
88747
- });
88748
- index += 1;
88749
- success = true;
88750
- } catch (error) {
88751
- ibiz.log.warn(
88752
- ibiz.i18n.t("runtime.hub.noExtensionPlugin", {
88753
- targetUrl
88754
- })
88755
- );
88756
- success = false;
88757
- }
88758
- } while (success);
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,