eoss 0.1.0-alpha.20 → 0.1.0-alpha.21

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 (207) hide show
  1. package/lib/account-login.js +1943 -1890
  2. package/lib/alert.js +4 -4
  3. package/lib/aside.js +4 -4
  4. package/lib/autocomplete.js +4936 -4834
  5. package/lib/avatar.js +4 -4
  6. package/lib/backtop.js +4 -4
  7. package/lib/badge.js +4 -4
  8. package/lib/breadcrumb-item.js +6 -6
  9. package/lib/breadcrumb.js +7 -7
  10. package/lib/button-group.js +11 -14
  11. package/lib/button.js +6 -6
  12. package/lib/ca-login.js +2480 -2382
  13. package/lib/calendar.js +798 -798
  14. package/lib/card.js +4 -4
  15. package/lib/carousel-item.js +911 -813
  16. package/lib/carousel.js +1646 -1548
  17. package/lib/cascader-panel.js +2556 -2458
  18. package/lib/cascader.js +4546 -4444
  19. package/lib/checkbox-button.js +4 -4
  20. package/lib/checkbox-group.js +2894 -2841
  21. package/lib/checkbox.js +4 -4
  22. package/lib/col.js +2 -2
  23. package/lib/collapse-item.js +35159 -2572
  24. package/lib/collapse.js +35410 -2762
  25. package/lib/color-picker.js +494 -490
  26. package/lib/config/api.js +15 -1
  27. package/lib/container.js +4 -4
  28. package/lib/cron.js +4 -4
  29. package/lib/data-table.js +1895 -1842
  30. package/lib/date-picker.js +6422 -6320
  31. package/lib/dialog.js +2912 -2806
  32. package/lib/divider.js +4 -4
  33. package/lib/drawer.js +311 -299
  34. package/lib/dropdown-item.js +6 -6
  35. package/lib/dropdown-menu.js +539 -535
  36. package/lib/dropdown.js +2270 -2172
  37. package/lib/email-login.js +1783 -1730
  38. package/lib/empty.js +723 -0
  39. package/lib/eoss.common.js +63680 -56193
  40. package/lib/flip.js +4 -4
  41. package/lib/flow-group.js +2985 -2887
  42. package/lib/flow.js +28067 -28022
  43. package/lib/footer.js +4 -4
  44. package/lib/form-item.js +1935 -1837
  45. package/lib/form.js +9230 -9092
  46. package/lib/header.js +4 -4
  47. package/lib/icon.js +1708 -1590
  48. package/lib/icons.js +4 -4
  49. package/lib/image-viewer.js +1660 -1562
  50. package/lib/image.js +162 -162
  51. package/lib/index.js +1 -1
  52. package/lib/infinite-scroll.js +76 -76
  53. package/lib/input-number.js +172 -172
  54. package/lib/input.js +1362 -1264
  55. package/lib/link.js +4 -4
  56. package/lib/loading.js +321 -317
  57. package/lib/login.js +3306 -3300
  58. package/lib/lowcode.js +13320 -0
  59. package/lib/main.js +14465 -14339
  60. package/lib/marquee.js +1237 -1139
  61. package/lib/menu-item-group.js +119 -119
  62. package/lib/menu-item.js +114 -114
  63. package/lib/menu.js +6193 -6091
  64. package/lib/message-box.js +3582 -3480
  65. package/lib/message.js +2265 -2163
  66. package/lib/notification.js +2430 -2328
  67. package/lib/option-group.js +4 -4
  68. package/lib/option.js +842 -744
  69. package/lib/page-header.js +4 -4
  70. package/lib/pagination.js +1916 -1815
  71. package/lib/phone-login.js +1788 -1735
  72. package/lib/popconfirm.js +8 -8
  73. package/lib/popover.js +4559 -4457
  74. package/lib/progress.js +4 -4
  75. package/lib/qr-code.js +9 -9
  76. package/lib/qrcode-login.js +1600 -1543
  77. package/lib/radio-button.js +6 -6
  78. package/lib/radio-group.js +2142 -2089
  79. package/lib/radio.js +6 -6
  80. package/lib/rate.js +1226 -1128
  81. package/lib/row.js +2 -2
  82. package/lib/scrollbar.js +2695 -2597
  83. package/lib/select.js +5985 -5961
  84. package/lib/selector-panel.js +5239 -5186
  85. package/lib/selector.js +1712 -1659
  86. package/lib/slider.js +16 -16
  87. package/lib/step.js +35836 -2736
  88. package/lib/steps.js +1281 -1183
  89. package/lib/submenu.js +461 -457
  90. package/lib/switch.js +1010 -912
  91. package/lib/tab-pane.js +4 -4
  92. package/lib/table-column.js +2595 -2497
  93. package/lib/table.js +9225 -9239
  94. package/lib/tabs.js +2414 -2320
  95. package/lib/tag.js +4 -4
  96. package/lib/theme-chalk/account-login.css +1 -1
  97. package/lib/theme-chalk/autocomplete.css +1 -1
  98. package/lib/theme-chalk/base.css +1 -1
  99. package/lib/theme-chalk/cascader.css +1 -1
  100. package/lib/theme-chalk/date-picker.css +1 -1
  101. package/lib/theme-chalk/empty.css +1 -0
  102. package/lib/theme-chalk/fonts/iconfont.ttf +0 -0
  103. package/lib/theme-chalk/fonts/iconfont.woff +0 -0
  104. package/lib/theme-chalk/form.css +1 -1
  105. package/lib/theme-chalk/icon.css +1 -1
  106. package/lib/theme-chalk/index.css +1 -1
  107. package/lib/theme-chalk/input-number.css +1 -1
  108. package/lib/theme-chalk/input.css +1 -1
  109. package/lib/theme-chalk/login.css +1 -1
  110. package/lib/theme-chalk/lowcode.css +1 -0
  111. package/lib/theme-chalk/main.css +1 -1
  112. package/lib/theme-chalk/message-box.css +1 -1
  113. package/lib/theme-chalk/pagination.css +1 -1
  114. package/lib/theme-chalk/qrcode-login.css +1 -1
  115. package/lib/theme-chalk/select.css +1 -1
  116. package/lib/theme-chalk/slider.css +1 -1
  117. package/lib/theme-chalk/tabs.css +1 -1
  118. package/lib/theme-chalk/time-picker.css +1 -1
  119. package/lib/theme-chalk/transfer.css +1 -1
  120. package/lib/time-picker.js +5823 -5819
  121. package/lib/time-select.js +3578 -3574
  122. package/lib/timeline-item.js +4 -4
  123. package/lib/timeline.js +4 -4
  124. package/lib/tips.js +1633 -1580
  125. package/lib/toolbar.js +213 -213
  126. package/lib/tooltip.js +4441 -4339
  127. package/lib/transfer.js +938 -840
  128. package/lib/tree-group.js +1875 -1757
  129. package/lib/tree.js +2626 -2573
  130. package/lib/upload.js +7209 -7156
  131. package/lib/utils/ajax.js +185 -243
  132. package/lib/utils/bus.js +2 -2
  133. package/lib/utils/popup/index.js +5 -1
  134. package/lib/utils/util.js +108 -11
  135. package/package.json +2 -2
  136. package/packages/button/src/button-group.vue +1 -4
  137. package/packages/collapse/src/collapse-item.vue +47 -33
  138. package/packages/dialog/src/dialog.vue +4 -1
  139. package/packages/drawer/src/drawer.vue +12 -4
  140. package/packages/empty/index.js +7 -0
  141. package/packages/empty/src/img-empty.vue +132 -0
  142. package/packages/empty/src/index.vue +49 -0
  143. package/packages/form/src/form-item-render.vue +16 -18
  144. package/packages/form/src/form.vue +27 -5
  145. package/packages/icons/src/icon.json +1 -1
  146. package/packages/login/src/login.vue +19 -21
  147. package/packages/login/src/mixins.js +2 -1
  148. package/packages/lowcode/index.js +5 -0
  149. package/packages/lowcode/src/aside.vue +331 -0
  150. package/packages/lowcode/src/attribute/bind.vue +441 -0
  151. package/packages/lowcode/src/attribute/dependency.vue +325 -0
  152. package/packages/lowcode/src/attribute/function.vue +112 -0
  153. package/packages/lowcode/src/attribute/property.vue +331 -0
  154. package/packages/lowcode/src/attribute/styles.vue +318 -0
  155. package/packages/lowcode/src/attribute.vue +135 -0
  156. package/packages/lowcode/src/canvas.vue +296 -0
  157. package/packages/lowcode/src/json.vue +32 -0
  158. package/packages/lowcode/src/lowcode.vue +539 -0
  159. package/packages/lowcode/src/modules.vue +93 -0
  160. package/packages/lowcode/src/pages.vue +91 -0
  161. package/packages/lowcode/src/render.vue +247 -0
  162. package/packages/lowcode/src/source.vue +32 -0
  163. package/packages/lowcode/src/toolbar.vue +162 -0
  164. package/packages/main/src/components/pages.vue +28 -2
  165. package/packages/main/src/components/set-menus.vue +3 -3
  166. package/packages/main/src/components/user.vue +6 -1
  167. package/packages/main/src/early.vue +2 -2
  168. package/packages/main/src/gzw.vue +55 -61
  169. package/packages/main/src/minxs.js +113 -36
  170. package/packages/pagination/src/pager.vue +2 -2
  171. package/packages/pagination/src/pagination.js +4 -1
  172. package/packages/qrcode-login/src/qrcode-login.vue +6 -2
  173. package/packages/select/src/select.vue +28 -6
  174. package/packages/steps/src/step.vue +7 -5
  175. package/packages/tabs/src/tab-nav.vue +1 -0
  176. package/packages/tabs/src/tabs.vue +0 -2
  177. package/packages/theme-chalk/dist/fonts/iconfont.ttf +0 -0
  178. package/packages/theme-chalk/dist/fonts/iconfont.woff +0 -0
  179. package/packages/theme-chalk/gulpfile.js +3 -0
  180. package/packages/theme-chalk/src/account-login.scss +1 -0
  181. package/packages/theme-chalk/src/base.scss +1 -1
  182. package/packages/theme-chalk/src/common/var.scss +16 -0
  183. package/packages/theme-chalk/src/empty.scss +45 -0
  184. package/packages/theme-chalk/src/fonts/iconfont.ttf +0 -0
  185. package/packages/theme-chalk/src/fonts/iconfont.woff +0 -0
  186. package/packages/theme-chalk/src/form.scss +1 -8
  187. package/packages/theme-chalk/src/icon.scss +30 -1
  188. package/packages/theme-chalk/src/index.scss +2 -0
  189. package/packages/theme-chalk/src/input-number.scss +0 -4
  190. package/packages/theme-chalk/src/input.scss +9 -0
  191. package/packages/theme-chalk/src/login.scss +32 -29
  192. package/packages/theme-chalk/src/lowcode.scss +461 -0
  193. package/packages/theme-chalk/src/main.scss +28 -65
  194. package/packages/theme-chalk/src/pagination.scss +4 -55
  195. package/packages/theme-chalk/src/qrcode-login.scss +3 -1
  196. package/packages/theme-chalk/src/tabs.scss +81 -50
  197. package/src/config/api.js +13 -0
  198. package/src/index.js +17 -4
  199. package/src/utils/ajax.js +61 -65
  200. package/src/utils/bus.js +2 -2
  201. package/src/utils/popup/index.js +5 -1
  202. package/src/utils/util.js +104 -7
  203. package/lib/index_/345/211/257/346/234/254.js +0 -583
  204. package/packages/dialog copy/index.js +0 -8
  205. package/packages/dialog copy/src/dialog.vue +0 -615
  206. package/src/index_/345/211/257/346/234/254.js +0 -359
  207. /package/{packages/form/src → src/components}/field-render.vue +0 -0
package/lib/input.js CHANGED
@@ -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 = 129);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 131);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -91,13 +91,13 @@ 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__, "K", function() { return noop; });
94
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "L", function() { return noop; });
95
95
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return hasOwn; });
96
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "U", function() { return toObject; });
96
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "V", function() { return toObject; });
97
97
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "v", function() { return getValueByPath; });
98
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__, "Y", 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; });
@@ -111,12 +111,12 @@ module.exports =
111
111
  /* unused harmony export looseEqual */
112
112
  /* unused harmony export arrayEquals */
113
113
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "C", function() { return isEqual; });
114
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "M", function() { return rafThrottle; });
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__, "O", 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__, "R", 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 */
@@ -150,7 +150,7 @@ module.exports =
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__, "S", function() { return timestampUrl; });
153
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "T", function() { return timestampUrl; });
154
154
  /* unused harmony export hasChars */
155
155
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "y", function() { return identical; });
156
156
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "z", function() { return indexOfObj; });
@@ -159,41 +159,42 @@ module.exports =
159
159
  /* unused harmony export isFunction */
160
160
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "G", function() { return isObjectEqual; });
161
161
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "H", function() { return joinUrl; });
162
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "J", function() { return layoutWaterfall; });
162
163
  /* unused harmony export loadJs */
163
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "J", function() { return loading; });
164
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "K", function() { return loading; });
164
165
  /* unused harmony export lowerCase */
165
166
  /* unused harmony export overbrim */
166
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "L", function() { return queryParams; });
167
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "M", function() { return queryParams; });
167
168
  /* unused harmony export receiveMessage */
168
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "N", function() { return renderIcon; });
169
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "O", function() { return renderIcon; });
169
170
  /* unused harmony export replenish */
170
171
  /* unused harmony export rmbToCapital */
171
172
  /* unused harmony export setScale */
172
173
  /* unused harmony export sendMessage */
173
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "P", function() { return setFavicon; });
174
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Q", function() { return setFavicon; });
174
175
  /* unused harmony export sum */
175
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Q", function() { return startWith; });
176
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "R", function() { return startWith; });
176
177
  /* unused harmony export takeLeft */
177
178
  /* unused harmony export takeRight */
178
179
  /* unused harmony export trimWhitespace */
179
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "T", function() { return toFixed; });
180
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "U", function() { return toFixed; });
180
181
  /* unused harmony export toFunction */
181
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "V", function() { return updateTheme; });
182
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "W", function() { return updateTheme; });
182
183
  /* unused harmony export upperType */
183
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "W", function() { return urlJoinParams; });
184
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "X", function() { return uuid; });
185
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ab", function() { return watermark; });
184
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "X", function() { return urlJoinParams; });
185
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Y", function() { return uuid; });
186
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bb", function() { return watermark; });
186
187
  /* unused harmony export winTopOpen */
187
188
  /* unused harmony export confirm */
188
189
  /* unused harmony export success */
189
190
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return error; });
190
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Z", function() { return warning; });
191
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
191
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ab", function() { return warning; });
192
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
192
193
  /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
193
- /* harmony import */ var _color__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
194
- /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3);
195
- /* harmony import */ var _storage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1);
196
- /* harmony import */ var _date__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6);
194
+ /* harmony import */ var _color__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13);
195
+ /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6);
196
+ /* harmony import */ var _storage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2);
197
+ /* harmony import */ var _date__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1);
197
198
  var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
198
199
 
199
200
  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
@@ -203,9 +204,9 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
203
204
 
204
205
 
205
206
 
206
- var _get = __webpack_require__(15);
207
- var _set = __webpack_require__(16);
208
- var _cloneDeep = __webpack_require__(17);
207
+ var _get = __webpack_require__(20);
208
+ var _set = __webpack_require__(21);
209
+ var _cloneDeep = __webpack_require__(22);
209
210
  var hasOwnProperty = Object.prototype.hasOwnProperty;
210
211
 
211
212
  // 导入date中的formatDate函数
@@ -1404,7 +1405,9 @@ var getObjectType = function getObjectType(obj) {
1404
1405
  * @return {Object|string} 参数对象或指定参数值
1405
1406
  **/
1406
1407
  var getParams = function getParams() {
1407
- var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1408
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1409
+
1410
+ var _ref5 = typeof options === 'string' ? { name: options } : options,
1408
1411
  url = _ref5.url,
1409
1412
  name = _ref5.name;
1410
1413
 
@@ -1816,10 +1819,7 @@ var indexOfObj = function indexOfObj(arry, target, key) {
1816
1819
  return _i3;
1817
1820
  }
1818
1821
  } else if (target && (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object') {
1819
- if (currentItem[currentKey] === undefined) {
1820
- throw new Error('\u5C5E\u6027' + currentKey + '\u4E0D\u5B58\u5728');
1821
- }
1822
- if (currentItem[currentKey] === target[currentKey]) {
1822
+ if (currentItem[currentKey] !== undefined && currentItem[currentKey] === target[currentKey]) {
1823
1823
  return _i3;
1824
1824
  }
1825
1825
  }
@@ -2014,7 +2014,105 @@ var joinUrl = function joinUrl(_ref8) {
2014
2014
  // 如果前缀类型无效,直接返回URL
2015
2015
  return url;
2016
2016
  };
2017
+ /**
2018
+ * layoutWaterfall
2019
+ * @desc 布布流布局计算
2020
+ * @author huangbo
2021
+ * @date 2022年5月7日
2022
+ * @param {String} url - JS文件地址
2023
+ * @param {Function} [callback] - 回调函数
2024
+ **/
2025
+ var layoutWaterfall = function layoutWaterfall(self, container, pages, columns, gap) {
2026
+ if (!container) return;
2027
+
2028
+ if (pages.length === 0) return;
2029
+
2030
+ // 获取容器实际内容宽度(减去 padding)
2031
+ var computedStyle = getComputedStyle(container);
2032
+ var paddingLeft = parseFloat(computedStyle.paddingLeft) || 0;
2033
+ var paddingRight = parseFloat(computedStyle.paddingRight) || 0;
2034
+ var paddingTop = parseFloat(computedStyle.paddingTop) || 0;
2035
+ var containerWidth = container.clientWidth - paddingLeft - paddingRight;
2036
+ if (containerWidth === 0) return;
2037
+
2038
+ // 计算每列宽度
2039
+ var columnWidth = (containerWidth - gap * (columns - 1)) / columns;
2040
+
2041
+ // 初始化每列高度数组(以 paddingTop 为起始偏移)
2042
+ var columnHeights = new Array(columns).fill(paddingTop);
2043
+
2044
+ // 遍历所有元素,分配到高度最小的列
2045
+ pages.forEach(function (item) {
2046
+ // 确保span在有效范围内
2047
+ var span = Math.max(1, Math.min(item.style ? item.style.span || item.span || 1 : item.span || 1, columns));
2048
+
2049
+ // 找到可以容纳当前元素span宽度的最小高度起始列
2050
+ var minHeight = Infinity;
2051
+ var startColumn = 0;
2052
+
2053
+ // 遍历所有可能的起始列,找到可以放置span列元素的位置
2054
+ for (var i = 0; i <= columns - span; i++) {
2055
+ // 计算当前连续span列的最大高度
2056
+ var currentMaxHeight = 0;
2057
+ for (var j = i; j < i + span; j++) {
2058
+ if (columnHeights[j] > currentMaxHeight) {
2059
+ currentMaxHeight = columnHeights[j];
2060
+ }
2061
+ }
2062
+
2063
+ // 找到最小的最大高度
2064
+ if (currentMaxHeight < minHeight) {
2065
+ minHeight = currentMaxHeight;
2066
+ startColumn = i;
2067
+ }
2068
+ }
2069
+
2070
+ // 计算元素宽度和位置
2071
+ var existingWidth = item.style && item.style.width ? parseInt(item.style.width, 10) : null;
2072
+ var hasSpan = item.style && item.style.span || item.span;
2073
+ var calculatedWidth = columnWidth * span + gap * (span - 1);
2074
+ var useCustomWidth = !hasSpan && existingWidth;
2075
+ var elementWidth = useCustomWidth ? existingWidth : calculatedWidth;
2076
+
2077
+ // 根据是否使用自定义宽度计算 left(加上 padding 偏移)
2078
+ var left = void 0;
2079
+ if (useCustomWidth) {
2080
+ // 自定义宽度:在分配的列范围内居中(取整避免亚像素)
2081
+ var columnSpaceWidth = columnWidth * span + gap * (span - 1);
2082
+ left = Math.round(paddingLeft + startColumn * columnWidth + startColumn * gap + (columnSpaceWidth - elementWidth) / 2);
2083
+ } else {
2084
+ // 标准 span 宽度:正常计算位置
2085
+ left = paddingLeft + startColumn * columnWidth + startColumn * gap;
2086
+ }
2087
+ var top = minHeight;
2017
2088
 
2089
+ // 设置元素样式(使用Vue的$set确保响应式)
2090
+ if (!item.style) {
2091
+ self.$set(item, 'style', {});
2092
+ }
2093
+ var height = item.style.height ? parseInt(item.style.height, 10) : 30;
2094
+ self.$set(item.style, 'position', 'absolute');
2095
+ self.$set(item.style, 'width', elementWidth + 'px');
2096
+ self.$set(item.style, 'height', height + 'px');
2097
+ self.$set(item.style, 'left', left + 'px');
2098
+ self.$set(item.style, 'top', top + 'px');
2099
+ if (!useCustomWidth) {
2100
+ self.$set(item.style, 'span', span);
2101
+ }
2102
+
2103
+ // 更新所有被占用列的高度
2104
+ var newHeight = top + height + gap;
2105
+ for (var _i5 = startColumn; _i5 < startColumn + span; _i5++) {
2106
+ columnHeights[_i5] = newHeight;
2107
+ }
2108
+ });
2109
+
2110
+ // 设置容器高度
2111
+ var maxHeight = Math.max.apply(Math, columnHeights);
2112
+ container.style.position = 'relative';
2113
+ container.style.height = maxHeight - gap + 'px'; // 减去最后一个间隙
2114
+ return { columnWidth: columnWidth, width: containerWidth };
2115
+ };
2018
2116
  /**
2019
2117
  * loadJs
2020
2118
  * @desc 加载JS文件
@@ -2045,7 +2143,7 @@ var loadJs = function loadJs(url, callback) {
2045
2143
  var loading = function loading() {
2046
2144
  var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '请求中...';
2047
2145
 
2048
- var Loading = __webpack_require__(13).default;
2146
+ var Loading = __webpack_require__(19).default;
2049
2147
  return Loading.service({
2050
2148
  text: text,
2051
2149
  spinner: 'es-icon-jiazai',
@@ -2163,8 +2261,8 @@ var renderIcon = function renderIcon(data, node, icons) {
2163
2261
  var _ref9 = data || {},
2164
2262
  attributes = _ref9.attributes;
2165
2263
 
2166
- var orgType = attributes.orgType || data.orgType;
2167
- var layerlevel = attributes.layerlevel || data.layerlevel;
2264
+ var orgType = attributes ? attributes.orgType : data.orgType;
2265
+ var layerlevel = attributes ? attributes.layerlevel : data.layerlevel;
2168
2266
  if (!orgType) return '';
2169
2267
  var key = orgType === 'org' ? layerlevel ? 'bumen' : 'gongsi' : 'bumen';
2170
2268
  if (node.level === 1 && (data.subNode || data.isParent || data.hasChildren)) {
@@ -2243,10 +2341,10 @@ var rmbToCapital = function rmbToCapital(num) {
2243
2341
  // 处理小数部分
2244
2342
  var decimalCapital = '';
2245
2343
  if (parseInt(decimalPart, 10) > 0) {
2246
- for (var _i5 = 0; _i5 < decimalPart.length; _i5++) {
2247
- var _digit = parseInt(decimalPart[_i5], 10);
2344
+ for (var _i6 = 0; _i6 < decimalPart.length; _i6++) {
2345
+ var _digit = parseInt(decimalPart[_i6], 10);
2248
2346
  if (_digit > 0) {
2249
- decimalCapital += chineseNumbers[_digit] + decimalUnits[_i5];
2347
+ decimalCapital += chineseNumbers[_digit] + decimalUnits[_i6];
2250
2348
  } else if (decimalCapital[decimalCapital.length - 1] !== chineseNumbers[0]) {
2251
2349
  decimalCapital += chineseNumbers[_digit];
2252
2350
  }
@@ -2912,1033 +3010,6 @@ var warning = function warning(content, _callback3) {
2912
3010
  /***/ 1:
2913
3011
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2914
3012
 
2915
- "use strict";
2916
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return setStorage; });
2917
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getStorage; });
2918
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return removeStorage; });
2919
- /* unused harmony export setCookie */
2920
- /* unused harmony export getCookie */
2921
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
2922
-
2923
- /**
2924
- * setStorage
2925
- * @desc:设置本地储存数据
2926
- * @author huangbo
2927
- * @date 2022年5月7日
2928
- * @param {String|Object} [key] - 数据的名称或包含type、key、value的对象
2929
- * @param {String} [value] - 数据的值(当第一个参数为字符串时使用)
2930
- **/
2931
- var setStorage = function setStorage(key, value) {
2932
- // 解析参数,支持两种调用方式:setStorage(key, value) 和 setStorage({type, key, value})
2933
- var type = void 0,
2934
- finalKey = void 0,
2935
- finalValue = void 0;
2936
-
2937
- if ((typeof key === 'undefined' ? 'undefined' : _typeof(key)) === 'object' && key !== null) {
2938
- // 对象调用方式:setStorage({type, key, value})
2939
- type = key.type;
2940
- finalKey = key.key;
2941
- finalValue = key.value;
2942
- } else {
2943
- // 字符串调用方式:setStorage(key, value)
2944
- type = getStorage('storageType');
2945
- finalKey = key;
2946
- finalValue = value;
2947
- }
2948
-
2949
- // 使用默认存储类型如果未指定
2950
- type = type || getStorage('storageType');
2951
-
2952
- // 获取存储对象
2953
- var storage = type === 'localStorage' ? localStorage : sessionStorage;
2954
-
2955
- // 处理不同类型的key
2956
- if (typeof finalKey === 'string') {
2957
- // 单个字符串key
2958
- var storedValue = (typeof finalValue === 'undefined' ? 'undefined' : _typeof(finalValue)) === 'object' ? JSON.stringify(finalValue) : finalValue;
2959
- storage.setItem(finalKey, storedValue);
2960
- if (finalKey === 'token') {
2961
- setCookie('token', storedValue);
2962
- }
2963
- } else if (Array.isArray(finalKey)) {
2964
- // 数组key,为多个key设置同一个value
2965
- var _storedValue = (typeof finalValue === 'undefined' ? 'undefined' : _typeof(finalValue)) === 'object' ? JSON.stringify(finalValue) : finalValue;
2966
- for (var i = 0; i < finalKey.length; i++) {
2967
- storage.setItem(finalKey[i], _storedValue);
2968
- if (finalKey[i] === 'token') {
2969
- setCookie('token', _storedValue);
2970
- }
2971
- }
2972
- } else if ((typeof finalKey === 'undefined' ? 'undefined' : _typeof(finalKey)) === 'object' && finalKey !== null) {
2973
- // 对象key,对象的属性名称作为key,属性值作为value
2974
- for (var k in finalKey) {
2975
- if (Object.prototype.hasOwnProperty.call(finalKey, k)) {
2976
- var _storedValue2 = _typeof(finalKey[k]) === 'object' ? JSON.stringify(finalKey[k]) : finalKey[k];
2977
- storage.setItem(k, _storedValue2);
2978
- if (k === 'token') {
2979
- setCookie('token', _storedValue2);
2980
- }
2981
- }
2982
- }
2983
- }
2984
- };
2985
-
2986
- /**
2987
- * getStorage
2988
- * @desc:获取本地储存数据
2989
- * @author huangbo
2990
- * @date 2022年5月7日
2991
- * @param {String} [key] - 获取的名称
2992
- **/
2993
- var getStorage = function getStorage(key) {
2994
- if (key) {
2995
- var res = sessionStorage.getItem(key) || localStorage.getItem(key);
2996
- if (!res && key === 'token') {
2997
- res = getCookie('token');
2998
- }
2999
- if (key === 'host' && !res) {
3000
- res = '';
3001
- }
3002
- return res;
3003
- }
3004
- var defaults = {};
3005
- var token = sessionStorage.getItem('token') || localStorage.getItem('token') || getCookie('token');
3006
- var ssId = sessionStorage.getItem('ssId') || localStorage.getItem('ssId') || getCookie('ssId');
3007
-
3008
- var deviceUnique = sessionStorage.getItem('deviceUnique') || localStorage.getItem('deviceUnique') || getCookie('deviceUnique');
3009
- if (token) {
3010
- defaults.Authorization = token;
3011
- }
3012
- if (ssId) {
3013
- defaults.ssId = ssId;
3014
- }
3015
- if (deviceUnique) {
3016
- defaults.deviceUnique = deviceUnique;
3017
- }
3018
- return defaults;
3019
- };
3020
-
3021
- /**
3022
- * removeStorage
3023
- * @desc:删除本地储存数据
3024
- * @author huangbo
3025
- * @date 2022年5月7日
3026
- * @param {String, Array} [key] - 获取的名称
3027
- **/
3028
- var removeStorage = function removeStorage(key) {
3029
- if (Array.isArray(key)) {
3030
- for (var i = 0; i < key.length; i++) {
3031
- sessionStorage.removeItem(key[i]);
3032
- localStorage.removeItem(key[i]);
3033
- if (key[i] === 'token') {
3034
- removeCookie('token');
3035
- }
3036
- }
3037
- } else if (key) {
3038
- sessionStorage.removeItem(key);
3039
- localStorage.removeItem(key);
3040
- if (key === 'token') {
3041
- removeCookie('token');
3042
- }
3043
- } else {
3044
- sessionStorage.clear();
3045
- localStorage.clear();
3046
- removeCookie('token');
3047
- }
3048
- };
3049
-
3050
- /**
3051
- * setCookie
3052
- * @desc 设置cookie
3053
- * @author huangbo
3054
- * @param {string} [name] cookie名称
3055
- * @param {string} [value] cookie值
3056
- * @param {boolean} [isSession] 是否是会话cookie
3057
- **/
3058
- var setCookie = function setCookie(name, value) {
3059
- var isSession = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
3060
- var time = arguments[3];
3061
-
3062
- try {
3063
- var cookieParts = [encodeURIComponent(name) + '=' + encodeURIComponent(value), 'path=/' // 仅保留path设置,确保全站访问
3064
- ];
3065
- // 会话/持久Cookie设置
3066
- if (!isSession) {
3067
- if (/MSIE|Trident/.test(navigator.userAgent)) {
3068
- // IE使用expires
3069
- var date = new Date();
3070
- date.setTime(date.getTime() + (time || 7 * 24 * 60 * 60 * 1000));
3071
- cookieParts.push('expires=' + date.toUTCString());
3072
- } else {
3073
- // 其他浏览器使用max-age
3074
- cookieParts.push('max-age=' + (time || 7 * 24 * 60 * 60));
3075
- }
3076
- }
3077
- // 内核兼容处理
3078
- if (/MSIE|Trident/.test(navigator.userAgent)) {
3079
- // IE特殊处理:添加P3P协议头
3080
- cookieParts.push('P3P=CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
3081
- } else {
3082
- // 现代浏览器设置
3083
- cookieParts.push('samesite=lax');
3084
- if (window.location.protocol === 'https:') {
3085
- cookieParts.push('secure');
3086
- }
3087
- }
3088
-
3089
- // 设置Cookie
3090
- document.cookie = cookieParts.join('; ');
3091
- return true;
3092
- } catch (e) {
3093
- console.error('Cookie设置失败:', e);
3094
- return false;
3095
- }
3096
- };
3097
-
3098
- /**
3099
- * getCookie
3100
- * @desc 获取cookie中指定名称的值
3101
- * @author huangbo
3102
- * @param {string} [name] cookie名称
3103
- **/
3104
- var getCookie = function getCookie(name) {
3105
- var cookies = document.cookie.split(';');
3106
- for (var _iterator = cookies, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
3107
- var _ref;
3108
-
3109
- if (_isArray) {
3110
- if (_i >= _iterator.length) break;
3111
- _ref = _iterator[_i++];
3112
- } else {
3113
- _i = _iterator.next();
3114
- if (_i.done) break;
3115
- _ref = _i.value;
3116
- }
3117
-
3118
- var cookie = _ref;
3119
-
3120
- var _cookie$trim$split = cookie.trim().split('='),
3121
- cookieName = _cookie$trim$split[0],
3122
- cookieValue = _cookie$trim$split[1];
3123
-
3124
- if (decodeURIComponent(cookieName) === name) {
3125
- return decodeURIComponent(cookieValue);
3126
- }
3127
- }
3128
- return null;
3129
- };
3130
-
3131
- /**
3132
- * removeCookie
3133
- * @desc:删除cookie
3134
- * @author huangbo
3135
- * @date 2022年5月7日
3136
- * @param {String, Array} [key] - 获取的名称
3137
- **/
3138
- var removeCookie = function removeCookie(key) {
3139
- if (Array.isArray(key)) {
3140
- for (var i = 0; i < key.length; i++) {
3141
- document.cookie = encodeURIComponent(key[i]) + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
3142
- }
3143
- } else {
3144
- document.cookie = encodeURIComponent(key) + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
3145
- }
3146
- };
3147
-
3148
- /***/ }),
3149
-
3150
- /***/ 10:
3151
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3152
-
3153
- "use strict";
3154
- function _broadcast(componentName, eventName, params) {
3155
- this.$children.forEach(function (child) {
3156
- var name = child.$options.componentName;
3157
-
3158
- if (name === componentName) {
3159
- child.$emit.apply(child, [eventName].concat(params));
3160
- } else {
3161
- _broadcast.apply(child, [componentName, eventName].concat([params]));
3162
- }
3163
- });
3164
- }
3165
- /* harmony default export */ __webpack_exports__["a"] = ({
3166
- methods: {
3167
- dispatch: function dispatch(componentName, eventName, params) {
3168
- var parent = this.$parent || this.$root;
3169
- var name = parent.$options.componentName;
3170
-
3171
- while (parent && (!name || name !== componentName)) {
3172
- parent = parent.$parent;
3173
-
3174
- if (parent) {
3175
- name = parent.$options.componentName;
3176
- }
3177
- }
3178
- if (parent) {
3179
- parent.$emit.apply(parent, [eventName].concat(params));
3180
- }
3181
- },
3182
- broadcast: function broadcast(componentName, eventName, params) {
3183
- _broadcast.call(this, componentName, eventName, params);
3184
- }
3185
- }
3186
- });
3187
-
3188
- /***/ }),
3189
-
3190
- /***/ 12:
3191
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3192
-
3193
- "use strict";
3194
- /* unused harmony export getHue */
3195
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getColor; });
3196
- /* unused harmony export getLightness */
3197
- /* unused harmony export getSaturation */
3198
- /* unused harmony export rgbToHsv */
3199
- /* unused harmony export hsvTorgb */
3200
- /* unused harmony export mixColor */
3201
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getRgb; });
3202
- /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
3203
-
3204
- var $hueStep = 2;
3205
- var $saturationStep1 = 0.16;
3206
- var $saturationStep2 = 0.05;
3207
- var $brightnessStep1 = 0.05;
3208
- var $brightnessStep2 = 0.15;
3209
- var $lightColorCount = 5;
3210
- var $darkColorCount = 4;
3211
- /**
3212
- * getHue
3213
- * @desc:转换色相
3214
- * @author huangbo
3215
- * @date 2022年5月7日
3216
- **/
3217
- var getHue = function getHue($h, $i, $isLight) {
3218
- var $hue = void 0;
3219
- if ($h >= 60 && $h <= 240) {
3220
- $hue = $isLight ? $h - $hueStep * $i : $h + $hueStep * $i;
3221
- } else {
3222
- $hue = $isLight ? $h + $hueStep * $i : $h - $hueStep * $i;
3223
- }
3224
- $hue = ($hue + 360) % 360;
3225
- return Math.round($hue);
3226
- };
3227
-
3228
- /**
3229
- * getColor
3230
- * @desc:根据颜色和对应的色板位置,计算出对应的色板颜色
3231
- * @author huangbo
3232
- * @date 2022年5月7日
3233
- **/
3234
- var getColor = function getColor($color, $n) {
3235
- var $isLight = $n < 7;
3236
- var $hsv = rgbToHsv($color);
3237
- // 这里将i转换成以主色为中心,两侧的i值逐渐增大
3238
- var $i = $isLight ? $lightColorCount + 1 - $n : $n - $lightColorCount - 1;
3239
- var color = hsvTorgb(getHue($hsv[0], $i, $isLight), getSaturation($hsv[1], $i, $isLight), getLightness($hsv[2], $i, $isLight));
3240
- return color;
3241
- };
3242
-
3243
- /**
3244
- * getLightness
3245
- * @desc:转换明度
3246
- * @author huangbo
3247
- * @date 2022年5月7日
3248
- * @return {string,array} 元素类名或者id
3249
- **/
3250
- var getLightness = function getLightness($v, $i, $isLight) {
3251
- var $value = $isLight ? $v + $brightnessStep1 * $i : $v - $brightnessStep2 * $i;
3252
- $value = $value < 1 ? $value : 1;
3253
- return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "T"])($value, 2);
3254
- };
3255
-
3256
- /**
3257
- * getSaturation
3258
- * @desc:转换饱和度
3259
- * @author huangbo
3260
- * @date 2022年5月7日
3261
- **/
3262
- var getSaturation = function getSaturation($s, $i, $isLight) {
3263
- var $saturation = void 0;
3264
- if ($isLight) {
3265
- $saturation = $s - $saturationStep1 * $i;
3266
- } else if ($i === $darkColorCount) {
3267
- $saturation = $s + $saturationStep1;
3268
- } else {
3269
- $saturation = $s + $saturationStep2 * $i;
3270
- }
3271
- $saturation = $saturation < 1 ? $saturation : 1;
3272
-
3273
- if ($isLight && $i === $lightColorCount && $saturation > 0.1) {
3274
- $saturation = 0.1;
3275
- }
3276
- $saturation = $saturation > 0.06 ? $saturation : 0.06;
3277
- return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "T"])($saturation, 2);
3278
- };
3279
-
3280
- /**
3281
- * rgbToHsv
3282
- * @desc:rgb转化成hsv
3283
- * @author huangbo
3284
- * @date 2022年5月7日
3285
- * @param {string} [$color] - 颜色值
3286
- **/
3287
- var rgbToHsv = function rgbToHsv($color) {
3288
- var rgb = getRgb($color);
3289
- var $red = rgb[0];
3290
- var $green = rgb[1];
3291
- var $blue = rgb[2];
3292
- var $max = Math.max($red, $green, $blue);
3293
- var $min = Math.min($red, $green, $blue);
3294
- var $diff = $max - $min;
3295
- var $h = 0;
3296
- if ($max === $min) {
3297
- $h = 0;
3298
- } else if ($max === $red) {
3299
- $h = 60 * ($green - $blue) / $diff + ($green > $blue - 1 ? 0 : 360);
3300
- } else if ($max === $green) {
3301
- $h = 60 * ($blue - $red) / $diff + 120;
3302
- } else if ($max === $blue) {
3303
- $h = 60 * ($red - $green) / $diff + 240;
3304
- }
3305
- var $s = $max === 0 ? 0 : $diff / $max;
3306
- var $v = $max / 255;
3307
- return [$h, $s, $v];
3308
- };
3309
-
3310
- /**
3311
- * hsvTorgb
3312
- * @desc:hsv转化成rgb
3313
- * @author huangbo
3314
- * @date 2022年5月7日
3315
- * @param {string} [$color] - 颜色值
3316
- **/
3317
- var hsvTorgb = function hsvTorgb($h, $s, $v) {
3318
- var $th = Math.floor($h / 60);
3319
- var $t1 = $h / 60 - $th;
3320
- var $t2 = $v * (1 - $s);
3321
- var $t3 = $v * (1 - $t1 * $s);
3322
- var $t4 = $v * (1 - (1 - $t1) * $s);
3323
- var $r = [$v, $t3, $t2, $t2, $t4, $v][$th % 6];
3324
- var $g = [$t4, $v, $v, $t3, $t2, $t2][$th % 6];
3325
- var $b = [$t2, $t2, $t4, $v, $v, $t3][$th % 6];
3326
- // return `rgb(${Math.round($r * 255)}, ${Math.round($g * 255)}, ${Math.round($b * 255)})`;
3327
- var red = Math.round($r * 255);
3328
- var green = Math.round($g * 255);
3329
- var blue = Math.round($b * 255);
3330
- red = red.toString(16);
3331
- green = green.toString(16);
3332
- blue = blue.toString(16);
3333
- red = red.length === 1 ? '0' + red : red;
3334
- green = green.length === 1 ? '0' + green : green;
3335
- blue = blue.length === 1 ? '0' + blue : blue;
3336
- return '#' + red + green + blue;
3337
- };
3338
-
3339
- /**
3340
- * mixColor
3341
- * @desc:生成混合色
3342
- * @author huangbo
3343
- * @date 2022年5月7日
3344
- * @param {string} [$color1] - 颜色值
3345
- * @param {string} [$color2] - 颜色值
3346
- * @param {string} [$n] - 百分比 0~1
3347
- **/
3348
- var mixColor = function mixColor($color1, $color2, $n) {
3349
- var rgb1 = getRgb($color1);
3350
- var rgb2 = getRgb($color2);
3351
- var r = rgb1[0] * $n + rgb2[0] * (1 - $n);
3352
- var g = rgb1[1] * $n + rgb2[1] * (1 - $n);
3353
- var b = rgb1[2] * $n + rgb2[2] * (1 - $n);
3354
- return '#' + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
3355
- };
3356
-
3357
- /**
3358
- * getRgb
3359
- * @desc:获取颜色值的rgb值
3360
- * @author huangbo
3361
- * @date 2022年5月7日
3362
- * @param {string} [$color] - 颜色值
3363
- **/
3364
- var getRgb = function getRgb($color) {
3365
- var rgb = [];
3366
- // 16进制颜色值的正则
3367
- var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
3368
- // 把颜色值变成小写
3369
- $color = $color.toLowerCase();
3370
- if (reg.test($color)) {
3371
- // 如果只有三位的值,需变成六位,如:#fff => #ffffff
3372
- if ($color.length === 4) {
3373
- var colorNew = '#';
3374
- for (var i = 1; i < 4; i++) {
3375
- colorNew += $color.slice(i, i + 1).concat($color.slice(i, i + 1));
3376
- }
3377
- $color = colorNew;
3378
- }
3379
- // 处理六位的颜色值,转为RGB
3380
- for (var _i = 1; _i < 7; _i += 2) {
3381
- rgb.push(parseInt('0x' + $color.slice(_i, _i + 2), 16));
3382
- }
3383
- } else {
3384
- rgb = $color.replace(/(?:\(|\)|rgb|RGB)*/g, '').split(',');
3385
- }
3386
- return rgb;
3387
- };
3388
-
3389
- /***/ }),
3390
-
3391
- /***/ 129:
3392
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3393
-
3394
- "use strict";
3395
- __webpack_require__.r(__webpack_exports__);
3396
- /* harmony import */ var _src_input__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73);
3397
-
3398
-
3399
- /* istanbul ignore next */
3400
- _src_input__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].install = function (Vue) {
3401
- Vue.component(_src_input__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].name, _src_input__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"]);
3402
- };
3403
-
3404
- /* harmony default export */ __webpack_exports__["default"] = (_src_input__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"]);
3405
-
3406
- /***/ }),
3407
-
3408
- /***/ 13:
3409
- /***/ (function(module, exports) {
3410
-
3411
- module.exports = require("eoss/lib/loading");
3412
-
3413
- /***/ }),
3414
-
3415
- /***/ 15:
3416
- /***/ (function(module, exports) {
3417
-
3418
- module.exports = require("lodash/get");
3419
-
3420
- /***/ }),
3421
-
3422
- /***/ 16:
3423
- /***/ (function(module, exports) {
3424
-
3425
- module.exports = require("lodash/set");
3426
-
3427
- /***/ }),
3428
-
3429
- /***/ 17:
3430
- /***/ (function(module, exports) {
3431
-
3432
- module.exports = require("lodash/cloneDeep");
3433
-
3434
- /***/ }),
3435
-
3436
- /***/ 18:
3437
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3438
-
3439
- "use strict";
3440
- /* harmony default export */ __webpack_exports__["a"] = (function (target) {
3441
- for (var i = 1, j = arguments.length; i < j; i++) {
3442
- var source = arguments[i] || {};
3443
- for (var prop in source) {
3444
- if (source.hasOwnProperty(prop)) {
3445
- var value = source[prop];
3446
- if (value !== undefined) {
3447
- target[prop] = value;
3448
- }
3449
- }
3450
- }
3451
- }
3452
-
3453
- return target;
3454
- });;
3455
-
3456
- /***/ }),
3457
-
3458
- /***/ 2:
3459
- /***/ (function(module, exports) {
3460
-
3461
- module.exports = require("vue");
3462
-
3463
- /***/ }),
3464
-
3465
- /***/ 3:
3466
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3467
-
3468
- "use strict";
3469
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isString; });
3470
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isObject; });
3471
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isHtmlElement; });
3472
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isFunction; });
3473
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isUndefined; });
3474
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isDefined; });
3475
- /**
3476
- * 检查一个值是否为字符串类型
3477
- * @param {*} obj 要检查的值
3478
- * @returns {boolean} 如果值为字符串则返回true,否则返回false
3479
- */
3480
- function isString(obj) {
3481
- return Object.prototype.toString.call(obj) === '[object String]';
3482
- }
3483
-
3484
- /**
3485
- * 检查一个值是否为对象类型
3486
- * @param {*} obj 要检查的值
3487
- * @returns {boolean} 如果值为对象则返回true,否则返回false
3488
- */
3489
- function isObject(obj) {
3490
- return Object.prototype.toString.call(obj) === '[object Object]';
3491
- }
3492
-
3493
- /**
3494
- * 检查一个节点是否为HTML元素
3495
- * @param {Node} node 要检查的节点
3496
- * @returns {boolean} 如果节点为HTML元素则返回true,否则返回false
3497
- */
3498
- function isHtmlElement(node) {
3499
- return node && node.nodeType === Node.ELEMENT_NODE;
3500
- }
3501
-
3502
- /**
3503
- * 检查一个值是否为函数类型
3504
- * @param {*} functionToCheck 要检查的值
3505
- * @returns {boolean} 如果值为函数则返回true,否则返回false
3506
- */
3507
- function isFunction(functionToCheck) {
3508
- var getType = {};
3509
- return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
3510
- }
3511
-
3512
- /**
3513
- * 检查一个值是否为undefined
3514
- * @param {*} val 要检查的值
3515
- * @returns {boolean} 如果值为undefined则返回true,否则返回false
3516
- */
3517
- function isUndefined(val) {
3518
- return val === void 0;
3519
- }
3520
-
3521
- /**
3522
- * 检查一个值是否已定义(不是undefined或null)
3523
- * @param {*} val 要检查的值
3524
- * @returns {boolean} 如果值已定义则返回true,否则返回false
3525
- */
3526
- function isDefined(val) {
3527
- return val !== undefined && val !== null;
3528
- }
3529
-
3530
- /***/ }),
3531
-
3532
- /***/ 31:
3533
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3534
-
3535
- "use strict";
3536
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addResizeListener; });
3537
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return removeResizeListener; });
3538
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3539
-
3540
- // 注意:此文件完全重写以解决 ResizeObserver 循环错误
3541
-
3542
- var isServer = typeof window === 'undefined';
3543
-
3544
- // 使用 WeakMap 存储:
3545
- // 1. 每个元素的监听器列表
3546
- // 2. 每个元素的最后处理时间
3547
- // 3. 每个元素的动画帧ID(用于requestAnimationFrame)
3548
- var listenersMap = new WeakMap();
3549
- var lastProcessedMap = new WeakMap();
3550
- var animationFrameMap = new WeakMap();
3551
- var PROCESSING_DELAY = 100; // 增加处理延迟到100ms
3552
-
3553
- // 更安全的resize处理器,使用requestAnimationFrame和严格的频率控制
3554
- function safeResizeHandler(element) {
3555
- var now = Date.now();
3556
- var lastTime = lastProcessedMap.get(element) || 0;
3557
- var listeners = listenersMap.get(element) || [];
3558
-
3559
- // 如果距离上次处理不足 PROCESSING_DELAY 毫秒,则跳过
3560
- if (now - lastTime < PROCESSING_DELAY) {
3561
- return;
3562
- }
3563
-
3564
- // 取消任何待处理的动画帧
3565
- var existingFrameId = animationFrameMap.get(element);
3566
- if (existingFrameId) {
3567
- cancelAnimationFrame(existingFrameId);
3568
- }
3569
-
3570
- // 使用requestAnimationFrame来处理大小变化,这样可以防止循环
3571
- var frameId = requestAnimationFrame(function () {
3572
- // 再次检查时间,确保在动画帧执行时不会太频繁
3573
- var frameNow = Date.now();
3574
- if (frameNow - lastTime < PROCESSING_DELAY) {
3575
- animationFrameMap.delete(element);
3576
- return;
3577
- }
3578
-
3579
- lastProcessedMap.set(element, frameNow);
3580
-
3581
- if (listeners.length) {
3582
- // 创建监听器副本以防止在迭代过程中修改
3583
- var listenersCopy = [].concat(listeners);
3584
- listenersCopy.forEach(function (listener) {
3585
- try {
3586
- // 使用setTimeout来彻底分离调用栈
3587
- setTimeout(function () {
3588
- try {
3589
- listener();
3590
- } catch (e) {
3591
- console.error('Resize listener error:', e);
3592
- }
3593
- }, 0);
3594
- } catch (e) {
3595
- console.error('Resize handler error:', e);
3596
- }
3597
- });
3598
- }
3599
-
3600
- animationFrameMap.delete(element);
3601
- });
3602
-
3603
- animationFrameMap.set(element, frameId);
3604
- }
3605
-
3606
- // 模拟ResizeObserver的自定义实现,不使用resize-observer-polyfill
3607
-
3608
- var CustomResizeObserver = function () {
3609
- function CustomResizeObserver(callback) {
3610
- _classCallCheck(this, CustomResizeObserver);
3611
-
3612
- this.callback = callback;
3613
- this.elements = new Set();
3614
- this.throttleTimer = null;
3615
- }
3616
-
3617
- CustomResizeObserver.prototype.observe = function observe(element) {
3618
- var _this = this;
3619
-
3620
- if (!element || !element.nodeType) return;
3621
-
3622
- this.elements.add(element);
3623
-
3624
- // 使用ResizeObserver的降级实现,结合setTimeout
3625
- var checkSize = function checkSize() {
3626
- var rect = element.getBoundingClientRect();
3627
- var currentSize = { width: rect.width, height: rect.height };
3628
- var lastSize = element.__lastSize || currentSize;
3629
-
3630
- // 检查尺寸是否真的改变了
3631
- if (Math.abs(currentSize.width - lastSize.width) > 1 || Math.abs(currentSize.height - lastSize.height) > 1) {
3632
- element.__lastSize = currentSize;
3633
-
3634
- // 调用原始回调,但在更安全的上下文中
3635
- safeResizeHandler(element);
3636
- }
3637
-
3638
- // 继续下一次检查,但增加延迟
3639
- _this.throttleTimer = setTimeout(checkSize, 100);
3640
- };
3641
-
3642
- // 开始检查
3643
- checkSize();
3644
-
3645
- // 存储timer引用以便disconnect时清除
3646
- element.__resizeTimer = this.throttleTimer;
3647
- };
3648
-
3649
- CustomResizeObserver.prototype.disconnect = function disconnect() {
3650
- // 清除所有定时器
3651
- this.elements.forEach(function (element) {
3652
- if (element.__resizeTimer) {
3653
- clearTimeout(element.__resizeTimer);
3654
- delete element.__resizeTimer;
3655
- }
3656
- });
3657
-
3658
- if (this.throttleTimer) {
3659
- clearTimeout(this.throttleTimer);
3660
- this.throttleTimer = null;
3661
- }
3662
-
3663
- this.elements.clear();
3664
- };
3665
-
3666
- return CustomResizeObserver;
3667
- }();
3668
-
3669
- /* istanbul ignore next */
3670
-
3671
-
3672
- var addResizeListener = function addResizeListener(element, fn) {
3673
- if (isServer) return;
3674
-
3675
- // 初始化元素的监听器列表
3676
- if (!listenersMap.has(element)) {
3677
- listenersMap.set(element, []);
3678
-
3679
- // 使用我们的自定义ResizeObserver,而不是官方的polyfill
3680
- try {
3681
- var observer = new CustomResizeObserver(function () {
3682
- safeResizeHandler(element);
3683
- });
3684
- observer.observe(element);
3685
- element.__customResizeObserver = observer;
3686
- } catch (e) {
3687
- console.error('Failed to create CustomResizeObserver:', e);
3688
- }
3689
- }
3690
-
3691
- var listeners = listenersMap.get(element);
3692
- if (!listeners.includes(fn)) {
3693
- listeners.push(fn);
3694
- }
3695
- };
3696
-
3697
- /* istanbul ignore next */
3698
- var removeResizeListener = function removeResizeListener(element, fn) {
3699
- if (!element || !listenersMap.has(element)) return;
3700
-
3701
- var listeners = listenersMap.get(element);
3702
- var index = listeners.indexOf(fn);
3703
-
3704
- if (index !== -1) {
3705
- listeners.splice(index, 1);
3706
-
3707
- // 如果没有监听器了,清理资源
3708
- if (listeners.length === 0) {
3709
- // 清除自定义ResizeObserver
3710
- if (element.__customResizeObserver) {
3711
- element.__customResizeObserver.disconnect();
3712
- delete element.__customResizeObserver;
3713
- }
3714
-
3715
- // 清除存储的数据
3716
- listenersMap.delete(element);
3717
- lastProcessedMap.delete(element);
3718
-
3719
- // 清除任何待处理的动画帧
3720
- var frameId = animationFrameMap.get(element);
3721
- if (frameId) {
3722
- cancelAnimationFrame(frameId);
3723
- animationFrameMap.delete(element);
3724
- }
3725
- }
3726
- }
3727
- };
3728
-
3729
- /***/ }),
3730
-
3731
- /***/ 32:
3732
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3733
-
3734
- "use strict";
3735
- /* harmony import */ var eoss_src_utils_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
3736
-
3737
- /**
3738
- * Show migrating guide in browser console.
3739
- *
3740
- * Usage:
3741
- * import Migrating from 'eoss/src/mixins/migrating';
3742
- *
3743
- * mixins: [Migrating]
3744
- *
3745
- * add getMigratingConfig method for your component.
3746
- * getMigratingConfig() {
3747
- * return {
3748
- * props: {
3749
- * 'allow-no-selection': 'allow-no-selection is removed.',
3750
- * 'selection-mode': 'selection-mode is removed.'
3751
- * },
3752
- * events: {
3753
- * selectionchange: 'selectionchange is renamed to selection-change.'
3754
- * }
3755
- * };
3756
- * },
3757
- */
3758
- /* harmony default export */ __webpack_exports__["a"] = ({
3759
- mounted: function mounted() {
3760
- if (true) return;
3761
- if (!this.$vnode) return;
3762
-
3763
- var _getMigratingConfig = this.getMigratingConfig(),
3764
- _getMigratingConfig$p = _getMigratingConfig.props,
3765
- props = _getMigratingConfig$p === undefined ? {} : _getMigratingConfig$p,
3766
- _getMigratingConfig$e = _getMigratingConfig.events,
3767
- events = _getMigratingConfig$e === undefined ? {} : _getMigratingConfig$e;
3768
-
3769
- var _$vnode = this.$vnode,
3770
- data = _$vnode.data,
3771
- componentOptions = _$vnode.componentOptions;
3772
-
3773
- var definedProps = data.attrs || {};
3774
- var definedEvents = componentOptions.listeners || {};
3775
-
3776
- for (var propName in definedProps) {
3777
- propName = Object(eoss_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* kebabCase */ "I"])(propName); // compatible with camel case
3778
- if (props[propName]) {
3779
- console.warn('[Eoss Migrating][' + this.$options.name + '][Attribute]: ' + props[propName]);
3780
- }
3781
- }
3782
-
3783
- for (var eventName in definedEvents) {
3784
- eventName = Object(eoss_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* kebabCase */ "I"])(eventName); // compatible with camel case
3785
- if (events[eventName]) {
3786
- console.warn('[Eoss Migrating][' + this.$options.name + '][Event]: ' + events[eventName]);
3787
- }
3788
- }
3789
- },
3790
-
3791
- methods: {
3792
- getMigratingConfig: function getMigratingConfig() {
3793
- return {
3794
- props: {},
3795
- events: {}
3796
- };
3797
- }
3798
- }
3799
- });
3800
-
3801
- /***/ }),
3802
-
3803
- /***/ 40:
3804
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3805
-
3806
- "use strict";
3807
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isDef; });
3808
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isKorean; });
3809
- /**
3810
- * 检查一个值是否已定义(不是 undefined 或 null)
3811
- * @param {*} val - 要检查的值
3812
- * @returns {boolean} - 如果值已定义则返回 true,否则返回 false
3813
- */
3814
- function isDef(val) {
3815
- return val !== undefined && val !== null;
3816
- }
3817
-
3818
- /**
3819
- * 检查文本是否包含韩文字符
3820
- * @param {string} text - 要检查的文本
3821
- * @returns {boolean} - 如果文本包含韩文字符则返回 true,否则返回 false
3822
- * @example
3823
- * isKorean('안녕하세요') // true
3824
- * isKorean('Hello') // false
3825
- */
3826
- function isKorean(text) {
3827
- // 正则表达式匹配朝鲜文字(Hangul)和韩文字母(Hangul Jamo)
3828
- var reg = /([(\uAC00-\uD7AF)|(\u3130-\u318F)])+/gi;
3829
- return reg.test(text);
3830
- }
3831
-
3832
- /***/ }),
3833
-
3834
- /***/ 5:
3835
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3836
-
3837
- "use strict";
3838
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
3839
- /* globals __VUE_SSR_CONTEXT__ */
3840
-
3841
- // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
3842
- // This module is a runtime utility for cleaner component module output and will
3843
- // be included in the final webpack user bundle.
3844
-
3845
- function normalizeComponent(
3846
- scriptExports,
3847
- render,
3848
- staticRenderFns,
3849
- functionalTemplate,
3850
- injectStyles,
3851
- scopeId,
3852
- moduleIdentifier /* server only */,
3853
- shadowMode /* vue-cli only */
3854
- ) {
3855
- // Vue.extend constructor export interop
3856
- var options =
3857
- typeof scriptExports === 'function' ? scriptExports.options : scriptExports
3858
-
3859
- // render functions
3860
- if (render) {
3861
- options.render = render
3862
- options.staticRenderFns = staticRenderFns
3863
- options._compiled = true
3864
- }
3865
-
3866
- // functional template
3867
- if (functionalTemplate) {
3868
- options.functional = true
3869
- }
3870
-
3871
- // scopedId
3872
- if (scopeId) {
3873
- options._scopeId = 'data-v-' + scopeId
3874
- }
3875
-
3876
- var hook
3877
- if (moduleIdentifier) {
3878
- // server build
3879
- hook = function (context) {
3880
- // 2.3 injection
3881
- context =
3882
- context || // cached call
3883
- (this.$vnode && this.$vnode.ssrContext) || // stateful
3884
- (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
3885
- // 2.2 with runInNewContext: true
3886
- if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
3887
- context = __VUE_SSR_CONTEXT__
3888
- }
3889
- // inject component styles
3890
- if (injectStyles) {
3891
- injectStyles.call(this, context)
3892
- }
3893
- // register component module identifier for async chunk inferrence
3894
- if (context && context._registeredComponents) {
3895
- context._registeredComponents.add(moduleIdentifier)
3896
- }
3897
- }
3898
- // used by ssr in case component is cached and beforeCreate
3899
- // never gets called
3900
- options._ssrRegister = hook
3901
- } else if (injectStyles) {
3902
- hook = shadowMode
3903
- ? function () {
3904
- injectStyles.call(
3905
- this,
3906
- (options.functional ? this.parent : this).$root.$options.shadowRoot
3907
- )
3908
- }
3909
- : injectStyles
3910
- }
3911
-
3912
- if (hook) {
3913
- if (options.functional) {
3914
- // for template-only hot-reload because in that case the render fn doesn't
3915
- // go through the normalizer
3916
- options._injectStyles = hook
3917
- // register for functional component in vue file
3918
- var originalRender = options.render
3919
- options.render = function renderWithStyleInjection(h, context) {
3920
- hook.call(context)
3921
- return originalRender(h, context)
3922
- }
3923
- } else {
3924
- // inject component registration as beforeCreate hook
3925
- var existing = options.beforeCreate
3926
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
3927
- }
3928
- }
3929
-
3930
- return {
3931
- exports: scriptExports,
3932
- options: options
3933
- }
3934
- }
3935
-
3936
-
3937
- /***/ }),
3938
-
3939
- /***/ 6:
3940
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3941
-
3942
3013
  "use strict";
3943
3014
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return fecha; });
3944
3015
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return getSettings; });
@@ -4705,228 +3776,1255 @@ const calculateNetworkDays = function (start_date, end_date, holidays = []) {
4705
3776
  workdays++;
4706
3777
  }
4707
3778
  }
4708
-
4709
- return workdays;
3779
+
3780
+ return workdays;
3781
+ };
3782
+
3783
+ /**
3784
+ * 日期加减天数
3785
+ * @param {string} start_date - 起始日期字符串,格式为 "YYYY-MM-DD"
3786
+ * @param {number} days - 要加上或减去的天数,正数表示加,负数表示减
3787
+ * @returns {string} 结果日期,格式为 "YYYY-MM-DD"
3788
+ */
3789
+ const dateAddDays = function (start_date, days) {
3790
+ if (typeof start_date !== 'string' || !Number.isInteger(days)) {
3791
+ throw new Error(
3792
+ "Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD' and a valid integer for the number of days."
3793
+ );
3794
+ }
3795
+
3796
+ const startDateObj = new Date(start_date);
3797
+ if (isNaN(startDateObj.getTime())) {
3798
+ throw new Error(
3799
+ "Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'."
3800
+ );
3801
+ }
3802
+
3803
+ const resultDateObj = new Date(startDateObj);
3804
+ resultDateObj.setDate(resultDateObj.getDate() + days);
3805
+
3806
+ const resultYear = resultDateObj.getFullYear();
3807
+ const resultMonth = String(resultDateObj.getMonth() + 1).padStart(2, '0');
3808
+ const resultDay = String(resultDateObj.getDate()).padStart(2, '0');
3809
+
3810
+ return `${resultYear}-${resultMonth}-${resultDay}`;
3811
+ };
3812
+
3813
+ /**
3814
+ * 计算两个日期之间的差值
3815
+ * @date 2023年12月14日
3816
+ * @param {String} start_date - 起始日期字符串
3817
+ * @param {String} end_date - 结束日期字符串
3818
+ * @param {String} unit - 单位:year/month/day
3819
+ * @returns {Number} 差值
3820
+ */
3821
+ const dateDiff = function (start_date, end_date, unit = 'day') {
3822
+ // Assuming date strings are in "YYYY-MM-DD" format
3823
+ var startDate = new Date(start_date);
3824
+ var endDate = new Date(end_date);
3825
+
3826
+ // If the date is invalid, return 0
3827
+ if (isNaN(startDate.getTime()) || isNaN(endDate.getTime())) {
3828
+ return 0;
3829
+ }
3830
+
3831
+ if (unit === 'year') {
3832
+ return endDate.getFullYear() - startDate.getFullYear();
3833
+ } else if (unit === 'month') {
3834
+ return (
3835
+ (endDate.getFullYear() - startDate.getFullYear()) * 12 +
3836
+ (endDate.getMonth() - startDate.getMonth())
3837
+ );
3838
+ } else {
3839
+ // Default to day
3840
+ var timeDifference = endDate - startDate;
3841
+ // Calculate days (86400000 milliseconds per day)
3842
+ return Math.floor(timeDifference / 86400000);
3843
+ }
3844
+ };
3845
+
3846
+ /**
3847
+ * 获取月份中的日期
3848
+ * @param {string} date - 日期字符串,格式为 "YYYY-MM-DD"
3849
+ * @returns {number} 月份中的日期(1-31)
3850
+ */
3851
+ const dayOfMonth = function (date) {
3852
+ if (typeof date !== 'string') {
3853
+ throw new Error(
3854
+ "Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD'."
3855
+ );
3856
+ }
3857
+
3858
+ const dateObj = new Date(date);
3859
+ if (isNaN(dateObj.getTime())) {
3860
+ throw new Error(
3861
+ "Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'."
3862
+ );
3863
+ }
3864
+
3865
+ return dateObj.getDate();
3866
+ };
3867
+
3868
+ /**
3869
+ * 获取当前日期
3870
+ * @date 2022年5月7日
3871
+ * @param {string} format - 日期格式,默认为'YYYY-MM-DD'
3872
+ * @returns {string} 当前日期的格式化字符串
3873
+ */
3874
+ const getCurrentDate = function (format = 'YYYY-MM-DD') {
3875
+ return formatDate(new Date(), format);
3876
+ };
3877
+
3878
+ /**
3879
+ * 获取当前日期时间
3880
+ * @date 2022年5月7日
3881
+ * @param {string} format - 日期时间格式,默认为'YYYY-MM-DD HH:mm:ss'
3882
+ * @returns {string} 当前日期时间的格式化字符串
3883
+ */
3884
+ const getCurrentDateTime = function (format = 'YYYY-MM-DD HH:mm:ss') {
3885
+ return formatDate(new Date(), format);
3886
+ };
3887
+
3888
+ /**
3889
+ * 获取小时
3890
+ * @date 2022年5月7日
3891
+ * @param {Date|string} [date] - 日期对象或日期字符串
3892
+ * @returns {number} 小时数(0-23)
3893
+ */
3894
+ const getHour = function (date) {
3895
+ if (!date) {
3896
+ return new Date().getHours();
3897
+ }
3898
+ if (typeof date === 'string') {
3899
+ date = new Date(date);
3900
+ }
3901
+ return date.getHours();
4710
3902
  };
4711
3903
 
4712
3904
  /**
4713
- * 日期加减天数
4714
- * @param {string} start_date - 起始日期字符串,格式为 "YYYY-MM-DD"
4715
- * @param {number} days - 要加上或减去的天数,正数表示加,负数表示减
4716
- * @returns {string} 结果日期,格式为 "YYYY-MM-DD"
3905
+ * 获取分钟
3906
+ * @date 2022年5月7日
3907
+ * @param {Date|string} [date] - 日期对象或日期字符串
3908
+ * @returns {number} 分钟数(0-59)
4717
3909
  */
4718
- const dateAddDays = function (start_date, days) {
4719
- if (typeof start_date !== 'string' || !Number.isInteger(days)) {
4720
- throw new Error(
4721
- "Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD' and a valid integer for the number of days."
4722
- );
3910
+ const getMinute = function (date) {
3911
+ if (!date) {
3912
+ return new Date().getMinutes();
4723
3913
  }
4724
-
4725
- const startDateObj = new Date(start_date);
4726
- if (isNaN(startDateObj.getTime())) {
4727
- throw new Error(
4728
- "Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'."
4729
- );
3914
+ if (typeof date === 'string') {
3915
+ date = new Date(date);
4730
3916
  }
4731
-
4732
- const resultDateObj = new Date(startDateObj);
4733
- resultDateObj.setDate(resultDateObj.getDate() + days);
4734
-
4735
- const resultYear = resultDateObj.getFullYear();
4736
- const resultMonth = String(resultDateObj.getMonth() + 1).padStart(2, '0');
4737
- const resultDay = String(resultDateObj.getDate()).padStart(2, '0');
4738
-
4739
- return `${resultYear}-${resultMonth}-${resultDay}`;
3917
+ return date.getMinutes();
4740
3918
  };
4741
3919
 
4742
3920
  /**
4743
- * 计算两个日期之间的差值
4744
- * @date 2023年12月14日
4745
- * @param {String} start_date - 起始日期字符串
4746
- * @param {String} end_date - 结束日期字符串
4747
- * @param {String} unit - 单位:year/month/day
4748
- * @returns {Number} 差值
3921
+ * 获取月份
3922
+ * @date 2022年5月7日
3923
+ * @param {Date|string} [date] - 日期对象或日期字符串
3924
+ * @returns {number} 月份数(1-12)
4749
3925
  */
4750
- const dateDiff = function (start_date, end_date, unit = 'day') {
4751
- // Assuming date strings are in "YYYY-MM-DD" format
4752
- var startDate = new Date(start_date);
4753
- var endDate = new Date(end_date);
3926
+ const getMonth = function (date) {
3927
+ if (!date) {
3928
+ return new Date().getMonth() + 1;
3929
+ }
3930
+ if (typeof date === 'string') {
3931
+ date = new Date(date);
3932
+ }
3933
+ return date.getMonth() + 1;
3934
+ };
4754
3935
 
4755
- // If the date is invalid, return 0
4756
- if (isNaN(startDate.getTime()) || isNaN(endDate.getTime())) {
4757
- return 0;
3936
+ /**
3937
+ * 获取秒
3938
+ * @date 2022年5月7日
3939
+ * @param {Date|string} [date] - 日期对象或日期字符串
3940
+ * @returns {number} 秒数(0-59)
3941
+ */
3942
+ const getSecond = function (date) {
3943
+ if (!date) {
3944
+ return new Date().getSeconds();
3945
+ }
3946
+ if (typeof date === 'string') {
3947
+ date = new Date(date);
4758
3948
  }
3949
+ return date.getSeconds();
3950
+ };
4759
3951
 
4760
- if (unit === 'year') {
4761
- return endDate.getFullYear() - startDate.getFullYear();
4762
- } else if (unit === 'month') {
4763
- return (
4764
- (endDate.getFullYear() - startDate.getFullYear()) * 12 +
4765
- (endDate.getMonth() - startDate.getMonth())
4766
- );
4767
- } else {
4768
- // Default to day
4769
- var timeDifference = endDate - startDate;
4770
- // Calculate days (86400000 milliseconds per day)
4771
- return Math.floor(timeDifference / 86400000);
3952
+ /**
3953
+ * 获取星期几
3954
+ * @date 2022年5月7日
3955
+ * @param {Date|string} [date] - 日期对象或日期字符串
3956
+ * @returns {number} 星期几(0-6,0表示星期日)
3957
+ */
3958
+ const getWeekday = function (date) {
3959
+ if (!date) {
3960
+ return new Date().getDay();
3961
+ }
3962
+ if (typeof date === 'string') {
3963
+ date = new Date(date);
4772
3964
  }
3965
+ return date.getDay();
4773
3966
  };
4774
3967
 
3968
+
3969
+ /**
3970
+ * @desc 获取上午/下午/晚上
3971
+ * @author huangbo
3972
+ * @date 2022年5月7日
3973
+ * @param {String} [time] - 时间
3974
+ **/
3975
+ const timeCycle = function (time) {
3976
+ let hour = 0;
3977
+ if (!time) {
3978
+ hour = new Date().getHours();
3979
+ } else if (typeof time === 'string') {
3980
+ // 从时间字符串中提取小时
3981
+ const match = time.match(/^(\d{1,2})/);
3982
+ if (match) {
3983
+ hour = parseInt(match[1], 10);
3984
+ }
3985
+ } else if (typeof time === 'number') {
3986
+ hour = time;
3987
+ }
3988
+ // 判断时间段
3989
+ if (hour >= 5 && hour < 12) {
3990
+ return '上午';
3991
+ } else if (hour >= 12 && hour < 18) {
3992
+ return '下午';
3993
+ } else {
3994
+ return '晚上';
3995
+ }
3996
+ };
3997
+
3998
+ /***/ }),
3999
+
4000
+ /***/ 10:
4001
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4002
+
4003
+ "use strict";
4004
+ function _broadcast(componentName, eventName, params) {
4005
+ this.$children.forEach(function (child) {
4006
+ var name = child.$options.componentName;
4007
+
4008
+ if (name === componentName) {
4009
+ child.$emit.apply(child, [eventName].concat(params));
4010
+ } else {
4011
+ _broadcast.apply(child, [componentName, eventName].concat([params]));
4012
+ }
4013
+ });
4014
+ }
4015
+ /* harmony default export */ __webpack_exports__["a"] = ({
4016
+ methods: {
4017
+ dispatch: function dispatch(componentName, eventName, params) {
4018
+ var parent = this.$parent || this.$root;
4019
+ var name = parent.$options.componentName;
4020
+
4021
+ while (parent && (!name || name !== componentName)) {
4022
+ parent = parent.$parent;
4023
+
4024
+ if (parent) {
4025
+ name = parent.$options.componentName;
4026
+ }
4027
+ }
4028
+ if (parent) {
4029
+ parent.$emit.apply(parent, [eventName].concat(params));
4030
+ }
4031
+ },
4032
+ broadcast: function broadcast(componentName, eventName, params) {
4033
+ _broadcast.call(this, componentName, eventName, params);
4034
+ }
4035
+ }
4036
+ });
4037
+
4038
+ /***/ }),
4039
+
4040
+ /***/ 13:
4041
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4042
+
4043
+ "use strict";
4044
+ /* unused harmony export getHue */
4045
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getColor; });
4046
+ /* unused harmony export getLightness */
4047
+ /* unused harmony export getSaturation */
4048
+ /* unused harmony export rgbToHsv */
4049
+ /* unused harmony export hsvTorgb */
4050
+ /* unused harmony export mixColor */
4051
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getRgb; });
4052
+ /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
4053
+
4054
+ var $hueStep = 2;
4055
+ var $saturationStep1 = 0.16;
4056
+ var $saturationStep2 = 0.05;
4057
+ var $brightnessStep1 = 0.05;
4058
+ var $brightnessStep2 = 0.15;
4059
+ var $lightColorCount = 5;
4060
+ var $darkColorCount = 4;
4061
+ /**
4062
+ * getHue
4063
+ * @desc:转换色相
4064
+ * @author huangbo
4065
+ * @date 2022年5月7日
4066
+ **/
4067
+ var getHue = function getHue($h, $i, $isLight) {
4068
+ var $hue = void 0;
4069
+ if ($h >= 60 && $h <= 240) {
4070
+ $hue = $isLight ? $h - $hueStep * $i : $h + $hueStep * $i;
4071
+ } else {
4072
+ $hue = $isLight ? $h + $hueStep * $i : $h - $hueStep * $i;
4073
+ }
4074
+ $hue = ($hue + 360) % 360;
4075
+ return Math.round($hue);
4076
+ };
4077
+
4078
+ /**
4079
+ * getColor
4080
+ * @desc:根据颜色和对应的色板位置,计算出对应的色板颜色
4081
+ * @author huangbo
4082
+ * @date 2022年5月7日
4083
+ **/
4084
+ var getColor = function getColor($color, $n) {
4085
+ var $isLight = $n < 7;
4086
+ var $hsv = rgbToHsv($color);
4087
+ // 这里将i转换成以主色为中心,两侧的i值逐渐增大
4088
+ var $i = $isLight ? $lightColorCount + 1 - $n : $n - $lightColorCount - 1;
4089
+ var color = hsvTorgb(getHue($hsv[0], $i, $isLight), getSaturation($hsv[1], $i, $isLight), getLightness($hsv[2], $i, $isLight));
4090
+ return color;
4091
+ };
4092
+
4093
+ /**
4094
+ * getLightness
4095
+ * @desc:转换明度
4096
+ * @author huangbo
4097
+ * @date 2022年5月7日
4098
+ * @return {string,array} 元素类名或者id
4099
+ **/
4100
+ var getLightness = function getLightness($v, $i, $isLight) {
4101
+ var $value = $isLight ? $v + $brightnessStep1 * $i : $v - $brightnessStep2 * $i;
4102
+ $value = $value < 1 ? $value : 1;
4103
+ return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "U"])($value, 2);
4104
+ };
4105
+
4106
+ /**
4107
+ * getSaturation
4108
+ * @desc:转换饱和度
4109
+ * @author huangbo
4110
+ * @date 2022年5月7日
4111
+ **/
4112
+ var getSaturation = function getSaturation($s, $i, $isLight) {
4113
+ var $saturation = void 0;
4114
+ if ($isLight) {
4115
+ $saturation = $s - $saturationStep1 * $i;
4116
+ } else if ($i === $darkColorCount) {
4117
+ $saturation = $s + $saturationStep1;
4118
+ } else {
4119
+ $saturation = $s + $saturationStep2 * $i;
4120
+ }
4121
+ $saturation = $saturation < 1 ? $saturation : 1;
4122
+
4123
+ if ($isLight && $i === $lightColorCount && $saturation > 0.1) {
4124
+ $saturation = 0.1;
4125
+ }
4126
+ $saturation = $saturation > 0.06 ? $saturation : 0.06;
4127
+ return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "U"])($saturation, 2);
4128
+ };
4129
+
4130
+ /**
4131
+ * rgbToHsv
4132
+ * @desc:rgb转化成hsv
4133
+ * @author huangbo
4134
+ * @date 2022年5月7日
4135
+ * @param {string} [$color] - 颜色值
4136
+ **/
4137
+ var rgbToHsv = function rgbToHsv($color) {
4138
+ var rgb = getRgb($color);
4139
+ var $red = rgb[0];
4140
+ var $green = rgb[1];
4141
+ var $blue = rgb[2];
4142
+ var $max = Math.max($red, $green, $blue);
4143
+ var $min = Math.min($red, $green, $blue);
4144
+ var $diff = $max - $min;
4145
+ var $h = 0;
4146
+ if ($max === $min) {
4147
+ $h = 0;
4148
+ } else if ($max === $red) {
4149
+ $h = 60 * ($green - $blue) / $diff + ($green > $blue - 1 ? 0 : 360);
4150
+ } else if ($max === $green) {
4151
+ $h = 60 * ($blue - $red) / $diff + 120;
4152
+ } else if ($max === $blue) {
4153
+ $h = 60 * ($red - $green) / $diff + 240;
4154
+ }
4155
+ var $s = $max === 0 ? 0 : $diff / $max;
4156
+ var $v = $max / 255;
4157
+ return [$h, $s, $v];
4158
+ };
4159
+
4160
+ /**
4161
+ * hsvTorgb
4162
+ * @desc:hsv转化成rgb
4163
+ * @author huangbo
4164
+ * @date 2022年5月7日
4165
+ * @param {string} [$color] - 颜色值
4166
+ **/
4167
+ var hsvTorgb = function hsvTorgb($h, $s, $v) {
4168
+ var $th = Math.floor($h / 60);
4169
+ var $t1 = $h / 60 - $th;
4170
+ var $t2 = $v * (1 - $s);
4171
+ var $t3 = $v * (1 - $t1 * $s);
4172
+ var $t4 = $v * (1 - (1 - $t1) * $s);
4173
+ var $r = [$v, $t3, $t2, $t2, $t4, $v][$th % 6];
4174
+ var $g = [$t4, $v, $v, $t3, $t2, $t2][$th % 6];
4175
+ var $b = [$t2, $t2, $t4, $v, $v, $t3][$th % 6];
4176
+ // return `rgb(${Math.round($r * 255)}, ${Math.round($g * 255)}, ${Math.round($b * 255)})`;
4177
+ var red = Math.round($r * 255);
4178
+ var green = Math.round($g * 255);
4179
+ var blue = Math.round($b * 255);
4180
+ red = red.toString(16);
4181
+ green = green.toString(16);
4182
+ blue = blue.toString(16);
4183
+ red = red.length === 1 ? '0' + red : red;
4184
+ green = green.length === 1 ? '0' + green : green;
4185
+ blue = blue.length === 1 ? '0' + blue : blue;
4186
+ return '#' + red + green + blue;
4187
+ };
4188
+
4189
+ /**
4190
+ * mixColor
4191
+ * @desc:生成混合色
4192
+ * @author huangbo
4193
+ * @date 2022年5月7日
4194
+ * @param {string} [$color1] - 颜色值
4195
+ * @param {string} [$color2] - 颜色值
4196
+ * @param {string} [$n] - 百分比 0~1
4197
+ **/
4198
+ var mixColor = function mixColor($color1, $color2, $n) {
4199
+ var rgb1 = getRgb($color1);
4200
+ var rgb2 = getRgb($color2);
4201
+ var r = rgb1[0] * $n + rgb2[0] * (1 - $n);
4202
+ var g = rgb1[1] * $n + rgb2[1] * (1 - $n);
4203
+ var b = rgb1[2] * $n + rgb2[2] * (1 - $n);
4204
+ return '#' + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
4205
+ };
4206
+
4207
+ /**
4208
+ * getRgb
4209
+ * @desc:获取颜色值的rgb值
4210
+ * @author huangbo
4211
+ * @date 2022年5月7日
4212
+ * @param {string} [$color] - 颜色值
4213
+ **/
4214
+ var getRgb = function getRgb($color) {
4215
+ var rgb = [];
4216
+ // 16进制颜色值的正则
4217
+ var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
4218
+ // 把颜色值变成小写
4219
+ $color = $color.toLowerCase();
4220
+ if (reg.test($color)) {
4221
+ // 如果只有三位的值,需变成六位,如:#fff => #ffffff
4222
+ if ($color.length === 4) {
4223
+ var colorNew = '#';
4224
+ for (var i = 1; i < 4; i++) {
4225
+ colorNew += $color.slice(i, i + 1).concat($color.slice(i, i + 1));
4226
+ }
4227
+ $color = colorNew;
4228
+ }
4229
+ // 处理六位的颜色值,转为RGB
4230
+ for (var _i = 1; _i < 7; _i += 2) {
4231
+ rgb.push(parseInt('0x' + $color.slice(_i, _i + 2), 16));
4232
+ }
4233
+ } else {
4234
+ rgb = $color.replace(/(?:\(|\)|rgb|RGB)*/g, '').split(',');
4235
+ }
4236
+ return rgb;
4237
+ };
4238
+
4239
+ /***/ }),
4240
+
4241
+ /***/ 131:
4242
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4243
+
4244
+ "use strict";
4245
+ __webpack_require__.r(__webpack_exports__);
4246
+ /* harmony import */ var _src_input__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(66);
4247
+
4248
+
4249
+ /* istanbul ignore next */
4250
+ _src_input__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].install = function (Vue) {
4251
+ Vue.component(_src_input__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].name, _src_input__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"]);
4252
+ };
4253
+
4254
+ /* harmony default export */ __webpack_exports__["default"] = (_src_input__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"]);
4255
+
4256
+ /***/ }),
4257
+
4258
+ /***/ 16:
4259
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4260
+
4261
+ "use strict";
4262
+ /* harmony default export */ __webpack_exports__["a"] = (function (target) {
4263
+ for (var i = 1, j = arguments.length; i < j; i++) {
4264
+ var source = arguments[i] || {};
4265
+ for (var prop in source) {
4266
+ if (source.hasOwnProperty(prop)) {
4267
+ var value = source[prop];
4268
+ if (value !== undefined) {
4269
+ target[prop] = value;
4270
+ }
4271
+ }
4272
+ }
4273
+ }
4274
+
4275
+ return target;
4276
+ });;
4277
+
4278
+ /***/ }),
4279
+
4280
+ /***/ 19:
4281
+ /***/ (function(module, exports) {
4282
+
4283
+ module.exports = require("eoss/lib/loading");
4284
+
4285
+ /***/ }),
4286
+
4287
+ /***/ 2:
4288
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4289
+
4290
+ "use strict";
4291
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return setStorage; });
4292
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getStorage; });
4293
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return removeStorage; });
4294
+ /* unused harmony export setCookie */
4295
+ /* unused harmony export getCookie */
4296
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
4297
+
4298
+ /**
4299
+ * setStorage
4300
+ * @desc:设置本地储存数据
4301
+ * @author huangbo
4302
+ * @date 2022年5月7日
4303
+ * @param {String|Object} [key] - 数据的名称或包含type、key、value的对象
4304
+ * @param {String} [value] - 数据的值(当第一个参数为字符串时使用)
4305
+ **/
4306
+ var setStorage = function setStorage(key, value) {
4307
+ // 解析参数,支持两种调用方式:setStorage(key, value) 和 setStorage({type, key, value})
4308
+ var type = void 0,
4309
+ finalKey = void 0,
4310
+ finalValue = void 0;
4311
+
4312
+ if ((typeof key === 'undefined' ? 'undefined' : _typeof(key)) === 'object' && key !== null) {
4313
+ // 对象调用方式:setStorage({type, key, value})
4314
+ type = key.type;
4315
+ finalKey = key.key;
4316
+ finalValue = key.value;
4317
+ } else {
4318
+ // 字符串调用方式:setStorage(key, value)
4319
+ type = getStorage('storageType');
4320
+ finalKey = key;
4321
+ finalValue = value;
4322
+ }
4323
+
4324
+ // 使用默认存储类型如果未指定
4325
+ type = type || getStorage('storageType');
4326
+
4327
+ // 获取存储对象
4328
+ var storage = type === 'localStorage' ? localStorage : sessionStorage;
4329
+
4330
+ // 处理不同类型的key
4331
+ if (typeof finalKey === 'string') {
4332
+ // 单个字符串key
4333
+ var storedValue = (typeof finalValue === 'undefined' ? 'undefined' : _typeof(finalValue)) === 'object' ? JSON.stringify(finalValue) : finalValue;
4334
+ storage.setItem(finalKey, storedValue);
4335
+ if (finalKey === 'token') {
4336
+ setCookie('token', storedValue);
4337
+ }
4338
+ } else if (Array.isArray(finalKey)) {
4339
+ // 数组key,为多个key设置同一个value
4340
+ var _storedValue = (typeof finalValue === 'undefined' ? 'undefined' : _typeof(finalValue)) === 'object' ? JSON.stringify(finalValue) : finalValue;
4341
+ for (var i = 0; i < finalKey.length; i++) {
4342
+ storage.setItem(finalKey[i], _storedValue);
4343
+ if (finalKey[i] === 'token') {
4344
+ setCookie('token', _storedValue);
4345
+ }
4346
+ }
4347
+ } else if ((typeof finalKey === 'undefined' ? 'undefined' : _typeof(finalKey)) === 'object' && finalKey !== null) {
4348
+ // 对象key,对象的属性名称作为key,属性值作为value
4349
+ for (var k in finalKey) {
4350
+ if (Object.prototype.hasOwnProperty.call(finalKey, k)) {
4351
+ var _storedValue2 = _typeof(finalKey[k]) === 'object' ? JSON.stringify(finalKey[k]) : finalKey[k];
4352
+ storage.setItem(k, _storedValue2);
4353
+ if (k === 'token') {
4354
+ setCookie('token', _storedValue2);
4355
+ }
4356
+ }
4357
+ }
4358
+ }
4359
+ };
4360
+
4361
+ /**
4362
+ * getStorage
4363
+ * @desc:获取本地储存数据
4364
+ * @author huangbo
4365
+ * @date 2022年5月7日
4366
+ * @param {String} [key] - 获取的名称
4367
+ **/
4368
+ var getStorage = function getStorage(key) {
4369
+ if (key) {
4370
+ var res = sessionStorage.getItem(key) || localStorage.getItem(key);
4371
+ if (!res && key === 'token') {
4372
+ res = getCookie('token');
4373
+ }
4374
+ if (key === 'host' && !res) {
4375
+ res = '';
4376
+ }
4377
+ return res;
4378
+ }
4379
+ var defaults = {};
4380
+ var token = sessionStorage.getItem('token') || localStorage.getItem('token') || getCookie('token');
4381
+ var ssId = sessionStorage.getItem('ssId') || localStorage.getItem('ssId') || getCookie('ssId');
4382
+
4383
+ var deviceUnique = sessionStorage.getItem('deviceUnique') || localStorage.getItem('deviceUnique') || getCookie('deviceUnique');
4384
+ if (token) {
4385
+ defaults.Authorization = token;
4386
+ }
4387
+ if (ssId) {
4388
+ defaults.ssId = ssId;
4389
+ }
4390
+ if (deviceUnique) {
4391
+ defaults.deviceUnique = deviceUnique;
4392
+ }
4393
+ return defaults;
4394
+ };
4395
+
4396
+ /**
4397
+ * removeStorage
4398
+ * @desc:删除本地储存数据
4399
+ * @author huangbo
4400
+ * @date 2022年5月7日
4401
+ * @param {String, Array} [key] - 获取的名称
4402
+ **/
4403
+ var removeStorage = function removeStorage(key) {
4404
+ if (Array.isArray(key)) {
4405
+ for (var i = 0; i < key.length; i++) {
4406
+ sessionStorage.removeItem(key[i]);
4407
+ localStorage.removeItem(key[i]);
4408
+ if (key[i] === 'token') {
4409
+ removeCookie('token');
4410
+ }
4411
+ }
4412
+ } else if (key) {
4413
+ sessionStorage.removeItem(key);
4414
+ localStorage.removeItem(key);
4415
+ if (key === 'token') {
4416
+ removeCookie('token');
4417
+ }
4418
+ } else {
4419
+ sessionStorage.clear();
4420
+ localStorage.clear();
4421
+ removeCookie('token');
4422
+ }
4423
+ };
4424
+
4425
+ /**
4426
+ * setCookie
4427
+ * @desc 设置cookie
4428
+ * @author huangbo
4429
+ * @param {string} [name] cookie名称
4430
+ * @param {string} [value] cookie值
4431
+ * @param {boolean} [isSession] 是否是会话cookie
4432
+ **/
4433
+ var setCookie = function setCookie(name, value) {
4434
+ var isSession = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
4435
+ var time = arguments[3];
4436
+
4437
+ try {
4438
+ var cookieParts = [encodeURIComponent(name) + '=' + encodeURIComponent(value), 'path=/' // 仅保留path设置,确保全站访问
4439
+ ];
4440
+ // 会话/持久Cookie设置
4441
+ if (!isSession) {
4442
+ if (/MSIE|Trident/.test(navigator.userAgent)) {
4443
+ // IE使用expires
4444
+ var date = new Date();
4445
+ date.setTime(date.getTime() + (time || 7 * 24 * 60 * 60 * 1000));
4446
+ cookieParts.push('expires=' + date.toUTCString());
4447
+ } else {
4448
+ // 其他浏览器使用max-age
4449
+ cookieParts.push('max-age=' + (time || 7 * 24 * 60 * 60));
4450
+ }
4451
+ }
4452
+ // 内核兼容处理
4453
+ if (/MSIE|Trident/.test(navigator.userAgent)) {
4454
+ // IE特殊处理:添加P3P协议头
4455
+ cookieParts.push('P3P=CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
4456
+ } else {
4457
+ // 现代浏览器设置
4458
+ cookieParts.push('samesite=lax');
4459
+ if (window.location.protocol === 'https:') {
4460
+ cookieParts.push('secure');
4461
+ }
4462
+ }
4463
+
4464
+ // 设置Cookie
4465
+ document.cookie = cookieParts.join('; ');
4466
+ return true;
4467
+ } catch (e) {
4468
+ console.error('Cookie设置失败:', e);
4469
+ return false;
4470
+ }
4471
+ };
4472
+
4473
+ /**
4474
+ * getCookie
4475
+ * @desc 获取cookie中指定名称的值
4476
+ * @author huangbo
4477
+ * @param {string} [name] cookie名称
4478
+ **/
4479
+ var getCookie = function getCookie(name) {
4480
+ var cookies = document.cookie.split(';');
4481
+ for (var _iterator = cookies, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
4482
+ var _ref;
4483
+
4484
+ if (_isArray) {
4485
+ if (_i >= _iterator.length) break;
4486
+ _ref = _iterator[_i++];
4487
+ } else {
4488
+ _i = _iterator.next();
4489
+ if (_i.done) break;
4490
+ _ref = _i.value;
4491
+ }
4492
+
4493
+ var cookie = _ref;
4494
+
4495
+ var _cookie$trim$split = cookie.trim().split('='),
4496
+ cookieName = _cookie$trim$split[0],
4497
+ cookieValue = _cookie$trim$split[1];
4498
+
4499
+ if (decodeURIComponent(cookieName) === name) {
4500
+ return decodeURIComponent(cookieValue);
4501
+ }
4502
+ }
4503
+ return null;
4504
+ };
4505
+
4506
+ /**
4507
+ * removeCookie
4508
+ * @desc:删除cookie
4509
+ * @author huangbo
4510
+ * @date 2022年5月7日
4511
+ * @param {String, Array} [key] - 获取的名称
4512
+ **/
4513
+ var removeCookie = function removeCookie(key) {
4514
+ if (Array.isArray(key)) {
4515
+ for (var i = 0; i < key.length; i++) {
4516
+ document.cookie = encodeURIComponent(key[i]) + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
4517
+ }
4518
+ } else {
4519
+ document.cookie = encodeURIComponent(key) + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
4520
+ }
4521
+ };
4522
+
4523
+ /***/ }),
4524
+
4525
+ /***/ 20:
4526
+ /***/ (function(module, exports) {
4527
+
4528
+ module.exports = require("lodash/get");
4529
+
4530
+ /***/ }),
4531
+
4532
+ /***/ 21:
4533
+ /***/ (function(module, exports) {
4534
+
4535
+ module.exports = require("lodash/set");
4536
+
4537
+ /***/ }),
4538
+
4539
+ /***/ 22:
4540
+ /***/ (function(module, exports) {
4541
+
4542
+ module.exports = require("lodash/cloneDeep");
4543
+
4544
+ /***/ }),
4545
+
4546
+ /***/ 26:
4547
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4548
+
4549
+ "use strict";
4550
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addResizeListener; });
4551
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return removeResizeListener; });
4552
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4553
+
4554
+ // 注意:此文件完全重写以解决 ResizeObserver 循环错误
4555
+
4556
+ var isServer = typeof window === 'undefined';
4557
+
4558
+ // 使用 WeakMap 存储:
4559
+ // 1. 每个元素的监听器列表
4560
+ // 2. 每个元素的最后处理时间
4561
+ // 3. 每个元素的动画帧ID(用于requestAnimationFrame)
4562
+ var listenersMap = new WeakMap();
4563
+ var lastProcessedMap = new WeakMap();
4564
+ var animationFrameMap = new WeakMap();
4565
+ var PROCESSING_DELAY = 100; // 增加处理延迟到100ms
4566
+
4567
+ // 更安全的resize处理器,使用requestAnimationFrame和严格的频率控制
4568
+ function safeResizeHandler(element) {
4569
+ var now = Date.now();
4570
+ var lastTime = lastProcessedMap.get(element) || 0;
4571
+ var listeners = listenersMap.get(element) || [];
4572
+
4573
+ // 如果距离上次处理不足 PROCESSING_DELAY 毫秒,则跳过
4574
+ if (now - lastTime < PROCESSING_DELAY) {
4575
+ return;
4576
+ }
4577
+
4578
+ // 取消任何待处理的动画帧
4579
+ var existingFrameId = animationFrameMap.get(element);
4580
+ if (existingFrameId) {
4581
+ cancelAnimationFrame(existingFrameId);
4582
+ }
4583
+
4584
+ // 使用requestAnimationFrame来处理大小变化,这样可以防止循环
4585
+ var frameId = requestAnimationFrame(function () {
4586
+ // 再次检查时间,确保在动画帧执行时不会太频繁
4587
+ var frameNow = Date.now();
4588
+ if (frameNow - lastTime < PROCESSING_DELAY) {
4589
+ animationFrameMap.delete(element);
4590
+ return;
4591
+ }
4592
+
4593
+ lastProcessedMap.set(element, frameNow);
4594
+
4595
+ if (listeners.length) {
4596
+ // 创建监听器副本以防止在迭代过程中修改
4597
+ var listenersCopy = [].concat(listeners);
4598
+ listenersCopy.forEach(function (listener) {
4599
+ try {
4600
+ // 使用setTimeout来彻底分离调用栈
4601
+ setTimeout(function () {
4602
+ try {
4603
+ listener();
4604
+ } catch (e) {
4605
+ console.error('Resize listener error:', e);
4606
+ }
4607
+ }, 0);
4608
+ } catch (e) {
4609
+ console.error('Resize handler error:', e);
4610
+ }
4611
+ });
4612
+ }
4613
+
4614
+ animationFrameMap.delete(element);
4615
+ });
4616
+
4617
+ animationFrameMap.set(element, frameId);
4618
+ }
4619
+
4620
+ // 模拟ResizeObserver的自定义实现,不使用resize-observer-polyfill
4621
+
4622
+ var CustomResizeObserver = function () {
4623
+ function CustomResizeObserver(callback) {
4624
+ _classCallCheck(this, CustomResizeObserver);
4625
+
4626
+ this.callback = callback;
4627
+ this.elements = new Set();
4628
+ this.throttleTimer = null;
4629
+ }
4630
+
4631
+ CustomResizeObserver.prototype.observe = function observe(element) {
4632
+ var _this = this;
4633
+
4634
+ if (!element || !element.nodeType) return;
4635
+
4636
+ this.elements.add(element);
4637
+
4638
+ // 使用ResizeObserver的降级实现,结合setTimeout
4639
+ var checkSize = function checkSize() {
4640
+ var rect = element.getBoundingClientRect();
4641
+ var currentSize = { width: rect.width, height: rect.height };
4642
+ var lastSize = element.__lastSize || currentSize;
4643
+
4644
+ // 检查尺寸是否真的改变了
4645
+ if (Math.abs(currentSize.width - lastSize.width) > 1 || Math.abs(currentSize.height - lastSize.height) > 1) {
4646
+ element.__lastSize = currentSize;
4647
+
4648
+ // 调用原始回调,但在更安全的上下文中
4649
+ safeResizeHandler(element);
4650
+ }
4651
+
4652
+ // 继续下一次检查,但增加延迟
4653
+ _this.throttleTimer = setTimeout(checkSize, 100);
4654
+ };
4655
+
4656
+ // 开始检查
4657
+ checkSize();
4658
+
4659
+ // 存储timer引用以便disconnect时清除
4660
+ element.__resizeTimer = this.throttleTimer;
4661
+ };
4662
+
4663
+ CustomResizeObserver.prototype.disconnect = function disconnect() {
4664
+ // 清除所有定时器
4665
+ this.elements.forEach(function (element) {
4666
+ if (element.__resizeTimer) {
4667
+ clearTimeout(element.__resizeTimer);
4668
+ delete element.__resizeTimer;
4669
+ }
4670
+ });
4671
+
4672
+ if (this.throttleTimer) {
4673
+ clearTimeout(this.throttleTimer);
4674
+ this.throttleTimer = null;
4675
+ }
4676
+
4677
+ this.elements.clear();
4678
+ };
4679
+
4680
+ return CustomResizeObserver;
4681
+ }();
4682
+
4683
+ /* istanbul ignore next */
4684
+
4685
+
4686
+ var addResizeListener = function addResizeListener(element, fn) {
4687
+ if (isServer) return;
4688
+
4689
+ // 初始化元素的监听器列表
4690
+ if (!listenersMap.has(element)) {
4691
+ listenersMap.set(element, []);
4692
+
4693
+ // 使用我们的自定义ResizeObserver,而不是官方的polyfill
4694
+ try {
4695
+ var observer = new CustomResizeObserver(function () {
4696
+ safeResizeHandler(element);
4697
+ });
4698
+ observer.observe(element);
4699
+ element.__customResizeObserver = observer;
4700
+ } catch (e) {
4701
+ console.error('Failed to create CustomResizeObserver:', e);
4702
+ }
4703
+ }
4704
+
4705
+ var listeners = listenersMap.get(element);
4706
+ if (!listeners.includes(fn)) {
4707
+ listeners.push(fn);
4708
+ }
4709
+ };
4710
+
4711
+ /* istanbul ignore next */
4712
+ var removeResizeListener = function removeResizeListener(element, fn) {
4713
+ if (!element || !listenersMap.has(element)) return;
4714
+
4715
+ var listeners = listenersMap.get(element);
4716
+ var index = listeners.indexOf(fn);
4717
+
4718
+ if (index !== -1) {
4719
+ listeners.splice(index, 1);
4720
+
4721
+ // 如果没有监听器了,清理资源
4722
+ if (listeners.length === 0) {
4723
+ // 清除自定义ResizeObserver
4724
+ if (element.__customResizeObserver) {
4725
+ element.__customResizeObserver.disconnect();
4726
+ delete element.__customResizeObserver;
4727
+ }
4728
+
4729
+ // 清除存储的数据
4730
+ listenersMap.delete(element);
4731
+ lastProcessedMap.delete(element);
4732
+
4733
+ // 清除任何待处理的动画帧
4734
+ var frameId = animationFrameMap.get(element);
4735
+ if (frameId) {
4736
+ cancelAnimationFrame(frameId);
4737
+ animationFrameMap.delete(element);
4738
+ }
4739
+ }
4740
+ }
4741
+ };
4742
+
4743
+ /***/ }),
4744
+
4745
+ /***/ 27:
4746
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4747
+
4748
+ "use strict";
4749
+ /* harmony import */ var eoss_src_utils_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
4750
+
4775
4751
  /**
4776
- * 获取月份中的日期
4777
- * @param {string} date - 日期字符串,格式为 "YYYY-MM-DD"
4778
- * @returns {number} 月份中的日期(1-31)
4779
- */
4780
- const dayOfMonth = function (date) {
4781
- if (typeof date !== 'string') {
4782
- throw new Error(
4783
- "Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD'."
4784
- );
4785
- }
4786
-
4787
- const dateObj = new Date(date);
4788
- if (isNaN(dateObj.getTime())) {
4789
- throw new Error(
4790
- "Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'."
4791
- );
4792
- }
4793
-
4794
- return dateObj.getDate();
4795
- };
4796
-
4752
+ * Show migrating guide in browser console.
4753
+ *
4754
+ * Usage:
4755
+ * import Migrating from 'eoss/src/mixins/migrating';
4756
+ *
4757
+ * mixins: [Migrating]
4758
+ *
4759
+ * add getMigratingConfig method for your component.
4760
+ * getMigratingConfig() {
4761
+ * return {
4762
+ * props: {
4763
+ * 'allow-no-selection': 'allow-no-selection is removed.',
4764
+ * 'selection-mode': 'selection-mode is removed.'
4765
+ * },
4766
+ * events: {
4767
+ * selectionchange: 'selectionchange is renamed to selection-change.'
4768
+ * }
4769
+ * };
4770
+ * },
4771
+ */
4772
+ /* harmony default export */ __webpack_exports__["a"] = ({
4773
+ mounted: function mounted() {
4774
+ if (true) return;
4775
+ if (!this.$vnode) return;
4776
+
4777
+ var _getMigratingConfig = this.getMigratingConfig(),
4778
+ _getMigratingConfig$p = _getMigratingConfig.props,
4779
+ props = _getMigratingConfig$p === undefined ? {} : _getMigratingConfig$p,
4780
+ _getMigratingConfig$e = _getMigratingConfig.events,
4781
+ events = _getMigratingConfig$e === undefined ? {} : _getMigratingConfig$e;
4782
+
4783
+ var _$vnode = this.$vnode,
4784
+ data = _$vnode.data,
4785
+ componentOptions = _$vnode.componentOptions;
4786
+
4787
+ var definedProps = data.attrs || {};
4788
+ var definedEvents = componentOptions.listeners || {};
4789
+
4790
+ for (var propName in definedProps) {
4791
+ propName = Object(eoss_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* kebabCase */ "I"])(propName); // compatible with camel case
4792
+ if (props[propName]) {
4793
+ console.warn('[Eoss Migrating][' + this.$options.name + '][Attribute]: ' + props[propName]);
4794
+ }
4795
+ }
4796
+
4797
+ for (var eventName in definedEvents) {
4798
+ eventName = Object(eoss_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* kebabCase */ "I"])(eventName); // compatible with camel case
4799
+ if (events[eventName]) {
4800
+ console.warn('[Eoss Migrating][' + this.$options.name + '][Event]: ' + events[eventName]);
4801
+ }
4802
+ }
4803
+ },
4804
+
4805
+ methods: {
4806
+ getMigratingConfig: function getMigratingConfig() {
4807
+ return {
4808
+ props: {},
4809
+ events: {}
4810
+ };
4811
+ }
4812
+ }
4813
+ });
4814
+
4815
+ /***/ }),
4816
+
4817
+ /***/ 3:
4818
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4819
+
4820
+ "use strict";
4821
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
4822
+ /* globals __VUE_SSR_CONTEXT__ */
4823
+
4824
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
4825
+ // This module is a runtime utility for cleaner component module output and will
4826
+ // be included in the final webpack user bundle.
4827
+
4828
+ function normalizeComponent(
4829
+ scriptExports,
4830
+ render,
4831
+ staticRenderFns,
4832
+ functionalTemplate,
4833
+ injectStyles,
4834
+ scopeId,
4835
+ moduleIdentifier /* server only */,
4836
+ shadowMode /* vue-cli only */
4837
+ ) {
4838
+ // Vue.extend constructor export interop
4839
+ var options =
4840
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
4841
+
4842
+ // render functions
4843
+ if (render) {
4844
+ options.render = render
4845
+ options.staticRenderFns = staticRenderFns
4846
+ options._compiled = true
4847
+ }
4848
+
4849
+ // functional template
4850
+ if (functionalTemplate) {
4851
+ options.functional = true
4852
+ }
4853
+
4854
+ // scopedId
4855
+ if (scopeId) {
4856
+ options._scopeId = 'data-v-' + scopeId
4857
+ }
4858
+
4859
+ var hook
4860
+ if (moduleIdentifier) {
4861
+ // server build
4862
+ hook = function (context) {
4863
+ // 2.3 injection
4864
+ context =
4865
+ context || // cached call
4866
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
4867
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
4868
+ // 2.2 with runInNewContext: true
4869
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
4870
+ context = __VUE_SSR_CONTEXT__
4871
+ }
4872
+ // inject component styles
4873
+ if (injectStyles) {
4874
+ injectStyles.call(this, context)
4875
+ }
4876
+ // register component module identifier for async chunk inferrence
4877
+ if (context && context._registeredComponents) {
4878
+ context._registeredComponents.add(moduleIdentifier)
4879
+ }
4880
+ }
4881
+ // used by ssr in case component is cached and beforeCreate
4882
+ // never gets called
4883
+ options._ssrRegister = hook
4884
+ } else if (injectStyles) {
4885
+ hook = shadowMode
4886
+ ? function () {
4887
+ injectStyles.call(
4888
+ this,
4889
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
4890
+ )
4891
+ }
4892
+ : injectStyles
4893
+ }
4894
+
4895
+ if (hook) {
4896
+ if (options.functional) {
4897
+ // for template-only hot-reload because in that case the render fn doesn't
4898
+ // go through the normalizer
4899
+ options._injectStyles = hook
4900
+ // register for functional component in vue file
4901
+ var originalRender = options.render
4902
+ options.render = function renderWithStyleInjection(h, context) {
4903
+ hook.call(context)
4904
+ return originalRender(h, context)
4905
+ }
4906
+ } else {
4907
+ // inject component registration as beforeCreate hook
4908
+ var existing = options.beforeCreate
4909
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
4910
+ }
4911
+ }
4912
+
4913
+ return {
4914
+ exports: scriptExports,
4915
+ options: options
4916
+ }
4917
+ }
4918
+
4919
+
4920
+ /***/ }),
4921
+
4922
+ /***/ 34:
4923
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4924
+
4925
+ "use strict";
4926
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isDef; });
4927
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isKorean; });
4797
4928
  /**
4798
- * 获取当前日期
4799
- * @date 2022年5月7日
4800
- * @param {string} format - 日期格式,默认为'YYYY-MM-DD'
4801
- * @returns {string} 当前日期的格式化字符串
4802
- */
4803
- const getCurrentDate = function (format = 'YYYY-MM-DD') {
4804
- return formatDate(new Date(), format);
4805
- };
4806
-
4929
+ * 检查一个值是否已定义(不是 undefined 或 null)
4930
+ * @param {*} val - 要检查的值
4931
+ * @returns {boolean} - 如果值已定义则返回 true,否则返回 false
4932
+ */
4933
+ function isDef(val) {
4934
+ return val !== undefined && val !== null;
4935
+ }
4936
+
4807
4937
  /**
4808
- * 获取当前日期时间
4809
- * @date 2022年5月7日
4810
- * @param {string} format - 日期时间格式,默认为'YYYY-MM-DD HH:mm:ss'
4811
- * @returns {string} 当前日期时间的格式化字符串
4812
- */
4813
- const getCurrentDateTime = function (format = 'YYYY-MM-DD HH:mm:ss') {
4814
- return formatDate(new Date(), format);
4815
- };
4816
-
4938
+ * 检查文本是否包含韩文字符
4939
+ * @param {string} text - 要检查的文本
4940
+ * @returns {boolean} - 如果文本包含韩文字符则返回 true,否则返回 false
4941
+ * @example
4942
+ * isKorean('안녕하세요') // true
4943
+ * isKorean('Hello') // false
4944
+ */
4945
+ function isKorean(text) {
4946
+ // 正则表达式匹配朝鲜文字(Hangul)和韩文字母(Hangul Jamo)
4947
+ var reg = /([(\uAC00-\uD7AF)|(\u3130-\u318F)])+/gi;
4948
+ return reg.test(text);
4949
+ }
4950
+
4951
+ /***/ }),
4952
+
4953
+ /***/ 4:
4954
+ /***/ (function(module, exports) {
4955
+
4956
+ module.exports = require("vue");
4957
+
4958
+ /***/ }),
4959
+
4960
+ /***/ 6:
4961
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4962
+
4963
+ "use strict";
4964
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isString; });
4965
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isObject; });
4966
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isHtmlElement; });
4967
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isFunction; });
4968
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isUndefined; });
4969
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isDefined; });
4817
4970
  /**
4818
- * 获取小时
4819
- * @date 2022年5月7日
4820
- * @param {Date|string} [date] - 日期对象或日期字符串
4821
- * @returns {number} 小时数(0-23)
4822
- */
4823
- const getHour = function (date) {
4824
- if (!date) {
4825
- return new Date().getHours();
4826
- }
4827
- if (typeof date === 'string') {
4828
- date = new Date(date);
4829
- }
4830
- return date.getHours();
4831
- };
4832
-
4971
+ * 检查一个值是否为字符串类型
4972
+ * @param {*} obj 要检查的值
4973
+ * @returns {boolean} 如果值为字符串则返回true,否则返回false
4974
+ */
4975
+ function isString(obj) {
4976
+ return Object.prototype.toString.call(obj) === '[object String]';
4977
+ }
4978
+
4833
4979
  /**
4834
- * 获取分钟
4835
- * @date 2022年5月7日
4836
- * @param {Date|string} [date] - 日期对象或日期字符串
4837
- * @returns {number} 分钟数(0-59)
4838
- */
4839
- const getMinute = function (date) {
4840
- if (!date) {
4841
- return new Date().getMinutes();
4842
- }
4843
- if (typeof date === 'string') {
4844
- date = new Date(date);
4845
- }
4846
- return date.getMinutes();
4847
- };
4848
-
4980
+ * 检查一个值是否为对象类型
4981
+ * @param {*} obj 要检查的值
4982
+ * @returns {boolean} 如果值为对象则返回true,否则返回false
4983
+ */
4984
+ function isObject(obj) {
4985
+ return Object.prototype.toString.call(obj) === '[object Object]';
4986
+ }
4987
+
4849
4988
  /**
4850
- * 获取月份
4851
- * @date 2022年5月7日
4852
- * @param {Date|string} [date] - 日期对象或日期字符串
4853
- * @returns {number} 月份数(1-12)
4854
- */
4855
- const getMonth = function (date) {
4856
- if (!date) {
4857
- return new Date().getMonth() + 1;
4858
- }
4859
- if (typeof date === 'string') {
4860
- date = new Date(date);
4861
- }
4862
- return date.getMonth() + 1;
4863
- };
4864
-
4989
+ * 检查一个节点是否为HTML元素
4990
+ * @param {Node} node 要检查的节点
4991
+ * @returns {boolean} 如果节点为HTML元素则返回true,否则返回false
4992
+ */
4993
+ function isHtmlElement(node) {
4994
+ return node && node.nodeType === Node.ELEMENT_NODE;
4995
+ }
4996
+
4865
4997
  /**
4866
- * 获取秒
4867
- * @date 2022年5月7日
4868
- * @param {Date|string} [date] - 日期对象或日期字符串
4869
- * @returns {number} 秒数(0-59)
4870
- */
4871
- const getSecond = function (date) {
4872
- if (!date) {
4873
- return new Date().getSeconds();
4874
- }
4875
- if (typeof date === 'string') {
4876
- date = new Date(date);
4877
- }
4878
- return date.getSeconds();
4879
- };
4880
-
4998
+ * 检查一个值是否为函数类型
4999
+ * @param {*} functionToCheck 要检查的值
5000
+ * @returns {boolean} 如果值为函数则返回true,否则返回false
5001
+ */
5002
+ function isFunction(functionToCheck) {
5003
+ var getType = {};
5004
+ return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
5005
+ }
5006
+
4881
5007
  /**
4882
- * 获取星期几
4883
- * @date 2022年5月7日
4884
- * @param {Date|string} [date] - 日期对象或日期字符串
4885
- * @returns {number} 星期几(0-6,0表示星期日)
4886
- */
4887
- const getWeekday = function (date) {
4888
- if (!date) {
4889
- return new Date().getDay();
4890
- }
4891
- if (typeof date === 'string') {
4892
- date = new Date(date);
4893
- }
4894
- return date.getDay();
4895
- };
4896
-
4897
-
5008
+ * 检查一个值是否为undefined
5009
+ * @param {*} val 要检查的值
5010
+ * @returns {boolean} 如果值为undefined则返回true,否则返回false
5011
+ */
5012
+ function isUndefined(val) {
5013
+ return val === void 0;
5014
+ }
5015
+
4898
5016
  /**
4899
- * @desc 获取上午/下午/晚上
4900
- * @author huangbo
4901
- * @date 2022年5月7日
4902
- * @param {String} [time] - 时间
4903
- **/
4904
- const timeCycle = function (time) {
4905
- let hour = 0;
4906
- if (!time) {
4907
- hour = new Date().getHours();
4908
- } else if (typeof time === 'string') {
4909
- // 从时间字符串中提取小时
4910
- const match = time.match(/^(\d{1,2})/);
4911
- if (match) {
4912
- hour = parseInt(match[1], 10);
4913
- }
4914
- } else if (typeof time === 'number') {
4915
- hour = time;
4916
- }
4917
- // 判断时间段
4918
- if (hour >= 5 && hour < 12) {
4919
- return '上午';
4920
- } else if (hour >= 12 && hour < 18) {
4921
- return '下午';
4922
- } else {
4923
- return '晚上';
4924
- }
4925
- };
5017
+ * 检查一个值是否已定义(不是undefined或null)
5018
+ * @param {*} val 要检查的值
5019
+ * @returns {boolean} 如果值已定义则返回true,否则返回false
5020
+ */
5021
+ function isDefined(val) {
5022
+ return val !== undefined && val !== null;
5023
+ }
4926
5024
 
4927
5025
  /***/ }),
4928
5026
 
4929
- /***/ 73:
5027
+ /***/ 66:
4930
5028
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
4931
5029
 
4932
5030
  "use strict";
@@ -5240,7 +5338,7 @@ render._withStripped = true
5240
5338
  var emitter = __webpack_require__(10);
5241
5339
 
5242
5340
  // EXTERNAL MODULE: ./src/mixins/migrating.js
5243
- var migrating = __webpack_require__(32);
5341
+ var migrating = __webpack_require__(27);
5244
5342
 
5245
5343
  // CONCATENATED MODULE: ./packages/input/src/calcTextareaHeight.js
5246
5344
  var hiddenTextarea = void 0;
@@ -5316,13 +5414,13 @@ function calcTextareaHeight(targetElement) {
5316
5414
  return result;
5317
5415
  };
5318
5416
  // EXTERNAL MODULE: ./src/utils/merge.js
5319
- var merge = __webpack_require__(18);
5417
+ var merge = __webpack_require__(16);
5320
5418
 
5321
5419
  // EXTERNAL MODULE: ./src/utils/shared.js
5322
- var shared = __webpack_require__(40);
5420
+ var shared = __webpack_require__(34);
5323
5421
 
5324
5422
  // EXTERNAL MODULE: ./src/utils/resize-event.js
5325
- var resize_event = __webpack_require__(31);
5423
+ var resize_event = __webpack_require__(26);
5326
5424
 
5327
5425
  // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/input/src/input.vue?vue&type=script&lang=js&
5328
5426
  //
@@ -6089,7 +6187,7 @@ var resize_event = __webpack_require__(31);
6089
6187
  // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=script&lang=js&
6090
6188
  /* harmony default export */ var src_inputvue_type_script_lang_js_ = (inputvue_type_script_lang_js_);
6091
6189
  // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
6092
- var componentNormalizer = __webpack_require__(5);
6190
+ var componentNormalizer = __webpack_require__(3);
6093
6191
 
6094
6192
  // CONCATENATED MODULE: ./packages/input/src/input.vue
6095
6193