@ibiz-template/runtime 0.4.6-dev.0 → 0.4.8-dev.0

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.
Files changed (60) hide show
  1. package/dist/index.esm.js +153 -96
  2. package/dist/index.system.min.js +2 -2
  3. package/out/controller/control/dashboard/portlet/portlet-part/portlet-part.controller.d.ts.map +1 -1
  4. package/out/controller/control/dashboard/portlet/portlet-part/portlet-part.controller.js +1 -1
  5. package/out/controller/control/data-view/data-view.controller.d.ts.map +1 -1
  6. package/out/controller/control/data-view/data-view.controller.js +3 -3
  7. package/out/controller/control/form/form-detail/form-button/form-button.controller.d.ts.map +1 -1
  8. package/out/controller/control/form/form-detail/form-button/form-button.controller.js +1 -1
  9. package/out/controller/control/form/form-detail/form-group-panel/form-group-panel.controller.d.ts.map +1 -1
  10. package/out/controller/control/form/form-detail/form-group-panel/form-group-panel.controller.js +1 -1
  11. package/out/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.d.ts.map +1 -1
  12. package/out/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.js +1 -1
  13. package/out/controller/control/grid/grid-column/grid-ua-column/grid-ua-column.controller.d.ts.map +1 -1
  14. package/out/controller/control/grid/grid-column/grid-ua-column/grid-ua-column.controller.js +1 -1
  15. package/out/controller/control/md-ctrl/md-ctrl.controller.d.ts.map +1 -1
  16. package/out/controller/control/md-ctrl/md-ctrl.controller.js +1 -1
  17. package/out/controller/control/toolbar/toolbar.controllerr.d.ts.map +1 -1
  18. package/out/controller/control/toolbar/toolbar.controllerr.js +2 -2
  19. package/out/controller/control/tree/tree.controller.d.ts +5 -3
  20. package/out/controller/control/tree/tree.controller.d.ts.map +1 -1
  21. package/out/controller/control/tree/tree.controller.js +6 -4
  22. package/out/controller/utils/button-state/ui-action-button.state.js +1 -1
  23. package/out/interface/common/i-app-hub-service/i-app-hub-service.d.ts +3 -3
  24. package/out/interface/common/i-app-hub-service/i-app-hub-service.d.ts.map +1 -1
  25. package/out/interface/controller/controller/control/i-tree.controller.d.ts +5 -3
  26. package/out/interface/controller/controller/control/i-tree.controller.d.ts.map +1 -1
  27. package/out/interface/logic-scheduler/i-scheduler-logic.d.ts +8 -0
  28. package/out/interface/logic-scheduler/i-scheduler-logic.d.ts.map +1 -1
  29. package/out/logic-scheduler/executor/app-ui-action-executor.d.ts.map +1 -1
  30. package/out/logic-scheduler/executor/app-ui-action-executor.js +1 -1
  31. package/out/model/ui-action/ui-action.d.ts +1 -1
  32. package/out/model/ui-action/ui-action.d.ts.map +1 -1
  33. package/out/model/ui-action/ui-action.js +1 -2
  34. package/out/ui-action/provider/ui-action-provider-base.d.ts +1 -1
  35. package/out/ui-action/provider/ui-action-provider-base.d.ts.map +1 -1
  36. package/out/ui-action/provider/ui-action-provider-base.js +4 -4
  37. package/out/ui-action/uiaction-util.d.ts +2 -2
  38. package/out/ui-action/uiaction-util.d.ts.map +1 -1
  39. package/out/ui-action/uiaction-util.js +4 -4
  40. package/out/ui-logic/ui-logic-node/de-ui-action-node/de-ui-action-node.d.ts.map +1 -1
  41. package/out/ui-logic/ui-logic-node/de-ui-action-node/de-ui-action-node.js +1 -1
  42. package/package.json +3 -3
  43. package/src/controller/control/dashboard/portlet/portlet-part/portlet-part.controller.ts +11 -7
  44. package/src/controller/control/data-view/data-view.controller.ts +33 -21
  45. package/src/controller/control/form/form-detail/form-button/form-button.controller.ts +12 -8
  46. package/src/controller/control/form/form-detail/form-group-panel/form-group-panel.controller.ts +11 -7
  47. package/src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts +11 -7
  48. package/src/controller/control/grid/grid-column/grid-ua-column/grid-ua-column.controller.ts +11 -7
  49. package/src/controller/control/md-ctrl/md-ctrl.controller.ts +11 -7
  50. package/src/controller/control/toolbar/toolbar.controllerr.ts +10 -6
  51. package/src/controller/control/tree/tree.controller.ts +14 -7
  52. package/src/controller/utils/button-state/ui-action-button.state.ts +1 -1
  53. package/src/interface/common/i-app-hub-service/i-app-hub-service.ts +3 -3
  54. package/src/interface/controller/controller/control/i-tree.controller.ts +5 -2
  55. package/src/interface/logic-scheduler/i-scheduler-logic.ts +9 -0
  56. package/src/logic-scheduler/executor/app-ui-action-executor.ts +5 -1
  57. package/src/model/ui-action/ui-action.ts +1 -1
  58. package/src/ui-action/provider/ui-action-provider-base.ts +8 -3
  59. package/src/ui-action/uiaction-util.ts +4 -2
  60. package/src/ui-logic/ui-logic-node/de-ui-action-node/de-ui-action-node.ts +10 -6
@@ -50,14 +50,18 @@ export class FormButtonController extends FormDetailController<IDEFormButton> {
50
50
  */
51
51
  async doUIAction(event: MouseEvent): Promise<void> {
52
52
  const actionId = this.model.uiactionId;
53
- await UIActionUtil.execAndResolved(actionId!, {
54
- context: this.form.context,
55
- params: this.form.params,
56
- data: [this.data],
57
- view: this.form.view,
58
- event,
59
- noWaitRoute: true,
60
- });
53
+ await UIActionUtil.execAndResolved(
54
+ actionId!,
55
+ {
56
+ context: this.form.context,
57
+ params: this.form.params,
58
+ data: [this.data],
59
+ view: this.form.view,
60
+ event,
61
+ noWaitRoute: true,
62
+ },
63
+ this.model.appId,
64
+ );
61
65
  }
62
66
 
63
67
  /**
@@ -108,12 +108,16 @@ export class FormGroupPanelController<
108
108
  ): Promise<void> {
109
109
  const actionId = detail.uiactionId;
110
110
 
111
- await UIActionUtil.execAndResolved(actionId!, {
112
- context: this.form.context,
113
- params: this.form.params,
114
- data: [this.data],
115
- view: this.form.view,
116
- event,
117
- });
111
+ await UIActionUtil.execAndResolved(
112
+ actionId!,
113
+ {
114
+ context: this.form.context,
115
+ params: this.form.params,
116
+ data: [this.data],
117
+ view: this.form.view,
118
+ event,
119
+ },
120
+ detail.appId,
121
+ );
118
122
  }
119
123
  }
@@ -174,13 +174,17 @@ export class GridFieldColumnController extends GridColumnController<IDEGridField
174
174
  */
175
175
  async triggerAction(row: GridRowState, event: MouseEvent): Promise<void> {
176
176
  const actionId = this.model.deuiactionId;
177
- await UIActionUtil.execAndResolved(actionId!, {
178
- context: this.context,
179
- params: this.params,
180
- data: [row.data],
181
- view: this.grid.view,
182
- event,
183
- });
177
+ await UIActionUtil.execAndResolved(
178
+ actionId!,
179
+ {
180
+ context: this.context,
181
+ params: this.params,
182
+ data: [row.data],
183
+ view: this.grid.view,
184
+ event,
185
+ },
186
+ this.model.appId,
187
+ );
184
188
  }
185
189
 
186
190
  /**
@@ -59,12 +59,16 @@ export class GridUAColumnController extends GridColumnController<IDEGridUAColumn
59
59
  event: MouseEvent,
60
60
  ): Promise<void> {
61
61
  const actionId = detail.uiactionId;
62
- await UIActionUtil.execAndResolved(actionId!, {
63
- context: this.context,
64
- params: this.params,
65
- data: [row.data],
66
- view: this.grid.view,
67
- event,
68
- });
62
+ await UIActionUtil.execAndResolved(
63
+ actionId!,
64
+ {
65
+ context: this.context,
66
+ params: this.params,
67
+ data: [row.data],
68
+ view: this.grid.view,
69
+ event,
70
+ },
71
+ detail.appId,
72
+ );
69
73
  }
70
74
  }
@@ -165,13 +165,17 @@ export class MDCtrlController
165
165
  event: MouseEvent,
166
166
  ): Promise<void> {
167
167
  const actionId = detail.uiactionId;
168
- await UIActionUtil.execAndResolved(actionId!, {
169
- context: this.context,
170
- params: this.params,
171
- data: [row.data],
172
- view: this.view,
173
- event,
174
- });
168
+ await UIActionUtil.execAndResolved(
169
+ actionId!,
170
+ {
171
+ context: this.context,
172
+ params: this.params,
173
+ data: [row.data],
174
+ view: this.view,
175
+ event,
176
+ },
177
+ detail.appId,
178
+ );
175
179
  }
176
180
 
177
181
  /**
@@ -70,7 +70,7 @@ export class ToolbarController<
70
70
  // 执行界面行为
71
71
  if (item.itemType === 'DEUIACTION') {
72
72
  const actionId = (item as IDETBUIActionItem).uiactionId;
73
- const uiAction = await getUIActionById(actionId!);
73
+ const uiAction = await getUIActionById(actionId!, item.appId);
74
74
  if (!uiAction) {
75
75
  throw new RuntimeError(`没有找到界面行为模型${actionId}`);
76
76
  }
@@ -89,11 +89,15 @@ export class ToolbarController<
89
89
  const data = res || [];
90
90
  const args = this.getEventArgs();
91
91
  args.params = Object.assign(param, args.params);
92
- await UIActionUtil.execAndResolved(actionId!, {
93
- ...args,
94
- data,
95
- event,
96
- });
92
+ await UIActionUtil.execAndResolved(
93
+ actionId!,
94
+ {
95
+ ...args,
96
+ data,
97
+ event,
98
+ },
99
+ item.appId,
100
+ );
97
101
  } finally {
98
102
  if (enableLoading) {
99
103
  this.state.buttonsState.setLoading('');
@@ -292,25 +292,32 @@ export class TreeController
292
292
 
293
293
  /**
294
294
  * 执行界面行为
295
- * @author lxm
296
- * @date 2023-07-27 05:31:36
295
+ *
296
+ * @author chitanda
297
+ * @date 2023-12-07 15:12:26
297
298
  * @param {string} uiActionId
298
299
  * @param {ITreeNodeData} nodeData
299
300
  * @param {MouseEvent} event
301
+ * @param {string} appId
300
302
  * @return {*} {Promise<void>}
301
303
  */
302
304
  async doUIAction(
303
305
  uiActionId: string,
304
306
  nodeData: ITreeNodeData,
305
307
  event: MouseEvent,
308
+ appId: string,
306
309
  ): Promise<void> {
307
310
  const eventArgs = this.getEventArgs();
308
311
  const nodeParams = this.parseTreeNodeData(nodeData);
309
- const result = await UIActionUtil.exec(uiActionId!, {
310
- ...eventArgs,
311
- ...nodeParams,
312
- event,
313
- });
312
+ const result = await UIActionUtil.exec(
313
+ uiActionId!,
314
+ {
315
+ ...eventArgs,
316
+ ...nodeParams,
317
+ event,
318
+ },
319
+ appId,
320
+ );
314
321
  if (result.closeView) {
315
322
  this.view.closeView();
316
323
  } else if (result.refresh) {
@@ -93,7 +93,7 @@ export class UIActionButtonState implements IButtonState {
93
93
  this.isInit = true;
94
94
  return;
95
95
  }
96
- const uiAction = await getUIActionById(this.uiActionId);
96
+ const uiAction = await getUIActionById(this.uiActionId, this.appId);
97
97
  [, this.appDeName] = this.uiActionId.split('@');
98
98
  if (!uiAction) {
99
99
  return;
@@ -135,7 +135,7 @@ export interface IAppHubService {
135
135
  * @param {string} [appId=ibiz.env.appId]
136
136
  * @return {*} {Promise<IAppDataEntity>}
137
137
  */
138
- getAppDataEntity(id: string, appId: string): Promise<IAppDataEntity>;
138
+ getAppDataEntity(id: string, appId?: string): Promise<IAppDataEntity>;
139
139
 
140
140
  /**
141
141
  * 异步获取应用对象,用于不确定应用是否已经加载的情况
@@ -145,7 +145,7 @@ export interface IAppHubService {
145
145
  * @param {string} [appId=ibiz.env.appId]
146
146
  * @return {*} {Promise<IAppService>}
147
147
  */
148
- getAppAsync(appId: string): Promise<IAppService>;
148
+ getAppAsync(appId?: string): Promise<IAppService>;
149
149
 
150
150
  /**
151
151
  * 获取应用实例
@@ -155,5 +155,5 @@ export interface IAppHubService {
155
155
  * @param {(string | IApplication)} [app]
156
156
  * @return {*} {IAppService}
157
157
  */
158
- getApp(app: string | IApplication): IAppService;
158
+ getApp(app?: string | IApplication): IAppService;
159
159
  }
@@ -32,17 +32,20 @@ export interface ITreeController
32
32
 
33
33
  /**
34
34
  * 执行界面行为
35
- * @author lxm
36
- * @date 2023-07-27 05:31:36
35
+ *
36
+ * @author chitanda
37
+ * @date 2023-12-07 15:12:51
37
38
  * @param {string} uiActionId
38
39
  * @param {ITreeNodeData} nodeData
39
40
  * @param {MouseEvent} event
41
+ * @param {string} appId
40
42
  * @return {*} {Promise<void>}
41
43
  */
42
44
  doUIAction(
43
45
  uiActionId: string,
44
46
  nodeData: ITreeNodeData,
45
47
  event: MouseEvent,
48
+ appId: string,
46
49
  ): Promise<void>;
47
50
 
48
51
  /**
@@ -24,6 +24,15 @@ export type LogicType =
24
24
  | 'SYSVIEWLOGIC';
25
25
 
26
26
  export interface ISchedulerLogic {
27
+ /**
28
+ * 应用标识
29
+ *
30
+ * @author chitanda
31
+ * @date 2023-12-07 14:12:23
32
+ * @type {string}
33
+ */
34
+ appId: string;
35
+
27
36
  /**
28
37
  * 触发器类型
29
38
  * @author lxm
@@ -22,6 +22,10 @@ export class AppDEUIActionExecutor extends LogicExecutor {
22
22
  `逻辑中缺少触发应用实体界面行为id`,
23
23
  );
24
24
  }
25
- UIActionUtil.execAndResolved(this.logic.appDEUIActionId, executeParams);
25
+ UIActionUtil.execAndResolved(
26
+ this.logic.appDEUIActionId,
27
+ executeParams,
28
+ this.logic.appId,
29
+ );
26
30
  }
27
31
  }
@@ -10,8 +10,8 @@ import { IAppDEUIAction } from '@ibiz/model-core';
10
10
  */
11
11
  export async function getUIActionById(
12
12
  id: string,
13
+ appId: string,
13
14
  ): Promise<IAppDEUIAction | undefined> {
14
- const [, , appId] = id.split('@');
15
15
  const app = ibiz.hub.getApp(appId);
16
16
  return app.getUIAction(id);
17
17
  }
@@ -70,9 +70,13 @@ export abstract class UIActionProviderBase implements IUIActionProvider {
70
70
  };
71
71
  if (action.closeEditView) {
72
72
  // 关闭视图的情况下,不等待后续界面行为
73
- this.doNextAction(action, nextActionParams);
73
+ this.doNextAction(action, nextActionParams, action.appId);
74
74
  } else {
75
- const nextResult = await this.doNextAction(action, nextActionParams);
75
+ const nextResult = await this.doNextAction(
76
+ action,
77
+ nextActionParams,
78
+ action.appId,
79
+ );
76
80
  if (nextResult) {
77
81
  Object.assign(result, nextResult);
78
82
  if (nextResult.cancel === true) {
@@ -160,10 +164,11 @@ export abstract class UIActionProviderBase implements IUIActionProvider {
160
164
  async doNextAction(
161
165
  action: IAppDEUIAction,
162
166
  params: IUILogicParams,
167
+ appId: string,
163
168
  ): Promise<IUIActionResult | undefined> {
164
169
  const nextActionId = action.nextId;
165
170
  if (nextActionId) {
166
- return UIActionUtil.exec(nextActionId, params);
171
+ return UIActionUtil.exec(nextActionId, params, appId);
167
172
  }
168
173
  }
169
174
 
@@ -26,8 +26,9 @@ export class UIActionUtil {
26
26
  static async exec(
27
27
  actionId: string,
28
28
  params: IUILogicParams,
29
+ appId: string,
29
30
  ): Promise<IUIActionResult> {
30
- const action = await getUIActionById(actionId);
31
+ const action = await getUIActionById(actionId, appId);
31
32
  if (!action) {
32
33
  throw new RuntimeError(`没找到${actionId}的界面行为模型`);
33
34
  }
@@ -53,8 +54,9 @@ export class UIActionUtil {
53
54
  static async execAndResolved(
54
55
  actionId: string,
55
56
  params: IUILogicParams,
57
+ appId: string,
56
58
  ): Promise<void> {
57
- const result = await this.exec(actionId, params);
59
+ const result = await this.exec(actionId, params, appId);
58
60
  if (result.closeView) {
59
61
  params.view.modal.ignoreDismissCheck = true;
60
62
  params.view.closeView({ ok: true });
@@ -32,11 +32,15 @@ export class DEUIActionNode extends UILogicNode {
32
32
  }
33
33
  }
34
34
 
35
- await UIActionUtil.execAndResolved(dstAppDEUIActionId!, {
36
- ...parameters,
37
- context: ctx.context,
38
- params: ctx.viewParam,
39
- data: actionData,
40
- });
35
+ await UIActionUtil.execAndResolved(
36
+ dstAppDEUIActionId!,
37
+ {
38
+ ...parameters,
39
+ context: ctx.context,
40
+ params: ctx.viewParam,
41
+ data: actionData,
42
+ },
43
+ this.model.appId,
44
+ );
41
45
  }
42
46
  }