@ibiz-template/runtime 0.1.16 → 0.1.17
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 +281 -125
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/out/controller/common/view/view.controller.d.ts.map +1 -1
- package/out/controller/common/view/view.controller.js +5 -1
- package/out/controller/control/form/edit-form/edit-form.service.d.ts +8 -0
- package/out/controller/control/form/edit-form/edit-form.service.d.ts.map +1 -1
- package/out/controller/control/form/edit-form/edit-form.service.js +23 -21
- package/out/controller/control/form/form-detail/form-item/form-item.controller.d.ts +9 -0
- package/out/controller/control/form/form-detail/form-item/form-item.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-item/form-item.controller.js +11 -0
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-grid/form-mdctrl-repeater-grid.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-grid/form-mdctrl-repeater-grid.controller.js +2 -1
- package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.controller.js +16 -8
- package/out/controller/control/grid/grid/grid.service.d.ts.map +1 -1
- package/out/controller/control/grid/grid/grid.service.js +2 -1
- package/out/de-logic/de-logic-context.d.ts +21 -0
- package/out/de-logic/de-logic-context.d.ts.map +1 -1
- package/out/de-logic/de-logic-context.js +22 -0
- package/out/de-logic/de-logic-param/de-logic-param.d.ts.map +1 -1
- package/out/de-logic/de-logic-param/de-logic-param.js +2 -1
- package/out/interface/controller/controller/editor/i-editor-container.controller.d.ts +8 -0
- package/out/interface/controller/controller/editor/i-editor-container.controller.d.ts.map +1 -1
- package/out/interface/controller/event/view/i-form-pickup-data-view.event.d.ts +13 -0
- package/out/interface/controller/event/view/i-form-pickup-data-view.event.d.ts.map +1 -0
- package/out/interface/controller/event/view/i-form-pickup-data-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/state/view/i-form-pickup-data-view.state.d.ts +13 -0
- package/out/interface/controller/state/view/i-form-pickup-data-view.state.d.ts.map +1 -0
- package/out/interface/controller/state/view/i-form-pickup-data-view.state.js +1 -0
- package/out/interface/controller/state/view/i-view.state.d.ts +7 -0
- package/out/interface/controller/state/view/i-view.state.d.ts.map +1 -1
- 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-modal-util/i-modal-util.d.ts +35 -0
- package/out/interface/util/i-modal-util/i-modal-util.d.ts.map +1 -1
- package/out/model/layout/layout.d.ts +1 -1
- package/out/model/layout/layout.d.ts.map +1 -1
- package/out/model/layout/layout.js +2 -2
- package/out/service/dto/method.dto.d.ts +0 -1
- package/out/service/dto/method.dto.d.ts.map +1 -1
- package/out/service/dto/method.dto.js +1 -6
- package/out/service/service/control/control.service.d.ts +0 -9
- package/out/service/service/control/control.service.d.ts.map +1 -1
- package/out/service/service/entity/method/de-action.d.ts +10 -0
- package/out/service/service/entity/method/de-action.d.ts.map +1 -1
- package/out/service/service/entity/method/de-action.js +12 -0
- package/out/service/service/entity/method/fetch.d.ts +1 -0
- package/out/service/service/entity/method/fetch.d.ts.map +1 -1
- package/out/service/service/entity/method/fetch.js +4 -0
- package/out/service/service/entity/method/method.d.ts +0 -10
- package/out/service/service/entity/method/method.d.ts.map +1 -1
- package/out/service/service/entity/method/method.js +0 -12
- package/out/ui-logic/ui-logic-context.d.ts +21 -0
- package/out/ui-logic/ui-logic-context.d.ts.map +1 -1
- package/out/ui-logic/ui-logic-context.js +22 -0
- package/out/ui-logic/ui-logic-node/debug-param-node/debug-param-node.d.ts +17 -0
- package/out/ui-logic/ui-logic-node/debug-param-node/debug-param-node.d.ts.map +1 -0
- package/out/ui-logic/ui-logic-node/debug-param-node/debug-param-node.js +21 -0
- package/out/ui-logic/ui-logic-node/index.d.ts +2 -0
- package/out/ui-logic/ui-logic-node/index.d.ts.map +1 -1
- package/out/ui-logic/ui-logic-node/index.js +2 -0
- package/out/ui-logic/ui-logic-node/msg-box-node/msg-box-node.d.ts +23 -0
- package/out/ui-logic/ui-logic-node/msg-box-node/msg-box-node.d.ts.map +1 -0
- package/out/ui-logic/ui-logic-node/msg-box-node/msg-box-node.js +79 -0
- package/out/ui-logic/ui-logic-param/ui-logic-param.d.ts.map +1 -1
- package/out/ui-logic/ui-logic-param/ui-logic-param.js +2 -1
- package/out/ui-logic/ui-logic.d.ts.map +1 -1
- package/out/ui-logic/ui-logic.js +7 -3
- package/package.json +2 -2
- package/src/controller/common/view/view.controller.ts +5 -1
- package/src/controller/control/form/edit-form/edit-form.service.ts +24 -22
- package/src/controller/control/form/form-detail/form-item/form-item.controller.ts +12 -0
- package/src/controller/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-grid/form-mdctrl-repeater-grid.controller.ts +2 -1
- package/src/controller/control/grid/grid/grid.controller.ts +21 -14
- package/src/controller/control/grid/grid/grid.service.ts +4 -1
- package/src/de-logic/de-logic-context.ts +32 -0
- package/src/de-logic/de-logic-param/de-logic-param.ts +2 -1
- package/src/interface/controller/controller/editor/i-editor-container.controller.ts +9 -0
- package/src/interface/controller/event/view/i-form-pickup-data-view.event.ts +12 -0
- package/src/interface/controller/event/view/index.ts +1 -0
- package/src/interface/controller/state/view/i-form-pickup-data-view.state.ts +12 -0
- package/src/interface/controller/state/view/i-view.state.ts +8 -0
- package/src/interface/controller/state/view/index.ts +1 -0
- package/src/interface/util/i-modal-util/i-modal-util.ts +41 -0
- package/src/model/layout/layout.ts +5 -3
- package/src/service/dto/method.dto.ts +1 -7
- package/src/service/service/control/control.service.ts +0 -10
- package/src/service/service/entity/method/de-action.ts +13 -0
- package/src/service/service/entity/method/fetch.ts +5 -0
- package/src/service/service/entity/method/method.ts +0 -13
- package/src/ui-logic/ui-logic-context.ts +32 -0
- package/src/ui-logic/ui-logic-node/debug-param-node/debug-param-node.ts +26 -0
- package/src/ui-logic/ui-logic-node/index.ts +2 -0
- package/src/ui-logic/ui-logic-node/msg-box-node/msg-box-node.ts +87 -0
- package/src/ui-logic/ui-logic-param/ui-logic-param.ts +2 -1
- package/src/ui-logic/ui-logic.ts +8 -2
|
@@ -31,6 +31,7 @@ import { ControlVO, Srfuf } from '../../../../service';
|
|
|
31
31
|
import { MDControlController } from '../../../common';
|
|
32
32
|
import { GridNotifyState } from '../../../constant';
|
|
33
33
|
import { isValueChange } from '../../../utils';
|
|
34
|
+
import { ScriptFactory } from '../../../../utils';
|
|
34
35
|
|
|
35
36
|
/**
|
|
36
37
|
* 表格控制器
|
|
@@ -803,22 +804,28 @@ export class GridController
|
|
|
803
804
|
throw new RuntimeError(`没找到${updateId}编辑列更新`);
|
|
804
805
|
}
|
|
805
806
|
|
|
806
|
-
const { appDEMethodId, degeiupdateDetails } =
|
|
807
|
+
const { appDEMethodId, degeiupdateDetails, customCode, scriptCode } =
|
|
808
|
+
findUpdate;
|
|
807
809
|
const updateItems = degeiupdateDetails!.map(item => item.id!);
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
params,
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
updateItems.map(itemName => {
|
|
819
|
-
return this.setRowValue(row, itemName, result[itemName]);
|
|
820
|
-
}),
|
|
810
|
+
if (customCode && scriptCode) {
|
|
811
|
+
ScriptFactory.execScriptFn({ data: row.data }, scriptCode, {
|
|
812
|
+
isAsync: false,
|
|
813
|
+
});
|
|
814
|
+
} else {
|
|
815
|
+
const params = { ...this.params, ...row.data.getOrigin() };
|
|
816
|
+
const res = await this.service.updateGridEditItem(
|
|
817
|
+
appDEMethodId!,
|
|
818
|
+
this.context,
|
|
819
|
+
params,
|
|
821
820
|
);
|
|
821
|
+
const result = res.data;
|
|
822
|
+
if (result && updateItems?.length) {
|
|
823
|
+
await Promise.all(
|
|
824
|
+
updateItems.map(itemName => {
|
|
825
|
+
return this.setRowValue(row, itemName, result![itemName]);
|
|
826
|
+
}),
|
|
827
|
+
);
|
|
828
|
+
}
|
|
822
829
|
}
|
|
823
830
|
}
|
|
824
831
|
|
|
@@ -64,7 +64,10 @@ export class GridService extends MDControlService<IDEGrid> {
|
|
|
64
64
|
context: IParams,
|
|
65
65
|
params: IParams = {},
|
|
66
66
|
): Promise<IHttpResponse<ControlVO>> {
|
|
67
|
-
|
|
67
|
+
const entityService = await this.app.deService.getService(
|
|
68
|
+
this.model.appDataEntityId!,
|
|
69
|
+
);
|
|
70
|
+
let res = await entityService.exec(methodName, context, params);
|
|
68
71
|
res = this.handleResponse(res);
|
|
69
72
|
return res as IHttpResponse<ControlVO>;
|
|
70
73
|
}
|
|
@@ -9,6 +9,14 @@ import { DELogicParam } from './de-logic-param/de-logic-param';
|
|
|
9
9
|
* @class DELogicContext
|
|
10
10
|
*/
|
|
11
11
|
export class DELogicContext {
|
|
12
|
+
/**
|
|
13
|
+
* 上一次返回值
|
|
14
|
+
* @author lxm
|
|
15
|
+
* @date 2023-09-04 09:22:52
|
|
16
|
+
* @type {unknown}
|
|
17
|
+
*/
|
|
18
|
+
lastReturn: unknown;
|
|
19
|
+
|
|
12
20
|
/**
|
|
13
21
|
* Creates an instance of DELogicContext.
|
|
14
22
|
* @author lxm
|
|
@@ -82,4 +90,28 @@ export class DELogicContext {
|
|
|
82
90
|
* @type {string}
|
|
83
91
|
*/
|
|
84
92
|
defaultParamName: string = 'Default';
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* 设置上一次返回值
|
|
96
|
+
* @author lxm
|
|
97
|
+
* @date 2023-09-04 09:23:52
|
|
98
|
+
* @param {unknown} value
|
|
99
|
+
*/
|
|
100
|
+
setLastReturn(value: unknown): void {
|
|
101
|
+
this.lastReturn = value;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* 初始化上一次返回参数类型的逻辑参数
|
|
106
|
+
* @author lxm
|
|
107
|
+
* @date 2023-09-04 09:52:00
|
|
108
|
+
* @param {string} tag
|
|
109
|
+
*/
|
|
110
|
+
initLastReturnParam(tag: string): void {
|
|
111
|
+
Object.defineProperty(this.params, tag, {
|
|
112
|
+
enumerable: true,
|
|
113
|
+
configurable: true,
|
|
114
|
+
get: () => this.lastReturn,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
85
117
|
}
|
|
@@ -48,7 +48,8 @@ export class DELogicParam {
|
|
|
48
48
|
// 数据对象变量
|
|
49
49
|
ctx.params[tag] = {};
|
|
50
50
|
} else if (m.lastReturnParam) {
|
|
51
|
-
|
|
51
|
+
// 上一次调用返回
|
|
52
|
+
ctx.initLastReturnParam(tag);
|
|
52
53
|
} else if (m.appContextParam) {
|
|
53
54
|
// 应用上下文
|
|
54
55
|
ctx.params[tag] = ctx.context;
|
|
@@ -37,4 +37,13 @@ export interface IEditorContainerController {
|
|
|
37
37
|
* @type {IParams}
|
|
38
38
|
*/
|
|
39
39
|
params: IParams;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* 数据类型
|
|
43
|
+
*
|
|
44
|
+
* @author zhanghengfeng
|
|
45
|
+
* @date 2023-09-01 11:09:38
|
|
46
|
+
* @type {(number | undefined)}
|
|
47
|
+
*/
|
|
48
|
+
dataType: number | undefined;
|
|
40
49
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IPickupDataViewEvent } from './i-pickup-data-view.event';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 表单选择数据视图事件
|
|
5
|
+
*
|
|
6
|
+
* @author zk
|
|
7
|
+
* @date 2023-09-01 02:09:26
|
|
8
|
+
* @export
|
|
9
|
+
* @interface IFormPickupDataViewEvent
|
|
10
|
+
* @extends {IMDViewEvent}
|
|
11
|
+
*/
|
|
12
|
+
export interface IFormPickupDataViewEvent extends IPickupDataViewEvent {}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IPickupDataViewState } from './i-pickup-data-view.state';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 表单选择数据视图UI状态
|
|
5
|
+
*
|
|
6
|
+
* @author zk
|
|
7
|
+
* @date 2023-09-01 02:09:26
|
|
8
|
+
* @export
|
|
9
|
+
* @interface IFormPickupDataViewState
|
|
10
|
+
* @extends {IMDViewState}
|
|
11
|
+
*/
|
|
12
|
+
export interface IFormPickupDataViewState extends IPickupDataViewState {}
|
|
@@ -32,4 +32,12 @@ export interface IViewState extends IControllerState, IViewSession {
|
|
|
32
32
|
* @type {boolean}
|
|
33
33
|
*/
|
|
34
34
|
noLoadDefault: boolean;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* 设置关闭视图时返回给外面的状态
|
|
38
|
+
* @author lxm
|
|
39
|
+
* @date 2023-09-01 10:37:46
|
|
40
|
+
* @type {boolean}
|
|
41
|
+
*/
|
|
42
|
+
closeOK?: boolean;
|
|
35
43
|
}
|
|
@@ -23,6 +23,47 @@ export interface ModalParams {
|
|
|
23
23
|
* @type {string}
|
|
24
24
|
*/
|
|
25
25
|
desc?: string;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 显示确认按钮(默认显示)
|
|
29
|
+
* @author lxm
|
|
30
|
+
* @date 2023-09-04 05:37:59
|
|
31
|
+
* @type {boolean}
|
|
32
|
+
*/
|
|
33
|
+
showConfirmButton?: boolean;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* 是否显示取消按钮
|
|
37
|
+
* @author lxm
|
|
38
|
+
* @date 2023-09-04 05:38:49
|
|
39
|
+
* @type {boolean}
|
|
40
|
+
*/
|
|
41
|
+
showCancelButton?: boolean;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* 确认按钮显示文本
|
|
45
|
+
* @author lxm
|
|
46
|
+
* @date 2023-09-04 05:39:30
|
|
47
|
+
* @type {string}
|
|
48
|
+
*/
|
|
49
|
+
confirmButtonText?: string;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* 取消按钮显示文本
|
|
53
|
+
* @author lxm
|
|
54
|
+
* @date 2023-09-04 05:39:30
|
|
55
|
+
* @type {string}
|
|
56
|
+
*/
|
|
57
|
+
cancelButtonText?: string;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* 消息类型
|
|
61
|
+
* @author lxm
|
|
62
|
+
* @date 2023-09-04 05:40:25
|
|
63
|
+
* @type {('success' | '')}
|
|
64
|
+
*/
|
|
65
|
+
type?: 'success' | 'info' | 'warning' | 'error';
|
|
66
|
+
|
|
26
67
|
/**
|
|
27
68
|
* 传递给时机组件的参数
|
|
28
69
|
*
|
|
@@ -49,12 +49,14 @@ export function calcLayoutHeightWidth(layoutPos: ILayoutPos): {
|
|
|
49
49
|
* @export
|
|
50
50
|
* @param {ILayoutPos} layoutPos
|
|
51
51
|
*/
|
|
52
|
-
export function calcContentAlignStyle(
|
|
52
|
+
export function calcContentAlignStyle(
|
|
53
|
+
layoutPos: ILayoutPos,
|
|
54
|
+
): IData | undefined {
|
|
53
55
|
const { valignSelf, halignSelf } = layoutPos;
|
|
54
|
-
|
|
56
|
+
let result;
|
|
55
57
|
// 自身对齐方式
|
|
56
58
|
if (valignSelf || halignSelf) {
|
|
57
|
-
|
|
59
|
+
result = { display: 'flex' };
|
|
58
60
|
// 自身垂直对齐模式
|
|
59
61
|
switch (valignSelf) {
|
|
60
62
|
case 'TOP':
|
|
@@ -24,10 +24,6 @@ export class MethodDto {
|
|
|
24
24
|
|
|
25
25
|
protected dtoMap: Map<string, MethodDto> = new Map();
|
|
26
26
|
|
|
27
|
-
get isLocalMode(): boolean {
|
|
28
|
-
return this.entity.storageMode === 1 || this.entity.storageMode === 4;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
27
|
constructor(
|
|
32
28
|
protected entity: IAppDataEntity,
|
|
33
29
|
protected dto?: IAppDEMethodDTO,
|
|
@@ -123,9 +119,7 @@ export class MethodDto {
|
|
|
123
119
|
await all[i];
|
|
124
120
|
}
|
|
125
121
|
const entityData = new AppDataEntity(this.entity, datum);
|
|
126
|
-
|
|
127
|
-
await service.local.add(context, entityData);
|
|
128
|
-
}
|
|
122
|
+
await service.local.add(context, entityData);
|
|
129
123
|
return entityData;
|
|
130
124
|
}),
|
|
131
125
|
);
|
|
@@ -2,7 +2,6 @@ import { IHttpResponse } from '@ibiz-template/core';
|
|
|
2
2
|
import { IControl } from '@ibiz/model-core';
|
|
3
3
|
import { ControlVO } from '../../vo/control.vo';
|
|
4
4
|
import { UIMapField } from '../../vo/ui-map-field';
|
|
5
|
-
import { IAppDEService } from '../../../interface';
|
|
6
5
|
import { Application } from '../../../application';
|
|
7
6
|
|
|
8
7
|
export class ControlService<T extends IControl = IControl> {
|
|
@@ -17,15 +16,6 @@ export class ControlService<T extends IControl = IControl> {
|
|
|
17
16
|
*/
|
|
18
17
|
readonly model: T;
|
|
19
18
|
|
|
20
|
-
/**
|
|
21
|
-
* 实体服务
|
|
22
|
-
*
|
|
23
|
-
* @author lxm
|
|
24
|
-
* @date 2022-08-29 18:08:19
|
|
25
|
-
* @type {IAppDEService}
|
|
26
|
-
*/
|
|
27
|
-
entityService!: IAppDEService;
|
|
28
|
-
|
|
29
19
|
/**
|
|
30
20
|
* UI数据和实体数据的属性名映射
|
|
31
21
|
* key:UI数据属性名
|
|
@@ -21,6 +21,19 @@ import { execDELogicAction, execFieldLogics } from '../../../../de-logic';
|
|
|
21
21
|
export class DEActionMethod extends Method {
|
|
22
22
|
declare method: IAppDEAction;
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
* 是否为本地模式
|
|
26
|
+
*
|
|
27
|
+
* @author chitanda
|
|
28
|
+
* @date 2023-04-19 16:04:46
|
|
29
|
+
* @readonly
|
|
30
|
+
* @protected
|
|
31
|
+
* @type {boolean}
|
|
32
|
+
*/
|
|
33
|
+
protected get isLocalMode(): boolean {
|
|
34
|
+
return this.method.actionType === 'BUILTIN';
|
|
35
|
+
}
|
|
36
|
+
|
|
24
37
|
async exec(
|
|
25
38
|
context: IParams,
|
|
26
39
|
data: IData,
|
|
@@ -23,6 +23,10 @@ import { execFieldLogics } from '../../../../de-logic';
|
|
|
23
23
|
export class FetchMethod extends Method {
|
|
24
24
|
declare method: IAppDEDataSet;
|
|
25
25
|
|
|
26
|
+
protected get isLocalMode(): boolean {
|
|
27
|
+
return this.method.dataSetType === 'DATAQUERY';
|
|
28
|
+
}
|
|
29
|
+
|
|
26
30
|
async exec(
|
|
27
31
|
context: IParams,
|
|
28
32
|
data: IData,
|
|
@@ -42,6 +46,7 @@ export class FetchMethod extends Method {
|
|
|
42
46
|
switch (this.method.dataSetType) {
|
|
43
47
|
case 'INDEXDE':
|
|
44
48
|
case 'CODELIST':
|
|
49
|
+
case 'MULTIFORM':
|
|
45
50
|
res = await this.fetchCodeListSet(context, params);
|
|
46
51
|
break;
|
|
47
52
|
case 'REMOTE':
|
|
@@ -50,19 +50,6 @@ export abstract class Method {
|
|
|
50
50
|
*/
|
|
51
51
|
protected service?: IAppDEService;
|
|
52
52
|
|
|
53
|
-
/**
|
|
54
|
-
* 是否为本地模式
|
|
55
|
-
*
|
|
56
|
-
* @author chitanda
|
|
57
|
-
* @date 2023-04-19 16:04:46
|
|
58
|
-
* @readonly
|
|
59
|
-
* @protected
|
|
60
|
-
* @type {boolean}
|
|
61
|
-
*/
|
|
62
|
-
protected get isLocalMode(): boolean {
|
|
63
|
-
return this.entity.storageMode === 1 || this.entity.storageMode === 4;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
53
|
/**
|
|
67
54
|
* Creates an instance of Method.
|
|
68
55
|
*
|
|
@@ -10,6 +10,14 @@ import { UILogicParam } from './ui-logic-param/ui-logic-param';
|
|
|
10
10
|
* @class UILogicContext
|
|
11
11
|
*/
|
|
12
12
|
export class UILogicContext {
|
|
13
|
+
/**
|
|
14
|
+
* 上一次返回值
|
|
15
|
+
* @author lxm
|
|
16
|
+
* @date 2023-09-04 09:22:52
|
|
17
|
+
* @type {unknown}
|
|
18
|
+
*/
|
|
19
|
+
lastReturn: unknown;
|
|
20
|
+
|
|
13
21
|
/**
|
|
14
22
|
* 上下文
|
|
15
23
|
*/
|
|
@@ -111,4 +119,28 @@ export class UILogicContext {
|
|
|
111
119
|
renewParam(name: string): void {
|
|
112
120
|
this.deLogicParams.get(name)?.renew(this);
|
|
113
121
|
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* 设置上一次返回值
|
|
125
|
+
* @author lxm
|
|
126
|
+
* @date 2023-09-04 09:23:52
|
|
127
|
+
* @param {unknown} value
|
|
128
|
+
*/
|
|
129
|
+
setLastReturn(value: unknown): void {
|
|
130
|
+
this.lastReturn = value;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* 初始化上一次返回参数类型的逻辑参数
|
|
135
|
+
* @author lxm
|
|
136
|
+
* @date 2023-09-04 09:52:00
|
|
137
|
+
* @param {string} tag
|
|
138
|
+
*/
|
|
139
|
+
initLastReturnParam(tag: string): void {
|
|
140
|
+
Object.defineProperty(this.params, tag, {
|
|
141
|
+
enumerable: true,
|
|
142
|
+
configurable: true,
|
|
143
|
+
get: () => this.lastReturn,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
114
146
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { RuntimeModelError } from '@ibiz-template/core';
|
|
2
|
+
import { IDEUIDebugParamLogic } from '@ibiz/model-core';
|
|
3
|
+
import { UILogicContext } from '../../ui-logic-context';
|
|
4
|
+
import { UILogicNode } from '../ui-logic-node';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 调试逻辑参数节点
|
|
8
|
+
*
|
|
9
|
+
* @author lxm
|
|
10
|
+
* @date 2023-02-09 21:02:20
|
|
11
|
+
* @export
|
|
12
|
+
* @class DebugParamNode
|
|
13
|
+
* @extends {UILogicNode}
|
|
14
|
+
*/
|
|
15
|
+
export class DebugParamNode extends UILogicNode {
|
|
16
|
+
declare model: IDEUIDebugParamLogic;
|
|
17
|
+
|
|
18
|
+
async exec(ctx: UILogicContext): Promise<void> {
|
|
19
|
+
const { dstDEUILogicParamId, name } = this.model;
|
|
20
|
+
if (!dstDEUILogicParamId) {
|
|
21
|
+
throw new RuntimeModelError(this.model, '缺少目标参数对象配置');
|
|
22
|
+
}
|
|
23
|
+
const param = ctx.params[dstDEUILogicParamId];
|
|
24
|
+
console.log(`逻辑节点${name}操作参数值:`, param);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -6,3 +6,5 @@ export { PrepareJSParamNode } from './prepare-js-param-node/prepare-js-param-nod
|
|
|
6
6
|
export { UILogicNode } from './ui-logic-node';
|
|
7
7
|
export { ViewCtrlInvokeNode } from './view-ctrl-invoke-node/view-ctrl-invoke-node';
|
|
8
8
|
export { BindParamNode } from './bind-param-node/bind-param-node';
|
|
9
|
+
export { MsgBoxNode } from './msg-box-node/msg-box-node';
|
|
10
|
+
export { DebugParamNode } from './debug-param-node/debug-param-node';
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { ModelError, RuntimeModelError } from '@ibiz-template/core';
|
|
2
|
+
import { IDEUIMsgBoxLogic } from '@ibiz/model-core';
|
|
3
|
+
import { ModalParams } from '../../../interface';
|
|
4
|
+
import { UILogicContext } from '../../ui-logic-context';
|
|
5
|
+
import { UILogicNode } from '../ui-logic-node';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 消息弹窗节点
|
|
9
|
+
*
|
|
10
|
+
* @author lxm
|
|
11
|
+
* @date 2023-02-09 21:02:20
|
|
12
|
+
* @export
|
|
13
|
+
* @class MsgBoxNode
|
|
14
|
+
* @extends {UILogicNode}
|
|
15
|
+
*/
|
|
16
|
+
export class MsgBoxNode extends UILogicNode {
|
|
17
|
+
declare model: IDEUIMsgBoxLogic;
|
|
18
|
+
|
|
19
|
+
protected typeMap = {
|
|
20
|
+
INFO: 'info',
|
|
21
|
+
QUESTION: 'success',
|
|
22
|
+
WARNING: 'warning',
|
|
23
|
+
ERROR: 'error',
|
|
24
|
+
} as const;
|
|
25
|
+
|
|
26
|
+
async exec(ctx: UILogicContext): Promise<void> {
|
|
27
|
+
const { msgBoxType, buttonsType, msgBoxParamId } = this.model;
|
|
28
|
+
if (!msgBoxType) {
|
|
29
|
+
throw new RuntimeModelError(this.model, '缺少消息类型的配置');
|
|
30
|
+
}
|
|
31
|
+
if (!buttonsType) {
|
|
32
|
+
throw new RuntimeModelError(this.model, '缺少按钮类型的配置');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// 处理标题和内容
|
|
36
|
+
let { title } = this.model;
|
|
37
|
+
let { message } = this.model;
|
|
38
|
+
if (msgBoxParamId) {
|
|
39
|
+
const param = ctx.params[msgBoxParamId];
|
|
40
|
+
if (param.title) {
|
|
41
|
+
title = param.title;
|
|
42
|
+
}
|
|
43
|
+
if (param.message) {
|
|
44
|
+
message = param.message;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// 处理消息类型
|
|
49
|
+
const type =
|
|
50
|
+
this.typeMap[msgBoxType as 'INFO' | 'QUESTION' | 'WARNING' | 'ERROR'];
|
|
51
|
+
const modalParams: ModalParams = {
|
|
52
|
+
type,
|
|
53
|
+
title: title || '消息',
|
|
54
|
+
desc: message,
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
let resultTags: string[] = [];
|
|
58
|
+
// 处理按钮类型
|
|
59
|
+
switch (buttonsType) {
|
|
60
|
+
case 'YESNO':
|
|
61
|
+
modalParams.confirmButtonText = '是';
|
|
62
|
+
modalParams.cancelButtonText = '否';
|
|
63
|
+
modalParams.showConfirmButton = true;
|
|
64
|
+
modalParams.showCancelButton = true;
|
|
65
|
+
resultTags = ['yes', 'no'];
|
|
66
|
+
break;
|
|
67
|
+
case 'OK':
|
|
68
|
+
modalParams.confirmButtonText = '确定';
|
|
69
|
+
modalParams.showConfirmButton = true;
|
|
70
|
+
modalParams.showCancelButton = false;
|
|
71
|
+
resultTags = ['ok'];
|
|
72
|
+
break;
|
|
73
|
+
case 'OKCANCEL':
|
|
74
|
+
modalParams.confirmButtonText = '确定';
|
|
75
|
+
modalParams.cancelButtonText = '取消';
|
|
76
|
+
modalParams.showConfirmButton = true;
|
|
77
|
+
modalParams.showCancelButton = true;
|
|
78
|
+
resultTags = ['ok', 'cancel'];
|
|
79
|
+
break;
|
|
80
|
+
default:
|
|
81
|
+
throw new ModelError(this.model, `${buttonsType}暂未支持`);
|
|
82
|
+
}
|
|
83
|
+
console.log(this.model, modalParams);
|
|
84
|
+
const result = await ibiz.modal.confirm(modalParams);
|
|
85
|
+
ctx.setLastReturn(resultTags[result ? 0 : 1]);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -69,7 +69,8 @@ export class UILogicParam {
|
|
|
69
69
|
// 数据对象变量
|
|
70
70
|
ctx.params[tag] = {};
|
|
71
71
|
} else if (m.lastReturnParam) {
|
|
72
|
-
|
|
72
|
+
// 上一次调用返回变量
|
|
73
|
+
ctx.initLastReturnParam(tag);
|
|
73
74
|
} else if (m.navContextParam) {
|
|
74
75
|
// 应用上下文
|
|
75
76
|
ctx.params[tag] = context;
|
package/src/ui-logic/ui-logic.ts
CHANGED
|
@@ -6,8 +6,10 @@ import { UILogicContext } from './ui-logic-context';
|
|
|
6
6
|
import {
|
|
7
7
|
BindParamNode,
|
|
8
8
|
DEActionNode,
|
|
9
|
+
DebugParamNode,
|
|
9
10
|
DEUIActionNode,
|
|
10
11
|
EndNode,
|
|
12
|
+
MsgBoxNode,
|
|
11
13
|
PrepareJSParamNode,
|
|
12
14
|
StartNode,
|
|
13
15
|
UILogicNode,
|
|
@@ -79,6 +81,12 @@ export class UILogic {
|
|
|
79
81
|
case 'VIEWCTRLINVOKE': // 视图部件调用
|
|
80
82
|
logicNode = new ViewCtrlInvokeNode(node);
|
|
81
83
|
break;
|
|
84
|
+
case 'MSGBOX': // 消息弹窗
|
|
85
|
+
logicNode = new MsgBoxNode(node);
|
|
86
|
+
break;
|
|
87
|
+
case 'DEBUGPARAM': // 调试逻辑参数
|
|
88
|
+
logicNode = new DebugParamNode(node);
|
|
89
|
+
break;
|
|
82
90
|
case 'RESETPARAM': // 重置参数
|
|
83
91
|
case 'COPYPARAM': // 拷贝参数
|
|
84
92
|
case 'VIEWCTRLFIREEVENT': // 视图部件事件触发
|
|
@@ -86,11 +94,9 @@ export class UILogic {
|
|
|
86
94
|
case 'SORTPARAM': // 排序数组参数
|
|
87
95
|
case 'RENEWPARAM': // 重新建立参数
|
|
88
96
|
case 'PFPLUGIN': // 前端插件调用
|
|
89
|
-
case 'MSGBOX': // 消息弹窗
|
|
90
97
|
case 'DEDATASET': // 实体数据集
|
|
91
98
|
case 'DELOGIC': // 实体逻辑
|
|
92
99
|
case 'THROWEXCEPTION': // 抛出异常
|
|
93
|
-
case 'DEBUGPARAM': // 调试逻辑参数
|
|
94
100
|
default:
|
|
95
101
|
throw new ModelError(node, `未支持的逻辑节点类型: ${logicNodeType}`);
|
|
96
102
|
}
|