@chaoswise/ui 2.7.11 → 2.8.0

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 (219) hide show
  1. package/lib/AlgorithmChart/common/chart.option.js +14 -11
  2. package/lib/AlgorithmChart/index.js +29 -26
  3. package/lib/Antd4/comment/index.js +1 -1
  4. package/lib/Antd4Form/FormItem.js +1 -1
  5. package/lib/BasicLayout/Nav.js +3 -5
  6. package/lib/BasicLayout/index.js +9 -10
  7. package/lib/CWCascader/rc-cascader/OptionList/Column.js +17 -18
  8. package/lib/CWMessage/MessageContent/TabList/index.js +19 -17
  9. package/lib/CWMessage/MessageContent/index.js +86 -73
  10. package/lib/CWMessage/index.js +62 -50
  11. package/lib/CWMessage/service/index.js +14 -14
  12. package/lib/CWMessage/utils/index.js +18 -11
  13. package/lib/CWRangePicker/DropdownMenu/MoreHistoryList/index.js +16 -10
  14. package/lib/CWRangePicker/DropdownMenu/MoreTimeList/index.js +4 -6
  15. package/lib/CWRangePicker/DropdownMenu/index.js +20 -13
  16. package/lib/CWRangePicker/Refresh/index.js +4 -7
  17. package/lib/CWRangePicker/TimeSpan/index.js +6 -9
  18. package/lib/CWRangePicker/index.js +39 -32
  19. package/lib/CWRangePicker/utils/index.js +45 -114
  20. package/lib/CWSelect/index.js +7 -10
  21. package/lib/CWTable/CWTable.js +23 -23
  22. package/lib/CWTable/EditLine.js +5 -8
  23. package/lib/CWTable/Filter.js +5 -8
  24. package/lib/CWTable/index.js +3 -0
  25. package/lib/CWTree/index.js +4 -7
  26. package/lib/CWUpload/upload/Dragger.js +4 -7
  27. package/lib/CWUpload/upload/UploadList.js +12 -15
  28. package/lib/CardSelect/index.js +16 -14
  29. package/lib/CitySelect/index.js +3 -1
  30. package/lib/ColorPicker/index.js +4 -7
  31. package/lib/ConfigProvider/ConfigProvider.js +143 -48
  32. package/lib/ConfigProvider/Switch.js +10 -2
  33. package/lib/ConfigProvider/context.js +8 -0
  34. package/lib/ConfigProvider/useLocale.js +1 -1
  35. package/lib/DatePicker/useLocale.js +17 -10
  36. package/lib/DateRangePicker/RangeDateTimePicker.js +3 -3
  37. package/lib/DateRangePicker/components/ExtraQuickFooter.js +5 -8
  38. package/lib/DateRangePicker/index.js +6 -5
  39. package/lib/DropdownDatePicker/DropdownMenu/MoreTimeList/index.js +4 -6
  40. package/lib/DropdownDatePicker/DropdownMenu/index.js +4 -7
  41. package/lib/DropdownDatePicker/index.js +12 -13
  42. package/lib/DropdownDatePicker/utils/index.js +5 -93
  43. package/lib/EchartsBar/index.js +1 -1
  44. package/lib/Empty/index.js +3 -6
  45. package/lib/ErrorBoundary/ErrorPage.js +8 -9
  46. package/lib/Exception/index.js +9 -12
  47. package/lib/FilterDropDown/index.js +3 -6
  48. package/lib/Flow/tools/index.js +4 -1
  49. package/lib/Header/Document/index.js +3 -8
  50. package/lib/Header/LocaleSwitcher.js +2 -0
  51. package/lib/Header/UserSetting/index.js +27 -45
  52. package/lib/IconSelect/components/CustomImg/index.js +8 -11
  53. package/lib/IconSelect/components/SearchIcon/index.js +9 -9
  54. package/lib/IconSelect/index.js +4 -7
  55. package/lib/ImagePreview/index.js +3 -1
  56. package/lib/Joyride/List.js +9 -8
  57. package/lib/Joyride/index.js +22 -25
  58. package/lib/ModuleFederation/react-dynamic-remote-component/RemoteComponent.js +38 -39
  59. package/lib/ModuleFederation/react-dynamic-remote-component/load-module.js +22 -23
  60. package/lib/Pagination/index.js +14 -14
  61. package/lib/PolymerizationSearch/DropdownMenu.js +4 -2
  62. package/lib/PolymerizationSearch/index.js +7 -7
  63. package/lib/Progress/index.js +3 -6
  64. package/lib/QuickTransfer/DragList.js +3 -6
  65. package/lib/QuickTransfer/index.js +19 -22
  66. package/lib/RangePicker/components/ExtraTimeFooter.js +4 -7
  67. package/lib/SearchBar/OutSearch.js +9 -2
  68. package/lib/SearchBar/index.js +13 -16
  69. package/lib/SimpleCard/index.js +3 -1
  70. package/lib/SingleSpa/index.js +30 -26
  71. package/lib/ThemeProvider/Switcher.js +3 -1
  72. package/lib/TimeRangeSlider/Refresh/index.js +4 -7
  73. package/lib/TimeRangeSlider/TimeRangeSliderCmp/hooks/useMouse.js +3 -3
  74. package/lib/TimeRangeSlider/TimeSpan/index.js +6 -9
  75. package/lib/TimeRangeSlider/index.js +28 -24
  76. package/lib/TimeRangeSlider/utils/index.js +20 -100
  77. package/lib/TimeZoneSelect/index.js +21 -22
  78. package/lib/TreeSelect111/index.js +3 -6
  79. package/lib/Upload-back/index.js +27 -25
  80. package/lib/VerticalLayout/index.js +3 -1
  81. package/lib/WangEditor/extraLanguage.js +19 -0
  82. package/lib/WangEditor/index.js +19 -13
  83. package/lib/WangEditor/messages.js +49 -0
  84. package/lib/WangEditor/wangEditor.js +47 -20
  85. package/lib/index.js +1 -0
  86. package/lib/locales/en_US.json +1 -0
  87. package/lib/locales/index.js +2 -0
  88. package/lib/locales/ja_JP.json +1 -0
  89. package/lib/locales/load.js +48 -0
  90. package/lib/locales/messages/antd.js +404 -0
  91. package/lib/locales/messages/editor.js +42 -0
  92. package/lib/locales/messages/timeRanges.js +36 -0
  93. package/lib/locales/messages/timeTypes.js +11 -0
  94. package/lib/locales/runtime.js +127 -0
  95. package/lib/locales/zh_CN.json +1 -0
  96. package/lib/locales/zh_HK.json +1 -0
  97. package/lib/locales/zh_TW.json +1 -0
  98. package/lib/useIntl/index.js +9 -0
  99. package/lib/useLocale/index.js +16 -13
  100. package/lib/utils/index.js +4 -1
  101. package/package.json +14 -3
  102. package/lib/BasicLayout/locale/en_US.js +0 -4
  103. package/lib/BasicLayout/locale/index.js +0 -13
  104. package/lib/BasicLayout/locale/ja_JP.js +0 -4
  105. package/lib/BasicLayout/locale/zh_CN.js +0 -4
  106. package/lib/BasicLayout/locale/zh_TW.js +0 -4
  107. package/lib/CWMessage/locale/en_US.js +0 -8
  108. package/lib/CWMessage/locale/index.js +0 -13
  109. package/lib/CWMessage/locale/ja_JP.js +0 -8
  110. package/lib/CWMessage/locale/zh_CN.js +0 -8
  111. package/lib/CWMessage/locale/zh_TW.js +0 -8
  112. package/lib/CWRangePicker/locale/en_US.js +0 -29
  113. package/lib/CWRangePicker/locale/index.js +0 -13
  114. package/lib/CWRangePicker/locale/ja_JP.js +0 -29
  115. package/lib/CWRangePicker/locale/zh_CN.js +0 -29
  116. package/lib/CWRangePicker/locale/zh_TW.js +0 -29
  117. package/lib/CWSelect/locale/en_US.js +0 -4
  118. package/lib/CWSelect/locale/index.js +0 -13
  119. package/lib/CWSelect/locale/ja_JP.js +0 -4
  120. package/lib/CWSelect/locale/zh_CN.js +0 -4
  121. package/lib/CWSelect/locale/zh_TW.js +0 -4
  122. package/lib/CWTable/locale/en_US.js +0 -6
  123. package/lib/CWTable/locale/index.js +0 -13
  124. package/lib/CWTable/locale/ja_JP.js +0 -6
  125. package/lib/CWTable/locale/zh_CN.js +0 -6
  126. package/lib/CWTable/locale/zh_TW.js +0 -6
  127. package/lib/CWTree/locale/en_US.js +0 -3
  128. package/lib/CWTree/locale/index.js +0 -13
  129. package/lib/CWTree/locale/ja_JP.js +0 -3
  130. package/lib/CWTree/locale/zh_CN.js +0 -3
  131. package/lib/CWTree/locale/zh_TW.js +0 -3
  132. package/lib/CWUpload/locale/en_US.js +0 -6
  133. package/lib/CWUpload/locale/index.js +0 -13
  134. package/lib/CWUpload/locale/ja_JP.js +0 -6
  135. package/lib/CWUpload/locale/zh_CN.js +0 -6
  136. package/lib/CWUpload/locale/zh_TW.js +0 -6
  137. package/lib/Card/index.less +0 -10
  138. package/lib/ColorPicker/locale/en_US.js +0 -4
  139. package/lib/ColorPicker/locale/index.js +0 -13
  140. package/lib/ColorPicker/locale/ja_JP.js +0 -4
  141. package/lib/ColorPicker/locale/zh_CN.js +0 -4
  142. package/lib/ColorPicker/locale/zh_TW.js +0 -4
  143. package/lib/DateRangePicker/locale/en_US.js +0 -5
  144. package/lib/DateRangePicker/locale/index.js +0 -13
  145. package/lib/DateRangePicker/locale/ja_JP.js +0 -5
  146. package/lib/DateRangePicker/locale/zh_CN.js +0 -5
  147. package/lib/DateRangePicker/locale/zh_TW.js +0 -5
  148. package/lib/DropdownDatePicker/locale/en_US.js +0 -21
  149. package/lib/DropdownDatePicker/locale/index.js +0 -13
  150. package/lib/DropdownDatePicker/locale/ja_JP.js +0 -21
  151. package/lib/DropdownDatePicker/locale/zh_CN.js +0 -21
  152. package/lib/DropdownDatePicker/locale/zh_TW.js +0 -21
  153. package/lib/Empty/locale/en_US.js +0 -3
  154. package/lib/Empty/locale/index.js +0 -13
  155. package/lib/Empty/locale/ja_JP.js +0 -3
  156. package/lib/Empty/locale/zh_CN.js +0 -3
  157. package/lib/Empty/locale/zh_TW.js +0 -3
  158. package/lib/ErrorBoundary/index.less +0 -15
  159. package/lib/ErrorBoundary/locale/en_US.js +0 -5
  160. package/lib/ErrorBoundary/locale/index.js +0 -13
  161. package/lib/ErrorBoundary/locale/ja_JP.js +0 -5
  162. package/lib/ErrorBoundary/locale/zh_CN.js +0 -5
  163. package/lib/ErrorBoundary/locale/zh_TW.js +0 -5
  164. package/lib/Exception/locale/en_US.js +0 -9
  165. package/lib/Exception/locale/index.js +0 -13
  166. package/lib/Exception/locale/ja_JP.js +0 -9
  167. package/lib/Exception/locale/zh_CN.js +0 -9
  168. package/lib/Exception/locale/zh_TW.js +0 -9
  169. package/lib/FilterDropDown/locale/en_US.js +0 -3
  170. package/lib/FilterDropDown/locale/index.js +0 -13
  171. package/lib/FilterDropDown/locale/ja_JP.js +0 -3
  172. package/lib/FilterDropDown/locale/zh_CN.js +0 -3
  173. package/lib/FilterDropDown/locale/zh_TW.js +0 -3
  174. package/lib/IconSelect/locale/en_US.js +0 -11
  175. package/lib/IconSelect/locale/index.js +0 -13
  176. package/lib/IconSelect/locale/ja_JP.js +0 -11
  177. package/lib/IconSelect/locale/zh_CN.js +0 -11
  178. package/lib/IconSelect/locale/zh_TW.js +0 -11
  179. package/lib/Joyride/locale/en_US.js +0 -25
  180. package/lib/Joyride/locale/index.js +0 -13
  181. package/lib/Joyride/locale/ja_JP.js +0 -25
  182. package/lib/Joyride/locale/zh_CN.js +0 -25
  183. package/lib/Joyride/locale/zh_TW.js +0 -25
  184. package/lib/Pagination/locale/en_US.js +0 -8
  185. package/lib/Pagination/locale/index.js +0 -13
  186. package/lib/Pagination/locale/ja_JP.js +0 -8
  187. package/lib/Pagination/locale/zh_CN.js +0 -8
  188. package/lib/Pagination/locale/zh_TW.js +0 -8
  189. package/lib/Progress/locale/en_US.js +0 -3
  190. package/lib/Progress/locale/index.js +0 -13
  191. package/lib/Progress/locale/ja_JP.js +0 -3
  192. package/lib/Progress/locale/zh_CN.js +0 -3
  193. package/lib/Progress/locale/zh_TW.js +0 -3
  194. package/lib/QuickTransfer/locale/en_US.js +0 -8
  195. package/lib/QuickTransfer/locale/index.js +0 -13
  196. package/lib/QuickTransfer/locale/ja_JP.js +0 -8
  197. package/lib/QuickTransfer/locale/zh_CN.js +0 -8
  198. package/lib/QuickTransfer/locale/zh_TW.js +0 -8
  199. package/lib/RangePicker/locale/en_US.js +0 -5
  200. package/lib/RangePicker/locale/index.js +0 -13
  201. package/lib/RangePicker/locale/ja_JP.js +0 -5
  202. package/lib/RangePicker/locale/zh_CN.js +0 -5
  203. package/lib/RangePicker/locale/zh_TW.js +0 -5
  204. package/lib/SearchBar/locale/en_US.js +0 -6
  205. package/lib/SearchBar/locale/index.js +0 -13
  206. package/lib/SearchBar/locale/ja_JP.js +0 -6
  207. package/lib/SearchBar/locale/zh_CN.js +0 -6
  208. package/lib/SearchBar/locale/zh_TW.js +0 -6
  209. package/lib/TimeRangeSlider/locale/en_US.js +0 -31
  210. package/lib/TimeRangeSlider/locale/index.js +0 -13
  211. package/lib/TimeRangeSlider/locale/ja_JP.js +0 -31
  212. package/lib/TimeRangeSlider/locale/zh_CN.js +0 -31
  213. package/lib/TimeRangeSlider/locale/zh_TW.js +0 -31
  214. package/lib/TreeSelect111/locale/en_US.js +0 -3
  215. package/lib/TreeSelect111/locale/index.js +0 -13
  216. package/lib/TreeSelect111/locale/ja_JP.js +0 -3
  217. package/lib/TreeSelect111/locale/zh_CN.js +0 -3
  218. package/lib/TreeSelect111/locale/zh_TW.js +0 -3
  219. package/lib/WangEditor/locale/index.js +0 -93
@@ -1,11 +1,13 @@
1
1
  import moment from "moment";
2
- var ChartOption = function ChartOption() {
2
+ var ChartOption = function ChartOption(intl) {
3
+ var anomalyLabel = intl.get("b38ae1d1-4784-48d0-93bc-5114e5bab2db").d("异常检测点:");
4
+ var realValueLabel = intl.get("25fb8e48-65c5-43f7-a8bf-7709ff04d887").d("真实值");
3
5
  var sampling = 'lttb'; ////average,max,min,sum/折线图在数据量远大于像素点时候的降采样策略,开启后可以有效的优化图表的绘制效率,默认关闭,也就是全部绘制不过滤数据点。
4
6
  return {
5
7
  animation: true,
6
8
  title: {
7
9
  show: true,
8
- text: '原始数据',
10
+ text: intl.get("ed0f81b8-b85f-423b-b12a-1aaf718402f6").d("原始数据"),
9
11
  textStyle: {
10
12
  fontFamily: "Helvetica",
11
13
  color: "rgba(0,0,0,0.85)",
@@ -19,7 +21,7 @@ var ChartOption = function ChartOption() {
19
21
  formatter: function formatter(params) {
20
22
  // console.log(params)
21
23
  var upDownLine = params.filter(function (i) {
22
- return i.seriesName === '上下界阈值';
24
+ return i.seriesName === intl.get("38ca4b1d-225d-424d-bd15-b113389de185").d("上下界阈值");
23
25
  });
24
26
  var dom = (params || []).map(function (item, index) {
25
27
  var marker = item.marker,
@@ -181,7 +183,7 @@ var ChartOption = function ChartOption() {
181
183
  series: [{
182
184
  animation: true,
183
185
  animationThreshold: 10000,
184
- name: '原始数据',
186
+ name: intl.get("ed0f81b8-b85f-423b-b12a-1aaf718402f6").d("原始数据"),
185
187
  type: 'line',
186
188
  // color: '#0066FF',
187
189
  symbol: 'circle',
@@ -235,7 +237,8 @@ var ChartOption = function ChartOption() {
235
237
  _data$coord = data.coord,
236
238
  coord = _data$coord === void 0 ? [] : _data$coord;
237
239
  // console.log(param);
238
- return ["{con|\u5F02\u5E38\u68C0\u6D4B\u70B9\uFF1A}", "{con|".concat(moment(Number(coord[0]) || '').format('YYYY/MM/DD HH:mm:ss'), "}"), "{con|\u771F\u5B9E\u503C: ".concat(coord[1] + minValue || '', "}")].join('\n');
240
+ // Translate only plain labels; rich-text braces belong to ECharts, not ICU.
241
+ return ["{con|".concat(anomalyLabel, "}"), "{con|".concat(moment(Number(coord[0]) || '').format('YYYY/MM/DD HH:mm:ss'), "}"), "{con|".concat(realValueLabel, ": ").concat(coord[1] + minValue || '', "}")].join('\n');
239
242
  },
240
243
  rich: {
241
244
  con: {
@@ -257,7 +260,7 @@ var ChartOption = function ChartOption() {
257
260
  // sampling: sampling,
258
261
  }, {
259
262
  animation: true,
260
- name: '预测基线',
263
+ name: intl.get("95b117bb-3f50-4fa0-84ca-2352cc16a353").d("预测基线"),
261
264
  type: 'line',
262
265
  // color: '#3FBF00',
263
266
  symbol: 'circle',
@@ -286,7 +289,7 @@ var ChartOption = function ChartOption() {
286
289
  }
287
290
  }, {
288
291
  animation: true,
289
- name: '上界',
292
+ name: intl.get("24ce035b-1020-49f4-91c0-7d291b97cfb2").d("上界"),
290
293
  type: 'line',
291
294
  // color: '#00c9c3',
292
295
  showSymbol: false,
@@ -302,7 +305,7 @@ var ChartOption = function ChartOption() {
302
305
  // sampling: sampling
303
306
  }, {
304
307
  animation: true,
305
- name: '下界',
308
+ name: intl.get("ecee07fd-fc13-403f-99f3-fe3756c71893").d("下界"),
306
309
  type: 'line',
307
310
  // color: '#17c9b9',
308
311
  showSymbol: false,
@@ -319,7 +322,7 @@ var ChartOption = function ChartOption() {
319
322
  // sampling: sampling
320
323
  }, {
321
324
  animation: true,
322
- name: '预测上界',
325
+ name: intl.get("154fd914-1948-48bb-bd07-b953ae4e54f8").d("预测上界"),
323
326
  type: 'line',
324
327
  // color: '#43C914',
325
328
  showSymbol: false,
@@ -335,7 +338,7 @@ var ChartOption = function ChartOption() {
335
338
  // sampling: sampling
336
339
  }, {
337
340
  animation: true,
338
- name: '预测下界',
341
+ name: intl.get("62138181-9a19-4726-b3ba-0290fd83b0a7").d("预测下界"),
339
342
  type: 'line',
340
343
  // color: '#43C914',
341
344
  showSymbol: false,
@@ -352,7 +355,7 @@ var ChartOption = function ChartOption() {
352
355
  // sampling: sampling
353
356
  }, {
354
357
  animation: true,
355
- name: '基线',
358
+ name: intl.get("2dc543f6-e08c-4197-bff4-46ccdcfae4e7").d("基线"),
356
359
  type: 'line',
357
360
  // color: '#FA8C16',
358
361
  data: [],
@@ -1,6 +1,11 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
1
2
  import _EchartsLine from "@chaoswise/ui/lib/EchartsLine";
3
+ import _useIntl from "@chaoswise/ui/lib/useIntl";
2
4
  var _excluded = ["data", "chartOption"];
3
5
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
6
+ 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; }
7
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
8
+ 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); }
4
9
  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], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
5
10
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
6
11
  import React, { useMemo } from "react";
@@ -12,12 +17,19 @@ import yellow from "./common/images/yellow.svg";
12
17
  import green from "./common/images/green.svg";
13
18
  import lightGreen from "./common/images/lightGreen.svg";
14
19
  var AlgorithmChart = function AlgorithmChart(props) {
20
+ var intl = _useIntl();
15
21
  var _props$data = props.data,
16
22
  data = _props$data === void 0 ? {} : _props$data,
17
23
  chartOption = props.chartOption,
18
24
  rest = _objectWithoutProperties(props, _excluded);
19
25
  var _data = useMemo(function () {
20
- var option = _option();
26
+ var option = _option(intl);
27
+ var labels = {
28
+ upperThreshold: intl.get("ca04a75e-c8d1-48a3-8620-ae7e1a53d32f").d("上阈值界限"),
29
+ lowerThreshold: intl.get("605a8e37-803b-4bdd-9cd4-3f81766c6f90").d("下阈值界限"),
30
+ fittedUpper: intl.get("c0209052-9ae9-4f22-9b2b-e81d4f8b1f62").d("拟合上界"),
31
+ fittedLower: intl.get("18d4e95e-aafa-4c2b-b68f-17b7e06a4ae3").d("拟合下界")
32
+ };
21
33
  var _data$title = data.title,
22
34
  title = _data$title === void 0 ? '' : _data$title,
23
35
  _data$seriesData = data.seriesData,
@@ -111,7 +123,7 @@ var AlgorithmChart = function AlgorithmChart(props) {
111
123
  /*****************添加的上下阈值界限*****************************/
112
124
  if (upperThreshold || [0, '0'].includes(upperThreshold)) {
113
125
  option.series[0].markLine.data[0] = {
114
- name: '上阈值界限',
126
+ name: labels.upperThreshold,
115
127
  yAxis: upperThreshold,
116
128
  minValue: minValue,
117
129
  // type: "median",
@@ -122,7 +134,7 @@ var AlgorithmChart = function AlgorithmChart(props) {
122
134
  }
123
135
  if (lowerThreshold || [0, '0'].includes(lowerThreshold)) {
124
136
  option.series[0].markLine.data[1] = {
125
- name: '下阈值界限',
137
+ name: labels.lowerThreshold,
126
138
  yAxis: lowerThreshold,
127
139
  minValue: minValue,
128
140
  // type: "median",
@@ -147,11 +159,11 @@ var AlgorithmChart = function AlgorithmChart(props) {
147
159
 
148
160
  /******检测的上下界,有无预测值,上下界名称不一样******/
149
161
  if (forecastUpper.length) {
150
- option.series[2].name = '拟合上界';
162
+ option.series[2].name = labels.fittedUpper;
151
163
  }
152
164
  option.series[2].data = upper.length ? upper : fitUpper;
153
165
  if (forecastLower.length) {
154
- option.series[3].name = '拟合下界';
166
+ option.series[3].name = labels.fittedLower;
155
167
  }
156
168
  option.series[3].data = lower.length ? lower : fitLower;
157
169
 
@@ -166,13 +178,13 @@ var AlgorithmChart = function AlgorithmChart(props) {
166
178
  if (!!processedData.length || !!seriesData.length) {
167
179
  //是否显示原始数据按钮
168
180
  legengData.push({
169
- name: '原始数据',
181
+ name: option.series[0].name,
170
182
  icon: blue
171
183
  });
172
184
  }
173
185
  if (forecastBaseline.length) {
174
186
  legengData.push({
175
- name: '预测基线',
187
+ name: option.series[1].name,
176
188
  icon: green
177
189
  });
178
190
  }
@@ -180,40 +192,40 @@ var AlgorithmChart = function AlgorithmChart(props) {
180
192
  if (forecastUpper.length) {
181
193
  if (!!upper.length || !!fitUpper.length) {
182
194
  legengData.push({
183
- name: '拟合上界',
195
+ name: option.series[2].name,
184
196
  icon: lightBlue
185
197
  });
186
198
  }
187
199
  if (!!lower.length || !!fitLower.length) {
188
200
  legengData.push({
189
- name: '拟合下界',
201
+ name: option.series[3].name,
190
202
  icon: lightBlue
191
203
  });
192
204
  }
193
205
  legengData.push({
194
- name: '预测上界',
206
+ name: option.series[4].name,
195
207
  icon: lightGreen
196
208
  });
197
209
  } else if (!!upper.length || !!fitUpper.length) {
198
210
  legengData.push({
199
- name: '上界',
211
+ name: option.series[2].name,
200
212
  icon: lightBlue
201
213
  });
202
214
  }
203
215
  if (forecastLower.length) {
204
216
  legengData.push({
205
- name: '预测下界',
217
+ name: option.series[5].name,
206
218
  icon: lightGreen
207
219
  });
208
220
  } else if (!!lower.length || !!fitLower.length) {
209
221
  legengData.push({
210
- name: '下界',
222
+ name: option.series[3].name,
211
223
  icon: lightBlue
212
224
  });
213
225
  }
214
226
  if (!!baseline.length || !!fitBaseline.length) {
215
227
  legengData.push({
216
- name: '基线',
228
+ name: option.series[6].name,
217
229
  icon: yellow
218
230
  });
219
231
  }
@@ -221,27 +233,18 @@ var AlgorithmChart = function AlgorithmChart(props) {
221
233
  /******************* 动态加载图例 ********************/
222
234
 
223
235
  /**********************默认展示/隐藏哪几条线*************/
224
- var legengSelected = {
225
- '拟合上界': false,
226
- '拟合下界': false,
227
- '预测上界': false,
228
- '预测下界': false,
229
- '上界': !forecastUpper.length,
230
- '下界': !forecastLower.length
231
- };
236
+ var legengSelected = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, option.series[4].name, false), option.series[5].name, false), option.series[2].name, !forecastUpper.length), option.series[3].name, !forecastLower.length);
232
237
  /**********************默认展示/隐藏哪几条线*************/
233
238
 
234
239
  /*****************没有预测值时,默认隐藏基线***********/
235
240
  if (!forecastBaseline.length) {
236
- legengSelected = Object.assign({}, legengSelected, {
237
- '基线': false
238
- });
241
+ legengSelected = Object.assign({}, legengSelected, _defineProperty({}, option.series[6].name, false));
239
242
  }
240
243
  /*****************没有预测值时,默认隐藏基线***********/
241
244
 
242
245
  option.legend.selected = legengSelected;
243
246
  return option;
244
- }, [data]);
247
+ }, [data, intl]);
245
248
  return /*#__PURE__*/React.createElement(_EchartsLine, _extends({
246
249
  option: _data,
247
250
  isMergeOption: false
@@ -44,7 +44,7 @@ var Comment = function Comment(_a) {
44
44
  return /*#__PURE__*/React.createElement("li", {
45
45
  key: "action-".concat(index)
46
46
  }, action) // eslint-disable-line react/no-array-index-key
47
- ;
47
+ ;
48
48
  })) : null;
49
49
  var authorContent = (author || datetime) && /*#__PURE__*/React.createElement("div", {
50
50
  className: "".concat(prefixCls, "-content-author")
@@ -70,7 +70,7 @@ function Item(_ref) {
70
70
  }, [name, children]);
71
71
  if (!name) {
72
72
  if (typeof children !== 'function') {
73
- console.warn('不要使用Form.Item进行非表单组件布局, 布局参考 https://formilyjs.org/#/xbS7SW/rpi9iNs5sD');
73
+ console.warn('不要使用Form.Item进行非表单组件布局, 布局参考 https://formilyjs.org/#/xbS7SW/rpi9iNs5sD'); // cw-i18n-disable-line
74
74
  }
75
75
  return /*#__PURE__*/React.createElement(Fragment, null, renderChildren);
76
76
  }
@@ -1,6 +1,5 @@
1
+ import useIntl from '../useIntl';
1
2
  import React from 'react';
2
- import useLocale from '../useLocale';
3
- import langConfig from './locale';
4
3
  function Nav(_ref) {
5
4
  var customContent = _ref.customContent,
6
5
  showBreadcrumb = _ref.showBreadcrumb,
@@ -10,8 +9,7 @@ function Nav(_ref) {
10
9
  _ref$onClickBack = _ref.onClickBack,
11
10
  onClickBack = _ref$onClickBack === void 0 ? function () {} : _ref$onClickBack,
12
11
  breadCrumb = _ref.breadCrumb;
13
- var _useLocale = useLocale(langConfig),
14
- langObj = _useLocale.langObj;
12
+ var intl = useIntl();
15
13
  if (customContent) {
16
14
  return null;
17
15
  }
@@ -29,7 +27,7 @@ function Nav(_ref) {
29
27
  className: "cw-content-nav-back-btn"
30
28
  }, backIcon), /*#__PURE__*/React.createElement("div", {
31
29
  className: "cw-content-nav-back-title"
32
- }, backNavigationTitle || langObj.back))));
30
+ }, backNavigationTitle || intl.get("26935dff-3710-42be-bf75-175785ea86a1").d("返回")))));
33
31
  }
34
32
  if (showBreadcrumb) {
35
33
  return /*#__PURE__*/React.createElement("div", {
@@ -13,6 +13,8 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
13
13
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
14
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], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
15
15
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
16
+ import useIntl from '../useIntl';
17
+ import useConfigLocale from '../ConfigProvider/useLocale';
16
18
  import React, { useState, useEffect, useRef } from "react";
17
19
  import ReactDOM from "react-dom";
18
20
  import PropTypes from 'prop-types';
@@ -23,9 +25,6 @@ import Sider from './Sider';
23
25
  import Nav from './Nav';
24
26
  import './index.less';
25
27
  import { eventManager } from '../utils';
26
- import useLocale from '../useLocale';
27
- import langConfig from './locale';
28
- import { formatMessage } from "../utils";
29
28
  import useConfigContext from '../useConfigContext';
30
29
  var Content = _Layout.Content,
31
30
  AntHeader = _Layout.Header;
@@ -99,9 +98,9 @@ var BasicLayout = function BasicLayout(_ref) {
99
98
  var _useConfigContext = useConfigContext(),
100
99
  getPrefixCls = _useConfigContext.getPrefixCls;
101
100
  var prefixCls = getPrefixCls('basic-layout');
102
- var _useLocale = useLocale(langConfig),
103
- langObj = _useLocale.langObj,
104
- locale = _useLocale.locale;
101
+ var intl = useIntl();
102
+ var _useConfigLocale = useConfigLocale(),
103
+ locale = _useConfigLocale.locale;
105
104
  var menuData = menuOptions.menuData,
106
105
  _menuOptions$resizabl = menuOptions.resizableProps,
107
106
  _menuOptions$resizabl2 = _menuOptions$resizabl === void 0 ? {} : _menuOptions$resizabl,
@@ -132,9 +131,9 @@ var BasicLayout = function BasicLayout(_ref) {
132
131
  };
133
132
  var defaultSiderWidth = SIDER_WIDTH_MAP[locale] || siderWidth;
134
133
  var _useState9 = useState(defaultSiderWidth),
135
- _useState10 = _slicedToArray(_useState9, 2),
136
- _siderDragWidth = _useState10[0],
137
- _setSiderDragWidth = _useState10[1];
134
+ _useState0 = _slicedToArray(_useState9, 2),
135
+ _siderDragWidth = _useState0[0],
136
+ _setSiderDragWidth = _useState0[1];
138
137
  useEffect(function () {
139
138
  onPassWidth(_siderDragWidth);
140
139
  }, [_siderDragWidth]);
@@ -270,7 +269,7 @@ var BasicLayout = function BasicLayout(_ref) {
270
269
  topNavigationClassName: topNavigationClassName,
271
270
  topNavigationTrigger: topNavigationTrigger,
272
271
  onClickTopNavigation: onClickTopNavigation,
273
- allProductsTitle: allProductsTitle || formatMessage(langObj["allProductsTitle"]),
272
+ allProductsTitle: allProductsTitle || intl.get("ec46c0b7-b38a-4048-af67-6ae0ec477c52").d("所有产品"),
274
273
  localeSwitcherOption: localeSwitcherOption,
275
274
  messageOption: messageOption,
276
275
  documentOption: documentOption,
@@ -5,7 +5,8 @@ import _Spin from "@chaoswise/ui/lib/Spin";
5
5
  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; }
6
6
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
7
7
  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); }
8
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
8
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
9
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
9
10
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
10
11
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
11
12
  function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
@@ -114,21 +115,20 @@ export default function Column(_ref) {
114
115
  });
115
116
  }, [options, checkedSet, fieldNames, halfCheckedSet, loadingKeys, prevValuePath]);
116
117
  var onChange = /*#__PURE__*/function () {
117
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(e) {
118
- return _regeneratorRuntime().wrap(function _callee$(_context) {
119
- while (1) switch (_context.prev = _context.next) {
118
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(e) {
119
+ return _regenerator().w(function (_context) {
120
+ while (1) switch (_context.n) {
120
121
  case 0:
121
122
  setInputValue(e.target.value);
122
123
  setColumnId(scrollColumnId);
123
124
  setColumnLoading(true);
124
125
  setLoadingType("search");
125
- _context.next = 6;
126
+ _context.n = 1;
126
127
  return onInputChange(e, scrollColumnId);
127
- case 6:
128
+ case 1:
128
129
  setColumnLoading(false);
129
- case 7:
130
- case "end":
131
- return _context.stop();
130
+ case 2:
131
+ return _context.a(2);
132
132
  }
133
133
  }, _callee);
134
134
  }));
@@ -144,10 +144,10 @@ export default function Column(_ref) {
144
144
  flex: 1
145
145
  },
146
146
  onScroll: (/*#__PURE__*/function () {
147
- var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
147
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(e) {
148
148
  var isScrollBottom;
149
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
150
- while (1) switch (_context2.prev = _context2.next) {
149
+ return _regenerator().w(function (_context2) {
150
+ while (1) switch (_context2.n) {
151
151
  case 0:
152
152
  isScrollBottom = function _isScrollBottom() {
153
153
  var element = e.target;
@@ -157,18 +157,17 @@ export default function Column(_ref) {
157
157
  setColumnId(scrollColumnId);
158
158
  onScroll(e, scrollColumnId);
159
159
  if (!isScrollBottom()) {
160
- _context2.next = 9;
160
+ _context2.n = 2;
161
161
  break;
162
162
  }
163
163
  setColumnLoading(true);
164
164
  setLoadingType("scroll");
165
- _context2.next = 8;
165
+ _context2.n = 1;
166
166
  return onSrollBottom(e, scrollColumnId);
167
- case 8:
167
+ case 1:
168
168
  setColumnLoading(false);
169
- case 9:
170
- case "end":
171
- return _context2.stop();
169
+ case 2:
170
+ return _context2.a(2);
172
171
  }
173
172
  }, _callee2);
174
173
  }));
@@ -1,8 +1,8 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
2
  import "@chaoswise/ui/lib/Button/index.less";
3
3
  import _Button from "@chaoswise/ui/lib/Button";
4
- import _useLocale2 from "@chaoswise/ui/lib/useLocale";
5
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
4
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
5
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
6
6
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
7
7
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
8
8
  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; }
@@ -10,11 +10,11 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
10
10
  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); }
11
11
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
12
12
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
13
+ import useIntl from '../../../useIntl';
14
+ import useConfigLocale from '../../../ConfigProvider/useLocale';
13
15
  import React from "react";
14
16
  import moment from "moment";
15
17
  import { readInnerMessageApi } from "../../service";
16
- import langConfig from "../../locale";
17
- import { formatMessage } from "../../../utils";
18
18
  import "./index.less";
19
19
  var TabList = function TabList(props) {
20
20
  var _props$messages = props.messages,
@@ -31,8 +31,9 @@ var TabList = function TabList(props) {
31
31
  code = props.code,
32
32
  onTabListAllRead = props.onTabListAllRead,
33
33
  renderMessageDateFormat = props.renderMessageDateFormat;
34
- var _useLocale = _useLocale2(langConfig),
35
- localeObj = _useLocale.langObj;
34
+ var intl = useIntl();
35
+ var _useConfigLocale = useConfigLocale(),
36
+ locale = _useConfigLocale.locale;
36
37
  var _readInnerMessageApi = requestOption.readInnerMessageApi;
37
38
  var onHandleMessage = function onHandleMessage(message) {
38
39
  var userMessageId = message.userMessageId,
@@ -59,16 +60,18 @@ var TabList = function TabList(props) {
59
60
  }
60
61
  };
61
62
  var readInnerMessage = /*#__PURE__*/function () {
62
- var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
63
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(params) {
63
64
  var resRequestApi, res, _params;
64
- return _regeneratorRuntime().wrap(function _callee$(_context) {
65
- while (1) switch (_context.prev = _context.next) {
65
+ return _regenerator().w(function (_context) {
66
+ while (1) switch (_context.n) {
66
67
  case 0:
67
- resRequestApi = _readInnerMessageApi || readInnerMessageApi;
68
- _context.next = 3;
68
+ resRequestApi = _readInnerMessageApi || function (params, gateway) {
69
+ return readInnerMessageApi(params, gateway, locale);
70
+ };
71
+ _context.n = 1;
69
72
  return resRequestApi(params, gatewayPrefix);
70
- case 3:
71
- res = _context.sent;
73
+ case 1:
74
+ res = _context.v;
72
75
  if (res.status == "success") {
73
76
  _params = {};
74
77
  if (pageInfo.current > 1 && messages.length === 1) {
@@ -84,9 +87,8 @@ var TabList = function TabList(props) {
84
87
  getMessageList(_params);
85
88
  getMessageUnreadCount();
86
89
  }
87
- case 5:
88
- case "end":
89
- return _context.stop();
90
+ case 2:
91
+ return _context.a(2);
90
92
  }
91
93
  }, _callee);
92
94
  }));
@@ -113,6 +115,6 @@ var TabList = function TabList(props) {
113
115
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Button, {
114
116
  className: "cw-message-content-all-read",
115
117
  onClick: onHandleReadAllMessage
116
- }, formatMessage(localeObj["markAllRead"])), messageList);
118
+ }, intl.get("687e715c-51a9-42b7-906e-ddc011056d60").d("全部已读")), messageList);
117
119
  };
118
120
  export default TabList;