@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,232 @@
|
|
|
1
|
+
import { RuntimeError } from '@ibiz-template/core';
|
|
2
|
+
import { DefectModelError, UnsupportedModelError, } from '@ibiz-template/model';
|
|
3
|
+
import { isNilOrEmpty, notNilEmpty } from 'qx-util';
|
|
4
|
+
import qs from 'qs';
|
|
5
|
+
import { OpenAppViewCommand } from '../../command';
|
|
6
|
+
import { convertNavData } from '../nav-params/nav-params';
|
|
7
|
+
/**
|
|
8
|
+
* 打开重定向视图
|
|
9
|
+
*
|
|
10
|
+
* @author chitanda
|
|
11
|
+
* @date 2022-09-28 16:09:13
|
|
12
|
+
* @export
|
|
13
|
+
* @param {IPSAppRedirectView} appView 应用重定向视图
|
|
14
|
+
* @param {IContext}
|
|
15
|
+
* @param {IParams} [params={}]
|
|
16
|
+
* @param {IData} [data={}]
|
|
17
|
+
* @return {*} {Promise<IModalData>}
|
|
18
|
+
*/
|
|
19
|
+
export async function openRedirectView(appView, context, params = {}, data = []) {
|
|
20
|
+
if (appView.instanceof('app.view.IPSAppDERedirectView')) {
|
|
21
|
+
return openDERedirectView(appView, context, params, data);
|
|
22
|
+
}
|
|
23
|
+
throw new UnsupportedModelError(appView, `未支持的重定向视图类型: ${appView.viewType}`);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 本地打开工作流重定向视图
|
|
27
|
+
*
|
|
28
|
+
* @description 工作流 appredirectview 特殊处理,全局通过 appredirectview 跳转工作流重定向,均使用此方法
|
|
29
|
+
* @author chitanda
|
|
30
|
+
* @date 2023-01-12 11:01:40
|
|
31
|
+
* @export
|
|
32
|
+
* @param {IPSAppDERedirectView} appView
|
|
33
|
+
* @param {IContext} context
|
|
34
|
+
* @param {string} linkUrl
|
|
35
|
+
*/
|
|
36
|
+
export async function toLocalOpenWFRedirectView(modelService, context, linkUrl) {
|
|
37
|
+
var _a;
|
|
38
|
+
const i = linkUrl.lastIndexOf('?');
|
|
39
|
+
const queryStr = decodeURIComponent(linkUrl.substring(i + 1, linkUrl.length));
|
|
40
|
+
const params = qs.parse(queryStr, { delimiter: ';' });
|
|
41
|
+
const deName = params.srfdename || '';
|
|
42
|
+
if (!deName) {
|
|
43
|
+
throw new RuntimeError('重定向参数缺少实体名称');
|
|
44
|
+
}
|
|
45
|
+
const upperDeName = deName.toUpperCase();
|
|
46
|
+
const { app } = modelService;
|
|
47
|
+
const entity = app.getAllPSAppDataEntities().find(item => {
|
|
48
|
+
return (item.name || item.refM.name) === upperDeName;
|
|
49
|
+
});
|
|
50
|
+
if (!entity) {
|
|
51
|
+
throw new RuntimeError(`未找到指定实体: ${deName}`);
|
|
52
|
+
}
|
|
53
|
+
const deCodeName = entity.codeName || entity.refM.codeName;
|
|
54
|
+
params[deCodeName.toLowerCase()] = params[deName.toLowerCase()];
|
|
55
|
+
const deRdView = (_a = app.getAllPSAppViews()) === null || _a === void 0 ? void 0 : _a.find(view => {
|
|
56
|
+
const { refM } = view;
|
|
57
|
+
if (refM.resource === deCodeName && refM.view === 'RedirectView') {
|
|
58
|
+
return view;
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
});
|
|
62
|
+
if (!deRdView) {
|
|
63
|
+
throw new Error(`未找到实体[${deName}]默认重定向视图[RedirectView]`);
|
|
64
|
+
}
|
|
65
|
+
// 删除跳转用参数
|
|
66
|
+
delete params.srfdename;
|
|
67
|
+
// 转换 processDefinitionKey 中的工作流流程以及版本到参数中
|
|
68
|
+
if (params.srfwf !== 'undo') {
|
|
69
|
+
const tags = params.processDefinitionKey.split('-');
|
|
70
|
+
const wfTag = tags[3];
|
|
71
|
+
const wf = wfTag.substring(0, wfTag.lastIndexOf('v'));
|
|
72
|
+
const wfVersion = wfTag.substring(wfTag.lastIndexOf('v'));
|
|
73
|
+
params.wf = wf;
|
|
74
|
+
params.wfVersion = wfVersion;
|
|
75
|
+
}
|
|
76
|
+
// 工作流附加参数转到上下文里
|
|
77
|
+
if (params.srfprocessinstanceid) {
|
|
78
|
+
context.srfprocessinstanceid = params.srfprocessinstanceid;
|
|
79
|
+
delete params.srfprocessinstanceid;
|
|
80
|
+
}
|
|
81
|
+
await ibiz.commands.execute(OpenAppViewCommand.TAG, deRdView, context, params);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* 打开实体重定向视图
|
|
85
|
+
*
|
|
86
|
+
* @author chitanda
|
|
87
|
+
* @date 2022-09-28 16:09:15
|
|
88
|
+
* @export
|
|
89
|
+
* @param {IPSAppDERedirectView} appView
|
|
90
|
+
* @param {IContext}
|
|
91
|
+
* @param {IParams} [params={}]
|
|
92
|
+
* @param {IData[]} [data=[]]
|
|
93
|
+
* @return {*} {Promise<IModalData>}
|
|
94
|
+
*/
|
|
95
|
+
export async function openDERedirectView(appView, context, params = {}, data = []) {
|
|
96
|
+
// 计算重定向视图上下文参数转换
|
|
97
|
+
const navContext = appView.getPSAppViewNavContexts() || [];
|
|
98
|
+
const navContextData = convertNavData(navContext, context, params);
|
|
99
|
+
context = Object.assign(context.clone(), navContextData);
|
|
100
|
+
// 计算重定向视图视图参数转换
|
|
101
|
+
const navParams = appView.getPSAppViewNavParams() || [];
|
|
102
|
+
const navParamsData = convertNavData(navParams, context, params);
|
|
103
|
+
Object.assign(params, navParamsData);
|
|
104
|
+
// 重定向视图对应应用实体
|
|
105
|
+
const entity = appView.getPSAppDataEntity();
|
|
106
|
+
await entity.fill(true);
|
|
107
|
+
const key = entity.codeName.toLowerCase();
|
|
108
|
+
let curData = data[0] || {};
|
|
109
|
+
// 将数据主键转换到上下文当中
|
|
110
|
+
context[key] = curData[key] || context[key] || params[key];
|
|
111
|
+
// 实体重定向视图获取数据行为
|
|
112
|
+
const action = appView.getGetDataPSAppDEAction();
|
|
113
|
+
const service = await ibiz.entityService.getService(entity.codeName);
|
|
114
|
+
ibiz.loading.showRedirect();
|
|
115
|
+
// 获取数据,未配置行为时,默认走 Get 行为
|
|
116
|
+
const res = await service.exec(action ? action.codeName : 'Get', context, params);
|
|
117
|
+
ibiz.loading.hideRedirect();
|
|
118
|
+
if (res.ok) {
|
|
119
|
+
curData = res.data;
|
|
120
|
+
let linkUrl = curData.linkurl;
|
|
121
|
+
if (linkUrl) {
|
|
122
|
+
// 工作流param09转的srfprocessinstanceid传递
|
|
123
|
+
if (context.srfprocessinstanceid) {
|
|
124
|
+
linkUrl += `;srfprocessinstanceid=${context.srfprocessinstanceid}`;
|
|
125
|
+
}
|
|
126
|
+
if (linkUrl.startsWith('http://') || linkUrl.startsWith('https://')) {
|
|
127
|
+
return new Promise(resolve => {
|
|
128
|
+
const newWindow = window.open(linkUrl, '_blank');
|
|
129
|
+
if (newWindow) {
|
|
130
|
+
newWindow.callback = () => {
|
|
131
|
+
resolve({ ok: true, data: [] });
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
if (linkUrl.startsWith('appredirectview?')) {
|
|
137
|
+
await toLocalOpenWFRedirectView(appView.getPSModelService(), context, linkUrl);
|
|
138
|
+
return { ok: true, data: [] };
|
|
139
|
+
}
|
|
140
|
+
return { ok: false, data: [] };
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
const rdTag = await calcDERdTag(entity, appView, params, curData);
|
|
144
|
+
// !!!工作流临时补充特殊处理标识, 避免补充了工作流流程匹配不上, 再从默认tag匹配!!!
|
|
145
|
+
const rdTagItems = rdTag.split(':');
|
|
146
|
+
const wfRdTag = rdTagItems.length === 2 ? rdTag : rdTagItems.slice(0, 2).join(':');
|
|
147
|
+
// 拼接当前重定向视图所在应用实体名称为前缀
|
|
148
|
+
const deRdTag = `${entity.name.toUpperCase()}:${rdTag}`;
|
|
149
|
+
// 所有重定向引用视图
|
|
150
|
+
const allRefViews = appView.getRedirectPSAppViewRefs();
|
|
151
|
+
let refView = allRefViews === null || allRefViews === void 0 ? void 0 : allRefViews.find(view => {
|
|
152
|
+
return view.name === deRdTag || view.name === rdTag;
|
|
153
|
+
});
|
|
154
|
+
if (!refView) {
|
|
155
|
+
// 特殊补充匹配,子流程应用特殊模式在没有配置具体流程的视图时,匹配不包含流程标识的
|
|
156
|
+
refView = allRefViews === null || allRefViews === void 0 ? void 0 : allRefViews.find(view => {
|
|
157
|
+
return view.name === wfRdTag;
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
if (refView) {
|
|
161
|
+
const view = refView.getRefPSAppView();
|
|
162
|
+
if (view) {
|
|
163
|
+
// 工作流param09转的srfprocessinstanceid传递
|
|
164
|
+
if (context.srfprocessinstanceid) {
|
|
165
|
+
params.srfprocessinstanceid = context.srfprocessinstanceid;
|
|
166
|
+
}
|
|
167
|
+
const result = await ibiz.commands.execute(OpenAppViewCommand.TAG, view, context, params, { data: [curData] });
|
|
168
|
+
if (result) {
|
|
169
|
+
return result;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
throw new DefectModelError(refView, `未配置实际引用视图`);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
throw new DefectModelError(appView, `未找到重定向标识[${rdTag}]或[${deRdTag}]对应视图`);
|
|
178
|
+
}
|
|
179
|
+
return { ok: true, data: [] };
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* 计算重定向标识
|
|
183
|
+
*
|
|
184
|
+
* @author chitanda
|
|
185
|
+
* @date 2022-10-25 16:10:48
|
|
186
|
+
* @export
|
|
187
|
+
* @param {IPSAppDataEntity} entity 重定向视图所在应用实体
|
|
188
|
+
* @param {IPSAppDERedirectView} rdView 重定向视图
|
|
189
|
+
* @param {string} srfWf
|
|
190
|
+
* @param {IData} data 当前数据
|
|
191
|
+
* @return {*} {Promise<string>}
|
|
192
|
+
*/
|
|
193
|
+
export async function calcDERdTag(entity, rdView, params, data) {
|
|
194
|
+
let rdTag = '';
|
|
195
|
+
// 重定向视图自定义类别属性
|
|
196
|
+
const typeField = rdView.getTypePSAppDEField();
|
|
197
|
+
// 自定义重定向
|
|
198
|
+
if (typeField) {
|
|
199
|
+
const value = data[typeField.codeName.toLowerCase()];
|
|
200
|
+
if (notNilEmpty(value)) {
|
|
201
|
+
return value;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
// 如果流程步骤存在,按照工作流优先
|
|
205
|
+
const srfWf = params.srfwf;
|
|
206
|
+
if (notNilEmpty(srfWf)) {
|
|
207
|
+
if (notNilEmpty(params.wf)) {
|
|
208
|
+
return `EDITVIEW:${srfWf.toUpperCase()}:${params.wf.toUpperCase()}`;
|
|
209
|
+
}
|
|
210
|
+
return `EDITVIEW:${srfWf.toUpperCase()}`;
|
|
211
|
+
}
|
|
212
|
+
let typeValue = '';
|
|
213
|
+
// 从索引属性获取重定向视图类型
|
|
214
|
+
const indexTypeField = entity.getIndexTypePSAppDEField();
|
|
215
|
+
if (indexTypeField) {
|
|
216
|
+
typeValue = data[indexTypeField.codeName.toLowerCase()];
|
|
217
|
+
}
|
|
218
|
+
if (isNilOrEmpty(typeValue)) {
|
|
219
|
+
// 从多表单属性判断重定向视图类型
|
|
220
|
+
const multiFormField = entity.getFormTypePSAppDEField();
|
|
221
|
+
if (multiFormField) {
|
|
222
|
+
typeValue = data[multiFormField.codeName.toLowerCase()];
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
if (notNilEmpty(typeValue)) {
|
|
226
|
+
rdTag = `EDITVIEW:${typeValue}`;
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
rdTag = `EDITVIEW`;
|
|
230
|
+
}
|
|
231
|
+
return rdTag;
|
|
232
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wf-helper.d.ts","sourceRoot":"","sources":["../../../src/utils/wf-helper/wf-helper.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,KAAK,SAMvC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 预置工作流相关数据处理并生成需要的上下文参数
|
|
3
|
+
*
|
|
4
|
+
* @export
|
|
5
|
+
* @param {IData} data
|
|
6
|
+
* @returns {*}
|
|
7
|
+
*/
|
|
8
|
+
export function getWFContext(data) {
|
|
9
|
+
const tempContext = {};
|
|
10
|
+
if (data.param09) {
|
|
11
|
+
tempContext.srfprocessinstanceid = data.param09;
|
|
12
|
+
}
|
|
13
|
+
return tempContext;
|
|
14
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view-logic.d.ts","sourceRoot":"","sources":["../../src/view-logic/view-logic.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"view-logic.d.ts","sourceRoot":"","sources":["../../src/view-logic/view-logic.ts"],"names":[],"mappings":"AACA,OAAO,EAML,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EAEhB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAc,eAAe,EAAE,MAAM,cAAc,CAAC;AAG3D;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CACpC,SAAS,EAAE,eAAe,EAC1B,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EACpB,MAAM,EAAE,OAAO,EACf,IAAI,GAAE,KAAU,GACf,OAAO,CAAC,eAAe,CAAC,CA8B1B;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,yBAAyB,CAC7C,UAAU,EAAE,qBAAqB,EACjC,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EACpB,MAAM,EAAE,OAAO,EACf,IAAI,GAAE,KAAU,GACf,OAAO,CAAC,eAAe,CAAC,CAqD1B;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,wBAAwB,CAC5C,UAAU,EAAE,oBAAoB,EAChC,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EACpB,MAAM,EAAE,OAAO,EACf,IAAI,GAAE,KAAU,GACf,OAAO,CAAC,eAAe,CAAC,CAgI1B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IBizContext } from '@ibiz-template/core';
|
|
2
1
|
import { notNilEmpty } from 'qx-util';
|
|
3
|
-
import { AppEntityModel, getPSUIActionByModelObject, } from '@ibiz-template/model';
|
|
2
|
+
import { AppEntityModel, DefectModelError, getPSUIActionByModelObject, } from '@ibiz-template/model';
|
|
3
|
+
import { RuntimeError } from '@ibiz-template/core';
|
|
4
4
|
import { OpenAppViewCommand } from '../command';
|
|
5
5
|
import { AppDEUIActionUtil, convertNavData } from '../utils';
|
|
6
6
|
/**
|
|
@@ -20,7 +20,7 @@ export async function executeViewLogic(viewLogic, context, data, params, opts =
|
|
|
20
20
|
// 执行打开数据界面逻辑
|
|
21
21
|
return executeOpenDataAppUILogic(viewLogic.getPSAppUILogic(), context, data, params, opts);
|
|
22
22
|
}
|
|
23
|
-
if (viewLogic.name === 'newdata') {
|
|
23
|
+
if (viewLogic.name === 'newdata' && viewLogic.getPSAppUILogic()) {
|
|
24
24
|
// 执行新建数据逻辑
|
|
25
25
|
return executeNewDataAppUILogic(viewLogic.getPSAppUILogic(), context, data, params, opts);
|
|
26
26
|
}
|
|
@@ -58,7 +58,6 @@ export async function executeOpenDataAppUILogic(appUILogic, context, data, param
|
|
|
58
58
|
const appDataEntity = new AppEntityModel(openView.getPSAppDataEntity());
|
|
59
59
|
await appDataEntity.init();
|
|
60
60
|
// 处理导航参数
|
|
61
|
-
let tempContext = {};
|
|
62
61
|
// 处理上下文导航参数
|
|
63
62
|
const navContexts = openViewRef.getPSNavigateContexts() || [];
|
|
64
63
|
// 默认添加主键的上下文导航参数
|
|
@@ -70,8 +69,8 @@ export async function executeOpenDataAppUILogic(appUILogic, context, data, param
|
|
|
70
69
|
rawValue: false,
|
|
71
70
|
});
|
|
72
71
|
}
|
|
73
|
-
|
|
74
|
-
tempContext =
|
|
72
|
+
const newContext = context.clone();
|
|
73
|
+
const tempContext = Object.assign(newContext, convertNavData(navContexts, context, params, data[0]));
|
|
75
74
|
// 处理导航视图参数
|
|
76
75
|
let tempParams = {};
|
|
77
76
|
const navParams = openViewRef.getPSNavigateParams();
|
|
@@ -79,7 +78,11 @@ export async function executeOpenDataAppUILogic(appUILogic, context, data, param
|
|
|
79
78
|
tempParams = convertNavData(navParams, params, context, data[0]);
|
|
80
79
|
}
|
|
81
80
|
// 打开视图
|
|
82
|
-
|
|
81
|
+
await ibiz.commands.execute(OpenAppViewCommand.TAG, openView, tempContext, tempParams, opts);
|
|
82
|
+
// 刷新上一个视图
|
|
83
|
+
const { neuron } = opts;
|
|
84
|
+
neuron.call.refresh();
|
|
85
|
+
return {};
|
|
83
86
|
}
|
|
84
87
|
/**
|
|
85
88
|
* 执行应用预置界面逻辑newdata
|
|
@@ -94,42 +97,118 @@ export async function executeOpenDataAppUILogic(appUILogic, context, data, param
|
|
|
94
97
|
* @param {IData} [opts] 额外参数,event是js原生事件
|
|
95
98
|
*/
|
|
96
99
|
export async function executeNewDataAppUILogic(appUILogic, context, data, params, opts = {}) {
|
|
100
|
+
var _a, _b;
|
|
101
|
+
const { enableWizardAdd, enableBatchAdd, batchAddOnly } = appUILogic;
|
|
102
|
+
let openViewRef = null;
|
|
103
|
+
let doBatchAdd = false;
|
|
97
104
|
// 准备需要的模型
|
|
98
|
-
|
|
99
|
-
if (
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
if (
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
105
|
+
// todo 拷贝
|
|
106
|
+
if (enableWizardAdd) {
|
|
107
|
+
// todo 向导添加
|
|
108
|
+
}
|
|
109
|
+
else if (enableBatchAdd) {
|
|
110
|
+
// 批添加
|
|
111
|
+
const batchViews = appUILogic.getBatchAddPSAppViews();
|
|
112
|
+
openViewRef = batchViews === null || batchViews === void 0 ? void 0 : batchViews.find(view => {
|
|
113
|
+
const openDeName = view.refMode.toLowerCase();
|
|
114
|
+
return openDeName !== context.srfparentdename;
|
|
115
|
+
});
|
|
116
|
+
doBatchAdd = true;
|
|
117
|
+
}
|
|
118
|
+
else if (batchAddOnly) {
|
|
119
|
+
// todo 只支持批添加
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
// 普通新建视图打开
|
|
123
|
+
openViewRef = appUILogic.getNewDataPSAppView();
|
|
124
|
+
}
|
|
125
|
+
const openView = openViewRef === null || openViewRef === void 0 ? void 0 : openViewRef.getRefPSAppView();
|
|
126
|
+
if (!openViewRef || !openView)
|
|
127
|
+
throw new RuntimeError('找不到新建视图');
|
|
128
|
+
await openView.fill(true);
|
|
129
|
+
const appDataEntity = new AppEntityModel(openView.getPSAppDataEntity());
|
|
106
130
|
await appDataEntity.init();
|
|
107
131
|
// 处理导航参数
|
|
108
132
|
let tempContext = {};
|
|
109
133
|
let tempParams = {};
|
|
110
134
|
const _data = (data === null || data === void 0 ? void 0 : data[0]) || {};
|
|
111
|
-
const navContexts =
|
|
135
|
+
const navContexts = openViewRef.getPSNavigateContexts();
|
|
112
136
|
if (notNilEmpty(navContexts)) {
|
|
113
137
|
tempContext = convertNavData(navContexts, context, params, _data);
|
|
114
138
|
}
|
|
115
|
-
|
|
116
|
-
if (notNilEmpty(navParams)) {
|
|
117
|
-
tempParams = convertNavData(navParams, params, context, _data);
|
|
118
|
-
}
|
|
119
|
-
tempContext = new IBizContext(tempContext, context);
|
|
139
|
+
tempContext = Object.assign(context.clone(), tempContext);
|
|
120
140
|
// 删除上下文内的主键
|
|
121
|
-
delete tempContext[appDataEntity.deName.toLowerCase()];
|
|
122
141
|
tempContext[appDataEntity.deName.toLowerCase()] = undefined;
|
|
123
|
-
|
|
124
|
-
if (
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
else if (appUILogic.enableBatchAdd) {
|
|
128
|
-
// todo 批添加
|
|
129
|
-
}
|
|
130
|
-
else if (appUILogic.batchAddOnly) {
|
|
131
|
-
// todo 只支持批添加
|
|
142
|
+
const navParams = openViewRef.getPSNavigateParams();
|
|
143
|
+
if (notNilEmpty(navParams)) {
|
|
144
|
+
tempParams = convertNavData(navParams, params, context, _data);
|
|
132
145
|
}
|
|
133
146
|
// 打开视图
|
|
134
|
-
|
|
147
|
+
const result = await ibiz.commands.execute(OpenAppViewCommand.TAG, openView, tempContext, tempParams, opts);
|
|
148
|
+
// 批添加新建选中数据后
|
|
149
|
+
if (doBatchAdd && ((_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
150
|
+
const newView = appUILogic.getNewDataPSAppView().getRefPSAppView();
|
|
151
|
+
await newView.fill(true);
|
|
152
|
+
const selfDe = newView.getPSAppDataEntity();
|
|
153
|
+
const minorDERs = selfDe.getMinorPSAppDERSs();
|
|
154
|
+
const pickParentDeName = openViewRef.refMode.toLowerCase();
|
|
155
|
+
if (!minorDERs) {
|
|
156
|
+
throw new DefectModelError(selfDe, '实体没有从关系集合!');
|
|
157
|
+
}
|
|
158
|
+
let pickParentFieldName;
|
|
159
|
+
minorDERs === null || minorDERs === void 0 ? void 0 : minorDERs.forEach(item => {
|
|
160
|
+
const majorDeName = item
|
|
161
|
+
.getMajorPSAppDataEntity()
|
|
162
|
+
.codeName.toLowerCase();
|
|
163
|
+
if (pickParentDeName === majorDeName) {
|
|
164
|
+
pickParentFieldName = item
|
|
165
|
+
.getParentPSAppDEField()
|
|
166
|
+
.codeName.toLowerCase();
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
// 获取key为keymapping的特殊视图参数
|
|
170
|
+
const openViewKeyParam = (_b = openView
|
|
171
|
+
.getPSAppViewNavParams()) === null || _b === void 0 ? void 0 : _b.find(navParam => {
|
|
172
|
+
return navParam.key === 'keymapping';
|
|
173
|
+
});
|
|
174
|
+
let addData = [];
|
|
175
|
+
if (openViewKeyParam) {
|
|
176
|
+
const keyValuePairs = openViewKeyParam.value.split(';');
|
|
177
|
+
const keyMapping = {};
|
|
178
|
+
// 遍历键值对数组并添加到 keyMapping 映射对象中
|
|
179
|
+
for (const pair of keyValuePairs) {
|
|
180
|
+
const [sourceKey, targetKey] = pair.split(':');
|
|
181
|
+
if (sourceKey && targetKey) {
|
|
182
|
+
keyMapping[sourceKey] = targetKey;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
addData = result.data.map(item => {
|
|
186
|
+
const tempData = {
|
|
187
|
+
[pickParentFieldName]: item.srfkey,
|
|
188
|
+
};
|
|
189
|
+
// 遍历映射对象,将属性从 item 复制到 tempData
|
|
190
|
+
for (const key in keyMapping) {
|
|
191
|
+
if (Object.prototype.hasOwnProperty.call(keyMapping, key)) {
|
|
192
|
+
const targetKey = keyMapping[key];
|
|
193
|
+
if (Object.prototype.hasOwnProperty.call(item, key)) {
|
|
194
|
+
tempData[targetKey] = item[key];
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return tempData;
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
addData = result.data.map(item => ({
|
|
203
|
+
[pickParentFieldName]: item.srfkey,
|
|
204
|
+
}));
|
|
205
|
+
}
|
|
206
|
+
// 获取实体服务并调用创建接口
|
|
207
|
+
const service = await ibiz.entityService.getService(selfDe.codeName, context);
|
|
208
|
+
await service.exec('Create', context, addData);
|
|
209
|
+
}
|
|
210
|
+
// 刷新上一个视图
|
|
211
|
+
const { neuron } = opts;
|
|
212
|
+
neuron.call.refresh();
|
|
213
|
+
return {};
|
|
135
214
|
}
|
package/package.json
CHANGED
|
@@ -1,38 +1,49 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/runtime",
|
|
3
|
-
"version": "0.0.1-
|
|
3
|
+
"version": "0.0.1-beta.130",
|
|
4
4
|
"description": "控制器包",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"main": "out/index.js",
|
|
6
7
|
"types": "out/index.d.ts",
|
|
8
|
+
"system": "./dist/system/index.system.js",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://gitee.com/iBizModeling/ibiz-template.git"
|
|
12
|
+
},
|
|
7
13
|
"files": [
|
|
14
|
+
"dist",
|
|
8
15
|
"out",
|
|
9
16
|
"src"
|
|
10
17
|
],
|
|
11
18
|
"scripts": {
|
|
12
19
|
"dev": "tsc --watch",
|
|
13
|
-
"build": "npm run lint && npm run clean && tsc --build",
|
|
20
|
+
"build": "npm run lint && npm run clean && npm run build:rollup && tsc --build",
|
|
21
|
+
"build:rollup": "rollup -c",
|
|
14
22
|
"lint": "eslint 'src/**/*.ts'",
|
|
15
23
|
"lint:fix": "eslint --fix 'src/**/*.ts'",
|
|
16
|
-
"clean": "rimraf out",
|
|
17
|
-
"
|
|
18
|
-
"publish:
|
|
24
|
+
"clean": "rimraf out dist",
|
|
25
|
+
"prepublish": "npm run build",
|
|
26
|
+
"publish:next": "npm publish --access public --tag next",
|
|
27
|
+
"publish:npm": "npm publish --access public"
|
|
19
28
|
},
|
|
20
29
|
"author": "chitanda",
|
|
21
30
|
"license": "MIT",
|
|
22
31
|
"dependencies": {
|
|
23
|
-
"@ibiz-template/command": "^0.0.1-
|
|
32
|
+
"@ibiz-template/command": "^0.0.1-beta.50",
|
|
33
|
+
"qs": "^6.11.0"
|
|
24
34
|
},
|
|
25
35
|
"devDependencies": {
|
|
26
|
-
"@ibiz-template/core": "^0.0.1-
|
|
27
|
-
"@ibiz-template/model": "^0.0.1-
|
|
28
|
-
"@ibiz-template/service": "^0.0.1-
|
|
29
|
-
"
|
|
36
|
+
"@ibiz-template/core": "^0.0.1-beta.130",
|
|
37
|
+
"@ibiz-template/model": "^0.0.1-beta.130",
|
|
38
|
+
"@ibiz-template/service": "^0.0.1-beta.130",
|
|
39
|
+
"@types/qs": "^6.9.7",
|
|
40
|
+
"@types/systemjs": "^6.13.0",
|
|
41
|
+
"qx-util": "^0.4.8"
|
|
30
42
|
},
|
|
31
43
|
"peerDependencies": {
|
|
32
|
-
"@ibiz-template/core": "^0.0.1-
|
|
33
|
-
"@ibiz-template/model": "^0.0.1-
|
|
34
|
-
"@ibiz-template/service": "^0.0.1-
|
|
35
|
-
"qx-util": "^0.4.
|
|
36
|
-
}
|
|
37
|
-
"gitHead": "36f86effeb183c0fad87a82feec576dab4a61eff"
|
|
44
|
+
"@ibiz-template/core": "^0.0.1-beta.30",
|
|
45
|
+
"@ibiz-template/model": "^0.0.1-beta.30",
|
|
46
|
+
"@ibiz-template/service": "^0.0.1-beta.30",
|
|
47
|
+
"qx-util": "^0.4.8"
|
|
48
|
+
}
|
|
38
49
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { IBizContext } from '@ibiz-template/core';
|
|
2
1
|
import { IPSAppFunc } from '@ibiz-template/model';
|
|
2
|
+
import { notNilEmpty } from 'qx-util';
|
|
3
|
+
import { convertNavData } from '../../../utils';
|
|
3
4
|
import { OpenAppViewCommand } from '../open-app-view/open-app-view';
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -31,40 +32,39 @@ export class AppFuncCommand {
|
|
|
31
32
|
* @author chitanda
|
|
32
33
|
* @date 2022-07-25 17:07:35
|
|
33
34
|
* @param {IPSAppFunc} appFunc 应用功能模型
|
|
34
|
-
* @param {
|
|
35
|
+
* @param {IContext} [context] 执行上下文
|
|
35
36
|
* @param {IParams} [params={}] 参数
|
|
36
37
|
* @param {IData} [opts={}] 额外参数,与具体执行对象规划好的额外参数。如需要给飘窗使用的 event 事件对象.
|
|
37
38
|
* @return {*} {Promise<void>}
|
|
38
39
|
*/
|
|
39
40
|
async exec(
|
|
40
41
|
appFunc: IPSAppFunc,
|
|
41
|
-
context
|
|
42
|
+
context: IContext,
|
|
42
43
|
params: IParams = {},
|
|
43
44
|
opts: IData = {},
|
|
44
45
|
): Promise<void> {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
46
|
+
// 处理导航参数
|
|
47
|
+
let tempContext: IContext = context.clone();
|
|
48
|
+
let tempParams: IData = {};
|
|
49
|
+
const navContexts = appFunc.getPSNavigateContexts();
|
|
50
|
+
if (notNilEmpty(navContexts)) {
|
|
51
|
+
tempContext = convertNavData(navContexts!, context, params) as IContext;
|
|
52
52
|
}
|
|
53
53
|
const navParams = appFunc.getPSNavigateParams();
|
|
54
|
-
if (navParams) {
|
|
55
|
-
|
|
54
|
+
if (notNilEmpty(navParams)) {
|
|
55
|
+
tempParams = convertNavData(navParams!, params, context);
|
|
56
56
|
}
|
|
57
57
|
switch (appFunc.appFuncType) {
|
|
58
58
|
case 'APPVIEW':
|
|
59
|
-
return this.openAppView(appFunc,
|
|
59
|
+
return this.openAppView(appFunc, tempContext, tempParams, opts);
|
|
60
60
|
case 'OPENHTMLPAGE':
|
|
61
61
|
return this.openHtmlPage(appFunc);
|
|
62
62
|
case 'PDTAPPFUNC':
|
|
63
|
-
return this.openPdAppFunc(appFunc,
|
|
63
|
+
return this.openPdAppFunc(appFunc, tempContext, tempParams);
|
|
64
64
|
case 'JAVASCRIPT':
|
|
65
|
-
return this.executeJavaScript(appFunc,
|
|
65
|
+
return this.executeJavaScript(appFunc, tempContext, tempParams);
|
|
66
66
|
case 'CUSTOM':
|
|
67
|
-
return this.custom(appFunc,
|
|
67
|
+
return this.custom(appFunc, tempContext, tempParams);
|
|
68
68
|
default:
|
|
69
69
|
throw new Error(`未知的应用功能类型: ${appFunc.appFuncType}`);
|
|
70
70
|
}
|
|
@@ -77,13 +77,13 @@ export class AppFuncCommand {
|
|
|
77
77
|
* @date 2022-07-25 18:07:49
|
|
78
78
|
* @protected
|
|
79
79
|
* @param {IPSAppFunc} appFunc
|
|
80
|
-
* @param {
|
|
80
|
+
* @param {IContext} [context]
|
|
81
81
|
* @param {IParams} [params]
|
|
82
82
|
* @return {*} {Promise<void>}
|
|
83
83
|
*/
|
|
84
84
|
protected openAppView(
|
|
85
85
|
appFunc: IPSAppFunc,
|
|
86
|
-
context?:
|
|
86
|
+
context?: IContext,
|
|
87
87
|
params?: IParams,
|
|
88
88
|
opts?: IData,
|
|
89
89
|
): Promise<void> {
|
|
@@ -120,15 +120,15 @@ export class AppFuncCommand {
|
|
|
120
120
|
* @date 2022-07-25 18:07:22
|
|
121
121
|
* @protected
|
|
122
122
|
* @param {IPSAppFunc} appFunc
|
|
123
|
-
* @param {
|
|
123
|
+
* @param {IContext} [context]
|
|
124
124
|
* @param {IParams} [params]
|
|
125
125
|
*/
|
|
126
126
|
protected openPdAppFunc(
|
|
127
127
|
appFunc: IPSAppFunc,
|
|
128
|
-
context?:
|
|
128
|
+
context?: IContext,
|
|
129
129
|
params?: IParams,
|
|
130
130
|
): void {
|
|
131
|
-
|
|
131
|
+
ibiz.log.warn('openPdAppFunc', appFunc, context, params);
|
|
132
132
|
throw new Error('未实现');
|
|
133
133
|
}
|
|
134
134
|
|
|
@@ -139,15 +139,15 @@ export class AppFuncCommand {
|
|
|
139
139
|
* @date 2022-07-25 18:07:09
|
|
140
140
|
* @protected
|
|
141
141
|
* @param {IPSAppFunc} appFunc
|
|
142
|
-
* @param {
|
|
142
|
+
* @param {IContext} [context]
|
|
143
143
|
* @param {IParams} [params]
|
|
144
144
|
*/
|
|
145
145
|
protected executeJavaScript(
|
|
146
146
|
appFunc: IPSAppFunc,
|
|
147
|
-
context?:
|
|
147
|
+
context?: IContext,
|
|
148
148
|
params?: IParams,
|
|
149
149
|
): void {
|
|
150
|
-
|
|
150
|
+
ibiz.log.warn('executeJavaScript', appFunc, context, params);
|
|
151
151
|
throw new Error('未实现');
|
|
152
152
|
}
|
|
153
153
|
|
|
@@ -158,15 +158,15 @@ export class AppFuncCommand {
|
|
|
158
158
|
* @date 2022-07-25 18:07:51
|
|
159
159
|
* @protected
|
|
160
160
|
* @param {IPSAppFunc} appFunc
|
|
161
|
-
* @param {
|
|
161
|
+
* @param {IContext} [context]
|
|
162
162
|
* @param {IParams} [params]
|
|
163
163
|
*/
|
|
164
164
|
protected custom(
|
|
165
165
|
appFunc: IPSAppFunc,
|
|
166
|
-
context?:
|
|
166
|
+
context?: IContext,
|
|
167
167
|
params?: IParams,
|
|
168
168
|
): void {
|
|
169
|
-
|
|
169
|
+
ibiz.log.warn('custom', appFunc, context, params);
|
|
170
170
|
throw new Error('未实现');
|
|
171
171
|
}
|
|
172
172
|
}
|