@ibiz-template/core 0.7.41-alpha.12 → 0.7.41-alpha.138

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 (200) hide show
  1. package/dist/index.esm.js +94 -23
  2. package/dist/index.system.min.js +1 -1
  3. package/out/environment/environment.d.ts.map +1 -1
  4. package/out/environment/environment.js +10 -0
  5. package/out/error/http-error/http-error-factory.d.ts +1 -1
  6. package/out/error/http-error/http-error-factory.d.ts.map +1 -1
  7. package/out/error/http-error/http-error-factory.js +11 -1
  8. package/out/error/http-error/http-error.d.ts +2 -2
  9. package/out/error/http-error/http-error.d.ts.map +1 -1
  10. package/out/interface/api/chat-message/i-api-chat-message.d.ts +63 -0
  11. package/out/interface/api/chat-message/i-api-chat-message.d.ts.map +1 -0
  12. package/out/interface/api/chat-message/i-api-chat-message.js +1 -0
  13. package/out/interface/api/chat-message/index.d.ts +2 -0
  14. package/out/interface/api/chat-message/index.d.ts.map +1 -0
  15. package/out/interface/api/chat-message/index.js +1 -0
  16. package/out/interface/api/environment/i-devtool-config.d.ts +29 -1
  17. package/out/interface/api/environment/i-devtool-config.d.ts.map +1 -1
  18. package/out/interface/api/environment/i-environment.d.ts +146 -1
  19. package/out/interface/api/environment/i-environment.d.ts.map +1 -1
  20. package/out/interface/api/ibizsys/i-app-data.d.ts +57 -0
  21. package/out/interface/api/ibizsys/i-app-data.d.ts.map +1 -0
  22. package/out/interface/api/ibizsys/i-app-data.js +1 -0
  23. package/out/interface/api/ibizsys/i-org-data.d.ts +1 -1
  24. package/out/interface/api/ibizsys/index.d.ts +1 -0
  25. package/out/interface/api/ibizsys/index.d.ts.map +1 -1
  26. package/out/interface/api/index.d.ts +1 -0
  27. package/out/interface/api/index.d.ts.map +1 -1
  28. package/out/interface/api/index.js +1 -0
  29. package/out/interface/api/utils/i-api-i18n.d.ts +9 -9
  30. package/out/interface/api/utils/index.d.ts +1 -0
  31. package/out/interface/api/utils/index.d.ts.map +1 -1
  32. package/out/interface/api/utils/message-center/base/i-message-base.d.ts +3 -3
  33. package/out/interface/api/utils/message-center/command/add-in-changed/i-command-add-in-changed.d.ts +1 -1
  34. package/out/interface/api/utils/message-center/command/async-action/i-command-async-action.d.ts +1 -1
  35. package/out/interface/api/utils/message-center/command/i-message-command.d.ts +1 -1
  36. package/out/interface/api/utils/message-center/command/internal-message/i-command-internal-message.d.ts +1 -1
  37. package/out/interface/api/utils/message-center/command/mark-open-data/i-command-mark-open-data.d.ts +1 -1
  38. package/out/interface/api/utils/message-center/common/i-message-center-event.d.ts +5 -0
  39. package/out/interface/api/utils/message-center/common/i-message-center-event.d.ts.map +1 -1
  40. package/out/interface/api/utils/message-center/common/i-portal-message.d.ts +3 -3
  41. package/out/interface/api/utils/message-center/console/i-message-console.d.ts +1 -1
  42. package/out/interface/api/utils/message-center/error/i-message-error.d.ts +1 -1
  43. package/out/interface/api/utils/message-center/i-message-center.d.ts +2 -2
  44. package/out/interface/api/utils/net/i-api-http-error.d.ts +39 -0
  45. package/out/interface/api/utils/net/i-api-http-error.d.ts.map +1 -0
  46. package/out/interface/api/utils/net/i-api-http-error.js +1 -0
  47. package/out/interface/api/utils/net/i-api-net.d.ts +1 -1
  48. package/out/interface/i-chat-message/i-chat-message.d.ts +2 -49
  49. package/out/interface/i-chat-message/i-chat-message.d.ts.map +1 -1
  50. package/out/utils/download-file/download-file.d.ts.map +1 -1
  51. package/out/utils/download-file/download-file.js +5 -1
  52. package/out/utils/interceptor/core-interceptor.js +2 -1
  53. package/out/utils/net/http-response.d.ts +2 -1
  54. package/out/utils/net/http-response.d.ts.map +1 -1
  55. package/out/utils/net/http-response.js +5 -1
  56. package/out/utils/net/net.d.ts +1 -1
  57. package/out/utils/net/net.d.ts.map +1 -1
  58. package/out/utils/net/net.js +16 -6
  59. package/out/utils/recursive/find-recursive-child.d.ts +20 -0
  60. package/out/utils/recursive/find-recursive-child.d.ts.map +1 -1
  61. package/out/utils/recursive/find-recursive-child.js +69 -7
  62. package/out/utils/string-util/string-util.d.ts.map +1 -1
  63. package/out/utils/string-util/string-util.js +2 -4
  64. package/package.json +5 -4
  65. package/src/command/command-register.ts +121 -0
  66. package/src/command/command.ts +78 -0
  67. package/src/command/index.ts +8 -0
  68. package/src/command/utils/index.ts +2 -0
  69. package/src/command/utils/linked-list.ts +136 -0
  70. package/src/command/utils/util.ts +103 -0
  71. package/src/constant/core/core.ts +54 -0
  72. package/src/constant/emoji/emoji.ts +2929 -0
  73. package/src/constant/http-status-message/http-status-message.ts +18 -0
  74. package/src/constant/index.ts +4 -0
  75. package/src/constant/util/util.ts +3 -0
  76. package/src/context/index.ts +231 -0
  77. package/src/environment/environment.ts +67 -0
  78. package/src/error/http-error/entity-error.ts +29 -0
  79. package/src/error/http-error/http-error-factory.ts +33 -0
  80. package/src/error/http-error/http-error.ts +52 -0
  81. package/src/error/index.ts +7 -0
  82. package/src/error/model-error/model-error.ts +27 -0
  83. package/src/error/notice-error/notice-error.ts +16 -0
  84. package/src/error/runtime-error/runtime-error.ts +13 -0
  85. package/src/error/runtime-model-error/runtime-model-error.ts +27 -0
  86. package/src/ibizsys.ts +82 -0
  87. package/src/index.ts +14 -0
  88. package/src/install.ts +12 -0
  89. package/src/interface/api/chat-message/i-api-chat-message.ts +71 -0
  90. package/src/interface/api/chat-message/index.ts +1 -0
  91. package/src/interface/api/constant/index.ts +2 -0
  92. package/src/interface/api/constant/login-mode/login-mode.ts +25 -0
  93. package/src/interface/api/constant/menu-permission-mode/menu-permission-mode.ts +20 -0
  94. package/src/interface/api/environment/i-devtool-config.ts +76 -0
  95. package/src/interface/api/environment/i-environment.ts +532 -0
  96. package/src/interface/api/environment/index.ts +2 -0
  97. package/src/interface/api/global-param/i-api-context.ts +37 -0
  98. package/src/interface/api/global-param/i-global-param.ts +27 -0
  99. package/src/interface/api/global-param/index.ts +2 -0
  100. package/src/interface/api/ibizsys/i-api-ibizsys.ts +54 -0
  101. package/src/interface/api/ibizsys/i-app-data.ts +64 -0
  102. package/src/interface/api/ibizsys/i-org-data.ts +31 -0
  103. package/src/interface/api/ibizsys/index.ts +3 -0
  104. package/src/interface/api/index.ts +6 -0
  105. package/src/interface/api/utils/i-api-i18n.ts +56 -0
  106. package/src/interface/api/utils/index.ts +5 -0
  107. package/src/interface/api/utils/message-center/base/i-message-all.ts +8 -0
  108. package/src/interface/api/utils/message-center/base/i-message-base.ts +29 -0
  109. package/src/interface/api/utils/message-center/base/index.ts +2 -0
  110. package/src/interface/api/utils/message-center/command/add-in-changed/i-add-in-changed.ts +25 -0
  111. package/src/interface/api/utils/message-center/command/add-in-changed/i-command-add-in-changed.ts +16 -0
  112. package/src/interface/api/utils/message-center/command/async-action/i-command-async-action.ts +17 -0
  113. package/src/interface/api/utils/message-center/command/change/i-command-change.ts +8 -0
  114. package/src/interface/api/utils/message-center/command/create/i-command-create.ts +18 -0
  115. package/src/interface/api/utils/message-center/command/i-command-base.ts +23 -0
  116. package/src/interface/api/utils/message-center/command/i-message-command.ts +94 -0
  117. package/src/interface/api/utils/message-center/command/index.ts +20 -0
  118. package/src/interface/api/utils/message-center/command/internal-message/i-command-internal-message.ts +17 -0
  119. package/src/interface/api/utils/message-center/command/internal-message/i-internal-message.ts +132 -0
  120. package/src/interface/api/utils/message-center/command/mark-open-data/i-command-mark-open-data.ts +17 -0
  121. package/src/interface/api/utils/message-center/command/mark-open-data/i-mark-open-data.ts +47 -0
  122. package/src/interface/api/utils/message-center/command/remove/i-command-remove.ts +18 -0
  123. package/src/interface/api/utils/message-center/command/update/i-command-update.ts +18 -0
  124. package/src/interface/api/utils/message-center/common/i-app-data-entity.ts +16 -0
  125. package/src/interface/api/utils/message-center/common/i-message-center-event.ts +15 -0
  126. package/src/interface/api/utils/message-center/common/i-msg-meta-data.ts +13 -0
  127. package/src/interface/api/utils/message-center/common/i-portal-async-action.ts +144 -0
  128. package/src/interface/api/utils/message-center/common/i-portal-message.ts +84 -0
  129. package/src/interface/api/utils/message-center/common/index.ts +5 -0
  130. package/src/interface/api/utils/message-center/console/i-message-console.ts +17 -0
  131. package/src/interface/api/utils/message-center/error/i-message-error.ts +17 -0
  132. package/src/interface/api/utils/message-center/i-message-center.ts +53 -0
  133. package/src/interface/api/utils/message-center/index.ts +6 -0
  134. package/src/interface/api/utils/net/i-api-http-error.ts +43 -0
  135. package/src/interface/api/utils/net/i-api-net.ts +93 -0
  136. package/src/interface/api/utils/net/i-http-response.ts +67 -0
  137. package/src/interface/click-outside/click-outside.ts +51 -0
  138. package/src/interface/command/command/i-command-option.ts +47 -0
  139. package/src/interface/command/command/i-command.ts +68 -0
  140. package/src/interface/command/disposable/i-disposable.ts +12 -0
  141. package/src/interface/command/i-command-controller.ts +50 -0
  142. package/src/interface/command/index.ts +11 -0
  143. package/src/interface/context/index.ts +42 -0
  144. package/src/interface/error/index.ts +13 -0
  145. package/src/interface/i-chat-message/i-chat-message.ts +16 -0
  146. package/src/interface/ibizsys/i-ibizsys.ts +33 -0
  147. package/src/interface/ibizsys/index.ts +1 -0
  148. package/src/interface/index.ts +11 -0
  149. package/src/interface/utils/i-18n.ts +22 -0
  150. package/src/interface/utils/index.ts +1 -0
  151. package/src/locale/en/index.ts +30 -0
  152. package/src/locale/index.ts +2 -0
  153. package/src/locale/zh-CN/index.ts +28 -0
  154. package/src/params/params.ts +131 -0
  155. package/src/types.ts +26 -0
  156. package/src/utils/bit-mask/bit-mask.ts +87 -0
  157. package/src/utils/click-outside/click-outside.ts +108 -0
  158. package/src/utils/clone/clone.ts +38 -0
  159. package/src/utils/color/color.ts +84 -0
  160. package/src/utils/cookie-util/cookie-util.ts +192 -0
  161. package/src/utils/data-type/data-types.ts +93 -0
  162. package/src/utils/download-file/download-file.ts +110 -0
  163. package/src/utils/event/event.ts +69 -0
  164. package/src/utils/history-list/history-item.ts +41 -0
  165. package/src/utils/history-list/history-list.ts +137 -0
  166. package/src/utils/index.ts +24 -0
  167. package/src/utils/interceptor/core-interceptor.ts +127 -0
  168. package/src/utils/interceptor/index.ts +2 -0
  169. package/src/utils/interceptor/interceptor.ts +122 -0
  170. package/src/utils/logger/logger.ts +34 -0
  171. package/src/utils/message-center/base/message-all.ts +10 -0
  172. package/src/utils/message-center/base/message-base.ts +73 -0
  173. package/src/utils/message-center/command/add-in-changed/command-add-in-changed.ts +23 -0
  174. package/src/utils/message-center/command/async-action/command-async-action.ts +23 -0
  175. package/src/utils/message-center/command/change/command-change.ts +11 -0
  176. package/src/utils/message-center/command/command-base/command-base.ts +35 -0
  177. package/src/utils/message-center/command/create/command-create.ts +25 -0
  178. package/src/utils/message-center/command/internal-message/command-internal-message.ts +26 -0
  179. package/src/utils/message-center/command/mark-open-data/command-mark-open-data.ts +23 -0
  180. package/src/utils/message-center/command/message-command.ts +162 -0
  181. package/src/utils/message-center/command/remove/command-remove.ts +25 -0
  182. package/src/utils/message-center/command/update/command-update.ts +25 -0
  183. package/src/utils/message-center/console/message-console.ts +27 -0
  184. package/src/utils/message-center/error/message-error.ts +27 -0
  185. package/src/utils/message-center/index.ts +1 -0
  186. package/src/utils/message-center/message-center.ts +77 -0
  187. package/src/utils/namespace/namespace.ts +217 -0
  188. package/src/utils/net/http-response.ts +60 -0
  189. package/src/utils/net/net.ts +463 -0
  190. package/src/utils/recursive/find-recursive-child.ts +238 -0
  191. package/src/utils/string-util/string-util.ts +76 -0
  192. package/src/utils/style/remote-style.ts +17 -0
  193. package/src/utils/sync/await-timeout.ts +29 -0
  194. package/src/utils/sync/count-latch.ts +79 -0
  195. package/src/utils/sync/index.ts +2 -0
  196. package/src/utils/types/types.ts +24 -0
  197. package/src/utils/upload/select-file.ts +93 -0
  198. package/src/utils/upload/upload-file.ts +194 -0
  199. package/src/utils/url-helper/url-helper.ts +52 -0
  200. package/src/utils/util/util.ts +580 -0
@@ -0,0 +1,144 @@
1
+ /**
2
+ * @description 异步作业信息
3
+ * @export
4
+ * @interface IPortalAsyncAction
5
+ */
6
+ export interface IPortalAsyncAction {
7
+ /**
8
+ * @description 异步操作标识
9
+ * @type {string}
10
+ * @memberof IPortalAsyncAction
11
+ */
12
+ asyncacitonid: string;
13
+ /**
14
+ * @description 异步操作名称
15
+ * @type {string}
16
+ * @memberof IPortalAsyncAction
17
+ */
18
+ asyncacitonname: string;
19
+ /**
20
+ * @description 会话标识
21
+ * @type {string}
22
+ * @memberof IPortalAsyncAction
23
+ */
24
+ fulltopictag: string;
25
+ /**
26
+ * @description 租户标识
27
+ * @type {string}
28
+ * @memberof IPortalAsyncAction
29
+ */
30
+ srfdcid: string;
31
+ /**
32
+ * @description 租户系统标识
33
+ * @type {string}
34
+ * @memberof IPortalAsyncAction
35
+ */
36
+ dcsystemid: string;
37
+
38
+ /**
39
+ * @description 异步作业类型,DEIMPORTDATA2: 异步导入
40
+ * @type {string}
41
+ * @memberof IPortalAsyncAction
42
+ */
43
+ actiontype: string;
44
+
45
+ /**
46
+ * @description 作业状态
47
+ * @type {(10 | 20 | 30 | 40)} 未开始 | 执行中 | 已执行 | 执行失败
48
+ * @memberof IPortalAsyncAction
49
+ */
50
+ actionstate: 10 | 20 | 30 | 40;
51
+
52
+ /**
53
+ * @description 异步作业执行结果
54
+ * @type {unknown}
55
+ * @memberof IPortalAsyncAction
56
+ */
57
+ actionresult?: unknown;
58
+
59
+ /**
60
+ * @description 步骤信息
61
+ * @type {string}
62
+ * @memberof IPortalAsyncAction
63
+ */
64
+ stepinfo?: string;
65
+
66
+ /**
67
+ * @description 完成百分比
68
+ * @type {number}
69
+ * @memberof IPortalAsyncAction
70
+ */
71
+ completionrate?: number;
72
+
73
+ /**
74
+ * @description 异步结果下载路径,目前是留给导出数据使用
75
+ * @type {string}
76
+ * @memberof IPortalAsyncAction
77
+ */
78
+ asyncresultdownloadurl?: string;
79
+
80
+ /**
81
+ * @description 预留参数
82
+ * @type {unknown}
83
+ * @memberof IPortalAsyncAction
84
+ */
85
+ actionparam?: unknown;
86
+
87
+ /**
88
+ * @description 预留参数2
89
+ * @type {unknown}
90
+ * @memberof IPortalAsyncAction
91
+ */
92
+ actionparam2?: unknown;
93
+
94
+ /**
95
+ * @description 预留参数3
96
+ * @type {unknown}
97
+ * @memberof IPortalAsyncAction
98
+ */
99
+ actionparam3?: unknown;
100
+
101
+ /**
102
+ * @description 预留参数4
103
+ * @type {unknown}
104
+ * @memberof IPortalAsyncAction
105
+ */
106
+ actionparam4?: unknown;
107
+
108
+ /**
109
+ * @description 操作开始时间
110
+ * @type {string}
111
+ * @memberof IPortalAsyncAction
112
+ */
113
+ begintime: string;
114
+ /**
115
+ * @description 操作结束时间
116
+ * @type {string}
117
+ * @memberof IPortalAsyncAction
118
+ */
119
+ endtime: string;
120
+ /**
121
+ * @description 创建人标识
122
+ * @type {string}
123
+ * @memberof IPortalAsyncAction
124
+ */
125
+ createman: string;
126
+ /**
127
+ * @description 创建时间
128
+ * @type {string}
129
+ * @memberof IPortalAsyncAction
130
+ */
131
+ createdate: string;
132
+ /**
133
+ * @description 更新人标识
134
+ * @type {string}
135
+ * @memberof IPortalAsyncAction
136
+ */
137
+ updateman: string;
138
+ /**
139
+ * @description 更新时间
140
+ * @type {string}
141
+ * @memberof IPortalAsyncAction
142
+ */
143
+ updatedate: string;
144
+ }
@@ -0,0 +1,84 @@
1
+ import { IApiData } from '../../../global-param';
2
+ import { IPortalAsyncAction } from './i-portal-async-action';
3
+
4
+ /**
5
+ * @description 消息数据
6
+ * @export
7
+ * @interface IPortalMessage
8
+ */
9
+ export interface IPortalMessage {
10
+ /**
11
+ * @description 消息标识
12
+ * @type {string}
13
+ * @memberof IPortalMessage
14
+ */
15
+ messageid: string;
16
+ /**
17
+ * @description 消息名称
18
+ * @type {string}
19
+ * @memberof IPortalMessage
20
+ */
21
+ messagename?: string;
22
+
23
+ /**
24
+ * @description 消息类型, 日志消息 | 命令 | 错误消息
25
+ * @type {('CONSOLE' | 'COMMAND' | 'ERROR')} 日志消息 | 命令 | 错误消息
26
+ * @memberof IPortalMessage
27
+ */
28
+ type: 'CONSOLE' | 'COMMAND' | 'ERROR';
29
+
30
+ /**
31
+ * @description 消息子类型, 标注打开数据 | 异步作业 | 站内信 | 数据更新 | 数据删除 | 数据创建 | 添加更改
32
+ * @type {('MARKOPENDATA'
33
+ * | 'ASYNCACTION'
34
+ * | 'INTERNALMESSAGE'
35
+ * | 'OBJECTUPDATED'
36
+ * | 'OBJECTREMOVED'
37
+ * | 'OBJECTCREATED'
38
+ * | 'ADDINCHANGED')} 标注打开数据 | 异步作业 | 站内信 | 数据更新 | 数据删除 | 数据创建 | 添加更改
39
+ * @memberof IPortalMessage
40
+ */
41
+ subtype?:
42
+ | 'MARKOPENDATA'
43
+ | 'ASYNCACTION'
44
+ | 'INTERNALMESSAGE'
45
+ | 'OBJECTUPDATED'
46
+ | 'OBJECTREMOVED'
47
+ | 'OBJECTCREATED'
48
+ | 'ADDINCHANGED';
49
+
50
+ /**
51
+ * @description 内容摘要
52
+ * @type {string}
53
+ * @memberof IPortalMessage
54
+ */
55
+ content?: string;
56
+
57
+ /**
58
+ * @description 消息数据
59
+ * @type {(IPortalAsyncAction | IApiData | string | unknown)}
60
+ * @memberof IPortalMessage
61
+ */
62
+ data?: IPortalAsyncAction | IApiData | string | unknown;
63
+
64
+ /**
65
+ * @description 消息路径
66
+ * @type {string}
67
+ * @memberof IPortalMessage
68
+ */
69
+ url?: string;
70
+
71
+ /**
72
+ * @description 移动端消息路径
73
+ * @type {string}
74
+ * @memberof IPortalMessage
75
+ */
76
+ mobileurl?: string;
77
+
78
+ /**
79
+ * @description 触发源的key,随机字符串,作为接收方判断是否相同环境触发,相同环境则不做处理,可不传
80
+ * @type {string}
81
+ * @memberof IPortalMessage
82
+ */
83
+ triggerKey?: string;
84
+ }
@@ -0,0 +1,5 @@
1
+ export type { IMessageCenterEvent } from './i-message-center-event';
2
+ export type { IPortalAsyncAction } from './i-portal-async-action';
3
+ export type { IPortalMessage } from './i-portal-message';
4
+ export type { IAppDataEntity } from './i-app-data-entity';
5
+ export type { IMsgMetaData } from './i-msg-meta-data';
@@ -0,0 +1,17 @@
1
+ import { IApiData } from '../../../global-param';
2
+ import { IMessageBase } from '../base';
3
+
4
+ /**
5
+ * @description 日志消息控制器
6
+ * @export
7
+ * @interface IMessageConsole
8
+ * @extends {IMessageBase}
9
+ */
10
+ export interface IMessageConsole extends IMessageBase {
11
+ /**
12
+ * @description 发送消息
13
+ * @param {(IApiData | string)} data 日志数据
14
+ * @memberof IMessageConsole
15
+ */
16
+ send(data: IApiData | string): void;
17
+ }
@@ -0,0 +1,17 @@
1
+ import { IApiData } from '../../../global-param';
2
+ import { IMessageBase } from '../base';
3
+
4
+ /**
5
+ * @description 错误消息控制器
6
+ * @export
7
+ * @interface IMessageError
8
+ * @extends {IMessageBase}
9
+ */
10
+ export interface IMessageError extends IMessageBase {
11
+ /**
12
+ * @description 发送消息
13
+ * @param {(IApiData | string)} data 错误数据
14
+ * @memberof IMessageError
15
+ */
16
+ send(data: IApiData | string): void;
17
+ }
@@ -0,0 +1,53 @@
1
+ import { IMessageCommand } from './command';
2
+ import { IPortalMessage } from './common';
3
+ import { IMessageConsole } from './console/i-message-console';
4
+ import { IMessageError } from './error/i-message-error';
5
+
6
+ /**
7
+ * @description 界面消息中心
8
+ * @export
9
+ * @interface IMessageCenter
10
+ */
11
+ export interface IMessageCenter {
12
+ /**
13
+ * @description 指令消息
14
+ * @type {IMessageCommand}
15
+ * @memberof IMessageCenter
16
+ */
17
+ readonly command: IMessageCommand;
18
+
19
+ /**
20
+ * @description 日志消息
21
+ * @type {IMessageConsole}
22
+ * @memberof IMessageCenter
23
+ */
24
+ readonly console: IMessageConsole;
25
+
26
+ /**
27
+ * @description 错误消息
28
+ * @type {IMessageError}
29
+ * @memberof IMessageCenter
30
+ */
31
+ readonly error: IMessageError;
32
+
33
+ /**
34
+ * @description 发送消息
35
+ * @param {IPortalMessage} msg 消息
36
+ * @memberof IMessageCenter
37
+ */
38
+ next(msg: IPortalMessage): void;
39
+
40
+ /**
41
+ * @description 订阅消息
42
+ * @param {(msg: IPortalMessage) => void} callback 回调函数
43
+ * @memberof IMessageCenter
44
+ */
45
+ on(callback: (msg: IPortalMessage) => void): void;
46
+
47
+ /**
48
+ * @description 取消订阅
49
+ * @param {(msg: IPortalMessage) => void} callback 回调函数
50
+ * @memberof IMessageCenter
51
+ */
52
+ off(callback: (msg: IPortalMessage) => void): void;
53
+ }
@@ -0,0 +1,6 @@
1
+ export * from './common';
2
+ export * from './base';
3
+ export * from './command';
4
+ export type { IMessageConsole } from './console/i-message-console';
5
+ export type { IMessageError } from './error/i-message-error';
6
+ export type { IMessageCenter } from './i-message-center';
@@ -0,0 +1,43 @@
1
+ import { AxiosResponse } from 'axios';
2
+
3
+ /**
4
+ * @description Http错误接口
5
+ * @export
6
+ * @interface IApiHttpError
7
+ */
8
+ export interface IApiHttpError {
9
+ /**
10
+ * @description 错误名称
11
+ * @type {string}
12
+ * @memberof IApiHttpError
13
+ */
14
+ name: string;
15
+
16
+ /**
17
+ * @description 错误消息
18
+ * @type {string}
19
+ * @memberof IApiHttpError
20
+ */
21
+ message: string;
22
+
23
+ /**
24
+ * @description 状态码
25
+ * @type {number}
26
+ * @memberof IApiHttpError
27
+ */
28
+ status: number;
29
+
30
+ /**
31
+ * @description 错误标识
32
+ * @type {string}
33
+ * @memberof IApiHttpError
34
+ */
35
+ tag: string;
36
+
37
+ /**
38
+ * @description axios响应对象
39
+ * @type {AxiosResponse}
40
+ * @memberof IApiHttpError
41
+ */
42
+ response?: AxiosResponse;
43
+ }
@@ -0,0 +1,93 @@
1
+ import {
2
+ AxiosRequestConfig,
3
+ AxiosResponse,
4
+ RawAxiosRequestHeaders,
5
+ } from 'axios';
6
+ import { IHttpResponse } from './i-http-response';
7
+ import { IApiData, IApiParams } from '../../global-param';
8
+
9
+ /**
10
+ * @description 网络请求工具
11
+ * @export
12
+ * @interface IApiNet
13
+ */
14
+ export interface IApiNet {
15
+ /**
16
+ * @description Post 请求
17
+ * @param {string} url 请求地址
18
+ * @param {IApiData} data 请求数据
19
+ * @param {IApiParams} [params={}] 请求参数
20
+ * @param {RawAxiosRequestHeaders} [headers={}] 请求头
21
+ * @returns {*} {Promise<IHttpResponse>}
22
+ * @memberof IApiNet
23
+ */
24
+ post(
25
+ url: string,
26
+ data: IApiData,
27
+ params?: IApiParams,
28
+ headers?: RawAxiosRequestHeaders,
29
+ ): Promise<IHttpResponse>;
30
+
31
+ /**
32
+ * @description Get 请求
33
+ * @param {string} url 请求地址
34
+ * @param {IApiParams} [params={}] 请求参数
35
+ * @param {RawAxiosRequestHeaders} [headers={}] 请求头
36
+ * @param {AxiosRequestConfig} [option={}] 请求配置
37
+ * @returns {*} {Promise<IHttpResponse>}
38
+ * @memberof IApiNet
39
+ */
40
+ get(
41
+ url: string,
42
+ params?: IApiParams,
43
+ headers?: RawAxiosRequestHeaders,
44
+ option?: AxiosRequestConfig,
45
+ ): Promise<IHttpResponse>;
46
+
47
+ /**
48
+ * @description Delete 请求
49
+ * @param {string} url 请求地址
50
+ * @param {IApiParams} [params] 请求参数
51
+ * @param {RawAxiosRequestHeaders} [headers] 请求头
52
+ * @returns {*} {Promise<IHttpResponse>}
53
+ * @memberof IApiNet
54
+ */
55
+ delete(
56
+ url: string,
57
+ params?: IApiParams,
58
+ headers?: RawAxiosRequestHeaders,
59
+ ): Promise<IHttpResponse>;
60
+
61
+ /**
62
+ * @description Put 请求
63
+ * @param {string} url 请求地址
64
+ * @param {IApiData} data 请求数据
65
+ * @param {IApiParams} [params={}] 请求参数
66
+ * @param {RawAxiosRequestHeaders} [headers={}] 请求头
67
+ * @returns {*} {Promise<IHttpResponse>}
68
+ * @memberof IApiNet
69
+ */
70
+ put(
71
+ url: string,
72
+ data: IApiData,
73
+ params?: IApiParams,
74
+ headers?: RawAxiosRequestHeaders,
75
+ ): Promise<IHttpResponse>;
76
+
77
+ /**
78
+ * @description 基础请求方法,会合并预置配置
79
+ * @param {string} url 请求地址
80
+ * @param {AxiosRequestConfig} [config={}] 请求配置
81
+ * @returns {*} {Promise<IHttpResponse>}
82
+ * @memberof IApiNet
83
+ */
84
+ request(url: string, config?: AxiosRequestConfig): Promise<IHttpResponse>;
85
+
86
+ /**
87
+ * @description 创建标准 axios 请求,此方法会跳过预置网络拦截器
88
+ * @param {AxiosRequestConfig<IApiData>} config 请求配置
89
+ * @returns {*} {Promise<AxiosResponse>}
90
+ * @memberof IApiNet
91
+ */
92
+ axios(config: AxiosRequestConfig<IApiData>): Promise<AxiosResponse>;
93
+ }
@@ -0,0 +1,67 @@
1
+ import { AxiosResponse } from 'axios';
2
+ import { IApiData } from '../../global-param';
3
+
4
+ /**
5
+ * @description Http请求返回接口
6
+ * @export
7
+ * @interface IHttpResponse
8
+ * @extends {AxiosResponse}
9
+ * @template T
10
+ */
11
+ export interface IHttpResponse<T = IApiData> extends AxiosResponse {
12
+ /**
13
+ * @description 是否请求成功,当状态码为 200-299 时认为成功
14
+ * @type {boolean}
15
+ * @memberof IHttpResponse
16
+ */
17
+ ok: boolean;
18
+
19
+ /**
20
+ * @description 是否为本地仿造响应,只有当值为 true 时, 才认为是本地仿造响应
21
+ * @type {boolean}
22
+ * @memberof IHttpResponse
23
+ */
24
+ local: boolean;
25
+
26
+ /**
27
+ * @description 响应数据
28
+ * @type {T}
29
+ * @memberof IHttpResponse
30
+ */
31
+ data: T;
32
+
33
+ /**
34
+ * @description 当前页
35
+ * @type {number}
36
+ * @memberof IHttpResponse
37
+ */
38
+ page?: number;
39
+
40
+ /**
41
+ * @description 分页条数
42
+ * @type {number}
43
+ * @memberof IHttpResponse
44
+ */
45
+ size?: number;
46
+
47
+ /**
48
+ * @description 总条数
49
+ * @type {number}
50
+ * @memberof IHttpResponse
51
+ */
52
+ total?: number;
53
+
54
+ /**
55
+ * @description 全部计数条数
56
+ * @type {number}
57
+ * @memberof IHttpResponse
58
+ */
59
+ totalx?: number;
60
+
61
+ /**
62
+ * @description 总页数
63
+ * @type {number}
64
+ * @memberof IHttpResponse
65
+ */
66
+ totalPages?: number;
67
+ }
@@ -0,0 +1,51 @@
1
+ /**
2
+ * @description 可选配置参数
3
+ * @export
4
+ * @interface OnClickOutsideOptions
5
+ */
6
+ export interface OnClickOutsideOptions {
7
+ /**
8
+ * @description 指定使用的window,不给就用默认的window
9
+ * @type {Window}
10
+ * @memberof OnClickOutsideOptions
11
+ */
12
+ window?: Window;
13
+ /**
14
+ * @description 指定需要忽略的元素,用于排除某些外部的元素
15
+ * @type {HTMLElement[]}
16
+ * @memberof OnClickOutsideOptions
17
+ */
18
+ ignore?: HTMLElement[];
19
+ /**
20
+ * @description 是否捕获内部元素。默认为是,内部元素不会触发回调。
21
+ * @type {boolean}
22
+ * @memberof OnClickOutsideOptions
23
+ */
24
+ capture?: boolean;
25
+ }
26
+
27
+ // 回调处理函数类型
28
+ export type OnClickOutsideHandler = (_evt: PointerEvent | MouseEvent) => void;
29
+
30
+ /**
31
+ * @description OnClickOutside返回对象类型
32
+ * @export
33
+ * @interface OnClickOutsideResult
34
+ */
35
+ export interface OnClickOutsideResult {
36
+ /**
37
+ * @description 停止监听,并移除相关监听事件
38
+ * @memberof OnClickOutsideResult
39
+ */
40
+ stop: () => void;
41
+ /**
42
+ * @description 暂停监听
43
+ * @memberof OnClickOutsideResult
44
+ */
45
+ pause: () => void;
46
+ /**
47
+ * @description 继续监听
48
+ * @memberof OnClickOutsideResult
49
+ */
50
+ proceed: () => void;
51
+ }
@@ -0,0 +1,47 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ /**
3
+ * @description 指令参数, 主要用于在指令呈现时的展示参数
4
+ * @export
5
+ * @interface ICommandOption
6
+ */
7
+ export interface ICommandOption {
8
+ /**
9
+ * @description 唯一标识符(必需)
10
+ * @type {string}
11
+ * @memberof ICommandOption
12
+ */
13
+ readonly id: string;
14
+ /**
15
+ * @description 显示标题(必需)
16
+ * @type {string}
17
+ * @memberof ICommandOption
18
+ */
19
+ readonly title: string;
20
+ /**
21
+ * @description 悬停提示(可选)
22
+ * @type {string}
23
+ * @memberof ICommandOption
24
+ */
25
+ readonly tooltip?: string;
26
+ /**
27
+ * @description 描述(可选)
28
+ * @type {string}
29
+ * @memberof ICommandOption
30
+ */
31
+ readonly description?: string;
32
+ /**
33
+ * @description svg图标(可选)
34
+ * @type {string}
35
+ * @memberof ICommandOption
36
+ */
37
+ readonly icon?: string;
38
+ }
39
+
40
+ /**
41
+ * @description 指令处理回调
42
+ * @export
43
+ * @interface ICommandHandler
44
+ */
45
+ export interface ICommandHandler {
46
+ (...args: any[]): unknown | Promise<unknown>;
47
+ }
@@ -0,0 +1,68 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import { IDisposable } from '../disposable/i-disposable';
3
+ import { ICommandHandler, ICommandOption } from './i-command-option';
4
+
5
+ /**
6
+ * @description 指令声明
7
+ * @export
8
+ * @interface ICommand
9
+ */
10
+ export interface ICommand {
11
+ id: string;
12
+ handler: ICommandHandler;
13
+ opts?: ICommandOption;
14
+ }
15
+
16
+ /**
17
+ * 指令控制器集
18
+ */
19
+ export type ICommandsMap = Map<string, ICommand>;
20
+
21
+ /**
22
+ * @description 指令注册器
23
+ * @export
24
+ * @interface ICommandRegistry
25
+ */
26
+ export interface ICommandRegistry {
27
+ /**
28
+ * @description 注册指令
29
+ * @param {string} id 指令id
30
+ * @param {ICommandHandler} command 指令处理回调
31
+ * @param {ICommandOption} opts 指令参数
32
+ * @returns {*} {IDisposable} 指令释放对象
33
+ * @memberof ICommandRegistry
34
+ */
35
+ registerCommand(
36
+ id: string,
37
+ command: ICommandHandler,
38
+ opts: ICommandOption,
39
+ ): IDisposable;
40
+ /**
41
+ * @description 注册指令
42
+ * @param {string} id 指令id
43
+ * @param {ICommandHandler} command 指令处理回调
44
+ * @returns {*} {IDisposable} 指令释放对象
45
+ * @memberof ICommandRegistry
46
+ */
47
+ registerCommand(id: string, command: ICommandHandler): IDisposable;
48
+ /**
49
+ * @description 注册指令
50
+ * @param {ICommand} command 指令
51
+ * @returns {*} {IDisposable} 指令释放对象
52
+ * @memberof ICommandRegistry
53
+ */
54
+ registerCommand(command: ICommand): IDisposable;
55
+ /**
56
+ * @description 获取指令
57
+ * @param {string} id 指令id
58
+ * @returns {*} {(ICommand | undefined)}
59
+ * @memberof ICommandRegistry
60
+ */
61
+ getCommand(id: string): ICommand | undefined;
62
+ /**
63
+ * @description 获取所有指令
64
+ * @returns {*} {ICommandsMap}
65
+ * @memberof ICommandRegistry
66
+ */
67
+ getCommands(): ICommandsMap;
68
+ }