@ibiz-template/runtime 0.5.3-beta.1 → 0.5.3-beta.10

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 (188) hide show
  1. package/dist/index.esm.js +1855 -648
  2. package/dist/index.system.min.js +1 -1
  3. package/out/app-hub.d.ts +12 -2
  4. package/out/app-hub.d.ts.map +1 -1
  5. package/out/app-hub.js +22 -2
  6. package/out/application.js +1 -1
  7. package/out/command/app/open-app-view/open-app-view.d.ts.map +1 -1
  8. package/out/command/app/open-app-view/open-app-view.js +8 -1
  9. package/out/controller/common/editor/editor.controller.d.ts +24 -0
  10. package/out/controller/common/editor/editor.controller.d.ts.map +1 -1
  11. package/out/controller/common/editor/editor.controller.js +50 -0
  12. package/out/controller/common/view/view.controller.d.ts.map +1 -1
  13. package/out/controller/common/view/view.controller.js +3 -2
  14. package/out/controller/constant/control/index.d.ts +1 -0
  15. package/out/controller/constant/control/index.d.ts.map +1 -1
  16. package/out/controller/constant/control/index.js +1 -0
  17. package/out/controller/constant/control/tree-grid-ex/tree-grid-ex-notify.state.d.ts +5 -0
  18. package/out/controller/constant/control/tree-grid-ex/tree-grid-ex-notify.state.d.ts.map +1 -0
  19. package/out/controller/constant/control/tree-grid-ex/tree-grid-ex-notify.state.js +6 -0
  20. package/out/controller/control/chart/chart.controller.js +1 -1
  21. package/out/controller/control/form/form/form.controller.d.ts.map +1 -1
  22. package/out/controller/control/form/form/form.controller.js +4 -1
  23. package/out/controller/control/form/form-detail/form-detail/form-detail.controller.d.ts.map +1 -1
  24. package/out/controller/control/form/form-detail/form-detail/form-detail.controller.js +4 -0
  25. package/out/controller/control/form/form-detail/form-tab-page/form-tab-page.controller.d.ts +8 -0
  26. package/out/controller/control/form/form-detail/form-tab-page/form-tab-page.controller.d.ts.map +1 -1
  27. package/out/controller/control/form/form-detail/form-tab-page/form-tab-page.controller.js +10 -0
  28. package/out/controller/control/form/form-detail/form-tab-panel/form-tab-panel.controller.d.ts +8 -0
  29. package/out/controller/control/form/form-detail/form-tab-panel/form-tab-panel.controller.d.ts.map +1 -1
  30. package/out/controller/control/form/form-detail/form-tab-panel/form-tab-panel.controller.js +15 -0
  31. package/out/controller/control/form/form-detail/form-tab-panel/form-tab-panel.state.d.ts +7 -0
  32. package/out/controller/control/form/form-detail/form-tab-panel/form-tab-panel.state.d.ts.map +1 -1
  33. package/out/controller/control/form/form-detail/form-tab-panel/form-tab-panel.state.js +10 -0
  34. package/out/controller/control/grid/grid/grid.service.d.ts.map +1 -1
  35. package/out/controller/control/grid/grid/grid.service.js +1 -10
  36. package/out/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.d.ts +7 -0
  37. package/out/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.d.ts.map +1 -1
  38. package/out/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.js +11 -2
  39. package/out/controller/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.controller.d.ts +0 -7
  40. package/out/controller/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.controller.d.ts.map +1 -1
  41. package/out/controller/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.controller.js +0 -9
  42. package/out/controller/control/tree-grid-ex/tree-grid-ex-column/index.d.ts +1 -0
  43. package/out/controller/control/tree-grid-ex/tree-grid-ex-column/index.d.ts.map +1 -1
  44. package/out/controller/control/tree-grid-ex/tree-grid-ex-column/index.js +1 -0
  45. package/out/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-column/tree-grid-ex-column.controller.d.ts +10 -0
  46. package/out/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-column/tree-grid-ex-column.controller.d.ts.map +1 -1
  47. package/out/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-column/tree-grid-ex-column.controller.js +12 -0
  48. package/out/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-field-column/tree-grid-ex-field-column.controller.d.ts +34 -0
  49. package/out/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-field-column/tree-grid-ex-field-column.controller.d.ts.map +1 -1
  50. package/out/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-field-column/tree-grid-ex-field-column.controller.js +68 -0
  51. package/out/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-field-column/tree-grid-ex-node-column.controller.d.ts +205 -0
  52. package/out/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-field-column/tree-grid-ex-node-column.controller.d.ts.map +1 -0
  53. package/out/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-field-column/tree-grid-ex-node-column.controller.js +345 -0
  54. package/out/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-ua-column/tree-grid-ex-ua-column.controller.d.ts +3 -0
  55. package/out/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-ua-column/tree-grid-ex-ua-column.controller.d.ts.map +1 -1
  56. package/out/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-ua-column/tree-grid-ex-ua-column.controller.js +14 -1
  57. package/out/controller/control/tree-grid-ex/tree-grid-ex-row.state.d.ts +16 -8
  58. package/out/controller/control/tree-grid-ex/tree-grid-ex-row.state.d.ts.map +1 -1
  59. package/out/controller/control/tree-grid-ex/tree-grid-ex-row.state.js +26 -12
  60. package/out/controller/control/tree-grid-ex/tree-grid-ex.controller.d.ts +59 -0
  61. package/out/controller/control/tree-grid-ex/tree-grid-ex.controller.d.ts.map +1 -1
  62. package/out/controller/control/tree-grid-ex/tree-grid-ex.controller.js +238 -1
  63. package/out/de-logic/utils/handle-src-val.d.ts +15 -0
  64. package/out/de-logic/utils/handle-src-val.d.ts.map +1 -1
  65. package/out/de-logic/utils/handle-src-val.js +10 -1
  66. package/out/interface/common/i-app-hub-service/i-app-hub-service.d.ts +4 -3
  67. package/out/interface/common/i-app-hub-service/i-app-hub-service.d.ts.map +1 -1
  68. package/out/interface/controller/controller/control/i-tree-grid-ex.controller.d.ts +23 -1
  69. package/out/interface/controller/controller/control/i-tree-grid-ex.controller.d.ts.map +1 -1
  70. package/out/interface/controller/event/control/i-tree-grid-ex.event.d.ts +17 -0
  71. package/out/interface/controller/event/control/i-tree-grid-ex.event.d.ts.map +1 -1
  72. package/out/interface/controller/state/control/i-tree-grid-ex.state.d.ts +60 -2
  73. package/out/interface/controller/state/control/i-tree-grid-ex.state.d.ts.map +1 -1
  74. package/out/interface/provider/i-async-action.provider.d.ts +3 -2
  75. package/out/interface/provider/i-async-action.provider.d.ts.map +1 -1
  76. package/out/interface/service/i-transaction/i-transaction.d.ts +83 -0
  77. package/out/interface/service/i-transaction/i-transaction.d.ts.map +1 -0
  78. package/out/interface/service/i-transaction/i-transaction.js +1 -0
  79. package/out/interface/service/index.d.ts +1 -0
  80. package/out/interface/service/index.d.ts.map +1 -1
  81. package/out/interface/service/service/i-app-de.service.d.ts +9 -3
  82. package/out/interface/service/service/i-app-de.service.d.ts.map +1 -1
  83. package/out/plugin/index.d.ts +1 -1
  84. package/out/plugin/index.d.ts.map +1 -1
  85. package/out/plugin/remote-plugin-item/remote-plugin-item.d.ts +46 -0
  86. package/out/plugin/remote-plugin-item/remote-plugin-item.d.ts.map +1 -1
  87. package/out/register/helper/app-menu-item-register.d.ts.map +1 -1
  88. package/out/register/helper/app-menu-item-register.js +1 -6
  89. package/out/register/helper/panel-item-register.d.ts.map +1 -1
  90. package/out/register/helper/panel-item-register.js +36 -30
  91. package/out/service/dto/method.dto.d.ts +1 -12
  92. package/out/service/dto/method.dto.d.ts.map +1 -1
  93. package/out/service/dto/method.dto.js +8 -20
  94. package/out/service/mqtt/mqtt.service.js +2 -2
  95. package/out/service/service/auth/v7-auth.service.d.ts.map +1 -1
  96. package/out/service/service/auth/v7-auth.service.js +2 -0
  97. package/out/service/service/entity/de.service.d.ts +1 -2
  98. package/out/service/service/entity/de.service.d.ts.map +1 -1
  99. package/out/service/service/entity/de.service.js +5 -2
  100. package/out/service/service/entity/method/de-action.d.ts +13 -1
  101. package/out/service/service/entity/method/de-action.d.ts.map +1 -1
  102. package/out/service/service/entity/method/de-action.js +167 -59
  103. package/out/service/service/entity/method/fetch.d.ts.map +1 -1
  104. package/out/service/service/entity/method/fetch.js +24 -21
  105. package/out/service/service/entity/method/method-renturn.d.ts.map +1 -1
  106. package/out/service/service/entity/method/method-renturn.js +6 -0
  107. package/out/service/utils/de-cache/de-cache.d.ts +11 -1
  108. package/out/service/utils/de-cache/de-cache.d.ts.map +1 -1
  109. package/out/service/utils/de-cache/de-cache.js +122 -18
  110. package/out/service/utils/de-dq-cond/ps-model-cond-engine-base.d.ts.map +1 -1
  111. package/out/service/utils/de-dq-cond/ps-model-cond-engine-base.js +4 -0
  112. package/out/service/utils/dynamic-code-list/dynamic-code-list.d.ts +1 -1
  113. package/out/service/utils/dynamic-code-list/dynamic-code-list.d.ts.map +1 -1
  114. package/out/service/utils/dynamic-code-list/dynamic-code-list.js +25 -26
  115. package/out/service/utils/res-path/res-path.d.ts +2 -2
  116. package/out/service/utils/res-path/res-path.d.ts.map +1 -1
  117. package/out/service/utils/res-path/res-path.js +1 -1
  118. package/out/service/vo/tree-node-data/tree-data-set-node-data.d.ts +6 -0
  119. package/out/service/vo/tree-node-data/tree-data-set-node-data.d.ts.map +1 -1
  120. package/out/service/vo/tree-node-data/tree-data-set-node-data.js +93 -41
  121. package/out/ui-action/provider/front-ui-action-provider.d.ts +1 -1
  122. package/out/ui-action/provider/front-ui-action-provider.d.ts.map +1 -1
  123. package/out/ui-action/provider/front-ui-action-provider.js +5 -1
  124. package/out/ui-logic/ui-logic-node/debug-param-node/debug-param-node.js +1 -1
  125. package/out/ui-logic/ui-logic-node/raw-js-code-node/raw-js-code-node.d.ts.map +1 -1
  126. package/out/ui-logic/ui-logic-node/raw-js-code-node/raw-js-code-node.js +0 -1
  127. package/out/utils/script/script-function.js +1 -1
  128. package/out/utils/ui-domain/transaction.d.ts +66 -0
  129. package/out/utils/ui-domain/transaction.d.ts.map +1 -0
  130. package/out/utils/ui-domain/transaction.js +94 -0
  131. package/out/utils/ui-domain/ui-domain.d.ts +50 -6
  132. package/out/utils/ui-domain/ui-domain.d.ts.map +1 -1
  133. package/out/utils/ui-domain/ui-domain.js +68 -9
  134. package/package.json +5 -5
  135. package/src/app-hub.ts +27 -2
  136. package/src/application.ts +1 -1
  137. package/src/command/app/open-app-view/open-app-view.ts +8 -1
  138. package/src/controller/common/editor/editor.controller.ts +54 -0
  139. package/src/controller/common/view/view.controller.ts +3 -2
  140. package/src/controller/constant/control/index.ts +1 -0
  141. package/src/controller/constant/control/tree-grid-ex/tree-grid-ex-notify.state.ts +5 -0
  142. package/src/controller/control/chart/chart.controller.ts +1 -1
  143. package/src/controller/control/form/form/form.controller.ts +11 -1
  144. package/src/controller/control/form/form-detail/form-detail/form-detail.controller.ts +4 -0
  145. package/src/controller/control/form/form-detail/form-tab-page/form-tab-page.controller.ts +14 -0
  146. package/src/controller/control/form/form-detail/form-tab-panel/form-tab-panel.controller.ts +16 -0
  147. package/src/controller/control/form/form-detail/form-tab-panel/form-tab-panel.state.ts +9 -1
  148. package/src/controller/control/grid/grid/grid.service.ts +1 -11
  149. package/src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts +12 -2
  150. package/src/controller/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.controller.ts +0 -10
  151. package/src/controller/control/tree-grid-ex/tree-grid-ex-column/index.ts +1 -0
  152. package/src/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-column/tree-grid-ex-column.controller.ts +22 -0
  153. package/src/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-field-column/tree-grid-ex-field-column.controller.ts +88 -2
  154. package/src/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-field-column/tree-grid-ex-node-column.controller.ts +522 -0
  155. package/src/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-ua-column/tree-grid-ex-ua-column.controller.ts +18 -1
  156. package/src/controller/control/tree-grid-ex/tree-grid-ex-row.state.ts +43 -12
  157. package/src/controller/control/tree-grid-ex/tree-grid-ex.controller.ts +296 -1
  158. package/src/de-logic/utils/handle-src-val.ts +29 -1
  159. package/src/interface/common/i-app-hub-service/i-app-hub-service.ts +4 -3
  160. package/src/interface/controller/controller/control/i-tree-grid-ex.controller.ts +27 -2
  161. package/src/interface/controller/event/control/i-tree-grid-ex.event.ts +15 -1
  162. package/src/interface/controller/state/control/i-tree-grid-ex.state.ts +64 -2
  163. package/src/interface/provider/i-async-action.provider.ts +3 -2
  164. package/src/interface/service/i-transaction/i-transaction.ts +88 -0
  165. package/src/interface/service/index.ts +4 -0
  166. package/src/interface/service/service/i-app-de.service.ts +10 -3
  167. package/src/plugin/index.ts +4 -1
  168. package/src/plugin/remote-plugin-item/remote-plugin-item.ts +43 -0
  169. package/src/register/helper/app-menu-item-register.ts +1 -5
  170. package/src/register/helper/panel-item-register.ts +43 -37
  171. package/src/service/dto/method.dto.ts +7 -20
  172. package/src/service/mqtt/mqtt.service.ts +2 -2
  173. package/src/service/service/auth/v7-auth.service.ts +2 -0
  174. package/src/service/service/entity/de.service.ts +7 -9
  175. package/src/service/service/entity/method/de-action.ts +186 -64
  176. package/src/service/service/entity/method/fetch.ts +28 -29
  177. package/src/service/service/entity/method/method-renturn.ts +6 -0
  178. package/src/service/utils/de-cache/de-cache.ts +128 -19
  179. package/src/service/utils/de-dq-cond/ps-model-cond-engine-base.ts +4 -0
  180. package/src/service/utils/dynamic-code-list/dynamic-code-list.ts +24 -32
  181. package/src/service/utils/res-path/res-path.ts +2 -2
  182. package/src/service/vo/tree-node-data/tree-data-set-node-data.ts +111 -46
  183. package/src/ui-action/provider/front-ui-action-provider.ts +10 -1
  184. package/src/ui-logic/ui-logic-node/debug-param-node/debug-param-node.ts +1 -1
  185. package/src/ui-logic/ui-logic-node/raw-js-code-node/raw-js-code-node.ts +0 -1
  186. package/src/utils/script/script-function.ts +1 -1
  187. package/src/utils/ui-domain/transaction.ts +100 -0
  188. package/src/utils/ui-domain/ui-domain.ts +73 -9
package/dist/index.esm.js CHANGED
@@ -1501,7 +1501,7 @@ var ScriptFunction = class {
1501
1501
  try {
1502
1502
  return fn.apply({}, args);
1503
1503
  } catch (error) {
1504
- console.log("\u62A5\u9519\u811A\u672C", code);
1504
+ ibiz.log.error("\u62A5\u9519\u811A\u672C", code);
1505
1505
  throw error;
1506
1506
  }
1507
1507
  };
@@ -2850,6 +2850,95 @@ var ThemeUtil = class {
2850
2850
 
2851
2851
  // src/utils/ui-domain/ui-domain.ts
2852
2852
  import { createUUID } from "qx-util";
2853
+
2854
+ // src/utils/ui-domain/transaction.ts
2855
+ var Transaction = class {
2856
+ constructor() {
2857
+ /**
2858
+ * 待提交队列
2859
+ *
2860
+ * @author chitanda
2861
+ * @date 2024-01-17 15:01:38
2862
+ * @protected
2863
+ */
2864
+ this.commitQueue = /* @__PURE__ */ new Map();
2865
+ /**
2866
+ * 事务状态
2867
+ *
2868
+ * @author chitanda
2869
+ * @date 2024-01-17 15:01:45
2870
+ * @type {ITransactionState}
2871
+ */
2872
+ this.state = {
2873
+ isOpen: false,
2874
+ isChange: false
2875
+ };
2876
+ }
2877
+ /**
2878
+ * 开启事务
2879
+ *
2880
+ * @description 事务开启后,所有的数据操作都会被缓存,直到事务提交或者回滚
2881
+ * @author chitanda
2882
+ * @date 2024-01-17 15:01:46
2883
+ */
2884
+ open() {
2885
+ if (this.state.isOpen) {
2886
+ ibiz.log.warn("\u4E8B\u52A1\u5DF2\u7ECF\u5F00\u542F, \u5355\u4E2A\u754C\u9762\u57DF\u53EA\u80FD\u5F00\u542F\u4E00\u4E2A\u4E8B\u52A1");
2887
+ return;
2888
+ }
2889
+ this.state.isOpen = true;
2890
+ }
2891
+ /**
2892
+ * 新增变更事务回调,事务提交时会按照添加顺序倒序执行
2893
+ *
2894
+ * @author chitanda
2895
+ * @date 2024-01-17 16:01:50
2896
+ * @param {string} id 回调标识,用于去重。一个数据只能有一个回调
2897
+ * @param {() => void} commit
2898
+ */
2899
+ change(id, commit) {
2900
+ this.state.isChange = true;
2901
+ this.commitQueue.set(id, commit);
2902
+ }
2903
+ /**
2904
+ * 提交事务
2905
+ *
2906
+ * @author chitanda
2907
+ * @date 2024-01-17 15:01:05
2908
+ */
2909
+ commit() {
2910
+ const commitQueue = Array.from(this.commitQueue.values()).reverse();
2911
+ for (const commit of commitQueue) {
2912
+ commit();
2913
+ }
2914
+ this.commitQueue.clear();
2915
+ this.state.isChange = false;
2916
+ }
2917
+ /**
2918
+ * 回滚事务
2919
+ *
2920
+ * @author chitanda
2921
+ * @date 2024-01-17 19:01:43
2922
+ */
2923
+ rollback() {
2924
+ this.commitQueue.clear();
2925
+ this.state.isChange = false;
2926
+ }
2927
+ /**
2928
+ * 关闭事务
2929
+ *
2930
+ * @author chitanda
2931
+ * @date 2024-01-17 15:01:02
2932
+ */
2933
+ close() {
2934
+ if (this.state.isChange) {
2935
+ throw new Error("\u5F53\u524D\u4E8B\u52A1\u672A\u63D0\u4EA4\uFF0C\u4E0D\u53EF\u4EE5\u76F4\u63A5\u5173\u95ED\u4E8B\u52A1");
2936
+ }
2937
+ this.state.isOpen = false;
2938
+ }
2939
+ };
2940
+
2941
+ // src/utils/ui-domain/ui-domain.ts
2853
2942
  var UIDomain = class {
2854
2943
  /**
2855
2944
  * Creates an instance of UIDomain.
@@ -2861,14 +2950,39 @@ var UIDomain = class {
2861
2950
  */
2862
2951
  constructor(id) {
2863
2952
  /**
2864
- * DTO 父子关系映射
2953
+ * 状态
2954
+ *
2955
+ * @author chitanda
2956
+ * @date 2024-01-15 19:01:51
2957
+ * @type {{ rsInit: boolean }} 关系是否已经初始化
2958
+ */
2959
+ this.state = { rsInit: false };
2960
+ /**
2961
+ * DTO 子父关系映射
2865
2962
  *
2866
2963
  * @author chitanda
2867
2964
  * @date 2023-12-26 15:12:13
2868
2965
  * @protected
2869
- * @type {Map<string, IAppDERS[]>}
2966
+ * @type {Map<string, IAppDERS[]>} Map<子实体, 当前实体的父关系>
2870
2967
  */
2871
2968
  this.rsMap = /* @__PURE__ */ new Map();
2969
+ /**
2970
+ * DTO 父子关系映射
2971
+ *
2972
+ * @author chitanda
2973
+ * @date 2024-01-15 17:01:42
2974
+ * @protected
2975
+ * @type {Map<string, IAppDERS[]>}
2976
+ */
2977
+ this.rs2Map = /* @__PURE__ */ new Map();
2978
+ /**
2979
+ * 当前界面域下唯一事务
2980
+ *
2981
+ * @author chitanda
2982
+ * @date 2024-01-17 15:01:07
2983
+ * @type {Transaction}
2984
+ */
2985
+ this.transaction = new Transaction();
2872
2986
  if (id) {
2873
2987
  this.id = id;
2874
2988
  } else {
@@ -2880,26 +2994,59 @@ var UIDomain = class {
2880
2994
  *
2881
2995
  * @author chitanda
2882
2996
  * @date 2023-12-26 15:12:31
2883
- * @param {string} entity
2997
+ * @param {string} appDataEntityId
2884
2998
  * @param {IAppDERS} configs
2885
2999
  */
2886
- setDERConfig(deCodeName, configs) {
2887
- this.rsMap.set(deCodeName, configs);
3000
+ setDERConfig(appDataEntityId, configs) {
3001
+ this.rsMap.set(appDataEntityId, configs);
2888
3002
  }
2889
3003
  /**
2890
3004
  * 获取当前界面域下,具体实体的关系(在数据加载完成之后才有值)
2891
3005
  *
2892
3006
  * @author chitanda
2893
3007
  * @date 2023-12-26 16:12:07
2894
- * @param {string} deCodeName
3008
+ * @param {string} appDataEntityId
3009
+ * @return {*} {IAppDERS[]}
3010
+ */
3011
+ getDERConfig(appDataEntityId) {
3012
+ if (this.rsMap.has(appDataEntityId)) {
3013
+ return this.rsMap.get(appDataEntityId);
3014
+ }
3015
+ return [];
3016
+ }
3017
+ /**
3018
+ * 查询指定主实体下的所有子实体关系
3019
+ *
3020
+ * @author chitanda
3021
+ * @date 2024-01-17 16:01:21
3022
+ * @param {string} appDataEntityId
2895
3023
  * @return {*} {IAppDERS[]}
2896
3024
  */
2897
- getDERConfig(deCodeName) {
2898
- if (this.rsMap.has(deCodeName)) {
2899
- return this.rsMap.get(deCodeName);
3025
+ getDERConfigByMajor(appDataEntityId) {
3026
+ if (this.rs2Map.has(appDataEntityId)) {
3027
+ return this.rs2Map.get(appDataEntityId);
2900
3028
  }
2901
3029
  return [];
2902
3030
  }
3031
+ /**
3032
+ * 根据模型给的子实体中的父关系模型,计算每个实体的子关系模型
3033
+ *
3034
+ * @author chitanda
3035
+ * @date 2024-01-15 19:01:49
3036
+ */
3037
+ calcParentRs() {
3038
+ this.rs2Map.clear();
3039
+ this.rsMap.forEach((configs, appDataEntityId) => {
3040
+ configs.forEach((config) => {
3041
+ config.minorAppDataEntityId = appDataEntityId;
3042
+ const major = config.majorAppDataEntityId;
3043
+ if (!this.rs2Map.has(major)) {
3044
+ this.rs2Map.set(major, []);
3045
+ }
3046
+ this.rs2Map.get(major).push(config);
3047
+ });
3048
+ });
3049
+ }
2903
3050
  /**
2904
3051
  * 界面域销毁
2905
3052
  *
@@ -3028,7 +3175,7 @@ async function handleAllSettled(values, isThrow = true) {
3028
3175
 
3029
3176
  // src/command/app/open-app-view/open-app-view.ts
3030
3177
  import { ModelError as ModelError15, RuntimeError as RuntimeError23 } from "@ibiz-template/core";
3031
- import { clone as clone15 } from "ramda";
3178
+ import { clone as clone17 } from "ramda";
3032
3179
 
3033
3180
  // src/service/utils/de-dq-cond/ps-de-dq-cond-engine.ts
3034
3181
  import { isEmpty as isEmpty3 } from "ramda";
@@ -3077,6 +3224,9 @@ var PSModelCondEngineBase = class {
3077
3224
  return objValue != null;
3078
3225
  }
3079
3226
  if ("EQ" /* CONDOP_EQ */ === strCondOp || "ABSEQ" /* CONDOP_ABSEQ */ === strCondOp || "GT" /* CONDOP_GT */ === strCondOp || "GTANDEQ" /* CONDOP_GTANDEQ */ === strCondOp || "LT" /* CONDOP_LT */ === strCondOp || "LTANDEQ" /* CONDOP_LTANDEQ */ === strCondOp || "NOTEQ" /* CONDOP_NOTEQ */ === strCondOp) {
3227
+ if (objValue == null || objCondValue == null) {
3228
+ return false;
3229
+ }
3080
3230
  let nRet = -1;
3081
3231
  if (objValue == objCondValue) {
3082
3232
  nRet = 0;
@@ -3652,7 +3802,7 @@ function getProvider6(key) {
3652
3802
  async function getPanelItemProvider(model) {
3653
3803
  var _a;
3654
3804
  let provider;
3655
- const { itemType, sysPFPluginId, appId: appId2 } = model;
3805
+ const { itemType, sysPFPluginId, appId: appId2, controlRenders } = model;
3656
3806
  if (sysPFPluginId) {
3657
3807
  const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId2);
3658
3808
  if (pluginKey) {
@@ -3664,41 +3814,45 @@ async function getPanelItemProvider(model) {
3664
3814
  return provider;
3665
3815
  }
3666
3816
  }
3667
- if (itemType === "CONTAINER") {
3668
- const predefinedType = model.predefinedType || "DEFAULT";
3669
- const key = "CONTAINER_".concat(predefinedType);
3670
- provider = getProvider6(key);
3671
- if (!provider) {
3672
- ibiz.log.error(
3673
- "\u627E\u4E0D\u5230\u9762\u677F\u5BB9\u5668\u9884\u7F6E\u7C7B\u578B\u4E3A".concat(predefinedType, "\u7684\u9002\u914D\u5668\uFF0C\u6CE8\u518Ckey\u4E3A").concat(key)
3674
- );
3675
- } else {
3676
- return provider;
3677
- }
3678
- }
3679
- if (itemType === "RAWITEM") {
3680
- const predefinedType = ((_a = model.rawItem) == null ? void 0 : _a.predefinedType) || "DEFAULT";
3681
- const key = "RAWITEM_".concat(predefinedType);
3682
- provider = getProvider6(key);
3683
- if (!provider) {
3684
- ibiz.log.error(
3685
- "\u627E\u4E0D\u5230\u9762\u677F\u6210\u5458\u76F4\u63A5\u5185\u5BB9\u9884\u7F6E\u7C7B\u578B\u4E3A".concat(predefinedType, "\u7684\u9002\u914D\u5668\uFF0C\u6CE8\u518Ckey\u4E3A").concat(key)
3686
- );
3687
- } else {
3688
- return provider;
3817
+ if (controlRenders && controlRenders.length > 0) {
3818
+ provider = getProvider6("PREDEFINE_RENDER");
3819
+ } else {
3820
+ if (itemType === "CONTAINER") {
3821
+ const predefinedType = model.predefinedType || "DEFAULT";
3822
+ const key = "CONTAINER_".concat(predefinedType);
3823
+ provider = getProvider6(key);
3824
+ if (!provider) {
3825
+ ibiz.log.error(
3826
+ "\u627E\u4E0D\u5230\u9762\u677F\u5BB9\u5668\u9884\u7F6E\u7C7B\u578B\u4E3A".concat(predefinedType, "\u7684\u9002\u914D\u5668\uFF0C\u6CE8\u518Ckey\u4E3A").concat(key)
3827
+ );
3828
+ } else {
3829
+ return provider;
3830
+ }
3689
3831
  }
3690
- }
3691
- if (itemType === "FIELD") {
3692
- const { editor } = model;
3693
- if (editor && editor.predefinedType) {
3694
- const key = "FIELD_".concat(editor.predefinedType.toUpperCase());
3832
+ if (itemType === "RAWITEM") {
3833
+ const predefinedType = ((_a = model.rawItem) == null ? void 0 : _a.predefinedType) || "DEFAULT";
3834
+ const key = "RAWITEM_".concat(predefinedType);
3695
3835
  provider = getProvider6(key);
3696
- if (provider) {
3836
+ if (!provider) {
3837
+ ibiz.log.error(
3838
+ "\u627E\u4E0D\u5230\u9762\u677F\u6210\u5458\u76F4\u63A5\u5185\u5BB9\u9884\u7F6E\u7C7B\u578B\u4E3A".concat(predefinedType, "\u7684\u9002\u914D\u5668\uFF0C\u6CE8\u518Ckey\u4E3A").concat(key)
3839
+ );
3840
+ } else {
3697
3841
  return provider;
3698
3842
  }
3699
3843
  }
3844
+ if (itemType === "FIELD") {
3845
+ const { editor } = model;
3846
+ if (editor && editor.predefinedType) {
3847
+ const key = "FIELD_".concat(editor.predefinedType.toUpperCase());
3848
+ provider = getProvider6(key);
3849
+ if (provider) {
3850
+ return provider;
3851
+ }
3852
+ }
3853
+ }
3854
+ provider = getProvider6(itemType);
3700
3855
  }
3701
- provider = getProvider6(itemType);
3702
3856
  if (!provider) {
3703
3857
  ibiz.log.error("\u627E\u4E0D\u5230\u9762\u677F\u6210\u5458\u7C7B\u578B".concat(itemType, "\u5BF9\u5E94\u7684\u9002\u914D\u5668"));
3704
3858
  } else {
@@ -4050,11 +4204,7 @@ async function getAppMenuItemProvider(model) {
4050
4204
  }
4051
4205
  }
4052
4206
  provider = getProvider14(itemType);
4053
- if (!provider) {
4054
- ibiz.log.error("\u627E\u4E0D\u5230\u5E94\u7528\u83DC\u5355\u9879\u7C7B\u578B".concat(itemType, "\u5BF9\u5E94\u7684\u9002\u914D\u5668"));
4055
- } else {
4056
- return provider;
4057
- }
4207
+ return provider;
4058
4208
  }
4059
4209
 
4060
4210
  // src/service/utils/app-counter/app-counter.ts
@@ -4532,16 +4682,16 @@ var DynamicCodeListCache = class {
4532
4682
  );
4533
4683
  let resultItems = [];
4534
4684
  if (res.data.length) {
4535
- res.data.forEach((item) => {
4536
- if (pvalueAppDEFieldId) {
4537
- const tempItems = this.prepareTreeData(res.data);
4538
- if (tempItems) {
4539
- resultItems = tempItems;
4540
- }
4541
- } else {
4542
- resultItems.push(this.convertData(item));
4685
+ if (pvalueAppDEFieldId) {
4686
+ const tempItems = this.prepareTreeData(res.data);
4687
+ if (tempItems) {
4688
+ resultItems = tempItems;
4543
4689
  }
4544
- });
4690
+ } else {
4691
+ res.data.forEach((item) => {
4692
+ resultItems.push(this.convertData(item));
4693
+ });
4694
+ }
4545
4695
  }
4546
4696
  return Object.freeze(resultItems);
4547
4697
  }
@@ -4550,26 +4700,23 @@ var DynamicCodeListCache = class {
4550
4700
  *
4551
4701
  * @return {codeListItem[] | undefined}
4552
4702
  */
4553
- prepareTreeData(items, pValue) {
4554
- const { pvalueAppDEFieldId } = this.codeList;
4555
- let filteredData = [];
4556
- filteredData = items.filter((item) => {
4557
- if (pValue) {
4558
- return item[pvalueAppDEFieldId] === pValue;
4703
+ prepareTreeData(items) {
4704
+ const { valueAppDEFieldId, pvalueAppDEFieldId } = this.codeList;
4705
+ const map = {};
4706
+ const nestedList = [];
4707
+ items.forEach((data) => {
4708
+ map[data[valueAppDEFieldId]] = this.convertData(data);
4709
+ });
4710
+ items.forEach((data) => {
4711
+ const parent = map[data[pvalueAppDEFieldId]];
4712
+ if (parent) {
4713
+ parent.children = parent.children || [];
4714
+ parent.children.push(map[data[valueAppDEFieldId]]);
4715
+ } else {
4716
+ nestedList.push(map[data[valueAppDEFieldId]]);
4559
4717
  }
4560
- return !item[pvalueAppDEFieldId];
4561
- });
4562
- if (filteredData.length === 0) {
4563
- return;
4564
- }
4565
- return filteredData.map((data) => {
4566
- const tempCodeListItem = this.convertData(data);
4567
- tempCodeListItem.children = this.prepareTreeData(
4568
- items,
4569
- tempCodeListItem.value
4570
- );
4571
- return tempCodeListItem;
4572
4718
  });
4719
+ return nestedList;
4573
4720
  }
4574
4721
  /**
4575
4722
  * 获取动态的代码项
@@ -4729,8 +4876,18 @@ var DECache = class {
4729
4876
  entity.srfkey = createUUID2();
4730
4877
  }
4731
4878
  entity.srftempdate = (/* @__PURE__ */ new Date()).getTime();
4732
- this.cacheMap.set(entity.srfkey, clone4(entity));
4733
- ibiz.log.warn("add", entity.srfkey, entity);
4879
+ const commit = () => {
4880
+ this.cacheMap.set(entity.srfkey, clone4(entity));
4881
+ ibiz.log.warn("add", entity.srfkey, entity);
4882
+ };
4883
+ const t = this.getTransaction(context);
4884
+ if (t) {
4885
+ t.change(entity.srfkey, () => {
4886
+ commit();
4887
+ });
4888
+ } else {
4889
+ commit();
4890
+ }
4734
4891
  return entity;
4735
4892
  } catch (err) {
4736
4893
  ibiz.log.error(err);
@@ -4780,10 +4937,25 @@ var DECache = class {
4780
4937
  entity.srftempdate = (/* @__PURE__ */ new Date()).getTime();
4781
4938
  const data = this.cacheMap.get(oldKey);
4782
4939
  if (data) {
4783
- data.assign(entity);
4784
- this.cacheMap.set(oldKey, data);
4785
- ibiz.log.warn("update", oldKey, entity);
4786
- return clone4(data);
4940
+ const _data = clone4(data);
4941
+ _data.assign(entity);
4942
+ const commit = () => {
4943
+ data.assign(entity);
4944
+ if (oldKey !== entity.srfkey) {
4945
+ this.cacheMap.delete(oldKey);
4946
+ }
4947
+ this.cacheMap.set(entity.srfkey, data);
4948
+ ibiz.log.warn("update", entity.srfkey, entity);
4949
+ };
4950
+ const t = this.getTransaction(context);
4951
+ if (t) {
4952
+ t.change(entity.srfkey, () => {
4953
+ commit();
4954
+ });
4955
+ } else {
4956
+ commit();
4957
+ }
4958
+ return _data;
4787
4959
  }
4788
4960
  throw new Error("\u6570\u636E\u4E0D\u5B58\u5728\uFF0C\u65E0\u6CD5\u66F4\u65B0!");
4789
4961
  } catch (err) {
@@ -4805,9 +4977,18 @@ var DECache = class {
4805
4977
  const key = srfKey;
4806
4978
  if (this.cacheMap.has(key)) {
4807
4979
  const data = this.cacheMap.get(key);
4808
- data.srftempdate = (/* @__PURE__ */ new Date()).getTime();
4809
- this.cacheMap.delete(key);
4810
- ibiz.log.warn("delete", key);
4980
+ const commit = () => {
4981
+ this.cacheMap.delete(key);
4982
+ ibiz.log.warn("delete", key);
4983
+ };
4984
+ const t = this.getTransaction(context);
4985
+ if (t) {
4986
+ t.change(key, () => {
4987
+ commit();
4988
+ });
4989
+ } else {
4990
+ commit();
4991
+ }
4811
4992
  return data;
4812
4993
  }
4813
4994
  return null;
@@ -4828,6 +5009,11 @@ var DECache = class {
4828
5009
  createBatch(context, entities) {
4829
5010
  try {
4830
5011
  isExistSessionId("add", context);
5012
+ const commit = (entity) => {
5013
+ this.cacheMap.set(entity.srfkey, entity);
5014
+ ibiz.log.warn("add", entity.srfkey, entity);
5015
+ };
5016
+ const t = this.getTransaction(context);
4831
5017
  for (let i = 0; i < entities.length; i++) {
4832
5018
  const entity = entities[i];
4833
5019
  if (isNil5(entity.srfkey) || isEmpty5(entity.srfkey)) {
@@ -4835,9 +5021,13 @@ var DECache = class {
4835
5021
  }
4836
5022
  entity.srftempdate = (/* @__PURE__ */ new Date()).getTime();
4837
5023
  const data = clone4(entity);
4838
- this.cacheMap.set(entity.srfkey, data);
4839
- entities[i] = data;
4840
- ibiz.log.warn("add", entity.srfkey, entity);
5024
+ if (t) {
5025
+ t.change(data.srfkey, () => {
5026
+ commit(data);
5027
+ });
5028
+ } else {
5029
+ commit(data);
5030
+ }
4841
5031
  }
4842
5032
  return entities;
4843
5033
  } catch (err) {
@@ -4857,16 +5047,41 @@ var DECache = class {
4857
5047
  updateBatch(context, entities) {
4858
5048
  try {
4859
5049
  isExistSessionId("update", context);
5050
+ const commit = (entity, oldKey) => {
5051
+ if (oldKey !== entity.srfkey) {
5052
+ this.cacheMap.delete(oldKey);
5053
+ }
5054
+ this.cacheMap.set(entity.srfkey, entity);
5055
+ ibiz.log.warn("update", entity.srfkey, entity);
5056
+ };
5057
+ const t = this.getTransaction(context);
4860
5058
  for (let i = 0; i < entities.length; i++) {
4861
5059
  const entity = entities[i];
4862
5060
  isExistSrfKey("update", entity);
5061
+ const oldKey = entity.srfkey;
5062
+ if (this.isUnionKey) {
5063
+ this.calcUnionKey(entity);
5064
+ if (oldKey !== entity.srfkey && this.checkData(context, entity.srfkey)) {
5065
+ throw new RuntimeError14(
5066
+ "\u66F4\u65B0\u8054\u5408\u4E3B\u952E\u6570\u636E\u5931\u8D25\uFF0C\u5DF2\u6709\u4E3B\u952E\u4E3A".concat(entity.srfkey, "\u7684\u6570\u636E")
5067
+ );
5068
+ }
5069
+ }
4863
5070
  entity.srftempdate = (/* @__PURE__ */ new Date()).getTime();
4864
5071
  const data = this.cacheMap.get(entity.srfkey);
4865
5072
  if (data) {
4866
- data.assign(entity);
4867
- this.cacheMap.set(entity.srfkey, data);
4868
- ibiz.log.warn("update", entity.srfkey, entity);
4869
- entities[i] = clone4(data);
5073
+ const _data = clone4(data);
5074
+ _data.assign(entity);
5075
+ entities[i] = _data;
5076
+ if (t) {
5077
+ t.change(entity.srfkey, () => {
5078
+ data.assign(entity);
5079
+ commit(data, oldKey);
5080
+ });
5081
+ } else {
5082
+ data.assign(entity);
5083
+ commit(data, oldKey);
5084
+ }
4870
5085
  } else {
4871
5086
  throw new Error(
4872
5087
  "\u6570\u636E[".concat(entity.srfdename, "-").concat(entity.srfmajortext, "(").concat(entity.srfkey, ")]\u4E0D\u5B58\u5728\uFF0C\u65E0\u6CD5\u66F4\u65B0!")
@@ -4907,10 +5122,20 @@ var DECache = class {
4907
5122
  "\u672A\u627E\u5230\u4EE5\u4E0B\u6570\u636E\u300C".concat(notRemoveKeys.join("\u3001"), "\u300D\uFF0C\u65E0\u6CD5\u5220\u9664!")
4908
5123
  );
4909
5124
  }
4910
- for (let i = 0; i < srfKeys.length; i++) {
4911
- const key = srfKeys[i];
5125
+ const commit = (key) => {
4912
5126
  this.cacheMap.delete(key);
4913
5127
  ibiz.log.warn("delete", key);
5128
+ };
5129
+ const t = this.getTransaction(context);
5130
+ for (let i = 0; i < srfKeys.length; i++) {
5131
+ const key = srfKeys[i];
5132
+ if (t) {
5133
+ t.change(key, () => {
5134
+ commit(key);
5135
+ });
5136
+ } else {
5137
+ commit(key);
5138
+ }
4914
5139
  }
4915
5140
  return [];
4916
5141
  }
@@ -4989,6 +5214,22 @@ var DECache = class {
4989
5214
  });
4990
5215
  data.srfkey = unionValues.join("||");
4991
5216
  }
5217
+ /**
5218
+ * 根据上下文,获取已经开启的事务
5219
+ *
5220
+ * @author chitanda
5221
+ * @date 2024-01-17 15:01:28
5222
+ * @protected
5223
+ * @param {IContext} context
5224
+ * @return {*} {(ITransaction | null)}
5225
+ */
5226
+ getTransaction(context) {
5227
+ const uiDomain = ibiz.uiDomainManager.get(context.srfsessionid);
5228
+ if (uiDomain && uiDomain.transaction.state.isOpen === true) {
5229
+ return uiDomain.transaction;
5230
+ }
5231
+ return null;
5232
+ }
4992
5233
  };
4993
5234
 
4994
5235
  // src/service/utils/res-path/res-path.ts
@@ -5404,7 +5645,8 @@ CounterService.counterMap = /* @__PURE__ */ new Map();
5404
5645
  // src/service/service/entity/de.service.ts
5405
5646
  import {
5406
5647
  ModelError as ModelError7,
5407
- RuntimeError as RuntimeError17
5648
+ RuntimeError as RuntimeError17,
5649
+ RuntimeModelError as RuntimeModelError10
5408
5650
  } from "@ibiz-template/core";
5409
5651
 
5410
5652
  // src/service/service/work-flow/work-flow.service.ts
@@ -5980,24 +6222,13 @@ var MethodDto = class {
5980
6222
  * @param {IAppDataEntity} entity
5981
6223
  * @param {boolean} [isLocalMode]
5982
6224
  * @param {IAppDEMethodDTO} [dto]
5983
- * @param {boolean} [inSelfLoop] 是否在自关系循环中
5984
6225
  */
5985
- constructor(service, entity, isLocalMode, dto, inSelfLoop) {
6226
+ constructor(service, entity, isLocalMode, dto) {
5986
6227
  this.service = service;
5987
6228
  this.entity = entity;
5988
6229
  this.isLocalMode = isLocalMode;
5989
6230
  this.dto = dto;
5990
- this.inSelfLoop = inSelfLoop;
5991
6231
  this.dtoMap = /* @__PURE__ */ new Map();
5992
- /**
5993
- * 当前 DTO 是否已经计算过关系相关逻辑
5994
- *
5995
- * @link this.calcRs
5996
- * @author chitanda
5997
- * @date 2023-12-26 16:12:18
5998
- * @protected
5999
- */
6000
- this.isCalcRs = false;
6001
6232
  if (dto) {
6002
6233
  this.app = ibiz.hub.getApp(entity.appId);
6003
6234
  this.fields = dto.appDEMethodDTOFields || [];
@@ -6126,10 +6357,12 @@ var MethodDto = class {
6126
6357
  * @return {*} {Promise<IDataEntity[]>}
6127
6358
  */
6128
6359
  async sets(context, data) {
6129
- if (this.isLocalMode && !this.inSelfLoop) {
6130
- this.service.local.clear();
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;
6131
6365
  }
6132
- await this.calcRs(context);
6133
6366
  return Promise.all(
6134
6367
  data.map(async (datum) => {
6135
6368
  const all = this.fields.filter((field) => field.type === "DTOS").map(async (field) => {
@@ -6142,7 +6375,7 @@ var MethodDto = class {
6142
6375
  }
6143
6376
  const dto = await this.getFieldDto(context, field);
6144
6377
  const items = datum[key];
6145
- if (items) {
6378
+ if (items && items.length > 0) {
6146
6379
  const pKey = datum[this.entity.keyAppDEFieldId];
6147
6380
  if (field.refPickupAppDEFieldId) {
6148
6381
  items.forEach((item) => {
@@ -6177,10 +6410,9 @@ var MethodDto = class {
6177
6410
  * @return {*} {Promise<void>}
6178
6411
  */
6179
6412
  async calcRs(context, depth = 0) {
6180
- if (this.isCalcRs || depth > 10) {
6413
+ if (depth > 10) {
6181
6414
  return;
6182
6415
  }
6183
- this.isCalcRs = true;
6184
6416
  depth += 1;
6185
6417
  const uiDomain = ibiz.uiDomainManager.get(context.srfsessionid);
6186
6418
  const dtoFields = this.fields.filter((field) => field.type === "DTOS");
@@ -6224,12 +6456,10 @@ var MethodDto = class {
6224
6456
  entity.appDEMethodDTOs || [],
6225
6457
  field.refAppDEMethodDTOId
6226
6458
  );
6227
- const inSelfLoop = this.entity.codeName === entity.codeName;
6228
6459
  const service = await this.app.deService.getService(context, entity.id);
6229
6460
  service.isLocalMode = true;
6230
6461
  const dto = service.createMethodDto(methodDto, {
6231
- isLocalMode: true,
6232
- inSelfLoop
6462
+ isLocalMode: true
6233
6463
  });
6234
6464
  this.dtoMap.set(field.codeName, dto);
6235
6465
  return dto;
@@ -6291,6 +6521,9 @@ var DEService = class {
6291
6521
  return this.methodMap.get(cacheId);
6292
6522
  }
6293
6523
  const model = findModelChild(this.model.appDEMethods, id);
6524
+ if (!model) {
6525
+ throw new RuntimeModelError10(this.model, "\u672A\u627E\u5230\u670D\u52A1\u65B9\u6CD5: ".concat(id));
6526
+ }
6294
6527
  const provider = await getDEMethodProvider(model);
6295
6528
  if (!provider) {
6296
6529
  throw new ModelError7(model, "\u672A\u652F\u6301\u7684\u670D\u52A1\u65B9\u6CD5\u7C7B\u578B: ".concat(model.methodType));
@@ -6475,13 +6708,7 @@ var DEService = class {
6475
6708
  this.local.clear();
6476
6709
  }
6477
6710
  createMethodDto(dto, opts) {
6478
- return new MethodDto(
6479
- this,
6480
- this.model,
6481
- opts == null ? void 0 : opts.isLocalMode,
6482
- dto,
6483
- opts == null ? void 0 : opts.inSelfLoop
6484
- );
6711
+ return new MethodDto(this, this.model, opts == null ? void 0 : opts.isLocalMode, dto);
6485
6712
  }
6486
6713
  };
6487
6714
 
@@ -7201,6 +7428,8 @@ var V7AuthService = class {
7201
7428
  clearCookie(CoreConst.TOKEN_EXPIRES);
7202
7429
  clearCookie(CoreConst.TOKEN_REMEMBER);
7203
7430
  clearCookie(CoreConst.IS_ANONYMOUS);
7431
+ ibiz.appData = void 0;
7432
+ ibiz.orgData = void 0;
7204
7433
  return true;
7205
7434
  } catch (err) {
7206
7435
  ibiz.notification.error({
@@ -7282,12 +7511,14 @@ import {
7282
7511
  HttpError as HttpError5,
7283
7512
  HttpResponse as HttpResponse3,
7284
7513
  RuntimeError as RuntimeError21,
7285
- RuntimeModelError as RuntimeModelError21
7514
+ RuntimeModelError as RuntimeModelError22
7286
7515
  } from "@ibiz-template/core";
7287
7516
  import { isArray as isArray6, isNil as isNil10 } from "lodash-es";
7517
+ import { ascSort } from "qx-util";
7518
+ import { clone as clone14 } from "ramda";
7288
7519
 
7289
7520
  // src/service/service/entity/method/method.ts
7290
- import { RuntimeModelError as RuntimeModelError10 } from "@ibiz-template/core";
7521
+ import { RuntimeModelError as RuntimeModelError11 } from "@ibiz-template/core";
7291
7522
 
7292
7523
  // src/service/service/entity/method/method-input.ts
7293
7524
  var MethodInput = class {
@@ -7378,6 +7609,11 @@ var MethodReturn = class {
7378
7609
  */
7379
7610
  async handle(context, data) {
7380
7611
  if (this.dto) {
7612
+ const app = ibiz.hub.getApp(this.entity.appId);
7613
+ app.deService.clearTempCache({
7614
+ srfappid: app.appId,
7615
+ srfsessionid: context.srfsessionid
7616
+ });
7381
7617
  const items = await this.dto.sets(context, [data]);
7382
7618
  return items[0];
7383
7619
  }
@@ -7453,17 +7689,17 @@ var Method = class {
7453
7689
  break;
7454
7690
  default:
7455
7691
  if (requestMethod) {
7456
- throw new RuntimeModelError10(
7692
+ throw new RuntimeModelError11(
7457
7693
  this.method,
7458
7694
  "\u672A\u652F\u6301\u7684\u8BF7\u6C42\u65B9\u5F0F: ".concat(requestMethod)
7459
7695
  );
7460
7696
  } else {
7461
- throw new RuntimeModelError10(this.method, "\u672A\u914D\u7F6E\u8BF7\u6C42\u65B9\u5F0F");
7697
+ throw new RuntimeModelError11(this.method, "\u672A\u914D\u7F6E\u8BF7\u6C42\u65B9\u5F0F");
7462
7698
  }
7463
7699
  }
7464
7700
  return res;
7465
7701
  }
7466
- throw new RuntimeModelError10(this.method, "\u672A\u652F\u6301\u7684\u884C\u4E3A\u7C7B\u578B[".concat(actionType, "]"));
7702
+ throw new RuntimeModelError11(this.method, "\u672A\u652F\u6301\u7684\u884C\u4E3A\u7C7B\u578B[".concat(actionType, "]"));
7467
7703
  }
7468
7704
  mergeRequestPath(path2, methodName) {
7469
7705
  return "".concat(path2, "/").concat(methodName);
@@ -7501,7 +7737,7 @@ import { isArray as isArray5 } from "lodash-es";
7501
7737
  import { clone as clone13 } from "ramda";
7502
7738
 
7503
7739
  // src/de-logic/de-logic.ts
7504
- import { ModelError as ModelError13, RuntimeModelError as RuntimeModelError20 } from "@ibiz-template/core";
7740
+ import { ModelError as ModelError13, RuntimeModelError as RuntimeModelError21 } from "@ibiz-template/core";
7505
7741
 
7506
7742
  // src/de-logic/de-logic-context.ts
7507
7743
  import { isArray as isArray4 } from "lodash-es";
@@ -7633,17 +7869,17 @@ var DELogicContext = class {
7633
7869
  };
7634
7870
 
7635
7871
  // src/de-logic/de-logic-node/de-action-node/de-action-node.ts
7636
- import { RuntimeModelError as RuntimeModelError13 } from "@ibiz-template/core";
7872
+ import { RuntimeModelError as RuntimeModelError14 } from "@ibiz-template/core";
7637
7873
 
7638
7874
  // src/de-logic/de-logic-link/de-logic-link-group-cond/de-logic-link-group-cond.ts
7639
- import { RuntimeModelError as RuntimeModelError12 } from "@ibiz-template/core";
7875
+ import { RuntimeModelError as RuntimeModelError13 } from "@ibiz-template/core";
7640
7876
 
7641
7877
  // src/de-logic/de-logic-link/de-logic-link-cond/de-logic-link-cond.ts
7642
7878
  var DELogicLinkCond = class {
7643
7879
  };
7644
7880
 
7645
7881
  // src/de-logic/de-logic-link/de-logic-link-single-cond/de-logic-link-single-cond.ts
7646
- import { ModelError as ModelError8, RuntimeModelError as RuntimeModelError11 } from "@ibiz-template/core";
7882
+ import { ModelError as ModelError8, RuntimeModelError as RuntimeModelError12 } from "@ibiz-template/core";
7647
7883
  var DELogicLinkSingleCond = class extends DELogicLinkCond {
7648
7884
  constructor(model) {
7649
7885
  super();
@@ -7690,7 +7926,7 @@ var DELogicLinkSingleCond = class extends DELogicLinkCond {
7690
7926
  switch (this.type) {
7691
7927
  case "ENTITYFIELD": {
7692
7928
  if (!this.value) {
7693
- throw new RuntimeModelError11(
7929
+ throw new RuntimeModelError12(
7694
7930
  this.model,
7695
7931
  "\u5F53\u524D\u6761\u4EF6\u503C\u7C7B\u578B\u4E3A[\u6570\u636E\u5BF9\u8C61\u5C5E\u6027],\u7F3A\u5C11\u914D\u7F6E\u6761\u4EF6\u503C"
7696
7932
  );
@@ -7700,7 +7936,7 @@ var DELogicLinkSingleCond = class extends DELogicLinkCond {
7700
7936
  }
7701
7937
  case "SRCENTITYFIELD": {
7702
7938
  if (!this.value) {
7703
- throw new RuntimeModelError11(
7939
+ throw new RuntimeModelError12(
7704
7940
  this.model,
7705
7941
  "\u5F53\u524D\u6761\u4EF6\u503C\u7C7B\u578B\u4E3A[\u6E90\u6570\u636E\u5BF9\u8C61\u5C5E\u6027],\u7F3A\u5C11\u914D\u7F6E\u6761\u4EF6\u503C"
7706
7942
  );
@@ -7763,7 +7999,7 @@ var DELogicLinkGroupCond = class _DELogicLinkGroupCond extends DELogicLinkCond {
7763
7999
  test(ctx, context, data) {
7764
8000
  let bol = true;
7765
8001
  if (this.conds.length === 0) {
7766
- throw new RuntimeModelError12(this.model, "\u754C\u9762\u8FDE\u63A5\u6761\u4EF6\u903B\u8F91\u7EC4\u672A\u914D\u7F6E\u903B\u8F91\u9879");
8002
+ throw new RuntimeModelError13(this.model, "\u754C\u9762\u8FDE\u63A5\u6761\u4EF6\u903B\u8F91\u7EC4\u672A\u914D\u7F6E\u903B\u8F91\u9879");
7767
8003
  }
7768
8004
  for (let i = 0; i < this.conds.length; i++) {
7769
8005
  const cond = this.conds[i];
@@ -7866,10 +8102,10 @@ var DEActionNode = class extends DELogicNode {
7866
8102
  retDELogicParamId
7867
8103
  } = this.model;
7868
8104
  if (!dstAppDataEntityId) {
7869
- throw new RuntimeModelError13(this.model, "\u672A\u6307\u5B9A\u5E94\u7528\u5B9E\u4F53");
8105
+ throw new RuntimeModelError14(this.model, "\u672A\u6307\u5B9A\u5E94\u7528\u5B9E\u4F53");
7870
8106
  }
7871
8107
  if (!dstAppDEActionId) {
7872
- throw new RuntimeModelError13(this.model, "\u672A\u6307\u5B9A\u5B9E\u4F53\u884C\u4E3A");
8108
+ throw new RuntimeModelError14(this.model, "\u672A\u6307\u5B9A\u5B9E\u4F53\u884C\u4E3A");
7873
8109
  }
7874
8110
  const requestData = ctx.params[dstDELogicParamId];
7875
8111
  const app = ibiz.hub.getApp(ctx.context.srfappid);
@@ -7933,7 +8169,7 @@ import { clone as clone10 } from "ramda";
7933
8169
  import { ModelError as ModelError10 } from "@ibiz-template/core";
7934
8170
  import { clone as clone9 } from "ramda";
7935
8171
  function handleSrcVal(ctx, srcValParams) {
7936
- const { srcDELogicParamId, srcFieldName, srcValue } = srcValParams;
8172
+ const { srcDELogicParamId, srcFieldName, srcValue, expression } = srcValParams;
7937
8173
  const srcValueType = srcValParams.srcValueType || "SRCDLPARAM";
7938
8174
  let srcField = srcFieldName;
7939
8175
  let value;
@@ -7963,6 +8199,15 @@ function handleSrcVal(ctx, srcValParams) {
7963
8199
  case "ENVPARAM":
7964
8200
  value = clone9(ibiz.env);
7965
8201
  break;
8202
+ case "EXPRESSION":
8203
+ if (!expression) {
8204
+ throw new ModelError10(srcValParams, "\u8868\u8FBE\u5F0F\u4E3A\u7A7A");
8205
+ }
8206
+ value = ScriptFactory.execScriptFn(ctx, expression, {
8207
+ singleRowReturn: true,
8208
+ isAsync: false
8209
+ });
8210
+ break;
7966
8211
  default:
7967
8212
  throw new ModelError10(srcValParams, "\u6682\u672A\u652F\u6301\u6E90\u503C\u7C7B\u578B".concat(srcValueType));
7968
8213
  }
@@ -8153,12 +8398,12 @@ var DataSetNode = class extends DELogicNode {
8153
8398
  };
8154
8399
 
8155
8400
  // src/de-logic/de-logic-node/bind-param-node/bind-param-node.ts
8156
- import { RuntimeModelError as RuntimeModelError14 } from "@ibiz-template/core";
8401
+ import { RuntimeModelError as RuntimeModelError15 } from "@ibiz-template/core";
8157
8402
  var BindParamNode = class extends DELogicNode {
8158
8403
  async exec(ctx) {
8159
8404
  const { dstDELogicParamId, srcDELogicParamId } = this.model;
8160
8405
  if (!dstDELogicParamId || !srcDELogicParamId) {
8161
- throw new RuntimeModelError14(
8406
+ throw new RuntimeModelError15(
8162
8407
  this.model,
8163
8408
  "\u7F3A\u5C11\u76EE\u6807\u53C2\u6570\u5BF9\u8C61\u6216\u8005\u6E90\u53C2\u6570\u5BF9\u8C61\u914D\u7F6E"
8164
8409
  );
@@ -8169,37 +8414,37 @@ var BindParamNode = class extends DELogicNode {
8169
8414
  };
8170
8415
 
8171
8416
  // src/de-logic/de-logic-node/reset-param-node/reset-param-node.ts
8172
- import { RuntimeModelError as RuntimeModelError15 } from "@ibiz-template/core";
8417
+ import { RuntimeModelError as RuntimeModelError16 } from "@ibiz-template/core";
8173
8418
  var ResetParamNode = class extends DELogicNode {
8174
8419
  async exec(ctx) {
8175
8420
  const { dstDELogicParamId } = this.model;
8176
8421
  if (!dstDELogicParamId) {
8177
- throw new RuntimeModelError15(this.model, "\u7F3A\u5C11\u76EE\u6807\u53C2\u6570\u5BF9\u8C61\u914D\u7F6E");
8422
+ throw new RuntimeModelError16(this.model, "\u7F3A\u5C11\u76EE\u6807\u53C2\u6570\u5BF9\u8C61\u914D\u7F6E");
8178
8423
  }
8179
8424
  ctx.resetParam(dstDELogicParamId);
8180
8425
  }
8181
8426
  };
8182
8427
 
8183
8428
  // src/de-logic/de-logic-node/renew-param-node/renew-param-node.ts
8184
- import { RuntimeModelError as RuntimeModelError16 } from "@ibiz-template/core";
8429
+ import { RuntimeModelError as RuntimeModelError17 } from "@ibiz-template/core";
8185
8430
  var RenewParamNode = class extends DELogicNode {
8186
8431
  async exec(ctx) {
8187
8432
  const { dstDELogicParamId } = this.model;
8188
8433
  if (!dstDELogicParamId) {
8189
- throw new RuntimeModelError16(this.model, "\u7F3A\u5C11\u76EE\u6807\u53C2\u6570\u5BF9\u8C61\u914D\u7F6E");
8434
+ throw new RuntimeModelError17(this.model, "\u7F3A\u5C11\u76EE\u6807\u53C2\u6570\u5BF9\u8C61\u914D\u7F6E");
8190
8435
  }
8191
8436
  ctx.renewParam(dstDELogicParamId);
8192
8437
  }
8193
8438
  };
8194
8439
 
8195
8440
  // src/de-logic/de-logic-node/copy-param-node/copy-param-node.ts
8196
- import { RuntimeModelError as RuntimeModelError17 } from "@ibiz-template/core";
8441
+ import { RuntimeModelError as RuntimeModelError18 } from "@ibiz-template/core";
8197
8442
  import { clone as clone11 } from "ramda";
8198
8443
  var CopyParamNode = class extends DELogicNode {
8199
8444
  async exec(ctx) {
8200
8445
  const { dstDELogicParamId, srcDELogicParamId } = this.model;
8201
8446
  if (!dstDELogicParamId || !srcDELogicParamId) {
8202
- throw new RuntimeModelError17(
8447
+ throw new RuntimeModelError18(
8203
8448
  this.model,
8204
8449
  "\u7F3A\u5C11\u76EE\u6807\u53C2\u6570\u5BF9\u8C61\u6216\u8005\u6E90\u53C2\u6570\u5BF9\u8C61\u914D\u7F6E"
8205
8450
  );
@@ -8210,12 +8455,12 @@ var CopyParamNode = class extends DELogicNode {
8210
8455
  };
8211
8456
 
8212
8457
  // src/de-logic/de-logic-node/sort-param-node/sort-param-node.ts
8213
- import { RuntimeModelError as RuntimeModelError18 } from "@ibiz-template/core";
8458
+ import { RuntimeModelError as RuntimeModelError19 } from "@ibiz-template/core";
8214
8459
  var SortParamNode = class extends DELogicNode {
8215
8460
  async exec(ctx) {
8216
8461
  const { dstDELogicParamId, dstSortDir, dstFieldName } = this.model;
8217
8462
  if (!dstDELogicParamId || !dstFieldName) {
8218
- throw new RuntimeModelError18(this.model, "\u7F3A\u5C11\u76EE\u6807\u53C2\u6570\u5BF9\u8C61\u6216\u76EE\u6807\u5C5E\u6027\u914D\u7F6E");
8463
+ throw new RuntimeModelError19(this.model, "\u7F3A\u5C11\u76EE\u6807\u53C2\u6570\u5BF9\u8C61\u6216\u76EE\u6807\u5C5E\u6027\u914D\u7F6E");
8219
8464
  }
8220
8465
  const key = dstFieldName.toLowerCase();
8221
8466
  const arr = ctx.params[dstDELogicParamId];
@@ -8226,7 +8471,7 @@ var SortParamNode = class extends DELogicNode {
8226
8471
  };
8227
8472
 
8228
8473
  // src/de-logic/de-logic-node/append-param-node/append-param-node.ts
8229
- import { RuntimeModelError as RuntimeModelError19 } from "@ibiz-template/core";
8474
+ import { RuntimeModelError as RuntimeModelError20 } from "@ibiz-template/core";
8230
8475
  var AppendParamNode = class extends DELogicNode {
8231
8476
  async exec(ctx) {
8232
8477
  const {
@@ -8237,7 +8482,7 @@ var AppendParamNode = class extends DELogicNode {
8237
8482
  srcSize
8238
8483
  } = this.model;
8239
8484
  if (!dstDELogicParamId || !srcDELogicParamId) {
8240
- throw new RuntimeModelError19(
8485
+ throw new RuntimeModelError20(
8241
8486
  this.model,
8242
8487
  "\u7F3A\u5C11\u76EE\u6807\u53C2\u6570\u5BF9\u8C61\u6216\u8005\u6E90\u53C2\u6570\u5BF9\u8C61\u914D\u7F6E"
8243
8488
  );
@@ -8386,7 +8631,7 @@ var DELogic = class {
8386
8631
  var _a, _b;
8387
8632
  if (model.customCode) {
8388
8633
  if (!model.scriptCode) {
8389
- throw new RuntimeModelError20(model, "\u811A\u672C\u4EE3\u7801\u6A21\u5F0F\u6CA1\u6709\u914D\u7F6E\u811A\u672C\u4EE3\u7801");
8634
+ throw new RuntimeModelError21(model, "\u811A\u672C\u4EE3\u7801\u6A21\u5F0F\u6CA1\u6709\u914D\u7F6E\u811A\u672C\u4EE3\u7801");
8390
8635
  }
8391
8636
  this.scriptFn = ScriptFactory.createScriptFn([], model.scriptCode, {
8392
8637
  isAsync: true
@@ -8394,7 +8639,7 @@ var DELogic = class {
8394
8639
  return;
8395
8640
  }
8396
8641
  if (!((_a = model.delogicNodes) == null ? void 0 : _a.length)) {
8397
- throw new RuntimeModelError20(model, "\u5B9E\u4F53\u903B\u8F91\u6CA1\u6709\u914D\u7F6E\u903B\u8F91\u8282\u70B9");
8642
+ throw new RuntimeModelError21(model, "\u5B9E\u4F53\u903B\u8F91\u6CA1\u6709\u914D\u7F6E\u903B\u8F91\u8282\u70B9");
8398
8643
  }
8399
8644
  model.delogicNodes.forEach((node) => {
8400
8645
  const { logicNodeType } = node;
@@ -8493,7 +8738,7 @@ var DELogic = class {
8493
8738
  const start = this.nodes.get(startDELogicNodeId);
8494
8739
  await this.deepExec(start, ctx);
8495
8740
  } else {
8496
- throw new RuntimeModelError20(this.model, "\u672A\u8BBE\u7F6E\u8D77\u59CB\u8282\u70B9");
8741
+ throw new RuntimeModelError21(this.model, "\u672A\u8BBE\u7F6E\u8D77\u59CB\u8282\u70B9");
8497
8742
  }
8498
8743
  if (ctx.isEndNode) {
8499
8744
  return ctx.result;
@@ -8612,66 +8857,64 @@ var DEActionMethod = class extends Method {
8612
8857
  return this.input.handle(context, data);
8613
8858
  }
8614
8859
  async exec(context, data, params) {
8615
- if (data) {
8860
+ let result;
8861
+ if (data && !["READ", "GETDRAFT"].includes(this.method.actionMode)) {
8616
8862
  await execFieldLogics(this.entity, "change", context, data, params);
8617
8863
  }
8618
8864
  if (this.method.actionType === "DELOGIC") {
8619
8865
  const deLogic = findDELogic(this.method.appDELogicId, this.entity);
8620
8866
  if (!deLogic) {
8621
- throw new RuntimeModelError21(this.method, "\u7F3A\u5C11\u5B9E\u4F53\u5904\u7406\u903B\u8F91");
8867
+ throw new RuntimeModelError22(this.method, "\u7F3A\u5C11\u5B9E\u4F53\u5904\u7406\u903B\u8F91");
8622
8868
  }
8623
- return execDELogicAction(deLogic, context, data, params);
8624
- }
8625
- if (data && !this.isLocalMode) {
8626
- data = await this.inputHandle(context, data);
8627
- }
8628
- if (data && !["READ", "GETDRAFT"].includes(this.method.actionMode)) {
8629
- await execFieldLogics(this.entity, "change", context, data, params);
8630
- }
8631
- let result;
8632
- switch (this.method.codeName) {
8633
- case "Create":
8634
- result = await this.create(context, data, params || {});
8635
- break;
8636
- case "Get":
8637
- result = await this.get(context, params);
8638
- break;
8639
- case "GetDraft":
8640
- result = await this.getDraft(context, params);
8641
- break;
8642
- case "Remove":
8643
- result = await this.remove(context, params);
8644
- break;
8645
- case "Update":
8646
- result = await this.update(context, data, params);
8647
- break;
8648
- case "CreateTemp":
8649
- result = await this.createTemp(context, data);
8650
- break;
8651
- case "GetTemp":
8652
- result = await this.getTemp(context, data);
8653
- break;
8654
- case "GetDraftTemp":
8655
- result = await this.getDraftTemp(context, params);
8656
- break;
8657
- case "RemoveTemp":
8658
- result = await this.removeTemp(context, data);
8659
- break;
8660
- case "UpdateTemp":
8661
- result = await this.updateTemp(context, data);
8662
- break;
8663
- default: {
8664
- let path2 = this.calcPath(context);
8665
- if (this.method.needResourceKey) {
8666
- let srfkey = context[this.entity.codeName.toLowerCase()];
8667
- if (isNil10(srfkey)) {
8668
- srfkey = isArray6(data) ? null : data == null ? void 0 : data[this.entity.keyAppDEFieldId];
8869
+ result = await execDELogicAction(deLogic, context, data, params);
8870
+ } else {
8871
+ if (data && !this.isLocalMode) {
8872
+ data = await this.inputHandle(context, data);
8873
+ }
8874
+ switch (this.method.codeName) {
8875
+ case "Create":
8876
+ result = await this.create(context, data, params || {});
8877
+ break;
8878
+ case "Get":
8879
+ result = await this.get(context, params);
8880
+ break;
8881
+ case "GetDraft":
8882
+ result = await this.getDraft(context, params);
8883
+ break;
8884
+ case "Remove":
8885
+ result = await this.remove(context, params);
8886
+ break;
8887
+ case "Update":
8888
+ result = await this.update(context, data, params);
8889
+ break;
8890
+ case "CreateTemp":
8891
+ result = await this.createTemp(context, data);
8892
+ break;
8893
+ case "GetTemp":
8894
+ result = await this.getTemp(context, data);
8895
+ break;
8896
+ case "GetDraftTemp":
8897
+ result = await this.getDraftTemp(context, params);
8898
+ break;
8899
+ case "RemoveTemp":
8900
+ result = await this.removeTemp(context, data);
8901
+ break;
8902
+ case "UpdateTemp":
8903
+ result = await this.updateTemp(context, data);
8904
+ break;
8905
+ default: {
8906
+ let path2 = this.calcPath(context);
8907
+ if (this.method.needResourceKey) {
8908
+ let srfkey = context[this.entity.codeName.toLowerCase()];
8909
+ if (isNil10(srfkey)) {
8910
+ srfkey = isArray6(data) ? null : data == null ? void 0 : data[this.entity.keyAppDEFieldId];
8911
+ }
8912
+ path2 = "".concat(path2, "/").concat(srfkey);
8669
8913
  }
8670
- path2 = "".concat(path2, "/").concat(srfkey);
8914
+ const res = await this.request(path2, context, data, params);
8915
+ res.data = await this.result.handle(context, res.data);
8916
+ result = res;
8671
8917
  }
8672
- const res = await this.request(path2, context, data, params);
8673
- res.data = await this.result.handle(context, res.data);
8674
- result = res;
8675
8918
  }
8676
8919
  }
8677
8920
  if (result.data) {
@@ -8859,6 +9102,13 @@ var DEActionMethod = class extends Method {
8859
9102
  if (!key && context) {
8860
9103
  key = context[this.entity.codeName.toLowerCase()];
8861
9104
  }
9105
+ try {
9106
+ await this.associationDeletion(key, context, params);
9107
+ } catch (error) {
9108
+ throw new HttpError5({
9109
+ response: new HttpResponse3(null, 500, error.message)
9110
+ });
9111
+ }
8862
9112
  const data = this.service.local.delete(context, key);
8863
9113
  if (data) {
8864
9114
  return new HttpResponse3(data);
@@ -8869,10 +9119,104 @@ var DEActionMethod = class extends Method {
8869
9119
  }
8870
9120
  }
8871
9121
  /**
8872
- * 更新临时数据
9122
+ * 关联删除
8873
9123
  *
8874
9124
  * @author chitanda
8875
- * @date 2022-08-21 17:08:17
9125
+ * @date 2024-01-17 16:01:47
9126
+ * @protected
9127
+ * @param {string} key
9128
+ * @param {IContext} context
9129
+ * @param {IParams} [params]
9130
+ * @return {*} {Promise<void>}
9131
+ */
9132
+ async associationDeletion(key, context, _params) {
9133
+ const uiDomain = ibiz.uiDomainManager.get(context.srfsessionid);
9134
+ const t = uiDomain.transaction;
9135
+ let selfOpenTransaction = false;
9136
+ if (t.state.isOpen === false) {
9137
+ t.open();
9138
+ selfOpenTransaction = true;
9139
+ }
9140
+ try {
9141
+ let configs = uiDomain.getDERConfigByMajor(this.entity.id);
9142
+ if (configs.length > 0) {
9143
+ const data = this.service.local.get(context, key);
9144
+ configs = ascSort(configs, "removeOrder");
9145
+ for (const config of configs) {
9146
+ if (config.rstype !== "DER1N") {
9147
+ throw new RuntimeModelError22(
9148
+ config,
9149
+ "\u76EE\u524D\u53EA\u652F\u6301[DER1N]\u5173\u7CFB\u7C7B\u578B\u5173\u8054\u5220\u9664\u5220\u9664"
9150
+ );
9151
+ }
9152
+ const {
9153
+ removeActionType,
9154
+ removeRejectMsg,
9155
+ minorAppDataEntityId,
9156
+ nestedAppDEDataSetId = "FetchDefault"
9157
+ } = config;
9158
+ const app = ibiz.hub.getApp(this.entity.appId);
9159
+ const minorService = await app.deService.getService(
9160
+ context,
9161
+ minorAppDataEntityId
9162
+ );
9163
+ const _context = clone14(context);
9164
+ _context[this.entity.codeName.toLowerCase()] = key;
9165
+ const res = await minorService.exec(nestedAppDEDataSetId, _context);
9166
+ const items = res.data || [];
9167
+ switch (removeActionType) {
9168
+ case 1: {
9169
+ for (let i = 0; i < items.length; i++) {
9170
+ const item = items[i];
9171
+ _context[minorService.model.codeName.toLowerCase()] = item.srfkey;
9172
+ const res2 = await minorService.remove(_context, item);
9173
+ if (res2.ok === false) {
9174
+ throw new Error(res2.statusText);
9175
+ }
9176
+ }
9177
+ break;
9178
+ }
9179
+ case 2:
9180
+ for (let i = 0; i < items.length; i++) {
9181
+ const item = items[i];
9182
+ _context[minorService.model.codeName.toLowerCase()] = item.srfkey;
9183
+ item[config.parentAppDEFieldId.toLowerCase()] = void 0;
9184
+ const res2 = await minorService.updateTemp(_context, item);
9185
+ if (res2.ok === false) {
9186
+ throw new Error(res2.statusText);
9187
+ }
9188
+ }
9189
+ break;
9190
+ case 3:
9191
+ if (items.length > 0) {
9192
+ const msg = items.map((item) => item.srfmajortext).join("\u3001");
9193
+ const message = "\u65E0\u6CD5\u5220\u9664[".concat(this.entity.logicName, "-").concat(data.srfmajortext, "], \u6570\u636E\u88AB[").concat(minorService.model.logicName, "-").concat(msg, "]\u5F15\u7528");
9194
+ throw new Error(removeRejectMsg || message);
9195
+ }
9196
+ break;
9197
+ default:
9198
+ }
9199
+ }
9200
+ }
9201
+ if (selfOpenTransaction && t.state.isOpen) {
9202
+ t.commit();
9203
+ }
9204
+ } catch (error) {
9205
+ if (selfOpenTransaction && t.state.isOpen) {
9206
+ t.rollback();
9207
+ }
9208
+ throw error;
9209
+ } finally {
9210
+ if (selfOpenTransaction && t.state.isOpen) {
9211
+ t.close();
9212
+ }
9213
+ }
9214
+ }
9215
+ /**
9216
+ * 更新临时数据
9217
+ *
9218
+ * @author chitanda
9219
+ * @date 2022-08-21 17:08:17
8876
9220
  * @param {IContext} context
8877
9221
  * @param {IData} entity
8878
9222
  * @return {*} {Promise<IHttpResponse<IDataEntity>>}
@@ -8955,8 +9299,9 @@ var DEActionMethod = class extends Method {
8955
9299
  if (configs.length > 0) {
8956
9300
  configs.forEach((config) => {
8957
9301
  if (config.parentAppDEFieldId) {
8958
- const { majorDECodeName, parentAppDEFieldId } = config;
8959
- const majorLowerCodeName = majorDECodeName.toLowerCase();
9302
+ const { majorAppDataEntityId, parentAppDEFieldId } = config;
9303
+ const majorDECodeName = calcDeCodeNameById(majorAppDataEntityId);
9304
+ const majorLowerCodeName = majorDECodeName;
8960
9305
  const pickupLowerDEFName = parentAppDEFieldId.toLowerCase();
8961
9306
  const majorkey = context[majorLowerCodeName];
8962
9307
  if (majorkey && majorkey !== data.srfkey) {
@@ -8980,43 +9325,42 @@ var DeActionDeMethodProvider = class {
8980
9325
  import {
8981
9326
  HttpResponse as HttpResponse4,
8982
9327
  ModelError as ModelError14,
8983
- RuntimeModelError as RuntimeModelError22
9328
+ RuntimeModelError as RuntimeModelError23
8984
9329
  } from "@ibiz-template/core";
8985
9330
  import { isArray as isArray7 } from "lodash-es";
8986
- import { clone as clone14, isEmpty as isEmpty7, isNil as isNil11 } from "ramda";
8987
- import { ascSort, descSort } from "qx-util";
9331
+ import { clone as clone15, isEmpty as isEmpty7, isNil as isNil11 } from "ramda";
9332
+ import { ascSort as ascSort2, descSort } from "qx-util";
8988
9333
  var FetchMethod = class extends Method {
8989
9334
  async exec(context, params, params2) {
8990
9335
  const searchParams = params && !isArray7(params) ? params : params2 || {};
9336
+ let res;
8991
9337
  if (this.isLocalMode) {
8992
9338
  const cond = DEDQCondUtil.getCond(this.method);
8993
- const items2 = await this.searchLocal(
8994
- cond,
8995
- new SearchFilter(context, searchParams)
8996
- );
8997
- return new HttpResponse4(items2, 200);
8998
- }
8999
- let res;
9000
- switch (this.method.dataSetType) {
9001
- case "INDEXDE":
9002
- case "CODELIST":
9003
- case "MULTIFORM":
9004
- res = await this.fetchCodeListSet(context, searchParams);
9005
- break;
9006
- case "REMOTE":
9007
- {
9008
- const path2 = this.calcPath(context);
9009
- res = await this.request(path2, context, params, params2);
9010
- }
9011
- break;
9012
- default:
9013
- throw new ModelError14(
9014
- this.method,
9015
- "\u6570\u636E\u6765\u6E90\u7C7B\u578B".concat(this.method.dataSetType, "\u6682\u672A\u652F\u6301")
9016
- );
9339
+ const filter = new SearchFilter(context, searchParams);
9340
+ const items = await this.searchLocal(cond, filter);
9341
+ res = new HttpResponse4(items, 200);
9342
+ } else {
9343
+ switch (this.method.dataSetType) {
9344
+ case "INDEXDE":
9345
+ case "CODELIST":
9346
+ case "MULTIFORM":
9347
+ res = await this.fetchCodeListSet(context, searchParams);
9348
+ break;
9349
+ case "REMOTE":
9350
+ {
9351
+ const path2 = this.calcPath(context);
9352
+ res = await this.request(path2, context, params, params2);
9353
+ }
9354
+ break;
9355
+ default:
9356
+ throw new ModelError14(
9357
+ this.method,
9358
+ "\u6570\u636E\u6765\u6E90\u7C7B\u578B".concat(this.method.dataSetType, "\u6682\u672A\u652F\u6301")
9359
+ );
9360
+ }
9361
+ const items = res.data || [];
9362
+ res.data = items.map((item) => this.createEntity(item));
9017
9363
  }
9018
- const items = res.data || [];
9019
- res.data = items.map((item) => this.createEntity(item));
9020
9364
  if (res.data) {
9021
9365
  await execFieldLogics(
9022
9366
  this.entity,
@@ -9065,13 +9409,13 @@ var FetchMethod = class extends Method {
9065
9409
  if (filter.sortMode === "DESC") {
9066
9410
  list = descSort(list, filter.sortField);
9067
9411
  } else {
9068
- list = ascSort(list, filter.sortField);
9412
+ list = ascSort2(list, filter.sortField);
9069
9413
  }
9070
9414
  }
9071
9415
  const { page, size } = filter;
9072
9416
  const start = page * size;
9073
9417
  const end = (page + 1) * size - 1;
9074
- const items = list.slice(start, end).map((item) => clone14(item));
9418
+ const items = list.slice(start, end).map((item) => clone15(item));
9075
9419
  return items;
9076
9420
  }
9077
9421
  /**
@@ -9085,7 +9429,7 @@ var FetchMethod = class extends Method {
9085
9429
  async fetchCodeListSet(context, params) {
9086
9430
  const { appCodeListId } = this.method;
9087
9431
  if (!appCodeListId) {
9088
- throw new RuntimeModelError22(this.method, "\u6CA1\u6709\u6307\u5B9A\u6570\u636E\u6765\u6E90\u4EE3\u7801\u8868");
9432
+ throw new RuntimeModelError23(this.method, "\u6CA1\u6709\u6307\u5B9A\u6570\u636E\u6765\u6E90\u4EE3\u7801\u8868");
9089
9433
  }
9090
9434
  const codeItems = await this.app.codeList.get(
9091
9435
  appCodeListId,
@@ -9199,15 +9543,14 @@ var TreeCodeListNodeData = class extends TreeNodeData {
9199
9543
 
9200
9544
  // src/service/vo/tree-node-data/tree-data-set-node-data.ts
9201
9545
  import { updateKeyDefine } from "@ibiz-template/core";
9202
- import { isNil as isNil12 } from "ramda";
9203
- var TreeDataSetNodeData = class extends TreeNodeData {
9546
+ import { clone as clone16, isNil as isNil12 } from "ramda";
9547
+ var CloneExcludeKeys = ["_id", "_value", "_text", "_deData", "clone"];
9548
+ var TreeDataSetNodeData = class _TreeDataSetNodeData extends TreeNodeData {
9204
9549
  constructor(model, parentNodeData, opts) {
9205
9550
  var _a, _b;
9206
9551
  super(model, parentNodeData, opts);
9207
9552
  const { data } = opts;
9208
9553
  this._deData = data;
9209
- this._text = model.textAppDEFieldId ? data[model.textAppDEFieldId] : data.srfmajortext;
9210
- this._value = model.idAppDEFieldId ? data[model.idAppDEFieldId] : data.srfkey;
9211
9554
  const selfId = "".concat(model.id, "@").concat(data.srfkey).toLowerCase();
9212
9555
  Object.defineProperty(this, "_id", {
9213
9556
  get() {
@@ -9216,6 +9559,20 @@ var TreeDataSetNodeData = class extends TreeNodeData {
9216
9559
  enumerable: true,
9217
9560
  configurable: true
9218
9561
  });
9562
+ Object.defineProperty(this, "_text", {
9563
+ get() {
9564
+ return model.textAppDEFieldId ? data[model.textAppDEFieldId] : data.srfmajortext;
9565
+ },
9566
+ enumerable: true,
9567
+ configurable: true
9568
+ });
9569
+ Object.defineProperty(this, "_value", {
9570
+ get() {
9571
+ return model.idAppDEFieldId ? data[model.idAppDEFieldId] : data.srfkey;
9572
+ },
9573
+ enumerable: true,
9574
+ configurable: true
9575
+ });
9219
9576
  if (model.appDataEntityId) {
9220
9577
  const deName = calcDeCodeNameById(model.appDataEntityId);
9221
9578
  this._context = Object.assign(this._context || {}, {
@@ -9228,14 +9585,13 @@ var TreeDataSetNodeData = class extends TreeNodeData {
9228
9585
  this._leaf = fieldValueToBoolean(data[model.leafFlagAppDEFieldId]);
9229
9586
  }
9230
9587
  const dataItemKeyMap = /* @__PURE__ */ new Map();
9231
- dataItemKeyMap.set("srfkey", "srfkey");
9232
- dataItemKeyMap.set("srfmajortext", "srfmajortext");
9588
+ const dataItemDefaultMap = /* @__PURE__ */ new Map();
9233
9589
  (_a = model.detreeNodeDataItems) == null ? void 0 : _a.forEach((dataItem) => {
9234
- const uiKey = dataItem.id.toLowerCase();
9590
+ const dataItemKey = dataItem.id.toLowerCase();
9235
9591
  const deFieldKey = dataItem.appDEFieldId.toLowerCase();
9236
- dataItemKeyMap.set(uiKey, deFieldKey);
9237
- if (dataItem.defaultValue && isNil12(data[deFieldKey])) {
9238
- data[deFieldKey] = dataItem.defaultValue;
9592
+ dataItemKeyMap.set(dataItemKey, deFieldKey);
9593
+ if (dataItem.defaultValue) {
9594
+ dataItemDefaultMap.set(dataItemKey, dataItem.defaultValue);
9239
9595
  }
9240
9596
  });
9241
9597
  const nodeColumnKeyMap = /* @__PURE__ */ new Map();
@@ -9245,35 +9601,60 @@ var TreeDataSetNodeData = class extends TreeNodeData {
9245
9601
  if (!columnKey || !dataItemKey) {
9246
9602
  ibiz.log.error("\u6A21\u578B\u5F02\u5E38\u7F3A\u5C11detreeColumnId\u6216\u8005dataItemName", column);
9247
9603
  } else {
9248
- nodeColumnKeyMap.set(columnKey, dataItemKeyMap.get(dataItemKey));
9604
+ nodeColumnKeyMap.set(columnKey, dataItemKey);
9249
9605
  }
9250
9606
  });
9607
+ const getDeKey = (key) => {
9608
+ if (nodeColumnKeyMap.has(key)) {
9609
+ return dataItemKeyMap.get(nodeColumnKeyMap.get(key));
9610
+ }
9611
+ if (dataItemKeyMap.has(key)) {
9612
+ return dataItemKeyMap.get(key);
9613
+ }
9614
+ if (Object.prototype.hasOwnProperty.call(this._deData, key)) {
9615
+ return key;
9616
+ }
9617
+ };
9618
+ const getKeyDefault = (key) => {
9619
+ if (nodeColumnKeyMap.has(key)) {
9620
+ return dataItemDefaultMap.get(nodeColumnKeyMap.get(key));
9621
+ }
9622
+ if (dataItemDefaultMap.has(key)) {
9623
+ return dataItemDefaultMap.get(key);
9624
+ }
9625
+ };
9626
+ this.clone = () => {
9627
+ const cloneData = clone16(this._deData);
9628
+ const cloneNodeData = new _TreeDataSetNodeData(model, this._parent, {
9629
+ data: cloneData,
9630
+ leaf: this._leaf,
9631
+ navContext: this._context,
9632
+ navParams: this._params
9633
+ });
9634
+ Object.keys(this).forEach((key) => {
9635
+ const deKey = getDeKey(key);
9636
+ if (isNil12(deKey) && !CloneExcludeKeys.includes(key)) {
9637
+ cloneNodeData[key] = this[key];
9638
+ }
9639
+ });
9640
+ return cloneNodeData;
9641
+ };
9251
9642
  return new Proxy(this, {
9252
9643
  set(target, p, value) {
9253
- if (nodeColumnKeyMap.has(p)) {
9254
- target._deData[nodeColumnKeyMap.get(p)] = value;
9255
- } else if (dataItemKeyMap.has(p)) {
9256
- target._deData[dataItemKeyMap.get(p)] = value;
9257
- } else if (Object.prototype.hasOwnProperty.call(target._deData, p)) {
9258
- target._deData[p] = value;
9644
+ const deKey = getDeKey(p);
9645
+ if (!isNil12(deKey)) {
9646
+ target._deData[deKey] = value;
9259
9647
  } else {
9260
9648
  target[p] = value;
9261
9649
  }
9262
9650
  return true;
9263
9651
  },
9264
9652
  get(target, p, _receiver) {
9265
- if (target[p] !== void 0) {
9266
- return target[p];
9267
- }
9268
- if (nodeColumnKeyMap.has(p)) {
9269
- return target._deData[nodeColumnKeyMap.get(p)];
9270
- }
9271
- if (dataItemKeyMap.has(p)) {
9272
- return target._deData[dataItemKeyMap.get(p)];
9273
- }
9274
- if (target._deData[p] !== void 0) {
9275
- return target._deData[p];
9653
+ const deKey = getDeKey(p);
9654
+ if (!isNil12(deKey)) {
9655
+ return isNil12(target._deData[deKey]) ? getKeyDefault(p) : target._deData[deKey];
9276
9656
  }
9657
+ return target[p];
9277
9658
  },
9278
9659
  ownKeys(target) {
9279
9660
  const allKeys = [
@@ -9896,10 +10277,10 @@ var MqttService = class {
9896
10277
  ibiz.log.debug("mqtt message", topic, payload.toString());
9897
10278
  });
9898
10279
  this.client.on("reconnect", () => {
9899
- ibiz.log.debug("mqtt reconnect");
10280
+ ibiz.log.warn("mqtt reconnect");
9900
10281
  });
9901
10282
  this.client.on("close", () => {
9902
- console.debug("mqtt close");
10283
+ ibiz.log.warn("mqtt close");
9903
10284
  });
9904
10285
  }
9905
10286
  /**
@@ -10061,7 +10442,7 @@ var _OpenAppViewCommand = class _OpenAppViewCommand {
10061
10442
  * @return {*} {(Promise<IModalData | void>)}
10062
10443
  */
10063
10444
  async exec(appViewId, _context, params = {}, opts = {}) {
10064
- const context = clone15(_context);
10445
+ const context = clone17(_context);
10065
10446
  const appView = await ibiz.hub.config.view.get(appViewId);
10066
10447
  if (!appView) {
10067
10448
  throw new RuntimeError23("\u5E94\u7528\u89C6\u56FE[".concat(appViewId, "]\u4E0D\u5B58\u5728"));
@@ -10087,7 +10468,13 @@ var _OpenAppViewCommand = class _OpenAppViewCommand {
10087
10468
  );
10088
10469
  }
10089
10470
  const { openMode = "INDEXVIEWTAB" } = appView;
10090
- switch (opts.openMode || openMode) {
10471
+ const viewOpenMode = opts.openMode || openMode;
10472
+ if (viewOpenMode !== void 0 && viewOpenMode !== "INDEXVIEWTAB") {
10473
+ if (context.toRouteDepth) {
10474
+ context.toRouteDepth = void 0;
10475
+ }
10476
+ }
10477
+ switch (viewOpenMode) {
10091
10478
  case "INDEXVIEWTAB":
10092
10479
  if (opts.noWaitRoute) {
10093
10480
  this.openIndexViewTab(appView, context, params);
@@ -10326,7 +10713,7 @@ function installCommand() {
10326
10713
  }
10327
10714
 
10328
10715
  // src/app-hub.ts
10329
- import { RuntimeError as RuntimeError61 } from "@ibiz-template/core";
10716
+ import { RuntimeError as RuntimeError63 } from "@ibiz-template/core";
10330
10717
 
10331
10718
  // src/application.ts
10332
10719
  import { Net, getToken } from "@ibiz-template/core";
@@ -10381,7 +10768,7 @@ var Application = class {
10381
10768
  async init() {
10382
10769
  await this.authority.init();
10383
10770
  await this.loadAppModelStyle();
10384
- if (ibiz.env.enableMqtt && ibiz.appData) {
10771
+ if (ibiz.env.enableMqtt && ibiz.appData && ibiz.auth.isAnonymous !== true) {
10385
10772
  this.mqtt = new MqttService(
10386
10773
  ibiz.appData.mqtttopic,
10387
10774
  getToken(),
@@ -10615,6 +11002,13 @@ var PanelNotifyState = /* @__PURE__ */ ((PanelNotifyState2) => {
10615
11002
  return PanelNotifyState2;
10616
11003
  })(PanelNotifyState || {});
10617
11004
 
11005
+ // src/controller/constant/control/tree-grid-ex/tree-grid-ex-notify.state.ts
11006
+ var TreeGridExNotifyState = /* @__PURE__ */ ((TreeGridExNotifyState2) => {
11007
+ TreeGridExNotifyState2["LOAD"] = "LOAD";
11008
+ TreeGridExNotifyState2["SAVE"] = "SAVE";
11009
+ return TreeGridExNotifyState2;
11010
+ })(TreeGridExNotifyState || {});
11011
+
10618
11012
  // src/controller/common/view/view.controller.ts
10619
11013
  import { notNilEmpty as notNilEmpty6 } from "qx-util";
10620
11014
  import { IBizContext as IBizContext2, RuntimeError as RuntimeError32 } from "@ibiz-template/core";
@@ -11792,7 +12186,7 @@ var BaseController = class {
11792
12186
  };
11793
12187
 
11794
12188
  // src/controller/utils/view-msg/view-msg-controller.ts
11795
- import { RuntimeError as RuntimeError31, RuntimeModelError as RuntimeModelError23 } from "@ibiz-template/core";
12189
+ import { RuntimeError as RuntimeError31, RuntimeModelError as RuntimeModelError24 } from "@ibiz-template/core";
11796
12190
  import { isNil as isNil18, mergeRight as mergeRight2 } from "ramda";
11797
12191
  var ViewMsgController = class _ViewMsgController {
11798
12192
  constructor(msgGroupId) {
@@ -11857,7 +12251,7 @@ var ViewMsgController = class _ViewMsgController {
11857
12251
  static async fetchDataSet(msgModel, context, params) {
11858
12252
  const { appDataEntityId, appDEDataSetId } = msgModel;
11859
12253
  if (!appDEDataSetId) {
11860
- throw new RuntimeModelError23(msgModel, "\u672A\u914D\u7F6E\u5B9E\u4F53\u6570\u636E\u96C6");
12254
+ throw new RuntimeModelError24(msgModel, "\u672A\u914D\u7F6E\u5B9E\u4F53\u6570\u636E\u96C6");
11861
12255
  }
11862
12256
  const res = await ibiz.hub.getApp(context.srfappid).deService.exec(appDataEntityId, appDEDataSetId, context, params);
11863
12257
  if (res.data.length) {
@@ -11951,7 +12345,7 @@ var ViewMsgController = class _ViewMsgController {
11951
12345
  msgPosAppDEFieldId
11952
12346
  } = msgModel;
11953
12347
  if (!appDataEntityId) {
11954
- throw new RuntimeModelError23(msgModel, "\u672A\u914D\u7F6E\u5E94\u7528\u5B9E\u4F53");
12348
+ throw new RuntimeModelError24(msgModel, "\u672A\u914D\u7F6E\u5E94\u7528\u5B9E\u4F53");
11955
12349
  }
11956
12350
  const entity = await ibiz.hub.getAppDataEntity(
11957
12351
  appDataEntityId,
@@ -12203,6 +12597,7 @@ var ViewController = class extends BaseController {
12203
12597
  (_a = this.scheduler) == null ? void 0 : _a.startTimerTrigger();
12204
12598
  }
12205
12599
  async onDestroyed() {
12600
+ const srfSessionId = this.context.srfsessionid;
12206
12601
  await super.onDestroyed();
12207
12602
  if (this.engines.length) {
12208
12603
  await Promise.all(this.engines.map((engine) => engine.onDestroyed()));
@@ -12212,8 +12607,8 @@ var ViewController = class extends BaseController {
12212
12607
  if (this.scheduler) {
12213
12608
  this.scheduler.destroy();
12214
12609
  }
12215
- if (this.id === this.context.srfsessionid) {
12216
- ibiz.uiDomainManager.destroy(this.context.srfsessionid);
12610
+ if (this.id === srfSessionId) {
12611
+ ibiz.uiDomainManager.destroy(srfSessionId);
12217
12612
  }
12218
12613
  this.context.destroy();
12219
12614
  ibiz.log.debug("\u89C6\u56FE[".concat(this.model.name, "](").concat(this.model.id, ")\u9500\u6BC1"));
@@ -12401,6 +12796,8 @@ var WFStepTraceViewController = class extends ViewController {
12401
12796
  };
12402
12797
 
12403
12798
  // src/controller/common/editor/editor.controller.ts
12799
+ import { DataTypes as DataTypes3 } from "@ibiz-template/core";
12800
+ import dayjs2 from "dayjs";
12404
12801
  var EditorController = class {
12405
12802
  /**
12406
12803
  * Creates an instance of EditorController.
@@ -12446,6 +12843,26 @@ var EditorController = class {
12446
12843
  get readonly() {
12447
12844
  return !!this.model.readOnly;
12448
12845
  }
12846
+ /**
12847
+ * 值格式化
12848
+ * @author lxm
12849
+ * @date 2024-01-11 10:18:33
12850
+ * @readonly
12851
+ * @type {(string | undefined)}
12852
+ */
12853
+ get valueFormat() {
12854
+ return this.parent.valueFormat;
12855
+ }
12856
+ /**
12857
+ * 数据类型
12858
+ * @author lxm
12859
+ * @date 2024-01-11 10:18:55
12860
+ * @readonly
12861
+ * @type {(number | undefined)}
12862
+ */
12863
+ get dataType() {
12864
+ return this.parent.dataType;
12865
+ }
12449
12866
  /**
12450
12867
  * 子类不可覆盖或重写此方法,在 init 时需要重写的使用 onInit 方法。
12451
12868
  *
@@ -12528,10 +12945,35 @@ var EditorController = class {
12528
12945
  toBoolean(value) {
12529
12946
  return Object.is("true", value);
12530
12947
  }
12948
+ /**
12949
+ * 值格式化
12950
+ * @author lxm
12951
+ * @date 2023-08-25 05:18:11
12952
+ * @param {unknown} value
12953
+ * @return {*} {string}
12954
+ */
12955
+ formatValue(value = "") {
12956
+ if (this.model.valueType !== "SIMPLE") {
12957
+ return ValueExUtil.toText(this.model, value);
12958
+ }
12959
+ const strVal = "".concat(value);
12960
+ if (!this.valueFormat) {
12961
+ return strVal;
12962
+ }
12963
+ const isDate = DataTypes3.isDate(this.dataType);
12964
+ if (isDate) {
12965
+ const formatVal = dayjs2(strVal).format(this.valueFormat);
12966
+ if (formatVal !== "Invalid Date") {
12967
+ return formatVal;
12968
+ }
12969
+ return strVal;
12970
+ }
12971
+ return ibiz.util.text.format(strVal, this.valueFormat);
12972
+ }
12531
12973
  };
12532
12974
 
12533
12975
  // src/controller/common/editor/code-list-editor.controller.ts
12534
- import { RuntimeModelError as RuntimeModelError24 } from "@ibiz-template/core";
12976
+ import { RuntimeModelError as RuntimeModelError25 } from "@ibiz-template/core";
12535
12977
  var CodeListEditorController = class extends EditorController {
12536
12978
  /**
12537
12979
  * 加载代码表数据
@@ -12555,7 +12997,7 @@ var CodeListEditorController = class extends EditorController {
12555
12997
  );
12556
12998
  return dataItems;
12557
12999
  }
12558
- throw new RuntimeModelError24(
13000
+ throw new RuntimeModelError25(
12559
13001
  this.model,
12560
13002
  "\u7F16\u8F91\u5668\u7C7B\u578B[".concat(this.model.editorType, "]\uFF0C\u672A\u914D\u7F6E\u4EE3\u7801\u8868")
12561
13003
  );
@@ -12564,7 +13006,7 @@ var CodeListEditorController = class extends EditorController {
12564
13006
 
12565
13007
  // src/controller/common/control/control.controller.ts
12566
13008
  import { IBizContext as IBizContext3, IBizParams, NoticeError as NoticeError2 } from "@ibiz-template/core";
12567
- import { clone as clone16, isNil as isNil20 } from "ramda";
13009
+ import { clone as clone18, isNil as isNil20 } from "ramda";
12568
13010
  import { notNilEmpty as notNilEmpty7 } from "qx-util";
12569
13011
  var ControlController = class extends BaseController {
12570
13012
  /**
@@ -12606,7 +13048,7 @@ var ControlController = class extends BaseController {
12606
13048
  "".concat(model.controlType, "_DEFAULT")
12607
13049
  );
12608
13050
  if (panelModel) {
12609
- this.controlPanel = clone16(panelModel);
13051
+ this.controlPanel = clone18(panelModel);
12610
13052
  }
12611
13053
  }
12612
13054
  this.updateContextParams({});
@@ -13358,7 +13800,7 @@ var MDControlController = class extends ControlController {
13358
13800
  import {
13359
13801
  findRecursiveChild,
13360
13802
  RuntimeError as RuntimeError34,
13361
- RuntimeModelError as RuntimeModelError25
13803
+ RuntimeModelError as RuntimeModelError26
13362
13804
  } from "@ibiz-template/core";
13363
13805
  var AppMenuController = class extends ControlController {
13364
13806
  constructor(model, context, params, ctx) {
@@ -13437,7 +13879,7 @@ var AppMenuController = class extends ControlController {
13437
13879
  return provider.onClick(menuItem, event, this);
13438
13880
  }
13439
13881
  if (!menuItem.appFuncId) {
13440
- throw new RuntimeModelError25(menuItem, "\u6CA1\u6709\u914D\u7F6E\u5E94\u7528\u529F\u80FD");
13882
+ throw new RuntimeModelError26(menuItem, "\u6CA1\u6709\u914D\u7F6E\u5E94\u7528\u529F\u80FD");
13441
13883
  }
13442
13884
  const tempContext = this.context.clone();
13443
13885
  tempContext.srfappid = menuItem.appId;
@@ -13556,7 +13998,7 @@ var AppMenuController = class extends ControlController {
13556
13998
  import {
13557
13999
  findRecursiveChild as findRecursiveChild2,
13558
14000
  RuntimeError as RuntimeError35,
13559
- RuntimeModelError as RuntimeModelError26
14001
+ RuntimeModelError as RuntimeModelError27
13560
14002
  } from "@ibiz-template/core";
13561
14003
  var AppMenuIconViewController = class extends AppMenuController {
13562
14004
  async onClickMenuItem(id, event) {
@@ -13572,7 +14014,7 @@ var AppMenuIconViewController = class extends AppMenuController {
13572
14014
  event
13573
14015
  });
13574
14016
  if (!menuItem.appFuncId) {
13575
- throw new RuntimeModelError26(menuItem, "\u6CA1\u6709\u914D\u7F6E\u5E94\u7528\u529F\u80FD");
14017
+ throw new RuntimeModelError27(menuItem, "\u6CA1\u6709\u914D\u7F6E\u5E94\u7528\u529F\u80FD");
13576
14018
  }
13577
14019
  const tempContext = this.context.clone();
13578
14020
  if (this.routeDepth === 1) {
@@ -13590,7 +14032,7 @@ var AppMenuIconViewController = class extends AppMenuController {
13590
14032
  };
13591
14033
 
13592
14034
  // src/controller/control/calendar/calendar.controller.ts
13593
- import dayjs2 from "dayjs";
14035
+ import dayjs3 from "dayjs";
13594
14036
 
13595
14037
  // src/controller/control/calendar/calendar.service.ts
13596
14038
  import { RuntimeError as RuntimeError36 } from "@ibiz-template/core";
@@ -13748,9 +14190,9 @@ var CalendarController = class extends MDControlController {
13748
14190
  const x = a.beginTime;
13749
14191
  const y = b.beginTime;
13750
14192
  let result = 0;
13751
- if (dayjs2(x).isAfter(y)) {
14193
+ if (dayjs3(x).isAfter(y)) {
13752
14194
  result = -1;
13753
- } else if (dayjs2(x).isBefore(y)) {
14195
+ } else if (dayjs3(x).isBefore(y)) {
13754
14196
  result = 1;
13755
14197
  }
13756
14198
  return result;
@@ -13782,8 +14224,8 @@ var CalendarController = class extends MDControlController {
13782
14224
  1
13783
14225
  );
13784
14226
  return {
13785
- srfstartdate: dayjs2(firstDayOfMonth).format("YYYY-MM-DD HH:mm:ss"),
13786
- srfenddate: dayjs2(lastDayOfMonth).format("YYYY-MM-DD HH:mm:ss")
14227
+ srfstartdate: dayjs3(firstDayOfMonth).format("YYYY-MM-DD HH:mm:ss"),
14228
+ srfenddate: dayjs3(lastDayOfMonth).format("YYYY-MM-DD HH:mm:ss")
13787
14229
  };
13788
14230
  }
13789
14231
  return { srfstartdate, srfenddate };
@@ -13868,22 +14310,22 @@ import { mergeDeepRight as mergeDeepRight3 } from "ramda";
13868
14310
  import { RuntimeError as RuntimeError37 } from "@ibiz-template/core";
13869
14311
 
13870
14312
  // src/controller/control/chart/generator/line-series-generator.ts
13871
- import { RuntimeModelError as RuntimeModelError28 } from "@ibiz-template/core";
14313
+ import { RuntimeModelError as RuntimeModelError29 } from "@ibiz-template/core";
13872
14314
 
13873
14315
  // src/controller/control/chart/generator/base-series-generator.ts
13874
- import { plus, RuntimeModelError as RuntimeModelError27, toNumberOrNil } from "@ibiz-template/core";
13875
- import dayjs3 from "dayjs";
14316
+ import { plus, RuntimeModelError as RuntimeModelError28, toNumberOrNil } from "@ibiz-template/core";
14317
+ import dayjs4 from "dayjs";
13876
14318
  import minMax from "dayjs/plugin/minMax";
13877
14319
  import isSameOrBefore from "dayjs/plugin/isSameOrBefore";
13878
14320
  import quarterOfYear from "dayjs/plugin/quarterOfYear";
13879
14321
  import weekOfYear from "dayjs/plugin/weekOfYear";
13880
14322
  import isoWeek from "dayjs/plugin/isoWeek";
13881
- import { clone as clone17, isNil as isNil21, mergeDeepRight } from "ramda";
13882
- dayjs3.extend(minMax);
13883
- dayjs3.extend(isSameOrBefore);
13884
- dayjs3.extend(quarterOfYear);
13885
- dayjs3.extend(weekOfYear);
13886
- dayjs3.extend(isoWeek);
14323
+ import { clone as clone19, isNil as isNil21, mergeDeepRight } from "ramda";
14324
+ dayjs4.extend(minMax);
14325
+ dayjs4.extend(isSameOrBefore);
14326
+ dayjs4.extend(quarterOfYear);
14327
+ dayjs4.extend(weekOfYear);
14328
+ dayjs4.extend(isoWeek);
13887
14329
  var DEFAULT_GROUP = "$default_group";
13888
14330
  var BaseSeriesGenerator = class {
13889
14331
  /**
@@ -13921,10 +14363,10 @@ var BaseSeriesGenerator = class {
13921
14363
  this.chartGenerator = chartGenerator;
13922
14364
  const { chartSeriesEncode, caption, id, userParam } = model;
13923
14365
  if (!model.catalogField) {
13924
- throw new RuntimeModelError27(model, "\u7F3A\u5C11\u5206\u7C7B\u5C5E\u6027\u914D\u7F6E");
14366
+ throw new RuntimeModelError28(model, "\u7F3A\u5C11\u5206\u7C7B\u5C5E\u6027\u914D\u7F6E");
13925
14367
  }
13926
14368
  if (!model.valueField) {
13927
- throw new RuntimeModelError27(model, "\u7F3A\u5C11\u503C\u5C5E\u6027\u914D\u7F6E");
14369
+ throw new RuntimeModelError28(model, "\u7F3A\u5C11\u503C\u5C5E\u6027\u914D\u7F6E");
13928
14370
  }
13929
14371
  this.catalogField = chartGenerator.getFieldKey(model.catalogField);
13930
14372
  this.valueField = chartGenerator.getFieldKey(model.valueField);
@@ -14153,7 +14595,7 @@ var BaseSeriesGenerator = class {
14153
14595
  dataPreprocess(data) {
14154
14596
  const tempData = [];
14155
14597
  data.forEach((singleData) => {
14156
- tempData.push(clone17(singleData));
14598
+ tempData.push(clone19(singleData));
14157
14599
  });
14158
14600
  const { groupMode } = this.model;
14159
14601
  if (groupMode) {
@@ -14168,25 +14610,25 @@ var BaseSeriesGenerator = class {
14168
14610
  format = "YYYY-MM";
14169
14611
  }
14170
14612
  if (singleData[this.catalogField]) {
14171
- const formattedDate = dayjs3(singleData[this.catalogField]).format(
14613
+ const formattedDate = dayjs4(singleData[this.catalogField]).format(
14172
14614
  format
14173
14615
  );
14174
14616
  singleData[this.catalogField] = formattedDate;
14175
14617
  }
14176
14618
  } else if (groupMode === "QUARTER") {
14177
14619
  if (singleData[this.catalogField]) {
14178
- const formattedDate = "".concat(dayjs3(
14620
+ const formattedDate = "".concat(dayjs4(
14179
14621
  singleData[this.catalogField]
14180
- ).format("YYYY"), "-").concat(dayjs3(
14622
+ ).format("YYYY"), "-").concat(dayjs4(
14181
14623
  singleData[this.catalogField]
14182
14624
  ).quarter());
14183
14625
  singleData[this.catalogField] = formattedDate;
14184
14626
  }
14185
14627
  } else if (groupMode === "YEARWEEK") {
14186
14628
  if (singleData[this.catalogField]) {
14187
- const formattedDate = "".concat(dayjs3(
14629
+ const formattedDate = "".concat(dayjs4(
14188
14630
  singleData[this.catalogField]
14189
- ).format("YYYY"), "-").concat(dayjs3(singleData[this.catalogField]).week());
14631
+ ).format("YYYY"), "-").concat(dayjs4(singleData[this.catalogField]).week());
14190
14632
  singleData[this.catalogField] = formattedDate;
14191
14633
  }
14192
14634
  }
@@ -14208,7 +14650,7 @@ var BaseSeriesGenerator = class {
14208
14650
  let sortedKeys = [];
14209
14651
  if (groupMode === "DAY" || groupMode === "YEAR" || groupMode === "MONTH") {
14210
14652
  sortedKeys = Array.from(dateMap.keys()).sort(
14211
- (a, b) => dayjs3(a).diff(dayjs3(b))
14653
+ (a, b) => dayjs4(a).diff(dayjs4(b))
14212
14654
  );
14213
14655
  } else if (groupMode === "QUARTER" || groupMode === "YEARWEEK") {
14214
14656
  sortedKeys = Array.from(dateMap.keys()).sort((a, b) => {
@@ -14242,11 +14684,11 @@ var BaseSeriesGenerator = class {
14242
14684
  const dates = [];
14243
14685
  Object.keys(data).forEach((key) => {
14244
14686
  data[key].forEach((_val, date) => {
14245
- dates.push(dayjs3(date));
14687
+ dates.push(dayjs4(date));
14246
14688
  });
14247
14689
  });
14248
- const maxDate = dayjs3.max(dates);
14249
- const minDate = dayjs3.min(dates);
14690
+ const maxDate = dayjs4.max(dates);
14691
+ const minDate = dayjs4.min(dates);
14250
14692
  if (groupMode === "DAY") {
14251
14693
  let currentDate = minDate;
14252
14694
  const endDate = maxDate;
@@ -14328,7 +14770,7 @@ var BaseSeriesGenerator = class {
14328
14770
  const [minYear] = minYearWeek.split("-");
14329
14771
  const [maxYear] = maxYearWeek.split("-");
14330
14772
  for (let year = parseInt(minYear, 10); year <= parseInt(maxYear, 10); year++) {
14331
- const numWeeks = dayjs3("".concat(year, "-12-31")).isoWeek();
14773
+ const numWeeks = dayjs4("".concat(year, "-12-31")).isoWeek();
14332
14774
  for (let week = 1; week <= numWeeks; week++) {
14333
14775
  const yearWeek = "".concat(year, "-").concat(week);
14334
14776
  Object.keys(data).forEach((key) => {
@@ -14347,10 +14789,10 @@ var BaseSeriesGenerator = class {
14347
14789
  var LineSeriesGenerator = class extends BaseSeriesGenerator {
14348
14790
  calcStaticOptions() {
14349
14791
  if (this.xAxisIndex === void 0) {
14350
- throw new RuntimeModelError28(this.model, "\u5E8F\u5217\u6CA1\u6709\u914D\u7F6EX\u5750\u6807\u8F74");
14792
+ throw new RuntimeModelError29(this.model, "\u5E8F\u5217\u6CA1\u6709\u914D\u7F6EX\u5750\u6807\u8F74");
14351
14793
  }
14352
14794
  if (this.yAxisIndex === void 0) {
14353
- throw new RuntimeModelError28(this.model, "\u5E8F\u5217\u6CA1\u6709\u914D\u7F6EY\u5750\u6807\u8F74");
14795
+ throw new RuntimeModelError29(this.model, "\u5E8F\u5217\u6CA1\u6709\u914D\u7F6EY\u5750\u6807\u8F74");
14354
14796
  }
14355
14797
  const options = super.calcStaticOptions();
14356
14798
  options.xAxisIndex = this.xAxisIndex;
@@ -14366,14 +14808,14 @@ var LineSeriesGenerator = class extends BaseSeriesGenerator {
14366
14808
  };
14367
14809
 
14368
14810
  // src/controller/control/chart/generator/bar-series-generator.ts
14369
- import { RuntimeModelError as RuntimeModelError29 } from "@ibiz-template/core";
14811
+ import { RuntimeModelError as RuntimeModelError30 } from "@ibiz-template/core";
14370
14812
  var BarSeriesGenerator = class extends BaseSeriesGenerator {
14371
14813
  calcStaticOptions() {
14372
14814
  if (this.xAxisIndex === void 0) {
14373
- throw new RuntimeModelError29(this.model, "\u5E8F\u5217\u6CA1\u6709\u914D\u7F6EX\u5750\u6807\u8F74");
14815
+ throw new RuntimeModelError30(this.model, "\u5E8F\u5217\u6CA1\u6709\u914D\u7F6EX\u5750\u6807\u8F74");
14374
14816
  }
14375
14817
  if (this.yAxisIndex === void 0) {
14376
- throw new RuntimeModelError29(this.model, "\u5E8F\u5217\u6CA1\u6709\u914D\u7F6EY\u5750\u6807\u8F74");
14818
+ throw new RuntimeModelError30(this.model, "\u5E8F\u5217\u6CA1\u6709\u914D\u7F6EY\u5750\u6807\u8F74");
14377
14819
  }
14378
14820
  const options = super.calcStaticOptions();
14379
14821
  options.xAxisIndex = this.xAxisIndex;
@@ -14426,14 +14868,14 @@ var PieSeriesGenerator = class extends BaseSeriesGenerator {
14426
14868
  };
14427
14869
 
14428
14870
  // src/controller/control/chart/generator/scatter-series-generator.ts
14429
- import { RuntimeModelError as RuntimeModelError30 } from "@ibiz-template/core";
14871
+ import { RuntimeModelError as RuntimeModelError31 } from "@ibiz-template/core";
14430
14872
  var ScatterSeriesGenerator = class extends BaseSeriesGenerator {
14431
14873
  calcStaticOptions() {
14432
14874
  if (this.xAxisIndex === void 0) {
14433
- throw new RuntimeModelError30(this.model, "\u5E8F\u5217\u6CA1\u6709\u914D\u7F6EX\u5750\u6807\u8F74");
14875
+ throw new RuntimeModelError31(this.model, "\u5E8F\u5217\u6CA1\u6709\u914D\u7F6EX\u5750\u6807\u8F74");
14434
14876
  }
14435
14877
  if (this.yAxisIndex === void 0) {
14436
- throw new RuntimeModelError30(this.model, "\u5E8F\u5217\u6CA1\u6709\u914D\u7F6EY\u5750\u6807\u8F74");
14878
+ throw new RuntimeModelError31(this.model, "\u5E8F\u5217\u6CA1\u6709\u914D\u7F6EY\u5750\u6807\u8F74");
14437
14879
  }
14438
14880
  const options = super.calcStaticOptions();
14439
14881
  options.xAxisIndex = this.xAxisIndex;
@@ -14992,7 +15434,7 @@ var ChartController = class extends MDControlController {
14992
15434
  if (!this.options) {
14993
15435
  throw new RuntimeError38("options\u8FD8\u6CA1\u8BA1\u7B97");
14994
15436
  }
14995
- this.chart.setOption(this.options);
15437
+ this.chart.setOption(this.options, { notMerge: true });
14996
15438
  this.resizeChart();
14997
15439
  }
14998
15440
  /**
@@ -15031,17 +15473,17 @@ var CaptionBarController = class extends ControlController {
15031
15473
  import { recursiveIterate as recursiveIterate2, RuntimeError as RuntimeError47 } from "@ibiz-template/core";
15032
15474
 
15033
15475
  // src/ui-action/provider/backend-ui-action-provider.ts
15034
- import { RuntimeModelError as RuntimeModelError49 } from "@ibiz-template/core";
15476
+ import { RuntimeModelError as RuntimeModelError50 } from "@ibiz-template/core";
15035
15477
  import { isArray as isArray8 } from "qx-util";
15036
15478
 
15037
15479
  // src/ui-action/provider/ui-action-provider-base.ts
15038
- import { RuntimeModelError as RuntimeModelError48 } from "@ibiz-template/core";
15480
+ import { RuntimeModelError as RuntimeModelError49 } from "@ibiz-template/core";
15039
15481
 
15040
15482
  // src/ui-logic/index.ts
15041
15483
  import { RuntimeError as RuntimeError44 } from "@ibiz-template/core";
15042
15484
 
15043
15485
  // src/ui-logic/ui-logic.ts
15044
- import { ModelError as ModelError25, RuntimeModelError as RuntimeModelError47 } from "@ibiz-template/core";
15486
+ import { ModelError as ModelError25, RuntimeModelError as RuntimeModelError48 } from "@ibiz-template/core";
15045
15487
 
15046
15488
  // src/ui-logic/ui-logic-context.ts
15047
15489
  var UILogicContext = class {
@@ -15187,24 +15629,24 @@ var UILogicContext = class {
15187
15629
  };
15188
15630
 
15189
15631
  // src/ui-logic/ui-logic-node/de-action-node/de-action-node.ts
15190
- import { RuntimeModelError as RuntimeModelError33 } from "@ibiz-template/core";
15632
+ import { RuntimeModelError as RuntimeModelError34 } from "@ibiz-template/core";
15191
15633
 
15192
15634
  // src/ui-logic/ui-logic-link/ui-logic-link.ts
15193
15635
  import { ModelError as ModelError20 } from "@ibiz-template/core";
15194
15636
 
15195
15637
  // src/ui-logic/ui-logic-link/ui-logic-link-group-cond/ui-logic-link-group-cond.ts
15196
- import { RuntimeModelError as RuntimeModelError32 } from "@ibiz-template/core";
15638
+ import { RuntimeModelError as RuntimeModelError33 } from "@ibiz-template/core";
15197
15639
 
15198
15640
  // src/ui-logic/ui-logic-link/ui-logic-link-cond/ui-logic-link-cond.ts
15199
15641
  var UILogicLinkCond = class {
15200
15642
  };
15201
15643
 
15202
15644
  // src/ui-logic/ui-logic-link/ui-logic-link-single-cond/ui-logic-link-single-cond.ts
15203
- import { ModelError as ModelError19, RuntimeModelError as RuntimeModelError31 } from "@ibiz-template/core";
15645
+ import { ModelError as ModelError19, RuntimeModelError as RuntimeModelError32 } from "@ibiz-template/core";
15204
15646
 
15205
15647
  // src/ui-logic/utils/handle-src-val.ts
15206
15648
  import { ModelError as ModelError18 } from "@ibiz-template/core";
15207
- import { clone as clone18 } from "ramda";
15649
+ import { clone as clone20 } from "ramda";
15208
15650
  function handleSrcVal2(ctx, srcValParams) {
15209
15651
  const { srcDEUILogicParamId, srcFieldName, srcValue } = srcValParams;
15210
15652
  const srcValueType = srcValParams.srcValueType || "SRCDLPARAM";
@@ -15231,7 +15673,7 @@ function handleSrcVal2(ctx, srcValParams) {
15231
15673
  value = ctx.parameters.context;
15232
15674
  break;
15233
15675
  case "ENVPARAM":
15234
- value = clone18(ibiz.env);
15676
+ value = clone20(ibiz.env);
15235
15677
  break;
15236
15678
  default:
15237
15679
  throw new ModelError18(srcValParams, "\u6682\u672A\u652F\u6301\u6E90\u503C\u7C7B\u578B".concat(srcValueType));
@@ -15296,7 +15738,7 @@ var UILogicLinkSingleCond = class extends UILogicLinkCond {
15296
15738
  switch (this.type) {
15297
15739
  case "ENTITYFIELD": {
15298
15740
  if (!this.value) {
15299
- throw new RuntimeModelError31(
15741
+ throw new RuntimeModelError32(
15300
15742
  this.model,
15301
15743
  "\u5F53\u524D\u6761\u4EF6\u503C\u7C7B\u578B\u4E3A[\u6570\u636E\u5BF9\u8C61\u5C5E\u6027],\u7F3A\u5C11\u914D\u7F6E\u6761\u4EF6\u503C"
15302
15744
  );
@@ -15306,7 +15748,7 @@ var UILogicLinkSingleCond = class extends UILogicLinkCond {
15306
15748
  }
15307
15749
  case "SRCENTITYFIELD": {
15308
15750
  if (!this.value) {
15309
- throw new RuntimeModelError31(
15751
+ throw new RuntimeModelError32(
15310
15752
  this.model,
15311
15753
  "\u5F53\u524D\u6761\u4EF6\u503C\u7C7B\u578B\u4E3A[\u6E90\u6570\u636E\u5BF9\u8C61\u5C5E\u6027],\u7F3A\u5C11\u914D\u7F6E\u6761\u4EF6\u503C"
15312
15754
  );
@@ -15372,7 +15814,7 @@ var UILogicLinkGroupCond = class _UILogicLinkGroupCond extends UILogicLinkCond {
15372
15814
  test(ctx, context, data) {
15373
15815
  let bol = true;
15374
15816
  if (this.conds.length === 0) {
15375
- throw new RuntimeModelError32(this.model, "\u754C\u9762\u8FDE\u63A5\u6761\u4EF6\u903B\u8F91\u7EC4\u672A\u914D\u7F6E\u903B\u8F91\u9879");
15817
+ throw new RuntimeModelError33(this.model, "\u754C\u9762\u8FDE\u63A5\u6761\u4EF6\u903B\u8F91\u7EC4\u672A\u914D\u7F6E\u903B\u8F91\u9879");
15376
15818
  }
15377
15819
  for (let i = 0; i < this.conds.length; i++) {
15378
15820
  const cond = this.conds[i];
@@ -15498,10 +15940,10 @@ var DEActionNode2 = class extends UILogicNode {
15498
15940
  retDEUILogicParamId
15499
15941
  } = this.model;
15500
15942
  if (!dstAppDataEntityId) {
15501
- throw new RuntimeModelError33(this.model, "\u672A\u6307\u5B9A\u5E94\u7528\u5B9E\u4F53");
15943
+ throw new RuntimeModelError34(this.model, "\u672A\u6307\u5B9A\u5E94\u7528\u5B9E\u4F53");
15502
15944
  }
15503
15945
  if (!dstAppDEActionId) {
15504
- throw new RuntimeModelError33(this.model, "\u672A\u6307\u5B9A\u5B9E\u4F53\u884C\u4E3A");
15946
+ throw new RuntimeModelError34(this.model, "\u672A\u6307\u5B9A\u5B9E\u4F53\u884C\u4E3A");
15505
15947
  }
15506
15948
  const requestData = ctx.params[dstDEUILogicParamId];
15507
15949
  const app = ibiz.hub.getApp(ctx.context.srfappid);
@@ -15519,13 +15961,13 @@ var DEActionNode2 = class extends UILogicNode {
15519
15961
  };
15520
15962
 
15521
15963
  // src/ui-logic/ui-logic-node/de-ui-action-node/de-ui-action-node.ts
15522
- import { RuntimeModelError as RuntimeModelError34 } from "@ibiz-template/core";
15964
+ import { RuntimeModelError as RuntimeModelError35 } from "@ibiz-template/core";
15523
15965
  var DEUIActionNode = class extends UILogicNode {
15524
15966
  async exec(ctx) {
15525
15967
  const { dstAppDEUIActionId, dstDEUILogicParamId } = this.model;
15526
15968
  const { data, parameters } = ctx;
15527
15969
  if (!dstAppDEUIActionId) {
15528
- throw new RuntimeModelError34(this.model, "\u672A\u914D\u7F6E\u754C\u9762\u884C\u4E3A");
15970
+ throw new RuntimeModelError35(this.model, "\u672A\u914D\u7F6E\u754C\u9762\u884C\u4E3A");
15529
15971
  }
15530
15972
  let actionData = [data];
15531
15973
  if (dstDEUILogicParamId) {
@@ -15590,7 +16032,7 @@ var EndNode2 = class extends UILogicNode {
15590
16032
 
15591
16033
  // src/ui-logic/ui-logic-node/prepare-js-param-node/prepare-js-param-node.ts
15592
16034
  import { ModelError as ModelError22, RuntimeError as RuntimeError39 } from "@ibiz-template/core";
15593
- import { clone as clone19 } from "ramda";
16035
+ import { clone as clone21 } from "ramda";
15594
16036
  var PrepareJSParamNode = class extends UILogicNode {
15595
16037
  async exec(ctx) {
15596
16038
  const nodeParams = this.model.deuilogicNodeParams;
@@ -15679,7 +16121,7 @@ var PrepareJSParamNode = class extends UILogicNode {
15679
16121
  copyParam(nodeParam, ctx) {
15680
16122
  const { dstDEUILogicParamId } = nodeParam;
15681
16123
  const srcVal = handleSrcVal2(ctx, nodeParam);
15682
- ctx.params[dstDEUILogicParamId] = clone19(srcVal);
16124
+ ctx.params[dstDEUILogicParamId] = clone21(srcVal);
15683
16125
  }
15684
16126
  /**
15685
16127
  * 绑定参数
@@ -15756,20 +16198,20 @@ var PrepareJSParamNode = class extends UILogicNode {
15756
16198
  };
15757
16199
 
15758
16200
  // src/ui-logic/ui-logic-node/view-ctrl-invoke-node/view-ctrl-invoke-node.ts
15759
- import { RuntimeError as RuntimeError40, RuntimeModelError as RuntimeModelError35 } from "@ibiz-template/core";
16201
+ import { RuntimeError as RuntimeError40, RuntimeModelError as RuntimeModelError36 } from "@ibiz-template/core";
15760
16202
  import { isFunction } from "lodash-es";
15761
16203
  var ViewCtrlInvokeNode = class extends UILogicNode {
15762
16204
  async exec(ctx) {
15763
16205
  ctx.isEndNode = true;
15764
16206
  const { invokeMethod, invokeCtrlId, invokeParamId } = this.model;
15765
16207
  if (!invokeCtrlId) {
15766
- throw new RuntimeModelError35(this.model, "\u6CA1\u6709\u914D\u7F6E\u754C\u9762\u5BF9\u8C61");
16208
+ throw new RuntimeModelError36(this.model, "\u6CA1\u6709\u914D\u7F6E\u754C\u9762\u5BF9\u8C61");
15767
16209
  }
15768
16210
  if (!invokeParamId) {
15769
- throw new RuntimeModelError35(this.model, "\u6CA1\u6709\u914D\u7F6E\u64CD\u4F5C\u53C2\u6570");
16211
+ throw new RuntimeModelError36(this.model, "\u6CA1\u6709\u914D\u7F6E\u64CD\u4F5C\u53C2\u6570");
15770
16212
  }
15771
16213
  if (!invokeMethod) {
15772
- throw new RuntimeModelError35(this.model, "\u6CA1\u6709\u914D\u7F6E\u8C03\u7528\u65B9\u6CD5");
16214
+ throw new RuntimeModelError36(this.model, "\u6CA1\u6709\u914D\u7F6E\u8C03\u7528\u65B9\u6CD5");
15773
16215
  }
15774
16216
  const invokeParam = ctx.params[invokeParamId];
15775
16217
  if (!invokeParam) {
@@ -15787,12 +16229,12 @@ var ViewCtrlInvokeNode = class extends UILogicNode {
15787
16229
  };
15788
16230
 
15789
16231
  // src/ui-logic/ui-logic-node/bind-param-node/bind-param-node.ts
15790
- import { RuntimeModelError as RuntimeModelError36 } from "@ibiz-template/core";
16232
+ import { RuntimeModelError as RuntimeModelError37 } from "@ibiz-template/core";
15791
16233
  var BindParamNode2 = class extends UILogicNode {
15792
16234
  async exec(ctx) {
15793
16235
  const { dstDEUILogicParamId, srcDEUILogicParamId } = this.model;
15794
16236
  if (!dstDEUILogicParamId || !srcDEUILogicParamId) {
15795
- throw new RuntimeModelError36(
16237
+ throw new RuntimeModelError37(
15796
16238
  this.model,
15797
16239
  "\u7F3A\u5C11\u76EE\u6807\u53C2\u6570\u5BF9\u8C61\u6216\u8005\u6E90\u53C2\u6570\u5BF9\u8C61\u914D\u7F6E"
15798
16240
  );
@@ -15803,7 +16245,7 @@ var BindParamNode2 = class extends UILogicNode {
15803
16245
  };
15804
16246
 
15805
16247
  // src/ui-logic/ui-logic-node/msg-box-node/msg-box-node.ts
15806
- import { ModelError as ModelError23, RuntimeModelError as RuntimeModelError37 } from "@ibiz-template/core";
16248
+ import { ModelError as ModelError23, RuntimeModelError as RuntimeModelError38 } from "@ibiz-template/core";
15807
16249
  var MsgBoxNode = class extends UILogicNode {
15808
16250
  constructor() {
15809
16251
  super(...arguments);
@@ -15817,10 +16259,10 @@ var MsgBoxNode = class extends UILogicNode {
15817
16259
  async exec(ctx) {
15818
16260
  const { msgBoxType, buttonsType, msgBoxParamId } = this.model;
15819
16261
  if (!msgBoxType) {
15820
- throw new RuntimeModelError37(this.model, "\u7F3A\u5C11\u6D88\u606F\u7C7B\u578B\u7684\u914D\u7F6E");
16262
+ throw new RuntimeModelError38(this.model, "\u7F3A\u5C11\u6D88\u606F\u7C7B\u578B\u7684\u914D\u7F6E");
15821
16263
  }
15822
16264
  if (!buttonsType) {
15823
- throw new RuntimeModelError37(this.model, "\u7F3A\u5C11\u6309\u94AE\u7C7B\u578B\u7684\u914D\u7F6E");
16265
+ throw new RuntimeModelError38(this.model, "\u7F3A\u5C11\u6309\u94AE\u7C7B\u578B\u7684\u914D\u7F6E");
15824
16266
  }
15825
16267
  let { title } = this.model;
15826
16268
  let { message } = this.model;
@@ -15880,49 +16322,49 @@ var PFPluginNode = class extends UILogicNode {
15880
16322
  };
15881
16323
 
15882
16324
  // src/ui-logic/ui-logic-node/debug-param-node/debug-param-node.ts
15883
- import { RuntimeModelError as RuntimeModelError38 } from "@ibiz-template/core";
16325
+ import { RuntimeModelError as RuntimeModelError39 } from "@ibiz-template/core";
15884
16326
  var DebugParamNode = class extends UILogicNode {
15885
16327
  async exec(ctx) {
15886
16328
  const { dstDEUILogicParamId, name } = this.model;
15887
16329
  if (!dstDEUILogicParamId) {
15888
- throw new RuntimeModelError38(this.model, "\u7F3A\u5C11\u76EE\u6807\u53C2\u6570\u5BF9\u8C61\u914D\u7F6E");
16330
+ throw new RuntimeModelError39(this.model, "\u7F3A\u5C11\u76EE\u6807\u53C2\u6570\u5BF9\u8C61\u914D\u7F6E");
15889
16331
  }
15890
16332
  const param = ctx.params[dstDEUILogicParamId];
15891
- console.log("\u903B\u8F91\u8282\u70B9".concat(name, "\u64CD\u4F5C\u53C2\u6570\u503C:"), param);
16333
+ ibiz.log.debug("\u903B\u8F91\u8282\u70B9".concat(name, "\u64CD\u4F5C\u53C2\u6570\u503C:"), param);
15892
16334
  }
15893
16335
  };
15894
16336
 
15895
16337
  // src/ui-logic/ui-logic-node/reset-param-node/reset-param-node.ts
15896
- import { RuntimeModelError as RuntimeModelError39 } from "@ibiz-template/core";
16338
+ import { RuntimeModelError as RuntimeModelError40 } from "@ibiz-template/core";
15897
16339
  var ResetParamNode2 = class extends UILogicNode {
15898
16340
  async exec(ctx) {
15899
16341
  const { dstDEUILogicParamId } = this.model;
15900
16342
  if (!dstDEUILogicParamId) {
15901
- throw new RuntimeModelError39(this.model, "\u7F3A\u5C11\u76EE\u6807\u53C2\u6570\u5BF9\u8C61\u914D\u7F6E");
16343
+ throw new RuntimeModelError40(this.model, "\u7F3A\u5C11\u76EE\u6807\u53C2\u6570\u5BF9\u8C61\u914D\u7F6E");
15902
16344
  }
15903
16345
  ctx.resetParam(dstDEUILogicParamId);
15904
16346
  }
15905
16347
  };
15906
16348
 
15907
16349
  // src/ui-logic/ui-logic-node/copy-param-node/copy-param-node.ts
15908
- import { RuntimeModelError as RuntimeModelError40 } from "@ibiz-template/core";
15909
- import { clone as clone20 } from "ramda";
16350
+ import { RuntimeModelError as RuntimeModelError41 } from "@ibiz-template/core";
16351
+ import { clone as clone22 } from "ramda";
15910
16352
  var CopyParamNode2 = class extends UILogicNode {
15911
16353
  async exec(ctx) {
15912
16354
  const { dstDEUILogicParamId, srcDEUILogicParamId } = this.model;
15913
16355
  if (!dstDEUILogicParamId || !srcDEUILogicParamId) {
15914
- throw new RuntimeModelError40(
16356
+ throw new RuntimeModelError41(
15915
16357
  this.model,
15916
16358
  "\u7F3A\u5C11\u76EE\u6807\u53C2\u6570\u5BF9\u8C61\u6216\u8005\u6E90\u53C2\u6570\u5BF9\u8C61\u914D\u7F6E"
15917
16359
  );
15918
16360
  }
15919
16361
  const srcVal = handleSrcVal2(ctx, this.model);
15920
- ctx.params[dstDEUILogicParamId] = clone20(srcVal);
16362
+ ctx.params[dstDEUILogicParamId] = clone22(srcVal);
15921
16363
  }
15922
16364
  };
15923
16365
 
15924
16366
  // src/ui-logic/ui-logic-node/append-param-node/append-param-node.ts
15925
- import { RuntimeModelError as RuntimeModelError41 } from "@ibiz-template/core";
16367
+ import { RuntimeModelError as RuntimeModelError42 } from "@ibiz-template/core";
15926
16368
  var AppendParamNode2 = class extends UILogicNode {
15927
16369
  async exec(ctx) {
15928
16370
  const {
@@ -15933,7 +16375,7 @@ var AppendParamNode2 = class extends UILogicNode {
15933
16375
  srcSize
15934
16376
  } = this.model;
15935
16377
  if (!dstDEUILogicParamId || !srcDEUILogicParamId) {
15936
- throw new RuntimeModelError41(
16378
+ throw new RuntimeModelError42(
15937
16379
  this.model,
15938
16380
  "\u7F3A\u5C11\u76EE\u6807\u53C2\u6570\u5BF9\u8C61\u6216\u8005\u6E90\u53C2\u6570\u5BF9\u8C61\u914D\u7F6E"
15939
16381
  );
@@ -15951,12 +16393,12 @@ var AppendParamNode2 = class extends UILogicNode {
15951
16393
  };
15952
16394
 
15953
16395
  // src/ui-logic/ui-logic-node/sort-param-node/sort-param-node.ts
15954
- import { RuntimeModelError as RuntimeModelError42 } from "@ibiz-template/core";
16396
+ import { RuntimeModelError as RuntimeModelError43 } from "@ibiz-template/core";
15955
16397
  var SortParamNode2 = class extends UILogicNode {
15956
16398
  async exec(ctx) {
15957
16399
  const { dstDEUILogicParamId, dstSortDir, dstFieldName } = this.model;
15958
16400
  if (!dstDEUILogicParamId || !dstFieldName) {
15959
- throw new RuntimeModelError42(this.model, "\u7F3A\u5C11\u76EE\u6807\u53C2\u6570\u5BF9\u8C61\u6216\u76EE\u6807\u5C5E\u6027\u914D\u7F6E");
16401
+ throw new RuntimeModelError43(this.model, "\u7F3A\u5C11\u76EE\u6807\u53C2\u6570\u5BF9\u8C61\u6216\u76EE\u6807\u5C5E\u6027\u914D\u7F6E");
15960
16402
  }
15961
16403
  const key = dstFieldName;
15962
16404
  const arr = ctx.params[dstDEUILogicParamId];
@@ -15967,19 +16409,19 @@ var SortParamNode2 = class extends UILogicNode {
15967
16409
  };
15968
16410
 
15969
16411
  // src/ui-logic/ui-logic-node/renew-param-node/renew-param-node.ts
15970
- import { RuntimeModelError as RuntimeModelError43 } from "@ibiz-template/core";
16412
+ import { RuntimeModelError as RuntimeModelError44 } from "@ibiz-template/core";
15971
16413
  var RenewParamNode2 = class extends UILogicNode {
15972
16414
  async exec(ctx) {
15973
16415
  const { dstDEUILogicParamId } = this.model;
15974
16416
  if (!dstDEUILogicParamId) {
15975
- throw new RuntimeModelError43(this.model, "\u7F3A\u5C11\u76EE\u6807\u53C2\u6570\u5BF9\u8C61\u914D\u7F6E");
16417
+ throw new RuntimeModelError44(this.model, "\u7F3A\u5C11\u76EE\u6807\u53C2\u6570\u5BF9\u8C61\u914D\u7F6E");
15976
16418
  }
15977
16419
  ctx.renewParam(dstDEUILogicParamId);
15978
16420
  }
15979
16421
  };
15980
16422
 
15981
16423
  // src/ui-logic/ui-logic-node/data-set-node/data-set-node.ts
15982
- import { RuntimeModelError as RuntimeModelError44 } from "@ibiz-template/core";
16424
+ import { RuntimeModelError as RuntimeModelError45 } from "@ibiz-template/core";
15983
16425
  var DataSetNode2 = class extends UILogicNode {
15984
16426
  async exec(ctx) {
15985
16427
  const {
@@ -15989,7 +16431,7 @@ var DataSetNode2 = class extends UILogicNode {
15989
16431
  retDEUILogicParamId
15990
16432
  } = this.model;
15991
16433
  if (!dstDEUILogicParamId) {
15992
- throw new RuntimeModelError44(this.model, "\u7F3A\u5C11\u914D\u7F6E\u8FC7\u6EE4\u53C2\u6570");
16434
+ throw new RuntimeModelError45(this.model, "\u7F3A\u5C11\u914D\u7F6E\u8FC7\u6EE4\u53C2\u6570");
15993
16435
  }
15994
16436
  const queryParams = ctx.params[dstDEUILogicParamId];
15995
16437
  const app = ibiz.hub.getApp(ctx.context.srfappid);
@@ -16015,19 +16457,19 @@ var ThrowExceptionNode2 = class extends UILogicNode {
16015
16457
  };
16016
16458
 
16017
16459
  // src/ui-logic/ui-logic-node/view-ctrl-fire-event-node/view-ctrl-fire-event-node.ts
16018
- import { RuntimeError as RuntimeError42, RuntimeModelError as RuntimeModelError45 } from "@ibiz-template/core";
16460
+ import { RuntimeError as RuntimeError42, RuntimeModelError as RuntimeModelError46 } from "@ibiz-template/core";
16019
16461
  var ViewCtrlFireEventNode = class extends UILogicNode {
16020
16462
  async exec(ctx) {
16021
16463
  ctx.isEndNode = true;
16022
16464
  const { eventName, eventParamId, fireCtrlId } = this.model;
16023
16465
  if (!fireCtrlId) {
16024
- throw new RuntimeModelError45(this.model, "\u6CA1\u6709\u914D\u7F6E\u89E6\u53D1\u5BF9\u8C61");
16466
+ throw new RuntimeModelError46(this.model, "\u6CA1\u6709\u914D\u7F6E\u89E6\u53D1\u5BF9\u8C61");
16025
16467
  }
16026
16468
  if (!eventName) {
16027
- throw new RuntimeModelError45(this.model, "\u6CA1\u6709\u914D\u7F6E\u4E8B\u4EF6\u540D\u79F0\u53C2\u6570");
16469
+ throw new RuntimeModelError46(this.model, "\u6CA1\u6709\u914D\u7F6E\u4E8B\u4EF6\u540D\u79F0\u53C2\u6570");
16028
16470
  }
16029
16471
  if (!eventParamId) {
16030
- throw new RuntimeModelError45(this.model, "\u6CA1\u6709\u914D\u7F6E\u4E8B\u4EF6\u53C2\u6570");
16472
+ throw new RuntimeModelError46(this.model, "\u6CA1\u6709\u914D\u7F6E\u4E8B\u4EF6\u53C2\u6570");
16031
16473
  }
16032
16474
  const invokeCtrl = ctx.params[fireCtrlId];
16033
16475
  if (!invokeCtrl) {
@@ -16042,7 +16484,7 @@ var ViewCtrlFireEventNode = class extends UILogicNode {
16042
16484
  };
16043
16485
 
16044
16486
  // src/ui-logic/ui-logic-node/execute-de-logic-node/execute-de-logic-node.ts
16045
- import { RuntimeError as RuntimeError43, RuntimeModelError as RuntimeModelError46 } from "@ibiz-template/core";
16487
+ import { RuntimeError as RuntimeError43, RuntimeModelError as RuntimeModelError47 } from "@ibiz-template/core";
16046
16488
  var ExecuteDELogicNode = class extends UILogicNode {
16047
16489
  async exec(ctx) {
16048
16490
  const {
@@ -16052,13 +16494,13 @@ var ExecuteDELogicNode = class extends UILogicNode {
16052
16494
  retDEUILogicParamId
16053
16495
  } = this.model;
16054
16496
  if (!dstAppDataEntityId) {
16055
- throw new RuntimeModelError46(this.model, "\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53");
16497
+ throw new RuntimeModelError47(this.model, "\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53");
16056
16498
  }
16057
16499
  if (!dstAppDELogicId) {
16058
- throw new RuntimeModelError46(this.model, "\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53\u903B\u8F91");
16500
+ throw new RuntimeModelError47(this.model, "\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53\u903B\u8F91");
16059
16501
  }
16060
16502
  if (!dstDEUILogicParamId) {
16061
- throw new RuntimeModelError46(this.model, "\u6CA1\u6709\u914D\u7F6E\u4F20\u5165\u903B\u8F91\u53C2\u6570");
16503
+ throw new RuntimeModelError47(this.model, "\u6CA1\u6709\u914D\u7F6E\u4F20\u5165\u903B\u8F91\u53C2\u6570");
16062
16504
  }
16063
16505
  const dstParam = ctx.params[dstDEUILogicParamId];
16064
16506
  if (!dstParam) {
@@ -16080,7 +16522,6 @@ var ExecuteDELogicNode = class extends UILogicNode {
16080
16522
  // src/ui-logic/ui-logic-node/raw-js-code-node/raw-js-code-node.ts
16081
16523
  var RawJSCodeNode = class extends UILogicNode {
16082
16524
  async exec(ctx) {
16083
- console.log(ctx);
16084
16525
  ScriptFactory.execScriptFn(
16085
16526
  {
16086
16527
  view: ctx.view,
@@ -16220,7 +16661,7 @@ var UILogic = class {
16220
16661
  this.params = /* @__PURE__ */ new Map();
16221
16662
  var _a;
16222
16663
  if (!((_a = model.deuilogicNodes) == null ? void 0 : _a.length)) {
16223
- throw new RuntimeModelError47(model, "\u754C\u9762\u903B\u8F91\u6CA1\u6709\u914D\u7F6E\u903B\u8F91\u8282\u70B9");
16664
+ throw new RuntimeModelError48(model, "\u754C\u9762\u903B\u8F91\u6CA1\u6709\u914D\u7F6E\u903B\u8F91\u8282\u70B9");
16224
16665
  }
16225
16666
  model.deuilogicNodes.forEach((node) => {
16226
16667
  const { logicNodeType } = node;
@@ -16340,7 +16781,7 @@ var UILogic = class {
16340
16781
  const start = this.nodes.get(startDEUILogicNodeId);
16341
16782
  await this.deepExec(start, ctx);
16342
16783
  } else {
16343
- throw new RuntimeModelError47(this.model, "\u672A\u8BBE\u7F6E\u8D77\u59CB\u8282\u70B9");
16784
+ throw new RuntimeModelError48(this.model, "\u672A\u8BBE\u7F6E\u8D77\u59CB\u8282\u70B9");
16344
16785
  }
16345
16786
  if (ctx.isEndNode) {
16346
16787
  return ctx.result;
@@ -16475,7 +16916,7 @@ var UIActionProviderBase = class {
16475
16916
  const { appDEUILogicId, appDataEntityId, uilogicAttachMode } = action;
16476
16917
  if (uilogicAttachMode === "REPLACE") {
16477
16918
  if (!appDEUILogicId) {
16478
- throw new RuntimeModelError48(action, "\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53\u754C\u9762\u903B\u8F91");
16919
+ throw new RuntimeModelError49(action, "\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53\u754C\u9762\u903B\u8F91");
16479
16920
  }
16480
16921
  await execUILogic(appDEUILogicId, appDataEntityId, args);
16481
16922
  return result;
@@ -16490,7 +16931,7 @@ var UIActionProviderBase = class {
16490
16931
  }
16491
16932
  if (action.uilogicAttachMode === "AFTER") {
16492
16933
  if (!appDEUILogicId) {
16493
- throw new RuntimeModelError48(action, "\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53\u754C\u9762\u903B\u8F91");
16934
+ throw new RuntimeModelError49(action, "\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53\u754C\u9762\u903B\u8F91");
16494
16935
  }
16495
16936
  await execUILogic(
16496
16937
  appDEUILogicId,
@@ -16715,7 +17156,7 @@ var BackendUIActionProvider = class extends UIActionProviderBase {
16715
17156
  const entityName = action.appDataEntityId;
16716
17157
  const methodName = action.appDEMethodId;
16717
17158
  if (!entityName || !methodName) {
16718
- throw new RuntimeModelError49(action, "\u672A\u914D\u7F6E\u5B9E\u4F53\u6216\u5B9E\u4F53\u884C\u4E3A");
17159
+ throw new RuntimeModelError50(action, "\u672A\u914D\u7F6E\u5B9E\u4F53\u6216\u5B9E\u4F53\u884C\u4E3A");
16719
17160
  }
16720
17161
  const { resultContext, resultParams, resultData } = await this.handleParams(
16721
17162
  action,
@@ -16840,7 +17281,7 @@ var SysUIActionProvider = class extends UIActionProviderBase {
16840
17281
  // src/ui-action/provider/front-ui-action-provider.ts
16841
17282
  import {
16842
17283
  StringUtil,
16843
- RuntimeModelError as RuntimeModelError50,
17284
+ RuntimeModelError as RuntimeModelError51,
16844
17285
  ModelError as ModelError26,
16845
17286
  RuntimeError as RuntimeError46
16846
17287
  } from "@ibiz-template/core";
@@ -16858,7 +17299,7 @@ var FrontUIActionProvider = class extends UIActionProviderBase {
16858
17299
  case "WIZARD": {
16859
17300
  const frontPSAppView = action.frontAppViewId;
16860
17301
  if (!frontPSAppView) {
16861
- throw new RuntimeModelError50(action, "\u672A\u914D\u7F6E\u6253\u5F00\u89C6\u56FE");
17302
+ throw new RuntimeModelError51(action, "\u672A\u914D\u7F6E\u6253\u5F00\u89C6\u56FE");
16862
17303
  }
16863
17304
  const { resultContext, resultParams } = await this.handleParams(
16864
17305
  action,
@@ -16923,7 +17364,7 @@ var FrontUIActionProvider = class extends UIActionProviderBase {
16923
17364
  );
16924
17365
  return result || {};
16925
17366
  }
16926
- throw new RuntimeModelError50(action, "\u81EA\u5B9A\u4E49\u7C7B\u578B\u7F3A\u5C11\u914D\u7F6E\u811A\u672C\u4EE3\u7801");
17367
+ throw new RuntimeModelError51(action, "\u81EA\u5B9A\u4E49\u7C7B\u578B\u7F3A\u5C11\u914D\u7F6E\u811A\u672C\u4EE3\u7801");
16927
17368
  }
16928
17369
  /**
16929
17370
  * 执行打印行为
@@ -16992,8 +17433,14 @@ var FrontUIActionProvider = class extends UIActionProviderBase {
16992
17433
  * @param {IUILogicParams} args
16993
17434
  * @return {*}
16994
17435
  */
16995
- async executeDataImport(action, _args) {
17436
+ async executeDataImport(action, args) {
16996
17437
  var _a;
17438
+ const { resultContext, resultParams } = await this.handleParams(
17439
+ action,
17440
+ args.context,
17441
+ args.data,
17442
+ args.params
17443
+ );
16997
17444
  const appDataEntity = await ibiz.hub.getAppDataEntity(
16998
17445
  action.appDataEntityId,
16999
17446
  action.appId
@@ -17011,7 +17458,9 @@ var FrontUIActionProvider = class extends UIActionProviderBase {
17011
17458
  {
17012
17459
  dismiss: () => modal.dismiss(),
17013
17460
  appDataEntity,
17014
- dataImport: appDEDataImport
17461
+ dataImport: appDEDataImport,
17462
+ context: resultContext,
17463
+ params: resultParams
17015
17464
  },
17016
17465
  {
17017
17466
  width: "auto",
@@ -17764,7 +18213,7 @@ var RawItemPortletController = class extends PortletPartController {
17764
18213
  };
17765
18214
 
17766
18215
  // src/controller/control/data-view/data-view.controller.ts
17767
- import { RuntimeModelError as RuntimeModelError51 } from "@ibiz-template/core";
18216
+ import { RuntimeModelError as RuntimeModelError52 } from "@ibiz-template/core";
17768
18217
  import { isNil as isNil22 } from "ramda";
17769
18218
 
17770
18219
  // src/controller/control/data-view/data-view.service.ts
@@ -17979,7 +18428,7 @@ var DataViewControlController = class extends MDControlController {
17979
18428
  const optItemModel = this.getOptItemModel();
17980
18429
  if (optItemModel) {
17981
18430
  if (!optItemModel.deuiactionGroup) {
17982
- throw new RuntimeModelError51(this.model, "\u64CD\u4F5C\u9879\u6CA1\u6709\u914D\u7F6E\u754C\u9762\u884C\u4E3A\u7EC4");
18431
+ throw new RuntimeModelError52(this.model, "\u64CD\u4F5C\u9879\u6CA1\u6709\u914D\u7F6E\u754C\u9762\u884C\u4E3A\u7EC4");
17983
18432
  }
17984
18433
  if (!((_a = optItemModel.deuiactionGroup.uiactionGroupDetails) == null ? void 0 : _a.length)) {
17985
18434
  ibiz.log.debug("\u64CD\u4F5C\u9879\u754C\u9762\u884C\u4E3A\u7EC4\u6CA1\u6709\u914D\u7F6E\u754C\u9762\u884C\u4E3A");
@@ -18032,7 +18481,7 @@ var DataViewControlController = class extends MDControlController {
18032
18481
  const { enableGroup, groupMode, groupAppDEFieldId } = this.model;
18033
18482
  if (enableGroup && groupMode) {
18034
18483
  if (!groupAppDEFieldId) {
18035
- throw new RuntimeModelError51(this.model, "\u5206\u7EC4\u5C5E\u6027\u6CA1\u6709\u914D\u7F6E");
18484
+ throw new RuntimeModelError52(this.model, "\u5206\u7EC4\u5C5E\u6027\u6CA1\u6709\u914D\u7F6E");
18036
18485
  }
18037
18486
  if (groupMode === "AUTO") {
18038
18487
  this.handleAutoGroup();
@@ -18099,7 +18548,7 @@ var DataViewControlController = class extends MDControlController {
18099
18548
  async handleCodeListGroup() {
18100
18549
  const { groupAppDEFieldId, groupCodeListId } = this.model;
18101
18550
  if (!groupCodeListId) {
18102
- throw new RuntimeModelError51(this.model, "\u5206\u7EC4\u4EE3\u7801\u8868\u6CA1\u6709\u914D\u7F6E");
18551
+ throw new RuntimeModelError52(this.model, "\u5206\u7EC4\u4EE3\u7801\u8868\u6CA1\u6709\u914D\u7F6E");
18103
18552
  }
18104
18553
  const { items } = this.state;
18105
18554
  const groupMap = /* @__PURE__ */ new Map();
@@ -18205,7 +18654,7 @@ var DataViewControlController = class extends MDControlController {
18205
18654
  caption = ibiz.i18n.t(item.capLanguageRes.lanResTag, item.caption);
18206
18655
  }
18207
18656
  if (!item.appDEFieldId) {
18208
- throw new RuntimeModelError51(item, "\u542F\u7528\u6392\u5E8F\u7684\u9879\u5FC5\u987B\u5173\u8054\u5B9E\u4F53\u5C5E\u6027");
18657
+ throw new RuntimeModelError52(item, "\u542F\u7528\u6392\u5E8F\u7684\u9879\u5FC5\u987B\u5173\u8054\u5B9E\u4F53\u5C5E\u6027");
18209
18658
  }
18210
18659
  const tempItem = {
18211
18660
  caption,
@@ -18223,10 +18672,10 @@ var DataViewControlController = class extends MDControlController {
18223
18672
  };
18224
18673
 
18225
18674
  // src/controller/control/exp-bar/calendar-exp-bar.controller.ts
18226
- import { RuntimeModelError as RuntimeModelError53 } from "@ibiz-template/core";
18675
+ import { RuntimeModelError as RuntimeModelError54 } from "@ibiz-template/core";
18227
18676
 
18228
18677
  // src/controller/control/exp-bar/exp-bar.controller.ts
18229
- import { RuntimeError as RuntimeError48, RuntimeModelError as RuntimeModelError52 } from "@ibiz-template/core";
18678
+ import { RuntimeError as RuntimeError48, RuntimeModelError as RuntimeModelError53 } from "@ibiz-template/core";
18230
18679
  var ExpBarControlController = class extends ControlController {
18231
18680
  constructor() {
18232
18681
  super(...arguments);
@@ -18281,7 +18730,7 @@ var ExpBarControlController = class extends ControlController {
18281
18730
  get xDataController() {
18282
18731
  const controller = this.view.getController(this.model.xdataControlName);
18283
18732
  if (!controller) {
18284
- throw new RuntimeModelError52(
18733
+ throw new RuntimeModelError53(
18285
18734
  this.model,
18286
18735
  "\u65E0\u6CD5\u83B7\u53D6\u591A\u6570\u636E\u90E8\u4EF6[".concat(this.model.xdataControlName, "]\u63A7\u5236\u5668")
18287
18736
  );
@@ -18640,7 +19089,7 @@ var CalendarExpBarController = class extends ExpBarControlController {
18640
19089
  get xDataController() {
18641
19090
  const controller = this.view.getController(this.model.xdataControlName);
18642
19091
  if (!controller) {
18643
- throw new RuntimeModelError53(
19092
+ throw new RuntimeModelError54(
18644
19093
  this.model,
18645
19094
  "\u65E0\u6CD5\u83B7\u53D6\u591A\u6570\u636E\u90E8\u4EF6[".concat(this.model.xdataControlName, "]\u63A7\u5236\u5668")
18646
19095
  );
@@ -18695,7 +19144,7 @@ var CalendarExpBarController = class extends ExpBarControlController {
18695
19144
  };
18696
19145
 
18697
19146
  // src/controller/control/exp-bar/tree-exp-bar.controller.ts
18698
- import { RuntimeError as RuntimeError49, RuntimeModelError as RuntimeModelError54 } from "@ibiz-template/core";
19147
+ import { RuntimeError as RuntimeError49, RuntimeModelError as RuntimeModelError55 } from "@ibiz-template/core";
18699
19148
  var TreeExpBarController = class extends ExpBarControlController {
18700
19149
  constructor() {
18701
19150
  super(...arguments);
@@ -18718,7 +19167,7 @@ var TreeExpBarController = class extends ExpBarControlController {
18718
19167
  get xDataController() {
18719
19168
  const controller = this.view.getController(this.model.xdataControlName);
18720
19169
  if (!controller) {
18721
- throw new RuntimeModelError54(
19170
+ throw new RuntimeModelError55(
18722
19171
  this.model,
18723
19172
  "\u65E0\u6CD5\u83B7\u53D6\u591A\u6570\u636E\u90E8\u4EF6[".concat(this.model.xdataControlName, "]\u63A7\u5236\u5668")
18724
19173
  );
@@ -18963,7 +19412,11 @@ var ChartExpBarController = class extends ExpBarControlController {
18963
19412
  import { RuntimeError as RuntimeError50 } from "@ibiz-template/core";
18964
19413
 
18965
19414
  // src/controller/control/form/form/form.controller.ts
18966
- import { debounceAndAsyncMerge, recursiveIterate as recursiveIterate3 } from "@ibiz-template/core";
19415
+ import {
19416
+ RuntimeModelError as RuntimeModelError56,
19417
+ debounceAndAsyncMerge,
19418
+ recursiveIterate as recursiveIterate3
19419
+ } from "@ibiz-template/core";
18967
19420
  var FormController = class extends ControlController {
18968
19421
  constructor() {
18969
19422
  super(...arguments);
@@ -19087,6 +19540,12 @@ var FormController = class extends ControlController {
19087
19540
  if (!detailProvider) {
19088
19541
  return;
19089
19542
  }
19543
+ if (form.details[detail.id]) {
19544
+ throw new RuntimeModelError56(
19545
+ detail,
19546
+ "\u521D\u59CB\u5316\u5F02\u5E38: \u8868\u5355\u6210\u5458[".concat(detail.id, "](").concat(detail.detailType, ")\u5DF2\u5B58\u5728\uFF0C\u8868\u5355\u9879\u6807\u8BC6\u91CD\u590D\u8BF7\u68C0\u67E5\u914D\u7F6E")
19547
+ );
19548
+ }
19090
19549
  form.providers[detail.id] = detailProvider;
19091
19550
  const detailController = await detailProvider.createController(
19092
19551
  detail,
@@ -19919,6 +20378,9 @@ var FormDetailController = class {
19919
20378
  * @date 2023-10-11 05:03:26
19920
20379
  */
19921
20380
  async onClick(event) {
20381
+ if (event) {
20382
+ event.stopPropagation();
20383
+ }
19922
20384
  this.form.evt.emit("onFormDetailEvent", {
19923
20385
  formDetailName: this.model.id,
19924
20386
  formDetailEventName: "onClick" /* CLICK */,
@@ -20724,7 +21186,7 @@ var FormMDCtrlController = class extends FormDetailController {
20724
21186
  import {
20725
21187
  mergeInLeft,
20726
21188
  ModelError as ModelError27,
20727
- RuntimeModelError as RuntimeModelError55
21189
+ RuntimeModelError as RuntimeModelError57
20728
21190
  } from "@ibiz-template/core";
20729
21191
  var FormMDCtrlMDController = class extends FormMDCtrlController {
20730
21192
  constructor() {
@@ -20750,7 +21212,7 @@ var FormMDCtrlMDController = class extends FormMDCtrlController {
20750
21212
  await super.onInit();
20751
21213
  const { contentControl } = this.model;
20752
21214
  if (!contentControl) {
20753
- throw new RuntimeModelError55(this.model, "\u591A\u6570\u636E\u90E8\u4EF6\u672A\u914D\u7F6E\u5185\u5BB9\u90E8\u4EF6");
21215
+ throw new RuntimeModelError57(this.model, "\u591A\u6570\u636E\u90E8\u4EF6\u672A\u914D\u7F6E\u5185\u5BB9\u90E8\u4EF6");
20754
21216
  }
20755
21217
  if (contentControl.controlType === "GRID") {
20756
21218
  mergeInLeft(contentControl, {
@@ -20847,7 +21309,7 @@ var FormMDCtrlMDController = class extends FormMDCtrlController {
20847
21309
  };
20848
21310
 
20849
21311
  // src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form.controller.ts
20850
- import { RuntimeError as RuntimeError51, RuntimeModelError as RuntimeModelError56 } from "@ibiz-template/core";
21312
+ import { RuntimeError as RuntimeError51, RuntimeModelError as RuntimeModelError58 } from "@ibiz-template/core";
20851
21313
  import { createUUID as createUUID11 } from "qx-util";
20852
21314
 
20853
21315
  // src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-form.state.ts
@@ -20888,7 +21350,7 @@ var FormMDCtrlFormController = class extends FormMDCtrlController {
20888
21350
  super.onInit();
20889
21351
  const { contentControl } = this.model;
20890
21352
  if (!contentControl) {
20891
- throw new RuntimeModelError56(this.model, "\u591A\u6570\u636E\u90E8\u4EF6\u672A\u914D\u7F6E\u5185\u5BB9\u90E8\u4EF6");
21353
+ throw new RuntimeModelError58(this.model, "\u591A\u6570\u636E\u90E8\u4EF6\u672A\u914D\u7F6E\u5185\u5BB9\u90E8\u4EF6");
20892
21354
  }
20893
21355
  contentControl.enableAutoSave = this.enableCreate || this.enableUpdate;
20894
21356
  const controlProvider = await getControlProvider(contentControl);
@@ -21022,7 +21484,7 @@ var FormMDCtrlFormController = class extends FormMDCtrlController {
21022
21484
 
21023
21485
  // src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater.controller.ts
21024
21486
  import { ModelError as ModelError28 } from "@ibiz-template/core";
21025
- import { clone as clone21 } from "ramda";
21487
+ import { clone as clone23 } from "ramda";
21026
21488
  var FormMDCtrlRepeaterController = class extends FormMDCtrlController {
21027
21489
  constructor() {
21028
21490
  super(...arguments);
@@ -21106,7 +21568,7 @@ var FormMDCtrlRepeaterController = class extends FormMDCtrlController {
21106
21568
  copyFields.forEach((key) => {
21107
21569
  tempForm[key] = this.form.model[key];
21108
21570
  });
21109
- this.repeatedForm = clone21(tempForm);
21571
+ this.repeatedForm = clone23(tempForm);
21110
21572
  }
21111
21573
  /**
21112
21574
  * 设置重复器数据(修改主表单里重复器对应属性)
@@ -21214,10 +21676,30 @@ var FormTabPageController = class extends FormDetailController {
21214
21676
  var _a;
21215
21677
  return new FormTabPageState((_a = this.parent) == null ? void 0 : _a.state);
21216
21678
  }
21679
+ /**
21680
+ * 是否激活的分页
21681
+ * @author lxm
21682
+ * @date 2024-01-17 03:16:24
21683
+ * @readonly
21684
+ * @type {boolean}
21685
+ */
21686
+ get isActive() {
21687
+ return this.parent.state.activeTab === this.model.id;
21688
+ }
21217
21689
  };
21218
21690
 
21219
21691
  // src/controller/control/form/form-detail/form-tab-panel/form-tab-panel.state.ts
21220
21692
  var FormTabPanelState = class extends FormDetailState {
21693
+ constructor() {
21694
+ super(...arguments);
21695
+ /**
21696
+ * 当前激活的分页
21697
+ * @author lxm
21698
+ * @date 2024-01-17 02:05:58
21699
+ * @type {string}
21700
+ */
21701
+ this.activeTab = "";
21702
+ }
21221
21703
  };
21222
21704
 
21223
21705
  // src/controller/control/form/form-detail/form-tab-panel/form-tab-panel.controller.ts
@@ -21226,6 +21708,20 @@ var FormTabPanelController = class extends FormDetailController {
21226
21708
  var _a;
21227
21709
  return new FormTabPanelState((_a = this.parent) == null ? void 0 : _a.state);
21228
21710
  }
21711
+ async onInit() {
21712
+ var _a;
21713
+ await super.onInit();
21714
+ this.state.activeTab = ((_a = this.model.deformTabPages) == null ? void 0 : _a[0].id) || "";
21715
+ }
21716
+ /**
21717
+ * 分页点击切换处理
21718
+ * @author lxm
21719
+ * @date 2024-01-17 02:59:38
21720
+ * @param {string} tabId
21721
+ */
21722
+ onTabChange(tabId) {
21723
+ this.state.activeTab = tabId;
21724
+ }
21229
21725
  };
21230
21726
 
21231
21727
  // src/controller/control/form/edit-form/edit-form.controller.ts
@@ -21236,12 +21732,12 @@ import {
21236
21732
  } from "@ibiz-template/core";
21237
21733
  import { debounce as debounce2 } from "lodash-es";
21238
21734
  import { createUUID as createUUID12 } from "qx-util";
21239
- import { clone as clone22 } from "ramda";
21735
+ import { clone as clone24 } from "ramda";
21240
21736
 
21241
21737
  // src/controller/control/form/edit-form/edit-form.service.ts
21242
21738
  import {
21243
21739
  recursiveIterate as recursiveIterate6,
21244
- RuntimeModelError as RuntimeModelError57
21740
+ RuntimeModelError as RuntimeModelError59
21245
21741
  } from "@ibiz-template/core";
21246
21742
  var EditFormService = class extends FormService {
21247
21743
  /**
@@ -21365,7 +21861,7 @@ var EditFormService = class extends FormService {
21365
21861
  const wizardForm = this.model;
21366
21862
  const methodName = (_a = wizardForm.goBackControlAction) == null ? void 0 : _a.appDEMethodId;
21367
21863
  if (!methodName) {
21368
- throw new RuntimeModelError57(this.model, "\u7F3A\u5C11\u8FD4\u56DE\u64CD\u4F5C\u5B9E\u4F53\u884C\u4E3A");
21864
+ throw new RuntimeModelError59(this.model, "\u7F3A\u5C11\u8FD4\u56DE\u64CD\u4F5C\u5B9E\u4F53\u884C\u4E3A");
21369
21865
  }
21370
21866
  let res = await this.exec(
21371
21867
  methodName,
@@ -21601,8 +22097,8 @@ var EditFormController = class extends FormController {
21601
22097
  * @return {*} {Promise<IData>}
21602
22098
  */
21603
22099
  async copy() {
21604
- const context = clone22(this.context);
21605
- const queryParams = clone22(this.params);
22100
+ const context = clone24(this.context);
22101
+ const queryParams = clone24(this.params);
21606
22102
  const appDataEntity = await ibiz.hub.getAppDataEntity(
21607
22103
  this.model.appDataEntityId,
21608
22104
  this.model.appId
@@ -21659,7 +22155,7 @@ var EditFormController = class extends FormController {
21659
22155
  return this.loadDraft();
21660
22156
  }
21661
22157
  const { context, params } = this.handlerAbilityParams(args);
21662
- const queryParams = clone22(params);
22158
+ const queryParams = clone24(params);
21663
22159
  let res;
21664
22160
  try {
21665
22161
  await this.startLoading();
@@ -22225,12 +22721,12 @@ import {
22225
22721
  mergeDefaultInLeft,
22226
22722
  recursiveIterate as recursiveIterate7,
22227
22723
  RuntimeError as RuntimeError53,
22228
- RuntimeModelError as RuntimeModelError59
22724
+ RuntimeModelError as RuntimeModelError61
22229
22725
  } from "@ibiz-template/core";
22230
- import { clone as clone23 } from "ramda";
22726
+ import { clone as clone25 } from "ramda";
22231
22727
 
22232
22728
  // src/controller/control/grid/grid/grid.service.ts
22233
- import { RuntimeModelError as RuntimeModelError58 } from "@ibiz-template/core";
22729
+ import { RuntimeModelError as RuntimeModelError60 } from "@ibiz-template/core";
22234
22730
  var GridService = class extends MDControlService {
22235
22731
  /**
22236
22732
  * 初始化属性映射
@@ -22258,7 +22754,7 @@ var GridService = class extends MDControlService {
22258
22754
  dataType: dataItem.dataType
22259
22755
  });
22260
22756
  } else {
22261
- throw new RuntimeModelError58(
22757
+ throw new RuntimeModelError60(
22262
22758
  column,
22263
22759
  "\u672A\u627E\u5230\u5BF9\u5E94\u7684\u8868\u683C\u6570\u636E\u9879[".concat(deField, "]")
22264
22760
  );
@@ -22537,7 +23033,7 @@ var GridController = class extends MDControlController {
22537
23033
  const result = await calcColumnModelBySchema(json, this);
22538
23034
  if (result && result.degridColumns.length > 0) {
22539
23035
  const { degridColumns, degridDataItems } = result;
22540
- this.model = clone23(this.model);
23036
+ this.model = clone25(this.model);
22541
23037
  this.model.degridColumns = [
22542
23038
  ...(this.model.degridColumns || []).filter((item) => {
22543
23039
  return degridColumns.findIndex((x) => x.id === item.id) === -1;
@@ -22568,11 +23064,11 @@ var GridController = class extends MDControlController {
22568
23064
  (item) => item.model.appDEFieldId === groupAppDEFieldId
22569
23065
  );
22570
23066
  if (!this.groupFieldColumn) {
22571
- throw new RuntimeModelError59(this.model, "\u6CA1\u6709\u914D\u7F6E\u5206\u7EC4\u5C5E\u6027\u7684\u5C5E\u6027\u5217");
23067
+ throw new RuntimeModelError61(this.model, "\u6CA1\u6709\u914D\u7F6E\u5206\u7EC4\u5C5E\u6027\u7684\u5C5E\u6027\u5217");
22572
23068
  }
22573
23069
  const groupFieldName = this.groupFieldColumn.model.id;
22574
23070
  if (!this.groupFieldColumn.model.appCodeListId) {
22575
- throw new RuntimeModelError59(
23071
+ throw new RuntimeModelError61(
22576
23072
  this.groupFieldColumn.model,
22577
23073
  "\u5206\u7EC4\u5C5E\u6027\u7684\u5C5E\u6027\u5217".concat(groupFieldName, "\u6CA1\u6709\u914D\u7F6E\u4EE3\u7801\u8868")
22578
23074
  );
@@ -22582,7 +23078,7 @@ var GridController = class extends MDControlController {
22582
23078
  );
22583
23079
  if (index !== -1 && index !== 0) {
22584
23080
  if (this.isMultistageHeader) {
22585
- throw new RuntimeModelError59(
23081
+ throw new RuntimeModelError61(
22586
23082
  this.model,
22587
23083
  "\u8BF7\u5C06\u5206\u7EC4\u5C5E\u6027\u5217".concat(groupFieldName, "\u914D\u7F6E\u4E3A\u7B2C\u4E00\u5217")
22588
23084
  );
@@ -22592,10 +23088,10 @@ var GridController = class extends MDControlController {
22592
23088
  }
22593
23089
  if (groupMode === "CODELIST") {
22594
23090
  if (!groupCodeListId) {
22595
- throw new RuntimeModelError59(this.model, "\u4EE3\u7801\u8868\u5206\u7EC4\u6A21\u5F0F\u9700\u8981\u914D\u7F6E\u4EE3\u7801\u8868");
23091
+ throw new RuntimeModelError61(this.model, "\u4EE3\u7801\u8868\u5206\u7EC4\u6A21\u5F0F\u9700\u8981\u914D\u7F6E\u4EE3\u7801\u8868");
22596
23092
  }
22597
23093
  if (this.groupFieldColumn.model.appCodeListId !== groupCodeListId) {
22598
- throw new RuntimeModelError59(
23094
+ throw new RuntimeModelError61(
22599
23095
  this.model,
22600
23096
  "\u5206\u7EC4\u4EE3\u7801\u8868\u4E0E\u5C5E\u6027\u5217".concat(groupFieldName, "\u7684\u4EE3\u7801\u8868\u4E0D\u4E00\u81F4")
22601
23097
  );
@@ -22682,7 +23178,7 @@ var GridController = class extends MDControlController {
22682
23178
  return;
22683
23179
  }
22684
23180
  if (!aggAppDEDataSetId || !aggAppDataEntityId) {
22685
- throw new RuntimeModelError59(this.model, "\u7F3A\u5C11\u914D\u7F6E\u805A\u5408\u5B9E\u4F53\u6216\u805A\u5408\u6570\u636E\u96C6");
23181
+ throw new RuntimeModelError61(this.model, "\u7F3A\u5C11\u914D\u7F6E\u805A\u5408\u5B9E\u4F53\u6216\u805A\u5408\u6570\u636E\u96C6");
22686
23182
  }
22687
23183
  const params = await this.getFetchParams();
22688
23184
  const app = ibiz.hub.getApp(this.context.srfappid);
@@ -23052,7 +23548,7 @@ var GridController = class extends MDControlController {
23052
23548
  throw new RuntimeError53("\u540C\u65F6\u53EA\u80FD\u6709\u4E00\u884C\u5F00\u542F\u884C\u7F16\u8F91");
23053
23549
  }
23054
23550
  if (row.data.srfuf === 1 /* UPDATE */) {
23055
- row.cacheData = clone23(row.data);
23551
+ row.cacheData = clone25(row.data);
23056
23552
  const defaultVal = this.calcDefaultValue(row.data, false);
23057
23553
  Object.assign(row.data, defaultVal);
23058
23554
  }
@@ -23221,7 +23717,7 @@ var GridController = class extends MDControlController {
23221
23717
  }
23222
23718
  });
23223
23719
  }
23224
- const cloneData = clone23(
23720
+ const cloneData = clone25(
23225
23721
  data2.map((item) => {
23226
23722
  return item.getOrigin();
23227
23723
  })
@@ -23456,10 +23952,10 @@ var GridController = class extends MDControlController {
23456
23952
  };
23457
23953
 
23458
23954
  // src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts
23459
- import { DataTypes as DataTypes3, ModelError as ModelError29, plus as plus2 } from "@ibiz-template/core";
23460
- import dayjs4 from "dayjs";
23955
+ import { DataTypes as DataTypes4, ModelError as ModelError29, plus as plus2 } from "@ibiz-template/core";
23956
+ import dayjs5 from "dayjs";
23461
23957
  import { debounce as debounce3 } from "lodash-es";
23462
- import { clone as clone24, isNil as isNil23 } from "ramda";
23958
+ import { clone as clone26, isNil as isNil23 } from "ramda";
23463
23959
  var GridFieldColumnController = class extends GridColumnController {
23464
23960
  constructor() {
23465
23961
  super(...arguments);
@@ -23492,6 +23988,15 @@ var GridFieldColumnController = class extends GridColumnController {
23492
23988
  get hasAction() {
23493
23989
  return !!this.model.deuiactionId;
23494
23990
  }
23991
+ /**
23992
+ * 属性列对应值在数据里的属性字段名称
23993
+ * @author lxm
23994
+ * @date 2023-06-25 09:26:04
23995
+ * @readonly
23996
+ */
23997
+ get fieldName() {
23998
+ return this.model.id.toLowerCase();
23999
+ }
23495
24000
  async onInit() {
23496
24001
  await super.onInit();
23497
24002
  this.loadCodeList = debounce3(this.loadCodeList, 300, {
@@ -23533,7 +24038,7 @@ var GridFieldColumnController = class extends GridColumnController {
23533
24038
  * @readonly
23534
24039
  */
23535
24040
  clickable(row) {
23536
- const value = row.data[this.model.codeName];
24041
+ const value = row.data[this.fieldName];
23537
24042
  return (this.isLinkColumn || this.hasAction) && value;
23538
24043
  }
23539
24044
  /**
@@ -23570,7 +24075,7 @@ var GridFieldColumnController = class extends GridColumnController {
23570
24075
  * @returns {*} {Promise<void>}
23571
24076
  */
23572
24077
  async openLinkView(row, event) {
23573
- const curValue = row.data[this.model.codeName];
24078
+ const curValue = row.data[this.fieldName];
23574
24079
  if (!curValue) {
23575
24080
  return;
23576
24081
  }
@@ -23588,7 +24093,7 @@ var GridFieldColumnController = class extends GridColumnController {
23588
24093
  srfkey: value,
23589
24094
  ...wfContext
23590
24095
  });
23591
- const tempParams = clone24(this.params);
24096
+ const tempParams = clone26(this.params);
23592
24097
  const { context: newContext, params: newParams } = this.handlePublicParams(
23593
24098
  row.data,
23594
24099
  tempContext,
@@ -23721,9 +24226,9 @@ var GridFieldColumnController = class extends GridColumnController {
23721
24226
  if (!this.valueFormat) {
23722
24227
  return strVal;
23723
24228
  }
23724
- const isDate = DataTypes3.isDate(this.dataType);
24229
+ const isDate = DataTypes4.isDate(this.dataType);
23725
24230
  if (isDate) {
23726
- const formatVal = dayjs4(strVal).format(this.valueFormat);
24231
+ const formatVal = dayjs5(strVal).format(this.valueFormat);
23727
24232
  if (formatVal !== "Invalid Date") {
23728
24233
  return formatVal;
23729
24234
  }
@@ -23759,7 +24264,7 @@ var GridFieldColumnController = class extends GridColumnController {
23759
24264
  };
23760
24265
 
23761
24266
  // src/controller/control/grid/grid-column/grid-ua-column/grid-ua-column.controller.ts
23762
- import { RuntimeModelError as RuntimeModelError60 } from "@ibiz-template/core";
24267
+ import { RuntimeModelError as RuntimeModelError62 } from "@ibiz-template/core";
23763
24268
  var GridUAColumnController = class extends GridColumnController {
23764
24269
  /**
23765
24270
  * 给rowController初始化操作列的状态
@@ -23772,7 +24277,7 @@ var GridUAColumnController = class extends GridColumnController {
23772
24277
  var _a;
23773
24278
  const { deuiactionGroup } = this.model;
23774
24279
  if (!deuiactionGroup) {
23775
- throw new RuntimeModelError60(this.model, "\u64CD\u4F5C\u5217\u6CA1\u6709\u914D\u7F6E\u754C\u9762\u884C\u4E3A\u7EC4");
24280
+ throw new RuntimeModelError62(this.model, "\u64CD\u4F5C\u5217\u6CA1\u6709\u914D\u7F6E\u754C\u9762\u884C\u4E3A\u7EC4");
23776
24281
  }
23777
24282
  if (!((_a = deuiactionGroup.uiactionGroupDetails) == null ? void 0 : _a.length)) {
23778
24283
  ibiz.log.debug("\u64CD\u4F5C\u5217\u754C\u9762\u884C\u4E3A\u7EC4\u6CA1\u6709\u914D\u7F6E\u754C\u9762\u884C\u4E3A");
@@ -23865,15 +24370,6 @@ var GridFieldEditColumnController = class extends GridFieldColumnController {
23865
24370
  }
23866
24371
  return void 0;
23867
24372
  }
23868
- /**
23869
- * 列数据属性字段名称
23870
- * @author lxm
23871
- * @date 2023-06-25 09:26:04
23872
- * @readonly
23873
- */
23874
- get fieldName() {
23875
- return this.model.dataItemName;
23876
- }
23877
24373
  /**
23878
24374
  * 初始化方法,生成表格编辑项控制器
23879
24375
  *
@@ -24988,10 +25484,10 @@ import {
24988
25484
  mergeInLeft as mergeInLeft3,
24989
25485
  recursiveIterate as recursiveIterate9
24990
25486
  } from "@ibiz-template/core";
24991
- import { clone as clone25, isNil as isNil24 } from "ramda";
25487
+ import { clone as clone27, isNil as isNil24 } from "ramda";
24992
25488
 
24993
25489
  // src/controller/control/search-bar/search-bar-filter.controller.ts
24994
- import { RuntimeModelError as RuntimeModelError61 } from "@ibiz-template/core";
25490
+ import { RuntimeModelError as RuntimeModelError63 } from "@ibiz-template/core";
24995
25491
  var ExcludeOPs = [
24996
25492
  "ISNULL" /* IS_NULL */,
24997
25493
  "ISNOTNULL" /* IS_NOT_NULL */
@@ -25032,7 +25528,7 @@ var SearchBarFilterController = class {
25032
25528
  async init() {
25033
25529
  if (!this.noEditor) {
25034
25530
  if (!this.model.editor) {
25035
- throw new RuntimeModelError61(this.model, "\u7F3A\u5C11\u7F16\u8F91\u5668\u6A21\u578B");
25531
+ throw new RuntimeModelError63(this.model, "\u7F3A\u5C11\u7F16\u8F91\u5668\u6A21\u578B");
25036
25532
  }
25037
25533
  this.editorProvider = await getEditorProvider(this.model.editor);
25038
25534
  if (this.editorProvider) {
@@ -25492,7 +25988,7 @@ var SearchBarController = class extends ControlController {
25492
25988
  }
25493
25989
  });
25494
25990
  if (addSearchBarFilters.length > 0) {
25495
- this.model = clone25(this.model);
25991
+ this.model = clone27(this.model);
25496
25992
  this.model.searchBarFilters = addSearchBarFilters.concat(...mergeFilters);
25497
25993
  this.model.enableFilter = true;
25498
25994
  }
@@ -26076,7 +26572,7 @@ var TabExpPanelController = class extends ControlController {
26076
26572
  // src/controller/control/tree/tree.controller.ts
26077
26573
  import {
26078
26574
  RuntimeError as RuntimeError57,
26079
- RuntimeModelError as RuntimeModelError62,
26575
+ RuntimeModelError as RuntimeModelError64,
26080
26576
  recursiveIterate as recursiveIterate10
26081
26577
  } from "@ibiz-template/core";
26082
26578
 
@@ -26947,7 +27443,7 @@ var TreeController = class extends MDControlController {
26947
27443
  const { sortAppDEFieldId, sortDir, allowOrder } = orderNodeModel;
26948
27444
  if (allowOrder === true) {
26949
27445
  if (!sortAppDEFieldId) {
26950
- throw new RuntimeModelError62(orderNodeModel, "\u7F3A\u5C11\u914D\u7F6E\u6392\u5E8F\u5C5E\u6027");
27446
+ throw new RuntimeModelError64(orderNodeModel, "\u7F3A\u5C11\u914D\u7F6E\u6392\u5E8F\u5C5E\u6027");
26951
27447
  }
26952
27448
  const sortField = sortAppDEFieldId.toLowerCase();
26953
27449
  const isAsc = sortDir === "ASC";
@@ -27028,7 +27524,7 @@ var TreeController = class extends MDControlController {
27028
27524
  async modifyNodeText(nodeData, text) {
27029
27525
  const model = this.getNodeModel(nodeData._nodeId);
27030
27526
  if (!model.allowEditText) {
27031
- throw new RuntimeModelError62(model, "\u6811\u8282\u70B9\u6CA1\u6709\u914D\u7F6E\u7F16\u8F91\u6A21\u5F0F\uFF1A\u540D\u79F0");
27527
+ throw new RuntimeModelError64(model, "\u6811\u8282\u70B9\u6CA1\u6709\u914D\u7F6E\u7F16\u8F91\u6A21\u5F0F\uFF1A\u540D\u79F0");
27032
27528
  }
27033
27529
  if (!nodeData._deData) {
27034
27530
  throw new RuntimeError57("\u4E0D\u662F\u5B9E\u4F53\u6811\u8282\u70B9\u6570\u636E");
@@ -27392,7 +27888,7 @@ var WizardPanelController = class extends ControlController {
27392
27888
  };
27393
27889
 
27394
27890
  // src/controller/control/md-ctrl/md-ctrl.controller.ts
27395
- import { RuntimeModelError as RuntimeModelError63 } from "@ibiz-template/core";
27891
+ import { RuntimeModelError as RuntimeModelError65 } from "@ibiz-template/core";
27396
27892
  import { isNil as isNil25 } from "ramda";
27397
27893
 
27398
27894
  // src/controller/control/md-ctrl/md-ctrl.service.ts
@@ -27599,7 +28095,7 @@ var MDCtrlController = class extends MDControlController {
27599
28095
  const { enableGroup, groupMode, groupAppDEFieldId } = this.model;
27600
28096
  if (enableGroup && groupMode) {
27601
28097
  if (!groupAppDEFieldId) {
27602
- throw new RuntimeModelError63(this.model, "\u5206\u7EC4\u5C5E\u6027\u6CA1\u6709\u914D\u7F6E");
28098
+ throw new RuntimeModelError65(this.model, "\u5206\u7EC4\u5C5E\u6027\u6CA1\u6709\u914D\u7F6E");
27603
28099
  }
27604
28100
  if (groupMode === "AUTO") {
27605
28101
  this.handleAutoGroup();
@@ -27666,7 +28162,7 @@ var MDCtrlController = class extends MDControlController {
27666
28162
  async handleCodeListGroup() {
27667
28163
  const { groupAppDEFieldId, groupCodeListId } = this.model;
27668
28164
  if (!groupCodeListId) {
27669
- throw new RuntimeModelError63(this.model, "\u5206\u7EC4\u4EE3\u7801\u8868\u6CA1\u6709\u914D\u7F6E");
28165
+ throw new RuntimeModelError65(this.model, "\u5206\u7EC4\u4EE3\u7801\u8868\u6CA1\u6709\u914D\u7F6E");
27670
28166
  }
27671
28167
  const { items } = this.state;
27672
28168
  const groupMap = /* @__PURE__ */ new Map();
@@ -27696,7 +28192,7 @@ var MDCtrlController = class extends MDControlController {
27696
28192
  };
27697
28193
 
27698
28194
  // src/controller/control/kanban/kanban.controller.ts
27699
- import { RuntimeError as RuntimeError59, RuntimeModelError as RuntimeModelError64 } from "@ibiz-template/core";
28195
+ import { RuntimeError as RuntimeError59, RuntimeModelError as RuntimeModelError66 } from "@ibiz-template/core";
27700
28196
  import { isNil as isNil26 } from "ramda";
27701
28197
 
27702
28198
  // src/controller/control/kanban/kanban.service.ts
@@ -27774,10 +28270,10 @@ var KanbanController = class extends DataViewControlController {
27774
28270
  const sortField = this.model.minorSortAppDEFieldId;
27775
28271
  const { minorSortDir } = this.model;
27776
28272
  if (!sortField) {
27777
- throw new RuntimeModelError64(this.model, "\u6392\u5E8F\u5C5E\u6027\u6CA1\u914D\u7F6E");
28273
+ throw new RuntimeModelError66(this.model, "\u6392\u5E8F\u5C5E\u6027\u6CA1\u914D\u7F6E");
27778
28274
  }
27779
28275
  if (!minorSortDir) {
27780
- throw new RuntimeModelError64(this.model, "\u6392\u5E8F\u65B9\u5411\u6CA1\u914D\u7F6E");
28276
+ throw new RuntimeModelError66(this.model, "\u6392\u5E8F\u65B9\u5411\u6CA1\u914D\u7F6E");
27781
28277
  }
27782
28278
  const isAsc = minorSortDir === "ASC";
27783
28279
  items.forEach((item) => {
@@ -27921,7 +28417,7 @@ var KanbanController = class extends DataViewControlController {
27921
28417
  async handleCodeListGroup() {
27922
28418
  const { groupAppDEFieldId, groupCodeListId } = this.model;
27923
28419
  if (!groupCodeListId) {
27924
- throw new RuntimeModelError64(this.model, "\u5206\u7EC4\u4EE3\u7801\u8868\u6CA1\u6709\u914D\u7F6E");
28420
+ throw new RuntimeModelError66(this.model, "\u5206\u7EC4\u4EE3\u7801\u8868\u6CA1\u6709\u914D\u7F6E");
27925
28421
  }
27926
28422
  const { items } = this.state;
27927
28423
  const groupMap = /* @__PURE__ */ new Map();
@@ -28215,7 +28711,12 @@ var KanbanController = class extends DataViewControlController {
28215
28711
  };
28216
28712
 
28217
28713
  // src/controller/control/tree-grid-ex/tree-grid-ex.controller.ts
28218
- import { recursiveIterate as recursiveIterate11 } from "@ibiz-template/core";
28714
+ import {
28715
+ RuntimeError as RuntimeError60,
28716
+ awaitTimeout as awaitTimeout3,
28717
+ recursiveIterate as recursiveIterate11
28718
+ } from "@ibiz-template/core";
28719
+ import { clone as clone28 } from "ramda";
28219
28720
 
28220
28721
  // src/controller/control/tree-grid-ex/tree-grid-ex.service.ts
28221
28722
  var TreeGridExService = class extends TreeService {
@@ -28224,19 +28725,30 @@ var TreeGridExService = class extends TreeService {
28224
28725
  // src/controller/control/tree-grid-ex/tree-grid-ex-row.state.ts
28225
28726
  var TreeGridExRowState = class {
28226
28727
  constructor(data, treeGrid) {
28227
- /**
28228
- * 操作列状态(p是操作列的标识)
28229
- *
28230
- * @author lxm
28231
- * @date 2022-09-07 22:09:38
28232
- * @type {({ [p: string]: IButtonContainerState })}
28233
- */
28234
- this.uaColStates = {};
28235
- this.data = data;
28236
- Object.values(treeGrid.uaColumns).forEach((column) => {
28237
- column.initActionStates(this);
28238
- });
28239
- }
28728
+ this.errors = {};
28729
+ this.columnActionsStates = {};
28730
+ this.editColStates = {};
28731
+ this.modified = false;
28732
+ this.showRowEdit = false;
28733
+ this.processing = false;
28734
+ this.data = data;
28735
+ if (data._nodeType === "DE") {
28736
+ Object.values(treeGrid.uaColumns).forEach((column) => {
28737
+ column.initActionStates(this);
28738
+ });
28739
+ Object.values(treeGrid.fieldColumns).forEach((column) => {
28740
+ column.initActionStates(this);
28741
+ });
28742
+ Object.values(treeGrid.fieldColumns).forEach((fieldColumn) => {
28743
+ this.editColStates[fieldColumn.name] = {
28744
+ disabled: false,
28745
+ readonly: false,
28746
+ editable: ibiz.config.grid.editShowMode === "all",
28747
+ required: false
28748
+ };
28749
+ });
28750
+ }
28751
+ }
28240
28752
  };
28241
28753
 
28242
28754
  // src/controller/control/tree-grid-ex/tree-grid-ex.controller.ts
@@ -28280,6 +28792,9 @@ var TreeGridExController = class extends TreeController {
28280
28792
  */
28281
28793
  this.uaColumns = {};
28282
28794
  }
28795
+ get _evt() {
28796
+ return this.evt;
28797
+ }
28283
28798
  /**
28284
28799
  * 是否有配置宽度自适应列
28285
28800
  *
@@ -28299,11 +28814,22 @@ var TreeGridExController = class extends TreeController {
28299
28814
  get overflowMode() {
28300
28815
  return ibiz.config.grid.overflowMode;
28301
28816
  }
28817
+ /**
28818
+ * 允许使用行编辑
28819
+ * @author lxm
28820
+ * @date 2023-08-17 02:52:07
28821
+ * @readonly
28822
+ * @type {boolean}
28823
+ */
28824
+ get allowRowEdit() {
28825
+ return this.state.rowEditOpen;
28826
+ }
28302
28827
  initState() {
28303
28828
  super.initState();
28304
28829
  this.state.columnStates = [];
28305
28830
  this.state.rootNodes = [];
28306
28831
  this.state.rows = {};
28832
+ this.state.rowEditOpen = true;
28307
28833
  }
28308
28834
  async onCreated() {
28309
28835
  await super.onCreated();
@@ -28357,180 +28883,830 @@ var TreeGridExController = class extends TreeController {
28357
28883
  }
28358
28884
  }
28359
28885
  /**
28360
- * 初始化树表格(增强)列状态
28886
+ * 初始化树表格(增强)列状态
28887
+ *
28888
+ * @author zk
28889
+ * @date 2023-09-21 06:09:43
28890
+ * @protected
28891
+ * @memberof TreeGridExController
28892
+ */
28893
+ initColumnStates() {
28894
+ var _a;
28895
+ (_a = this.model.detreeColumns) == null ? void 0 : _a.forEach((column) => {
28896
+ this.state.columnStates.push({
28897
+ key: column.codeName,
28898
+ caption: column.caption,
28899
+ hidden: !!column.hideDefault,
28900
+ uaColumn: column.columnType === "UAGRIDCOLUMN"
28901
+ });
28902
+ });
28903
+ this.calcColumnFixed();
28904
+ }
28905
+ /**
28906
+ * 计算列的固定状态
28907
+ *
28908
+ * @author zk
28909
+ * @date 2023-09-21 06:09:50
28910
+ * @protected
28911
+ * @memberof TreeGridExController
28912
+ */
28913
+ calcColumnFixed() {
28914
+ const showColumns = this.state.columnStates.filter(
28915
+ (column) => !column.hidden
28916
+ );
28917
+ const allNum = showColumns.length;
28918
+ showColumns.forEach((column, index) => {
28919
+ if (column.uaColumn) {
28920
+ column.fixed = index + 1 <= Math.floor(allNum / 2) ? "left" : "right";
28921
+ }
28922
+ });
28923
+ }
28924
+ /**
28925
+ * 获取树表格行数据
28926
+ * @author lxm
28927
+ * @date 2023-12-22 02:23:44
28928
+ * @param {string} key 可以是节点id也可以是_uuid
28929
+ * @return {*} {(ITreeGridExRowState | undefined)}
28930
+ */
28931
+ getRowState(key) {
28932
+ const nodeData = this.getNodeData(key);
28933
+ if (nodeData) {
28934
+ return this.state.rows[nodeData._uuid];
28935
+ }
28936
+ }
28937
+ async afterLoadNodes(nodes) {
28938
+ await super.afterLoadNodes(nodes);
28939
+ recursiveIterate11(
28940
+ { _children: nodes },
28941
+ (node) => {
28942
+ this.state.rows[node._uuid] = new TreeGridExRowState(node, this);
28943
+ },
28944
+ { childrenFields: ["_children"] }
28945
+ );
28946
+ }
28947
+ /**
28948
+ * 转换各类多语言
28949
+ *
28950
+ * @date 2023-05-18 02:57:00
28951
+ * @protected
28952
+ */
28953
+ convertMultipleLanguages() {
28954
+ const convertColumnCaption = (columns) => {
28955
+ columns.forEach((column) => {
28956
+ if (column.capLanguageRes && column.capLanguageRes.lanResTag) {
28957
+ column.caption = ibiz.i18n.t(
28958
+ column.capLanguageRes.lanResTag,
28959
+ column.caption
28960
+ );
28961
+ }
28962
+ });
28963
+ };
28964
+ if (this.model.detreeColumns && this.model.detreeColumns.length > 0) {
28965
+ convertColumnCaption(this.model.detreeColumns);
28966
+ }
28967
+ }
28968
+ async save(nodeData) {
28969
+ if (this.state.isSimple) {
28970
+ ibiz.log.debug("\u7B80\u5355\u6A21\u5F0F\uFF0C\u4E0D\u4FDD\u5B58");
28971
+ return;
28972
+ }
28973
+ if (nodeData._nodeType !== "DE") {
28974
+ throw new RuntimeError60("\u975E\u5B9E\u4F53\u8282\u70B9\u6570\u636E\u4E0D\u80FD\u4FDD\u5B58");
28975
+ }
28976
+ const rowState = this.state.rows[nodeData._uuid];
28977
+ if (!rowState) {
28978
+ throw new RuntimeError60("\u884C\u6570\u636E\u4E0D\u5B58\u5728");
28979
+ }
28980
+ if (!rowState.modified) {
28981
+ ibiz.log.debug("\u503C\u6CA1\u6709\u53D1\u751F\u6539\u53D8");
28982
+ return;
28983
+ }
28984
+ if (rowState.processing) {
28985
+ await awaitTimeout3(500, this.save.bind(this), [nodeData]);
28986
+ return;
28987
+ }
28988
+ const nodeModel = this.getNodeModel(nodeData._nodeId);
28989
+ const { appDataEntityId } = nodeModel;
28990
+ const isCreate = nodeData._deData.srfuf === 0 /* CREATE */;
28991
+ if (isCreate) {
28992
+ throw new RuntimeError60("\u6682\u4E0D\u652F\u6301\u65B0\u5EFA");
28993
+ }
28994
+ const methodAction = "update";
28995
+ const deName = calcDeCodeNameById(appDataEntityId);
28996
+ const tempContext = this.context.clone();
28997
+ tempContext[deName] = nodeData._deData.srfkey;
28998
+ const app = ibiz.hub.getApp(this.context.srfappid);
28999
+ let res;
29000
+ try {
29001
+ res = await app.deService.exec(
29002
+ appDataEntityId,
29003
+ methodAction,
29004
+ tempContext,
29005
+ nodeData._deData
29006
+ );
29007
+ } catch (error) {
29008
+ await this._evt.emit("onSaveError", void 0);
29009
+ this.actionNotification("".concat(isCreate ? "CREATE" : "UPDATE", "ERROR"), {
29010
+ error,
29011
+ data: rowState.data
29012
+ });
29013
+ throw error;
29014
+ }
29015
+ rowState.data._deData = res.data;
29016
+ rowState.modified = false;
29017
+ this.gridStateNotify(rowState, "SAVE" /* SAVE */);
29018
+ await this._evt.emit("onSaveSuccess", void 0);
29019
+ }
29020
+ async saveAll() {
29021
+ const needSaveData = Object.values(this.state.rows).filter((row) => row.modified).map((row) => row.data);
29022
+ if (!needSaveData.length) {
29023
+ return;
29024
+ }
29025
+ await handleAllSettled(
29026
+ needSaveData.map((data) => {
29027
+ return this.save(data);
29028
+ })
29029
+ );
29030
+ }
29031
+ /**
29032
+ * 树表格状态变更通知
29033
+ *
29034
+ * @author lxm
29035
+ * @date 2022-09-20 18:09:07
29036
+ */
29037
+ gridStateNotify(row, state) {
29038
+ Object.values(this.columns).forEach((column) => {
29039
+ column.gridStateNotify(row, state);
29040
+ });
29041
+ }
29042
+ /**
29043
+ * 设置行属性的值
29044
+ *
29045
+ * @author lxm
29046
+ * @date 2022-08-24 10:08:40
29047
+ * @param {GridRowState} row 行状态控制器
29048
+ * @param {unknown} value 要设置的值
29049
+ * @param {string} name 要设置的表单数据的属性名称
29050
+ */
29051
+ async setRowValue(row, name, value) {
29052
+ if (Object.prototype.hasOwnProperty.call(row.data, name) && !isValueChange(row.data[name], value)) {
29053
+ return;
29054
+ }
29055
+ row.data[name] = value;
29056
+ row.modified = true;
29057
+ row.processing = true;
29058
+ try {
29059
+ await this.dataChangeNotify(row, [name]);
29060
+ } finally {
29061
+ row.processing = false;
29062
+ }
29063
+ }
29064
+ /**
29065
+ * 通知所有表格编辑项成员表格编辑项数据变更
29066
+ *
29067
+ * @author lxm
29068
+ * @date 2022-09-20 22:09:49
29069
+ * @param {GridRowState} row 行数据
29070
+ * @param {string[]} names 更新的属性
29071
+ */
29072
+ async dataChangeNotify(row, names) {
29073
+ await handleAllSettled(
29074
+ Object.values(this.columns).map(async (column) => {
29075
+ return column.dataChangeNotify(row, names);
29076
+ })
29077
+ );
29078
+ }
29079
+ async toggleRowEdit() {
29080
+ this.state.rowEditOpen = !this.state.rowEditOpen;
29081
+ }
29082
+ /**
29083
+ * 计算默认值并返回一个对象,对象里的属性就是要填充的默认值
29084
+ * 没有的属性就是不需要填充默认值的属性
29085
+ * @author lxm
29086
+ * @date 2023-09-18 04:01:06
29087
+ * @param {IData} data
29088
+ * @param {boolean} isCreate
29089
+ * @return {*} {IData}
29090
+ */
29091
+ calcDefaultValue(data, isCreate) {
29092
+ const result = {};
29093
+ Object.values(this.fieldColumns).forEach((c) => {
29094
+ const nodeColumn = c.nodeColumnControllerMap.get(data._nodeId);
29095
+ if (!nodeColumn || !nodeColumn.nodeEditItem) {
29096
+ return;
29097
+ }
29098
+ const { createDV, createDVT, updateDV, updateDVT } = nodeColumn.nodeEditItem;
29099
+ const valueType = isCreate ? createDVT : updateDVT;
29100
+ const defaultValue = isCreate ? createDV : updateDV;
29101
+ const defaultVal = getDefaultValue(
29102
+ {
29103
+ name: c.name,
29104
+ valueType,
29105
+ defaultValue,
29106
+ valueFormat: nodeColumn.valueFormat
29107
+ },
29108
+ { data, context: this.context, params: this.params }
29109
+ );
29110
+ if (defaultVal !== void 0) {
29111
+ result[c.name] = defaultVal;
29112
+ }
29113
+ });
29114
+ return result;
29115
+ }
29116
+ /**
29117
+ * 切换单行的编辑状态
29118
+ * @author lxm
29119
+ * @date 2023-08-08 06:45:54
29120
+ * @param {GridRowState} row
29121
+ * @param {boolean} [editable]
29122
+ */
29123
+ async switchRowEdit(row, editable, isSave = true) {
29124
+ if (!this.allowRowEdit) {
29125
+ return;
29126
+ }
29127
+ if (row.data._nodeType !== "DE") {
29128
+ return;
29129
+ }
29130
+ const toState = editable === void 0 ? !row.showRowEdit : editable;
29131
+ if (row.showRowEdit === toState) {
29132
+ return;
29133
+ }
29134
+ if (toState === false) {
29135
+ if (isSave) {
29136
+ await this.save(row.data);
29137
+ } else if (row.data._deData.srfuf === 0 /* CREATE */) {
29138
+ row.showRowEdit = false;
29139
+ this._evt.emit("onRowEditChange", { row });
29140
+ return this.remove({ data: [row.data], silent: true });
29141
+ } else if (row.cacheData) {
29142
+ row.data = row.cacheData;
29143
+ delete row.cacheData;
29144
+ }
29145
+ } else {
29146
+ const editingRow = Object.values(this.state.rows).find(
29147
+ (item) => item.showRowEdit
29148
+ );
29149
+ if (editingRow) {
29150
+ throw new RuntimeError60("\u540C\u65F6\u53EA\u80FD\u6709\u4E00\u884C\u5F00\u542F\u884C\u7F16\u8F91");
29151
+ }
29152
+ if (row.data._deData.srfuf === 1 /* UPDATE */) {
29153
+ row.cacheData = clone28(row.data);
29154
+ const defaultVal = this.calcDefaultValue(row.data, false);
29155
+ Object.assign(row.data, defaultVal);
29156
+ }
29157
+ }
29158
+ row.showRowEdit = toState;
29159
+ Object.values(this.fieldColumns).forEach((column) => {
29160
+ row.editColStates[column.name].editable = toState;
29161
+ });
29162
+ this._evt.emit("onRowEditChange", { row });
29163
+ }
29164
+ };
29165
+
29166
+ // src/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-column/tree-grid-ex-column.controller.ts
29167
+ var TreeGridExColumnController = class {
29168
+ /**
29169
+ * Creates an instance of GridFieldColumnController.
29170
+ * @author lxm
29171
+ * @date 2022-08-24 20:08:22
29172
+ * @param {T} model
29173
+ */
29174
+ constructor(model, treeGrid) {
29175
+ /**
29176
+ * 是否是自适应列
29177
+ * @author lxm
29178
+ * @date 2023-07-07 11:20:16
29179
+ * @type {boolean}
29180
+ */
29181
+ this.isAdaptiveColumn = false;
29182
+ /**
29183
+ * 是否是脚本代码
29184
+ * @return {*}
29185
+ * @author: zhujiamin
29186
+ * @Date: 2023-08-15 10:51:25
29187
+ */
29188
+ this.isCustomCode = false;
29189
+ this.model = model;
29190
+ this.treeGrid = treeGrid;
29191
+ this.isAdaptiveColumn = model.widthUnit === "STAR";
29192
+ }
29193
+ /**
29194
+ * 上下文
29195
+ *
29196
+ * @author lxm
29197
+ * @date 2022-09-05 19:09:24
29198
+ * @readonly
29199
+ * @type {IContext}
29200
+ */
29201
+ get context() {
29202
+ return this.treeGrid.context;
29203
+ }
29204
+ /**
29205
+ * 视图参数
29206
+ *
29207
+ * @author lxm
29208
+ * @date 2022-09-05 19:09:00
29209
+ * @readonly
29210
+ * @type {IParams}
29211
+ */
29212
+ get params() {
29213
+ return this.treeGrid.params;
29214
+ }
29215
+ /**
29216
+ * 是否是第一个显示的树表格列
29217
+ * @author lxm
29218
+ * @date 2023-12-22 03:28:10
29219
+ * @readonly
29220
+ * @type {boolean}
29221
+ */
29222
+ get isFirstShowColumn() {
29223
+ const firstColumn = this.treeGrid.state.columnStates.find(
29224
+ (item) => !item.hidden
29225
+ );
29226
+ return (firstColumn == null ? void 0 : firstColumn.key) === this.model.codeName;
29227
+ }
29228
+ /**
29229
+ * 子类不可覆盖或重写此方法,在 init 时需要重写的使用 onInit 方法。
29230
+ *
29231
+ * @author lxm
29232
+ * @date 2022-08-18 22:08:30
29233
+ * @returns {*} {Promise<void>}
29234
+ */
29235
+ async init() {
29236
+ await this.onInit();
29237
+ }
29238
+ /**
29239
+ * 初始化方法
29240
+ *
29241
+ * @author lxm
29242
+ * @date 2022-09-28 15:09:15
29243
+ * @protected
29244
+ * @returns {*} {Promise<void>}
29245
+ */
29246
+ async onInit() {
29247
+ }
29248
+ /**
29249
+ * 表格状态变更通知
29250
+ *
29251
+ * @author lxm
29252
+ * @date 2022-09-20 18:09:07
29253
+ */
29254
+ gridStateNotify(_row, _state) {
29255
+ }
29256
+ async dataChangeNotify(_row, _names) {
29257
+ }
29258
+ };
29259
+
29260
+ // src/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-field-column/tree-grid-ex-node-column.controller.ts
29261
+ import {
29262
+ DataTypes as DataTypes5,
29263
+ RuntimeError as RuntimeError61,
29264
+ RuntimeModelError as RuntimeModelError67
29265
+ } from "@ibiz-template/core";
29266
+ import { clone as clone29 } from "ramda";
29267
+ import dayjs6 from "dayjs";
29268
+ var TreeGridExNodeColumnController = class {
29269
+ /**
29270
+ * @author lxm
29271
+ * @date 2024-01-09 10:04:05
29272
+ * @param {TreeGridExFieldColumnController} fieldColumn 树表格属性列控制器
29273
+ * @param {IDETreeNode} nodeModel 对应实体节点模型
29274
+ */
29275
+ constructor(fieldColumn, nodeModel) {
29276
+ this.fieldColumn = fieldColumn;
29277
+ this.nodeModel = nodeModel;
29278
+ /**
29279
+ * 代码表模型
29280
+ * @return {*}
29281
+ * @author: zhujiamin
29282
+ * @Date: 2023-05-24 10:55:50
29283
+ */
29284
+ this.codeList = void 0;
29285
+ const { detreeNodeColumns, detreeNodeDataItems, detreeNodeEditItems } = nodeModel;
29286
+ const nodeColumn = detreeNodeColumns == null ? void 0 : detreeNodeColumns.find((column) => {
29287
+ return column.detreeColumnId === this.fieldColumn.model.id;
29288
+ });
29289
+ const nodeDataItem = detreeNodeDataItems == null ? void 0 : detreeNodeDataItems.find(
29290
+ (treeNodeDataItem) => {
29291
+ return treeNodeDataItem.id === nodeColumn.dataItemName;
29292
+ }
29293
+ );
29294
+ if (!nodeColumn || !nodeDataItem) {
29295
+ throw new RuntimeModelError67(
29296
+ nodeModel,
29297
+ "\u8282\u70B9\u6CA1\u6709\u914D\u7F6E\u5BF9\u5E94\u8868\u683C\u5217".concat(this.fieldColumn.name, "\u7684\u6570\u636E\u9879")
29298
+ );
29299
+ }
29300
+ this.nodeColumn = nodeColumn;
29301
+ this.nodeDataItem = nodeDataItem;
29302
+ if (nodeColumn.enableRowEdit) {
29303
+ const nodeEditItem = detreeNodeEditItems == null ? void 0 : detreeNodeEditItems.find(
29304
+ (treeNodeEditItem) => {
29305
+ return treeNodeEditItem.id === nodeColumn.id;
29306
+ }
29307
+ );
29308
+ if (!nodeEditItem) {
29309
+ throw new RuntimeModelError67(
29310
+ nodeModel,
29311
+ "\u6CA1\u6709\u627E\u5230\u5BF9\u5E94\u8868\u683C\u5217".concat(this.fieldColumn.name, "\u7684\u7F16\u8F91\u9879\u6A21\u578B")
29312
+ );
29313
+ }
29314
+ this.nodeEditItem = nodeEditItem;
29315
+ }
29316
+ }
29317
+ get unitName() {
29318
+ var _a;
29319
+ return (_a = this.nodeEditItem) == null ? void 0 : _a.unitName;
29320
+ }
29321
+ get valueFormat() {
29322
+ return this.nodeColumn.valueFormat;
29323
+ }
29324
+ get context() {
29325
+ return this.fieldColumn.context;
29326
+ }
29327
+ get params() {
29328
+ return this.fieldColumn.params;
29329
+ }
29330
+ get dataType() {
29331
+ var _a;
29332
+ return (_a = this.nodeDataItem) == null ? void 0 : _a.dataType;
29333
+ }
29334
+ /**
29335
+ * 树表格列标识(用于取数和各种比较判断)
29336
+ * @author lxm
29337
+ * @date 2024-01-09 11:33:37
29338
+ * @readonly
29339
+ * @type {string}
29340
+ */
29341
+ get name() {
29342
+ return this.fieldColumn.name;
29343
+ }
29344
+ /**
29345
+ *树表格增强部件
29346
+ * @author lxm
29347
+ * @date 2024-01-10 11:49:23
29348
+ * @readonly
29349
+ * @type {TreeGridExController}
29350
+ */
29351
+ get treeGrid() {
29352
+ return this.fieldColumn.treeGrid;
29353
+ }
29354
+ /**
29355
+ * 是否是链接列
29356
+ *
29357
+ * @author lxm
29358
+ * @date 2022-09-28 17:09:15
29359
+ * @returns {*}
29360
+ */
29361
+ get isLinkColumn() {
29362
+ return !!this.nodeColumn.enableLinkView && !!this.nodeColumn.linkAppViewId;
29363
+ }
29364
+ /**
29365
+ * 是否有触发界面行为
29366
+ *
29367
+ * @author lxm
29368
+ * @date 2022-12-08 14:12:37
29369
+ * @readonly
29370
+ * @type {boolean}
29371
+ */
29372
+ get hasClickAction() {
29373
+ return !!this.nodeColumn.deuiactionId;
29374
+ }
29375
+ /**
29376
+ * 单元格超出呈现模式
29377
+ * @author lxm
29378
+ * @date 2024-01-09 05:36:36
29379
+ * @readonly
29380
+ * @type {('wrap' | 'ellipsis')}
29381
+ */
29382
+ get overflowMode() {
29383
+ return this.fieldColumn.treeGrid.overflowMode;
29384
+ }
29385
+ /**
29386
+ * 初始化
29387
+ * @author lxm
29388
+ * @date 2024-01-09 10:02:16
29389
+ * @return {*} {Promise<void>}
29390
+ */
29391
+ async init() {
29392
+ var _a;
29393
+ if (((_a = this.nodeEditItem) == null ? void 0 : _a.editor) && this.nodeEditItem.editor.editorType !== "HIDDEN") {
29394
+ this.editorProvider = await getEditorProvider(this.nodeEditItem.editor);
29395
+ if (this.editorProvider) {
29396
+ this.editor = await this.editorProvider.createController(
29397
+ this.nodeEditItem.editor,
29398
+ this
29399
+ );
29400
+ }
29401
+ }
29402
+ if (!this.nodeEditItem) {
29403
+ await this.loadCodeList();
29404
+ }
29405
+ }
29406
+ /**
29407
+ * 初始化属性列界面行为组按钮状态
29408
+ *
29409
+ * @author lxm
29410
+ * @date 2022-09-07 21:09:43
29411
+ * @param {GridRowState} row
29412
+ */
29413
+ initActionStates(row) {
29414
+ const { deuiactionGroup } = this.nodeColumn;
29415
+ if (deuiactionGroup && deuiactionGroup.uiactionGroupDetails) {
29416
+ const containerState = new ButtonContainerState();
29417
+ deuiactionGroup.uiactionGroupDetails.forEach((detail) => {
29418
+ const actionid = detail.uiactionId;
29419
+ if (actionid) {
29420
+ const buttonState = new UIActionButtonState(
29421
+ detail.id,
29422
+ this.context.srfappid,
29423
+ actionid
29424
+ );
29425
+ containerState.addState(detail.id, buttonState);
29426
+ }
29427
+ });
29428
+ row.columnActionsStates[this.name] = containerState;
29429
+ }
29430
+ }
29431
+ /**
29432
+ * 文本点击事件
29433
+ *
29434
+ * @author zk
29435
+ * @date 2023-07-13 12:07:53
29436
+ * @param {MouseEvent} event
29437
+ */
29438
+ onTextClick(row, event) {
29439
+ if (this.isLinkColumn) {
29440
+ event.stopPropagation();
29441
+ this.openLinkView(row, event);
29442
+ } else if (this.hasClickAction) {
29443
+ event.stopPropagation();
29444
+ this.triggerAction(row, event);
29445
+ }
29446
+ }
29447
+ /**
29448
+ * 打开链接视图
29449
+ *
29450
+ * @author lxm
29451
+ * @date 2024-01-09 02:45:34
29452
+ * @param {ITreeGridExRowState} row
29453
+ * @param {MouseEvent} event
29454
+ * @return {*} {Promise<void>}
29455
+ */
29456
+ async openLinkView(row, event) {
29457
+ const curValue = row.data[this.fieldColumn.name];
29458
+ if (!curValue) {
29459
+ return;
29460
+ }
29461
+ const valueItem = this.nodeColumn.linkValueItem || "srfkey";
29462
+ const value = row.data[valueItem];
29463
+ if (value == null) {
29464
+ throw new RuntimeError61("\u672A\u5728\u884C\u6570\u636E\u4E2D\u53D6\u5230 ".concat(valueItem, " \u7684\u503C"));
29465
+ }
29466
+ const { linkAppViewId } = this.nodeColumn;
29467
+ if (!linkAppViewId) {
29468
+ return;
29469
+ }
29470
+ const wfContext = getWFContext(row.data);
29471
+ const tempContext = Object.assign(this.context.clone(), {
29472
+ srfkey: value,
29473
+ ...wfContext
29474
+ });
29475
+ const tempParams = clone29(this.params);
29476
+ const { userParam } = this.nodeColumn;
29477
+ if (userParam) {
29478
+ const { navigateContexts, navigateParams } = parseUserParams(userParam);
29479
+ let selfContext = {};
29480
+ if (navigateContexts && row.data) {
29481
+ selfContext = convertNavData(
29482
+ navigateContexts,
29483
+ row.data,
29484
+ tempParams,
29485
+ tempContext
29486
+ );
29487
+ }
29488
+ Object.assign(tempContext, selfContext);
29489
+ let selfParams = {};
29490
+ if (navigateParams && row.data) {
29491
+ selfParams = convertNavData(
29492
+ navigateParams,
29493
+ row.data,
29494
+ tempParams,
29495
+ tempContext
29496
+ );
29497
+ }
29498
+ Object.assign(tempParams, selfParams);
29499
+ }
29500
+ const res = await ibiz.commands.execute(
29501
+ OpenAppViewCommand.TAG,
29502
+ linkAppViewId,
29503
+ tempContext,
29504
+ tempParams,
29505
+ { event }
29506
+ );
29507
+ if (res == null ? void 0 : res.ok) {
29508
+ this.fieldColumn.treeGrid.refresh();
29509
+ }
29510
+ }
29511
+ /**
29512
+ * 触发表格列附加界面行为
29513
+ *
29514
+ * @author lxm
29515
+ * @date 2022-12-08 15:12:35
29516
+ * @param {GridRowState} row 行数据
29517
+ * @param {MouseEvent} event 鼠标事件
29518
+ * @returns {*} {Promise<void>}
29519
+ */
29520
+ async triggerAction(row, event) {
29521
+ const actionId = this.nodeColumn.deuiactionId;
29522
+ await UIActionUtil.execAndResolved(
29523
+ actionId,
29524
+ {
29525
+ context: this.context,
29526
+ params: this.params,
29527
+ data: [row.data],
29528
+ view: this.treeGrid.view,
29529
+ event
29530
+ },
29531
+ this.nodeColumn.appId
29532
+ );
29533
+ }
29534
+ /**
29535
+ * 触发界面行为组点击事件
28361
29536
  *
28362
- * @author zk
28363
- * @date 2023-09-21 06:09:43
28364
- * @protected
28365
- * @memberof TreeGridExController
29537
+ * @author lxm
29538
+ * @date 2024-01-11 02:26:12
29539
+ * @param {IUIActionGroupDetail} detail
29540
+ * @param {ITreeGridExRowState} row
29541
+ * @param {MouseEvent} event
29542
+ * @return {*} {Promise<void>}
28366
29543
  */
28367
- initColumnStates() {
28368
- var _a;
28369
- (_a = this.model.detreeColumns) == null ? void 0 : _a.forEach((column) => {
28370
- this.state.columnStates.push({
28371
- key: column.codeName,
28372
- caption: column.caption,
28373
- hidden: !!column.hideDefault,
28374
- uaColumn: column.columnType === "UAGRIDCOLUMN"
28375
- });
28376
- });
28377
- this.calcColumnFixed();
29544
+ async onActionClick(detail, row, event) {
29545
+ const actionId = detail.uiactionId;
29546
+ await UIActionUtil.execAndResolved(
29547
+ actionId,
29548
+ {
29549
+ context: this.context,
29550
+ params: this.params,
29551
+ data: [row.data],
29552
+ view: this.treeGrid.view,
29553
+ event
29554
+ },
29555
+ detail.appId
29556
+ );
28378
29557
  }
28379
29558
  /**
28380
- * 计算列的固定状态
28381
- *
28382
- * @author zk
28383
- * @date 2023-09-21 06:09:50
28384
- * @protected
28385
- * @memberof TreeGridExController
29559
+ * 值格式化
29560
+ * @author lxm
29561
+ * @date 2024-01-09 03:37:34
29562
+ * @param {unknown} [value='']
29563
+ * @return {*} {string}
28386
29564
  */
28387
- calcColumnFixed() {
28388
- const showColumns = this.state.columnStates.filter(
28389
- (column) => !column.hidden
28390
- );
28391
- const allNum = showColumns.length;
28392
- showColumns.forEach((column, index) => {
28393
- if (column.uaColumn) {
28394
- column.fixed = index + 1 <= Math.floor(allNum / 2) ? "left" : "right";
29565
+ formatValue(value = "") {
29566
+ if (this.nodeColumn.valueType !== "SIMPLE") {
29567
+ return ValueExUtil.toText(this.nodeColumn, value);
29568
+ }
29569
+ const strVal = "".concat(value);
29570
+ if (!this.valueFormat) {
29571
+ return strVal;
29572
+ }
29573
+ const isDate = DataTypes5.isDate(this.dataType);
29574
+ if (isDate || this.fieldColumn.name === "createdate") {
29575
+ const formatVal = dayjs6(strVal).format(this.valueFormat);
29576
+ if (formatVal !== "Invalid Date") {
29577
+ return formatVal;
28395
29578
  }
28396
- });
29579
+ return strVal;
29580
+ }
29581
+ return ibiz.util.text.format(strVal, this.valueFormat);
28397
29582
  }
28398
29583
  /**
28399
- * 获取树表格行数据
29584
+ * 加载代码表数据
29585
+ *
28400
29586
  * @author lxm
28401
- * @date 2023-12-22 02:23:44
28402
- * @param {string} key 可以是节点id也可以是_uuid
28403
- * @return {*} {(ITreeGridExRowState | undefined)}
29587
+ * @date 2022-09-28 15:09:38
29588
+ * @returns {*}
28404
29589
  */
28405
- getRowState(key) {
28406
- const nodeData = this.getNodeData(key);
28407
- if (nodeData) {
28408
- return this.state.rows[nodeData._uuid];
29590
+ async loadCodeList() {
29591
+ const appCodeListId = this.nodeColumn.appCodeListId;
29592
+ if (!appCodeListId) {
29593
+ return;
28409
29594
  }
28410
- }
28411
- async afterLoadNodes(nodes) {
28412
- await super.afterLoadNodes(nodes);
28413
- recursiveIterate11(
28414
- { _children: nodes },
28415
- (node) => {
28416
- this.state.rows[node._uuid] = new TreeGridExRowState(node, this);
28417
- },
28418
- { childrenFields: ["_children"] }
29595
+ const app = ibiz.hub.getApp(this.context.srfappid);
29596
+ if (!this.codeList) {
29597
+ this.codeList = app.codeList.getCodeList(appCodeListId);
29598
+ }
29599
+ const dataItems = await app.codeList.get(
29600
+ appCodeListId,
29601
+ this.context,
29602
+ this.params
28419
29603
  );
29604
+ this.codeListItems = dataItems;
29605
+ return dataItems;
29606
+ }
29607
+ gridStateNotify(row, state) {
29608
+ if (state === "LOAD" /* LOAD */ || state === "SAVE" /* SAVE */) {
29609
+ const uaColState = row.columnActionsStates[this.name];
29610
+ if (uaColState && row.data._nodeType === "DE") {
29611
+ uaColState.update(row.data._deData);
29612
+ }
29613
+ }
28420
29614
  }
28421
29615
  /**
28422
- * 转换各类多语言
29616
+ * 设置行属性的值
28423
29617
  *
28424
- * @date 2023-05-18 02:57:00
28425
- * @protected
29618
+ * @author lxm
29619
+ * @date 2022-08-24 10:08:40
29620
+ * @param {GridRowState} row 行状态控制器
29621
+ * @param {unknown} value 要设置的值
29622
+ * @param {string} name 要设置的表单数据的属性名称
28426
29623
  */
28427
- convertMultipleLanguages() {
28428
- const convertColumnCaption = (columns) => {
28429
- columns.forEach((column) => {
28430
- if (column.capLanguageRes && column.capLanguageRes.lanResTag) {
28431
- column.caption = ibiz.i18n.t(
28432
- column.capLanguageRes.lanResTag,
28433
- column.caption
28434
- );
28435
- }
28436
- });
28437
- };
28438
- if (this.model.detreeColumns && this.model.detreeColumns.length > 0) {
28439
- convertColumnCaption(this.model.detreeColumns);
28440
- }
29624
+ async setRowValue(row, value, name) {
29625
+ name = name || this.name;
29626
+ await this.treeGrid.setRowValue(row, name, value);
28441
29627
  }
28442
29628
  };
28443
29629
 
28444
- // src/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-column/tree-grid-ex-column.controller.ts
28445
- var TreeGridExColumnController = class {
28446
- /**
28447
- * Creates an instance of GridFieldColumnController.
28448
- * @author lxm
28449
- * @date 2022-08-24 20:08:22
28450
- * @param {T} model
28451
- */
28452
- constructor(model, treeGrid) {
29630
+ // src/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-field-column/tree-grid-ex-field-column.controller.ts
29631
+ var TreeGridExFieldColumnController = class extends TreeGridExColumnController {
29632
+ constructor() {
29633
+ super(...arguments);
28453
29634
  /**
28454
- * 是否是自适应列
29635
+ * 该树表格列对应不同节点模型的节点列控制器
28455
29636
  * @author lxm
28456
- * @date 2023-07-07 11:20:16
28457
- * @type {boolean}
28458
- */
28459
- this.isAdaptiveColumn = false;
28460
- /**
28461
- * 是否是脚本代码
28462
- * @return {*}
28463
- * @author: zhujiamin
28464
- * @Date: 2023-08-15 10:51:25
29637
+ * @date 2024-01-08 05:40:56
29638
+ * @type {Map<string, IDETreeNodeColumn>}
28465
29639
  */
28466
- this.isCustomCode = false;
28467
- this.model = model;
28468
- this.treeGrid = treeGrid;
28469
- this.isAdaptiveColumn = model.widthUnit === "STAR";
29640
+ this.nodeColumnControllerMap = /* @__PURE__ */ new Map();
28470
29641
  }
28471
29642
  /**
28472
- * 上下文
28473
- *
29643
+ * 树表格列标识(用于取数和各种比较判断)
28474
29644
  * @author lxm
28475
- * @date 2022-09-05 19:09:24
29645
+ * @date 2024-01-09 11:33:37
28476
29646
  * @readonly
28477
- * @type {IContext}
29647
+ * @type {string}
28478
29648
  */
28479
- get context() {
28480
- return this.treeGrid.context;
29649
+ get name() {
29650
+ return this.model.id;
28481
29651
  }
28482
- /**
28483
- * 视图参数
28484
- *
28485
- * @author lxm
28486
- * @date 2022-09-05 19:09:00
28487
- * @readonly
28488
- * @type {IParams}
28489
- */
28490
- get params() {
28491
- return this.treeGrid.params;
29652
+ async init() {
29653
+ await this.onInit();
29654
+ await this.initNodeColumnController();
28492
29655
  }
28493
29656
  /**
28494
- * 是否是第一个显示的树表格列
29657
+ * 解析模型并初始化相关属性
28495
29658
  * @author lxm
28496
- * @date 2023-12-22 03:28:10
28497
- * @readonly
28498
- * @type {boolean}
29659
+ * @date 2024-01-08 05:59:12
29660
+ * @return {*} {Promise<void>}
28499
29661
  */
28500
- get isFirstShowColumn() {
28501
- const firstColumn = this.treeGrid.state.columnStates.find(
28502
- (item) => !item.hidden
29662
+ async initNodeColumnController() {
29663
+ var _a;
29664
+ (_a = this.treeGrid.model.detreeNodes) == null ? void 0 : _a.forEach((node) => {
29665
+ var _a2;
29666
+ if (node.treeNodeType !== "DE") {
29667
+ return;
29668
+ }
29669
+ const nodeColumn = (_a2 = node.detreeNodeColumns) == null ? void 0 : _a2.find(
29670
+ (column) => {
29671
+ return column.detreeColumnId === this.model.id;
29672
+ }
29673
+ );
29674
+ if (nodeColumn) {
29675
+ this.nodeColumnControllerMap.set(
29676
+ node.id,
29677
+ new TreeGridExNodeColumnController(this, node)
29678
+ );
29679
+ }
29680
+ });
29681
+ await Promise.all(
29682
+ Array.from(this.nodeColumnControllerMap.values()).map(
29683
+ (controller) => controller.init()
29684
+ )
28503
29685
  );
28504
- return (firstColumn == null ? void 0 : firstColumn.key) === this.model.codeName;
28505
29686
  }
28506
29687
  /**
28507
- * 子类不可覆盖或重写此方法,在 init 时需要重写的使用 onInit 方法。
28508
- *
29688
+ * 初始化属性列界面行为组按钮状态
28509
29689
  * @author lxm
28510
- * @date 2022-08-18 22:08:30
28511
- * @returns {*} {Promise<void>}
29690
+ * @date 2024-01-11 01:48:38
29691
+ * @param {ITreeGridExRowState} row
28512
29692
  */
28513
- async init() {
28514
- await this.onInit();
29693
+ initActionStates(row) {
29694
+ const nodeColumn = this.nodeColumnControllerMap.get(row.data._nodeId);
29695
+ if (nodeColumn) {
29696
+ nodeColumn.initActionStates(row);
29697
+ }
28515
29698
  }
28516
- /**
28517
- * 初始化方法
28518
- *
28519
- * @author lxm
28520
- * @date 2022-09-28 15:09:15
28521
- * @protected
28522
- * @returns {*} {Promise<void>}
28523
- */
28524
- async onInit() {
29699
+ gridStateNotify(row, state) {
29700
+ super.gridStateNotify(row, state);
29701
+ const nodeColumn = this.nodeColumnControllerMap.get(row.data._nodeId);
29702
+ if (nodeColumn) {
29703
+ nodeColumn.gridStateNotify(row, state);
29704
+ }
28525
29705
  }
28526
29706
  };
28527
29707
 
28528
- // src/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-field-column/tree-grid-ex-field-column.controller.ts
28529
- var TreeGridExFieldColumnController = class extends TreeGridExColumnController {
28530
- };
28531
-
28532
29708
  // src/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-ua-column/tree-grid-ex-ua-column.controller.ts
28533
- import { RuntimeModelError as RuntimeModelError65 } from "@ibiz-template/core";
29709
+ import { RuntimeModelError as RuntimeModelError68 } from "@ibiz-template/core";
28534
29710
  var TreeGridExUAColumnController = class extends TreeGridExColumnController {
28535
29711
  /**
28536
29712
  * 给rowController初始化操作列的状态
@@ -28543,7 +29719,8 @@ var TreeGridExUAColumnController = class extends TreeGridExColumnController {
28543
29719
  var _a;
28544
29720
  const { deuiactionGroup } = this.model;
28545
29721
  if (!deuiactionGroup) {
28546
- throw new RuntimeModelError65(this.model, "\u64CD\u4F5C\u5217\u6CA1\u6709\u914D\u7F6E\u754C\u9762\u884C\u4E3A\u7EC4");
29722
+ return;
29723
+ throw new RuntimeModelError68(this.model, "\u64CD\u4F5C\u5217\u6CA1\u6709\u914D\u7F6E\u754C\u9762\u884C\u4E3A\u7EC4");
28547
29724
  }
28548
29725
  if (!((_a = deuiactionGroup.uiactionGroupDetails) == null ? void 0 : _a.length)) {
28549
29726
  ibiz.log.debug("\u64CD\u4F5C\u5217\u754C\u9762\u884C\u4E3A\u7EC4\u6CA1\u6709\u914D\u7F6E\u754C\u9762\u884C\u4E3A");
@@ -28561,7 +29738,7 @@ var TreeGridExUAColumnController = class extends TreeGridExColumnController {
28561
29738
  containerState.addState(detail.id, buttonState);
28562
29739
  }
28563
29740
  });
28564
- row.uaColStates[this.model.codeName] = containerState;
29741
+ row.columnActionsStates[this.model.id] = containerState;
28565
29742
  }
28566
29743
  /**
28567
29744
  * 触发操作列点击事件
@@ -28585,10 +29762,19 @@ var TreeGridExUAColumnController = class extends TreeGridExColumnController {
28585
29762
  detail.appId
28586
29763
  );
28587
29764
  }
29765
+ gridStateNotify(row, state) {
29766
+ super.gridStateNotify(row, state);
29767
+ if (state === "LOAD" /* LOAD */ || state === "SAVE" /* SAVE */) {
29768
+ const uaColState = row.columnActionsStates[this.model.id];
29769
+ if (uaColState && row.data._nodeType === "DE") {
29770
+ uaColState.update(row.data._deData);
29771
+ }
29772
+ }
29773
+ }
28588
29774
  };
28589
29775
 
28590
29776
  // src/controller/control/tree-grid/tree-grid.controller.ts
28591
- import { RuntimeModelError as RuntimeModelError66 } from "@ibiz-template/core";
29777
+ import { RuntimeModelError as RuntimeModelError69 } from "@ibiz-template/core";
28592
29778
  var TreeGridController = class extends GridController {
28593
29779
  constructor() {
28594
29780
  super(...arguments);
@@ -28633,10 +29819,10 @@ var TreeGridController = class extends GridController {
28633
29819
  return item.treeColumnMode === 2 || item.treeColumnMode === 3;
28634
29820
  });
28635
29821
  if (!treeGridParent) {
28636
- throw new RuntimeModelError66(this.model, "\u6811\u8868\u683C\u65E0\u503C\u5217\u6A21\u5F0F");
29822
+ throw new RuntimeModelError69(this.model, "\u6811\u8868\u683C\u65E0\u503C\u5217\u6A21\u5F0F");
28637
29823
  }
28638
29824
  if (!treeGridValue) {
28639
- throw new RuntimeModelError66(this.model, "\u6811\u8868\u683C\u65E0\u7236\u503C\u5217\u6A21\u5F0F");
29825
+ throw new RuntimeModelError69(this.model, "\u6811\u8868\u683C\u65E0\u7236\u503C\u5217\u6A21\u5F0F");
28640
29826
  }
28641
29827
  this.treeGridValueField = treeGridValue.appDEFieldId.toLowerCase();
28642
29828
  this.treeGridParentField = treeGridParent.appDEFieldId.toLowerCase();
@@ -28656,7 +29842,7 @@ var TreeGridService = class extends GridService {
28656
29842
  };
28657
29843
 
28658
29844
  // src/controller/control/medit-view-panel/medit-view-panel.controller.ts
28659
- import { RuntimeError as RuntimeError60 } from "@ibiz-template/core";
29845
+ import { RuntimeError as RuntimeError62 } from "@ibiz-template/core";
28660
29846
  import { createUUID as createUUID13 } from "qx-util";
28661
29847
 
28662
29848
  // src/controller/control/medit-view-panel/medit-view-panel.service.ts
@@ -28872,7 +30058,7 @@ var MEditViewPanelController = class extends MDControlController {
28872
30058
  (item) => item.id === id
28873
30059
  );
28874
30060
  if (panelUiItemIndex < 0) {
28875
- throw new RuntimeError60("\u7F16\u8F91\u89C6\u56FE\u9762\u677F\u90E8\u4EF6UI\u6570\u636E\u4E0D\u5B58\u5728");
30061
+ throw new RuntimeError62("\u7F16\u8F91\u89C6\u56FE\u9762\u677F\u90E8\u4EF6UI\u6570\u636E\u4E0D\u5B58\u5728");
28876
30062
  }
28877
30063
  const tempUiItem = this.state.panelUiItems[panelUiItemIndex];
28878
30064
  if (tempUiItem.id.startsWith("mockId:")) {
@@ -29788,6 +30974,15 @@ var AppHub = class {
29788
30974
  * @type {Map<string, string>} Map<视图 id, 视图所属应用>
29789
30975
  */
29790
30976
  this.view2appMap = /* @__PURE__ */ new Map();
30977
+ /**
30978
+ * 当前注册的应用视图优先级
30979
+ *
30980
+ * @author chitanda
30981
+ * @date 2024-01-15 15:01:57
30982
+ * @protected
30983
+ * @type {Map<string, number>}
30984
+ */
30985
+ this.view2appPriorityMap = /* @__PURE__ */ new Map();
29791
30986
  /**
29792
30987
  * 实例化的应用视图模型
29793
30988
  *
@@ -29879,13 +31074,23 @@ var AppHub = class {
29879
31074
  * 设置应用视图所属应用
29880
31075
  *
29881
31076
  * @author chitanda
29882
- * @date 2023-04-17 23:04:37
31077
+ * @date 2024-01-15 15:01:41
29883
31078
  * @param {string} tag 视图 codeName 或者视图 id
29884
31079
  * @param {string} [appId=ibiz.env.appId]
31080
+ * @param {number} [priority=-1] 视图的优先级,值越小优先级越高。1为最高优先级
29885
31081
  */
29886
- setAppView(tag, appId2 = ibiz.env.appId) {
31082
+ setAppView(tag, appId2 = ibiz.env.appId, priority = -1) {
29887
31083
  const id = this.calcAppViewId(tag);
31084
+ if (this.view2appMap.has(id)) {
31085
+ const _priority = this.view2appPriorityMap.get(id);
31086
+ if (_priority && _priority < priority) {
31087
+ return;
31088
+ }
31089
+ }
29888
31090
  this.view2appMap.set(id, appId2);
31091
+ if (priority !== -1) {
31092
+ this.view2appPriorityMap.set(id, priority);
31093
+ }
29889
31094
  }
29890
31095
  /**
29891
31096
  * 判断应用视图是否存在
@@ -29935,7 +31140,7 @@ var AppHub = class {
29935
31140
  this.registerAppView(appView);
29936
31141
  return appView;
29937
31142
  }
29938
- throw new RuntimeError61("\u89C6\u56FE[".concat(id, "]\u4E0D\u5B58\u5728"));
31143
+ throw new RuntimeError63("\u89C6\u56FE[".concat(id, "]\u4E0D\u5B58\u5728"));
29939
31144
  }
29940
31145
  /**
29941
31146
  * 根据视图模型路径,加参数重新计算视图模型
@@ -29956,7 +31161,7 @@ var AppHub = class {
29956
31161
  );
29957
31162
  return model;
29958
31163
  }
29959
- throw new RuntimeError61("\u89C6\u56FE[".concat(modelPath, "]\u4E0D\u5B58\u5728"));
31164
+ throw new RuntimeError63("\u89C6\u56FE[".concat(modelPath, "]\u4E0D\u5B58\u5728"));
29960
31165
  }
29961
31166
  /**
29962
31167
  * 根据应用实体代码名称查找应用视图
@@ -29987,7 +31192,7 @@ var AppHub = class {
29987
31192
  this.registerAppDataEntity(entity, appId2);
29988
31193
  return entity;
29989
31194
  }
29990
- throw new RuntimeError61("\u672A\u627E\u5230\u5E94\u7528\u5B9E\u4F53[".concat(id, "]"));
31195
+ throw new RuntimeError63("\u672A\u627E\u5230\u5E94\u7528\u5B9E\u4F53[".concat(id, "]"));
29991
31196
  }
29992
31197
  /**
29993
31198
  * 新建 hub 应用
@@ -30002,7 +31207,7 @@ var AppHub = class {
30002
31207
  return this.appMap.get(id);
30003
31208
  }
30004
31209
  if (!this.modelLoaderProvider) {
30005
- throw new RuntimeError61("\u8BF7\u5148\u6CE8\u518C\u6A21\u578B\u52A0\u8F7D\u9002\u914D\u5668");
31210
+ throw new RuntimeError63("\u8BF7\u5148\u6CE8\u518C\u6A21\u578B\u52A0\u8F7D\u9002\u914D\u5668");
30006
31211
  }
30007
31212
  const appModel = await this.modelLoaderProvider.getApp(id);
30008
31213
  const app = new Application(appModel);
@@ -30133,7 +31338,7 @@ var EngineFactory = class {
30133
31338
  };
30134
31339
 
30135
31340
  // src/engine/view-base.engine.ts
30136
- import { RuntimeError as RuntimeError62 } from "@ibiz-template/core";
31341
+ import { RuntimeError as RuntimeError64 } from "@ibiz-template/core";
30137
31342
  var ViewEngineBase = class {
30138
31343
  /**
30139
31344
  * 构造函数在视图控制器的构造函数逻辑内部执行
@@ -30321,7 +31526,7 @@ var ViewEngineBase = class {
30321
31526
  const { appDataEntityId } = this.view.model;
30322
31527
  const { evt, context, params } = this.view;
30323
31528
  if (!appDataEntityId) {
30324
- throw new RuntimeError62("\u8BE5\u89C6\u56FE\u6CA1\u6709\u5B9E\u4F53\uFF0C\u65E0\u6CD5\u52A0\u8F7D\u5B9E\u4F53\u6570\u636E");
31529
+ throw new RuntimeError64("\u8BE5\u89C6\u56FE\u6CA1\u6709\u5B9E\u4F53\uFF0C\u65E0\u6CD5\u52A0\u8F7D\u5B9E\u4F53\u6570\u636E");
30325
31530
  }
30326
31531
  const app = ibiz.hub.getApp(context.srfappid);
30327
31532
  const res = await app.deService.exec(
@@ -30342,8 +31547,8 @@ var ViewEngineBase = class {
30342
31547
  };
30343
31548
 
30344
31549
  // src/engine/md-view.engine.ts
30345
- import { RuntimeModelError as RuntimeModelError67 } from "@ibiz-template/core";
30346
- import { clone as clone26 } from "ramda";
31550
+ import { RuntimeModelError as RuntimeModelError70 } from "@ibiz-template/core";
31551
+ import { clone as clone30 } from "ramda";
30347
31552
  var MDViewEngine = class extends ViewEngineBase {
30348
31553
  /**
30349
31554
  * 多数据部件名称
@@ -30526,7 +31731,7 @@ var MDViewEngine = class extends ViewEngineBase {
30526
31731
  view: this.view
30527
31732
  }));
30528
31733
  if (result === -1) {
30529
- throw new RuntimeModelError67(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
31734
+ throw new RuntimeModelError70(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
30530
31735
  } else {
30531
31736
  return {
30532
31737
  cancel: !result.ok
@@ -30549,9 +31754,9 @@ var MDViewEngine = class extends ViewEngineBase {
30549
31754
  (item) => item.id === "newdata"
30550
31755
  );
30551
31756
  if (!openAppViewLogic) {
30552
- throw new RuntimeModelError67(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
31757
+ throw new RuntimeModelError70(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
30553
31758
  }
30554
- const params = clone26(this.view.params);
31759
+ const params = clone30(this.view.params);
30555
31760
  if (copyMode) {
30556
31761
  params.srfcopymode = copyMode;
30557
31762
  }
@@ -30563,7 +31768,7 @@ var MDViewEngine = class extends ViewEngineBase {
30563
31768
  view: this.view
30564
31769
  }));
30565
31770
  if (result === -1) {
30566
- throw new RuntimeModelError67(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
31771
+ throw new RuntimeModelError70(this.view.model, "\u7F3A\u5C11newdata\u7684\u89C6\u56FE\u903B\u8F91");
30567
31772
  } else {
30568
31773
  return {
30569
31774
  cancel: !result.ok
@@ -30762,7 +31967,7 @@ var GlobalUtil = class {
30762
31967
  };
30763
31968
 
30764
31969
  // src/logic-scheduler/executor/logic-executor.ts
30765
- import { RuntimeError as RuntimeError63 } from "@ibiz-template/core";
31970
+ import { RuntimeError as RuntimeError65 } from "@ibiz-template/core";
30766
31971
  var LogicExecutor = class {
30767
31972
  /**
30768
31973
  * @author lxm
@@ -30783,7 +31988,7 @@ var LogicExecutor = class {
30783
31988
  */
30784
31989
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
30785
31990
  execute(_executeParams) {
30786
- throw new RuntimeError63("Method not implemented.");
31991
+ throw new RuntimeError65("Method not implemented.");
30787
31992
  }
30788
31993
  /**
30789
31994
  * 销毁方法
@@ -30874,13 +32079,13 @@ var ScriptExecutor = class extends LogicExecutor {
30874
32079
  };
30875
32080
 
30876
32081
  // src/logic-scheduler/executor/app-de-ui-logic-executor.ts
30877
- import { RuntimeModelError as RuntimeModelError68 } from "@ibiz-template/core";
32082
+ import { RuntimeModelError as RuntimeModelError71 } from "@ibiz-template/core";
30878
32083
  var AppDEUILogicExecutor = class extends LogicExecutor {
30879
32084
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
30880
32085
  execute(executeParams) {
30881
32086
  const { appDEUILogicId, appDataEntityId } = this.logic;
30882
32087
  if (!appDEUILogicId) {
30883
- throw new RuntimeModelError68(this.logic, "\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53\u754C\u9762\u903B\u8F91");
32088
+ throw new RuntimeModelError71(this.logic, "\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53\u754C\u9762\u903B\u8F91");
30884
32089
  }
30885
32090
  execUILogic(appDEUILogicId, appDataEntityId, executeParams);
30886
32091
  }
@@ -31220,7 +32425,7 @@ var LogicSchedulerCenter = class {
31220
32425
  };
31221
32426
 
31222
32427
  // src/logic-scheduler/trigger/logic-trigger.ts
31223
- import { RuntimeError as RuntimeError64 } from "@ibiz-template/core";
32428
+ import { RuntimeError as RuntimeError66 } from "@ibiz-template/core";
31224
32429
  var LogicTrigger = class {
31225
32430
  /**
31226
32431
  * @author lxm
@@ -31280,7 +32485,7 @@ var LogicTrigger = class {
31280
32485
  if (this.executor) {
31281
32486
  return this.executor.execute(executeParams);
31282
32487
  }
31283
- throw new RuntimeError64("".concat(this.logic.id, "\u6CA1\u6709\u7ED1\u5B9Aexecutor"));
32488
+ throw new RuntimeError66("".concat(this.logic.id, "\u6CA1\u6709\u7ED1\u5B9Aexecutor"));
31284
32489
  }
31285
32490
  /**
31286
32491
  * 销毁方法
@@ -31297,12 +32502,12 @@ var CustomTrigger = class extends LogicTrigger {
31297
32502
  };
31298
32503
 
31299
32504
  // src/logic-scheduler/trigger/item-dyna-logic-trigger.ts
31300
- import { RuntimeError as RuntimeError65 } from "@ibiz-template/core";
32505
+ import { RuntimeError as RuntimeError67 } from "@ibiz-template/core";
31301
32506
  var ItemDynaLogicTrigger = class extends LogicTrigger {
31302
32507
  bindExecutor(executor) {
31303
32508
  super.bindExecutor(executor);
31304
32509
  if (this.executor.type !== "SCRIPT") {
31305
- throw new RuntimeError65(
32510
+ throw new RuntimeError67(
31306
32511
  "\u9884\u5B9A\u4E49\u903B\u8F91\u7C7B\u578B".concat(this.type, "\u7684\u89E6\u53D1\u5668\u7C7B\u578B\u53EA\u80FD\u662F\u811A\u672C")
31307
32512
  );
31308
32513
  }
@@ -31338,7 +32543,7 @@ var ItemDynaLogicTrigger = class extends LogicTrigger {
31338
32543
  };
31339
32544
 
31340
32545
  // src/logic-scheduler/trigger/timer-trigger.ts
31341
- import { RuntimeError as RuntimeError66, RuntimeModelError as RuntimeModelError69 } from "@ibiz-template/core";
32546
+ import { RuntimeError as RuntimeError68, RuntimeModelError as RuntimeModelError72 } from "@ibiz-template/core";
31342
32547
  var TimerTrigger = class extends LogicTrigger {
31343
32548
  constructor() {
31344
32549
  super(...arguments);
@@ -31346,11 +32551,11 @@ var TimerTrigger = class extends LogicTrigger {
31346
32551
  }
31347
32552
  start() {
31348
32553
  if (!this.logic.timer) {
31349
- throw new RuntimeModelError69(this.logic, "\u5B9A\u65F6\u5668\u7F3A\u5C11\u5B9A\u65F6\u95F4\u9694");
32554
+ throw new RuntimeModelError72(this.logic, "\u5B9A\u65F6\u5668\u7F3A\u5C11\u5B9A\u65F6\u95F4\u9694");
31350
32555
  }
31351
32556
  this.timer = setInterval(() => {
31352
32557
  if (!this.scheduler.defaultParamsCb) {
31353
- throw new RuntimeError66("\u5B9A\u65F6\u5668\u7F3A\u5C11\u9ED8\u8BA4\u53C2\u6570\u56DE\u8C03");
32558
+ throw new RuntimeError68("\u5B9A\u65F6\u5668\u7F3A\u5C11\u9ED8\u8BA4\u53C2\u6570\u56DE\u8C03");
31354
32559
  }
31355
32560
  const params = this.scheduler.defaultParamsCb();
31356
32561
  this.executor.execute(params);
@@ -31367,8 +32572,8 @@ var TimerTrigger = class extends LogicTrigger {
31367
32572
  // src/logic-scheduler/executor/app-ui-logic-executor.ts
31368
32573
  import {
31369
32574
  ModelError as ModelError34,
31370
- RuntimeError as RuntimeError67,
31371
- RuntimeModelError as RuntimeModelError70
32575
+ RuntimeError as RuntimeError69,
32576
+ RuntimeModelError as RuntimeModelError73
31372
32577
  } from "@ibiz-template/core";
31373
32578
  import { notNilEmpty as notNilEmpty9 } from "qx-util";
31374
32579
  var AppUILogicExecutor = class extends LogicExecutor {
@@ -31405,7 +32610,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
31405
32610
  const { context, params, ...rest } = parameters;
31406
32611
  const { data } = parameters;
31407
32612
  if (!(data == null ? void 0 : data[0])) {
31408
- throw new RuntimeError67("opendata\u6CA1\u6709\u53EF\u64CD\u4F5C\u6570\u636E\uFF01");
32613
+ throw new RuntimeError69("opendata\u6CA1\u6709\u53EF\u64CD\u4F5C\u6570\u636E\uFF01");
31409
32614
  }
31410
32615
  const openViewRefs = appUILogic.openDataAppViews;
31411
32616
  let openViewRef;
@@ -31414,7 +32619,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
31414
32619
  } else {
31415
32620
  openViewRef = appUILogic.openDataAppView;
31416
32621
  if (!openViewRef) {
31417
- throw new RuntimeModelError70(
32622
+ throw new RuntimeModelError73(
31418
32623
  appUILogic,
31419
32624
  "opendata\u89C6\u56FE\u903B\u8F91\u6CA1\u6709\u914D\u7F6E\u9ED8\u8BA4\u6253\u5F00\u89C6\u56FE"
31420
32625
  );
@@ -31422,7 +32627,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
31422
32627
  }
31423
32628
  const openView = openViewRef.refAppViewId;
31424
32629
  if (!openView) {
31425
- throw new RuntimeModelError70(
32630
+ throw new RuntimeModelError73(
31426
32631
  appUILogic,
31427
32632
  "opendata\u89C6\u56FE\u903B\u8F91\u7684\u9ED8\u8BA4\u6253\u5F00\u89C6\u56FE\u6CA1\u6709\u5B9E\u9645\u5F15\u7528\u89C6\u56FE"
31428
32633
  );
@@ -31452,7 +32657,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
31452
32657
  );
31453
32658
  const typeFileName = appDataEntity.formTypeAppDEFieldId || appDataEntity.dataTypeAppDEFieldId;
31454
32659
  if (!typeFileName) {
31455
- throw new RuntimeModelError70(
32660
+ throw new RuntimeModelError73(
31456
32661
  appUILogic,
31457
32662
  "".concat(appDataEntity.codeName, "[\u591A\u8868\u5355\u5B9E\u4F53] or [\u7D22\u5F15\u5B9E\u4F53]\u7F3A\u5C11\u7C7B\u578B\u5C5E\u6027\u914D\u7F6E")
31458
32663
  );
@@ -31460,12 +32665,12 @@ var AppUILogicExecutor = class extends LogicExecutor {
31460
32665
  const { data } = parameters;
31461
32666
  const formTypeValue = data[0][typeFileName];
31462
32667
  if (!formTypeValue) {
31463
- throw new RuntimeModelError70(appUILogic, "\u6570\u636E\u6E90\u65E0\u8868\u5355\u7C7B\u578B\u5E94\u7528\u5B9E\u4F53\u5C5E\u6027\u503C");
32668
+ throw new RuntimeModelError73(appUILogic, "\u6570\u636E\u6E90\u65E0\u8868\u5355\u7C7B\u578B\u5E94\u7528\u5B9E\u4F53\u5C5E\u6027\u503C");
31464
32669
  }
31465
32670
  const openViewRefs = appUILogic.openDataAppViews;
31466
32671
  const findView = openViewRefs == null ? void 0 : openViewRefs.find((item) => item.refMode === formTypeValue);
31467
32672
  if (!findView) {
31468
- throw new RuntimeError67(
32673
+ throw new RuntimeError69(
31469
32674
  "\u6CA1\u6709\u627E\u5230\u4E0E\u8868\u5355\u7C7B\u578B".concat(formTypeValue, "\u76F8\u5173\u7684\u5B9E\u4F53\u7684\u7F16\u8F91\u89C6\u56FE")
31470
32675
  );
31471
32676
  }
@@ -31502,7 +32707,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
31502
32707
  return viewRef.refMode.toLowerCase() !== parentDeName;
31503
32708
  });
31504
32709
  if (!newViewRef) {
31505
- throw new RuntimeModelError70(
32710
+ throw new RuntimeModelError73(
31506
32711
  appUILogic,
31507
32712
  "\u6CA1\u6709\u627E\u5230\u6279\u6DFB\u52A0\u9700\u8981\u6253\u5F00\u7684\u9009\u62E9\u89C6\u56FE"
31508
32713
  );
@@ -31512,7 +32717,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
31512
32717
  } else {
31513
32718
  newViewRef = newDataAppView;
31514
32719
  if (!newViewRef || !newViewRef.refAppViewId) {
31515
- throw new RuntimeModelError70(
32720
+ throw new RuntimeModelError73(
31516
32721
  appUILogic,
31517
32722
  "newdata\u89C6\u56FE\u903B\u8F91\u6CA1\u6709\u914D\u7F6E\u9ED8\u8BA4\u65B0\u5EFA\u6570\u636E\u89C6\u56FE"
31518
32723
  );
@@ -31576,7 +32781,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
31576
32781
  const { wizardAppView, newDataAppViews } = appUILogic;
31577
32782
  const { context, params, ...rest } = parameters;
31578
32783
  if (!wizardAppView || !wizardAppView.refAppViewId) {
31579
- throw new RuntimeModelError70(appUILogic, "\u7F3A\u5C11\u9ED8\u8BA4\u7D22\u5F15\u5B9E\u4F53\u9009\u62E9\u89C6\u56FE");
32784
+ throw new RuntimeModelError73(appUILogic, "\u7F3A\u5C11\u9ED8\u8BA4\u7D22\u5F15\u5B9E\u4F53\u9009\u62E9\u89C6\u56FE");
31580
32785
  }
31581
32786
  const result = await ibiz.commands.execute(
31582
32787
  OpenAppViewCommand.TAG,
@@ -31590,7 +32795,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
31590
32795
  }
31591
32796
  const selectData = (_a = result.data) == null ? void 0 : _a[0];
31592
32797
  if (!selectData) {
31593
- throw new RuntimeError67("\u8BF7\u9009\u4E2D\u4E00\u6761\u6570\u636E");
32798
+ throw new RuntimeError69("\u8BF7\u9009\u4E2D\u4E00\u6761\u6570\u636E");
31594
32799
  }
31595
32800
  const indexType = selectData.srfkey;
31596
32801
  const findView = newDataAppViews == null ? void 0 : newDataAppViews.find(
@@ -31600,7 +32805,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
31600
32805
  }
31601
32806
  );
31602
32807
  if (!findView) {
31603
- throw new RuntimeError67(
32808
+ throw new RuntimeError69(
31604
32809
  "\u6CA1\u6709\u627E\u5230\u4E0E\u7D22\u5F15\u7C7B\u578B".concat(indexType, "\u76F8\u5173\u7684\u5B9E\u4F53\u7684\u7F16\u8F91\u89C6\u56FE")
31605
32810
  );
31606
32811
  }
@@ -31627,7 +32832,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
31627
32832
  const minorDERs = selfDe.minorAppDERSs;
31628
32833
  const pickParentDeName = newViewRef.refMode.toLowerCase();
31629
32834
  if (!minorDERs) {
31630
- throw new RuntimeModelError70(selfDe, "\u5B9E\u4F53\u6CA1\u6709\u4ECE\u5173\u7CFB\u96C6\u5408\uFF01");
32835
+ throw new RuntimeModelError73(selfDe, "\u5B9E\u4F53\u6CA1\u6709\u4ECE\u5173\u7CFB\u96C6\u5408\uFF01");
31631
32836
  }
31632
32837
  let pickParentFieldName = "";
31633
32838
  minorDERs == null ? void 0 : minorDERs.forEach((item) => {
@@ -31637,7 +32842,7 @@ var AppUILogicExecutor = class extends LogicExecutor {
31637
32842
  }
31638
32843
  });
31639
32844
  if (pickParentFieldName === void 0) {
31640
- throw new RuntimeError67(
32845
+ throw new RuntimeError69(
31641
32846
  "\u6CA1\u6709\u627E\u5230".concat(pickParentDeName, "\u5728\u5F53\u524D\u5B9E\u4F53\u7684\u5916\u952E\u5C5E\u6027")
31642
32847
  );
31643
32848
  }
@@ -31724,12 +32929,12 @@ var ControlEventTrigger = class extends LogicTrigger {
31724
32929
  };
31725
32930
 
31726
32931
  // src/logic-scheduler/executor/app-ui-action-executor.ts
31727
- import { RuntimeModelError as RuntimeModelError71 } from "@ibiz-template/core";
32932
+ import { RuntimeModelError as RuntimeModelError74 } from "@ibiz-template/core";
31728
32933
  var AppDEUIActionExecutor = class extends LogicExecutor {
31729
32934
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
31730
32935
  execute(executeParams) {
31731
32936
  if (!this.logic.appDEUIActionId) {
31732
- throw new RuntimeModelError71(
32937
+ throw new RuntimeModelError74(
31733
32938
  this.logic,
31734
32939
  "\u903B\u8F91\u4E2D\u7F3A\u5C11\u89E6\u53D1\u5E94\u7528\u5B9E\u4F53\u754C\u9762\u884C\u4E3Aid"
31735
32940
  );
@@ -32087,6 +33292,8 @@ export {
32087
33292
  TreeGridExColumnController,
32088
33293
  TreeGridExController,
32089
33294
  TreeGridExFieldColumnController,
33295
+ TreeGridExNodeColumnController,
33296
+ TreeGridExNotifyState,
32090
33297
  TreeGridExRowState,
32091
33298
  TreeGridExService,
32092
33299
  TreeGridExUAColumnController,