@ibiz-template/runtime 0.5.0-beta.0 → 0.5.0-beta.1

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 (70) hide show
  1. package/dist/index.esm.js +352 -553
  2. package/dist/index.system.min.js +2 -2
  3. package/out/controller/common/control/md-control.controller.d.ts +21 -1
  4. package/out/controller/common/control/md-control.controller.d.ts.map +1 -1
  5. package/out/controller/common/control/md-control.controller.js +31 -0
  6. package/out/controller/control/gantt/gantt.controller.d.ts +6 -189
  7. package/out/controller/control/gantt/gantt.controller.d.ts.map +1 -1
  8. package/out/controller/control/gantt/gantt.controller.js +6 -412
  9. package/out/controller/control/gantt/gantt.service.d.ts +2 -2
  10. package/out/controller/control/gantt/gantt.service.d.ts.map +1 -1
  11. package/out/controller/control/gantt/gantt.service.js +5 -5
  12. package/out/controller/control/list/list.controller.d.ts +1 -30
  13. package/out/controller/control/list/list.controller.d.ts.map +1 -1
  14. package/out/controller/control/list/list.controller.js +0 -41
  15. package/out/controller/control/search-bar/search-bar.controller.d.ts.map +1 -1
  16. package/out/controller/control/search-bar/search-bar.controller.js +48 -4
  17. package/out/controller/control/search-bar/search-bar.service.d.ts +24 -0
  18. package/out/controller/control/search-bar/search-bar.service.d.ts.map +1 -1
  19. package/out/controller/control/search-bar/search-bar.service.js +62 -16
  20. package/out/interface/controller/event/control/i-gantt.event.d.ts +2 -44
  21. package/out/interface/controller/event/control/i-gantt.event.d.ts.map +1 -1
  22. package/out/interface/controller/state/control/i-gantt.state.d.ts +2 -41
  23. package/out/interface/controller/state/control/i-gantt.state.d.ts.map +1 -1
  24. package/out/interface/controller/state/control/i-search-bar.state.d.ts +8 -1
  25. package/out/interface/controller/state/control/i-search-bar.state.d.ts.map +1 -1
  26. package/out/interface/service/i-parent-config/i-parent-config.d.ts +67 -0
  27. package/out/interface/service/i-parent-config/i-parent-config.d.ts.map +1 -0
  28. package/out/interface/service/i-parent-config/i-parent-config.js +1 -0
  29. package/out/interface/service/index.d.ts +1 -0
  30. package/out/interface/service/index.d.ts.map +1 -1
  31. package/out/service/dto/method.dto.d.ts +20 -0
  32. package/out/service/dto/method.dto.d.ts.map +1 -1
  33. package/out/service/dto/method.dto.js +63 -1
  34. package/out/service/vo/gantt-node-data/gantt-data-set-node-data.d.ts +0 -1
  35. package/out/service/vo/gantt-node-data/gantt-data-set-node-data.d.ts.map +1 -1
  36. package/out/service/vo/gantt-node-data/gantt-data-set-node-data.js +1 -2
  37. package/out/service/vo/gantt-node-data/gantt-node-data-util.d.ts +0 -7
  38. package/out/service/vo/gantt-node-data/gantt-node-data-util.d.ts.map +1 -1
  39. package/out/service/vo/gantt-node-data/gantt-node-data-util.js +0 -18
  40. package/out/ui-action/provider/ui-action-provider-base.d.ts +10 -0
  41. package/out/ui-action/provider/ui-action-provider-base.d.ts.map +1 -1
  42. package/out/ui-action/provider/ui-action-provider-base.js +20 -9
  43. package/out/utils/index.d.ts +1 -1
  44. package/out/utils/index.d.ts.map +1 -1
  45. package/out/utils/index.js +1 -1
  46. package/out/utils/open-redirect-view/open-redirect-view.d.ts +25 -1
  47. package/out/utils/open-redirect-view/open-redirect-view.d.ts.map +1 -1
  48. package/out/utils/open-redirect-view/open-redirect-view.js +72 -31
  49. package/out/utils/ui-domain/ui-domain.d.ts +28 -0
  50. package/out/utils/ui-domain/ui-domain.d.ts.map +1 -1
  51. package/out/utils/ui-domain/ui-domain.js +40 -0
  52. package/package.json +5 -5
  53. package/src/controller/common/control/md-control.controller.ts +43 -0
  54. package/src/controller/control/gantt/gantt.controller.ts +7 -492
  55. package/src/controller/control/gantt/gantt.service.ts +5 -5
  56. package/src/controller/control/list/list.controller.ts +0 -54
  57. package/src/controller/control/search-bar/search-bar.controller.ts +63 -10
  58. package/src/controller/control/search-bar/search-bar.service.ts +70 -16
  59. package/src/interface/controller/event/control/i-gantt.event.ts +2 -38
  60. package/src/interface/controller/state/control/i-gantt.state.ts +2 -47
  61. package/src/interface/controller/state/control/i-search-bar.state.ts +9 -1
  62. package/src/interface/service/i-parent-config/i-parent-config.ts +66 -0
  63. package/src/interface/service/index.ts +1 -0
  64. package/src/service/dto/method.dto.ts +74 -1
  65. package/src/service/vo/gantt-node-data/gantt-data-set-node-data.ts +1 -4
  66. package/src/service/vo/gantt-node-data/gantt-node-data-util.ts +0 -21
  67. package/src/ui-action/provider/ui-action-provider-base.ts +34 -15
  68. package/src/utils/index.ts +1 -0
  69. package/src/utils/open-redirect-view/open-redirect-view.ts +93 -38
  70. package/src/utils/ui-domain/ui-domain.ts +44 -0
@@ -1,5 +1,5 @@
1
1
  import { TreeDataSetNodeData } from '../tree-node-data';
2
- import { calcDataItemValue, calcNodeDataItem } from './gantt-node-data-util';
2
+ import { calcDataItemValue } from './gantt-node-data-util';
3
3
  export class GanttDataSetNodeData extends TreeDataSetNodeData {
4
4
  constructor(model, nodeModel, parentNodeData, opts) {
5
5
  super(nodeModel, parentNodeData, opts);
@@ -10,6 +10,5 @@ export class GanttDataSetNodeData extends TreeDataSetNodeData {
10
10
  this.prevDataItemValue = calcDataItemValue(model.prevDataItemName, nodeModel, data);
11
11
  this.finishDataItemValue = calcDataItemValue(model.finishDataItemName, nodeModel, data);
12
12
  this.totalDataItemValue = calcDataItemValue(model.totalDataItemName, nodeModel, data);
13
- this.nodeDataItem = calcNodeDataItem(nodeModel, data);
14
13
  }
15
14
  }
@@ -6,11 +6,4 @@ import { IDETreeNode } from '@ibiz/model-core';
6
6
  * @returns
7
7
  */
8
8
  export declare const calcDataItemValue: (fieldCodeName: string | undefined, nodeModel: IDETreeNode, data?: IData) => string;
9
- /**
10
- * 计算数据项
11
- * @param nodeModel 节点模型
12
- * @param data 数据
13
- * @returns
14
- */
15
- export declare const calcNodeDataItem: (nodeModel: IDETreeNode, data: IData) => IData;
16
9
  //# sourceMappingURL=gantt-node-data-util.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"gantt-node-data-util.d.ts","sourceRoot":"","sources":["../../../../src/service/vo/gantt-node-data/gantt-node-data-util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAuB,MAAM,kBAAkB,CAAC;AAEpE;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,kBACb,MAAM,GAAG,SAAS,aACtB,WAAW,SAChB,KAAK,KACV,MAaF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,cAChB,WAAW,QAChB,KAAK,KACV,KAUF,CAAC"}
1
+ {"version":3,"file":"gantt-node-data-util.d.ts","sourceRoot":"","sources":["../../../../src/service/vo/gantt-node-data/gantt-node-data-util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAuB,MAAM,kBAAkB,CAAC;AAEpE;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,kBACb,MAAM,GAAG,SAAS,aACtB,WAAW,SAChB,KAAK,KACV,MAaF,CAAC"}
@@ -17,21 +17,3 @@ export const calcDataItemValue = (fieldCodeName, nodeModel, data = {}) => {
17
17
  }
18
18
  return result;
19
19
  };
20
- /**
21
- * 计算数据项
22
- * @param nodeModel 节点模型
23
- * @param data 数据
24
- * @returns
25
- */
26
- export const calcNodeDataItem = (nodeModel, data) => {
27
- var _a;
28
- const dataItem = {};
29
- (_a = nodeModel.detreeNodeDataItems) === null || _a === void 0 ? void 0 : _a.forEach(item => {
30
- if (item.id && item.appDEFieldId) {
31
- Object.assign(dataItem, {
32
- [item.id.toLowerCase()]: data[item.appDEFieldId.toLowerCase()],
33
- });
34
- }
35
- });
36
- return dataItem;
37
- };
@@ -18,6 +18,16 @@ export declare abstract class UIActionProviderBase implements IUIActionProvider
18
18
  * @return {*} {Promise<IUIActionResult>}
19
19
  */
20
20
  exec(action: IAppDEUIAction, args: IUILogicParams): Promise<IUIActionResult>;
21
+ /**
22
+ * 根据界面行为逻辑返回值,合并参数获得后续逻辑要用的参数
23
+ * @author lxm
24
+ * @date 2023-12-25 02:42:23
25
+ * @protected
26
+ * @param {IUILogicParams} args 当前环境的参数
27
+ * @param {IUIActionResult} result 上一次逻辑执行的结果
28
+ * @return {*} {IUILogicParams}
29
+ */
30
+ protected mergeArgsByResult(args: IUILogicParams, result: IUIActionResult): IUILogicParams;
21
31
  /**
22
32
  * 有错误和取消时对result做的处理
23
33
  * @author lxm
@@ -1 +1 @@
1
- {"version":3,"file":"ui-action-provider-base.d.ts","sourceRoot":"","sources":["../../../src/ui-action/provider/ui-action-provider-base.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAgC,MAAM,kBAAkB,CAAC;AAChF,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,cAAc,EACf,MAAM,iBAAiB,CAAC;AAMzB;;;;;;;GAOG;AACH,8BAAsB,oBAAqB,YAAW,iBAAiB;IACrE;;;;;;;OAOG;IACG,IAAI,CACR,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC;IAkE3B;;;;;;;;OAQG;IACH,SAAS,CAAC,WAAW,CAAC,MAAM,EAAE,eAAe,GAAG,eAAe;IAO/D;;;;;;;OAOG;IACG,SAAS,CACb,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,OAAO,CAAC;IAQnB;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,UAAU,CACjB,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,eAAe,CAAC;IAE3B;;;;;;;;;;;OAWG;IACG,YAAY,CAChB,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,cAAc,EACtB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;IAOvC;;;;;;;;;;;;;;;;OAgBG;cACa,YAAY,CAC1B,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EAAE,EACb,MAAM,EAAE,OAAO,GACd,OAAO,CAAC;QACT,aAAa,EAAE,QAAQ,CAAC;QACxB,UAAU,EAAE,KAAK,EAAE,CAAC;QACpB,YAAY,EAAE,OAAO,CAAC;KACvB,CAAC;IAwFF;;;;;;;;;OASG;IACH,SAAS,CAAC,WAAW,CACnB,IAAI,EAAE,SAAS,GAAG,SAAS,EAC3B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,MAAM,GAAG,SAAS;CA2CtB"}
1
+ {"version":3,"file":"ui-action-provider-base.d.ts","sourceRoot":"","sources":["../../../src/ui-action/provider/ui-action-provider-base.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAgC,MAAM,kBAAkB,CAAC;AAChF,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,cAAc,EACf,MAAM,iBAAiB,CAAC;AAMzB;;;;;;;GAOG;AACH,8BAAsB,oBAAqB,YAAW,iBAAiB;IACrE;;;;;;;OAOG;IACG,IAAI,CACR,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC;IAgE3B;;;;;;;;OAQG;IACH,SAAS,CAAC,iBAAiB,CACzB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,eAAe,GACtB,cAAc;IASjB;;;;;;;;OAQG;IACH,SAAS,CAAC,WAAW,CAAC,MAAM,EAAE,eAAe,GAAG,eAAe;IAO/D;;;;;;;OAOG;IACG,SAAS,CACb,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,OAAO,CAAC;IAQnB;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,UAAU,CACjB,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,eAAe,CAAC;IAE3B;;;;;;;;;;;OAWG;IACG,YAAY,CAChB,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,cAAc,EACtB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;IAOvC;;;;;;;;;;;;;;;;OAgBG;cACa,YAAY,CAC1B,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EAAE,EACb,MAAM,EAAE,OAAO,GACd,OAAO,CAAC;QACT,aAAa,EAAE,QAAQ,CAAC;QACxB,UAAU,EAAE,KAAK,EAAE,CAAC;QACpB,YAAY,EAAE,OAAO,CAAC;KACvB,CAAC;IAwFF;;;;;;;;;OASG;IACH,SAAS,CAAC,WAAW,CACnB,IAAI,EAAE,SAAS,GAAG,SAAS,EAC3B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,GACnB,MAAM,GAAG,SAAS;CA2CtB"}
@@ -21,7 +21,6 @@ export class UIActionProviderBase {
21
21
  * @return {*} {Promise<IUIActionResult>}
22
22
  */
23
23
  async exec(action, args) {
24
- const { context, params, data } = args;
25
24
  const result = {
26
25
  refresh: action.reloadData,
27
26
  refreshMode: action.refreshMode,
@@ -47,8 +46,15 @@ export class UIActionProviderBase {
47
46
  if (result.cancel === true) {
48
47
  return this.returnError(result);
49
48
  }
49
+ // ** 界面行为执行之后,执行界面逻辑
50
+ if (action.uilogicAttachMode === 'AFTER') {
51
+ if (!appDEUILogicId) {
52
+ throw new RuntimeModelError(action, '没有配置实体界面逻辑');
53
+ }
54
+ await execUILogic(appDEUILogicId, appDataEntityId, this.mergeArgsByResult(args, result));
55
+ }
50
56
  // ** 后续界面行为
51
- const nextActionParams = Object.assign(Object.assign({}, args), { context: result.nextContext || context, data: result.data || data, params: result.nextParams || params });
57
+ const nextActionParams = this.mergeArgsByResult(args, result);
52
58
  if (action.closeEditView) {
53
59
  // 关闭视图的情况下,不等待后续界面行为
54
60
  this.doNextAction(action, nextActionParams, action.appId);
@@ -62,15 +68,20 @@ export class UIActionProviderBase {
62
68
  }
63
69
  }
64
70
  }
65
- // ** 界面行为执行之后,执行界面逻辑
66
- if (action.uilogicAttachMode === 'AFTER') {
67
- if (!appDEUILogicId) {
68
- throw new RuntimeModelError(action, '没有配置实体界面逻辑');
69
- }
70
- await execUILogic(appDEUILogicId, appDataEntityId, args);
71
- }
72
71
  return result;
73
72
  }
73
+ /**
74
+ * 根据界面行为逻辑返回值,合并参数获得后续逻辑要用的参数
75
+ * @author lxm
76
+ * @date 2023-12-25 02:42:23
77
+ * @protected
78
+ * @param {IUILogicParams} args 当前环境的参数
79
+ * @param {IUIActionResult} result 上一次逻辑执行的结果
80
+ * @return {*} {IUILogicParams}
81
+ */
82
+ mergeArgsByResult(args, result) {
83
+ return Object.assign(Object.assign({}, args), { context: result.nextContext || args.context, data: result.data || args.data, params: result.nextParams || args.params });
84
+ }
74
85
  /**
75
86
  * 有错误和取消时对result做的处理
76
87
  * @author lxm
@@ -1,7 +1,7 @@
1
1
  export { HandlebarsUtil } from './handlebars/handlebars';
2
2
  export { calcNavParams } from './nav-params/calc-nav-params';
3
3
  export * from './nav-params/nav-params';
4
- export { toLocalOpenWFRedirectView, openRedirectView, } from './open-redirect-view/open-redirect-view';
4
+ export { toLocalOpenWFRedirectView, openRedirectView, getDERedirectToView, } from './open-redirect-view/open-redirect-view';
5
5
  export * from './verify';
6
6
  export { LayoutPanelUtil } from './layout-panel-util/layout-panel-util';
7
7
  export * from './wf-helper/wf-helper';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,cAAc,yBAAyB,CAAC;AACxC,OAAO,EACL,yBAAyB,EACzB,gBAAgB,GACjB,MAAM,yCAAyC,CAAC;AACjD,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,cAAc,yBAAyB,CAAC;AACxC,OAAO,EACL,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,yCAAyC,CAAC;AACjD,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC"}
@@ -1,7 +1,7 @@
1
1
  export { HandlebarsUtil } from './handlebars/handlebars';
2
2
  export { calcNavParams } from './nav-params/calc-nav-params';
3
3
  export * from './nav-params/nav-params';
4
- export { toLocalOpenWFRedirectView, openRedirectView, } from './open-redirect-view/open-redirect-view';
4
+ export { toLocalOpenWFRedirectView, openRedirectView, getDERedirectToView, } from './open-redirect-view/open-redirect-view';
5
5
  export * from './verify';
6
6
  export { LayoutPanelUtil } from './layout-panel-util/layout-panel-util';
7
7
  export * from './wf-helper/wf-helper';
@@ -1,5 +1,11 @@
1
1
  import { IAppDERedirectView, IAppDataEntity, IAppRedirectView } from '@ibiz/model-core';
2
2
  import { IModalData, IOpenViewOptions } from '../../interface';
3
+ type ToViewParams = {
4
+ context: IContext;
5
+ params: IParams;
6
+ opts: IOpenViewOptions;
7
+ viewId: string;
8
+ };
3
9
  /**
4
10
  * 打开重定向视图
5
11
  *
@@ -24,7 +30,24 @@ export declare function openRedirectView(appView: IAppRedirectView, context: ICo
24
30
  * @param {IContext} context
25
31
  * @param {string} linkUrl
26
32
  */
27
- export declare function toLocalOpenWFRedirectView(context: IContext, linkUrl: string, opts?: IOpenViewOptions): Promise<void>;
33
+ export declare function toLocalOpenWFRedirectView(context: IContext, linkUrl: string, opts?: IOpenViewOptions): Promise<ToViewParams>;
34
+ /**
35
+ * 获取处理后的重定向视图最终要跳转视图的相关信息
36
+ * @author lxm
37
+ * @date 2023-12-26 11:16:02
38
+ * @export
39
+ * @param {IAppDERedirectView} appView
40
+ * @param {IContext} context
41
+ * @param {IParams} [params={}]
42
+ * @param {IOpenViewOptions} [opts={}]
43
+ * @return {*} {(Promise<({ type: 'view' } & ToViewParams) | { type: 'url'; url: string }>)}
44
+ */
45
+ export declare function getDERedirectToView(appView: IAppDERedirectView, context: IContext, params?: IParams, opts?: IOpenViewOptions): Promise<({
46
+ type: 'view';
47
+ } & ToViewParams) | {
48
+ type: 'url';
49
+ url: string;
50
+ }>;
28
51
  /**
29
52
  * 打开实体重定向视图
30
53
  *
@@ -51,4 +74,5 @@ export declare function openDERedirectView(appView: IAppDERedirectView, context:
51
74
  * @return {*} {Promise<string>}
52
75
  */
53
76
  export declare function calcDERdTag(entity: IAppDataEntity, rdView: IAppDERedirectView, params: IParams, data: IData): Promise<string>;
77
+ export {};
54
78
  //# sourceMappingURL=open-redirect-view.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"open-redirect-view.d.ts","sourceRoot":"","sources":["../../../src/utils/open-redirect-view/open-redirect-view.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAK/D;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,QAAQ,EACjB,MAAM,GAAE,OAAY,EACpB,IAAI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,UAAU,CAAC,CAOrB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAoDf;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,QAAQ,EACjB,MAAM,GAAE,OAAY,EACpB,IAAI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,UAAU,CAAC,CAwGrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,KAAK,GACV,OAAO,CAAC,MAAM,CAAC,CA4CjB"}
1
+ {"version":3,"file":"open-redirect-view.d.ts","sourceRoot":"","sources":["../../../src/utils/open-redirect-view/open-redirect-view.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAK/D,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,QAAQ,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,QAAQ,EACjB,MAAM,GAAE,OAAY,EACpB,IAAI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,UAAU,CAAC,CAOrB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,YAAY,CAAC,CAoDvB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,QAAQ,EACjB,MAAM,GAAE,OAAY,EACpB,IAAI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,YAAY,CAAC,GAAG;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAsG3E;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,QAAQ,EACjB,MAAM,GAAE,OAAY,EACpB,IAAI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,UAAU,CAAC,CA+BrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,KAAK,GACV,OAAO,CAAC,MAAM,CAAC,CA6CjB"}
@@ -65,21 +65,25 @@ export async function toLocalOpenWFRedirectView(context, linkUrl, opts = {}) {
65
65
  context.srfprocessinstanceid = params.srfprocessinstanceid;
66
66
  delete params.srfprocessinstanceid;
67
67
  }
68
- await ibiz.commands.execute(OpenAppViewCommand.TAG, deRdView.id, context, params, opts);
68
+ return {
69
+ context,
70
+ params,
71
+ opts,
72
+ viewId: deRdView.id,
73
+ };
69
74
  }
70
75
  /**
71
- * 打开实体重定向视图
72
- *
73
- * @author chitanda
74
- * @date 2022-09-28 16:09:15
76
+ * 获取处理后的重定向视图最终要跳转视图的相关信息
77
+ * @author lxm
78
+ * @date 2023-12-26 11:16:02
75
79
  * @export
76
80
  * @param {IAppDERedirectView} appView
77
- * @param {IContext}
81
+ * @param {IContext} context
78
82
  * @param {IParams} [params={}]
79
- * @param {IData[]} [data=[]]
80
- * @return {*} {Promise<IModalData>}
83
+ * @param {IOpenViewOptions} [opts={}]
84
+ * @return {*} {(Promise<({ type: 'view' } & ToViewParams) | { type: 'url'; url: string }>)}
81
85
  */
82
- export async function openDERedirectView(appView, context, params = {}, opts = {}) {
86
+ export async function getDERedirectToView(appView, context, params = {}, opts = {}) {
83
87
  var _a;
84
88
  // 计算重定向视图上下文参数转换
85
89
  const navContext = appView.appViewNavContexts || [];
@@ -116,20 +120,13 @@ export async function openDERedirectView(appView, context, params = {}, opts = {
116
120
  linkUrl = linkUrl.slice(linkUrl.indexOf('appredirectview?'));
117
121
  }
118
122
  if (linkUrl.startsWith('http://') || linkUrl.startsWith('https://')) {
119
- return new Promise(resolve => {
120
- const newWindow = window.open(linkUrl, '_blank');
121
- if (newWindow) {
122
- newWindow.callback = () => {
123
- resolve({ ok: true, data: [] });
124
- };
125
- }
126
- });
123
+ return { type: 'url', url: linkUrl };
127
124
  }
128
125
  if (linkUrl.startsWith('appredirectview?')) {
129
- await toLocalOpenWFRedirectView(context, linkUrl, opts);
130
- return { ok: true, data: [] };
126
+ const toView = await toLocalOpenWFRedirectView(context, linkUrl, opts);
127
+ return Object.assign({ type: 'view' }, toView);
131
128
  }
132
- return { ok: false, data: [] };
129
+ throw new RuntimeError(`未支持的linkUrl格式:${linkUrl}`);
133
130
  }
134
131
  }
135
132
  }
@@ -144,8 +141,14 @@ export async function openDERedirectView(appView, context, params = {}, opts = {
144
141
  // 拼接当前重定向视图所在应用实体名称为前缀
145
142
  const deRdTag = `${entity.name.toUpperCase()}:${rdTag}`;
146
143
  // 所有重定向引用视图
147
- const allRefViews = appView.redirectAppViewRefs;
148
- const refView = allRefViews === null || allRefViews === void 0 ? void 0 : allRefViews.find(view => {
144
+ const allRefViews = [];
145
+ if (appView.redirectAppViewRefs) {
146
+ allRefViews.push(...appView.redirectAppViewRefs);
147
+ }
148
+ if (appView.appViewRefs) {
149
+ allRefViews.push(...appView.appViewRefs);
150
+ }
151
+ const refView = allRefViews.find(view => {
149
152
  const matchKey = view.name || view.id;
150
153
  // 特殊补充 wfRdTag 匹配,子流程应用特殊模式
151
154
  return matchKey === deRdTag || matchKey === rdTag || matchKey === wfRdTag;
@@ -153,14 +156,15 @@ export async function openDERedirectView(appView, context, params = {}, opts = {
153
156
  if (refView) {
154
157
  const viewId = refView.refAppViewId;
155
158
  if (viewId) {
156
- const result = await ibiz.commands.execute(OpenAppViewCommand.TAG, viewId, context, params, Object.assign(Object.assign({}, opts), { data: [curData] }));
157
- if (result) {
158
- return result;
159
- }
160
- }
161
- else {
162
- throw new RuntimeModelError(refView, `未配置实际引用视图`);
159
+ return {
160
+ type: 'view',
161
+ viewId,
162
+ context,
163
+ params,
164
+ opts: Object.assign(Object.assign({}, opts), { data: [curData] }),
165
+ };
163
166
  }
167
+ throw new RuntimeModelError(refView, `未配置实际引用视图`);
164
168
  }
165
169
  else {
166
170
  ibiz.log.error('重定向视图引用有:', allRefViews === null || allRefViews === void 0 ? void 0 : allRefViews.map(({ refAppViewId, name, realTitle }) => ({
@@ -170,7 +174,43 @@ export async function openDERedirectView(appView, context, params = {}, opts = {
170
174
  })));
171
175
  throw new RuntimeModelError(appView, `未找到重定向标识[${rdTag}]或[${deRdTag}]或工作流[${wfRdTag}]对应视图`);
172
176
  }
173
- return { ok: true, data: [] };
177
+ }
178
+ /**
179
+ * 打开实体重定向视图
180
+ *
181
+ * @author chitanda
182
+ * @date 2022-09-28 16:09:15
183
+ * @export
184
+ * @param {IAppDERedirectView} appView
185
+ * @param {IContext}
186
+ * @param {IParams} [params={}]
187
+ * @param {IData[]} [data=[]]
188
+ * @return {*} {Promise<IModalData>}
189
+ */
190
+ export async function openDERedirectView(appView, context, params = {}, opts = {}) {
191
+ let toView;
192
+ try {
193
+ toView = await getDERedirectToView(appView, context, params, opts);
194
+ }
195
+ catch (error) {
196
+ ibiz.log.error(error);
197
+ return { ok: false, data: [] };
198
+ }
199
+ // 返回路径,则用window打开
200
+ if (toView.type === 'url') {
201
+ const openUrl = toView.url;
202
+ return new Promise(resolve => {
203
+ const newWindow = window.open(openUrl, '_blank');
204
+ if (newWindow) {
205
+ newWindow.callback = () => {
206
+ resolve({ ok: true, data: [] });
207
+ };
208
+ }
209
+ });
210
+ }
211
+ // 返回视图相关信息,则打开视图
212
+ const result = await ibiz.commands.execute(OpenAppViewCommand.TAG, toView.viewId, toView.context, toView.params, toView.opts);
213
+ return result || { ok: true, data: [] };
174
214
  }
175
215
  /**
176
216
  * 计算重定向标识
@@ -193,7 +233,8 @@ export async function calcDERdTag(entity, rdView, params, data) {
193
233
  const { codeName } = findFieldById(entity, typeFieldId);
194
234
  const value = data[codeName.toLowerCase()];
195
235
  if (notNilEmpty(value)) {
196
- return `${value}`;
236
+ // 因为平台发布出来的标识全都是大写,所以这里也全部转大写
237
+ return `${value.toUpperCase()}`;
197
238
  }
198
239
  ibiz.log.warn(`重定向视图[${rdView.name}]自定义类别属性[${typeFieldId}]值为空`, data);
199
240
  }
@@ -1,3 +1,4 @@
1
+ import { IParentConfig } from '../../interface';
1
2
  /**
2
3
  * 界面域
3
4
  *
@@ -15,6 +16,15 @@ export declare class UIDomain {
15
16
  * @type {string}
16
17
  */
17
18
  readonly id: string;
19
+ /**
20
+ * DTO 父子关系映射
21
+ *
22
+ * @author chitanda
23
+ * @date 2023-12-26 15:12:13
24
+ * @protected
25
+ * @type {Map<string, IParentConfig[]>}
26
+ */
27
+ protected rsMap: Map<string, IParentConfig[]>;
18
28
  /**
19
29
  * Creates an instance of UIDomain.
20
30
  *
@@ -24,6 +34,24 @@ export declare class UIDomain {
24
34
  * @param {string} [id]
25
35
  */
26
36
  constructor(id?: string);
37
+ /**
38
+ * 设置当前界面域下,指定实体的相关父关系以及属性。在 DTO 包解析时设置此参数,销毁时清空
39
+ *
40
+ * @author chitanda
41
+ * @date 2023-12-26 15:12:31
42
+ * @param {string} entity
43
+ * @param {IParentConfig} config
44
+ */
45
+ setDERConfig(deCodeName: string, config: IParentConfig): void;
46
+ /**
47
+ * 获取当前界面域下,具体实体的关系(在数据加载完成之后才有值)
48
+ *
49
+ * @author chitanda
50
+ * @date 2023-12-26 16:12:07
51
+ * @param {string} deCodeName
52
+ * @return {*} {IParentConfig[]}
53
+ */
54
+ getDERConfig(deCodeName: string): IParentConfig[];
27
55
  /**
28
56
  * 界面域销毁
29
57
  *
@@ -1 +1 @@
1
- {"version":3,"file":"ui-domain.d.ts","sourceRoot":"","sources":["../../../src/utils/ui-domain/ui-domain.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,qBAAa,QAAQ;IACnB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB;;;;;;;OAOG;gBACS,EAAE,CAAC,EAAE,MAAM;IAQvB;;;;;OAKG;IACH,OAAO,IAAI,IAAI;CAShB"}
1
+ {"version":3,"file":"ui-domain.d.ts","sourceRoot":"","sources":["../../../src/utils/ui-domain/ui-domain.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;;;;GAOG;AACH,qBAAa,QAAQ;IACnB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB;;;;;;;OAOG;IACH,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC,CAAa;IAE1D;;;;;;;OAOG;gBACS,EAAE,CAAC,EAAE,MAAM;IAQvB;;;;;;;OAOG;IACH,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI;IAQ7D;;;;;;;OAOG;IACH,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,aAAa,EAAE;IAOjD;;;;;OAKG;IACH,OAAO,IAAI,IAAI;CAWhB"}
@@ -17,6 +17,15 @@ export class UIDomain {
17
17
  * @param {string} [id]
18
18
  */
19
19
  constructor(id) {
20
+ /**
21
+ * DTO 父子关系映射
22
+ *
23
+ * @author chitanda
24
+ * @date 2023-12-26 15:12:13
25
+ * @protected
26
+ * @type {Map<string, IParentConfig[]>}
27
+ */
28
+ this.rsMap = new Map();
20
29
  if (id) {
21
30
  this.id = id;
22
31
  }
@@ -24,6 +33,35 @@ export class UIDomain {
24
33
  this.id = createUUID();
25
34
  }
26
35
  }
36
+ /**
37
+ * 设置当前界面域下,指定实体的相关父关系以及属性。在 DTO 包解析时设置此参数,销毁时清空
38
+ *
39
+ * @author chitanda
40
+ * @date 2023-12-26 15:12:31
41
+ * @param {string} entity
42
+ * @param {IParentConfig} config
43
+ */
44
+ setDERConfig(deCodeName, config) {
45
+ if (!this.rsMap.has(deCodeName)) {
46
+ this.rsMap.set(deCodeName, []);
47
+ }
48
+ const arr = this.rsMap.get(deCodeName);
49
+ arr.push(config);
50
+ }
51
+ /**
52
+ * 获取当前界面域下,具体实体的关系(在数据加载完成之后才有值)
53
+ *
54
+ * @author chitanda
55
+ * @date 2023-12-26 16:12:07
56
+ * @param {string} deCodeName
57
+ * @return {*} {IParentConfig[]}
58
+ */
59
+ getDERConfig(deCodeName) {
60
+ if (this.rsMap.has(deCodeName)) {
61
+ return this.rsMap.get(deCodeName);
62
+ }
63
+ return [];
64
+ }
27
65
  /**
28
66
  * 界面域销毁
29
67
  *
@@ -31,6 +69,8 @@ export class UIDomain {
31
69
  * @date 2023-12-22 15:12:49
32
70
  */
33
71
  destroy() {
72
+ // 清空当前域下的父子关系映射
73
+ this.rsMap.clear();
34
74
  const apps = ibiz.hub.getAllApps();
35
75
  apps.forEach(app => {
36
76
  app.deService.reset({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiz-template/runtime",
3
- "version": "0.5.0-beta.0",
3
+ "version": "0.5.0-beta.1",
4
4
  "description": "控制器包",
5
5
  "type": "module",
6
6
  "main": "out/index.js",
@@ -30,7 +30,7 @@
30
30
  "license": "MIT",
31
31
  "devDependencies": {
32
32
  "@ibiz-template/core": "^0.5.0-beta.0",
33
- "@ibiz/model-core": "^0.0.28",
33
+ "@ibiz/model-core": "^0.0.29",
34
34
  "@types/path-browserify": "^1.0.2",
35
35
  "@types/qs": "^6.9.10",
36
36
  "@types/systemjs": "^6.13.5",
@@ -46,8 +46,8 @@
46
46
  "ramda": "^0.29.1"
47
47
  },
48
48
  "peerDependencies": {
49
- "@ibiz-template/core": "^0.4.0",
50
- "@ibiz/model-core": "^0.0.28",
49
+ "@ibiz-template/core": "^0.5.0-beta.0",
50
+ "@ibiz/model-core": "^0.0.29",
51
51
  "async-validator": "^4.2.5",
52
52
  "dayjs": "^1.11.7",
53
53
  "echarts": "^5.4.3",
@@ -59,5 +59,5 @@
59
59
  "qx-util": "^0.4.8",
60
60
  "ramda": "^0.29.0"
61
61
  },
62
- "gitHead": "06600ef120d5aaca67336eb6afdf5281195d507a"
62
+ "gitHead": "30a5699d02d89a2755a595888a5f94c384f3b5fb"
63
63
  }
@@ -6,6 +6,7 @@ import {
6
6
  IMDControlController,
7
7
  IMDControlEvent,
8
8
  IMDControlState,
9
+ IToolbarController,
9
10
  MDCtrlLoadParams,
10
11
  MDCtrlRemoveParams,
11
12
  } from '../../../interface';
@@ -89,6 +90,38 @@ export class MDControlController<
89
90
  */
90
91
  protected dataEntity!: IAppDataEntity;
91
92
 
93
+ /**
94
+ * 批操作工具栏
95
+ *
96
+ * @author zk
97
+ * @date 2023-08-02 06:08:34
98
+ * @readonly
99
+ * @type {(IToolbarController | undefined)}
100
+ * @memberof ListController
101
+ */
102
+ protected get batchToolbarController(): IToolbarController | undefined {
103
+ const controller = this.view.getController(
104
+ `${this.model.name!}_batchtoolbar`,
105
+ );
106
+ return controller as IToolbarController;
107
+ }
108
+
109
+ /**
110
+ * 快速工具栏
111
+ *
112
+ * @author zk
113
+ * @date 2023-08-02 06:08:34
114
+ * @readonly
115
+ * @type {(IToolbarController | undefined)}
116
+ * @memberof ListController
117
+ */
118
+ protected get quickToolbarController(): IToolbarController | undefined {
119
+ const controller = this.view.getController(
120
+ `${this.model.name!}_quicktoolbar`,
121
+ );
122
+ return controller as IToolbarController;
123
+ }
124
+
92
125
  protected async onCreated(): Promise<void> {
93
126
  await super.onCreated();
94
127
 
@@ -406,6 +439,16 @@ export class MDControlController<
406
439
  data: selection,
407
440
  });
408
441
  }
442
+ // 根据数据计算工具栏权限和状态
443
+ const data = selection?.[0];
444
+ this.batchToolbarController?.calcButtonState(
445
+ data,
446
+ this.model.appDataEntityId,
447
+ );
448
+ this.quickToolbarController?.calcButtonState(
449
+ data,
450
+ this.model.appDataEntityId,
451
+ );
409
452
  }
410
453
 
411
454
  /**