@ibiz-template/runtime 0.0.1-alpha.9 → 0.0.1-beta.130

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 (286) hide show
  1. package/dist/system/index.system.js +1 -0
  2. package/out/command/app/app-func/app-func.d.ts +10 -11
  3. package/out/command/app/app-func/app-func.d.ts.map +1 -1
  4. package/out/command/app/app-func/app-func.js +22 -23
  5. package/out/command/app/open-app-view/open-app-view.d.ts +12 -24
  6. package/out/command/app/open-app-view/open-app-view.d.ts.map +1 -1
  7. package/out/command/app/open-app-view/open-app-view.js +12 -24
  8. package/out/config/global-config.d.ts +18 -0
  9. package/out/config/global-config.d.ts.map +1 -0
  10. package/out/config/global-config.js +18 -0
  11. package/out/index.d.ts +4 -1
  12. package/out/index.d.ts.map +1 -1
  13. package/out/index.js +4 -1
  14. package/out/install.d.ts.map +1 -1
  15. package/out/install.js +11 -2
  16. package/out/interface/i-drawer-options/i-drawer-options.d.ts +29 -0
  17. package/out/interface/i-drawer-options/i-drawer-options.d.ts.map +1 -0
  18. package/out/interface/i-global-config/i-global-config.d.ts +62 -0
  19. package/out/interface/i-global-config/i-global-config.d.ts.map +1 -0
  20. package/out/interface/i-modal/i-modal.d.ts +7 -0
  21. package/out/interface/i-modal/i-modal.d.ts.map +1 -1
  22. package/out/interface/i-modal-data/i-modal-data.d.ts +1 -1
  23. package/out/interface/i-modal-data/i-modal-data.d.ts.map +1 -1
  24. package/out/interface/i-modal-options/i-modal-options.d.ts +43 -0
  25. package/out/interface/i-modal-options/i-modal-options.d.ts.map +1 -0
  26. package/out/interface/i-modal-options/i-modal-options.js +1 -0
  27. package/out/interface/i-plugin-factory/i-plugin-factory.d.ts +66 -0
  28. package/out/interface/i-plugin-factory/i-plugin-factory.d.ts.map +1 -0
  29. package/out/interface/i-plugin-factory/i-plugin-factory.js +1 -0
  30. package/out/interface/i-plugin-item/i-plugin-item.d.ts +28 -0
  31. package/out/interface/i-plugin-item/i-plugin-item.d.ts.map +1 -0
  32. package/out/interface/i-plugin-item/i-plugin-item.js +1 -0
  33. package/out/interface/i-popover-options/i-popover-options.d.ts +84 -0
  34. package/out/interface/i-popover-options/i-popover-options.d.ts.map +1 -0
  35. package/out/interface/i-popover-options/i-popover-options.js +1 -0
  36. package/out/interface/i-ui-action-handler/i-ui-action-handler.d.ts +26 -0
  37. package/out/interface/i-ui-action-handler/i-ui-action-handler.d.ts.map +1 -0
  38. package/out/interface/i-ui-action-handler/i-ui-action-handler.js +1 -0
  39. package/out/interface/i-ui-action-result/i-ui-action-result.d.ts +17 -0
  40. package/out/interface/i-ui-action-result/i-ui-action-result.d.ts.map +1 -1
  41. package/out/interface/i-ui-logic-params/i-ui-logic-params.d.ts +31 -0
  42. package/out/interface/i-ui-logic-params/i-ui-logic-params.d.ts.map +1 -0
  43. package/out/interface/i-ui-logic-params/i-ui-logic-params.js +1 -0
  44. package/out/interface/index.d.ts +11 -3
  45. package/out/interface/index.d.ts.map +1 -1
  46. package/out/interface/index.js +3 -3
  47. package/out/interface/logic-scheduler/i-scheduler-logic.d.ts +35 -0
  48. package/out/interface/logic-scheduler/i-scheduler-logic.d.ts.map +1 -0
  49. package/out/interface/logic-scheduler/i-scheduler-logic.js +1 -0
  50. package/out/interface/logic-scheduler/i-trigger-match-params.d.ts +17 -0
  51. package/out/interface/logic-scheduler/i-trigger-match-params.d.ts.map +1 -0
  52. package/out/interface/logic-scheduler/i-trigger-match-params.js +1 -0
  53. package/out/interface/logic-scheduler/index.d.ts +3 -0
  54. package/out/interface/logic-scheduler/index.d.ts.map +1 -0
  55. package/out/interface/logic-scheduler/index.js +1 -0
  56. package/out/interface/provider/i-ui-action-provider.d.ts +20 -0
  57. package/out/interface/provider/i-ui-action-provider.d.ts.map +1 -0
  58. package/out/interface/provider/i-ui-action-provider.js +1 -0
  59. package/out/interface/provider/index.d.ts +2 -0
  60. package/out/interface/provider/index.d.ts.map +1 -0
  61. package/out/interface/provider/index.js +1 -0
  62. package/out/interface/register/i-register.d.ts +8 -1
  63. package/out/interface/register/i-register.d.ts.map +1 -1
  64. package/out/interface/register/i-ui-action-register.d.ts +15 -0
  65. package/out/interface/register/i-ui-action-register.d.ts.map +1 -0
  66. package/out/interface/register/i-ui-action-register.js +1 -0
  67. package/out/interface/register/index.d.ts +3 -0
  68. package/out/interface/register/index.d.ts.map +1 -0
  69. package/out/interface/register/index.js +2 -0
  70. package/out/interface/util/i-loading-util/i-loading-util.d.ts +14 -0
  71. package/out/interface/util/i-loading-util/i-loading-util.d.ts.map +1 -1
  72. package/out/interface/util/i-modal-util/i-modal-util.d.ts +8 -0
  73. package/out/interface/util/i-modal-util/i-modal-util.d.ts.map +1 -1
  74. package/out/interface/util/i-open-view-util/i-open-view-util.d.ts +10 -11
  75. package/out/interface/util/i-open-view-util/i-open-view-util.d.ts.map +1 -1
  76. package/out/interface/util/i-overlay-container/i-overlay-container.d.ts +37 -0
  77. package/out/interface/util/i-overlay-container/i-overlay-container.d.ts.map +1 -0
  78. package/out/interface/util/i-overlay-container/i-overlay-container.js +1 -0
  79. package/out/interface/util/i-overlay-controller/i-overlay-controller.d.ts +86 -0
  80. package/out/interface/util/i-overlay-controller/i-overlay-controller.d.ts.map +1 -0
  81. package/out/interface/util/i-overlay-controller/i-overlay-controller.js +1 -0
  82. package/out/interface/util/i-overlay-popover-container/i-overlay-popover-container.d.ts +23 -0
  83. package/out/interface/util/i-overlay-popover-container/i-overlay-popover-container.d.ts.map +1 -0
  84. package/out/interface/util/i-overlay-popover-container/i-overlay-popover-container.js +1 -0
  85. package/out/interface/util/index.d.ts +3 -0
  86. package/out/interface/util/index.d.ts.map +1 -1
  87. package/out/logic-scheduler/executor/logic-executor-factory.d.ts +34 -0
  88. package/out/logic-scheduler/executor/logic-executor-factory.d.ts.map +1 -0
  89. package/out/logic-scheduler/executor/logic-executor-factory.js +42 -0
  90. package/out/logic-scheduler/executor/logic-executor.d.ts +32 -0
  91. package/out/logic-scheduler/executor/logic-executor.d.ts.map +1 -0
  92. package/out/logic-scheduler/executor/logic-executor.js +30 -0
  93. package/out/logic-scheduler/executor/script-executor.d.ts +39 -0
  94. package/out/logic-scheduler/executor/script-executor.d.ts.map +1 -0
  95. package/out/logic-scheduler/executor/script-executor.js +53 -0
  96. package/out/logic-scheduler/index.d.ts +12 -0
  97. package/out/logic-scheduler/index.d.ts.map +1 -0
  98. package/out/logic-scheduler/index.js +17 -0
  99. package/out/logic-scheduler/logic-scheduler-center.d.ts +45 -0
  100. package/out/logic-scheduler/logic-scheduler-center.d.ts.map +1 -0
  101. package/out/logic-scheduler/logic-scheduler-center.js +49 -0
  102. package/out/logic-scheduler/scheduler/control-logic-scheduler.d.ts +14 -0
  103. package/out/logic-scheduler/scheduler/control-logic-scheduler.d.ts.map +1 -0
  104. package/out/logic-scheduler/scheduler/control-logic-scheduler.js +16 -0
  105. package/out/logic-scheduler/scheduler/logic-scheduler.d.ts +105 -0
  106. package/out/logic-scheduler/scheduler/logic-scheduler.d.ts.map +1 -0
  107. package/out/logic-scheduler/scheduler/logic-scheduler.js +148 -0
  108. package/out/logic-scheduler/scheduler/view-logic-scheduler.d.ts +14 -0
  109. package/out/logic-scheduler/scheduler/view-logic-scheduler.d.ts.map +1 -0
  110. package/out/logic-scheduler/scheduler/view-logic-scheduler.js +14 -0
  111. package/out/logic-scheduler/trigger/item-dyna-logic-trigger.d.ts +12 -0
  112. package/out/logic-scheduler/trigger/item-dyna-logic-trigger.d.ts.map +1 -0
  113. package/out/logic-scheduler/trigger/item-dyna-logic-trigger.js +26 -0
  114. package/out/logic-scheduler/trigger/logic-trigger-factory.d.ts +34 -0
  115. package/out/logic-scheduler/trigger/logic-trigger-factory.d.ts.map +1 -0
  116. package/out/logic-scheduler/trigger/logic-trigger-factory.js +42 -0
  117. package/out/logic-scheduler/trigger/logic-trigger.d.ts +55 -0
  118. package/out/logic-scheduler/trigger/logic-trigger.d.ts.map +1 -0
  119. package/out/logic-scheduler/trigger/logic-trigger.js +52 -0
  120. package/out/plugin/index.d.ts +3 -0
  121. package/out/plugin/index.d.ts.map +1 -0
  122. package/out/plugin/index.js +2 -0
  123. package/out/plugin/plugin-static-resource/plugin-static-resource.d.ts +55 -0
  124. package/out/plugin/plugin-static-resource/plugin-static-resource.d.ts.map +1 -0
  125. package/out/plugin/plugin-static-resource/plugin-static-resource.js +67 -0
  126. package/out/plugin/remote-plugin-item/remote-plugin-item.d.ts +111 -0
  127. package/out/plugin/remote-plugin-item/remote-plugin-item.d.ts.map +1 -0
  128. package/out/plugin/remote-plugin-item/remote-plugin-item.js +24 -0
  129. package/out/provider/index.d.ts +2 -0
  130. package/out/provider/index.d.ts.map +1 -0
  131. package/out/provider/index.js +1 -0
  132. package/out/provider/ui-action/backend-ui-action-provider.d.ts +15 -0
  133. package/out/provider/ui-action/backend-ui-action-provider.d.ts.map +1 -0
  134. package/out/provider/ui-action/backend-ui-action-provider.js +18 -0
  135. package/out/provider/ui-action/common-sys-ui-action-provider.d.ts +15 -0
  136. package/out/provider/ui-action/common-sys-ui-action-provider.d.ts.map +1 -0
  137. package/out/provider/ui-action/common-sys-ui-action-provider.js +18 -0
  138. package/out/provider/ui-action/front-ui-action-provider.d.ts +15 -0
  139. package/out/provider/ui-action/front-ui-action-provider.d.ts.map +1 -0
  140. package/out/provider/ui-action/front-ui-action-provider.js +18 -0
  141. package/out/provider/ui-action/index.d.ts +14 -0
  142. package/out/provider/ui-action/index.d.ts.map +1 -0
  143. package/out/provider/ui-action/index.js +48 -0
  144. package/out/provider/ui-action/wf-withdraw-ui-action-provider.d.ts +15 -0
  145. package/out/provider/ui-action/wf-withdraw-ui-action-provider.d.ts.map +1 -0
  146. package/out/provider/ui-action/wf-withdraw-ui-action-provider.js +18 -0
  147. package/out/register/index.d.ts +4 -0
  148. package/out/register/index.d.ts.map +1 -0
  149. package/out/register/index.js +3 -0
  150. package/out/register/register-base.d.ts +18 -0
  151. package/out/register/register-base.d.ts.map +1 -0
  152. package/out/register/register-base.js +24 -0
  153. package/out/register/register-center.d.ts +20 -0
  154. package/out/register/register-center.d.ts.map +1 -0
  155. package/out/register/register-center.js +21 -0
  156. package/out/register/ui-action-register.d.ts +17 -0
  157. package/out/register/ui-action-register.d.ts.map +1 -0
  158. package/out/register/ui-action-register.js +41 -0
  159. package/out/types.d.ts +35 -3
  160. package/out/types.d.ts.map +1 -1
  161. package/out/utils/app-de-ui-action-util/app-de-ui-action-util.d.ts +0 -59
  162. package/out/utils/app-de-ui-action-util/app-de-ui-action-util.d.ts.map +1 -1
  163. package/out/utils/app-de-ui-action-util/app-de-ui-action-util.js +3 -240
  164. package/out/utils/app-de-ui-action-util/handler/backend-ui-action-handler.d.ts +16 -0
  165. package/out/utils/app-de-ui-action-util/handler/backend-ui-action-handler.d.ts.map +1 -0
  166. package/out/utils/app-de-ui-action-util/handler/backend-ui-action-handler.js +31 -0
  167. package/out/utils/app-de-ui-action-util/handler/common-sys-ui-action-handler.d.ts +16 -0
  168. package/out/utils/app-de-ui-action-util/handler/common-sys-ui-action-handler.d.ts.map +1 -0
  169. package/out/utils/app-de-ui-action-util/handler/common-sys-ui-action-handler.js +103 -0
  170. package/out/utils/app-de-ui-action-util/handler/front-ui-action-handler.d.ts +16 -0
  171. package/out/utils/app-de-ui-action-util/handler/front-ui-action-handler.d.ts.map +1 -0
  172. package/out/utils/app-de-ui-action-util/handler/front-ui-action-handler.js +47 -0
  173. package/out/utils/app-de-ui-action-util/handler/index.d.ts +6 -0
  174. package/out/utils/app-de-ui-action-util/handler/index.d.ts.map +1 -0
  175. package/out/utils/app-de-ui-action-util/handler/index.js +5 -0
  176. package/out/utils/app-de-ui-action-util/handler/ui-action-handler.d.ts +72 -0
  177. package/out/utils/app-de-ui-action-util/handler/ui-action-handler.d.ts.map +1 -0
  178. package/out/utils/app-de-ui-action-util/handler/ui-action-handler.js +166 -0
  179. package/out/utils/app-de-ui-action-util/handler/wf-withdraw-handler.d.ts +16 -0
  180. package/out/utils/app-de-ui-action-util/handler/wf-withdraw-handler.d.ts.map +1 -0
  181. package/out/utils/app-de-ui-action-util/handler/wf-withdraw-handler.js +27 -0
  182. package/out/utils/app-de-ui-action-util/index.d.ts +3 -0
  183. package/out/utils/app-de-ui-action-util/index.d.ts.map +1 -0
  184. package/out/utils/app-de-ui-action-util/index.js +2 -0
  185. package/out/utils/index.d.ts +4 -1
  186. package/out/utils/index.d.ts.map +1 -1
  187. package/out/utils/index.js +4 -1
  188. package/out/utils/nav-params/calc-nav-params.d.ts +29 -0
  189. package/out/utils/nav-params/calc-nav-params.d.ts.map +1 -0
  190. package/out/utils/nav-params/calc-nav-params.js +34 -0
  191. package/out/utils/nav-params/nav-params.d.ts +20 -1
  192. package/out/utils/nav-params/nav-params.d.ts.map +1 -1
  193. package/out/utils/nav-params/nav-params.js +58 -4
  194. package/out/utils/open-redirect-view/open-redirect-view.d.ts +54 -0
  195. package/out/utils/open-redirect-view/open-redirect-view.d.ts.map +1 -0
  196. package/out/utils/open-redirect-view/open-redirect-view.js +232 -0
  197. package/out/utils/wf-helper/wf-helper.d.ts +9 -0
  198. package/out/utils/wf-helper/wf-helper.d.ts.map +1 -0
  199. package/out/utils/wf-helper/wf-helper.js +14 -0
  200. package/out/view-logic/view-logic.d.ts.map +1 -1
  201. package/out/view-logic/view-logic.js +111 -32
  202. package/package.json +27 -16
  203. package/src/command/app/app-func/app-func.ts +27 -27
  204. package/src/command/app/open-app-view/open-app-view.ts +24 -41
  205. package/src/config/global-config.ts +22 -0
  206. package/src/index.ts +4 -1
  207. package/src/install.ts +11 -2
  208. package/src/interface/i-drawer-options/i-drawer-options.ts +28 -0
  209. package/src/interface/i-global-config/i-global-config.ts +65 -0
  210. package/src/interface/i-modal/i-modal.ts +8 -0
  211. package/src/interface/i-modal-data/i-modal-data.ts +1 -1
  212. package/src/interface/i-modal-options/i-modal-options.ts +44 -0
  213. package/src/interface/i-plugin-factory/i-plugin-factory.ts +66 -0
  214. package/src/interface/i-plugin-item/i-plugin-item.ts +27 -0
  215. package/src/interface/i-popover-options/i-popover-options.ts +85 -0
  216. package/src/interface/i-ui-action-handler/i-ui-action-handler.ts +32 -0
  217. package/src/interface/i-ui-action-result/i-ui-action-result.ts +20 -0
  218. package/src/interface/i-ui-logic-params/i-ui-logic-params.ts +31 -0
  219. package/src/interface/index.ts +15 -3
  220. package/src/interface/logic-scheduler/i-scheduler-logic.ts +58 -0
  221. package/src/interface/logic-scheduler/i-trigger-match-params.ts +18 -0
  222. package/src/interface/logic-scheduler/index.ts +7 -0
  223. package/src/interface/provider/i-ui-action-provider.ts +20 -0
  224. package/src/interface/provider/index.ts +1 -0
  225. package/src/interface/register/i-register.ts +8 -1
  226. package/src/interface/register/i-ui-action-register.ts +15 -0
  227. package/src/interface/register/index.ts +2 -0
  228. package/src/interface/util/i-loading-util/i-loading-util.ts +14 -0
  229. package/src/interface/util/i-modal-util/i-modal-util.ts +8 -0
  230. package/src/interface/util/i-open-view-util/i-open-view-util.ts +11 -11
  231. package/src/interface/util/i-overlay-container/i-overlay-container.ts +38 -0
  232. package/src/interface/util/i-overlay-controller/i-overlay-controller.ts +116 -0
  233. package/src/interface/util/i-overlay-popover-container/i-overlay-popover-container.ts +23 -0
  234. package/src/interface/util/index.ts +3 -0
  235. package/src/logic-scheduler/executor/logic-executor-factory.ts +48 -0
  236. package/src/logic-scheduler/executor/logic-executor.ts +43 -0
  237. package/src/logic-scheduler/executor/script-executor.ts +63 -0
  238. package/src/logic-scheduler/index.ts +41 -0
  239. package/src/logic-scheduler/logic-scheduler-center.ts +52 -0
  240. package/src/logic-scheduler/scheduler/control-logic-scheduler.ts +21 -0
  241. package/src/logic-scheduler/scheduler/logic-scheduler.ts +192 -0
  242. package/src/logic-scheduler/scheduler/view-logic-scheduler.ts +17 -0
  243. package/src/logic-scheduler/trigger/item-dyna-logic-trigger.ts +41 -0
  244. package/src/logic-scheduler/trigger/logic-trigger-factory.ts +48 -0
  245. package/src/logic-scheduler/trigger/logic-trigger.ts +77 -0
  246. package/src/plugin/index.ts +5 -0
  247. package/src/plugin/plugin-static-resource/plugin-static-resource.ts +80 -0
  248. package/src/plugin/remote-plugin-item/remote-plugin-item.ts +118 -0
  249. package/src/provider/index.ts +1 -0
  250. package/src/provider/ui-action/backend-ui-action-provider.ts +22 -0
  251. package/src/provider/ui-action/common-sys-ui-action-provider.ts +22 -0
  252. package/src/provider/ui-action/front-ui-action-provider.ts +22 -0
  253. package/src/provider/ui-action/index.ts +56 -0
  254. package/src/provider/ui-action/wf-withdraw-ui-action-provider.ts +22 -0
  255. package/src/register/index.ts +3 -0
  256. package/src/register/register-base.ts +27 -0
  257. package/src/register/register-center.ts +20 -0
  258. package/src/register/ui-action-register.ts +48 -0
  259. package/src/types.ts +39 -3
  260. package/src/utils/app-de-ui-action-util/app-de-ui-action-util.ts +4 -329
  261. package/src/utils/app-de-ui-action-util/handler/backend-ui-action-handler.ts +51 -0
  262. package/src/utils/app-de-ui-action-util/handler/common-sys-ui-action-handler.ts +124 -0
  263. package/src/utils/app-de-ui-action-util/handler/front-ui-action-handler.ts +69 -0
  264. package/src/utils/app-de-ui-action-util/handler/index.ts +5 -0
  265. package/src/utils/app-de-ui-action-util/handler/ui-action-handler.ts +253 -0
  266. package/src/utils/app-de-ui-action-util/handler/wf-withdraw-handler.ts +36 -0
  267. package/src/utils/app-de-ui-action-util/index.ts +2 -0
  268. package/src/utils/index.ts +7 -1
  269. package/src/utils/nav-params/calc-nav-params.ts +59 -0
  270. package/src/utils/nav-params/nav-params.ts +66 -5
  271. package/src/utils/open-redirect-view/open-redirect-view.ts +308 -0
  272. package/src/utils/wf-helper/wf-helper.ts +14 -0
  273. package/src/view-logic/view-logic.ts +123 -30
  274. package/LICENSE +0 -21
  275. package/out/interface/provider/i-editor-provider.d.ts +0 -38
  276. package/out/interface/provider/i-editor-provider.d.ts.map +0 -1
  277. package/out/interface/register/i-editor-register.d.ts +0 -23
  278. package/out/interface/register/i-editor-register.d.ts.map +0 -1
  279. package/out/register/register.d.ts +0 -20
  280. package/out/register/register.d.ts.map +0 -1
  281. package/out/register/register.js +0 -10
  282. package/src/interface/provider/i-editor-provider.ts +0 -44
  283. package/src/interface/register/i-editor-register.ts +0 -23
  284. package/src/register/register.ts +0 -20
  285. /package/out/interface/{provider/i-editor-provider.js → i-drawer-options/i-drawer-options.js} +0 -0
  286. /package/out/interface/{register/i-editor-register.js → i-global-config/i-global-config.js} +0 -0
@@ -0,0 +1,22 @@
1
+ import { IUIActionHandler, IUIActionProvider } from '../../interface';
2
+ import { FrontUIActionHandler } from '../../utils';
3
+
4
+ /**
5
+ * 前台调用界面行为适配器
6
+ *
7
+ * @author lxm
8
+ * @date 2022-10-25 15:10:51
9
+ * @export
10
+ * @class FrontUIActionProvider
11
+ * @implements {IUIActionProvider}
12
+ */
13
+ export class FrontUIActionProvider implements IUIActionProvider {
14
+ private handler?: IUIActionHandler;
15
+
16
+ async getHandler(): Promise<IUIActionHandler> {
17
+ if (!this.handler) {
18
+ this.handler = new FrontUIActionHandler();
19
+ }
20
+ return this.handler;
21
+ }
22
+ }
@@ -0,0 +1,56 @@
1
+ import { BackendUIActionProvider } from './backend-ui-action-provider';
2
+ import { CommonSysUIActionProvider } from './common-sys-ui-action-provider';
3
+ import { FrontUIActionProvider } from './front-ui-action-provider';
4
+ import { WFWithdrawUIActionProvider } from './wf-withdraw-ui-action-provider';
5
+
6
+ /**
7
+ * 预置默认的界面行为适配器
8
+ *
9
+ * @author lxm
10
+ * @date 2022-09-19 22:09:50
11
+ * @export
12
+ */
13
+ export function presetUIActionProvider(): void {
14
+ const { uiAction } = ibiz.register;
15
+ if (!uiAction) {
16
+ return;
17
+ }
18
+ // *前台调用
19
+ uiAction.register('FRONT', new FrontUIActionProvider());
20
+ // *后台调用
21
+ uiAction.register('BACKEND', new BackendUIActionProvider());
22
+ // *系统预置界面行为
23
+ // 打开新建数据视图
24
+ uiAction.register('SYS_New', new CommonSysUIActionProvider());
25
+ // 打开编辑数据视图
26
+ uiAction.register('SYS_Edit', new CommonSysUIActionProvider());
27
+ // 保存
28
+ uiAction.register('SYS_Save', new CommonSysUIActionProvider());
29
+ uiAction.register('SYS_SaveAndExit', new CommonSysUIActionProvider());
30
+ uiAction.register('SYS_SaveRow', new CommonSysUIActionProvider());
31
+ uiAction.register('SYS_SaveAndNew', new CommonSysUIActionProvider());
32
+ // 删除
33
+ uiAction.register('SYS_Remove', new CommonSysUIActionProvider());
34
+ uiAction.register('SYS_RemoveAndExit', new CommonSysUIActionProvider());
35
+ uiAction.register('SYS_NewRow', new CommonSysUIActionProvider());
36
+ // 工作流
37
+ uiAction.register('SYS_SaveAndStart', new CommonSysUIActionProvider());
38
+ uiAction.register('SYS_ViewWFStep', new CommonSysUIActionProvider());
39
+ // 其他
40
+ uiAction.register('SYS_ToggleFilter', new CommonSysUIActionProvider());
41
+ uiAction.register('SYS_Exit', new CommonSysUIActionProvider());
42
+ uiAction.register('SYS_Refresh', new CommonSysUIActionProvider());
43
+ uiAction.register('SYS_Import', new CommonSysUIActionProvider());
44
+ uiAction.register('SYS_ExportExcel', new CommonSysUIActionProvider());
45
+
46
+ // 预置插件
47
+ // 工作流撤回
48
+ uiAction.register('DEUIACTION_WFWithdraw', new WFWithdrawUIActionProvider());
49
+ }
50
+
51
+ export {
52
+ FrontUIActionProvider,
53
+ CommonSysUIActionProvider,
54
+ BackendUIActionProvider,
55
+ WFWithdrawUIActionProvider,
56
+ };
@@ -0,0 +1,22 @@
1
+ import { IUIActionHandler, IUIActionProvider } from '../../interface';
2
+ import { WFWithdrawUIActionHandler } from '../../utils';
3
+
4
+ /**
5
+ * 工作流流程撤回界面行为适配器
6
+ *
7
+ * @author lxm
8
+ * @date 2022-10-25 15:10:51
9
+ * @export
10
+ * @class WFWithdrawUIActionProvider
11
+ * @implements {IUIActionProvider}
12
+ */
13
+ export class WFWithdrawUIActionProvider implements IUIActionProvider {
14
+ private handler?: IUIActionHandler;
15
+
16
+ async getHandler(): Promise<IUIActionHandler> {
17
+ if (!this.handler) {
18
+ this.handler = new WFWithdrawUIActionHandler();
19
+ }
20
+ return this.handler;
21
+ }
22
+ }
@@ -0,0 +1,3 @@
1
+ export * from './register-center';
2
+ export * from './register-base';
3
+ export * from './ui-action-register';
@@ -0,0 +1,27 @@
1
+ import { IRegister } from '../interface';
2
+
3
+ /**
4
+ * 注册器基类
5
+ *
6
+ * @author lxm
7
+ * @date 2022-10-17 16:10:54
8
+ * @export
9
+ * @class RegisterBase
10
+ * @implements {IRegister<T>}
11
+ * @template T
12
+ */
13
+ export class RegisterBase<T> implements IRegister<T> {
14
+ providers: Map<string, T> = new Map();
15
+
16
+ register(key: string, provider: T): void {
17
+ this.providers.set(key, provider);
18
+ }
19
+
20
+ unRegister(key: string): void {
21
+ this.providers.delete(key);
22
+ }
23
+
24
+ getByKey(key: string): T | undefined {
25
+ return this.providers.get(key);
26
+ }
27
+ }
@@ -0,0 +1,20 @@
1
+ import { UIActionRegister } from './ui-action-register';
2
+
3
+ /**
4
+ * 注册中心
5
+ *
6
+ * @author lxm
7
+ * @date 2022-09-19 19:09:10
8
+ * @export
9
+ * @class Register
10
+ */
11
+ export class RegisterCenter {
12
+ /**
13
+ * 界面行为注册器
14
+ *
15
+ * @author lxm
16
+ * @date 2022-10-25 15:10:39
17
+ * @type {UIActionRegister}
18
+ */
19
+ uiAction: UIActionRegister = new UIActionRegister();
20
+ }
@@ -0,0 +1,48 @@
1
+ import { RuntimeError } from '@ibiz-template/core';
2
+ import { IPSAppUIAction } from '@ibiz-template/model';
3
+ import { IUIActionRegister, IUIActionProvider } from '../interface';
4
+ import { RegisterBase } from './register-base';
5
+
6
+ /**
7
+ * 界面行为注册器
8
+ *
9
+ * @author lxm
10
+ * @date 2022-10-25 15:10:38
11
+ * @export
12
+ * @class UIActionRegister
13
+ * @extends {RegisterBase<IUIActionProvider>}
14
+ * @implements {IUIActionRegister}
15
+ */
16
+ export class UIActionRegister
17
+ extends RegisterBase<IUIActionProvider>
18
+ implements IUIActionRegister
19
+ {
20
+ async get(model: IPSAppUIAction): Promise<IUIActionProvider> {
21
+ // 先找插件标识和类型
22
+ if (model.getPSSysPFPlugin()) {
23
+ await ibiz.plugin.loadPlugin(model.getPSSysPFPlugin()!);
24
+ const { pluginType, pluginCode } = model.getPSSysPFPlugin()!;
25
+ const key = `${pluginType}_${pluginCode}`;
26
+ if (this.providers.has(key)) {
27
+ return this.providers.get(key)!;
28
+ }
29
+ throw new RuntimeError(`找不到插件标识${key}对应的适配器`);
30
+ }
31
+ // 找界面行为模式和界面行为标记
32
+ const { uIActionMode, uIActionTag } = model;
33
+ if (uIActionMode === 'SYS') {
34
+ const key = `${uIActionMode}_${uIActionTag}`;
35
+ if (this.providers.has(key)) {
36
+ return this.providers.get(key)!;
37
+ }
38
+ throw new RuntimeError(
39
+ `找不到系统预置界面行为${uIActionTag}对应的适配器`,
40
+ );
41
+ } else {
42
+ if (this.providers.has(uIActionMode)) {
43
+ return this.providers.get(uIActionMode)!;
44
+ }
45
+ throw new RuntimeError(`找不界面行为模式${uIActionMode}对应的适配器`);
46
+ }
47
+ }
48
+ }
package/src/types.ts CHANGED
@@ -6,8 +6,12 @@ import {
6
6
  IOpenViewUtil,
7
7
  IModalUtil,
8
8
  ILoadingUtil,
9
+ IPluginFactory,
10
+ IOverlayController,
11
+ IGlobalConfig,
9
12
  } from './interface';
10
- import { Register } from './register/register';
13
+ import { LogicSchedulerCenter } from './logic-scheduler';
14
+ import { RegisterCenter } from './register/register-center';
11
15
 
12
16
  declare module '@ibiz-template/core' {
13
17
  interface IBizSys {
@@ -63,7 +67,22 @@ declare module '@ibiz-template/core' {
63
67
  * @type {IOpenViewUtil}
64
68
  */
65
69
  openView: IOpenViewUtil;
66
-
70
+ /**
71
+ * 全局多种组件呈现工具类
72
+ *
73
+ * @author chitanda
74
+ * @date 2022-11-08 15:11:08
75
+ * @type {IOverlayController}
76
+ */
77
+ overlay: IOverlayController;
78
+ /**
79
+ * 插件工具工厂
80
+ *
81
+ * @author chitanda
82
+ * @date 2022-10-20 16:10:36
83
+ * @type {IPluginFactory}
84
+ */
85
+ plugin: IPluginFactory;
67
86
  /**
68
87
  * 注册中心
69
88
  *
@@ -71,6 +90,23 @@ declare module '@ibiz-template/core' {
71
90
  * @date 2022-09-19 19:09:23
72
91
  * @type {Register}
73
92
  */
74
- register: Register;
93
+ register: RegisterCenter;
94
+
95
+ /**
96
+ * 全局配置
97
+ *
98
+ * @author lxm
99
+ * @date 2022-12-09 14:12:14
100
+ * @type {IGlobalConfig}
101
+ */
102
+ config: IGlobalConfig;
103
+
104
+ /**
105
+ * 逻辑调度中心
106
+ * @author lxm
107
+ * @date 2023-06-25 06:50:06
108
+ * @type {LogicSchedulerCenter}
109
+ */
110
+ scheduler: LogicSchedulerCenter;
75
111
  }
76
112
  }
@@ -1,13 +1,5 @@
1
- import { IBizContext } from '@ibiz-template/core';
2
- import {
3
- IPSAppDEUIAction,
4
- IPSNavigateContext,
5
- UnsupportedModelError,
6
- } from '@ibiz-template/model';
7
- import { notNilEmpty } from 'qx-util';
8
- import { OpenAppViewCommand } from '../../command';
1
+ import { IPSAppDEUIAction } from '@ibiz-template/model';
9
2
  import { IUIActionResult } from '../../interface';
10
- import { convertNavData } from '../nav-params/nav-params';
11
3
 
12
4
  /**
13
5
  * 应用实体界面行为
@@ -38,325 +30,8 @@ export class AppDEUIActionUtil {
38
30
  params: IParams,
39
31
  opts?: IData,
40
32
  ): Promise<IUIActionResult> {
41
- // **用户操作确认**
42
- if (action.enableConfirm && action.confirmMsg) {
43
- // todo 用户操作确认
44
- }
45
-
46
- const { neuron } = opts!;
47
- const result: IUIActionResult = {
48
- refresh: action.reloadData,
49
- closeView: action.closeEditView,
50
- };
51
-
52
- // *根据行为模式处理
53
- if (action.uIActionMode === 'SYS') {
54
- // 系统预置处理的独有处理
55
- const tempResult = await this.executeSysUIAction(action, data, opts);
56
- Object.assign(result, tempResult);
57
- } else {
58
- // 处理参数
59
- const { resultContext, resultData, resultParams } =
60
- await this.handleParams(action, context, data, params);
61
-
62
- if (action.uIActionMode === 'FRONT') {
63
- // 前台调用的独有处理
64
- const tempResult = await this.executeFrontUIAction(
65
- action,
66
- resultContext,
67
- resultData,
68
- resultParams,
69
- opts,
70
- );
71
- Object.assign(result, tempResult);
72
- } else if (action.uIActionMode === 'BACKEND') {
73
- // 后台调用的独有处理
74
- const tempResult = this.executeBackEndUIAction(
75
- action,
76
- resultContext,
77
- resultData,
78
- resultParams,
79
- );
80
- Object.assign(result, tempResult);
81
- }
82
- }
83
-
84
- // *后续界面行为处理
85
- if (action.getNextPSUIAction()) {
86
- // 后续界面行为
87
- // todo 用到数据时转成后台数据格式。
88
- }
89
-
90
- // *刷新引用视图
91
- if (result.refresh) {
92
- if (!neuron.call.refresh) {
93
- throw new Error(`该视图不存在刷新能力`);
94
- }
95
- await neuron.call.refresh();
96
- }
97
-
98
- // *关闭引用视图
99
- if (result.closeView) {
100
- if (!neuron.call.closeView) {
101
- throw new Error(`该视图不存在关闭视图能力`);
102
- }
103
- await neuron.call.closeView();
104
- }
105
-
106
- return result;
107
- }
108
-
109
- /**
110
- * 参数处理(根据数据目标和数据参数,导航参数)
111
- *
112
- * @author lxm
113
- * @date 2022-08-29 17:08:00
114
- * @protected
115
- * @static
116
- * @param {IPSAppDEUIAction} action 界面行为
117
- * @param {IContext} context 上下文
118
- * @param {(IData[] | null)} data 数据集合
119
- * @param {IParams} params 视图参数
120
- * @returns {*} {Promise<{
121
- * resultContext: IContext; 处理后的上下文
122
- * resultData: IData[]; 处理后的数据集合
123
- * resultParams: IParams; 处理后的视图参数
124
- * }>}
125
- */
126
- protected static async handleParams(
127
- action: IPSAppDEUIAction,
128
- context: IContext,
129
- data: IData[] | null,
130
- params: IParams,
131
- ): Promise<{
132
- resultContext: IContext;
133
- resultData: IData[];
134
- resultParams: IParams;
135
- }> {
136
- let resultData = data || [];
137
- // 数据目标不支持提示
138
- if (
139
- ['SINGLEDATA', 'MULTIDATA', 'MULTIKEY'].indexOf(action.actionTarget) !==
140
- -1
141
- ) {
142
- throw new Error(
143
- `数据类型${action.actionTarget}暂未支持,请配置无数据或单项数据主键`,
144
- );
145
- }
146
-
147
- // 数据目标为无数据时,清空数据
148
- if (action.actionTarget === 'NONE') {
149
- resultData = [];
150
- }
151
-
152
- // 处理上下文导航参数
153
- let resultContext: IData = {};
154
- const navContexts = action.getPSNavigateContexts() || [];
155
-
156
- // 单项数据主键时,在导航参数开头加一个主键的导航参数,可以被配置的同名导航参数覆盖。
157
- const appDataEntity = action.getPSAppDataEntity();
158
- if (appDataEntity && action.actionTarget === 'SINGLEKEY') {
159
- await appDataEntity?.fill(true);
160
- const appDeName = appDataEntity.codeName.toLowerCase();
161
- const { valueItem } = action;
162
- navContexts.unshift({
163
- key: appDeName,
164
- value: valueItem || 'srfkey',
165
- rawValue: false,
166
- } as IPSNavigateContext);
167
- }
168
-
169
- if (notNilEmpty(navContexts)) {
170
- resultContext = convertNavData(
171
- navContexts!,
172
- context,
173
- params,
174
- data?.[0] || {},
175
- );
176
- }
177
- resultContext = new IBizContext(resultContext, context);
178
-
179
- // 处理导航视图参数
180
- let resultParams: IData = {};
181
- const navParams = action.getPSNavigateParams();
182
- if (notNilEmpty(navParams)) {
183
- resultParams = convertNavData(
184
- navParams!,
185
- context,
186
- params,
187
- data?.[0] || {},
188
- );
189
- }
190
- return { resultContext, resultData, resultParams };
191
- }
192
-
193
- /**
194
- * 执行系统预置界面行为
195
- *
196
- * @author lxm
197
- * @date 2022-08-29 15:08:29
198
- * @static
199
- * @param {IPSAppDEUIAction} action
200
- * @returns {*} {Promise<IUIActionResult>}
201
- */
202
- static async executeSysUIAction(
203
- action: IPSAppDEUIAction,
204
- data: IData[] | null,
205
- opts?: IData,
206
- ): Promise<IUIActionResult> {
207
- const { neuron, event } = opts!;
208
- const { uIActionTag } = action;
209
- const result: IUIActionResult = {};
210
-
211
- // todo 暂未支持部分
212
- if (
213
- [
214
- 'HELP',
215
- 'PRINT',
216
- 'ViewWFStep',
217
- 'RefreshParent',
218
- 'RefreshAll',
219
- 'Import',
220
- ].indexOf(uIActionTag) !== -1
221
- ) {
222
- throw new UnsupportedModelError(action, `${uIActionTag}暂未支持`);
223
- }
224
-
225
- // 打开新建数据视图
226
- if (uIActionTag === 'New') {
227
- if (!neuron.call.newData) {
228
- throw new Error(`该视图不存在newData能力`);
229
- }
230
- await neuron.call.newData(event);
231
- }
232
- // 打开编辑数据视图
233
- if (uIActionTag === 'Edit') {
234
- if (!neuron.call.openData) {
235
- throw new Error(`该视图不存在openData能力`);
236
- }
237
- await neuron.call.openData(data?.[0], event);
238
- }
239
-
240
- // 保存能力
241
- const saveTags = ['SaveAndExit', 'Save', 'SaveAndStart', 'SaveRow'];
242
- if (saveTags.indexOf(uIActionTag) !== -1) {
243
- if (!neuron.call.save) {
244
- throw new Error(`该视图不存在save能力`);
245
- }
246
- await neuron.call.save();
247
- }
248
-
249
- // 保存并新建
250
- if (uIActionTag === 'SaveAndNew') {
251
- if (!neuron.call.saveAndNew) {
252
- throw new Error(`该视图不存在saveAndNew能力`);
253
- }
254
- await neuron.call.saveAndNew();
255
- }
256
-
257
- // 删除能力
258
- if (uIActionTag === 'Remove' || uIActionTag === 'RemoveAndExit') {
259
- if (!neuron.call.remove) {
260
- throw new Error(`该视图不存在remove能力`);
261
- }
262
- await neuron.call.remove();
263
- }
264
-
265
- // 新建行能力
266
- if (uIActionTag === 'NewRow') {
267
- if (!neuron.call.newRow) {
268
- throw new Error(`该视图不存在newRow能力`);
269
- }
270
- await neuron.call.newRow();
271
- }
272
-
273
- // 切换搜索表单能力
274
- if (uIActionTag === 'ToggleFilter') {
275
- if (!neuron.call.toggleFilter) {
276
- throw new Error(`该视图不存在ToggleFilter能力`);
277
- }
278
- neuron.call.toggleFilter();
279
- }
280
-
281
- // 需要关闭视图的
282
- if (
283
- ['SaveAndExit', 'Exit', 'SaveAndStart', 'RemoveAndExit'].indexOf(
284
- uIActionTag,
285
- ) !== -1
286
- ) {
287
- result.closeView = true;
288
- }
289
-
290
- // 需要刷新界面的
291
- if (['Refresh'].indexOf(uIActionTag) !== -1) {
292
- result.refresh = true;
293
- }
294
- return result;
295
- }
296
-
297
- /**
298
- * 执行前台调用
299
- *
300
- * @author lxm
301
- * @date 2022-08-29 15:08:51
302
- * @static
303
- * @param {IPSAppDEUIAction} action
304
- * @param {IContext} context
305
- * @param {(IData[] | null)} data
306
- * @param {IParams} params
307
- * @param {IData} [opts]
308
- * @returns {*} {Promise<IUIActionResult>}
309
- */
310
- static async executeFrontUIAction(
311
- action: IPSAppDEUIAction,
312
- context: IContext,
313
- _data: IData[] | null,
314
- params: IParams,
315
- opts?: IData,
316
- ): Promise<IUIActionResult> {
317
- const frontPSAppView = action.getFrontPSAppView();
318
- if (!frontPSAppView) {
319
- throw new Error('未配置打开视图');
320
- }
321
- await frontPSAppView.fill(true);
322
- await ibiz.commands.execute(
323
- OpenAppViewCommand.TAG,
324
- frontPSAppView,
325
- context,
326
- params,
327
- opts,
328
- );
329
-
330
- return {};
331
- }
332
-
333
- /**
334
- * 执行后台调用
335
- *
336
- * @author lxm
337
- * @date 2022-08-28 20:08:35
338
- * @export
339
- * @param {IPSAppDEUIAction} action
340
- * @param {IContext} context
341
- * @param {IData[]} data
342
- * @param {IParams} params
343
- * @returns {*} {Promise<IUIActionResult>}
344
- */
345
- static async executeBackEndUIAction(
346
- action: IPSAppDEUIAction,
347
- context: IContext,
348
- _data: IData[],
349
- params: IParams,
350
- ): Promise<IUIActionResult> {
351
- const entityName = action.getPSAppDataEntity()?.codeName;
352
- const methodName = action.getPSAppDEMethod()?.codeName;
353
- if (!entityName || !methodName) {
354
- throw new Error('找不到实体或实体行为');
355
- }
356
- const deService = await ibiz.entityService.getService(entityName);
357
- const res = await deService.exec(methodName, context, params);
358
- // todo 用到数据时转成后台数据格式。
359
- console.log(res);
360
- return {};
33
+ const provider = await ibiz.register.uiAction.get(action);
34
+ const handler = await provider.getHandler();
35
+ return handler.exec(action, context, data, params, opts);
361
36
  }
362
37
  }
@@ -0,0 +1,51 @@
1
+ import { IPSAppDEUIAction } from '@ibiz-template/model';
2
+ import { isArray } from 'qx-util';
3
+ import { IUIActionResult } from '../../../interface';
4
+ import { UIActionHandler } from './ui-action-handler';
5
+
6
+ /**
7
+ * 后台调用界面行为处理器
8
+ *
9
+ * @author lxm
10
+ * @date 2022-10-25 15:10:20
11
+ * @export
12
+ * @class BackendUIActionHandler
13
+ * @extends {UIActionHandler}
14
+ */
15
+ export class BackendUIActionHandler extends UIActionHandler {
16
+ async execAction(
17
+ action: IPSAppDEUIAction,
18
+ context: IContext,
19
+ data: IData[] | null,
20
+ params: IParams,
21
+ _opts?: IData | undefined,
22
+ ): Promise<IUIActionResult> {
23
+ const entityName = action.getPSAppDataEntity()?.codeName;
24
+ const methodName = action.getPSAppDEMethod()?.codeName;
25
+ if (!entityName || !methodName) {
26
+ throw new Error('找不到实体或实体行为');
27
+ }
28
+ // 处理参数
29
+ const { resultContext, resultParams, resultData } = await this.handleParams(
30
+ action,
31
+ context,
32
+ data,
33
+ params,
34
+ );
35
+ const deService = await ibiz.entityService.getService(entityName);
36
+ const _data =
37
+ resultData.length > 0
38
+ ? resultData[0]?.getRequestData?.() || resultData[0]
39
+ : {};
40
+ const res = await deService.exec(
41
+ methodName,
42
+ resultContext,
43
+ _data,
44
+ resultParams,
45
+ );
46
+
47
+ return {
48
+ data: isArray(res.data) ? (res.data as IData[]) : [res.data],
49
+ };
50
+ }
51
+ }