eoss 0.1.0-alpha.25 → 0.1.0-alpha.26

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 (254) 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 +1000 -971
  83. package/lib/alert.js +2 -2
  84. package/lib/aside.js +2 -2
  85. package/lib/audit-trajectory.js +75 -71
  86. package/lib/autocomplete.js +2136 -1951
  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 +12 -12
  93. package/lib/button.js +2 -2
  94. package/lib/ca-login.js +913 -888
  95. package/lib/calendar.js +872 -847
  96. package/lib/card.js +2 -2
  97. package/lib/carousel-item.js +905 -880
  98. package/lib/carousel.js +1042 -1017
  99. package/lib/cascader-panel.js +926 -901
  100. package/lib/cascader.js +2022 -1837
  101. package/lib/checkbox-button.js +2 -2
  102. package/lib/checkbox-group.js +1000 -971
  103. package/lib/checkbox.js +2 -2
  104. package/lib/col.js +2 -2
  105. package/lib/collapse-item.js +2174 -1980
  106. package/lib/collapse.js +2175 -1980
  107. package/lib/color-picker.js +1112 -952
  108. package/lib/config/api.js +3 -0
  109. package/lib/container.js +2 -2
  110. package/lib/cron.js +2 -2
  111. package/lib/data-table.js +1007 -978
  112. package/lib/date-picker.js +2142 -1957
  113. package/lib/dialog.js +910 -885
  114. package/lib/divider.js +2 -2
  115. package/lib/drawer.js +2 -2
  116. package/lib/dropdown-item.js +4 -4
  117. package/lib/dropdown-menu.js +1104 -944
  118. package/lib/dropdown.js +925 -900
  119. package/lib/email-login.js +999 -970
  120. package/lib/empty.js +2 -2
  121. package/lib/eoss.common.js +8751 -4166
  122. package/lib/flip.js +2 -2
  123. package/lib/flow-group.js +906 -881
  124. package/lib/flow.js +1112 -1083
  125. package/lib/flows.js +1010 -981
  126. package/lib/footer.js +2 -2
  127. package/lib/form-item.js +909 -884
  128. package/lib/form.js +2185 -1986
  129. package/lib/guide.js +620 -0
  130. package/lib/header.js +2 -2
  131. package/lib/icon.js +981 -952
  132. package/lib/icons.js +2 -2
  133. package/lib/image-viewer.js +907 -882
  134. package/lib/image.js +4 -4
  135. package/lib/index.js +1 -1
  136. package/lib/infinite-scroll.js +2 -2
  137. package/lib/input-number.js +4 -4
  138. package/lib/input.js +910 -885
  139. package/lib/link.js +2 -2
  140. package/lib/loading.js +2 -2
  141. package/lib/login.js +1027 -998
  142. package/lib/lowcode.js +17336 -13510
  143. package/lib/main.js +14933 -14625
  144. package/lib/marquee.js +907 -882
  145. package/lib/menu-item-group.js +2 -2
  146. package/lib/menu-item.js +2 -2
  147. package/lib/menu.js +2011 -1826
  148. package/lib/message-box.js +923 -898
  149. package/lib/message.js +911 -886
  150. package/lib/notification.js +911 -886
  151. package/lib/option-group.js +2 -2
  152. package/lib/option.js +907 -882
  153. package/lib/page-header.js +2 -2
  154. package/lib/pagination.js +910 -885
  155. package/lib/phone-login.js +998 -969
  156. package/lib/popconfirm.js +12 -12
  157. package/lib/popover.js +2009 -1824
  158. package/lib/process-config.js +1015 -986
  159. package/lib/process-module.js +1001 -972
  160. package/lib/process-rule.js +1019 -990
  161. package/lib/progress.js +5 -5
  162. package/lib/qr-code.js +4 -4
  163. package/lib/qrcode-login.js +1057 -1028
  164. package/lib/radio-button.js +2 -2
  165. package/lib/radio-group.js +998 -969
  166. package/lib/radio.js +2 -2
  167. package/lib/rate.js +907 -882
  168. package/lib/row.js +2 -2
  169. package/lib/scrollbar.js +904 -879
  170. package/lib/select.js +2135 -1945
  171. package/lib/selector-panel.js +1009 -980
  172. package/lib/selector.js +1001 -972
  173. package/lib/slider.js +2 -2
  174. package/lib/step.js +2172 -1977
  175. package/lib/steps.js +907 -882
  176. package/lib/submenu.js +1119 -959
  177. package/lib/switch.js +907 -882
  178. package/lib/tab-pane.js +2 -2
  179. package/lib/table-column.js +906 -881
  180. package/lib/table.js +2236 -2047
  181. package/lib/tabs.js +911 -886
  182. package/lib/tag.js +2 -2
  183. package/lib/theme-chalk/base.css +1 -1
  184. package/lib/theme-chalk/guide.css +1 -0
  185. package/lib/theme-chalk/icon.css +1 -1
  186. package/lib/theme-chalk/index.css +1 -1
  187. package/lib/theme-chalk/lowcode-view.css +1 -0
  188. package/lib/theme-chalk/lowcode.css +1 -1
  189. package/lib/theme-chalk/main.css +1 -1
  190. package/lib/theme-chalk/pagination.css +1 -1
  191. package/lib/theme-chalk/select-dropdown.css +1 -1
  192. package/lib/theme-chalk/select.css +1 -1
  193. package/lib/theme-chalk/wujie.css +1 -0
  194. package/lib/time-picker.js +1977 -1792
  195. package/lib/time-select.js +1978 -1793
  196. package/lib/timeline-item.js +2 -2
  197. package/lib/timeline.js +2 -2
  198. package/lib/tips.js +998 -969
  199. package/lib/toolbar.js +2 -2
  200. package/lib/tooltip.js +2006 -1821
  201. package/lib/transfer.js +916 -891
  202. package/lib/tree-group.js +978 -949
  203. package/lib/tree.js +999 -970
  204. package/lib/update-history.js +76 -72
  205. package/lib/upload.js +1028 -999
  206. package/lib/utils/frame.js +133 -0
  207. package/lib/wujie.js +5037 -0
  208. package/package.json +3 -2
  209. package/packages/cascader/src/cascader.vue +1 -1
  210. package/packages/date-picker/src/picker.vue +1 -1
  211. package/packages/form/src/form-item-render.vue +10 -6
  212. package/packages/guide/index.js +8 -0
  213. package/packages/guide/src/directive.js +47 -0
  214. package/packages/guide/src/guide.vue +89 -0
  215. package/packages/guide/src/manager.js +133 -0
  216. package/packages/input/src/input.vue +1 -1
  217. package/packages/lowcode/src/aside.vue +41 -8
  218. package/packages/lowcode/src/attribute/bind.vue +2 -4
  219. package/packages/lowcode/src/attribute/dependency.vue +3 -16
  220. package/packages/lowcode/src/attribute/function.vue +2 -4
  221. package/packages/lowcode/src/attribute/property.vue +3 -15
  222. package/packages/lowcode/src/attribute/styles.vue +105 -11
  223. package/packages/lowcode/src/attribute.vue +5 -35
  224. package/packages/lowcode/src/canvas.vue +223 -97
  225. package/packages/lowcode/src/iframe.vue +60 -0
  226. package/packages/lowcode/src/lowcode.vue +32 -8
  227. package/packages/lowcode/src/pages.vue +1 -1
  228. package/packages/lowcode/src/render.vue +312 -70
  229. package/packages/lowcode/src/util/source-generator.js +7 -11
  230. package/packages/lowcode/src/util/source-parser.js +1 -1
  231. package/packages/lowcode-view/index.js +1 -1
  232. package/packages/lowcode-view/src/Iframe.vue +55 -0
  233. package/packages/lowcode-view/src/Modulels.vue +239 -0
  234. package/packages/lowcode-view/src/render.vue +337 -0
  235. package/packages/lowcode-view/src/view.vue +763 -0
  236. package/packages/main/src/components/pages.vue +11 -2
  237. package/packages/main/src/event-center.js +160 -0
  238. package/packages/main/src/minxs.js +60 -90
  239. package/packages/progress/src/progress.vue +1 -1
  240. package/packages/select/src/select.vue +2 -1
  241. package/packages/theme-chalk/src/common/var.scss +34 -10
  242. package/packages/theme-chalk/src/guide.scss +93 -0
  243. package/packages/theme-chalk/src/icon.scss +425 -426
  244. package/packages/theme-chalk/src/index.scss +2 -0
  245. package/packages/theme-chalk/src/lowcode-view.scss +288 -0
  246. package/packages/theme-chalk/src/lowcode.scss +11 -1
  247. package/packages/theme-chalk/src/select-dropdown.scss +1 -1
  248. package/packages/theme-chalk/src/wujie.scss +5 -0
  249. package/packages/wujie/index.js +10 -0
  250. package/packages/wujie/src/wujie.vue +205 -0
  251. package/src/config/api.js +3 -0
  252. package/src/index.js +325 -319
  253. package/src/utils/frame.js +102 -0
  254. package/packages/lowcode/src/view.vue +0 -187
@@ -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 = 242);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 248);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -91,32 +91,32 @@ module.exports =
91
91
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
92
92
 
93
93
  "use strict";
94
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "M", function() { return noop; });
95
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "y", function() { return hasOwn; });
96
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "W", function() { return toObject; });
97
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "w", function() { return getValueByPath; });
98
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return getPropByPath; });
94
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "L", function() { return noop; });
95
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return hasOwn; });
96
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "V", function() { return toObject; });
97
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "v", function() { return getValueByPath; });
98
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return getPropByPath; });
99
99
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return generateId; });
100
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ab", function() { return valueEquals; });
100
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Z", function() { return valueEquals; });
101
101
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return escapeRegexpString; });
102
102
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return arrayFindIndex; });
103
103
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return arrayFind; });
104
104
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return coerceTruthyValueToArray; });
105
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "G", function() { return isIE; });
106
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "B", function() { return isEdge; });
107
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F", function() { return isFirefox; });
105
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F", function() { return isIE; });
106
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "A", function() { return isEdge; });
107
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "E", function() { return isFirefox; });
108
108
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return autoprefixer; });
109
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "J", function() { return kebabCase; });
109
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "I", function() { return kebabCase; });
110
110
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return capitalize; });
111
111
  /* unused harmony export looseEqual */
112
112
  /* unused harmony export arrayEquals */
113
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "D", function() { return isEqual; });
114
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "O", function() { return rafThrottle; });
113
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "C", function() { return isEqual; });
114
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "N", function() { return rafThrottle; });
115
115
  /* unused harmony export objToArray */
116
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Q", function() { return requestAnimationFrame; });
116
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "P", function() { return requestAnimationFrame; });
117
117
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return cancelAnimationFrame; });
118
118
  /* unused harmony export debounce */
119
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "T", function() { return throttle; });
119
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "S", function() { return throttle; });
120
120
  /* unused harmony export guid */
121
121
  /* unused harmony export uid */
122
122
  /* unused harmony export get */
@@ -124,7 +124,7 @@ module.exports =
124
124
  /* unused harmony export cloneDeep */
125
125
  /* unused harmony export grouping */
126
126
  /* unused harmony export pager */
127
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return getWinTop; });
127
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "w", function() { return getWinTop; });
128
128
  /* unused harmony export getFileType */
129
129
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return arrUnique; });
130
130
  /* unused harmony export average */
@@ -142,54 +142,54 @@ module.exports =
142
142
  /* unused harmony export exportXls */
143
143
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return extend; });
144
144
  /* unused harmony export getObjectType */
145
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return getParams; });
145
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return getParams; });
146
146
  /* unused harmony export getScript */
147
147
  /* unused harmony export getStyle */
148
148
  /* unused harmony export getTypeName */
149
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "v", function() { return getTypePrefix; });
149
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return getTypePrefix; });
150
150
  /* unused harmony export getValues */
151
151
  /* unused harmony export getZoom */
152
152
  /* unused harmony export getLength */
153
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "U", function() { return timestampUrl; });
153
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "T", function() { return timestampUrl; });
154
154
  /* unused harmony export hasChars */
155
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "z", function() { return identical; });
156
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "A", function() { return indexOfObj; });
157
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "C", function() { return isEmpty; });
158
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "E", function() { return isExist; });
155
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "y", function() { return identical; });
156
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "z", function() { return indexOfObj; });
157
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "B", function() { return isEmpty; });
158
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "D", function() { return isExist; });
159
159
  /* unused harmony export isFunction */
160
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "H", function() { return isObjectEqual; });
161
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "I", function() { return joinUrl; });
162
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return getHorizontalMargin; });
163
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "K", function() { return layoutWaterfall; });
160
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "G", function() { return isObjectEqual; });
161
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "H", function() { return joinUrl; });
162
+ /* unused harmony export getHorizontalMargin */
163
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "J", function() { return layoutWaterfall; });
164
164
  /* unused harmony export loadJs */
165
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "L", function() { return loading; });
165
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "K", function() { return loading; });
166
166
  /* unused harmony export lowerCase */
167
167
  /* unused harmony export overbrim */
168
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "N", function() { return queryParams; });
168
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "M", function() { return queryParams; });
169
169
  /* unused harmony export receiveMessage */
170
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "P", function() { return renderIcon; });
170
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "O", function() { return renderIcon; });
171
171
  /* unused harmony export replenish */
172
172
  /* unused harmony export rmbToCapital */
173
173
  /* unused harmony export setScale */
174
174
  /* unused harmony export sendMessage */
175
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "R", function() { return setFavicon; });
175
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Q", function() { return setFavicon; });
176
176
  /* unused harmony export sum */
177
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "S", function() { return startWith; });
177
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "R", function() { return startWith; });
178
178
  /* unused harmony export takeLeft */
179
179
  /* unused harmony export takeRight */
180
180
  /* unused harmony export trimWhitespace */
181
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "V", function() { return toFixed; });
181
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "U", function() { return toFixed; });
182
182
  /* unused harmony export toFunction */
183
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "X", function() { return updateTheme; });
183
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "W", function() { return updateTheme; });
184
184
  /* unused harmony export upperType */
185
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Y", function() { return urlJoinParams; });
186
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Z", function() { return uuid; });
187
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cb", function() { return watermark; });
185
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "X", function() { return urlJoinParams; });
186
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Y", function() { return uuid; });
187
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bb", function() { return watermark; });
188
188
  /* unused harmony export winTopOpen */
189
189
  /* unused harmony export confirm */
190
190
  /* unused harmony export success */
191
191
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return error; });
192
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bb", function() { return warning; });
192
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ab", function() { return warning; });
193
193
  /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
194
194
  /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
195
195
  /* harmony import */ var _color__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
@@ -2172,7 +2172,7 @@ var loadJs = function loadJs(url, callback) {
2172
2172
  var loading = function loading() {
2173
2173
  var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '请求中...';
2174
2174
 
2175
- var Loading = __webpack_require__(18).default;
2175
+ var Loading = __webpack_require__(17).default;
2176
2176
  return Loading.service({
2177
2177
  text: text,
2178
2178
  spinner: 'es-icon-jiazai',
@@ -3337,7 +3337,7 @@ var getColor = function getColor($color, $n) {
3337
3337
  var getLightness = function getLightness($v, $i, $isLight) {
3338
3338
  var $value = $isLight ? $v + $brightnessStep1 * $i : $v - $brightnessStep2 * $i;
3339
3339
  $value = $value < 1 ? $value : 1;
3340
- return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "V"])($value, 2);
3340
+ return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "U"])($value, 2);
3341
3341
  };
3342
3342
 
3343
3343
  /**
@@ -3361,7 +3361,7 @@ var getSaturation = function getSaturation($s, $i, $isLight) {
3361
3361
  $saturation = 0.1;
3362
3362
  }
3363
3363
  $saturation = $saturation > 0.06 ? $saturation : 0.06;
3364
- return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "V"])($saturation, 2);
3364
+ return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "U"])($saturation, 2);
3365
3365
  };
3366
3366
 
3367
3367
  /**
@@ -3475,7 +3475,7 @@ var getRgb = function getRgb($color) {
3475
3475
 
3476
3476
  /***/ }),
3477
3477
 
3478
- /***/ 18:
3478
+ /***/ 17:
3479
3479
  /***/ (function(module, exports) {
3480
3480
 
3481
3481
  module.exports = require("eoss/lib/loading");
@@ -3539,736 +3539,759 @@ module.exports = require("lodash/get");
3539
3539
  /* unused harmony export getSecond */
3540
3540
  /* unused harmony export getWeekday */
3541
3541
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F", function() { return timeCycle; });
3542
-
3543
-
3542
+ /* Modified from https://github.com/taylorhakes/fecha
3543
+ *
3544
+ * The MIT License (MIT)
3545
+ *
3546
+ * Copyright (c) 2015 Taylor Hakes
3547
+ *
3548
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
3549
+ * of this software and associated documentation files (the "Software"), to deal
3550
+ * in the Software without restriction, including without limitation the rights
3551
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
3552
+ * copies of the Software, and to permit persons to whom the Software is
3553
+ * furnished to do so, subject to the following conditions:
3554
+ *
3555
+ * The above copyright notice and this permission notice shall be included in all
3556
+ * copies or substantial portions of the Software.
3557
+ *
3558
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
3559
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
3560
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3561
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
3562
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
3563
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3564
+ * SOFTWARE.
3565
+ */
3566
+
3567
+ /*eslint-disable*/
3568
+ // 把 YYYY-MM-DD 改成了 yyyy-MM-dd
3569
+
3570
+
3544
3571
  /**
3545
3572
  * Parse or format dates
3546
3573
  * @class fecha
3547
- */
3548
- var fecha = {};
3549
- var token = /d{1,4}|M{1,4}|yy(?:yy)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g;
3550
- var twoDigits = '\\d\\d?';
3551
- var threeDigits = '\\d{3}';
3552
- var fourDigits = '\\d{4}';
3553
- var word = '[^\\s]+';
3554
- var literal = /\[([^]*?)\]/gm;
3555
- var noop = function noop() {};
3556
-
3557
- function regexEscape(str) {
3558
- return str.replace(/[|\\{()[^$+*?.-]/g, '\\$&');
3559
- }
3560
-
3561
- function shorten(arr, sLen) {
3562
- var newArr = [];
3563
- for (var i = 0, len = arr.length; i < len; i++) {
3564
- newArr.push(arr[i].substr(0, sLen));
3565
- }
3566
- return newArr;
3567
- }
3568
-
3569
- function monthUpdate() {
3570
- return function (d, v) {
3571
- var index = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'].indexOf(v.toLowerCase());
3572
- if (~index) {
3573
- d.month = index;
3574
- }
3575
- };
3576
- }
3577
-
3578
- function pad(val, len) {
3579
- val = String(val);
3580
- len = len || 2;
3581
- while (val.length < len) {
3582
- val = '0' + val;
3583
- }
3584
- return val;
3585
- }
3586
-
3587
- // 直接使用中文日期名称常量
3588
- var dayNames = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
3589
- var monthNames = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];
3590
- var monthNamesShort = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二'];
3591
- var dayNamesShort = ['日', '一', '二', '三', '四', '五', '六'];
3592
- var amPm = ['上午', '下午'];
3593
- var DoFn = function DoFn(D) {
3594
- return D + '日';
3595
- };
3596
-
3597
- var formatFlags = {
3598
- D: function D(dateObj) {
3599
- return dateObj.getDay();
3600
- },
3601
- DD: function DD(dateObj) {
3602
- return pad(dateObj.getDay());
3603
- },
3604
- Do: function Do(dateObj) {
3605
- return DoFn(dateObj.getDate());
3606
- },
3607
- d: function d(dateObj) {
3608
- return dateObj.getDate();
3609
- },
3610
- dd: function dd(dateObj) {
3611
- return pad(dateObj.getDate());
3612
- },
3613
- ddd: function ddd(dateObj) {
3614
- return dayNamesShort[dateObj.getDay()];
3615
- },
3616
- dddd: function dddd(dateObj) {
3617
- return dayNames[dateObj.getDay()];
3618
- },
3619
- M: function M(dateObj) {
3620
- return dateObj.getMonth() + 1;
3621
- },
3622
- MM: function MM(dateObj) {
3623
- return pad(dateObj.getMonth() + 1);
3624
- },
3625
- MMM: function MMM(dateObj) {
3626
- return monthNamesShort[dateObj.getMonth()];
3627
- },
3628
- MMMM: function MMMM(dateObj) {
3629
- return monthNames[dateObj.getMonth()];
3630
- },
3631
- yy: function yy(dateObj) {
3632
- return pad(String(dateObj.getFullYear()), 4).substr(2);
3633
- },
3634
- yyyy: function yyyy(dateObj) {
3635
- return pad(dateObj.getFullYear(), 4);
3636
- },
3637
- h: function h(dateObj) {
3638
- return dateObj.getHours() % 12 || 12;
3639
- },
3640
- hh: function hh(dateObj) {
3641
- return pad(dateObj.getHours() % 12 || 12);
3642
- },
3643
- H: function H(dateObj) {
3644
- return dateObj.getHours();
3645
- },
3646
- HH: function HH(dateObj) {
3647
- return pad(dateObj.getHours());
3648
- },
3649
- m: function m(dateObj) {
3650
- return dateObj.getMinutes();
3651
- },
3652
- mm: function mm(dateObj) {
3653
- return pad(dateObj.getMinutes());
3654
- },
3655
- s: function s(dateObj) {
3656
- return dateObj.getSeconds();
3657
- },
3658
- ss: function ss(dateObj) {
3659
- return pad(dateObj.getSeconds());
3660
- },
3661
- S: function S(dateObj) {
3662
- return Math.round(dateObj.getMilliseconds() / 100);
3663
- },
3664
- SS: function SS(dateObj) {
3665
- return pad(Math.round(dateObj.getMilliseconds() / 10), 2);
3666
- },
3667
- SSS: function SSS(dateObj) {
3668
- return pad(dateObj.getMilliseconds(), 3);
3669
- },
3670
- a: function a(dateObj) {
3671
- return dateObj.getHours() < 12 ? '上午' : '下午';
3672
- },
3673
- A: function A(dateObj) {
3674
- return dateObj.getHours() < 12 ? '上午' : '下午';
3675
- },
3676
- ZZ: function ZZ(dateObj) {
3677
- var o = dateObj.getTimezoneOffset();
3678
- return (o > 0 ? '-' : '+') + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4);
3679
- }
3680
- };
3681
-
3682
- var parseFlags = {
3683
- d: [twoDigits, function (d, v) {
3684
- d.day = v;
3685
- }],
3686
- Do: [twoDigits + word, function (d, v) {
3687
- d.day = parseInt(v, 10);
3688
- }],
3689
- M: [twoDigits, function (d, v) {
3690
- d.month = v - 1;
3691
- }],
3692
- yy: [twoDigits, function (d, v) {
3693
- var da = new Date(),
3694
- cent = +('' + da.getFullYear()).substr(0, 2);
3695
- d.year = '' + (v > 68 ? cent - 1 : cent) + v;
3696
- }],
3697
- h: [twoDigits, function (d, v) {
3698
- d.hour = v;
3699
- }],
3700
- m: [twoDigits, function (d, v) {
3701
- d.minute = v;
3702
- }],
3703
- s: [twoDigits, function (d, v) {
3704
- d.second = v;
3705
- }],
3706
- yyyy: [fourDigits, function (d, v) {
3707
- d.year = v;
3708
- }],
3709
- S: ['\\d', function (d, v) {
3710
- d.millisecond = v * 100;
3711
- }],
3712
- SS: ['\\d{2}', function (d, v) {
3713
- d.millisecond = v * 10;
3714
- }],
3715
- SSS: [threeDigits, function (d, v) {
3716
- d.millisecond = v;
3717
- }],
3718
- D: [twoDigits, noop],
3719
- ddd: [word, noop],
3720
- MMM: [word, monthUpdate('monthNamesShort')],
3721
- MMMM: [word, monthUpdate('monthNames')],
3722
- a: [word, function (d, v) {
3723
- var val = v.toLowerCase();
3724
- if (val === '上午') {
3725
- d.isPm = false;
3726
- } else if (val === '下午') {
3727
- d.isPm = true;
3728
- }
3729
- }],
3730
- ZZ: ['[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z', function (d, v) {
3731
- var parts = (v + '').match(/([+-]|\d\d)/gi),
3732
- minutes = void 0;
3733
-
3734
- if (parts) {
3735
- minutes = +(parts[1] * 60) + parseInt(parts[2], 10);
3736
- d.timezoneOffset = parts[0] === '+' ? minutes : -minutes;
3737
- }
3738
- }]
3739
- };
3740
- parseFlags.dd = parseFlags.d;
3741
- parseFlags.dddd = parseFlags.ddd;
3742
- parseFlags.DD = parseFlags.D;
3743
- parseFlags.mm = parseFlags.m;
3744
- parseFlags.hh = parseFlags.H = parseFlags.HH = parseFlags.h;
3745
- parseFlags.MM = parseFlags.M;
3746
- parseFlags.ss = parseFlags.s;
3747
- parseFlags.A = parseFlags.a;
3748
-
3749
- // Some common format strings
3750
- fecha.masks = {
3751
- default: 'ddd MMM dd yyyy HH:mm:ss',
3752
- shortDate: 'M/D/yy',
3753
- mediumDate: 'MMM d, yyyy',
3754
- longDate: 'MMMM d, yyyy',
3755
- fullDate: 'dddd, MMMM d, yyyy',
3756
- shortTime: 'HH:mm',
3757
- mediumTime: 'HH:mm:ss',
3758
- longTime: 'HH:mm:ss.SSS'
3759
- };
3760
-
3574
+ */
3575
+ const fecha = {};
3576
+ const token = /d{1,4}|M{1,4}|yy(?:yy)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g;
3577
+ const twoDigits = '\\d\\d?';
3578
+ const threeDigits = '\\d{3}';
3579
+ const fourDigits = '\\d{4}';
3580
+ const word = '[^\\s]+';
3581
+ const literal = /\[([^]*?)\]/gm;
3582
+ const noop = function () {};
3583
+
3584
+ function regexEscape(str) {
3585
+ return str.replace(/[|\\{()[^$+*?.-]/g, '\\$&');
3586
+ }
3587
+
3588
+ function shorten(arr, sLen) {
3589
+ const newArr = [];
3590
+ for (let i = 0, len = arr.length; i < len; i++) {
3591
+ newArr.push(arr[i].substr(0, sLen));
3592
+ }
3593
+ return newArr;
3594
+ }
3595
+
3596
+ function monthUpdate() {
3597
+ return function (d, v) {
3598
+ const index = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'].indexOf(v.toLowerCase());
3599
+ if (~index) {
3600
+ d.month = index;
3601
+ }
3602
+ };
3603
+ }
3604
+
3605
+ function pad(val, len) {
3606
+ val = String(val);
3607
+ len = len || 2;
3608
+ while (val.length < len) {
3609
+ val = '0' + val;
3610
+ }
3611
+ return val;
3612
+ }
3613
+
3614
+ // 直接使用中文日期名称常量
3615
+ const dayNames = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
3616
+ const monthNames = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];
3617
+ const monthNamesShort = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二'];
3618
+ const dayNamesShort = ['日', '一', '二', '三', '四', '五', '六'];
3619
+ const amPm = ['上午', '下午'];
3620
+ const DoFn = function DoFn(D) {
3621
+ return D + '日';
3622
+ };
3623
+
3624
+ const formatFlags = {
3625
+ D: function(dateObj) {
3626
+ return dateObj.getDay();
3627
+ },
3628
+ DD: function(dateObj) {
3629
+ return pad(dateObj.getDay());
3630
+ },
3631
+ Do: function(dateObj) {
3632
+ return DoFn(dateObj.getDate());
3633
+ },
3634
+ d: function(dateObj) {
3635
+ return dateObj.getDate();
3636
+ },
3637
+ dd: function(dateObj) {
3638
+ return pad(dateObj.getDate());
3639
+ },
3640
+ ddd: function(dateObj) {
3641
+ return dayNamesShort[dateObj.getDay()];
3642
+ },
3643
+ dddd: function(dateObj) {
3644
+ return dayNames[dateObj.getDay()];
3645
+ },
3646
+ M: function(dateObj) {
3647
+ return dateObj.getMonth() + 1;
3648
+ },
3649
+ MM: function(dateObj) {
3650
+ return pad(dateObj.getMonth() + 1);
3651
+ },
3652
+ MMM: function(dateObj) {
3653
+ return monthNamesShort[dateObj.getMonth()];
3654
+ },
3655
+ MMMM: function(dateObj) {
3656
+ return monthNames[dateObj.getMonth()];
3657
+ },
3658
+ yy: function(dateObj) {
3659
+ return pad(String(dateObj.getFullYear()), 4).substr(2);
3660
+ },
3661
+ yyyy: function(dateObj) {
3662
+ return pad(dateObj.getFullYear(), 4);
3663
+ },
3664
+ h: function(dateObj) {
3665
+ return dateObj.getHours() % 12 || 12;
3666
+ },
3667
+ hh: function(dateObj) {
3668
+ return pad(dateObj.getHours() % 12 || 12);
3669
+ },
3670
+ H: function(dateObj) {
3671
+ return dateObj.getHours();
3672
+ },
3673
+ HH: function(dateObj) {
3674
+ return pad(dateObj.getHours());
3675
+ },
3676
+ m: function(dateObj) {
3677
+ return dateObj.getMinutes();
3678
+ },
3679
+ mm: function(dateObj) {
3680
+ return pad(dateObj.getMinutes());
3681
+ },
3682
+ s: function(dateObj) {
3683
+ return dateObj.getSeconds();
3684
+ },
3685
+ ss: function(dateObj) {
3686
+ return pad(dateObj.getSeconds());
3687
+ },
3688
+ S: function(dateObj) {
3689
+ return Math.round(dateObj.getMilliseconds() / 100);
3690
+ },
3691
+ SS: function(dateObj) {
3692
+ return pad(Math.round(dateObj.getMilliseconds() / 10), 2);
3693
+ },
3694
+ SSS: function(dateObj) {
3695
+ return pad(dateObj.getMilliseconds(), 3);
3696
+ },
3697
+ a: function(dateObj) {
3698
+ return dateObj.getHours() < 12 ? '上午' : '下午';
3699
+ },
3700
+ A: function(dateObj) {
3701
+ return dateObj.getHours() < 12 ? '上午' : '下午';
3702
+ },
3703
+ ZZ: function(dateObj) {
3704
+ const o = dateObj.getTimezoneOffset();
3705
+ return (o > 0 ? '-' : '+') + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4);
3706
+ }
3707
+ };
3708
+
3709
+ const parseFlags = {
3710
+ d: [twoDigits, function (d, v) {
3711
+ d.day = v;
3712
+ }],
3713
+ Do: [twoDigits + word, function (d, v) {
3714
+ d.day = parseInt(v, 10);
3715
+ }],
3716
+ M: [twoDigits, function (d, v) {
3717
+ d.month = v - 1;
3718
+ }],
3719
+ yy: [twoDigits, function (d, v) {
3720
+ const da = new Date(), cent = +('' + da.getFullYear()).substr(0, 2);
3721
+ d.year = '' + (v > 68 ? cent - 1 : cent) + v;
3722
+ }],
3723
+ h: [twoDigits, function (d, v) {
3724
+ d.hour = v;
3725
+ }],
3726
+ m: [twoDigits, function (d, v) {
3727
+ d.minute = v;
3728
+ }],
3729
+ s: [twoDigits, function (d, v) {
3730
+ d.second = v;
3731
+ }],
3732
+ yyyy: [fourDigits, function (d, v) {
3733
+ d.year = v;
3734
+ }],
3735
+ S: ['\\d', function (d, v) {
3736
+ d.millisecond = v * 100;
3737
+ }],
3738
+ SS: ['\\d{2}', function (d, v) {
3739
+ d.millisecond = v * 10;
3740
+ }],
3741
+ SSS: [threeDigits, function (d, v) {
3742
+ d.millisecond = v;
3743
+ }],
3744
+ D: [twoDigits, noop],
3745
+ ddd: [word, noop],
3746
+ MMM: [word, monthUpdate('monthNamesShort')],
3747
+ MMMM: [word, monthUpdate('monthNames')],
3748
+ a: [word, function (d, v) {
3749
+ const val = v.toLowerCase();
3750
+ if (val === '上午') {
3751
+ d.isPm = false;
3752
+ } else if (val === '下午') {
3753
+ d.isPm = true;
3754
+ }
3755
+ }],
3756
+ ZZ: ['[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z', function (d, v) {
3757
+ let parts = (v + '').match(/([+-]|\d\d)/gi), minutes;
3758
+
3759
+ if (parts) {
3760
+ minutes = +(parts[1] * 60) + parseInt(parts[2], 10);
3761
+ d.timezoneOffset = parts[0] === '+' ? minutes : -minutes;
3762
+ }
3763
+ }]
3764
+ };
3765
+ parseFlags.dd = parseFlags.d;
3766
+ parseFlags.dddd = parseFlags.ddd;
3767
+ parseFlags.DD = parseFlags.D;
3768
+ parseFlags.mm = parseFlags.m;
3769
+ parseFlags.hh = parseFlags.H = parseFlags.HH = parseFlags.h;
3770
+ parseFlags.MM = parseFlags.M;
3771
+ parseFlags.ss = parseFlags.s;
3772
+ parseFlags.A = parseFlags.a;
3773
+
3774
+
3775
+ // Some common format strings
3776
+ fecha.masks = {
3777
+ default: 'ddd MMM dd yyyy HH:mm:ss',
3778
+ shortDate: 'M/D/yy',
3779
+ mediumDate: 'MMM d, yyyy',
3780
+ longDate: 'MMMM d, yyyy',
3781
+ fullDate: 'dddd, MMMM d, yyyy',
3782
+ shortTime: 'HH:mm',
3783
+ mediumTime: 'HH:mm:ss',
3784
+ longTime: 'HH:mm:ss.SSS'
3785
+ };
3786
+
3761
3787
  /***
3762
3788
  * Format a date
3763
3789
  * @method format
3764
3790
  * @param {Date|number} dateObj
3765
3791
  * @param {string} mask Format of the date, i.e. 'mm-dd-yy' or 'shortDate'
3766
- */
3767
- fecha.format = function (dateObj, mask) {
3768
- if (typeof dateObj === 'number') {
3769
- dateObj = new Date(dateObj);
3770
- }
3771
-
3772
- if (Object.prototype.toString.call(dateObj) !== '[object Date]' || isNaN(dateObj.getTime())) {
3773
- throw new Error('Invalid Date in fecha.format');
3774
- }
3775
-
3776
- mask = fecha.masks[mask] || mask || fecha.masks['default'];
3777
-
3778
- var literals = [];
3779
-
3780
- // Make literals inactive by replacing them with ??
3781
- mask = mask.replace(literal, function ($0, $1) {
3782
- literals.push($1);
3783
- return '@@@';
3784
- });
3785
- // Apply formatting rules
3786
- mask = mask.replace(token, function ($0) {
3787
- return $0 in formatFlags ? formatFlags[$0](dateObj) : $0.slice(1, $0.length - 1);
3788
- });
3789
- // Inline literal values back into the formatted value
3790
- return mask.replace(/@@@/g, function () {
3791
- return literals.shift();
3792
- });
3793
- };
3794
-
3792
+ */
3793
+ fecha.format = function (dateObj, mask) {
3794
+ if (typeof dateObj === 'number') {
3795
+ dateObj = new Date(dateObj);
3796
+ }
3797
+
3798
+ if (Object.prototype.toString.call(dateObj) !== '[object Date]' || isNaN(dateObj.getTime())) {
3799
+ throw new Error('Invalid Date in fecha.format');
3800
+ }
3801
+
3802
+ mask = fecha.masks[mask] || mask || fecha.masks['default'];
3803
+
3804
+ const literals = [];
3805
+
3806
+ // Make literals inactive by replacing them with ??
3807
+ mask = mask.replace(literal, function($0, $1) {
3808
+ literals.push($1);
3809
+ return '@@@';
3810
+ });
3811
+ // Apply formatting rules
3812
+ mask = mask.replace(token, function ($0) {
3813
+ return $0 in formatFlags ? formatFlags[$0](dateObj) : $0.slice(1, $0.length - 1);
3814
+ });
3815
+ // Inline literal values back into the formatted value
3816
+ return mask.replace(/@@@/g, function() {
3817
+ return literals.shift();
3818
+ });
3819
+ };
3820
+
3795
3821
  /**
3796
3822
  * Parse a date string into an object, changes - into /
3797
3823
  * @method parse
3798
3824
  * @param {string} dateStr Date string
3799
3825
  * @param {string} format Date parse format
3800
3826
  * @returns {Date|boolean}
3801
- */
3802
- fecha.parse = function (dateStr, format) {
3803
- if (typeof format !== 'string') {
3804
- throw new Error('Invalid format in fecha.parse');
3805
- }
3806
-
3807
- format = fecha.masks[format] || format;
3808
-
3809
- // Avoid regular expression denial of service, fail early for really long strings
3810
- // https://www.owasp.org/index.php/Regular_expression_Denial_of_Service_-_ReDoS
3811
- if (dateStr.length > 1000) {
3812
- return null;
3813
- }
3814
-
3815
- var dateInfo = {};
3816
- var parseInfo = [];
3817
- var literals = [];
3818
- format = format.replace(literal, function ($0, $1) {
3819
- literals.push($1);
3820
- return '@@@';
3821
- });
3822
- var newFormat = regexEscape(format).replace(token, function ($0) {
3823
- if (parseFlags[$0]) {
3824
- var info = parseFlags[$0];
3825
- parseInfo.push(info[1]);
3826
- return '(' + info[0] + ')';
3827
- }
3828
-
3829
- return $0;
3830
- });
3831
- newFormat = newFormat.replace(/@@@/g, function () {
3832
- return literals.shift();
3833
- });
3834
- var matches = dateStr.match(new RegExp(newFormat, 'i'));
3835
- if (!matches) {
3836
- return null;
3837
- }
3838
-
3839
- for (var i = 1; i < matches.length; i++) {
3840
- parseInfo[i - 1](dateInfo, matches[i]);
3841
- }
3842
-
3843
- var today = new Date();
3844
- if (dateInfo.isPm === true && dateInfo.hour != null && +dateInfo.hour !== 12) {
3845
- dateInfo.hour = +dateInfo.hour + 12;
3846
- } else if (dateInfo.isPm === false && +dateInfo.hour === 12) {
3847
- dateInfo.hour = 0;
3848
- }
3849
-
3850
- var date = void 0;
3851
- if (dateInfo.timezoneOffset != null) {
3852
- dateInfo.minute = +(dateInfo.minute || 0) - +dateInfo.timezoneOffset;
3853
- 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));
3854
- } else {
3855
- 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);
3856
- }
3857
- return date;
3858
- };
3859
-
3860
- // 导出fecha对象
3861
-
3862
-
3863
- // 以下是从date-util.js合并的函数
3864
- var newArray = function newArray(start, end) {
3865
- var result = [];
3866
- for (var i = start; i <= end; i++) {
3867
- result.push(i);
3868
- }
3869
- return result;
3870
- };
3871
-
3872
- var getSettings = function getSettings() {
3873
- return {
3874
- dayNamesShort: ['日', '一', '二', '三', '四', '五', '六'],
3875
- dayNames: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
3876
- monthNamesShort: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
3877
- monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
3878
- amPm: ['上午', '下午']
3879
- };
3880
- };
3881
-
3882
- var toDate = function toDate(date) {
3883
- return isDate(date) ? new Date(date) : null;
3884
- };
3885
-
3886
- var isDate = function isDate(date) {
3887
- if (date === null || date === undefined) return false;
3888
- if (isNaN(new Date(date).getTime())) return false;
3889
- if (Array.isArray(date)) return false; // deal with `new Date([ new Date() ]) -> new Date()`
3890
- return true;
3891
- };
3892
-
3893
- var isDateObject = function isDateObject(val) {
3894
- return val instanceof Date;
3895
- };
3896
-
3897
- var formatDate = function formatDate(date) {
3898
- var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-MM-dd';
3899
-
3900
- // 处理多种输入类型
3901
- if (!date) return '';
3902
-
3903
- // 如果是时间戳,转成日期对象
3904
- if (typeof date === 'number') {
3905
- date = new Date(date);
3906
- }
3907
- // 如果是字符串,转成日期对象
3908
- if (typeof date === 'string') {
3909
- date = new Date(date);
3910
- }
3911
-
3912
- // 调用toDate进一步验证和转换
3913
- date = toDate(date);
3914
- if (!date) return '';
3915
-
3916
- // 兼容大写和小写的格式标记
3917
- // 将大写的YYYY/MM/DD/HH/mm/ss转换为小写的yyyy/mm/dd/hh/mm/ss
3918
- var lowercaseFormat = format.replace(/YYYY/g, 'yyyy').replace(/D/g, 'd');
3919
-
3920
- // 使用fecha库进行格式化,支持中文配置
3921
- var str = fecha.format(date, lowercaseFormat, getSettings());
3922
- return str;
3923
- };
3924
-
3925
- var parseDate = function parseDate(string, format) {
3926
- return fecha.parse(string, format || 'yyyy-MM-dd', getSettings());
3927
- };
3928
-
3929
- var getDayCountOfMonth = function getDayCountOfMonth(year, month) {
3930
- if (month === 3 || month === 5 || month === 8 || month === 10) {
3931
- return 30;
3932
- }
3933
-
3934
- if (month === 1) {
3935
- if (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0) {
3936
- return 29;
3937
- } else {
3938
- return 28;
3939
- }
3940
- }
3941
-
3942
- return 31;
3943
- };
3944
-
3945
- var getDayCountOfYear = function getDayCountOfYear(year) {
3946
- var isLeapYear = year % 400 === 0 || year % 100 !== 0 && year % 4 === 0;
3947
- return isLeapYear ? 366 : 365;
3948
- };
3949
-
3950
- var getFirstDayOfMonth = function getFirstDayOfMonth(date) {
3951
- var temp = new Date(date.getTime());
3952
- temp.setDate(1);
3953
- return temp.getDay();
3954
- };
3955
-
3956
- // see: https://stackoverflow.com/questions/3674539/incrementing-a-date-in-javascript
3957
- // {prev, next} Date should work for Daylight Saving Time
3958
- // Adding 24 * 60 * 60 * 1000 does not work in the above scenario
3959
- var prevDate = function prevDate(date) {
3960
- var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
3961
-
3962
- return new Date(date.getFullYear(), date.getMonth(), date.getDate() - amount);
3963
- };
3964
-
3965
- var nextDate = function nextDate(date) {
3966
- var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
3967
-
3968
- return new Date(date.getFullYear(), date.getMonth(), date.getDate() + amount);
3969
- };
3970
-
3971
- var getStartDateOfMonth = function getStartDateOfMonth(year, month) {
3972
- var result = new Date(year, month, 1);
3973
- var day = result.getDay();
3974
-
3975
- if (day === 0) {
3976
- return prevDate(result, 7);
3977
- } else {
3978
- return prevDate(result, day);
3979
- }
3980
- };
3981
-
3982
- var getWeekNumber = function getWeekNumber(date) {
3983
- // 支持多种输入类型
3984
- if (!date || !isDate(date)) {
3985
- date = new Date();
3986
- }
3987
- if (typeof date === 'string') {
3988
- date = new Date(date);
3989
- }
3990
-
3991
- // 验证日期有效性
3992
- if (!isDate(date)) return null;
3993
-
3994
- var d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));
3995
- // 设置为最近的星期四:当前日期 + 4 - 当前星期数
3996
- // 将星期日的星期数设为7
3997
- d.setUTCDate(d.getUTCDate() + 4 - (d.getUTCDay() || 7));
3998
- // 获取当年的第一天
3999
- var yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));
4000
- // 计算到最近的星期四的完整周数
4001
- var weekNo = Math.ceil(((d - yearStart) / 86400000 + 1) / 7);
4002
- // 返回周数
4003
- return weekNo;
4004
- };
4005
-
4006
- var getRangeHours = function getRangeHours(ranges) {
4007
- var hours = [];
4008
- var disabledHours = [];
4009
-
4010
- (ranges || []).forEach(function (range) {
4011
- var value = range.map(function (date) {
4012
- return date.getHours();
4013
- });
4014
-
4015
- disabledHours = disabledHours.concat(newArray(value[0], value[1]));
4016
- });
4017
-
4018
- if (disabledHours.length) {
4019
- for (var i = 0; i < 24; i++) {
4020
- hours[i] = disabledHours.indexOf(i) === -1;
4021
- }
4022
- } else {
4023
- for (var _i = 0; _i < 24; _i++) {
4024
- hours[_i] = false;
4025
- }
4026
- }
4027
-
4028
- return hours;
4029
- };
4030
-
4031
- var getPrevMonthLastDays = function getPrevMonthLastDays(date, amount) {
4032
- if (amount <= 0) return [];
4033
- var temp = new Date(date.getTime());
4034
- temp.setDate(0);
4035
- var lastDay = temp.getDate();
4036
- return range(amount).map(function (_, index) {
4037
- return lastDay - (amount - index - 1);
4038
- });
4039
- };
4040
-
4041
- var getMonthDays = function getMonthDays(date) {
4042
- var temp = new Date(date.getFullYear(), date.getMonth() + 1, 0);
4043
- var days = temp.getDate();
4044
- return range(days).map(function (_, index) {
4045
- return index + 1;
4046
- });
4047
- };
4048
-
4049
- function setRangeData(arr, start, end, value) {
4050
- for (var i = start; i < end; i++) {
4051
- arr[i] = value;
4052
- }
4053
- }
4054
-
4055
- var getRangeMinutes = function getRangeMinutes(ranges, hour) {
4056
- var minutes = new Array(60);
4057
-
4058
- if (ranges.length > 0) {
4059
- ranges.forEach(function (range) {
4060
- var start = range[0];
4061
- var end = range[1];
4062
- var startHour = start.getHours();
4063
- var startMinute = start.getMinutes();
4064
- var endHour = end.getHours();
4065
- var endMinute = end.getMinutes();
4066
- if (startHour === hour && endHour !== hour) {
4067
- setRangeData(minutes, startMinute, 60, true);
4068
- } else if (startHour === hour && endHour === hour) {
4069
- setRangeData(minutes, startMinute, endMinute + 1, true);
4070
- } else if (startHour !== hour && endHour === hour) {
4071
- setRangeData(minutes, 0, endMinute + 1, true);
4072
- } else if (startHour < hour && endHour > hour) {
4073
- setRangeData(minutes, 0, 60, true);
4074
- }
4075
- });
4076
- } else {
4077
- setRangeData(minutes, 0, 60, true);
4078
- }
4079
- return minutes;
4080
- };
4081
-
4082
- var range = function range(n) {
4083
- // see https://stackoverflow.com/questions/3746725/create-a-javascript-array-containing-1-n
4084
- return Array.apply(null, { length: n }).map(function (_, n) {
4085
- return n;
4086
- });
4087
- };
4088
-
4089
- var modifyDate = function modifyDate(date, y, m, d) {
4090
- return new Date(y, m, d, date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
4091
- };
4092
-
4093
- var modifyTime = function modifyTime(date, h, m, s) {
4094
- return new Date(date.getFullYear(), date.getMonth(), date.getDate(), h, m, s, date.getMilliseconds());
4095
- };
4096
-
4097
- var modifyWithTimeString = function modifyWithTimeString(date, time) {
4098
- if (date == null || !time) {
4099
- return date;
4100
- }
4101
- time = parseDate(time, 'HH:mm:ss');
4102
- return modifyTime(date, time.getHours(), time.getMinutes(), time.getSeconds());
4103
- };
4104
-
4105
- var clearTime = function clearTime(date) {
4106
- return new Date(date.getFullYear(), date.getMonth(), date.getDate());
4107
- };
4108
-
4109
- var clearMilliseconds = function clearMilliseconds(date) {
4110
- return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), 0);
4111
- };
4112
-
4113
- var limitTimeRange = function limitTimeRange(date, ranges) {
4114
- var format = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'HH:mm:ss';
4115
-
4116
- // TODO: refactory a more elegant solution
4117
- if (ranges.length === 0) return date;
4118
- var normalizeDate = function normalizeDate(date) {
4119
- return fecha.parse(fecha.format(date, format), format);
4120
- };
4121
- var ndate = normalizeDate(date);
4122
- var nranges = ranges.map(function (range) {
4123
- return range.map(normalizeDate);
4124
- });
4125
- if (nranges.some(function (nrange) {
4126
- return ndate >= nrange[0] && ndate <= nrange[1];
4127
- })) return date;
4128
-
4129
- var minDate = nranges[0][0];
4130
- var maxDate = nranges[0][0];
4131
-
4132
- nranges.forEach(function (nrange) {
4133
- minDate = new Date(Math.min(nrange[0], minDate));
4134
- maxDate = new Date(Math.max(nrange[1], minDate));
4135
- });
4136
-
4137
- var ret = ndate < minDate ? minDate : maxDate;
4138
- // preserve Year/Month/Date
4139
- return modifyDate(ret, date.getFullYear(), date.getMonth(), date.getDate());
4140
- };
4141
-
4142
- var timeWithinRange = function timeWithinRange(date, selectableRange, format) {
4143
- var limitedDate = limitTimeRange(date, selectableRange, format);
4144
- return limitedDate.getTime() === date.getTime();
4145
- };
4146
-
4147
- var changeYearMonthAndClampDate = function changeYearMonthAndClampDate(date, year, month) {
4148
- // clamp date to the number of days in `year`, `month`
4149
- // eg: (2010-1-31, 2010, 2) => 2010-2-28
4150
- var monthDate = Math.min(date.getDate(), getDayCountOfMonth(year, month));
4151
- return modifyDate(date, year, month, monthDate);
4152
- };
4153
-
4154
- var prevMonth = function prevMonth(date) {
4155
- var year = date.getFullYear();
4156
- var month = date.getMonth();
4157
- return month === 0 ? changeYearMonthAndClampDate(date, year - 1, 11) : changeYearMonthAndClampDate(date, year, month - 1);
4158
- };
4159
-
4160
- var nextMonth = function nextMonth(date) {
4161
- var year = date.getFullYear();
4162
- var month = date.getMonth();
4163
- return month === 11 ? changeYearMonthAndClampDate(date, year + 1, 0) : changeYearMonthAndClampDate(date, year, month + 1);
4164
- };
4165
-
4166
- var prevYear = function prevYear(date) {
4167
- var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
4168
-
4169
- var year = date.getFullYear();
4170
- var month = date.getMonth();
4171
- return changeYearMonthAndClampDate(date, year - amount, month);
4172
- };
4173
-
4174
- var nextYear = function nextYear(date) {
4175
- var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
4176
-
4177
- var year = date.getFullYear();
4178
- var month = date.getMonth();
4179
- return changeYearMonthAndClampDate(date, year + amount, month);
4180
- };
4181
-
4182
- var extractDateFormat = function extractDateFormat(format) {
4183
- return format.replace(/\W?m{1,2}|\W?ZZ/g, '').replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi, '').trim();
4184
- };
4185
-
4186
- var extractTimeFormat = function extractTimeFormat(format) {
4187
- return format.replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?y{2,4}/g, '').trim();
4188
- };
4189
-
4190
- var validateRangeInOneMonth = function validateRangeInOneMonth(start, end) {
4191
- return start.getMonth() === end.getMonth() && start.getFullYear() === end.getFullYear();
4192
- };
4193
-
3827
+ */
3828
+ fecha.parse = function (dateStr, format) {
3829
+ if (typeof format !== 'string') {
3830
+ throw new Error('Invalid format in fecha.parse');
3831
+ }
3832
+
3833
+ format = fecha.masks[format] || format;
3834
+
3835
+ // Avoid regular expression denial of service, fail early for really long strings
3836
+ // https://www.owasp.org/index.php/Regular_expression_Denial_of_Service_-_ReDoS
3837
+ if (dateStr.length > 1000) {
3838
+ return null;
3839
+ }
3840
+
3841
+ const dateInfo = {};
3842
+ const parseInfo = [];
3843
+ const literals = [];
3844
+ format = format.replace(literal, function($0, $1) {
3845
+ literals.push($1);
3846
+ return '@@@';
3847
+ });
3848
+ let newFormat = regexEscape(format).replace(token, function ($0) {
3849
+ if (parseFlags[$0]) {
3850
+ const info = parseFlags[$0];
3851
+ parseInfo.push(info[1]);
3852
+ return '(' + info[0] + ')';
3853
+ }
3854
+
3855
+ return $0;
3856
+ });
3857
+ newFormat = newFormat.replace(/@@@/g, function() {
3858
+ return literals.shift();
3859
+ });
3860
+ const matches = dateStr.match(new RegExp(newFormat, 'i'));
3861
+ if (!matches) {
3862
+ return null;
3863
+ }
3864
+
3865
+ for (let i = 1; i < matches.length; i++) {
3866
+ parseInfo[i - 1](dateInfo, matches[i]);
3867
+ }
3868
+
3869
+ const today = new Date();
3870
+ if (dateInfo.isPm === true && dateInfo.hour != null && +dateInfo.hour !== 12) {
3871
+ dateInfo.hour = +dateInfo.hour + 12;
3872
+ } else if (dateInfo.isPm === false && +dateInfo.hour === 12) {
3873
+ dateInfo.hour = 0;
3874
+ }
3875
+
3876
+ let date;
3877
+ if (dateInfo.timezoneOffset != null) {
3878
+ dateInfo.minute = +(dateInfo.minute || 0) - +dateInfo.timezoneOffset;
3879
+ date = new Date(Date.UTC(dateInfo.year || today.getFullYear(), dateInfo.month || 0, dateInfo.day || 1,
3880
+ dateInfo.hour || 0, dateInfo.minute || 0, dateInfo.second || 0, dateInfo.millisecond || 0));
3881
+ } else {
3882
+ date = new Date(dateInfo.year || today.getFullYear(), dateInfo.month || 0, dateInfo.day || 1,
3883
+ dateInfo.hour || 0, dateInfo.minute || 0, dateInfo.second || 0, dateInfo.millisecond || 0);
3884
+ }
3885
+ return date;
3886
+ };
3887
+
3888
+ // 导出fecha对象
3889
+
3890
+
3891
+ // 以下是从date-util.js合并的函数
3892
+ const newArray = function(start, end) {
3893
+ let result = [];
3894
+ for (let i = start; i <= end; i++) {
3895
+ result.push(i);
3896
+ }
3897
+ return result;
3898
+ };
3899
+
3900
+ const getSettings = () => {
3901
+ return {
3902
+ dayNamesShort: ['日', '一', '二', '三', '四', '五', '六'],
3903
+ dayNames: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
3904
+ monthNamesShort: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
3905
+ monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
3906
+ amPm: ['上午', '下午']
3907
+ };
3908
+ };
3909
+
3910
+ const toDate = function(date) {
3911
+ return isDate(date) ? new Date(date) : null;
3912
+ };
3913
+
3914
+ const isDate = function(date) {
3915
+ if (date === null || date === undefined) return false;
3916
+ if (isNaN(new Date(date).getTime())) return false;
3917
+ if (Array.isArray(date)) return false; // deal with `new Date([ new Date() ]) -> new Date()`
3918
+ return true;
3919
+ };
3920
+
3921
+ const isDateObject = function(val) {
3922
+ return val instanceof Date;
3923
+ };
3924
+
3925
+ const formatDate = function (date, format = 'yyyy-MM-dd') {
3926
+ // 处理多种输入类型
3927
+ if (!date) return '';
3928
+
3929
+ // 如果是时间戳,转成日期对象
3930
+ if (typeof date === 'number') {
3931
+ date = new Date(date);
3932
+ }
3933
+ // 如果是字符串,转成日期对象
3934
+ if (typeof date === 'string') {
3935
+ date = new Date(date);
3936
+ }
3937
+
3938
+ // 调用toDate进一步验证和转换
3939
+ date = toDate(date);
3940
+ if (!date) return '';
3941
+
3942
+ // 兼容大写和小写的格式标记
3943
+ // 将大写的YYYY/MM/DD/HH/mm/ss转换为小写的yyyy/mm/dd/hh/mm/ss
3944
+ const lowercaseFormat = format
3945
+ .replace(/YYYY/g, 'yyyy')
3946
+ .replace(/D/g, 'd')
3947
+
3948
+ // 使用fecha库进行格式化,支持中文配置
3949
+ const str = fecha.format(date, lowercaseFormat, getSettings());
3950
+ return str;
3951
+ };
3952
+
3953
+ const parseDate = function(string, format) {
3954
+ return fecha.parse(string, format || 'yyyy-MM-dd', getSettings());
3955
+ };
3956
+
3957
+ const getDayCountOfMonth = function(year, month) {
3958
+ if (month === 3 || month === 5 || month === 8 || month === 10) {
3959
+ return 30;
3960
+ }
3961
+
3962
+ if (month === 1) {
3963
+ if (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0) {
3964
+ return 29;
3965
+ } else {
3966
+ return 28;
3967
+ }
3968
+ }
3969
+
3970
+ return 31;
3971
+ };
3972
+
3973
+ const getDayCountOfYear = function(year) {
3974
+ const isLeapYear = year % 400 === 0 || (year % 100 !== 0 && year % 4 === 0);
3975
+ return isLeapYear ? 366 : 365;
3976
+ };
3977
+
3978
+ const getFirstDayOfMonth = function(date) {
3979
+ const temp = new Date(date.getTime());
3980
+ temp.setDate(1);
3981
+ return temp.getDay();
3982
+ };
3983
+
3984
+ // see: https://stackoverflow.com/questions/3674539/incrementing-a-date-in-javascript
3985
+ // {prev, next} Date should work for Daylight Saving Time
3986
+ // Adding 24 * 60 * 60 * 1000 does not work in the above scenario
3987
+ const prevDate = function(date, amount = 1) {
3988
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate() - amount);
3989
+ };
3990
+
3991
+ const nextDate = function(date, amount = 1) {
3992
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate() + amount);
3993
+ };
3994
+
3995
+ const getStartDateOfMonth = function(year, month) {
3996
+ const result = new Date(year, month, 1);
3997
+ const day = result.getDay();
3998
+
3999
+ if (day === 0) {
4000
+ return prevDate(result, 7);
4001
+ } else {
4002
+ return prevDate(result, day);
4003
+ }
4004
+ };
4005
+
4006
+ const getWeekNumber = function(date) {
4007
+ // 支持多种输入类型
4008
+ if (!date||!isDate(date)) {
4009
+ date = new Date();
4010
+ }
4011
+ if (typeof date === 'string') {
4012
+ date = new Date(date);
4013
+ }
4014
+
4015
+ // 验证日期有效性
4016
+ if (!isDate(date)) return null;
4017
+
4018
+ const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));
4019
+ // 设置为最近的星期四:当前日期 + 4 - 当前星期数
4020
+ // 将星期日的星期数设为7
4021
+ d.setUTCDate(d.getUTCDate() + 4 - (d.getUTCDay() || 7));
4022
+ // 获取当年的第一天
4023
+ const yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));
4024
+ // 计算到最近的星期四的完整周数
4025
+ const weekNo = Math.ceil((((d - yearStart) / 86400000) + 1) / 7);
4026
+ // 返回周数
4027
+ return weekNo;
4028
+ };
4029
+
4030
+ const getRangeHours = function(ranges) {
4031
+ const hours = [];
4032
+ let disabledHours = [];
4033
+
4034
+ (ranges || []).forEach(range => {
4035
+ const value = range.map(date => date.getHours());
4036
+
4037
+ disabledHours = disabledHours.concat(newArray(value[0], value[1]));
4038
+ });
4039
+
4040
+ if (disabledHours.length) {
4041
+ for (let i = 0; i < 24; i++) {
4042
+ hours[i] = disabledHours.indexOf(i) === -1;
4043
+ }
4044
+ } else {
4045
+ for (let i = 0; i < 24; i++) {
4046
+ hours[i] = false;
4047
+ }
4048
+ }
4049
+
4050
+ return hours;
4051
+ };
4052
+
4053
+ const getPrevMonthLastDays = (date, amount) => {
4054
+ if (amount <= 0) return [];
4055
+ const temp = new Date(date.getTime());
4056
+ temp.setDate(0);
4057
+ const lastDay = temp.getDate();
4058
+ return range(amount).map((_, index) => lastDay - (amount - index - 1));
4059
+ };
4060
+
4061
+ const getMonthDays = (date) => {
4062
+ const temp = new Date(date.getFullYear(), date.getMonth() + 1, 0);
4063
+ const days = temp.getDate();
4064
+ return range(days).map((_, index) => index + 1);
4065
+ };
4066
+
4067
+ function setRangeData(arr, start, end, value) {
4068
+ for (let i = start; i < end; i++) {
4069
+ arr[i] = value;
4070
+ }
4071
+ }
4072
+
4073
+ const getRangeMinutes = function(ranges, hour) {
4074
+ const minutes = new Array(60);
4075
+
4076
+ if (ranges.length > 0) {
4077
+ ranges.forEach(range => {
4078
+ const start = range[0];
4079
+ const end = range[1];
4080
+ const startHour = start.getHours();
4081
+ const startMinute = start.getMinutes();
4082
+ const endHour = end.getHours();
4083
+ const endMinute = end.getMinutes();
4084
+ if (startHour === hour && endHour !== hour) {
4085
+ setRangeData(minutes, startMinute, 60, true);
4086
+ } else if (startHour === hour && endHour === hour) {
4087
+ setRangeData(minutes, startMinute, endMinute + 1, true);
4088
+ } else if (startHour !== hour && endHour === hour) {
4089
+ setRangeData(minutes, 0, endMinute + 1, true);
4090
+ } else if (startHour < hour && endHour > hour) {
4091
+ setRangeData(minutes, 0, 60, true);
4092
+ }
4093
+ });
4094
+ } else {
4095
+ setRangeData(minutes, 0, 60, true);
4096
+ }
4097
+ return minutes;
4098
+ };
4099
+
4100
+ const range = function(n) {
4101
+ // see https://stackoverflow.com/questions/3746725/create-a-javascript-array-containing-1-n
4102
+ return Array.apply(null, {length: n}).map((_, n) => n);
4103
+ };
4104
+
4105
+ const modifyDate = function(date, y, m, d) {
4106
+ return new Date(y, m, d, date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
4107
+ };
4108
+
4109
+ const modifyTime = function(date, h, m, s) {
4110
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate(), h, m, s, date.getMilliseconds());
4111
+ };
4112
+
4113
+ const modifyWithTimeString = (date, time) => {
4114
+ if (date == null || !time) {
4115
+ return date;
4116
+ }
4117
+ time = parseDate(time, 'HH:mm:ss');
4118
+ return modifyTime(date, time.getHours(), time.getMinutes(), time.getSeconds());
4119
+ };
4120
+
4121
+ const clearTime = function(date) {
4122
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate());
4123
+ };
4124
+
4125
+ const clearMilliseconds = function(date) {
4126
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), 0);
4127
+ };
4128
+
4129
+ const limitTimeRange = function(date, ranges, format = 'HH:mm:ss') {
4130
+ // TODO: refactory a more elegant solution
4131
+ if (ranges.length === 0) return date;
4132
+ const normalizeDate = date => fecha.parse(fecha.format(date, format), format);
4133
+ const ndate = normalizeDate(date);
4134
+ const nranges = ranges.map(range => range.map(normalizeDate));
4135
+ if (nranges.some(nrange => ndate >= nrange[0] && ndate <= nrange[1])) return date;
4136
+
4137
+ let minDate = nranges[0][0];
4138
+ let maxDate = nranges[0][0];
4139
+
4140
+ nranges.forEach(nrange => {
4141
+ minDate = new Date(Math.min(nrange[0], minDate));
4142
+ maxDate = new Date(Math.max(nrange[1], minDate));
4143
+ });
4144
+
4145
+ const ret = ndate < minDate ? minDate : maxDate;
4146
+ // preserve Year/Month/Date
4147
+ return modifyDate(
4148
+ ret,
4149
+ date.getFullYear(),
4150
+ date.getMonth(),
4151
+ date.getDate()
4152
+ );
4153
+ };
4154
+
4155
+ const timeWithinRange = function(date, selectableRange, format) {
4156
+ const limitedDate = limitTimeRange(date, selectableRange, format);
4157
+ return limitedDate.getTime() === date.getTime();
4158
+ };
4159
+
4160
+ const changeYearMonthAndClampDate = function(date, year, month) {
4161
+ // clamp date to the number of days in `year`, `month`
4162
+ // eg: (2010-1-31, 2010, 2) => 2010-2-28
4163
+ const monthDate = Math.min(date.getDate(), getDayCountOfMonth(year, month));
4164
+ return modifyDate(date, year, month, monthDate);
4165
+ };
4166
+
4167
+ const prevMonth = function(date) {
4168
+ const year = date.getFullYear();
4169
+ const month = date.getMonth();
4170
+ return month === 0
4171
+ ? changeYearMonthAndClampDate(date, year - 1, 11)
4172
+ : changeYearMonthAndClampDate(date, year, month - 1);
4173
+ };
4174
+
4175
+ const nextMonth = function(date) {
4176
+ const year = date.getFullYear();
4177
+ const month = date.getMonth();
4178
+ return month === 11
4179
+ ? changeYearMonthAndClampDate(date, year + 1, 0)
4180
+ : changeYearMonthAndClampDate(date, year, month + 1);
4181
+ };
4182
+
4183
+ const prevYear = function(date, amount = 1) {
4184
+ const year = date.getFullYear();
4185
+ const month = date.getMonth();
4186
+ return changeYearMonthAndClampDate(date, year - amount, month);
4187
+ };
4188
+
4189
+ const nextYear = function(date, amount = 1) {
4190
+ const year = date.getFullYear();
4191
+ const month = date.getMonth();
4192
+ return changeYearMonthAndClampDate(date, year + amount, month);
4193
+ };
4194
+
4195
+ const extractDateFormat = function(format) {
4196
+ return format
4197
+ .replace(/\W?m{1,2}|\W?ZZ/g, '')
4198
+ .replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi, '')
4199
+ .trim();
4200
+ };
4201
+
4202
+ const extractTimeFormat = function(format) {
4203
+ return format
4204
+ .replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?y{2,4}/g, '')
4205
+ .trim();
4206
+ };
4207
+
4208
+ const validateRangeInOneMonth = function(start, end) {
4209
+ return (start.getMonth() === end.getMonth()) && (start.getFullYear() === end.getFullYear());
4210
+ };
4211
+
4194
4212
  /**
4195
4213
  * 计算两个日期之间的工作日数量(不包括周末和节假日)
4196
4214
  * @param {string} start_date - 开始日期字符串,格式为 "YYYY-MM-DD"
4197
4215
  * @param {string} end_date - 结束日期字符串,格式为 "YYYY-MM-DD"
4198
4216
  * @param {Array<string>} holidays - 假期日期字符串数组,格式为 "YYYY-MM-DD"
4199
4217
  * @returns {number} 工作日数量
4200
- */
4201
- var calculateNetworkDays = function calculateNetworkDays(start_date, end_date) {
4202
- var holidays = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
4203
-
4204
- if (typeof start_date !== 'string' || typeof end_date !== 'string') {
4205
- throw new Error("Invalid input. Please provide valid date strings in the format 'YYYY-MM-DD'.");
4206
- }
4207
-
4208
- var startDateObj = new Date(start_date);
4209
- var endDateObj = new Date(end_date);
4210
-
4211
- if (isNaN(startDateObj.getTime()) || isNaN(endDateObj.getTime())) {
4212
- throw new Error("Invalid date format. Please provide valid date strings in the format 'YYYY-MM-DD'.");
4213
- }
4214
-
4215
- if (startDateObj > endDateObj) {
4216
- throw new Error('Start date should be earlier than or equal to end date.');
4217
- }
4218
-
4219
- var workdays = 0;
4220
-
4221
- // Iterate through each day in the date range
4222
-
4223
- var _loop = function _loop(currentDate) {
4224
- // Check if the current day is a weekend (Saturday or Sunday)
4225
- var isWeekend = currentDate.getDay() === 0 || currentDate.getDay() === 6;
4226
-
4227
- // Check if the current day is a holiday
4228
- var isHoliday = holidays.some(function (holiday) {
4229
- var holidayDate = new Date(holiday);
4230
- return currentDate.toDateString() === holidayDate.toDateString();
4231
- });
4232
-
4233
- // If it's a workday (not a weekend or holiday), increment the workdays count
4234
- if (!isWeekend && !isHoliday) {
4235
- workdays++;
4236
- }
4237
- };
4238
-
4239
- for (var currentDate = new Date(startDateObj); currentDate <= endDateObj; currentDate.setDate(currentDate.getDate() + 1)) {
4240
- _loop(currentDate);
4241
- }
4242
-
4243
- return workdays;
4244
- };
4245
-
4218
+ */
4219
+ const calculateNetworkDays = function (start_date, end_date, holidays = []) {
4220
+ if (typeof start_date !== 'string' || typeof end_date !== 'string') {
4221
+ throw new Error(
4222
+ "Invalid input. Please provide valid date strings in the format 'YYYY-MM-DD'."
4223
+ );
4224
+ }
4225
+
4226
+ const startDateObj = new Date(start_date);
4227
+ const endDateObj = new Date(end_date);
4228
+
4229
+ if (isNaN(startDateObj.getTime()) || isNaN(endDateObj.getTime())) {
4230
+ throw new Error(
4231
+ "Invalid date format. Please provide valid date strings in the format 'YYYY-MM-DD'."
4232
+ );
4233
+ }
4234
+
4235
+ if (startDateObj > endDateObj) {
4236
+ throw new Error('Start date should be earlier than or equal to end date.');
4237
+ }
4238
+
4239
+ let workdays = 0;
4240
+
4241
+ // Iterate through each day in the date range
4242
+ for (
4243
+ let currentDate = new Date(startDateObj);
4244
+ currentDate <= endDateObj;
4245
+ currentDate.setDate(currentDate.getDate() + 1)
4246
+ ) {
4247
+ // Check if the current day is a weekend (Saturday or Sunday)
4248
+ const isWeekend = currentDate.getDay() === 0 || currentDate.getDay() === 6;
4249
+
4250
+ // Check if the current day is a holiday
4251
+ const isHoliday = holidays.some((holiday) => {
4252
+ const holidayDate = new Date(holiday);
4253
+ return currentDate.toDateString() === holidayDate.toDateString();
4254
+ });
4255
+
4256
+ // If it's a workday (not a weekend or holiday), increment the workdays count
4257
+ if (!isWeekend && !isHoliday) {
4258
+ workdays++;
4259
+ }
4260
+ }
4261
+
4262
+ return workdays;
4263
+ };
4264
+
4246
4265
  /**
4247
4266
  * 日期加减天数
4248
4267
  * @param {string} start_date - 起始日期字符串,格式为 "YYYY-MM-DD"
4249
4268
  * @param {number} days - 要加上或减去的天数,正数表示加,负数表示减
4250
4269
  * @returns {string} 结果日期,格式为 "YYYY-MM-DD"
4251
- */
4252
- var dateAddDays = function dateAddDays(start_date, days) {
4253
- if (typeof start_date !== 'string' || !Number.isInteger(days)) {
4254
- 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.");
4255
- }
4256
-
4257
- var startDateObj = new Date(start_date);
4258
- if (isNaN(startDateObj.getTime())) {
4259
- throw new Error("Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'.");
4260
- }
4261
-
4262
- var resultDateObj = new Date(startDateObj);
4263
- resultDateObj.setDate(resultDateObj.getDate() + days);
4264
-
4265
- var resultYear = resultDateObj.getFullYear();
4266
- var resultMonth = String(resultDateObj.getMonth() + 1).padStart(2, '0');
4267
- var resultDay = String(resultDateObj.getDate()).padStart(2, '0');
4268
-
4269
- return resultYear + '-' + resultMonth + '-' + resultDay;
4270
- };
4271
-
4270
+ */
4271
+ const dateAddDays = function (start_date, days) {
4272
+ if (typeof start_date !== 'string' || !Number.isInteger(days)) {
4273
+ throw new Error(
4274
+ "Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD' and a valid integer for the number of days."
4275
+ );
4276
+ }
4277
+
4278
+ const startDateObj = new Date(start_date);
4279
+ if (isNaN(startDateObj.getTime())) {
4280
+ throw new Error(
4281
+ "Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'."
4282
+ );
4283
+ }
4284
+
4285
+ const resultDateObj = new Date(startDateObj);
4286
+ resultDateObj.setDate(resultDateObj.getDate() + days);
4287
+
4288
+ const resultYear = resultDateObj.getFullYear();
4289
+ const resultMonth = String(resultDateObj.getMonth() + 1).padStart(2, '0');
4290
+ const resultDay = String(resultDateObj.getDate()).padStart(2, '0');
4291
+
4292
+ return `${resultYear}-${resultMonth}-${resultDay}`;
4293
+ };
4294
+
4272
4295
  /**
4273
4296
  * 计算两个日期之间的差值
4274
4297
  * @date 2023年12月14日
@@ -4276,180 +4299,182 @@ var dateAddDays = function dateAddDays(start_date, days) {
4276
4299
  * @param {String} end_date - 结束日期字符串
4277
4300
  * @param {String} unit - 单位:year/month/day
4278
4301
  * @returns {Number} 差值
4279
- */
4280
- var dateDiff = function dateDiff(start_date, end_date) {
4281
- var unit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'day';
4282
-
4283
- // Assuming date strings are in "YYYY-MM-DD" format
4284
- var startDate = new Date(start_date);
4285
- var endDate = new Date(end_date);
4286
-
4287
- // If the date is invalid, return 0
4288
- if (isNaN(startDate.getTime()) || isNaN(endDate.getTime())) {
4289
- return 0;
4290
- }
4291
-
4292
- if (unit === 'year') {
4293
- return endDate.getFullYear() - startDate.getFullYear();
4294
- } else if (unit === 'month') {
4295
- return (endDate.getFullYear() - startDate.getFullYear()) * 12 + (endDate.getMonth() - startDate.getMonth());
4296
- } else {
4297
- // Default to day
4298
- var timeDifference = endDate - startDate;
4299
- // Calculate days (86400000 milliseconds per day)
4300
- return Math.floor(timeDifference / 86400000);
4301
- }
4302
- };
4303
-
4302
+ */
4303
+ const dateDiff = function (start_date, end_date, unit = 'day') {
4304
+ // Assuming date strings are in "YYYY-MM-DD" format
4305
+ var startDate = new Date(start_date);
4306
+ var endDate = new Date(end_date);
4307
+
4308
+ // If the date is invalid, return 0
4309
+ if (isNaN(startDate.getTime()) || isNaN(endDate.getTime())) {
4310
+ return 0;
4311
+ }
4312
+
4313
+ if (unit === 'year') {
4314
+ return endDate.getFullYear() - startDate.getFullYear();
4315
+ } else if (unit === 'month') {
4316
+ return (
4317
+ (endDate.getFullYear() - startDate.getFullYear()) * 12 +
4318
+ (endDate.getMonth() - startDate.getMonth())
4319
+ );
4320
+ } else {
4321
+ // Default to day
4322
+ var timeDifference = endDate - startDate;
4323
+ // Calculate days (86400000 milliseconds per day)
4324
+ return Math.floor(timeDifference / 86400000);
4325
+ }
4326
+ };
4327
+
4304
4328
  /**
4305
4329
  * 获取月份中的日期
4306
4330
  * @param {string} date - 日期字符串,格式为 "YYYY-MM-DD"
4307
4331
  * @returns {number} 月份中的日期(1-31)
4308
- */
4309
- var dayOfMonth = function dayOfMonth(date) {
4310
- if (typeof date !== 'string') {
4311
- throw new Error("Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD'.");
4312
- }
4313
-
4314
- var dateObj = new Date(date);
4315
- if (isNaN(dateObj.getTime())) {
4316
- throw new Error("Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'.");
4317
- }
4318
-
4319
- return dateObj.getDate();
4320
- };
4321
-
4332
+ */
4333
+ const dayOfMonth = function (date) {
4334
+ if (typeof date !== 'string') {
4335
+ throw new Error(
4336
+ "Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD'."
4337
+ );
4338
+ }
4339
+
4340
+ const dateObj = new Date(date);
4341
+ if (isNaN(dateObj.getTime())) {
4342
+ throw new Error(
4343
+ "Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'."
4344
+ );
4345
+ }
4346
+
4347
+ return dateObj.getDate();
4348
+ };
4349
+
4322
4350
  /**
4323
4351
  * 获取当前日期
4324
4352
  * @date 2022年5月7日
4325
4353
  * @param {string} format - 日期格式,默认为'YYYY-MM-DD'
4326
4354
  * @returns {string} 当前日期的格式化字符串
4327
- */
4328
- var getCurrentDate = function getCurrentDate() {
4329
- var format = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'YYYY-MM-DD';
4330
-
4331
- return formatDate(new Date(), format);
4332
- };
4333
-
4355
+ */
4356
+ const getCurrentDate = function (format = 'YYYY-MM-DD') {
4357
+ return formatDate(new Date(), format);
4358
+ };
4359
+
4334
4360
  /**
4335
4361
  * 获取当前日期时间
4336
4362
  * @date 2022年5月7日
4337
4363
  * @param {string} format - 日期时间格式,默认为'YYYY-MM-DD HH:mm:ss'
4338
4364
  * @returns {string} 当前日期时间的格式化字符串
4339
- */
4340
- var getCurrentDateTime = function getCurrentDateTime() {
4341
- var format = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'YYYY-MM-DD HH:mm:ss';
4342
-
4343
- return formatDate(new Date(), format);
4344
- };
4345
-
4365
+ */
4366
+ const getCurrentDateTime = function (format = 'YYYY-MM-DD HH:mm:ss') {
4367
+ return formatDate(new Date(), format);
4368
+ };
4369
+
4346
4370
  /**
4347
4371
  * 获取小时
4348
4372
  * @date 2022年5月7日
4349
4373
  * @param {Date|string} [date] - 日期对象或日期字符串
4350
4374
  * @returns {number} 小时数(0-23)
4351
- */
4352
- var getHour = function getHour(date) {
4353
- if (!date) {
4354
- return new Date().getHours();
4355
- }
4356
- if (typeof date === 'string') {
4357
- date = new Date(date);
4358
- }
4359
- return date.getHours();
4360
- };
4361
-
4375
+ */
4376
+ const getHour = function (date) {
4377
+ if (!date) {
4378
+ return new Date().getHours();
4379
+ }
4380
+ if (typeof date === 'string') {
4381
+ date = new Date(date);
4382
+ }
4383
+ return date.getHours();
4384
+ };
4385
+
4362
4386
  /**
4363
4387
  * 获取分钟
4364
4388
  * @date 2022年5月7日
4365
4389
  * @param {Date|string} [date] - 日期对象或日期字符串
4366
4390
  * @returns {number} 分钟数(0-59)
4367
- */
4368
- var getMinute = function getMinute(date) {
4369
- if (!date) {
4370
- return new Date().getMinutes();
4371
- }
4372
- if (typeof date === 'string') {
4373
- date = new Date(date);
4374
- }
4375
- return date.getMinutes();
4376
- };
4377
-
4391
+ */
4392
+ const getMinute = function (date) {
4393
+ if (!date) {
4394
+ return new Date().getMinutes();
4395
+ }
4396
+ if (typeof date === 'string') {
4397
+ date = new Date(date);
4398
+ }
4399
+ return date.getMinutes();
4400
+ };
4401
+
4378
4402
  /**
4379
4403
  * 获取月份
4380
4404
  * @date 2022年5月7日
4381
4405
  * @param {Date|string} [date] - 日期对象或日期字符串
4382
4406
  * @returns {number} 月份数(1-12)
4383
- */
4384
- var getMonth = function getMonth(date) {
4385
- if (!date) {
4386
- return new Date().getMonth() + 1;
4387
- }
4388
- if (typeof date === 'string') {
4389
- date = new Date(date);
4390
- }
4391
- return date.getMonth() + 1;
4392
- };
4393
-
4407
+ */
4408
+ const getMonth = function (date) {
4409
+ if (!date) {
4410
+ return new Date().getMonth() + 1;
4411
+ }
4412
+ if (typeof date === 'string') {
4413
+ date = new Date(date);
4414
+ }
4415
+ return date.getMonth() + 1;
4416
+ };
4417
+
4394
4418
  /**
4395
4419
  * 获取秒
4396
4420
  * @date 2022年5月7日
4397
4421
  * @param {Date|string} [date] - 日期对象或日期字符串
4398
4422
  * @returns {number} 秒数(0-59)
4399
- */
4400
- var getSecond = function getSecond(date) {
4401
- if (!date) {
4402
- return new Date().getSeconds();
4403
- }
4404
- if (typeof date === 'string') {
4405
- date = new Date(date);
4406
- }
4407
- return date.getSeconds();
4408
- };
4409
-
4423
+ */
4424
+ const getSecond = function (date) {
4425
+ if (!date) {
4426
+ return new Date().getSeconds();
4427
+ }
4428
+ if (typeof date === 'string') {
4429
+ date = new Date(date);
4430
+ }
4431
+ return date.getSeconds();
4432
+ };
4433
+
4410
4434
  /**
4411
4435
  * 获取星期几
4412
4436
  * @date 2022年5月7日
4413
4437
  * @param {Date|string} [date] - 日期对象或日期字符串
4414
4438
  * @returns {number} 星期几(0-6,0表示星期日)
4415
- */
4416
- var getWeekday = function getWeekday(date) {
4417
- if (!date) {
4418
- return new Date().getDay();
4419
- }
4420
- if (typeof date === 'string') {
4421
- date = new Date(date);
4422
- }
4423
- return date.getDay();
4424
- };
4425
-
4439
+ */
4440
+ const getWeekday = function (date) {
4441
+ if (!date) {
4442
+ return new Date().getDay();
4443
+ }
4444
+ if (typeof date === 'string') {
4445
+ date = new Date(date);
4446
+ }
4447
+ return date.getDay();
4448
+ };
4449
+
4450
+
4426
4451
  /**
4427
4452
  * @desc 获取上午/下午/晚上
4428
4453
  * @author huangbo
4429
4454
  * @date 2022年5月7日
4430
4455
  * @param {String} [time] - 时间
4431
- **/
4432
- var timeCycle = function timeCycle(time) {
4433
- var hour = 0;
4434
- if (!time) {
4435
- hour = new Date().getHours();
4436
- } else if (typeof time === 'string') {
4437
- // 从时间字符串中提取小时
4438
- var match = time.match(/^(\d{1,2})/);
4439
- if (match) {
4440
- hour = parseInt(match[1], 10);
4441
- }
4442
- } else if (typeof time === 'number') {
4443
- hour = time;
4444
- }
4445
- // 判断时间段
4446
- if (hour >= 5 && hour < 12) {
4447
- return '上午';
4448
- } else if (hour >= 12 && hour < 18) {
4449
- return '下午';
4450
- } else {
4451
- return '晚上';
4452
- }
4456
+ **/
4457
+ const timeCycle = function (time) {
4458
+ let hour = 0;
4459
+ if (!time) {
4460
+ hour = new Date().getHours();
4461
+ } else if (typeof time === 'string') {
4462
+ // 从时间字符串中提取小时
4463
+ const match = time.match(/^(\d{1,2})/);
4464
+ if (match) {
4465
+ hour = parseInt(match[1], 10);
4466
+ }
4467
+ } else if (typeof time === 'number') {
4468
+ hour = time;
4469
+ }
4470
+ // 判断时间段
4471
+ if (hour >= 5 && hour < 12) {
4472
+ return '上午';
4473
+ } else if (hour >= 12 && hour < 18) {
4474
+ return '下午';
4475
+ } else {
4476
+ return '晚上';
4477
+ }
4453
4478
  };
4454
4479
 
4455
4480
  /***/ }),
@@ -4468,7 +4493,7 @@ module.exports = require("lodash/cloneDeep");
4468
4493
 
4469
4494
  /***/ }),
4470
4495
 
4471
- /***/ 242:
4496
+ /***/ 248:
4472
4497
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
4473
4498
 
4474
4499
  "use strict";
@@ -5060,7 +5085,7 @@ var orderBy = function orderBy(array, sortKey, reverse, sortMethod, sortBy) {
5060
5085
  }
5061
5086
  return sortBy.map(function (by) {
5062
5087
  if (typeof by === 'string') {
5063
- return Object(eoss_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* getValueByPath */ "w"])(value, by);
5088
+ return Object(eoss_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* getValueByPath */ "v"])(value, by);
5064
5089
  } else {
5065
5090
  return by(value, index, array);
5066
5091
  }
@@ -5069,7 +5094,7 @@ var orderBy = function orderBy(array, sortKey, reverse, sortMethod, sortBy) {
5069
5094
  if (sortKey !== '$key') {
5070
5095
  if (isObject(value) && '$value' in value) value = value.$value;
5071
5096
  }
5072
- return [isObject(value) ? Object(eoss_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* getValueByPath */ "w"])(value, sortKey) : value];
5097
+ return [isObject(value) ? Object(eoss_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* getValueByPath */ "v"])(value, sortKey) : value];
5073
5098
  };
5074
5099
  var compare = function compare(a, b) {
5075
5100
  if (sortMethod) {
@@ -5515,7 +5540,7 @@ function defaultRenderCell(h, _ref2) {
5515
5540
  if (property && row) {
5516
5541
  try {
5517
5542
  // 假设getPropByPath是一个外部函数,需要确保它存在
5518
- var result = typeof eoss_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* getPropByPath */ "u"] === 'function' ? Object(eoss_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* getPropByPath */ "u"])(row, property) : { v: undefined };
5543
+ var result = typeof eoss_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* getPropByPath */ "t"] === 'function' ? Object(eoss_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* getPropByPath */ "t"])(row, property) : { v: undefined };
5519
5544
  value = result && result.v;
5520
5545
  } catch (error) {
5521
5546
  console.error('Error getting property value:', error);