@ibiz-template/runtime 0.0.1-beta.1 → 0.0.1-beta.141

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 (198) hide show
  1. package/dist/system/index.system.js +1 -1
  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 +19 -20
  5. package/out/command/app/open-app-view/open-app-view.d.ts +12 -13
  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 +6 -6
  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/global/global-util/global-util.d.ts +19 -0
  12. package/out/global/global-util/global-util.d.ts.map +1 -0
  13. package/out/global/global-util/global-util.js +20 -0
  14. package/out/global/index.d.ts +2 -0
  15. package/out/global/index.d.ts.map +1 -0
  16. package/out/global/index.js +1 -0
  17. package/out/index.d.ts +1 -0
  18. package/out/index.d.ts.map +1 -1
  19. package/out/index.js +1 -0
  20. package/out/install.d.ts.map +1 -1
  21. package/out/install.js +9 -0
  22. package/out/interface/i-global-config/i-global-config.d.ts +62 -0
  23. package/out/interface/i-global-config/i-global-config.d.ts.map +1 -0
  24. package/out/interface/i-global-config/i-global-config.js +1 -0
  25. package/out/interface/i-modal/i-modal.d.ts +7 -0
  26. package/out/interface/i-modal/i-modal.d.ts.map +1 -1
  27. package/out/interface/i-modal-options/i-modal-options.d.ts +8 -0
  28. package/out/interface/i-modal-options/i-modal-options.d.ts.map +1 -1
  29. package/out/interface/i-plugin-factory/i-plugin-factory.d.ts +32 -5
  30. package/out/interface/i-plugin-factory/i-plugin-factory.d.ts.map +1 -1
  31. package/out/interface/i-plugin-item/i-plugin-item.d.ts +28 -0
  32. package/out/interface/i-plugin-item/i-plugin-item.d.ts.map +1 -0
  33. package/out/interface/i-plugin-item/i-plugin-item.js +1 -0
  34. package/out/interface/i-ui-action-handler/i-ui-action-handler.d.ts +2 -3
  35. package/out/interface/i-ui-action-handler/i-ui-action-handler.d.ts.map +1 -1
  36. package/out/interface/i-ui-action-result/i-ui-action-result.d.ts +17 -0
  37. package/out/interface/i-ui-action-result/i-ui-action-result.d.ts.map +1 -1
  38. package/out/interface/i-ui-logic-params/i-ui-logic-params.d.ts +31 -0
  39. package/out/interface/i-ui-logic-params/i-ui-logic-params.d.ts.map +1 -0
  40. package/out/interface/i-ui-logic-params/i-ui-logic-params.js +1 -0
  41. package/out/interface/index.d.ts +4 -0
  42. package/out/interface/index.d.ts.map +1 -1
  43. package/out/interface/index.js +1 -0
  44. package/out/interface/logic-scheduler/i-scheduler-logic.d.ts +35 -0
  45. package/out/interface/logic-scheduler/i-scheduler-logic.d.ts.map +1 -0
  46. package/out/interface/logic-scheduler/i-scheduler-logic.js +1 -0
  47. package/out/interface/logic-scheduler/i-trigger-match-params.d.ts +17 -0
  48. package/out/interface/logic-scheduler/i-trigger-match-params.d.ts.map +1 -0
  49. package/out/interface/logic-scheduler/i-trigger-match-params.js +1 -0
  50. package/out/interface/logic-scheduler/index.d.ts +3 -0
  51. package/out/interface/logic-scheduler/index.d.ts.map +1 -0
  52. package/out/interface/logic-scheduler/index.js +1 -0
  53. package/out/interface/util/i-modal-util/i-modal-util.d.ts +8 -0
  54. package/out/interface/util/i-modal-util/i-modal-util.d.ts.map +1 -1
  55. package/out/interface/util/i-open-view-util/i-open-view-util.d.ts +10 -11
  56. package/out/interface/util/i-open-view-util/i-open-view-util.d.ts.map +1 -1
  57. package/out/logic-scheduler/executor/logic-executor-factory.d.ts +34 -0
  58. package/out/logic-scheduler/executor/logic-executor-factory.d.ts.map +1 -0
  59. package/out/logic-scheduler/executor/logic-executor-factory.js +42 -0
  60. package/out/logic-scheduler/executor/logic-executor.d.ts +32 -0
  61. package/out/logic-scheduler/executor/logic-executor.d.ts.map +1 -0
  62. package/out/logic-scheduler/executor/logic-executor.js +30 -0
  63. package/out/logic-scheduler/executor/script-executor.d.ts +39 -0
  64. package/out/logic-scheduler/executor/script-executor.d.ts.map +1 -0
  65. package/out/logic-scheduler/executor/script-executor.js +53 -0
  66. package/out/logic-scheduler/index.d.ts +12 -0
  67. package/out/logic-scheduler/index.d.ts.map +1 -0
  68. package/out/logic-scheduler/index.js +17 -0
  69. package/out/logic-scheduler/logic-scheduler-center.d.ts +45 -0
  70. package/out/logic-scheduler/logic-scheduler-center.d.ts.map +1 -0
  71. package/out/logic-scheduler/logic-scheduler-center.js +49 -0
  72. package/out/logic-scheduler/scheduler/control-logic-scheduler.d.ts +14 -0
  73. package/out/logic-scheduler/scheduler/control-logic-scheduler.d.ts.map +1 -0
  74. package/out/logic-scheduler/scheduler/control-logic-scheduler.js +16 -0
  75. package/out/logic-scheduler/scheduler/logic-scheduler.d.ts +105 -0
  76. package/out/logic-scheduler/scheduler/logic-scheduler.d.ts.map +1 -0
  77. package/out/logic-scheduler/scheduler/logic-scheduler.js +148 -0
  78. package/out/logic-scheduler/scheduler/view-logic-scheduler.d.ts +14 -0
  79. package/out/logic-scheduler/scheduler/view-logic-scheduler.d.ts.map +1 -0
  80. package/out/logic-scheduler/scheduler/view-logic-scheduler.js +14 -0
  81. package/out/logic-scheduler/trigger/item-dyna-logic-trigger.d.ts +12 -0
  82. package/out/logic-scheduler/trigger/item-dyna-logic-trigger.d.ts.map +1 -0
  83. package/out/logic-scheduler/trigger/item-dyna-logic-trigger.js +26 -0
  84. package/out/logic-scheduler/trigger/logic-trigger-factory.d.ts +34 -0
  85. package/out/logic-scheduler/trigger/logic-trigger-factory.d.ts.map +1 -0
  86. package/out/logic-scheduler/trigger/logic-trigger-factory.js +42 -0
  87. package/out/logic-scheduler/trigger/logic-trigger.d.ts +55 -0
  88. package/out/logic-scheduler/trigger/logic-trigger.d.ts.map +1 -0
  89. package/out/logic-scheduler/trigger/logic-trigger.js +52 -0
  90. package/out/plugin/plugin-static-resource/plugin-static-resource.d.ts +18 -0
  91. package/out/plugin/plugin-static-resource/plugin-static-resource.d.ts.map +1 -1
  92. package/out/plugin/plugin-static-resource/plugin-static-resource.js +36 -0
  93. package/out/plugin/remote-plugin-item/remote-plugin-item.d.ts +12 -3
  94. package/out/plugin/remote-plugin-item/remote-plugin-item.d.ts.map +1 -1
  95. package/out/plugin/remote-plugin-item/remote-plugin-item.js +5 -3
  96. package/out/provider/ui-action/index.d.ts +2 -1
  97. package/out/provider/ui-action/index.d.ts.map +1 -1
  98. package/out/provider/ui-action/index.js +5 -1
  99. package/out/provider/ui-action/wf-withdraw-ui-action-provider.d.ts +15 -0
  100. package/out/provider/ui-action/wf-withdraw-ui-action-provider.d.ts.map +1 -0
  101. package/out/provider/ui-action/wf-withdraw-ui-action-provider.js +18 -0
  102. package/out/types.d.ts +26 -1
  103. package/out/types.d.ts.map +1 -1
  104. package/out/utils/app-de-ui-action-util/app-de-ui-action-util.d.ts +2 -3
  105. package/out/utils/app-de-ui-action-util/app-de-ui-action-util.d.ts.map +1 -1
  106. package/out/utils/app-de-ui-action-util/app-de-ui-action-util.js +1 -1
  107. package/out/utils/app-de-ui-action-util/handler/backend-ui-action-handler.d.ts +1 -2
  108. package/out/utils/app-de-ui-action-util/handler/backend-ui-action-handler.d.ts.map +1 -1
  109. package/out/utils/app-de-ui-action-util/handler/backend-ui-action-handler.js +7 -4
  110. package/out/utils/app-de-ui-action-util/handler/common-sys-ui-action-handler.d.ts +1 -2
  111. package/out/utils/app-de-ui-action-util/handler/common-sys-ui-action-handler.d.ts.map +1 -1
  112. package/out/utils/app-de-ui-action-util/handler/common-sys-ui-action-handler.js +1 -1
  113. package/out/utils/app-de-ui-action-util/handler/front-ui-action-handler.d.ts +1 -2
  114. package/out/utils/app-de-ui-action-util/handler/front-ui-action-handler.d.ts.map +1 -1
  115. package/out/utils/app-de-ui-action-util/handler/front-ui-action-handler.js +31 -8
  116. package/out/utils/app-de-ui-action-util/handler/index.d.ts +1 -0
  117. package/out/utils/app-de-ui-action-util/handler/index.d.ts.map +1 -1
  118. package/out/utils/app-de-ui-action-util/handler/index.js +1 -0
  119. package/out/utils/app-de-ui-action-util/handler/ui-action-handler.d.ts +10 -20
  120. package/out/utils/app-de-ui-action-util/handler/ui-action-handler.d.ts.map +1 -1
  121. package/out/utils/app-de-ui-action-util/handler/ui-action-handler.js +82 -59
  122. package/out/utils/app-de-ui-action-util/handler/wf-withdraw-handler.d.ts +16 -0
  123. package/out/utils/app-de-ui-action-util/handler/wf-withdraw-handler.d.ts.map +1 -0
  124. package/out/utils/app-de-ui-action-util/handler/wf-withdraw-handler.js +27 -0
  125. package/out/utils/index.d.ts +4 -1
  126. package/out/utils/index.d.ts.map +1 -1
  127. package/out/utils/index.js +4 -1
  128. package/out/utils/nav-params/calc-nav-params.d.ts +29 -0
  129. package/out/utils/nav-params/calc-nav-params.d.ts.map +1 -0
  130. package/out/utils/nav-params/calc-nav-params.js +34 -0
  131. package/out/utils/nav-params/nav-params.d.ts +20 -1
  132. package/out/utils/nav-params/nav-params.d.ts.map +1 -1
  133. package/out/utils/nav-params/nav-params.js +58 -4
  134. package/out/utils/open-redirect-view/open-redirect-view.d.ts +19 -8
  135. package/out/utils/open-redirect-view/open-redirect-view.d.ts.map +1 -1
  136. package/out/utils/open-redirect-view/open-redirect-view.js +107 -14
  137. package/out/utils/text-util/text-util.d.ts +21 -0
  138. package/out/utils/text-util/text-util.d.ts.map +1 -0
  139. package/out/utils/text-util/text-util.js +22 -0
  140. package/out/utils/wf-helper/wf-helper.d.ts +9 -0
  141. package/out/utils/wf-helper/wf-helper.d.ts.map +1 -0
  142. package/out/utils/wf-helper/wf-helper.js +14 -0
  143. package/out/view-logic/view-logic.d.ts +6 -7
  144. package/out/view-logic/view-logic.d.ts.map +1 -1
  145. package/out/view-logic/view-logic.js +102 -29
  146. package/package.json +15 -14
  147. package/src/command/app/app-func/app-func.ts +24 -24
  148. package/src/command/app/open-app-view/open-app-view.ts +12 -13
  149. package/src/config/global-config.ts +22 -0
  150. package/src/global/global-util/global-util.ts +19 -0
  151. package/src/global/index.ts +1 -0
  152. package/src/index.ts +1 -0
  153. package/src/install.ts +9 -0
  154. package/src/interface/i-global-config/i-global-config.ts +65 -0
  155. package/src/interface/i-modal/i-modal.ts +8 -0
  156. package/src/interface/i-modal-options/i-modal-options.ts +9 -0
  157. package/src/interface/i-plugin-factory/i-plugin-factory.ts +32 -5
  158. package/src/interface/i-plugin-item/i-plugin-item.ts +27 -0
  159. package/src/interface/i-ui-action-handler/i-ui-action-handler.ts +2 -3
  160. package/src/interface/i-ui-action-result/i-ui-action-result.ts +20 -0
  161. package/src/interface/i-ui-logic-params/i-ui-logic-params.ts +31 -0
  162. package/src/interface/index.ts +5 -0
  163. package/src/interface/logic-scheduler/i-scheduler-logic.ts +58 -0
  164. package/src/interface/logic-scheduler/i-trigger-match-params.ts +18 -0
  165. package/src/interface/logic-scheduler/index.ts +7 -0
  166. package/src/interface/util/i-modal-util/i-modal-util.ts +8 -0
  167. package/src/interface/util/i-open-view-util/i-open-view-util.ts +10 -11
  168. package/src/logic-scheduler/executor/logic-executor-factory.ts +48 -0
  169. package/src/logic-scheduler/executor/logic-executor.ts +43 -0
  170. package/src/logic-scheduler/executor/script-executor.ts +63 -0
  171. package/src/logic-scheduler/index.ts +41 -0
  172. package/src/logic-scheduler/logic-scheduler-center.ts +52 -0
  173. package/src/logic-scheduler/scheduler/control-logic-scheduler.ts +21 -0
  174. package/src/logic-scheduler/scheduler/logic-scheduler.ts +192 -0
  175. package/src/logic-scheduler/scheduler/view-logic-scheduler.ts +17 -0
  176. package/src/logic-scheduler/trigger/item-dyna-logic-trigger.ts +41 -0
  177. package/src/logic-scheduler/trigger/logic-trigger-factory.ts +48 -0
  178. package/src/logic-scheduler/trigger/logic-trigger.ts +77 -0
  179. package/src/plugin/plugin-static-resource/plugin-static-resource.ts +38 -0
  180. package/src/plugin/remote-plugin-item/remote-plugin-item.ts +14 -3
  181. package/src/provider/ui-action/index.ts +6 -0
  182. package/src/provider/ui-action/wf-withdraw-ui-action-provider.ts +22 -0
  183. package/src/types.ts +29 -0
  184. package/src/utils/app-de-ui-action-util/app-de-ui-action-util.ts +2 -3
  185. package/src/utils/app-de-ui-action-util/handler/backend-ui-action-handler.ts +13 -5
  186. package/src/utils/app-de-ui-action-util/handler/common-sys-ui-action-handler.ts +2 -3
  187. package/src/utils/app-de-ui-action-util/handler/front-ui-action-handler.ts +46 -23
  188. package/src/utils/app-de-ui-action-util/handler/index.ts +1 -0
  189. package/src/utils/app-de-ui-action-util/handler/ui-action-handler.ts +113 -75
  190. package/src/utils/app-de-ui-action-util/handler/wf-withdraw-handler.ts +36 -0
  191. package/src/utils/index.ts +7 -1
  192. package/src/utils/nav-params/calc-nav-params.ts +59 -0
  193. package/src/utils/nav-params/nav-params.ts +66 -5
  194. package/src/utils/open-redirect-view/open-redirect-view.ts +142 -14
  195. package/src/utils/text-util/text-util.ts +22 -0
  196. package/src/utils/wf-helper/wf-helper.ts +14 -0
  197. package/src/view-logic/view-logic.ts +111 -31
  198. package/LICENSE +0 -21
@@ -0,0 +1,77 @@
1
+ import { RuntimeError } from '@ibiz-template/core';
2
+ import type {
3
+ IUILogicParams,
4
+ ISchedulerLogic,
5
+ ITriggerMatchParams,
6
+ TriggerType,
7
+ } from '../../interface';
8
+ import { LogicExecutor } from '../executor/logic-executor';
9
+
10
+ /**
11
+ * 逻辑触发器
12
+ * @author lxm
13
+ * @date 2023-06-25 06:09:22
14
+ * @export
15
+ * @class LogicTrigger
16
+ */
17
+ export class LogicTrigger {
18
+ /**
19
+ *
20
+ * @author lxm
21
+ * @date 2023-06-25 07:32:04
22
+ */
23
+ type: TriggerType;
24
+
25
+ /**
26
+ * @author lxm
27
+ * @date 2023-06-25 07:32:57
28
+ * @param {ISchedulerLogic} logic 逻辑
29
+ */
30
+ constructor(protected logic: ISchedulerLogic) {
31
+ this.type = logic.triggerType;
32
+ }
33
+
34
+ /**
35
+ * 执行器
36
+ * @author lxm
37
+ * @date 2023-06-25 07:25:05
38
+ * @type {LogicExecutor}
39
+ */
40
+ executor?: LogicExecutor;
41
+
42
+ /**
43
+ * 绑定执行器
44
+ * @author lxm
45
+ * @date 2023-06-25 07:25:13
46
+ * @param {LogicExecutor} executor
47
+ */
48
+ bindExecutor(executor: LogicExecutor) {
49
+ this.executor = executor;
50
+ }
51
+
52
+ /**
53
+ * 匹配触发器,返回true表示该触发器满足触发条件。
54
+ * @author lxm
55
+ * @date 2023-06-25 07:49:00
56
+ * @param {IData} _args
57
+ * @return {*} {boolean}
58
+ */
59
+ match(matchParams: ITriggerMatchParams): boolean {
60
+ return matchParams.triggerType === this.type;
61
+ }
62
+
63
+ /**
64
+ * 执行对应的执行器
65
+ * @author lxm
66
+ * @date 2023-06-26 01:45:42
67
+ * @param {Partial<IUILogicParams>} executeParams
68
+ * @return {*}
69
+ */
70
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
71
+ execute(executeParams: IUILogicParams): any {
72
+ if (this.executor) {
73
+ return this.executor.execute(executeParams);
74
+ }
75
+ throw new RuntimeError(`${this.logic.id}没有绑定executor`);
76
+ }
77
+ }
@@ -17,6 +17,16 @@ export class PluginStaticResource {
17
17
  */
18
18
  protected baseDir: string;
19
19
 
20
+ /**
21
+ * 已经输出过路径的 style 标签
22
+ *
23
+ * @author chitanda
24
+ * @date 2023-03-23 10:03:38
25
+ * @protected
26
+ * @type {Map<string, null>}
27
+ */
28
+ protected styleElementMap: Map<string, null> = new Map();
29
+
20
30
  /**
21
31
  * 插件静态资源工具类.
22
32
  *
@@ -39,4 +49,32 @@ export class PluginStaticResource {
39
49
  dir(path: string): string {
40
50
  return this.baseDir + path;
41
51
  }
52
+
53
+ /**
54
+ * 加载样式静态资源
55
+ *
56
+ * @author chitanda
57
+ * @date 2023-03-23 10:03:49
58
+ * @param {string[]} urls
59
+ * @return {*} {Promise<void>}
60
+ */
61
+ async loadStyle(urls: string[]): Promise<void> {
62
+ const all = urls.map(styleUrl => {
63
+ const url = this.dir(styleUrl);
64
+ if (this.styleElementMap.has(url)) {
65
+ return false;
66
+ }
67
+ this.styleElementMap.set(url, null);
68
+ return new Promise((resolve, reject) => {
69
+ const linkDom = document.createElement('link');
70
+ linkDom.setAttribute('type', 'text/css');
71
+ linkDom.setAttribute('rel', 'stylesheet');
72
+ linkDom.setAttribute('href', url);
73
+ linkDom.onload = resolve;
74
+ linkDom.onerror = reject;
75
+ document.head.appendChild(linkDom);
76
+ });
77
+ });
78
+ await Promise.all(all);
79
+ }
42
80
  }
@@ -83,6 +83,15 @@ export class RemotePluginItem {
83
83
  */
84
84
  readonly tag: string;
85
85
 
86
+ /**
87
+ * 插件模型
88
+ *
89
+ * @author chitanda
90
+ * @date 2023-01-30 15:01:37
91
+ * @type {IPSAppPFPluginRef}
92
+ */
93
+ readonly repo: string;
94
+
86
95
  /**
87
96
  * 配置参数
88
97
  *
@@ -96,12 +105,14 @@ export class RemotePluginItem {
96
105
  * Creates an instance of RemotePluginItem.
97
106
  *
98
107
  * @author chitanda
99
- * @date 2022-10-31 12:10:28
100
- * @param {string} tag 插件唯一标识
108
+ * @date 2023-02-02 15:02:13
109
+ * @param {string} tag 插件标识名称
110
+ * @param {string} repo 插件路径
101
111
  * @param {RemotePluginConfig} config
102
112
  */
103
- constructor(tag: string, config: RemotePluginConfig) {
113
+ constructor(tag: string, repo: string, config: RemotePluginConfig) {
104
114
  this.tag = tag;
115
+ this.repo = repo;
105
116
  this.config = config;
106
117
  }
107
118
  }
@@ -1,6 +1,7 @@
1
1
  import { BackendUIActionProvider } from './backend-ui-action-provider';
2
2
  import { CommonSysUIActionProvider } from './common-sys-ui-action-provider';
3
3
  import { FrontUIActionProvider } from './front-ui-action-provider';
4
+ import { WFWithdrawUIActionProvider } from './wf-withdraw-ui-action-provider';
4
5
 
5
6
  /**
6
7
  * 预置默认的界面行为适配器
@@ -41,10 +42,15 @@ export function presetUIActionProvider(): void {
41
42
  uiAction.register('SYS_Refresh', new CommonSysUIActionProvider());
42
43
  uiAction.register('SYS_Import', new CommonSysUIActionProvider());
43
44
  uiAction.register('SYS_ExportExcel', new CommonSysUIActionProvider());
45
+
46
+ // 预置插件
47
+ // 工作流撤回
48
+ uiAction.register('DEUIACTION_WFWithdraw', new WFWithdrawUIActionProvider());
44
49
  }
45
50
 
46
51
  export {
47
52
  FrontUIActionProvider,
48
53
  CommonSysUIActionProvider,
49
54
  BackendUIActionProvider,
55
+ WFWithdrawUIActionProvider,
50
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
+ }
package/src/types.ts CHANGED
@@ -8,8 +8,11 @@ import {
8
8
  ILoadingUtil,
9
9
  IPluginFactory,
10
10
  IOverlayController,
11
+ IGlobalConfig,
11
12
  } from './interface';
13
+ import { LogicSchedulerCenter } from './logic-scheduler';
12
14
  import { RegisterCenter } from './register/register-center';
15
+ import { GlobalUtil } from './global';
13
16
 
14
17
  declare module '@ibiz-template/core' {
15
18
  interface IBizSys {
@@ -89,5 +92,31 @@ declare module '@ibiz-template/core' {
89
92
  * @type {Register}
90
93
  */
91
94
  register: RegisterCenter;
95
+
96
+ /**
97
+ * 全局配置
98
+ *
99
+ * @author lxm
100
+ * @date 2022-12-09 14:12:14
101
+ * @type {IGlobalConfig}
102
+ */
103
+ config: IGlobalConfig;
104
+
105
+ /**
106
+ * 逻辑调度中心
107
+ * @author lxm
108
+ * @date 2023-06-25 06:50:06
109
+ * @type {LogicSchedulerCenter}
110
+ */
111
+ scheduler: LogicSchedulerCenter;
112
+
113
+ /**
114
+ * 全局工具类
115
+ *
116
+ * @author zhanghengfeng
117
+ * @date 2023-11-03 15:11:11
118
+ * @type {GlobalUtil}
119
+ */
120
+ util: GlobalUtil;
92
121
  }
93
122
  }
@@ -1,4 +1,3 @@
1
- import { IBizContext } from '@ibiz-template/core';
2
1
  import { IPSAppDEUIAction } from '@ibiz-template/model';
3
2
  import { IUIActionResult } from '../../interface';
4
3
 
@@ -18,7 +17,7 @@ export class AppDEUIActionUtil {
18
17
  * @date 2022-08-29 15:08:47
19
18
  * @static
20
19
  * @param {IPSAppDEUIAction} action
21
- * @param {IBizContext} context
20
+ * @param {IContext} context
22
21
  * @param {(IData | null)} data
23
22
  * @param {IParams} [params]
24
23
  * @param {IData} [opts]
@@ -26,7 +25,7 @@ export class AppDEUIActionUtil {
26
25
  */
27
26
  static async exec(
28
27
  action: IPSAppDEUIAction,
29
- context: IBizContext,
28
+ context: IContext,
30
29
  data: IData[] | null,
31
30
  params: IParams,
32
31
  opts?: IData,
@@ -1,5 +1,5 @@
1
- import { IBizContext } from '@ibiz-template/core';
2
1
  import { IPSAppDEUIAction } from '@ibiz-template/model';
2
+ import { isArray } from 'qx-util';
3
3
  import { IUIActionResult } from '../../../interface';
4
4
  import { UIActionHandler } from './ui-action-handler';
5
5
 
@@ -15,7 +15,7 @@ import { UIActionHandler } from './ui-action-handler';
15
15
  export class BackendUIActionHandler extends UIActionHandler {
16
16
  async execAction(
17
17
  action: IPSAppDEUIAction,
18
- context: IBizContext,
18
+ context: IContext,
19
19
  data: IData[] | null,
20
20
  params: IParams,
21
21
  _opts?: IData | undefined,
@@ -35,9 +35,17 @@ export class BackendUIActionHandler extends UIActionHandler {
35
35
  const deService = await ibiz.entityService.getService(entityName);
36
36
  const _data =
37
37
  resultData.length > 0
38
- ? resultData[0]?.getRequestData() || resultData[0]
38
+ ? resultData[0]?.getRequestData?.() || resultData[0]
39
39
  : {};
40
- await deService.exec(methodName, resultContext, _data, resultParams);
41
- return {};
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
+ };
42
50
  }
43
51
  }
@@ -1,4 +1,3 @@
1
- import { IBizContext } from '@ibiz-template/core';
2
1
  import { IPSAppDEUIAction } from '@ibiz-template/model';
3
2
  import { IUIActionResult } from '../../../interface';
4
3
  import { UIActionHandler } from './ui-action-handler';
@@ -15,7 +14,7 @@ import { UIActionHandler } from './ui-action-handler';
15
14
  export class CommonSysUIActionHandler extends UIActionHandler {
16
15
  async execAction(
17
16
  action: IPSAppDEUIAction,
18
- context: IBizContext,
17
+ context: IContext,
19
18
  data: IData[] | null,
20
19
  params: IParams,
21
20
  opts?: IData | undefined,
@@ -62,7 +61,7 @@ export class CommonSysUIActionHandler extends UIActionHandler {
62
61
  if (!neuron.call.remove) {
63
62
  throw new Error(`该视图不存在remove能力`);
64
63
  }
65
- await neuron.call.remove();
64
+ await neuron.call.remove(data);
66
65
  }
67
66
 
68
67
  // 新建行能力
@@ -1,7 +1,7 @@
1
- import { IBizContext } from '@ibiz-template/core';
2
- import { IPSAppDEUIAction } from '@ibiz-template/model';
1
+ import { IPSAppDEUIAction, UnsupportedModelError } from '@ibiz-template/model';
2
+ import { StringUtil } from '@ibiz-template/core';
3
3
  import { OpenAppViewCommand } from '../../../command';
4
- import { IUIActionResult } from '../../../interface';
4
+ import { IModalData, IUIActionResult } from '../../../interface';
5
5
  import { UIActionHandler } from './ui-action-handler';
6
6
 
7
7
  /**
@@ -16,31 +16,54 @@ import { UIActionHandler } from './ui-action-handler';
16
16
  export class FrontUIActionHandler extends UIActionHandler {
17
17
  async execAction(
18
18
  action: IPSAppDEUIAction,
19
- context: IBizContext,
19
+ context: IContext,
20
20
  data: IData[] | null,
21
21
  params: IParams,
22
22
  opts?: IData | undefined,
23
23
  ): Promise<IUIActionResult> {
24
- const frontPSAppView = action.getFrontPSAppView();
25
- if (!frontPSAppView) {
26
- throw new Error('未配置打开视图');
24
+ const actionResult: IUIActionResult = {};
25
+ const { frontProcessType } = action;
26
+ if (frontProcessType === 'OPENHTMLPAGE') {
27
+ // 打开html
28
+ const url = StringUtil.fill(action.htmlPageUrl, context, data?.[0]);
29
+ window.open(url, '_blank');
27
30
  }
28
- await frontPSAppView.fill(true);
29
- // 处理参数
30
- const { resultContext, resultParams } = await this.handleParams(
31
- action,
32
- context,
33
- data,
34
- params,
35
- );
36
- await ibiz.commands.execute(
37
- OpenAppViewCommand.TAG,
38
- frontPSAppView,
39
- resultContext,
40
- resultParams,
41
- opts,
42
- );
31
+ if (['TOP', 'WIZARD'].includes(frontProcessType)) {
32
+ const frontPSAppView = action.getFrontPSAppView();
33
+ if (!frontPSAppView) {
34
+ throw new Error('未配置打开视图');
35
+ }
36
+ await frontPSAppView.fill(true);
37
+ // 处理参数
38
+ const { resultContext, resultParams } = await this.handleParams(
39
+ action,
40
+ context,
41
+ data,
42
+ params,
43
+ );
44
+ const res: IModalData | undefined = await ibiz.commands.execute(
45
+ OpenAppViewCommand.TAG,
46
+ frontPSAppView,
47
+ resultContext,
48
+ resultParams,
49
+ opts,
50
+ );
51
+ // 打开视图取消操作时,不执行刷新和关闭视图操作。
52
+ if (res?.ok === false) {
53
+ actionResult.closeView = false;
54
+ actionResult.refresh = false;
55
+ actionResult.cancel = true;
56
+ }
43
57
 
44
- return {};
58
+ if (res?.ok && res.data) {
59
+ actionResult.data = res.data;
60
+ }
61
+ } else {
62
+ throw new UnsupportedModelError(
63
+ action,
64
+ `未支持的前台处理模式[${frontProcessType}]`,
65
+ );
66
+ }
67
+ return actionResult;
45
68
  }
46
69
  }
@@ -2,3 +2,4 @@ export * from './ui-action-handler';
2
2
  export * from './common-sys-ui-action-handler';
3
3
  export * from './backend-ui-action-handler';
4
4
  export * from './front-ui-action-handler';
5
+ export * from './wf-withdraw-handler';