@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.
- package/dist/system/index.system.js +1 -0
- 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 +22 -23
- package/out/command/app/open-app-view/open-app-view.d.ts +12 -24
- 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 +12 -24
- 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/index.d.ts +4 -1
- package/out/index.d.ts.map +1 -1
- package/out/index.js +4 -1
- package/out/install.d.ts.map +1 -1
- package/out/install.js +11 -2
- package/out/interface/i-drawer-options/i-drawer-options.d.ts +29 -0
- package/out/interface/i-drawer-options/i-drawer-options.d.ts.map +1 -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-modal/i-modal.d.ts +7 -0
- package/out/interface/i-modal/i-modal.d.ts.map +1 -1
- package/out/interface/i-modal-data/i-modal-data.d.ts +1 -1
- package/out/interface/i-modal-data/i-modal-data.d.ts.map +1 -1
- package/out/interface/i-modal-options/i-modal-options.d.ts +43 -0
- package/out/interface/i-modal-options/i-modal-options.d.ts.map +1 -0
- package/out/interface/i-modal-options/i-modal-options.js +1 -0
- package/out/interface/i-plugin-factory/i-plugin-factory.d.ts +66 -0
- package/out/interface/i-plugin-factory/i-plugin-factory.d.ts.map +1 -0
- package/out/interface/i-plugin-factory/i-plugin-factory.js +1 -0
- 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-popover-options/i-popover-options.d.ts +84 -0
- package/out/interface/i-popover-options/i-popover-options.d.ts.map +1 -0
- package/out/interface/i-popover-options/i-popover-options.js +1 -0
- package/out/interface/i-ui-action-handler/i-ui-action-handler.d.ts +26 -0
- package/out/interface/i-ui-action-handler/i-ui-action-handler.d.ts.map +1 -0
- package/out/interface/i-ui-action-handler/i-ui-action-handler.js +1 -0
- 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 +11 -3
- package/out/interface/index.d.ts.map +1 -1
- package/out/interface/index.js +3 -3
- 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/provider/i-ui-action-provider.d.ts +20 -0
- package/out/interface/provider/i-ui-action-provider.d.ts.map +1 -0
- package/out/interface/provider/i-ui-action-provider.js +1 -0
- package/out/interface/provider/index.d.ts +2 -0
- package/out/interface/provider/index.d.ts.map +1 -0
- package/out/interface/provider/index.js +1 -0
- package/out/interface/register/i-register.d.ts +8 -1
- package/out/interface/register/i-register.d.ts.map +1 -1
- package/out/interface/register/i-ui-action-register.d.ts +15 -0
- package/out/interface/register/i-ui-action-register.d.ts.map +1 -0
- package/out/interface/register/i-ui-action-register.js +1 -0
- package/out/interface/register/index.d.ts +3 -0
- package/out/interface/register/index.d.ts.map +1 -0
- package/out/interface/register/index.js +2 -0
- package/out/interface/util/i-loading-util/i-loading-util.d.ts +14 -0
- package/out/interface/util/i-loading-util/i-loading-util.d.ts.map +1 -1
- 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/interface/util/i-overlay-container/i-overlay-container.d.ts +37 -0
- package/out/interface/util/i-overlay-container/i-overlay-container.d.ts.map +1 -0
- package/out/interface/util/i-overlay-container/i-overlay-container.js +1 -0
- package/out/interface/util/i-overlay-controller/i-overlay-controller.d.ts +86 -0
- package/out/interface/util/i-overlay-controller/i-overlay-controller.d.ts.map +1 -0
- package/out/interface/util/i-overlay-controller/i-overlay-controller.js +1 -0
- package/out/interface/util/i-overlay-popover-container/i-overlay-popover-container.d.ts +23 -0
- package/out/interface/util/i-overlay-popover-container/i-overlay-popover-container.d.ts.map +1 -0
- package/out/interface/util/i-overlay-popover-container/i-overlay-popover-container.js +1 -0
- package/out/interface/util/index.d.ts +3 -0
- package/out/interface/util/index.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/index.d.ts +3 -0
- package/out/plugin/index.d.ts.map +1 -0
- package/out/plugin/index.js +2 -0
- package/out/plugin/plugin-static-resource/plugin-static-resource.d.ts +55 -0
- package/out/plugin/plugin-static-resource/plugin-static-resource.d.ts.map +1 -0
- package/out/plugin/plugin-static-resource/plugin-static-resource.js +67 -0
- package/out/plugin/remote-plugin-item/remote-plugin-item.d.ts +111 -0
- package/out/plugin/remote-plugin-item/remote-plugin-item.d.ts.map +1 -0
- package/out/plugin/remote-plugin-item/remote-plugin-item.js +24 -0
- package/out/provider/index.d.ts +2 -0
- package/out/provider/index.d.ts.map +1 -0
- package/out/provider/index.js +1 -0
- package/out/provider/ui-action/backend-ui-action-provider.d.ts +15 -0
- package/out/provider/ui-action/backend-ui-action-provider.d.ts.map +1 -0
- package/out/provider/ui-action/backend-ui-action-provider.js +18 -0
- package/out/provider/ui-action/common-sys-ui-action-provider.d.ts +15 -0
- package/out/provider/ui-action/common-sys-ui-action-provider.d.ts.map +1 -0
- package/out/provider/ui-action/common-sys-ui-action-provider.js +18 -0
- package/out/provider/ui-action/front-ui-action-provider.d.ts +15 -0
- package/out/provider/ui-action/front-ui-action-provider.d.ts.map +1 -0
- package/out/provider/ui-action/front-ui-action-provider.js +18 -0
- package/out/provider/ui-action/index.d.ts +14 -0
- package/out/provider/ui-action/index.d.ts.map +1 -0
- package/out/provider/ui-action/index.js +48 -0
- 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/register/index.d.ts +4 -0
- package/out/register/index.d.ts.map +1 -0
- package/out/register/index.js +3 -0
- package/out/register/register-base.d.ts +18 -0
- package/out/register/register-base.d.ts.map +1 -0
- package/out/register/register-base.js +24 -0
- package/out/register/register-center.d.ts +20 -0
- package/out/register/register-center.d.ts.map +1 -0
- package/out/register/register-center.js +21 -0
- package/out/register/ui-action-register.d.ts +17 -0
- package/out/register/ui-action-register.d.ts.map +1 -0
- package/out/register/ui-action-register.js +41 -0
- package/out/types.d.ts +35 -3
- package/out/types.d.ts.map +1 -1
- package/out/utils/app-de-ui-action-util/app-de-ui-action-util.d.ts +0 -59
- 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 +3 -240
- package/out/utils/app-de-ui-action-util/handler/backend-ui-action-handler.d.ts +16 -0
- package/out/utils/app-de-ui-action-util/handler/backend-ui-action-handler.d.ts.map +1 -0
- package/out/utils/app-de-ui-action-util/handler/backend-ui-action-handler.js +31 -0
- package/out/utils/app-de-ui-action-util/handler/common-sys-ui-action-handler.d.ts +16 -0
- package/out/utils/app-de-ui-action-util/handler/common-sys-ui-action-handler.d.ts.map +1 -0
- package/out/utils/app-de-ui-action-util/handler/common-sys-ui-action-handler.js +103 -0
- package/out/utils/app-de-ui-action-util/handler/front-ui-action-handler.d.ts +16 -0
- package/out/utils/app-de-ui-action-util/handler/front-ui-action-handler.d.ts.map +1 -0
- package/out/utils/app-de-ui-action-util/handler/front-ui-action-handler.js +47 -0
- package/out/utils/app-de-ui-action-util/handler/index.d.ts +6 -0
- package/out/utils/app-de-ui-action-util/handler/index.d.ts.map +1 -0
- package/out/utils/app-de-ui-action-util/handler/index.js +5 -0
- package/out/utils/app-de-ui-action-util/handler/ui-action-handler.d.ts +72 -0
- package/out/utils/app-de-ui-action-util/handler/ui-action-handler.d.ts.map +1 -0
- package/out/utils/app-de-ui-action-util/handler/ui-action-handler.js +166 -0
- 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/app-de-ui-action-util/index.d.ts +3 -0
- package/out/utils/app-de-ui-action-util/index.d.ts.map +1 -0
- package/out/utils/app-de-ui-action-util/index.js +2 -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 +54 -0
- package/out/utils/open-redirect-view/open-redirect-view.d.ts.map +1 -0
- package/out/utils/open-redirect-view/open-redirect-view.js +232 -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.map +1 -1
- package/out/view-logic/view-logic.js +111 -32
- package/package.json +27 -16
- package/src/command/app/app-func/app-func.ts +27 -27
- package/src/command/app/open-app-view/open-app-view.ts +24 -41
- package/src/config/global-config.ts +22 -0
- package/src/index.ts +4 -1
- package/src/install.ts +11 -2
- package/src/interface/i-drawer-options/i-drawer-options.ts +28 -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-data/i-modal-data.ts +1 -1
- package/src/interface/i-modal-options/i-modal-options.ts +44 -0
- package/src/interface/i-plugin-factory/i-plugin-factory.ts +66 -0
- package/src/interface/i-plugin-item/i-plugin-item.ts +27 -0
- package/src/interface/i-popover-options/i-popover-options.ts +85 -0
- package/src/interface/i-ui-action-handler/i-ui-action-handler.ts +32 -0
- 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 +15 -3
- 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/provider/i-ui-action-provider.ts +20 -0
- package/src/interface/provider/index.ts +1 -0
- package/src/interface/register/i-register.ts +8 -1
- package/src/interface/register/i-ui-action-register.ts +15 -0
- package/src/interface/register/index.ts +2 -0
- package/src/interface/util/i-loading-util/i-loading-util.ts +14 -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 +11 -11
- package/src/interface/util/i-overlay-container/i-overlay-container.ts +38 -0
- package/src/interface/util/i-overlay-controller/i-overlay-controller.ts +116 -0
- package/src/interface/util/i-overlay-popover-container/i-overlay-popover-container.ts +23 -0
- package/src/interface/util/index.ts +3 -0
- 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/index.ts +5 -0
- package/src/plugin/plugin-static-resource/plugin-static-resource.ts +80 -0
- package/src/plugin/remote-plugin-item/remote-plugin-item.ts +118 -0
- package/src/provider/index.ts +1 -0
- package/src/provider/ui-action/backend-ui-action-provider.ts +22 -0
- package/src/provider/ui-action/common-sys-ui-action-provider.ts +22 -0
- package/src/provider/ui-action/front-ui-action-provider.ts +22 -0
- package/src/provider/ui-action/index.ts +56 -0
- package/src/provider/ui-action/wf-withdraw-ui-action-provider.ts +22 -0
- package/src/register/index.ts +3 -0
- package/src/register/register-base.ts +27 -0
- package/src/register/register-center.ts +20 -0
- package/src/register/ui-action-register.ts +48 -0
- package/src/types.ts +39 -3
- package/src/utils/app-de-ui-action-util/app-de-ui-action-util.ts +4 -329
- package/src/utils/app-de-ui-action-util/handler/backend-ui-action-handler.ts +51 -0
- package/src/utils/app-de-ui-action-util/handler/common-sys-ui-action-handler.ts +124 -0
- package/src/utils/app-de-ui-action-util/handler/front-ui-action-handler.ts +69 -0
- package/src/utils/app-de-ui-action-util/handler/index.ts +5 -0
- package/src/utils/app-de-ui-action-util/handler/ui-action-handler.ts +253 -0
- package/src/utils/app-de-ui-action-util/handler/wf-withdraw-handler.ts +36 -0
- package/src/utils/app-de-ui-action-util/index.ts +2 -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 +308 -0
- package/src/utils/wf-helper/wf-helper.ts +14 -0
- package/src/view-logic/view-logic.ts +123 -30
- package/LICENSE +0 -21
- package/out/interface/provider/i-editor-provider.d.ts +0 -38
- package/out/interface/provider/i-editor-provider.d.ts.map +0 -1
- package/out/interface/register/i-editor-register.d.ts +0 -23
- package/out/interface/register/i-editor-register.d.ts.map +0 -1
- package/out/register/register.d.ts +0 -20
- package/out/register/register.d.ts.map +0 -1
- package/out/register/register.js +0 -10
- package/src/interface/provider/i-editor-provider.ts +0 -44
- package/src/interface/register/i-editor-register.ts +0 -23
- package/src/register/register.ts +0 -20
- /package/out/interface/{provider/i-editor-provider.js → i-drawer-options/i-drawer-options.js} +0 -0
- /package/out/interface/{register/i-editor-register.js → i-global-config/i-global-config.js} +0 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { IPSAppDEViewLogic, IPSControlLogic } from '@ibiz-template/model';
|
|
2
|
+
import { LogicExecutorFactory } from './executor/logic-executor-factory';
|
|
3
|
+
import { ControlLogicScheduler } from './scheduler/control-logic-scheduler';
|
|
4
|
+
import { ViewLogicScheduler } from './scheduler/view-logic-scheduler';
|
|
5
|
+
import { LogicTriggerFactory } from './trigger/logic-trigger-factory';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 调度器中心
|
|
9
|
+
* @author lxm
|
|
10
|
+
* @date 2023-06-25 03:30:21
|
|
11
|
+
* @export
|
|
12
|
+
* @class LogicSchedulerFactory
|
|
13
|
+
*/
|
|
14
|
+
export class LogicSchedulerCenter {
|
|
15
|
+
/**
|
|
16
|
+
* 执行器工厂
|
|
17
|
+
* @author lxm
|
|
18
|
+
* @date 2023-06-25 06:41:42
|
|
19
|
+
* @type {LogicExecutorFactory}
|
|
20
|
+
*/
|
|
21
|
+
executorFactory: LogicExecutorFactory = new LogicExecutorFactory();
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* 触发器工厂
|
|
25
|
+
* @author lxm
|
|
26
|
+
* @date 2023-06-25 06:44:12
|
|
27
|
+
* @type {LogicTriggerFactory}
|
|
28
|
+
*/
|
|
29
|
+
triggerFactory: LogicTriggerFactory = new LogicTriggerFactory();
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 创建视图逻辑调度器实例
|
|
33
|
+
* @author lxm
|
|
34
|
+
* @date 2023-06-25 03:41:43
|
|
35
|
+
* @param {IAppDEViewLogic} logics
|
|
36
|
+
* @return {*} {ViewLogicScheduler}
|
|
37
|
+
*/
|
|
38
|
+
createViewScheduler(logics: IPSAppDEViewLogic[]): ViewLogicScheduler {
|
|
39
|
+
return new ViewLogicScheduler(logics);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* 创建部件逻辑调度器实例
|
|
44
|
+
* @author lxm
|
|
45
|
+
* @date 2023-06-25 03:48:30
|
|
46
|
+
* @param {IControlLogic} logics
|
|
47
|
+
* @return {*} {ControlLogicScheduler}
|
|
48
|
+
*/
|
|
49
|
+
createControlScheduler(logics: IPSControlLogic[]): ControlLogicScheduler {
|
|
50
|
+
return new ControlLogicScheduler(logics);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IPSControlLogic } from '@ibiz-template/model';
|
|
2
|
+
import type { ISchedulerLogic } from '../../interface';
|
|
3
|
+
import { LogicScheduler } from './logic-scheduler';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 部件逻辑调度器实例类
|
|
7
|
+
* @author lxm
|
|
8
|
+
* @date 2023-06-25 03:36:32
|
|
9
|
+
* @export
|
|
10
|
+
* @class ViewLogicScheduler
|
|
11
|
+
* @extends {LogicScheduler}
|
|
12
|
+
*/
|
|
13
|
+
export class ControlLogicScheduler extends LogicScheduler {
|
|
14
|
+
constructor(logics: IPSControlLogic[]) {
|
|
15
|
+
// 部件逻辑把APPVIEWENGINE排除掉。
|
|
16
|
+
const filterLogics = logics.filter(
|
|
17
|
+
item => item.triggerType !== 'APPVIEWENGINE',
|
|
18
|
+
);
|
|
19
|
+
super(filterLogics as ISchedulerLogic[]);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { mergeLeft } from 'ramda';
|
|
2
|
+
import type {
|
|
3
|
+
IUILogicParams,
|
|
4
|
+
ISchedulerLogic,
|
|
5
|
+
ITriggerMatchParams,
|
|
6
|
+
} from '../../interface';
|
|
7
|
+
import { LogicExecutor } from '../executor/logic-executor';
|
|
8
|
+
import { LogicTrigger } from '../trigger/logic-trigger';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* 逻辑调度器实例类
|
|
12
|
+
* @author lxm
|
|
13
|
+
* @date 2023-06-25 03:35:46
|
|
14
|
+
* @export
|
|
15
|
+
* @class LogicScheduler
|
|
16
|
+
*/
|
|
17
|
+
export class LogicScheduler {
|
|
18
|
+
logics: ISchedulerLogic[];
|
|
19
|
+
|
|
20
|
+
triggers = new Map<string, LogicTrigger>();
|
|
21
|
+
|
|
22
|
+
executors = new Map<string, LogicExecutor>();
|
|
23
|
+
|
|
24
|
+
constructor(logics: ISchedulerLogic[]) {
|
|
25
|
+
this.logics = logics;
|
|
26
|
+
logics.forEach(logic => {
|
|
27
|
+
try {
|
|
28
|
+
const executor = this.createExecutor(logic);
|
|
29
|
+
this.executors.set(logic.id, executor);
|
|
30
|
+
const trigger = this.createTrigger(logic);
|
|
31
|
+
this.triggers.set(logic.id, trigger);
|
|
32
|
+
trigger.bindExecutor(executor);
|
|
33
|
+
} catch (error) {
|
|
34
|
+
ibiz.log.error((error as IData).message);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* 默认参数回调
|
|
41
|
+
* @author lxm
|
|
42
|
+
* @date 2023-06-25 08:25:51
|
|
43
|
+
*/
|
|
44
|
+
defaultParamsCb?: () => IUILogicParams;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* 获取执行参数,把默认参数和调用参数合并
|
|
48
|
+
* @author lxm
|
|
49
|
+
* @date 2023-06-25 08:28:34
|
|
50
|
+
* @param {IData} args
|
|
51
|
+
* @return {*}
|
|
52
|
+
*/
|
|
53
|
+
getExecuteParams(executeParams: Partial<IUILogicParams>): IUILogicParams {
|
|
54
|
+
let defaultParams = {};
|
|
55
|
+
if (this.defaultParamsCb) {
|
|
56
|
+
defaultParams = this.defaultParamsCb();
|
|
57
|
+
}
|
|
58
|
+
return mergeLeft(executeParams, defaultParams) as IUILogicParams;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* 创建触发器实例
|
|
63
|
+
* @author lxm
|
|
64
|
+
* @date 2023-06-26 02:33:35
|
|
65
|
+
* @protected
|
|
66
|
+
* @param {ISchedulerLogic} logic
|
|
67
|
+
* @return {*} {LogicTrigger}
|
|
68
|
+
*/
|
|
69
|
+
protected createTrigger(logic: ISchedulerLogic): LogicTrigger {
|
|
70
|
+
return ibiz.scheduler.triggerFactory.createTrigger(logic);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* 创建执行器实例
|
|
75
|
+
* @author lxm
|
|
76
|
+
* @date 2023-06-26 02:33:52
|
|
77
|
+
* @protected
|
|
78
|
+
* @param {ISchedulerLogic} logic
|
|
79
|
+
* @return {*} {LogicExecutor}
|
|
80
|
+
*/
|
|
81
|
+
protected createExecutor(logic: ISchedulerLogic): LogicExecutor {
|
|
82
|
+
return ibiz.scheduler.executorFactory.createExecutor(logic);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* 获取匹配的触发器。
|
|
87
|
+
* @author lxm
|
|
88
|
+
* @date 2023-06-26 02:32:24
|
|
89
|
+
* @param {ITriggerMatchParams} matchParams
|
|
90
|
+
* @return {*} {LogicTrigger[]}
|
|
91
|
+
*/
|
|
92
|
+
protected getMatchTriggers(matchParams: ITriggerMatchParams): LogicTrigger[] {
|
|
93
|
+
const triggers: LogicTrigger[] = [];
|
|
94
|
+
this.triggers.forEach(trigger => {
|
|
95
|
+
if (trigger.match(matchParams)) {
|
|
96
|
+
triggers.push(trigger);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
return triggers;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* 找到匹配的触发器并执行对应的执行器,并返回结果。
|
|
104
|
+
* 返回undefined表示没有匹配的触发器。
|
|
105
|
+
* @author lxm
|
|
106
|
+
* @date 2023-06-26 02:30:24
|
|
107
|
+
* @param {ITriggerMatchParams} matchParams 匹配参数
|
|
108
|
+
* @param {Partial<IUILogicParams>} [executeParams={}] 执行参数
|
|
109
|
+
* @return {*} {(any[] | undefined)}
|
|
110
|
+
*/
|
|
111
|
+
triggerAndExecute(
|
|
112
|
+
matchParams: ITriggerMatchParams,
|
|
113
|
+
executeParams: Partial<IUILogicParams> = {},
|
|
114
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
115
|
+
): any[] | undefined {
|
|
116
|
+
const triggers = this.getMatchTriggers(matchParams);
|
|
117
|
+
if (triggers.length > 0) {
|
|
118
|
+
const params = this.getExecuteParams(executeParams);
|
|
119
|
+
const result = triggers.map(trigger => {
|
|
120
|
+
return trigger.execute(params);
|
|
121
|
+
});
|
|
122
|
+
return result;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* 预定义项的动态逻辑
|
|
128
|
+
* @author lxm
|
|
129
|
+
* @date 2023-06-26 02:29:08
|
|
130
|
+
* @protected
|
|
131
|
+
* @param {string} itemName 子项名称
|
|
132
|
+
* @param {('ITEMVISIBLE' | 'ITEMENABLE' | 'ITEMBLANK')} triggerType 预定义逻辑类型
|
|
133
|
+
* @param {Partial<IUILogicParams>} executeParams 执行参数
|
|
134
|
+
* @return {*} {(boolean | undefined)}
|
|
135
|
+
*/
|
|
136
|
+
protected triggerItemDynaLogic(
|
|
137
|
+
itemName: string,
|
|
138
|
+
triggerType: 'ITEMVISIBLE' | 'ITEMENABLE' | 'ITEMBLANK',
|
|
139
|
+
executeParams: Partial<IUILogicParams>,
|
|
140
|
+
): boolean | undefined {
|
|
141
|
+
const matchParams = { itemName, triggerType };
|
|
142
|
+
const result = this.triggerAndExecute(matchParams, executeParams);
|
|
143
|
+
if (result?.length) {
|
|
144
|
+
return result.pop();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* 预定义项显示逻辑
|
|
150
|
+
* @author lxm
|
|
151
|
+
* @date 2023-06-26 02:26:36
|
|
152
|
+
* @param {string} itemName 子项名称
|
|
153
|
+
* @param {Partial<IUILogicParams>} executeParams 执行参数
|
|
154
|
+
* @return {*} {(boolean | undefined)}
|
|
155
|
+
*/
|
|
156
|
+
triggerItemVisible(
|
|
157
|
+
itemName: string,
|
|
158
|
+
executeParams: Partial<IUILogicParams>,
|
|
159
|
+
): boolean | undefined {
|
|
160
|
+
return this.triggerItemDynaLogic(itemName, 'ITEMVISIBLE', executeParams);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* 预定义项启用逻辑
|
|
165
|
+
* @author lxm
|
|
166
|
+
* @date 2023-06-26 02:26:35
|
|
167
|
+
* @param {string} itemName 子项名称
|
|
168
|
+
* @param {Partial<IUILogicParams>} executeParams 执行参数
|
|
169
|
+
* @return {*} {(boolean | undefined)}
|
|
170
|
+
*/
|
|
171
|
+
triggerItemEnable(
|
|
172
|
+
itemName: string,
|
|
173
|
+
executeParams: Partial<IUILogicParams>,
|
|
174
|
+
): boolean | undefined {
|
|
175
|
+
return this.triggerItemDynaLogic(itemName, 'ITEMENABLE', executeParams);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* 预定义项空输入逻辑
|
|
180
|
+
* @author lxm
|
|
181
|
+
* @date 2023-06-26 02:26:33
|
|
182
|
+
* @param {string} itemName 子项名称
|
|
183
|
+
* @param {Partial<IUILogicParams>} executeParams 执行参数
|
|
184
|
+
* @return {*} {(boolean | undefined)}
|
|
185
|
+
*/
|
|
186
|
+
triggerItemBlank(
|
|
187
|
+
itemName: string,
|
|
188
|
+
executeParams: Partial<IUILogicParams>,
|
|
189
|
+
): boolean | undefined {
|
|
190
|
+
return this.triggerItemDynaLogic(itemName, 'ITEMBLANK', executeParams);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IPSAppDEViewLogic } from '@ibiz-template/model';
|
|
2
|
+
import type { ISchedulerLogic } from '../../interface';
|
|
3
|
+
import { LogicScheduler } from './logic-scheduler';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 视图逻辑调度器实例类
|
|
7
|
+
* @author lxm
|
|
8
|
+
* @date 2023-06-25 03:36:32
|
|
9
|
+
* @export
|
|
10
|
+
* @class ViewLogicScheduler
|
|
11
|
+
* @extends {LogicScheduler}
|
|
12
|
+
*/
|
|
13
|
+
export class ViewLogicScheduler extends LogicScheduler {
|
|
14
|
+
constructor(logics: IPSAppDEViewLogic[]) {
|
|
15
|
+
super(logics as IData as ISchedulerLogic[]);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { RuntimeError } from '@ibiz-template/core';
|
|
2
|
+
import type { ITriggerMatchParams, IUILogicParams } from '../../interface';
|
|
3
|
+
import { LogicExecutor } from '../executor/logic-executor';
|
|
4
|
+
import { ScriptExecutor } from '../executor/script-executor';
|
|
5
|
+
import { LogicTrigger } from './logic-trigger';
|
|
6
|
+
|
|
7
|
+
export class ItemDynaLogicTrigger extends LogicTrigger {
|
|
8
|
+
declare type: 'ITEMVISIBLE' | 'ITEMENABLE' | 'ITEMBLANK';
|
|
9
|
+
|
|
10
|
+
declare executor: ScriptExecutor;
|
|
11
|
+
|
|
12
|
+
bindExecutor(executor: LogicExecutor) {
|
|
13
|
+
super.bindExecutor(executor);
|
|
14
|
+
if (this.executor.type !== 'SCRIPT') {
|
|
15
|
+
throw new RuntimeError(
|
|
16
|
+
`预定义逻辑类型${this.type}的触发器类型只能是脚本`,
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
this.executor.isRowReturn = true;
|
|
20
|
+
this.executor.init(
|
|
21
|
+
['context', 'viewparams', 'data', 'env'],
|
|
22
|
+
executeParams => {
|
|
23
|
+
const { context, params, data } = executeParams;
|
|
24
|
+
return [context, params, data?.[0] || {}, ibiz.env];
|
|
25
|
+
},
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
match(matchParams: ITriggerMatchParams): boolean {
|
|
30
|
+
const superResult = super.match(matchParams);
|
|
31
|
+
return superResult && matchParams.itemName === this.logic.itemName;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
execute(executeParams: IUILogicParams): boolean {
|
|
35
|
+
const result = this.executor.execute(executeParams);
|
|
36
|
+
if (typeof result === 'boolean') {
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
39
|
+
throw new RuntimeError(`${this.logic.id}逻辑返回值不是布尔值`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { IPSModelObject, UnsupportedModelError } from '@ibiz-template/model';
|
|
2
|
+
import type { ISchedulerLogic } from '../../interface';
|
|
3
|
+
import { LogicTrigger } from './logic-trigger';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 逻辑触发器工厂
|
|
7
|
+
* @author lxm
|
|
8
|
+
* @date 2023-06-25 06:37:54
|
|
9
|
+
* @export
|
|
10
|
+
* @class LogicTriggerFactory
|
|
11
|
+
*/
|
|
12
|
+
export class LogicTriggerFactory {
|
|
13
|
+
/**
|
|
14
|
+
* 构造回调方法集合
|
|
15
|
+
* @author lxm
|
|
16
|
+
* @date 2023-06-25 06:53:31
|
|
17
|
+
*/
|
|
18
|
+
constructorMap = new Map<string, (logic: ISchedulerLogic) => LogicTrigger>();
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 注册
|
|
22
|
+
* @author lxm
|
|
23
|
+
* @date 2023-06-25 06:54:17
|
|
24
|
+
* @param {string} key 注册标识
|
|
25
|
+
* @param {(logic: ISchedulerLogic) => LogicTrigger} callback
|
|
26
|
+
*/
|
|
27
|
+
register(key: string, callback: (logic: ISchedulerLogic) => LogicTrigger) {
|
|
28
|
+
this.constructorMap.set(key, callback);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 创建触发器实例
|
|
33
|
+
* @author lxm
|
|
34
|
+
* @date 2023-06-25 06:56:32
|
|
35
|
+
* @param {ISchedulerLogic} logic
|
|
36
|
+
* @return {*}
|
|
37
|
+
*/
|
|
38
|
+
createTrigger(logic: ISchedulerLogic) {
|
|
39
|
+
const constructor = this.constructorMap.get(logic.triggerType);
|
|
40
|
+
if (!constructor) {
|
|
41
|
+
throw new UnsupportedModelError(
|
|
42
|
+
logic as IData as IPSModelObject,
|
|
43
|
+
`触发器类型 ${logic.triggerType} 暂未支持!`,
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
return constructor(logic);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 插件静态资源工具类
|
|
3
|
+
*
|
|
4
|
+
* @author chitanda
|
|
5
|
+
* @date 2022-11-03 10:11:08
|
|
6
|
+
* @export
|
|
7
|
+
* @class PluginStaticResource
|
|
8
|
+
*/
|
|
9
|
+
export class PluginStaticResource {
|
|
10
|
+
/**
|
|
11
|
+
* 计算出的静态资源跟路径
|
|
12
|
+
*
|
|
13
|
+
* @author chitanda
|
|
14
|
+
* @date 2022-11-03 10:11:08
|
|
15
|
+
* @protected
|
|
16
|
+
* @type {string}
|
|
17
|
+
*/
|
|
18
|
+
protected baseDir: string;
|
|
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
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 插件静态资源工具类.
|
|
32
|
+
*
|
|
33
|
+
* @author chitanda
|
|
34
|
+
* @date 2022-11-03 10:11:41
|
|
35
|
+
* @param {string} mateUrl import.mate.url
|
|
36
|
+
*/
|
|
37
|
+
constructor(mateUrl: string) {
|
|
38
|
+
this.baseDir = mateUrl.substring(0, mateUrl.lastIndexOf('/'));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* 合并输出静态资源目录
|
|
43
|
+
*
|
|
44
|
+
* @author chitanda
|
|
45
|
+
* @date 2022-11-03 10:11:39
|
|
46
|
+
* @param {string} path
|
|
47
|
+
* @return {*} {string}
|
|
48
|
+
*/
|
|
49
|
+
dir(path: string): string {
|
|
50
|
+
return this.baseDir + path;
|
|
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
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 远程插件配置
|
|
3
|
+
*
|
|
4
|
+
* @author chitanda
|
|
5
|
+
* @date 2022-10-31 16:10:34
|
|
6
|
+
* @export
|
|
7
|
+
* @interface RemotePluginConfig
|
|
8
|
+
*/
|
|
9
|
+
export interface RemotePluginConfig {
|
|
10
|
+
/**
|
|
11
|
+
* 所有配置文件基础路径
|
|
12
|
+
*
|
|
13
|
+
* @author chitanda
|
|
14
|
+
* @date 2022-11-02 14:11:06
|
|
15
|
+
* @type {string}
|
|
16
|
+
*/
|
|
17
|
+
baseUrl: string;
|
|
18
|
+
/**
|
|
19
|
+
* 包名称
|
|
20
|
+
*
|
|
21
|
+
* @author chitanda
|
|
22
|
+
* @date 2022-10-31 16:10:42
|
|
23
|
+
* @type {string}
|
|
24
|
+
*/
|
|
25
|
+
name: string;
|
|
26
|
+
/**
|
|
27
|
+
* 版本
|
|
28
|
+
*
|
|
29
|
+
* @author chitanda
|
|
30
|
+
* @date 2022-11-02 15:11:03
|
|
31
|
+
* @type {string}
|
|
32
|
+
*/
|
|
33
|
+
version: string;
|
|
34
|
+
/**
|
|
35
|
+
* system js 入口脚本
|
|
36
|
+
*
|
|
37
|
+
* @author chitanda
|
|
38
|
+
* @date 2022-11-02 15:11:28
|
|
39
|
+
* @type {string}
|
|
40
|
+
*/
|
|
41
|
+
system: string;
|
|
42
|
+
/**
|
|
43
|
+
* 模块文件 入口脚本
|
|
44
|
+
*
|
|
45
|
+
* @author chitanda
|
|
46
|
+
* @date 2022-11-02 16:11:50
|
|
47
|
+
* @type {string}
|
|
48
|
+
*/
|
|
49
|
+
module: string;
|
|
50
|
+
/**
|
|
51
|
+
* 样式地址
|
|
52
|
+
*
|
|
53
|
+
* @author chitanda
|
|
54
|
+
* @date 2022-10-31 16:10:46
|
|
55
|
+
* @type {(string | string[])}
|
|
56
|
+
*/
|
|
57
|
+
styles: string | string[];
|
|
58
|
+
/**
|
|
59
|
+
* 是否为应用级
|
|
60
|
+
*
|
|
61
|
+
* @author chitanda
|
|
62
|
+
* @date 2022-10-31 16:10:51
|
|
63
|
+
* @type {boolean}
|
|
64
|
+
*/
|
|
65
|
+
app?: boolean;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* 远程插件项
|
|
70
|
+
*
|
|
71
|
+
* @author chitanda
|
|
72
|
+
* @date 2022-10-31 12:10:41
|
|
73
|
+
* @export
|
|
74
|
+
* @class RemotePluginItem
|
|
75
|
+
*/
|
|
76
|
+
export class RemotePluginItem {
|
|
77
|
+
/**
|
|
78
|
+
* 唯一标识
|
|
79
|
+
*
|
|
80
|
+
* @author chitanda
|
|
81
|
+
* @date 2022-10-31 12:10:48
|
|
82
|
+
* @type {string}
|
|
83
|
+
*/
|
|
84
|
+
readonly tag: string;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* 插件模型
|
|
88
|
+
*
|
|
89
|
+
* @author chitanda
|
|
90
|
+
* @date 2023-01-30 15:01:37
|
|
91
|
+
* @type {IPSAppPFPluginRef}
|
|
92
|
+
*/
|
|
93
|
+
readonly repo: string;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* 配置参数
|
|
97
|
+
*
|
|
98
|
+
* @author chitanda
|
|
99
|
+
* @date 2022-11-02 15:11:38
|
|
100
|
+
* @type {RemotePluginConfig}
|
|
101
|
+
*/
|
|
102
|
+
readonly config: RemotePluginConfig;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Creates an instance of RemotePluginItem.
|
|
106
|
+
*
|
|
107
|
+
* @author chitanda
|
|
108
|
+
* @date 2023-02-02 15:02:13
|
|
109
|
+
* @param {string} tag 插件标识名称
|
|
110
|
+
* @param {string} repo 插件路径
|
|
111
|
+
* @param {RemotePluginConfig} config
|
|
112
|
+
*/
|
|
113
|
+
constructor(tag: string, repo: string, config: RemotePluginConfig) {
|
|
114
|
+
this.tag = tag;
|
|
115
|
+
this.repo = repo;
|
|
116
|
+
this.config = config;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ui-action';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IUIActionHandler, IUIActionProvider } from '../../interface';
|
|
2
|
+
import { BackendUIActionHandler } from '../../utils';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 后台调用界面行为适配器
|
|
6
|
+
*
|
|
7
|
+
* @author lxm
|
|
8
|
+
* @date 2022-10-25 15:10:51
|
|
9
|
+
* @export
|
|
10
|
+
* @class BackendUIActionProvider
|
|
11
|
+
* @implements {IUIActionProvider}
|
|
12
|
+
*/
|
|
13
|
+
export class BackendUIActionProvider implements IUIActionProvider {
|
|
14
|
+
private handler?: IUIActionHandler;
|
|
15
|
+
|
|
16
|
+
async getHandler(): Promise<IUIActionHandler> {
|
|
17
|
+
if (!this.handler) {
|
|
18
|
+
this.handler = new BackendUIActionHandler();
|
|
19
|
+
}
|
|
20
|
+
return this.handler;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IUIActionHandler, IUIActionProvider } from '../../interface';
|
|
2
|
+
import { CommonSysUIActionHandler } from '../../utils';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 常用系统预置界面行为适配器
|
|
6
|
+
*
|
|
7
|
+
* @author lxm
|
|
8
|
+
* @date 2022-10-25 15:10:51
|
|
9
|
+
* @export
|
|
10
|
+
* @class CommonSysUIActionProvider
|
|
11
|
+
* @implements {IUIActionProvider}
|
|
12
|
+
*/
|
|
13
|
+
export class CommonSysUIActionProvider implements IUIActionProvider {
|
|
14
|
+
private handler?: IUIActionHandler;
|
|
15
|
+
|
|
16
|
+
async getHandler(): Promise<IUIActionHandler> {
|
|
17
|
+
if (!this.handler) {
|
|
18
|
+
this.handler = new CommonSysUIActionHandler();
|
|
19
|
+
}
|
|
20
|
+
return this.handler;
|
|
21
|
+
}
|
|
22
|
+
}
|