@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,47 @@
|
|
|
1
|
+
import { UnsupportedModelError } from '@ibiz-template/model';
|
|
2
|
+
import { StringUtil } from '@ibiz-template/core';
|
|
3
|
+
import { OpenAppViewCommand } from '../../../command';
|
|
4
|
+
import { UIActionHandler } from './ui-action-handler';
|
|
5
|
+
/**
|
|
6
|
+
* 前台调用界面行为处理器
|
|
7
|
+
*
|
|
8
|
+
* @author lxm
|
|
9
|
+
* @date 2022-10-25 15:10:20
|
|
10
|
+
* @export
|
|
11
|
+
* @class FrontUIActionHandler
|
|
12
|
+
* @extends {UIActionHandler}
|
|
13
|
+
*/
|
|
14
|
+
export class FrontUIActionHandler extends UIActionHandler {
|
|
15
|
+
async execAction(action, context, data, params, opts) {
|
|
16
|
+
const actionResult = {};
|
|
17
|
+
const { frontProcessType } = action;
|
|
18
|
+
if (frontProcessType === 'OPENHTMLPAGE') {
|
|
19
|
+
// 打开html
|
|
20
|
+
const url = StringUtil.fill(action.htmlPageUrl, context, data === null || data === void 0 ? void 0 : data[0]);
|
|
21
|
+
window.open(url, '_blank');
|
|
22
|
+
}
|
|
23
|
+
if (['TOP', 'WIZARD'].includes(frontProcessType)) {
|
|
24
|
+
const frontPSAppView = action.getFrontPSAppView();
|
|
25
|
+
if (!frontPSAppView) {
|
|
26
|
+
throw new Error('未配置打开视图');
|
|
27
|
+
}
|
|
28
|
+
await frontPSAppView.fill(true);
|
|
29
|
+
// 处理参数
|
|
30
|
+
const { resultContext, resultParams } = await this.handleParams(action, context, data, params);
|
|
31
|
+
const res = await ibiz.commands.execute(OpenAppViewCommand.TAG, frontPSAppView, resultContext, resultParams, opts);
|
|
32
|
+
// 打开视图取消操作时,不执行刷新和关闭视图操作。
|
|
33
|
+
if ((res === null || res === void 0 ? void 0 : res.ok) === false) {
|
|
34
|
+
actionResult.closeView = false;
|
|
35
|
+
actionResult.refresh = false;
|
|
36
|
+
actionResult.cancel = true;
|
|
37
|
+
}
|
|
38
|
+
if ((res === null || res === void 0 ? void 0 : res.ok) && res.data) {
|
|
39
|
+
actionResult.data = res.data;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
throw new UnsupportedModelError(action, `未支持的前台处理模式[${frontProcessType}]`);
|
|
44
|
+
}
|
|
45
|
+
return actionResult;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/app-de-ui-action-util/handler/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { IPSAppDEUIAction } from '@ibiz-template/model';
|
|
2
|
+
import { IUIActionHandler, IUIActionResult } from '../../../interface';
|
|
3
|
+
/**
|
|
4
|
+
* 界面行为处理器基类
|
|
5
|
+
*
|
|
6
|
+
* @author lxm
|
|
7
|
+
* @date 2022-10-25 14:10:31
|
|
8
|
+
* @export
|
|
9
|
+
* @class UIActionHandler
|
|
10
|
+
*/
|
|
11
|
+
export declare abstract class UIActionHandler implements IUIActionHandler {
|
|
12
|
+
exec(action: IPSAppDEUIAction, context: IContext, data: IData[] | null, params: IParams, opts?: IData | undefined): Promise<IUIActionResult>;
|
|
13
|
+
/**
|
|
14
|
+
* 用户操作确认
|
|
15
|
+
*
|
|
16
|
+
* @author lxm
|
|
17
|
+
* @date 2022-10-25 14:10:55
|
|
18
|
+
* @param {IPSAppDEUIAction} action 界面行为模型
|
|
19
|
+
* @returns {*} {Promise<boolean>}
|
|
20
|
+
*/
|
|
21
|
+
isConfirm(action: IPSAppDEUIAction, context: IContext, params: IParams, data: IData[] | null): Promise<boolean>;
|
|
22
|
+
/**
|
|
23
|
+
* 执行具体界面行为的独有逻辑(子类重写)
|
|
24
|
+
*
|
|
25
|
+
* @author lxm
|
|
26
|
+
* @date 2022-10-25 15:10:03
|
|
27
|
+
* @abstract
|
|
28
|
+
* @param {IPSAppDEUIAction} action
|
|
29
|
+
* @param {IContext} context
|
|
30
|
+
* @param {(IData[] | null)} data
|
|
31
|
+
* @param {IParams} params
|
|
32
|
+
* @param {(IData | undefined)} [opts]
|
|
33
|
+
* @returns {*} {Promise<IUIActionResult>}
|
|
34
|
+
*/
|
|
35
|
+
abstract execAction(action: IPSAppDEUIAction, context: IContext, data: IData[] | null, params: IParams, opts?: IData | undefined): Promise<IUIActionResult>;
|
|
36
|
+
/**
|
|
37
|
+
* 执行后续界面行为
|
|
38
|
+
*
|
|
39
|
+
* @author lxm
|
|
40
|
+
* @date 2022-10-25 15:10:54
|
|
41
|
+
* @param {IPSAppDEUIAction} action
|
|
42
|
+
* @param {IContext} context
|
|
43
|
+
* @param {(IData[] | null)} data
|
|
44
|
+
* @param {IParams} params
|
|
45
|
+
* @param {(IData | undefined)} [opts]
|
|
46
|
+
* @returns {*} {Promise<void>}
|
|
47
|
+
*/
|
|
48
|
+
doNextAction(action: IPSAppDEUIAction, context: IContext, data: IData[] | null, params: IParams, opts?: IData | undefined): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* 参数处理(根据数据目标和数据参数,导航参数)
|
|
51
|
+
*
|
|
52
|
+
* @author lxm
|
|
53
|
+
* @date 2022-08-29 17:08:00
|
|
54
|
+
* @protected
|
|
55
|
+
* @static
|
|
56
|
+
* @param {IPSAppDEUIAction} action 界面行为
|
|
57
|
+
* @param {IContext} context 上下文
|
|
58
|
+
* @param {(IData[] | null)} data 数据集合
|
|
59
|
+
* @param {IParams} params 视图参数
|
|
60
|
+
* @returns {*} {Promise<{
|
|
61
|
+
* resultContext: IContext; 处理后的上下文
|
|
62
|
+
* resultData: IData[]; 处理后的数据集合
|
|
63
|
+
* resultParams: IParams; 处理后的视图参数
|
|
64
|
+
* }>}
|
|
65
|
+
*/
|
|
66
|
+
protected handleParams(action: IPSAppDEUIAction, context: IContext, data: IData[] | null, params: IParams): Promise<{
|
|
67
|
+
resultContext: IContext;
|
|
68
|
+
resultData: IData[];
|
|
69
|
+
resultParams: IParams;
|
|
70
|
+
}>;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=ui-action-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-action-handler.d.ts","sourceRoot":"","sources":["../../../../src/utils/app-de-ui-action-util/handler/ui-action-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAEjB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGvE;;;;;;;GAOG;AACH,8BAAsB,eAAgB,YAAW,gBAAgB;IACzD,IAAI,CACR,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EACpB,MAAM,EAAE,OAAO,EACf,IAAI,CAAC,EAAE,KAAK,GAAG,SAAS,GACvB,OAAO,CAAC,eAAe,CAAC;IAsC3B;;;;;;;OAOG;IACG,SAAS,CACb,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,QAAQ,EACjB,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,GACnB,OAAO,CAAC,OAAO,CAAC;IAYnB;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,UAAU,CACjB,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EACpB,MAAM,EAAE,OAAO,EACf,IAAI,CAAC,EAAE,KAAK,GAAG,SAAS,GACvB,OAAO,CAAC,eAAe,CAAC;IAE3B;;;;;;;;;;;OAWG;IACG,YAAY,CAChB,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EACpB,MAAM,EAAE,OAAO,EACf,IAAI,CAAC,EAAE,KAAK,GAAG,SAAS,GACvB,OAAO,CAAC,IAAI,CAAC;IAUhB;;;;;;;;;;;;;;;;OAgBG;cACa,YAAY,CAC1B,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EACpB,MAAM,EAAE,OAAO,GACd,OAAO,CAAC;QACT,aAAa,EAAE,QAAQ,CAAC;QACxB,UAAU,EAAE,KAAK,EAAE,CAAC;QACpB,YAAY,EAAE,OAAO,CAAC;KACvB,CAAC;CAyFH"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { getPSUIActionByModelObject, } from '@ibiz-template/model';
|
|
2
|
+
import { notNilEmpty } from 'qx-util';
|
|
3
|
+
import { StringUtil } from '@ibiz-template/core';
|
|
4
|
+
import { convertNavData, formatMultiData } from '../../nav-params/nav-params';
|
|
5
|
+
import { AppDEUIActionUtil } from '../app-de-ui-action-util';
|
|
6
|
+
/**
|
|
7
|
+
* 界面行为处理器基类
|
|
8
|
+
*
|
|
9
|
+
* @author lxm
|
|
10
|
+
* @date 2022-10-25 14:10:31
|
|
11
|
+
* @export
|
|
12
|
+
* @class UIActionHandler
|
|
13
|
+
*/
|
|
14
|
+
export class UIActionHandler {
|
|
15
|
+
async exec(action, context, data, params, opts) {
|
|
16
|
+
// **用户操作确认**
|
|
17
|
+
if (!(await this.isConfirm(action, context, params, data))) {
|
|
18
|
+
return {
|
|
19
|
+
refresh: false,
|
|
20
|
+
closeView: false,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const result = {
|
|
24
|
+
refresh: action.reloadData,
|
|
25
|
+
closeView: action.closeEditView,
|
|
26
|
+
};
|
|
27
|
+
// 执行不同类型的界面行为独有逻辑,并且合并result
|
|
28
|
+
const _result = await this.execAction(action, context, data, params, opts);
|
|
29
|
+
Object.assign(result, _result);
|
|
30
|
+
// 如果是取消操作则中断后续处理逻辑。
|
|
31
|
+
if (result.cancel === true) {
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
await this.doNextAction(action, context, _result.data || data, params, opts);
|
|
35
|
+
if (action.successMsg) {
|
|
36
|
+
ibiz.message.success(action.successMsg);
|
|
37
|
+
}
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* 用户操作确认
|
|
42
|
+
*
|
|
43
|
+
* @author lxm
|
|
44
|
+
* @date 2022-10-25 14:10:55
|
|
45
|
+
* @param {IPSAppDEUIAction} action 界面行为模型
|
|
46
|
+
* @returns {*} {Promise<boolean>}
|
|
47
|
+
*/
|
|
48
|
+
async isConfirm(action, context, params, data) {
|
|
49
|
+
if (action.enableConfirm && action.confirmMsg) {
|
|
50
|
+
const value = StringUtil.dynamicMatch(action.confirmMsg, {
|
|
51
|
+
context: context || {},
|
|
52
|
+
viewParams: params || {},
|
|
53
|
+
data,
|
|
54
|
+
});
|
|
55
|
+
return ibiz.modal.confirm({ title: value });
|
|
56
|
+
}
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* 执行后续界面行为
|
|
61
|
+
*
|
|
62
|
+
* @author lxm
|
|
63
|
+
* @date 2022-10-25 15:10:54
|
|
64
|
+
* @param {IPSAppDEUIAction} action
|
|
65
|
+
* @param {IContext} context
|
|
66
|
+
* @param {(IData[] | null)} data
|
|
67
|
+
* @param {IParams} params
|
|
68
|
+
* @param {(IData | undefined)} [opts]
|
|
69
|
+
* @returns {*} {Promise<void>}
|
|
70
|
+
*/
|
|
71
|
+
async doNextAction(action, context, data, params, opts) {
|
|
72
|
+
const nextAction = (await getPSUIActionByModelObject(action, 'getNextPSUIAction'));
|
|
73
|
+
if (nextAction) {
|
|
74
|
+
await AppDEUIActionUtil.exec(nextAction, context, data, params, opts);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* 参数处理(根据数据目标和数据参数,导航参数)
|
|
79
|
+
*
|
|
80
|
+
* @author lxm
|
|
81
|
+
* @date 2022-08-29 17:08:00
|
|
82
|
+
* @protected
|
|
83
|
+
* @static
|
|
84
|
+
* @param {IPSAppDEUIAction} action 界面行为
|
|
85
|
+
* @param {IContext} context 上下文
|
|
86
|
+
* @param {(IData[] | null)} data 数据集合
|
|
87
|
+
* @param {IParams} params 视图参数
|
|
88
|
+
* @returns {*} {Promise<{
|
|
89
|
+
* resultContext: IContext; 处理后的上下文
|
|
90
|
+
* resultData: IData[]; 处理后的数据集合
|
|
91
|
+
* resultParams: IParams; 处理后的视图参数
|
|
92
|
+
* }>}
|
|
93
|
+
*/
|
|
94
|
+
async handleParams(action, context, data, params) {
|
|
95
|
+
let resultData = [];
|
|
96
|
+
data = data || [];
|
|
97
|
+
// 准备实体名称
|
|
98
|
+
const appDataEntity = action.getPSAppDataEntity();
|
|
99
|
+
if (appDataEntity) {
|
|
100
|
+
await appDataEntity.fill(true);
|
|
101
|
+
}
|
|
102
|
+
const deName = appDataEntity === null || appDataEntity === void 0 ? void 0 : appDataEntity.codeName.toLowerCase();
|
|
103
|
+
// 根据数据目标处理数据集合
|
|
104
|
+
switch (action.actionTarget) {
|
|
105
|
+
// 数据目标为无数据时,清空数据
|
|
106
|
+
case 'NONE':
|
|
107
|
+
resultData = [];
|
|
108
|
+
break;
|
|
109
|
+
// 单项数据给单个数据
|
|
110
|
+
case 'SINGLEDATA':
|
|
111
|
+
resultData = [data[0]];
|
|
112
|
+
break;
|
|
113
|
+
// 多项数据传递数组
|
|
114
|
+
case 'MULTIDATA':
|
|
115
|
+
resultData = data;
|
|
116
|
+
break;
|
|
117
|
+
// 多项数据传递数组
|
|
118
|
+
case 'MULTIKEY':
|
|
119
|
+
resultData =
|
|
120
|
+
deName && data.length > 0
|
|
121
|
+
? data.map(item => ({ [deName]: item.srfkey || item[deName] }))
|
|
122
|
+
: [{}];
|
|
123
|
+
break;
|
|
124
|
+
// 单项数据主键,传递包含一个对象的数组,对象里只含有一个主键
|
|
125
|
+
case 'SINGLEKEY':
|
|
126
|
+
{
|
|
127
|
+
const originData = data[0] || {};
|
|
128
|
+
resultData = deName
|
|
129
|
+
? [{ [deName]: originData.srfkey || originData[deName] }]
|
|
130
|
+
: [{}];
|
|
131
|
+
}
|
|
132
|
+
break;
|
|
133
|
+
default:
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
// 处理上下文导航参数
|
|
137
|
+
const resultContext = context.clone();
|
|
138
|
+
const navContexts = [...(action.getPSNavigateContexts() || [])];
|
|
139
|
+
// 非无数据时,在导航参数开头加一个主键的导航参数,可以被配置的同名导航参数覆盖。
|
|
140
|
+
// 数据项名称替换主键的取值属性,参数项名称替换处理后主键在上下文的名称
|
|
141
|
+
if (deName && action.actionTarget !== 'NONE') {
|
|
142
|
+
const { valueItem, paramItem } = action;
|
|
143
|
+
const key = paramItem || deName;
|
|
144
|
+
const valueKey = valueItem || 'srfkey';
|
|
145
|
+
navContexts.unshift({
|
|
146
|
+
key,
|
|
147
|
+
value: valueKey,
|
|
148
|
+
rawValue: false,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
// 是否是多数据
|
|
152
|
+
const isMultiData = ['MULTIKEY', 'MULTIDATA'].includes(action.actionTarget) &&
|
|
153
|
+
data.length > 0;
|
|
154
|
+
if (notNilEmpty(navContexts)) {
|
|
155
|
+
const tempContext = convertNavData(navContexts, context, params, isMultiData ? formatMultiData(navContexts, data) : data[0] || {});
|
|
156
|
+
Object.assign(resultContext, tempContext);
|
|
157
|
+
}
|
|
158
|
+
// 处理导航视图参数
|
|
159
|
+
let resultParams = {};
|
|
160
|
+
const navParams = action.getPSNavigateParams();
|
|
161
|
+
if (notNilEmpty(navParams)) {
|
|
162
|
+
resultParams = convertNavData(navParams, context, params, isMultiData ? formatMultiData(navParams, data) : data[0] || {});
|
|
163
|
+
}
|
|
164
|
+
return { resultContext, resultData, resultParams };
|
|
165
|
+
}
|
|
166
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IPSAppDEUIAction } from '@ibiz-template/model';
|
|
2
|
+
import { IUIActionResult } from '../../../interface';
|
|
3
|
+
import { UIActionHandler } from './ui-action-handler';
|
|
4
|
+
/**
|
|
5
|
+
* 工作流流程撤回界面行为处理器
|
|
6
|
+
*
|
|
7
|
+
* @author lxm
|
|
8
|
+
* @date 2022-10-25 15:10:20
|
|
9
|
+
* @export
|
|
10
|
+
* @class WFWithdrawUIActionHandler
|
|
11
|
+
* @extends {UIActionHandler}
|
|
12
|
+
*/
|
|
13
|
+
export declare class WFWithdrawUIActionHandler extends UIActionHandler {
|
|
14
|
+
execAction(action: IPSAppDEUIAction, context: IContext, data: IData[] | null, params: IParams, opts?: IData | undefined): Promise<IUIActionResult>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=wf-withdraw-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wf-withdraw-handler.d.ts","sourceRoot":"","sources":["../../../../src/utils/app-de-ui-action-util/handler/wf-withdraw-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD;;;;;;;;GAQG;AACH,qBAAa,yBAA0B,SAAQ,eAAe;IACtD,UAAU,CACd,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EACpB,MAAM,EAAE,OAAO,EACf,IAAI,CAAC,EAAE,KAAK,GAAG,SAAS,GACvB,OAAO,CAAC,eAAe,CAAC;CAe5B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { UIActionHandler } from './ui-action-handler';
|
|
2
|
+
/**
|
|
3
|
+
* 工作流流程撤回界面行为处理器
|
|
4
|
+
*
|
|
5
|
+
* @author lxm
|
|
6
|
+
* @date 2022-10-25 15:10:20
|
|
7
|
+
* @export
|
|
8
|
+
* @class WFWithdrawUIActionHandler
|
|
9
|
+
* @extends {UIActionHandler}
|
|
10
|
+
*/
|
|
11
|
+
export class WFWithdrawUIActionHandler extends UIActionHandler {
|
|
12
|
+
async execAction(action, context, data, params, opts) {
|
|
13
|
+
const isWithdraw = await ibiz.modal.confirm({
|
|
14
|
+
title: '提示',
|
|
15
|
+
desc: '是否确认执行撤回操作?',
|
|
16
|
+
});
|
|
17
|
+
let isCloseView = false;
|
|
18
|
+
if (isWithdraw && (opts === null || opts === void 0 ? void 0 : opts.neuron)) {
|
|
19
|
+
await opts.neuron.call.wfWithdraw(context, params, (data === null || data === void 0 ? void 0 : data[0]) || []);
|
|
20
|
+
isCloseView = true;
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
refresh: false,
|
|
24
|
+
closeView: isCloseView,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/app-de-ui-action-util/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,yBAAyB,CAAC"}
|
package/out/utils/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
export { AppDEUIActionUtil } from './app-de-ui-action-util/app-de-ui-action-util';
|
|
2
1
|
export * from './nav-params/nav-params';
|
|
2
|
+
export { calcNavParams } from './nav-params/calc-nav-params';
|
|
3
|
+
export * from './app-de-ui-action-util';
|
|
4
|
+
export { toLocalOpenWFRedirectView, openRedirectView, } from './open-redirect-view/open-redirect-view';
|
|
5
|
+
export * from './wf-helper/wf-helper';
|
|
3
6
|
//# sourceMappingURL=index.d.ts.map
|
package/out/utils/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,cAAc,yBAAyB,CAAC;AACxC,OAAO,EACL,yBAAyB,EACzB,gBAAgB,GACjB,MAAM,yCAAyC,CAAC;AACjD,cAAc,uBAAuB,CAAC"}
|
package/out/utils/index.js
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
export { AppDEUIActionUtil } from './app-de-ui-action-util/app-de-ui-action-util';
|
|
2
1
|
export * from './nav-params/nav-params';
|
|
2
|
+
export { calcNavParams } from './nav-params/calc-nav-params';
|
|
3
|
+
export * from './app-de-ui-action-util';
|
|
4
|
+
export { toLocalOpenWFRedirectView, openRedirectView, } from './open-redirect-view/open-redirect-view';
|
|
5
|
+
export * from './wf-helper/wf-helper';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IPSNavigateParam } from '@ibiz-template/model';
|
|
2
|
+
/**
|
|
3
|
+
* 计算导航关系相关模型,得到额外附加的上下文和视图参数
|
|
4
|
+
* @author lxm
|
|
5
|
+
* @date 2023-03-14 07:25:48
|
|
6
|
+
* @export
|
|
7
|
+
*/
|
|
8
|
+
export declare function calcNavParams(model: {
|
|
9
|
+
/**
|
|
10
|
+
* 实体名称
|
|
11
|
+
*/
|
|
12
|
+
deName?: string;
|
|
13
|
+
navFilter?: string | undefined;
|
|
14
|
+
pickupDEFName?: string | undefined;
|
|
15
|
+
navContexts?: IPSNavigateParam[] | null;
|
|
16
|
+
navParams?: IPSNavigateParam[] | null;
|
|
17
|
+
}, originParams: {
|
|
18
|
+
/**
|
|
19
|
+
* 关系父主键值
|
|
20
|
+
*/
|
|
21
|
+
derValue?: string;
|
|
22
|
+
context: IParams;
|
|
23
|
+
params: IParams;
|
|
24
|
+
datum: IData;
|
|
25
|
+
}): {
|
|
26
|
+
resultContext: IParams;
|
|
27
|
+
resultParams: IParams;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=calc-nav-params.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calc-nav-params.d.ts","sourceRoot":"","sources":["../../../src/utils/nav-params/calc-nav-params.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxD;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE;IACL;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,WAAW,CAAC,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC;IACxC,SAAS,CAAC,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC;CACvC,EACD,YAAY,EAAE;IACZ;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC;CACd;;;EA8BF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { convertNavData } from './nav-params';
|
|
2
|
+
/**
|
|
3
|
+
* 计算导航关系相关模型,得到额外附加的上下文和视图参数
|
|
4
|
+
* @author lxm
|
|
5
|
+
* @date 2023-03-14 07:25:48
|
|
6
|
+
* @export
|
|
7
|
+
*/
|
|
8
|
+
export function calcNavParams(model, originParams) {
|
|
9
|
+
const { deName, navFilter, pickupDEFName, navContexts, navParams } = model;
|
|
10
|
+
const { context, params, datum, derValue } = originParams;
|
|
11
|
+
const resultContext = {};
|
|
12
|
+
const resultParams = {};
|
|
13
|
+
const deSrfkey = derValue || datum[deName];
|
|
14
|
+
if (deSrfkey) {
|
|
15
|
+
if (deName) {
|
|
16
|
+
resultContext[deName] = deSrfkey;
|
|
17
|
+
}
|
|
18
|
+
if (navFilter) {
|
|
19
|
+
resultParams[navFilter] = deSrfkey;
|
|
20
|
+
}
|
|
21
|
+
if (pickupDEFName) {
|
|
22
|
+
resultParams[`n_${pickupDEFName}_eq`] = deSrfkey;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
// 自定义导航视图参数和上下文
|
|
26
|
+
const tempContext = convertNavData(navContexts, context, params, datum);
|
|
27
|
+
const tempParams = convertNavData(navParams, context, params, datum);
|
|
28
|
+
Object.assign(resultContext, tempContext);
|
|
29
|
+
Object.assign(resultParams, tempParams);
|
|
30
|
+
return {
|
|
31
|
+
resultContext,
|
|
32
|
+
resultParams,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -12,7 +12,7 @@ import { IPSNavigateParam } from '@ibiz-template/model';
|
|
|
12
12
|
* @param {IPSNavigateParam[]} naviDatas 导航参数
|
|
13
13
|
* @param {...IData[]} origins 转换数据来源集合
|
|
14
14
|
*/
|
|
15
|
-
export declare function convertNavData(naviDatas: IPSNavigateParam[] | IData, ...origins: IData[]): IData;
|
|
15
|
+
export declare function convertNavData(naviDatas: IPSNavigateParam[] | IData | undefined | null, ...origins: IData[]): IData;
|
|
16
16
|
/**
|
|
17
17
|
* 通过模型中的导航数组 转换导航数据(如导航上下文,导航视图参数)
|
|
18
18
|
* - 把%xxx%,转换成origins元素里对应叫xxx的值
|
|
@@ -41,4 +41,23 @@ export declare function convertNavDataByArray(naviDatas: IPSNavigateParam[], ...
|
|
|
41
41
|
* @param {...IData[]} origins
|
|
42
42
|
*/
|
|
43
43
|
export declare function convertNavDataByObject(naviData: IData, ...origins: IData[]): IData;
|
|
44
|
+
/**
|
|
45
|
+
* 把对象格式的导航参数转换成数组格式的导航参数
|
|
46
|
+
* @author lxm
|
|
47
|
+
* @date 2023-07-10 03:33:14
|
|
48
|
+
* @export
|
|
49
|
+
* @param {IData} naviData
|
|
50
|
+
* @return {*} {IPSNavigateParam[]}
|
|
51
|
+
*/
|
|
52
|
+
export declare function convertObjectToNavParams(naviData: IData): IPSNavigateParam[];
|
|
53
|
+
/**
|
|
54
|
+
* 根据导航参数把多条数据转换成单条数据,用;分隔
|
|
55
|
+
* @author lxm
|
|
56
|
+
* @date 2023-07-10 04:31:30
|
|
57
|
+
* @export
|
|
58
|
+
* @param {(IPSNavigateParam[] | IData | undefined | null)} navParams
|
|
59
|
+
* @param {IData[]} dataArr
|
|
60
|
+
* @return {*} {IData}
|
|
61
|
+
*/
|
|
62
|
+
export declare function formatMultiData(navParams: IPSNavigateParam[] | IData | undefined | null, dataArr: IData[]): IData;
|
|
44
63
|
//# sourceMappingURL=nav-params.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nav-params.d.ts","sourceRoot":"","sources":["../../../src/utils/nav-params/nav-params.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxD;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,gBAAgB,EAAE,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"nav-params.d.ts","sourceRoot":"","sources":["../../../src/utils/nav-params/nav-params.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxD;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,gBAAgB,EAAE,GAAG,KAAK,GAAG,SAAS,GAAG,IAAI,EACxD,GAAG,OAAO,EAAE,KAAK,EAAE,SASpB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,gBAAgB,EAAE,EAC7B,GAAG,OAAO,EAAE,KAAK,EAAE,SAyBpB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,SAoB1E;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,KAAK,GAAG,gBAAgB,EAAE,CAmB5E;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,gBAAgB,EAAE,GAAG,KAAK,GAAG,SAAS,GAAG,IAAI,EACxD,OAAO,EAAE,KAAK,EAAE,GACf,KAAK,CAkBP"}
|
|
@@ -50,11 +50,11 @@ export function convertNavDataByArray(naviDatas, ...origins) {
|
|
|
50
50
|
Object.prototype.hasOwnProperty.call(item, naviData.value));
|
|
51
51
|
});
|
|
52
52
|
if (findOrigin) {
|
|
53
|
-
result[naviData.key] = findOrigin[naviData.value];
|
|
53
|
+
result[naviData.key.toLowerCase()] = findOrigin[naviData.value];
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
else {
|
|
57
|
-
result[naviData.key] = naviData.value;
|
|
57
|
+
result[naviData.key.toLowerCase()] = naviData.value;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
return result;
|
|
@@ -84,12 +84,66 @@ export function convertNavDataByObject(naviData, ...origins) {
|
|
|
84
84
|
return Object.prototype.hasOwnProperty.call(item, valueKey);
|
|
85
85
|
});
|
|
86
86
|
if (findOrigin) {
|
|
87
|
-
result[key] = findOrigin[valueKey];
|
|
87
|
+
result[key.toLowerCase()] = findOrigin[valueKey];
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
else {
|
|
91
|
-
result[key] = naviData[key];
|
|
91
|
+
result[key.toLowerCase()] = naviData[key];
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
return result;
|
|
95
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* 把对象格式的导航参数转换成数组格式的导航参数
|
|
98
|
+
* @author lxm
|
|
99
|
+
* @date 2023-07-10 03:33:14
|
|
100
|
+
* @export
|
|
101
|
+
* @param {IData} naviData
|
|
102
|
+
* @return {*} {IPSNavigateParam[]}
|
|
103
|
+
*/
|
|
104
|
+
export function convertObjectToNavParams(naviData) {
|
|
105
|
+
const result = [];
|
|
106
|
+
const reg = /^%(.+)%$/;
|
|
107
|
+
// eslint-disable-next-line guard-for-in
|
|
108
|
+
for (const key in naviData) {
|
|
109
|
+
let rawValue = true;
|
|
110
|
+
let value = naviData[key];
|
|
111
|
+
if (notNilEmpty(naviData[key]) && reg.test(naviData[key])) {
|
|
112
|
+
rawValue = false;
|
|
113
|
+
value = naviData[key].substring(1, naviData[key].length - 1);
|
|
114
|
+
}
|
|
115
|
+
result.push({
|
|
116
|
+
key: key.toLowerCase(),
|
|
117
|
+
rawValue,
|
|
118
|
+
value,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
return result;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* 根据导航参数把多条数据转换成单条数据,用;分隔
|
|
125
|
+
* @author lxm
|
|
126
|
+
* @date 2023-07-10 04:31:30
|
|
127
|
+
* @export
|
|
128
|
+
* @param {(IPSNavigateParam[] | IData | undefined | null)} navParams
|
|
129
|
+
* @param {IData[]} dataArr
|
|
130
|
+
* @return {*} {IData}
|
|
131
|
+
*/
|
|
132
|
+
export function formatMultiData(navParams, dataArr) {
|
|
133
|
+
const result = {};
|
|
134
|
+
if (!navParams) {
|
|
135
|
+
return result;
|
|
136
|
+
}
|
|
137
|
+
const naviArr = Array.isArray(navParams)
|
|
138
|
+
? navParams
|
|
139
|
+
: convertObjectToNavParams(navParams);
|
|
140
|
+
const data1 = dataArr[0];
|
|
141
|
+
naviArr.forEach(naviParam => {
|
|
142
|
+
const { rawValue, value } = naviParam;
|
|
143
|
+
// 非直接且取值的属性是数据的属性时,把多条数据的值合并到一起,用;分隔
|
|
144
|
+
if (!rawValue && Object.prototype.hasOwnProperty.call(data1, value)) {
|
|
145
|
+
result[value] = dataArr.map(item => item[value]).join(';');
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
return result;
|
|
149
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { IPSAppDataEntity, IPSAppDERedirectView, IPSAppRedirectView, IPSModelService } from '@ibiz-template/model';
|
|
2
|
+
import { IModalData } from '../../interface';
|
|
3
|
+
/**
|
|
4
|
+
* 打开重定向视图
|
|
5
|
+
*
|
|
6
|
+
* @author chitanda
|
|
7
|
+
* @date 2022-09-28 16:09:13
|
|
8
|
+
* @export
|
|
9
|
+
* @param {IPSAppRedirectView} appView 应用重定向视图
|
|
10
|
+
* @param {IContext}
|
|
11
|
+
* @param {IParams} [params={}]
|
|
12
|
+
* @param {IData} [data={}]
|
|
13
|
+
* @return {*} {Promise<IModalData>}
|
|
14
|
+
*/
|
|
15
|
+
export declare function openRedirectView(appView: IPSAppRedirectView, context: IContext, params?: IParams, data?: IData[]): Promise<IModalData>;
|
|
16
|
+
/**
|
|
17
|
+
* 本地打开工作流重定向视图
|
|
18
|
+
*
|
|
19
|
+
* @description 工作流 appredirectview 特殊处理,全局通过 appredirectview 跳转工作流重定向,均使用此方法
|
|
20
|
+
* @author chitanda
|
|
21
|
+
* @date 2023-01-12 11:01:40
|
|
22
|
+
* @export
|
|
23
|
+
* @param {IPSAppDERedirectView} appView
|
|
24
|
+
* @param {IContext} context
|
|
25
|
+
* @param {string} linkUrl
|
|
26
|
+
*/
|
|
27
|
+
export declare function toLocalOpenWFRedirectView(modelService: IPSModelService, context: IContext, linkUrl: string): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* 打开实体重定向视图
|
|
30
|
+
*
|
|
31
|
+
* @author chitanda
|
|
32
|
+
* @date 2022-09-28 16:09:15
|
|
33
|
+
* @export
|
|
34
|
+
* @param {IPSAppDERedirectView} appView
|
|
35
|
+
* @param {IContext}
|
|
36
|
+
* @param {IParams} [params={}]
|
|
37
|
+
* @param {IData[]} [data=[]]
|
|
38
|
+
* @return {*} {Promise<IModalData>}
|
|
39
|
+
*/
|
|
40
|
+
export declare function openDERedirectView(appView: IPSAppDERedirectView, context: IContext, params?: IParams, data?: IData[]): Promise<IModalData>;
|
|
41
|
+
/**
|
|
42
|
+
* 计算重定向标识
|
|
43
|
+
*
|
|
44
|
+
* @author chitanda
|
|
45
|
+
* @date 2022-10-25 16:10:48
|
|
46
|
+
* @export
|
|
47
|
+
* @param {IPSAppDataEntity} entity 重定向视图所在应用实体
|
|
48
|
+
* @param {IPSAppDERedirectView} rdView 重定向视图
|
|
49
|
+
* @param {string} srfWf
|
|
50
|
+
* @param {IData} data 当前数据
|
|
51
|
+
* @return {*} {Promise<string>}
|
|
52
|
+
*/
|
|
53
|
+
export declare function calcDERdTag(entity: IPSAppDataEntity, rdView: IPSAppDERedirectView, params: IParams, data: IData): Promise<string>;
|
|
54
|
+
//# sourceMappingURL=open-redirect-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open-redirect-view.d.ts","sourceRoot":"","sources":["../../../src/utils/open-redirect-view/open-redirect-view.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EAEhB,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,QAAQ,EACjB,MAAM,GAAE,OAAY,EACpB,IAAI,GAAE,KAAK,EAAO,GACjB,OAAO,CAAC,UAAU,CAAC,CAarB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,yBAAyB,CAC7C,YAAY,EAAE,eAAe,EAC7B,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,MAAM,iBAqEhB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,QAAQ,EACjB,MAAM,GAAE,OAAY,EACpB,IAAI,GAAE,KAAK,EAAO,GACjB,OAAO,CAAC,UAAU,CAAC,CAqGrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,oBAAoB,EAC5B,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,KAAK,GACV,OAAO,CAAC,MAAM,CAAC,CAsCjB"}
|