@ibiz-template/runtime 0.5.0-beta.4 → 0.5.0

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 (115) hide show
  1. package/dist/index.esm.js +664 -170
  2. package/dist/index.system.min.js +1 -1
  3. package/out/app-hub.d.ts +1 -0
  4. package/out/app-hub.d.ts.map +1 -1
  5. package/out/app-hub.js +5 -0
  6. package/out/controller/control/app-menu/app-menu.controller.d.ts +34 -1
  7. package/out/controller/control/app-menu/app-menu.controller.d.ts.map +1 -1
  8. package/out/controller/control/app-menu/app-menu.controller.js +47 -5
  9. package/out/controller/control/gantt/gantt.controller.d.ts.map +1 -1
  10. package/out/controller/control/gantt/gantt.controller.js +3 -3
  11. package/out/controller/control/grid/grid/entity-schema.d.ts +16 -0
  12. package/out/controller/control/grid/grid/entity-schema.d.ts.map +1 -0
  13. package/out/controller/control/grid/grid/entity-schema.js +81 -0
  14. package/out/controller/control/grid/grid/grid.controller.d.ts +17 -1
  15. package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
  16. package/out/controller/control/grid/grid/grid.controller.js +51 -6
  17. package/out/controller/control/grid/grid/grid.service.js +1 -1
  18. package/out/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.js +1 -1
  19. package/out/controller/control/search-bar/entity-schema.d.ts +13 -0
  20. package/out/controller/control/search-bar/entity-schema.d.ts.map +1 -0
  21. package/out/controller/control/search-bar/entity-schema.js +151 -0
  22. package/out/controller/control/search-bar/search-bar-filter.controller.d.ts +9 -0
  23. package/out/controller/control/search-bar/search-bar-filter.controller.d.ts.map +1 -1
  24. package/out/controller/control/search-bar/search-bar-filter.controller.js +26 -6
  25. package/out/controller/control/search-bar/search-bar.controller.d.ts +29 -1
  26. package/out/controller/control/search-bar/search-bar.controller.d.ts.map +1 -1
  27. package/out/controller/control/search-bar/search-bar.controller.js +55 -8
  28. package/out/controller/control/tree/tree.controller.js +1 -1
  29. package/out/controller/control/tree-grid/tree-grid.controller.d.ts +35 -2
  30. package/out/controller/control/tree-grid/tree-grid.controller.d.ts.map +1 -1
  31. package/out/controller/control/tree-grid/tree-grid.controller.js +60 -0
  32. package/out/controller/control/tree-grid-ex/tree-grid-ex.controller.d.ts.map +1 -1
  33. package/out/controller/control/tree-grid-ex/tree-grid-ex.controller.js +2 -1
  34. package/out/controller/utils/index.d.ts +1 -0
  35. package/out/controller/utils/index.d.ts.map +1 -1
  36. package/out/controller/utils/index.js +1 -0
  37. package/out/controller/utils/jsonschema/entity.d.ts +11 -0
  38. package/out/controller/utils/jsonschema/entity.d.ts.map +1 -0
  39. package/out/controller/utils/jsonschema/entity.js +16 -0
  40. package/out/controller/utils/jsonschema/index.d.ts +2 -0
  41. package/out/controller/utils/jsonschema/index.d.ts.map +1 -0
  42. package/out/controller/utils/jsonschema/index.js +1 -0
  43. package/out/interface/common/i-app-hub-service/i-app-hub-service.d.ts +6 -0
  44. package/out/interface/common/i-app-hub-service/i-app-hub-service.d.ts.map +1 -1
  45. package/out/interface/controller/controller/control/i-grid.controller.d.ts +1 -1
  46. package/out/interface/controller/controller/control/i-grid.controller.d.ts.map +1 -1
  47. package/out/interface/controller/controller/control/i-tree-grid.controller.d.ts +11 -1
  48. package/out/interface/controller/controller/control/i-tree-grid.controller.d.ts.map +1 -1
  49. package/out/interface/controller/state/control/i-tree-grid.state.d.ts +5 -0
  50. package/out/interface/controller/state/control/i-tree-grid.state.d.ts.map +1 -1
  51. package/out/interface/provider/i-app-menu-item.provider.d.ts +31 -0
  52. package/out/interface/provider/i-app-menu-item.provider.d.ts.map +1 -0
  53. package/out/interface/provider/i-app-menu-item.provider.js +1 -0
  54. package/out/interface/provider/index.d.ts +1 -0
  55. package/out/interface/provider/index.d.ts.map +1 -1
  56. package/out/interface/service/i-data-entity/i-data-entity.d.ts +0 -17
  57. package/out/interface/service/i-data-entity/i-data-entity.d.ts.map +1 -1
  58. package/out/interface/service/service/i-auth.service.d.ts +23 -0
  59. package/out/interface/service/service/i-auth.service.d.ts.map +1 -1
  60. package/out/interface/service/service/index.d.ts +1 -1
  61. package/out/interface/service/service/index.d.ts.map +1 -1
  62. package/out/register/helper/app-menu-item-register.d.ts +25 -0
  63. package/out/register/helper/app-menu-item-register.d.ts.map +1 -0
  64. package/out/register/helper/app-menu-item-register.js +52 -0
  65. package/out/register/helper/index.d.ts +1 -0
  66. package/out/register/helper/index.d.ts.map +1 -1
  67. package/out/register/helper/index.js +1 -0
  68. package/out/service/app-data-entity/app-data-entity.d.ts +0 -9
  69. package/out/service/app-data-entity/app-data-entity.d.ts.map +1 -1
  70. package/out/service/app-data-entity/app-data-entity.js +11 -41
  71. package/out/service/de-service-util.js +1 -1
  72. package/out/service/service/auth/v7-auth.service.d.ts +3 -1
  73. package/out/service/service/auth/v7-auth.service.d.ts.map +1 -1
  74. package/out/service/service/auth/v7-auth.service.js +26 -3
  75. package/out/service/service/entity/method/de-action.d.ts +11 -0
  76. package/out/service/service/entity/method/de-action.d.ts.map +1 -1
  77. package/out/service/service/entity/method/de-action.js +34 -6
  78. package/out/service/utils/de-cache/de-cache.js +3 -3
  79. package/out/utils/open-redirect-view/open-redirect-view.d.ts +17 -4
  80. package/out/utils/open-redirect-view/open-redirect-view.d.ts.map +1 -1
  81. package/out/utils/open-redirect-view/open-redirect-view.js +20 -4
  82. package/package.json +3 -3
  83. package/src/app-hub.ts +6 -0
  84. package/src/controller/control/app-menu/app-menu.controller.ts +64 -6
  85. package/src/controller/control/gantt/gantt.controller.ts +3 -3
  86. package/src/controller/control/grid/grid/entity-schema.ts +105 -0
  87. package/src/controller/control/grid/grid/grid.controller.ts +74 -9
  88. package/src/controller/control/grid/grid/grid.service.ts +1 -1
  89. package/src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts +1 -1
  90. package/src/controller/control/search-bar/entity-schema.ts +178 -0
  91. package/src/controller/control/search-bar/search-bar-filter.controller.ts +32 -9
  92. package/src/controller/control/search-bar/search-bar.controller.ts +69 -9
  93. package/src/controller/control/tree/tree.controller.ts +1 -1
  94. package/src/controller/control/tree-grid/tree-grid.controller.ts +79 -4
  95. package/src/controller/control/tree-grid-ex/tree-grid-ex.controller.ts +2 -2
  96. package/src/controller/utils/index.ts +1 -0
  97. package/src/controller/utils/jsonschema/entity.ts +19 -0
  98. package/src/controller/utils/jsonschema/index.ts +1 -0
  99. package/src/interface/common/i-app-hub-service/i-app-hub-service.ts +7 -0
  100. package/src/interface/controller/controller/control/i-grid.controller.ts +5 -2
  101. package/src/interface/controller/controller/control/i-tree-grid.controller.ts +16 -1
  102. package/src/interface/controller/state/control/i-tree-grid.state.ts +7 -1
  103. package/src/interface/provider/i-app-menu-item.provider.ts +40 -0
  104. package/src/interface/provider/index.ts +1 -0
  105. package/src/interface/service/i-data-entity/i-data-entity.ts +0 -19
  106. package/src/interface/service/service/i-auth.service.ts +26 -0
  107. package/src/interface/service/service/index.ts +1 -1
  108. package/src/register/helper/app-menu-item-register.ts +65 -0
  109. package/src/register/helper/index.ts +1 -0
  110. package/src/service/app-data-entity/app-data-entity.ts +11 -46
  111. package/src/service/de-service-util.ts +1 -1
  112. package/src/service/service/auth/v7-auth.service.ts +31 -2
  113. package/src/service/service/entity/method/de-action.ts +47 -6
  114. package/src/service/utils/de-cache/de-cache.ts +3 -3
  115. package/src/utils/open-redirect-view/open-redirect-view.ts +31 -4
package/dist/index.esm.js CHANGED
@@ -776,8 +776,8 @@ function parseUserParams(userParams) {
776
776
  }
777
777
  return { navigateContexts, navigateParams, other };
778
778
  }
779
- function getPFPlugin(id, appId) {
780
- const app = ibiz.hub.getApp(appId);
779
+ function getPFPlugin(id, appId2) {
780
+ const app = ibiz.hub.getApp(appId2);
781
781
  if (!app) {
782
782
  throw new RuntimeModelError2(app, "\u672A\u627E\u5230\u5E94\u7528");
783
783
  }
@@ -997,8 +997,8 @@ function findFieldById(entity, fieldId) {
997
997
  }
998
998
 
999
999
  // src/model/ui-action/ui-action.ts
1000
- async function getUIActionById(id, appId) {
1001
- const app = ibiz.hub.getApp(appId);
1000
+ async function getUIActionById(id, appId2) {
1001
+ const app = ibiz.hub.getApp(appId2);
1002
1002
  return app.getUIAction(id);
1003
1003
  }
1004
1004
 
@@ -1145,6 +1145,16 @@ async function openRedirectView(appView, context, params = {}, opts = {}) {
1145
1145
  );
1146
1146
  }
1147
1147
  async function toLocalOpenWFRedirectView(context, linkUrl, opts = {}) {
1148
+ const toView = await getLocalOpenWFRedirectView(context, linkUrl, opts);
1149
+ await ibiz.commands.execute(
1150
+ OpenAppViewCommand.TAG,
1151
+ toView.viewId,
1152
+ toView.context,
1153
+ toView.params,
1154
+ toView.opts
1155
+ );
1156
+ }
1157
+ async function getLocalOpenWFRedirectView(context, linkUrl, opts = {}) {
1148
1158
  const i = linkUrl.lastIndexOf("?");
1149
1159
  const queryStr = decodeURIComponent(
1150
1160
  linkUrl.substring(i + 1, linkUrl.length)
@@ -1214,7 +1224,7 @@ async function getDERedirectToView(appView, context, params = {}, opts = {}) {
1214
1224
  return { type: "url", url: linkUrl };
1215
1225
  }
1216
1226
  if (linkUrl.startsWith("appredirectview?")) {
1217
- const toView = await toLocalOpenWFRedirectView(
1227
+ const toView = await getLocalOpenWFRedirectView(
1218
1228
  context,
1219
1229
  linkUrl,
1220
1230
  opts
@@ -3371,9 +3381,9 @@ var PSDEDQCondEngine = _PSDEDQCondEngine;
3371
3381
  import { RuntimeError as RuntimeError6 } from "@ibiz-template/core";
3372
3382
 
3373
3383
  // src/register/helper/common-register.ts
3374
- async function getPluginRegisterKey(pluginId, appId) {
3384
+ async function getPluginRegisterKey(pluginId, appId2) {
3375
3385
  var _a;
3376
- const app = ibiz.hub.getApp(appId);
3386
+ const app = ibiz.hub.getApp(appId2);
3377
3387
  const plugin = (_a = app.model.appPFPluginRefs) == null ? void 0 : _a.find(
3378
3388
  (item) => item.pluginCode.toLowerCase() === pluginId
3379
3389
  );
@@ -3397,9 +3407,9 @@ function getProvider(key) {
3397
3407
  }
3398
3408
  async function getAppCounterProvider(model) {
3399
3409
  let provider;
3400
- const { codeName, counterType, sysPFPluginId, appId } = model;
3410
+ const { codeName, counterType, sysPFPluginId, appId: appId2 } = model;
3401
3411
  if (sysPFPluginId) {
3402
- const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId);
3412
+ const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId2);
3403
3413
  if (pluginKey) {
3404
3414
  provider = getProvider(pluginKey);
3405
3415
  }
@@ -3437,9 +3447,9 @@ function getProvider2(key) {
3437
3447
  }
3438
3448
  async function getControlProvider(model) {
3439
3449
  let provider;
3440
- const { controlType, controlStyle, sysPFPluginId, appId } = model;
3450
+ const { controlType, controlStyle, sysPFPluginId, appId: appId2 } = model;
3441
3451
  if (sysPFPluginId) {
3442
- const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId);
3452
+ const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId2);
3443
3453
  if (pluginKey) {
3444
3454
  provider = getProvider2(pluginKey);
3445
3455
  }
@@ -3486,9 +3496,9 @@ function getProvider3(key) {
3486
3496
  }
3487
3497
  async function getEditorProvider(model) {
3488
3498
  let provider;
3489
- const { editorType, editorStyle, predefinedType, sysPFPluginId, appId } = model;
3499
+ const { editorType, editorStyle, predefinedType, sysPFPluginId, appId: appId2 } = model;
3490
3500
  if (sysPFPluginId) {
3491
- const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId);
3501
+ const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId2);
3492
3502
  if (pluginKey) {
3493
3503
  provider = getProvider3(pluginKey);
3494
3504
  }
@@ -3545,9 +3555,9 @@ function getProvider4(key) {
3545
3555
  }
3546
3556
  async function getFormDetailProvider(model) {
3547
3557
  let provider;
3548
- const { detailType, sysPFPluginId, appId } = model;
3558
+ const { detailType, sysPFPluginId, appId: appId2 } = model;
3549
3559
  if (sysPFPluginId) {
3550
- const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId);
3560
+ const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId2);
3551
3561
  if (pluginKey) {
3552
3562
  provider = getProvider4(pluginKey);
3553
3563
  }
@@ -3577,9 +3587,9 @@ function getProvider5(key) {
3577
3587
  }
3578
3588
  async function getGridColumnProvider(model) {
3579
3589
  let provider;
3580
- const { columnType, enableRowEdit, sysPFPluginId, appId } = model;
3590
+ const { columnType, enableRowEdit, sysPFPluginId, appId: appId2 } = model;
3581
3591
  if (sysPFPluginId) {
3582
- const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId);
3592
+ const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId2);
3583
3593
  if (pluginKey) {
3584
3594
  provider = getProvider5(pluginKey);
3585
3595
  }
@@ -3614,9 +3624,9 @@ function getProvider6(key) {
3614
3624
  async function getPanelItemProvider(model) {
3615
3625
  var _a;
3616
3626
  let provider;
3617
- const { itemType, sysPFPluginId, appId } = model;
3627
+ const { itemType, sysPFPluginId, appId: appId2 } = model;
3618
3628
  if (sysPFPluginId) {
3619
- const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId);
3629
+ const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId2);
3620
3630
  if (pluginKey) {
3621
3631
  provider = getProvider6(pluginKey);
3622
3632
  }
@@ -3680,9 +3690,9 @@ function getProvider7(key) {
3680
3690
  }
3681
3691
  async function getPortletProvider(model) {
3682
3692
  let provider;
3683
- const { portletType, sysPFPluginId, appId } = model;
3693
+ const { portletType, sysPFPluginId, appId: appId2 } = model;
3684
3694
  if (sysPFPluginId) {
3685
- const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId);
3695
+ const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId2);
3686
3696
  if (pluginKey) {
3687
3697
  provider = getProvider7(pluginKey);
3688
3698
  }
@@ -3713,9 +3723,9 @@ function getProvider8(key) {
3713
3723
  }
3714
3724
  async function getUIActionProvider(model) {
3715
3725
  let provider;
3716
- const { uiactionMode, sysPFPluginId, appId, uiactionTag } = model;
3726
+ const { uiactionMode, sysPFPluginId, appId: appId2, uiactionTag } = model;
3717
3727
  if (sysPFPluginId) {
3718
- const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId);
3728
+ const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId2);
3719
3729
  if (pluginKey) {
3720
3730
  provider = getProvider8(pluginKey);
3721
3731
  }
@@ -3745,8 +3755,8 @@ function registerUILogicNodeProvider(key, callback) {
3745
3755
  }
3746
3756
  async function getUILogicNodeProvider(model) {
3747
3757
  let provider;
3748
- const { sysPFPluginId, appId } = model;
3749
- const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId);
3758
+ const { sysPFPluginId, appId: appId2 } = model;
3759
+ const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId2);
3750
3760
  if (pluginKey) {
3751
3761
  provider = ibiz.register.get(
3752
3762
  "".concat(UILOGINNODE_PROVIDER_PREFIX, "_").concat(pluginKey)
@@ -3770,9 +3780,9 @@ function getProvider9(key) {
3770
3780
  }
3771
3781
  async function getViewProvider(model) {
3772
3782
  let provider;
3773
- const { viewType, viewStyle, sysPFPluginId, appId } = model;
3783
+ const { viewType, viewStyle, sysPFPluginId, appId: appId2 } = model;
3774
3784
  if (sysPFPluginId) {
3775
- const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId);
3785
+ const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId2);
3776
3786
  if (pluginKey) {
3777
3787
  provider = getProvider9(pluginKey);
3778
3788
  }
@@ -3932,9 +3942,9 @@ function getProvider12(key) {
3932
3942
  }
3933
3943
  async function getDEMethodProvider(model) {
3934
3944
  let provider;
3935
- const { methodType, sysPFPluginId, appId } = model;
3945
+ const { methodType, sysPFPluginId, appId: appId2 } = model;
3936
3946
  if (sysPFPluginId) {
3937
- const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId);
3947
+ const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId2);
3938
3948
  if (pluginKey) {
3939
3949
  provider = getProvider12(pluginKey);
3940
3950
  }
@@ -3967,9 +3977,9 @@ function getProvider13(key) {
3967
3977
  }
3968
3978
  async function getTreeGridExColumnProvider(model) {
3969
3979
  let provider;
3970
- const { columnType, appId, renderSysPFPluginId } = model;
3980
+ const { columnType, appId: appId2, renderSysPFPluginId } = model;
3971
3981
  if (renderSysPFPluginId) {
3972
- const pluginKey = await getPluginRegisterKey(renderSysPFPluginId, appId);
3982
+ const pluginKey = await getPluginRegisterKey(renderSysPFPluginId, appId2);
3973
3983
  if (pluginKey) {
3974
3984
  provider = getProvider13(pluginKey);
3975
3985
  }
@@ -3987,6 +3997,38 @@ async function getTreeGridExColumnProvider(model) {
3987
3997
  }
3988
3998
  }
3989
3999
 
4000
+ // src/register/helper/app-menu-item-register.ts
4001
+ var APPMENUITEM_PROVIDER_PREFIX = "APPMENUITEM";
4002
+ function registerAppMenuItemProvider(key, callback) {
4003
+ ibiz.register.register("".concat(APPMENUITEM_PROVIDER_PREFIX, "_").concat(key), callback);
4004
+ }
4005
+ function getProvider14(key) {
4006
+ return ibiz.register.get(
4007
+ "".concat(APPMENUITEM_PROVIDER_PREFIX, "_").concat(key)
4008
+ );
4009
+ }
4010
+ async function getAppMenuItemProvider(model) {
4011
+ let provider;
4012
+ const { sysPFPluginId, appId: appId2, itemType } = model;
4013
+ if (sysPFPluginId) {
4014
+ const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId2);
4015
+ if (pluginKey) {
4016
+ provider = getProvider14(pluginKey);
4017
+ }
4018
+ if (!provider) {
4019
+ ibiz.log.error("\u627E\u4E0D\u5230\u5E94\u7528\u83DC\u5355\u9879\u63D2\u4EF6".concat(pluginKey, "\u5BF9\u5E94\u7684\u9002\u914D\u5668"));
4020
+ } else {
4021
+ return provider;
4022
+ }
4023
+ }
4024
+ provider = getProvider14(itemType);
4025
+ if (!provider) {
4026
+ ibiz.log.error("\u627E\u4E0D\u5230\u5E94\u7528\u83DC\u5355\u9879\u7C7B\u578B".concat(itemType, "\u5BF9\u5E94\u7684\u9002\u914D\u5668"));
4027
+ } else {
4028
+ return provider;
4029
+ }
4030
+ }
4031
+
3990
4032
  // src/service/utils/app-counter/app-counter.ts
3991
4033
  import { IBizContext, RuntimeError as RuntimeError12 } from "@ibiz-template/core";
3992
4034
  import { notNilEmpty as notNilEmpty5, QXEvent } from "qx-util";
@@ -4941,9 +4983,6 @@ var DECache = class {
4941
4983
  * @date 2023-12-22 13:12:17
4942
4984
  */
4943
4985
  clear() {
4944
- this.cacheMap.forEach((item) => {
4945
- item.destroy();
4946
- });
4947
4986
  this.cacheMap.clear();
4948
4987
  }
4949
4988
  /**
@@ -5291,11 +5330,11 @@ var ConfigService = class {
5291
5330
  * @param {string} folder 定义文件夹
5292
5331
  * @param {string} tag 存储标识
5293
5332
  */
5294
- constructor(appId, folder, tag) {
5295
- this.appId = appId;
5333
+ constructor(appId2, folder, tag) {
5334
+ this.appId = appId2;
5296
5335
  this.folder = folder;
5297
5336
  this.tag = tag;
5298
- this.app = ibiz.hub.getApp(appId);
5337
+ this.app = ibiz.hub.getApp(appId2);
5299
5338
  }
5300
5339
  /**
5301
5340
  * 保存配置
@@ -5755,7 +5794,7 @@ var FileService = class {
5755
5794
 
5756
5795
  // src/service/app-data-entity/app-data-entity.ts
5757
5796
  import { clone as clone5, isNil as isNil7 } from "ramda";
5758
- import { DataTypes, HistoryList } from "@ibiz-template/core";
5797
+ import { DataTypes } from "@ibiz-template/core";
5759
5798
  import { createUUID as createUUID3 } from "qx-util";
5760
5799
 
5761
5800
  // src/service/constant/srfuf.ts
@@ -5779,9 +5818,6 @@ var AppDataEntity = class _AppDataEntity {
5779
5818
  * @param {(IData | AppDataEntity)} [data={}]
5780
5819
  */
5781
5820
  constructor(entity, data = {}) {
5782
- let history = new HistoryList(
5783
- data instanceof _AppDataEntity ? clone5(data._data) : clone5(data)
5784
- );
5785
5821
  Object.defineProperty(this, "_entity", {
5786
5822
  enumerable: false,
5787
5823
  configurable: true,
@@ -5790,19 +5826,7 @@ var AppDataEntity = class _AppDataEntity {
5790
5826
  Object.defineProperty(this, "_data", {
5791
5827
  enumerable: false,
5792
5828
  configurable: true,
5793
- get() {
5794
- return history.data;
5795
- }
5796
- });
5797
- Object.defineProperty(this, "history", {
5798
- enumerable: false,
5799
- configurable: true,
5800
- set(v) {
5801
- history = v;
5802
- },
5803
- get() {
5804
- return history;
5805
- }
5829
+ value: data instanceof _AppDataEntity ? clone5(data._data) : clone5(data)
5806
5830
  });
5807
5831
  Object.defineProperty(this, "srfdeid", {
5808
5832
  get() {
@@ -5875,18 +5899,17 @@ var AppDataEntity = class _AppDataEntity {
5875
5899
  */
5876
5900
  defineProperties() {
5877
5901
  var _a;
5878
- const self = this;
5879
- const { convertVal } = this;
5902
+ const { _data, convertVal } = this;
5880
5903
  const properties = {};
5881
- const keys = Object.keys(this._data);
5904
+ const keys = Object.keys(_data);
5882
5905
  keys.forEach((key) => {
5883
5906
  properties[key] = {
5884
5907
  enumerable: true,
5885
5908
  set(val) {
5886
- self._data[key] = val;
5909
+ _data[key] = val;
5887
5910
  },
5888
5911
  get() {
5889
- return self._data[key];
5912
+ return _data[key];
5890
5913
  }
5891
5914
  };
5892
5915
  });
@@ -5895,13 +5918,13 @@ var AppDataEntity = class _AppDataEntity {
5895
5918
  properties[key] = {
5896
5919
  enumerable: true,
5897
5920
  set(val) {
5898
- self._data[key] = convertVal(val, field.stdDataType);
5921
+ _data[key] = convertVal(val, field.stdDataType);
5899
5922
  },
5900
5923
  get() {
5901
- return self._data[key];
5924
+ return _data[key];
5902
5925
  }
5903
5926
  };
5904
- self._data[key] = convertVal(self._data[key], field.stdDataType);
5927
+ _data[key] = convertVal(_data[key], field.stdDataType);
5905
5928
  });
5906
5929
  Object.defineProperties(this, properties);
5907
5930
  }
@@ -5913,9 +5936,8 @@ var AppDataEntity = class _AppDataEntity {
5913
5936
  * @return {*} {AppDataEntity}
5914
5937
  */
5915
5938
  clone() {
5916
- const entity = new _AppDataEntity(this._entity);
5939
+ const entity = new _AppDataEntity(this._entity, this._data);
5917
5940
  entity.srfkey = this.srfkey;
5918
- entity.history = clone5(this.history);
5919
5941
  return entity;
5920
5942
  }
5921
5943
  /**
@@ -5938,23 +5960,9 @@ var AppDataEntity = class _AppDataEntity {
5938
5960
  delete _data[key];
5939
5961
  }
5940
5962
  });
5941
- this.history.assign(_data);
5963
+ Object.assign(this._data, _data);
5942
5964
  return this;
5943
5965
  }
5944
- /**
5945
- * 实体对象销毁
5946
- *
5947
- * @author chitanda
5948
- * @date 2023-12-28 21:12:24
5949
- */
5950
- destroy() {
5951
- this.history.destroy();
5952
- Object.defineProperty(this, "_entity", {
5953
- enumerable: false,
5954
- configurable: true,
5955
- value: null
5956
- });
5957
- }
5958
5966
  /**
5959
5967
  * 根据属性的数据类型转换值
5960
5968
  * @author lxm
@@ -6890,8 +6898,8 @@ var AuthorityService = class {
6890
6898
  import { CoreConst } from "@ibiz-template/core";
6891
6899
  import { clearCookie, getCookie, setCookie } from "qx-util";
6892
6900
  var V7AuthService = class {
6893
- constructor() {
6894
- this.isAnonymous = false;
6901
+ get isAnonymous() {
6902
+ return getCookie(CoreConst.IS_ANONYMOUS) === "1";
6895
6903
  }
6896
6904
  async anonymousLogin() {
6897
6905
  const { anonymousUser, anonymousPwd } = ibiz.env;
@@ -6901,7 +6909,13 @@ var V7AuthService = class {
6901
6909
  }
6902
6910
  const result = await this.login(anonymousUser, anonymousPwd);
6903
6911
  if (result) {
6904
- this.isAnonymous = true;
6912
+ setCookie(CoreConst.IS_ANONYMOUS, "1", 0, true);
6913
+ const token = getCookie(CoreConst.TOKEN);
6914
+ const expirein = getCookie(CoreConst.TOKEN_EXPIRES);
6915
+ const remember = getCookie(CoreConst.TOKEN_REMEMBER);
6916
+ setCookie(CoreConst.TOKEN, token, 0, true);
6917
+ setCookie(CoreConst.TOKEN_EXPIRES, expirein, 0, true);
6918
+ setCookie(CoreConst.TOKEN_REMEMBER, remember, 0, true);
6905
6919
  }
6906
6920
  return result;
6907
6921
  }
@@ -6925,6 +6939,7 @@ var V7AuthService = class {
6925
6939
  remember ? 7 : 0,
6926
6940
  true
6927
6941
  );
6942
+ clearCookie(CoreConst.IS_ANONYMOUS);
6928
6943
  }
6929
6944
  return true;
6930
6945
  } catch (err) {
@@ -6941,6 +6956,7 @@ var V7AuthService = class {
6941
6956
  clearCookie(CoreConst.TOKEN);
6942
6957
  clearCookie(CoreConst.TOKEN_EXPIRES);
6943
6958
  clearCookie(CoreConst.TOKEN_REMEMBER);
6959
+ clearCookie(CoreConst.IS_ANONYMOUS);
6944
6960
  return true;
6945
6961
  } catch (err) {
6946
6962
  ibiz.notification.error({
@@ -6951,6 +6967,9 @@ var V7AuthService = class {
6951
6967
  return false;
6952
6968
  }
6953
6969
  async extendLogin() {
6970
+ if (this.isAnonymous) {
6971
+ return;
6972
+ }
6954
6973
  const token = getCookie(CoreConst.TOKEN);
6955
6974
  const expirein = getCookie(CoreConst.TOKEN_EXPIRES);
6956
6975
  const remember = getCookie(CoreConst.TOKEN_REMEMBER);
@@ -6974,6 +6993,14 @@ var V7AuthService = class {
6974
6993
  }, wait);
6975
6994
  }
6976
6995
  }
6996
+ getAuthInfo() {
6997
+ const token = getCookie(CoreConst.TOKEN);
6998
+ const isAnonymous = !!getCookie(CoreConst.IS_ANONYMOUS);
6999
+ return token ? {
7000
+ token,
7001
+ isAnonymous
7002
+ } : void 0;
7003
+ }
6977
7004
  };
6978
7005
 
6979
7006
  // src/service/service/async-action/async-action.service.ts
@@ -8506,8 +8533,8 @@ var DELogic = class {
8506
8533
 
8507
8534
  // src/de-logic/index.ts
8508
8535
  var deLogicMap = /* @__PURE__ */ new Map();
8509
- async function findDeLogic(deDELogicId, dataEntityId, appId) {
8510
- const appDataEntity = await ibiz.hub.getAppDataEntity(dataEntityId, appId);
8536
+ async function findDeLogic(deDELogicId, dataEntityId, appId2) {
8537
+ const appDataEntity = await ibiz.hub.getAppDataEntity(dataEntityId, appId2);
8511
8538
  return findDELogic(deDELogicId, appDataEntity);
8512
8539
  }
8513
8540
  async function execDELogic(deDELogic, context, data = {}, params = {}) {
@@ -8781,10 +8808,15 @@ var DEActionMethod = class extends Method {
8781
8808
  let resultData;
8782
8809
  if (isArray6(addData)) {
8783
8810
  resultData = await Promise.all(
8784
- addData.map((item) => this.service.local.add(context, item))
8811
+ addData.map(
8812
+ (item) => this.service.local.add(context, this.attach(context, item))
8813
+ )
8785
8814
  );
8786
8815
  } else {
8787
- resultData = await this.service.local.add(context, addData);
8816
+ resultData = await this.service.local.add(
8817
+ context,
8818
+ this.attach(context, addData)
8819
+ );
8788
8820
  }
8789
8821
  return new HttpResponse3(resultData);
8790
8822
  } catch (err) {
@@ -8824,6 +8856,7 @@ var DEActionMethod = class extends Method {
8824
8856
  try {
8825
8857
  let key = null;
8826
8858
  if (params) {
8859
+ key = params[this.entity.keyAppDEFieldId.toLowerCase()];
8827
8860
  }
8828
8861
  if (!key && context) {
8829
8862
  key = context[this.entity.codeName.toLowerCase()];
@@ -8852,10 +8885,15 @@ var DEActionMethod = class extends Method {
8852
8885
  let resultData;
8853
8886
  if (isArray6(updateData)) {
8854
8887
  resultData = await Promise.all(
8855
- updateData.map((item) => this.service.local.update(context, item))
8888
+ updateData.map(
8889
+ (item) => this.service.local.update(context, this.attach(context, item))
8890
+ )
8856
8891
  );
8857
8892
  } else {
8858
- resultData = await this.service.local.update(context, updateData);
8893
+ resultData = await this.service.local.update(
8894
+ context,
8895
+ this.attach(context, updateData)
8896
+ );
8859
8897
  }
8860
8898
  if (resultData) {
8861
8899
  return new HttpResponse3(resultData);
@@ -8878,6 +8916,7 @@ var DEActionMethod = class extends Method {
8878
8916
  try {
8879
8917
  let key = null;
8880
8918
  if (params) {
8919
+ key = params[this.entity.keyAppDEFieldId.toLowerCase()];
8881
8920
  }
8882
8921
  if (!key && context) {
8883
8922
  key = context[this.entity.codeName.toLowerCase()];
@@ -8901,6 +8940,33 @@ var DEActionMethod = class extends Method {
8901
8940
  async removeBatchTemp(_context, _params) {
8902
8941
  return new HttpResponse3(true);
8903
8942
  }
8943
+ /**
8944
+ * 在新建、更新时,根据界面域下的关系,自动填充相关父属性
8945
+ *
8946
+ * @author chitanda
8947
+ * @date 2024-01-02 15:01:30
8948
+ * @protected
8949
+ * @param {IContext} context
8950
+ * @param {IDataEntity} data
8951
+ * @return {*} {IDataEntity}
8952
+ */
8953
+ attach(context, data) {
8954
+ const sandboxId = context.srfsessionid;
8955
+ const uiDomain = ibiz.uiDomainManager.get(sandboxId);
8956
+ const configs = uiDomain.getDERConfig(this.entity.id);
8957
+ if (configs.length > 0) {
8958
+ configs.forEach((config) => {
8959
+ const { majorDECodeName, pickupDEFName } = config;
8960
+ const majorLowerCodeName = majorDECodeName.toLowerCase();
8961
+ const pickupLowerDEFName = pickupDEFName.toLowerCase();
8962
+ const majorkey = context[majorLowerCodeName];
8963
+ if (majorkey && majorkey !== data.srfkey) {
8964
+ data[pickupLowerDEFName] = majorkey;
8965
+ }
8966
+ });
8967
+ }
8968
+ return data;
8969
+ }
8904
8970
  };
8905
8971
 
8906
8972
  // src/service/service/entity/method/provider/de-action-de-method.provider.ts
@@ -9752,10 +9818,10 @@ var MqttService = class {
9752
9818
  * @param {string} token
9753
9819
  * @param {string} appId
9754
9820
  */
9755
- constructor(mqttTopic, token, appId) {
9821
+ constructor(mqttTopic, token, appId2) {
9756
9822
  this.mqttTopic = mqttTopic;
9757
9823
  this.token = token;
9758
- this.appId = appId;
9824
+ this.appId = appId2;
9759
9825
  /**
9760
9826
  * 接受消息通知
9761
9827
  *
@@ -9876,7 +9942,7 @@ var _DEServiceUtil = class _DEServiceUtil {
9876
9942
  * @return {*} {Promise<IAppDEService>}
9877
9943
  */
9878
9944
  async getService(context, id) {
9879
- const sandboxId = context.srfsessionid;
9945
+ const sandboxId = context.srfsessionid || "applocation";
9880
9946
  if (!this.cache.has(sandboxId)) {
9881
9947
  this.cache.set(sandboxId, /* @__PURE__ */ new Map());
9882
9948
  }
@@ -10859,7 +10925,7 @@ var ActivityCounter = class extends Counter {
10859
10925
 
10860
10926
  // src/controller/utils/button-state/ui-action-button.state.ts
10861
10927
  var UIActionButtonState = class {
10862
- constructor(name, appId, uiActionId) {
10928
+ constructor(name, appId2, uiActionId) {
10863
10929
  this.disabled = false;
10864
10930
  this.visible = true;
10865
10931
  this.loading = false;
@@ -10895,7 +10961,7 @@ var UIActionButtonState = class {
10895
10961
  this.isInit = false;
10896
10962
  this.name = name;
10897
10963
  this.uiActionId = uiActionId;
10898
- this.appId = appId;
10964
+ this.appId = appId2;
10899
10965
  }
10900
10966
  /**
10901
10967
  * 初始化,没有界面行为id就是普通的buttonState
@@ -11485,6 +11551,15 @@ async function exportData(header, data, fileName) {
11485
11551
  }
11486
11552
  }
11487
11553
 
11554
+ // src/controller/utils/jsonschema/entity.ts
11555
+ async function getEntitySchema(entityId, context) {
11556
+ const app = ibiz.hub.getApp(context.srfappid);
11557
+ const entity = await ibiz.hub.getAppDataEntity(entityId, context.srfappid);
11558
+ const url = "/jsonschema/".concat(entity.name);
11559
+ const res = await app.net.get(url);
11560
+ return res.data;
11561
+ }
11562
+
11488
11563
  // src/controller/common/base.controller.ts
11489
11564
  var SELF_KEY = "__self";
11490
11565
  var BaseController = class {
@@ -13271,6 +13346,17 @@ import {
13271
13346
  RuntimeModelError as RuntimeModelError24
13272
13347
  } from "@ibiz-template/core";
13273
13348
  var AppMenuController = class extends ControlController {
13349
+ constructor(model, context, params, ctx) {
13350
+ super(model, context, params, ctx);
13351
+ /**
13352
+ * 菜单项适配器集合
13353
+ * @author lxm
13354
+ * @date 2023-07-19 04:14:50
13355
+ * @type {{ [key: string]: IProvider }}
13356
+ */
13357
+ this.itemProviders = {};
13358
+ this.flattenAllItems();
13359
+ }
13274
13360
  initState() {
13275
13361
  super.initState();
13276
13362
  this.state.menuItemsState = {};
@@ -13289,10 +13375,28 @@ var AppMenuController = class extends ControlController {
13289
13375
  var _a;
13290
13376
  await super.onCreated();
13291
13377
  this.app = await ibiz.hub.getApp(this.context.srfappid);
13378
+ await this.initAppMenuItemProviders();
13292
13379
  (_a = this.model.appMenuItems) == null ? void 0 : _a.forEach((item) => {
13293
13380
  this.initMenuItemState(item);
13294
13381
  });
13295
13382
  }
13383
+ /**
13384
+ * 初始化菜单项的适配器
13385
+ * @author lxm
13386
+ * @date 2023-12-29 02:50:20
13387
+ * @protected
13388
+ * @return {*} {Promise<void>}
13389
+ */
13390
+ async initAppMenuItemProviders() {
13391
+ await Promise.all(
13392
+ this.allAppMenuItems.map(async (item) => {
13393
+ const provider = await getAppMenuItemProvider(item);
13394
+ if (provider) {
13395
+ this.itemProviders[item.id] = provider;
13396
+ }
13397
+ })
13398
+ );
13399
+ }
13296
13400
  /**
13297
13401
  * 菜单项点击回调,触发对应的应用功能
13298
13402
  *
@@ -13313,6 +13417,10 @@ var AppMenuController = class extends ControlController {
13313
13417
  eventArg: id,
13314
13418
  event
13315
13419
  });
13420
+ const provider = this.itemProviders[id];
13421
+ if (provider && provider.onClick) {
13422
+ return provider.onClick(menuItem, event, this);
13423
+ }
13316
13424
  if (!menuItem.appFuncId) {
13317
13425
  throw new RuntimeModelError24(menuItem, "\u6CA1\u6709\u914D\u7F6E\u5E94\u7528\u529F\u80FD");
13318
13426
  }
@@ -13363,11 +13471,11 @@ var AppMenuController = class extends ControlController {
13363
13471
  }
13364
13472
  /**
13365
13473
  * 所有项平铺
13366
- * @return {*}
13367
- * @author: zhujiamin
13368
- * @Date: 2022-09-09 16:48:21
13474
+ * @author lxm
13475
+ * @date 2023-12-29 02:42:39
13476
+ * @protected
13369
13477
  */
13370
- getAllItems() {
13478
+ flattenAllItems() {
13371
13479
  const result = [];
13372
13480
  const flattenMenus = (menuItems) => {
13373
13481
  menuItems.forEach((item) => {
@@ -13378,7 +13486,16 @@ var AppMenuController = class extends ControlController {
13378
13486
  });
13379
13487
  };
13380
13488
  flattenMenus(this.model.appMenuItems);
13381
- return result;
13489
+ this.allAppMenuItems = result;
13490
+ }
13491
+ /**
13492
+ * 所有项平铺
13493
+ * @return {*}
13494
+ * @author: zhujiamin
13495
+ * @Date: 2022-09-09 16:48:21
13496
+ */
13497
+ getAllItems() {
13498
+ return this.allAppMenuItems;
13382
13499
  }
13383
13500
  /**
13384
13501
  * 根据id去视图控制器里取得计数器对象
@@ -16279,8 +16396,8 @@ var UIActionUtil = class {
16279
16396
  * @param {IUILogicParams} params 界面行为参数
16280
16397
  * @return {*} {Promise<IUIActionResult>}
16281
16398
  */
16282
- static async exec(actionId, params, appId) {
16283
- const action = await getUIActionById(actionId, appId);
16399
+ static async exec(actionId, params, appId2) {
16400
+ const action = await getUIActionById(actionId, appId2);
16284
16401
  if (!action) {
16285
16402
  throw new RuntimeError45("\u6CA1\u627E\u5230".concat(actionId, "\u7684\u754C\u9762\u884C\u4E3A\u6A21\u578B"));
16286
16403
  }
@@ -16301,9 +16418,9 @@ var UIActionUtil = class {
16301
16418
  * @param {string} actionId 界面行为id
16302
16419
  * @param {IUILogicParams} params 界面行为参数
16303
16420
  */
16304
- static async execAndResolved(actionId, params, appId) {
16421
+ static async execAndResolved(actionId, params, appId2) {
16305
16422
  var _a, _b;
16306
- const result = await this.exec(actionId, params, appId);
16423
+ const result = await this.exec(actionId, params, appId2);
16307
16424
  if (result.closeView) {
16308
16425
  params.view.modal.ignoreDismissCheck = true;
16309
16426
  params.view.closeView({ ok: true });
@@ -16443,10 +16560,10 @@ var UIActionProviderBase = class {
16443
16560
  * @param {(IData | undefined)} [opts]
16444
16561
  * @returns {*} {Promise<void>}
16445
16562
  */
16446
- async doNextAction(action, params, appId) {
16563
+ async doNextAction(action, params, appId2) {
16447
16564
  const nextActionId = action.nextId;
16448
16565
  if (nextActionId) {
16449
- return UIActionUtil.exec(nextActionId, params, appId);
16566
+ return UIActionUtil.exec(nextActionId, params, appId2);
16450
16567
  }
16451
16568
  }
16452
16569
  /**
@@ -22120,7 +22237,7 @@ var GridService = class extends MDControlService {
22120
22237
  if (deField) {
22121
22238
  const deFieldKey = deField.toLowerCase();
22122
22239
  const dataItem = dataItems.find(
22123
- (item) => item.appDEFieldId === deField
22240
+ (item) => item.id === column.dataItemName
22124
22241
  );
22125
22242
  if (dataItem) {
22126
22243
  mapField = new UIMapField(uiKey, deFieldKey, {
@@ -22161,6 +22278,82 @@ var GridService = class extends MDControlService {
22161
22278
  }
22162
22279
  };
22163
22280
 
22281
+ // src/controller/control/grid/grid/entity-schema.ts
22282
+ var TypeToDataType = {
22283
+ string: 25,
22284
+ number: 6,
22285
+ integer: 9,
22286
+ date: 5
22287
+ };
22288
+ async function calcColumnModelBySchema(json, c) {
22289
+ var _a;
22290
+ if (!json.properties) {
22291
+ return;
22292
+ }
22293
+ const { properties } = json;
22294
+ if (!(Object.keys(properties).length > 0)) {
22295
+ return;
22296
+ }
22297
+ const addFields = [];
22298
+ Object.keys(properties).forEach((key) => {
22299
+ let type;
22300
+ switch (properties[key].type) {
22301
+ case "string":
22302
+ type = "string";
22303
+ if (properties[key].format === "date-time") {
22304
+ type = "date";
22305
+ }
22306
+ break;
22307
+ case "integer":
22308
+ type = "integer";
22309
+ break;
22310
+ case "number":
22311
+ type = "number";
22312
+ break;
22313
+ default:
22314
+ ibiz.log.error("\u672A\u652F\u6301\u7684\u7C7B\u578B".concat(properties[key].type));
22315
+ return;
22316
+ }
22317
+ addFields.push({
22318
+ key,
22319
+ description: properties[key].description,
22320
+ type
22321
+ });
22322
+ });
22323
+ const codeNameToId = {};
22324
+ const dataEntity = await ibiz.hub.getAppDataEntity(
22325
+ c.model.appDataEntityId,
22326
+ c.model.appId
22327
+ );
22328
+ (_a = dataEntity.appDEFields) == null ? void 0 : _a.forEach((field) => {
22329
+ codeNameToId[field.codeName.toLowerCase()] = field.id;
22330
+ });
22331
+ const addColumns = [];
22332
+ const addDataItems = [];
22333
+ addFields.forEach((item) => {
22334
+ addColumns.push({
22335
+ appId: c.model.appId,
22336
+ appDEFieldId: codeNameToId[item.key],
22337
+ id: item.key,
22338
+ codeName: item.key,
22339
+ columnType: "DEFGRIDCOLUMN",
22340
+ width: 150,
22341
+ widthUnit: "PX",
22342
+ valueType: "SIMPLE",
22343
+ caption: item.description,
22344
+ dataItemName: item.key
22345
+ });
22346
+ addDataItems.push({
22347
+ appId: c.model.appId,
22348
+ appDEFieldId: codeNameToId[item.key],
22349
+ id: item.key,
22350
+ valueType: "SIMPLE",
22351
+ dataType: TypeToDataType[item.type]
22352
+ });
22353
+ });
22354
+ return { degridColumns: addColumns, degridDataItems: addDataItems };
22355
+ }
22356
+
22164
22357
  // src/controller/control/grid/grid/grid.controller.ts
22165
22358
  var GridController = class extends MDControlController {
22166
22359
  constructor() {
@@ -22179,6 +22372,13 @@ var GridController = class extends MDControlController {
22179
22372
  * @type {boolean}
22180
22373
  */
22181
22374
  this.isMultistageHeader = false;
22375
+ /**
22376
+ * 是否添加jsonschema里定义的表格列
22377
+ * @author lxm
22378
+ * @date 2024-01-02 05:27:16
22379
+ * @type {boolean}
22380
+ */
22381
+ this.addSchemaColumn = false;
22182
22382
  /**
22183
22383
  * 所有表格列控制器集合
22184
22384
  *
@@ -22227,6 +22427,9 @@ var GridController = class extends MDControlController {
22227
22427
  */
22228
22428
  this.aggTitle = "\u5408\u8BA1";
22229
22429
  }
22430
+ get _evt() {
22431
+ return this.evt;
22432
+ }
22230
22433
  /**
22231
22434
  * 分组代码表项集合
22232
22435
  * @author lxm
@@ -22286,6 +22489,7 @@ var GridController = class extends MDControlController {
22286
22489
  * @returns {*} {Promise<void>}
22287
22490
  */
22288
22491
  async onCreated() {
22492
+ await this.initByEntitySchema();
22289
22493
  await super.onCreated();
22290
22494
  this.service = new GridService(this.model);
22291
22495
  await this.service.init(this.context);
@@ -22300,6 +22504,41 @@ var GridController = class extends MDControlController {
22300
22504
  );
22301
22505
  await this.initGroup();
22302
22506
  }
22507
+ /**
22508
+ * 根据jsonschema初始化自定义表格列
22509
+ * @author lxm
22510
+ * @date 2024-01-02 04:41:23
22511
+ * @return {*} {Promise<void>}
22512
+ */
22513
+ async initByEntitySchema() {
22514
+ if (!this.addSchemaColumn) {
22515
+ return;
22516
+ }
22517
+ const json = await getEntitySchema(
22518
+ this.model.appDataEntityId,
22519
+ this.context
22520
+ );
22521
+ if (!json) {
22522
+ return;
22523
+ }
22524
+ const result = await calcColumnModelBySchema(json, this);
22525
+ if (result && result.degridColumns.length > 0) {
22526
+ const { degridColumns, degridDataItems } = result;
22527
+ this.model = clone22(this.model);
22528
+ this.model.degridColumns = [
22529
+ ...(this.model.degridColumns || []).filter((item) => {
22530
+ return degridColumns.findIndex((x) => x.id === item.id) === -1;
22531
+ }),
22532
+ ...degridColumns
22533
+ ];
22534
+ this.model.degridDataItems = [
22535
+ ...(this.model.degridDataItems || []).filter((item) => {
22536
+ return degridDataItems.findIndex((x) => x.id === item.id) === -1;
22537
+ }),
22538
+ ...degridDataItems
22539
+ ];
22540
+ }
22541
+ }
22303
22542
  /**
22304
22543
  * 初始化表格分组
22305
22544
  * @author lxm
@@ -22560,7 +22799,7 @@ var GridController = class extends MDControlController {
22560
22799
  try {
22561
22800
  res = isCreate ? await this.service.create(tempContext, data) : await this.service.update(tempContext, data);
22562
22801
  } catch (error) {
22563
- await this.evt.emit("onSaveError", void 0);
22802
+ await this._evt.emit("onSaveError", void 0);
22564
22803
  this.actionNotification("".concat(isCreate ? "CREATE" : "UPDATE", "ERROR"), {
22565
22804
  error,
22566
22805
  data: rowState.data
@@ -22572,7 +22811,7 @@ var GridController = class extends MDControlController {
22572
22811
  rowState.data = res.data;
22573
22812
  rowState.modified = false;
22574
22813
  this.gridStateNotify(rowState, "SAVE" /* SAVE */);
22575
- await this.evt.emit("onSaveSuccess", void 0);
22814
+ await this._evt.emit("onSaveSuccess", void 0);
22576
22815
  }
22577
22816
  async saveAll() {
22578
22817
  const needSaveData = this.state.rows.filter((row) => row.modified).map((row) => row.data);
@@ -22697,7 +22936,7 @@ var GridController = class extends MDControlController {
22697
22936
  row.processing = true;
22698
22937
  try {
22699
22938
  await this.dataChangeNotify(row, [name]);
22700
- await this.evt.emit("onGridDataChange", {
22939
+ await this._evt.emit("onGridDataChange", {
22701
22940
  data: this.state.rows.map((_row) => {
22702
22941
  return _row.data;
22703
22942
  })
@@ -22772,7 +23011,7 @@ var GridController = class extends MDControlController {
22772
23011
  await this.save(row.data);
22773
23012
  } else if (row.data.srfuf === 0 /* CREATE */) {
22774
23013
  row.showRowEdit = false;
22775
- this.evt.emit("onRowEditChange", { row });
23014
+ this._evt.emit("onRowEditChange", { row });
22776
23015
  return this.remove({ data: [row.data], silent: true });
22777
23016
  } else if (row.cacheData) {
22778
23017
  row.data = row.cacheData;
@@ -22793,7 +23032,7 @@ var GridController = class extends MDControlController {
22793
23032
  Object.values(this.editColumns).forEach((column) => {
22794
23033
  row.editColStates[column.fieldName].editable = toState;
22795
23034
  });
22796
- this.evt.emit("onRowEditChange", { row });
23035
+ this._evt.emit("onRowEditChange", { row });
22797
23036
  }
22798
23037
  /**
22799
23038
  * 获取部件默认排序模型
@@ -23354,7 +23593,7 @@ var GridFieldColumnController = class extends GridColumnController {
23354
23593
  */
23355
23594
  calcFieldAgg(items) {
23356
23595
  const { aggField, aggMode, aggValueFormat, unitName } = this.model;
23357
- if (aggMode === "NONE") {
23596
+ if (isNil22(aggMode) || aggMode === "NONE") {
23358
23597
  return;
23359
23598
  }
23360
23599
  const fieldName = aggField || this.model.id;
@@ -24684,10 +24923,21 @@ import { isNil as isNil23 } from "ramda";
24684
24923
 
24685
24924
  // src/controller/control/search-bar/search-bar-filter.controller.ts
24686
24925
  import { RuntimeModelError as RuntimeModelError60 } from "@ibiz-template/core";
24926
+ var ExcludeOPs = [
24927
+ "ISNULL" /* IS_NULL */,
24928
+ "ISNOTNULL" /* IS_NOT_NULL */
24929
+ ];
24687
24930
  var SearchBarFilterController = class {
24688
24931
  constructor(model, searchBar) {
24689
24932
  this.model = model;
24690
24933
  this.searchBar = searchBar;
24934
+ /**
24935
+ * 不需要编辑器
24936
+ * @author lxm
24937
+ * @date 2024-01-02 11:08:45
24938
+ * @type {boolean}
24939
+ */
24940
+ this.noEditor = false;
24691
24941
  var _a;
24692
24942
  let field;
24693
24943
  if (model.appDEFieldId) {
@@ -24696,6 +24946,7 @@ var SearchBarFilterController = class {
24696
24946
  this.fieldName = field ? field.codeName.toLowerCase() : model.id;
24697
24947
  this.label = model.caption || (field == null ? void 0 : field.logicName) || model.id;
24698
24948
  this.valueOP = (_a = model.defsearchMode) == null ? void 0 : _a.valueOP;
24949
+ this.noEditor = this.valueOP ? ExcludeOPs.includes(this.valueOP) : !this.model.editor;
24699
24950
  }
24700
24951
  get context() {
24701
24952
  return this.searchBar.context;
@@ -24710,15 +24961,17 @@ var SearchBarFilterController = class {
24710
24961
  * @return {*} {Promise<void>}
24711
24962
  */
24712
24963
  async init() {
24713
- if (!this.model.editor) {
24714
- throw new RuntimeModelError60(this.model, "\u7F3A\u5C11\u7F16\u8F91\u5668\u6A21\u578B");
24715
- }
24716
- this.editorProvider = await getEditorProvider(this.model.editor);
24717
- if (this.editorProvider) {
24718
- this.editor = await this.editorProvider.createController(
24719
- this.model.editor,
24720
- this
24721
- );
24964
+ if (!this.noEditor) {
24965
+ if (!this.model.editor) {
24966
+ throw new RuntimeModelError60(this.model, "\u7F3A\u5C11\u7F16\u8F91\u5668\u6A21\u578B");
24967
+ }
24968
+ this.editorProvider = await getEditorProvider(this.model.editor);
24969
+ if (this.editorProvider) {
24970
+ this.editor = await this.editorProvider.createController(
24971
+ this.model.editor,
24972
+ this
24973
+ );
24974
+ }
24722
24975
  }
24723
24976
  }
24724
24977
  };
@@ -24897,6 +25150,135 @@ var SearchBarService = class {
24897
25150
  }
24898
25151
  };
24899
25152
 
25153
+ // src/controller/control/search-bar/entity-schema.ts
25154
+ var appId = "";
25155
+ var typeToOPs = {
25156
+ string: [
25157
+ "EQ" /* EQ */,
25158
+ "NOTEQ" /* NOT_EQ */,
25159
+ "ISNULL" /* IS_NULL */,
25160
+ "ISNOTNULL" /* IS_NOT_NULL */,
25161
+ "USERLIKE" /* USER_LIKE */,
25162
+ "LIKE" /* LIKE */,
25163
+ "LIFTLIKE" /* LIFT_LIKE */,
25164
+ "RIGHT_LIKE" /* RIGHT_LIKE */
25165
+ ],
25166
+ number: [
25167
+ "EQ" /* EQ */,
25168
+ "GT" /* GT */,
25169
+ "GTANDEQ" /* GT_AND_EQ */,
25170
+ "LT" /* LT */,
25171
+ "LTANDEQ" /* LT_AND_EQ */,
25172
+ "NOTEQ" /* NOT_EQ */,
25173
+ "ISNULL" /* IS_NULL */,
25174
+ "ISNOTNULL" /* IS_NOT_NULL */,
25175
+ "IN" /* IN */,
25176
+ "NOTIN" /* NOT_IN */
25177
+ ],
25178
+ date: [
25179
+ "EQ" /* EQ */,
25180
+ "GT" /* GT */,
25181
+ "GTANDEQ" /* GT_AND_EQ */,
25182
+ "LT" /* LT */,
25183
+ "LTANDEQ" /* LT_AND_EQ */,
25184
+ "NOTEQ" /* NOT_EQ */,
25185
+ "ISNULL" /* IS_NULL */,
25186
+ "ISNOTNULL" /* IS_NOT_NULL */,
25187
+ "IN" /* IN */,
25188
+ "NOTIN" /* NOT_IN */
25189
+ ]
25190
+ };
25191
+ var EditorsMap = {};
25192
+ function initDefaultEditor() {
25193
+ Object.keys(typeToOPs).forEach((type) => {
25194
+ const allowOPs = typeToOPs[type];
25195
+ allowOPs.forEach((op) => {
25196
+ if (ExcludeOPs.includes(op)) {
25197
+ return;
25198
+ }
25199
+ const key = "".concat(type, "_").concat(op);
25200
+ if (EditorsMap[key]) {
25201
+ return;
25202
+ }
25203
+ if (type === "date" && !["IN" /* IN */, "NOTIN" /* NOT_IN */].includes(op)) {
25204
+ EditorsMap[key] = {
25205
+ appId,
25206
+ editorType: "DATEPICKER",
25207
+ id: key
25208
+ };
25209
+ } else {
25210
+ EditorsMap[key] = {
25211
+ appId,
25212
+ editorType: "TEXTBOX",
25213
+ id: key
25214
+ };
25215
+ }
25216
+ });
25217
+ });
25218
+ }
25219
+ initDefaultEditor();
25220
+ function calcFilterModelBySchema(json, c) {
25221
+ var _a;
25222
+ if (!json.properties) {
25223
+ return [];
25224
+ }
25225
+ const { properties } = json;
25226
+ if (!(Object.keys(properties).length > 0)) {
25227
+ return [];
25228
+ }
25229
+ const addFields = [];
25230
+ Object.keys(properties).forEach((key) => {
25231
+ let type;
25232
+ switch (properties[key].type) {
25233
+ case "string":
25234
+ type = "string";
25235
+ if (properties[key].format === "date-time") {
25236
+ type = "date";
25237
+ }
25238
+ break;
25239
+ case "integer":
25240
+ case "number":
25241
+ type = "number";
25242
+ break;
25243
+ default:
25244
+ ibiz.log.error("\u672A\u652F\u6301\u7684\u7C7B\u578B".concat(properties[key].type));
25245
+ return;
25246
+ }
25247
+ addFields.push({
25248
+ key,
25249
+ description: properties[key].description,
25250
+ type
25251
+ });
25252
+ });
25253
+ const codeNameToId = {};
25254
+ (_a = c.appDataEntity.appDEFields) == null ? void 0 : _a.forEach((field) => {
25255
+ codeNameToId[field.codeName.toLowerCase()] = field.id;
25256
+ });
25257
+ const addSearchBarFilters = [];
25258
+ addFields.forEach((item) => {
25259
+ const ops = typeToOPs[item.type];
25260
+ if (!ops) {
25261
+ ibiz.log.error("\u672A\u652F\u6301\u7684\u7C7B\u578B", item.type);
25262
+ return;
25263
+ }
25264
+ ops.forEach((op) => {
25265
+ const editorModel = EditorsMap["".concat(item.type, "_").concat(op)];
25266
+ addSearchBarFilters.push({
25267
+ appId,
25268
+ appDEFieldId: codeNameToId[item.key],
25269
+ id: item.key,
25270
+ caption: item.description,
25271
+ defsearchMode: {
25272
+ appId,
25273
+ valueOP: op
25274
+ },
25275
+ editor: editorModel
25276
+ });
25277
+ });
25278
+ });
25279
+ return addSearchBarFilters;
25280
+ }
25281
+
24900
25282
  // src/controller/control/search-bar/search-bar.controller.ts
24901
25283
  var SearchBarController = class extends ControlController {
24902
25284
  constructor() {
@@ -24929,6 +25311,13 @@ var SearchBarController = class extends ControlController {
24929
25311
  * @Date: 2023-12-21 10:17:43
24930
25312
  */
24931
25313
  this.isBackendSearchGroup = this.model.searchBarStyle === "SEARCHBAR2";
25314
+ /**
25315
+ * 启用自定义过滤项
25316
+ * @author lxm
25317
+ * @date 2023-12-29 04:15:34
25318
+ * @type {boolean}
25319
+ */
25320
+ this.enableFilter = this.model.enableFilter === true;
24932
25321
  }
24933
25322
  /**
24934
25323
  * 表格控制器
@@ -24943,12 +25332,19 @@ var SearchBarController = class extends ControlController {
24943
25332
  super.initState();
24944
25333
  this.state.query = "";
24945
25334
  this.state.selectedGroupItem = null;
24946
- this.state.visible = !!(this.model.enableQuickSearch || this.model.enableGroup || this.model.enableFilter);
24947
- if (this.model.enableFilter) {
24948
- this.resetFilter();
24949
- }
24950
25335
  this.state.searchBarGroups = [];
24951
25336
  this.state.selectedSearchGroupItem = null;
25337
+ this.initFilterState();
25338
+ }
25339
+ /**
25340
+ * 初始化Filter相关的属性
25341
+ * @author lxm
25342
+ * @date 2023-12-29 04:18:02
25343
+ * @protected
25344
+ */
25345
+ initFilterState() {
25346
+ this.resetFilter();
25347
+ this.state.visible = !!(this.model.enableQuickSearch || this.model.enableGroup || this.enableFilter);
24952
25348
  }
24953
25349
  async onCreated() {
24954
25350
  await super.onCreated();
@@ -24964,9 +25360,39 @@ var SearchBarController = class extends ControlController {
24964
25360
  this.service = new SearchBarService(this.model, this.view.model.codeName);
24965
25361
  await this.service.init(this.context);
24966
25362
  }
25363
+ await this.initByEntitySchema();
24967
25364
  await this.initSearchBarFilters();
24968
25365
  await this.initSearBarGroups();
24969
25366
  }
25367
+ /**
25368
+ * 根据实体jsonschema初始化
25369
+ * @author lxm
25370
+ * @date 2023-12-29 04:21:31
25371
+ * @return {*} {Promise<void>}
25372
+ */
25373
+ async initByEntitySchema() {
25374
+ var _a;
25375
+ this.enableFilter = true;
25376
+ const json = await getEntitySchema(this.appDataEntity.id, this.context);
25377
+ if (!json) {
25378
+ return;
25379
+ }
25380
+ const addSearchBarFilters = calcFilterModelBySchema(json, this);
25381
+ const mergeFilters = [];
25382
+ (_a = this.model.searchBarFilters) == null ? void 0 : _a.forEach((filter) => {
25383
+ const findindex = addSearchBarFilters.findIndex(
25384
+ (item) => {
25385
+ var _a2;
25386
+ return item.appDEFieldId === filter.appDEFieldId && (((_a2 = filter.defsearchMode) == null ? void 0 : _a2.valueOP) ? item.defsearchMode.valueOP === filter.defsearchMode.valueOP : true);
25387
+ }
25388
+ );
25389
+ if (findindex === -1) {
25390
+ mergeFilters.push(filter);
25391
+ }
25392
+ });
25393
+ addSearchBarFilters.push(...mergeFilters);
25394
+ this.searchBarFilters = addSearchBarFilters;
25395
+ }
24970
25396
  /**
24971
25397
  * 计算快速搜索的占位
24972
25398
  * @author lxm
@@ -25062,8 +25488,8 @@ var SearchBarController = class extends ControlController {
25062
25488
  */
25063
25489
  async initSearchBarFilters() {
25064
25490
  var _a;
25065
- if ((_a = this.model.searchBarFilters) == null ? void 0 : _a.length) {
25066
- this.model.searchBarFilters.forEach((item) => {
25491
+ if ((_a = this.searchBarFilters) == null ? void 0 : _a.length) {
25492
+ this.searchBarFilters.forEach((item) => {
25067
25493
  const filterController = new SearchBarFilterController(item, this);
25068
25494
  this.filterControllers.push(filterController);
25069
25495
  });
@@ -26190,7 +26616,7 @@ var TreeController = class extends MDControlController {
26190
26616
  * @param {string} appId
26191
26617
  * @return {*} {Promise<void>}
26192
26618
  */
26193
- async doUIAction(uiActionId, nodeData, event, appId) {
26619
+ async doUIAction(uiActionId, nodeData, event, appId2) {
26194
26620
  const eventArgs = this.getEventArgs();
26195
26621
  const nodeParams = this.parseTreeNodeData(nodeData);
26196
26622
  const result = await UIActionUtil.exec(
@@ -26200,7 +26626,7 @@ var TreeController = class extends MDControlController {
26200
26626
  ...nodeParams,
26201
26627
  event
26202
26628
  },
26203
- appId
26629
+ appId2
26204
26630
  );
26205
26631
  if (result.closeView) {
26206
26632
  this.view.closeView();
@@ -26272,7 +26698,7 @@ var TreeController = class extends MDControlController {
26272
26698
  if (refreshParent) {
26273
26699
  const { parent } = currentNode;
26274
26700
  if (!parent || !this.model.rootVisible && this.state.rootNodes.includes(parent)) {
26275
- this.refresh();
26701
+ await this.refresh();
26276
26702
  return;
26277
26703
  }
26278
26704
  }
@@ -27767,12 +28193,13 @@ var TreeGridExController = class extends TreeController {
27767
28193
  initState() {
27768
28194
  super.initState();
27769
28195
  this.state.columnStates = [];
28196
+ this.state.rootNodes = [];
27770
28197
  this.state.rows = {};
27771
28198
  }
27772
28199
  async onCreated() {
27773
28200
  await super.onCreated();
27774
- this.initColumnStates();
27775
28201
  await this.initGridColumns();
28202
+ this.initColumnStates();
27776
28203
  }
27777
28204
  async initService() {
27778
28205
  this.service = new TreeGridExService(this.model);
@@ -28048,7 +28475,67 @@ var TreeGridExUAColumnController = class extends TreeGridExColumnController {
28048
28475
  };
28049
28476
 
28050
28477
  // src/controller/control/tree-grid/tree-grid.controller.ts
28478
+ import { RuntimeModelError as RuntimeModelError65 } from "@ibiz-template/core";
28051
28479
  var TreeGridController = class extends GridController {
28480
+ constructor() {
28481
+ super(...arguments);
28482
+ /**
28483
+ * 树表格值属性名称
28484
+ *
28485
+ */
28486
+ this.treeGridValueField = "";
28487
+ /**
28488
+ * 树表格父属性名称
28489
+ *
28490
+ */
28491
+ this.treeGridParentField = "";
28492
+ }
28493
+ initState() {
28494
+ super.initState();
28495
+ this.state.showTreeGrid = true;
28496
+ }
28497
+ /**
28498
+ * 初始化方法
28499
+ *
28500
+ * @author lxm
28501
+ * @date 2022-08-18 22:08:17
28502
+ * @protected
28503
+ * @returns {*} {Promise<void>}
28504
+ */
28505
+ async onCreated() {
28506
+ await super.onCreated();
28507
+ this.initTreeGridField();
28508
+ }
28509
+ /**
28510
+ * 初始化树表格字段
28511
+ * @return {*}
28512
+ * @author: zhujiamin
28513
+ */
28514
+ initTreeGridField() {
28515
+ var _a, _b;
28516
+ const treeGridParent = (_a = this.model.degridColumns) == null ? void 0 : _a.find((item) => {
28517
+ return item.treeColumnMode === 4 || item.treeColumnMode === 12;
28518
+ });
28519
+ const treeGridValue = (_b = this.model.degridColumns) == null ? void 0 : _b.find((item) => {
28520
+ return item.treeColumnMode === 2 || item.treeColumnMode === 3;
28521
+ });
28522
+ if (!treeGridParent) {
28523
+ throw new RuntimeModelError65(this.model, "\u6811\u8868\u683C\u65E0\u503C\u5217\u6A21\u5F0F");
28524
+ }
28525
+ if (!treeGridValue) {
28526
+ throw new RuntimeModelError65(this.model, "\u6811\u8868\u683C\u65E0\u7236\u503C\u5217\u6A21\u5F0F");
28527
+ }
28528
+ this.treeGridValueField = treeGridValue.appDEFieldId.toLowerCase();
28529
+ this.treeGridParentField = treeGridParent.appDEFieldId.toLowerCase();
28530
+ }
28531
+ /**
28532
+ * 切换树表格显示
28533
+ * @return {*}
28534
+ * @author: zhujiamin
28535
+ */
28536
+ switchTreeGridShow() {
28537
+ this.state.showTreeGrid = !this.state.showTreeGrid;
28538
+ }
28052
28539
  };
28053
28540
 
28054
28541
  // src/controller/control/tree-grid/tree-grid.service.ts
@@ -29041,7 +29528,6 @@ var GanttController = class extends TreeGridExController {
29041
29528
  */
29042
29529
  initState() {
29043
29530
  super.initState();
29044
- this.state.rootNodes = [];
29045
29531
  this.state.ganttStyle = {};
29046
29532
  }
29047
29533
  /**
@@ -29114,9 +29600,9 @@ var GanttController = class extends TreeGridExController {
29114
29600
  if (nodeModel) {
29115
29601
  const newData = isTransformData ? this.transformNodeDataItem(nodeModel, data) : data;
29116
29602
  if (Object.keys(newData).length > 0) {
29117
- const [, entityCodename] = nodeModel.appDataEntityId.split(".");
29603
+ const deName = calcDeCodeNameById(nodeModel.appDataEntityId);
29118
29604
  const tempContext = Object.assign(this.context.clone(), {
29119
- [entityCodename]: currentNode.srfkey
29605
+ [deName]: currentNode.srfkey
29120
29606
  });
29121
29607
  const response = await this.service.execDeService(
29122
29608
  nodeModel.appDataEntityId,
@@ -29269,11 +29755,11 @@ var AppHub = class {
29269
29755
  * @param {IAppDataEntity} model
29270
29756
  * @param {string} [appId=ibiz.env.appId]
29271
29757
  */
29272
- registerAppDataEntity(model, appId = ibiz.env.appId) {
29273
- if (!this.dataEntities.has(appId)) {
29274
- this.dataEntities.set(appId, /* @__PURE__ */ new Map());
29758
+ registerAppDataEntity(model, appId2 = ibiz.env.appId) {
29759
+ if (!this.dataEntities.has(appId2)) {
29760
+ this.dataEntities.set(appId2, /* @__PURE__ */ new Map());
29275
29761
  }
29276
- const map = this.dataEntities.get(appId);
29762
+ const map = this.dataEntities.get(appId2);
29277
29763
  map.set(model.id, model);
29278
29764
  }
29279
29765
  /**
@@ -29284,9 +29770,9 @@ var AppHub = class {
29284
29770
  * @param {string} tag 视图 codeName 或者视图 id
29285
29771
  * @param {string} [appId=ibiz.env.appId]
29286
29772
  */
29287
- setAppView(tag, appId = ibiz.env.appId) {
29773
+ setAppView(tag, appId2 = ibiz.env.appId) {
29288
29774
  const id = this.calcAppViewId(tag);
29289
- this.view2appMap.set(id, appId);
29775
+ this.view2appMap.set(id, appId2);
29290
29776
  }
29291
29777
  /**
29292
29778
  * 判断应用视图是否存在
@@ -29308,9 +29794,9 @@ var AppHub = class {
29308
29794
  * @param {string} appId
29309
29795
  * @return {*} {(Promise<string | null>)}
29310
29796
  */
29311
- async getAppStyle(appId) {
29797
+ async getAppStyle(appId2) {
29312
29798
  if (this.modelLoaderProvider) {
29313
- return this.modelLoaderProvider.getAppStyle(appId);
29799
+ return this.modelLoaderProvider.getAppStyle(appId2);
29314
29800
  }
29315
29801
  return null;
29316
29802
  }
@@ -29324,15 +29810,15 @@ var AppHub = class {
29324
29810
  */
29325
29811
  async getAppView(tag) {
29326
29812
  const id = this.calcAppViewId(tag);
29327
- const appId = this.view2appMap.get(id) || ibiz.env.appId;
29328
- if (!this.appMap.has(appId)) {
29329
- await this.createApp(appId);
29813
+ const appId2 = this.view2appMap.get(id) || ibiz.env.appId;
29814
+ if (!this.appMap.has(appId2)) {
29815
+ await this.createApp(appId2);
29330
29816
  }
29331
29817
  if (this.views.has(id)) {
29332
29818
  return this.views.get(id);
29333
29819
  }
29334
29820
  if (this.modelLoaderProvider) {
29335
- const appView = await this.modelLoaderProvider.getAppView(appId, id);
29821
+ const appView = await this.modelLoaderProvider.getAppView(appId2, id);
29336
29822
  this.registerAppView(appView);
29337
29823
  return appView;
29338
29824
  }
@@ -29347,9 +29833,9 @@ var AppHub = class {
29347
29833
  * @param {string} [appId=ibiz.env.appId]
29348
29834
  * @return {*} {Promise<IAppDataEntity>}
29349
29835
  */
29350
- async getAppDataEntity(id, appId = ibiz.env.appId) {
29351
- if (this.dataEntities.has(appId)) {
29352
- const map = this.dataEntities.get(appId);
29836
+ async getAppDataEntity(id, appId2 = ibiz.env.appId) {
29837
+ if (this.dataEntities.has(appId2)) {
29838
+ const map = this.dataEntities.get(appId2);
29353
29839
  if (map.has(id)) {
29354
29840
  return map.get(id);
29355
29841
  }
@@ -29357,14 +29843,14 @@ var AppHub = class {
29357
29843
  if (this.modelLoaderProvider) {
29358
29844
  let entity;
29359
29845
  if (id.indexOf(".") !== -1) {
29360
- entity = await this.modelLoaderProvider.getAppDataEntity(appId, id);
29846
+ entity = await this.modelLoaderProvider.getAppDataEntity(appId2, id);
29361
29847
  } else {
29362
29848
  entity = await this.modelLoaderProvider.getAppDataEntityByCodeName(
29363
- appId,
29849
+ appId2,
29364
29850
  id
29365
29851
  );
29366
29852
  }
29367
- this.registerAppDataEntity(entity, appId);
29853
+ this.registerAppDataEntity(entity, appId2);
29368
29854
  return entity;
29369
29855
  }
29370
29856
  throw new RuntimeError61("\u672A\u627E\u5230\u5E94\u7528\u5B9E\u4F53[".concat(id, "]"));
@@ -29443,6 +29929,10 @@ var AppHub = class {
29443
29929
  }
29444
29930
  return [];
29445
29931
  }
29932
+ reset() {
29933
+ this.appMap.clear();
29934
+ this.configCache = void 0;
29935
+ }
29446
29936
  };
29447
29937
 
29448
29938
  // src/engine/engine-factory.ts
@@ -29704,7 +30194,7 @@ var ViewEngineBase = class {
29704
30194
  };
29705
30195
 
29706
30196
  // src/engine/md-view.engine.ts
29707
- import { RuntimeModelError as RuntimeModelError65 } from "@ibiz-template/core";
30197
+ import { RuntimeModelError as RuntimeModelError66 } from "@ibiz-template/core";
29708
30198
  import { clone as clone24 } from "ramda";
29709
30199
  var MDViewEngine = class extends ViewEngineBase {
29710
30200
  /**
@@ -29888,7 +30378,7 @@ var MDViewEngine = class extends ViewEngineBase {
29888
30378
  view: this.view
29889
30379
  }));
29890
30380
  if (result === -1) {
29891
- throw new RuntimeModelError65(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
30381
+ throw new RuntimeModelError66(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
29892
30382
  } else {
29893
30383
  return {
29894
30384
  cancel: !result.ok
@@ -29911,7 +30401,7 @@ var MDViewEngine = class extends ViewEngineBase {
29911
30401
  (item) => item.id === "newdata"
29912
30402
  );
29913
30403
  if (!openAppViewLogic) {
29914
- throw new RuntimeModelError65(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
30404
+ throw new RuntimeModelError66(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
29915
30405
  }
29916
30406
  const params = clone24(this.view.params);
29917
30407
  if (copyMode) {
@@ -29925,7 +30415,7 @@ var MDViewEngine = class extends ViewEngineBase {
29925
30415
  view: this.view
29926
30416
  }));
29927
30417
  if (result === -1) {
29928
- throw new RuntimeModelError65(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
30418
+ throw new RuntimeModelError66(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
29929
30419
  } else {
29930
30420
  return {
29931
30421
  cancel: !result.ok
@@ -30236,13 +30726,13 @@ var ScriptExecutor = class extends LogicExecutor {
30236
30726
  };
30237
30727
 
30238
30728
  // src/logic-scheduler/executor/app-de-ui-logic-executor.ts
30239
- import { RuntimeModelError as RuntimeModelError66 } from "@ibiz-template/core";
30729
+ import { RuntimeModelError as RuntimeModelError67 } from "@ibiz-template/core";
30240
30730
  var AppDEUILogicExecutor = class extends LogicExecutor {
30241
30731
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
30242
30732
  execute(executeParams) {
30243
30733
  const { appDEUILogicId, appDataEntityId } = this.logic;
30244
30734
  if (!appDEUILogicId) {
30245
- throw new RuntimeModelError66(this.logic, "\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53\u754C\u9762\u903B\u8F91");
30735
+ throw new RuntimeModelError67(this.logic, "\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53\u754C\u9762\u903B\u8F91");
30246
30736
  }
30247
30737
  execUILogic(appDEUILogicId, appDataEntityId, executeParams);
30248
30738
  }
@@ -30700,7 +31190,7 @@ var ItemDynaLogicTrigger = class extends LogicTrigger {
30700
31190
  };
30701
31191
 
30702
31192
  // src/logic-scheduler/trigger/timer-trigger.ts
30703
- import { RuntimeError as RuntimeError66, RuntimeModelError as RuntimeModelError67 } from "@ibiz-template/core";
31193
+ import { RuntimeError as RuntimeError66, RuntimeModelError as RuntimeModelError68 } from "@ibiz-template/core";
30704
31194
  var TimerTrigger = class extends LogicTrigger {
30705
31195
  constructor() {
30706
31196
  super(...arguments);
@@ -30708,7 +31198,7 @@ var TimerTrigger = class extends LogicTrigger {
30708
31198
  }
30709
31199
  start() {
30710
31200
  if (!this.logic.timer) {
30711
- throw new RuntimeModelError67(this.logic, "\u5B9A\u65F6\u5668\u7F3A\u5C11\u5B9A\u65F6\u95F4\u9694");
31201
+ throw new RuntimeModelError68(this.logic, "\u5B9A\u65F6\u5668\u7F3A\u5C11\u5B9A\u65F6\u95F4\u9694");
30712
31202
  }
30713
31203
  this.timer = setInterval(() => {
30714
31204
  if (!this.scheduler.defaultParamsCb) {
@@ -30730,7 +31220,7 @@ var TimerTrigger = class extends LogicTrigger {
30730
31220
  import {
30731
31221
  ModelError as ModelError34,
30732
31222
  RuntimeError as RuntimeError67,
30733
- RuntimeModelError as RuntimeModelError68
31223
+ RuntimeModelError as RuntimeModelError69
30734
31224
  } from "@ibiz-template/core";
30735
31225
  import { notNilEmpty as notNilEmpty9 } from "qx-util";
30736
31226
  var AppUILogicExecutor = class extends LogicExecutor {
@@ -30776,7 +31266,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
30776
31266
  } else {
30777
31267
  openViewRef = appUILogic.openDataAppView;
30778
31268
  if (!openViewRef) {
30779
- throw new RuntimeModelError68(
31269
+ throw new RuntimeModelError69(
30780
31270
  appUILogic,
30781
31271
  "opendata\u89C6\u56FE\u903B\u8F91\u6CA1\u6709\u914D\u7F6E\u9ED8\u8BA4\u6253\u5F00\u89C6\u56FE"
30782
31272
  );
@@ -30784,7 +31274,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
30784
31274
  }
30785
31275
  const openView = openViewRef.refAppViewId;
30786
31276
  if (!openView) {
30787
- throw new RuntimeModelError68(
31277
+ throw new RuntimeModelError69(
30788
31278
  appUILogic,
30789
31279
  "opendata\u89C6\u56FE\u903B\u8F91\u7684\u9ED8\u8BA4\u6253\u5F00\u89C6\u56FE\u6CA1\u6709\u5B9E\u9645\u5F15\u7528\u89C6\u56FE"
30790
31280
  );
@@ -30814,7 +31304,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
30814
31304
  );
30815
31305
  const typeFileName = appDataEntity.formTypeAppDEFieldId || appDataEntity.dataTypeAppDEFieldId;
30816
31306
  if (!typeFileName) {
30817
- throw new RuntimeModelError68(
31307
+ throw new RuntimeModelError69(
30818
31308
  appUILogic,
30819
31309
  "".concat(appDataEntity.codeName, "[\u591A\u8868\u5355\u5B9E\u4F53] or [\u7D22\u5F15\u5B9E\u4F53]\u7F3A\u5C11\u7C7B\u578B\u5C5E\u6027\u914D\u7F6E")
30820
31310
  );
@@ -30822,7 +31312,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
30822
31312
  const { data } = parameters;
30823
31313
  const formTypeValue = data[0][typeFileName];
30824
31314
  if (!formTypeValue) {
30825
- throw new RuntimeModelError68(appUILogic, "\u6570\u636E\u6E90\u65E0\u8868\u5355\u7C7B\u578B\u5E94\u7528\u5B9E\u4F53\u5C5E\u6027\u503C");
31315
+ throw new RuntimeModelError69(appUILogic, "\u6570\u636E\u6E90\u65E0\u8868\u5355\u7C7B\u578B\u5E94\u7528\u5B9E\u4F53\u5C5E\u6027\u503C");
30826
31316
  }
30827
31317
  const openViewRefs = appUILogic.openDataAppViews;
30828
31318
  const findView = openViewRefs == null ? void 0 : openViewRefs.find((item) => item.refMode === formTypeValue);
@@ -30864,7 +31354,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
30864
31354
  return viewRef.refMode.toLowerCase() !== parentDeName;
30865
31355
  });
30866
31356
  if (!newViewRef) {
30867
- throw new RuntimeModelError68(
31357
+ throw new RuntimeModelError69(
30868
31358
  appUILogic,
30869
31359
  "\u6CA1\u6709\u627E\u5230\u6279\u6DFB\u52A0\u9700\u8981\u6253\u5F00\u7684\u9009\u62E9\u89C6\u56FE"
30870
31360
  );
@@ -30874,7 +31364,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
30874
31364
  } else {
30875
31365
  newViewRef = newDataAppView;
30876
31366
  if (!newViewRef || !newViewRef.refAppViewId) {
30877
- throw new RuntimeModelError68(
31367
+ throw new RuntimeModelError69(
30878
31368
  appUILogic,
30879
31369
  "newdata\u89C6\u56FE\u903B\u8F91\u6CA1\u6709\u914D\u7F6E\u9ED8\u8BA4\u65B0\u5EFA\u6570\u636E\u89C6\u56FE"
30880
31370
  );
@@ -30932,7 +31422,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
30932
31422
  const { wizardAppView, newDataAppViews } = appUILogic;
30933
31423
  const { context, params, ...rest } = parameters;
30934
31424
  if (!wizardAppView || !wizardAppView.refAppViewId) {
30935
- throw new RuntimeModelError68(appUILogic, "\u7F3A\u5C11\u9ED8\u8BA4\u7D22\u5F15\u5B9E\u4F53\u9009\u62E9\u89C6\u56FE");
31425
+ throw new RuntimeModelError69(appUILogic, "\u7F3A\u5C11\u9ED8\u8BA4\u7D22\u5F15\u5B9E\u4F53\u9009\u62E9\u89C6\u56FE");
30936
31426
  }
30937
31427
  const result = await ibiz.commands.execute(
30938
31428
  OpenAppViewCommand.TAG,
@@ -30983,7 +31473,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
30983
31473
  const minorDERs = selfDe.minorAppDERSs;
30984
31474
  const pickParentDeName = newViewRef.refMode.toLowerCase();
30985
31475
  if (!minorDERs) {
30986
- throw new RuntimeModelError68(selfDe, "\u5B9E\u4F53\u6CA1\u6709\u4ECE\u5173\u7CFB\u96C6\u5408\uFF01");
31476
+ throw new RuntimeModelError69(selfDe, "\u5B9E\u4F53\u6CA1\u6709\u4ECE\u5173\u7CFB\u96C6\u5408\uFF01");
30987
31477
  }
30988
31478
  let pickParentFieldName;
30989
31479
  minorDERs == null ? void 0 : minorDERs.forEach((item) => {
@@ -31082,12 +31572,12 @@ var ControlEventTrigger = class extends LogicTrigger {
31082
31572
  };
31083
31573
 
31084
31574
  // src/logic-scheduler/executor/app-ui-action-executor.ts
31085
- import { RuntimeModelError as RuntimeModelError69 } from "@ibiz-template/core";
31575
+ import { RuntimeModelError as RuntimeModelError70 } from "@ibiz-template/core";
31086
31576
  var AppDEUIActionExecutor = class extends LogicExecutor {
31087
31577
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
31088
31578
  execute(executeParams) {
31089
31579
  if (!this.logic.appDEUIActionId) {
31090
- throw new RuntimeModelError69(
31580
+ throw new RuntimeModelError70(
31091
31581
  this.logic,
31092
31582
  "\u903B\u8F91\u4E2D\u7F3A\u5C11\u89E6\u53D1\u5E94\u7528\u5B9E\u4F53\u754C\u9762\u884C\u4E3Aid"
31093
31583
  );
@@ -31258,6 +31748,7 @@ var RemotePluginItem = class {
31258
31748
  }
31259
31749
  };
31260
31750
  export {
31751
+ APPMENUITEM_PROVIDER_PREFIX,
31261
31752
  APP_COUNTER_PROVIDER_PREFIX,
31262
31753
  ASYNC_ACTION_PROVIDER_PREFIX,
31263
31754
  AcFetchMethod,
@@ -31509,6 +32000,7 @@ export {
31509
32000
  generateRules,
31510
32001
  getAllPanelField,
31511
32002
  getAppCounterProvider,
32003
+ getAppMenuItemProvider,
31512
32004
  getAppViewRef,
31513
32005
  getAsyncActionProvider,
31514
32006
  getChildNodeRSs,
@@ -31521,6 +32013,7 @@ export {
31521
32013
  getDeACMode,
31522
32014
  getDefaultValue,
31523
32015
  getEditorProvider,
32016
+ getEntitySchema,
31524
32017
  getFormDetailProvider,
31525
32018
  getGridColumnProvider,
31526
32019
  getMatchResPath,
@@ -31558,6 +32051,7 @@ export {
31558
32051
  presetDEMethodProvider,
31559
32052
  presetUIActionProvider,
31560
32053
  registerAppCounterProvider,
32054
+ registerAppMenuItemProvider,
31561
32055
  registerAsyncActionProvider,
31562
32056
  registerControlProvider,
31563
32057
  registerDEMethodProvider,