@ibiz-template/runtime 0.5.7-alpha.2 → 0.5.7-alpha.4

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 (177) hide show
  1. package/dist/index.esm.js +2384 -278
  2. package/dist/index.system.min.js +1 -1
  3. package/out/app-hub.d.ts +2 -0
  4. package/out/app-hub.d.ts.map +1 -1
  5. package/out/app-hub.js +2 -0
  6. package/out/application.d.ts +7 -0
  7. package/out/application.d.ts.map +1 -1
  8. package/out/application.js +23 -10
  9. package/out/constant/index.d.ts +1 -0
  10. package/out/constant/index.d.ts.map +1 -1
  11. package/out/constant/index.js +1 -0
  12. package/out/constant/preset-identifier.d.ts +15 -0
  13. package/out/constant/preset-identifier.d.ts.map +1 -0
  14. package/out/constant/preset-identifier.js +16 -0
  15. package/out/controller/common/editor/editor.controller.d.ts.map +1 -1
  16. package/out/controller/common/editor/editor.controller.js +4 -0
  17. package/out/controller/control/exp-bar/exp-bar.controller.d.ts.map +1 -1
  18. package/out/controller/control/exp-bar/exp-bar.controller.js +7 -0
  19. package/out/controller/control/exp-bar/tree-exp-bar.controller.d.ts +5 -0
  20. package/out/controller/control/exp-bar/tree-exp-bar.controller.d.ts.map +1 -1
  21. package/out/controller/control/exp-bar/tree-exp-bar.controller.js +16 -0
  22. package/out/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-ua-column/tree-grid-ex-ua-column.controller.d.ts +23 -1
  23. package/out/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-ua-column/tree-grid-ex-ua-column.controller.d.ts.map +1 -1
  24. package/out/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-ua-column/tree-grid-ex-ua-column.controller.js +56 -4
  25. package/out/controller/notification/async-action.controller.d.ts +64 -0
  26. package/out/controller/notification/async-action.controller.d.ts.map +1 -0
  27. package/out/controller/notification/async-action.controller.js +141 -0
  28. package/out/controller/notification/index.d.ts +2 -0
  29. package/out/controller/notification/index.d.ts.map +1 -0
  30. package/out/controller/notification/index.js +1 -0
  31. package/out/controller/notification/internal-message.controller.d.ts +23 -0
  32. package/out/controller/notification/internal-message.controller.d.ts.map +1 -0
  33. package/out/controller/notification/internal-message.controller.js +50 -0
  34. package/out/controller/notification/notice.controller.d.ts +10 -0
  35. package/out/controller/notification/notice.controller.d.ts.map +1 -0
  36. package/out/controller/notification/notice.controller.js +13 -0
  37. package/out/global/global-util/global-util.d.ts +17 -1
  38. package/out/global/global-util/global-util.d.ts.map +1 -1
  39. package/out/global/global-util/global-util.js +17 -1
  40. package/out/interface/common/i-app-hub-service/i-app-hub-service.d.ts +8 -1
  41. package/out/interface/common/i-app-hub-service/i-app-hub-service.d.ts.map +1 -1
  42. package/out/interface/common/i-app-service/i-app-service.d.ts +16 -1
  43. package/out/interface/common/i-app-service/i-app-service.d.ts.map +1 -1
  44. package/out/interface/common/i-popover-options/i-popover-options.d.ts +9 -1
  45. package/out/interface/common/i-popover-options/i-popover-options.d.ts.map +1 -1
  46. package/out/interface/controller/controller/index.d.ts +1 -0
  47. package/out/interface/controller/controller/index.d.ts.map +1 -1
  48. package/out/interface/controller/controller/index.js +1 -0
  49. package/out/interface/controller/controller/notice/i-async-action.controller.d.ts +49 -0
  50. package/out/interface/controller/controller/notice/i-async-action.controller.d.ts.map +1 -0
  51. package/out/interface/controller/controller/notice/i-async-action.controller.js +1 -0
  52. package/out/interface/controller/controller/notice/i-internal-message.controller.d.ts +68 -0
  53. package/out/interface/controller/controller/notice/i-internal-message.controller.d.ts.map +1 -0
  54. package/out/interface/controller/controller/notice/i-internal-message.controller.js +1 -0
  55. package/out/interface/controller/controller/notice/i-notice.controller.d.ts +33 -0
  56. package/out/interface/controller/controller/notice/i-notice.controller.d.ts.map +1 -0
  57. package/out/interface/controller/controller/notice/i-notice.controller.js +1 -0
  58. package/out/interface/controller/controller/notice/index.d.ts +4 -0
  59. package/out/interface/controller/controller/notice/index.d.ts.map +1 -0
  60. package/out/interface/controller/controller/notice/index.js +1 -0
  61. package/out/interface/provider/i-async-action.provider.d.ts +11 -3
  62. package/out/interface/provider/i-async-action.provider.d.ts.map +1 -1
  63. package/out/interface/provider/i-internal-message.provider.d.ts +10 -2
  64. package/out/interface/provider/i-internal-message.provider.d.ts.map +1 -1
  65. package/out/interface/util/i-animation-util/i-animation-options.d.ts +31 -0
  66. package/out/interface/util/i-animation-util/i-animation-options.d.ts.map +1 -0
  67. package/out/interface/util/i-animation-util/i-animation-options.js +1 -0
  68. package/out/interface/util/i-notice-util/i-notice-util.d.ts +34 -0
  69. package/out/interface/util/i-notice-util/i-notice-util.d.ts.map +1 -0
  70. package/out/interface/util/i-notice-util/i-notice-util.js +1 -0
  71. package/out/interface/util/i-open-view-util/i-open-view-util.d.ts +2 -2
  72. package/out/interface/util/i-open-view-util/i-open-view-util.d.ts.map +1 -1
  73. package/out/interface/util/index.d.ts +2 -0
  74. package/out/interface/util/index.d.ts.map +1 -1
  75. package/out/register/helper/async-action-register.d.ts +2 -1
  76. package/out/register/helper/async-action-register.d.ts.map +1 -1
  77. package/out/register/helper/async-action-register.js +3 -3
  78. package/out/register/helper/internal-message-register.js +2 -2
  79. package/out/service/dto/method.dto.d.ts.map +1 -1
  80. package/out/service/dto/method.dto.js +11 -0
  81. package/out/service/mqtt/mqtt.service.d.ts.map +1 -1
  82. package/out/service/mqtt/mqtt.service.js +1 -0
  83. package/out/service/service/auth/v7-auth.service.d.ts.map +1 -1
  84. package/out/service/service/auth/v7-auth.service.js +4 -0
  85. package/out/service/service/entity/method/de-action.d.ts.map +1 -1
  86. package/out/service/service/entity/method/de-action.js +4 -4
  87. package/out/service/service/internal-message/internal-message.service.d.ts +1 -1
  88. package/out/service/service/internal-message/internal-message.service.d.ts.map +1 -1
  89. package/out/service/service/internal-message/internal-message.service.js +7 -16
  90. package/out/service/utils/de-cache/de-cache.d.ts +2 -4
  91. package/out/service/utils/de-cache/de-cache.d.ts.map +1 -1
  92. package/out/service/utils/de-cache/de-cache.js +4 -8
  93. package/out/service/utils/dyna-sys-params/dyna-sys-params.d.ts +21 -0
  94. package/out/service/utils/dyna-sys-params/dyna-sys-params.d.ts.map +1 -0
  95. package/out/service/utils/dyna-sys-params/dyna-sys-params.js +48 -0
  96. package/out/service/utils/dynamic-code-list/dynamic-code-list.d.ts.map +1 -1
  97. package/out/service/utils/dynamic-code-list/dynamic-code-list.js +9 -5
  98. package/out/service/utils/index.d.ts +1 -0
  99. package/out/service/utils/index.d.ts.map +1 -1
  100. package/out/service/utils/index.js +1 -0
  101. package/out/service/vo/tree-node-data/tree-data-set-node-data.d.ts.map +1 -1
  102. package/out/service/vo/tree-node-data/tree-data-set-node-data.js +8 -0
  103. package/out/types.d.ts +8 -1
  104. package/out/types.d.ts.map +1 -1
  105. package/out/ui-action/uiaction-util.d.ts +23 -0
  106. package/out/ui-action/uiaction-util.d.ts.map +1 -1
  107. package/out/ui-action/uiaction-util.js +39 -1
  108. package/out/utils/anime/anime-element-util.d.ts +44 -0
  109. package/out/utils/anime/anime-element-util.d.ts.map +1 -0
  110. package/out/utils/anime/anime-element-util.js +108 -0
  111. package/out/utils/anime/anime-util/anime-util.d.ts +60 -0
  112. package/out/utils/anime/anime-util/anime-util.d.ts.map +1 -0
  113. package/out/utils/anime/anime-util/anime-util.js +96 -0
  114. package/out/utils/anime/anime.d.ts +27 -0
  115. package/out/utils/anime/anime.d.ts.map +1 -0
  116. package/out/utils/anime/anime.js +86 -0
  117. package/out/utils/anime/index.d.ts +2 -0
  118. package/out/utils/anime/index.d.ts.map +1 -0
  119. package/out/utils/anime/index.js +1 -0
  120. package/out/utils/file-util/file-util.d.ts +57 -0
  121. package/out/utils/file-util/file-util.d.ts.map +1 -0
  122. package/out/utils/file-util/file-util.js +113 -0
  123. package/out/utils/file-util/index.d.ts +2 -0
  124. package/out/utils/file-util/index.d.ts.map +1 -0
  125. package/out/utils/file-util/index.js +1 -0
  126. package/out/utils/index.d.ts +2 -0
  127. package/out/utils/index.d.ts.map +1 -1
  128. package/out/utils/index.js +2 -0
  129. package/package.json +9 -5
  130. package/src/app-hub.ts +3 -0
  131. package/src/application.ts +31 -16
  132. package/src/constant/index.ts +1 -0
  133. package/src/constant/preset-identifier.ts +15 -0
  134. package/src/controller/common/editor/editor.controller.ts +11 -1
  135. package/src/controller/control/exp-bar/exp-bar.controller.ts +6 -0
  136. package/src/controller/control/exp-bar/tree-exp-bar.controller.ts +17 -0
  137. package/src/controller/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-ua-column/tree-grid-ex-ua-column.controller.ts +68 -4
  138. package/src/controller/notification/async-action.controller.ts +163 -0
  139. package/src/controller/notification/index.ts +1 -0
  140. package/src/controller/notification/internal-message.controller.ts +64 -0
  141. package/src/controller/notification/notice.controller.ts +16 -0
  142. package/src/global/global-util/global-util.ts +20 -0
  143. package/src/interface/common/i-app-hub-service/i-app-hub-service.ts +9 -1
  144. package/src/interface/common/i-app-service/i-app-service.ts +18 -0
  145. package/src/interface/common/i-popover-options/i-popover-options.ts +10 -1
  146. package/src/interface/controller/controller/index.ts +1 -0
  147. package/src/interface/controller/controller/notice/i-async-action.controller.ts +52 -0
  148. package/src/interface/controller/controller/notice/i-internal-message.controller.ts +74 -0
  149. package/src/interface/controller/controller/notice/i-notice.controller.ts +36 -0
  150. package/src/interface/controller/controller/notice/index.ts +9 -0
  151. package/src/interface/provider/i-async-action.provider.ts +14 -3
  152. package/src/interface/provider/i-internal-message.provider.ts +10 -2
  153. package/src/interface/util/i-animation-util/i-animation-options.ts +34 -0
  154. package/src/interface/util/i-notice-util/i-notice-util.ts +34 -0
  155. package/src/interface/util/i-open-view-util/i-open-view-util.ts +2 -1
  156. package/src/interface/util/index.ts +2 -0
  157. package/src/register/helper/async-action-register.ts +4 -4
  158. package/src/register/helper/internal-message-register.ts +2 -2
  159. package/src/service/dto/method.dto.ts +16 -0
  160. package/src/service/mqtt/mqtt.service.ts +1 -0
  161. package/src/service/service/auth/v7-auth.service.ts +5 -0
  162. package/src/service/service/entity/method/de-action.ts +2 -12
  163. package/src/service/service/internal-message/internal-message.service.ts +12 -18
  164. package/src/service/utils/de-cache/de-cache.ts +4 -18
  165. package/src/service/utils/dyna-sys-params/dyna-sys-params.ts +66 -0
  166. package/src/service/utils/dynamic-code-list/dynamic-code-list.ts +9 -6
  167. package/src/service/utils/index.ts +1 -0
  168. package/src/service/vo/tree-node-data/tree-data-set-node-data.ts +8 -0
  169. package/src/types.ts +9 -0
  170. package/src/ui-action/uiaction-util.ts +48 -1
  171. package/src/utils/anime/anime-element-util.ts +141 -0
  172. package/src/utils/anime/anime-util/anime-util.ts +123 -0
  173. package/src/utils/anime/anime.ts +111 -0
  174. package/src/utils/anime/index.ts +1 -0
  175. package/src/utils/file-util/file-util.ts +141 -0
  176. package/src/utils/file-util/index.ts +1 -0
  177. package/src/utils/index.ts +2 -0
@@ -0,0 +1,52 @@
1
+ import { IPortalAsyncAction } from '@ibiz-template/core';
2
+ import { QXEvent } from 'qx-util';
3
+
4
+ /**
5
+ * 站内信事件
6
+ * @author lxm
7
+ * @date 2024-01-26 10:47:41
8
+ * @interface IAsyncActionEvent
9
+ */
10
+ export interface IAsyncActionEvent {
11
+ /**
12
+ * 所有数据的变更,新增,删除,更新都算
13
+ * @author lxm
14
+ * @date 2024-01-26 10:56:50
15
+ */
16
+ dataChange: () => void;
17
+ change: (msg: IPortalAsyncAction) => void;
18
+ add: (msg: IPortalAsyncAction) => void;
19
+ }
20
+
21
+ /**
22
+ * 异步操作逻辑控制器
23
+ * @author lxm
24
+ * @date 2024-01-26 09:57:13
25
+ * @export
26
+ * @interface IAsyncActionController
27
+ */
28
+ export interface IAsyncActionController {
29
+ /**
30
+ * 事件
31
+ * @author lxm
32
+ * @date 2024-01-26 10:48:53
33
+ * @type {QXEvent<IAsyncActionEvent>}
34
+ */
35
+ readonly evt: QXEvent<IAsyncActionEvent>;
36
+
37
+ /**
38
+ * 总条数
39
+ * @author lxm
40
+ * @date 2024-01-26 10:00:25
41
+ * @type {number}
42
+ */
43
+ readonly total: number;
44
+
45
+ /**
46
+ * 当前已加载的所有异步操作集合
47
+ * @author lxm
48
+ * @date 2024-01-26 10:06:05
49
+ * @type {IPortalAsyncAction[]}
50
+ */
51
+ readonly actions: IPortalAsyncAction[];
52
+ }
@@ -0,0 +1,74 @@
1
+ import { IInternalMessage } from '@ibiz-template/core';
2
+ import { QXEvent } from 'qx-util';
3
+
4
+ /**
5
+ * 站内信事件
6
+ * @author lxm
7
+ * @date 2024-01-26 10:47:41
8
+ * @interface InternalMessageEvent
9
+ */
10
+ export interface InternalMessageEvent {
11
+ /**
12
+ * 所有数据的变更,新增,删除,更新都算
13
+ * @author lxm
14
+ * @date 2024-01-26 10:56:50
15
+ */
16
+ dataChange: () => void;
17
+ }
18
+
19
+ /**
20
+ * 站内信逻辑控制器
21
+ * @author lxm
22
+ * @date 2024-01-26 09:57:13
23
+ * @export
24
+ * @interface IInternalMessageController
25
+ */
26
+ export interface IInternalMessageController {
27
+ /**
28
+ * 事件
29
+ * @author lxm
30
+ * @date 2024-01-26 10:48:53
31
+ * @type {QXEvent<InternalMessageEvent>}
32
+ */
33
+ readonly evt: QXEvent<InternalMessageEvent>;
34
+
35
+ /**
36
+ * 总条数
37
+ * @author lxm
38
+ * @date 2024-01-26 10:00:25
39
+ * @type {number}
40
+ */
41
+ readonly total: number;
42
+
43
+ /**
44
+ * 每次请求加载的条数
45
+ * @author lxm
46
+ * @date 2024-01-26 10:00:45
47
+ * @type {number}
48
+ */
49
+ readonly size: number;
50
+
51
+ /**
52
+ * 当前已加载的所有消息集合
53
+ * @author lxm
54
+ * @date 2024-01-26 10:06:05
55
+ * @type {IInternalMessage[]}
56
+ */
57
+ readonly messages: IInternalMessage[];
58
+
59
+ /**
60
+ * 加载(会重置数据)
61
+ * @author lxm
62
+ * @date 2024-01-26 10:19:31
63
+ * @return {*} {Promise<void>}
64
+ */
65
+ load(): Promise<void>;
66
+
67
+ /**
68
+ * 加载更多
69
+ * @author lxm
70
+ * @date 2024-01-26 10:19:43
71
+ * @return {*} {Promise<void>}
72
+ */
73
+ loadMore(): Promise<void>;
74
+ }
@@ -0,0 +1,36 @@
1
+ import { IAsyncActionController } from './i-async-action.controller';
2
+ import { IInternalMessageController } from './i-internal-message.controller';
3
+
4
+ export interface INoticeController {
5
+ /**
6
+ * 需要处理的通知总数
7
+ * @author lxm
8
+ * @date 2024-01-25 04:33:06
9
+ * @type {number}
10
+ */
11
+ total: number;
12
+
13
+ /**
14
+ * 站内信控制器
15
+ * @author lxm
16
+ * @date 2024-01-26 09:58:36
17
+ * @type {IInternalMessageController}
18
+ */
19
+ internalMessage: IInternalMessageController;
20
+
21
+ /**
22
+ * 异步操作控制器
23
+ * @author lxm
24
+ * @date 2024-01-26 09:58:55
25
+ * @type {IAsyncActionController}
26
+ */
27
+ asyncAction: IAsyncActionController;
28
+
29
+ /**
30
+ * 初始化
31
+ * @author lxm
32
+ * @date 2024-01-25 06:47:09
33
+ * @return {*} {Promise<void>}
34
+ */
35
+ init(): Promise<void>;
36
+ }
@@ -0,0 +1,9 @@
1
+ export type { INoticeController } from './i-notice.controller';
2
+ export type {
3
+ IAsyncActionController,
4
+ IAsyncActionEvent,
5
+ } from './i-async-action.controller';
6
+ export type {
7
+ IInternalMessageController,
8
+ InternalMessageEvent,
9
+ } from './i-internal-message.controller';
@@ -10,7 +10,7 @@ import { IPortalAsyncAction } from '@ibiz-template/core';
10
10
  */
11
11
  export interface IAsyncActionProvider {
12
12
  /**
13
- * 绘制组件
13
+ * 绘制组件(不能是字符串)
14
14
  * @author lxm
15
15
  * @date 2022-09-20 10:09:50
16
16
  * @type {unknown}
@@ -18,13 +18,24 @@ export interface IAsyncActionProvider {
18
18
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
19
19
  component: any;
20
20
 
21
+ /**
22
+ * 绘制函数
23
+ * @author lxm
24
+ * @date 2024-01-26 05:38:09
25
+ */
26
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
+ render: (props: IData & { action: IPortalAsyncAction }) => any;
28
+
21
29
  /**
22
30
  * 点击事件
23
31
  * @author lxm
24
32
  * @date 2024-01-15 12:47:22
25
33
  * @param {IPortalAsyncAction} asyncAction
26
34
  * @param {MouseEvent} event
27
- * @return {*} {boolean} 返回是否隐藏消息popover
35
+ * @return {*} {boolean} 返回是否需要隐藏外层组件消息
28
36
  */
29
- onClick(asyncAction: IPortalAsyncAction, event: MouseEvent): boolean;
37
+ onClick?(
38
+ asyncAction: IPortalAsyncAction,
39
+ event: MouseEvent,
40
+ ): Promise<boolean>;
30
41
  }
@@ -18,13 +18,21 @@ export interface IInternalMessageProvider {
18
18
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
19
19
  component: any;
20
20
 
21
+ /**
22
+ * 绘制函数
23
+ * @author lxm
24
+ * @date 2024-01-26 05:38:09
25
+ */
26
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
+ render: (props: IData & { message: IInternalMessage }) => any;
28
+
21
29
  /**
22
30
  * 点击事件
23
31
  * @author lxm
24
32
  * @date 2024-01-15 12:47:22
25
- * @param {IInternalMessage} asyncAction
33
+ * @param {IInternalMessage} message
26
34
  * @param {MouseEvent} event
27
35
  * @return {*} {boolean} 返回是否隐藏消息popover
28
36
  */
29
- onClick(asyncAction: IInternalMessage, event: MouseEvent): boolean;
37
+ onClick?(message: IInternalMessage, event: MouseEvent): Promise<boolean>;
30
38
  }
@@ -0,0 +1,34 @@
1
+ export interface IAnimationOptions {
2
+ /**
3
+ * 动画持续时间
4
+ *
5
+ * @author zk
6
+ * @date 2024-01-24 04:01:29
7
+ * @type {number}
8
+ * @memberof IAnimationOptions
9
+ */
10
+ duration?: number;
11
+
12
+ /**
13
+ * 是否循环
14
+ *
15
+ * @author zk
16
+ * @date 2024-01-24 04:01:19
17
+ * @type {false}
18
+ * @memberof IAnimationOptions
19
+ */
20
+ loop?: false;
21
+
22
+ /**
23
+ * 运行速度曲线
24
+ *
25
+ * @author zk
26
+ * @date 2024-01-25 01:01:52
27
+ * @type {string}
28
+ * @memberof IAnimationOptions
29
+ */
30
+ easing?: string;
31
+
32
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
+ [key: string | symbol]: any;
34
+ }
@@ -0,0 +1,34 @@
1
+ import { IPortalAsyncAction } from '@ibiz-template/core';
2
+
3
+ /**
4
+ * 系统全局消息通知的呈现工具类
5
+ *
6
+ * @author lxm
7
+ * @date 2024-01-26 05:09:14
8
+ * @export
9
+ * @interface INoticeUtil
10
+ */
11
+ export interface INoticeUtil {
12
+ /**
13
+ * 展示异步操作的通知
14
+ * @author lxm
15
+ * @date 2024-01-26 04:40:10
16
+ * @param {IPortalAsyncAction} asyncAction
17
+ */
18
+ showAsyncAction(asyncAction: IPortalAsyncAction): void;
19
+
20
+ /**
21
+ * 展示正在执行的相关信息的通知
22
+ * @author lxm
23
+ * @date 2024-01-26 05:11:55
24
+ * @param {{ num: number }} info
25
+ */
26
+ showDoingNotice(info: { num: number }): void;
27
+
28
+ /**
29
+ * 关闭正在执行的相关信息的通知
30
+ * @author lxm
31
+ * @date 2024-01-26 05:13:12
32
+ */
33
+ closeDoingNotice(): void;
34
+ }
@@ -1,4 +1,4 @@
1
- import { IModalData } from '../../common';
1
+ import { IModalData, IPopoverOptions } from '../../common';
2
2
 
3
3
  /**
4
4
  * 打开视图工具类
@@ -83,6 +83,7 @@ export interface IOpenViewUtil {
83
83
  event: MouseEvent,
84
84
  context: IContext,
85
85
  params?: IParams,
86
+ options?: IPopoverOptions,
86
87
  ): Promise<IModalData>;
87
88
 
88
89
  /**
@@ -16,3 +16,5 @@ export type { IOverlayPopoverContainer } from './i-overlay-popover-container/i-o
16
16
  export type { IScriptFunctionOpts } from './script/i-script-function';
17
17
  export type { IExcelUtil } from './i-excel-util/i-excel-util';
18
18
  export type { IViewStack, IViewStackEvent } from './i-view-stack/i-view-stack';
19
+ export type { IAnimationOptions } from './i-animation-util/i-animation-options';
20
+ export type { INoticeUtil } from './i-notice-util/i-notice-util';
@@ -1,4 +1,4 @@
1
- import { RuntimeError } from '@ibiz-template/core';
1
+ import { IPortalAsyncAction, RuntimeError } from '@ibiz-template/core';
2
2
  import { IAsyncActionProvider } from '../../interface';
3
3
 
4
4
  /** 界面行为适配器前缀 */
@@ -34,15 +34,15 @@ function getProvider(key: string): IAsyncActionProvider | undefined {
34
34
  * @return {*} {Promise<IAsyncActionProvider>}
35
35
  */
36
36
  export function getAsyncActionProvider(
37
- actiontype: string,
37
+ action: IPortalAsyncAction,
38
38
  ): IAsyncActionProvider {
39
39
  const provider: IAsyncActionProvider | undefined = getProvider(
40
- actiontype || 'DEFAULT',
40
+ action.actiontype || 'DEFAULT',
41
41
  );
42
42
 
43
43
  // 找异步操作类型
44
44
  if (!provider) {
45
- throw new RuntimeError(`找不异步操作类型${actiontype}对应的适配器`);
45
+ throw new RuntimeError(`找不异步操作类型${action.actiontype}对应的适配器`);
46
46
  } else {
47
47
  return provider;
48
48
  }
@@ -40,12 +40,12 @@ export function getInternalMessageProvider(
40
40
  msg: IInternalMessage,
41
41
  ): IInternalMessageProvider {
42
42
  const provider: IInternalMessageProvider | undefined = getProvider(
43
- msg.message_type || 'DEFAULT',
43
+ msg.content_type || 'DEFAULT',
44
44
  );
45
45
 
46
46
  // 找异步操作类型
47
47
  if (!provider) {
48
- throw new RuntimeError(`找不站内信类型${msg.message_type}对应的适配器`);
48
+ throw new RuntimeError(`找不站内信类型${msg.content_type}对应的适配器`);
49
49
  } else {
50
50
  return provider;
51
51
  }
@@ -193,6 +193,7 @@ export class MethodDto {
193
193
  * @return {*} {Promise<IDataEntity[]>}
194
194
  */
195
195
  async sets(context: IContext, data: IData[]): Promise<IDataEntity[]> {
196
+ const uiDomain = ibiz.uiDomainManager.get(context.srfsessionid);
196
197
  return Promise.all(
197
198
  data.map(async datum => {
198
199
  const all = this.fields
@@ -206,7 +207,22 @@ export class MethodDto {
206
207
  if (!field.refAppDataEntityId) {
207
208
  return;
208
209
  }
210
+
211
+ // 获取当前需要打包子数据的关系配置
212
+ const configs = uiDomain.getDERConfig(field.refAppDataEntityId!);
213
+
214
+ // 查找当前 dto 实体在关系配置中和本实体的关系配置
215
+ const deRs = configs.find(rs => {
216
+ return rs.majorAppDataEntityId === this.entity.id;
217
+ });
218
+
209
219
  const dto = await this.getFieldDto(context, field);
220
+
221
+ if (!deRs) {
222
+ // 如果没有关系配置,则清空本地缓存再设置。如果已经配置关系的 MethodReturn.handle 时会清理掉缓存
223
+ dto.service.local.clear();
224
+ }
225
+
210
226
  const items: IData[] = datum[key];
211
227
  if (items && items.length > 0) {
212
228
  const pKey = datum[this.entity.keyAppDEFieldId!];
@@ -111,5 +111,6 @@ export class MqttService {
111
111
  */
112
112
  close(): void {
113
113
  this.client?.end();
114
+ this.evt.reset();
114
115
  }
115
116
  }
@@ -138,6 +138,11 @@ export class V7AuthService implements IAuthService {
138
138
  true,
139
139
  );
140
140
  }
141
+
142
+ // 刷新token之后用新的token重连mqtt
143
+ ibiz.hub.getAllApps().forEach(app => {
144
+ app.initMqtt();
145
+ });
141
146
  }
142
147
  // 下一次延时做准备
143
148
  this.extendLogin();
@@ -279,18 +279,13 @@ export class DEActionMethod extends Method {
279
279
  resultData = await Promise.all(
280
280
  addData.map(
281
281
  item =>
282
- this.service.local.add(
283
- context,
284
- this.attach(context, item),
285
- false,
286
- )!,
282
+ this.service.local.add(context, this.attach(context, item))!,
287
283
  ),
288
284
  );
289
285
  } else {
290
286
  resultData = await this.service.local.add(
291
287
  context,
292
288
  this.attach(context, addData),
293
- false,
294
289
  )!;
295
290
  }
296
291
  return new HttpResponse(resultData);
@@ -500,18 +495,13 @@ export class DEActionMethod extends Method {
500
495
  resultData = await Promise.all(
501
496
  updateData.map(
502
497
  item =>
503
- this.service.local.update(
504
- context,
505
- this.attach(context, item),
506
- false,
507
- )!,
498
+ this.service.local.update(context, this.attach(context, item))!,
508
499
  ),
509
500
  );
510
501
  } else {
511
502
  resultData = await this.service.local.update(
512
503
  context,
513
504
  this.attach(context, updateData),
514
- false,
515
505
  )!;
516
506
  }
517
507
  if (resultData) {
@@ -8,7 +8,7 @@ export class InternalMessageService implements IInternalMessageService {
8
8
  * @author lxm
9
9
  * @date 2024-01-23 02:06:47
10
10
  */
11
- baseUrl = '/extension/internal_messages';
11
+ protected baseUrl = '/extension/internal_messages';
12
12
 
13
13
  /**
14
14
  * 获取站内信的集合
@@ -20,13 +20,18 @@ export class InternalMessageService implements IInternalMessageService {
20
20
  async fetch(
21
21
  params: IParams = {},
22
22
  ): Promise<IHttpResponse<IInternalMessage[]>> {
23
- // const res = await ibiz.net.post(
24
- // `${this.baseUrl}/fetch_cur_receiver`,
25
- // params,
26
- // );
27
- const res: IData = {
28
- ok: true,
23
+ // 默认的查询参数
24
+ const fetchParams = {
25
+ page: 0,
26
+ size: 20,
27
+ sort: 'update_time,desc',
29
28
  };
29
+ Object.assign(fetchParams, params);
30
+
31
+ const res = await ibiz.net.post(
32
+ `${this.baseUrl}/fetch_cur_receiver`,
33
+ fetchParams,
34
+ );
30
35
  if (res.headers) {
31
36
  if (res.headers['x-page']) {
32
37
  res.page = Number(res.headers['x-page']);
@@ -41,17 +46,6 @@ export class InternalMessageService implements IInternalMessageService {
41
46
  if (isNil(res.data)) {
42
47
  res.data = [];
43
48
  }
44
-
45
- res.page = params.page;
46
- res.total = 34;
47
- res.data = Array.from({ length: params.size }, (_, i) => ({
48
- id: i + 1,
49
- status: 'RECEIVED',
50
- title: `标题${i + 1}`,
51
- content: `内容${i + 1}长内容`,
52
- short_content: `内容${i + 1}短内容`,
53
- create_time: new Date().toISOString(),
54
- }));
55
49
  return res as IHttpResponse<IInternalMessage[]>;
56
50
  }
57
51
 
@@ -95,19 +95,14 @@ export class DECache {
95
95
  *
96
96
  * @param {*} context
97
97
  * @param {IDataEntity} entity
98
- * @param {boolean} [ignoreDuplicate=true] 是否忽略主键重复(不忽略报错,忽略则覆盖)
99
98
  * @return {*} {boolean}
100
99
  * @memberof EntityCache
101
100
  */
102
- add(
103
- context: IContext,
104
- entity: IDataEntity,
105
- ignoreDuplicate = true,
106
- ): IDataEntity | null {
101
+ add(context: IContext, entity: IDataEntity): IDataEntity | null {
107
102
  // 联合主键相关数据处理
108
103
  if (this.isUnionKey) {
109
104
  this.calcUnionKey(entity);
110
- if (ignoreDuplicate === false && this.checkData(context, entity.srfkey)) {
105
+ if (this.checkData(context, entity.srfkey)) {
111
106
  throw new RuntimeError(
112
107
  `新建联合主键数据失败,已有主键为${entity.srfkey}的数据`,
113
108
  );
@@ -164,25 +159,16 @@ export class DECache {
164
159
  *
165
160
  * @param {IContext} context
166
161
  * @param {IDataEntity} entity
167
- * @param {boolean} [ignoreDuplicate=true] 是否忽略主键重复(不忽略报错,忽略则覆盖)
168
162
  * @return {*} {IDataEntity}
169
163
  * @memberof EntityCache
170
164
  */
171
- update(
172
- context: IContext,
173
- entity: IDataEntity,
174
- ignoreDuplicate = true,
175
- ): IDataEntity | null {
165
+ update(context: IContext, entity: IDataEntity): IDataEntity | null {
176
166
  const oldKey = entity.srfkey!;
177
167
  // 联合主键相关数据处理
178
168
  if (this.isUnionKey) {
179
169
  this.calcUnionKey(entity);
180
170
  // 只在临时数据的新建更新时,主键改变的时候,检测变更之后的主键是否已经存在
181
- if (
182
- ignoreDuplicate === false &&
183
- oldKey !== entity.srfkey &&
184
- this.checkData(context, entity.srfkey)
185
- ) {
171
+ if (oldKey !== entity.srfkey && this.checkData(context, entity.srfkey)) {
186
172
  throw new RuntimeError(
187
173
  `更新联合主键数据失败,已有主键为${entity.srfkey}的数据`,
188
174
  );
@@ -0,0 +1,66 @@
1
+ import { getMatchResPath } from '../res-path/res-path';
2
+
3
+ /**
4
+ * 计算动态系统接口参数
5
+ * @author lxm
6
+ * @date 2024-01-25 03:30:18
7
+ * @export
8
+ * @param {string} appDataEntityId 实体id
9
+ * @param {IContext} context 视图上下文
10
+ * @param {{
11
+ * viewParams?: IParams; 视图参数
12
+ * appId?: string; 应用id
13
+ * }} [opts={}]
14
+ */
15
+ export async function calcDynaSysParams(
16
+ appDataEntityId: string,
17
+ context: IContext,
18
+ opts: {
19
+ viewParams?: IParams;
20
+ appId?: string;
21
+ } = {},
22
+ ): Promise<{
23
+ srfkey?: string | undefined;
24
+ srfparentkey?: string | undefined;
25
+ srfparentdeanme?: string | undefined;
26
+ }> {
27
+ const appId = opts.appId || context.srfappid;
28
+ const viewParams = opts.viewParams || {};
29
+ const loadModelParams: {
30
+ srfkey?: string;
31
+ srfparentkey?: string;
32
+ srfparentdeanme?: string;
33
+ } = {};
34
+
35
+ const appDe = await ibiz.hub.getAppDataEntity(appDataEntityId, appId);
36
+
37
+ // *计算srfkey
38
+ if (viewParams.srfkey) {
39
+ loadModelParams.srfkey = viewParams.srfkey;
40
+ } else {
41
+ // * 计算资源路径上下文参数
42
+ // 主键
43
+ const srfkey = context[appDe.codeName!.toLowerCase()];
44
+ if (srfkey) {
45
+ loadModelParams.srfkey = srfkey;
46
+ }
47
+ }
48
+
49
+ // *计算上层父实体主键和name
50
+ if (viewParams.srfparentkey && viewParams.srfparentdeanme) {
51
+ loadModelParams.srfparentkey = viewParams.srfparentkey;
52
+ loadModelParams.srfparentdeanme = viewParams.srfparentdeanme;
53
+ } else {
54
+ // 上层资源路径主实体名称和主键
55
+ const match = getMatchResPath(context, appDe);
56
+ if (match && match.keys.length > 1) {
57
+ const parentDeKey = match.keys[match.keys.length - 2];
58
+ loadModelParams.srfparentkey =
59
+ viewParams.srfparentkey || context[parentDeKey];
60
+ loadModelParams.srfparentdeanme =
61
+ viewParams.srfparentdeanme || parentDeKey;
62
+ }
63
+ }
64
+
65
+ return loadModelParams;
66
+ }
@@ -108,7 +108,7 @@ export class DynamicCodeListCache {
108
108
  const { predefinedType } = this.codeList;
109
109
  if (predefinedType) {
110
110
  this.isPredefined = true;
111
- if (!['OPERATOR', 'RUNTIME'].includes(predefinedType)) {
111
+ if (!['OPERATOR', 'RUNTIME', 'DEMAINSTATE'].includes(predefinedType)) {
112
112
  throw new ModelError(
113
113
  this.codeList,
114
114
  `预定义类型${predefinedType}暂不支持`,
@@ -249,11 +249,14 @@ export class DynamicCodeListCache {
249
249
 
250
250
  // *预定义加载
251
251
  if (this.isPredefined && this.codeList.codeName) {
252
- const index = this.codeList.codeName.indexOf('__');
253
- const tag =
254
- index !== -1
255
- ? this.codeList.codeName.substring(index + 2)
256
- : this.codeList.codeName;
252
+ let tag = this.codeList.codeName;
253
+ if (this.codeList.predefinedType === 'OPERATOR') {
254
+ const index = this.codeList.codeName.indexOf('__');
255
+ tag =
256
+ index !== -1
257
+ ? this.codeList.codeName.substring(index + 2)
258
+ : this.codeList.codeName;
259
+ }
257
260
  const res = await app.net.get(
258
261
  `/dictionaries/codelist/${tag}`,
259
262
  tempParams,
@@ -6,3 +6,4 @@ export { DECache } from './de-cache/de-cache';
6
6
  export { getMatchResPath, calcResPath } from './res-path/res-path';
7
7
  export { SearchFilter } from './search-filter/search-filter';
8
8
  export { fieldValueToBoolean } from './util/util';
9
+ export { calcDynaSysParams } from './dyna-sys-params/dyna-sys-params';