@chaoswise/ui 3.0.12 → 3.0.14

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 (214) hide show
  1. package/lib/AbreastLayout/index.js +2 -2
  2. package/lib/AdaptiveLayout/index.js +2 -2
  3. package/lib/Antd5/_util/transButton.js +2 -2
  4. package/lib/Antd5/alert/Alert.js +2 -2
  5. package/lib/Antd5/app/style/index.js +2 -1
  6. package/lib/Antd5/avatar/avatar.js +2 -2
  7. package/lib/Antd5/badge/ScrollNumber.js +2 -2
  8. package/lib/Antd5/badge/index.js +2 -2
  9. package/lib/Antd5/breadcrumb/Breadcrumb.js +2 -2
  10. package/lib/Antd5/breadcrumb/BreadcrumbItem.js +2 -2
  11. package/lib/Antd5/breadcrumb/useItemRender.js +2 -2
  12. package/lib/Antd5/breadcrumb/useItems.js +2 -2
  13. package/lib/Antd5/button/button-group.js +2 -2
  14. package/lib/Antd5/button/button.js +2 -2
  15. package/lib/Antd5/card/Card.js +2 -2
  16. package/lib/Antd5/card/Grid.js +2 -2
  17. package/lib/Antd5/card/Meta.js +2 -2
  18. package/lib/Antd5/carousel/index.js +2 -2
  19. package/lib/Antd5/cascader/index.js +2 -2
  20. package/lib/Antd5/checkbox/Checkbox.js +2 -2
  21. package/lib/Antd5/checkbox/Group.js +2 -2
  22. package/lib/Antd5/color-picker/ColorPicker.js +2 -2
  23. package/lib/Antd5/color-picker/ColorPickerPanel.js +2 -2
  24. package/lib/Antd5/color-picker/components/ColorTrigger.js +2 -2
  25. package/lib/Antd5/color-picker/components/PanelPicker.js +2 -2
  26. package/lib/Antd5/config-provider/index.js +2 -2
  27. package/lib/Antd5/date-picker/generatePicker/generateRangePicker.js +2 -2
  28. package/lib/Antd5/date-picker/generatePicker/generateSinglePicker.js +2 -2
  29. package/lib/Antd5/descriptions/hooks/useItems.js +2 -2
  30. package/lib/Antd5/descriptions/index.js +2 -2
  31. package/lib/Antd5/divider/index.js +2 -2
  32. package/lib/Antd5/drawer/index.js +2 -2
  33. package/lib/Antd5/dropdown/dropdown-button.js +2 -2
  34. package/lib/Antd5/empty/index.js +2 -2
  35. package/lib/Antd5/flex/index.js +2 -2
  36. package/lib/Antd5/float-button/BackTop.js +2 -2
  37. package/lib/Antd5/float-button/FloatButton.js +2 -2
  38. package/lib/Antd5/float-button/FloatButtonGroup.js +2 -2
  39. package/lib/Antd5/float-button/PurePanel.js +2 -2
  40. package/lib/Antd5/form/Form.js +2 -2
  41. package/lib/Antd5/form/FormItem/ItemHolder.js +2 -2
  42. package/lib/Antd5/form/FormItemLabel.js +2 -2
  43. package/lib/Antd5/form/FormList.js +2 -2
  44. package/lib/Antd5/grid/col.js +2 -2
  45. package/lib/Antd5/grid/row.js +2 -2
  46. package/lib/Antd5/image/PreviewGroup.js +2 -2
  47. package/lib/Antd5/image/index.js +2 -2
  48. package/lib/Antd5/input/Input.js +2 -2
  49. package/lib/Antd5/input/OTP/OTPInput.js +2 -2
  50. package/lib/Antd5/input/OTP/index.js +2 -2
  51. package/lib/Antd5/input/Password.js +2 -2
  52. package/lib/Antd5/input/Search.js +2 -2
  53. package/lib/Antd5/input/TextArea.js +2 -2
  54. package/lib/Antd5/input-number/index.js +2 -2
  55. package/lib/Antd5/layout/Sider.js +2 -2
  56. package/lib/Antd5/layout/layout.js +2 -2
  57. package/lib/Antd5/list/Item.js +2 -2
  58. package/lib/Antd5/list/index.js +2 -2
  59. package/lib/Antd5/mentions/index.js +2 -2
  60. package/lib/Antd5/menu/MenuDivider.js +2 -2
  61. package/lib/Antd5/menu/OverrideContext.js +2 -2
  62. package/lib/Antd5/menu/menu.js +2 -2
  63. package/lib/Antd5/message/PurePanel.js +2 -2
  64. package/lib/Antd5/message/useMessage.js +2 -2
  65. package/lib/Antd5/modal/ConfirmDialog.js +2 -2
  66. package/lib/Antd5/modal/Modal.js +2 -2
  67. package/lib/Antd5/modal/PurePanel.js +2 -2
  68. package/lib/Antd5/modal/useModal/HookModal.js +2 -2
  69. package/lib/Antd5/notification/PurePanel.js +2 -2
  70. package/lib/Antd5/notification/useNotification.js +2 -2
  71. package/lib/Antd5/pagination/Pagination.js +2 -2
  72. package/lib/Antd5/popconfirm/PurePanel.js +2 -2
  73. package/lib/Antd5/popconfirm/index.js +2 -2
  74. package/lib/Antd5/popover/PurePanel.js +2 -2
  75. package/lib/Antd5/popover/index.js +2 -2
  76. package/lib/Antd5/progress/Line.js +2 -2
  77. package/lib/Antd5/progress/progress.js +2 -2
  78. package/lib/Antd5/radio/radio.js +2 -2
  79. package/lib/Antd5/radio/radioButton.js +2 -2
  80. package/lib/Antd5/rate/index.js +2 -2
  81. package/lib/Antd5/segmented/index.js +2 -2
  82. package/lib/Antd5/select/index.js +2 -2
  83. package/lib/Antd5/slider/index.js +2 -2
  84. package/lib/Antd5/space/Compact.js +2 -2
  85. package/lib/Antd5/space/index.js +2 -2
  86. package/lib/Antd5/spin/index.js +2 -2
  87. package/lib/Antd5/statistic/Countdown.js +2 -2
  88. package/lib/Antd5/statistic/Statistic.js +2 -2
  89. package/lib/Antd5/steps/index.js +2 -2
  90. package/lib/Antd5/switch/index.js +2 -2
  91. package/lib/Antd5/table/hooks/usePagination.js +2 -2
  92. package/lib/Antd5/tabs/hooks/useLegacyItems.js +2 -2
  93. package/lib/Antd5/tabs/index.js +2 -2
  94. package/lib/Antd5/tag/CheckableTag.js +2 -2
  95. package/lib/Antd5/tag/index.js +2 -2
  96. package/lib/Antd5/theme/useToken.js +2 -2
  97. package/lib/Antd5/theme/util/alias.js +2 -2
  98. package/lib/Antd5/time-picker/index.js +2 -2
  99. package/lib/Antd5/timeline/Timeline.js +2 -2
  100. package/lib/Antd5/timeline/TimelineItem.js +2 -2
  101. package/lib/Antd5/timeline/TimelineItemList.js +2 -2
  102. package/lib/Antd5/tooltip/index.js +2 -2
  103. package/lib/Antd5/tour/PurePanel.js +2 -2
  104. package/lib/Antd5/tour/index.js +2 -2
  105. package/lib/Antd5/tree/DirectoryTree.js +2 -2
  106. package/lib/Antd5/tree-select/index.js +2 -2
  107. package/lib/Antd5/typography/Base/index.js +2 -2
  108. package/lib/Antd5/typography/Link.js +2 -2
  109. package/lib/Antd5/typography/Text.js +2 -2
  110. package/lib/Antd5/typography/Title.js +2 -2
  111. package/lib/Antd5/typography/Typography.js +2 -2
  112. package/lib/Antd5/upload/Dragger.js +2 -2
  113. package/lib/Antd5/upload/Upload.js +1 -1
  114. package/lib/AppHolder/index.js +19 -0
  115. package/lib/Badge/index.style.js +42 -10
  116. package/lib/BasicLayout/Breadcrumb.js +2 -2
  117. package/lib/BasicLayout/Footer.js +2 -2
  118. package/lib/BasicLayout/Sider.js +8 -4
  119. package/lib/BasicLayout/style/sider.js +53 -49
  120. package/lib/Button/index.js +2 -2
  121. package/lib/CWCascader/Cascader/index.js +2 -2
  122. package/lib/CWCascader/rc-cascader/Cascader.js +2 -2
  123. package/lib/CWMessage/MessageContent/TabList/index.js +2 -2
  124. package/lib/CWMessage/MessageContent/index.js +6 -6
  125. package/lib/CWMessage/index.js +82 -92
  126. package/lib/CWMessage/index.style.js +2 -4
  127. package/lib/CWRadioTabs/index.js +2 -2
  128. package/lib/CWRangePicker/DropdownMenu/index.js +41 -37
  129. package/lib/CWRangePicker/DropdownMenu/index.style.js +129 -130
  130. package/lib/CWRangePicker/Refresh/index.js +8 -4
  131. package/lib/CWRangePicker/Refresh/index.style.js +16 -19
  132. package/lib/CWRangePicker/TimeSpan/index.js +7 -2
  133. package/lib/CWRangePicker/TimeSpan/index.style.js +9 -12
  134. package/lib/CWRangePicker/index.js +8 -4
  135. package/lib/CWRangePicker/index.style.js +47 -52
  136. package/lib/CWTable/CWTable.js +3 -3
  137. package/lib/CWTable/header.js +2 -2
  138. package/lib/CWTree/index.js +8 -4
  139. package/lib/CWTree/index.style.js +97 -99
  140. package/lib/CardSelect/index.js +2 -2
  141. package/lib/ChangeIcon/index.js +1 -1
  142. package/lib/Collapse/index.js +2 -2
  143. package/lib/ConfigProvider/ConfigProvider.js +17 -5
  144. package/lib/CustomScrollBar/index.js +2 -2
  145. package/lib/Drawer/index.js +2 -2
  146. package/lib/Dropdown/DropdownButton.js +2 -2
  147. package/lib/Dropdown/index.js +2 -2
  148. package/lib/EchartsArea/index.js +2 -2
  149. package/lib/EchartsBar/index.js +2 -2
  150. package/lib/EchartsBarRow/index.js +2 -2
  151. package/lib/EchartsBase/index.js +2 -2
  152. package/lib/EchartsLine/index.js +2 -2
  153. package/lib/EchartsPie/index.js +2 -2
  154. package/lib/EchartsRing/index.js +2 -2
  155. package/lib/Empty/index.js +2 -2
  156. package/lib/Exception/index.js +1 -1
  157. package/lib/FilterDropDown/index.js +1 -1
  158. package/lib/Flow/BasicLayout/Chain.js +2 -2
  159. package/lib/Flow/Flow.js +2 -2
  160. package/lib/Form/FormItem.js +2 -2
  161. package/lib/Form/index.js +2 -2
  162. package/lib/FormItemWrapper/index.js +2 -2
  163. package/lib/GlobalTabs/index.js +2 -2
  164. package/lib/Header/CommonDropMenu.js +2 -2
  165. package/lib/Header/LocaleSwitcher.js +2 -2
  166. package/lib/Header/Message/index.js +2 -2
  167. package/lib/Header/TopNavigationMenu/index.js +1 -1
  168. package/lib/Header/UserSetting/index.js +1 -1
  169. package/lib/Header/index.js +1 -1
  170. package/lib/Icon/index.js +2 -2
  171. package/lib/IconSelect/index.js +1 -1
  172. package/lib/Input/InputComponent.js +2 -2
  173. package/lib/InputNumber/index.js +2 -2
  174. package/lib/Joyride/index.js +2 -2
  175. package/lib/LayoutBreadcrumb/index.js +2 -2
  176. package/lib/LayoutWrapper/Footer.js +7 -3
  177. package/lib/LayoutWrapper/Header.js +7 -3
  178. package/lib/LayoutWrapper/index.js +5 -2
  179. package/lib/LeftNavigation/index.js +1 -1
  180. package/lib/Modal/Modal.js +2 -2
  181. package/lib/Modal/index.js +2 -2
  182. package/lib/ModuleFederation/react-dynamic-remote-component/RemoteComponent.js +2 -2
  183. package/lib/ModuleTitle/index.js +2 -2
  184. package/lib/Pagination/index.js +2 -2
  185. package/lib/QuickRangePicker/index.js +2 -2
  186. package/lib/QuickTransfer/index.js +7 -3
  187. package/lib/ScrollLoad/index.js +2 -2
  188. package/lib/SearchBar/index.js +3 -3
  189. package/lib/SiderMenu/index.js +2 -2
  190. package/lib/SimpleCard/index.js +2 -2
  191. package/lib/SimplePagination/index.js +1 -1
  192. package/lib/SingleSpa/index.js +2 -2
  193. package/lib/Slider/index.js +2 -2
  194. package/lib/Tabs/index.js +2 -2
  195. package/lib/Tag/CheckableTag.js +2 -2
  196. package/lib/Tag/index.js +2 -2
  197. package/lib/Tag/index.style.js +41 -9
  198. package/lib/ThemeProvider/main.js +2 -2
  199. package/lib/Tooltip/index.js +4 -4
  200. package/lib/TooltipText/index.js +3 -3
  201. package/lib/UniversalLayout/index.js +5 -1
  202. package/lib/WangEditor/editor4.js +2 -2
  203. package/lib/WangEditor/index.js +2 -2
  204. package/lib/antd-style/factories/createStyleProvider/index.js +2 -2
  205. package/lib/antd-style/factories/createStyles/index.js +2 -2
  206. package/lib/antd-style/factories/createThemeProvider/AntdProvider.js +2 -2
  207. package/lib/antd-style/factories/createThemeProvider/TokenContainer.js +2 -2
  208. package/lib/antd-style/factories/createThemeProvider/index.js +2 -2
  209. package/lib/antd-style/functions/index.js +6 -5
  210. package/lib/configHoc/index.js +2 -2
  211. package/lib/locales/en_US.json +1 -0
  212. package/lib/locales/zh_CN.json +1 -0
  213. package/lib/locales/zh_TW.json +1 -0
  214. package/package.json +1 -1
@@ -13,8 +13,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
13
13
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
14
14
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15
15
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
16
- function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
17
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
16
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
17
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
18
18
  function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
19
19
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
20
20
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
@@ -99,6 +99,8 @@ function Message(props) {
99
99
  setTotal = _useState8[1];
100
100
  // 保存消息配置
101
101
  var messageOptionRef = useRef({});
102
+ // 获取socket信息
103
+ var socketConnectInfo = useRef();
102
104
  // 分页配置初始化
103
105
  var _useState9 = useState({
104
106
  current: 1,
@@ -124,6 +126,11 @@ function Message(props) {
124
126
  useEffect(function () {
125
127
  getMessageQuerySettings();
126
128
  connectSocket();
129
+ return function () {
130
+ if (socketConnectInfo.current) {
131
+ socketConnectInfo.current.disconnect && socketConnectInfo.current.disconnect();
132
+ }
133
+ };
127
134
  }, []);
128
135
  useEffect(function () {
129
136
  setPageInfo(function (pre) {
@@ -166,9 +173,9 @@ function Message(props) {
166
173
  userMessageId: id,
167
174
  clientType: "BROWSER"
168
175
  };
169
- resRequestApi = _getMessageDetailApi ? _getMessageDetailApi(params) : getMessageDetailApi(params, gatewayPrefix);
176
+ resRequestApi = _getMessageDetailApi || getMessageDetailApi;
170
177
  _context.next = 4;
171
- return resRequestApi;
178
+ return resRequestApi(params, gatewayPrefix);
172
179
  case 4:
173
180
  res = _context.sent;
174
181
  if (res && res.status == "success") {
@@ -203,24 +210,13 @@ function Message(props) {
203
210
  }();
204
211
  var readInnerMessage = /*#__PURE__*/function () {
205
212
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
206
- var resRequestApi, res;
213
+ var resRequestApi;
207
214
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
208
215
  while (1) switch (_context2.prev = _context2.next) {
209
216
  case 0:
210
- resRequestApi = _readInnerMessageApi ? _readInnerMessageApi(params) : readInnerMessageApi(params, gatewayPrefix);
211
- _context2.next = 3;
212
- return resRequestApi;
213
- case 3:
214
- res = _context2.sent;
215
- if (res.status == "success") {
216
- // if (pageInfo.current > 1 && dataSource.length === 1) {
217
- // let _params = { current: pageInfo.current - 1 };
218
- // setPageInfo((pre) => ({ ...pre, current: pre.current - 1 }));
219
- // conditionsRef.current = { ...conditionsRef.current, ..._params };
220
- // }
221
- // 已读消息
222
- }
223
- case 5:
217
+ resRequestApi = _readInnerMessageApi || readInnerMessageApi;
218
+ resRequestApi(params, gatewayPrefix);
219
+ case 2:
224
220
  case "end":
225
221
  return _context2.stop();
226
222
  }
@@ -230,17 +226,53 @@ function Message(props) {
230
226
  return _ref3.apply(this, arguments);
231
227
  };
232
228
  }();
229
+ var getSocketPostMessage = function getSocketPostMessage(data) {
230
+ var _JSON$parse = JSON.parse(data),
231
+ count = _JSON$parse.count,
232
+ message = _JSON$parse.message;
233
+ var _ref4 = count || {},
234
+ _ref4$total = _ref4.total,
235
+ total = _ref4$total === void 0 ? 0 : _ref4$total;
236
+ setMessageTotal(total);
237
+ onSocketChange(JSON.parse(data));
238
+ if (message) {
239
+ var noticeMessage = message.noticeMessage,
240
+ action = message.action;
241
+ var _ref5 = noticeMessage || {},
242
+ userMessageId = _ref5.id,
243
+ type = _ref5.type;
244
+ if (!userMessageId) return;
245
+ if (action && action.mode === "recall") {
246
+ // 销毁强提醒
247
+ api.destroy(userMessageId);
248
+ // 销毁后如果弹窗开启关闭弹窗
249
+ setVisible(false);
250
+ } else {
251
+ // 生成强提醒
252
+ var _ref6 = messageOptionRef.current[type] || {},
253
+ enable = _ref6.enable,
254
+ _mode = _ref6.mode,
255
+ _ref6$time = _ref6.time,
256
+ time = _ref6$time === void 0 ? 5 : _ref6$time;
257
+ setMode(_mode);
258
+ if (enable) {
259
+ openNotification(time, userMessageId);
260
+ }
261
+ }
262
+ }
263
+ };
233
264
  var connectSocket = /*#__PURE__*/function () {
234
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
265
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
235
266
  var resRequestApi, res, finalOrigin, socket;
236
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
237
- while (1) switch (_context5.prev = _context5.next) {
267
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
268
+ while (1) switch (_context4.prev = _context4.next) {
238
269
  case 0:
239
- resRequestApi = _getSessionId ? _getSessionId() : getSessionId(gatewayPrefix);
240
- _context5.next = 3;
241
- return resRequestApi;
270
+ // 获取sessionId
271
+ resRequestApi = _getSessionId || getSessionId;
272
+ _context4.next = 3;
273
+ return resRequestApi(gatewayPrefix);
242
274
  case 3:
243
- res = _context5.sent;
275
+ res = _context4.sent;
244
276
  if (res && res.status == "success") {
245
277
  finalOrigin = socketOrigin ? socketOrigin : "ws://".concat(window.location.host);
246
278
  socket = io(finalOrigin, {
@@ -250,62 +282,20 @@ function Message(props) {
250
282
  sessionId: res.data,
251
283
  clientType: "BROWSER"
252
284
  }
253
- });
254
- socket.on("push", /*#__PURE__*/function () {
255
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(data) {
256
- var _JSON$parse, count, message, _ref6, _ref6$total, total, noticeMessage, action, _ref7, userMessageId, type, _ref8, enable, _mode, _ref8$time, time;
257
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
258
- while (1) switch (_context3.prev = _context3.next) {
259
- case 0:
260
- _JSON$parse = JSON.parse(data), count = _JSON$parse.count, message = _JSON$parse.message;
261
- _ref6 = count || {}, _ref6$total = _ref6.total, total = _ref6$total === void 0 ? 0 : _ref6$total;
262
- setMessageTotal(total);
263
- onSocketChange(JSON.parse(data));
264
- if (!message) {
265
- _context3.next = 10;
266
- break;
267
- }
268
- noticeMessage = message.noticeMessage, action = message.action;
269
- _ref7 = noticeMessage || {}, userMessageId = _ref7.id, type = _ref7.type;
270
- if (userMessageId) {
271
- _context3.next = 9;
272
- break;
273
- }
274
- return _context3.abrupt("return");
275
- case 9:
276
- if (action && action.mode === "recall") {
277
- // 销毁强提醒
278
- api.destroy(userMessageId);
279
- // 销毁后如果弹窗开启关闭弹窗
280
- setVisible(false);
281
- } else {
282
- // 生成强提醒
283
- _ref8 = messageOptionRef.current[type] || {}, enable = _ref8.enable, _mode = _ref8.mode, _ref8$time = _ref8.time, time = _ref8$time === void 0 ? 5 : _ref8$time;
284
- setMode(_mode);
285
- if (enable) {
286
- openNotification(time, userMessageId);
287
- }
288
- }
289
- case 10:
290
- case "end":
291
- return _context3.stop();
292
- }
293
- }, _callee3);
294
- }));
295
- return function (_x4) {
296
- return _ref5.apply(this, arguments);
297
- };
298
- }());
285
+ }); // 记录socket连接信息,用于关闭socket连接
286
+ socketConnectInfo.current = socket;
287
+ // 监听从服务器传来的消息
288
+ socket.on("push", getSocketPostMessage);
299
289
  // socket重连
300
- socket.on("reconnect_attempt", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
290
+ socket.on("reconnect_attempt", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
301
291
  var res;
302
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
303
- while (1) switch (_context4.prev = _context4.next) {
292
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
293
+ while (1) switch (_context3.prev = _context3.next) {
304
294
  case 0:
305
- _context4.next = 2;
295
+ _context3.next = 2;
306
296
  return resRequestApi;
307
297
  case 2:
308
- res = _context4.sent;
298
+ res = _context3.sent;
309
299
  if (res && res.status == "success") {
310
300
  socket.io.opts.query = {
311
301
  sessionId: res.data,
@@ -314,44 +304,44 @@ function Message(props) {
314
304
  }
315
305
  case 4:
316
306
  case "end":
317
- return _context4.stop();
307
+ return _context3.stop();
318
308
  }
319
- }, _callee4);
309
+ }, _callee3);
320
310
  })));
321
311
  }
322
312
  case 5:
323
313
  case "end":
324
- return _context5.stop();
314
+ return _context4.stop();
325
315
  }
326
- }, _callee5);
316
+ }, _callee4);
327
317
  }));
328
318
  return function connectSocket() {
329
- return _ref4.apply(this, arguments);
319
+ return _ref7.apply(this, arguments);
330
320
  };
331
321
  }();
332
322
  var getMessageQuerySettings = /*#__PURE__*/function () {
333
- var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
323
+ var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
334
324
  var resRequestApi, res, data;
335
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
336
- while (1) switch (_context6.prev = _context6.next) {
325
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
326
+ while (1) switch (_context5.prev = _context5.next) {
337
327
  case 0:
338
- resRequestApi = _getMessageQuerySettingsApi ? _getMessageQuerySettingsApi() : getMessageQuerySettingsApi(gatewayPrefix);
339
- _context6.next = 3;
340
- return resRequestApi;
328
+ resRequestApi = _getMessageQuerySettingsApi || getMessageQuerySettingsApi;
329
+ _context5.next = 3;
330
+ return resRequestApi(gatewayPrefix);
341
331
  case 3:
342
- res = _context6.sent;
332
+ res = _context5.sent;
343
333
  if (res && res.status === "success") {
344
334
  data = res.data;
345
335
  messageOptionRef.current = data || {};
346
336
  }
347
337
  case 5:
348
338
  case "end":
349
- return _context6.stop();
339
+ return _context5.stop();
350
340
  }
351
- }, _callee6);
341
+ }, _callee5);
352
342
  }));
353
343
  return function getMessageQuerySettings() {
354
- return _ref10.apply(this, arguments);
344
+ return _ref9.apply(this, arguments);
355
345
  };
356
346
  }();
357
347
  return wrapCSSVar( /*#__PURE__*/React.createElement("div", {
@@ -126,9 +126,7 @@ var genCustomCWMessageStyle = function genCustomCWMessageStyle(token) {
126
126
  }
127
127
  })), "".concat(messagePrefixCls, "-content-tabs-list"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({
128
128
  paddingTop: "16px"
129
- }, "&".concat(messagePrefixCls, "-content-tabs-list-invalid"), _defineProperty({
130
- color: "red"
131
- }, "".concat(messagePrefixCls, "-content-tabs-list-title,").concat(messagePrefixCls, "-content-tabs-list-desc,").concat(messagePrefixCls, "-content-tabs-list-date"), {
129
+ }, "&".concat(messagePrefixCls, "-content-tabs-list-invalid"), _defineProperty({}, "".concat(messagePrefixCls, "-content-tabs-list-title,").concat(messagePrefixCls, "-content-tabs-list-desc,").concat(messagePrefixCls, "-content-tabs-list-date"), {
132
130
  color: token.colorTextDisabled,
133
131
  "&:hover": {
134
132
  color: token.colorTextDisabled
@@ -157,7 +155,7 @@ var genCustomCWMessageStyle = function genCustomCWMessageStyle(token) {
157
155
  WebkitBoxOrient: "vertical",
158
156
  marginTop: "8px",
159
157
  marginBottom: "4px",
160
- height: "40px",
158
+ // height: "40px",
161
159
  lineHeight: "20px",
162
160
  color: token.colorTextSecondary,
163
161
  whiteSpace: "pre-wrap"
@@ -10,8 +10,8 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
10
10
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
11
11
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
12
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
13
- function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
14
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
13
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
14
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
15
15
  import React, { forwardRef, useState, useEffect, useMemo } from "react";
16
16
  import { EllipsisOutlined } from "@ant-design/icons";
17
17
  import PropTypes from "prop-types";
@@ -11,26 +11,27 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
11
11
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
12
12
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
13
13
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
14
- function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
15
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
14
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
15
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
16
16
  function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
17
17
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
18
18
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
19
19
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
20
20
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
21
21
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
22
- import React from 'react';
23
- import { RightOutlined } from '@ant-design/icons';
24
- import classnames from 'classnames';
25
- import CalendarSvg from '../assets/Calendar';
26
- import Calendar2Svg from '../assets/Calendar2';
27
- import LiveSvg from '../assets/live';
28
- import MoreSvg from '../assets/more';
29
- import MoreTimeList from './MoreTimeList';
30
- import MoreHistoryList from './MoreHistoryList';
31
- import { judgeType, funcValueChangeArrayValue, getCorrectValue, getHistoryInfo } from '../utils';
32
- import { useIntl } from '../../locales';
33
- import useStyle from './index.style';
22
+ import React from "react";
23
+ import { RightOutlined } from "@ant-design/icons";
24
+ import classnames from "classnames";
25
+ import CalendarSvg from "../assets/Calendar";
26
+ import Calendar2Svg from "../assets/Calendar2";
27
+ import LiveSvg from "../assets/live";
28
+ import MoreSvg from "../assets/more";
29
+ import MoreTimeList from "./MoreTimeList";
30
+ import MoreHistoryList from "./MoreHistoryList";
31
+ import useConfigContext from "../../useConfigContext";
32
+ import { judgeType, funcValueChangeArrayValue, getCorrectValue, getHistoryInfo } from "../utils";
33
+ import { useIntl } from "../../locales";
34
+ import useStyle from "./index.style";
34
35
  var DropdownMenu = function DropdownMenu(props) {
35
36
  var dataSource = props.dataSource,
36
37
  regroupDataSource = props.regroupDataSource,
@@ -46,7 +47,10 @@ var DropdownMenu = function DropdownMenu(props) {
46
47
  setHistoryList = props.setHistoryList,
47
48
  format = props.format,
48
49
  timeSpanOption = props.timeSpanOption;
49
- var _useStyle = useStyle("cw-dropdown-menu-wrapper"),
50
+ var _useConfigContext = useConfigContext(),
51
+ getPrefixCls = _useConfigContext.getPrefixCls;
52
+ var prefixCls = getPrefixCls();
53
+ var _useStyle = useStyle("".concat(prefixCls, "-cw-dropdown-menu")),
50
54
  _useStyle2 = _slicedToArray(_useStyle, 3),
51
55
  wrapCSSVar = _useStyle2[0],
52
56
  hashId = _useStyle2[1],
@@ -54,7 +58,7 @@ var DropdownMenu = function DropdownMenu(props) {
54
58
  var intl = useIntl();
55
59
  var _ref = (intl === null || intl === void 0 ? void 0 : intl.options) || {},
56
60
  _ref$currentLocale = _ref.currentLocale,
57
- locale = _ref$currentLocale === void 0 ? 'zh_CN' : _ref$currentLocale;
61
+ locale = _ref$currentLocale === void 0 ? "zh_CN" : _ref$currentLocale;
58
62
  var _timeSpanOption$timeS = timeSpanOption.timeSpanBoundary,
59
63
  timeSpanBoundary = _timeSpanOption$timeS === void 0 ? 94608000 : _timeSpanOption$timeS;
60
64
  var _menuOption$showCalen = menuOption.showCalendar,
@@ -66,7 +70,7 @@ var DropdownMenu = function DropdownMenu(props) {
66
70
  _menuOption$showDefau2 = menuOption.showDefaultHistoryCount,
67
71
  showDefaultHistoryCount = _menuOption$showDefau2 === void 0 ? 5 : _menuOption$showDefau2,
68
72
  _menuOption$moreHisto = menuOption.moreHistoryDropdownPosition,
69
- moreHistoryDropdownPosition = _menuOption$moreHisto === void 0 ? 'left' : _menuOption$moreHisto;
73
+ moreHistoryDropdownPosition = _menuOption$moreHisto === void 0 ? "left" : _menuOption$moreHisto;
70
74
  // 点击Menu.Item中切换选项列表
71
75
  var onClickItem = function onClickItem(item) {
72
76
  var timeDomain = recordDateValue.timeDomain,
@@ -137,7 +141,7 @@ var DropdownMenu = function DropdownMenu(props) {
137
141
  setHistoryList([]);
138
142
  };
139
143
  return wrapCSSVar( /*#__PURE__*/React.createElement("div", {
140
- className: classnames(hashId, cssVarCls, 'cw-dropdown-menu-wrapper')
144
+ className: classnames(hashId, cssVarCls, "".concat(prefixCls, "-cw-dropdown-menu-wrapper"))
141
145
  }, dataSource === null || dataSource === void 0 ? void 0 : dataSource.slice(0, showDefaultCount).map(function (item) {
142
146
  var values = item.value;
143
147
  var _judgeType = judgeType(item),
@@ -148,8 +152,8 @@ var DropdownMenu = function DropdownMenu(props) {
148
152
  isHasDate = false;
149
153
  }
150
154
  return /*#__PURE__*/React.createElement("div", {
151
- className: classnames('cw-dropdown-menu-_item', {
152
- 'cw-dropdown-menu-item-selected': (recordDateValue === null || recordDateValue === void 0 ? void 0 : recordDateValue.key) === item.key
155
+ className: classnames("cw-dropdown-menu-_item", {
156
+ "cw-dropdown-menu-item-selected": (recordDateValue === null || recordDateValue === void 0 ? void 0 : recordDateValue.key) === item.key
153
157
  }),
154
158
  key: item.key,
155
159
  onClick: function onClick() {
@@ -159,7 +163,7 @@ var DropdownMenu = function DropdownMenu(props) {
159
163
  className: "cw-range-picker-prefix-icon"
160
164
  }) : /*#__PURE__*/React.createElement(LiveSvg, null), /*#__PURE__*/React.createElement("span", {
161
165
  style: {
162
- marginLeft: '4px'
166
+ marginLeft: "4px"
163
167
  }
164
168
  }, item.render ? item.render(item) : item.title));
165
169
  }), (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) > showDefaultCount && /*#__PURE__*/React.createElement(_Dropdown, {
@@ -168,28 +172,28 @@ var DropdownMenu = function DropdownMenu(props) {
168
172
  recordDateValue: recordDateValue,
169
173
  onClickItem: onClickItem
170
174
  }),
171
- overlayClassName: classnames('cw-dropdown-menu-more-wrapper', {
172
- 'cw-dropdown-menu-more-wrapper-left': moreItemDropdownPosition === 'left'
175
+ overlayClassName: classnames("cw-dropdown-menu-more-wrapper", {
176
+ "cw-dropdown-menu-more-wrapper-left": moreItemDropdownPosition === "left"
173
177
  }),
174
178
  getPopupContainer: function getPopupContainer(triggerNode) {
175
179
  return triggerNode;
176
180
  }
177
181
  }, /*#__PURE__*/React.createElement("div", {
178
- className: classnames('cw-dropdown-menu-_item', 'cw-dropdown-menu-item-more')
182
+ className: classnames("cw-dropdown-menu-_item", "cw-dropdown-menu-item-more")
179
183
  }, /*#__PURE__*/React.createElement("div", {
180
184
  style: {
181
- display: 'flex',
182
- alignItems: 'center'
185
+ display: "flex",
186
+ alignItems: "center"
183
187
  }
184
188
  }, /*#__PURE__*/React.createElement(MoreSvg, {
185
189
  className: "cw-range-picker-prefix-icon"
186
190
  }), /*#__PURE__*/React.createElement("span", {
187
191
  style: {
188
- marginLeft: '4px'
192
+ marginLeft: "4px"
189
193
  }
190
- }, intl.get('a30db643-5238-42bc-bc5e-98a9d0c7df51').d('更多'))), /*#__PURE__*/React.createElement(RightOutlined, null))), showCalendar && /*#__PURE__*/React.createElement("div", {
191
- className: classnames('cw-dropdown-menu-_item'),
192
- key: 'unique-calendar',
194
+ }, intl.get("a30db643-5238-42bc-bc5e-98a9d0c7df51").d("更多"))), /*#__PURE__*/React.createElement(RightOutlined, null))), showCalendar && /*#__PURE__*/React.createElement("div", {
195
+ className: classnames("cw-dropdown-menu-_item"),
196
+ key: "unique-calendar",
193
197
  onClick: onClickSelectCalendar
194
198
  }, /*#__PURE__*/React.createElement("div", {
195
199
  className: "cw-range-picker-menu-item-calendar"
@@ -197,28 +201,28 @@ var DropdownMenu = function DropdownMenu(props) {
197
201
  className: "cw-range-picker-prefix-icon"
198
202
  })), /*#__PURE__*/React.createElement("span", {
199
203
  style: {
200
- marginLeft: '4px'
204
+ marginLeft: "4px"
201
205
  }
202
- }, intl.get('711fdb26-65b9-48da-ba3c-363f5ab8218c').d('日历选择'))), showHistoryList && Boolean(historyList.length) && /*#__PURE__*/React.createElement(_Dropdown, {
206
+ }, intl.get("711fdb26-65b9-48da-ba3c-363f5ab8218c").d("日历选择"))), showHistoryList && Boolean(historyList.length) && /*#__PURE__*/React.createElement(_Dropdown, {
203
207
  overlay: /*#__PURE__*/React.createElement(MoreHistoryList, {
204
208
  historyList: historyList,
205
209
  onClickTag: onClickTag,
206
210
  onCloseTag: onCloseTag,
207
211
  onCloseAllTag: onCloseAllTag
208
212
  }),
209
- overlayClassName: classnames('cw-dropdown-menu-history-more-wrapper', {
210
- 'cw-dropdown-menu-history-more-wrapper-left': moreHistoryDropdownPosition === 'left'
213
+ overlayClassName: classnames("cw-dropdown-menu-history-more-wrapper", {
214
+ "cw-dropdown-menu-history-more-wrapper-left": moreHistoryDropdownPosition === "left"
211
215
  }),
212
216
  getPopupContainer: function getPopupContainer(triggerNode) {
213
217
  return triggerNode;
214
218
  }
215
219
  }, /*#__PURE__*/React.createElement("div", {
216
- className: classnames('cw-dropdown-menu-history-outer-wrapper')
220
+ className: classnames("cw-dropdown-menu-history-outer-wrapper")
217
221
  }, /*#__PURE__*/React.createElement("div", {
218
- className: classnames('cw-dropdown-menu-history-wrapper')
222
+ className: classnames("cw-dropdown-menu-history-wrapper")
219
223
  }, /*#__PURE__*/React.createElement("span", {
220
224
  className: "cw-dropdown-menu-history-title"
221
- }, intl.get('294afc43-e2de-4d72-ba99-1f25d6f7a1d7').d('历史记录')), historyList.slice(0, showDefaultHistoryCount).map(function (tag) {
225
+ }, intl.get("294afc43-e2de-4d72-ba99-1f25d6f7a1d7").d("历史记录")), historyList.slice(0, showDefaultHistoryCount).map(function (tag) {
222
226
  return /*#__PURE__*/React.createElement(_Tag, {
223
227
  type: "custom_type01",
224
228
  closable: true,