@ibiz-template/runtime 0.1.19 → 0.1.20

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 (67) hide show
  1. package/dist/index.esm.js +217 -29
  2. package/dist/index.system.min.js +1 -1
  3. package/dist/index.system.min.js.map +1 -1
  4. package/out/controller/common/control/control.controller.d.ts +13 -0
  5. package/out/controller/common/control/control.controller.d.ts.map +1 -1
  6. package/out/controller/common/control/control.controller.js +58 -0
  7. package/out/controller/common/control/md-control.controller.d.ts +7 -0
  8. package/out/controller/common/control/md-control.controller.d.ts.map +1 -1
  9. package/out/controller/common/control/md-control.controller.js +27 -2
  10. package/out/controller/control/data-view/data-view.controller.d.ts.map +1 -1
  11. package/out/controller/control/data-view/data-view.controller.js +2 -1
  12. package/out/controller/control/form/edit-form/edit-form.controller.d.ts.map +1 -1
  13. package/out/controller/control/form/edit-form/edit-form.controller.js +36 -7
  14. package/out/controller/control/form/form/form.controller.d.ts +4 -0
  15. package/out/controller/control/form/form/form.controller.d.ts.map +1 -1
  16. package/out/controller/control/form/form/form.controller.js +3 -0
  17. package/out/controller/control/form/search-form/search-form.controller.d.ts.map +1 -1
  18. package/out/controller/control/form/search-form/search-form.controller.js +11 -1
  19. package/out/controller/control/grid/grid/grid.controller.d.ts +1 -1
  20. package/out/controller/control/grid/grid/grid.controller.d.ts.map +1 -1
  21. package/out/controller/control/grid/grid/grid.controller.js +29 -5
  22. package/out/controller/control/list/list.controller.d.ts.map +1 -1
  23. package/out/controller/control/list/list.controller.js +2 -1
  24. package/out/logic-scheduler/executor/app-ui-logic-executor.d.ts +1 -0
  25. package/out/logic-scheduler/executor/app-ui-logic-executor.d.ts.map +1 -1
  26. package/out/logic-scheduler/executor/app-ui-logic-executor.js +33 -4
  27. package/out/logic-scheduler/trigger/control-event-trigger.js +1 -1
  28. package/out/logic-scheduler/trigger/view-event-trigger.js +1 -1
  29. package/out/model/data-entity/data-entity.d.ts +11 -0
  30. package/out/model/data-entity/data-entity.d.ts.map +1 -1
  31. package/out/model/data-entity/data-entity.js +14 -0
  32. package/out/model/index.d.ts +1 -0
  33. package/out/model/index.d.ts.map +1 -1
  34. package/out/model/index.js +1 -0
  35. package/out/model/panel/data-container.d.ts +11 -0
  36. package/out/model/panel/data-container.d.ts.map +1 -0
  37. package/out/model/panel/data-container.js +12 -0
  38. package/out/model/panel/index.d.ts +2 -0
  39. package/out/model/panel/index.d.ts.map +1 -0
  40. package/out/model/panel/index.js +1 -0
  41. package/out/service/app-data-entity/app-data-entity.d.ts.map +1 -1
  42. package/out/service/app-data-entity/app-data-entity.js +3 -1
  43. package/out/service/service/entity/method/method.d.ts.map +1 -1
  44. package/out/service/service/entity/method/method.js +3 -0
  45. package/out/service/vo/control.vo.js +2 -2
  46. package/out/ui-logic/ui-logic-node/msg-box-node/msg-box-node.d.ts.map +1 -1
  47. package/out/ui-logic/ui-logic-node/msg-box-node/msg-box-node.js +0 -1
  48. package/package.json +3 -3
  49. package/src/controller/common/control/control.controller.ts +67 -0
  50. package/src/controller/common/control/md-control.controller.ts +28 -2
  51. package/src/controller/control/data-view/data-view.controller.ts +2 -1
  52. package/src/controller/control/form/edit-form/edit-form.controller.ts +34 -7
  53. package/src/controller/control/form/form/form.controller.ts +7 -0
  54. package/src/controller/control/form/search-form/search-form.controller.ts +10 -1
  55. package/src/controller/control/grid/grid/grid.controller.ts +28 -5
  56. package/src/controller/control/list/list.controller.ts +2 -1
  57. package/src/logic-scheduler/executor/app-ui-logic-executor.ts +44 -7
  58. package/src/logic-scheduler/trigger/control-event-trigger.ts +1 -1
  59. package/src/logic-scheduler/trigger/view-event-trigger.ts +1 -1
  60. package/src/model/data-entity/data-entity.ts +17 -0
  61. package/src/model/index.ts +1 -0
  62. package/src/model/panel/data-container.ts +18 -0
  63. package/src/model/panel/index.ts +1 -0
  64. package/src/service/app-data-entity/app-data-entity.ts +3 -1
  65. package/src/service/service/entity/method/method.ts +3 -0
  66. package/src/service/vo/control.vo.ts +2 -2
  67. package/src/ui-logic/ui-logic-node/msg-box-node/msg-box-node.ts +0 -1
@@ -26,6 +26,17 @@ export declare function hasDeCodeName(params: IParams, entityId: string): boolea
26
26
  * @Date: 2023-05-31 10:26:24
27
27
  */
28
28
  export declare function getDeACMode(appDEACModeId: string, entityId: string, srfappid?: string): Promise<IAppDEACMode | undefined>;
29
+ /**
30
+ * 从实体里找到表单类型应用实体属性
31
+ *
32
+ * @author zk
33
+ * @date 2023-09-07 05:09:41
34
+ * @export
35
+ * @param {string} entityId
36
+ * @param {string} [srfappid]
37
+ * @return {*} {(Promise<string | undefined>)}
38
+ */
39
+ export declare function getFormTypeFieldName(entityId: string): Promise<string | undefined>;
29
40
  /**
30
41
  * 从实体里找到实体逻辑
31
42
  * @author lxm
@@ -1 +1 @@
1
- {"version":3,"file":"data-entity.d.ts","sourceRoot":"","sources":["../../../src/model/data-entity/data-entity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,YAAY,EACZ,WAAW,EACX,QAAQ,EACT,MAAM,kBAAkB,CAAC;AAG1B;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAGrD;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAGxE;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAMnC;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,cAAc,GACrB,QAAQ,GAAG,SAAS,CAEtB;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,GACrC,QAAQ,EAAE,CAYZ;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,MAAM,GACd,WAAW,GAAG,SAAS,CAEzB"}
1
+ {"version":3,"file":"data-entity.d.ts","sourceRoot":"","sources":["../../../src/model/data-entity/data-entity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,YAAY,EACZ,WAAW,EACX,QAAQ,EACT,MAAM,kBAAkB,CAAC;AAG1B;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAGrD;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAGxE;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAMnC;AAED;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAG7B;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,cAAc,GACrB,QAAQ,GAAG,SAAS,CAEtB;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,GACrC,QAAQ,EAAE,CAYZ;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,MAAM,GACd,WAAW,GAAG,SAAS,CAEzB"}
@@ -39,6 +39,20 @@ export async function getDeACMode(appDEACModeId, entityId, srfappid) {
39
39
  });
40
40
  return deACMode;
41
41
  }
42
+ /**
43
+ * 从实体里找到表单类型应用实体属性
44
+ *
45
+ * @author zk
46
+ * @date 2023-09-07 05:09:41
47
+ * @export
48
+ * @param {string} entityId
49
+ * @param {string} [srfappid]
50
+ * @return {*} {(Promise<string | undefined>)}
51
+ */
52
+ export async function getFormTypeFieldName(entityId) {
53
+ const appDataEntity = await ibiz.hub.getAppDataEntity(entityId);
54
+ return appDataEntity.formTypeAppDEFieldId;
55
+ }
42
56
  /**
43
57
  * 从实体里找到实体逻辑
44
58
  * @author lxm
@@ -7,4 +7,5 @@ export * from './tree/index';
7
7
  export * from './grid/index';
8
8
  export * from './form/index';
9
9
  export * from './view/view';
10
+ export * from './panel/index';
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC"}
@@ -7,3 +7,4 @@ export * from './tree/index';
7
7
  export * from './grid/index';
8
8
  export * from './form/index';
9
9
  export * from './view/view';
10
+ export * from './panel/index';
@@ -0,0 +1,11 @@
1
+ import { IPanelItem } from '@ibiz/model-core';
2
+ /**
3
+ * 判断面板成员模型是否是数据容器
4
+ * @author lxm
5
+ * @date 2023-09-06 04:56:01
6
+ * @export
7
+ * @param {IPanelItem} panelItem
8
+ * @return {*} {boolean}
9
+ */
10
+ export declare function isDataContainer(panelItem: IPanelItem): boolean;
11
+ //# sourceMappingURL=data-container.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-container.d.ts","sourceRoot":"","sources":["../../../src/model/panel/data-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE/D;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAO9D"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * 判断面板成员模型是否是数据容器
3
+ * @author lxm
4
+ * @date 2023-09-06 04:56:01
5
+ * @export
6
+ * @param {IPanelItem} panelItem
7
+ * @return {*} {boolean}
8
+ */
9
+ export function isDataContainer(panelItem) {
10
+ return (panelItem.itemType === 'CONTAINER' &&
11
+ ['CONTAINER_MULTIDATA', 'CONTAINER_SINGLEDATA'].includes(panelItem.predefinedType));
12
+ }
@@ -0,0 +1,2 @@
1
+ export * from './data-container';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/model/panel/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './data-container';
@@ -1 +1 @@
1
- {"version":3,"file":"app-data-entity.d.ts","sourceRoot":"","sources":["../../../src/service/app-data-entity/app-data-entity.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;;;;;;GAOG;AACH,qBAAa,aAAc,YAAW,WAAW;IAC/C,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;IAE5B,UAAkB,KAAK,EAAE,KAAK,CAAC;IAE/B,UAAkB,OAAO,EAAE,cAAc,CAAC;IAElC,OAAO,EAAE,MAAM,CAAC;IAEhB,aAAa,EAAE,MAAM,CAAC;IAEtB,UAAU,EAAE,MAAM,CAAC;IAEnB,YAAY,EAAE,MAAM,CAAC;IAErB,MAAM,EAAE,MAAM,CAAC;IAEf,YAAY,EAAE,MAAM,CAAC;IAErB,YAAY,EAAE,MAAM,CAAC;IAE7B,IAAI,KAAK,IAAI,KAAK,CAEjB;IAED;;;;;;;OAOG;gBACS,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,KAAK,GAAG,aAAa;IA6E/D;;;;;;OAMG;IACH,SAAS,CAAC,gBAAgB,IAAI,IAAI;IAgClC;;;;;;OAMG;IACH,KAAK,IAAI,aAAa;IAItB;;;;;;;OAOG;IACH,MAAM,CAAC,IAAI,EAAE,KAAK,GAAG,aAAa,GAAG,aAAa;CAQnD"}
1
+ {"version":3,"file":"app-data-entity.d.ts","sourceRoot":"","sources":["../../../src/service/app-data-entity/app-data-entity.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;;;;;;GAOG;AACH,qBAAa,aAAc,YAAW,WAAW;IAC/C,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;IAE5B,UAAkB,KAAK,EAAE,KAAK,CAAC;IAE/B,UAAkB,OAAO,EAAE,cAAc,CAAC;IAElC,OAAO,EAAE,MAAM,CAAC;IAEhB,aAAa,EAAE,MAAM,CAAC;IAEtB,UAAU,EAAE,MAAM,CAAC;IAEnB,YAAY,EAAE,MAAM,CAAC;IAErB,MAAM,EAAE,MAAM,CAAC;IAEf,YAAY,EAAE,MAAM,CAAC;IAErB,YAAY,EAAE,MAAM,CAAC;IAE7B,IAAI,KAAK,IAAI,KAAK,CAEjB;IAED;;;;;;;OAOG;gBACS,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,KAAK,GAAG,aAAa;IA6E/D;;;;;;OAMG;IACH,SAAS,CAAC,gBAAgB,IAAI,IAAI;IAgClC;;;;;;OAMG;IACH,KAAK,IAAI,aAAa;IAMtB;;;;;;;OAOG;IACH,MAAM,CAAC,IAAI,EAAE,KAAK,GAAG,aAAa,GAAG,aAAa;CAQnD"}
@@ -140,7 +140,9 @@ export class AppDataEntity {
140
140
  * @return {*} {AppDataEntity}
141
141
  */
142
142
  clone() {
143
- return new AppDataEntity(this._entity, this._data);
143
+ const entity = new AppDataEntity(this._entity, this._data);
144
+ entity.srfkey = this.srfkey;
145
+ return entity;
144
146
  }
145
147
  /**
146
148
  * 合并参数
@@ -1 +1 @@
1
- {"version":3,"file":"method.d.ts","sourceRoot":"","sources":["../../../../../src/service/service/entity/method/method.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAqB,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEnE;;;;;;;GAOG;AACH,8BAAsB,MAAM;IA2CxB,SAAS,CAAC,MAAM,EAAE,cAAc;IAChC,SAAS,CAAC,MAAM,EAAE,YAAY;IA3ChC,SAAS,CAAC,GAAG,EAAG,WAAW,CAAC;IAE5B;;;;;;;OAOG;IACH,SAAS,CAAC,KAAK,EAAG,WAAW,CAAC;IAE9B;;;;;;;OAOG;IACH,SAAS,CAAC,MAAM,EAAG,YAAY,CAAC;IAEhC;;;;;;;OAOG;IACH,SAAS,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;IAElC;;;;;;;;OAQG;gBAES,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,YAAY;IAOhC;;;;;;;;;OASG;IACH,QAAQ,CAAC,IAAI,CACX,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,KAAK,EACb,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,YAAY,CAAC;IAExB;;;;;;;;;;;OAWG;cACa,OAAO,CACrB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,KAAK,EACX,MAAM,EAAE,OAAO,GAEd,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAuC7B;;;;;;;;OAQG;IACH,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM;IAM5C;;;;;;;OAOG;cACa,UAAU,IAAI,OAAO,CAAC,aAAa,CAAC;IAOpD;;;;;;;;OAQG;IACH,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,GAAG,WAAW,GAAG,WAAW;CAG/D"}
1
+ {"version":3,"file":"method.d.ts","sourceRoot":"","sources":["../../../../../src/service/service/entity/method/method.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAqB,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEnE;;;;;;;GAOG;AACH,8BAAsB,MAAM;IA2CxB,SAAS,CAAC,MAAM,EAAE,cAAc;IAChC,SAAS,CAAC,MAAM,EAAE,YAAY;IA3ChC,SAAS,CAAC,GAAG,EAAG,WAAW,CAAC;IAE5B;;;;;;;OAOG;IACH,SAAS,CAAC,KAAK,EAAG,WAAW,CAAC;IAE9B;;;;;;;OAOG;IACH,SAAS,CAAC,MAAM,EAAG,YAAY,CAAC;IAEhC;;;;;;;OAOG;IACH,SAAS,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;IAElC;;;;;;;;OAQG;gBAES,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,YAAY;IAOhC;;;;;;;;;OASG;IACH,QAAQ,CAAC,IAAI,CACX,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,KAAK,EACb,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,YAAY,CAAC;IAExB;;;;;;;;;;;OAWG;cACa,OAAO,CACrB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,KAAK,EACX,MAAM,EAAE,OAAO,GAEd,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAuC7B;;;;;;;;OAQG;IACH,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM;IAM5C;;;;;;;OAOG;cACa,UAAU,IAAI,OAAO,CAAC,aAAa,CAAC;IAOpD;;;;;;;;OAQG;IACH,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,GAAG,WAAW,GAAG,WAAW;CAM/D"}
@@ -110,6 +110,9 @@ export class Method {
110
110
  * @return {*} {IDataEntity}
111
111
  */
112
112
  createEntity(data) {
113
+ if (data instanceof AppDataEntity) {
114
+ return data.clone();
115
+ }
113
116
  return new AppDataEntity(this.entity, data);
114
117
  }
115
118
  }
@@ -126,8 +126,8 @@ export class ControlVO {
126
126
  * @returns {*}
127
127
  */
128
128
  linkProperty(uiKey, dataKey, isOriginField = true) {
129
- // srfuf不做处理
130
- if (uiKey === 'srfuf') {
129
+ // srfuf和srfkey不做处理
130
+ if (uiKey === 'srfuf' || uiKey === 'srfkey') {
131
131
  return;
132
132
  }
133
133
  // 后台数据存在$origin里,其他存在ControlVo上
@@ -1 +1 @@
1
- {"version":3,"file":"msg-box-node.d.ts","sourceRoot":"","sources":["../../../../src/ui-logic/ui-logic-node/msg-box-node/msg-box-node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C;;;;;;;;GAQG;AACH,qBAAa,UAAW,SAAQ,WAAW;IACjC,KAAK,EAAE,gBAAgB,CAAC;IAEhC,SAAS,CAAC,OAAO;;;;;MAKN;IAEL,IAAI,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CA6D/C"}
1
+ {"version":3,"file":"msg-box-node.d.ts","sourceRoot":"","sources":["../../../../src/ui-logic/ui-logic-node/msg-box-node/msg-box-node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C;;;;;;;;GAQG;AACH,qBAAa,UAAW,SAAQ,WAAW;IACjC,KAAK,EAAE,gBAAgB,CAAC;IAEhC,SAAS,CAAC,OAAO;;;;;MAKN;IAEL,IAAI,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CA4D/C"}
@@ -72,7 +72,6 @@ export class MsgBoxNode extends UILogicNode {
72
72
  default:
73
73
  throw new ModelError(this.model, `${buttonsType}暂未支持`);
74
74
  }
75
- console.log(this.model, modalParams);
76
75
  const result = await ibiz.modal.confirm(modalParams);
77
76
  ctx.setLastReturn(resultTags[result ? 0 : 1]);
78
77
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiz-template/runtime",
3
- "version": "0.1.19",
3
+ "version": "0.1.20",
4
4
  "description": "控制器包",
5
5
  "type": "module",
6
6
  "main": "out/index.js",
@@ -29,7 +29,7 @@
29
29
  "author": "chitanda",
30
30
  "license": "MIT",
31
31
  "devDependencies": {
32
- "@ibiz-template/core": "^0.1.18",
32
+ "@ibiz-template/core": "^0.1.20",
33
33
  "@ibiz/model-core": "^0.0.15",
34
34
  "@types/path-browserify": "^1.0.0",
35
35
  "@types/qs": "^6.9.7",
@@ -57,5 +57,5 @@
57
57
  "qx-util": "^0.4.8",
58
58
  "ramda": "^0.29.0"
59
59
  },
60
- "gitHead": "62b9073941f08f79c2a5ae70c9b895d1a9300c26"
60
+ "gitHead": "bd9c4f935e57362567b12c7b4b91a64f4c099616"
61
61
  }
@@ -1,4 +1,6 @@
1
1
  import { IControl, IControlLogic, IViewLayoutPanel } from '@ibiz/model-core';
2
+ import { NoticeError } from '@ibiz-template/core';
3
+ import { isNil } from 'ramda';
2
4
  import { BaseController } from '..';
3
5
  import { CTX } from '../../ctx';
4
6
  import {
@@ -17,6 +19,7 @@ import {
17
19
  } from '../../../interface';
18
20
  import { ControlLogicScheduler } from '../../../logic-scheduler';
19
21
  import { getControlProvider } from '../../../register';
22
+ import { ScriptFactory } from '../../../utils';
20
23
 
21
24
  /**
22
25
  * 部件控制器
@@ -235,4 +238,68 @@ export class ControlController<
235
238
  return this.getEventArgs();
236
239
  };
237
240
  }
241
+
242
+ /**
243
+ * 执行对应部件行为消息提示
244
+ * @author lxm
245
+ * @date 2023-09-07 04:51:21
246
+ * @param {string} tag
247
+ * @param {({ default?: string; data?: IData | IData[]; error?: Error })} [opts]
248
+ * @return {*} {void}
249
+ */
250
+ actionNotification(
251
+ tag: string,
252
+ opts?: { default?: string; data?: IData | IData[]; error?: Error },
253
+ ): void {
254
+ const { ctrlMsg } = this.model;
255
+ const msgItem = ctrlMsg?.ctrlMsgItems?.find(item => item.name === tag);
256
+ let message: string;
257
+ let duration: number | undefined;
258
+ if (msgItem && msgItem.content) {
259
+ // 自定义部件消息提示
260
+ duration = isNil(msgItem.timeout) ? undefined : msgItem.timeout / 1000; // 单位转换为秒
261
+ const scriptParams: IParams = { ...this.getEventArgs() };
262
+ if (opts?.data) {
263
+ scriptParams.data = opts.data;
264
+ }
265
+ message = ScriptFactory.execScriptFn(
266
+ scriptParams,
267
+ `\`${msgItem.content}\``,
268
+ {
269
+ isAsync: false,
270
+ singleRowReturn: true,
271
+ },
272
+ ) as string;
273
+ } else {
274
+ // 全局多语言资源提示信息
275
+ const resTag = `CONTROL.${this.model.controlType}.${tag}`.toUpperCase();
276
+ message = ibiz.i18n.t(resTag, '');
277
+ // 多语言如果给出来是标识,说明没找到,消息改成空值
278
+ if (message === resTag) {
279
+ message = '';
280
+ }
281
+ }
282
+
283
+ // 都没有的时候如果给了默认输出信息,弹出默认输出信息
284
+ if (!message && opts?.default) {
285
+ message = opts.default;
286
+ }
287
+
288
+ // 如果报错有Message的时候给报错的信息
289
+ if (!message && opts?.error) {
290
+ message = message || opts.error.message;
291
+ }
292
+
293
+ // 如果默认信息也没有就不弹出信息
294
+ if (!message) {
295
+ return;
296
+ }
297
+
298
+ if (opts?.error) {
299
+ // 报错时抛错误
300
+ throw new NoticeError(message, duration);
301
+ } else {
302
+ ibiz.message.success(message, duration, duration === 0);
303
+ }
304
+ }
238
305
  }
@@ -60,8 +60,25 @@ export class MDControlController<
60
60
  this.state.groups = [];
61
61
  }
62
62
 
63
+ /**
64
+ * 实体属性映射,key是id,value是name
65
+ * @author lxm
66
+ * @date 2023-09-07 03:16:56
67
+ * @protected
68
+ */
69
+ protected fieldIdNameMap = new Map<string, string>();
70
+
63
71
  protected async onCreated(): Promise<void> {
64
72
  await super.onCreated();
73
+
74
+ // 初始化实体属性id和name的映射
75
+ const dataEntity = await ibiz.hub.getAppDataEntity(
76
+ this.model.appDataEntityId!,
77
+ );
78
+ dataEntity.appDEFields?.forEach(field => {
79
+ this.fieldIdNameMap.set(field.id!, field.name!);
80
+ });
81
+
65
82
  // 设置默认排序
66
83
  this.setSort();
67
84
  }
@@ -159,11 +176,15 @@ export class MDControlController<
159
176
  });
160
177
  } catch (error) {
161
178
  await this._evt.emit('onLoadError', undefined);
179
+ this.actionNotification('FETCHERROR', {
180
+ error: error as Error,
181
+ });
162
182
  throw error;
163
183
  } finally {
164
184
  await this.endLoading();
165
185
  }
166
186
 
187
+ this.actionNotification('FETCHSUCCESS');
167
188
  return this.state.items;
168
189
  }
169
190
 
@@ -234,8 +255,9 @@ export class MDControlController<
234
255
  );
235
256
 
236
257
  if (args?.silent !== true) {
237
- ibiz.notification.success({
238
- desc: `数据[${data
258
+ this.actionNotification('REMOVESUCCESS', {
259
+ data,
260
+ default: `数据[${data
239
261
  .map(item => item.srfmajortext)
240
262
  .join('、')}]删除成功!`,
241
263
  });
@@ -247,6 +269,10 @@ export class MDControlController<
247
269
  }
248
270
  } catch (error) {
249
271
  await this._evt.emit('onRemoveError', undefined);
272
+ this.actionNotification('REMOVEERROR', {
273
+ error: error as Error,
274
+ data,
275
+ });
250
276
  throw error;
251
277
  } finally {
252
278
  await this.endLoading();
@@ -249,7 +249,8 @@ export class DataViewControlController
249
249
  // 设置默认排序或者置空
250
250
  const { minorSortAppDEFieldId, minorSortDir } = this.model;
251
251
  if (minorSortAppDEFieldId && minorSortDir) {
252
- this.state.sortQuery = `${minorSortAppDEFieldId.toLowerCase()},${minorSortDir.toLowerCase()}`;
252
+ const fieldName = this.fieldIdNameMap.get(minorSortAppDEFieldId)!;
253
+ this.state.sortQuery = `${fieldName.toLowerCase()},${minorSortDir.toLowerCase()}`;
253
254
  } else {
254
255
  this.state.sortQuery = '';
255
256
  }
@@ -79,6 +79,9 @@ export class EditFormController
79
79
  res = await this.service.getDraft(this.context, queryParams);
80
80
  } catch (error) {
81
81
  await this.evt.emit('onLoadDraftError', undefined);
82
+ this.actionNotification('GETDRAFTERROR', {
83
+ error: error as Error,
84
+ });
82
85
  throw error;
83
86
  } finally {
84
87
  await this.endLoading();
@@ -91,6 +94,7 @@ export class EditFormController
91
94
  this.formStateNotify(FormNotifyState.DRAFT);
92
95
 
93
96
  await this.evt.emit('onLoadDraftSuccess', undefined);
97
+ this.actionNotification('GETDRAFTSUCCESS');
94
98
  this.state.isLoaded = true;
95
99
  return this.data;
96
100
  }
@@ -120,6 +124,9 @@ export class EditFormController
120
124
  res = await this.service.get(this.context, queryParams);
121
125
  } catch (error) {
122
126
  await this.evt.emit('onLoadError', undefined);
127
+ this.actionNotification('GETERROR', {
128
+ error: error as Error,
129
+ });
123
130
  throw error;
124
131
  } finally {
125
132
  await this.endLoading();
@@ -130,6 +137,7 @@ export class EditFormController
130
137
  this.formStateNotify(FormNotifyState.LOAD);
131
138
 
132
139
  await this.evt.emit('onLoadSuccess', undefined);
140
+ this.actionNotification('GETSUCCESS');
133
141
  this.state.isLoaded = true;
134
142
  return this.data;
135
143
  }
@@ -153,14 +161,17 @@ export class EditFormController
153
161
  }
154
162
  await this.startLoading();
155
163
  await this.evt.emit('onBeforeSave', undefined);
164
+ const isCreate = this.data.srfuf === Srfuf.CREATE;
156
165
  let res;
157
166
  try {
158
- res =
159
- this.data.srfuf === Srfuf.CREATE
160
- ? await this.service.create(this.context, this.data)
161
- : await this.service.update(this.context, this.data);
167
+ res = isCreate
168
+ ? await this.service.create(this.context, this.data)
169
+ : await this.service.update(this.context, this.data);
162
170
  } catch (error) {
163
171
  await this.evt.emit('onSaveError', undefined);
172
+ this.actionNotification(`${isCreate ? 'CREATE' : 'UPDATE'}ERROR`, {
173
+ error: error as Error,
174
+ });
164
175
  throw error;
165
176
  } finally {
166
177
  await this.endLoading();
@@ -172,7 +183,9 @@ export class EditFormController
172
183
  this.state.modified = false;
173
184
  await this.evt.emit('onSaveSuccess', undefined);
174
185
  this.formStateNotify(FormNotifyState.SAVE);
175
- ibiz.message.success(`${this.data.srfmajortext || ''}保存成功`);
186
+ this.actionNotification(`${isCreate ? 'CREATE' : 'UPDATE'}SUCCESS`, {
187
+ default: `${this.data.srfmajortext || ''}保存成功`,
188
+ });
176
189
  return this.data;
177
190
  }
178
191
 
@@ -203,6 +216,9 @@ export class EditFormController
203
216
  res = await this.service.remove(this.context, this.params);
204
217
  } catch (error) {
205
218
  await this.evt.emit('onRemoveError', undefined);
219
+ this.actionNotification('REMOVEERROR', {
220
+ error: error as Error,
221
+ });
206
222
  throw error;
207
223
  } finally {
208
224
  await this.endLoading();
@@ -214,6 +230,7 @@ export class EditFormController
214
230
  this.state.data = new ControlVO();
215
231
  this.state.modified = false;
216
232
  await this.evt.emit('onRemoveSuccess', undefined);
233
+ this.actionNotification('REMOVESUCCESS');
217
234
 
218
235
  return ok;
219
236
  }
@@ -317,10 +334,15 @@ export class EditFormController
317
334
  },
318
335
  this.data,
319
336
  );
337
+ } catch (error) {
338
+ this.actionNotification('WFSTARTERROR', {
339
+ error: error as Error,
340
+ });
341
+ throw error;
320
342
  } finally {
321
343
  await this.endLoading();
322
344
  }
323
- ibiz.message.success('流程启动成功');
345
+ this.actionNotification('WFSTARTSUCCESS', { default: '流程启动成功' });
324
346
  }
325
347
 
326
348
  /**
@@ -346,10 +368,15 @@ export class EditFormController
346
368
  },
347
369
  this.data,
348
370
  );
371
+ } catch (error) {
372
+ this.actionNotification('WFSUBMITERROR', {
373
+ error: error as Error,
374
+ });
375
+ throw error;
349
376
  } finally {
350
377
  await this.endLoading();
351
378
  }
352
- ibiz.message.success('流程提交成功');
379
+ this.actionNotification('WFSUBMITSUCCESS', { default: '流程提交成功' });
353
380
  }
354
381
 
355
382
  async dataChangeNotify(names: string[]): Promise<void> {
@@ -269,4 +269,11 @@ export abstract class FormController<
269
269
  // 找不到value为false即全部是true
270
270
  return values.findIndex(value => !value) === -1;
271
271
  }
272
+
273
+ actionNotification(
274
+ tag: string,
275
+ opts?: { default?: string; error?: Error },
276
+ ): void {
277
+ super.actionNotification(tag, { data: this.data, ...(opts || {}) });
278
+ }
272
279
  }
@@ -55,11 +55,20 @@ export class SearchFormController
55
55
  const params = await this.getDraftParams();
56
56
  Object.assign(queryParams, params);
57
57
  await this.evt.emit('onBeforeLoadDraft', { params: queryParams });
58
- const res = await this.service.getDraft(this.context, queryParams);
58
+ let res;
59
+ try {
60
+ res = await this.service.getDraft(this.context, queryParams);
61
+ } catch (error) {
62
+ this.actionNotification('GETDRAFTERROR', {
63
+ error: error as Error,
64
+ });
65
+ throw error;
66
+ }
59
67
  this.state.data = res.data;
60
68
  mergeDefaultInLeft(this.data, params);
61
69
  this.state.isLoaded = true;
62
70
  this.formStateNotify(FormNotifyState.DRAFT);
71
+ this.actionNotification('GETDRAFTSUCCESS');
63
72
  return this.data;
64
73
  }
65
74
 
@@ -430,13 +430,23 @@ export class GridController
430
430
  throw new RuntimeError('请先完成当前行编辑中的行的操作');
431
431
  }
432
432
 
433
- const res = await this.service.getDraft(this.context, this.params);
433
+ let res;
434
+ try {
435
+ res = await this.service.getDraft(this.context, this.params);
436
+ } catch (error) {
437
+ this.actionNotification('GETDRAFTERROR', {
438
+ error: error as Error,
439
+ });
440
+ throw error;
441
+ }
442
+
434
443
  // 加载完后续处理
435
444
  this.state.items.unshift(res.data);
436
445
  const newRow = new GridRowState(res.data, this);
437
446
  this.state.rows.unshift(newRow);
438
447
  this.gridStateNotify(newRow, GridNotifyState.DRAFT);
439
448
  this.switchRowEdit(this.state.rows[0], true);
449
+ this.actionNotification('GETDRAFTSUCCESS', { data: res.data });
440
450
  }
441
451
 
442
452
  /**
@@ -482,6 +492,13 @@ export class GridController
482
492
  res = isCreate
483
493
  ? await this.service.create(tempContext, data)
484
494
  : await this.service.update(tempContext, data);
495
+ } catch (error) {
496
+ await this.evt.emit('onSaveError', undefined);
497
+ this.actionNotification(`${isCreate ? 'CREATE' : 'UPDATE'}ERROR`, {
498
+ error: error as Error,
499
+ data: rowState.data,
500
+ });
501
+ throw error;
485
502
  } finally {
486
503
  await this.endLoading();
487
504
  }
@@ -494,6 +511,10 @@ export class GridController
494
511
  rowState.modified = false;
495
512
 
496
513
  ibiz.message.success(`${res.data.srfmajortext || ''}保存成功`);
514
+ this.actionNotification(`${isCreate ? 'CREATE' : 'UPDATE'}SUCCESS`, {
515
+ default: `${res.data.srfmajortext || ''}保存成功`,
516
+ data: res.data,
517
+ });
497
518
  this.gridStateNotify(rowState, GridNotifyState.SAVE);
498
519
  await this.evt.emit('onSaveSuccess', undefined);
499
520
  }
@@ -774,14 +795,16 @@ export class GridController
774
795
  * @param {string} key 排序字段
775
796
  * @param {string} order 排序顺序
776
797
  */
777
- setSort(key?: string, order?: 'asc' | 'desc'): void {
778
- if (key && order) {
779
- super.setSort(key, order);
798
+ setSort(fieldId?: string, order?: 'asc' | 'desc'): void {
799
+ if (fieldId && order) {
800
+ const fieldName = this.fieldIdNameMap.get(fieldId)!.toLowerCase();
801
+ super.setSort(fieldName, order);
780
802
  } else {
781
803
  // 设置默认排序或者置空
782
804
  const { minorSortAppDEFieldId, minorSortDir } = this.model;
783
805
  if (minorSortAppDEFieldId && minorSortDir) {
784
- this.state.sortQuery = `${minorSortAppDEFieldId.toLowerCase()},${minorSortDir.toLowerCase()}`;
806
+ const fieldName = this.fieldIdNameMap.get(minorSortAppDEFieldId)!;
807
+ this.state.sortQuery = `${fieldName.toLowerCase()},${minorSortDir.toLowerCase()}`;
785
808
  } else {
786
809
  this.state.sortQuery = '';
787
810
  }
@@ -44,7 +44,8 @@ export class ListController
44
44
  // 设置默认排序或者置空
45
45
  const { minorSortAppDEFieldId, minorSortDir } = this.model;
46
46
  if (minorSortAppDEFieldId && minorSortDir) {
47
- this.state.sortQuery = `${minorSortAppDEFieldId.toLowerCase()},${minorSortDir.toLowerCase()}`;
47
+ const fieldName = this.fieldIdNameMap.get(minorSortAppDEFieldId)!;
48
+ this.state.sortQuery = `${fieldName.toLowerCase()},${minorSortDir.toLowerCase()}`;
48
49
  } else {
49
50
  this.state.sortQuery = '';
50
51
  }