@ibiz-template/runtime 0.4.6 → 0.4.8

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 (61) hide show
  1. package/dist/index.esm.js +176 -109
  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/controller/controller/control/i-tree.controller.d.ts +5 -3
  24. package/out/interface/controller/controller/control/i-tree.controller.d.ts.map +1 -1
  25. package/out/interface/logic-scheduler/i-scheduler-logic.d.ts +8 -0
  26. package/out/interface/logic-scheduler/i-scheduler-logic.d.ts.map +1 -1
  27. package/out/logic-scheduler/executor/app-ui-action-executor.d.ts.map +1 -1
  28. package/out/logic-scheduler/executor/app-ui-action-executor.js +1 -1
  29. package/out/logic-scheduler/executor/app-ui-logic-executor.d.ts +1 -1
  30. package/out/logic-scheduler/executor/app-ui-logic-executor.d.ts.map +1 -1
  31. package/out/logic-scheduler/executor/app-ui-logic-executor.js +15 -8
  32. package/out/model/ui-action/ui-action.d.ts +5 -3
  33. package/out/model/ui-action/ui-action.d.ts.map +1 -1
  34. package/out/model/ui-action/ui-action.js +5 -4
  35. package/out/ui-action/provider/ui-action-provider-base.d.ts +1 -1
  36. package/out/ui-action/provider/ui-action-provider-base.d.ts.map +1 -1
  37. package/out/ui-action/provider/ui-action-provider-base.js +4 -4
  38. package/out/ui-action/uiaction-util.d.ts +2 -2
  39. package/out/ui-action/uiaction-util.d.ts.map +1 -1
  40. package/out/ui-action/uiaction-util.js +4 -4
  41. package/out/ui-logic/ui-logic-node/de-ui-action-node/de-ui-action-node.d.ts.map +1 -1
  42. package/out/ui-logic/ui-logic-node/de-ui-action-node/de-ui-action-node.js +1 -1
  43. package/package.json +2 -2
  44. package/src/controller/control/dashboard/portlet/portlet-part/portlet-part.controller.ts +11 -7
  45. package/src/controller/control/data-view/data-view.controller.ts +33 -21
  46. package/src/controller/control/form/form-detail/form-button/form-button.controller.ts +12 -8
  47. package/src/controller/control/form/form-detail/form-group-panel/form-group-panel.controller.ts +11 -7
  48. package/src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts +11 -7
  49. package/src/controller/control/grid/grid-column/grid-ua-column/grid-ua-column.controller.ts +11 -7
  50. package/src/controller/control/md-ctrl/md-ctrl.controller.ts +11 -7
  51. package/src/controller/control/toolbar/toolbar.controllerr.ts +10 -6
  52. package/src/controller/control/tree/tree.controller.ts +14 -7
  53. package/src/controller/utils/button-state/ui-action-button.state.ts +1 -1
  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/logic-scheduler/executor/app-ui-logic-executor.ts +22 -15
  58. package/src/model/ui-action/ui-action.ts +5 -3
  59. package/src/ui-action/provider/ui-action-provider-base.ts +8 -3
  60. package/src/ui-action/uiaction-util.ts +4 -2
  61. package/src/ui-logic/ui-logic-node/de-ui-action-node/de-ui-action-node.ts +10 -6
@@ -272,13 +272,17 @@ export class DataViewControlController<
272
272
  event: MouseEvent,
273
273
  ): Promise<void> {
274
274
  const actionId = detail.uiactionId;
275
- await UIActionUtil.execAndResolved(actionId!, {
276
- context: this.context,
277
- params: this.params,
278
- data: [item],
279
- view: this.view,
280
- event,
281
- });
275
+ await UIActionUtil.execAndResolved(
276
+ actionId!,
277
+ {
278
+ context: this.context,
279
+ params: this.params,
280
+ data: [item],
281
+ view: this.view,
282
+ event,
283
+ },
284
+ detail.appId,
285
+ );
282
286
  }
283
287
 
284
288
  /**
@@ -425,13 +429,17 @@ export class DataViewControlController<
425
429
  */
426
430
  onClickNew(event: MouseEvent, group: string | number): void {
427
431
  const params = { ...this.params, srfgroup: group };
428
- UIActionUtil.execAndResolved('new', {
429
- context: this.context,
430
- params,
431
- data: [],
432
- view: this.view,
433
- event,
434
- });
432
+ UIActionUtil.execAndResolved(
433
+ 'new',
434
+ {
435
+ context: this.context,
436
+ params,
437
+ data: [],
438
+ view: this.view,
439
+ event,
440
+ },
441
+ this.view.model.appId,
442
+ );
435
443
  }
436
444
 
437
445
  /**
@@ -449,13 +457,17 @@ export class DataViewControlController<
449
457
  ): Promise<void> {
450
458
  const actionId = detail.uiactionId;
451
459
  const params = { ...this.params, srfgroup: group.key };
452
- await UIActionUtil.execAndResolved(actionId!, {
453
- context: this.context,
454
- params,
455
- data: group.selectedData || [],
456
- view: this.view,
457
- event,
458
- });
460
+ await UIActionUtil.execAndResolved(
461
+ actionId!,
462
+ {
463
+ context: this.context,
464
+ params,
465
+ data: group.selectedData || [],
466
+ view: this.view,
467
+ event,
468
+ },
469
+ detail.appId,
470
+ );
459
471
  }
460
472
 
461
473
  /**
@@ -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;
@@ -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
  }
@@ -29,21 +29,26 @@ export class AppUILogicExecutor extends LogicExecutor {
29
29
  declare type: 'APPUILOGIC';
30
30
 
31
31
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
32
- execute(executeParams: IUILogicParams): any {
33
- if (this.logic.id === 'opendata' && this.logic.builtinAppUILogic) {
34
- // 执行打开数据界面逻辑
35
- return this.executeOpenDataAppUILogic(
36
- this.logic.builtinAppUILogic as IAppUIOpenDataLogic,
37
- executeParams,
38
- );
39
- }
40
- if (this.logic.id === 'newdata' && this.logic.builtinAppUILogic) {
41
- // 执行新建数据逻辑
42
- return this.executeNewDataAppUILogic(
43
- this.logic.builtinAppUILogic as IAppUINewDataLogic,
44
- executeParams,
45
- );
32
+ async execute(executeParams: IUILogicParams): Promise<any> {
33
+ let result;
34
+ try {
35
+ if (this.logic.id === 'opendata' && this.logic.builtinAppUILogic) {
36
+ // 执行打开数据界面逻辑
37
+ result = await this.executeOpenDataAppUILogic(
38
+ this.logic.builtinAppUILogic as IAppUIOpenDataLogic,
39
+ executeParams,
40
+ );
41
+ } else if (this.logic.id === 'newdata' && this.logic.builtinAppUILogic) {
42
+ // 执行新建数据逻辑
43
+ result = await this.executeNewDataAppUILogic(
44
+ this.logic.builtinAppUILogic as IAppUINewDataLogic,
45
+ executeParams,
46
+ );
47
+ }
48
+ } catch (error) {
49
+ ibiz.log.error(error);
46
50
  }
51
+ return result;
47
52
  }
48
53
 
49
54
  /**
@@ -291,7 +296,9 @@ export class AppUILogicExecutor extends LogicExecutor {
291
296
  throw new RuntimeError('请选中一条数据');
292
297
  }
293
298
  const indexType = selectData.srfkey;
294
- const findView = newDataAppViews?.find(item => item.refMode === indexType);
299
+ const findView = newDataAppViews?.find(
300
+ item => item.refMode?.toUpperCase() === indexType.toUpperCase(),
301
+ );
295
302
  if (!findView) {
296
303
  throw new RuntimeError(
297
304
  `没有找到与索引类型${indexType}相关的实体的编辑视图`,
@@ -2,16 +2,18 @@ import { IAppDEUIAction } from '@ibiz/model-core';
2
2
 
3
3
  /**
4
4
  * 通过id获取界面行为模型方法
5
- * @author lxm
6
- * @date 2023-05-18 09:24:40
5
+ *
6
+ * @author chitanda
7
+ * @date 2023-12-07 17:12:16
7
8
  * @export
8
9
  * @param {string} id
10
+ * @param {string} appId
9
11
  * @return {*} {(Promise<IAppDEUIAction | undefined>)}
10
12
  */
11
13
  export async function getUIActionById(
12
14
  id: string,
15
+ appId: string,
13
16
  ): Promise<IAppDEUIAction | undefined> {
14
- const [, , appId] = id.split('@');
15
17
  const app = ibiz.hub.getApp(appId);
16
18
  return app.getUIAction(id);
17
19
  }
@@ -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
  }