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