@ibiz-template/runtime 0.1.5 → 0.1.7
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 +188 -85
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/out/command/app/open-app-view/open-app-view.d.ts +3 -3
- 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 +4 -1
- package/out/controller/common/base.controller.js +1 -1
- package/out/controller/common/control/control.controller.js +1 -1
- package/out/controller/common/control/md-control.controller.js +1 -1
- package/out/controller/common/view/view.controller.d.ts.map +1 -1
- package/out/controller/common/view/view.controller.js +13 -3
- package/out/controller/ctx/ctx.d.ts.map +1 -1
- package/out/controller/ctx/ctx.js +1 -1
- package/out/interface/common/i-open-view-options/i-open-view-options.d.ts +38 -0
- package/out/interface/common/i-open-view-options/i-open-view-options.d.ts.map +1 -0
- package/out/interface/common/i-open-view-options/i-open-view-options.js +1 -0
- package/out/interface/common/index.d.ts +1 -0
- package/out/interface/common/index.d.ts.map +1 -1
- package/out/interface/controller/common/i-nav-view-msg/i-nav-view-msg.d.ts +45 -0
- package/out/interface/controller/common/i-nav-view-msg/i-nav-view-msg.d.ts.map +1 -0
- package/out/interface/controller/common/i-nav-view-msg/i-nav-view-msg.js +1 -0
- package/out/interface/controller/common/index.d.ts +1 -0
- package/out/interface/controller/common/index.d.ts.map +1 -1
- package/out/interface/controller/common/index.js +1 -0
- package/out/interface/controller/controller/control/i-exp-bar-control.controller.d.ts +11 -0
- package/out/interface/controller/controller/control/i-exp-bar-control.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-tree-exp-bar.controller.d.ts +0 -11
- package/out/interface/controller/controller/control/i-tree-exp-bar.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/control/panel-item/i-panel-item-nav-pos.controller.d.ts +1 -46
- package/out/interface/controller/controller/control/panel-item/i-panel-item-nav-pos.controller.d.ts.map +1 -1
- package/out/interface/controller/event/argument/control-trigger.event.d.ts +33 -0
- package/out/interface/controller/event/argument/control-trigger.event.d.ts.map +1 -0
- package/out/interface/controller/event/argument/control-trigger.event.js +1 -0
- package/out/interface/controller/event/argument/index.d.ts +2 -0
- package/out/interface/controller/event/argument/index.d.ts.map +1 -1
- package/out/interface/controller/event/argument/nav-view-change.event.d.ts +20 -0
- package/out/interface/controller/event/argument/nav-view-change.event.d.ts.map +1 -0
- package/out/interface/controller/event/argument/nav-view-change.event.js +1 -0
- package/out/interface/controller/event/control/i-exp-bar-control.event.d.ts +11 -0
- package/out/interface/controller/event/control/i-exp-bar-control.event.d.ts.map +1 -1
- package/out/interface/controller/event/control/i-panel.event.d.ts +15 -1
- package/out/interface/controller/event/control/i-panel.event.d.ts.map +1 -1
- package/out/interface/controller/event/control/i-tab-exp-panel.event.d.ts +11 -0
- package/out/interface/controller/event/control/i-tab-exp-panel.event.d.ts.map +1 -1
- package/out/interface/controller/work-flow/wf-link.d.ts +4 -4
- package/out/interface/logic-scheduler/i-scheduler-logic.d.ts +5 -3
- package/out/interface/logic-scheduler/i-scheduler-logic.d.ts.map +1 -1
- package/out/interface/logic-scheduler/i-trigger-match-params.d.ts +5 -0
- package/out/interface/logic-scheduler/i-trigger-match-params.d.ts.map +1 -1
- package/out/interface/util/i-confirm-util/i-confirm-util.d.ts +82 -0
- package/out/interface/util/i-confirm-util/i-confirm-util.d.ts.map +1 -0
- package/out/interface/util/i-confirm-util/i-confirm-util.js +1 -0
- package/out/interface/util/i-modal-util/i-modal-util.d.ts +8 -0
- package/out/interface/util/i-modal-util/i-modal-util.d.ts.map +1 -1
- package/out/interface/util/index.d.ts +1 -0
- package/out/interface/util/index.d.ts.map +1 -1
- package/out/logic-scheduler/index.d.ts.map +1 -1
- package/out/logic-scheduler/index.js +2 -0
- package/out/logic-scheduler/scheduler/logic-scheduler.d.ts +24 -1
- package/out/logic-scheduler/scheduler/logic-scheduler.d.ts.map +1 -1
- package/out/logic-scheduler/scheduler/logic-scheduler.js +39 -0
- package/out/logic-scheduler/trigger/control-event-trigger.d.ts +27 -0
- package/out/logic-scheduler/trigger/control-event-trigger.d.ts.map +1 -0
- package/out/logic-scheduler/trigger/control-event-trigger.js +33 -0
- package/out/logic-scheduler/trigger/view-event-trigger.d.ts +8 -0
- package/out/logic-scheduler/trigger/view-event-trigger.d.ts.map +1 -1
- package/out/logic-scheduler/trigger/view-event-trigger.js +8 -0
- package/out/service/dto/method.dto.d.ts.map +1 -1
- package/out/service/dto/method.dto.js +3 -9
- package/out/service/service/code-list/code-list.service.d.ts.map +1 -1
- package/out/service/service/code-list/code-list.service.js +5 -1
- package/out/types.d.ts +19 -1
- package/out/types.d.ts.map +1 -1
- package/out/ui-logic/ui-logic-node/bind-param-node/bind-param-node.d.ts +17 -0
- package/out/ui-logic/ui-logic-node/bind-param-node/bind-param-node.d.ts.map +1 -0
- package/out/ui-logic/ui-logic-node/bind-param-node/bind-param-node.js +22 -0
- package/out/ui-logic/ui-logic-node/index.d.ts +1 -0
- package/out/ui-logic/ui-logic-node/index.d.ts.map +1 -1
- package/out/ui-logic/ui-logic-node/index.js +1 -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 -2
- package/out/ui-logic/ui-logic.d.ts.map +1 -1
- package/out/ui-logic/ui-logic.js +5 -3
- package/out/ui-logic/utils/handle-src-val.d.ts.map +1 -1
- package/out/ui-logic/utils/handle-src-val.js +2 -4
- package/out/utils/open-redirect-view/open-redirect-view.d.ts +4 -4
- package/out/utils/open-redirect-view/open-redirect-view.d.ts.map +1 -1
- package/out/utils/open-redirect-view/open-redirect-view.js +10 -9
- package/out/utils/wf-helper/wf-helper.js +2 -2
- package/package.json +3 -3
- package/src/command/app/open-app-view/open-app-view.ts +8 -5
- package/src/controller/common/base.controller.ts +1 -1
- package/src/controller/common/control/control.controller.ts +1 -1
- package/src/controller/common/control/md-control.controller.ts +1 -1
- package/src/controller/common/view/view.controller.ts +16 -3
- package/src/controller/ctx/ctx.ts +1 -1
- package/src/interface/common/i-open-view-options/i-open-view-options.ts +40 -0
- package/src/interface/common/index.ts +1 -0
- package/src/interface/controller/common/i-nav-view-msg/i-nav-view-msg.ts +48 -0
- package/src/interface/controller/common/index.ts +1 -0
- package/src/interface/controller/controller/control/i-exp-bar-control.controller.ts +12 -0
- package/src/interface/controller/controller/control/i-tree-exp-bar.controller.ts +1 -17
- package/src/interface/controller/controller/control/panel-item/i-panel-item-nav-pos.controller.ts +1 -52
- package/src/interface/controller/event/argument/control-trigger.event.ts +35 -0
- package/src/interface/controller/event/argument/index.ts +2 -0
- package/src/interface/controller/event/argument/nav-view-change.event.ts +20 -0
- package/src/interface/controller/event/control/i-exp-bar-control.event.ts +13 -1
- package/src/interface/controller/event/control/i-panel.event.ts +15 -1
- package/src/interface/controller/event/control/i-tab-exp-panel.event.ts +13 -1
- package/src/interface/controller/work-flow/wf-link.ts +4 -4
- package/src/interface/logic-scheduler/i-scheduler-logic.ts +6 -3
- package/src/interface/logic-scheduler/i-trigger-match-params.ts +6 -0
- package/src/interface/util/i-confirm-util/i-confirm-util.ts +82 -0
- package/src/interface/util/i-modal-util/i-modal-util.ts +8 -0
- package/src/interface/util/index.ts +1 -0
- package/src/logic-scheduler/index.ts +5 -0
- package/src/logic-scheduler/scheduler/logic-scheduler.ts +43 -0
- package/src/logic-scheduler/trigger/control-event-trigger.ts +45 -0
- package/src/logic-scheduler/trigger/view-event-trigger.ts +8 -0
- package/src/service/dto/method.dto.ts +3 -8
- package/src/service/service/code-list/code-list.service.ts +8 -1
- package/src/types.ts +21 -0
- package/src/ui-logic/ui-logic-node/bind-param-node/bind-param-node.ts +30 -0
- package/src/ui-logic/ui-logic-node/index.ts +1 -0
- package/src/ui-logic/ui-logic-param/ui-logic-param.ts +5 -2
- package/src/ui-logic/ui-logic.ts +5 -2
- package/src/ui-logic/utils/handle-src-val.ts +3 -6
- package/src/utils/open-redirect-view/open-redirect-view.ts +10 -8
- package/src/utils/wf-helper/wf-helper.ts +2 -2
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { PartialWithObject } from '@ibiz-template/core';
|
|
2
|
+
import { NavViewChangeEvent, EventBase } from '../argument';
|
|
1
3
|
import { IControlEvent } from './i-control.event';
|
|
2
4
|
|
|
3
5
|
/**
|
|
@@ -7,4 +9,14 @@ import { IControlEvent } from './i-control.event';
|
|
|
7
9
|
* @interface ITabExpPanelEvent
|
|
8
10
|
* @extends {IControlEvent}
|
|
9
11
|
*/
|
|
10
|
-
export interface ITabExpPanelEvent extends IControlEvent {
|
|
12
|
+
export interface ITabExpPanelEvent extends IControlEvent {
|
|
13
|
+
/**
|
|
14
|
+
* 导航视图变更事件
|
|
15
|
+
* @author lxm
|
|
16
|
+
* @date 2023-08-09 07:19:00
|
|
17
|
+
*/
|
|
18
|
+
onNavViewChange: {
|
|
19
|
+
event: NavViewChangeEvent;
|
|
20
|
+
emitArgs: PartialWithObject<NavViewChangeEvent, EventBase>;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -21,7 +21,7 @@ export interface WFLink {
|
|
|
21
21
|
* @date 2023-06-20 03:30:20
|
|
22
22
|
* @type {string}
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
sequenceflowview: string;
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* pc端流程操作表单
|
|
@@ -29,7 +29,7 @@ export interface WFLink {
|
|
|
29
29
|
* @date 2023-06-20 03:30:21
|
|
30
30
|
* @type {string}
|
|
31
31
|
*/
|
|
32
|
-
|
|
32
|
+
sequenceflowform: string;
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* 移动端流程操作视图
|
|
@@ -37,7 +37,7 @@ export interface WFLink {
|
|
|
37
37
|
* @date 2023-06-20 03:31:45
|
|
38
38
|
* @type {string}
|
|
39
39
|
*/
|
|
40
|
-
|
|
40
|
+
sequenceflowmobview: string;
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* 移动端流程操作表单
|
|
@@ -45,7 +45,7 @@ export interface WFLink {
|
|
|
45
45
|
* @date 2023-06-20 03:31:43
|
|
46
46
|
* @type {string}
|
|
47
47
|
*/
|
|
48
|
-
|
|
48
|
+
sequenceflowmobform: string;
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* 流程ID
|
|
@@ -88,21 +88,24 @@ export interface ISchedulerLogic {
|
|
|
88
88
|
/**
|
|
89
89
|
* 事件名称
|
|
90
90
|
* @type {string}
|
|
91
|
-
* 来源 getEventNames
|
|
92
91
|
*/
|
|
93
92
|
eventNames?: string;
|
|
94
93
|
|
|
95
94
|
/**
|
|
96
95
|
* 事件参数
|
|
97
96
|
* @type {string}
|
|
98
|
-
* 来源 getEventArg
|
|
99
97
|
*/
|
|
100
98
|
eventArg?: string;
|
|
101
99
|
|
|
102
100
|
/**
|
|
103
101
|
* 事件参数2
|
|
104
102
|
* @type {string}
|
|
105
|
-
* 来源 getEventArg2
|
|
106
103
|
*/
|
|
107
104
|
eventArg2?: string;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* 部件名称
|
|
108
|
+
* @type {string}
|
|
109
|
+
*/
|
|
110
|
+
ctrlName?: string;
|
|
108
111
|
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 确认框参数
|
|
3
|
+
*
|
|
4
|
+
* @author chitanda
|
|
5
|
+
* @date 2022-08-17 16:08:42
|
|
6
|
+
* @export
|
|
7
|
+
* @interface ConfirmParams
|
|
8
|
+
*/
|
|
9
|
+
export interface ConfirmParams {
|
|
10
|
+
/**
|
|
11
|
+
* 标题
|
|
12
|
+
*
|
|
13
|
+
* @author chitanda
|
|
14
|
+
* @date 2022-08-17 16:08:04
|
|
15
|
+
* @type {string}
|
|
16
|
+
*/
|
|
17
|
+
title: string;
|
|
18
|
+
/**
|
|
19
|
+
* 描述
|
|
20
|
+
*
|
|
21
|
+
* @author chitanda
|
|
22
|
+
* @date 2022-08-17 16:08:08
|
|
23
|
+
* @type {string}
|
|
24
|
+
*/
|
|
25
|
+
desc?: string;
|
|
26
|
+
/**
|
|
27
|
+
* 传递给组件的参数
|
|
28
|
+
*
|
|
29
|
+
* @author chitanda
|
|
30
|
+
* @date 2023-08-14 15:08:07
|
|
31
|
+
* @type {IParams}
|
|
32
|
+
*/
|
|
33
|
+
options?: IParams;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* 确认框
|
|
38
|
+
*
|
|
39
|
+
* @description 需要用户确认收到提示消息时使用此工具
|
|
40
|
+
* @author chitanda
|
|
41
|
+
* @date 2022-08-17 16:08:25
|
|
42
|
+
* @export
|
|
43
|
+
* @interface IConfirmUtil
|
|
44
|
+
*/
|
|
45
|
+
export interface IConfirmUtil {
|
|
46
|
+
/**
|
|
47
|
+
* 普通信息
|
|
48
|
+
*
|
|
49
|
+
* @author chitanda
|
|
50
|
+
* @date 2022-08-17 16:08:36
|
|
51
|
+
* @param {ConfirmParams} params
|
|
52
|
+
* @return {*} {Promise<boolean>}
|
|
53
|
+
*/
|
|
54
|
+
info(params: ConfirmParams): Promise<boolean>;
|
|
55
|
+
/**
|
|
56
|
+
* 成功信息
|
|
57
|
+
*
|
|
58
|
+
* @author chitanda
|
|
59
|
+
* @date 2022-08-17 16:08:47
|
|
60
|
+
* @param {ConfirmParams} params
|
|
61
|
+
* @return {*} {Promise<boolean>}
|
|
62
|
+
*/
|
|
63
|
+
success(params: ConfirmParams): Promise<boolean>;
|
|
64
|
+
/**
|
|
65
|
+
* 警告信息
|
|
66
|
+
*
|
|
67
|
+
* @author chitanda
|
|
68
|
+
* @date 2022-08-17 16:08:53
|
|
69
|
+
* @param {ConfirmParams} params
|
|
70
|
+
* @return {*} {Promise<boolean>}
|
|
71
|
+
*/
|
|
72
|
+
warning(params: ConfirmParams): Promise<boolean>;
|
|
73
|
+
/**
|
|
74
|
+
* 错误信息
|
|
75
|
+
*
|
|
76
|
+
* @author chitanda
|
|
77
|
+
* @date 2022-08-17 16:08:59
|
|
78
|
+
* @param {ConfirmParams} params
|
|
79
|
+
* @return {*} {Promise<boolean>}
|
|
80
|
+
*/
|
|
81
|
+
error(params: ConfirmParams): Promise<boolean>;
|
|
82
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { ILoadingUtil } from './i-loading-util/i-loading-util';
|
|
2
2
|
export { IMessageUtil } from './i-message-util/i-message-util';
|
|
3
3
|
export { IModalUtil, ModalParams } from './i-modal-util/i-modal-util';
|
|
4
|
+
export { IConfirmUtil, ConfirmParams } from './i-confirm-util/i-confirm-util';
|
|
4
5
|
export {
|
|
5
6
|
INotificationUtil,
|
|
6
7
|
NotificationParams,
|
|
@@ -12,6 +12,7 @@ import { LogicTriggerFactory } from './trigger/logic-trigger-factory';
|
|
|
12
12
|
import { TimerTrigger } from './trigger/timer-trigger';
|
|
13
13
|
import { AppUILogicExecutor } from './executor/app-ui-logic-executor';
|
|
14
14
|
import { ViewEventTrigger } from './trigger/view-event-trigger';
|
|
15
|
+
import { ControlEventTrigger } from './trigger/control-event-trigger';
|
|
15
16
|
|
|
16
17
|
export {
|
|
17
18
|
LogicSchedulerCenter,
|
|
@@ -54,6 +55,10 @@ export function installLogicSchedule(): void {
|
|
|
54
55
|
'VIEWEVENT',
|
|
55
56
|
(logic, scheduler) => new ViewEventTrigger(logic, scheduler),
|
|
56
57
|
);
|
|
58
|
+
ibiz.scheduler.triggerFactory.register(
|
|
59
|
+
'CTRLEVENT',
|
|
60
|
+
(logic, scheduler) => new ControlEventTrigger(logic, scheduler),
|
|
61
|
+
);
|
|
57
62
|
|
|
58
63
|
// 执行器
|
|
59
64
|
ibiz.scheduler.executorFactory.register(
|
|
@@ -3,6 +3,7 @@ import type {
|
|
|
3
3
|
IUILogicParams,
|
|
4
4
|
ISchedulerLogic,
|
|
5
5
|
ITriggerMatchParams,
|
|
6
|
+
EventBase,
|
|
6
7
|
} from '../../interface';
|
|
7
8
|
import { LogicExecutor } from '../executor/logic-executor';
|
|
8
9
|
import { LogicTrigger } from '../trigger/logic-trigger';
|
|
@@ -22,6 +23,22 @@ export class LogicScheduler {
|
|
|
22
23
|
|
|
23
24
|
executors = new Map<string, LogicExecutor>();
|
|
24
25
|
|
|
26
|
+
/**
|
|
27
|
+
* 是否有视图事件触发类型逻辑
|
|
28
|
+
* @author lxm
|
|
29
|
+
* @date 2023-08-14 02:19:51
|
|
30
|
+
* @type {boolean}
|
|
31
|
+
*/
|
|
32
|
+
hasViewEventTrigger: boolean = false;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 是否有部件事件触发类型逻辑
|
|
36
|
+
* @author lxm
|
|
37
|
+
* @date 2023-08-14 02:19:51
|
|
38
|
+
* @type {boolean}
|
|
39
|
+
*/
|
|
40
|
+
hasControlEventTrigger: boolean = false;
|
|
41
|
+
|
|
25
42
|
constructor(logics: ISchedulerLogic[]) {
|
|
26
43
|
this.logics = logics;
|
|
27
44
|
logics.forEach(logic => {
|
|
@@ -78,6 +95,15 @@ export class LogicScheduler {
|
|
|
78
95
|
* @return {*} {LogicTrigger}
|
|
79
96
|
*/
|
|
80
97
|
protected createTrigger(logic: ISchedulerLogic): LogicTrigger {
|
|
98
|
+
switch (logic.triggerType) {
|
|
99
|
+
case 'VIEWEVENT':
|
|
100
|
+
this.hasViewEventTrigger = true;
|
|
101
|
+
break;
|
|
102
|
+
case 'CTRLEVENT':
|
|
103
|
+
this.hasControlEventTrigger = true;
|
|
104
|
+
break;
|
|
105
|
+
default:
|
|
106
|
+
}
|
|
81
107
|
return ibiz.scheduler.triggerFactory.createTrigger(logic, this);
|
|
82
108
|
}
|
|
83
109
|
|
|
@@ -228,4 +254,21 @@ export class LogicScheduler {
|
|
|
228
254
|
const params = this.getExecuteParams(executeParams);
|
|
229
255
|
return trigger.execute(params);
|
|
230
256
|
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* 触发部件事件
|
|
260
|
+
* @author lxm
|
|
261
|
+
* @date 2023-06-26 02:26:33
|
|
262
|
+
* @param {string} itemName 子项名称
|
|
263
|
+
* @param {Partial<IUILogicParams>} executeParams 执行参数
|
|
264
|
+
* @return {*} {(boolean | undefined)}
|
|
265
|
+
*/
|
|
266
|
+
triggerControlEvent(ctrlName: string, event: EventBase): void {
|
|
267
|
+
const matchParams = {
|
|
268
|
+
ctrlName,
|
|
269
|
+
eventName: event.eventName,
|
|
270
|
+
triggerType: 'CTRLEVENT',
|
|
271
|
+
} as const;
|
|
272
|
+
this.triggerAndExecute(matchParams, event);
|
|
273
|
+
}
|
|
231
274
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { StudioControlEvents } from '../../constant';
|
|
2
|
+
import type { ISchedulerLogic, ITriggerMatchParams } from '../../interface';
|
|
3
|
+
import { LogicScheduler } from '../scheduler/logic-scheduler';
|
|
4
|
+
import { LogicTrigger } from './logic-trigger';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 部件事件触发器
|
|
8
|
+
* @author lxm
|
|
9
|
+
* @date 2023-08-14 02:10:46
|
|
10
|
+
* @export
|
|
11
|
+
* @class ControlEventTrigger
|
|
12
|
+
* @extends {LogicTrigger}
|
|
13
|
+
*/
|
|
14
|
+
export class ControlEventTrigger extends LogicTrigger {
|
|
15
|
+
declare type: 'CTRLEVENT';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* 监听事件名称集合
|
|
19
|
+
* @author lxm
|
|
20
|
+
* @date 2023-07-26 05:48:30
|
|
21
|
+
* @protected
|
|
22
|
+
* @type {string[]}
|
|
23
|
+
*/
|
|
24
|
+
protected listenEventNames: string[] = [];
|
|
25
|
+
|
|
26
|
+
constructor(
|
|
27
|
+
protected logic: ISchedulerLogic,
|
|
28
|
+
protected scheduler: LogicScheduler,
|
|
29
|
+
) {
|
|
30
|
+
super(logic, scheduler);
|
|
31
|
+
const names = logic.eventNames!.split(',');
|
|
32
|
+
this.listenEventNames = names.map(
|
|
33
|
+
name => StudioControlEvents[name as keyof StudioControlEvents] || name,
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
match(matchParams: ITriggerMatchParams): boolean {
|
|
38
|
+
const superResult = super.match(matchParams);
|
|
39
|
+
return (
|
|
40
|
+
superResult &&
|
|
41
|
+
matchParams.ctrlName === this.logic.ctrlName &&
|
|
42
|
+
this.listenEventNames.includes(matchParams.eventName!)
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -3,6 +3,14 @@ import type { ISchedulerLogic, ITriggerMatchParams } from '../../interface';
|
|
|
3
3
|
import { LogicScheduler } from '../scheduler/logic-scheduler';
|
|
4
4
|
import { LogicTrigger } from './logic-trigger';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* 视图事件触发器
|
|
8
|
+
* @author lxm
|
|
9
|
+
* @date 2023-08-14 02:12:44
|
|
10
|
+
* @export
|
|
11
|
+
* @class ViewEventTrigger
|
|
12
|
+
* @extends {LogicTrigger}
|
|
13
|
+
*/
|
|
6
14
|
export class ViewEventTrigger extends LogicTrigger {
|
|
7
15
|
declare type: 'VIEWEVENT';
|
|
8
16
|
|
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
IAppDEMethodDTO,
|
|
5
5
|
IAppDEMethodDTOField,
|
|
6
6
|
} from '@ibiz/model-core';
|
|
7
|
-
import { isNilOrEmpty } from 'qx-util';
|
|
8
7
|
import { ModelError } from '@ibiz-template/core';
|
|
9
8
|
import { Application } from '../../application';
|
|
10
9
|
import { AppDataEntity } from '../app-data-entity/app-data-entity';
|
|
@@ -52,17 +51,12 @@ export class MethodDto {
|
|
|
52
51
|
*/
|
|
53
52
|
async get(context: IParams, data: IData): Promise<IData> {
|
|
54
53
|
const params: IData = {};
|
|
54
|
+
// 拷贝数据
|
|
55
55
|
for (let i = 0; i < this.fields.length; i++) {
|
|
56
56
|
const field = this.fields[i];
|
|
57
57
|
const key = field.codeName!.toLowerCase();
|
|
58
58
|
switch (field.type) {
|
|
59
59
|
case 'SIMPLE': {
|
|
60
|
-
const val = data[key];
|
|
61
|
-
if (isNilOrEmpty(val)) {
|
|
62
|
-
params[key] = null;
|
|
63
|
-
} else {
|
|
64
|
-
params[key] = val;
|
|
65
|
-
}
|
|
66
60
|
break;
|
|
67
61
|
}
|
|
68
62
|
case 'DTOS': {
|
|
@@ -87,7 +81,8 @@ export class MethodDto {
|
|
|
87
81
|
);
|
|
88
82
|
}
|
|
89
83
|
}
|
|
90
|
-
|
|
84
|
+
// 合并剩余参数
|
|
85
|
+
return { ...data, ...params };
|
|
91
86
|
}
|
|
92
87
|
|
|
93
88
|
/**
|
|
@@ -99,8 +99,15 @@ export class CodeListService {
|
|
|
99
99
|
): Readonly<CodeListItem>[] {
|
|
100
100
|
return codeItems.map(codeItem => {
|
|
101
101
|
// todo代码项其他属性,表单数据
|
|
102
|
+
let text = codeItem.text!;
|
|
103
|
+
if (codeItem.textLanguageRes) {
|
|
104
|
+
text = ibiz.i18n.t(
|
|
105
|
+
codeItem.textLanguageRes.lanResTag!,
|
|
106
|
+
codeItem.textLanguageRes.defaultContent,
|
|
107
|
+
);
|
|
108
|
+
}
|
|
102
109
|
const _codeItem: CodeListItem = {
|
|
103
|
-
text
|
|
110
|
+
text,
|
|
104
111
|
value: isValueNumber ? Number(codeItem.value) : codeItem.value!,
|
|
105
112
|
color: codeItem.color,
|
|
106
113
|
id: codeItem.codeName!,
|
package/src/types.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { I18n } from '@ibiz-template/core/src/interface';
|
|
1
2
|
import { EngineFactory } from './engine';
|
|
2
3
|
import { GlobalUtil } from './global';
|
|
3
4
|
import {
|
|
@@ -5,6 +6,7 @@ import {
|
|
|
5
6
|
INotificationUtil,
|
|
6
7
|
IOpenViewUtil,
|
|
7
8
|
IModalUtil,
|
|
9
|
+
IConfirmUtil,
|
|
8
10
|
ILoadingUtil,
|
|
9
11
|
IPluginFactory,
|
|
10
12
|
IOverlayController,
|
|
@@ -45,6 +47,16 @@ declare module '@ibiz-template/core' {
|
|
|
45
47
|
*/
|
|
46
48
|
modal: IModalUtil;
|
|
47
49
|
|
|
50
|
+
/**
|
|
51
|
+
* 确认框
|
|
52
|
+
*
|
|
53
|
+
* @description 需要用户确认收到提示消息时使用此工具
|
|
54
|
+
* @author chitanda
|
|
55
|
+
* @date 2022-08-17 16:08:10
|
|
56
|
+
* @type {IConfirmUtil}
|
|
57
|
+
*/
|
|
58
|
+
confirm: IConfirmUtil;
|
|
59
|
+
|
|
48
60
|
/**
|
|
49
61
|
* 消息通知
|
|
50
62
|
*
|
|
@@ -137,6 +149,15 @@ declare module '@ibiz-template/core' {
|
|
|
137
149
|
*/
|
|
138
150
|
util: GlobalUtil;
|
|
139
151
|
|
|
152
|
+
/**
|
|
153
|
+
* 多语言
|
|
154
|
+
*
|
|
155
|
+
* @author chitanda
|
|
156
|
+
* @date 2023-08-11 16:08:15
|
|
157
|
+
* @type {I18n}
|
|
158
|
+
*/
|
|
159
|
+
i18n: I18n;
|
|
160
|
+
|
|
140
161
|
/**
|
|
141
162
|
* 逻辑调度中心
|
|
142
163
|
* @author lxm
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { RuntimeModelError } from '@ibiz-template/core';
|
|
2
|
+
import { IDEUIBindParamLogic } from '@ibiz/model-core';
|
|
3
|
+
import { UILogicContext } from '../../ui-logic-context';
|
|
4
|
+
import { handleSrcVal } from '../../utils';
|
|
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 BindParamNode
|
|
14
|
+
* @extends {UILogicNode}
|
|
15
|
+
*/
|
|
16
|
+
export class BindParamNode extends UILogicNode {
|
|
17
|
+
declare model: IDEUIBindParamLogic;
|
|
18
|
+
|
|
19
|
+
async exec(ctx: UILogicContext): Promise<void> {
|
|
20
|
+
const { dstDEUILogicParamId, srcDEUILogicParamId } = this.model;
|
|
21
|
+
if (!dstDEUILogicParamId || !srcDEUILogicParamId) {
|
|
22
|
+
throw new RuntimeModelError(
|
|
23
|
+
this.model,
|
|
24
|
+
'缺少目标参数对象或者源参数对象配置',
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
const srcVal = handleSrcVal(ctx, this.model);
|
|
28
|
+
ctx.params[dstDEUILogicParamId] = srcVal;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -5,3 +5,4 @@ export { EndNode } from './end-node/end-node';
|
|
|
5
5
|
export { PrepareJSParamNode } from './prepare-js-param-node/prepare-js-param-node';
|
|
6
6
|
export { UILogicNode } from './ui-logic-node';
|
|
7
7
|
export { ViewCtrlInvokeNode } from './view-ctrl-invoke-node/view-ctrl-invoke-node';
|
|
8
|
+
export { BindParamNode } from './bind-param-node/bind-param-node';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModelError,
|
|
1
|
+
import { ModelError, RuntimeModelError } from '@ibiz-template/core';
|
|
2
2
|
import { IDEUILogicParam } from '@ibiz/model-core';
|
|
3
3
|
import { UILogicContext } from '../ui-logic-context';
|
|
4
4
|
|
|
@@ -46,7 +46,10 @@ export class UILogicParam {
|
|
|
46
46
|
if (control) {
|
|
47
47
|
ctx.params[tag] = control;
|
|
48
48
|
} else {
|
|
49
|
-
throw new
|
|
49
|
+
throw new RuntimeModelError(
|
|
50
|
+
this.model,
|
|
51
|
+
`视图逻辑初始化参数,未找到${m.codeName!}指定部件对象`,
|
|
52
|
+
);
|
|
50
53
|
}
|
|
51
54
|
} else if (m.activeViewParam) {
|
|
52
55
|
// 当前视图
|
package/src/ui-logic/ui-logic.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { IDEUILogic } from '@ibiz/model-core';
|
|
|
4
4
|
import { IUILogicParams } from '../interface';
|
|
5
5
|
import { UILogicContext } from './ui-logic-context';
|
|
6
6
|
import {
|
|
7
|
+
BindParamNode,
|
|
7
8
|
DEActionNode,
|
|
8
9
|
DEUIActionNode,
|
|
9
10
|
EndNode,
|
|
@@ -72,12 +73,14 @@ export class UILogic {
|
|
|
72
73
|
case 'PREPAREJSPARAM': // 准备参数
|
|
73
74
|
logicNode = new PrepareJSParamNode(node);
|
|
74
75
|
break;
|
|
75
|
-
case 'RESETPARAM': // 重置参数
|
|
76
|
-
case 'COPYPARAM': // 拷贝参数
|
|
77
76
|
case 'BINDPARAM': // 绑定参数
|
|
77
|
+
logicNode = new BindParamNode(node);
|
|
78
|
+
break;
|
|
78
79
|
case 'VIEWCTRLINVOKE': // 视图部件调用
|
|
79
80
|
logicNode = new ViewCtrlInvokeNode(node);
|
|
80
81
|
break;
|
|
82
|
+
case 'RESETPARAM': // 重置参数
|
|
83
|
+
case 'COPYPARAM': // 拷贝参数
|
|
81
84
|
case 'VIEWCTRLFIREEVENT': // 视图部件事件触发
|
|
82
85
|
case 'APPENDPARAM': // 附加到数组参数
|
|
83
86
|
case 'SORTPARAM': // 排序数组参数
|
|
@@ -34,13 +34,10 @@ export function handleSrcVal(
|
|
|
34
34
|
ctx: UILogicContext,
|
|
35
35
|
srcValParams: SrcValParams,
|
|
36
36
|
): unknown {
|
|
37
|
-
const { srcDEUILogicParamId,
|
|
38
|
-
srcValParams;
|
|
39
|
-
|
|
37
|
+
const { srcDEUILogicParamId, srcFieldName, srcValue } = srcValParams;
|
|
40
38
|
// 没有源值类型就是逻辑参数
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
39
|
+
const srcValueType = srcValParams.srcValueType || 'SRCDLPARAM';
|
|
40
|
+
|
|
44
41
|
let value: unknown;
|
|
45
42
|
switch (srcValueType) {
|
|
46
43
|
// 源逻辑参数
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import { RuntimeError, RuntimeModelError } from '@ibiz-template/core';
|
|
8
8
|
import { isNilOrEmpty, notNilEmpty } from 'qx-util';
|
|
9
9
|
import qs from 'qs';
|
|
10
|
-
import { IModalData } from '../../interface';
|
|
10
|
+
import { IModalData, IOpenViewOptions } from '../../interface';
|
|
11
11
|
import { OpenAppViewCommand } from '../../command';
|
|
12
12
|
import { convertNavData } from '../nav-params/nav-params';
|
|
13
13
|
import { calcDeCodeNameById, findFieldById } from '../../model';
|
|
@@ -28,13 +28,13 @@ export async function openRedirectView(
|
|
|
28
28
|
appView: IAppRedirectView,
|
|
29
29
|
context: IContext,
|
|
30
30
|
params: IParams = {},
|
|
31
|
-
|
|
31
|
+
opts: IOpenViewOptions = {},
|
|
32
32
|
): Promise<IModalData> {
|
|
33
33
|
return openDERedirectView(
|
|
34
34
|
appView as IAppDERedirectView,
|
|
35
35
|
context,
|
|
36
36
|
params,
|
|
37
|
-
|
|
37
|
+
opts,
|
|
38
38
|
);
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -52,6 +52,7 @@ export async function openRedirectView(
|
|
|
52
52
|
export async function toLocalOpenWFRedirectView(
|
|
53
53
|
context: IContext,
|
|
54
54
|
linkUrl: string,
|
|
55
|
+
opts: IOpenViewOptions = {},
|
|
55
56
|
): Promise<void> {
|
|
56
57
|
const i = linkUrl.lastIndexOf('?');
|
|
57
58
|
const queryStr: string = decodeURIComponent(
|
|
@@ -102,6 +103,7 @@ export async function toLocalOpenWFRedirectView(
|
|
|
102
103
|
deRdView.id,
|
|
103
104
|
context,
|
|
104
105
|
params,
|
|
106
|
+
opts,
|
|
105
107
|
);
|
|
106
108
|
}
|
|
107
109
|
|
|
@@ -121,7 +123,7 @@ export async function openDERedirectView(
|
|
|
121
123
|
appView: IAppDERedirectView,
|
|
122
124
|
context: IContext,
|
|
123
125
|
params: IParams = {},
|
|
124
|
-
|
|
126
|
+
opts: IOpenViewOptions = {},
|
|
125
127
|
): Promise<IModalData> {
|
|
126
128
|
// 计算重定向视图上下文参数转换
|
|
127
129
|
const navContext = appView.appViewNavContexts || [];
|
|
@@ -135,7 +137,7 @@ export async function openDERedirectView(
|
|
|
135
137
|
// 重定向视图对应应用实体
|
|
136
138
|
const entityId = appView.appDataEntityId!;
|
|
137
139
|
const key = calcDeCodeNameById(entityId);
|
|
138
|
-
let curData: IData = data[0] || {};
|
|
140
|
+
let curData: IData = opts.data?.[0] || {};
|
|
139
141
|
// 将数据主键转换到上下文当中
|
|
140
142
|
context[key] = curData[key] || context[key] || params[key];
|
|
141
143
|
// 实体重定向视图获取数据行为
|
|
@@ -171,7 +173,7 @@ export async function openDERedirectView(
|
|
|
171
173
|
});
|
|
172
174
|
}
|
|
173
175
|
if (linkUrl.startsWith('appredirectview?')) {
|
|
174
|
-
await toLocalOpenWFRedirectView(context, linkUrl);
|
|
176
|
+
await toLocalOpenWFRedirectView(context, linkUrl, opts);
|
|
175
177
|
return { ok: true, data: [] };
|
|
176
178
|
}
|
|
177
179
|
return { ok: false, data: [] };
|
|
@@ -204,7 +206,7 @@ export async function openDERedirectView(
|
|
|
204
206
|
viewId,
|
|
205
207
|
context,
|
|
206
208
|
params,
|
|
207
|
-
{ data: [curData] },
|
|
209
|
+
{ ...opts, data: [curData] },
|
|
208
210
|
);
|
|
209
211
|
if (result) {
|
|
210
212
|
return result;
|
|
@@ -283,7 +285,7 @@ export async function calcDERdTag(
|
|
|
283
285
|
}
|
|
284
286
|
}
|
|
285
287
|
if (notNilEmpty(typeValue)) {
|
|
286
|
-
rdTag = `${defView}:${typeValue.toUpperCase()}`;
|
|
288
|
+
rdTag = `${defView}:${typeValue.toString().toUpperCase()}`;
|
|
287
289
|
} else {
|
|
288
290
|
rdTag = `${defView}`;
|
|
289
291
|
}
|
|
@@ -29,11 +29,11 @@ export function getWFSubmitViewId(
|
|
|
29
29
|
view: IAppView,
|
|
30
30
|
link: WFLink,
|
|
31
31
|
): string | undefined {
|
|
32
|
-
const { type,
|
|
32
|
+
const { type, sequenceflowview, sequenceflowmobview } = link;
|
|
33
33
|
const appViewRefs = view.viewLayoutPanel?.appViewRefs || view.appViewRefs;
|
|
34
34
|
const key = type
|
|
35
35
|
? `WFUTILACTION@${type.toUpperCase()}`
|
|
36
|
-
: `WFACTION@${ibiz.env.isMob ?
|
|
36
|
+
: `WFACTION@${ibiz.env.isMob ? sequenceflowmobview : sequenceflowview}`;
|
|
37
37
|
const submitViewRef = appViewRefs!.find(viewRef => {
|
|
38
38
|
return viewRef.name === key;
|
|
39
39
|
});
|