@chaoswise/ui 3.1.16 → 3.1.17

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 (57) hide show
  1. package/lib/Antd5/_util/isNumeric.js +4 -0
  2. package/lib/Antd5/avatar/group.js +121 -0
  3. package/lib/Antd5/button/LoadingIcon.js +82 -0
  4. package/lib/Antd5/pagination/Select.js +24 -0
  5. package/lib/BasicLayout/locale/en_US.js +4 -0
  6. package/lib/BasicLayout/locale/index.js +11 -0
  7. package/lib/BasicLayout/locale/zh_CN.js +4 -0
  8. package/lib/BasicLayout/locale/zh_TW.js +4 -0
  9. package/lib/CWColorPicker/index.js +44 -44
  10. package/lib/CWMessage/MessageContent/TabList/index.js +13 -13
  11. package/lib/CWMessage/MessageContent/index.js +24 -24
  12. package/lib/CWRangePicker/DropdownMenu/MoreHistoryList/index.js +7 -7
  13. package/lib/CWRangePicker/DropdownMenu/MoreTimeList/index.js +14 -14
  14. package/lib/CWRangePicker/DropdownMenu/index.js +34 -34
  15. package/lib/CWRangePicker/Refresh/index.js +12 -12
  16. package/lib/CWRangePicker/TimeSpan/index.js +14 -14
  17. package/lib/CWRangePicker/index.js +56 -56
  18. package/lib/CWRangePicker/utils/generate/dayjs.js +110 -93
  19. package/lib/CWRangePicker/utils/generate/moment.js +99 -82
  20. package/lib/CWTable/assets/DownGraySvg.js +16 -0
  21. package/lib/CWTable/assets/DownLightSvg.js +16 -0
  22. package/lib/CWTable/assets/SortSvg.js +16 -0
  23. package/lib/CWTable/assets/SortingSvg.js +16 -0
  24. package/lib/CWTable/assets/UpGraySvg.js +15 -0
  25. package/lib/CWTable/assets/UpLightSvg.js +15 -0
  26. package/lib/CWTree/locale/en_US.js +3 -0
  27. package/lib/CWTree/locale/index.js +11 -0
  28. package/lib/CWTree/locale/zh_CN.js +3 -0
  29. package/lib/CWTree/locale/zh_TW.js +3 -0
  30. package/lib/ConfigProvider/ConfigProvider.js +6 -0
  31. package/lib/ConfigProvider/generate/dayjs.js +4 -0
  32. package/lib/Empty/index.js +10 -10
  33. package/lib/ErrorBoundary/ErrorPage.js +10 -10
  34. package/lib/Exception/index.js +22 -22
  35. package/lib/FilterDropDown/index.js +19 -19
  36. package/lib/Header/Document/index.js +5 -5
  37. package/lib/IconSelect/components/CustomImg/index.js +10 -10
  38. package/lib/IconSelect/components/SearchIcon/index.js +8 -8
  39. package/lib/IconSelect/index.js +16 -16
  40. package/lib/Joyride/List.js +11 -11
  41. package/lib/Joyride/index.js +55 -55
  42. package/lib/Pagination/index.js +34 -34
  43. package/lib/QuickTransfer/DragList.js +15 -15
  44. package/lib/QuickTransfer/index.js +59 -59
  45. package/lib/RangePicker/components/ExtraTimeFooter.js +1 -1
  46. package/lib/SearchBar/index.js +40 -40
  47. package/lib/TimeRangeSlider/Refresh/index.js +11 -11
  48. package/lib/TimeRangeSlider/TimeSpan/index.js +13 -13
  49. package/lib/TimeRangeSlider/index.js +32 -32
  50. package/lib/TimeRangeSlider/utils/generate/moment.js +106 -89
  51. package/lib/locales/en_US.json +1 -86
  52. package/lib/locales/index.js +11 -0
  53. package/lib/locales/ja_JP.json +1 -0
  54. package/lib/locales/zh_CN.json +1 -86
  55. package/lib/locales/zh_TW.json +1 -86
  56. package/package.json +2 -1
  57. /package/lib/Antd5/avatar/{Avatar.js → avatar.js} +0 -0
@@ -11,10 +11,10 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
11
11
  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; }
12
12
  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; } }
13
13
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
14
- import originalDayjs from "dayjs";
15
- import duration from "dayjs/plugin/duration";
16
- import utc from "dayjs/plugin/utc";
17
- import timezone from "dayjs/plugin/timezone";
14
+ import originalDayjs from 'dayjs';
15
+ import duration from 'dayjs/plugin/duration';
16
+ import utc from 'dayjs/plugin/utc';
17
+ import timezone from 'dayjs/plugin/timezone';
18
18
  import { v4 as uuidv4 } from 'uuid';
19
19
  originalDayjs.extend(duration);
20
20
  // 扩展 dayjs 支持时区
@@ -29,58 +29,64 @@ var dayjs = function dayjs() {
29
29
  // 枚举时间单位
30
30
  var ENUM_TimeUnit = {
31
31
  s: {
32
- zh_CN: "秒",
32
+ zh_CN: '秒',
33
33
  en_US: {
34
- singular: "Second",
35
- plural: "Seconds"
34
+ singular: 'Second',
35
+ plural: 'Seconds'
36
36
  },
37
- zh_TW: "秒",
38
- unit: "seconds"
37
+ zh_TW: '秒',
38
+ ja_JP: '秒',
39
+ unit: 'seconds'
39
40
  },
40
41
  m: {
41
- zh_CN: "分钟",
42
+ zh_CN: '分钟',
42
43
  en_US: {
43
- singular: "Minute",
44
- plural: "Minutes"
44
+ singular: 'Minute',
45
+ plural: 'Minutes'
45
46
  },
46
- zh_TW: "分鐘",
47
- unit: "minutes"
47
+ zh_TW: '分鐘',
48
+ ja_JP: '分',
49
+ unit: 'minutes'
48
50
  },
49
51
  h: {
50
- zh_CN: "小时",
52
+ zh_CN: '小时',
51
53
  en_US: {
52
- singular: "Hour",
53
- plural: "Hours"
54
+ singular: 'Hour',
55
+ plural: 'Hours'
54
56
  },
55
- zh_TW: "小時",
56
- unit: "hours"
57
+ zh_TW: '小時',
58
+ ja_JP: '時間',
59
+ unit: 'hours'
57
60
  },
58
61
  d: {
59
- zh_CN: "天",
62
+ zh_CN: '天',
60
63
  en_US: {
61
- singular: "Day",
62
- plural: "Days"
64
+ singular: 'Day',
65
+ plural: 'Days'
63
66
  },
64
- zh_TW: "天",
65
- unit: "days"
67
+ zh_TW: '天',
68
+ ja_JP: '日',
69
+ unit: 'days'
66
70
  },
67
71
  mo: {
68
- zh_CN: "月",
72
+ zh_CN: '月',
69
73
  en_US: {
70
- singular: "Month",
71
- plural: "Months"
74
+ singular: 'Month',
75
+ plural: 'Months'
72
76
  },
73
- zh_TW: "月",
74
- unit: "mo"
77
+ zh_TW: '月',
78
+ ja_JP: 'ヶ月',
79
+ unit: 'mo'
75
80
  },
76
81
  y: {
77
- zh_CN: "年",
82
+ zh_CN: '年',
78
83
  en_US: {
79
- singular: "Year",
80
- plural: "Years"
84
+ singular: 'Year',
85
+ plural: 'Years'
81
86
  },
82
- zh_TW: "年",
83
- unit: "years"
87
+ zh_TW: '年',
88
+ ja_JP: '年',
89
+ unit: 'years'
84
90
  }
85
91
  };
86
92
 
@@ -102,7 +108,7 @@ export var regroupDataSourceFn = function regroupDataSourceFn(dataSource) {
102
108
  if (Object.keys(EnumTimeTypeData).includes(item.type)) {
103
109
  EnumTimeTypeData[item.type].push(item);
104
110
  } else {
105
- EnumTimeTypeData["other"].push(item);
111
+ EnumTimeTypeData['other'].push(item);
106
112
  }
107
113
  });
108
114
  Object.entries(EnumTimeTypeData).forEach(function (item) {
@@ -143,10 +149,10 @@ export var getUnit = function getUnit(unit) {
143
149
  export var judgeType = function judgeType(recordDateValue) {
144
150
  var key = recordDateValue.key,
145
151
  _recordDateValue$time = recordDateValue.timeDomain,
146
- timeDomain = _recordDateValue$time === void 0 ? "" : _recordDateValue$time;
152
+ timeDomain = _recordDateValue$time === void 0 ? '' : _recordDateValue$time;
147
153
  var isRule = false;
148
154
  var captureUnit = [];
149
- var recordUnit = "";
155
+ var recordUnit = '';
150
156
  var _getUnit = getUnit(key),
151
157
  _isRule = _getUnit.isRule,
152
158
  _captureUnit = _getUnit.captureUnit;
@@ -169,14 +175,14 @@ export var judgeType = function judgeType(recordDateValue) {
169
175
  export var echoRecentlyTimeTitle = function echoRecentlyTimeTitle(locale, captureUnit) {
170
176
  // 参数验证
171
177
  if (!captureUnit || !Array.isArray(captureUnit) || captureUnit.length < 2) {
172
- return "";
178
+ return '';
173
179
  }
174
180
  var _captureUnit3 = _slicedToArray(captureUnit, 2),
175
181
  count = _captureUnit3[0],
176
182
  unit = _captureUnit3[1];
177
183
  var timeUnit = ENUM_TimeUnit[unit];
178
184
  if (!timeUnit) {
179
- return "";
185
+ return '';
180
186
  }
181
187
  var countNum = parseInt(count, 10);
182
188
 
@@ -184,7 +190,7 @@ export var echoRecentlyTimeTitle = function echoRecentlyTimeTitle(locale, captur
184
190
  var localeConfig = {
185
191
  zh_CN: {
186
192
  template: function template(count, unitText) {
187
- return "\u6700\u8FD1".concat(count).concat(unit === "mo" ? "个" : "").concat(unitText);
193
+ return "\u6700\u8FD1".concat(count).concat(unit === 'mo' ? '个' : '').concat(unitText);
188
194
  },
189
195
  getUnitText: function getUnitText() {
190
196
  return timeUnit.zh_CN;
@@ -192,7 +198,7 @@ export var echoRecentlyTimeTitle = function echoRecentlyTimeTitle(locale, captur
192
198
  },
193
199
  zh: {
194
200
  template: function template(count, unitText) {
195
- return "\u6700\u8FD1".concat(count).concat(unit === "mo" ? "个" : "").concat(unitText);
201
+ return "\u6700\u8FD1".concat(count).concat(unit === 'mo' ? '个' : '').concat(unitText);
196
202
  },
197
203
  getUnitText: function getUnitText() {
198
204
  return timeUnit.zh_CN;
@@ -200,12 +206,20 @@ export var echoRecentlyTimeTitle = function echoRecentlyTimeTitle(locale, captur
200
206
  },
201
207
  zh_TW: {
202
208
  template: function template(count, unitText) {
203
- return "\u6700\u8FD1".concat(count).concat(unit === "mo" ? "個" : "").concat(unitText);
209
+ return "\u6700\u8FD1".concat(count).concat(unit === 'mo' ? '個' : '').concat(unitText);
204
210
  },
205
211
  getUnitText: function getUnitText() {
206
212
  return timeUnit.zh_TW;
207
213
  }
208
214
  },
215
+ ja_JP: {
216
+ template: function template(count, unitText) {
217
+ return "\u904E\u53BB".concat(count).concat(unitText);
218
+ },
219
+ getUnitText: function getUnitText() {
220
+ return timeUnit.ja_JP;
221
+ }
222
+ },
209
223
  "default": {
210
224
  template: function template(count, unitText) {
211
225
  return "Past ".concat(count, " ").concat(unitText);
@@ -234,8 +248,8 @@ export var echoAbsoluteTimeTitle = function echoAbsoluteTimeTitle(value, format)
234
248
  export var echoInputValue = function echoInputValue() {
235
249
  var recordDateValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
236
250
  var isFoucs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
237
- var locale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "zh_CN";
238
- var format = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "YYYY/MM/DD HH:mm:ss";
251
+ var locale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'zh_CN';
252
+ var format = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'YYYY/MM/DD HH:mm:ss';
239
253
  var forceRenderTitle = arguments.length > 4 ? arguments[4] : undefined;
240
254
  var isAutoRefresh = arguments.length > 5 ? arguments[5] : undefined;
241
255
  var timeSpanBoundary = arguments.length > 6 ? arguments[6] : undefined;
@@ -259,9 +273,9 @@ export var echoInputValue = function echoInputValue() {
259
273
  if (Array.isArray(value) && (_value2 = value) !== null && _value2 !== void 0 && _value2.length) {
260
274
  return echoAbsoluteTimeTitle(value, format, true, timeSpanBoundary);
261
275
  }
262
- return "";
276
+ return '';
263
277
  }
264
- if (!isRule && !values) return title || "Live Tail";
278
+ if (!isRule && !values) return title || 'Live Tail';
265
279
  if (isAutoRefresh) {
266
280
  var _value3;
267
281
  if (isRule) {
@@ -289,7 +303,7 @@ export var echoInputValue = function echoInputValue() {
289
303
 
290
304
  // 计算两个moment日期的时间差(时间戳)
291
305
  export var computeTimeDiff = function computeTimeDiff(value) {
292
- var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "ms";
306
+ var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'ms';
293
307
  return value[1].diff(value[0], unit);
294
308
  };
295
309
  export var getYears = function getYears(seconds) {
@@ -300,11 +314,11 @@ export var getYears = function getYears(seconds) {
300
314
  // 计算输入框时间跨度
301
315
  export var computeTimeSpan = function computeTimeSpan(value, timeSpanBoundary) {
302
316
  // 当前传入日期的时间
303
- var timeDiff = computeTimeDiff(value, "s");
317
+ var timeDiff = computeTimeDiff(value, 's');
304
318
  if (timeDiff >= 60) {
305
319
  timeDiff = Number(timeDiff + 1);
306
320
  }
307
- var duration = originalDayjs.duration(timeDiff, "s");
321
+ var duration = originalDayjs.duration(timeDiff, 's');
308
322
  var _duration$$d = duration.$d,
309
323
  years = _duration$$d.years,
310
324
  months = _duration$$d.months,
@@ -324,7 +338,7 @@ export var computeTimeSpan = function computeTimeSpan(value, timeSpanBoundary) {
324
338
  if (hours) return "".concat(hours, "h");
325
339
  if (minutes) return "".concat(minutes, "m");
326
340
  if (seconds) return "".concat(seconds, "s");
327
- return "";
341
+ return '';
328
342
  };
329
343
 
330
344
  /**
@@ -340,7 +354,7 @@ export var getTimeSpanFromValue = function getTimeSpanFromValue(value, timeSpanB
340
354
  value: value,
341
355
  timeDomain: timeDomain,
342
356
  number: captureUnit[0],
343
- unit: captureUnit[1] === "mo" ? "M" : captureUnit[1]
357
+ unit: captureUnit[1] === 'mo' ? 'M' : captureUnit[1]
344
358
  };
345
359
  };
346
360
 
@@ -367,10 +381,10 @@ export var cloneChangeDate = function cloneChangeDate(currentDate_0, currentDate
367
381
  var cloneCurrentDate_1 = currentDate_1.clone();
368
382
  // 是否切换到最近时间
369
383
  var switchInitial = false;
370
- if (direction == "left") {
384
+ if (direction == 'left') {
371
385
  cloneCurrentDate_0 = cloneCurrentDate_0.subtract(duration);
372
386
  cloneCurrentDate_1 = cloneCurrentDate_1.subtract(duration);
373
- } else if (direction == "right") {
387
+ } else if (direction == 'right') {
374
388
  cloneCurrentDate_0 = cloneCurrentDate_0.add(duration);
375
389
  cloneCurrentDate_1 = cloneCurrentDate_1.add(duration);
376
390
  // 计算最大值的时间差
@@ -392,36 +406,36 @@ export var cloneChangeDate = function cloneChangeDate(currentDate_0, currentDate
392
406
  if (_maxTimeDiff <= 0) {
393
407
  // 当前时间已经是极限了
394
408
  // 已经是极限直接当前时间向前推进timeSpanBoundary即可
395
- cloneCurrentDate_0 = dayjs().subtract(originalDayjs.duration(timeSpanBoundary, "s"));
409
+ cloneCurrentDate_0 = dayjs().subtract(originalDayjs.duration(timeSpanBoundary, 's'));
396
410
  cloneCurrentDate_1 = dayjs();
397
411
  switchInitial = true;
398
412
  } else {
399
413
  var clone0 = currentDate_0.clone();
400
414
  var clone1 = currentDate_1.clone();
401
- var initialTimeDiff = computeTimeDiff([clone0, clone1], "s");
415
+ var initialTimeDiff = computeTimeDiff([clone0, clone1], 's');
402
416
  if (timeSpanBoundary > initialTimeDiff) {
403
417
  var needChangeTimeDiff = Math.ceil(timeSpanBoundary - initialTimeDiff) / 2;
404
- cloneCurrentDate_0 = clone0.subtract(originalDayjs.duration(needChangeTimeDiff, "s"));
405
- cloneCurrentDate_1 = clone1.add(originalDayjs.duration(needChangeTimeDiff, "s"));
418
+ cloneCurrentDate_0 = clone0.subtract(originalDayjs.duration(needChangeTimeDiff, 's'));
419
+ cloneCurrentDate_1 = clone1.add(originalDayjs.duration(needChangeTimeDiff, 's'));
406
420
  // 计算最大值的时间差
407
421
  var _maxTimeDiff2 = computeTimeDiff([cloneCurrentDate_1, dayjs()]);
408
422
  if (_maxTimeDiff2 <= 0) {
409
423
  // 当前时间已经是极限了
410
424
  // 已经是极限直接当前时间向前推进timeSpanBoundary即可
411
- cloneCurrentDate_0 = dayjs().subtract(originalDayjs.duration(timeSpanBoundary, "s"));
425
+ cloneCurrentDate_0 = dayjs().subtract(originalDayjs.duration(timeSpanBoundary, 's'));
412
426
  cloneCurrentDate_1 = dayjs();
413
427
  switchInitial = true;
414
428
  }
415
429
  } else {
416
- cloneCurrentDate_1 = clone1.add(originalDayjs.duration(timeSpanBoundary, "s"));
430
+ cloneCurrentDate_1 = clone1.add(originalDayjs.duration(timeSpanBoundary, 's'));
417
431
  var clone = cloneCurrentDate_1.clone();
418
- cloneCurrentDate_0 = clone.subtract(originalDayjs.duration(timeSpanBoundary, "s"));
432
+ cloneCurrentDate_0 = clone.subtract(originalDayjs.duration(timeSpanBoundary, 's'));
419
433
  // 计算最大值的时间差
420
434
  var _maxTimeDiff3 = computeTimeDiff([cloneCurrentDate_1, dayjs()]);
421
435
  if (_maxTimeDiff3 <= 0) {
422
436
  // 当前时间已经是极限了
423
437
  // 已经是极限直接当前时间向前推进timeSpanBoundary即可
424
- cloneCurrentDate_0 = dayjs().subtract(originalDayjs.duration(timeSpanBoundary, "s"));
438
+ cloneCurrentDate_0 = dayjs().subtract(originalDayjs.duration(timeSpanBoundary, 's'));
425
439
  cloneCurrentDate_1 = dayjs();
426
440
  switchInitial = true;
427
441
  }
@@ -451,8 +465,8 @@ export var cloneChangeDate = function cloneChangeDate(currentDate_0, currentDate
451
465
  */
452
466
  export var getChangeUnitDate = function getChangeUnitDate(unitFigure, unit) {
453
467
  var value = [dayjs().subtract(unitFigure, unit), dayjs()];
454
- if (unit === "mo") {
455
- value[0] = dayjs().subtract(unitFigure * 31, "d");
468
+ if (unit === 'mo') {
469
+ value[0] = dayjs().subtract(unitFigure * 31, 'd');
456
470
  }
457
471
  return value;
458
472
  };
@@ -501,7 +515,7 @@ export var getChangeDate = function getChangeDate(recordDateValue, direction) {
501
515
  };
502
516
  };
503
517
  export var isInvalidDate = function isInvalidDate(value) {
504
- return dayjs(value[0]).toDate() == "Invalid Date" || dayjs(value[1]).toDate() == "Invalid Date" || !computeTimeDiff(value);
518
+ return dayjs(value[0]).toDate() == 'Invalid Date' || dayjs(value[1]).toDate() == 'Invalid Date' || !computeTimeDiff(value);
505
519
  };
506
520
 
507
521
  // 符合禁用规则的时间集合
@@ -516,7 +530,7 @@ export function range(start, end) {
516
530
  // 判断value值是否是函数形式,并将函数形式执行之后转化为数组形式的value值
517
531
  export var funcValueChangeArrayValue = function funcValueChangeArrayValue(value) {
518
532
  if (!value) return;
519
- var isFunc = Object.prototype.toString.call(value) == "[object Function]";
533
+ var isFunc = Object.prototype.toString.call(value) == '[object Function]';
520
534
  var finalValue = value;
521
535
  if (isFunc) {
522
536
  finalValue = [value()[0], value()[1]];
@@ -526,7 +540,7 @@ export var funcValueChangeArrayValue = function funcValueChangeArrayValue(value)
526
540
 
527
541
  // 判断是否为最近时间规则,并返回矫正之后的value值
528
542
  export var getCorrectValue = function getCorrectValue(value) {
529
- var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
543
+ var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
530
544
  var _getUnit5 = getUnit(key),
531
545
  isRule = _getUnit5.isRule,
532
546
  captureUnit = _getUnit5.captureUnit;
@@ -537,7 +551,7 @@ export var getCorrectValue = function getCorrectValue(value) {
537
551
  returnValue = _objectSpread(_objectSpread({}, returnValue), {}, {
538
552
  timeDomain: key,
539
553
  number: captureUnit[0],
540
- unit: captureUnit[1] === "mo" ? "M" : captureUnit[1],
554
+ unit: captureUnit[1] === 'mo' ? 'M' : captureUnit[1],
541
555
  isRecently: true
542
556
  });
543
557
  if (!returnValue.value) {
@@ -564,7 +578,7 @@ export var getHistoryInfo = function getHistoryInfo(recordValue, historyList, _r
564
578
  var key = recordValue.key,
565
579
  value = recordValue.value,
566
580
  _recordValue$title = recordValue.title,
567
- title = _recordValue$title === void 0 ? "" : _recordValue$title;
581
+ title = _recordValue$title === void 0 ? '' : _recordValue$title;
568
582
  var _judgeType3 = judgeType(recordValue),
569
583
  _judgeType4 = _slicedToArray(_judgeType3, 2),
570
584
  isRule = _judgeType4[0],
@@ -580,7 +594,7 @@ export var getHistoryInfo = function getHistoryInfo(recordValue, historyList, _r
580
594
  }
581
595
  }
582
596
  if (!values && !isRule && !_title) {
583
- _title = intl.get("bbf8ccde-ab7c-4040-97eb-35b56742de27").d("未转化标题");
597
+ _title = intl.get('bbf8ccde-ab7c-4040-97eb-35b56742de27').d('未转化标题');
584
598
  }
585
599
  var isRepeat = Boolean(historyList.find(function (item) {
586
600
  return item.key === key || item.title === _title;
@@ -593,11 +607,14 @@ export var getHistoryInfo = function getHistoryInfo(recordValue, historyList, _r
593
607
  };
594
608
 
595
609
  // ----------------------------------时间输入绝对时间----------------------------------
596
- var FORMATS = ["YYYY/MM/DD HH:mm:ss", "YYYY/M/D H:m:s", "YYYY/MM/DD HH:mm", "YYYY/M/D H:m", "MM/DD HH:mm:ss", "M/D H:m:s", "MM/DD HH:mm", "M/D H:m", "YYYY/MM/DD", "YYYY/M/D", "MM/DD", "M/D", "HH:mm:ss", "H:m:s", "HH:mm", "H:m", "X"];
610
+ var FORMATS = ['YYYY/MM/DD HH:mm:ss', 'YYYY/M/D H:m:s', 'YYYY/MM/DD HH:mm', 'YYYY/M/D H:m', 'MM/DD HH:mm:ss', 'M/D H:m:s', 'MM/DD HH:mm', 'M/D H:m', 'YYYY/MM/DD', 'YYYY/M/D', 'MM/DD', 'M/D', 'HH:mm:ss', 'H:m:s', 'HH:mm', 'H:m', 'X'];
611
+
597
612
  // 不需要二次操作
598
- var NOT_CHANGE_FORMATS = ["YYYY/MM/DD HH:mm:ss", "YYYY/M/D H:m:s", "YYYY/MM/DD HH:mm", "YYYY/M/D H:m", "MM/DD HH:mm:ss", "M/D H:m:s", "MM/DD HH:mm", "M/D H:m", "X"];
613
+ var NOT_CHANGE_FORMATS = ['YYYY/MM/DD HH:mm:ss', 'YYYY/M/D H:m:s', 'YYYY/MM/DD HH:mm', 'YYYY/M/D H:m', 'MM/DD HH:mm:ss', 'M/D H:m:s', 'MM/DD HH:mm', 'M/D H:m', 'X'];
614
+
599
615
  // 需要二次操作
600
- var NEED_CHANGE_FORMATS = ["YYYY/MM/DD", "YYYY/M/D", "MM/DD", "M/D", "HH:mm:ss", "H:m:s", "HH:mm", "H:m"];
616
+ var NEED_CHANGE_FORMATS = ['YYYY/MM/DD', 'YYYY/M/D', 'MM/DD', 'M/D', 'HH:mm:ss', 'H:m:s', 'HH:mm', 'H:m'];
617
+
601
618
  // 判断数组中有几个真值
602
619
  export var getTruthDateCount = function getTruthDateCount(dateArray) {
603
620
  var truthDate = dateArray.filter(Boolean);
@@ -635,10 +652,10 @@ var getFormatParseDate = function getFormatParseDate() {
635
652
  cloneEndDate = null;
636
653
  }
637
654
  } else if (NEED_CHANGE_FORMATS.slice(0, 4).includes(format)) {
638
- cloneEndDate = cloneEndDate.set("hour", 23).set("minute", 59).set("second", 59);
655
+ cloneEndDate = cloneEndDate.set('hour', 23).set('minute', 59).set('second', 59);
639
656
  if (isAfterDate(cloneEndDate, cloneStartDate)) {
640
657
  if (!isAfterCurrentDate(cloneStartDate, cloneEndDate)) {
641
- if (cloneEndDate.isSame(dayjs(), "day")) {
658
+ if (cloneEndDate.isSame(dayjs(), 'day')) {
642
659
  cloneEndDate = dayjs();
643
660
  } else {
644
661
  cloneStartDate = null;
@@ -652,8 +669,8 @@ var getFormatParseDate = function getFormatParseDate() {
652
669
  } else if (NEED_CHANGE_FORMATS.slice(4).includes(format)) {
653
670
  if (isAfterDate(cloneEndDate, cloneStartDate)) {
654
671
  if (!isAfterCurrentDate(cloneStartDate, cloneEndDate)) {
655
- cloneStartDate = cloneStartDate.subtract(1, "days");
656
- cloneEndDate = cloneEndDate.subtract(1, "days");
672
+ cloneStartDate = cloneStartDate.subtract(1, 'days');
673
+ cloneEndDate = cloneEndDate.subtract(1, 'days');
657
674
  }
658
675
  } else {
659
676
  cloneStartDate = null;
@@ -670,10 +687,10 @@ var getFormatParseDate = function getFormatParseDate() {
670
687
  _endDate = _date2[0];
671
688
  var _cloneStartDate = null;
672
689
  var _cloneEndDate = null;
673
- if (format !== "X") {
690
+ if (format !== 'X') {
674
691
  _cloneStartDate = _endDate.clone();
675
692
  _cloneEndDate = _endDate.clone();
676
- _cloneStartDate = _cloneStartDate.set("hour", 0).set("minute", 0).set("second", 0);
693
+ _cloneStartDate = _cloneStartDate.set('hour', 0).set('minute', 0).set('second', 0);
677
694
  if (NOT_CHANGE_FORMATS.includes(format)) {
678
695
  if (!isAfterCurrentDate(_cloneStartDate, _cloneEndDate, true)) {
679
696
  _cloneStartDate = null;
@@ -681,9 +698,9 @@ var getFormatParseDate = function getFormatParseDate() {
681
698
  }
682
699
  }
683
700
  if (NEED_CHANGE_FORMATS.slice(0, 4).includes(format)) {
684
- _cloneEndDate = _cloneEndDate.set("hour", 23).set("minute", 59).set("second", 59);
701
+ _cloneEndDate = _cloneEndDate.set('hour', 23).set('minute', 59).set('second', 59);
685
702
  if (!isAfterCurrentDate(_cloneStartDate, _cloneEndDate, true)) {
686
- if (_cloneEndDate.isSame(dayjs(), "day")) {
703
+ if (_cloneEndDate.isSame(dayjs(), 'day')) {
687
704
  _cloneEndDate = dayjs();
688
705
  } else {
689
706
  _cloneStartDate = null;
@@ -693,8 +710,8 @@ var getFormatParseDate = function getFormatParseDate() {
693
710
  }
694
711
  if (NEED_CHANGE_FORMATS.slice(4).includes(format)) {
695
712
  if (!isAfterCurrentDate(_cloneStartDate, _cloneEndDate, true)) {
696
- _cloneStartDate = _cloneStartDate.subtract(1, "days");
697
- _cloneEndDate = _cloneEndDate.subtract(1, "days");
713
+ _cloneStartDate = _cloneStartDate.subtract(1, 'days');
714
+ _cloneEndDate = _cloneEndDate.subtract(1, 'days');
698
715
  }
699
716
  }
700
717
  }
@@ -707,17 +724,17 @@ var getFormatParseDate = function getFormatParseDate() {
707
724
  // 转换输入日期并返回符合规则的日期和format格式
708
725
  var parseInputDate = function parseInputDate(text) {
709
726
  var finalDate = null;
710
- var finalFormat = "";
727
+ var finalFormat = '';
711
728
  for (var i = 0; i < FORMATS.length; i += 1) {
712
729
  var format = FORMATS[i];
713
730
  var date = originalDayjs(text, format, true).tz(timeZone, true); // tz参数设置为undefined:使用设置后的全局时区, true:2023-01-01 02:02:02 切换到对应时区仍然是 2023-01-01 02:02:02
714
731
  if (date.isValid()) {
715
732
  finalDate = date;
716
733
  finalFormat = format;
717
- if (format === "X") {
734
+ if (format === 'X') {
718
735
  if (text.length !== 10) {
719
736
  finalDate = null;
720
- finalFormat = "";
737
+ finalFormat = '';
721
738
  }
722
739
  }
723
740
  return {
@@ -732,7 +749,7 @@ var parseInputDate = function parseInputDate(text) {
732
749
  };
733
750
  };
734
751
  function getCharCount(str, _char) {
735
- var regex = new RegExp(_char, "g");
752
+ var regex = new RegExp(_char, 'g');
736
753
  var result = str.match(regex);
737
754
  var count = !result ? 0 : result.length;
738
755
  return count;
@@ -740,13 +757,13 @@ function getCharCount(str, _char) {
740
757
  function getCheckableDateInfo(inputStr) {
741
758
  // 替换时间跨度为空字符串
742
759
  // "[21mo] 2023/03/01 00:00:00 - 2023/03/22 10:38:00"-》2023/03/01 00:00:00 - 2023/03/22 10:38:00
743
- var deleteSpanStr = inputStr.replace(/^\[[1-9][0-9]*([s|m|h|d|y]|mo)\]\s/, "");
760
+ var deleteSpanStr = inputStr.replace(/^\[[1-9][0-9]*([s|m|h|d|y]|mo)\]\s/, '');
744
761
  var dateArray = [];
745
- var count = getCharCount(deleteSpanStr, "-");
762
+ var count = getCharCount(deleteSpanStr, '-');
746
763
  if (count === 1) {
747
- dateArray = deleteSpanStr.split("-");
748
- dateArray[0] = dateArray[0].replace(/\s$/, "");
749
- dateArray[1] = dateArray[1].replace(/^\s/, "");
764
+ dateArray = deleteSpanStr.split('-');
765
+ dateArray[0] = dateArray[0].replace(/\s$/, '');
766
+ dateArray[1] = dateArray[1].replace(/^\s/, '');
750
767
  } else {
751
768
  dateArray = [deleteSpanStr];
752
769
  }
@@ -757,7 +774,7 @@ export function getFinalDateOption(inputStr) {
757
774
  var dateArray = getCheckableDateInfo(inputStr);
758
775
  var finalDateOption = {
759
776
  dateValue: [null, null],
760
- format: ""
777
+ format: ''
761
778
  };
762
779
  if (dateArray.length === 2) {
763
780
  // ['2023/03/01 00:00:00', '2023/03/22 10:38:00']
@@ -793,6 +810,6 @@ export function getFinalDateOption(inputStr) {
793
810
  * 是否超过了最大的时间跨度
794
811
  */
795
812
  export var isExceedMaxTimeSpan = function isExceedMaxTimeSpan(value, timeSpanBoundary) {
796
- return computeTimeDiff(value, "s") > timeSpanBoundary;
813
+ return computeTimeDiff(value, 's') > timeSpanBoundary;
797
814
  };
798
815
  export default dayjs;