@ibiz-template/runtime 0.0.1-alpha.8 → 0.0.1-beta.1
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.js +3 -3
- package/out/command/app/open-app-view/open-app-view.d.ts +2 -13
- package/out/command/app/open-app-view/open-app-view.d.ts.map +1 -1
- package/out/command/app/open-app-view/open-app-view.js +6 -18
- package/out/index.d.ts +3 -1
- package/out/index.d.ts.map +1 -1
- package/out/index.js +3 -1
- package/out/install.d.ts.map +1 -1
- package/out/install.js +5 -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/{provider/i-editor-provider.js → i-drawer-options/i-drawer-options.js} +0 -0
- 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 +35 -0
- package/out/interface/i-modal-options/i-modal-options.d.ts.map +1 -0
- package/out/interface/{register/i-editor-register.js → i-modal-options/i-modal-options.js} +0 -0
- package/out/interface/i-plugin-factory/i-plugin-factory.d.ts +39 -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-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 +27 -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/index.d.ts +7 -3
- package/out/interface/index.d.ts.map +1 -1
- package/out/interface/index.js +2 -3
- 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-open-view-util/i-open-view-util.d.ts +1 -1
- 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/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 +37 -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 +31 -0
- package/out/plugin/remote-plugin-item/remote-plugin-item.d.ts +102 -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 +22 -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 +13 -0
- package/out/provider/ui-action/index.d.ts.map +1 -0
- package/out/provider/ui-action/index.js +44 -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 +19 -3
- package/out/types.d.ts.map +1 -1
- package/out/utils/app-de-ui-action-util/app-de-ui-action-util.d.ts +3 -61
- 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 +4 -241
- package/out/utils/app-de-ui-action-util/handler/backend-ui-action-handler.d.ts +17 -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 +28 -0
- package/out/utils/app-de-ui-action-util/handler/common-sys-ui-action-handler.d.ts +17 -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 +17 -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 +24 -0
- package/out/utils/app-de-ui-action-util/handler/index.d.ts +5 -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 +4 -0
- package/out/utils/app-de-ui-action-util/handler/ui-action-handler.d.ts +82 -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 +143 -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 +2 -1
- package/out/utils/index.d.ts.map +1 -1
- package/out/utils/index.js +2 -1
- package/out/utils/open-redirect-view/open-redirect-view.d.ts +43 -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 +139 -0
- package/out/view-logic/view-logic.d.ts +7 -6
- package/out/view-logic/view-logic.d.ts.map +1 -1
- package/out/view-logic/view-logic.js +19 -13
- package/package.json +22 -12
- package/src/command/app/app-func/app-func.ts +3 -3
- package/src/command/app/open-app-view/open-app-view.ts +12 -28
- package/src/index.ts +3 -1
- package/src/install.ts +5 -2
- package/src/interface/i-drawer-options/i-drawer-options.ts +28 -0
- package/src/interface/i-modal-data/i-modal-data.ts +1 -1
- package/src/interface/i-modal-options/i-modal-options.ts +35 -0
- package/src/interface/i-plugin-factory/i-plugin-factory.ts +39 -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 +33 -0
- package/src/interface/index.ts +10 -3
- 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-open-view-util/i-open-view-util.ts +1 -0
- 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/plugin/index.ts +5 -0
- package/src/plugin/plugin-static-resource/plugin-static-resource.ts +42 -0
- package/src/plugin/remote-plugin-item/remote-plugin-item.ts +107 -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 +50 -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 +20 -3
- package/src/utils/app-de-ui-action-util/app-de-ui-action-util.ts +6 -330
- package/src/utils/app-de-ui-action-util/handler/backend-ui-action-handler.ts +43 -0
- package/src/utils/app-de-ui-action-util/handler/common-sys-ui-action-handler.ts +125 -0
- package/src/utils/app-de-ui-action-util/handler/front-ui-action-handler.ts +46 -0
- package/src/utils/app-de-ui-action-util/handler/index.ts +4 -0
- package/src/utils/app-de-ui-action-util/handler/ui-action-handler.ts +215 -0
- package/src/utils/app-de-ui-action-util/index.ts +2 -0
- package/src/utils/index.ts +2 -1
- package/src/utils/open-redirect-view/open-redirect-view.ts +180 -0
- package/src/view-logic/view-logic.ts +30 -17
- 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
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IRegister } from '../interface';
|
|
2
|
+
/**
|
|
3
|
+
* 注册器基类
|
|
4
|
+
*
|
|
5
|
+
* @author lxm
|
|
6
|
+
* @date 2022-10-17 16:10:54
|
|
7
|
+
* @export
|
|
8
|
+
* @class RegisterBase
|
|
9
|
+
* @implements {IRegister<T>}
|
|
10
|
+
* @template T
|
|
11
|
+
*/
|
|
12
|
+
export declare class RegisterBase<T> implements IRegister<T> {
|
|
13
|
+
providers: Map<string, T>;
|
|
14
|
+
register(key: string, provider: T): void;
|
|
15
|
+
unRegister(key: string): void;
|
|
16
|
+
getByKey(key: string): T | undefined;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=register-base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-base.d.ts","sourceRoot":"","sources":["../../src/register/register-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;;;;;;;;GASG;AACH,qBAAa,YAAY,CAAC,CAAC,CAAE,YAAW,SAAS,CAAC,CAAC,CAAC;IAClD,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAa;IAEtC,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI;IAIxC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI7B,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;CAGrC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 注册器基类
|
|
3
|
+
*
|
|
4
|
+
* @author lxm
|
|
5
|
+
* @date 2022-10-17 16:10:54
|
|
6
|
+
* @export
|
|
7
|
+
* @class RegisterBase
|
|
8
|
+
* @implements {IRegister<T>}
|
|
9
|
+
* @template T
|
|
10
|
+
*/
|
|
11
|
+
export class RegisterBase {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.providers = new Map();
|
|
14
|
+
}
|
|
15
|
+
register(key, provider) {
|
|
16
|
+
this.providers.set(key, provider);
|
|
17
|
+
}
|
|
18
|
+
unRegister(key) {
|
|
19
|
+
this.providers.delete(key);
|
|
20
|
+
}
|
|
21
|
+
getByKey(key) {
|
|
22
|
+
return this.providers.get(key);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { UIActionRegister } from './ui-action-register';
|
|
2
|
+
/**
|
|
3
|
+
* 注册中心
|
|
4
|
+
*
|
|
5
|
+
* @author lxm
|
|
6
|
+
* @date 2022-09-19 19:09:10
|
|
7
|
+
* @export
|
|
8
|
+
* @class Register
|
|
9
|
+
*/
|
|
10
|
+
export declare class RegisterCenter {
|
|
11
|
+
/**
|
|
12
|
+
* 界面行为注册器
|
|
13
|
+
*
|
|
14
|
+
* @author lxm
|
|
15
|
+
* @date 2022-10-25 15:10:39
|
|
16
|
+
* @type {UIActionRegister}
|
|
17
|
+
*/
|
|
18
|
+
uiAction: UIActionRegister;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=register-center.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-center.d.ts","sourceRoot":"","sources":["../../src/register/register-center.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD;;;;;;;GAOG;AACH,qBAAa,cAAc;IACzB;;;;;;OAMG;IACH,QAAQ,EAAE,gBAAgB,CAA0B;CACrD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { UIActionRegister } from './ui-action-register';
|
|
2
|
+
/**
|
|
3
|
+
* 注册中心
|
|
4
|
+
*
|
|
5
|
+
* @author lxm
|
|
6
|
+
* @date 2022-09-19 19:09:10
|
|
7
|
+
* @export
|
|
8
|
+
* @class Register
|
|
9
|
+
*/
|
|
10
|
+
export class RegisterCenter {
|
|
11
|
+
constructor() {
|
|
12
|
+
/**
|
|
13
|
+
* 界面行为注册器
|
|
14
|
+
*
|
|
15
|
+
* @author lxm
|
|
16
|
+
* @date 2022-10-25 15:10:39
|
|
17
|
+
* @type {UIActionRegister}
|
|
18
|
+
*/
|
|
19
|
+
this.uiAction = new UIActionRegister();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IPSAppUIAction } from '@ibiz-template/model';
|
|
2
|
+
import { IUIActionRegister, IUIActionProvider } from '../interface';
|
|
3
|
+
import { RegisterBase } from './register-base';
|
|
4
|
+
/**
|
|
5
|
+
* 界面行为注册器
|
|
6
|
+
*
|
|
7
|
+
* @author lxm
|
|
8
|
+
* @date 2022-10-25 15:10:38
|
|
9
|
+
* @export
|
|
10
|
+
* @class UIActionRegister
|
|
11
|
+
* @extends {RegisterBase<IUIActionProvider>}
|
|
12
|
+
* @implements {IUIActionRegister}
|
|
13
|
+
*/
|
|
14
|
+
export declare class UIActionRegister extends RegisterBase<IUIActionProvider> implements IUIActionRegister {
|
|
15
|
+
get(model: IPSAppUIAction): Promise<IUIActionProvider>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=ui-action-register.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-action-register.d.ts","sourceRoot":"","sources":["../../src/register/ui-action-register.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;;;;;;;GASG;AACH,qBAAa,gBACX,SAAQ,YAAY,CAAC,iBAAiB,CACtC,YAAW,iBAAiB;IAEtB,GAAG,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC;CA4B7D"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { RuntimeError } from '@ibiz-template/core';
|
|
2
|
+
import { RegisterBase } from './register-base';
|
|
3
|
+
/**
|
|
4
|
+
* 界面行为注册器
|
|
5
|
+
*
|
|
6
|
+
* @author lxm
|
|
7
|
+
* @date 2022-10-25 15:10:38
|
|
8
|
+
* @export
|
|
9
|
+
* @class UIActionRegister
|
|
10
|
+
* @extends {RegisterBase<IUIActionProvider>}
|
|
11
|
+
* @implements {IUIActionRegister}
|
|
12
|
+
*/
|
|
13
|
+
export class UIActionRegister extends RegisterBase {
|
|
14
|
+
async get(model) {
|
|
15
|
+
// 先找插件标识和类型
|
|
16
|
+
if (model.getPSSysPFPlugin()) {
|
|
17
|
+
await ibiz.plugin.loadPlugin(model.getPSSysPFPlugin());
|
|
18
|
+
const { pluginType, pluginCode } = model.getPSSysPFPlugin();
|
|
19
|
+
const key = `${pluginType}_${pluginCode}`;
|
|
20
|
+
if (this.providers.has(key)) {
|
|
21
|
+
return this.providers.get(key);
|
|
22
|
+
}
|
|
23
|
+
throw new RuntimeError(`找不到插件标识${key}对应的适配器`);
|
|
24
|
+
}
|
|
25
|
+
// 找界面行为模式和界面行为标记
|
|
26
|
+
const { uIActionMode, uIActionTag } = model;
|
|
27
|
+
if (uIActionMode === 'SYS') {
|
|
28
|
+
const key = `${uIActionMode}_${uIActionTag}`;
|
|
29
|
+
if (this.providers.has(key)) {
|
|
30
|
+
return this.providers.get(key);
|
|
31
|
+
}
|
|
32
|
+
throw new RuntimeError(`找不到系统预置界面行为${uIActionTag}对应的适配器`);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
if (this.providers.has(uIActionMode)) {
|
|
36
|
+
return this.providers.get(uIActionMode);
|
|
37
|
+
}
|
|
38
|
+
throw new RuntimeError(`找不界面行为模式${uIActionMode}对应的适配器`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
package/out/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CommandController } from '@ibiz-template/command';
|
|
2
2
|
import '@ibiz-template/service';
|
|
3
|
-
import { IMessageUtil, INotificationUtil, IOpenViewUtil, IModalUtil, ILoadingUtil } from './interface';
|
|
4
|
-
import {
|
|
3
|
+
import { IMessageUtil, INotificationUtil, IOpenViewUtil, IModalUtil, ILoadingUtil, IPluginFactory, IOverlayController } from './interface';
|
|
4
|
+
import { RegisterCenter } from './register/register-center';
|
|
5
5
|
declare module '@ibiz-template/core' {
|
|
6
6
|
interface IBizSys {
|
|
7
7
|
/**
|
|
@@ -56,6 +56,22 @@ declare module '@ibiz-template/core' {
|
|
|
56
56
|
* @type {IOpenViewUtil}
|
|
57
57
|
*/
|
|
58
58
|
openView: IOpenViewUtil;
|
|
59
|
+
/**
|
|
60
|
+
* 全局多种组件呈现工具类
|
|
61
|
+
*
|
|
62
|
+
* @author chitanda
|
|
63
|
+
* @date 2022-11-08 15:11:08
|
|
64
|
+
* @type {IOverlayController}
|
|
65
|
+
*/
|
|
66
|
+
overlay: IOverlayController;
|
|
67
|
+
/**
|
|
68
|
+
* 插件工具工厂
|
|
69
|
+
*
|
|
70
|
+
* @author chitanda
|
|
71
|
+
* @date 2022-10-20 16:10:36
|
|
72
|
+
* @type {IPluginFactory}
|
|
73
|
+
*/
|
|
74
|
+
plugin: IPluginFactory;
|
|
59
75
|
/**
|
|
60
76
|
* 注册中心
|
|
61
77
|
*
|
|
@@ -63,7 +79,7 @@ declare module '@ibiz-template/core' {
|
|
|
63
79
|
* @date 2022-09-19 19:09:23
|
|
64
80
|
* @type {Register}
|
|
65
81
|
*/
|
|
66
|
-
register:
|
|
82
|
+
register: RegisterCenter;
|
|
67
83
|
}
|
|
68
84
|
}
|
|
69
85
|
//# sourceMappingURL=types.d.ts.map
|
package/out/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,wBAAwB,CAAC;AAChC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,YAAY,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,wBAAwB,CAAC;AAChC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,YAAY,EACZ,cAAc,EACd,kBAAkB,EACnB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,OAAO;QACf;;;;;;WAMG;QACH,QAAQ,EAAE,iBAAiB,CAAC;QAC5B;;;;;;WAMG;QACH,OAAO,EAAE,YAAY,CAAC;QACtB;;;;;;;WAOG;QACH,KAAK,EAAE,UAAU,CAAC;QAClB;;;;;;;WAOG;QACH,OAAO,EAAE,YAAY,CAAC;QACtB;;;;;;;WAOG;QACH,YAAY,EAAE,iBAAiB,CAAC;QAChC;;;;;;;WAOG;QACH,QAAQ,EAAE,aAAa,CAAC;QACxB;;;;;;WAMG;QACH,OAAO,EAAE,kBAAkB,CAAC;QAC5B;;;;;;WAMG;QACH,MAAM,EAAE,cAAc,CAAC;QACvB;;;;;;WAMG;QACH,QAAQ,EAAE,cAAc,CAAC;KAC1B;CACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IBizContext } from '@ibiz-template/core';
|
|
1
2
|
import { IPSAppDEUIAction } from '@ibiz-template/model';
|
|
2
3
|
import { IUIActionResult } from '../../interface';
|
|
3
4
|
/**
|
|
@@ -16,71 +17,12 @@ export declare class AppDEUIActionUtil {
|
|
|
16
17
|
* @date 2022-08-29 15:08:47
|
|
17
18
|
* @static
|
|
18
19
|
* @param {IPSAppDEUIAction} action
|
|
19
|
-
* @param {
|
|
20
|
+
* @param {IBizContext} context
|
|
20
21
|
* @param {(IData | null)} data
|
|
21
22
|
* @param {IParams} [params]
|
|
22
23
|
* @param {IData} [opts]
|
|
23
24
|
* @return {*} {Promise<IUIActionResult>}
|
|
24
25
|
*/
|
|
25
|
-
static exec(action: IPSAppDEUIAction, context:
|
|
26
|
-
/**
|
|
27
|
-
* 参数处理(根据数据目标和数据参数,导航参数)
|
|
28
|
-
*
|
|
29
|
-
* @author lxm
|
|
30
|
-
* @date 2022-08-29 17:08:00
|
|
31
|
-
* @protected
|
|
32
|
-
* @static
|
|
33
|
-
* @param {IPSAppDEUIAction} action 界面行为
|
|
34
|
-
* @param {IContext} context 上下文
|
|
35
|
-
* @param {(IData[] | null)} data 数据集合
|
|
36
|
-
* @param {IParams} params 视图参数
|
|
37
|
-
* @returns {*} {Promise<{
|
|
38
|
-
* resultContext: IContext; 处理后的上下文
|
|
39
|
-
* resultData: IData[]; 处理后的数据集合
|
|
40
|
-
* resultParams: IParams; 处理后的视图参数
|
|
41
|
-
* }>}
|
|
42
|
-
*/
|
|
43
|
-
protected static handleParams(action: IPSAppDEUIAction, context: IContext, data: IData[] | null, params: IParams): Promise<{
|
|
44
|
-
resultContext: IContext;
|
|
45
|
-
resultData: IData[];
|
|
46
|
-
resultParams: IParams;
|
|
47
|
-
}>;
|
|
48
|
-
/**
|
|
49
|
-
* 执行系统预置界面行为
|
|
50
|
-
*
|
|
51
|
-
* @author lxm
|
|
52
|
-
* @date 2022-08-29 15:08:29
|
|
53
|
-
* @static
|
|
54
|
-
* @param {IPSAppDEUIAction} action
|
|
55
|
-
* @returns {*} {Promise<IUIActionResult>}
|
|
56
|
-
*/
|
|
57
|
-
static executeSysUIAction(action: IPSAppDEUIAction, data: IData[] | null, opts?: IData): Promise<IUIActionResult>;
|
|
58
|
-
/**
|
|
59
|
-
* 执行前台调用
|
|
60
|
-
*
|
|
61
|
-
* @author lxm
|
|
62
|
-
* @date 2022-08-29 15:08:51
|
|
63
|
-
* @static
|
|
64
|
-
* @param {IPSAppDEUIAction} action
|
|
65
|
-
* @param {IContext} context
|
|
66
|
-
* @param {(IData[] | null)} data
|
|
67
|
-
* @param {IParams} params
|
|
68
|
-
* @param {IData} [opts]
|
|
69
|
-
* @returns {*} {Promise<IUIActionResult>}
|
|
70
|
-
*/
|
|
71
|
-
static executeFrontUIAction(action: IPSAppDEUIAction, context: IContext, _data: IData[] | null, params: IParams, opts?: IData): Promise<IUIActionResult>;
|
|
72
|
-
/**
|
|
73
|
-
* 执行后台调用
|
|
74
|
-
*
|
|
75
|
-
* @author lxm
|
|
76
|
-
* @date 2022-08-28 20:08:35
|
|
77
|
-
* @export
|
|
78
|
-
* @param {IPSAppDEUIAction} action
|
|
79
|
-
* @param {IContext} context
|
|
80
|
-
* @param {IData[]} data
|
|
81
|
-
* @param {IParams} params
|
|
82
|
-
* @returns {*} {Promise<IUIActionResult>}
|
|
83
|
-
*/
|
|
84
|
-
static executeBackEndUIAction(action: IPSAppDEUIAction, context: IContext, _data: IData[], params: IParams): Promise<IUIActionResult>;
|
|
26
|
+
static exec(action: IPSAppDEUIAction, context: IBizContext, data: IData[] | null, params: IParams, opts?: IData): Promise<IUIActionResult>;
|
|
85
27
|
}
|
|
86
28
|
//# sourceMappingURL=app-de-ui-action-util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-de-ui-action-util.d.ts","sourceRoot":"","sources":["../../../src/utils/app-de-ui-action-util/app-de-ui-action-util.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app-de-ui-action-util.d.ts","sourceRoot":"","sources":["../../../src/utils/app-de-ui-action-util/app-de-ui-action-util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD;;;;;;;GAOG;AACH,qBAAa,iBAAiB;IAC5B;;;;;;;;;;;;OAYG;WACU,IAAI,CACf,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EACpB,MAAM,EAAE,OAAO,EACf,IAAI,CAAC,EAAE,KAAK,GACX,OAAO,CAAC,eAAe,CAAC;CAK5B"}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import { IBizContext } from '@ibiz-template/core';
|
|
2
|
-
import { UnsupportedModelError, } from '@ibiz-template/model';
|
|
3
|
-
import { notNilEmpty } from 'qx-util';
|
|
4
|
-
import { OpenAppViewCommand } from '../../command';
|
|
5
|
-
import { convertNavData } from '../nav-params/nav-params';
|
|
6
1
|
/**
|
|
7
2
|
* 应用实体界面行为
|
|
8
3
|
*
|
|
@@ -19,247 +14,15 @@ export class AppDEUIActionUtil {
|
|
|
19
14
|
* @date 2022-08-29 15:08:47
|
|
20
15
|
* @static
|
|
21
16
|
* @param {IPSAppDEUIAction} action
|
|
22
|
-
* @param {
|
|
17
|
+
* @param {IBizContext} context
|
|
23
18
|
* @param {(IData | null)} data
|
|
24
19
|
* @param {IParams} [params]
|
|
25
20
|
* @param {IData} [opts]
|
|
26
21
|
* @return {*} {Promise<IUIActionResult>}
|
|
27
22
|
*/
|
|
28
23
|
static async exec(action, context, data, params, opts) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
const { neuron } = opts;
|
|
34
|
-
const result = {
|
|
35
|
-
refresh: action.reloadData,
|
|
36
|
-
closeView: action.closeEditView,
|
|
37
|
-
};
|
|
38
|
-
// *根据行为模式处理
|
|
39
|
-
if (action.uIActionMode === 'SYS') {
|
|
40
|
-
// 系统预置处理的独有处理
|
|
41
|
-
const tempResult = await this.executeSysUIAction(action, data, opts);
|
|
42
|
-
Object.assign(result, tempResult);
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
// 处理参数
|
|
46
|
-
const { resultContext, resultData, resultParams } = await this.handleParams(action, context, data, params);
|
|
47
|
-
if (action.uIActionMode === 'FRONT') {
|
|
48
|
-
// 前台调用的独有处理
|
|
49
|
-
const tempResult = await this.executeFrontUIAction(action, resultContext, resultData, resultParams, opts);
|
|
50
|
-
Object.assign(result, tempResult);
|
|
51
|
-
}
|
|
52
|
-
else if (action.uIActionMode === 'BACKEND') {
|
|
53
|
-
// 后台调用的独有处理
|
|
54
|
-
const tempResult = this.executeBackEndUIAction(action, resultContext, resultData, resultParams);
|
|
55
|
-
Object.assign(result, tempResult);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
// *后续界面行为处理
|
|
59
|
-
if (action.getNextPSUIAction()) {
|
|
60
|
-
// 后续界面行为
|
|
61
|
-
// todo 用到数据时转成后台数据格式。
|
|
62
|
-
}
|
|
63
|
-
// *刷新引用视图
|
|
64
|
-
if (result.refresh) {
|
|
65
|
-
if (!neuron.call.refresh) {
|
|
66
|
-
throw new Error(`该视图不存在刷新能力`);
|
|
67
|
-
}
|
|
68
|
-
await neuron.call.refresh();
|
|
69
|
-
}
|
|
70
|
-
// *关闭引用视图
|
|
71
|
-
if (result.closeView) {
|
|
72
|
-
if (!neuron.call.closeView) {
|
|
73
|
-
throw new Error(`该视图不存在关闭视图能力`);
|
|
74
|
-
}
|
|
75
|
-
await neuron.call.closeView();
|
|
76
|
-
}
|
|
77
|
-
return result;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* 参数处理(根据数据目标和数据参数,导航参数)
|
|
81
|
-
*
|
|
82
|
-
* @author lxm
|
|
83
|
-
* @date 2022-08-29 17:08:00
|
|
84
|
-
* @protected
|
|
85
|
-
* @static
|
|
86
|
-
* @param {IPSAppDEUIAction} action 界面行为
|
|
87
|
-
* @param {IContext} context 上下文
|
|
88
|
-
* @param {(IData[] | null)} data 数据集合
|
|
89
|
-
* @param {IParams} params 视图参数
|
|
90
|
-
* @returns {*} {Promise<{
|
|
91
|
-
* resultContext: IContext; 处理后的上下文
|
|
92
|
-
* resultData: IData[]; 处理后的数据集合
|
|
93
|
-
* resultParams: IParams; 处理后的视图参数
|
|
94
|
-
* }>}
|
|
95
|
-
*/
|
|
96
|
-
static async handleParams(action, context, data, params) {
|
|
97
|
-
let resultData = data || [];
|
|
98
|
-
// 数据目标不支持提示
|
|
99
|
-
if (['SINGLEDATA', 'MULTIDATA', 'MULTIKEY'].indexOf(action.actionTarget) !==
|
|
100
|
-
-1) {
|
|
101
|
-
throw new Error(`数据类型${action.actionTarget}暂未支持,请配置无数据或单项数据主键`);
|
|
102
|
-
}
|
|
103
|
-
// 数据目标为无数据时,清空数据
|
|
104
|
-
if (action.actionTarget === 'NONE') {
|
|
105
|
-
resultData = [];
|
|
106
|
-
}
|
|
107
|
-
// 处理上下文导航参数
|
|
108
|
-
let resultContext = {};
|
|
109
|
-
const navContexts = action.getPSNavigateContexts() || [];
|
|
110
|
-
// 单项数据主键时,在导航参数开头加一个主键的导航参数,可以被配置的同名导航参数覆盖。
|
|
111
|
-
const appDataEntity = action.getPSAppDataEntity();
|
|
112
|
-
if (appDataEntity && action.actionTarget === 'SINGLEKEY') {
|
|
113
|
-
await (appDataEntity === null || appDataEntity === void 0 ? void 0 : appDataEntity.fill(true));
|
|
114
|
-
const appDeName = appDataEntity.codeName.toLowerCase();
|
|
115
|
-
const { valueItem } = action;
|
|
116
|
-
navContexts.unshift({
|
|
117
|
-
key: appDeName,
|
|
118
|
-
value: valueItem || 'srfkey',
|
|
119
|
-
rawValue: false,
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
if (notNilEmpty(navContexts)) {
|
|
123
|
-
resultContext = convertNavData(navContexts, context, params, (data === null || data === void 0 ? void 0 : data[0]) || {});
|
|
124
|
-
}
|
|
125
|
-
resultContext = new IBizContext(resultContext, context);
|
|
126
|
-
// 处理导航视图参数
|
|
127
|
-
let resultParams = {};
|
|
128
|
-
const navParams = action.getPSNavigateParams();
|
|
129
|
-
if (notNilEmpty(navParams)) {
|
|
130
|
-
resultParams = convertNavData(navParams, context, params, (data === null || data === void 0 ? void 0 : data[0]) || {});
|
|
131
|
-
}
|
|
132
|
-
return { resultContext, resultData, resultParams };
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* 执行系统预置界面行为
|
|
136
|
-
*
|
|
137
|
-
* @author lxm
|
|
138
|
-
* @date 2022-08-29 15:08:29
|
|
139
|
-
* @static
|
|
140
|
-
* @param {IPSAppDEUIAction} action
|
|
141
|
-
* @returns {*} {Promise<IUIActionResult>}
|
|
142
|
-
*/
|
|
143
|
-
static async executeSysUIAction(action, data, opts) {
|
|
144
|
-
const { neuron, event } = opts;
|
|
145
|
-
const { uIActionTag } = action;
|
|
146
|
-
const result = {};
|
|
147
|
-
// todo 暂未支持部分
|
|
148
|
-
if ([
|
|
149
|
-
'HELP',
|
|
150
|
-
'PRINT',
|
|
151
|
-
'ViewWFStep',
|
|
152
|
-
'RefreshParent',
|
|
153
|
-
'RefreshAll',
|
|
154
|
-
'Import',
|
|
155
|
-
].indexOf(uIActionTag) !== -1) {
|
|
156
|
-
throw new UnsupportedModelError(action, `${uIActionTag}暂未支持`);
|
|
157
|
-
}
|
|
158
|
-
// 打开新建数据视图
|
|
159
|
-
if (uIActionTag === 'New') {
|
|
160
|
-
if (!neuron.call.newData) {
|
|
161
|
-
throw new Error(`该视图不存在newData能力`);
|
|
162
|
-
}
|
|
163
|
-
await neuron.call.newData(event);
|
|
164
|
-
}
|
|
165
|
-
// 打开编辑数据视图
|
|
166
|
-
if (uIActionTag === 'Edit') {
|
|
167
|
-
if (!neuron.call.openData) {
|
|
168
|
-
throw new Error(`该视图不存在openData能力`);
|
|
169
|
-
}
|
|
170
|
-
await neuron.call.openData(data === null || data === void 0 ? void 0 : data[0], event);
|
|
171
|
-
}
|
|
172
|
-
// 保存能力
|
|
173
|
-
const saveTags = ['SaveAndExit', 'Save', 'SaveAndStart', 'SaveRow'];
|
|
174
|
-
if (saveTags.indexOf(uIActionTag) !== -1) {
|
|
175
|
-
if (!neuron.call.save) {
|
|
176
|
-
throw new Error(`该视图不存在save能力`);
|
|
177
|
-
}
|
|
178
|
-
await neuron.call.save();
|
|
179
|
-
}
|
|
180
|
-
// 保存并新建
|
|
181
|
-
if (uIActionTag === 'SaveAndNew') {
|
|
182
|
-
if (!neuron.call.saveAndNew) {
|
|
183
|
-
throw new Error(`该视图不存在saveAndNew能力`);
|
|
184
|
-
}
|
|
185
|
-
await neuron.call.saveAndNew();
|
|
186
|
-
}
|
|
187
|
-
// 删除能力
|
|
188
|
-
if (uIActionTag === 'Remove' || uIActionTag === 'RemoveAndExit') {
|
|
189
|
-
if (!neuron.call.remove) {
|
|
190
|
-
throw new Error(`该视图不存在remove能力`);
|
|
191
|
-
}
|
|
192
|
-
await neuron.call.remove();
|
|
193
|
-
}
|
|
194
|
-
// 新建行能力
|
|
195
|
-
if (uIActionTag === 'NewRow') {
|
|
196
|
-
if (!neuron.call.newRow) {
|
|
197
|
-
throw new Error(`该视图不存在newRow能力`);
|
|
198
|
-
}
|
|
199
|
-
await neuron.call.newRow();
|
|
200
|
-
}
|
|
201
|
-
// 切换搜索表单能力
|
|
202
|
-
if (uIActionTag === 'ToggleFilter') {
|
|
203
|
-
if (!neuron.call.toggleFilter) {
|
|
204
|
-
throw new Error(`该视图不存在ToggleFilter能力`);
|
|
205
|
-
}
|
|
206
|
-
neuron.call.toggleFilter();
|
|
207
|
-
}
|
|
208
|
-
// 需要关闭视图的
|
|
209
|
-
if (['SaveAndExit', 'Exit', 'SaveAndStart', 'RemoveAndExit'].indexOf(uIActionTag) !== -1) {
|
|
210
|
-
result.closeView = true;
|
|
211
|
-
}
|
|
212
|
-
// 需要刷新界面的
|
|
213
|
-
if (['Refresh'].indexOf(uIActionTag) !== -1) {
|
|
214
|
-
result.refresh = true;
|
|
215
|
-
}
|
|
216
|
-
return result;
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* 执行前台调用
|
|
220
|
-
*
|
|
221
|
-
* @author lxm
|
|
222
|
-
* @date 2022-08-29 15:08:51
|
|
223
|
-
* @static
|
|
224
|
-
* @param {IPSAppDEUIAction} action
|
|
225
|
-
* @param {IContext} context
|
|
226
|
-
* @param {(IData[] | null)} data
|
|
227
|
-
* @param {IParams} params
|
|
228
|
-
* @param {IData} [opts]
|
|
229
|
-
* @returns {*} {Promise<IUIActionResult>}
|
|
230
|
-
*/
|
|
231
|
-
static async executeFrontUIAction(action, context, _data, params, opts) {
|
|
232
|
-
const frontPSAppView = action.getFrontPSAppView();
|
|
233
|
-
if (!frontPSAppView) {
|
|
234
|
-
throw new Error('未配置打开视图');
|
|
235
|
-
}
|
|
236
|
-
await frontPSAppView.fill(true);
|
|
237
|
-
await ibiz.commands.execute(OpenAppViewCommand.TAG, frontPSAppView, context, params, opts);
|
|
238
|
-
return {};
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* 执行后台调用
|
|
242
|
-
*
|
|
243
|
-
* @author lxm
|
|
244
|
-
* @date 2022-08-28 20:08:35
|
|
245
|
-
* @export
|
|
246
|
-
* @param {IPSAppDEUIAction} action
|
|
247
|
-
* @param {IContext} context
|
|
248
|
-
* @param {IData[]} data
|
|
249
|
-
* @param {IParams} params
|
|
250
|
-
* @returns {*} {Promise<IUIActionResult>}
|
|
251
|
-
*/
|
|
252
|
-
static async executeBackEndUIAction(action, context, _data, params) {
|
|
253
|
-
var _a, _b;
|
|
254
|
-
const entityName = (_a = action.getPSAppDataEntity()) === null || _a === void 0 ? void 0 : _a.codeName;
|
|
255
|
-
const methodName = (_b = action.getPSAppDEMethod()) === null || _b === void 0 ? void 0 : _b.codeName;
|
|
256
|
-
if (!entityName || !methodName) {
|
|
257
|
-
throw new Error('找不到实体或实体行为');
|
|
258
|
-
}
|
|
259
|
-
const deService = await ibiz.entityService.getService(entityName);
|
|
260
|
-
const res = await deService.exec(methodName, context, params);
|
|
261
|
-
// todo 用到数据时转成后台数据格式。
|
|
262
|
-
console.log(res);
|
|
263
|
-
return {};
|
|
24
|
+
const provider = await ibiz.register.uiAction.get(action);
|
|
25
|
+
const handler = await provider.getHandler();
|
|
26
|
+
return handler.exec(action, context, data, params, opts);
|
|
264
27
|
}
|
|
265
28
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IBizContext } from '@ibiz-template/core';
|
|
2
|
+
import { IPSAppDEUIAction } from '@ibiz-template/model';
|
|
3
|
+
import { IUIActionResult } from '../../../interface';
|
|
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 BackendUIActionHandler
|
|
12
|
+
* @extends {UIActionHandler}
|
|
13
|
+
*/
|
|
14
|
+
export declare class BackendUIActionHandler extends UIActionHandler {
|
|
15
|
+
execAction(action: IPSAppDEUIAction, context: IBizContext, data: IData[] | null, params: IParams, _opts?: IData | undefined): Promise<IUIActionResult>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=backend-ui-action-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend-ui-action-handler.d.ts","sourceRoot":"","sources":["../../../../src/utils/app-de-ui-action-util/handler/backend-ui-action-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,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,sBAAuB,SAAQ,eAAe;IACnD,UAAU,CACd,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EACpB,MAAM,EAAE,OAAO,EACf,KAAK,CAAC,EAAE,KAAK,GAAG,SAAS,GACxB,OAAO,CAAC,eAAe,CAAC;CAqB5B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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 BackendUIActionHandler
|
|
9
|
+
* @extends {UIActionHandler}
|
|
10
|
+
*/
|
|
11
|
+
export class BackendUIActionHandler extends UIActionHandler {
|
|
12
|
+
async execAction(action, context, data, params, _opts) {
|
|
13
|
+
var _a, _b, _c;
|
|
14
|
+
const entityName = (_a = action.getPSAppDataEntity()) === null || _a === void 0 ? void 0 : _a.codeName;
|
|
15
|
+
const methodName = (_b = action.getPSAppDEMethod()) === null || _b === void 0 ? void 0 : _b.codeName;
|
|
16
|
+
if (!entityName || !methodName) {
|
|
17
|
+
throw new Error('找不到实体或实体行为');
|
|
18
|
+
}
|
|
19
|
+
// 处理参数
|
|
20
|
+
const { resultContext, resultParams, resultData } = await this.handleParams(action, context, data, params);
|
|
21
|
+
const deService = await ibiz.entityService.getService(entityName);
|
|
22
|
+
const _data = resultData.length > 0
|
|
23
|
+
? ((_c = resultData[0]) === null || _c === void 0 ? void 0 : _c.getRequestData()) || resultData[0]
|
|
24
|
+
: {};
|
|
25
|
+
await deService.exec(methodName, resultContext, _data, resultParams);
|
|
26
|
+
return {};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IBizContext } from '@ibiz-template/core';
|
|
2
|
+
import { IPSAppDEUIAction } from '@ibiz-template/model';
|
|
3
|
+
import { IUIActionResult } from '../../../interface';
|
|
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 CommonSysUIActionHandler
|
|
12
|
+
* @extends {UIActionHandler}
|
|
13
|
+
*/
|
|
14
|
+
export declare class CommonSysUIActionHandler extends UIActionHandler {
|
|
15
|
+
execAction(action: IPSAppDEUIAction, context: IBizContext, data: IData[] | null, params: IParams, opts?: IData | undefined): Promise<IUIActionResult>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=common-sys-ui-action-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-sys-ui-action-handler.d.ts","sourceRoot":"","sources":["../../../../src/utils/app-de-ui-action-util/handler/common-sys-ui-action-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,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,wBAAyB,SAAQ,eAAe;IACrD,UAAU,CACd,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EACpB,MAAM,EAAE,OAAO,EACf,IAAI,CAAC,EAAE,KAAK,GAAG,SAAS,GACvB,OAAO,CAAC,eAAe,CAAC;CAuG5B"}
|