@ibiz-template/runtime 0.5.7-alpha.3 → 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 (103) hide show
  1. package/dist/index.esm.js +551 -207
  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.js +1 -1
  7. package/out/controller/control/exp-bar/exp-bar.controller.d.ts.map +1 -1
  8. package/out/controller/control/exp-bar/exp-bar.controller.js +7 -0
  9. package/out/controller/control/exp-bar/tree-exp-bar.controller.d.ts +5 -0
  10. package/out/controller/control/exp-bar/tree-exp-bar.controller.d.ts.map +1 -1
  11. package/out/controller/control/exp-bar/tree-exp-bar.controller.js +16 -0
  12. package/out/controller/notification/async-action.controller.d.ts +64 -0
  13. package/out/controller/notification/async-action.controller.d.ts.map +1 -0
  14. package/out/controller/notification/async-action.controller.js +141 -0
  15. package/out/controller/notification/index.d.ts +2 -0
  16. package/out/controller/notification/index.d.ts.map +1 -0
  17. package/out/controller/notification/index.js +1 -0
  18. package/out/controller/notification/internal-message.controller.d.ts +23 -0
  19. package/out/controller/notification/internal-message.controller.d.ts.map +1 -0
  20. package/out/controller/notification/internal-message.controller.js +50 -0
  21. package/out/controller/notification/notice.controller.d.ts +10 -0
  22. package/out/controller/notification/notice.controller.d.ts.map +1 -0
  23. package/out/controller/notification/notice.controller.js +13 -0
  24. package/out/global/global-util/global-util.d.ts +9 -1
  25. package/out/global/global-util/global-util.d.ts.map +1 -1
  26. package/out/global/global-util/global-util.js +9 -1
  27. package/out/interface/common/i-app-hub-service/i-app-hub-service.d.ts +8 -1
  28. package/out/interface/common/i-app-hub-service/i-app-hub-service.d.ts.map +1 -1
  29. package/out/interface/common/i-popover-options/i-popover-options.d.ts +9 -1
  30. package/out/interface/common/i-popover-options/i-popover-options.d.ts.map +1 -1
  31. package/out/interface/controller/controller/index.d.ts +1 -0
  32. package/out/interface/controller/controller/index.d.ts.map +1 -1
  33. package/out/interface/controller/controller/index.js +1 -0
  34. package/out/interface/controller/controller/notice/i-async-action.controller.d.ts +49 -0
  35. package/out/interface/controller/controller/notice/i-async-action.controller.d.ts.map +1 -0
  36. package/out/interface/controller/controller/notice/i-async-action.controller.js +1 -0
  37. package/out/interface/controller/controller/notice/i-internal-message.controller.d.ts +68 -0
  38. package/out/interface/controller/controller/notice/i-internal-message.controller.d.ts.map +1 -0
  39. package/out/interface/controller/controller/notice/i-internal-message.controller.js +1 -0
  40. package/out/interface/controller/controller/notice/i-notice.controller.d.ts +33 -0
  41. package/out/interface/controller/controller/notice/i-notice.controller.d.ts.map +1 -0
  42. package/out/interface/controller/controller/notice/i-notice.controller.js +1 -0
  43. package/out/interface/controller/controller/notice/index.d.ts +4 -0
  44. package/out/interface/controller/controller/notice/index.d.ts.map +1 -0
  45. package/out/interface/controller/controller/notice/index.js +1 -0
  46. package/out/interface/provider/i-async-action.provider.d.ts +11 -3
  47. package/out/interface/provider/i-async-action.provider.d.ts.map +1 -1
  48. package/out/interface/provider/i-internal-message.provider.d.ts +10 -2
  49. package/out/interface/provider/i-internal-message.provider.d.ts.map +1 -1
  50. package/out/interface/util/i-notice-util/i-notice-util.d.ts +34 -0
  51. package/out/interface/util/i-notice-util/i-notice-util.d.ts.map +1 -0
  52. package/out/interface/util/i-notice-util/i-notice-util.js +1 -0
  53. package/out/interface/util/i-open-view-util/i-open-view-util.d.ts +2 -2
  54. package/out/interface/util/i-open-view-util/i-open-view-util.d.ts.map +1 -1
  55. package/out/interface/util/index.d.ts +1 -0
  56. package/out/interface/util/index.d.ts.map +1 -1
  57. package/out/register/helper/async-action-register.d.ts +2 -1
  58. package/out/register/helper/async-action-register.d.ts.map +1 -1
  59. package/out/register/helper/async-action-register.js +3 -3
  60. package/out/register/helper/internal-message-register.js +2 -2
  61. package/out/service/service/internal-message/internal-message.service.d.ts +1 -1
  62. package/out/service/service/internal-message/internal-message.service.d.ts.map +1 -1
  63. package/out/service/service/internal-message/internal-message.service.js +7 -16
  64. package/out/types.d.ts +8 -1
  65. package/out/types.d.ts.map +1 -1
  66. package/out/utils/file-util/file-util.d.ts +57 -0
  67. package/out/utils/file-util/file-util.d.ts.map +1 -0
  68. package/out/utils/file-util/file-util.js +113 -0
  69. package/out/utils/file-util/index.d.ts +2 -0
  70. package/out/utils/file-util/index.d.ts.map +1 -0
  71. package/out/utils/file-util/index.js +1 -0
  72. package/out/utils/index.d.ts +1 -0
  73. package/out/utils/index.d.ts.map +1 -1
  74. package/out/utils/index.js +1 -0
  75. package/package.json +3 -3
  76. package/src/app-hub.ts +3 -0
  77. package/src/application.ts +1 -1
  78. package/src/controller/control/exp-bar/exp-bar.controller.ts +6 -0
  79. package/src/controller/control/exp-bar/tree-exp-bar.controller.ts +17 -0
  80. package/src/controller/notification/async-action.controller.ts +163 -0
  81. package/src/controller/notification/index.ts +1 -0
  82. package/src/controller/notification/internal-message.controller.ts +64 -0
  83. package/src/controller/notification/notice.controller.ts +16 -0
  84. package/src/global/global-util/global-util.ts +10 -0
  85. package/src/interface/common/i-app-hub-service/i-app-hub-service.ts +9 -1
  86. package/src/interface/common/i-popover-options/i-popover-options.ts +10 -1
  87. package/src/interface/controller/controller/index.ts +1 -0
  88. package/src/interface/controller/controller/notice/i-async-action.controller.ts +52 -0
  89. package/src/interface/controller/controller/notice/i-internal-message.controller.ts +74 -0
  90. package/src/interface/controller/controller/notice/i-notice.controller.ts +36 -0
  91. package/src/interface/controller/controller/notice/index.ts +9 -0
  92. package/src/interface/provider/i-async-action.provider.ts +14 -3
  93. package/src/interface/provider/i-internal-message.provider.ts +10 -2
  94. package/src/interface/util/i-notice-util/i-notice-util.ts +34 -0
  95. package/src/interface/util/i-open-view-util/i-open-view-util.ts +2 -1
  96. package/src/interface/util/index.ts +1 -0
  97. package/src/register/helper/async-action-register.ts +4 -4
  98. package/src/register/helper/internal-message-register.ts +2 -2
  99. package/src/service/service/internal-message/internal-message.service.ts +12 -18
  100. package/src/types.ts +9 -0
  101. package/src/utils/file-util/file-util.ts +141 -0
  102. package/src/utils/file-util/index.ts +1 -0
  103. package/src/utils/index.ts +1 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i-async-action.controller.d.ts","sourceRoot":"","sources":["../../../../../src/interface/controller/controller/notice/i-async-action.controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,MAAM,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC1C,GAAG,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACxC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAEzC;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,EAAE,kBAAkB,EAAE,CAAC;CACxC"}
@@ -0,0 +1,68 @@
1
+ import { IInternalMessage } from '@ibiz-template/core';
2
+ import { QXEvent } from 'qx-util';
3
+ /**
4
+ * 站内信事件
5
+ * @author lxm
6
+ * @date 2024-01-26 10:47:41
7
+ * @interface InternalMessageEvent
8
+ */
9
+ export interface InternalMessageEvent {
10
+ /**
11
+ * 所有数据的变更,新增,删除,更新都算
12
+ * @author lxm
13
+ * @date 2024-01-26 10:56:50
14
+ */
15
+ dataChange: () => void;
16
+ }
17
+ /**
18
+ * 站内信逻辑控制器
19
+ * @author lxm
20
+ * @date 2024-01-26 09:57:13
21
+ * @export
22
+ * @interface IInternalMessageController
23
+ */
24
+ export interface IInternalMessageController {
25
+ /**
26
+ * 事件
27
+ * @author lxm
28
+ * @date 2024-01-26 10:48:53
29
+ * @type {QXEvent<InternalMessageEvent>}
30
+ */
31
+ readonly evt: QXEvent<InternalMessageEvent>;
32
+ /**
33
+ * 总条数
34
+ * @author lxm
35
+ * @date 2024-01-26 10:00:25
36
+ * @type {number}
37
+ */
38
+ readonly total: number;
39
+ /**
40
+ * 每次请求加载的条数
41
+ * @author lxm
42
+ * @date 2024-01-26 10:00:45
43
+ * @type {number}
44
+ */
45
+ readonly size: number;
46
+ /**
47
+ * 当前已加载的所有消息集合
48
+ * @author lxm
49
+ * @date 2024-01-26 10:06:05
50
+ * @type {IInternalMessage[]}
51
+ */
52
+ readonly messages: IInternalMessage[];
53
+ /**
54
+ * 加载(会重置数据)
55
+ * @author lxm
56
+ * @date 2024-01-26 10:19:31
57
+ * @return {*} {Promise<void>}
58
+ */
59
+ load(): Promise<void>;
60
+ /**
61
+ * 加载更多
62
+ * @author lxm
63
+ * @date 2024-01-26 10:19:43
64
+ * @return {*} {Promise<void>}
65
+ */
66
+ loadMore(): Promise<void>;
67
+ }
68
+ //# sourceMappingURL=i-internal-message.controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i-internal-message.controller.d.ts","sourceRoot":"","sources":["../../../../../src/interface/controller/controller/notice/i-internal-message.controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,0BAA0B;IACzC;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAE5C;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAEtC;;;;;OAKG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtB;;;;;OAKG;IACH,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B"}
@@ -0,0 +1,33 @@
1
+ import { IAsyncActionController } from './i-async-action.controller';
2
+ import { IInternalMessageController } from './i-internal-message.controller';
3
+ export interface INoticeController {
4
+ /**
5
+ * 需要处理的通知总数
6
+ * @author lxm
7
+ * @date 2024-01-25 04:33:06
8
+ * @type {number}
9
+ */
10
+ total: number;
11
+ /**
12
+ * 站内信控制器
13
+ * @author lxm
14
+ * @date 2024-01-26 09:58:36
15
+ * @type {IInternalMessageController}
16
+ */
17
+ internalMessage: IInternalMessageController;
18
+ /**
19
+ * 异步操作控制器
20
+ * @author lxm
21
+ * @date 2024-01-26 09:58:55
22
+ * @type {IAsyncActionController}
23
+ */
24
+ asyncAction: IAsyncActionController;
25
+ /**
26
+ * 初始化
27
+ * @author lxm
28
+ * @date 2024-01-25 06:47:09
29
+ * @return {*} {Promise<void>}
30
+ */
31
+ init(): Promise<void>;
32
+ }
33
+ //# sourceMappingURL=i-notice.controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i-notice.controller.d.ts","sourceRoot":"","sources":["../../../../../src/interface/controller/controller/notice/i-notice.controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAE7E,MAAM,WAAW,iBAAiB;IAChC;;;;;OAKG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;OAKG;IACH,eAAe,EAAE,0BAA0B,CAAC;IAE5C;;;;;OAKG;IACH,WAAW,EAAE,sBAAsB,CAAC;IAEpC;;;;;OAKG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB"}
@@ -0,0 +1,4 @@
1
+ export type { INoticeController } from './i-notice.controller';
2
+ export type { IAsyncActionController, IAsyncActionEvent, } from './i-async-action.controller';
3
+ export type { IInternalMessageController, InternalMessageEvent, } from './i-internal-message.controller';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/interface/controller/controller/notice/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,YAAY,EACV,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,iCAAiC,CAAC"}
@@ -9,20 +9,28 @@ import { IPortalAsyncAction } from '@ibiz-template/core';
9
9
  */
10
10
  export interface IAsyncActionProvider {
11
11
  /**
12
- * 绘制组件
12
+ * 绘制组件(不能是字符串)
13
13
  * @author lxm
14
14
  * @date 2022-09-20 10:09:50
15
15
  * @type {unknown}
16
16
  */
17
17
  component: any;
18
+ /**
19
+ * 绘制函数
20
+ * @author lxm
21
+ * @date 2024-01-26 05:38:09
22
+ */
23
+ render: (props: IData & {
24
+ action: IPortalAsyncAction;
25
+ }) => any;
18
26
  /**
19
27
  * 点击事件
20
28
  * @author lxm
21
29
  * @date 2024-01-15 12:47:22
22
30
  * @param {IPortalAsyncAction} asyncAction
23
31
  * @param {MouseEvent} event
24
- * @return {*} {boolean} 返回是否隐藏消息popover
32
+ * @return {*} {boolean} 返回是否需要隐藏外层组件消息
25
33
  */
26
- onClick(asyncAction: IPortalAsyncAction, event: MouseEvent): boolean;
34
+ onClick?(asyncAction: IPortalAsyncAction, event: MouseEvent): Promise<boolean>;
27
35
  }
28
36
  //# sourceMappingURL=i-async-action.provider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"i-async-action.provider.d.ts","sourceRoot":"","sources":["../../../src/interface/provider/i-async-action.provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IAEH,SAAS,EAAE,GAAG,CAAC;IAEf;;;;;;;OAOG;IACH,OAAO,CAAC,WAAW,EAAE,kBAAkB,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC;CACtE"}
1
+ {"version":3,"file":"i-async-action.provider.d.ts","sourceRoot":"","sources":["../../../src/interface/provider/i-async-action.provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IAEH,SAAS,EAAE,GAAG,CAAC;IAEf;;;;OAIG;IAEH,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,GAAG;QAAE,MAAM,EAAE,kBAAkB,CAAA;KAAE,KAAK,GAAG,CAAC;IAE/D;;;;;;;OAOG;IACH,OAAO,CAAC,CACN,WAAW,EAAE,kBAAkB,EAC/B,KAAK,EAAE,UAAU,GAChB,OAAO,CAAC,OAAO,CAAC,CAAC;CACrB"}
@@ -15,14 +15,22 @@ export interface IInternalMessageProvider {
15
15
  * @type {unknown}
16
16
  */
17
17
  component: any;
18
+ /**
19
+ * 绘制函数
20
+ * @author lxm
21
+ * @date 2024-01-26 05:38:09
22
+ */
23
+ render: (props: IData & {
24
+ message: IInternalMessage;
25
+ }) => any;
18
26
  /**
19
27
  * 点击事件
20
28
  * @author lxm
21
29
  * @date 2024-01-15 12:47:22
22
- * @param {IInternalMessage} asyncAction
30
+ * @param {IInternalMessage} message
23
31
  * @param {MouseEvent} event
24
32
  * @return {*} {boolean} 返回是否隐藏消息popover
25
33
  */
26
- onClick(asyncAction: IInternalMessage, event: MouseEvent): boolean;
34
+ onClick?(message: IInternalMessage, event: MouseEvent): Promise<boolean>;
27
35
  }
28
36
  //# sourceMappingURL=i-internal-message.provider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"i-internal-message.provider.d.ts","sourceRoot":"","sources":["../../../src/interface/provider/i-internal-message.provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;;;OAKG;IAEH,SAAS,EAAE,GAAG,CAAC;IAEf;;;;;;;OAOG;IACH,OAAO,CAAC,WAAW,EAAE,gBAAgB,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC;CACpE"}
1
+ {"version":3,"file":"i-internal-message.provider.d.ts","sourceRoot":"","sources":["../../../src/interface/provider/i-internal-message.provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;;;OAKG;IAEH,SAAS,EAAE,GAAG,CAAC;IAEf;;;;OAIG;IAEH,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,GAAG;QAAE,OAAO,EAAE,gBAAgB,CAAA;KAAE,KAAK,GAAG,CAAC;IAE9D;;;;;;;OAOG;IACH,OAAO,CAAC,CAAC,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1E"}
@@ -0,0 +1,34 @@
1
+ import { IPortalAsyncAction } from '@ibiz-template/core';
2
+ /**
3
+ * 系统全局消息通知的呈现工具类
4
+ *
5
+ * @author lxm
6
+ * @date 2024-01-26 05:09:14
7
+ * @export
8
+ * @interface INoticeUtil
9
+ */
10
+ export interface INoticeUtil {
11
+ /**
12
+ * 展示异步操作的通知
13
+ * @author lxm
14
+ * @date 2024-01-26 04:40:10
15
+ * @param {IPortalAsyncAction} asyncAction
16
+ */
17
+ showAsyncAction(asyncAction: IPortalAsyncAction): void;
18
+ /**
19
+ * 展示正在执行的相关信息的通知
20
+ * @author lxm
21
+ * @date 2024-01-26 05:11:55
22
+ * @param {{ num: number }} info
23
+ */
24
+ showDoingNotice(info: {
25
+ num: number;
26
+ }): void;
27
+ /**
28
+ * 关闭正在执行的相关信息的通知
29
+ * @author lxm
30
+ * @date 2024-01-26 05:13:12
31
+ */
32
+ closeDoingNotice(): void;
33
+ }
34
+ //# sourceMappingURL=i-notice-util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i-notice-util.d.ts","sourceRoot":"","sources":["../../../../src/interface/util/i-notice-util/i-notice-util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;OAKG;IACH,eAAe,CAAC,WAAW,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAEvD;;;;;OAKG;IACH,eAAe,CAAC,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAE7C;;;;OAIG;IACH,gBAAgB,IAAI,IAAI,CAAC;CAC1B"}
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- import { IModalData } from '../../common';
1
+ import { IModalData, IPopoverOptions } from '../../common';
2
2
  /**
3
3
  * 打开视图工具类
4
4
  *
@@ -61,7 +61,7 @@ export interface IOpenViewUtil {
61
61
  * @param {IParams} [params]
62
62
  * @return {*} {Promise<IModalData>}
63
63
  */
64
- popover(appViewId: string, event: MouseEvent, context: IContext, params?: IParams): Promise<IModalData>;
64
+ popover(appViewId: string, event: MouseEvent, context: IContext, params?: IParams, options?: IPopoverOptions): Promise<IModalData>;
65
65
  /**
66
66
  * 抽屉模式打开
67
67
  *
@@ -1 +1 @@
1
- {"version":3,"file":"i-open-view-util.d.ts","sourceRoot":"","sources":["../../../../src/interface/util/i-open-view-util/i-open-view-util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;;;OAOG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAExC;;;;;;;;;OASG;IACH,IAAI,CACF,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,QAAQ,EACjB,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,UAAU,CAAC,CAAC;IAEvB;;;;;;;;;OASG;IACH,WAAW,CACT,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,QAAQ,EACjB,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,UAAU,CAAC,CAAC;IAEvB;;;;;;;;;OASG;IACH,KAAK,CACH,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,QAAQ,EACjB,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,UAAU,CAAC,CAAC;IAEvB;;;;;;;;;OASG;IACH,OAAO,CACL,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,QAAQ,EACjB,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,UAAU,CAAC,CAAC;IAEvB;;;;;;;;;OASG;IACH,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,QAAQ,EACjB,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,UAAU,CAAC,CAAC;IAEvB;;;;;;;;;OASG;IACH,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,QAAQ,EACjB,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,UAAU,CAAC,CAAC;CACxB"}
1
+ {"version":3,"file":"i-open-view-util.d.ts","sourceRoot":"","sources":["../../../../src/interface/util/i-open-view-util/i-open-view-util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE3D;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;;;OAOG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAExC;;;;;;;;;OASG;IACH,IAAI,CACF,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,QAAQ,EACjB,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,UAAU,CAAC,CAAC;IAEvB;;;;;;;;;OASG;IACH,WAAW,CACT,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,QAAQ,EACjB,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,UAAU,CAAC,CAAC;IAEvB;;;;;;;;;OASG;IACH,KAAK,CACH,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,QAAQ,EACjB,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,UAAU,CAAC,CAAC;IAEvB;;;;;;;;;OASG;IACH,OAAO,CACL,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,QAAQ,EACjB,MAAM,CAAC,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,UAAU,CAAC,CAAC;IAEvB;;;;;;;;;OASG;IACH,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,QAAQ,EACjB,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,UAAU,CAAC,CAAC;IAEvB;;;;;;;;;OASG;IACH,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,QAAQ,EACjB,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,UAAU,CAAC,CAAC;CACxB"}
@@ -11,4 +11,5 @@ export type { IScriptFunctionOpts } from './script/i-script-function';
11
11
  export type { IExcelUtil } from './i-excel-util/i-excel-util';
12
12
  export type { IViewStack, IViewStackEvent } from './i-view-stack/i-view-stack';
13
13
  export type { IAnimationOptions } from './i-animation-util/i-animation-options';
14
+ export type { INoticeUtil } from './i-notice-util/i-notice-util';
14
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interface/util/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,YAAY,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC3E,YAAY,EACV,YAAY,EACZ,aAAa,GACd,MAAM,iCAAiC,CAAC;AACzC,YAAY,EACV,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,2CAA2C,CAAC;AACnD,YAAY,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACzE,YAAY,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AACnF,YAAY,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACtF,YAAY,EAAE,wBAAwB,EAAE,MAAM,2DAA2D,CAAC;AAC1G,YAAY,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,YAAY,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC/E,YAAY,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interface/util/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,YAAY,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC3E,YAAY,EACV,YAAY,EACZ,aAAa,GACd,MAAM,iCAAiC,CAAC;AACzC,YAAY,EACV,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,2CAA2C,CAAC;AACnD,YAAY,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACzE,YAAY,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AACnF,YAAY,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACtF,YAAY,EAAE,wBAAwB,EAAE,MAAM,2DAA2D,CAAC;AAC1G,YAAY,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,YAAY,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC/E,YAAY,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAChF,YAAY,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { IPortalAsyncAction } from '@ibiz-template/core';
1
2
  import { IAsyncActionProvider } from '../../interface';
2
3
  /** 界面行为适配器前缀 */
3
4
  export declare const ASYNC_ACTION_PROVIDER_PREFIX = "ASYNC_ACTION";
@@ -18,5 +19,5 @@ export declare function registerAsyncActionProvider(key: string, callback: () =>
18
19
  * @param {IAppView} model
19
20
  * @return {*} {Promise<IAsyncActionProvider>}
20
21
  */
21
- export declare function getAsyncActionProvider(actiontype: string): IAsyncActionProvider;
22
+ export declare function getAsyncActionProvider(action: IPortalAsyncAction): IAsyncActionProvider;
22
23
  //# sourceMappingURL=async-action-register.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"async-action-register.d.ts","sourceRoot":"","sources":["../../../src/register/helper/async-action-register.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,gBAAgB;AAChB,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAE3D;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,oBAAoB,GACnC,IAAI,CAEN;AAQD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,MAAM,GACjB,oBAAoB,CAWtB"}
1
+ {"version":3,"file":"async-action-register.d.ts","sourceRoot":"","sources":["../../../src/register/helper/async-action-register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAgB,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,gBAAgB;AAChB,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAE3D;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,oBAAoB,GACnC,IAAI,CAEN;AAQD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,kBAAkB,GACzB,oBAAoB,CAWtB"}
@@ -23,11 +23,11 @@ function getProvider(key) {
23
23
  * @param {IAppView} model
24
24
  * @return {*} {Promise<IAsyncActionProvider>}
25
25
  */
26
- export function getAsyncActionProvider(actiontype) {
27
- const provider = getProvider(actiontype || 'DEFAULT');
26
+ export function getAsyncActionProvider(action) {
27
+ const provider = getProvider(action.actiontype || 'DEFAULT');
28
28
  // 找异步操作类型
29
29
  if (!provider) {
30
- throw new RuntimeError(`找不异步操作类型${actiontype}对应的适配器`);
30
+ throw new RuntimeError(`找不异步操作类型${action.actiontype}对应的适配器`);
31
31
  }
32
32
  else {
33
33
  return provider;
@@ -24,10 +24,10 @@ function getProvider(key) {
24
24
  * @return {*} {Promise<IInternalMessageProvider>}
25
25
  */
26
26
  export function getInternalMessageProvider(msg) {
27
- const provider = getProvider(msg.message_type || 'DEFAULT');
27
+ const provider = getProvider(msg.content_type || 'DEFAULT');
28
28
  // 找异步操作类型
29
29
  if (!provider) {
30
- throw new RuntimeError(`找不站内信类型${msg.message_type}对应的适配器`);
30
+ throw new RuntimeError(`找不站内信类型${msg.content_type}对应的适配器`);
31
31
  }
32
32
  else {
33
33
  return provider;
@@ -6,7 +6,7 @@ export declare class InternalMessageService implements IInternalMessageService {
6
6
  * @author lxm
7
7
  * @date 2024-01-23 02:06:47
8
8
  */
9
- baseUrl: string;
9
+ protected baseUrl: string;
10
10
  /**
11
11
  * 获取站内信的集合
12
12
  * @author lxm
@@ -1 +1 @@
1
- {"version":3,"file":"internal-message.service.d.ts","sourceRoot":"","sources":["../../../../src/service/service/internal-message/internal-message.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,qBAAa,sBAAuB,YAAW,uBAAuB;IACpE;;;;OAIG;IACH,OAAO,SAAkC;IAEzC;;;;;;OAMG;IACG,KAAK,CACT,MAAM,GAAE,OAAY,GACnB,OAAO,CAAC,aAAa,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAoC7C;;;;;;OAMG;IACG,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,gBAAgB,EAAE,CAAC,CAAC;CAIzE"}
1
+ {"version":3,"file":"internal-message.service.d.ts","sourceRoot":"","sources":["../../../../src/service/service/internal-message/internal-message.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,qBAAa,sBAAuB,YAAW,uBAAuB;IACpE;;;;OAIG;IACH,SAAS,CAAC,OAAO,SAAkC;IAEnD;;;;;;OAMG;IACG,KAAK,CACT,MAAM,GAAE,OAAY,GACnB,OAAO,CAAC,aAAa,CAAC,gBAAgB,EAAE,CAAC,CAAC;IA8B7C;;;;;;OAMG;IACG,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,gBAAgB,EAAE,CAAC,CAAC;CAIzE"}
@@ -16,13 +16,14 @@ export class InternalMessageService {
16
16
  * @return {*} {Promise<IHttpResponse<IInternalMessage[]>>}
17
17
  */
18
18
  async fetch(params = {}) {
19
- // const res = await ibiz.net.post(
20
- // `${this.baseUrl}/fetch_cur_receiver`,
21
- // params,
22
- // );
23
- const res = {
24
- ok: true,
19
+ // 默认的查询参数
20
+ const fetchParams = {
21
+ page: 0,
22
+ size: 20,
23
+ sort: 'update_time,desc',
25
24
  };
25
+ Object.assign(fetchParams, params);
26
+ const res = await ibiz.net.post(`${this.baseUrl}/fetch_cur_receiver`, fetchParams);
26
27
  if (res.headers) {
27
28
  if (res.headers['x-page']) {
28
29
  res.page = Number(res.headers['x-page']);
@@ -37,16 +38,6 @@ export class InternalMessageService {
37
38
  if (isNil(res.data)) {
38
39
  res.data = [];
39
40
  }
40
- res.page = params.page;
41
- res.total = 34;
42
- res.data = Array.from({ length: params.size }, (_, i) => ({
43
- id: i + 1,
44
- status: 'RECEIVED',
45
- title: `标题${i + 1}`,
46
- content: `内容${i + 1}长内容`,
47
- short_content: `内容${i + 1}短内容`,
48
- create_time: new Date().toISOString(),
49
- }));
50
41
  return res;
51
42
  }
52
43
  /**
package/out/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { I18n } from '@ibiz-template/core/src/interface';
2
2
  import { EngineFactory } from './engine';
3
3
  import { GlobalUtil } from './global';
4
- import { IMessageUtil, INotificationUtil, IOpenViewUtil, IModalUtil, IConfirmUtil, ILoadingUtil, IPluginFactory, IOverlayController, IGlobalConfig, IAppHubService, IAuthService, IAsyncActionService, IPlatformProvider, IInternalMessageService } from './interface';
4
+ import { IMessageUtil, INotificationUtil, IOpenViewUtil, IModalUtil, IConfirmUtil, ILoadingUtil, IPluginFactory, IOverlayController, IGlobalConfig, IAppHubService, IAuthService, IAsyncActionService, IPlatformProvider, IInternalMessageService, INoticeUtil } from './interface';
5
5
  import { LogicSchedulerCenter } from './logic-scheduler';
6
6
  import { RegisterCenter } from './register/register-center';
7
7
  import { UIDomainManager } from './utils';
@@ -59,6 +59,13 @@ declare module '@ibiz-template/core' {
59
59
  * @type {INotificationUtil}
60
60
  */
61
61
  notification: INotificationUtil;
62
+ /**
63
+ * 全局的消息通知类
64
+ * @author lxm
65
+ * @date 2024-01-26 05:10:37
66
+ * @type {INoticeUtil}
67
+ */
68
+ notice: INoticeUtil;
62
69
  /**
63
70
  * 多模式打开视图工具类
64
71
  *
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mCAAmC,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,OAAO;QACf;;;;;;WAMG;QACH,OAAO,EAAE,YAAY,CAAC;QAEtB;;;;;;WAMG;QACH,GAAG,EAAE,cAAc,CAAC;QAEpB;;;;;;;WAOG;QACH,KAAK,EAAE,UAAU,CAAC;QAElB;;;;;;;WAOG;QACH,OAAO,EAAE,YAAY,CAAC;QAEtB;;;;;;;WAOG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BAAiB,CAAC;QAE5B;;;;;;WAMG;QACH,eAAe,EAAE,eAAe,CAAC;KAClC;IAED,UAAU,YAAY;QACpB;;;;;;;WAOG;QACH,YAAY,CAAC,EAAE,aAAa,CAAC;KAC9B;CACF"}
@@ -0,0 +1,57 @@
1
+ export declare class FileUtil {
2
+ /**
3
+ * 计算OSSCat参数
4
+ *
5
+ * @author zk
6
+ * @date 2024-01-26 02:01:52
7
+ * @param {string} url
8
+ * @param {IContext} context
9
+ * @return {*} {string}
10
+ * @memberof FileUtil
11
+ */
12
+ protected calcOSSCatUrl(url: string, context: IContext, OSSCatName?: string): string;
13
+ /**
14
+ * 计算文件的上传路径和下载路径
15
+ * 下载路径文件id用%fileId%占位,替换即可
16
+ * 配置编辑器参数uploadParams和exportParams时,会像导航参数一样动态添加对应的参数到url上
17
+ *
18
+ * @author zk
19
+ * @date 2024-01-26 02:01:15
20
+ * @param {IData} data
21
+ * @param {IContext} context
22
+ * @param {IParams} params
23
+ * @param {IParams} uploadParams
24
+ * @param {IParams} exportParams
25
+ * @return {*} {{
26
+ * uploadUrl: string;
27
+ * downloadUrl: string;
28
+ * }}
29
+ * @memberof FileUtil
30
+ */
31
+ calcFileUpDownUrl(context: IContext, params: IParams, data?: IData, extraParams?: IData): {
32
+ uploadUrl: string;
33
+ downloadUrl: string;
34
+ };
35
+ /**
36
+ * 请求url获取文件流,并用JS触发文件下载
37
+ *
38
+ * @author zk
39
+ * @date 2024-01-26 02:01:29
40
+ * @param {{ url: string; name: string }} file
41
+ * @memberof FileUtil
42
+ */
43
+ fileDownload(url: string, name: string): Promise<void>;
44
+ /**
45
+ * 文件上传
46
+ *
47
+ * @author zk
48
+ * @date 2024-01-26 05:01:35
49
+ * @param {string} uploadUrl
50
+ * @param {Blob} file
51
+ * @param {IData} headers
52
+ * @return {*} {Promise<IData>}
53
+ * @memberof FileUtil
54
+ */
55
+ fileUpload(uploadUrl: string, file: Blob, headers: IData): Promise<IData>;
56
+ }
57
+ //# sourceMappingURL=file-util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-util.d.ts","sourceRoot":"","sources":["../../../src/utils/file-util/file-util.ts"],"names":[],"mappings":"AAIA,qBAAa,QAAQ;IACnB;;;;;;;;;OASG;IACH,SAAS,CAAC,aAAa,CACrB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,QAAQ,EACjB,UAAU,CAAC,EAAE,MAAM,GAClB,MAAM;IAWT;;;;;;;;;;;;;;;;;OAiBG;IACH,iBAAiB,CACf,OAAO,EAAE,QAAQ,EACjB,MAAM,EAAE,OAAO,EACf,IAAI,GAAE,KAAU,EAChB,WAAW,GAAE,KAAU,GACtB;QACD,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;KACrB;IA0BD;;;;;;;OAOG;IACG,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAqB5D;;;;;;;;;;OAUG;IACG,UAAU,CACd,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,KAAK,GACb,OAAO,CAAC,KAAK,CAAC;CAclB"}
@@ -0,0 +1,113 @@
1
+ import { RuntimeError, downloadFileFromBlob } from '@ibiz-template/core';
2
+ import qs from 'qs';
3
+ import { convertNavData } from '../nav-params/nav-params';
4
+ export class FileUtil {
5
+ /**
6
+ * 计算OSSCat参数
7
+ *
8
+ * @author zk
9
+ * @date 2024-01-26 02:01:52
10
+ * @param {string} url
11
+ * @param {IContext} context
12
+ * @return {*} {string}
13
+ * @memberof FileUtil
14
+ */
15
+ calcOSSCatUrl(url, context, OSSCatName) {
16
+ var _a;
17
+ let uploadUrl = `${ibiz.env.baseUrl}/${ibiz.env.appId}${url}`;
18
+ const app = ibiz.hub.getApp(context.srfappid);
19
+ const OSSCat = OSSCatName ||
20
+ app.model.defaultOSSCat ||
21
+ ((_a = app.model.userParam) === null || _a === void 0 ? void 0 : _a.DefaultOSSCat);
22
+ uploadUrl = uploadUrl.replace('/{cat}', OSSCat ? `/${OSSCat}` : '');
23
+ return uploadUrl;
24
+ }
25
+ /**
26
+ * 计算文件的上传路径和下载路径
27
+ * 下载路径文件id用%fileId%占位,替换即可
28
+ * 配置编辑器参数uploadParams和exportParams时,会像导航参数一样动态添加对应的参数到url上
29
+ *
30
+ * @author zk
31
+ * @date 2024-01-26 02:01:15
32
+ * @param {IData} data
33
+ * @param {IContext} context
34
+ * @param {IParams} params
35
+ * @param {IParams} uploadParams
36
+ * @param {IParams} exportParams
37
+ * @return {*} {{
38
+ * uploadUrl: string;
39
+ * downloadUrl: string;
40
+ * }}
41
+ * @memberof FileUtil
42
+ */
43
+ calcFileUpDownUrl(context, params, data = {}, extraParams = {}) {
44
+ const { uploadParams, exportParams, osscat: OSSCatName } = extraParams;
45
+ // 计算文件上传路径
46
+ let uploadUrl = this.calcOSSCatUrl(ibiz.env.uploadFileUrl, context, OSSCatName);
47
+ let downloadUrl = this.calcOSSCatUrl(`${ibiz.env.downloadFileUrl}/%fileId%`, context, OSSCatName);
48
+ let _uploadParams = {};
49
+ let _exportParams = {};
50
+ if (uploadParams) {
51
+ _uploadParams = convertNavData(uploadParams, data, params, context);
52
+ }
53
+ if (exportParams) {
54
+ _exportParams = convertNavData(exportParams, data, params, context);
55
+ }
56
+ uploadUrl += qs.stringify(_uploadParams, { addQueryPrefix: true });
57
+ downloadUrl += qs.stringify(_exportParams, { addQueryPrefix: true });
58
+ return { uploadUrl, downloadUrl };
59
+ }
60
+ /**
61
+ * 请求url获取文件流,并用JS触发文件下载
62
+ *
63
+ * @author zk
64
+ * @date 2024-01-26 02:01:29
65
+ * @param {{ url: string; name: string }} file
66
+ * @memberof FileUtil
67
+ */
68
+ async fileDownload(url, name) {
69
+ // 发送get请求
70
+ const response = await ibiz.net.request(url, {
71
+ method: 'get',
72
+ responseType: 'blob',
73
+ baseURL: '', // 已经有baseURL了,这里无需再写
74
+ });
75
+ if (response.status !== 200) {
76
+ throw new RuntimeError('下载文件失败');
77
+ }
78
+ // 请求成功,后台返回的是一个文件流
79
+ if (!response.data) {
80
+ throw new RuntimeError('文件流数据不存在');
81
+ }
82
+ else {
83
+ // 获取文件名
84
+ const fileName = name;
85
+ downloadFileFromBlob(response.data, fileName);
86
+ }
87
+ }
88
+ /**
89
+ * 文件上传
90
+ *
91
+ * @author zk
92
+ * @date 2024-01-26 05:01:35
93
+ * @param {string} uploadUrl
94
+ * @param {Blob} file
95
+ * @param {IData} headers
96
+ * @return {*} {Promise<IData>}
97
+ * @memberof FileUtil
98
+ */
99
+ async fileUpload(uploadUrl, file, headers) {
100
+ const formData = new FormData();
101
+ formData.append('file', file);
102
+ const res = await ibiz.net.axios({
103
+ url: uploadUrl,
104
+ method: 'post',
105
+ headers,
106
+ data: formData,
107
+ });
108
+ if (res.status !== 200) {
109
+ throw new RuntimeError('文件上传失败');
110
+ }
111
+ return res.data;
112
+ }
113
+ }
@@ -0,0 +1,2 @@
1
+ export { FileUtil } from './file-util';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/file-util/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1 @@
1
+ export { FileUtil } from './file-util';
@@ -17,4 +17,5 @@ export { RawValueUtil } from './raw-value-util/raw-value-util';
17
17
  export { ViewStack } from './view-stack/view-stack';
18
18
  export { handleAllSettled } from './promise/promise';
19
19
  export { AnimeUtil } from './anime';
20
+ export { FileUtil } from './file-util';
20
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,8BA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,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,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC"}
@@ -17,3 +17,4 @@ export { RawValueUtil } from './raw-value-util/raw-value-util';
17
17
  export { ViewStack } from './view-stack/view-stack';
18
18
  export { handleAllSettled } from './promise/promise';
19
19
  export { AnimeUtil } from './anime';
20
+ export { FileUtil } from './file-util';