@ibiz-template/runtime 0.1.8 → 0.1.10
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/index.esm.js +4313 -4022
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/out/app-hub.d.ts +8 -0
- package/out/app-hub.d.ts.map +1 -1
- package/out/app-hub.js +8 -0
- package/out/command/app/open-app-view/open-app-view.js +5 -5
- package/out/config/global-config.js +1 -1
- package/out/controller/common/control/control.controller.d.ts +9 -1
- package/out/controller/common/control/control.controller.d.ts.map +1 -1
- package/out/controller/common/control/control.controller.js +17 -7
- package/out/controller/common/view/view.controller.d.ts +1 -0
- package/out/controller/common/view/view.controller.d.ts.map +1 -1
- package/out/controller/common/view/view.controller.js +6 -3
- package/out/controller/hub.controller.d.ts +16 -0
- package/out/controller/hub.controller.d.ts.map +1 -0
- package/out/controller/hub.controller.js +20 -0
- package/out/controller/index.d.ts +1 -0
- package/out/controller/index.d.ts.map +1 -1
- package/out/controller/index.js +1 -0
- package/out/controller/utils/value-rule/value-rule.d.ts.map +1 -1
- package/out/controller/utils/value-rule/value-rule.js +1 -1
- package/out/interface/common/i-app-hub-service/i-app-hub-service.d.ts +9 -0
- package/out/interface/common/i-app-hub-service/i-app-hub-service.d.ts.map +1 -1
- package/out/interface/common/i-ui-action-result/i-ui-action-result.d.ts +7 -0
- package/out/interface/common/i-ui-action-result/i-ui-action-result.d.ts.map +1 -1
- package/out/interface/controller/app.d.ts +37 -0
- package/out/interface/controller/app.d.ts.map +1 -0
- package/out/interface/controller/app.js +1 -0
- package/out/interface/controller/controller/control/i-context-menu.controller.d.ts +15 -0
- package/out/interface/controller/controller/control/i-context-menu.controller.d.ts.map +1 -0
- package/out/interface/controller/controller/control/i-context-menu.controller.js +1 -0
- package/out/interface/controller/controller/control/i-form.controller.d.ts +7 -0
- package/out/interface/controller/controller/control/i-form.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-grid.controller.d.ts +9 -1
- package/out/interface/controller/controller/control/i-grid.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-toolbar.controller.d.ts +2 -2
- package/out/interface/controller/controller/control/i-toolbar.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-tree.controller.d.ts +6 -4
- package/out/interface/controller/controller/control/i-tree.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/control/index.d.ts +1 -0
- package/out/interface/controller/controller/control/index.d.ts.map +1 -1
- package/out/interface/controller/controller/control/index.js +1 -0
- package/out/interface/controller/controller/view/i-view.controller.d.ts +8 -0
- package/out/interface/controller/controller/view/i-view.controller.d.ts.map +1 -1
- package/out/interface/controller/event/control/i-context-menu.event.d.ts +11 -0
- package/out/interface/controller/event/control/i-context-menu.event.d.ts.map +1 -0
- package/out/interface/controller/event/control/i-context-menu.event.js +1 -0
- package/out/interface/controller/event/control/i-pickup-view-panel.event.d.ts +0 -15
- package/out/interface/controller/event/control/i-pickup-view-panel.event.d.ts.map +1 -1
- package/out/interface/controller/event/control/index.d.ts +1 -0
- package/out/interface/controller/event/control/index.d.ts.map +1 -1
- package/out/interface/controller/event/control/index.js +1 -0
- package/out/interface/controller/event/view/i-pickup-md-view.event.d.ts +31 -0
- package/out/interface/controller/event/view/i-pickup-md-view.event.d.ts.map +1 -0
- package/out/interface/controller/event/view/i-pickup-md-view.event.js +1 -0
- package/out/interface/controller/event/view/index.d.ts +1 -0
- package/out/interface/controller/event/view/index.d.ts.map +1 -1
- package/out/interface/controller/event/view/index.js +1 -0
- package/out/interface/controller/index.d.ts +1 -0
- package/out/interface/controller/index.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-context-menu.state.d.ts +11 -0
- package/out/interface/controller/state/control/i-context-menu.state.d.ts.map +1 -0
- package/out/interface/controller/state/control/i-context-menu.state.js +1 -0
- package/out/interface/controller/state/control/i-tree-exp-bar.state.d.ts +8 -0
- package/out/interface/controller/state/control/i-tree-exp-bar.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/i-tree.state.d.ts +1 -10
- package/out/interface/controller/state/control/i-tree.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/index.d.ts +1 -0
- package/out/interface/controller/state/control/index.d.ts.map +1 -1
- package/out/interface/controller/state/control/index.js +1 -0
- package/out/interface/controller/state/view/i-pickup-md-view.state.d.ts +22 -0
- package/out/interface/controller/state/view/i-pickup-md-view.state.d.ts.map +1 -0
- package/out/interface/controller/state/view/i-pickup-md-view.state.js +1 -0
- package/out/interface/controller/state/view/index.d.ts +1 -0
- package/out/interface/controller/state/view/index.d.ts.map +1 -1
- package/out/interface/controller/state/view/index.js +1 -0
- package/out/interface/util/i-open-view-util/i-open-view-util.d.ts +11 -11
- package/out/interface/util/i-open-view-util/i-open-view-util.d.ts.map +1 -1
- package/out/interface/util/script/i-script-function.d.ts +8 -1
- package/out/interface/util/script/i-script-function.d.ts.map +1 -1
- package/out/logic-scheduler/executor/script-executor.d.ts +6 -6
- package/out/logic-scheduler/executor/script-executor.d.ts.map +1 -1
- package/out/logic-scheduler/executor/script-executor.js +10 -14
- package/out/logic-scheduler/trigger/item-dyna-logic-trigger.d.ts +1 -0
- package/out/logic-scheduler/trigger/item-dyna-logic-trigger.d.ts.map +1 -1
- package/out/logic-scheduler/trigger/item-dyna-logic-trigger.js +6 -2
- package/out/logic-scheduler/trigger/logic-trigger.d.ts +8 -0
- package/out/logic-scheduler/trigger/logic-trigger.d.ts.map +1 -1
- package/out/logic-scheduler/trigger/logic-trigger.js +17 -0
- package/out/model/layout/layout.d.ts.map +1 -1
- package/out/model/layout/layout.js +1 -0
- package/out/register/helper/common-register.d.ts +11 -0
- package/out/register/helper/common-register.d.ts.map +1 -0
- package/out/register/helper/common-register.js +20 -0
- package/out/register/helper/control-register.d.ts.map +1 -1
- package/out/register/helper/control-register.js +22 -5
- package/out/register/helper/editor-register.d.ts.map +1 -1
- package/out/register/helper/editor-register.js +25 -5
- package/out/register/helper/form-detail-register.d.ts.map +1 -1
- package/out/register/helper/form-detail-register.js +19 -5
- package/out/register/helper/grid-column-register.d.ts.map +1 -1
- package/out/register/helper/grid-column-register.js +19 -5
- package/out/register/helper/panel-item-register.d.ts.map +1 -1
- package/out/register/helper/panel-item-register.js +25 -5
- package/out/register/helper/portlet-register.d.ts.map +1 -1
- package/out/register/helper/portlet-register.js +19 -5
- package/out/register/helper/ui-action-register.d.ts.map +1 -1
- package/out/register/helper/ui-action-register.js +19 -5
- package/out/register/helper/view-register.d.ts.map +1 -1
- package/out/register/helper/view-register.js +18 -1
- package/out/service/app-data-entity/app-data-entity.d.ts.map +1 -1
- package/out/service/app-data-entity/app-data-entity.js +0 -1
- package/out/service/service/counter/counter.service.d.ts.map +1 -1
- package/out/service/service/counter/counter.service.js +4 -1
- package/out/service/vo/tree-node-data/tree-data-set-node-data.d.ts.map +1 -1
- package/out/service/vo/tree-node-data/tree-data-set-node-data.js +3 -1
- package/out/ui-action/provider/sys-ui-action-provider.d.ts +1 -0
- package/out/ui-action/provider/sys-ui-action-provider.d.ts.map +1 -1
- package/out/ui-action/provider/sys-ui-action-provider.js +42 -1
- package/out/ui-action/provider/ui-action-provider-base.d.ts.map +1 -1
- package/out/ui-action/provider/ui-action-provider-base.js +1 -0
- package/out/ui-action/uiaction-util.d.ts.map +1 -1
- package/out/ui-action/uiaction-util.js +13 -1
- package/out/utils/script/script-function.d.ts +9 -0
- package/out/utils/script/script-function.d.ts.map +1 -1
- package/out/utils/script/script-function.js +75 -1
- package/out/utils/verify/de-rule-verify.js +1 -1
- package/package.json +4 -4
- package/src/app-hub.ts +9 -0
- package/src/command/app/open-app-view/open-app-view.ts +5 -5
- package/src/config/global-config.ts +1 -1
- package/src/controller/common/control/control.controller.ts +19 -9
- package/src/controller/common/view/view.controller.ts +9 -3
- package/src/controller/hub.controller.ts +22 -0
- package/src/controller/index.ts +1 -0
- package/src/controller/utils/value-rule/value-rule.ts +1 -0
- package/src/interface/common/i-app-hub-service/i-app-hub-service.ts +10 -0
- package/src/interface/common/i-ui-action-result/i-ui-action-result.ts +8 -0
- package/src/interface/controller/app.ts +38 -0
- package/src/interface/controller/controller/control/i-context-menu.controller.ts +19 -0
- package/src/interface/controller/controller/control/i-form.controller.ts +8 -0
- package/src/interface/controller/controller/control/i-grid.controller.ts +10 -1
- package/src/interface/controller/controller/control/i-toolbar.controller.ts +6 -3
- package/src/interface/controller/controller/control/i-tree.controller.ts +9 -4
- package/src/interface/controller/controller/control/index.ts +1 -0
- package/src/interface/controller/controller/view/i-view.controller.ts +9 -0
- package/src/interface/controller/event/control/i-context-menu.event.ts +10 -0
- package/src/interface/controller/event/control/i-pickup-view-panel.event.ts +0 -16
- package/src/interface/controller/event/control/index.ts +1 -0
- package/src/interface/controller/event/view/i-pickup-md-view.event.ts +29 -0
- package/src/interface/controller/event/view/index.ts +1 -0
- package/src/interface/controller/index.ts +1 -0
- package/src/interface/controller/state/control/i-context-menu.state.ts +10 -0
- package/src/interface/controller/state/control/i-tree-exp-bar.state.ts +10 -1
- package/src/interface/controller/state/control/i-tree.state.ts +1 -9
- package/src/interface/controller/state/control/index.ts +1 -0
- package/src/interface/controller/state/view/i-pickup-md-view.state.ts +22 -0
- package/src/interface/controller/state/view/index.ts +1 -0
- package/src/interface/util/i-open-view-util/i-open-view-util.ts +11 -11
- package/src/interface/util/script/i-script-function.ts +9 -1
- package/src/logic-scheduler/executor/script-executor.ts +11 -14
- package/src/logic-scheduler/trigger/item-dyna-logic-trigger.ts +8 -2
- package/src/logic-scheduler/trigger/logic-trigger.ts +19 -0
- package/src/model/layout/layout.ts +1 -0
- package/src/register/helper/common-register.ts +28 -0
- package/src/register/helper/control-register.ts +21 -6
- package/src/register/helper/editor-register.ts +22 -7
- package/src/register/helper/form-detail-register.ts +18 -6
- package/src/register/helper/grid-column-register.ts +19 -6
- package/src/register/helper/panel-item-register.ts +22 -6
- package/src/register/helper/portlet-register.ts +19 -6
- package/src/register/helper/ui-action-register.ts +19 -6
- package/src/register/helper/view-register.ts +18 -1
- package/src/service/app-data-entity/app-data-entity.ts +0 -1
- package/src/service/service/counter/counter.service.ts +4 -1
- package/src/service/vo/tree-node-data/tree-data-set-node-data.ts +3 -0
- package/src/ui-action/provider/sys-ui-action-provider.ts +41 -1
- package/src/ui-action/provider/ui-action-provider-base.ts +1 -0
- package/src/ui-action/uiaction-util.ts +12 -1
- package/src/utils/script/script-function.ts +77 -2
- package/src/utils/verify/de-rule-verify.ts +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IIcon } from '../../common';
|
|
2
2
|
import { IMDControlState } from './i-md-control.state';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -37,14 +37,6 @@ export interface ITreeState extends IMDControlState {
|
|
|
37
37
|
* @type {string[]}
|
|
38
38
|
*/
|
|
39
39
|
expandedKeys: string[];
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* 右键上下文菜单状态
|
|
43
|
-
* @author lxm
|
|
44
|
-
* @date 2023-08-01 04:48:11
|
|
45
|
-
* @type {{ [p: string]: IButtonContainerState }}
|
|
46
|
-
*/
|
|
47
|
-
contextMenus: { [p: string]: IButtonContainerState };
|
|
48
40
|
}
|
|
49
41
|
|
|
50
42
|
/**
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IMDViewState } from './i-md-view.state';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 选择多数据视图UI状态
|
|
5
|
+
*
|
|
6
|
+
* @author zk
|
|
7
|
+
* @date 2023-05-25 05:05:43
|
|
8
|
+
* @export
|
|
9
|
+
* @interface IPickupMDViewState
|
|
10
|
+
* @extends {IMDViewState}
|
|
11
|
+
*/
|
|
12
|
+
export interface IPickupMDViewState extends IMDViewState {
|
|
13
|
+
/**
|
|
14
|
+
* 是否单选
|
|
15
|
+
*
|
|
16
|
+
* @author zk
|
|
17
|
+
* @date 2023-08-21 05:08:36
|
|
18
|
+
* @type {boolean}
|
|
19
|
+
* @memberof IPickupMDViewState
|
|
20
|
+
*/
|
|
21
|
+
singleSelect: boolean;
|
|
22
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IModalData
|
|
1
|
+
import { IModalData } from '../../common';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* 打开视图工具类
|
|
@@ -25,13 +25,13 @@ export interface IOpenViewUtil {
|
|
|
25
25
|
*
|
|
26
26
|
* @author chitanda
|
|
27
27
|
* @date 2023-07-12 21:07:51
|
|
28
|
-
* @param {
|
|
28
|
+
* @param {string} appViewId
|
|
29
29
|
* @param {IContext} context
|
|
30
30
|
* @param {IParams} [params]
|
|
31
31
|
* @return {*} {Promise<IModalData>}
|
|
32
32
|
*/
|
|
33
33
|
root(
|
|
34
|
-
|
|
34
|
+
appViewId: string,
|
|
35
35
|
context: IContext,
|
|
36
36
|
params?: IParams,
|
|
37
37
|
): Promise<IModalData>;
|
|
@@ -41,13 +41,13 @@ export interface IOpenViewUtil {
|
|
|
41
41
|
*
|
|
42
42
|
* @author chitanda
|
|
43
43
|
* @date 2022-08-16 20:08:41
|
|
44
|
-
* @param {
|
|
44
|
+
* @param {string} appViewId
|
|
45
45
|
* @param {IContext} [context]
|
|
46
46
|
* @param {IParams} [params]
|
|
47
47
|
* @return {*} {Promise<IModalData>}
|
|
48
48
|
*/
|
|
49
49
|
modal(
|
|
50
|
-
|
|
50
|
+
appViewId: string,
|
|
51
51
|
context: IContext,
|
|
52
52
|
params?: IParams,
|
|
53
53
|
): Promise<IModalData>;
|
|
@@ -57,13 +57,13 @@ export interface IOpenViewUtil {
|
|
|
57
57
|
*
|
|
58
58
|
* @author chitanda
|
|
59
59
|
* @date 2022-08-16 20:08:22
|
|
60
|
-
* @param {
|
|
60
|
+
* @param {string} appViewId
|
|
61
61
|
* @param {IContext} [context]
|
|
62
62
|
* @param {IParams} [params]
|
|
63
63
|
* @return {*} {Promise<IModalData>}
|
|
64
64
|
*/
|
|
65
65
|
popover(
|
|
66
|
-
|
|
66
|
+
appViewId: string,
|
|
67
67
|
event: MouseEvent,
|
|
68
68
|
context: IContext,
|
|
69
69
|
params?: IParams,
|
|
@@ -74,13 +74,13 @@ export interface IOpenViewUtil {
|
|
|
74
74
|
*
|
|
75
75
|
* @author chitanda
|
|
76
76
|
* @date 2022-08-16 20:08:46
|
|
77
|
-
* @param {
|
|
77
|
+
* @param {string} appViewId
|
|
78
78
|
* @param {IContext} [context]
|
|
79
79
|
* @param {IParams} [params]
|
|
80
80
|
* @return {*} {Promise<IModalData>}
|
|
81
81
|
*/
|
|
82
82
|
drawer(
|
|
83
|
-
|
|
83
|
+
appViewId: string,
|
|
84
84
|
context: IContext,
|
|
85
85
|
params?: IParams,
|
|
86
86
|
): Promise<IModalData>;
|
|
@@ -90,13 +90,13 @@ export interface IOpenViewUtil {
|
|
|
90
90
|
*
|
|
91
91
|
* @author chitanda
|
|
92
92
|
* @date 2022-08-16 20:08:29
|
|
93
|
-
* @param {
|
|
93
|
+
* @param {string} appViewId
|
|
94
94
|
* @param {IContext} [context]
|
|
95
95
|
* @param {IParams} [params]
|
|
96
96
|
* @return {*} {Promise<IModalData>}
|
|
97
97
|
*/
|
|
98
98
|
custom(
|
|
99
|
-
|
|
99
|
+
appViewId: string,
|
|
100
100
|
context: IContext,
|
|
101
101
|
params?: IParams,
|
|
102
102
|
): Promise<IModalData>;
|
|
@@ -12,7 +12,7 @@ export interface IScriptFunctionOpts {
|
|
|
12
12
|
* @date 2023-07-25 10:46:18
|
|
13
13
|
* @type {boolean}
|
|
14
14
|
*/
|
|
15
|
-
singleRowReturn
|
|
15
|
+
singleRowReturn?: boolean;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* 预置参数
|
|
@@ -21,4 +21,12 @@ export interface IScriptFunctionOpts {
|
|
|
21
21
|
* @type {IParams}
|
|
22
22
|
*/
|
|
23
23
|
presetParams?: IParams;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 是否是异步函数脚本
|
|
27
|
+
* @author lxm
|
|
28
|
+
* @date 2023-08-21 03:15:43
|
|
29
|
+
* @type {boolean}
|
|
30
|
+
*/
|
|
31
|
+
isAsync?: boolean;
|
|
24
32
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IUILogicParams } from '../../interface';
|
|
1
|
+
import { IScriptFunctionOpts, IUILogicParams } from '../../interface';
|
|
3
2
|
import { ScriptFactory, ScriptFunction } from '../../utils';
|
|
4
3
|
import { LogicExecutor } from './logic-executor';
|
|
5
4
|
|
|
@@ -18,12 +17,12 @@ export class ScriptExecutor extends LogicExecutor {
|
|
|
18
17
|
scriptFn?: ScriptFunction;
|
|
19
18
|
|
|
20
19
|
/**
|
|
21
|
-
*
|
|
20
|
+
* 初始化完成
|
|
22
21
|
* @author lxm
|
|
23
|
-
* @date 2023-
|
|
22
|
+
* @date 2023-08-21 04:27:38
|
|
24
23
|
* @type {boolean}
|
|
25
24
|
*/
|
|
26
|
-
|
|
25
|
+
initialized: boolean = false;
|
|
27
26
|
|
|
28
27
|
/**
|
|
29
28
|
* 执行参数转换成脚本执行作用域参数
|
|
@@ -32,8 +31,9 @@ export class ScriptExecutor extends LogicExecutor {
|
|
|
32
31
|
* @param {IUILogicParams} _executeParams
|
|
33
32
|
* @return {*} {IData[]}
|
|
34
33
|
*/
|
|
35
|
-
convertScriptArgs(
|
|
36
|
-
|
|
34
|
+
convertScriptArgs(executeParams: IUILogicParams): IData {
|
|
35
|
+
// 默认不特殊处理的不转换
|
|
36
|
+
return executeParams;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
/**
|
|
@@ -46,16 +46,13 @@ export class ScriptExecutor extends LogicExecutor {
|
|
|
46
46
|
init(
|
|
47
47
|
paramKeys: string[],
|
|
48
48
|
convertFun: (executeParams: IUILogicParams) => IData,
|
|
49
|
+
options?: IScriptFunctionOpts,
|
|
49
50
|
): void {
|
|
50
51
|
this.convertScriptArgs = convertFun;
|
|
51
|
-
|
|
52
|
-
if (this.isRowReturn) {
|
|
53
|
-
code = `return (${code})`;
|
|
54
|
-
}
|
|
52
|
+
const code = this.logic.scriptCode!;
|
|
55
53
|
// eslint-disable-next-line no-new-func
|
|
56
|
-
this.scriptFn = ScriptFactory.createScriptFn(paramKeys, code,
|
|
57
|
-
|
|
58
|
-
});
|
|
54
|
+
this.scriptFn = ScriptFactory.createScriptFn(paramKeys, code, options);
|
|
55
|
+
this.initialized = true;
|
|
59
56
|
}
|
|
60
57
|
|
|
61
58
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -16,8 +16,10 @@ export class ItemDynaLogicTrigger extends LogicTrigger {
|
|
|
16
16
|
`预定义逻辑类型${this.type}的触发器类型只能是脚本`,
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
bindScriptExecutor(executor: ScriptExecutor): void {
|
|
22
|
+
executor.init(
|
|
21
23
|
['context', 'viewparams', 'data', 'env'],
|
|
22
24
|
executeParams => {
|
|
23
25
|
const { context, params, data } = executeParams;
|
|
@@ -28,6 +30,10 @@ export class ItemDynaLogicTrigger extends LogicTrigger {
|
|
|
28
30
|
env: ibiz.env,
|
|
29
31
|
};
|
|
30
32
|
},
|
|
33
|
+
{
|
|
34
|
+
singleRowReturn: true,
|
|
35
|
+
isAsync: false,
|
|
36
|
+
},
|
|
31
37
|
);
|
|
32
38
|
}
|
|
33
39
|
|
|
@@ -6,6 +6,7 @@ import type {
|
|
|
6
6
|
TriggerType,
|
|
7
7
|
} from '../../interface';
|
|
8
8
|
import { LogicExecutor } from '../executor/logic-executor';
|
|
9
|
+
import { ScriptExecutor } from '../executor/script-executor';
|
|
9
10
|
import { LogicScheduler } from '../scheduler/logic-scheduler';
|
|
10
11
|
|
|
11
12
|
/**
|
|
@@ -51,6 +52,24 @@ export class LogicTrigger {
|
|
|
51
52
|
*/
|
|
52
53
|
bindExecutor(executor: LogicExecutor): void {
|
|
53
54
|
this.executor = executor;
|
|
55
|
+
if (this.executor.type === 'SCRIPT') {
|
|
56
|
+
this.bindScriptExecutor(executor as ScriptExecutor);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* 绑定脚本执行器
|
|
62
|
+
* @author lxm
|
|
63
|
+
* @date 2023-08-21 04:33:35
|
|
64
|
+
* @param {ScriptExecutor} executor
|
|
65
|
+
*/
|
|
66
|
+
bindScriptExecutor(executor: ScriptExecutor): void {
|
|
67
|
+
if (!executor.initialized) {
|
|
68
|
+
executor.init([], executeParams => executeParams, {
|
|
69
|
+
isAsync: true,
|
|
70
|
+
singleRowReturn: false,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
54
73
|
}
|
|
55
74
|
|
|
56
75
|
/**
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取插件的注册唯一标识
|
|
3
|
+
* @author lxm
|
|
4
|
+
* @date 2023-08-23 11:04:04
|
|
5
|
+
* @export
|
|
6
|
+
* @param {string} pluginId
|
|
7
|
+
* @param {string} [appId]
|
|
8
|
+
* @return {*} {string}
|
|
9
|
+
*/
|
|
10
|
+
export async function getPluginRegisterKey(
|
|
11
|
+
pluginId: string,
|
|
12
|
+
appId?: string,
|
|
13
|
+
): Promise<string | undefined> {
|
|
14
|
+
const app = ibiz.hub.getApp(appId);
|
|
15
|
+
|
|
16
|
+
const plugin = app.model.appPFPluginRefs?.find(
|
|
17
|
+
item => item.pluginCode!.toLowerCase() === pluginId,
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
if (!plugin) {
|
|
21
|
+
ibiz.log.error(`找不到${pluginId}的插件模型`);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
await ibiz.plugin.loadPlugin(plugin);
|
|
26
|
+
|
|
27
|
+
return `${plugin.pluginType}_${plugin.pluginCode}`;
|
|
28
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IControl } from '@ibiz/model-core';
|
|
2
2
|
import { IControlProvider } from '../../interface';
|
|
3
|
+
import { getPluginRegisterKey } from './common-register';
|
|
3
4
|
|
|
4
5
|
/** 部件适配器前缀 */
|
|
5
6
|
export const CONTROL_PROVIDER_PREFIX = 'CONTROL';
|
|
@@ -37,7 +38,21 @@ export async function getControlProvider(
|
|
|
37
38
|
model: IControl,
|
|
38
39
|
): Promise<IControlProvider | undefined> {
|
|
39
40
|
let provider: IControlProvider | undefined;
|
|
40
|
-
const { controlType, controlStyle } =
|
|
41
|
+
const { controlType, controlStyle, sysPFPluginId, appId } =
|
|
42
|
+
model as Required<IControl>;
|
|
43
|
+
|
|
44
|
+
// 找插件适配器
|
|
45
|
+
if (sysPFPluginId) {
|
|
46
|
+
const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId);
|
|
47
|
+
if (pluginKey) {
|
|
48
|
+
provider = getProvider(pluginKey);
|
|
49
|
+
}
|
|
50
|
+
if (!provider) {
|
|
51
|
+
ibiz.log.error(`找不到部件插件${pluginKey}对应的适配器`);
|
|
52
|
+
} else {
|
|
53
|
+
return provider;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
41
56
|
|
|
42
57
|
// 再找部件类型和部件样式
|
|
43
58
|
if (controlStyle && controlStyle !== 'DEFAULT') {
|
|
@@ -48,17 +63,17 @@ export async function getControlProvider(
|
|
|
48
63
|
`找不到部件类型:[${controlType}]的部件样式:[${controlStyle}]对应的适配器`,
|
|
49
64
|
model,
|
|
50
65
|
);
|
|
66
|
+
} else {
|
|
67
|
+
return provider;
|
|
51
68
|
}
|
|
52
69
|
}
|
|
53
70
|
|
|
54
71
|
// 找部件类型
|
|
55
|
-
|
|
56
|
-
provider = getProvider(controlType);
|
|
57
|
-
}
|
|
72
|
+
provider = getProvider(controlType);
|
|
58
73
|
|
|
59
74
|
if (!provider) {
|
|
60
75
|
ibiz.log.error(`找不到部件类型${controlType}对应的适配器`);
|
|
76
|
+
} else {
|
|
77
|
+
return provider;
|
|
61
78
|
}
|
|
62
|
-
|
|
63
|
-
return provider;
|
|
64
79
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IEditor } from '@ibiz/model-core';
|
|
2
2
|
import { IEditorProvider } from '../../interface';
|
|
3
|
+
import { getPluginRegisterKey } from './common-register';
|
|
3
4
|
|
|
4
5
|
/** 编辑器适配器前缀 */
|
|
5
6
|
export const EDITOR_PROVIDER_PREFIX = 'EDITOR';
|
|
@@ -37,9 +38,22 @@ export async function getEditorProvider(
|
|
|
37
38
|
model: IEditor,
|
|
38
39
|
): Promise<IEditorProvider | undefined> {
|
|
39
40
|
let provider: IEditorProvider | undefined;
|
|
40
|
-
const { editorType, editorStyle, predefinedType } =
|
|
41
|
+
const { editorType, editorStyle, predefinedType, sysPFPluginId, appId } =
|
|
41
42
|
model as Required<IEditor>;
|
|
42
43
|
|
|
44
|
+
// 找插件适配器
|
|
45
|
+
if (sysPFPluginId) {
|
|
46
|
+
const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId);
|
|
47
|
+
if (pluginKey) {
|
|
48
|
+
provider = getProvider(pluginKey);
|
|
49
|
+
}
|
|
50
|
+
if (!provider) {
|
|
51
|
+
ibiz.log.error(`找不到编辑器插件${pluginKey}对应的适配器`);
|
|
52
|
+
} else {
|
|
53
|
+
return provider;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
43
57
|
// 再找编辑器类型和编辑器样式
|
|
44
58
|
if (editorStyle && editorStyle !== 'DEFAULT') {
|
|
45
59
|
const key = `${editorType}_${editorStyle}`;
|
|
@@ -49,6 +63,8 @@ export async function getEditorProvider(
|
|
|
49
63
|
`找不到编辑器类型:[${editorType}]的编辑器样式:[${editorStyle}]对应的适配器`,
|
|
50
64
|
model,
|
|
51
65
|
);
|
|
66
|
+
} else {
|
|
67
|
+
return provider;
|
|
52
68
|
}
|
|
53
69
|
}
|
|
54
70
|
|
|
@@ -64,17 +80,16 @@ export async function getEditorProvider(
|
|
|
64
80
|
`找不到编辑器类型:[${editorType}]的预置类型:[${predefinedType}]对应的适配器`,
|
|
65
81
|
model,
|
|
66
82
|
);
|
|
83
|
+
} else {
|
|
84
|
+
return provider;
|
|
67
85
|
}
|
|
68
86
|
}
|
|
69
87
|
|
|
70
88
|
// 找编辑器类型
|
|
71
|
-
|
|
72
|
-
provider = getProvider(editorType);
|
|
73
|
-
}
|
|
74
|
-
|
|
89
|
+
provider = getProvider(editorType);
|
|
75
90
|
if (!provider) {
|
|
76
91
|
ibiz.log.error(`找不到编辑器类型${editorType}对应的适配器`);
|
|
92
|
+
} else {
|
|
93
|
+
return provider;
|
|
77
94
|
}
|
|
78
|
-
|
|
79
|
-
return provider;
|
|
80
95
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IDEFormDetail } from '@ibiz/model-core';
|
|
2
2
|
import { IFormDetailProvider } from '../../interface';
|
|
3
|
+
import { getPluginRegisterKey } from './common-register';
|
|
3
4
|
|
|
4
5
|
/** 表单成员适配器前缀 */
|
|
5
6
|
export const FORMDETAIL_PROVIDER_PREFIX = 'FORMDETAIL';
|
|
@@ -37,15 +38,26 @@ export async function getFormDetailProvider(
|
|
|
37
38
|
model: IDEFormDetail,
|
|
38
39
|
): Promise<IFormDetailProvider | undefined> {
|
|
39
40
|
let provider: IFormDetailProvider | undefined;
|
|
40
|
-
const { detailType } = model as Required<IDEFormDetail>;
|
|
41
|
+
const { detailType, sysPFPluginId, appId } = model as Required<IDEFormDetail>;
|
|
41
42
|
|
|
42
|
-
//
|
|
43
|
-
if (
|
|
44
|
-
|
|
43
|
+
// 找插件适配器
|
|
44
|
+
if (sysPFPluginId) {
|
|
45
|
+
const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId);
|
|
46
|
+
if (pluginKey) {
|
|
47
|
+
provider = getProvider(pluginKey);
|
|
48
|
+
}
|
|
49
|
+
if (!provider) {
|
|
50
|
+
ibiz.log.error(`找不到表单成员插件${pluginKey}对应的适配器`);
|
|
51
|
+
} else {
|
|
52
|
+
return provider;
|
|
53
|
+
}
|
|
45
54
|
}
|
|
55
|
+
|
|
56
|
+
// 找表单成员类型
|
|
57
|
+
provider = getProvider(detailType);
|
|
46
58
|
if (!provider) {
|
|
47
59
|
ibiz.log.error(`找不到表单成员类型${detailType}对应的适配器`);
|
|
60
|
+
} else {
|
|
61
|
+
return provider;
|
|
48
62
|
}
|
|
49
|
-
|
|
50
|
-
return provider;
|
|
51
63
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IDEGridColumn } from '@ibiz/model-core';
|
|
2
2
|
import { IGridColumnProvider } from '../../interface';
|
|
3
|
+
import { getPluginRegisterKey } from './common-register';
|
|
3
4
|
|
|
4
5
|
/** 表格列适配器前缀 */
|
|
5
6
|
export const GRIDCOLUMN_PROVIDER_PREFIX = 'GRIDCOLUMN';
|
|
@@ -37,16 +38,28 @@ export async function getGridColumnProvider(
|
|
|
37
38
|
model: IDEGridColumn,
|
|
38
39
|
): Promise<IGridColumnProvider | undefined> {
|
|
39
40
|
let provider: IGridColumnProvider | undefined;
|
|
40
|
-
const { columnType, enableRowEdit } =
|
|
41
|
+
const { columnType, enableRowEdit, sysPFPluginId, appId } =
|
|
42
|
+
model as Required<IDEGridColumn>;
|
|
43
|
+
|
|
44
|
+
// 找插件适配器
|
|
45
|
+
if (sysPFPluginId) {
|
|
46
|
+
const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId);
|
|
47
|
+
if (pluginKey) {
|
|
48
|
+
provider = getProvider(pluginKey);
|
|
49
|
+
}
|
|
50
|
+
if (!provider) {
|
|
51
|
+
ibiz.log.error(`找不到表格列插件${pluginKey}对应的适配器`);
|
|
52
|
+
} else {
|
|
53
|
+
return provider;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
41
56
|
|
|
42
57
|
const key = enableRowEdit ? `${columnType!}_EDIT` : columnType!;
|
|
43
58
|
// 找表格列类型
|
|
44
|
-
|
|
45
|
-
provider = getProvider(key);
|
|
46
|
-
}
|
|
59
|
+
provider = getProvider(key);
|
|
47
60
|
if (!provider) {
|
|
48
61
|
ibiz.log.error(`找不到表格列类型${key}对应的适配器`);
|
|
62
|
+
} else {
|
|
63
|
+
return provider;
|
|
49
64
|
}
|
|
50
|
-
|
|
51
|
-
return provider;
|
|
52
65
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IPanelContainer, IPanelItem, IPanelRawItem } from '@ibiz/model-core';
|
|
2
2
|
import { IPanelItemProvider } from '../../interface';
|
|
3
|
+
import { getPluginRegisterKey } from './common-register';
|
|
3
4
|
|
|
4
5
|
/** 面板成员适配器前缀 */
|
|
5
6
|
export const PANELITEM_PROVIDER_PREFIX = 'PANELITEM';
|
|
@@ -40,7 +41,20 @@ export async function getPanelItemProvider(
|
|
|
40
41
|
model: IPanelItem,
|
|
41
42
|
): Promise<IPanelItemProvider | undefined> {
|
|
42
43
|
let provider: IPanelItemProvider | undefined;
|
|
43
|
-
const { itemType } = model as Required<IPanelItem>;
|
|
44
|
+
const { itemType, sysPFPluginId, appId } = model as Required<IPanelItem>;
|
|
45
|
+
|
|
46
|
+
// 找插件适配器
|
|
47
|
+
if (sysPFPluginId) {
|
|
48
|
+
const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId);
|
|
49
|
+
if (pluginKey) {
|
|
50
|
+
provider = getProvider(pluginKey);
|
|
51
|
+
}
|
|
52
|
+
if (!provider) {
|
|
53
|
+
ibiz.log.error(`找不到面板成员插件${pluginKey}对应的适配器`);
|
|
54
|
+
} else {
|
|
55
|
+
return provider;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
44
58
|
|
|
45
59
|
// 特殊容器类型
|
|
46
60
|
if (itemType === 'CONTAINER') {
|
|
@@ -50,6 +64,8 @@ export async function getPanelItemProvider(
|
|
|
50
64
|
provider = getProvider(key);
|
|
51
65
|
if (!provider) {
|
|
52
66
|
ibiz.log.error(`找不到面板容器预置类型为${predefinedType}的适配器`);
|
|
67
|
+
} else {
|
|
68
|
+
return provider;
|
|
53
69
|
}
|
|
54
70
|
}
|
|
55
71
|
|
|
@@ -63,16 +79,16 @@ export async function getPanelItemProvider(
|
|
|
63
79
|
ibiz.log.error(
|
|
64
80
|
`找不到面板成员直接内容预置类型为${predefinedType}的适配器`,
|
|
65
81
|
);
|
|
82
|
+
} else {
|
|
83
|
+
return provider;
|
|
66
84
|
}
|
|
67
85
|
}
|
|
68
86
|
|
|
69
87
|
// 找面板成员类型
|
|
70
|
-
|
|
71
|
-
provider = getProvider(itemType);
|
|
72
|
-
}
|
|
88
|
+
provider = getProvider(itemType);
|
|
73
89
|
if (!provider) {
|
|
74
90
|
ibiz.log.error(`找不到面板成员类型${itemType}对应的适配器`);
|
|
91
|
+
} else {
|
|
92
|
+
return provider;
|
|
75
93
|
}
|
|
76
|
-
|
|
77
|
-
return provider;
|
|
78
94
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IDBPortletPart } from '@ibiz/model-core';
|
|
2
2
|
import { IPortletProvider } from '../../interface';
|
|
3
|
+
import { getPluginRegisterKey } from './common-register';
|
|
3
4
|
|
|
4
5
|
/** 门户部件成员适配器前缀 */
|
|
5
6
|
export const PORTLET_PROVIDER_PREFIX = 'PORTLET';
|
|
@@ -37,15 +38,27 @@ export async function getPortletProvider(
|
|
|
37
38
|
model: IDBPortletPart,
|
|
38
39
|
): Promise<IPortletProvider | undefined> {
|
|
39
40
|
let provider: IPortletProvider | undefined;
|
|
40
|
-
const { portletType } =
|
|
41
|
+
const { portletType, sysPFPluginId, appId } =
|
|
42
|
+
model as Required<IDBPortletPart>;
|
|
41
43
|
|
|
42
|
-
//
|
|
43
|
-
if (
|
|
44
|
-
|
|
44
|
+
// 找插件适配器
|
|
45
|
+
if (sysPFPluginId) {
|
|
46
|
+
const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId);
|
|
47
|
+
if (pluginKey) {
|
|
48
|
+
provider = getProvider(pluginKey);
|
|
49
|
+
}
|
|
50
|
+
if (!provider) {
|
|
51
|
+
ibiz.log.error(`找不到门户部件插件${pluginKey}对应的适配器`);
|
|
52
|
+
} else {
|
|
53
|
+
return provider;
|
|
54
|
+
}
|
|
45
55
|
}
|
|
56
|
+
|
|
57
|
+
// 找门户部件成员类型
|
|
58
|
+
provider = getProvider(portletType);
|
|
46
59
|
if (!provider) {
|
|
47
60
|
ibiz.log.error(`找不到门户部件成员类型${portletType}对应的适配器`);
|
|
61
|
+
} else {
|
|
62
|
+
return provider;
|
|
48
63
|
}
|
|
49
|
-
|
|
50
|
-
return provider;
|
|
51
64
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { RuntimeError } from '@ibiz-template/core';
|
|
2
2
|
import { IAppUIAction } from '@ibiz/model-core';
|
|
3
3
|
import { IUIActionProvider } from '../../interface';
|
|
4
|
+
import { getPluginRegisterKey } from './common-register';
|
|
4
5
|
|
|
5
6
|
/** 界面行为适配器前缀 */
|
|
6
7
|
export const UIACTION_PROVIDER_PREFIX = 'UIACTION';
|
|
@@ -38,15 +39,27 @@ export async function getUIActionProvider(
|
|
|
38
39
|
model: IAppUIAction,
|
|
39
40
|
): Promise<IUIActionProvider> {
|
|
40
41
|
let provider: IUIActionProvider | undefined;
|
|
41
|
-
const { uiactionMode } =
|
|
42
|
+
const { uiactionMode, sysPFPluginId, appId } =
|
|
43
|
+
model as Required<IAppUIAction>;
|
|
42
44
|
|
|
43
|
-
//
|
|
44
|
-
if (
|
|
45
|
-
|
|
45
|
+
// 找插件适配器
|
|
46
|
+
if (sysPFPluginId) {
|
|
47
|
+
const pluginKey = await getPluginRegisterKey(sysPFPluginId, appId);
|
|
48
|
+
if (pluginKey) {
|
|
49
|
+
provider = getProvider(pluginKey);
|
|
50
|
+
}
|
|
51
|
+
if (!provider) {
|
|
52
|
+
ibiz.log.error(`找不到界面行为插件${pluginKey}对应的适配器`);
|
|
53
|
+
} else {
|
|
54
|
+
return provider;
|
|
55
|
+
}
|
|
46
56
|
}
|
|
57
|
+
|
|
58
|
+
// 找界面行为类型
|
|
59
|
+
provider = getProvider(uiactionMode);
|
|
47
60
|
if (!provider) {
|
|
48
61
|
throw new RuntimeError(`找不界面行为模式${uiactionMode}对应的适配器`);
|
|
62
|
+
} else {
|
|
63
|
+
return provider;
|
|
49
64
|
}
|
|
50
|
-
|
|
51
|
-
return provider;
|
|
52
65
|
}
|