eoss 0.1.0-alpha.39 → 0.1.0-alpha.40

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 (233) hide show
  1. package/lib/0.js +1 -1
  2. package/lib/1.js +1 -1
  3. package/lib/10.js +1 -1
  4. package/lib/11.js +1 -1
  5. package/lib/12.js +1 -1
  6. package/lib/13.js +1 -1
  7. package/lib/14.js +1 -1
  8. package/lib/15.js +1 -1
  9. package/lib/16.js +1 -1
  10. package/lib/17.js +1 -1
  11. package/lib/18.js +1 -1
  12. package/lib/19.js +1 -1
  13. package/lib/20.js +1 -1
  14. package/lib/21.js +1 -1
  15. package/lib/22.js +1 -1
  16. package/lib/23.js +1 -1
  17. package/lib/24.js +1 -1
  18. package/lib/25.js +1 -1
  19. package/lib/26.js +1 -1
  20. package/lib/27.js +1 -1
  21. package/lib/28.js +1 -1
  22. package/lib/29.js +1 -1
  23. package/lib/3.js +1 -1
  24. package/lib/30.js +1 -1
  25. package/lib/31.js +1 -1
  26. package/lib/32.js +1 -1
  27. package/lib/33.js +1 -1
  28. package/lib/34.js +1 -1
  29. package/lib/35.js +1 -1
  30. package/lib/36.js +1 -1
  31. package/lib/37.js +1 -1
  32. package/lib/38.js +1 -1
  33. package/lib/39.js +1 -1
  34. package/lib/4.js +1 -1
  35. package/lib/40.js +1 -1
  36. package/lib/41.js +1 -1
  37. package/lib/42.js +1 -1
  38. package/lib/43.js +1 -1
  39. package/lib/44.js +1 -1
  40. package/lib/45.js +1 -1
  41. package/lib/46.js +1 -1
  42. package/lib/47.js +1 -1
  43. package/lib/48.js +1 -1
  44. package/lib/49.js +1 -1
  45. package/lib/5.js +1 -1
  46. package/lib/50.js +1 -1
  47. package/lib/51.js +1 -1
  48. package/lib/52.js +1 -1
  49. package/lib/53.js +1 -1
  50. package/lib/54.js +1 -1
  51. package/lib/55.js +1 -1
  52. package/lib/56.js +1 -1
  53. package/lib/57.js +1 -1
  54. package/lib/58.js +1 -1
  55. package/lib/59.js +1 -1
  56. package/lib/6.js +1 -1
  57. package/lib/60.js +1 -1
  58. package/lib/61.js +1 -1
  59. package/lib/62.js +1 -1
  60. package/lib/63.js +1 -1
  61. package/lib/64.js +1 -1
  62. package/lib/65.js +1 -1
  63. package/lib/66.js +1 -1
  64. package/lib/67.js +1 -1
  65. package/lib/68.js +1 -1
  66. package/lib/69.js +1 -1
  67. package/lib/7.js +1 -1
  68. package/lib/70.js +1 -1
  69. package/lib/71.js +1 -1
  70. package/lib/72.js +1 -1
  71. package/lib/73.js +1 -1
  72. package/lib/74.js +1 -1
  73. package/lib/75.js +1 -1
  74. package/lib/76.js +1 -1
  75. package/lib/77.js +1 -1
  76. package/lib/78.js +1 -1
  77. package/lib/79.js +1 -1
  78. package/lib/8.js +1 -1
  79. package/lib/80.js +1 -1
  80. package/lib/81.js +1 -1
  81. package/lib/9.js +1 -1
  82. package/lib/account-login.js +837 -862
  83. package/lib/alert.js +2 -2
  84. package/lib/aside.js +2 -2
  85. package/lib/audit-trajectory.js +4 -4
  86. package/lib/autocomplete.js +1813 -1988
  87. package/lib/avatar.js +2 -2
  88. package/lib/backtop.js +2 -2
  89. package/lib/badge.js +2 -2
  90. package/lib/breadcrumb-item.js +4 -4
  91. package/lib/breadcrumb.js +4 -4
  92. package/lib/button-group.js +4 -4
  93. package/lib/button.js +2 -2
  94. package/lib/ca-login.js +837 -862
  95. package/lib/calendar.js +839 -864
  96. package/lib/card.js +2 -2
  97. package/lib/carousel-item.js +846 -871
  98. package/lib/carousel.js +839 -864
  99. package/lib/cascader-panel.js +852 -877
  100. package/lib/cascader.js +2048 -2223
  101. package/lib/checkbox-button.js +4 -4
  102. package/lib/checkbox-group.js +859 -884
  103. package/lib/checkbox.js +4 -4
  104. package/lib/col.js +2 -2
  105. package/lib/collapse-item.js +1040 -1065
  106. package/lib/collapse.js +1040 -1065
  107. package/lib/color-picker.js +972 -1122
  108. package/lib/container.js +2 -2
  109. package/lib/cron.js +12 -12
  110. package/lib/data-table.js +843 -868
  111. package/lib/date-picker.js +10520 -10695
  112. package/lib/descriptions-item.js +4 -4
  113. package/lib/descriptions.js +4 -4
  114. package/lib/dialog.js +837 -862
  115. package/lib/divider.js +2 -2
  116. package/lib/drawer.js +2 -2
  117. package/lib/dropdown-item.js +4 -4
  118. package/lib/dropdown-menu.js +974 -1124
  119. package/lib/dropdown.js +841 -866
  120. package/lib/email-login.js +837 -862
  121. package/lib/empty.js +2 -2
  122. package/lib/eoss.common.js +4023 -2668
  123. package/lib/flip.js +2 -2
  124. package/lib/flow-group.js +853 -878
  125. package/lib/flow.js +868 -893
  126. package/lib/flows.js +854 -879
  127. package/lib/footer.js +2 -2
  128. package/lib/form-item.js +860 -885
  129. package/lib/form.js +933 -950
  130. package/lib/guide.js +2 -2
  131. package/lib/header.js +2 -2
  132. package/lib/icon.js +837 -862
  133. package/lib/icons.js +2 -2
  134. package/lib/image-viewer.js +837 -862
  135. package/lib/image.js +4 -4
  136. package/lib/index.js +1 -1
  137. package/lib/infinite-scroll.js +2 -2
  138. package/lib/input-number.js +6 -6
  139. package/lib/input.js +839 -864
  140. package/lib/link.js +2 -2
  141. package/lib/loading.js +2 -2
  142. package/lib/login.js +867 -891
  143. package/lib/lowcode-view.js +1843 -1185
  144. package/lib/lowcode.js +3050 -1569
  145. package/lib/main.js +970 -988
  146. package/lib/marquee.js +837 -862
  147. package/lib/menu-item-group.js +15 -15
  148. package/lib/menu-item.js +6 -6
  149. package/lib/menu.js +2227 -2368
  150. package/lib/message-box.js +843 -868
  151. package/lib/message.js +839 -864
  152. package/lib/notification.js +861 -886
  153. package/lib/option-group.js +4 -4
  154. package/lib/option.js +839 -864
  155. package/lib/page-header.js +2 -2
  156. package/lib/pagination.js +839 -864
  157. package/lib/phone-login.js +847 -866
  158. package/lib/popconfirm.js +4 -4
  159. package/lib/popover.js +1831 -2006
  160. package/lib/process-config.js +839 -864
  161. package/lib/process-module.js +846 -871
  162. package/lib/process-rule.js +905 -930
  163. package/lib/progress.js +2 -2
  164. package/lib/qr-code.js +4 -4
  165. package/lib/qrcode-login.js +839 -864
  166. package/lib/radio-button.js +4 -4
  167. package/lib/radio-group.js +850 -875
  168. package/lib/radio.js +4 -4
  169. package/lib/rate.js +837 -862
  170. package/lib/retrial-auth.js +837 -862
  171. package/lib/row.js +2 -2
  172. package/lib/scrollbar.js +839 -864
  173. package/lib/select.js +2139 -2314
  174. package/lib/selector-panel.js +940 -965
  175. package/lib/selector.js +852 -877
  176. package/lib/slider.js +4 -4
  177. package/lib/step.js +32 -32
  178. package/lib/steps.js +874 -899
  179. package/lib/submenu.js +1269 -1385
  180. package/lib/switch.js +839 -864
  181. package/lib/tab-pane.js +4 -4
  182. package/lib/table-column.js +840 -865
  183. package/lib/table.js +1825 -2000
  184. package/lib/tabs.js +846 -871
  185. package/lib/tag.js +2 -2
  186. package/lib/theme-chalk/fonts/iconfont.ttf +0 -0
  187. package/lib/theme-chalk/fonts/iconfont.woff +0 -0
  188. package/lib/theme-chalk/index.css +1 -1
  189. package/lib/theme-chalk/lowcode.css +1 -1
  190. package/lib/time-picker.js +6471 -6646
  191. package/lib/time-select.js +5039 -5214
  192. package/lib/timeline-item.js +2 -2
  193. package/lib/timeline.js +2 -2
  194. package/lib/tips.js +837 -862
  195. package/lib/toolbar.js +4 -4
  196. package/lib/tooltip.js +1813 -1988
  197. package/lib/transfer.js +837 -862
  198. package/lib/tree-group.js +853 -878
  199. package/lib/tree.js +1026 -1051
  200. package/lib/update-history.js +4 -4
  201. package/lib/upload.js +859 -884
  202. package/lib/wujie.js +841 -866
  203. package/package.json +1 -1
  204. package/packages/flow-group/src/main.vue +2 -2
  205. package/packages/form/src/form-item-render.vue +1 -0
  206. package/packages/form/src/form-item.vue +12 -6
  207. package/packages/form/src/form.vue +5 -5
  208. package/packages/login/src/login.vue +1 -0
  209. package/packages/lowcode/src/attribute/function.vue +28 -9
  210. package/packages/lowcode/src/attribute/props.vue +202 -0
  211. package/packages/lowcode/src/attribute/styles.vue +79 -5
  212. package/packages/lowcode/src/attribute.vue +61 -4
  213. package/packages/lowcode/src/canvas.vue +159 -2
  214. package/packages/lowcode/src/form-render.vue +305 -0
  215. package/packages/lowcode/src/lowcode.vue +33 -13
  216. package/packages/lowcode/src/modules.vue +53 -37
  217. package/packages/lowcode/src/render.vue +80 -25
  218. package/packages/lowcode/src/util/components.js +100 -0
  219. package/packages/lowcode/src/util/props-util.js +67 -0
  220. package/packages/lowcode/src/util/source-generator.js +69 -9
  221. package/packages/lowcode/src/util/source-parser.js +64 -10
  222. package/packages/lowcode-view/src/render.vue +48 -18
  223. package/packages/main/src/components/userinfo.vue +0 -1
  224. package/packages/menu/src/menu-item-group.vue +1 -1
  225. package/packages/menu/src/mixins.js +8 -4
  226. package/packages/menu/src/submenu.vue +35 -5
  227. package/packages/phone-login/src/phone-login.vue +5 -2
  228. package/packages/theme-chalk/dist/fonts/iconfont.ttf +0 -0
  229. package/packages/theme-chalk/dist/fonts/iconfont.woff +0 -0
  230. package/packages/theme-chalk/src/fonts/iconfont.ttf +0 -0
  231. package/packages/theme-chalk/src/fonts/iconfont.woff +0 -0
  232. package/packages/theme-chalk/src/lowcode.scss +21 -2
  233. package/src/index.js +336 -336
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 194);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 201);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -4467,7 +4467,7 @@ var getTableData = function getTableData(_ref9) {
4467
4467
 
4468
4468
  /***/ }),
4469
4469
 
4470
- /***/ 105:
4470
+ /***/ 107:
4471
4471
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
4472
4472
 
4473
4473
  "use strict";
@@ -4530,17 +4530,17 @@ render._withStripped = true
4530
4530
  // CONCATENATED MODULE: ./packages/checkbox/src/checkbox-group.vue?vue&type=template&id=61423f1a&
4531
4531
 
4532
4532
  // EXTERNAL MODULE: external "sortablejs"
4533
- var external_sortablejs_ = __webpack_require__(56);
4533
+ var external_sortablejs_ = __webpack_require__(55);
4534
4534
  var external_sortablejs_default = /*#__PURE__*/__webpack_require__.n(external_sortablejs_);
4535
4535
 
4536
4536
  // EXTERNAL MODULE: ./src/mixins/emitter.js
4537
4537
  var emitter = __webpack_require__(15);
4538
4538
 
4539
4539
  // EXTERNAL MODULE: ./packages/checkbox/src/checkbox.vue + 4 modules
4540
- var src_checkbox = __webpack_require__(88);
4540
+ var src_checkbox = __webpack_require__(90);
4541
4541
 
4542
4542
  // EXTERNAL MODULE: ./packages/checkbox/src/checkbox-button.vue + 4 modules
4543
- var checkbox_button = __webpack_require__(89);
4543
+ var checkbox_button = __webpack_require__(91);
4544
4544
 
4545
4545
  // EXTERNAL MODULE: ./src/utils/ajax.js
4546
4546
  var ajax = __webpack_require__(10);
@@ -4882,7 +4882,7 @@ var component = Object(componentNormalizer["a" /* default */])(
4882
4882
 
4883
4883
  /***/ }),
4884
4884
 
4885
- /***/ 111:
4885
+ /***/ 113:
4886
4886
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
4887
4887
 
4888
4888
  "use strict";
@@ -4945,10 +4945,10 @@ render._withStripped = true
4945
4945
  var emitter = __webpack_require__(15);
4946
4946
 
4947
4947
  // EXTERNAL MODULE: ./packages/radio/src/radio.vue + 4 modules
4948
- var src_radio = __webpack_require__(90);
4948
+ var src_radio = __webpack_require__(92);
4949
4949
 
4950
4950
  // EXTERNAL MODULE: ./packages/radio/src/radio-button.vue + 4 modules
4951
- var radio_button = __webpack_require__(91);
4951
+ var radio_button = __webpack_require__(93);
4952
4952
 
4953
4953
  // EXTERNAL MODULE: ./src/utils/ajax.js
4954
4954
  var ajax = __webpack_require__(10);
@@ -5614,7 +5614,73 @@ module.exports = require("lodash/cloneDeep");
5614
5614
 
5615
5615
  /***/ }),
5616
5616
 
5617
- /***/ 194:
5617
+ /***/ 2:
5618
+ /***/ (function(module, exports) {
5619
+
5620
+ module.exports = require("vue");
5621
+
5622
+ /***/ }),
5623
+
5624
+ /***/ 20:
5625
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
5626
+
5627
+ "use strict";
5628
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return doEncrypt; });
5629
+ /* unused harmony export doDecrypt */
5630
+ /* harmony import */ var _storage__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
5631
+ var sm2 = __webpack_require__(42).sm2;
5632
+
5633
+
5634
+ /**
5635
+ * doEncrypt
5636
+ * @desc:sm2加密
5637
+ * @author huangbo
5638
+ * @date 2022年5月7日
5639
+ * @param {string} [data] - 被加密的字符串
5640
+ * @param {string} [key] - 公钥
5641
+ **/
5642
+ var doEncrypt = function doEncrypt(_ref) {
5643
+ var data = _ref.data,
5644
+ key = _ref.key,
5645
+ mode = _ref.mode;
5646
+
5647
+ if (!key) {
5648
+ key = Object(_storage__WEBPACK_IMPORTED_MODULE_0__[/* getStorage */ "a"])('secretKey');
5649
+ }
5650
+ if (!mode) {
5651
+ mode = 1;
5652
+ }
5653
+ if (!new RegExp('^04').test(key)) {
5654
+ key = '04' + key;
5655
+ }
5656
+ var result = sm2.doEncrypt(data, key, mode);
5657
+ return result;
5658
+ };
5659
+
5660
+ /**
5661
+ * doDecrypt
5662
+ * @desc:sm2解密
5663
+ * @author huangbo
5664
+ * @date 2022年5月7日
5665
+ * @param {string} [data] - 被解密的加密字符串
5666
+ * @param {string} [key] - 私钥
5667
+ **/
5668
+ var doDecrypt = function doDecrypt(_ref2) {
5669
+ var data = _ref2.data,
5670
+ key = _ref2.key,
5671
+ mode = _ref2.mode;
5672
+
5673
+ var cipherMode = mode ? mode : 1;
5674
+ if (new RegExp('^04').test(key)) {
5675
+ key = key.slice(2);
5676
+ }
5677
+ var result = sm2.doDecrypt(data, key, cipherMode);
5678
+ return result;
5679
+ };
5680
+
5681
+ /***/ }),
5682
+
5683
+ /***/ 201:
5618
5684
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5619
5685
 
5620
5686
  "use strict";
@@ -5948,7 +6014,7 @@ treevue_type_template_id_7b54c30c_render._withStripped = true
5948
6014
  // CONCATENATED MODULE: ./packages/selector-panel/src/tree.vue?vue&type=template&id=7b54c30c&
5949
6015
 
5950
6016
  // EXTERNAL MODULE: external "eoss/lib/tree"
5951
- var tree_ = __webpack_require__(50);
6017
+ var tree_ = __webpack_require__(51);
5952
6018
  var tree_default = /*#__PURE__*/__webpack_require__.n(tree_);
5953
6019
 
5954
6020
  // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/selector-panel/src/tree.vue?vue&type=script&lang=js&
@@ -6151,10 +6217,10 @@ selectionvue_type_template_id_3ce4ab40_render._withStripped = true
6151
6217
  // CONCATENATED MODULE: ./packages/selector-panel/src/selection.vue?vue&type=template&id=3ce4ab40&
6152
6218
 
6153
6219
  // EXTERNAL MODULE: ./packages/radio/src/radio-group.vue + 4 modules
6154
- var radio_group = __webpack_require__(111);
6220
+ var radio_group = __webpack_require__(113);
6155
6221
 
6156
6222
  // EXTERNAL MODULE: ./packages/checkbox/src/checkbox-group.vue + 4 modules
6157
- var checkbox_group = __webpack_require__(105);
6223
+ var checkbox_group = __webpack_require__(107);
6158
6224
 
6159
6225
  // EXTERNAL MODULE: ./src/utils/types.js
6160
6226
  var types = __webpack_require__(3);
@@ -6683,7 +6749,7 @@ var input_ = __webpack_require__(14);
6683
6749
  var input_default = /*#__PURE__*/__webpack_require__.n(input_);
6684
6750
 
6685
6751
  // EXTERNAL MODULE: external "eoss/lib/option"
6686
- var option_ = __webpack_require__(51);
6752
+ var option_ = __webpack_require__(52);
6687
6753
  var option_default = /*#__PURE__*/__webpack_require__.n(option_);
6688
6754
 
6689
6755
  // EXTERNAL MODULE: external "eoss/lib/select"
@@ -6691,15 +6757,15 @@ var select_ = __webpack_require__(41);
6691
6757
  var select_default = /*#__PURE__*/__webpack_require__.n(select_);
6692
6758
 
6693
6759
  // EXTERNAL MODULE: external "eoss/lib/switch"
6694
- var switch_ = __webpack_require__(64);
6760
+ var switch_ = __webpack_require__(65);
6695
6761
  var switch_default = /*#__PURE__*/__webpack_require__.n(switch_);
6696
6762
 
6697
6763
  // EXTERNAL MODULE: external "eoss/lib/tab-pane"
6698
- var tab_pane_ = __webpack_require__(59);
6764
+ var tab_pane_ = __webpack_require__(60);
6699
6765
  var tab_pane_default = /*#__PURE__*/__webpack_require__.n(tab_pane_);
6700
6766
 
6701
6767
  // EXTERNAL MODULE: external "eoss/lib/tabs"
6702
- var tabs_ = __webpack_require__(55);
6768
+ var tabs_ = __webpack_require__(57);
6703
6769
  var tabs_default = /*#__PURE__*/__webpack_require__.n(tabs_);
6704
6770
 
6705
6771
  // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/selector-panel/src/selector-panel.vue?vue&type=script&lang=js&
@@ -7238,72 +7304,6 @@ selector_panel.install = function (Vue) {
7238
7304
 
7239
7305
  /***/ }),
7240
7306
 
7241
- /***/ 2:
7242
- /***/ (function(module, exports) {
7243
-
7244
- module.exports = require("vue");
7245
-
7246
- /***/ }),
7247
-
7248
- /***/ 20:
7249
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
7250
-
7251
- "use strict";
7252
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return doEncrypt; });
7253
- /* unused harmony export doDecrypt */
7254
- /* harmony import */ var _storage__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
7255
- var sm2 = __webpack_require__(42).sm2;
7256
-
7257
-
7258
- /**
7259
- * doEncrypt
7260
- * @desc:sm2加密
7261
- * @author huangbo
7262
- * @date 2022年5月7日
7263
- * @param {string} [data] - 被加密的字符串
7264
- * @param {string} [key] - 公钥
7265
- **/
7266
- var doEncrypt = function doEncrypt(_ref) {
7267
- var data = _ref.data,
7268
- key = _ref.key,
7269
- mode = _ref.mode;
7270
-
7271
- if (!key) {
7272
- key = Object(_storage__WEBPACK_IMPORTED_MODULE_0__[/* getStorage */ "a"])('secretKey');
7273
- }
7274
- if (!mode) {
7275
- mode = 1;
7276
- }
7277
- if (!new RegExp('^04').test(key)) {
7278
- key = '04' + key;
7279
- }
7280
- var result = sm2.doEncrypt(data, key, mode);
7281
- return result;
7282
- };
7283
-
7284
- /**
7285
- * doDecrypt
7286
- * @desc:sm2解密
7287
- * @author huangbo
7288
- * @date 2022年5月7日
7289
- * @param {string} [data] - 被解密的加密字符串
7290
- * @param {string} [key] - 私钥
7291
- **/
7292
- var doDecrypt = function doDecrypt(_ref2) {
7293
- var data = _ref2.data,
7294
- key = _ref2.key,
7295
- mode = _ref2.mode;
7296
-
7297
- var cipherMode = mode ? mode : 1;
7298
- if (new RegExp('^04').test(key)) {
7299
- key = key.slice(2);
7300
- }
7301
- var result = sm2.doDecrypt(data, key, cipherMode);
7302
- return result;
7303
- };
7304
-
7305
- /***/ }),
7306
-
7307
7307
  /***/ 21:
7308
7308
  /***/ (function(module, exports) {
7309
7309
 
@@ -7567,14 +7567,14 @@ module.exports = require("sm-crypto");
7567
7567
 
7568
7568
  /***/ }),
7569
7569
 
7570
- /***/ 50:
7570
+ /***/ 51:
7571
7571
  /***/ (function(module, exports) {
7572
7572
 
7573
7573
  module.exports = require("eoss/lib/tree");
7574
7574
 
7575
7575
  /***/ }),
7576
7576
 
7577
- /***/ 51:
7577
+ /***/ 52:
7578
7578
  /***/ (function(module, exports) {
7579
7579
 
7580
7580
  module.exports = require("eoss/lib/option");
@@ -7584,21 +7584,14 @@ module.exports = require("eoss/lib/option");
7584
7584
  /***/ 55:
7585
7585
  /***/ (function(module, exports) {
7586
7586
 
7587
- module.exports = require("eoss/lib/tabs");
7588
-
7589
- /***/ }),
7590
-
7591
- /***/ 56:
7592
- /***/ (function(module, exports) {
7593
-
7594
7587
  module.exports = require("sortablejs");
7595
7588
 
7596
7589
  /***/ }),
7597
7590
 
7598
- /***/ 59:
7591
+ /***/ 57:
7599
7592
  /***/ (function(module, exports) {
7600
7593
 
7601
- module.exports = require("eoss/lib/tab-pane");
7594
+ module.exports = require("eoss/lib/tabs");
7602
7595
 
7603
7596
  /***/ }),
7604
7597
 
@@ -8175,7 +8168,14 @@ var changeInTime = '/baseIssueRules/changeInTime';
8175
8168
 
8176
8169
  /***/ }),
8177
8170
 
8178
- /***/ 64:
8171
+ /***/ 60:
8172
+ /***/ (function(module, exports) {
8173
+
8174
+ module.exports = require("eoss/lib/tab-pane");
8175
+
8176
+ /***/ }),
8177
+
8178
+ /***/ 65:
8179
8179
  /***/ (function(module, exports) {
8180
8180
 
8181
8181
  module.exports = require("eoss/lib/switch");
@@ -8232,759 +8232,736 @@ module.exports = require("eoss/lib/switch");
8232
8232
  /* unused harmony export getSecond */
8233
8233
  /* unused harmony export getWeekday */
8234
8234
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F", function() { return timeCycle; });
8235
- /* Modified from https://github.com/taylorhakes/fecha
8236
- *
8237
- * The MIT License (MIT)
8238
- *
8239
- * Copyright (c) 2015 Taylor Hakes
8240
- *
8241
- * Permission is hereby granted, free of charge, to any person obtaining a copy
8242
- * of this software and associated documentation files (the "Software"), to deal
8243
- * in the Software without restriction, including without limitation the rights
8244
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8245
- * copies of the Software, and to permit persons to whom the Software is
8246
- * furnished to do so, subject to the following conditions:
8247
- *
8248
- * The above copyright notice and this permission notice shall be included in all
8249
- * copies or substantial portions of the Software.
8250
- *
8251
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
8252
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
8253
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
8254
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
8255
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
8256
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
8257
- * SOFTWARE.
8258
- */
8259
-
8260
- /*eslint-disable*/
8261
- // 把 YYYY-MM-DD 改成了 yyyy-MM-dd
8262
-
8263
-
8235
+
8236
+
8264
8237
  /**
8265
8238
  * Parse or format dates
8266
8239
  * @class fecha
8267
- */
8268
- const fecha = {};
8269
- const token = /d{1,4}|M{1,4}|yy(?:yy)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g;
8270
- const twoDigits = '\\d\\d?';
8271
- const threeDigits = '\\d{3}';
8272
- const fourDigits = '\\d{4}';
8273
- const word = '[^\\s]+';
8274
- const literal = /\[([^]*?)\]/gm;
8275
- const noop = function () {};
8276
-
8277
- function regexEscape(str) {
8278
- return str.replace(/[|\\{()[^$+*?.-]/g, '\\$&');
8279
- }
8280
-
8281
- function shorten(arr, sLen) {
8282
- const newArr = [];
8283
- for (let i = 0, len = arr.length; i < len; i++) {
8284
- newArr.push(arr[i].substr(0, sLen));
8285
- }
8286
- return newArr;
8287
- }
8288
-
8289
- function monthUpdate() {
8290
- return function (d, v) {
8291
- const index = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'].indexOf(v.toLowerCase());
8292
- if (~index) {
8293
- d.month = index;
8294
- }
8295
- };
8296
- }
8297
-
8298
- function pad(val, len) {
8299
- val = String(val);
8300
- len = len || 2;
8301
- while (val.length < len) {
8302
- val = '0' + val;
8303
- }
8304
- return val;
8305
- }
8306
-
8307
- // 直接使用中文日期名称常量
8308
- const dayNames = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
8309
- const monthNames = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];
8310
- const monthNamesShort = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二'];
8311
- const dayNamesShort = ['日', '一', '二', '三', '四', '五', '六'];
8312
- const amPm = ['上午', '下午'];
8313
- const DoFn = function DoFn(D) {
8314
- return D + '日';
8315
- };
8316
-
8317
- const formatFlags = {
8318
- D: function(dateObj) {
8319
- return dateObj.getDay();
8320
- },
8321
- DD: function(dateObj) {
8322
- return pad(dateObj.getDay());
8323
- },
8324
- Do: function(dateObj) {
8325
- return DoFn(dateObj.getDate());
8326
- },
8327
- d: function(dateObj) {
8328
- return dateObj.getDate();
8329
- },
8330
- dd: function(dateObj) {
8331
- return pad(dateObj.getDate());
8332
- },
8333
- ddd: function(dateObj) {
8334
- return dayNamesShort[dateObj.getDay()];
8335
- },
8336
- dddd: function(dateObj) {
8337
- return dayNames[dateObj.getDay()];
8338
- },
8339
- M: function(dateObj) {
8340
- return dateObj.getMonth() + 1;
8341
- },
8342
- MM: function(dateObj) {
8343
- return pad(dateObj.getMonth() + 1);
8344
- },
8345
- MMM: function(dateObj) {
8346
- return monthNamesShort[dateObj.getMonth()];
8347
- },
8348
- MMMM: function(dateObj) {
8349
- return monthNames[dateObj.getMonth()];
8350
- },
8351
- yy: function(dateObj) {
8352
- return pad(String(dateObj.getFullYear()), 4).substr(2);
8353
- },
8354
- yyyy: function(dateObj) {
8355
- return pad(dateObj.getFullYear(), 4);
8356
- },
8357
- h: function(dateObj) {
8358
- return dateObj.getHours() % 12 || 12;
8359
- },
8360
- hh: function(dateObj) {
8361
- return pad(dateObj.getHours() % 12 || 12);
8362
- },
8363
- H: function(dateObj) {
8364
- return dateObj.getHours();
8365
- },
8366
- HH: function(dateObj) {
8367
- return pad(dateObj.getHours());
8368
- },
8369
- m: function(dateObj) {
8370
- return dateObj.getMinutes();
8371
- },
8372
- mm: function(dateObj) {
8373
- return pad(dateObj.getMinutes());
8374
- },
8375
- s: function(dateObj) {
8376
- return dateObj.getSeconds();
8377
- },
8378
- ss: function(dateObj) {
8379
- return pad(dateObj.getSeconds());
8380
- },
8381
- S: function(dateObj) {
8382
- return Math.round(dateObj.getMilliseconds() / 100);
8383
- },
8384
- SS: function(dateObj) {
8385
- return pad(Math.round(dateObj.getMilliseconds() / 10), 2);
8386
- },
8387
- SSS: function(dateObj) {
8388
- return pad(dateObj.getMilliseconds(), 3);
8389
- },
8390
- a: function(dateObj) {
8391
- return dateObj.getHours() < 12 ? '上午' : '下午';
8392
- },
8393
- A: function(dateObj) {
8394
- return dateObj.getHours() < 12 ? '上午' : '下午';
8395
- },
8396
- ZZ: function(dateObj) {
8397
- const o = dateObj.getTimezoneOffset();
8398
- return (o > 0 ? '-' : '+') + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4);
8399
- }
8400
- };
8401
-
8402
- const parseFlags = {
8403
- d: [twoDigits, function (d, v) {
8404
- d.day = v;
8405
- }],
8406
- Do: [twoDigits + word, function (d, v) {
8407
- d.day = parseInt(v, 10);
8408
- }],
8409
- M: [twoDigits, function (d, v) {
8410
- d.month = v - 1;
8411
- }],
8412
- yy: [twoDigits, function (d, v) {
8413
- const da = new Date(), cent = +('' + da.getFullYear()).substr(0, 2);
8414
- d.year = '' + (v > 68 ? cent - 1 : cent) + v;
8415
- }],
8416
- h: [twoDigits, function (d, v) {
8417
- d.hour = v;
8418
- }],
8419
- m: [twoDigits, function (d, v) {
8420
- d.minute = v;
8421
- }],
8422
- s: [twoDigits, function (d, v) {
8423
- d.second = v;
8424
- }],
8425
- yyyy: [fourDigits, function (d, v) {
8426
- d.year = v;
8427
- }],
8428
- S: ['\\d', function (d, v) {
8429
- d.millisecond = v * 100;
8430
- }],
8431
- SS: ['\\d{2}', function (d, v) {
8432
- d.millisecond = v * 10;
8433
- }],
8434
- SSS: [threeDigits, function (d, v) {
8435
- d.millisecond = v;
8436
- }],
8437
- D: [twoDigits, noop],
8438
- ddd: [word, noop],
8439
- MMM: [word, monthUpdate('monthNamesShort')],
8440
- MMMM: [word, monthUpdate('monthNames')],
8441
- a: [word, function (d, v) {
8442
- const val = v.toLowerCase();
8443
- if (val === '上午') {
8444
- d.isPm = false;
8445
- } else if (val === '下午') {
8446
- d.isPm = true;
8447
- }
8448
- }],
8449
- ZZ: ['[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z', function (d, v) {
8450
- let parts = (v + '').match(/([+-]|\d\d)/gi), minutes;
8451
-
8452
- if (parts) {
8453
- minutes = +(parts[1] * 60) + parseInt(parts[2], 10);
8454
- d.timezoneOffset = parts[0] === '+' ? minutes : -minutes;
8455
- }
8456
- }]
8457
- };
8458
- parseFlags.dd = parseFlags.d;
8459
- parseFlags.dddd = parseFlags.ddd;
8460
- parseFlags.DD = parseFlags.D;
8461
- parseFlags.mm = parseFlags.m;
8462
- parseFlags.hh = parseFlags.H = parseFlags.HH = parseFlags.h;
8463
- parseFlags.MM = parseFlags.M;
8464
- parseFlags.ss = parseFlags.s;
8465
- parseFlags.A = parseFlags.a;
8466
-
8467
-
8468
- // Some common format strings
8469
- fecha.masks = {
8470
- default: 'ddd MMM dd yyyy HH:mm:ss',
8471
- shortDate: 'M/D/yy',
8472
- mediumDate: 'MMM d, yyyy',
8473
- longDate: 'MMMM d, yyyy',
8474
- fullDate: 'dddd, MMMM d, yyyy',
8475
- shortTime: 'HH:mm',
8476
- mediumTime: 'HH:mm:ss',
8477
- longTime: 'HH:mm:ss.SSS'
8478
- };
8479
-
8240
+ */
8241
+ var fecha = {};
8242
+ var token = /d{1,4}|M{1,4}|yy(?:yy)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g;
8243
+ var twoDigits = '\\d\\d?';
8244
+ var threeDigits = '\\d{3}';
8245
+ var fourDigits = '\\d{4}';
8246
+ var word = '[^\\s]+';
8247
+ var literal = /\[([^]*?)\]/gm;
8248
+ var noop = function noop() {};
8249
+
8250
+ function regexEscape(str) {
8251
+ return str.replace(/[|\\{()[^$+*?.-]/g, '\\$&');
8252
+ }
8253
+
8254
+ function shorten(arr, sLen) {
8255
+ var newArr = [];
8256
+ for (var i = 0, len = arr.length; i < len; i++) {
8257
+ newArr.push(arr[i].substr(0, sLen));
8258
+ }
8259
+ return newArr;
8260
+ }
8261
+
8262
+ function monthUpdate() {
8263
+ return function (d, v) {
8264
+ var index = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'].indexOf(v.toLowerCase());
8265
+ if (~index) {
8266
+ d.month = index;
8267
+ }
8268
+ };
8269
+ }
8270
+
8271
+ function pad(val, len) {
8272
+ val = String(val);
8273
+ len = len || 2;
8274
+ while (val.length < len) {
8275
+ val = '0' + val;
8276
+ }
8277
+ return val;
8278
+ }
8279
+
8280
+ // 直接使用中文日期名称常量
8281
+ var dayNames = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
8282
+ var monthNames = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];
8283
+ var monthNamesShort = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二'];
8284
+ var dayNamesShort = ['日', '一', '二', '三', '四', '五', '六'];
8285
+ var amPm = ['上午', '下午'];
8286
+ var DoFn = function DoFn(D) {
8287
+ return D + '日';
8288
+ };
8289
+
8290
+ var formatFlags = {
8291
+ D: function D(dateObj) {
8292
+ return dateObj.getDay();
8293
+ },
8294
+ DD: function DD(dateObj) {
8295
+ return pad(dateObj.getDay());
8296
+ },
8297
+ Do: function Do(dateObj) {
8298
+ return DoFn(dateObj.getDate());
8299
+ },
8300
+ d: function d(dateObj) {
8301
+ return dateObj.getDate();
8302
+ },
8303
+ dd: function dd(dateObj) {
8304
+ return pad(dateObj.getDate());
8305
+ },
8306
+ ddd: function ddd(dateObj) {
8307
+ return dayNamesShort[dateObj.getDay()];
8308
+ },
8309
+ dddd: function dddd(dateObj) {
8310
+ return dayNames[dateObj.getDay()];
8311
+ },
8312
+ M: function M(dateObj) {
8313
+ return dateObj.getMonth() + 1;
8314
+ },
8315
+ MM: function MM(dateObj) {
8316
+ return pad(dateObj.getMonth() + 1);
8317
+ },
8318
+ MMM: function MMM(dateObj) {
8319
+ return monthNamesShort[dateObj.getMonth()];
8320
+ },
8321
+ MMMM: function MMMM(dateObj) {
8322
+ return monthNames[dateObj.getMonth()];
8323
+ },
8324
+ yy: function yy(dateObj) {
8325
+ return pad(String(dateObj.getFullYear()), 4).substr(2);
8326
+ },
8327
+ yyyy: function yyyy(dateObj) {
8328
+ return pad(dateObj.getFullYear(), 4);
8329
+ },
8330
+ h: function h(dateObj) {
8331
+ return dateObj.getHours() % 12 || 12;
8332
+ },
8333
+ hh: function hh(dateObj) {
8334
+ return pad(dateObj.getHours() % 12 || 12);
8335
+ },
8336
+ H: function H(dateObj) {
8337
+ return dateObj.getHours();
8338
+ },
8339
+ HH: function HH(dateObj) {
8340
+ return pad(dateObj.getHours());
8341
+ },
8342
+ m: function m(dateObj) {
8343
+ return dateObj.getMinutes();
8344
+ },
8345
+ mm: function mm(dateObj) {
8346
+ return pad(dateObj.getMinutes());
8347
+ },
8348
+ s: function s(dateObj) {
8349
+ return dateObj.getSeconds();
8350
+ },
8351
+ ss: function ss(dateObj) {
8352
+ return pad(dateObj.getSeconds());
8353
+ },
8354
+ S: function S(dateObj) {
8355
+ return Math.round(dateObj.getMilliseconds() / 100);
8356
+ },
8357
+ SS: function SS(dateObj) {
8358
+ return pad(Math.round(dateObj.getMilliseconds() / 10), 2);
8359
+ },
8360
+ SSS: function SSS(dateObj) {
8361
+ return pad(dateObj.getMilliseconds(), 3);
8362
+ },
8363
+ a: function a(dateObj) {
8364
+ return dateObj.getHours() < 12 ? '上午' : '下午';
8365
+ },
8366
+ A: function A(dateObj) {
8367
+ return dateObj.getHours() < 12 ? '上午' : '下午';
8368
+ },
8369
+ ZZ: function ZZ(dateObj) {
8370
+ var o = dateObj.getTimezoneOffset();
8371
+ return (o > 0 ? '-' : '+') + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4);
8372
+ }
8373
+ };
8374
+
8375
+ var parseFlags = {
8376
+ d: [twoDigits, function (d, v) {
8377
+ d.day = v;
8378
+ }],
8379
+ Do: [twoDigits + word, function (d, v) {
8380
+ d.day = parseInt(v, 10);
8381
+ }],
8382
+ M: [twoDigits, function (d, v) {
8383
+ d.month = v - 1;
8384
+ }],
8385
+ yy: [twoDigits, function (d, v) {
8386
+ var da = new Date(),
8387
+ cent = +('' + da.getFullYear()).substr(0, 2);
8388
+ d.year = '' + (v > 68 ? cent - 1 : cent) + v;
8389
+ }],
8390
+ h: [twoDigits, function (d, v) {
8391
+ d.hour = v;
8392
+ }],
8393
+ m: [twoDigits, function (d, v) {
8394
+ d.minute = v;
8395
+ }],
8396
+ s: [twoDigits, function (d, v) {
8397
+ d.second = v;
8398
+ }],
8399
+ yyyy: [fourDigits, function (d, v) {
8400
+ d.year = v;
8401
+ }],
8402
+ S: ['\\d', function (d, v) {
8403
+ d.millisecond = v * 100;
8404
+ }],
8405
+ SS: ['\\d{2}', function (d, v) {
8406
+ d.millisecond = v * 10;
8407
+ }],
8408
+ SSS: [threeDigits, function (d, v) {
8409
+ d.millisecond = v;
8410
+ }],
8411
+ D: [twoDigits, noop],
8412
+ ddd: [word, noop],
8413
+ MMM: [word, monthUpdate('monthNamesShort')],
8414
+ MMMM: [word, monthUpdate('monthNames')],
8415
+ a: [word, function (d, v) {
8416
+ var val = v.toLowerCase();
8417
+ if (val === '上午') {
8418
+ d.isPm = false;
8419
+ } else if (val === '下午') {
8420
+ d.isPm = true;
8421
+ }
8422
+ }],
8423
+ ZZ: ['[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z', function (d, v) {
8424
+ var parts = (v + '').match(/([+-]|\d\d)/gi),
8425
+ minutes = void 0;
8426
+
8427
+ if (parts) {
8428
+ minutes = +(parts[1] * 60) + parseInt(parts[2], 10);
8429
+ d.timezoneOffset = parts[0] === '+' ? minutes : -minutes;
8430
+ }
8431
+ }]
8432
+ };
8433
+ parseFlags.dd = parseFlags.d;
8434
+ parseFlags.dddd = parseFlags.ddd;
8435
+ parseFlags.DD = parseFlags.D;
8436
+ parseFlags.mm = parseFlags.m;
8437
+ parseFlags.hh = parseFlags.H = parseFlags.HH = parseFlags.h;
8438
+ parseFlags.MM = parseFlags.M;
8439
+ parseFlags.ss = parseFlags.s;
8440
+ parseFlags.A = parseFlags.a;
8441
+
8442
+ // Some common format strings
8443
+ fecha.masks = {
8444
+ default: 'ddd MMM dd yyyy HH:mm:ss',
8445
+ shortDate: 'M/D/yy',
8446
+ mediumDate: 'MMM d, yyyy',
8447
+ longDate: 'MMMM d, yyyy',
8448
+ fullDate: 'dddd, MMMM d, yyyy',
8449
+ shortTime: 'HH:mm',
8450
+ mediumTime: 'HH:mm:ss',
8451
+ longTime: 'HH:mm:ss.SSS'
8452
+ };
8453
+
8480
8454
  /***
8481
8455
  * Format a date
8482
8456
  * @method format
8483
8457
  * @param {Date|number} dateObj
8484
8458
  * @param {string} mask Format of the date, i.e. 'mm-dd-yy' or 'shortDate'
8485
- */
8486
- fecha.format = function (dateObj, mask) {
8487
- if (typeof dateObj === 'number') {
8488
- dateObj = new Date(dateObj);
8489
- }
8490
-
8491
- if (Object.prototype.toString.call(dateObj) !== '[object Date]' || isNaN(dateObj.getTime())) {
8492
- throw new Error('Invalid Date in fecha.format');
8493
- }
8494
-
8495
- mask = fecha.masks[mask] || mask || fecha.masks['default'];
8496
-
8497
- const literals = [];
8498
-
8499
- // Make literals inactive by replacing them with ??
8500
- mask = mask.replace(literal, function($0, $1) {
8501
- literals.push($1);
8502
- return '@@@';
8503
- });
8504
- // Apply formatting rules
8505
- mask = mask.replace(token, function ($0) {
8506
- return $0 in formatFlags ? formatFlags[$0](dateObj) : $0.slice(1, $0.length - 1);
8507
- });
8508
- // Inline literal values back into the formatted value
8509
- return mask.replace(/@@@/g, function() {
8510
- return literals.shift();
8511
- });
8512
- };
8513
-
8459
+ */
8460
+ fecha.format = function (dateObj, mask) {
8461
+ if (typeof dateObj === 'number') {
8462
+ dateObj = new Date(dateObj);
8463
+ }
8464
+
8465
+ if (Object.prototype.toString.call(dateObj) !== '[object Date]' || isNaN(dateObj.getTime())) {
8466
+ throw new Error('Invalid Date in fecha.format');
8467
+ }
8468
+
8469
+ mask = fecha.masks[mask] || mask || fecha.masks['default'];
8470
+
8471
+ var literals = [];
8472
+
8473
+ // Make literals inactive by replacing them with ??
8474
+ mask = mask.replace(literal, function ($0, $1) {
8475
+ literals.push($1);
8476
+ return '@@@';
8477
+ });
8478
+ // Apply formatting rules
8479
+ mask = mask.replace(token, function ($0) {
8480
+ return $0 in formatFlags ? formatFlags[$0](dateObj) : $0.slice(1, $0.length - 1);
8481
+ });
8482
+ // Inline literal values back into the formatted value
8483
+ return mask.replace(/@@@/g, function () {
8484
+ return literals.shift();
8485
+ });
8486
+ };
8487
+
8514
8488
  /**
8515
8489
  * Parse a date string into an object, changes - into /
8516
8490
  * @method parse
8517
8491
  * @param {string} dateStr Date string
8518
8492
  * @param {string} format Date parse format
8519
8493
  * @returns {Date|boolean}
8520
- */
8521
- fecha.parse = function (dateStr, format) {
8522
- if (typeof format !== 'string') {
8523
- throw new Error('Invalid format in fecha.parse');
8524
- }
8525
-
8526
- format = fecha.masks[format] || format;
8527
-
8528
- // Avoid regular expression denial of service, fail early for really long strings
8529
- // https://www.owasp.org/index.php/Regular_expression_Denial_of_Service_-_ReDoS
8530
- if (dateStr.length > 1000) {
8531
- return null;
8532
- }
8533
-
8534
- const dateInfo = {};
8535
- const parseInfo = [];
8536
- const literals = [];
8537
- format = format.replace(literal, function($0, $1) {
8538
- literals.push($1);
8539
- return '@@@';
8540
- });
8541
- let newFormat = regexEscape(format).replace(token, function ($0) {
8542
- if (parseFlags[$0]) {
8543
- const info = parseFlags[$0];
8544
- parseInfo.push(info[1]);
8545
- return '(' + info[0] + ')';
8546
- }
8547
-
8548
- return $0;
8549
- });
8550
- newFormat = newFormat.replace(/@@@/g, function() {
8551
- return literals.shift();
8552
- });
8553
- const matches = dateStr.match(new RegExp(newFormat, 'i'));
8554
- if (!matches) {
8555
- return null;
8556
- }
8557
-
8558
- for (let i = 1; i < matches.length; i++) {
8559
- parseInfo[i - 1](dateInfo, matches[i]);
8560
- }
8561
-
8562
- const today = new Date();
8563
- if (dateInfo.isPm === true && dateInfo.hour != null && +dateInfo.hour !== 12) {
8564
- dateInfo.hour = +dateInfo.hour + 12;
8565
- } else if (dateInfo.isPm === false && +dateInfo.hour === 12) {
8566
- dateInfo.hour = 0;
8567
- }
8568
-
8569
- let date;
8570
- if (dateInfo.timezoneOffset != null) {
8571
- dateInfo.minute = +(dateInfo.minute || 0) - +dateInfo.timezoneOffset;
8572
- date = new Date(Date.UTC(dateInfo.year || today.getFullYear(), dateInfo.month || 0, dateInfo.day || 1,
8573
- dateInfo.hour || 0, dateInfo.minute || 0, dateInfo.second || 0, dateInfo.millisecond || 0));
8574
- } else {
8575
- date = new Date(dateInfo.year || today.getFullYear(), dateInfo.month || 0, dateInfo.day || 1,
8576
- dateInfo.hour || 0, dateInfo.minute || 0, dateInfo.second || 0, dateInfo.millisecond || 0);
8577
- }
8578
- return date;
8579
- };
8580
-
8581
- // 导出fecha对象
8582
-
8583
-
8584
- // 以下是从date-util.js合并的函数
8585
- const newArray = function(start, end) {
8586
- let result = [];
8587
- for (let i = start; i <= end; i++) {
8588
- result.push(i);
8589
- }
8590
- return result;
8591
- };
8592
-
8593
- const getSettings = () => {
8594
- return {
8595
- dayNamesShort: ['日', '一', '二', '三', '四', '五', '六'],
8596
- dayNames: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
8597
- monthNamesShort: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
8598
- monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
8599
- amPm: ['上午', '下午']
8600
- };
8601
- };
8602
-
8603
- const toDate = function(date) {
8604
- return isDate(date) ? new Date(date) : null;
8605
- };
8606
-
8607
- const isDate = function(date) {
8608
- if (date === null || date === undefined) return false;
8609
- if (isNaN(new Date(date).getTime())) return false;
8610
- if (Array.isArray(date)) return false; // deal with `new Date([ new Date() ]) -> new Date()`
8611
- return true;
8612
- };
8613
-
8614
- const isDateObject = function(val) {
8615
- return val instanceof Date;
8616
- };
8617
-
8618
- const formatDate = function (date, format = 'yyyy-MM-dd') {
8619
- // 处理多种输入类型
8620
- if (!date) return '';
8621
-
8622
- // 如果是时间戳,转成日期对象
8623
- if (typeof date === 'number') {
8624
- date = new Date(date);
8625
- }
8626
- // 如果是字符串,转成日期对象
8627
- if (typeof date === 'string') {
8628
- date = new Date(date);
8629
- }
8630
-
8631
- // 调用toDate进一步验证和转换
8632
- date = toDate(date);
8633
- if (!date) return '';
8634
-
8635
- // 兼容大写和小写的格式标记
8636
- // 将大写的YYYY/MM/DD/HH/mm/ss转换为小写的yyyy/mm/dd/hh/mm/ss
8637
- const lowercaseFormat = format
8638
- .replace(/YYYY/g, 'yyyy')
8639
- .replace(/D/g, 'd')
8640
-
8641
- // 使用fecha库进行格式化,支持中文配置
8642
- const str = fecha.format(date, lowercaseFormat, getSettings());
8643
- return str;
8644
- };
8645
-
8646
- const parseDate = function(string, format) {
8647
- return fecha.parse(string, format || 'yyyy-MM-dd', getSettings());
8648
- };
8649
-
8650
- const getDayCountOfMonth = function(year, month) {
8651
- if (month === 3 || month === 5 || month === 8 || month === 10) {
8652
- return 30;
8653
- }
8654
-
8655
- if (month === 1) {
8656
- if (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0) {
8657
- return 29;
8658
- } else {
8659
- return 28;
8660
- }
8661
- }
8662
-
8663
- return 31;
8664
- };
8665
-
8666
- const getDayCountOfYear = function(year) {
8667
- const isLeapYear = year % 400 === 0 || (year % 100 !== 0 && year % 4 === 0);
8668
- return isLeapYear ? 366 : 365;
8669
- };
8670
-
8671
- const getFirstDayOfMonth = function(date) {
8672
- const temp = new Date(date.getTime());
8673
- temp.setDate(1);
8674
- return temp.getDay();
8675
- };
8676
-
8677
- // see: https://stackoverflow.com/questions/3674539/incrementing-a-date-in-javascript
8678
- // {prev, next} Date should work for Daylight Saving Time
8679
- // Adding 24 * 60 * 60 * 1000 does not work in the above scenario
8680
- const prevDate = function(date, amount = 1) {
8681
- return new Date(date.getFullYear(), date.getMonth(), date.getDate() - amount);
8682
- };
8683
-
8684
- const nextDate = function(date, amount = 1) {
8685
- return new Date(date.getFullYear(), date.getMonth(), date.getDate() + amount);
8686
- };
8687
-
8688
- const getStartDateOfMonth = function(year, month) {
8689
- const result = new Date(year, month, 1);
8690
- const day = result.getDay();
8691
-
8692
- if (day === 0) {
8693
- return prevDate(result, 7);
8694
- } else {
8695
- return prevDate(result, day);
8696
- }
8697
- };
8698
-
8699
- const getWeekNumber = function(date) {
8700
- // 支持多种输入类型
8701
- if (!date||!isDate(date)) {
8702
- date = new Date();
8703
- }
8704
- if (typeof date === 'string') {
8705
- date = new Date(date);
8706
- }
8707
-
8708
- // 验证日期有效性
8709
- if (!isDate(date)) return null;
8710
-
8711
- const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));
8712
- // 设置为最近的星期四:当前日期 + 4 - 当前星期数
8713
- // 将星期日的星期数设为7
8714
- d.setUTCDate(d.getUTCDate() + 4 - (d.getUTCDay() || 7));
8715
- // 获取当年的第一天
8716
- const yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));
8717
- // 计算到最近的星期四的完整周数
8718
- const weekNo = Math.ceil((((d - yearStart) / 86400000) + 1) / 7);
8719
- // 返回周数
8720
- return weekNo;
8721
- };
8722
-
8723
- const getRangeHours = function(ranges) {
8724
- const hours = [];
8725
- let disabledHours = [];
8726
-
8727
- (ranges || []).forEach(range => {
8728
- const value = range.map(date => date.getHours());
8729
-
8730
- disabledHours = disabledHours.concat(newArray(value[0], value[1]));
8731
- });
8732
-
8733
- if (disabledHours.length) {
8734
- for (let i = 0; i < 24; i++) {
8735
- hours[i] = disabledHours.indexOf(i) === -1;
8736
- }
8737
- } else {
8738
- for (let i = 0; i < 24; i++) {
8739
- hours[i] = false;
8740
- }
8741
- }
8742
-
8743
- return hours;
8744
- };
8745
-
8746
- const getPrevMonthLastDays = (date, amount) => {
8747
- if (amount <= 0) return [];
8748
- const temp = new Date(date.getTime());
8749
- temp.setDate(0);
8750
- const lastDay = temp.getDate();
8751
- return range(amount).map((_, index) => lastDay - (amount - index - 1));
8752
- };
8753
-
8754
- const getMonthDays = (date) => {
8755
- const temp = new Date(date.getFullYear(), date.getMonth() + 1, 0);
8756
- const days = temp.getDate();
8757
- return range(days).map((_, index) => index + 1);
8758
- };
8759
-
8760
- function setRangeData(arr, start, end, value) {
8761
- for (let i = start; i < end; i++) {
8762
- arr[i] = value;
8763
- }
8764
- }
8765
-
8766
- const getRangeMinutes = function(ranges, hour) {
8767
- const minutes = new Array(60);
8768
-
8769
- if (ranges.length > 0) {
8770
- ranges.forEach(range => {
8771
- const start = range[0];
8772
- const end = range[1];
8773
- const startHour = start.getHours();
8774
- const startMinute = start.getMinutes();
8775
- const endHour = end.getHours();
8776
- const endMinute = end.getMinutes();
8777
- if (startHour === hour && endHour !== hour) {
8778
- setRangeData(minutes, startMinute, 60, true);
8779
- } else if (startHour === hour && endHour === hour) {
8780
- setRangeData(minutes, startMinute, endMinute + 1, true);
8781
- } else if (startHour !== hour && endHour === hour) {
8782
- setRangeData(minutes, 0, endMinute + 1, true);
8783
- } else if (startHour < hour && endHour > hour) {
8784
- setRangeData(minutes, 0, 60, true);
8785
- }
8786
- });
8787
- } else {
8788
- setRangeData(minutes, 0, 60, true);
8789
- }
8790
- return minutes;
8791
- };
8792
-
8793
- const range = function(n) {
8794
- // see https://stackoverflow.com/questions/3746725/create-a-javascript-array-containing-1-n
8795
- return Array.apply(null, {length: n}).map((_, n) => n);
8796
- };
8797
-
8798
- const modifyDate = function(date, y, m, d) {
8799
- return new Date(y, m, d, date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
8800
- };
8801
-
8802
- const modifyTime = function(date, h, m, s) {
8803
- return new Date(date.getFullYear(), date.getMonth(), date.getDate(), h, m, s, date.getMilliseconds());
8804
- };
8805
-
8806
- const modifyWithTimeString = (date, time) => {
8807
- if (date == null || !time) {
8808
- return date;
8809
- }
8810
- time = parseDate(time, 'HH:mm:ss');
8811
- return modifyTime(date, time.getHours(), time.getMinutes(), time.getSeconds());
8812
- };
8813
-
8814
- const clearTime = function(date) {
8815
- return new Date(date.getFullYear(), date.getMonth(), date.getDate());
8816
- };
8817
-
8818
- const clearMilliseconds = function(date) {
8819
- return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), 0);
8820
- };
8821
-
8822
- const limitTimeRange = function(date, ranges, format = 'HH:mm:ss') {
8823
- // TODO: refactory a more elegant solution
8824
- if (ranges.length === 0) return date;
8825
- const normalizeDate = date => fecha.parse(fecha.format(date, format), format);
8826
- const ndate = normalizeDate(date);
8827
- const nranges = ranges.map(range => range.map(normalizeDate));
8828
- if (nranges.some(nrange => ndate >= nrange[0] && ndate <= nrange[1])) return date;
8829
-
8830
- let minDate = nranges[0][0];
8831
- let maxDate = nranges[0][0];
8832
-
8833
- nranges.forEach(nrange => {
8834
- minDate = new Date(Math.min(nrange[0], minDate));
8835
- maxDate = new Date(Math.max(nrange[1], minDate));
8836
- });
8837
-
8838
- const ret = ndate < minDate ? minDate : maxDate;
8839
- // preserve Year/Month/Date
8840
- return modifyDate(
8841
- ret,
8842
- date.getFullYear(),
8843
- date.getMonth(),
8844
- date.getDate()
8845
- );
8846
- };
8847
-
8848
- const timeWithinRange = function(date, selectableRange, format) {
8849
- const limitedDate = limitTimeRange(date, selectableRange, format);
8850
- return limitedDate.getTime() === date.getTime();
8851
- };
8852
-
8853
- const changeYearMonthAndClampDate = function(date, year, month) {
8854
- // clamp date to the number of days in `year`, `month`
8855
- // eg: (2010-1-31, 2010, 2) => 2010-2-28
8856
- const monthDate = Math.min(date.getDate(), getDayCountOfMonth(year, month));
8857
- return modifyDate(date, year, month, monthDate);
8858
- };
8859
-
8860
- const prevMonth = function(date) {
8861
- const year = date.getFullYear();
8862
- const month = date.getMonth();
8863
- return month === 0
8864
- ? changeYearMonthAndClampDate(date, year - 1, 11)
8865
- : changeYearMonthAndClampDate(date, year, month - 1);
8866
- };
8867
-
8868
- const nextMonth = function(date) {
8869
- const year = date.getFullYear();
8870
- const month = date.getMonth();
8871
- return month === 11
8872
- ? changeYearMonthAndClampDate(date, year + 1, 0)
8873
- : changeYearMonthAndClampDate(date, year, month + 1);
8874
- };
8875
-
8876
- const prevYear = function(date, amount = 1) {
8877
- const year = date.getFullYear();
8878
- const month = date.getMonth();
8879
- return changeYearMonthAndClampDate(date, year - amount, month);
8880
- };
8881
-
8882
- const nextYear = function(date, amount = 1) {
8883
- const year = date.getFullYear();
8884
- const month = date.getMonth();
8885
- return changeYearMonthAndClampDate(date, year + amount, month);
8886
- };
8887
-
8888
- const extractDateFormat = function(format) {
8889
- return format
8890
- .replace(/\W?m{1,2}|\W?ZZ/g, '')
8891
- .replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi, '')
8892
- .trim();
8893
- };
8894
-
8895
- const extractTimeFormat = function(format) {
8896
- return format
8897
- .replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?y{2,4}/g, '')
8898
- .trim();
8899
- };
8900
-
8901
- const validateRangeInOneMonth = function(start, end) {
8902
- return (start.getMonth() === end.getMonth()) && (start.getFullYear() === end.getFullYear());
8903
- };
8904
-
8494
+ */
8495
+ fecha.parse = function (dateStr, format) {
8496
+ if (typeof format !== 'string') {
8497
+ throw new Error('Invalid format in fecha.parse');
8498
+ }
8499
+
8500
+ format = fecha.masks[format] || format;
8501
+
8502
+ // Avoid regular expression denial of service, fail early for really long strings
8503
+ // https://www.owasp.org/index.php/Regular_expression_Denial_of_Service_-_ReDoS
8504
+ if (dateStr.length > 1000) {
8505
+ return null;
8506
+ }
8507
+
8508
+ var dateInfo = {};
8509
+ var parseInfo = [];
8510
+ var literals = [];
8511
+ format = format.replace(literal, function ($0, $1) {
8512
+ literals.push($1);
8513
+ return '@@@';
8514
+ });
8515
+ var newFormat = regexEscape(format).replace(token, function ($0) {
8516
+ if (parseFlags[$0]) {
8517
+ var info = parseFlags[$0];
8518
+ parseInfo.push(info[1]);
8519
+ return '(' + info[0] + ')';
8520
+ }
8521
+
8522
+ return $0;
8523
+ });
8524
+ newFormat = newFormat.replace(/@@@/g, function () {
8525
+ return literals.shift();
8526
+ });
8527
+ var matches = dateStr.match(new RegExp(newFormat, 'i'));
8528
+ if (!matches) {
8529
+ return null;
8530
+ }
8531
+
8532
+ for (var i = 1; i < matches.length; i++) {
8533
+ parseInfo[i - 1](dateInfo, matches[i]);
8534
+ }
8535
+
8536
+ var today = new Date();
8537
+ if (dateInfo.isPm === true && dateInfo.hour != null && +dateInfo.hour !== 12) {
8538
+ dateInfo.hour = +dateInfo.hour + 12;
8539
+ } else if (dateInfo.isPm === false && +dateInfo.hour === 12) {
8540
+ dateInfo.hour = 0;
8541
+ }
8542
+
8543
+ var date = void 0;
8544
+ if (dateInfo.timezoneOffset != null) {
8545
+ dateInfo.minute = +(dateInfo.minute || 0) - +dateInfo.timezoneOffset;
8546
+ date = new Date(Date.UTC(dateInfo.year || today.getFullYear(), dateInfo.month || 0, dateInfo.day || 1, dateInfo.hour || 0, dateInfo.minute || 0, dateInfo.second || 0, dateInfo.millisecond || 0));
8547
+ } else {
8548
+ date = new Date(dateInfo.year || today.getFullYear(), dateInfo.month || 0, dateInfo.day || 1, dateInfo.hour || 0, dateInfo.minute || 0, dateInfo.second || 0, dateInfo.millisecond || 0);
8549
+ }
8550
+ return date;
8551
+ };
8552
+
8553
+ // 导出fecha对象
8554
+
8555
+
8556
+ // 以下是从date-util.js合并的函数
8557
+ var newArray = function newArray(start, end) {
8558
+ var result = [];
8559
+ for (var i = start; i <= end; i++) {
8560
+ result.push(i);
8561
+ }
8562
+ return result;
8563
+ };
8564
+
8565
+ var getSettings = function getSettings() {
8566
+ return {
8567
+ dayNamesShort: ['日', '一', '二', '三', '四', '五', '六'],
8568
+ dayNames: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
8569
+ monthNamesShort: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
8570
+ monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
8571
+ amPm: ['上午', '下午']
8572
+ };
8573
+ };
8574
+
8575
+ var toDate = function toDate(date) {
8576
+ return isDate(date) ? new Date(date) : null;
8577
+ };
8578
+
8579
+ var isDate = function isDate(date) {
8580
+ if (date === null || date === undefined) return false;
8581
+ if (isNaN(new Date(date).getTime())) return false;
8582
+ if (Array.isArray(date)) return false; // deal with `new Date([ new Date() ]) -> new Date()`
8583
+ return true;
8584
+ };
8585
+
8586
+ var isDateObject = function isDateObject(val) {
8587
+ return val instanceof Date;
8588
+ };
8589
+
8590
+ var formatDate = function formatDate(date) {
8591
+ var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-MM-dd';
8592
+
8593
+ // 处理多种输入类型
8594
+ if (!date) return '';
8595
+
8596
+ // 如果是时间戳,转成日期对象
8597
+ if (typeof date === 'number') {
8598
+ date = new Date(date);
8599
+ }
8600
+ // 如果是字符串,转成日期对象
8601
+ if (typeof date === 'string') {
8602
+ date = new Date(date);
8603
+ }
8604
+
8605
+ // 调用toDate进一步验证和转换
8606
+ date = toDate(date);
8607
+ if (!date) return '';
8608
+
8609
+ // 兼容大写和小写的格式标记
8610
+ // 将大写的YYYY/MM/DD/HH/mm/ss转换为小写的yyyy/mm/dd/hh/mm/ss
8611
+ var lowercaseFormat = format.replace(/YYYY/g, 'yyyy').replace(/D/g, 'd');
8612
+
8613
+ // 使用fecha库进行格式化,支持中文配置
8614
+ var str = fecha.format(date, lowercaseFormat, getSettings());
8615
+ return str;
8616
+ };
8617
+
8618
+ var parseDate = function parseDate(string, format) {
8619
+ return fecha.parse(string, format || 'yyyy-MM-dd', getSettings());
8620
+ };
8621
+
8622
+ var getDayCountOfMonth = function getDayCountOfMonth(year, month) {
8623
+ if (month === 3 || month === 5 || month === 8 || month === 10) {
8624
+ return 30;
8625
+ }
8626
+
8627
+ if (month === 1) {
8628
+ if (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0) {
8629
+ return 29;
8630
+ } else {
8631
+ return 28;
8632
+ }
8633
+ }
8634
+
8635
+ return 31;
8636
+ };
8637
+
8638
+ var getDayCountOfYear = function getDayCountOfYear(year) {
8639
+ var isLeapYear = year % 400 === 0 || year % 100 !== 0 && year % 4 === 0;
8640
+ return isLeapYear ? 366 : 365;
8641
+ };
8642
+
8643
+ var getFirstDayOfMonth = function getFirstDayOfMonth(date) {
8644
+ var temp = new Date(date.getTime());
8645
+ temp.setDate(1);
8646
+ return temp.getDay();
8647
+ };
8648
+
8649
+ // see: https://stackoverflow.com/questions/3674539/incrementing-a-date-in-javascript
8650
+ // {prev, next} Date should work for Daylight Saving Time
8651
+ // Adding 24 * 60 * 60 * 1000 does not work in the above scenario
8652
+ var prevDate = function prevDate(date) {
8653
+ var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
8654
+
8655
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate() - amount);
8656
+ };
8657
+
8658
+ var nextDate = function nextDate(date) {
8659
+ var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
8660
+
8661
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate() + amount);
8662
+ };
8663
+
8664
+ var getStartDateOfMonth = function getStartDateOfMonth(year, month) {
8665
+ var result = new Date(year, month, 1);
8666
+ var day = result.getDay();
8667
+
8668
+ if (day === 0) {
8669
+ return prevDate(result, 7);
8670
+ } else {
8671
+ return prevDate(result, day);
8672
+ }
8673
+ };
8674
+
8675
+ var getWeekNumber = function getWeekNumber(date) {
8676
+ // 支持多种输入类型
8677
+ if (!date || !isDate(date)) {
8678
+ date = new Date();
8679
+ }
8680
+ if (typeof date === 'string') {
8681
+ date = new Date(date);
8682
+ }
8683
+
8684
+ // 验证日期有效性
8685
+ if (!isDate(date)) return null;
8686
+
8687
+ var d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));
8688
+ // 设置为最近的星期四:当前日期 + 4 - 当前星期数
8689
+ // 将星期日的星期数设为7
8690
+ d.setUTCDate(d.getUTCDate() + 4 - (d.getUTCDay() || 7));
8691
+ // 获取当年的第一天
8692
+ var yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));
8693
+ // 计算到最近的星期四的完整周数
8694
+ var weekNo = Math.ceil(((d - yearStart) / 86400000 + 1) / 7);
8695
+ // 返回周数
8696
+ return weekNo;
8697
+ };
8698
+
8699
+ var getRangeHours = function getRangeHours(ranges) {
8700
+ var hours = [];
8701
+ var disabledHours = [];
8702
+
8703
+ (ranges || []).forEach(function (range) {
8704
+ var value = range.map(function (date) {
8705
+ return date.getHours();
8706
+ });
8707
+
8708
+ disabledHours = disabledHours.concat(newArray(value[0], value[1]));
8709
+ });
8710
+
8711
+ if (disabledHours.length) {
8712
+ for (var i = 0; i < 24; i++) {
8713
+ hours[i] = disabledHours.indexOf(i) === -1;
8714
+ }
8715
+ } else {
8716
+ for (var _i = 0; _i < 24; _i++) {
8717
+ hours[_i] = false;
8718
+ }
8719
+ }
8720
+
8721
+ return hours;
8722
+ };
8723
+
8724
+ var getPrevMonthLastDays = function getPrevMonthLastDays(date, amount) {
8725
+ if (amount <= 0) return [];
8726
+ var temp = new Date(date.getTime());
8727
+ temp.setDate(0);
8728
+ var lastDay = temp.getDate();
8729
+ return range(amount).map(function (_, index) {
8730
+ return lastDay - (amount - index - 1);
8731
+ });
8732
+ };
8733
+
8734
+ var getMonthDays = function getMonthDays(date) {
8735
+ var temp = new Date(date.getFullYear(), date.getMonth() + 1, 0);
8736
+ var days = temp.getDate();
8737
+ return range(days).map(function (_, index) {
8738
+ return index + 1;
8739
+ });
8740
+ };
8741
+
8742
+ function setRangeData(arr, start, end, value) {
8743
+ for (var i = start; i < end; i++) {
8744
+ arr[i] = value;
8745
+ }
8746
+ }
8747
+
8748
+ var getRangeMinutes = function getRangeMinutes(ranges, hour) {
8749
+ var minutes = new Array(60);
8750
+
8751
+ if (ranges.length > 0) {
8752
+ ranges.forEach(function (range) {
8753
+ var start = range[0];
8754
+ var end = range[1];
8755
+ var startHour = start.getHours();
8756
+ var startMinute = start.getMinutes();
8757
+ var endHour = end.getHours();
8758
+ var endMinute = end.getMinutes();
8759
+ if (startHour === hour && endHour !== hour) {
8760
+ setRangeData(minutes, startMinute, 60, true);
8761
+ } else if (startHour === hour && endHour === hour) {
8762
+ setRangeData(minutes, startMinute, endMinute + 1, true);
8763
+ } else if (startHour !== hour && endHour === hour) {
8764
+ setRangeData(minutes, 0, endMinute + 1, true);
8765
+ } else if (startHour < hour && endHour > hour) {
8766
+ setRangeData(minutes, 0, 60, true);
8767
+ }
8768
+ });
8769
+ } else {
8770
+ setRangeData(minutes, 0, 60, true);
8771
+ }
8772
+ return minutes;
8773
+ };
8774
+
8775
+ var range = function range(n) {
8776
+ // see https://stackoverflow.com/questions/3746725/create-a-javascript-array-containing-1-n
8777
+ return Array.apply(null, { length: n }).map(function (_, n) {
8778
+ return n;
8779
+ });
8780
+ };
8781
+
8782
+ var modifyDate = function modifyDate(date, y, m, d) {
8783
+ return new Date(y, m, d, date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
8784
+ };
8785
+
8786
+ var modifyTime = function modifyTime(date, h, m, s) {
8787
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate(), h, m, s, date.getMilliseconds());
8788
+ };
8789
+
8790
+ var modifyWithTimeString = function modifyWithTimeString(date, time) {
8791
+ if (date == null || !time) {
8792
+ return date;
8793
+ }
8794
+ time = parseDate(time, 'HH:mm:ss');
8795
+ return modifyTime(date, time.getHours(), time.getMinutes(), time.getSeconds());
8796
+ };
8797
+
8798
+ var clearTime = function clearTime(date) {
8799
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate());
8800
+ };
8801
+
8802
+ var clearMilliseconds = function clearMilliseconds(date) {
8803
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), 0);
8804
+ };
8805
+
8806
+ var limitTimeRange = function limitTimeRange(date, ranges) {
8807
+ var format = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'HH:mm:ss';
8808
+
8809
+ // TODO: refactory a more elegant solution
8810
+ if (ranges.length === 0) return date;
8811
+ var normalizeDate = function normalizeDate(date) {
8812
+ return fecha.parse(fecha.format(date, format), format);
8813
+ };
8814
+ var ndate = normalizeDate(date);
8815
+ var nranges = ranges.map(function (range) {
8816
+ return range.map(normalizeDate);
8817
+ });
8818
+ if (nranges.some(function (nrange) {
8819
+ return ndate >= nrange[0] && ndate <= nrange[1];
8820
+ })) return date;
8821
+
8822
+ var minDate = nranges[0][0];
8823
+ var maxDate = nranges[0][0];
8824
+
8825
+ nranges.forEach(function (nrange) {
8826
+ minDate = new Date(Math.min(nrange[0], minDate));
8827
+ maxDate = new Date(Math.max(nrange[1], minDate));
8828
+ });
8829
+
8830
+ var ret = ndate < minDate ? minDate : maxDate;
8831
+ // preserve Year/Month/Date
8832
+ return modifyDate(ret, date.getFullYear(), date.getMonth(), date.getDate());
8833
+ };
8834
+
8835
+ var timeWithinRange = function timeWithinRange(date, selectableRange, format) {
8836
+ var limitedDate = limitTimeRange(date, selectableRange, format);
8837
+ return limitedDate.getTime() === date.getTime();
8838
+ };
8839
+
8840
+ var changeYearMonthAndClampDate = function changeYearMonthAndClampDate(date, year, month) {
8841
+ // clamp date to the number of days in `year`, `month`
8842
+ // eg: (2010-1-31, 2010, 2) => 2010-2-28
8843
+ var monthDate = Math.min(date.getDate(), getDayCountOfMonth(year, month));
8844
+ return modifyDate(date, year, month, monthDate);
8845
+ };
8846
+
8847
+ var prevMonth = function prevMonth(date) {
8848
+ var year = date.getFullYear();
8849
+ var month = date.getMonth();
8850
+ return month === 0 ? changeYearMonthAndClampDate(date, year - 1, 11) : changeYearMonthAndClampDate(date, year, month - 1);
8851
+ };
8852
+
8853
+ var nextMonth = function nextMonth(date) {
8854
+ var year = date.getFullYear();
8855
+ var month = date.getMonth();
8856
+ return month === 11 ? changeYearMonthAndClampDate(date, year + 1, 0) : changeYearMonthAndClampDate(date, year, month + 1);
8857
+ };
8858
+
8859
+ var prevYear = function prevYear(date) {
8860
+ var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
8861
+
8862
+ var year = date.getFullYear();
8863
+ var month = date.getMonth();
8864
+ return changeYearMonthAndClampDate(date, year - amount, month);
8865
+ };
8866
+
8867
+ var nextYear = function nextYear(date) {
8868
+ var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
8869
+
8870
+ var year = date.getFullYear();
8871
+ var month = date.getMonth();
8872
+ return changeYearMonthAndClampDate(date, year + amount, month);
8873
+ };
8874
+
8875
+ var extractDateFormat = function extractDateFormat(format) {
8876
+ return format.replace(/\W?m{1,2}|\W?ZZ/g, '').replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi, '').trim();
8877
+ };
8878
+
8879
+ var extractTimeFormat = function extractTimeFormat(format) {
8880
+ return format.replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?y{2,4}/g, '').trim();
8881
+ };
8882
+
8883
+ var validateRangeInOneMonth = function validateRangeInOneMonth(start, end) {
8884
+ return start.getMonth() === end.getMonth() && start.getFullYear() === end.getFullYear();
8885
+ };
8886
+
8905
8887
  /**
8906
8888
  * 计算两个日期之间的工作日数量(不包括周末和节假日)
8907
8889
  * @param {string} start_date - 开始日期字符串,格式为 "YYYY-MM-DD"
8908
8890
  * @param {string} end_date - 结束日期字符串,格式为 "YYYY-MM-DD"
8909
8891
  * @param {Array<string>} holidays - 假期日期字符串数组,格式为 "YYYY-MM-DD"
8910
8892
  * @returns {number} 工作日数量
8911
- */
8912
- const calculateNetworkDays = function (start_date, end_date, holidays = []) {
8913
- if (typeof start_date !== 'string' || typeof end_date !== 'string') {
8914
- throw new Error(
8915
- "Invalid input. Please provide valid date strings in the format 'YYYY-MM-DD'."
8916
- );
8917
- }
8918
-
8919
- const startDateObj = new Date(start_date);
8920
- const endDateObj = new Date(end_date);
8921
-
8922
- if (isNaN(startDateObj.getTime()) || isNaN(endDateObj.getTime())) {
8923
- throw new Error(
8924
- "Invalid date format. Please provide valid date strings in the format 'YYYY-MM-DD'."
8925
- );
8926
- }
8927
-
8928
- if (startDateObj > endDateObj) {
8929
- throw new Error('Start date should be earlier than or equal to end date.');
8930
- }
8931
-
8932
- let workdays = 0;
8933
-
8934
- // Iterate through each day in the date range
8935
- for (
8936
- let currentDate = new Date(startDateObj);
8937
- currentDate <= endDateObj;
8938
- currentDate.setDate(currentDate.getDate() + 1)
8939
- ) {
8940
- // Check if the current day is a weekend (Saturday or Sunday)
8941
- const isWeekend = currentDate.getDay() === 0 || currentDate.getDay() === 6;
8942
-
8943
- // Check if the current day is a holiday
8944
- const isHoliday = holidays.some((holiday) => {
8945
- const holidayDate = new Date(holiday);
8946
- return currentDate.toDateString() === holidayDate.toDateString();
8947
- });
8948
-
8949
- // If it's a workday (not a weekend or holiday), increment the workdays count
8950
- if (!isWeekend && !isHoliday) {
8951
- workdays++;
8952
- }
8953
- }
8954
-
8955
- return workdays;
8956
- };
8957
-
8893
+ */
8894
+ var calculateNetworkDays = function calculateNetworkDays(start_date, end_date) {
8895
+ var holidays = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
8896
+
8897
+ if (typeof start_date !== 'string' || typeof end_date !== 'string') {
8898
+ throw new Error("Invalid input. Please provide valid date strings in the format 'YYYY-MM-DD'.");
8899
+ }
8900
+
8901
+ var startDateObj = new Date(start_date);
8902
+ var endDateObj = new Date(end_date);
8903
+
8904
+ if (isNaN(startDateObj.getTime()) || isNaN(endDateObj.getTime())) {
8905
+ throw new Error("Invalid date format. Please provide valid date strings in the format 'YYYY-MM-DD'.");
8906
+ }
8907
+
8908
+ if (startDateObj > endDateObj) {
8909
+ throw new Error('Start date should be earlier than or equal to end date.');
8910
+ }
8911
+
8912
+ var workdays = 0;
8913
+
8914
+ // Iterate through each day in the date range
8915
+
8916
+ var _loop = function _loop(currentDate) {
8917
+ // Check if the current day is a weekend (Saturday or Sunday)
8918
+ var isWeekend = currentDate.getDay() === 0 || currentDate.getDay() === 6;
8919
+
8920
+ // Check if the current day is a holiday
8921
+ var isHoliday = holidays.some(function (holiday) {
8922
+ var holidayDate = new Date(holiday);
8923
+ return currentDate.toDateString() === holidayDate.toDateString();
8924
+ });
8925
+
8926
+ // If it's a workday (not a weekend or holiday), increment the workdays count
8927
+ if (!isWeekend && !isHoliday) {
8928
+ workdays++;
8929
+ }
8930
+ };
8931
+
8932
+ for (var currentDate = new Date(startDateObj); currentDate <= endDateObj; currentDate.setDate(currentDate.getDate() + 1)) {
8933
+ _loop(currentDate);
8934
+ }
8935
+
8936
+ return workdays;
8937
+ };
8938
+
8958
8939
  /**
8959
8940
  * 日期加减天数
8960
8941
  * @param {string} start_date - 起始日期字符串,格式为 "YYYY-MM-DD"
8961
8942
  * @param {number} days - 要加上或减去的天数,正数表示加,负数表示减
8962
8943
  * @returns {string} 结果日期,格式为 "YYYY-MM-DD"
8963
- */
8964
- const dateAddDays = function (start_date, days) {
8965
- if (typeof start_date !== 'string' || !Number.isInteger(days)) {
8966
- throw new Error(
8967
- "Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD' and a valid integer for the number of days."
8968
- );
8969
- }
8970
-
8971
- const startDateObj = new Date(start_date);
8972
- if (isNaN(startDateObj.getTime())) {
8973
- throw new Error(
8974
- "Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'."
8975
- );
8976
- }
8977
-
8978
- const resultDateObj = new Date(startDateObj);
8979
- resultDateObj.setDate(resultDateObj.getDate() + days);
8980
-
8981
- const resultYear = resultDateObj.getFullYear();
8982
- const resultMonth = String(resultDateObj.getMonth() + 1).padStart(2, '0');
8983
- const resultDay = String(resultDateObj.getDate()).padStart(2, '0');
8984
-
8985
- return `${resultYear}-${resultMonth}-${resultDay}`;
8986
- };
8987
-
8944
+ */
8945
+ var dateAddDays = function dateAddDays(start_date, days) {
8946
+ if (typeof start_date !== 'string' || !Number.isInteger(days)) {
8947
+ throw new Error("Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD' and a valid integer for the number of days.");
8948
+ }
8949
+
8950
+ var startDateObj = new Date(start_date);
8951
+ if (isNaN(startDateObj.getTime())) {
8952
+ throw new Error("Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'.");
8953
+ }
8954
+
8955
+ var resultDateObj = new Date(startDateObj);
8956
+ resultDateObj.setDate(resultDateObj.getDate() + days);
8957
+
8958
+ var resultYear = resultDateObj.getFullYear();
8959
+ var resultMonth = String(resultDateObj.getMonth() + 1).padStart(2, '0');
8960
+ var resultDay = String(resultDateObj.getDate()).padStart(2, '0');
8961
+
8962
+ return resultYear + '-' + resultMonth + '-' + resultDay;
8963
+ };
8964
+
8988
8965
  /**
8989
8966
  * 计算两个日期之间的差值
8990
8967
  * @date 2023年12月14日
@@ -8992,182 +8969,180 @@ const dateAddDays = function (start_date, days) {
8992
8969
  * @param {String} end_date - 结束日期字符串
8993
8970
  * @param {String} unit - 单位:year/month/day
8994
8971
  * @returns {Number} 差值
8995
- */
8996
- const dateDiff = function (start_date, end_date, unit = 'day') {
8997
- // Assuming date strings are in "YYYY-MM-DD" format
8998
- var startDate = new Date(start_date);
8999
- var endDate = new Date(end_date);
9000
-
9001
- // If the date is invalid, return 0
9002
- if (isNaN(startDate.getTime()) || isNaN(endDate.getTime())) {
9003
- return 0;
9004
- }
9005
-
9006
- if (unit === 'year') {
9007
- return endDate.getFullYear() - startDate.getFullYear();
9008
- } else if (unit === 'month') {
9009
- return (
9010
- (endDate.getFullYear() - startDate.getFullYear()) * 12 +
9011
- (endDate.getMonth() - startDate.getMonth())
9012
- );
9013
- } else {
9014
- // Default to day
9015
- var timeDifference = endDate - startDate;
9016
- // Calculate days (86400000 milliseconds per day)
9017
- return Math.floor(timeDifference / 86400000);
9018
- }
9019
- };
9020
-
8972
+ */
8973
+ var dateDiff = function dateDiff(start_date, end_date) {
8974
+ var unit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'day';
8975
+
8976
+ // Assuming date strings are in "YYYY-MM-DD" format
8977
+ var startDate = new Date(start_date);
8978
+ var endDate = new Date(end_date);
8979
+
8980
+ // If the date is invalid, return 0
8981
+ if (isNaN(startDate.getTime()) || isNaN(endDate.getTime())) {
8982
+ return 0;
8983
+ }
8984
+
8985
+ if (unit === 'year') {
8986
+ return endDate.getFullYear() - startDate.getFullYear();
8987
+ } else if (unit === 'month') {
8988
+ return (endDate.getFullYear() - startDate.getFullYear()) * 12 + (endDate.getMonth() - startDate.getMonth());
8989
+ } else {
8990
+ // Default to day
8991
+ var timeDifference = endDate - startDate;
8992
+ // Calculate days (86400000 milliseconds per day)
8993
+ return Math.floor(timeDifference / 86400000);
8994
+ }
8995
+ };
8996
+
9021
8997
  /**
9022
8998
  * 获取月份中的日期
9023
8999
  * @param {string} date - 日期字符串,格式为 "YYYY-MM-DD"
9024
9000
  * @returns {number} 月份中的日期(1-31)
9025
- */
9026
- const dayOfMonth = function (date) {
9027
- if (typeof date !== 'string') {
9028
- throw new Error(
9029
- "Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD'."
9030
- );
9031
- }
9032
-
9033
- const dateObj = new Date(date);
9034
- if (isNaN(dateObj.getTime())) {
9035
- throw new Error(
9036
- "Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'."
9037
- );
9038
- }
9039
-
9040
- return dateObj.getDate();
9041
- };
9042
-
9001
+ */
9002
+ var dayOfMonth = function dayOfMonth(date) {
9003
+ if (typeof date !== 'string') {
9004
+ throw new Error("Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD'.");
9005
+ }
9006
+
9007
+ var dateObj = new Date(date);
9008
+ if (isNaN(dateObj.getTime())) {
9009
+ throw new Error("Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'.");
9010
+ }
9011
+
9012
+ return dateObj.getDate();
9013
+ };
9014
+
9043
9015
  /**
9044
9016
  * 获取当前日期
9045
9017
  * @date 2022年5月7日
9046
9018
  * @param {string} format - 日期格式,默认为'YYYY-MM-DD'
9047
9019
  * @returns {string} 当前日期的格式化字符串
9048
- */
9049
- const getCurrentDate = function (format = 'YYYY-MM-DD') {
9050
- return formatDate(new Date(), format);
9051
- };
9052
-
9020
+ */
9021
+ var getCurrentDate = function getCurrentDate() {
9022
+ var format = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'YYYY-MM-DD';
9023
+
9024
+ return formatDate(new Date(), format);
9025
+ };
9026
+
9053
9027
  /**
9054
9028
  * 获取当前日期时间
9055
9029
  * @date 2022年5月7日
9056
9030
  * @param {string} format - 日期时间格式,默认为'YYYY-MM-DD HH:mm:ss'
9057
9031
  * @returns {string} 当前日期时间的格式化字符串
9058
- */
9059
- const getCurrentDateTime = function (format = 'YYYY-MM-DD HH:mm:ss') {
9060
- return formatDate(new Date(), format);
9061
- };
9062
-
9032
+ */
9033
+ var getCurrentDateTime = function getCurrentDateTime() {
9034
+ var format = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'YYYY-MM-DD HH:mm:ss';
9035
+
9036
+ return formatDate(new Date(), format);
9037
+ };
9038
+
9063
9039
  /**
9064
9040
  * 获取小时
9065
9041
  * @date 2022年5月7日
9066
9042
  * @param {Date|string} [date] - 日期对象或日期字符串
9067
9043
  * @returns {number} 小时数(0-23)
9068
- */
9069
- const getHour = function (date) {
9070
- if (!date) {
9071
- return new Date().getHours();
9072
- }
9073
- if (typeof date === 'string') {
9074
- date = new Date(date);
9075
- }
9076
- return date.getHours();
9077
- };
9078
-
9044
+ */
9045
+ var getHour = function getHour(date) {
9046
+ if (!date) {
9047
+ return new Date().getHours();
9048
+ }
9049
+ if (typeof date === 'string') {
9050
+ date = new Date(date);
9051
+ }
9052
+ return date.getHours();
9053
+ };
9054
+
9079
9055
  /**
9080
9056
  * 获取分钟
9081
9057
  * @date 2022年5月7日
9082
9058
  * @param {Date|string} [date] - 日期对象或日期字符串
9083
9059
  * @returns {number} 分钟数(0-59)
9084
- */
9085
- const getMinute = function (date) {
9086
- if (!date) {
9087
- return new Date().getMinutes();
9088
- }
9089
- if (typeof date === 'string') {
9090
- date = new Date(date);
9091
- }
9092
- return date.getMinutes();
9093
- };
9094
-
9060
+ */
9061
+ var getMinute = function getMinute(date) {
9062
+ if (!date) {
9063
+ return new Date().getMinutes();
9064
+ }
9065
+ if (typeof date === 'string') {
9066
+ date = new Date(date);
9067
+ }
9068
+ return date.getMinutes();
9069
+ };
9070
+
9095
9071
  /**
9096
9072
  * 获取月份
9097
9073
  * @date 2022年5月7日
9098
9074
  * @param {Date|string} [date] - 日期对象或日期字符串
9099
9075
  * @returns {number} 月份数(1-12)
9100
- */
9101
- const getMonth = function (date) {
9102
- if (!date) {
9103
- return new Date().getMonth() + 1;
9104
- }
9105
- if (typeof date === 'string') {
9106
- date = new Date(date);
9107
- }
9108
- return date.getMonth() + 1;
9109
- };
9110
-
9076
+ */
9077
+ var getMonth = function getMonth(date) {
9078
+ if (!date) {
9079
+ return new Date().getMonth() + 1;
9080
+ }
9081
+ if (typeof date === 'string') {
9082
+ date = new Date(date);
9083
+ }
9084
+ return date.getMonth() + 1;
9085
+ };
9086
+
9111
9087
  /**
9112
9088
  * 获取秒
9113
9089
  * @date 2022年5月7日
9114
9090
  * @param {Date|string} [date] - 日期对象或日期字符串
9115
9091
  * @returns {number} 秒数(0-59)
9116
- */
9117
- const getSecond = function (date) {
9118
- if (!date) {
9119
- return new Date().getSeconds();
9120
- }
9121
- if (typeof date === 'string') {
9122
- date = new Date(date);
9123
- }
9124
- return date.getSeconds();
9125
- };
9126
-
9092
+ */
9093
+ var getSecond = function getSecond(date) {
9094
+ if (!date) {
9095
+ return new Date().getSeconds();
9096
+ }
9097
+ if (typeof date === 'string') {
9098
+ date = new Date(date);
9099
+ }
9100
+ return date.getSeconds();
9101
+ };
9102
+
9127
9103
  /**
9128
9104
  * 获取星期几
9129
9105
  * @date 2022年5月7日
9130
9106
  * @param {Date|string} [date] - 日期对象或日期字符串
9131
9107
  * @returns {number} 星期几(0-6,0表示星期日)
9132
- */
9133
- const getWeekday = function (date) {
9134
- if (!date) {
9135
- return new Date().getDay();
9136
- }
9137
- if (typeof date === 'string') {
9138
- date = new Date(date);
9139
- }
9140
- return date.getDay();
9141
- };
9142
-
9143
-
9108
+ */
9109
+ var getWeekday = function getWeekday(date) {
9110
+ if (!date) {
9111
+ return new Date().getDay();
9112
+ }
9113
+ if (typeof date === 'string') {
9114
+ date = new Date(date);
9115
+ }
9116
+ return date.getDay();
9117
+ };
9118
+
9144
9119
  /**
9145
9120
  * @desc 获取上午/下午/晚上
9146
9121
  * @author huangbo
9147
9122
  * @date 2022年5月7日
9148
9123
  * @param {String} [time] - 时间
9149
- **/
9150
- const timeCycle = function (time) {
9151
- let hour = 0;
9152
- if (!time) {
9153
- hour = new Date().getHours();
9154
- } else if (typeof time === 'string') {
9155
- // 从时间字符串中提取小时
9156
- const match = time.match(/^(\d{1,2})/);
9157
- if (match) {
9158
- hour = parseInt(match[1], 10);
9159
- }
9160
- } else if (typeof time === 'number') {
9161
- hour = time;
9162
- }
9163
- // 判断时间段
9164
- if (hour >= 5 && hour < 12) {
9165
- return '上午';
9166
- } else if (hour >= 12 && hour < 18) {
9167
- return '下午';
9168
- } else {
9169
- return '晚上';
9170
- }
9124
+ **/
9125
+ var timeCycle = function timeCycle(time) {
9126
+ var hour = 0;
9127
+ if (!time) {
9128
+ hour = new Date().getHours();
9129
+ } else if (typeof time === 'string') {
9130
+ // 从时间字符串中提取小时
9131
+ var match = time.match(/^(\d{1,2})/);
9132
+ if (match) {
9133
+ hour = parseInt(match[1], 10);
9134
+ }
9135
+ } else if (typeof time === 'number') {
9136
+ hour = time;
9137
+ }
9138
+ // 判断时间段
9139
+ if (hour >= 5 && hour < 12) {
9140
+ return '上午';
9141
+ } else if (hour >= 12 && hour < 18) {
9142
+ return '下午';
9143
+ } else {
9144
+ return '晚上';
9145
+ }
9171
9146
  };
9172
9147
 
9173
9148
  /***/ }),
@@ -9179,7 +9154,14 @@ module.exports = require("eoss/lib/message-box");
9179
9154
 
9180
9155
  /***/ }),
9181
9156
 
9182
- /***/ 88:
9157
+ /***/ 9:
9158
+ /***/ (function(module, exports) {
9159
+
9160
+ module.exports = require("eoss/lib/message");
9161
+
9162
+ /***/ }),
9163
+
9164
+ /***/ 90:
9183
9165
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
9184
9166
 
9185
9167
  "use strict";
@@ -9877,7 +9859,7 @@ var component = Object(componentNormalizer["a" /* default */])(
9877
9859
 
9878
9860
  /***/ }),
9879
9861
 
9880
- /***/ 89:
9862
+ /***/ 91:
9881
9863
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
9882
9864
 
9883
9865
  "use strict";
@@ -10289,14 +10271,7 @@ var component = Object(componentNormalizer["a" /* default */])(
10289
10271
 
10290
10272
  /***/ }),
10291
10273
 
10292
- /***/ 9:
10293
- /***/ (function(module, exports) {
10294
-
10295
- module.exports = require("eoss/lib/message");
10296
-
10297
- /***/ }),
10298
-
10299
- /***/ 90:
10274
+ /***/ 92:
10300
10275
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
10301
10276
 
10302
10277
  "use strict";
@@ -10828,7 +10803,7 @@ var component = Object(componentNormalizer["a" /* default */])(
10828
10803
 
10829
10804
  /***/ }),
10830
10805
 
10831
- /***/ 91:
10806
+ /***/ 93:
10832
10807
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
10833
10808
 
10834
10809
  "use strict";