@ibiz-template/runtime 0.0.1-alpha.9 → 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,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 全局呈现容器
|
|
3
|
+
*
|
|
4
|
+
* @author chitanda
|
|
5
|
+
* @date 2022-11-09 14:11:59
|
|
6
|
+
* @export
|
|
7
|
+
* @interface IOverlayContainer
|
|
8
|
+
*/
|
|
9
|
+
export interface IOverlayContainer {
|
|
10
|
+
/**
|
|
11
|
+
* 展示容器
|
|
12
|
+
*
|
|
13
|
+
* @author chitanda
|
|
14
|
+
* @date 2022-11-09 14:11:10
|
|
15
|
+
* @return {*} {Promise<void>}
|
|
16
|
+
*/
|
|
17
|
+
present(): Promise<void>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* 关闭容器
|
|
21
|
+
*
|
|
22
|
+
* @author chitanda
|
|
23
|
+
* @date 2022-11-09 14:11:17
|
|
24
|
+
* @param {unknown} [data]
|
|
25
|
+
* @return {*} {Promise<void>}
|
|
26
|
+
*/
|
|
27
|
+
dismiss(data?: unknown): Promise<void>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* 等待容器关闭并返回返回值
|
|
31
|
+
*
|
|
32
|
+
* @author chitanda
|
|
33
|
+
* @date 2022-11-09 14:11:21
|
|
34
|
+
* @template T
|
|
35
|
+
* @return {*} {Promise<T>}
|
|
36
|
+
*/
|
|
37
|
+
onWillDismiss<T = unknown>(): Promise<T>;
|
|
38
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { IDrawerOptions } from '../../i-drawer-options/i-drawer-options';
|
|
2
|
+
import { IPopoverOptions } from '../../i-popover-options/i-popover-options';
|
|
3
|
+
import { IModalOptions } from '../../i-modal-options/i-modal-options';
|
|
4
|
+
import { IOverlayContainer } from '../i-overlay-container/i-overlay-container';
|
|
5
|
+
import { IOverlayPopoverContainer } from '../i-overlay-popover-container/i-overlay-popover-container';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 全局呈现容器控制器
|
|
9
|
+
*
|
|
10
|
+
* @author chitanda
|
|
11
|
+
* @date 2022-11-08 14:11:27
|
|
12
|
+
* @export
|
|
13
|
+
* @interface IOverlayController
|
|
14
|
+
*/
|
|
15
|
+
export interface IOverlayController {
|
|
16
|
+
/**
|
|
17
|
+
* 飘窗
|
|
18
|
+
*
|
|
19
|
+
* @author chitanda
|
|
20
|
+
* @date 2022-11-09 12:11:22
|
|
21
|
+
* @template T
|
|
22
|
+
* @param {HTMLElement} element
|
|
23
|
+
* @param {unknown} component 组件名称,组件对象,或者绘制函数
|
|
24
|
+
* @param {IParams} [props] 组件props
|
|
25
|
+
* @param {IPopoverOptions} [opts]
|
|
26
|
+
* @return {*} {Promise<T>}
|
|
27
|
+
*/
|
|
28
|
+
popover<T = void>(
|
|
29
|
+
element: HTMLElement,
|
|
30
|
+
component: unknown,
|
|
31
|
+
props?: IParams,
|
|
32
|
+
opts?: IPopoverOptions,
|
|
33
|
+
): Promise<T>;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* 创建飘窗全局容器
|
|
37
|
+
*
|
|
38
|
+
* @author chitanda
|
|
39
|
+
* @date 2022-11-09 15:11:13
|
|
40
|
+
* @param {unknown} component 组件名称,组件对象,或者绘制函数
|
|
41
|
+
* @param {IParams} [props] 组件props
|
|
42
|
+
* @param {IPopoverOptions} [opts]
|
|
43
|
+
* @return {*} {IOverlayPopoverContainer}
|
|
44
|
+
*/
|
|
45
|
+
createPopover(
|
|
46
|
+
component: unknown,
|
|
47
|
+
props?: IParams,
|
|
48
|
+
opts?: IPopoverOptions,
|
|
49
|
+
): IOverlayPopoverContainer;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* 抽屉
|
|
53
|
+
*
|
|
54
|
+
* @author chitanda
|
|
55
|
+
* @date 2022-11-08 15:11:45
|
|
56
|
+
* @template T
|
|
57
|
+
* @param {unknown} component 组件名称,组件对象,或者绘制函数
|
|
58
|
+
* @param {IParams} [props] 组件props
|
|
59
|
+
* @param {IDrawerOptions} [opts]
|
|
60
|
+
* @return {*} {Promise<T>}
|
|
61
|
+
*/
|
|
62
|
+
drawer<T = void>(
|
|
63
|
+
component: unknown,
|
|
64
|
+
props?: IParams,
|
|
65
|
+
opts?: IDrawerOptions,
|
|
66
|
+
): Promise<T>;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* 创建全局抽屉容器
|
|
70
|
+
*
|
|
71
|
+
* @author chitanda
|
|
72
|
+
* @date 2022-11-09 15:11:49
|
|
73
|
+
* @param {unknown} component 组件名称,组件对象,或者绘制函数
|
|
74
|
+
* @param {IParams} [props] 组件props
|
|
75
|
+
* @param {IDrawerOptions} [opts]
|
|
76
|
+
* @return {*} {IOverlayContainer}
|
|
77
|
+
*/
|
|
78
|
+
createDrawer(
|
|
79
|
+
component: unknown,
|
|
80
|
+
props?: IParams,
|
|
81
|
+
opts?: IDrawerOptions,
|
|
82
|
+
): IOverlayContainer;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* 模态
|
|
86
|
+
*
|
|
87
|
+
* @author chitanda
|
|
88
|
+
* @date 2022-11-08 15:11:40
|
|
89
|
+
* @template T
|
|
90
|
+
* @param {unknown} component 组件名称,组件对象,或者绘制函数
|
|
91
|
+
* @param {IParams} [props] 组件props
|
|
92
|
+
* @param {IModalOptions} [opts]
|
|
93
|
+
* @return {*} {Promise<T>}
|
|
94
|
+
*/
|
|
95
|
+
modal<T = void>(
|
|
96
|
+
component: unknown,
|
|
97
|
+
props?: IParams,
|
|
98
|
+
opts?: IModalOptions,
|
|
99
|
+
): Promise<T>;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* 创建全局模态容器
|
|
103
|
+
*
|
|
104
|
+
* @author chitanda
|
|
105
|
+
* @date 2022-11-09 15:11:58
|
|
106
|
+
* @param {unknown} component 组件名称,组件对象,或者绘制函数
|
|
107
|
+
* @param {IParams} [props] 组件props
|
|
108
|
+
* @param {IModalOptions} [opts]
|
|
109
|
+
* @return {*} {IOverlayContainer}
|
|
110
|
+
*/
|
|
111
|
+
createModal(
|
|
112
|
+
component: unknown,
|
|
113
|
+
props?: IParams,
|
|
114
|
+
opts?: IModalOptions,
|
|
115
|
+
): IOverlayContainer;
|
|
116
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IOverlayContainer } from '../i-overlay-container/i-overlay-container';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 飘窗容器
|
|
5
|
+
*
|
|
6
|
+
* @author chitanda
|
|
7
|
+
* @date 2022-11-09 14:11:39
|
|
8
|
+
* @export
|
|
9
|
+
* @interface IOverlayPopoverContainer
|
|
10
|
+
* @extends {IOverlayContainer}
|
|
11
|
+
*/
|
|
12
|
+
export interface IOverlayPopoverContainer extends IOverlayContainer {
|
|
13
|
+
/**
|
|
14
|
+
* 展示飘窗容器
|
|
15
|
+
*
|
|
16
|
+
* @author chitanda
|
|
17
|
+
* @date 2022-11-09 14:11:47
|
|
18
|
+
* @param {HTMLElement} target
|
|
19
|
+
* @return {*} {Promise<void>}
|
|
20
|
+
*/
|
|
21
|
+
present(target: HTMLElement): Promise<void>;
|
|
22
|
+
present(): Promise<void>;
|
|
23
|
+
}
|
|
@@ -6,3 +6,6 @@ export {
|
|
|
6
6
|
NotificationParams,
|
|
7
7
|
} from './i-notification-util/i-notification-util';
|
|
8
8
|
export { IOpenViewUtil } from './i-open-view-util/i-open-view-util';
|
|
9
|
+
export { IOverlayContainer } from './i-overlay-container/i-overlay-container';
|
|
10
|
+
export { IOverlayController } from './i-overlay-controller/i-overlay-controller';
|
|
11
|
+
export { IOverlayPopoverContainer } from './i-overlay-popover-container/i-overlay-popover-container';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 插件静态资源工具类
|
|
3
|
+
*
|
|
4
|
+
* @author chitanda
|
|
5
|
+
* @date 2022-11-03 10:11:08
|
|
6
|
+
* @export
|
|
7
|
+
* @class PluginStaticResource
|
|
8
|
+
*/
|
|
9
|
+
export class PluginStaticResource {
|
|
10
|
+
/**
|
|
11
|
+
* 计算出的静态资源跟路径
|
|
12
|
+
*
|
|
13
|
+
* @author chitanda
|
|
14
|
+
* @date 2022-11-03 10:11:08
|
|
15
|
+
* @protected
|
|
16
|
+
* @type {string}
|
|
17
|
+
*/
|
|
18
|
+
protected baseDir: string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 插件静态资源工具类.
|
|
22
|
+
*
|
|
23
|
+
* @author chitanda
|
|
24
|
+
* @date 2022-11-03 10:11:41
|
|
25
|
+
* @param {string} mateUrl import.mate.url
|
|
26
|
+
*/
|
|
27
|
+
constructor(mateUrl: string) {
|
|
28
|
+
this.baseDir = mateUrl.substring(0, mateUrl.lastIndexOf('/'));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 合并输出静态资源目录
|
|
33
|
+
*
|
|
34
|
+
* @author chitanda
|
|
35
|
+
* @date 2022-11-03 10:11:39
|
|
36
|
+
* @param {string} path
|
|
37
|
+
* @return {*} {string}
|
|
38
|
+
*/
|
|
39
|
+
dir(path: string): string {
|
|
40
|
+
return this.baseDir + path;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 远程插件配置
|
|
3
|
+
*
|
|
4
|
+
* @author chitanda
|
|
5
|
+
* @date 2022-10-31 16:10:34
|
|
6
|
+
* @export
|
|
7
|
+
* @interface RemotePluginConfig
|
|
8
|
+
*/
|
|
9
|
+
export interface RemotePluginConfig {
|
|
10
|
+
/**
|
|
11
|
+
* 所有配置文件基础路径
|
|
12
|
+
*
|
|
13
|
+
* @author chitanda
|
|
14
|
+
* @date 2022-11-02 14:11:06
|
|
15
|
+
* @type {string}
|
|
16
|
+
*/
|
|
17
|
+
baseUrl: string;
|
|
18
|
+
/**
|
|
19
|
+
* 包名称
|
|
20
|
+
*
|
|
21
|
+
* @author chitanda
|
|
22
|
+
* @date 2022-10-31 16:10:42
|
|
23
|
+
* @type {string}
|
|
24
|
+
*/
|
|
25
|
+
name: string;
|
|
26
|
+
/**
|
|
27
|
+
* 版本
|
|
28
|
+
*
|
|
29
|
+
* @author chitanda
|
|
30
|
+
* @date 2022-11-02 15:11:03
|
|
31
|
+
* @type {string}
|
|
32
|
+
*/
|
|
33
|
+
version: string;
|
|
34
|
+
/**
|
|
35
|
+
* system js 入口脚本
|
|
36
|
+
*
|
|
37
|
+
* @author chitanda
|
|
38
|
+
* @date 2022-11-02 15:11:28
|
|
39
|
+
* @type {string}
|
|
40
|
+
*/
|
|
41
|
+
system: string;
|
|
42
|
+
/**
|
|
43
|
+
* 模块文件 入口脚本
|
|
44
|
+
*
|
|
45
|
+
* @author chitanda
|
|
46
|
+
* @date 2022-11-02 16:11:50
|
|
47
|
+
* @type {string}
|
|
48
|
+
*/
|
|
49
|
+
module: string;
|
|
50
|
+
/**
|
|
51
|
+
* 样式地址
|
|
52
|
+
*
|
|
53
|
+
* @author chitanda
|
|
54
|
+
* @date 2022-10-31 16:10:46
|
|
55
|
+
* @type {(string | string[])}
|
|
56
|
+
*/
|
|
57
|
+
styles: string | string[];
|
|
58
|
+
/**
|
|
59
|
+
* 是否为应用级
|
|
60
|
+
*
|
|
61
|
+
* @author chitanda
|
|
62
|
+
* @date 2022-10-31 16:10:51
|
|
63
|
+
* @type {boolean}
|
|
64
|
+
*/
|
|
65
|
+
app?: boolean;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* 远程插件项
|
|
70
|
+
*
|
|
71
|
+
* @author chitanda
|
|
72
|
+
* @date 2022-10-31 12:10:41
|
|
73
|
+
* @export
|
|
74
|
+
* @class RemotePluginItem
|
|
75
|
+
*/
|
|
76
|
+
export class RemotePluginItem {
|
|
77
|
+
/**
|
|
78
|
+
* 唯一标识
|
|
79
|
+
*
|
|
80
|
+
* @author chitanda
|
|
81
|
+
* @date 2022-10-31 12:10:48
|
|
82
|
+
* @type {string}
|
|
83
|
+
*/
|
|
84
|
+
readonly tag: string;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* 配置参数
|
|
88
|
+
*
|
|
89
|
+
* @author chitanda
|
|
90
|
+
* @date 2022-11-02 15:11:38
|
|
91
|
+
* @type {RemotePluginConfig}
|
|
92
|
+
*/
|
|
93
|
+
readonly config: RemotePluginConfig;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Creates an instance of RemotePluginItem.
|
|
97
|
+
*
|
|
98
|
+
* @author chitanda
|
|
99
|
+
* @date 2022-10-31 12:10:28
|
|
100
|
+
* @param {string} tag 插件唯一标识
|
|
101
|
+
* @param {RemotePluginConfig} config
|
|
102
|
+
*/
|
|
103
|
+
constructor(tag: string, config: RemotePluginConfig) {
|
|
104
|
+
this.tag = tag;
|
|
105
|
+
this.config = config;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ui-action';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IUIActionHandler, IUIActionProvider } from '../../interface';
|
|
2
|
+
import { BackendUIActionHandler } from '../../utils';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 后台调用界面行为适配器
|
|
6
|
+
*
|
|
7
|
+
* @author lxm
|
|
8
|
+
* @date 2022-10-25 15:10:51
|
|
9
|
+
* @export
|
|
10
|
+
* @class BackendUIActionProvider
|
|
11
|
+
* @implements {IUIActionProvider}
|
|
12
|
+
*/
|
|
13
|
+
export class BackendUIActionProvider implements IUIActionProvider {
|
|
14
|
+
private handler?: IUIActionHandler;
|
|
15
|
+
|
|
16
|
+
async getHandler(): Promise<IUIActionHandler> {
|
|
17
|
+
if (!this.handler) {
|
|
18
|
+
this.handler = new BackendUIActionHandler();
|
|
19
|
+
}
|
|
20
|
+
return this.handler;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IUIActionHandler, IUIActionProvider } from '../../interface';
|
|
2
|
+
import { CommonSysUIActionHandler } from '../../utils';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 常用系统预置界面行为适配器
|
|
6
|
+
*
|
|
7
|
+
* @author lxm
|
|
8
|
+
* @date 2022-10-25 15:10:51
|
|
9
|
+
* @export
|
|
10
|
+
* @class CommonSysUIActionProvider
|
|
11
|
+
* @implements {IUIActionProvider}
|
|
12
|
+
*/
|
|
13
|
+
export class CommonSysUIActionProvider implements IUIActionProvider {
|
|
14
|
+
private handler?: IUIActionHandler;
|
|
15
|
+
|
|
16
|
+
async getHandler(): Promise<IUIActionHandler> {
|
|
17
|
+
if (!this.handler) {
|
|
18
|
+
this.handler = new CommonSysUIActionHandler();
|
|
19
|
+
}
|
|
20
|
+
return this.handler;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IUIActionHandler, IUIActionProvider } from '../../interface';
|
|
2
|
+
import { FrontUIActionHandler } from '../../utils';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 前台调用界面行为适配器
|
|
6
|
+
*
|
|
7
|
+
* @author lxm
|
|
8
|
+
* @date 2022-10-25 15:10:51
|
|
9
|
+
* @export
|
|
10
|
+
* @class FrontUIActionProvider
|
|
11
|
+
* @implements {IUIActionProvider}
|
|
12
|
+
*/
|
|
13
|
+
export class FrontUIActionProvider implements IUIActionProvider {
|
|
14
|
+
private handler?: IUIActionHandler;
|
|
15
|
+
|
|
16
|
+
async getHandler(): Promise<IUIActionHandler> {
|
|
17
|
+
if (!this.handler) {
|
|
18
|
+
this.handler = new FrontUIActionHandler();
|
|
19
|
+
}
|
|
20
|
+
return this.handler;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { BackendUIActionProvider } from './backend-ui-action-provider';
|
|
2
|
+
import { CommonSysUIActionProvider } from './common-sys-ui-action-provider';
|
|
3
|
+
import { FrontUIActionProvider } from './front-ui-action-provider';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 预置默认的界面行为适配器
|
|
7
|
+
*
|
|
8
|
+
* @author lxm
|
|
9
|
+
* @date 2022-09-19 22:09:50
|
|
10
|
+
* @export
|
|
11
|
+
*/
|
|
12
|
+
export function presetUIActionProvider(): void {
|
|
13
|
+
const { uiAction } = ibiz.register;
|
|
14
|
+
if (!uiAction) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
// *前台调用
|
|
18
|
+
uiAction.register('FRONT', new FrontUIActionProvider());
|
|
19
|
+
// *后台调用
|
|
20
|
+
uiAction.register('BACKEND', new BackendUIActionProvider());
|
|
21
|
+
// *系统预置界面行为
|
|
22
|
+
// 打开新建数据视图
|
|
23
|
+
uiAction.register('SYS_New', new CommonSysUIActionProvider());
|
|
24
|
+
// 打开编辑数据视图
|
|
25
|
+
uiAction.register('SYS_Edit', new CommonSysUIActionProvider());
|
|
26
|
+
// 保存
|
|
27
|
+
uiAction.register('SYS_Save', new CommonSysUIActionProvider());
|
|
28
|
+
uiAction.register('SYS_SaveAndExit', new CommonSysUIActionProvider());
|
|
29
|
+
uiAction.register('SYS_SaveRow', new CommonSysUIActionProvider());
|
|
30
|
+
uiAction.register('SYS_SaveAndNew', new CommonSysUIActionProvider());
|
|
31
|
+
// 删除
|
|
32
|
+
uiAction.register('SYS_Remove', new CommonSysUIActionProvider());
|
|
33
|
+
uiAction.register('SYS_RemoveAndExit', new CommonSysUIActionProvider());
|
|
34
|
+
uiAction.register('SYS_NewRow', new CommonSysUIActionProvider());
|
|
35
|
+
// 工作流
|
|
36
|
+
uiAction.register('SYS_SaveAndStart', new CommonSysUIActionProvider());
|
|
37
|
+
uiAction.register('SYS_ViewWFStep', new CommonSysUIActionProvider());
|
|
38
|
+
// 其他
|
|
39
|
+
uiAction.register('SYS_ToggleFilter', new CommonSysUIActionProvider());
|
|
40
|
+
uiAction.register('SYS_Exit', new CommonSysUIActionProvider());
|
|
41
|
+
uiAction.register('SYS_Refresh', new CommonSysUIActionProvider());
|
|
42
|
+
uiAction.register('SYS_Import', new CommonSysUIActionProvider());
|
|
43
|
+
uiAction.register('SYS_ExportExcel', new CommonSysUIActionProvider());
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export {
|
|
47
|
+
FrontUIActionProvider,
|
|
48
|
+
CommonSysUIActionProvider,
|
|
49
|
+
BackendUIActionProvider,
|
|
50
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IRegister } from '../interface';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 注册器基类
|
|
5
|
+
*
|
|
6
|
+
* @author lxm
|
|
7
|
+
* @date 2022-10-17 16:10:54
|
|
8
|
+
* @export
|
|
9
|
+
* @class RegisterBase
|
|
10
|
+
* @implements {IRegister<T>}
|
|
11
|
+
* @template T
|
|
12
|
+
*/
|
|
13
|
+
export class RegisterBase<T> implements IRegister<T> {
|
|
14
|
+
providers: Map<string, T> = new Map();
|
|
15
|
+
|
|
16
|
+
register(key: string, provider: T): void {
|
|
17
|
+
this.providers.set(key, provider);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
unRegister(key: string): void {
|
|
21
|
+
this.providers.delete(key);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
getByKey(key: string): T | undefined {
|
|
25
|
+
return this.providers.get(key);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { UIActionRegister } from './ui-action-register';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 注册中心
|
|
5
|
+
*
|
|
6
|
+
* @author lxm
|
|
7
|
+
* @date 2022-09-19 19:09:10
|
|
8
|
+
* @export
|
|
9
|
+
* @class Register
|
|
10
|
+
*/
|
|
11
|
+
export class RegisterCenter {
|
|
12
|
+
/**
|
|
13
|
+
* 界面行为注册器
|
|
14
|
+
*
|
|
15
|
+
* @author lxm
|
|
16
|
+
* @date 2022-10-25 15:10:39
|
|
17
|
+
* @type {UIActionRegister}
|
|
18
|
+
*/
|
|
19
|
+
uiAction: UIActionRegister = new UIActionRegister();
|
|
20
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { RuntimeError } from '@ibiz-template/core';
|
|
2
|
+
import { IPSAppUIAction } from '@ibiz-template/model';
|
|
3
|
+
import { IUIActionRegister, IUIActionProvider } from '../interface';
|
|
4
|
+
import { RegisterBase } from './register-base';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 界面行为注册器
|
|
8
|
+
*
|
|
9
|
+
* @author lxm
|
|
10
|
+
* @date 2022-10-25 15:10:38
|
|
11
|
+
* @export
|
|
12
|
+
* @class UIActionRegister
|
|
13
|
+
* @extends {RegisterBase<IUIActionProvider>}
|
|
14
|
+
* @implements {IUIActionRegister}
|
|
15
|
+
*/
|
|
16
|
+
export class UIActionRegister
|
|
17
|
+
extends RegisterBase<IUIActionProvider>
|
|
18
|
+
implements IUIActionRegister
|
|
19
|
+
{
|
|
20
|
+
async get(model: IPSAppUIAction): Promise<IUIActionProvider> {
|
|
21
|
+
// 先找插件标识和类型
|
|
22
|
+
if (model.getPSSysPFPlugin()) {
|
|
23
|
+
await ibiz.plugin.loadPlugin(model.getPSSysPFPlugin()!);
|
|
24
|
+
const { pluginType, pluginCode } = model.getPSSysPFPlugin()!;
|
|
25
|
+
const key = `${pluginType}_${pluginCode}`;
|
|
26
|
+
if (this.providers.has(key)) {
|
|
27
|
+
return this.providers.get(key)!;
|
|
28
|
+
}
|
|
29
|
+
throw new RuntimeError(`找不到插件标识${key}对应的适配器`);
|
|
30
|
+
}
|
|
31
|
+
// 找界面行为模式和界面行为标记
|
|
32
|
+
const { uIActionMode, uIActionTag } = model;
|
|
33
|
+
if (uIActionMode === 'SYS') {
|
|
34
|
+
const key = `${uIActionMode}_${uIActionTag}`;
|
|
35
|
+
if (this.providers.has(key)) {
|
|
36
|
+
return this.providers.get(key)!;
|
|
37
|
+
}
|
|
38
|
+
throw new RuntimeError(
|
|
39
|
+
`找不到系统预置界面行为${uIActionTag}对应的适配器`,
|
|
40
|
+
);
|
|
41
|
+
} else {
|
|
42
|
+
if (this.providers.has(uIActionMode)) {
|
|
43
|
+
return this.providers.get(uIActionMode)!;
|
|
44
|
+
}
|
|
45
|
+
throw new RuntimeError(`找不界面行为模式${uIActionMode}对应的适配器`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -6,8 +6,10 @@ import {
|
|
|
6
6
|
IOpenViewUtil,
|
|
7
7
|
IModalUtil,
|
|
8
8
|
ILoadingUtil,
|
|
9
|
+
IPluginFactory,
|
|
10
|
+
IOverlayController,
|
|
9
11
|
} from './interface';
|
|
10
|
-
import {
|
|
12
|
+
import { RegisterCenter } from './register/register-center';
|
|
11
13
|
|
|
12
14
|
declare module '@ibiz-template/core' {
|
|
13
15
|
interface IBizSys {
|
|
@@ -63,7 +65,22 @@ declare module '@ibiz-template/core' {
|
|
|
63
65
|
* @type {IOpenViewUtil}
|
|
64
66
|
*/
|
|
65
67
|
openView: IOpenViewUtil;
|
|
66
|
-
|
|
68
|
+
/**
|
|
69
|
+
* 全局多种组件呈现工具类
|
|
70
|
+
*
|
|
71
|
+
* @author chitanda
|
|
72
|
+
* @date 2022-11-08 15:11:08
|
|
73
|
+
* @type {IOverlayController}
|
|
74
|
+
*/
|
|
75
|
+
overlay: IOverlayController;
|
|
76
|
+
/**
|
|
77
|
+
* 插件工具工厂
|
|
78
|
+
*
|
|
79
|
+
* @author chitanda
|
|
80
|
+
* @date 2022-10-20 16:10:36
|
|
81
|
+
* @type {IPluginFactory}
|
|
82
|
+
*/
|
|
83
|
+
plugin: IPluginFactory;
|
|
67
84
|
/**
|
|
68
85
|
* 注册中心
|
|
69
86
|
*
|
|
@@ -71,6 +88,6 @@ declare module '@ibiz-template/core' {
|
|
|
71
88
|
* @date 2022-09-19 19:09:23
|
|
72
89
|
* @type {Register}
|
|
73
90
|
*/
|
|
74
|
-
register:
|
|
91
|
+
register: RegisterCenter;
|
|
75
92
|
}
|
|
76
93
|
}
|