@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.
- package/dist/system/index.system.js +1 -1
- package/out/command/app/app-func/app-func.d.ts +10 -11
- package/out/command/app/app-func/app-func.d.ts.map +1 -1
- package/out/command/app/app-func/app-func.js +19 -20
- package/out/command/app/open-app-view/open-app-view.d.ts +12 -13
- package/out/command/app/open-app-view/open-app-view.d.ts.map +1 -1
- package/out/command/app/open-app-view/open-app-view.js +6 -6
- package/out/config/global-config.d.ts +18 -0
- package/out/config/global-config.d.ts.map +1 -0
- package/out/config/global-config.js +18 -0
- package/out/global/global-util/global-util.d.ts +19 -0
- package/out/global/global-util/global-util.d.ts.map +1 -0
- package/out/global/global-util/global-util.js +20 -0
- package/out/global/index.d.ts +2 -0
- package/out/global/index.d.ts.map +1 -0
- package/out/global/index.js +1 -0
- package/out/index.d.ts +1 -0
- package/out/index.d.ts.map +1 -1
- package/out/index.js +1 -0
- package/out/install.d.ts.map +1 -1
- package/out/install.js +9 -0
- package/out/interface/i-global-config/i-global-config.d.ts +62 -0
- package/out/interface/i-global-config/i-global-config.d.ts.map +1 -0
- package/out/interface/i-global-config/i-global-config.js +1 -0
- package/out/interface/i-modal/i-modal.d.ts +7 -0
- package/out/interface/i-modal/i-modal.d.ts.map +1 -1
- package/out/interface/i-modal-options/i-modal-options.d.ts +8 -0
- package/out/interface/i-modal-options/i-modal-options.d.ts.map +1 -1
- package/out/interface/i-plugin-factory/i-plugin-factory.d.ts +32 -5
- package/out/interface/i-plugin-factory/i-plugin-factory.d.ts.map +1 -1
- package/out/interface/i-plugin-item/i-plugin-item.d.ts +28 -0
- package/out/interface/i-plugin-item/i-plugin-item.d.ts.map +1 -0
- package/out/interface/i-plugin-item/i-plugin-item.js +1 -0
- package/out/interface/i-ui-action-handler/i-ui-action-handler.d.ts +2 -3
- package/out/interface/i-ui-action-handler/i-ui-action-handler.d.ts.map +1 -1
- package/out/interface/i-ui-action-result/i-ui-action-result.d.ts +17 -0
- package/out/interface/i-ui-action-result/i-ui-action-result.d.ts.map +1 -1
- package/out/interface/i-ui-logic-params/i-ui-logic-params.d.ts +31 -0
- package/out/interface/i-ui-logic-params/i-ui-logic-params.d.ts.map +1 -0
- package/out/interface/i-ui-logic-params/i-ui-logic-params.js +1 -0
- package/out/interface/index.d.ts +4 -0
- package/out/interface/index.d.ts.map +1 -1
- package/out/interface/index.js +1 -0
- package/out/interface/logic-scheduler/i-scheduler-logic.d.ts +35 -0
- package/out/interface/logic-scheduler/i-scheduler-logic.d.ts.map +1 -0
- package/out/interface/logic-scheduler/i-scheduler-logic.js +1 -0
- package/out/interface/logic-scheduler/i-trigger-match-params.d.ts +17 -0
- package/out/interface/logic-scheduler/i-trigger-match-params.d.ts.map +1 -0
- package/out/interface/logic-scheduler/i-trigger-match-params.js +1 -0
- package/out/interface/logic-scheduler/index.d.ts +3 -0
- package/out/interface/logic-scheduler/index.d.ts.map +1 -0
- package/out/interface/logic-scheduler/index.js +1 -0
- package/out/interface/util/i-modal-util/i-modal-util.d.ts +8 -0
- package/out/interface/util/i-modal-util/i-modal-util.d.ts.map +1 -1
- package/out/interface/util/i-open-view-util/i-open-view-util.d.ts +10 -11
- package/out/interface/util/i-open-view-util/i-open-view-util.d.ts.map +1 -1
- package/out/logic-scheduler/executor/logic-executor-factory.d.ts +34 -0
- package/out/logic-scheduler/executor/logic-executor-factory.d.ts.map +1 -0
- package/out/logic-scheduler/executor/logic-executor-factory.js +42 -0
- package/out/logic-scheduler/executor/logic-executor.d.ts +32 -0
- package/out/logic-scheduler/executor/logic-executor.d.ts.map +1 -0
- package/out/logic-scheduler/executor/logic-executor.js +30 -0
- package/out/logic-scheduler/executor/script-executor.d.ts +39 -0
- package/out/logic-scheduler/executor/script-executor.d.ts.map +1 -0
- package/out/logic-scheduler/executor/script-executor.js +53 -0
- package/out/logic-scheduler/index.d.ts +12 -0
- package/out/logic-scheduler/index.d.ts.map +1 -0
- package/out/logic-scheduler/index.js +17 -0
- package/out/logic-scheduler/logic-scheduler-center.d.ts +45 -0
- package/out/logic-scheduler/logic-scheduler-center.d.ts.map +1 -0
- package/out/logic-scheduler/logic-scheduler-center.js +49 -0
- package/out/logic-scheduler/scheduler/control-logic-scheduler.d.ts +14 -0
- package/out/logic-scheduler/scheduler/control-logic-scheduler.d.ts.map +1 -0
- package/out/logic-scheduler/scheduler/control-logic-scheduler.js +16 -0
- package/out/logic-scheduler/scheduler/logic-scheduler.d.ts +105 -0
- package/out/logic-scheduler/scheduler/logic-scheduler.d.ts.map +1 -0
- package/out/logic-scheduler/scheduler/logic-scheduler.js +148 -0
- package/out/logic-scheduler/scheduler/view-logic-scheduler.d.ts +14 -0
- package/out/logic-scheduler/scheduler/view-logic-scheduler.d.ts.map +1 -0
- package/out/logic-scheduler/scheduler/view-logic-scheduler.js +14 -0
- package/out/logic-scheduler/trigger/item-dyna-logic-trigger.d.ts +12 -0
- package/out/logic-scheduler/trigger/item-dyna-logic-trigger.d.ts.map +1 -0
- package/out/logic-scheduler/trigger/item-dyna-logic-trigger.js +26 -0
- package/out/logic-scheduler/trigger/logic-trigger-factory.d.ts +34 -0
- package/out/logic-scheduler/trigger/logic-trigger-factory.d.ts.map +1 -0
- package/out/logic-scheduler/trigger/logic-trigger-factory.js +42 -0
- package/out/logic-scheduler/trigger/logic-trigger.d.ts +55 -0
- package/out/logic-scheduler/trigger/logic-trigger.d.ts.map +1 -0
- package/out/logic-scheduler/trigger/logic-trigger.js +52 -0
- package/out/plugin/plugin-static-resource/plugin-static-resource.d.ts +18 -0
- package/out/plugin/plugin-static-resource/plugin-static-resource.d.ts.map +1 -1
- package/out/plugin/plugin-static-resource/plugin-static-resource.js +36 -0
- package/out/plugin/remote-plugin-item/remote-plugin-item.d.ts +12 -3
- package/out/plugin/remote-plugin-item/remote-plugin-item.d.ts.map +1 -1
- package/out/plugin/remote-plugin-item/remote-plugin-item.js +5 -3
- package/out/provider/ui-action/index.d.ts +2 -1
- package/out/provider/ui-action/index.d.ts.map +1 -1
- package/out/provider/ui-action/index.js +5 -1
- package/out/provider/ui-action/wf-withdraw-ui-action-provider.d.ts +15 -0
- package/out/provider/ui-action/wf-withdraw-ui-action-provider.d.ts.map +1 -0
- package/out/provider/ui-action/wf-withdraw-ui-action-provider.js +18 -0
- package/out/types.d.ts +26 -1
- package/out/types.d.ts.map +1 -1
- package/out/utils/app-de-ui-action-util/app-de-ui-action-util.d.ts +2 -3
- package/out/utils/app-de-ui-action-util/app-de-ui-action-util.d.ts.map +1 -1
- package/out/utils/app-de-ui-action-util/app-de-ui-action-util.js +1 -1
- package/out/utils/app-de-ui-action-util/handler/backend-ui-action-handler.d.ts +1 -2
- package/out/utils/app-de-ui-action-util/handler/backend-ui-action-handler.d.ts.map +1 -1
- package/out/utils/app-de-ui-action-util/handler/backend-ui-action-handler.js +7 -4
- package/out/utils/app-de-ui-action-util/handler/common-sys-ui-action-handler.d.ts +1 -2
- package/out/utils/app-de-ui-action-util/handler/common-sys-ui-action-handler.d.ts.map +1 -1
- package/out/utils/app-de-ui-action-util/handler/common-sys-ui-action-handler.js +1 -1
- package/out/utils/app-de-ui-action-util/handler/front-ui-action-handler.d.ts +1 -2
- package/out/utils/app-de-ui-action-util/handler/front-ui-action-handler.d.ts.map +1 -1
- package/out/utils/app-de-ui-action-util/handler/front-ui-action-handler.js +31 -8
- package/out/utils/app-de-ui-action-util/handler/index.d.ts +1 -0
- package/out/utils/app-de-ui-action-util/handler/index.d.ts.map +1 -1
- package/out/utils/app-de-ui-action-util/handler/index.js +1 -0
- package/out/utils/app-de-ui-action-util/handler/ui-action-handler.d.ts +10 -20
- package/out/utils/app-de-ui-action-util/handler/ui-action-handler.d.ts.map +1 -1
- package/out/utils/app-de-ui-action-util/handler/ui-action-handler.js +82 -59
- package/out/utils/app-de-ui-action-util/handler/wf-withdraw-handler.d.ts +16 -0
- package/out/utils/app-de-ui-action-util/handler/wf-withdraw-handler.d.ts.map +1 -0
- package/out/utils/app-de-ui-action-util/handler/wf-withdraw-handler.js +27 -0
- package/out/utils/index.d.ts +4 -1
- package/out/utils/index.d.ts.map +1 -1
- package/out/utils/index.js +4 -1
- package/out/utils/nav-params/calc-nav-params.d.ts +29 -0
- package/out/utils/nav-params/calc-nav-params.d.ts.map +1 -0
- package/out/utils/nav-params/calc-nav-params.js +34 -0
- package/out/utils/nav-params/nav-params.d.ts +20 -1
- package/out/utils/nav-params/nav-params.d.ts.map +1 -1
- package/out/utils/nav-params/nav-params.js +58 -4
- package/out/utils/open-redirect-view/open-redirect-view.d.ts +19 -8
- package/out/utils/open-redirect-view/open-redirect-view.d.ts.map +1 -1
- package/out/utils/open-redirect-view/open-redirect-view.js +107 -14
- package/out/utils/text-util/text-util.d.ts +21 -0
- package/out/utils/text-util/text-util.d.ts.map +1 -0
- package/out/utils/text-util/text-util.js +22 -0
- package/out/utils/wf-helper/wf-helper.d.ts +9 -0
- package/out/utils/wf-helper/wf-helper.d.ts.map +1 -0
- package/out/utils/wf-helper/wf-helper.js +14 -0
- package/out/view-logic/view-logic.d.ts +6 -7
- package/out/view-logic/view-logic.d.ts.map +1 -1
- package/out/view-logic/view-logic.js +102 -29
- package/package.json +15 -14
- package/src/command/app/app-func/app-func.ts +24 -24
- package/src/command/app/open-app-view/open-app-view.ts +12 -13
- package/src/config/global-config.ts +22 -0
- package/src/global/global-util/global-util.ts +19 -0
- package/src/global/index.ts +1 -0
- package/src/index.ts +1 -0
- package/src/install.ts +9 -0
- package/src/interface/i-global-config/i-global-config.ts +65 -0
- package/src/interface/i-modal/i-modal.ts +8 -0
- package/src/interface/i-modal-options/i-modal-options.ts +9 -0
- package/src/interface/i-plugin-factory/i-plugin-factory.ts +32 -5
- package/src/interface/i-plugin-item/i-plugin-item.ts +27 -0
- package/src/interface/i-ui-action-handler/i-ui-action-handler.ts +2 -3
- package/src/interface/i-ui-action-result/i-ui-action-result.ts +20 -0
- package/src/interface/i-ui-logic-params/i-ui-logic-params.ts +31 -0
- package/src/interface/index.ts +5 -0
- package/src/interface/logic-scheduler/i-scheduler-logic.ts +58 -0
- package/src/interface/logic-scheduler/i-trigger-match-params.ts +18 -0
- package/src/interface/logic-scheduler/index.ts +7 -0
- package/src/interface/util/i-modal-util/i-modal-util.ts +8 -0
- package/src/interface/util/i-open-view-util/i-open-view-util.ts +10 -11
- package/src/logic-scheduler/executor/logic-executor-factory.ts +48 -0
- package/src/logic-scheduler/executor/logic-executor.ts +43 -0
- package/src/logic-scheduler/executor/script-executor.ts +63 -0
- package/src/logic-scheduler/index.ts +41 -0
- package/src/logic-scheduler/logic-scheduler-center.ts +52 -0
- package/src/logic-scheduler/scheduler/control-logic-scheduler.ts +21 -0
- package/src/logic-scheduler/scheduler/logic-scheduler.ts +192 -0
- package/src/logic-scheduler/scheduler/view-logic-scheduler.ts +17 -0
- package/src/logic-scheduler/trigger/item-dyna-logic-trigger.ts +41 -0
- package/src/logic-scheduler/trigger/logic-trigger-factory.ts +48 -0
- package/src/logic-scheduler/trigger/logic-trigger.ts +77 -0
- package/src/plugin/plugin-static-resource/plugin-static-resource.ts +38 -0
- package/src/plugin/remote-plugin-item/remote-plugin-item.ts +14 -3
- package/src/provider/ui-action/index.ts +6 -0
- package/src/provider/ui-action/wf-withdraw-ui-action-provider.ts +22 -0
- package/src/types.ts +29 -0
- package/src/utils/app-de-ui-action-util/app-de-ui-action-util.ts +2 -3
- package/src/utils/app-de-ui-action-util/handler/backend-ui-action-handler.ts +13 -5
- package/src/utils/app-de-ui-action-util/handler/common-sys-ui-action-handler.ts +2 -3
- package/src/utils/app-de-ui-action-util/handler/front-ui-action-handler.ts +46 -23
- package/src/utils/app-de-ui-action-util/handler/index.ts +1 -0
- package/src/utils/app-de-ui-action-util/handler/ui-action-handler.ts +113 -75
- package/src/utils/app-de-ui-action-util/handler/wf-withdraw-handler.ts +36 -0
- package/src/utils/index.ts +7 -1
- package/src/utils/nav-params/calc-nav-params.ts +59 -0
- package/src/utils/nav-params/nav-params.ts +66 -5
- package/src/utils/open-redirect-view/open-redirect-view.ts +142 -14
- package/src/utils/text-util/text-util.ts +22 -0
- package/src/utils/wf-helper/wf-helper.ts +14 -0
- package/src/view-logic/view-logic.ts +111 -31
- 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
|
|
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 {
|
|
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:
|
|
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:
|
|
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(
|
|
41
|
-
|
|
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:
|
|
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 {
|
|
2
|
-
import {
|
|
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:
|
|
19
|
+
context: IContext,
|
|
20
20
|
data: IData[] | null,
|
|
21
21
|
params: IParams,
|
|
22
22
|
opts?: IData | undefined,
|
|
23
23
|
): Promise<IUIActionResult> {
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
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
|
}
|