@ibiz-template/runtime 0.5.3-beta.9 → 0.5.4

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 (98) hide show
  1. package/dist/index.esm.js +300 -106
  2. package/dist/index.system.min.js +1 -1
  3. package/out/application.d.ts.map +1 -1
  4. package/out/application.js +4 -1
  5. package/out/controller/common/view/view.controller.d.ts.map +1 -1
  6. package/out/controller/common/view/view.controller.js +2 -0
  7. package/out/controller/control/form/edit-form/edit-form.controller.js +1 -1
  8. package/out/controller/control/form/form-detail/form-tab-panel/form-tab-panel.controller.js +2 -1
  9. package/out/controller/control/search-bar/search-bar.controller.d.ts +8 -1
  10. package/out/controller/control/search-bar/search-bar.controller.d.ts.map +1 -1
  11. package/out/controller/control/search-bar/search-bar.controller.js +41 -9
  12. package/out/controller/control/search-bar/search-bar.service.d.ts +4 -4
  13. package/out/controller/control/search-bar/search-bar.service.d.ts.map +1 -1
  14. package/out/controller/control/search-bar/search-bar.service.js +38 -19
  15. package/out/controller/control/tree/tree.controller.d.ts +17 -0
  16. package/out/controller/control/tree/tree.controller.d.ts.map +1 -1
  17. package/out/controller/control/tree/tree.controller.js +22 -0
  18. package/out/controller/control/tree-grid-ex/tree-grid-ex.controller.d.ts.map +1 -1
  19. package/out/controller/control/tree-grid-ex/tree-grid-ex.controller.js +6 -4
  20. package/out/controller/utils/jsonschema/entity.d.ts.map +1 -1
  21. package/out/controller/utils/jsonschema/entity.js +4 -1
  22. package/out/engine/md-view.engine.d.ts.map +1 -1
  23. package/out/engine/md-view.engine.js +3 -1
  24. package/out/global/global-util/global-util.d.ts +8 -1
  25. package/out/global/global-util/global-util.d.ts.map +1 -1
  26. package/out/global/global-util/global-util.js +8 -1
  27. package/out/interface/controller/common/i-icon/i-icon.d.ts +1 -0
  28. package/out/interface/controller/common/i-icon/i-icon.d.ts.map +1 -1
  29. package/out/interface/controller/controller/control/i-search-bar.controller.d.ts +8 -0
  30. package/out/interface/controller/controller/control/i-search-bar.controller.d.ts.map +1 -1
  31. package/out/interface/controller/state/control/i-drbar.state.d.ts +7 -0
  32. package/out/interface/controller/state/control/i-drbar.state.d.ts.map +1 -1
  33. package/out/interface/controller/state/control/i-drtab.state.d.ts +7 -0
  34. package/out/interface/controller/state/control/i-drtab.state.d.ts.map +1 -1
  35. package/out/interface/controller/state/control/i-search-bar.state.d.ts +36 -1
  36. package/out/interface/controller/state/control/i-search-bar.state.d.ts.map +1 -1
  37. package/out/interface/util/i-view-stack/i-view-stack.d.ts +53 -0
  38. package/out/interface/util/i-view-stack/i-view-stack.d.ts.map +1 -0
  39. package/out/interface/util/i-view-stack/i-view-stack.js +1 -0
  40. package/out/interface/util/index.d.ts +1 -0
  41. package/out/interface/util/index.d.ts.map +1 -1
  42. package/out/plugin/remote-plugin-item/remote-plugin-item.d.ts +10 -0
  43. package/out/plugin/remote-plugin-item/remote-plugin-item.d.ts.map +1 -1
  44. package/out/register/helper/async-action-register.d.ts.map +1 -1
  45. package/out/register/helper/async-action-register.js +1 -1
  46. package/out/service/de-service-util.d.ts +11 -0
  47. package/out/service/de-service-util.d.ts.map +1 -1
  48. package/out/service/de-service-util.js +34 -0
  49. package/out/service/dto/method.dto.d.ts +1 -2
  50. package/out/service/dto/method.dto.d.ts.map +1 -1
  51. package/out/service/dto/method.dto.js +0 -7
  52. package/out/service/mqtt/mqtt.service.d.ts.map +1 -1
  53. package/out/service/mqtt/mqtt.service.js +1 -4
  54. package/out/service/service/auth/v7-auth.service.d.ts +1 -2
  55. package/out/service/service/auth/v7-auth.service.d.ts.map +1 -1
  56. package/out/service/service/auth/v7-auth.service.js +27 -7
  57. package/out/service/service/entity/method/method-renturn.d.ts.map +1 -1
  58. package/out/service/service/entity/method/method-renturn.js +9 -3
  59. package/out/service/utils/dynamic-code-list/dynamic-code-list.d.ts.map +1 -1
  60. package/out/service/utils/dynamic-code-list/dynamic-code-list.js +15 -3
  61. package/out/service/vo/tree-node-data/tree-node-data.d.ts.map +1 -1
  62. package/out/service/vo/tree-node-data/tree-node-data.js +3 -0
  63. package/out/utils/index.d.ts +1 -0
  64. package/out/utils/index.d.ts.map +1 -1
  65. package/out/utils/index.js +1 -0
  66. package/out/utils/view-stack/view-stack.d.ts +29 -0
  67. package/out/utils/view-stack/view-stack.d.ts.map +1 -0
  68. package/out/utils/view-stack/view-stack.js +47 -0
  69. package/package.json +5 -5
  70. package/src/application.ts +6 -1
  71. package/src/controller/common/view/view.controller.ts +4 -0
  72. package/src/controller/control/form/edit-form/edit-form.controller.ts +1 -1
  73. package/src/controller/control/form/form-detail/form-tab-panel/form-tab-panel.controller.ts +1 -1
  74. package/src/controller/control/search-bar/search-bar.controller.ts +40 -9
  75. package/src/controller/control/search-bar/search-bar.service.ts +42 -20
  76. package/src/controller/control/tree/tree.controller.ts +35 -0
  77. package/src/controller/control/tree-grid-ex/tree-grid-ex.controller.ts +12 -4
  78. package/src/controller/utils/jsonschema/entity.ts +4 -1
  79. package/src/engine/md-view.engine.ts +5 -1
  80. package/src/global/global-util/global-util.ts +9 -0
  81. package/src/interface/controller/common/i-icon/i-icon.ts +1 -0
  82. package/src/interface/controller/controller/control/i-search-bar.controller.ts +9 -0
  83. package/src/interface/controller/state/control/i-drbar.state.ts +8 -0
  84. package/src/interface/controller/state/control/i-drtab.state.ts +8 -0
  85. package/src/interface/controller/state/control/i-search-bar.state.ts +41 -1
  86. package/src/interface/util/i-view-stack/i-view-stack.ts +53 -0
  87. package/src/interface/util/index.ts +1 -0
  88. package/src/plugin/remote-plugin-item/remote-plugin-item.ts +8 -0
  89. package/src/register/helper/async-action-register.ts +3 -1
  90. package/src/service/de-service-util.ts +43 -0
  91. package/src/service/dto/method.dto.ts +1 -8
  92. package/src/service/mqtt/mqtt.service.ts +1 -4
  93. package/src/service/service/auth/v7-auth.service.ts +37 -19
  94. package/src/service/service/entity/method/method-renturn.ts +14 -5
  95. package/src/service/utils/dynamic-code-list/dynamic-code-list.ts +18 -2
  96. package/src/service/vo/tree-node-data/tree-node-data.ts +3 -0
  97. package/src/utils/index.ts +1 -0
  98. package/src/utils/view-stack/view-stack.ts +64 -0
package/dist/index.esm.js CHANGED
@@ -3150,6 +3150,47 @@ var RawValueUtil = class {
3150
3150
  }
3151
3151
  };
3152
3152
 
3153
+ // src/utils/view-stack/view-stack.ts
3154
+ var ViewStack = class {
3155
+ constructor() {
3156
+ this.stackMap = /* @__PURE__ */ new Map();
3157
+ this.stack = [];
3158
+ this.activeStack = [];
3159
+ }
3160
+ add(id, view) {
3161
+ this.stack.push(view);
3162
+ this.stackMap.set(id, view);
3163
+ this.recalculateActiveStack();
3164
+ }
3165
+ remove(id) {
3166
+ const view = this.stackMap.get(id);
3167
+ if (view) {
3168
+ this.stack.splice(this.stack.indexOf(view), 1);
3169
+ this.stackMap.delete(id);
3170
+ this.recalculateActiveStack();
3171
+ }
3172
+ }
3173
+ getActives() {
3174
+ return this.activeStack;
3175
+ }
3176
+ active(_id) {
3177
+ this.recalculateActiveStack();
3178
+ }
3179
+ deactivate(_id) {
3180
+ this.recalculateActiveStack();
3181
+ }
3182
+ /**
3183
+ * 重新计算激活视图堆栈
3184
+ *
3185
+ * @author chitanda
3186
+ * @date 2024-01-18 14:01:23
3187
+ * @protected
3188
+ */
3189
+ recalculateActiveStack() {
3190
+ this.activeStack = this.stack.filter((item) => item.isActive === true);
3191
+ }
3192
+ };
3193
+
3153
3194
  // src/utils/promise/promise.ts
3154
3195
  async function handleAllSettled(values, isThrow = true) {
3155
3196
  const allResults = await Promise.allSettled(values);
@@ -4007,7 +4048,9 @@ function getProvider10(key) {
4007
4048
  );
4008
4049
  }
4009
4050
  function getAsyncActionProvider(actiontype) {
4010
- const provider = getProvider10(actiontype);
4051
+ const provider = getProvider10(
4052
+ actiontype || "DEFAULT"
4053
+ );
4011
4054
  if (!provider) {
4012
4055
  throw new RuntimeError9("\u627E\u4E0D\u5F02\u6B65\u64CD\u4F5C\u7C7B\u578B".concat(actiontype, "\u5BF9\u5E94\u7684\u9002\u914D\u5668"));
4013
4056
  } else {
@@ -4589,7 +4632,9 @@ var DynamicCodeListCache = class {
4589
4632
  iconPathAppDEFieldId,
4590
4633
  iconPathXAppDEFieldId,
4591
4634
  disableAppDEFieldId,
4592
- dataAppDEFieldId
4635
+ dataAppDEFieldId,
4636
+ clsAppDEFieldId,
4637
+ colorAppDEFieldId
4593
4638
  } = this.codeList;
4594
4639
  const value = valueAppDEFieldId ? data[valueAppDEFieldId] : data.srfkey;
4595
4640
  result.id = value;
@@ -4613,6 +4658,12 @@ var DynamicCodeListCache = class {
4613
4658
  if (disableAppDEFieldId) {
4614
4659
  result.disableSelect = fieldValueToBoolean(data[disableAppDEFieldId]);
4615
4660
  }
4661
+ if (clsAppDEFieldId) {
4662
+ result.textCls = data[clsAppDEFieldId];
4663
+ }
4664
+ if (colorAppDEFieldId) {
4665
+ result.color = data[colorAppDEFieldId];
4666
+ }
4616
4667
  if (dataAppDEFieldId && data[dataAppDEFieldId]) {
4617
4668
  try {
4618
4669
  result.data = ScriptFactory.execSingleLine(
@@ -4660,9 +4711,11 @@ var DynamicCodeListCache = class {
4660
4711
  if (!tempParams.size) {
4661
4712
  tempParams.size = 1e4;
4662
4713
  }
4663
- if (this.isPredefined) {
4714
+ if (this.isPredefined && this.codeList.codeName) {
4715
+ const index = this.codeList.codeName.indexOf("__");
4716
+ const tag = index !== -1 ? this.codeList.codeName.substring(index + 2) : this.codeList.codeName;
4664
4717
  const res2 = await app.net.get(
4665
- "/dictionaries/codelist/".concat(this.codeList.codeName),
4718
+ "/dictionaries/codelist/".concat(tag),
4666
4719
  tempParams
4667
4720
  );
4668
4721
  return Object.freeze(res2.data.items);
@@ -6357,12 +6410,6 @@ var MethodDto = class {
6357
6410
  * @return {*} {Promise<IDataEntity[]>}
6358
6411
  */
6359
6412
  async sets(context, data) {
6360
- const uiDomain = ibiz.uiDomainManager.get(context.srfsessionid);
6361
- if (uiDomain && uiDomain.state.rsInit !== true) {
6362
- await this.calcRs(context);
6363
- uiDomain.calcParentRs();
6364
- uiDomain.state.rsInit = true;
6365
- }
6366
6413
  return Promise.all(
6367
6414
  data.map(async (datum) => {
6368
6415
  const all = this.fields.filter((field) => field.type === "DTOS").map(async (field) => {
@@ -6404,7 +6451,6 @@ var MethodDto = class {
6404
6451
  *
6405
6452
  * @author chitanda
6406
6453
  * @date 2023-12-26 16:12:13
6407
- * @protected
6408
6454
  * @param {IContext} context
6409
6455
  * @param {number} [depth=0] 递归层级,避免进入死循环。最大递归层级为 10
6410
6456
  * @return {*} {Promise<void>}
@@ -7384,9 +7430,13 @@ var V7AuthService = class {
7384
7430
  const token = getCookie(CoreConst.TOKEN);
7385
7431
  const expirein = getCookie(CoreConst.TOKEN_EXPIRES);
7386
7432
  const remember = getCookie(CoreConst.TOKEN_REMEMBER);
7433
+ const refreshToken = getCookie(CoreConst.REFRESH_TOKEN);
7387
7434
  setCookie(CoreConst.TOKEN, token, 0, true);
7388
7435
  setCookie(CoreConst.TOKEN_EXPIRES, expirein, 0, true);
7389
7436
  setCookie(CoreConst.TOKEN_REMEMBER, remember, 0, true);
7437
+ if (refreshToken) {
7438
+ setCookie(CoreConst.REFRESH_TOKEN, refreshToken, 0, true);
7439
+ }
7390
7440
  }
7391
7441
  return result;
7392
7442
  }
@@ -7399,17 +7449,21 @@ var V7AuthService = class {
7399
7449
  });
7400
7450
  const { data } = res;
7401
7451
  if (data && data.token) {
7452
+ const cacheDays = remember ? 7 : 0;
7402
7453
  if (remember) {
7403
- setCookie(CoreConst.TOKEN_REMEMBER, "1", 7, true);
7454
+ setCookie(CoreConst.TOKEN_REMEMBER, "1", cacheDays, true);
7404
7455
  }
7405
- setCookie(CoreConst.TOKEN, data.token, remember ? 7 : 0, true);
7456
+ setCookie(CoreConst.TOKEN, data.token, cacheDays, true);
7406
7457
  const expiredDate = (/* @__PURE__ */ new Date()).getTime() + (data.expirein || 7199) * 1e3;
7407
- setCookie(
7408
- CoreConst.TOKEN_EXPIRES,
7409
- "".concat(expiredDate),
7410
- remember ? 7 : 0,
7411
- true
7412
- );
7458
+ setCookie(CoreConst.TOKEN_EXPIRES, "".concat(expiredDate), cacheDays, true);
7459
+ if (data.refresh_token) {
7460
+ setCookie(
7461
+ CoreConst.REFRESH_TOKEN,
7462
+ data.refresh_token,
7463
+ cacheDays,
7464
+ true
7465
+ );
7466
+ }
7413
7467
  clearCookie(CoreConst.IS_ANONYMOUS);
7414
7468
  }
7415
7469
  return true;
@@ -7427,6 +7481,7 @@ var V7AuthService = class {
7427
7481
  clearCookie(CoreConst.TOKEN);
7428
7482
  clearCookie(CoreConst.TOKEN_EXPIRES);
7429
7483
  clearCookie(CoreConst.TOKEN_REMEMBER);
7484
+ clearCookie(CoreConst.REFRESH_TOKEN);
7430
7485
  clearCookie(CoreConst.IS_ANONYMOUS);
7431
7486
  ibiz.appData = void 0;
7432
7487
  ibiz.orgData = void 0;
@@ -7445,22 +7500,32 @@ var V7AuthService = class {
7445
7500
  }
7446
7501
  const token = getCookie(CoreConst.TOKEN);
7447
7502
  const expirein = getCookie(CoreConst.TOKEN_EXPIRES);
7448
- const remember = getCookie(CoreConst.TOKEN_REMEMBER);
7449
7503
  if (token && expirein) {
7450
7504
  let wait = Number(expirein) - (/* @__PURE__ */ new Date()).getTime();
7451
7505
  const early = 5 * 60 * 1e3;
7452
7506
  wait = wait > early ? wait - early : 0;
7453
7507
  setTimeout(async () => {
7454
- const res = await ibiz.net.get("/uaa/refreshtoken2");
7508
+ const remember = getCookie(CoreConst.TOKEN_REMEMBER);
7509
+ const refreshToken = getCookie(CoreConst.REFRESH_TOKEN);
7510
+ const cacheDay = remember ? 7 : 0;
7511
+ let res;
7512
+ if (refreshToken != null && refreshToken !== "") {
7513
+ res = await ibiz.net.get("/uaa/refresh_token/".concat(refreshToken));
7514
+ } else {
7515
+ res = await ibiz.net.get("/uaa/refreshtoken2");
7516
+ }
7455
7517
  if (res.ok) {
7456
- setCookie(CoreConst.TOKEN, res.data.token, remember ? 7 : 0, true);
7518
+ setCookie(CoreConst.TOKEN, res.data.token, cacheDay, true);
7457
7519
  const expiredDate = (/* @__PURE__ */ new Date()).getTime() + (res.data.expirein || 7199) * 1e3;
7458
- setCookie(
7459
- CoreConst.TOKEN_EXPIRES,
7460
- "".concat(expiredDate),
7461
- remember ? 7 : 0,
7462
- true
7463
- );
7520
+ setCookie(CoreConst.TOKEN_EXPIRES, "".concat(expiredDate), cacheDay, true);
7521
+ if (res.data.refresh_token) {
7522
+ setCookie(
7523
+ CoreConst.REFRESH_TOKEN,
7524
+ res.data.refresh_token,
7525
+ cacheDay,
7526
+ true
7527
+ );
7528
+ }
7464
7529
  }
7465
7530
  this.extendLogin();
7466
7531
  }, wait);
@@ -7610,10 +7675,19 @@ var MethodReturn = class {
7610
7675
  async handle(context, data) {
7611
7676
  if (this.dto) {
7612
7677
  const app = ibiz.hub.getApp(this.entity.appId);
7613
- app.deService.clearTempCache({
7614
- srfappid: app.appId,
7615
- srfsessionid: context.srfsessionid
7616
- });
7678
+ const uiDomain = ibiz.uiDomainManager.get(context.srfsessionid);
7679
+ if (uiDomain && uiDomain.state.rsInit !== true) {
7680
+ await this.dto.calcRs(context);
7681
+ uiDomain.calcParentRs();
7682
+ uiDomain.state.rsInit = true;
7683
+ }
7684
+ app.deService.clearTempCacheByRs(
7685
+ {
7686
+ srfappid: app.appId,
7687
+ srfsessionid: context.srfsessionid
7688
+ },
7689
+ this.entity.id
7690
+ );
7617
7691
  const items = await this.dto.sets(context, [data]);
7618
7692
  return items[0];
7619
7693
  }
@@ -9509,6 +9583,9 @@ var TreeNodeData = class {
9509
9583
  if (sysImage.imagePath) {
9510
9584
  icon.imagePath = sysImage.imagePath;
9511
9585
  }
9586
+ if (sysImage.rawContent) {
9587
+ icon.htmlStr = sysImage.rawContent;
9588
+ }
9512
9589
  }
9513
9590
  return Object.values(icon).length > 0 ? icon : void 0;
9514
9591
  }
@@ -10203,7 +10280,7 @@ var GanttCodeListNodeData = class extends TreeCodeListNodeData {
10203
10280
  };
10204
10281
 
10205
10282
  // src/service/mqtt/mqtt.service.ts
10206
- import { QXEvent as QXEvent3, createUUID as createUUID7, isNilOrEmpty as isNilOrEmpty6 } from "qx-util";
10283
+ import { QXEvent as QXEvent3, createUUID as createUUID7 } from "qx-util";
10207
10284
  var MqttService = class {
10208
10285
  /**
10209
10286
  * Creates an instance of MqttService.
@@ -10244,9 +10321,6 @@ var MqttService = class {
10244
10321
  keepalive: 60,
10245
10322
  clean: true
10246
10323
  };
10247
- if (isNilOrEmpty6(mqttTopic) || isNilOrEmpty6(token)) {
10248
- throw new Error("mqttTopic or token is empty");
10249
- }
10250
10324
  this.options.username = mqttTopic;
10251
10325
  this.options.password = token;
10252
10326
  }
@@ -10399,6 +10473,42 @@ var _DEServiceUtil = class _DEServiceUtil {
10399
10473
  service.local.clear();
10400
10474
  });
10401
10475
  }
10476
+ /**
10477
+ * 清理指定实体的临时数据缓存,并根据关系清理掉子实体的临时数据缓存
10478
+ *
10479
+ * @author chitanda
10480
+ * @date 2024-01-19 14:01:32
10481
+ * @param {IContext} context
10482
+ * @param {string} entityID
10483
+ * @param {string[]} [clearEntities=[]] 已经清理过的实体忽略,避免关系循环引用导致死循环
10484
+ * @return {*} {void}
10485
+ */
10486
+ clearTempCacheByRs(context, entityID, clearEntities = []) {
10487
+ if (clearEntities.includes(entityID) === true) {
10488
+ return;
10489
+ }
10490
+ clearEntities.push(entityID);
10491
+ const sandboxId = context.srfsessionid;
10492
+ if (!this.cache.has(sandboxId)) {
10493
+ return;
10494
+ }
10495
+ const map = this.cache.get(sandboxId);
10496
+ const service = map.get(entityID);
10497
+ if (service) {
10498
+ service.local.clear();
10499
+ }
10500
+ const uiDomain = ibiz.uiDomainManager.get(context.srfsessionid);
10501
+ if (uiDomain) {
10502
+ const configs = uiDomain.getDERConfigByMajor(entityID);
10503
+ configs.forEach((config) => {
10504
+ this.clearTempCacheByRs(
10505
+ context,
10506
+ config.minorAppDataEntityId,
10507
+ clearEntities
10508
+ );
10509
+ });
10510
+ }
10511
+ }
10402
10512
  /**
10403
10513
  * 执行服务方法
10404
10514
  * @author lxm
@@ -10768,7 +10878,7 @@ var Application = class {
10768
10878
  async init() {
10769
10879
  await this.authority.init();
10770
10880
  await this.loadAppModelStyle();
10771
- if (ibiz.env.enableMqtt && ibiz.appData && ibiz.auth.isAnonymous !== true) {
10881
+ if (ibiz.env.enableMqtt && ibiz.appData && ibiz.appData.mqtttopic && ibiz.auth.isAnonymous !== true) {
10772
10882
  this.mqtt = new MqttService(
10773
10883
  ibiz.appData.mqtttopic,
10774
10884
  getToken(),
@@ -11661,7 +11771,7 @@ function getOriginData(data) {
11661
11771
 
11662
11772
  // src/controller/utils/value-rule/value-rule.ts
11663
11773
  import { RuntimeError as RuntimeError27 } from "@ibiz-template/core";
11664
- import { isNilOrEmpty as isNilOrEmpty7, isNumber } from "qx-util";
11774
+ import { isNilOrEmpty as isNilOrEmpty6, isNumber } from "qx-util";
11665
11775
  import { isNil as isNil15 } from "ramda";
11666
11776
  function generateRules(itemVRs, name, valueItemName) {
11667
11777
  const rules = [];
@@ -11701,7 +11811,7 @@ function generateRules(itemVRs, name, valueItemName) {
11701
11811
  const valueName = valueItemName || name;
11702
11812
  rules.push({
11703
11813
  validator: (rule, value, callback, source) => {
11704
- if (isNilOrEmpty7(source[valueName])) {
11814
+ if (isNilOrEmpty6(source[valueName])) {
11705
11815
  return true;
11706
11816
  }
11707
11817
  const { isPast, infoMessage } = verifyDeRules(
@@ -11964,7 +12074,10 @@ async function exportData(header, data, fileName) {
11964
12074
  async function getEntitySchema(entityId, context) {
11965
12075
  const app = ibiz.hub.getApp(context.srfappid);
11966
12076
  const entity = await ibiz.hub.getAppDataEntity(entityId, context.srfappid);
11967
- const url = "/jsonschema/".concat(entity.name);
12077
+ let url = "/jsonschema/".concat(entity.name);
12078
+ if (entity.dynaSysMode === 0 && ibiz.appData) {
12079
+ url += "?dynamodeltag=".concat(ibiz.appData.dynamodeltag);
12080
+ }
11968
12081
  const res = await app.net.get(url);
11969
12082
  return res.data;
11970
12083
  }
@@ -12602,6 +12715,7 @@ var ViewController = class extends BaseController {
12602
12715
  if (this.engines.length) {
12603
12716
  await Promise.all(this.engines.map((engine) => engine.onDestroyed()));
12604
12717
  }
12718
+ Object.values(this.counters).forEach((counter) => counter.destroy());
12605
12719
  this.ctx.destroy();
12606
12720
  this.engines = [];
12607
12721
  if (this.scheduler) {
@@ -20739,7 +20853,7 @@ var FormGroupPanelController = class extends FormDetailController {
20739
20853
 
20740
20854
  // src/controller/control/form/form-detail/form-item/form-item.controller.ts
20741
20855
  import Schema from "async-validator";
20742
- import { isNilOrEmpty as isNilOrEmpty8 } from "qx-util";
20856
+ import { isNilOrEmpty as isNilOrEmpty7 } from "qx-util";
20743
20857
 
20744
20858
  // src/controller/control/form/form-detail/form-item/form-item.state.ts
20745
20859
  var FormItemState = class extends FormDetailState {
@@ -20995,7 +21109,7 @@ var FormItemController = class extends FormDetailController {
20995
21109
  this.state.error = null;
20996
21110
  return true;
20997
21111
  }
20998
- if (this.state.required && isNilOrEmpty8(this.data[this.name])) {
21112
+ if (this.state.required && isNilOrEmpty7(this.data[this.name])) {
20999
21113
  this.state.error = "\u8BF7\u586B\u5199".concat(this.model.caption || "");
21000
21114
  return false;
21001
21115
  }
@@ -21709,8 +21823,9 @@ var FormTabPanelController = class extends FormDetailController {
21709
21823
  return new FormTabPanelState((_a = this.parent) == null ? void 0 : _a.state);
21710
21824
  }
21711
21825
  async onInit() {
21826
+ var _a;
21712
21827
  await super.onInit();
21713
- this.state.activeTab = this.model.deformTabPages[0].id;
21828
+ this.state.activeTab = ((_a = this.model.deformTabPages) == null ? void 0 : _a[0].id) || "";
21714
21829
  }
21715
21830
  /**
21716
21831
  * 分页点击切换处理
@@ -22235,7 +22350,7 @@ var EditFormController = class extends FormController {
22235
22350
  });
22236
22351
  }
22237
22352
  ibiz.mc.command.send(
22238
- this.data.$origin,
22353
+ res.data.$origin,
22239
22354
  isCreate ? "OBJECTCREATED" : "OBJECTUPDATED"
22240
22355
  );
22241
22356
  return this.data;
@@ -24323,7 +24438,7 @@ var GridUAColumnController = class extends GridColumnController {
24323
24438
  // src/controller/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.controller.ts
24324
24439
  import { RuntimeError as RuntimeError54 } from "@ibiz-template/core";
24325
24440
  import Schema2 from "async-validator";
24326
- import { isNilOrEmpty as isNilOrEmpty9 } from "qx-util";
24441
+ import { isNilOrEmpty as isNilOrEmpty8 } from "qx-util";
24327
24442
  var GridFieldEditColumnController = class extends GridFieldColumnController {
24328
24443
  constructor() {
24329
24444
  super(...arguments);
@@ -24562,7 +24677,7 @@ var GridFieldEditColumnController = class extends GridFieldColumnController {
24562
24677
  */
24563
24678
  async validate(row) {
24564
24679
  const editName = this.fieldName;
24565
- if (ibiz.config.grid.editShowMode !== "cell" && row.editColStates[editName].required && isNilOrEmpty9(row.data[editName])) {
24680
+ if (ibiz.config.grid.editShowMode !== "cell" && row.editColStates[editName].required && isNilOrEmpty8(row.data[editName])) {
24566
24681
  row.errors[editName] = "\u8BF7\u586B\u5199".concat(this.model.caption || "");
24567
24682
  return false;
24568
24683
  }
@@ -25565,8 +25680,16 @@ var SearchBarService = class {
25565
25680
  *
25566
25681
  */
25567
25682
  async fetch() {
25568
- const res = await this.app.net.post("".concat(this.themeUrl, "/fetch_default"), {
25569
- app_view_tag: this.viewTag,
25683
+ const searchconds = [
25684
+ {
25685
+ condop: "EQ",
25686
+ condtype: "DEFIELD",
25687
+ fieldname: "app_view_tag",
25688
+ value: this.viewTag
25689
+ }
25690
+ ];
25691
+ const res = await this.app.net.post("".concat(this.themeUrl, "/fetch_cur_user_all"), {
25692
+ searchconds,
25570
25693
  sort: "create_time,asc"
25571
25694
  });
25572
25695
  if (res.ok) {
@@ -25579,9 +25702,7 @@ var SearchBarService = class {
25579
25702
  *
25580
25703
  */
25581
25704
  async get(id) {
25582
- const res = await this.app.net.get("".concat(this.themeUrl, "/").concat(id), {
25583
- app_view_tag: this.viewTag
25584
- });
25705
+ const res = await this.app.net.get("".concat(this.themeUrl, "/").concat(id));
25585
25706
  if (res.ok) {
25586
25707
  [res.data] = this.convertBackDataToFront([res.data]);
25587
25708
  }
@@ -25592,32 +25713,34 @@ var SearchBarService = class {
25592
25713
  *
25593
25714
  */
25594
25715
  async remove(id) {
25595
- const res = await this.app.net.delete("".concat(this.themeUrl, "/").concat(id), {
25596
- app_view_tag: this.viewTag
25597
- });
25716
+ const res = await this.app.net.delete("".concat(this.themeUrl, "/").concat(id));
25598
25717
  return res;
25599
25718
  }
25600
25719
  /**
25601
- * 新建数据
25720
+ * 新建数据(只有一个标题)
25602
25721
  *
25603
25722
  */
25604
25723
  async create(caption) {
25605
25724
  const res = await this.app.net.post("".concat(this.themeUrl), {
25606
- name: caption,
25725
+ name: "".concat(this.viewTag, "___").concat(caption),
25726
+ caption,
25727
+ app_tag: this.model.appId,
25607
25728
  app_view_tag: this.viewTag
25608
25729
  });
25609
25730
  return res;
25610
25731
  }
25611
25732
  /**
25612
- * 新建数据(带参数,给平台配置建立的分组用)
25733
+ * 新建数据(带参数,给平台配置建立的分组用,分组项名称就是id)
25613
25734
  *
25614
25735
  */
25615
- async createWithParams(id, data) {
25736
+ async createWithParams(group, data) {
25616
25737
  const res = await this.app.net.post("".concat(this.themeUrl), {
25617
- id,
25618
- theme_model: JSON.stringify(data),
25738
+ name: group.name,
25739
+ caption: group.caption,
25740
+ app_tag: this.model.appId,
25619
25741
  app_view_tag: this.viewTag,
25620
- show: data.show
25742
+ theme_model: JSON.stringify(data),
25743
+ valid_flag: group.show ? 1 : 0
25621
25744
  });
25622
25745
  return res;
25623
25746
  }
@@ -25668,8 +25791,14 @@ var SearchBarService = class {
25668
25791
  convertBackDataToFront(data) {
25669
25792
  return data.map((item) => {
25670
25793
  const tempItem = { ...item };
25794
+ if (item.id) {
25795
+ tempItem.id = item.id;
25796
+ }
25671
25797
  if (item.name) {
25672
- tempItem.caption = item.name;
25798
+ tempItem.name = item.name;
25799
+ }
25800
+ if (item.caption) {
25801
+ tempItem.caption = item.caption;
25673
25802
  }
25674
25803
  if (item.theme_model) {
25675
25804
  tempItem.searchGroupData = JSON.parse(item.theme_model);
@@ -25693,12 +25822,17 @@ var SearchBarService = class {
25693
25822
  convertFrontDataToBack(data) {
25694
25823
  return data.map((item) => {
25695
25824
  const tempItem = {
25696
- appId: item.appId,
25697
- app_view_tag: this.viewTag,
25698
- id: item.id
25825
+ app_tag: this.model.appId,
25826
+ app_view_tag: this.viewTag
25699
25827
  };
25828
+ if (item.id) {
25829
+ tempItem.id = item.id;
25830
+ }
25831
+ if (item.name) {
25832
+ tempItem.name = item.name;
25833
+ }
25700
25834
  if (item.caption) {
25701
- tempItem.name = item.caption;
25835
+ tempItem.caption = item.caption;
25702
25836
  }
25703
25837
  if (item.searchGroupData && Object.keys(item.searchGroupData).length > 0) {
25704
25838
  tempItem.theme_model = JSON.stringify(item.searchGroupData);
@@ -25894,6 +26028,13 @@ var SearchBarController = class extends ControlController {
25894
26028
  * @Date: 2023-12-21 10:17:43
25895
26029
  */
25896
26030
  this.isBackendSearchGroup = this.model.searchBarStyle === "SEARCHBAR2";
26031
+ /**
26032
+ * 是否有默认选中
26033
+ * @return {*}
26034
+ * @author: zhujiamin
26035
+ * @Date: 2023-12-21 10:17:43
26036
+ */
26037
+ this.hasDefaultSelect = false;
25897
26038
  /**
25898
26039
  * 是否启用根据实体的JSON Schema生成过滤项
25899
26040
  * @author lxm
@@ -25949,11 +26090,14 @@ var SearchBarController = class extends ControlController {
25949
26090
  this.calcQuickSearchPlaceholder();
25950
26091
  }
25951
26092
  if (this.isBackendSearchGroup && this.view.model.codeName) {
25952
- this.service = new SearchBarService(this.model, this.view.model.codeName);
26093
+ this.service = new SearchBarService(
26094
+ this.model,
26095
+ this.view.model.codeName.toLowerCase()
26096
+ );
25953
26097
  await this.service.init(this.context);
25954
26098
  }
25955
26099
  await this.initSearchBarFilters();
25956
- await this.initSearBarGroups();
26100
+ await this.initSearBarGroups(true);
25957
26101
  }
25958
26102
  /**
25959
26103
  * 根据实体jsonschema初始化
@@ -26194,18 +26338,21 @@ var SearchBarController = class extends ControlController {
26194
26338
  * @author: zhujiamin
26195
26339
  * @Date: 2023-12-19 14:43:46
26196
26340
  */
26197
- async initSearBarGroups() {
26341
+ async initSearBarGroups(firstInit = false) {
26198
26342
  this.state.searchBarGroups = [];
26199
26343
  if (this.isBackendSearchGroup) {
26200
26344
  if (this.model.searchBarGroups && this.model.searchBarGroups.length > 0) {
26201
26345
  this.state.searchBarGroups = this.model.searchBarGroups.map(
26202
26346
  (item, index) => {
26203
26347
  const tempGroup = {
26204
- ...item,
26348
+ name: item.id,
26349
+ caption: item.caption,
26205
26350
  saved: false,
26206
26351
  show: true,
26207
26352
  searchGroupData: {},
26208
- order: (index + 1) * 100
26353
+ order: (index + 1) * 100,
26354
+ defaultSelect: false,
26355
+ noEdit: true
26209
26356
  };
26210
26357
  if (item.data) {
26211
26358
  try {
@@ -26228,6 +26375,9 @@ var SearchBarController = class extends ControlController {
26228
26375
  ibiz.log.error("".concat(item.data, "\u975E\u6807\u51C6JSON\u683C\u5F0F:"), error);
26229
26376
  }
26230
26377
  }
26378
+ if (item.defaultGroup) {
26379
+ tempGroup.defaultSelect = true;
26380
+ }
26231
26381
  return tempGroup;
26232
26382
  }
26233
26383
  );
@@ -26236,7 +26386,7 @@ var SearchBarController = class extends ControlController {
26236
26386
  if (res.ok) {
26237
26387
  res.data.forEach((group) => {
26238
26388
  const existGroup = this.state.searchBarGroups.find(
26239
- (item) => item.id === group.id
26389
+ (item) => item.name === group.name
26240
26390
  );
26241
26391
  if (existGroup) {
26242
26392
  mergeInLeft3(existGroup, group);
@@ -26247,7 +26397,6 @@ var SearchBarController = class extends ControlController {
26247
26397
  0
26248
26398
  );
26249
26399
  this.state.searchBarGroups.push({
26250
- appId: this.context.srfappid,
26251
26400
  saved: true,
26252
26401
  show: true,
26253
26402
  searchGroupData: {},
@@ -26262,6 +26411,15 @@ var SearchBarController = class extends ControlController {
26262
26411
  this.state.searchBarGroups.forEach((item, index) => {
26263
26412
  item.order = (index + 1) * 100;
26264
26413
  });
26414
+ if (firstInit && this.state.searchBarGroups && this.state.searchBarGroups.length > 0) {
26415
+ const defaultSelectedGroup = this.state.searchBarGroups.find((group) => {
26416
+ return group.defaultSelect;
26417
+ });
26418
+ if (defaultSelectedGroup) {
26419
+ this.hasDefaultSelect = true;
26420
+ this.handleGroupClick(defaultSelectedGroup);
26421
+ }
26422
+ }
26265
26423
  }
26266
26424
  }
26267
26425
  /**
@@ -26287,14 +26445,15 @@ var SearchBarController = class extends ControlController {
26287
26445
  ibiz.message.success("\u4FDD\u5B58\u6210\u529F");
26288
26446
  } else {
26289
26447
  const res = await this.service.createWithParams(
26290
- this.state.selectedSearchGroupItem.id,
26448
+ this.state.selectedSearchGroupItem,
26291
26449
  saveParams
26292
26450
  );
26293
26451
  if (res.ok) {
26294
26452
  const savedGroup = this.state.searchBarGroups.find(
26295
- (group) => group.id === res.data.id
26453
+ (group) => group.name === res.data.name
26296
26454
  );
26297
26455
  if (savedGroup) {
26456
+ mergeInLeft3(savedGroup, res.data);
26298
26457
  savedGroup.saved = true;
26299
26458
  }
26300
26459
  ibiz.message.success("\u4FDD\u5B58\u6210\u529F");
@@ -26924,6 +27083,7 @@ var TreeController = class extends MDControlController {
26924
27083
  this.initDropNodeRss();
26925
27084
  this.initNodeClickTBUIActionItem();
26926
27085
  await this.initService();
27086
+ await this.initCounter();
26927
27087
  this.model.detreeNodes.forEach((node) => {
26928
27088
  var _a2, _b2;
26929
27089
  if ((_b2 = (_a2 = node.decontextMenu) == null ? void 0 : _a2.detoolbarItems) == null ? void 0 : _b2.length) {
@@ -26939,6 +27099,12 @@ var TreeController = class extends MDControlController {
26939
27099
  Object.values(this.contextMenus).map((menu) => menu.created())
26940
27100
  );
26941
27101
  }
27102
+ async onDestroyed() {
27103
+ await super.onDestroyed();
27104
+ if (this.counter) {
27105
+ this.counter.destroy();
27106
+ }
27107
+ }
26942
27108
  /**
26943
27109
  * 初始化对应类型的部件服务
26944
27110
  * @author lxm
@@ -26950,6 +27116,23 @@ var TreeController = class extends MDControlController {
26950
27116
  this.service = new TreeService(this.model);
26951
27117
  await this.service.init(this.context);
26952
27118
  }
27119
+ /**
27120
+ * 初始化计数器
27121
+ * @author lxm
27122
+ * @date 2024-01-18 05:12:02
27123
+ * @protected
27124
+ * @return {*} {Promise<void>}
27125
+ */
27126
+ async initCounter() {
27127
+ const { appCounterRefs } = this.model;
27128
+ const appCounterRef = appCounterRefs == null ? void 0 : appCounterRefs[0];
27129
+ if (appCounterRef) {
27130
+ this.counter = await CounterService.getCounterByRef(
27131
+ appCounterRef,
27132
+ this.context
27133
+ );
27134
+ }
27135
+ }
26953
27136
  /**
26954
27137
  * 初始化节点拖入关系处理
26955
27138
  * @author lxm
@@ -28712,6 +28895,7 @@ var KanbanController = class extends DataViewControlController {
28712
28895
  // src/controller/control/tree-grid-ex/tree-grid-ex.controller.ts
28713
28896
  import {
28714
28897
  RuntimeError as RuntimeError60,
28898
+ RuntimeModelError as RuntimeModelError67,
28715
28899
  awaitTimeout as awaitTimeout3,
28716
28900
  recursiveIterate as recursiveIterate11
28717
28901
  } from "@ibiz-template/core";
@@ -28985,12 +29169,14 @@ var TreeGridExController = class extends TreeController {
28985
29169
  return;
28986
29170
  }
28987
29171
  const nodeModel = this.getNodeModel(nodeData._nodeId);
28988
- const { appDataEntityId } = nodeModel;
29172
+ const { appDataEntityId, updateAppDEActionId } = nodeModel;
28989
29173
  const isCreate = nodeData._deData.srfuf === 0 /* CREATE */;
28990
29174
  if (isCreate) {
28991
29175
  throw new RuntimeError60("\u6682\u4E0D\u652F\u6301\u65B0\u5EFA");
28992
29176
  }
28993
- const methodAction = "update";
29177
+ if (!updateAppDEActionId) {
29178
+ throw new RuntimeModelError67(nodeModel, "\u6811\u8282\u70B9\u6CA1\u6709\u914D\u7F6E\u66F4\u65B0\u5B9E\u4F53\u884C\u4E3A");
29179
+ }
28994
29180
  const deName = calcDeCodeNameById(appDataEntityId);
28995
29181
  const tempContext = this.context.clone();
28996
29182
  tempContext[deName] = nodeData._deData.srfkey;
@@ -28999,7 +29185,7 @@ var TreeGridExController = class extends TreeController {
28999
29185
  try {
29000
29186
  res = await app.deService.exec(
29001
29187
  appDataEntityId,
29002
- methodAction,
29188
+ updateAppDEActionId,
29003
29189
  tempContext,
29004
29190
  nodeData._deData
29005
29191
  );
@@ -29260,7 +29446,7 @@ var TreeGridExColumnController = class {
29260
29446
  import {
29261
29447
  DataTypes as DataTypes5,
29262
29448
  RuntimeError as RuntimeError61,
29263
- RuntimeModelError as RuntimeModelError67
29449
+ RuntimeModelError as RuntimeModelError68
29264
29450
  } from "@ibiz-template/core";
29265
29451
  import { clone as clone29 } from "ramda";
29266
29452
  import dayjs6 from "dayjs";
@@ -29291,7 +29477,7 @@ var TreeGridExNodeColumnController = class {
29291
29477
  }
29292
29478
  );
29293
29479
  if (!nodeColumn || !nodeDataItem) {
29294
- throw new RuntimeModelError67(
29480
+ throw new RuntimeModelError68(
29295
29481
  nodeModel,
29296
29482
  "\u8282\u70B9\u6CA1\u6709\u914D\u7F6E\u5BF9\u5E94\u8868\u683C\u5217".concat(this.fieldColumn.name, "\u7684\u6570\u636E\u9879")
29297
29483
  );
@@ -29305,7 +29491,7 @@ var TreeGridExNodeColumnController = class {
29305
29491
  }
29306
29492
  );
29307
29493
  if (!nodeEditItem) {
29308
- throw new RuntimeModelError67(
29494
+ throw new RuntimeModelError68(
29309
29495
  nodeModel,
29310
29496
  "\u6CA1\u6709\u627E\u5230\u5BF9\u5E94\u8868\u683C\u5217".concat(this.fieldColumn.name, "\u7684\u7F16\u8F91\u9879\u6A21\u578B")
29311
29497
  );
@@ -29705,7 +29891,7 @@ var TreeGridExFieldColumnController = class extends TreeGridExColumnController {
29705
29891
  };
29706
29892
 
29707
29893
  // src/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-ua-column/tree-grid-ex-ua-column.controller.ts
29708
- import { RuntimeModelError as RuntimeModelError68 } from "@ibiz-template/core";
29894
+ import { RuntimeModelError as RuntimeModelError69 } from "@ibiz-template/core";
29709
29895
  var TreeGridExUAColumnController = class extends TreeGridExColumnController {
29710
29896
  /**
29711
29897
  * 给rowController初始化操作列的状态
@@ -29719,7 +29905,7 @@ var TreeGridExUAColumnController = class extends TreeGridExColumnController {
29719
29905
  const { deuiactionGroup } = this.model;
29720
29906
  if (!deuiactionGroup) {
29721
29907
  return;
29722
- throw new RuntimeModelError68(this.model, "\u64CD\u4F5C\u5217\u6CA1\u6709\u914D\u7F6E\u754C\u9762\u884C\u4E3A\u7EC4");
29908
+ throw new RuntimeModelError69(this.model, "\u64CD\u4F5C\u5217\u6CA1\u6709\u914D\u7F6E\u754C\u9762\u884C\u4E3A\u7EC4");
29723
29909
  }
29724
29910
  if (!((_a = deuiactionGroup.uiactionGroupDetails) == null ? void 0 : _a.length)) {
29725
29911
  ibiz.log.debug("\u64CD\u4F5C\u5217\u754C\u9762\u884C\u4E3A\u7EC4\u6CA1\u6709\u914D\u7F6E\u754C\u9762\u884C\u4E3A");
@@ -29773,7 +29959,7 @@ var TreeGridExUAColumnController = class extends TreeGridExColumnController {
29773
29959
  };
29774
29960
 
29775
29961
  // src/controller/control/tree-grid/tree-grid.controller.ts
29776
- import { RuntimeModelError as RuntimeModelError69 } from "@ibiz-template/core";
29962
+ import { RuntimeModelError as RuntimeModelError70 } from "@ibiz-template/core";
29777
29963
  var TreeGridController = class extends GridController {
29778
29964
  constructor() {
29779
29965
  super(...arguments);
@@ -29818,10 +30004,10 @@ var TreeGridController = class extends GridController {
29818
30004
  return item.treeColumnMode === 2 || item.treeColumnMode === 3;
29819
30005
  });
29820
30006
  if (!treeGridParent) {
29821
- throw new RuntimeModelError69(this.model, "\u6811\u8868\u683C\u65E0\u503C\u5217\u6A21\u5F0F");
30007
+ throw new RuntimeModelError70(this.model, "\u6811\u8868\u683C\u65E0\u503C\u5217\u6A21\u5F0F");
29822
30008
  }
29823
30009
  if (!treeGridValue) {
29824
- throw new RuntimeModelError69(this.model, "\u6811\u8868\u683C\u65E0\u7236\u503C\u5217\u6A21\u5F0F");
30010
+ throw new RuntimeModelError70(this.model, "\u6811\u8868\u683C\u65E0\u7236\u503C\u5217\u6A21\u5F0F");
29825
30011
  }
29826
30012
  this.treeGridValueField = treeGridValue.appDEFieldId.toLowerCase();
29827
30013
  this.treeGridParentField = treeGridParent.appDEFieldId.toLowerCase();
@@ -31546,7 +31732,7 @@ var ViewEngineBase = class {
31546
31732
  };
31547
31733
 
31548
31734
  // src/engine/md-view.engine.ts
31549
- import { RuntimeModelError as RuntimeModelError70 } from "@ibiz-template/core";
31735
+ import { RuntimeModelError as RuntimeModelError71 } from "@ibiz-template/core";
31550
31736
  import { clone as clone30 } from "ramda";
31551
31737
  var MDViewEngine = class extends ViewEngineBase {
31552
31738
  /**
@@ -31639,7 +31825,7 @@ var MDViewEngine = class extends ViewEngineBase {
31639
31825
  this.reLoad();
31640
31826
  });
31641
31827
  }
31642
- if (!this.view.state.noLoadDefault && model.loadDefault) {
31828
+ if (!this.view.state.noLoadDefault && model.loadDefault && !this.searchBar.hasDefaultSelect) {
31643
31829
  this.load();
31644
31830
  }
31645
31831
  }
@@ -31730,7 +31916,7 @@ var MDViewEngine = class extends ViewEngineBase {
31730
31916
  view: this.view
31731
31917
  }));
31732
31918
  if (result === -1) {
31733
- throw new RuntimeModelError70(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
31919
+ throw new RuntimeModelError71(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
31734
31920
  } else {
31735
31921
  return {
31736
31922
  cancel: !result.ok
@@ -31753,7 +31939,7 @@ var MDViewEngine = class extends ViewEngineBase {
31753
31939
  (item) => item.id === "newdata"
31754
31940
  );
31755
31941
  if (!openAppViewLogic) {
31756
- throw new RuntimeModelError70(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
31942
+ throw new RuntimeModelError71(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
31757
31943
  }
31758
31944
  const params = clone30(this.view.params);
31759
31945
  if (copyMode) {
@@ -31767,7 +31953,7 @@ var MDViewEngine = class extends ViewEngineBase {
31767
31953
  view: this.view
31768
31954
  }));
31769
31955
  if (result === -1) {
31770
- throw new RuntimeModelError70(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
31956
+ throw new RuntimeModelError71(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
31771
31957
  } else {
31772
31958
  return {
31773
31959
  cancel: !result.ok
@@ -31935,6 +32121,13 @@ var GlobalUtil = class {
31935
32121
  * @date 2023-09-26 05:04:26
31936
32122
  */
31937
32123
  this.error = new ErrorHandlerCenter();
32124
+ /**
32125
+ * 视图堆栈
32126
+ *
32127
+ * @author chitanda
32128
+ * @date 2024-01-18 14:01:23
32129
+ */
32130
+ this.viewStack = new ViewStack();
31938
32131
  this.error.register(new DefaultErrorHandler());
31939
32132
  }
31940
32133
  /**
@@ -32078,13 +32271,13 @@ var ScriptExecutor = class extends LogicExecutor {
32078
32271
  };
32079
32272
 
32080
32273
  // src/logic-scheduler/executor/app-de-ui-logic-executor.ts
32081
- import { RuntimeModelError as RuntimeModelError71 } from "@ibiz-template/core";
32274
+ import { RuntimeModelError as RuntimeModelError72 } from "@ibiz-template/core";
32082
32275
  var AppDEUILogicExecutor = class extends LogicExecutor {
32083
32276
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
32084
32277
  execute(executeParams) {
32085
32278
  const { appDEUILogicId, appDataEntityId } = this.logic;
32086
32279
  if (!appDEUILogicId) {
32087
- throw new RuntimeModelError71(this.logic, "\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53\u754C\u9762\u903B\u8F91");
32280
+ throw new RuntimeModelError72(this.logic, "\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53\u754C\u9762\u903B\u8F91");
32088
32281
  }
32089
32282
  execUILogic(appDEUILogicId, appDataEntityId, executeParams);
32090
32283
  }
@@ -32542,7 +32735,7 @@ var ItemDynaLogicTrigger = class extends LogicTrigger {
32542
32735
  };
32543
32736
 
32544
32737
  // src/logic-scheduler/trigger/timer-trigger.ts
32545
- import { RuntimeError as RuntimeError68, RuntimeModelError as RuntimeModelError72 } from "@ibiz-template/core";
32738
+ import { RuntimeError as RuntimeError68, RuntimeModelError as RuntimeModelError73 } from "@ibiz-template/core";
32546
32739
  var TimerTrigger = class extends LogicTrigger {
32547
32740
  constructor() {
32548
32741
  super(...arguments);
@@ -32550,7 +32743,7 @@ var TimerTrigger = class extends LogicTrigger {
32550
32743
  }
32551
32744
  start() {
32552
32745
  if (!this.logic.timer) {
32553
- throw new RuntimeModelError72(this.logic, "\u5B9A\u65F6\u5668\u7F3A\u5C11\u5B9A\u65F6\u95F4\u9694");
32746
+ throw new RuntimeModelError73(this.logic, "\u5B9A\u65F6\u5668\u7F3A\u5C11\u5B9A\u65F6\u95F4\u9694");
32554
32747
  }
32555
32748
  this.timer = setInterval(() => {
32556
32749
  if (!this.scheduler.defaultParamsCb) {
@@ -32572,7 +32765,7 @@ var TimerTrigger = class extends LogicTrigger {
32572
32765
  import {
32573
32766
  ModelError as ModelError34,
32574
32767
  RuntimeError as RuntimeError69,
32575
- RuntimeModelError as RuntimeModelError73
32768
+ RuntimeModelError as RuntimeModelError74
32576
32769
  } from "@ibiz-template/core";
32577
32770
  import { notNilEmpty as notNilEmpty9 } from "qx-util";
32578
32771
  var AppUILogicExecutor = class extends LogicExecutor {
@@ -32618,7 +32811,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
32618
32811
  } else {
32619
32812
  openViewRef = appUILogic.openDataAppView;
32620
32813
  if (!openViewRef) {
32621
- throw new RuntimeModelError73(
32814
+ throw new RuntimeModelError74(
32622
32815
  appUILogic,
32623
32816
  "opendata\u89C6\u56FE\u903B\u8F91\u6CA1\u6709\u914D\u7F6E\u9ED8\u8BA4\u6253\u5F00\u89C6\u56FE"
32624
32817
  );
@@ -32626,7 +32819,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
32626
32819
  }
32627
32820
  const openView = openViewRef.refAppViewId;
32628
32821
  if (!openView) {
32629
- throw new RuntimeModelError73(
32822
+ throw new RuntimeModelError74(
32630
32823
  appUILogic,
32631
32824
  "opendata\u89C6\u56FE\u903B\u8F91\u7684\u9ED8\u8BA4\u6253\u5F00\u89C6\u56FE\u6CA1\u6709\u5B9E\u9645\u5F15\u7528\u89C6\u56FE"
32632
32825
  );
@@ -32656,7 +32849,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
32656
32849
  );
32657
32850
  const typeFileName = appDataEntity.formTypeAppDEFieldId || appDataEntity.dataTypeAppDEFieldId;
32658
32851
  if (!typeFileName) {
32659
- throw new RuntimeModelError73(
32852
+ throw new RuntimeModelError74(
32660
32853
  appUILogic,
32661
32854
  "".concat(appDataEntity.codeName, "[\u591A\u8868\u5355\u5B9E\u4F53] or [\u7D22\u5F15\u5B9E\u4F53]\u7F3A\u5C11\u7C7B\u578B\u5C5E\u6027\u914D\u7F6E")
32662
32855
  );
@@ -32664,7 +32857,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
32664
32857
  const { data } = parameters;
32665
32858
  const formTypeValue = data[0][typeFileName];
32666
32859
  if (!formTypeValue) {
32667
- throw new RuntimeModelError73(appUILogic, "\u6570\u636E\u6E90\u65E0\u8868\u5355\u7C7B\u578B\u5E94\u7528\u5B9E\u4F53\u5C5E\u6027\u503C");
32860
+ throw new RuntimeModelError74(appUILogic, "\u6570\u636E\u6E90\u65E0\u8868\u5355\u7C7B\u578B\u5E94\u7528\u5B9E\u4F53\u5C5E\u6027\u503C");
32668
32861
  }
32669
32862
  const openViewRefs = appUILogic.openDataAppViews;
32670
32863
  const findView = openViewRefs == null ? void 0 : openViewRefs.find((item) => item.refMode === formTypeValue);
@@ -32706,7 +32899,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
32706
32899
  return viewRef.refMode.toLowerCase() !== parentDeName;
32707
32900
  });
32708
32901
  if (!newViewRef) {
32709
- throw new RuntimeModelError73(
32902
+ throw new RuntimeModelError74(
32710
32903
  appUILogic,
32711
32904
  "\u6CA1\u6709\u627E\u5230\u6279\u6DFB\u52A0\u9700\u8981\u6253\u5F00\u7684\u9009\u62E9\u89C6\u56FE"
32712
32905
  );
@@ -32716,7 +32909,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
32716
32909
  } else {
32717
32910
  newViewRef = newDataAppView;
32718
32911
  if (!newViewRef || !newViewRef.refAppViewId) {
32719
- throw new RuntimeModelError73(
32912
+ throw new RuntimeModelError74(
32720
32913
  appUILogic,
32721
32914
  "newdata\u89C6\u56FE\u903B\u8F91\u6CA1\u6709\u914D\u7F6E\u9ED8\u8BA4\u65B0\u5EFA\u6570\u636E\u89C6\u56FE"
32722
32915
  );
@@ -32780,7 +32973,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
32780
32973
  const { wizardAppView, newDataAppViews } = appUILogic;
32781
32974
  const { context, params, ...rest } = parameters;
32782
32975
  if (!wizardAppView || !wizardAppView.refAppViewId) {
32783
- throw new RuntimeModelError73(appUILogic, "\u7F3A\u5C11\u9ED8\u8BA4\u7D22\u5F15\u5B9E\u4F53\u9009\u62E9\u89C6\u56FE");
32976
+ throw new RuntimeModelError74(appUILogic, "\u7F3A\u5C11\u9ED8\u8BA4\u7D22\u5F15\u5B9E\u4F53\u9009\u62E9\u89C6\u56FE");
32784
32977
  }
32785
32978
  const result = await ibiz.commands.execute(
32786
32979
  OpenAppViewCommand.TAG,
@@ -32831,7 +33024,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
32831
33024
  const minorDERs = selfDe.minorAppDERSs;
32832
33025
  const pickParentDeName = newViewRef.refMode.toLowerCase();
32833
33026
  if (!minorDERs) {
32834
- throw new RuntimeModelError73(selfDe, "\u5B9E\u4F53\u6CA1\u6709\u4ECE\u5173\u7CFB\u96C6\u5408\uFF01");
33027
+ throw new RuntimeModelError74(selfDe, "\u5B9E\u4F53\u6CA1\u6709\u4ECE\u5173\u7CFB\u96C6\u5408\uFF01");
32835
33028
  }
32836
33029
  let pickParentFieldName = "";
32837
33030
  minorDERs == null ? void 0 : minorDERs.forEach((item) => {
@@ -32928,12 +33121,12 @@ var ControlEventTrigger = class extends LogicTrigger {
32928
33121
  };
32929
33122
 
32930
33123
  // src/logic-scheduler/executor/app-ui-action-executor.ts
32931
- import { RuntimeModelError as RuntimeModelError74 } from "@ibiz-template/core";
33124
+ import { RuntimeModelError as RuntimeModelError75 } from "@ibiz-template/core";
32932
33125
  var AppDEUIActionExecutor = class extends LogicExecutor {
32933
33126
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
32934
33127
  execute(executeParams) {
32935
33128
  if (!this.logic.appDEUIActionId) {
32936
- throw new RuntimeModelError74(
33129
+ throw new RuntimeModelError75(
32937
33130
  this.logic,
32938
33131
  "\u903B\u8F91\u4E2D\u7F3A\u5C11\u89E6\u53D1\u5E94\u7528\u5B9E\u4F53\u754C\u9762\u884C\u4E3Aid"
32939
33132
  );
@@ -33318,6 +33511,7 @@ export {
33318
33511
  ViewLayoutPanelController,
33319
33512
  ViewMode,
33320
33513
  ViewPortletController,
33514
+ ViewStack,
33321
33515
  ViewType,
33322
33516
  WFStepTraceViewController,
33323
33517
  WFWithdrawUIActionProvider,