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/message.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 = 171);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 175);
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,1949 +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
- /***/ 12:
3151
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3152
-
3153
- "use strict";
3154
- /* unused harmony export getHue */
3155
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getColor; });
3156
- /* unused harmony export getLightness */
3157
- /* unused harmony export getSaturation */
3158
- /* unused harmony export rgbToHsv */
3159
- /* unused harmony export hsvTorgb */
3160
- /* unused harmony export mixColor */
3161
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getRgb; });
3162
- /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
3163
-
3164
- var $hueStep = 2;
3165
- var $saturationStep1 = 0.16;
3166
- var $saturationStep2 = 0.05;
3167
- var $brightnessStep1 = 0.05;
3168
- var $brightnessStep2 = 0.15;
3169
- var $lightColorCount = 5;
3170
- var $darkColorCount = 4;
3171
- /**
3172
- * getHue
3173
- * @desc:转换色相
3174
- * @author huangbo
3175
- * @date 2022年5月7日
3176
- **/
3177
- var getHue = function getHue($h, $i, $isLight) {
3178
- var $hue = void 0;
3179
- if ($h >= 60 && $h <= 240) {
3180
- $hue = $isLight ? $h - $hueStep * $i : $h + $hueStep * $i;
3181
- } else {
3182
- $hue = $isLight ? $h + $hueStep * $i : $h - $hueStep * $i;
3183
- }
3184
- $hue = ($hue + 360) % 360;
3185
- return Math.round($hue);
3186
- };
3187
-
3188
- /**
3189
- * getColor
3190
- * @desc:根据颜色和对应的色板位置,计算出对应的色板颜色
3191
- * @author huangbo
3192
- * @date 2022年5月7日
3193
- **/
3194
- var getColor = function getColor($color, $n) {
3195
- var $isLight = $n < 7;
3196
- var $hsv = rgbToHsv($color);
3197
- // 这里将i转换成以主色为中心,两侧的i值逐渐增大
3198
- var $i = $isLight ? $lightColorCount + 1 - $n : $n - $lightColorCount - 1;
3199
- var color = hsvTorgb(getHue($hsv[0], $i, $isLight), getSaturation($hsv[1], $i, $isLight), getLightness($hsv[2], $i, $isLight));
3200
- return color;
3201
- };
3202
-
3203
- /**
3204
- * getLightness
3205
- * @desc:转换明度
3206
- * @author huangbo
3207
- * @date 2022年5月7日
3208
- * @return {string,array} 元素类名或者id
3209
- **/
3210
- var getLightness = function getLightness($v, $i, $isLight) {
3211
- var $value = $isLight ? $v + $brightnessStep1 * $i : $v - $brightnessStep2 * $i;
3212
- $value = $value < 1 ? $value : 1;
3213
- return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "T"])($value, 2);
3214
- };
3215
-
3216
- /**
3217
- * getSaturation
3218
- * @desc:转换饱和度
3219
- * @author huangbo
3220
- * @date 2022年5月7日
3221
- **/
3222
- var getSaturation = function getSaturation($s, $i, $isLight) {
3223
- var $saturation = void 0;
3224
- if ($isLight) {
3225
- $saturation = $s - $saturationStep1 * $i;
3226
- } else if ($i === $darkColorCount) {
3227
- $saturation = $s + $saturationStep1;
3228
- } else {
3229
- $saturation = $s + $saturationStep2 * $i;
3230
- }
3231
- $saturation = $saturation < 1 ? $saturation : 1;
3232
-
3233
- if ($isLight && $i === $lightColorCount && $saturation > 0.1) {
3234
- $saturation = 0.1;
3235
- }
3236
- $saturation = $saturation > 0.06 ? $saturation : 0.06;
3237
- return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "T"])($saturation, 2);
3238
- };
3239
-
3240
- /**
3241
- * rgbToHsv
3242
- * @desc:rgb转化成hsv
3243
- * @author huangbo
3244
- * @date 2022年5月7日
3245
- * @param {string} [$color] - 颜色值
3246
- **/
3247
- var rgbToHsv = function rgbToHsv($color) {
3248
- var rgb = getRgb($color);
3249
- var $red = rgb[0];
3250
- var $green = rgb[1];
3251
- var $blue = rgb[2];
3252
- var $max = Math.max($red, $green, $blue);
3253
- var $min = Math.min($red, $green, $blue);
3254
- var $diff = $max - $min;
3255
- var $h = 0;
3256
- if ($max === $min) {
3257
- $h = 0;
3258
- } else if ($max === $red) {
3259
- $h = 60 * ($green - $blue) / $diff + ($green > $blue - 1 ? 0 : 360);
3260
- } else if ($max === $green) {
3261
- $h = 60 * ($blue - $red) / $diff + 120;
3262
- } else if ($max === $blue) {
3263
- $h = 60 * ($red - $green) / $diff + 240;
3264
- }
3265
- var $s = $max === 0 ? 0 : $diff / $max;
3266
- var $v = $max / 255;
3267
- return [$h, $s, $v];
3268
- };
3269
-
3270
- /**
3271
- * hsvTorgb
3272
- * @desc:hsv转化成rgb
3273
- * @author huangbo
3274
- * @date 2022年5月7日
3275
- * @param {string} [$color] - 颜色值
3276
- **/
3277
- var hsvTorgb = function hsvTorgb($h, $s, $v) {
3278
- var $th = Math.floor($h / 60);
3279
- var $t1 = $h / 60 - $th;
3280
- var $t2 = $v * (1 - $s);
3281
- var $t3 = $v * (1 - $t1 * $s);
3282
- var $t4 = $v * (1 - (1 - $t1) * $s);
3283
- var $r = [$v, $t3, $t2, $t2, $t4, $v][$th % 6];
3284
- var $g = [$t4, $v, $v, $t3, $t2, $t2][$th % 6];
3285
- var $b = [$t2, $t2, $t4, $v, $v, $t3][$th % 6];
3286
- // return `rgb(${Math.round($r * 255)}, ${Math.round($g * 255)}, ${Math.round($b * 255)})`;
3287
- var red = Math.round($r * 255);
3288
- var green = Math.round($g * 255);
3289
- var blue = Math.round($b * 255);
3290
- red = red.toString(16);
3291
- green = green.toString(16);
3292
- blue = blue.toString(16);
3293
- red = red.length === 1 ? '0' + red : red;
3294
- green = green.length === 1 ? '0' + green : green;
3295
- blue = blue.length === 1 ? '0' + blue : blue;
3296
- return '#' + red + green + blue;
3297
- };
3298
-
3299
- /**
3300
- * mixColor
3301
- * @desc:生成混合色
3302
- * @author huangbo
3303
- * @date 2022年5月7日
3304
- * @param {string} [$color1] - 颜色值
3305
- * @param {string} [$color2] - 颜色值
3306
- * @param {string} [$n] - 百分比 0~1
3307
- **/
3308
- var mixColor = function mixColor($color1, $color2, $n) {
3309
- var rgb1 = getRgb($color1);
3310
- var rgb2 = getRgb($color2);
3311
- var r = rgb1[0] * $n + rgb2[0] * (1 - $n);
3312
- var g = rgb1[1] * $n + rgb2[1] * (1 - $n);
3313
- var b = rgb1[2] * $n + rgb2[2] * (1 - $n);
3314
- return '#' + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
3315
- };
3316
-
3317
- /**
3318
- * getRgb
3319
- * @desc:获取颜色值的rgb值
3320
- * @author huangbo
3321
- * @date 2022年5月7日
3322
- * @param {string} [$color] - 颜色值
3323
- **/
3324
- var getRgb = function getRgb($color) {
3325
- var rgb = [];
3326
- // 16进制颜色值的正则
3327
- var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
3328
- // 把颜色值变成小写
3329
- $color = $color.toLowerCase();
3330
- if (reg.test($color)) {
3331
- // 如果只有三位的值,需变成六位,如:#fff => #ffffff
3332
- if ($color.length === 4) {
3333
- var colorNew = '#';
3334
- for (var i = 1; i < 4; i++) {
3335
- colorNew += $color.slice(i, i + 1).concat($color.slice(i, i + 1));
3336
- }
3337
- $color = colorNew;
3338
- }
3339
- // 处理六位的颜色值,转为RGB
3340
- for (var _i = 1; _i < 7; _i += 2) {
3341
- rgb.push(parseInt('0x' + $color.slice(_i, _i + 2), 16));
3342
- }
3343
- } else {
3344
- rgb = $color.replace(/(?:\(|\)|rgb|RGB)*/g, '').split(',');
3345
- }
3346
- return rgb;
3347
- };
3348
-
3349
- /***/ }),
3350
-
3351
- /***/ 13:
3352
- /***/ (function(module, exports) {
3353
-
3354
- module.exports = require("eoss/lib/loading");
3355
-
3356
- /***/ }),
3357
-
3358
- /***/ 15:
3359
- /***/ (function(module, exports) {
3360
-
3361
- module.exports = require("lodash/get");
3362
-
3363
- /***/ }),
3364
-
3365
- /***/ 16:
3366
- /***/ (function(module, exports) {
3367
-
3368
- module.exports = require("lodash/set");
3369
-
3370
- /***/ }),
3371
-
3372
- /***/ 17:
3373
- /***/ (function(module, exports) {
3374
-
3375
- module.exports = require("lodash/cloneDeep");
3376
-
3377
- /***/ }),
3378
-
3379
- /***/ 171:
3380
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3381
-
3382
- "use strict";
3383
- // ESM COMPAT FLAG
3384
- __webpack_require__.r(__webpack_exports__);
3385
-
3386
- // EXTERNAL MODULE: external "vue"
3387
- var external_vue_ = __webpack_require__(2);
3388
- var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
3389
-
3390
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/message/src/main.vue?vue&type=template&id=7cefbaa1&
3391
- var render = function () {
3392
- var _vm = this
3393
- var _h = _vm.$createElement
3394
- var _c = _vm._self._c || _h
3395
- return _c(
3396
- "transition",
3397
- {
3398
- attrs: { name: "es-message-fade" },
3399
- on: { "after-leave": _vm.handleAfterLeave },
3400
- },
3401
- [
3402
- _c(
3403
- "div",
3404
- {
3405
- directives: [
3406
- {
3407
- name: "show",
3408
- rawName: "v-show",
3409
- value: _vm.visible,
3410
- expression: "visible",
3411
- },
3412
- ],
3413
- class: [
3414
- "es-message",
3415
- _vm.type && !_vm.iconClass ? "es-message--" + _vm.type : "",
3416
- _vm.center ? "is-center" : "",
3417
- _vm.showClose ? "is-closable" : "",
3418
- _vm.customClass,
3419
- ],
3420
- style: _vm.positionStyle,
3421
- attrs: { role: "alert" },
3422
- on: { mouseenter: _vm.clearTimer, mouseleave: _vm.startTimer },
3423
- },
3424
- [
3425
- _vm.iconClass
3426
- ? _c("i", { class: _vm.iconClass })
3427
- : _c("i", { class: _vm.typeClass }),
3428
- _vm._t("default", function () {
3429
- return [
3430
- !_vm.dangerouslyUseHTMLString
3431
- ? _c("p", { staticClass: "es-message__content" }, [
3432
- _vm._v("\n " + _vm._s(_vm.message) + "\n "),
3433
- ])
3434
- : _c("p", {
3435
- staticClass: "es-message__content",
3436
- domProps: { innerHTML: _vm._s(_vm.message) },
3437
- }),
3438
- ]
3439
- }),
3440
- _vm.showClose
3441
- ? _c("i", {
3442
- staticClass: "es-message__closeBtn es-icon-guanbi",
3443
- on: { click: _vm.close },
3444
- })
3445
- : _vm._e(),
3446
- ],
3447
- 2
3448
- ),
3449
- ]
3450
- )
3451
- }
3452
- var staticRenderFns = []
3453
- render._withStripped = true
3454
-
3455
-
3456
- // CONCATENATED MODULE: ./packages/message/src/main.vue?vue&type=template&id=7cefbaa1&
3457
-
3458
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/message/src/main.vue?vue&type=script&lang=js&
3459
- //
3460
- //
3461
- //
3462
- //
3463
- //
3464
- //
3465
- //
3466
- //
3467
- //
3468
- //
3469
- //
3470
- //
3471
- //
3472
- //
3473
- //
3474
- //
3475
- //
3476
- //
3477
- //
3478
- //
3479
- //
3480
- //
3481
- //
3482
- //
3483
- //
3484
- //
3485
- //
3486
- //
3487
- //
3488
- //
3489
- //
3490
- //
3491
- //
3492
-
3493
- /**
3494
- * 消息提示组件
3495
- * 用于主动操作后的反馈提示,从顶部出现,可自动消失
3496
- */
3497
- var typeMap = {
3498
- success: 'success',
3499
- info: 'info',
3500
- warning: 'warning',
3501
- error: 'error'
3502
- };
3503
-
3504
- /* harmony default export */ var mainvue_type_script_lang_js_ = ({
3505
- data: function data() {
3506
- return {
3507
- /**
3508
- * 消息是否可见
3509
- */
3510
- visible: false,
3511
- /**
3512
- * 消息文字
3513
- */
3514
- message: '',
3515
- /**
3516
- * 显示时间,毫秒。设为0则不会自动关闭
3517
- */
3518
- duration: 3000,
3519
- /**
3520
- * 主题类型
3521
- */
3522
- type: 'info',
3523
- /**
3524
- * 自定义图标的类名,会覆盖type
3525
- */
3526
- iconClass: '',
3527
- /**
3528
- * 自定义类名
3529
- */
3530
- customClass: '',
3531
- /**
3532
- * 关闭时的回调函数
3533
- */
3534
- onClose: null,
3535
- /**
3536
- * 是否显示关闭按钮
3537
- */
3538
- showClose: false,
3539
- /**
3540
- * 是否已关闭
3541
- */
3542
- closed: false,
3543
- /**
3544
- * 垂直偏移量
3545
- */
3546
- verticalOffset: 20,
3547
- /**
3548
- * 定时器
3549
- */
3550
- timer: null,
3551
- /**
3552
- * 是否将message作为HTML片段处理
3553
- */
3554
- dangerouslyUseHTMLString: false,
3555
- /**
3556
- * 文字是否居中
3557
- */
3558
- center: false
3559
- };
3560
- },
3561
-
3562
-
3563
- computed: {
3564
- typeClass: function typeClass() {
3565
- return this.type && !this.iconClass ? 'es-message__icon es-icon-' + typeMap[this.type] : '';
3566
- },
3567
- positionStyle: function positionStyle() {
3568
- return {
3569
- top: this.verticalOffset + 'px'
3570
- };
3571
- }
3572
- },
3573
-
3574
- watch: {
3575
- closed: function closed(newVal) {
3576
- if (newVal) {
3577
- this.visible = false;
3578
- }
3579
- }
3580
- },
3581
-
3582
- methods: {
3583
- /**
3584
- * 离开动画结束后的处理
3585
- */
3586
- handleAfterLeave: function handleAfterLeave() {
3587
- this.$destroy(true);
3588
- this.$el.parentNode.removeChild(this.$el);
3589
- },
3590
-
3591
-
3592
- /**
3593
- * 关闭消息
3594
- */
3595
- close: function close() {
3596
- this.closed = true;
3597
- if (typeof this.onClose === 'function') {
3598
- this.onClose(this);
3599
- }
3600
- },
3601
-
3602
-
3603
- /**
3604
- * 清除定时器
3605
- */
3606
- clearTimer: function clearTimer() {
3607
- clearTimeout(this.timer);
3608
- },
3609
-
3610
-
3611
- /**
3612
- * 开始定时器
3613
- */
3614
- startTimer: function startTimer() {
3615
- var _this = this;
3616
-
3617
- if (this.duration > 0) {
3618
- this.timer = setTimeout(function () {
3619
- if (!_this.closed) {
3620
- _this.close();
3621
- }
3622
- }, this.duration);
3623
- }
3624
- },
3625
-
3626
-
3627
- /**
3628
- * 键盘事件处理
3629
- * @param {Event} e - 键盘事件对象
3630
- */
3631
- keydown: function keydown(e) {
3632
- if (e.keyCode === 27) {
3633
- // esc关闭消息
3634
- if (!this.closed) {
3635
- this.close();
3636
- }
3637
- }
3638
- }
3639
- },
3640
- mounted: function mounted() {
3641
- this.startTimer();
3642
- document.addEventListener('keydown', this.keydown);
3643
- },
3644
- beforeDestroy: function beforeDestroy() {
3645
- document.removeEventListener('keydown', this.keydown);
3646
- }
3647
- });
3648
- // CONCATENATED MODULE: ./packages/message/src/main.vue?vue&type=script&lang=js&
3649
- /* harmony default export */ var src_mainvue_type_script_lang_js_ = (mainvue_type_script_lang_js_);
3650
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
3651
- var componentNormalizer = __webpack_require__(5);
3652
-
3653
- // CONCATENATED MODULE: ./packages/message/src/main.vue
3654
-
3655
-
3656
-
3657
-
3658
-
3659
- /* normalize component */
3660
-
3661
- var component = Object(componentNormalizer["a" /* default */])(
3662
- src_mainvue_type_script_lang_js_,
3663
- render,
3664
- staticRenderFns,
3665
- false,
3666
- null,
3667
- null,
3668
- null
3669
-
3670
- )
3671
-
3672
- /* harmony default export */ var main = (component.exports);
3673
- // EXTERNAL MODULE: ./src/utils/popup/index.js + 1 modules
3674
- var popup = __webpack_require__(22);
3675
-
3676
- // EXTERNAL MODULE: ./src/utils/vdom.js
3677
- var vdom = __webpack_require__(64);
3678
-
3679
- // CONCATENATED MODULE: ./packages/message/src/main.js
3680
- /**
3681
- * 消息提示组件
3682
- * 用于主动操作后的反馈提示,从顶部出现,可自动消失
3683
- */
3684
-
3685
-
3686
-
3687
-
3688
- var MessageConstructor = external_vue_default.a.extend(main);
3689
-
3690
- var instance = void 0;
3691
- var instances = [];
3692
- var seed = 1;
3693
-
3694
- /**
3695
- * 创建消息提示
3696
- * @param {Object|string} options - 配置项或消息文字
3697
- * @param {string} [options.message] - 消息文字
3698
- * @param {string} [options.type=info] - 主题类型
3699
- * @param {number} [options.duration=3000] - 显示时间,毫秒。设为0则不会自动关闭
3700
- * @param {string} [options.iconClass] - 自定义图标的类名,会覆盖type
3701
- * @param {boolean} [options.dangerouslyUseHTMLString=false] - 是否将message作为HTML片段处理
3702
- * @param {string} [options.customClass] - 自定义类名
3703
- * @param {boolean} [options.showClose=false] - 是否显示关闭按钮
3704
- * @param {boolean} [options.center=false] - 文字是否居中
3705
- * @param {function} [options.onClose] - 关闭时的回调函数
3706
- * @param {number} [options.offset=20] - Message距离窗口顶部的偏移量
3707
- * @returns {Object} Message实例
3708
- */
3709
- var main_Message = function Message(options) {
3710
- if (external_vue_default.a.prototype.$isServer) return;
3711
- options = options || {};
3712
- if (typeof options === 'string') {
3713
- options = {
3714
- message: options
3715
- };
3716
- }
3717
- var userOnClose = options.onClose;
3718
- var id = 'message_' + seed++;
3719
-
3720
- options.onClose = function () {
3721
- Message.close(id, userOnClose);
3722
- };
3723
- instance = new MessageConstructor({
3724
- data: options
3725
- });
3726
- instance.id = id;
3727
- if (Object(vdom["a" /* isVNode */])(instance.message)) {
3728
- instance.$slots.default = [instance.message];
3729
- instance.message = null;
3730
- }
3731
- instance.$mount();
3732
- document.body.appendChild(instance.$el);
3733
- var verticalOffset = options.offset || 20;
3734
- instances.forEach(function (item) {
3735
- verticalOffset += item.$el.offsetHeight + 16;
3736
- });
3737
- instance.verticalOffset = verticalOffset;
3738
- instance.visible = true;
3739
- instance.$el.style.zIndex = popup["a" /* PopupManager */].nextZIndex();
3740
- instances.push(instance);
3741
- return instance;
3742
- };
3743
-
3744
- ['success', 'warning', 'info', 'error'].forEach(function (type) {
3745
- main_Message[type] = function (options) {
3746
- if (typeof options === 'string') {
3747
- options = {
3748
- message: options
3749
- };
3750
- }
3751
- options.type = type;
3752
- return main_Message(options);
3753
- };
3754
- });
3755
-
3756
- /**
3757
- * 关闭指定的消息
3758
- * @param {string} id - 消息实例的id
3759
- * @param {function} userOnClose - 用户自定义的关闭回调函数
3760
- */
3761
- main_Message.close = function (id, userOnClose) {
3762
- var len = instances.length;
3763
- var index = -1;
3764
- var removedHeight = void 0;
3765
- for (var i = 0; i < len; i++) {
3766
- if (id === instances[i].id) {
3767
- removedHeight = instances[i].$el.offsetHeight;
3768
- index = i;
3769
- if (typeof userOnClose === 'function') {
3770
- userOnClose(instances[i]);
3771
- }
3772
- instances.splice(i, 1);
3773
- break;
3774
- }
3775
- }
3776
- if (len <= 1 || index === -1 || index > instances.length - 1) return;
3777
- for (var _i = index; _i < len - 1; _i++) {
3778
- var dom = instances[_i].$el;
3779
- dom.style['top'] = parseInt(dom.style['top'], 10) - removedHeight - 16 + 'px';
3780
- }
3781
- };
3782
-
3783
- /**
3784
- * 关闭所有消息
3785
- */
3786
- main_Message.closeAll = function () {
3787
- for (var i = instances.length - 1; i >= 0; i--) {
3788
- instances[i].close();
3789
- }
3790
- };
3791
-
3792
- /* harmony default export */ var src_main = (main_Message);
3793
- // CONCATENATED MODULE: ./packages/message/index.js
3794
-
3795
- /* harmony default export */ var message = __webpack_exports__["default"] = (src_main);
3796
-
3797
- /***/ }),
3798
-
3799
- /***/ 18:
3800
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3801
-
3802
- "use strict";
3803
- /* harmony default export */ __webpack_exports__["a"] = (function (target) {
3804
- for (var i = 1, j = arguments.length; i < j; i++) {
3805
- var source = arguments[i] || {};
3806
- for (var prop in source) {
3807
- if (source.hasOwnProperty(prop)) {
3808
- var value = source[prop];
3809
- if (value !== undefined) {
3810
- target[prop] = value;
3811
- }
3812
- }
3813
- }
3814
- }
3815
-
3816
- return target;
3817
- });;
3818
-
3819
- /***/ }),
3820
-
3821
- /***/ 19:
3822
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3823
-
3824
- "use strict";
3825
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getScrollbarWidth; });
3826
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return scrollIntoView; });
3827
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getScrollSize; });
3828
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return scrollMove; });
3829
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
3830
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
3831
-
3832
-
3833
- /**
3834
- * 缓存变量,用于存储计算过的滚动条宽度
3835
- */
3836
- var scrollBarWidth = void 0;
3837
-
3838
- /**
3839
- * 计算并返回浏览器滚动条的宽度
3840
- * @returns {number} 滚动条宽度(像素)
3841
- */
3842
- var getScrollbarWidth = function getScrollbarWidth() {
3843
- // 服务器端渲染时返回0
3844
- if (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) return 0;
3845
- // 如果已经计算过,直接返回缓存值
3846
- if (scrollBarWidth !== undefined) return scrollBarWidth;
3847
-
3848
- // 创建测试元素
3849
- var outer = document.createElement('div');
3850
- outer.className = 'es-scrollbar__wrap';
3851
- outer.style.visibility = 'hidden';
3852
- outer.style.width = '100px';
3853
- outer.style.position = 'absolute';
3854
- outer.style.top = '-9999px';
3855
- document.body.appendChild(outer);
3856
-
3857
- // 计算无滚动条时的宽度
3858
- var widthNoScroll = outer.offsetWidth;
3859
- outer.style.overflow = 'scroll';
3860
-
3861
- // 创建内部元素并计算有滚动条时的宽度
3862
- var inner = document.createElement('div');
3863
- inner.style.width = '100%';
3864
- outer.appendChild(inner);
3865
-
3866
- var widthWithScroll = inner.offsetWidth;
3867
- // 清理DOM
3868
- outer.parentNode.removeChild(outer);
3869
- // 计算滚动条宽度
3870
- scrollBarWidth = widthNoScroll - widthWithScroll;
3871
-
3872
- return scrollBarWidth;
3873
- };
3874
-
3875
- /**
3876
- * 将指定元素滚动到容器视图中
3877
- * @param {HTMLElement} container - 容器元素
3878
- * @param {HTMLElement} selected - 要滚动到视图中的元素
3879
- * @example
3880
- * // 用法示例
3881
- * const container = document.querySelector('.container');
3882
- * const element = document.querySelector('.target-element');
3883
- * scrollIntoView(container, element);
3884
- */
3885
- function scrollIntoView(container, selected) {
3886
- // 服务器端渲染时不执行
3887
- if (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) return;
3888
-
3889
- // 如果没有指定元素,滚动到顶部
3890
- if (!selected) {
3891
- container.scrollTop = 0;
3892
- return;
3893
- }
3894
-
3895
- // 收集所有偏移父元素
3896
- var offsetParents = [];
3897
- var pointer = selected.offsetParent;
3898
- while (pointer && container !== pointer && container.contains(pointer)) {
3899
- offsetParents.push(pointer);
3900
- pointer = pointer.offsetParent;
3901
- }
3902
-
3903
- // 计算元素相对于容器的顶部偏移量
3904
- var top = selected.offsetTop + offsetParents.reduce(function (prev, curr) {
3905
- return prev + curr.offsetTop;
3906
- }, 0);
3907
- var bottom = top + selected.offsetHeight;
3908
- var viewRectTop = container.scrollTop;
3909
- var viewRectBottom = viewRectTop + container.clientHeight;
3910
-
3911
- // 调整滚动位置使元素可见
3912
- if (top < viewRectTop) {
3913
- container.scrollTop = top;
3914
- } else if (bottom > viewRectBottom) {
3915
- container.scrollTop = bottom - container.clientHeight;
3916
- }
3917
- }
3918
-
3919
- // 获取滚动条大小
3920
- function getScrollSize(wrap) {
3921
- if (!wrap) {
3922
- return { width: '', height: '' };
3923
- };
3924
- var heightPercentage = 0;
3925
- var widthPercentage = 0;
3926
-
3927
- // 修复滚动条尺寸计算逻辑
3928
- var scrollHeight = wrap.scrollHeight;
3929
- var scrollWidth = wrap.scrollWidth;
3930
- var clientHeight = wrap.clientHeight;
3931
- var clientWidth = wrap.clientWidth;
3932
- var sizes = {
3933
- width: '',
3934
- height: ''
3935
- };
3936
- // 只有当内容高度超过容器高度时才显示垂直滚动条
3937
- if (scrollHeight > clientHeight) {
3938
- heightPercentage = clientHeight * 100 / scrollHeight;
3939
- sizes.height = heightPercentage < 100 ? heightPercentage + '%' : '100%';
3940
- } else {
3941
- sizes.height = '';
3942
- }
3943
-
3944
- // 只有当内容宽度超过容器宽度时才显示水平滚动条
3945
- if (scrollWidth > clientWidth) {
3946
- widthPercentage = clientWidth * 100 / scrollWidth;
3947
- sizes.width = widthPercentage < 100 ? widthPercentage + '%' : '100%';
3948
- } else {
3949
- sizes.width = '';
3950
- }
3951
- return sizes;
3952
- }
3953
-
3954
- // 滚动条移动
3955
- function scrollMove(wrap) {
3956
- if (!wrap) return;
3957
-
3958
- // 立即更新滚动条位置,不使用阈值判断
3959
- var y = wrap.scrollTop * 100 / wrap.clientHeight;
3960
- var x = wrap.scrollLeft * 100 / wrap.clientWidth;
3961
- return { y: y, x: x };
3962
- }
3963
-
3964
- /***/ }),
3965
-
3966
- /***/ 2:
3967
- /***/ (function(module, exports) {
3968
-
3969
- module.exports = require("vue");
3970
-
3971
- /***/ }),
3972
-
3973
- /***/ 22:
3974
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3975
-
3976
- "use strict";
3977
-
3978
- // EXPORTS
3979
- __webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ popup_manager; });
3980
-
3981
- // EXTERNAL MODULE: external "vue"
3982
- var external_vue_ = __webpack_require__(2);
3983
- var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
3984
-
3985
- // EXTERNAL MODULE: ./src/utils/merge.js
3986
- var merge = __webpack_require__(18);
3987
-
3988
- // EXTERNAL MODULE: ./src/utils/dom.js
3989
- var utils_dom = __webpack_require__(4);
3990
-
3991
- // CONCATENATED MODULE: ./src/utils/popup/popup-manager.js
3992
-
3993
-
3994
-
3995
- var hasModal = false;
3996
- var hasInitZIndex = false;
3997
- var popup_manager_zIndex = void 0;
3998
-
3999
- var popup_manager_getModal = function getModal() {
4000
- if (external_vue_default.a.prototype.$isServer) return;
4001
- var modalDom = PopupManager.modalDom;
4002
- if (modalDom) {
4003
- hasModal = true;
4004
- } else {
4005
- hasModal = false;
4006
- modalDom = document.createElement('div');
4007
- PopupManager.modalDom = modalDom;
4008
-
4009
- modalDom.addEventListener('touchmove', function (event) {
4010
- event.preventDefault();
4011
- event.stopPropagation();
4012
- });
4013
-
4014
- modalDom.addEventListener('click', function () {
4015
- PopupManager.doOnModalClick && PopupManager.doOnModalClick();
4016
- });
4017
- }
4018
-
4019
- return modalDom;
4020
- };
4021
-
4022
- var instances = {};
4023
-
4024
- var PopupManager = {
4025
- modalFade: true,
4026
-
4027
- getInstance: function getInstance(id) {
4028
- return instances[id];
4029
- },
4030
-
4031
- register: function register(id, instance) {
4032
- if (id && instance) {
4033
- instances[id] = instance;
4034
- }
4035
- },
4036
-
4037
- deregister: function deregister(id) {
4038
- if (id) {
4039
- instances[id] = null;
4040
- delete instances[id];
4041
- }
4042
- },
4043
-
4044
- nextZIndex: function nextZIndex() {
4045
- return PopupManager.zIndex++;
4046
- },
4047
-
4048
- modalStack: [],
4049
-
4050
- doOnModalClick: function doOnModalClick() {
4051
- var topItem = PopupManager.modalStack[PopupManager.modalStack.length - 1];
4052
- if (!topItem) return;
4053
-
4054
- var instance = PopupManager.getInstance(topItem.id);
4055
- if (instance && instance.closeOnClickModal) {
4056
- instance.close();
4057
- }
4058
- },
4059
-
4060
- openModal: function openModal(id, zIndex, dom, modalClass, modalFade) {
4061
- if (external_vue_default.a.prototype.$isServer) return;
4062
- if (!id || zIndex === undefined) return;
4063
- this.modalFade = modalFade;
4064
-
4065
- var modalStack = this.modalStack;
4066
-
4067
- for (var i = 0, j = modalStack.length; i < j; i++) {
4068
- var item = modalStack[i];
4069
- if (item.id === id) {
4070
- return;
4071
- }
4072
- }
4073
-
4074
- var modalDom = popup_manager_getModal();
4075
-
4076
- Object(utils_dom["a" /* addClass */])(modalDom, 'v-modal');
4077
- if (this.modalFade && !hasModal) {
4078
- Object(utils_dom["a" /* addClass */])(modalDom, 'v-modal-enter');
4079
- }
4080
- if (modalClass) {
4081
- var classArr = modalClass.trim().split(/\s+/);
4082
- classArr.forEach(function (item) {
4083
- return Object(utils_dom["a" /* addClass */])(modalDom, item);
4084
- });
4085
- }
4086
- setTimeout(function () {
4087
- Object(utils_dom["i" /* removeClass */])(modalDom, 'v-modal-enter');
4088
- }, 200);
4089
-
4090
- if (dom && dom.parentNode && dom.parentNode.nodeType !== 11) {
4091
- dom.parentNode.appendChild(modalDom);
4092
- } else {
4093
- document.body.appendChild(modalDom);
4094
- }
4095
-
4096
- if (zIndex) {
4097
- modalDom.style.zIndex = zIndex;
4098
- }
4099
- modalDom.tabIndex = 0;
4100
- modalDom.style.display = '';
4101
-
4102
- this.modalStack.push({ id: id, zIndex: zIndex, modalClass: modalClass });
4103
- },
4104
-
4105
- closeModal: function closeModal(id) {
4106
- var modalStack = this.modalStack;
4107
- var modalDom = popup_manager_getModal();
4108
- var topItem = null;
4109
-
4110
- if (modalStack.length > 0) {
4111
- topItem = modalStack[modalStack.length - 1];
4112
- if (topItem.id === id) {
4113
- modalStack.pop();
4114
- if (modalStack.length > 0) {
4115
- modalDom.style.zIndex = modalStack[modalStack.length - 1].zIndex;
4116
- }
4117
- } else {
4118
- for (var i = modalStack.length - 1; i >= 0; i--) {
4119
- if (modalStack[i].id === id) {
4120
- modalStack.splice(i, 1);
4121
- break;
4122
- }
4123
- }
4124
- }
4125
- }
4126
-
4127
- if (modalStack.length === 0) {
4128
- if (this.modalFade) {
4129
- Object(utils_dom["a" /* addClass */])(modalDom, 'v-modal-leave');
4130
- }
4131
- setTimeout(function () {
4132
- if (modalStack.length === 0) {
4133
- if (topItem && topItem.modalClass) {
4134
- var classArr = topItem.modalClass.trim().split(/\s+/);
4135
- classArr.forEach(function (item) {
4136
- return Object(utils_dom["i" /* removeClass */])(modalDom, item);
4137
- });
4138
- }
4139
- if (modalDom.parentNode) modalDom.parentNode.removeChild(modalDom);
4140
- modalDom.style.display = 'none';
4141
- PopupManager.modalDom = undefined;
4142
- }
4143
- Object(utils_dom["i" /* removeClass */])(modalDom, 'v-modal-leave');
4144
- }, 200);
4145
- } else {
4146
- if (topItem && topItem.modalClass) {
4147
- var classArr = topItem.modalClass.trim().split(/\s+/);
4148
- classArr.forEach(function (item) {
4149
- return Object(utils_dom["i" /* removeClass */])(modalDom, item);
4150
- });
4151
- }
4152
- }
4153
- }
4154
- };
4155
-
4156
- Object.defineProperty(PopupManager, 'zIndex', {
4157
- configurable: true,
4158
- get: function get() {
4159
- if (!hasInitZIndex) {
4160
- if (!popup_manager_zIndex) {
4161
- popup_manager_zIndex = popup_manager_zIndex || (external_vue_default.a.prototype.$EOSS || {}).zIndex || 2000;
4162
- }
4163
- hasInitZIndex = true;
4164
- }
4165
- return popup_manager_zIndex;
4166
- },
4167
- set: function set(value) {
4168
- popup_manager_zIndex = value;
4169
- }
4170
- });
4171
-
4172
- var popup_manager_getTopPopup = function getTopPopup() {
4173
- if (external_vue_default.a.prototype.$isServer) return;
4174
- if (PopupManager.modalStack.length > 0) {
4175
- var topPopup = PopupManager.modalStack[PopupManager.modalStack.length - 1];
4176
- if (!topPopup) return;
4177
- var instance = PopupManager.getInstance(topPopup.id);
4178
-
4179
- return instance;
4180
- }
4181
- };
4182
-
4183
- if (!external_vue_default.a.prototype.$isServer) {
4184
- // handle `esc` key when the popup is shown
4185
- window.addEventListener('keydown', function (event) {
4186
- if (event.keyCode === 27) {
4187
- var topPopup = popup_manager_getTopPopup();
4188
-
4189
- if (topPopup && topPopup.closeOnPressEscape) {
4190
- topPopup.handleClose ? topPopup.handleClose() : topPopup.handleAction ? topPopup.handleAction('cancel') : topPopup.close();
4191
- }
4192
- }
4193
- });
4194
- }
4195
-
4196
- /* harmony default export */ var popup_manager = (PopupManager);
4197
- // EXTERNAL MODULE: ./src/utils/scrollbar.js
4198
- var scrollbar = __webpack_require__(19);
4199
-
4200
- // CONCATENATED MODULE: ./src/utils/popup/index.js
4201
-
4202
-
4203
-
4204
-
4205
-
4206
-
4207
- var idSeed = 1;
4208
-
4209
- var scrollBarWidth = void 0;
4210
-
4211
- /* harmony default export */ var popup = __webpack_exports__["b"] = ({
4212
- props: {
4213
- visible: {
4214
- type: Boolean,
4215
- default: false
4216
- },
4217
- openDelay: {},
4218
- closeDelay: {},
4219
- zIndex: {},
4220
- modal: {
4221
- type: Boolean,
4222
- default: false
4223
- },
4224
- modalFade: {
4225
- type: Boolean,
4226
- default: true
4227
- },
4228
- modalClass: {},
4229
- modalAppendToBody: {
4230
- type: Boolean,
4231
- default: false
4232
- },
4233
- lockScroll: {
4234
- type: Boolean,
4235
- default: true
4236
- },
4237
- closeOnPressEscape: {
4238
- type: Boolean,
4239
- default: false
4240
- },
4241
- closeOnClickModal: {
4242
- type: Boolean,
4243
- default: false
4244
- }
4245
- },
4246
-
4247
- beforeMount: function beforeMount() {
4248
- this._popupId = 'popup-' + idSeed++;
4249
- popup_manager.register(this._popupId, this);
4250
- },
4251
- mounted: function mounted() {
4252
- var _this = this;
4253
-
4254
- // 监听组件的 'opened' 事件,在过渡动画完成后设置 rendered = true
4255
- this.$on('opened', function () {
4256
- _this.$nextTick(function () {
4257
- _this.rendered = true;
4258
- });
4259
- });
4260
- },
4261
- beforeDestroy: function beforeDestroy() {
4262
- popup_manager.deregister(this._popupId);
4263
- popup_manager.closeModal(this._popupId);
4264
-
4265
- this.restoreBodyStyle();
4266
- },
4267
- data: function data() {
4268
- return {
4269
- opened: false,
4270
- bodyPaddingRight: null,
4271
- computedBodyPaddingRight: 0,
4272
- withoutHiddenClass: true,
4273
- rendered: false
4274
- };
4275
- },
4276
-
4277
-
4278
- watch: {
4279
- visible: function visible(val) {
4280
- var _this2 = this;
4281
-
4282
- if (val) {
4283
- if (this._opening) return;
4284
- if (!this.rendered) {
4285
- external_vue_default.a.nextTick(function () {
4286
- _this2.open();
4287
- });
4288
- } else {
4289
- this.open();
4290
- }
4291
- } else {
4292
- this.close();
4293
- }
4294
- }
4295
- },
4296
-
4297
- methods: {
4298
- open: function open(options) {
4299
- var _this3 = this;
4300
-
4301
- var props = Object(merge["a" /* default */])({}, this.$props || this, options);
4302
-
4303
- if (this._closeTimer) {
4304
- clearTimeout(this._closeTimer);
4305
- this._closeTimer = null;
4306
- }
4307
- clearTimeout(this._openTimer);
4308
-
4309
- var openDelay = Number(props.openDelay);
4310
- if (openDelay > 0) {
4311
- this._openTimer = setTimeout(function () {
4312
- _this3._openTimer = null;
4313
- _this3.doOpen(props);
4314
- }, openDelay);
4315
- } else {
4316
- this.doOpen(props);
4317
- }
4318
- },
4319
- doOpen: function doOpen(props) {
4320
- if (this.$isServer) return;
4321
- if (this.willOpen && !this.willOpen()) return;
4322
- if (this.opened) return;
4323
-
4324
- this._opening = true;
4325
-
4326
- var dom = this.$el;
4327
-
4328
- var modal = props.modal;
4329
-
4330
- var zIndex = props.zIndex;
4331
- if (zIndex) {
4332
- popup_manager.zIndex = zIndex;
4333
- }
4334
-
4335
- if (modal) {
4336
- if (this._closing) {
4337
- popup_manager.closeModal(this._popupId);
4338
- this._closing = false;
4339
- }
4340
- popup_manager.openModal(this._popupId, popup_manager.nextZIndex(), this.modalAppendToBody ? undefined : dom, props.modalClass, props.modalFade);
4341
- if (props.lockScroll) {
4342
- this.withoutHiddenClass = !Object(utils_dom["d" /* hasClass */])(document.body, 'es-popup-parent--hidden');
4343
- if (this.withoutHiddenClass) {
4344
- this.bodyPaddingRight = document.body.style.paddingRight;
4345
- this.computedBodyPaddingRight = parseInt(Object(utils_dom["c" /* getStyle */])(document.body, 'paddingRight'), 10);
4346
- }
4347
- scrollBarWidth = Object(scrollbar["b" /* getScrollbarWidth */])();
4348
- var bodyHasOverflow = document.documentElement.clientHeight < document.body.scrollHeight;
4349
- var bodyOverflowY = Object(utils_dom["c" /* getStyle */])(document.body, 'overflowY');
4350
- if (scrollBarWidth > 0 && (bodyHasOverflow || bodyOverflowY === 'scroll') && this.withoutHiddenClass) {
4351
- document.body.style.paddingRight = this.computedBodyPaddingRight + scrollBarWidth + 'px';
4352
- }
4353
- Object(utils_dom["a" /* addClass */])(document.body, 'es-popup-parent--hidden');
4354
- }
4355
- }
4356
-
4357
- if (getComputedStyle(dom).position === 'static') {
4358
- dom.style.position = 'absolute';
4359
- }
4360
-
4361
- dom.style.zIndex = popup_manager.nextZIndex();
4362
- this.opened = true;
4363
-
4364
- this.onOpen && this.onOpen();
4365
-
4366
- this.doAfterOpen();
4367
- },
4368
- doAfterOpen: function doAfterOpen() {
4369
- this._opening = false;
4370
- },
4371
- close: function close() {
4372
- var _this4 = this;
4373
-
4374
- if (this.willClose && !this.willClose()) return;
4375
-
4376
- if (this._openTimer !== null) {
4377
- clearTimeout(this._openTimer);
4378
- this._openTimer = null;
4379
- }
4380
- clearTimeout(this._closeTimer);
4381
-
4382
- var closeDelay = Number(this.closeDelay);
4383
-
4384
- if (closeDelay > 0) {
4385
- this._closeTimer = setTimeout(function () {
4386
- _this4._closeTimer = null;
4387
- _this4.doClose();
4388
- }, closeDelay);
4389
- } else {
4390
- this.doClose();
4391
- }
4392
- },
4393
- doClose: function doClose() {
4394
- this._closing = true;
4395
-
4396
- this.onClose && this.onClose();
4397
-
4398
- if (this.lockScroll) {
4399
- setTimeout(this.restoreBodyStyle, 200);
4400
- }
4401
-
4402
- this.opened = false;
4403
-
4404
- this.doAfterClose();
4405
- },
4406
- doAfterClose: function doAfterClose() {
4407
- popup_manager.closeModal(this._popupId);
4408
- this._closing = false;
4409
- },
4410
- restoreBodyStyle: function restoreBodyStyle() {
4411
- if (this.modal && this.withoutHiddenClass) {
4412
- document.body.style.paddingRight = this.bodyPaddingRight;
4413
- Object(utils_dom["i" /* removeClass */])(document.body, 'es-popup-parent--hidden');
4414
- }
4415
- this.withoutHiddenClass = true;
4416
- }
4417
- }
4418
- });
4419
-
4420
-
4421
-
4422
- /***/ }),
4423
-
4424
- /***/ 3:
4425
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
4426
-
4427
- "use strict";
4428
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isString; });
4429
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isObject; });
4430
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isHtmlElement; });
4431
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isFunction; });
4432
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isUndefined; });
4433
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isDefined; });
4434
- /**
4435
- * 检查一个值是否为字符串类型
4436
- * @param {*} obj 要检查的值
4437
- * @returns {boolean} 如果值为字符串则返回true,否则返回false
4438
- */
4439
- function isString(obj) {
4440
- return Object.prototype.toString.call(obj) === '[object String]';
4441
- }
4442
-
4443
- /**
4444
- * 检查一个值是否为对象类型
4445
- * @param {*} obj 要检查的值
4446
- * @returns {boolean} 如果值为对象则返回true,否则返回false
4447
- */
4448
- function isObject(obj) {
4449
- return Object.prototype.toString.call(obj) === '[object Object]';
4450
- }
4451
-
4452
- /**
4453
- * 检查一个节点是否为HTML元素
4454
- * @param {Node} node 要检查的节点
4455
- * @returns {boolean} 如果节点为HTML元素则返回true,否则返回false
4456
- */
4457
- function isHtmlElement(node) {
4458
- return node && node.nodeType === Node.ELEMENT_NODE;
4459
- }
4460
-
4461
- /**
4462
- * 检查一个值是否为函数类型
4463
- * @param {*} functionToCheck 要检查的值
4464
- * @returns {boolean} 如果值为函数则返回true,否则返回false
4465
- */
4466
- function isFunction(functionToCheck) {
4467
- var getType = {};
4468
- return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
4469
- }
4470
-
4471
- /**
4472
- * 检查一个值是否为undefined
4473
- * @param {*} val 要检查的值
4474
- * @returns {boolean} 如果值为undefined则返回true,否则返回false
4475
- */
4476
- function isUndefined(val) {
4477
- return val === void 0;
4478
- }
4479
-
4480
- /**
4481
- * 检查一个值是否已定义(不是undefined或null)
4482
- * @param {*} val 要检查的值
4483
- * @returns {boolean} 如果值已定义则返回true,否则返回false
4484
- */
4485
- function isDefined(val) {
4486
- return val !== undefined && val !== null;
4487
- }
4488
-
4489
- /***/ }),
4490
-
4491
- /***/ 4:
4492
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
4493
-
4494
- "use strict";
4495
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return on; });
4496
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return off; });
4497
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return once; });
4498
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return hasClass; });
4499
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addClass; });
4500
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return removeClass; });
4501
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getStyle; });
4502
- /* unused harmony export setStyle */
4503
- /* unused harmony export isScroll */
4504
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getScrollContainer; });
4505
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isInContainer; });
4506
- /* unused harmony export insertAfter */
4507
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
4508
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
4509
- 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; };
4510
-
4511
- /* istanbul ignore next */
4512
-
4513
-
4514
-
4515
- var isServer = vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer;
4516
- var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
4517
- var MOZ_HACK_REGEXP = /^moz([A-Z])/;
4518
- var ieVersion = isServer ? 0 : Number(document.documentMode);
4519
-
4520
- /* istanbul ignore next */
4521
- var trim = function trim(string) {
4522
- return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
4523
- };
4524
- /* istanbul ignore next */
4525
- var camelCase = function camelCase(name) {
4526
- return name.replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) {
4527
- return offset ? letter.toUpperCase() : letter;
4528
- }).replace(MOZ_HACK_REGEXP, 'Moz$1');
4529
- };
4530
-
4531
- /* istanbul ignore next */
4532
- var on = function () {
4533
- if (!isServer && document.addEventListener) {
4534
- return function (element, event, handler) {
4535
- if (element && event && handler) {
4536
- element.addEventListener(event, handler, false);
4537
- }
4538
- };
4539
- } else {
4540
- return function (element, event, handler) {
4541
- if (element && event && handler) {
4542
- element.attachEvent('on' + event, handler);
4543
- }
4544
- };
4545
- }
4546
- }();
4547
-
4548
- /* istanbul ignore next */
4549
- var off = function () {
4550
- if (!isServer && document.removeEventListener) {
4551
- return function (element, event, handler) {
4552
- if (element && event) {
4553
- element.removeEventListener(event, handler, false);
4554
- }
4555
- };
4556
- } else {
4557
- return function (element, event, handler) {
4558
- if (element && event) {
4559
- element.detachEvent('on' + event, handler);
4560
- }
4561
- };
4562
- }
4563
- }();
4564
-
4565
- /* istanbul ignore next */
4566
- var once = function once(el, event, fn) {
4567
- var listener = function listener() {
4568
- if (fn) {
4569
- fn.apply(this, arguments);
4570
- }
4571
- off(el, event, listener);
4572
- };
4573
- on(el, event, listener);
4574
- };
4575
-
4576
- /* istanbul ignore next */
4577
- function hasClass(el, cls) {
4578
- if (!el || !cls) return false;
4579
- if (cls.indexOf(' ') !== -1) {
4580
- throw new Error('className should not contain space.');
4581
- }
4582
- if (el.classList) {
4583
- return el.classList.contains(cls);
4584
- } else {
4585
- return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1;
4586
- }
4587
- }
4588
-
4589
- /* istanbul ignore next */
4590
- function addClass(el, cls) {
4591
- if (!el) return;
4592
- var curClass = el.className;
4593
- var classes = (cls || '').split(' ');
4594
-
4595
- for (var i = 0, j = classes.length; i < j; i++) {
4596
- var clsName = classes[i];
4597
- if (!clsName) continue;
4598
-
4599
- if (el.classList) {
4600
- el.classList.add(clsName);
4601
- } else if (!hasClass(el, clsName)) {
4602
- curClass += ' ' + clsName;
4603
- }
4604
- }
4605
- if (!el.classList) {
4606
- el.className = curClass;
4607
- }
4608
- }
4609
-
4610
- /* istanbul ignore next */
4611
- function removeClass(el, cls) {
4612
- if (!el || !cls) return;
4613
- var classes = cls.split(' ');
4614
- var curClass = ' ' + el.className + ' ';
4615
-
4616
- for (var i = 0, j = classes.length; i < j; i++) {
4617
- var clsName = classes[i];
4618
- if (!clsName) continue;
4619
-
4620
- if (el.classList) {
4621
- el.classList.remove(clsName);
4622
- } else if (hasClass(el, clsName)) {
4623
- curClass = curClass.replace(' ' + clsName + ' ', ' ');
4624
- }
4625
- }
4626
- if (!el.classList) {
4627
- el.className = trim(curClass);
4628
- }
4629
- }
4630
-
4631
- /* istanbul ignore next */
4632
- var getStyle = ieVersion < 9 ? function (element, styleName) {
4633
- if (isServer) return;
4634
- if (!element || !styleName) return null;
4635
- styleName = camelCase(styleName);
4636
- if (styleName === 'float') {
4637
- styleName = 'styleFloat';
4638
- }
4639
- try {
4640
- switch (styleName) {
4641
- case 'opacity':
4642
- try {
4643
- return element.filters.item('alpha').opacity / 100;
4644
- } catch (e) {
4645
- return 1.0;
4646
- }
4647
- default:
4648
- return element.style[styleName] || element.currentStyle ? element.currentStyle[styleName] : null;
4649
- }
4650
- } catch (e) {
4651
- return element.style[styleName];
4652
- }
4653
- } : function (element, styleName) {
4654
- if (isServer) return;
4655
- if (!element || !styleName) return null;
4656
- styleName = camelCase(styleName);
4657
- if (styleName === 'float') {
4658
- styleName = 'cssFloat';
4659
- }
4660
- try {
4661
- var computed = document.defaultView.getComputedStyle(element, '');
4662
- return element.style[styleName] || computed ? computed[styleName] : null;
4663
- } catch (e) {
4664
- return element.style[styleName];
4665
- }
4666
- };
4667
-
4668
- /* istanbul ignore next */
4669
- function setStyle(element, styleName, value) {
4670
- if (!element || !styleName) return;
4671
-
4672
- if ((typeof styleName === 'undefined' ? 'undefined' : _typeof(styleName)) === 'object') {
4673
- for (var prop in styleName) {
4674
- if (styleName.hasOwnProperty(prop)) {
4675
- setStyle(element, prop, styleName[prop]);
4676
- }
4677
- }
4678
- } else {
4679
- styleName = camelCase(styleName);
4680
- if (styleName === 'opacity' && ieVersion < 9) {
4681
- element.style.filter = isNaN(value) ? '' : 'alpha(opacity=' + value * 100 + ')';
4682
- } else {
4683
- element.style[styleName] = value;
4684
- }
4685
- }
4686
- }
4687
-
4688
- var isScroll = function isScroll(el, vertical) {
4689
- if (isServer) return;
4690
-
4691
- var determinedDirection = vertical !== null || vertical !== undefined;
4692
- var overflow = determinedDirection ? vertical ? getStyle(el, 'overflow-y') : getStyle(el, 'overflow-x') : getStyle(el, 'overflow');
4693
-
4694
- return overflow.match(/(scroll|auto)/);
4695
- };
4696
-
4697
- var getScrollContainer = function getScrollContainer(el, vertical) {
4698
- if (isServer) return;
4699
-
4700
- var parent = el;
4701
- while (parent) {
4702
- if ([window, document, document.documentElement].includes(parent)) {
4703
- return window;
4704
- }
4705
- if (isScroll(parent, vertical)) {
4706
- return parent;
4707
- }
4708
- parent = parent.parentNode;
4709
- }
4710
-
4711
- return parent;
4712
- };
4713
-
4714
- var isInContainer = function isInContainer(el, container) {
4715
- if (isServer || !el || !container) return false;
4716
-
4717
- var elRect = el.getBoundingClientRect();
4718
- var containerRect = void 0;
4719
-
4720
- if ([window, document, document.documentElement, null, undefined].includes(container)) {
4721
- containerRect = {
4722
- top: 0,
4723
- right: window.innerWidth,
4724
- bottom: window.innerHeight,
4725
- left: 0
4726
- };
4727
- } else {
4728
- containerRect = container.getBoundingClientRect();
4729
- }
4730
-
4731
- return elRect.top < containerRect.bottom && elRect.bottom > containerRect.top && elRect.right > containerRect.left && elRect.left < containerRect.right;
4732
- };
4733
-
4734
- /**
4735
- * 在元素前插入元素
4736
- * @param {HTMLElement} newEl 新DOM元素
4737
- * @param {HTMLElement} targetEl 在指定目标DOM元素前插入
4738
- */
4739
- function insertAfter(newEl, targetEl) {
4740
- var parentEl = targetEl.parentNode;
4741
- if (parentEl.lastChild === targetEl) {
4742
- parentEl.appendChild(newEl);
4743
- } else {
4744
- parentEl.insertBefore(newEl, targetEl.nextSibling);
4745
- }
4746
- }
4747
-
4748
- /***/ }),
4749
-
4750
- /***/ 5:
4751
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
4752
-
4753
- "use strict";
4754
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
4755
- /* globals __VUE_SSR_CONTEXT__ */
4756
-
4757
- // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
4758
- // This module is a runtime utility for cleaner component module output and will
4759
- // be included in the final webpack user bundle.
4760
-
4761
- function normalizeComponent(
4762
- scriptExports,
4763
- render,
4764
- staticRenderFns,
4765
- functionalTemplate,
4766
- injectStyles,
4767
- scopeId,
4768
- moduleIdentifier /* server only */,
4769
- shadowMode /* vue-cli only */
4770
- ) {
4771
- // Vue.extend constructor export interop
4772
- var options =
4773
- typeof scriptExports === 'function' ? scriptExports.options : scriptExports
4774
-
4775
- // render functions
4776
- if (render) {
4777
- options.render = render
4778
- options.staticRenderFns = staticRenderFns
4779
- options._compiled = true
4780
- }
4781
-
4782
- // functional template
4783
- if (functionalTemplate) {
4784
- options.functional = true
4785
- }
4786
-
4787
- // scopedId
4788
- if (scopeId) {
4789
- options._scopeId = 'data-v-' + scopeId
4790
- }
4791
-
4792
- var hook
4793
- if (moduleIdentifier) {
4794
- // server build
4795
- hook = function (context) {
4796
- // 2.3 injection
4797
- context =
4798
- context || // cached call
4799
- (this.$vnode && this.$vnode.ssrContext) || // stateful
4800
- (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
4801
- // 2.2 with runInNewContext: true
4802
- if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
4803
- context = __VUE_SSR_CONTEXT__
4804
- }
4805
- // inject component styles
4806
- if (injectStyles) {
4807
- injectStyles.call(this, context)
4808
- }
4809
- // register component module identifier for async chunk inferrence
4810
- if (context && context._registeredComponents) {
4811
- context._registeredComponents.add(moduleIdentifier)
4812
- }
4813
- }
4814
- // used by ssr in case component is cached and beforeCreate
4815
- // never gets called
4816
- options._ssrRegister = hook
4817
- } else if (injectStyles) {
4818
- hook = shadowMode
4819
- ? function () {
4820
- injectStyles.call(
4821
- this,
4822
- (options.functional ? this.parent : this).$root.$options.shadowRoot
4823
- )
4824
- }
4825
- : injectStyles
4826
- }
4827
-
4828
- if (hook) {
4829
- if (options.functional) {
4830
- // for template-only hot-reload because in that case the render fn doesn't
4831
- // go through the normalizer
4832
- options._injectStyles = hook
4833
- // register for functional component in vue file
4834
- var originalRender = options.render
4835
- options.render = function renderWithStyleInjection(h, context) {
4836
- hook.call(context)
4837
- return originalRender(h, context)
4838
- }
4839
- } else {
4840
- // inject component registration as beforeCreate hook
4841
- var existing = options.beforeCreate
4842
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
4843
- }
4844
- }
4845
-
4846
- return {
4847
- exports: scriptExports,
4848
- options: options
4849
- }
4850
- }
4851
-
4852
-
4853
- /***/ }),
4854
-
4855
- /***/ 6:
4856
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
4857
-
4858
3013
  "use strict";
4859
3014
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return fecha; });
4860
3015
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return getSettings; });
@@ -5656,193 +3811,2147 @@ const dateAddDays = function (start_date, days) {
5656
3811
  };
5657
3812
 
5658
3813
  /**
5659
- * 计算两个日期之间的差值
5660
- * @date 2023年12月14日
5661
- * @param {String} start_date - 起始日期字符串
5662
- * @param {String} end_date - 结束日期字符串
5663
- * @param {String} unit - 单位:year/month/day
5664
- * @returns {Number} 差值
5665
- */
5666
- const dateDiff = function (start_date, end_date, unit = 'day') {
5667
- // Assuming date strings are in "YYYY-MM-DD" format
5668
- var startDate = new Date(start_date);
5669
- var endDate = new Date(end_date);
5670
-
5671
- // If the date is invalid, return 0
5672
- if (isNaN(startDate.getTime()) || isNaN(endDate.getTime())) {
5673
- return 0;
5674
- }
5675
-
5676
- if (unit === 'year') {
5677
- return endDate.getFullYear() - startDate.getFullYear();
5678
- } else if (unit === 'month') {
5679
- return (
5680
- (endDate.getFullYear() - startDate.getFullYear()) * 12 +
5681
- (endDate.getMonth() - startDate.getMonth())
5682
- );
5683
- } else {
5684
- // Default to day
5685
- var timeDifference = endDate - startDate;
5686
- // Calculate days (86400000 milliseconds per day)
5687
- return Math.floor(timeDifference / 86400000);
5688
- }
5689
- };
5690
-
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();
3902
+ };
3903
+
3904
+ /**
3905
+ * 获取分钟
3906
+ * @date 2022年5月7日
3907
+ * @param {Date|string} [date] - 日期对象或日期字符串
3908
+ * @returns {number} 分钟数(0-59)
3909
+ */
3910
+ const getMinute = function (date) {
3911
+ if (!date) {
3912
+ return new Date().getMinutes();
3913
+ }
3914
+ if (typeof date === 'string') {
3915
+ date = new Date(date);
3916
+ }
3917
+ return date.getMinutes();
3918
+ };
3919
+
3920
+ /**
3921
+ * 获取月份
3922
+ * @date 2022年5月7日
3923
+ * @param {Date|string} [date] - 日期对象或日期字符串
3924
+ * @returns {number} 月份数(1-12)
3925
+ */
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
+ };
3935
+
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);
3948
+ }
3949
+ return date.getSeconds();
3950
+ };
3951
+
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);
3964
+ }
3965
+ return date.getDay();
3966
+ };
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
+ /***/ 13:
4001
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4002
+
4003
+ "use strict";
4004
+ /* unused harmony export getHue */
4005
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getColor; });
4006
+ /* unused harmony export getLightness */
4007
+ /* unused harmony export getSaturation */
4008
+ /* unused harmony export rgbToHsv */
4009
+ /* unused harmony export hsvTorgb */
4010
+ /* unused harmony export mixColor */
4011
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getRgb; });
4012
+ /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
4013
+
4014
+ var $hueStep = 2;
4015
+ var $saturationStep1 = 0.16;
4016
+ var $saturationStep2 = 0.05;
4017
+ var $brightnessStep1 = 0.05;
4018
+ var $brightnessStep2 = 0.15;
4019
+ var $lightColorCount = 5;
4020
+ var $darkColorCount = 4;
4021
+ /**
4022
+ * getHue
4023
+ * @desc:转换色相
4024
+ * @author huangbo
4025
+ * @date 2022年5月7日
4026
+ **/
4027
+ var getHue = function getHue($h, $i, $isLight) {
4028
+ var $hue = void 0;
4029
+ if ($h >= 60 && $h <= 240) {
4030
+ $hue = $isLight ? $h - $hueStep * $i : $h + $hueStep * $i;
4031
+ } else {
4032
+ $hue = $isLight ? $h + $hueStep * $i : $h - $hueStep * $i;
4033
+ }
4034
+ $hue = ($hue + 360) % 360;
4035
+ return Math.round($hue);
4036
+ };
4037
+
4038
+ /**
4039
+ * getColor
4040
+ * @desc:根据颜色和对应的色板位置,计算出对应的色板颜色
4041
+ * @author huangbo
4042
+ * @date 2022年5月7日
4043
+ **/
4044
+ var getColor = function getColor($color, $n) {
4045
+ var $isLight = $n < 7;
4046
+ var $hsv = rgbToHsv($color);
4047
+ // 这里将i转换成以主色为中心,两侧的i值逐渐增大
4048
+ var $i = $isLight ? $lightColorCount + 1 - $n : $n - $lightColorCount - 1;
4049
+ var color = hsvTorgb(getHue($hsv[0], $i, $isLight), getSaturation($hsv[1], $i, $isLight), getLightness($hsv[2], $i, $isLight));
4050
+ return color;
4051
+ };
4052
+
4053
+ /**
4054
+ * getLightness
4055
+ * @desc:转换明度
4056
+ * @author huangbo
4057
+ * @date 2022年5月7日
4058
+ * @return {string,array} 元素类名或者id
4059
+ **/
4060
+ var getLightness = function getLightness($v, $i, $isLight) {
4061
+ var $value = $isLight ? $v + $brightnessStep1 * $i : $v - $brightnessStep2 * $i;
4062
+ $value = $value < 1 ? $value : 1;
4063
+ return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "U"])($value, 2);
4064
+ };
4065
+
4066
+ /**
4067
+ * getSaturation
4068
+ * @desc:转换饱和度
4069
+ * @author huangbo
4070
+ * @date 2022年5月7日
4071
+ **/
4072
+ var getSaturation = function getSaturation($s, $i, $isLight) {
4073
+ var $saturation = void 0;
4074
+ if ($isLight) {
4075
+ $saturation = $s - $saturationStep1 * $i;
4076
+ } else if ($i === $darkColorCount) {
4077
+ $saturation = $s + $saturationStep1;
4078
+ } else {
4079
+ $saturation = $s + $saturationStep2 * $i;
4080
+ }
4081
+ $saturation = $saturation < 1 ? $saturation : 1;
4082
+
4083
+ if ($isLight && $i === $lightColorCount && $saturation > 0.1) {
4084
+ $saturation = 0.1;
4085
+ }
4086
+ $saturation = $saturation > 0.06 ? $saturation : 0.06;
4087
+ return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "U"])($saturation, 2);
4088
+ };
4089
+
4090
+ /**
4091
+ * rgbToHsv
4092
+ * @desc:rgb转化成hsv
4093
+ * @author huangbo
4094
+ * @date 2022年5月7日
4095
+ * @param {string} [$color] - 颜色值
4096
+ **/
4097
+ var rgbToHsv = function rgbToHsv($color) {
4098
+ var rgb = getRgb($color);
4099
+ var $red = rgb[0];
4100
+ var $green = rgb[1];
4101
+ var $blue = rgb[2];
4102
+ var $max = Math.max($red, $green, $blue);
4103
+ var $min = Math.min($red, $green, $blue);
4104
+ var $diff = $max - $min;
4105
+ var $h = 0;
4106
+ if ($max === $min) {
4107
+ $h = 0;
4108
+ } else if ($max === $red) {
4109
+ $h = 60 * ($green - $blue) / $diff + ($green > $blue - 1 ? 0 : 360);
4110
+ } else if ($max === $green) {
4111
+ $h = 60 * ($blue - $red) / $diff + 120;
4112
+ } else if ($max === $blue) {
4113
+ $h = 60 * ($red - $green) / $diff + 240;
4114
+ }
4115
+ var $s = $max === 0 ? 0 : $diff / $max;
4116
+ var $v = $max / 255;
4117
+ return [$h, $s, $v];
4118
+ };
4119
+
4120
+ /**
4121
+ * hsvTorgb
4122
+ * @desc:hsv转化成rgb
4123
+ * @author huangbo
4124
+ * @date 2022年5月7日
4125
+ * @param {string} [$color] - 颜色值
4126
+ **/
4127
+ var hsvTorgb = function hsvTorgb($h, $s, $v) {
4128
+ var $th = Math.floor($h / 60);
4129
+ var $t1 = $h / 60 - $th;
4130
+ var $t2 = $v * (1 - $s);
4131
+ var $t3 = $v * (1 - $t1 * $s);
4132
+ var $t4 = $v * (1 - (1 - $t1) * $s);
4133
+ var $r = [$v, $t3, $t2, $t2, $t4, $v][$th % 6];
4134
+ var $g = [$t4, $v, $v, $t3, $t2, $t2][$th % 6];
4135
+ var $b = [$t2, $t2, $t4, $v, $v, $t3][$th % 6];
4136
+ // return `rgb(${Math.round($r * 255)}, ${Math.round($g * 255)}, ${Math.round($b * 255)})`;
4137
+ var red = Math.round($r * 255);
4138
+ var green = Math.round($g * 255);
4139
+ var blue = Math.round($b * 255);
4140
+ red = red.toString(16);
4141
+ green = green.toString(16);
4142
+ blue = blue.toString(16);
4143
+ red = red.length === 1 ? '0' + red : red;
4144
+ green = green.length === 1 ? '0' + green : green;
4145
+ blue = blue.length === 1 ? '0' + blue : blue;
4146
+ return '#' + red + green + blue;
4147
+ };
4148
+
4149
+ /**
4150
+ * mixColor
4151
+ * @desc:生成混合色
4152
+ * @author huangbo
4153
+ * @date 2022年5月7日
4154
+ * @param {string} [$color1] - 颜色值
4155
+ * @param {string} [$color2] - 颜色值
4156
+ * @param {string} [$n] - 百分比 0~1
4157
+ **/
4158
+ var mixColor = function mixColor($color1, $color2, $n) {
4159
+ var rgb1 = getRgb($color1);
4160
+ var rgb2 = getRgb($color2);
4161
+ var r = rgb1[0] * $n + rgb2[0] * (1 - $n);
4162
+ var g = rgb1[1] * $n + rgb2[1] * (1 - $n);
4163
+ var b = rgb1[2] * $n + rgb2[2] * (1 - $n);
4164
+ return '#' + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
4165
+ };
4166
+
4167
+ /**
4168
+ * getRgb
4169
+ * @desc:获取颜色值的rgb值
4170
+ * @author huangbo
4171
+ * @date 2022年5月7日
4172
+ * @param {string} [$color] - 颜色值
4173
+ **/
4174
+ var getRgb = function getRgb($color) {
4175
+ var rgb = [];
4176
+ // 16进制颜色值的正则
4177
+ var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
4178
+ // 把颜色值变成小写
4179
+ $color = $color.toLowerCase();
4180
+ if (reg.test($color)) {
4181
+ // 如果只有三位的值,需变成六位,如:#fff => #ffffff
4182
+ if ($color.length === 4) {
4183
+ var colorNew = '#';
4184
+ for (var i = 1; i < 4; i++) {
4185
+ colorNew += $color.slice(i, i + 1).concat($color.slice(i, i + 1));
4186
+ }
4187
+ $color = colorNew;
4188
+ }
4189
+ // 处理六位的颜色值,转为RGB
4190
+ for (var _i = 1; _i < 7; _i += 2) {
4191
+ rgb.push(parseInt('0x' + $color.slice(_i, _i + 2), 16));
4192
+ }
4193
+ } else {
4194
+ rgb = $color.replace(/(?:\(|\)|rgb|RGB)*/g, '').split(',');
4195
+ }
4196
+ return rgb;
4197
+ };
4198
+
4199
+ /***/ }),
4200
+
4201
+ /***/ 15:
4202
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4203
+
4204
+ "use strict";
4205
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getScrollbarWidth; });
4206
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return scrollIntoView; });
4207
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getScrollSize; });
4208
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return scrollMove; });
4209
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
4210
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
4211
+
4212
+
4213
+ /**
4214
+ * 缓存变量,用于存储计算过的滚动条宽度
4215
+ */
4216
+ var scrollBarWidth = void 0;
4217
+
5691
4218
  /**
5692
- * 获取月份中的日期
5693
- * @param {string} date - 日期字符串,格式为 "YYYY-MM-DD"
5694
- * @returns {number} 月份中的日期(1-31)
5695
- */
5696
- const dayOfMonth = function (date) {
5697
- if (typeof date !== 'string') {
5698
- throw new Error(
5699
- "Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD'."
5700
- );
5701
- }
5702
-
5703
- const dateObj = new Date(date);
5704
- if (isNaN(dateObj.getTime())) {
5705
- throw new Error(
5706
- "Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'."
5707
- );
5708
- }
5709
-
5710
- return dateObj.getDate();
5711
- };
5712
-
4219
+ * 计算并返回浏览器滚动条的宽度
4220
+ * @returns {number} 滚动条宽度(像素)
4221
+ */
4222
+ var getScrollbarWidth = function getScrollbarWidth() {
4223
+ // 服务器端渲染时返回0
4224
+ if (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) return 0;
4225
+ // 如果已经计算过,直接返回缓存值
4226
+ if (scrollBarWidth !== undefined) return scrollBarWidth;
4227
+
4228
+ // 创建测试元素
4229
+ var outer = document.createElement('div');
4230
+ outer.className = 'es-scrollbar__wrap';
4231
+ outer.style.visibility = 'hidden';
4232
+ outer.style.width = '100px';
4233
+ outer.style.position = 'absolute';
4234
+ outer.style.top = '-9999px';
4235
+ document.body.appendChild(outer);
4236
+
4237
+ // 计算无滚动条时的宽度
4238
+ var widthNoScroll = outer.offsetWidth;
4239
+ outer.style.overflow = 'scroll';
4240
+
4241
+ // 创建内部元素并计算有滚动条时的宽度
4242
+ var inner = document.createElement('div');
4243
+ inner.style.width = '100%';
4244
+ outer.appendChild(inner);
4245
+
4246
+ var widthWithScroll = inner.offsetWidth;
4247
+ // 清理DOM
4248
+ outer.parentNode.removeChild(outer);
4249
+ // 计算滚动条宽度
4250
+ scrollBarWidth = widthNoScroll - widthWithScroll;
4251
+
4252
+ return scrollBarWidth;
4253
+ };
4254
+
5713
4255
  /**
5714
- * 获取当前日期
5715
- * @date 2022年5月7日
5716
- * @param {string} format - 日期格式,默认为'YYYY-MM-DD'
5717
- * @returns {string} 当前日期的格式化字符串
5718
- */
5719
- const getCurrentDate = function (format = 'YYYY-MM-DD') {
5720
- return formatDate(new Date(), format);
5721
- };
5722
-
4256
+ * 将指定元素滚动到容器视图中
4257
+ * @param {HTMLElement} container - 容器元素
4258
+ * @param {HTMLElement} selected - 要滚动到视图中的元素
4259
+ * @example
4260
+ * // 用法示例
4261
+ * const container = document.querySelector('.container');
4262
+ * const element = document.querySelector('.target-element');
4263
+ * scrollIntoView(container, element);
4264
+ */
4265
+ function scrollIntoView(container, selected) {
4266
+ // 服务器端渲染时不执行
4267
+ if (vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer) return;
4268
+
4269
+ // 如果没有指定元素,滚动到顶部
4270
+ if (!selected) {
4271
+ container.scrollTop = 0;
4272
+ return;
4273
+ }
4274
+
4275
+ // 收集所有偏移父元素
4276
+ var offsetParents = [];
4277
+ var pointer = selected.offsetParent;
4278
+ while (pointer && container !== pointer && container.contains(pointer)) {
4279
+ offsetParents.push(pointer);
4280
+ pointer = pointer.offsetParent;
4281
+ }
4282
+
4283
+ // 计算元素相对于容器的顶部偏移量
4284
+ var top = selected.offsetTop + offsetParents.reduce(function (prev, curr) {
4285
+ return prev + curr.offsetTop;
4286
+ }, 0);
4287
+ var bottom = top + selected.offsetHeight;
4288
+ var viewRectTop = container.scrollTop;
4289
+ var viewRectBottom = viewRectTop + container.clientHeight;
4290
+
4291
+ // 调整滚动位置使元素可见
4292
+ if (top < viewRectTop) {
4293
+ container.scrollTop = top;
4294
+ } else if (bottom > viewRectBottom) {
4295
+ container.scrollTop = bottom - container.clientHeight;
4296
+ }
4297
+ }
4298
+
4299
+ // 获取滚动条大小
4300
+ function getScrollSize(wrap) {
4301
+ if (!wrap) {
4302
+ return { width: '', height: '' };
4303
+ };
4304
+ var heightPercentage = 0;
4305
+ var widthPercentage = 0;
4306
+
4307
+ // 修复滚动条尺寸计算逻辑
4308
+ var scrollHeight = wrap.scrollHeight;
4309
+ var scrollWidth = wrap.scrollWidth;
4310
+ var clientHeight = wrap.clientHeight;
4311
+ var clientWidth = wrap.clientWidth;
4312
+ var sizes = {
4313
+ width: '',
4314
+ height: ''
4315
+ };
4316
+ // 只有当内容高度超过容器高度时才显示垂直滚动条
4317
+ if (scrollHeight > clientHeight) {
4318
+ heightPercentage = clientHeight * 100 / scrollHeight;
4319
+ sizes.height = heightPercentage < 100 ? heightPercentage + '%' : '100%';
4320
+ } else {
4321
+ sizes.height = '';
4322
+ }
4323
+
4324
+ // 只有当内容宽度超过容器宽度时才显示水平滚动条
4325
+ if (scrollWidth > clientWidth) {
4326
+ widthPercentage = clientWidth * 100 / scrollWidth;
4327
+ sizes.width = widthPercentage < 100 ? widthPercentage + '%' : '100%';
4328
+ } else {
4329
+ sizes.width = '';
4330
+ }
4331
+ return sizes;
4332
+ }
4333
+
4334
+ // 滚动条移动
4335
+ function scrollMove(wrap) {
4336
+ if (!wrap) return;
4337
+
4338
+ // 立即更新滚动条位置,不使用阈值判断
4339
+ var y = wrap.scrollTop * 100 / wrap.clientHeight;
4340
+ var x = wrap.scrollLeft * 100 / wrap.clientWidth;
4341
+ return { y: y, x: x };
4342
+ }
4343
+
4344
+ /***/ }),
4345
+
4346
+ /***/ 16:
4347
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4348
+
4349
+ "use strict";
4350
+ /* harmony default export */ __webpack_exports__["a"] = (function (target) {
4351
+ for (var i = 1, j = arguments.length; i < j; i++) {
4352
+ var source = arguments[i] || {};
4353
+ for (var prop in source) {
4354
+ if (source.hasOwnProperty(prop)) {
4355
+ var value = source[prop];
4356
+ if (value !== undefined) {
4357
+ target[prop] = value;
4358
+ }
4359
+ }
4360
+ }
4361
+ }
4362
+
4363
+ return target;
4364
+ });;
4365
+
4366
+ /***/ }),
4367
+
4368
+ /***/ 175:
4369
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4370
+
4371
+ "use strict";
4372
+ // ESM COMPAT FLAG
4373
+ __webpack_require__.r(__webpack_exports__);
4374
+
4375
+ // EXTERNAL MODULE: external "vue"
4376
+ var external_vue_ = __webpack_require__(4);
4377
+ var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
4378
+
4379
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/message/src/main.vue?vue&type=template&id=7cefbaa1&
4380
+ var render = function () {
4381
+ var _vm = this
4382
+ var _h = _vm.$createElement
4383
+ var _c = _vm._self._c || _h
4384
+ return _c(
4385
+ "transition",
4386
+ {
4387
+ attrs: { name: "es-message-fade" },
4388
+ on: { "after-leave": _vm.handleAfterLeave },
4389
+ },
4390
+ [
4391
+ _c(
4392
+ "div",
4393
+ {
4394
+ directives: [
4395
+ {
4396
+ name: "show",
4397
+ rawName: "v-show",
4398
+ value: _vm.visible,
4399
+ expression: "visible",
4400
+ },
4401
+ ],
4402
+ class: [
4403
+ "es-message",
4404
+ _vm.type && !_vm.iconClass ? "es-message--" + _vm.type : "",
4405
+ _vm.center ? "is-center" : "",
4406
+ _vm.showClose ? "is-closable" : "",
4407
+ _vm.customClass,
4408
+ ],
4409
+ style: _vm.positionStyle,
4410
+ attrs: { role: "alert" },
4411
+ on: { mouseenter: _vm.clearTimer, mouseleave: _vm.startTimer },
4412
+ },
4413
+ [
4414
+ _vm.iconClass
4415
+ ? _c("i", { class: _vm.iconClass })
4416
+ : _c("i", { class: _vm.typeClass }),
4417
+ _vm._t("default", function () {
4418
+ return [
4419
+ !_vm.dangerouslyUseHTMLString
4420
+ ? _c("p", { staticClass: "es-message__content" }, [
4421
+ _vm._v("\n " + _vm._s(_vm.message) + "\n "),
4422
+ ])
4423
+ : _c("p", {
4424
+ staticClass: "es-message__content",
4425
+ domProps: { innerHTML: _vm._s(_vm.message) },
4426
+ }),
4427
+ ]
4428
+ }),
4429
+ _vm.showClose
4430
+ ? _c("i", {
4431
+ staticClass: "es-message__closeBtn es-icon-guanbi",
4432
+ on: { click: _vm.close },
4433
+ })
4434
+ : _vm._e(),
4435
+ ],
4436
+ 2
4437
+ ),
4438
+ ]
4439
+ )
4440
+ }
4441
+ var staticRenderFns = []
4442
+ render._withStripped = true
4443
+
4444
+
4445
+ // CONCATENATED MODULE: ./packages/message/src/main.vue?vue&type=template&id=7cefbaa1&
4446
+
4447
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/message/src/main.vue?vue&type=script&lang=js&
4448
+ //
4449
+ //
4450
+ //
4451
+ //
4452
+ //
4453
+ //
4454
+ //
4455
+ //
4456
+ //
4457
+ //
4458
+ //
4459
+ //
4460
+ //
4461
+ //
4462
+ //
4463
+ //
4464
+ //
4465
+ //
4466
+ //
4467
+ //
4468
+ //
4469
+ //
4470
+ //
4471
+ //
4472
+ //
4473
+ //
4474
+ //
4475
+ //
4476
+ //
4477
+ //
4478
+ //
4479
+ //
4480
+ //
4481
+
4482
+ /**
4483
+ * 消息提示组件
4484
+ * 用于主动操作后的反馈提示,从顶部出现,可自动消失
4485
+ */
4486
+ var typeMap = {
4487
+ success: 'success',
4488
+ info: 'info',
4489
+ warning: 'warning',
4490
+ error: 'error'
4491
+ };
4492
+
4493
+ /* harmony default export */ var mainvue_type_script_lang_js_ = ({
4494
+ data: function data() {
4495
+ return {
4496
+ /**
4497
+ * 消息是否可见
4498
+ */
4499
+ visible: false,
4500
+ /**
4501
+ * 消息文字
4502
+ */
4503
+ message: '',
4504
+ /**
4505
+ * 显示时间,毫秒。设为0则不会自动关闭
4506
+ */
4507
+ duration: 3000,
4508
+ /**
4509
+ * 主题类型
4510
+ */
4511
+ type: 'info',
4512
+ /**
4513
+ * 自定义图标的类名,会覆盖type
4514
+ */
4515
+ iconClass: '',
4516
+ /**
4517
+ * 自定义类名
4518
+ */
4519
+ customClass: '',
4520
+ /**
4521
+ * 关闭时的回调函数
4522
+ */
4523
+ onClose: null,
4524
+ /**
4525
+ * 是否显示关闭按钮
4526
+ */
4527
+ showClose: false,
4528
+ /**
4529
+ * 是否已关闭
4530
+ */
4531
+ closed: false,
4532
+ /**
4533
+ * 垂直偏移量
4534
+ */
4535
+ verticalOffset: 20,
4536
+ /**
4537
+ * 定时器
4538
+ */
4539
+ timer: null,
4540
+ /**
4541
+ * 是否将message作为HTML片段处理
4542
+ */
4543
+ dangerouslyUseHTMLString: false,
4544
+ /**
4545
+ * 文字是否居中
4546
+ */
4547
+ center: false
4548
+ };
4549
+ },
4550
+
4551
+
4552
+ computed: {
4553
+ typeClass: function typeClass() {
4554
+ return this.type && !this.iconClass ? 'es-message__icon es-icon-' + typeMap[this.type] : '';
4555
+ },
4556
+ positionStyle: function positionStyle() {
4557
+ return {
4558
+ top: this.verticalOffset + 'px'
4559
+ };
4560
+ }
4561
+ },
4562
+
4563
+ watch: {
4564
+ closed: function closed(newVal) {
4565
+ if (newVal) {
4566
+ this.visible = false;
4567
+ }
4568
+ }
4569
+ },
4570
+
4571
+ methods: {
4572
+ /**
4573
+ * 离开动画结束后的处理
4574
+ */
4575
+ handleAfterLeave: function handleAfterLeave() {
4576
+ this.$destroy(true);
4577
+ this.$el.parentNode.removeChild(this.$el);
4578
+ },
4579
+
4580
+
4581
+ /**
4582
+ * 关闭消息
4583
+ */
4584
+ close: function close() {
4585
+ this.closed = true;
4586
+ if (typeof this.onClose === 'function') {
4587
+ this.onClose(this);
4588
+ }
4589
+ },
4590
+
4591
+
4592
+ /**
4593
+ * 清除定时器
4594
+ */
4595
+ clearTimer: function clearTimer() {
4596
+ clearTimeout(this.timer);
4597
+ },
4598
+
4599
+
4600
+ /**
4601
+ * 开始定时器
4602
+ */
4603
+ startTimer: function startTimer() {
4604
+ var _this = this;
4605
+
4606
+ if (this.duration > 0) {
4607
+ this.timer = setTimeout(function () {
4608
+ if (!_this.closed) {
4609
+ _this.close();
4610
+ }
4611
+ }, this.duration);
4612
+ }
4613
+ },
4614
+
4615
+
4616
+ /**
4617
+ * 键盘事件处理
4618
+ * @param {Event} e - 键盘事件对象
4619
+ */
4620
+ keydown: function keydown(e) {
4621
+ if (e.keyCode === 27) {
4622
+ // esc关闭消息
4623
+ if (!this.closed) {
4624
+ this.close();
4625
+ }
4626
+ }
4627
+ }
4628
+ },
4629
+ mounted: function mounted() {
4630
+ this.startTimer();
4631
+ document.addEventListener('keydown', this.keydown);
4632
+ },
4633
+ beforeDestroy: function beforeDestroy() {
4634
+ document.removeEventListener('keydown', this.keydown);
4635
+ }
4636
+ });
4637
+ // CONCATENATED MODULE: ./packages/message/src/main.vue?vue&type=script&lang=js&
4638
+ /* harmony default export */ var src_mainvue_type_script_lang_js_ = (mainvue_type_script_lang_js_);
4639
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
4640
+ var componentNormalizer = __webpack_require__(3);
4641
+
4642
+ // CONCATENATED MODULE: ./packages/message/src/main.vue
4643
+
4644
+
4645
+
4646
+
4647
+
4648
+ /* normalize component */
4649
+
4650
+ var component = Object(componentNormalizer["a" /* default */])(
4651
+ src_mainvue_type_script_lang_js_,
4652
+ render,
4653
+ staticRenderFns,
4654
+ false,
4655
+ null,
4656
+ null,
4657
+ null
4658
+
4659
+ )
4660
+
4661
+ /* harmony default export */ var main = (component.exports);
4662
+ // EXTERNAL MODULE: ./src/utils/popup/index.js + 1 modules
4663
+ var popup = __webpack_require__(23);
4664
+
4665
+ // EXTERNAL MODULE: ./src/utils/vdom.js
4666
+ var vdom = __webpack_require__(85);
4667
+
4668
+ // CONCATENATED MODULE: ./packages/message/src/main.js
4669
+ /**
4670
+ * 消息提示组件
4671
+ * 用于主动操作后的反馈提示,从顶部出现,可自动消失
4672
+ */
4673
+
4674
+
4675
+
4676
+
4677
+ var MessageConstructor = external_vue_default.a.extend(main);
4678
+
4679
+ var instance = void 0;
4680
+ var instances = [];
4681
+ var seed = 1;
4682
+
4683
+ /**
4684
+ * 创建消息提示
4685
+ * @param {Object|string} options - 配置项或消息文字
4686
+ * @param {string} [options.message] - 消息文字
4687
+ * @param {string} [options.type=info] - 主题类型
4688
+ * @param {number} [options.duration=3000] - 显示时间,毫秒。设为0则不会自动关闭
4689
+ * @param {string} [options.iconClass] - 自定义图标的类名,会覆盖type
4690
+ * @param {boolean} [options.dangerouslyUseHTMLString=false] - 是否将message作为HTML片段处理
4691
+ * @param {string} [options.customClass] - 自定义类名
4692
+ * @param {boolean} [options.showClose=false] - 是否显示关闭按钮
4693
+ * @param {boolean} [options.center=false] - 文字是否居中
4694
+ * @param {function} [options.onClose] - 关闭时的回调函数
4695
+ * @param {number} [options.offset=20] - Message距离窗口顶部的偏移量
4696
+ * @returns {Object} Message实例
4697
+ */
4698
+ var main_Message = function Message(options) {
4699
+ if (external_vue_default.a.prototype.$isServer) return;
4700
+ options = options || {};
4701
+ if (typeof options === 'string') {
4702
+ options = {
4703
+ message: options
4704
+ };
4705
+ }
4706
+ var userOnClose = options.onClose;
4707
+ var id = 'message_' + seed++;
4708
+
4709
+ options.onClose = function () {
4710
+ Message.close(id, userOnClose);
4711
+ };
4712
+ instance = new MessageConstructor({
4713
+ data: options
4714
+ });
4715
+ instance.id = id;
4716
+ if (Object(vdom["a" /* isVNode */])(instance.message)) {
4717
+ instance.$slots.default = [instance.message];
4718
+ instance.message = null;
4719
+ }
4720
+ instance.$mount();
4721
+ document.body.appendChild(instance.$el);
4722
+ var verticalOffset = options.offset || 20;
4723
+ instances.forEach(function (item) {
4724
+ verticalOffset += item.$el.offsetHeight + 16;
4725
+ });
4726
+ instance.verticalOffset = verticalOffset;
4727
+ instance.visible = true;
4728
+ instance.$el.style.zIndex = popup["a" /* PopupManager */].nextZIndex();
4729
+ instances.push(instance);
4730
+ return instance;
4731
+ };
4732
+
4733
+ ['success', 'warning', 'info', 'error'].forEach(function (type) {
4734
+ main_Message[type] = function (options) {
4735
+ if (typeof options === 'string') {
4736
+ options = {
4737
+ message: options
4738
+ };
4739
+ }
4740
+ options.type = type;
4741
+ return main_Message(options);
4742
+ };
4743
+ });
4744
+
4745
+ /**
4746
+ * 关闭指定的消息
4747
+ * @param {string} id - 消息实例的id
4748
+ * @param {function} userOnClose - 用户自定义的关闭回调函数
4749
+ */
4750
+ main_Message.close = function (id, userOnClose) {
4751
+ var len = instances.length;
4752
+ var index = -1;
4753
+ var removedHeight = void 0;
4754
+ for (var i = 0; i < len; i++) {
4755
+ if (id === instances[i].id) {
4756
+ removedHeight = instances[i].$el.offsetHeight;
4757
+ index = i;
4758
+ if (typeof userOnClose === 'function') {
4759
+ userOnClose(instances[i]);
4760
+ }
4761
+ instances.splice(i, 1);
4762
+ break;
4763
+ }
4764
+ }
4765
+ if (len <= 1 || index === -1 || index > instances.length - 1) return;
4766
+ for (var _i = index; _i < len - 1; _i++) {
4767
+ var dom = instances[_i].$el;
4768
+ dom.style['top'] = parseInt(dom.style['top'], 10) - removedHeight - 16 + 'px';
4769
+ }
4770
+ };
4771
+
4772
+ /**
4773
+ * 关闭所有消息
4774
+ */
4775
+ main_Message.closeAll = function () {
4776
+ for (var i = instances.length - 1; i >= 0; i--) {
4777
+ instances[i].close();
4778
+ }
4779
+ };
4780
+
4781
+ /* harmony default export */ var src_main = (main_Message);
4782
+ // CONCATENATED MODULE: ./packages/message/index.js
4783
+
4784
+ /* harmony default export */ var message = __webpack_exports__["default"] = (src_main);
4785
+
4786
+ /***/ }),
4787
+
4788
+ /***/ 19:
4789
+ /***/ (function(module, exports) {
4790
+
4791
+ module.exports = require("eoss/lib/loading");
4792
+
4793
+ /***/ }),
4794
+
4795
+ /***/ 2:
4796
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4797
+
4798
+ "use strict";
4799
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return setStorage; });
4800
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getStorage; });
4801
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return removeStorage; });
4802
+ /* unused harmony export setCookie */
4803
+ /* unused harmony export getCookie */
4804
+ 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; };
4805
+
4806
+ /**
4807
+ * setStorage
4808
+ * @desc:设置本地储存数据
4809
+ * @author huangbo
4810
+ * @date 2022年5月7日
4811
+ * @param {String|Object} [key] - 数据的名称或包含type、key、value的对象
4812
+ * @param {String} [value] - 数据的值(当第一个参数为字符串时使用)
4813
+ **/
4814
+ var setStorage = function setStorage(key, value) {
4815
+ // 解析参数,支持两种调用方式:setStorage(key, value) 和 setStorage({type, key, value})
4816
+ var type = void 0,
4817
+ finalKey = void 0,
4818
+ finalValue = void 0;
4819
+
4820
+ if ((typeof key === 'undefined' ? 'undefined' : _typeof(key)) === 'object' && key !== null) {
4821
+ // 对象调用方式:setStorage({type, key, value})
4822
+ type = key.type;
4823
+ finalKey = key.key;
4824
+ finalValue = key.value;
4825
+ } else {
4826
+ // 字符串调用方式:setStorage(key, value)
4827
+ type = getStorage('storageType');
4828
+ finalKey = key;
4829
+ finalValue = value;
4830
+ }
4831
+
4832
+ // 使用默认存储类型如果未指定
4833
+ type = type || getStorage('storageType');
4834
+
4835
+ // 获取存储对象
4836
+ var storage = type === 'localStorage' ? localStorage : sessionStorage;
4837
+
4838
+ // 处理不同类型的key
4839
+ if (typeof finalKey === 'string') {
4840
+ // 单个字符串key
4841
+ var storedValue = (typeof finalValue === 'undefined' ? 'undefined' : _typeof(finalValue)) === 'object' ? JSON.stringify(finalValue) : finalValue;
4842
+ storage.setItem(finalKey, storedValue);
4843
+ if (finalKey === 'token') {
4844
+ setCookie('token', storedValue);
4845
+ }
4846
+ } else if (Array.isArray(finalKey)) {
4847
+ // 数组key,为多个key设置同一个value
4848
+ var _storedValue = (typeof finalValue === 'undefined' ? 'undefined' : _typeof(finalValue)) === 'object' ? JSON.stringify(finalValue) : finalValue;
4849
+ for (var i = 0; i < finalKey.length; i++) {
4850
+ storage.setItem(finalKey[i], _storedValue);
4851
+ if (finalKey[i] === 'token') {
4852
+ setCookie('token', _storedValue);
4853
+ }
4854
+ }
4855
+ } else if ((typeof finalKey === 'undefined' ? 'undefined' : _typeof(finalKey)) === 'object' && finalKey !== null) {
4856
+ // 对象key,对象的属性名称作为key,属性值作为value
4857
+ for (var k in finalKey) {
4858
+ if (Object.prototype.hasOwnProperty.call(finalKey, k)) {
4859
+ var _storedValue2 = _typeof(finalKey[k]) === 'object' ? JSON.stringify(finalKey[k]) : finalKey[k];
4860
+ storage.setItem(k, _storedValue2);
4861
+ if (k === 'token') {
4862
+ setCookie('token', _storedValue2);
4863
+ }
4864
+ }
4865
+ }
4866
+ }
4867
+ };
4868
+
4869
+ /**
4870
+ * getStorage
4871
+ * @desc:获取本地储存数据
4872
+ * @author huangbo
4873
+ * @date 2022年5月7日
4874
+ * @param {String} [key] - 获取的名称
4875
+ **/
4876
+ var getStorage = function getStorage(key) {
4877
+ if (key) {
4878
+ var res = sessionStorage.getItem(key) || localStorage.getItem(key);
4879
+ if (!res && key === 'token') {
4880
+ res = getCookie('token');
4881
+ }
4882
+ if (key === 'host' && !res) {
4883
+ res = '';
4884
+ }
4885
+ return res;
4886
+ }
4887
+ var defaults = {};
4888
+ var token = sessionStorage.getItem('token') || localStorage.getItem('token') || getCookie('token');
4889
+ var ssId = sessionStorage.getItem('ssId') || localStorage.getItem('ssId') || getCookie('ssId');
4890
+
4891
+ var deviceUnique = sessionStorage.getItem('deviceUnique') || localStorage.getItem('deviceUnique') || getCookie('deviceUnique');
4892
+ if (token) {
4893
+ defaults.Authorization = token;
4894
+ }
4895
+ if (ssId) {
4896
+ defaults.ssId = ssId;
4897
+ }
4898
+ if (deviceUnique) {
4899
+ defaults.deviceUnique = deviceUnique;
4900
+ }
4901
+ return defaults;
4902
+ };
4903
+
4904
+ /**
4905
+ * removeStorage
4906
+ * @desc:删除本地储存数据
4907
+ * @author huangbo
4908
+ * @date 2022年5月7日
4909
+ * @param {String, Array} [key] - 获取的名称
4910
+ **/
4911
+ var removeStorage = function removeStorage(key) {
4912
+ if (Array.isArray(key)) {
4913
+ for (var i = 0; i < key.length; i++) {
4914
+ sessionStorage.removeItem(key[i]);
4915
+ localStorage.removeItem(key[i]);
4916
+ if (key[i] === 'token') {
4917
+ removeCookie('token');
4918
+ }
4919
+ }
4920
+ } else if (key) {
4921
+ sessionStorage.removeItem(key);
4922
+ localStorage.removeItem(key);
4923
+ if (key === 'token') {
4924
+ removeCookie('token');
4925
+ }
4926
+ } else {
4927
+ sessionStorage.clear();
4928
+ localStorage.clear();
4929
+ removeCookie('token');
4930
+ }
4931
+ };
4932
+
4933
+ /**
4934
+ * setCookie
4935
+ * @desc 设置cookie
4936
+ * @author huangbo
4937
+ * @param {string} [name] cookie名称
4938
+ * @param {string} [value] cookie值
4939
+ * @param {boolean} [isSession] 是否是会话cookie
4940
+ **/
4941
+ var setCookie = function setCookie(name, value) {
4942
+ var isSession = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
4943
+ var time = arguments[3];
4944
+
4945
+ try {
4946
+ var cookieParts = [encodeURIComponent(name) + '=' + encodeURIComponent(value), 'path=/' // 仅保留path设置,确保全站访问
4947
+ ];
4948
+ // 会话/持久Cookie设置
4949
+ if (!isSession) {
4950
+ if (/MSIE|Trident/.test(navigator.userAgent)) {
4951
+ // IE使用expires
4952
+ var date = new Date();
4953
+ date.setTime(date.getTime() + (time || 7 * 24 * 60 * 60 * 1000));
4954
+ cookieParts.push('expires=' + date.toUTCString());
4955
+ } else {
4956
+ // 其他浏览器使用max-age
4957
+ cookieParts.push('max-age=' + (time || 7 * 24 * 60 * 60));
4958
+ }
4959
+ }
4960
+ // 内核兼容处理
4961
+ if (/MSIE|Trident/.test(navigator.userAgent)) {
4962
+ // IE特殊处理:添加P3P协议头
4963
+ cookieParts.push('P3P=CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
4964
+ } else {
4965
+ // 现代浏览器设置
4966
+ cookieParts.push('samesite=lax');
4967
+ if (window.location.protocol === 'https:') {
4968
+ cookieParts.push('secure');
4969
+ }
4970
+ }
4971
+
4972
+ // 设置Cookie
4973
+ document.cookie = cookieParts.join('; ');
4974
+ return true;
4975
+ } catch (e) {
4976
+ console.error('Cookie设置失败:', e);
4977
+ return false;
4978
+ }
4979
+ };
4980
+
4981
+ /**
4982
+ * getCookie
4983
+ * @desc 获取cookie中指定名称的值
4984
+ * @author huangbo
4985
+ * @param {string} [name] cookie名称
4986
+ **/
4987
+ var getCookie = function getCookie(name) {
4988
+ var cookies = document.cookie.split(';');
4989
+ for (var _iterator = cookies, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
4990
+ var _ref;
4991
+
4992
+ if (_isArray) {
4993
+ if (_i >= _iterator.length) break;
4994
+ _ref = _iterator[_i++];
4995
+ } else {
4996
+ _i = _iterator.next();
4997
+ if (_i.done) break;
4998
+ _ref = _i.value;
4999
+ }
5000
+
5001
+ var cookie = _ref;
5002
+
5003
+ var _cookie$trim$split = cookie.trim().split('='),
5004
+ cookieName = _cookie$trim$split[0],
5005
+ cookieValue = _cookie$trim$split[1];
5006
+
5007
+ if (decodeURIComponent(cookieName) === name) {
5008
+ return decodeURIComponent(cookieValue);
5009
+ }
5010
+ }
5011
+ return null;
5012
+ };
5013
+
5014
+ /**
5015
+ * removeCookie
5016
+ * @desc:删除cookie
5017
+ * @author huangbo
5018
+ * @date 2022年5月7日
5019
+ * @param {String, Array} [key] - 获取的名称
5020
+ **/
5021
+ var removeCookie = function removeCookie(key) {
5022
+ if (Array.isArray(key)) {
5023
+ for (var i = 0; i < key.length; i++) {
5024
+ document.cookie = encodeURIComponent(key[i]) + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
5025
+ }
5026
+ } else {
5027
+ document.cookie = encodeURIComponent(key) + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
5028
+ }
5029
+ };
5030
+
5031
+ /***/ }),
5032
+
5033
+ /***/ 20:
5034
+ /***/ (function(module, exports) {
5035
+
5036
+ module.exports = require("lodash/get");
5037
+
5038
+ /***/ }),
5039
+
5040
+ /***/ 21:
5041
+ /***/ (function(module, exports) {
5042
+
5043
+ module.exports = require("lodash/set");
5044
+
5045
+ /***/ }),
5046
+
5047
+ /***/ 22:
5048
+ /***/ (function(module, exports) {
5049
+
5050
+ module.exports = require("lodash/cloneDeep");
5051
+
5052
+ /***/ }),
5053
+
5054
+ /***/ 23:
5055
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
5056
+
5057
+ "use strict";
5058
+
5059
+ // EXPORTS
5060
+ __webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ popup_manager; });
5061
+
5062
+ // EXTERNAL MODULE: external "vue"
5063
+ var external_vue_ = __webpack_require__(4);
5064
+ var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
5065
+
5066
+ // EXTERNAL MODULE: ./src/utils/merge.js
5067
+ var merge = __webpack_require__(16);
5068
+
5069
+ // EXTERNAL MODULE: ./src/utils/dom.js
5070
+ var utils_dom = __webpack_require__(5);
5071
+
5072
+ // CONCATENATED MODULE: ./src/utils/popup/popup-manager.js
5073
+
5074
+
5075
+
5076
+ var hasModal = false;
5077
+ var hasInitZIndex = false;
5078
+ var popup_manager_zIndex = void 0;
5079
+
5080
+ var popup_manager_getModal = function getModal() {
5081
+ if (external_vue_default.a.prototype.$isServer) return;
5082
+ var modalDom = PopupManager.modalDom;
5083
+ if (modalDom) {
5084
+ hasModal = true;
5085
+ } else {
5086
+ hasModal = false;
5087
+ modalDom = document.createElement('div');
5088
+ PopupManager.modalDom = modalDom;
5089
+
5090
+ modalDom.addEventListener('touchmove', function (event) {
5091
+ event.preventDefault();
5092
+ event.stopPropagation();
5093
+ });
5094
+
5095
+ modalDom.addEventListener('click', function () {
5096
+ PopupManager.doOnModalClick && PopupManager.doOnModalClick();
5097
+ });
5098
+ }
5099
+
5100
+ return modalDom;
5101
+ };
5102
+
5103
+ var instances = {};
5104
+
5105
+ var PopupManager = {
5106
+ modalFade: true,
5107
+
5108
+ getInstance: function getInstance(id) {
5109
+ return instances[id];
5110
+ },
5111
+
5112
+ register: function register(id, instance) {
5113
+ if (id && instance) {
5114
+ instances[id] = instance;
5115
+ }
5116
+ },
5117
+
5118
+ deregister: function deregister(id) {
5119
+ if (id) {
5120
+ instances[id] = null;
5121
+ delete instances[id];
5122
+ }
5123
+ },
5124
+
5125
+ nextZIndex: function nextZIndex() {
5126
+ return PopupManager.zIndex++;
5127
+ },
5128
+
5129
+ modalStack: [],
5130
+
5131
+ doOnModalClick: function doOnModalClick() {
5132
+ var topItem = PopupManager.modalStack[PopupManager.modalStack.length - 1];
5133
+ if (!topItem) return;
5134
+
5135
+ var instance = PopupManager.getInstance(topItem.id);
5136
+ if (instance && instance.closeOnClickModal) {
5137
+ instance.close();
5138
+ }
5139
+ },
5140
+
5141
+ openModal: function openModal(id, zIndex, dom, modalClass, modalFade) {
5142
+ if (external_vue_default.a.prototype.$isServer) return;
5143
+ if (!id || zIndex === undefined) return;
5144
+ this.modalFade = modalFade;
5145
+
5146
+ var modalStack = this.modalStack;
5147
+
5148
+ for (var i = 0, j = modalStack.length; i < j; i++) {
5149
+ var item = modalStack[i];
5150
+ if (item.id === id) {
5151
+ return;
5152
+ }
5153
+ }
5154
+
5155
+ var modalDom = popup_manager_getModal();
5156
+
5157
+ Object(utils_dom["a" /* addClass */])(modalDom, 'v-modal');
5158
+ if (this.modalFade && !hasModal) {
5159
+ Object(utils_dom["a" /* addClass */])(modalDom, 'v-modal-enter');
5160
+ }
5161
+ if (modalClass) {
5162
+ var classArr = modalClass.trim().split(/\s+/);
5163
+ classArr.forEach(function (item) {
5164
+ return Object(utils_dom["a" /* addClass */])(modalDom, item);
5165
+ });
5166
+ }
5167
+ setTimeout(function () {
5168
+ Object(utils_dom["i" /* removeClass */])(modalDom, 'v-modal-enter');
5169
+ }, 200);
5170
+
5171
+ if (dom && dom.parentNode && dom.parentNode.nodeType !== 11) {
5172
+ dom.parentNode.appendChild(modalDom);
5173
+ } else {
5174
+ document.body.appendChild(modalDom);
5175
+ }
5176
+
5177
+ if (zIndex) {
5178
+ modalDom.style.zIndex = zIndex;
5179
+ }
5180
+ modalDom.tabIndex = 0;
5181
+ modalDom.style.display = '';
5182
+
5183
+ this.modalStack.push({ id: id, zIndex: zIndex, modalClass: modalClass });
5184
+ },
5185
+
5186
+ closeModal: function closeModal(id) {
5187
+ var modalStack = this.modalStack;
5188
+ var modalDom = popup_manager_getModal();
5189
+ var topItem = null;
5190
+
5191
+ if (modalStack.length > 0) {
5192
+ topItem = modalStack[modalStack.length - 1];
5193
+ if (topItem.id === id) {
5194
+ modalStack.pop();
5195
+ if (modalStack.length > 0) {
5196
+ modalDom.style.zIndex = modalStack[modalStack.length - 1].zIndex;
5197
+ }
5198
+ } else {
5199
+ for (var i = modalStack.length - 1; i >= 0; i--) {
5200
+ if (modalStack[i].id === id) {
5201
+ modalStack.splice(i, 1);
5202
+ break;
5203
+ }
5204
+ }
5205
+ }
5206
+ }
5207
+
5208
+ if (modalStack.length === 0) {
5209
+ if (this.modalFade) {
5210
+ Object(utils_dom["a" /* addClass */])(modalDom, 'v-modal-leave');
5211
+ }
5212
+ setTimeout(function () {
5213
+ if (modalStack.length === 0) {
5214
+ if (topItem && topItem.modalClass) {
5215
+ var classArr = topItem.modalClass.trim().split(/\s+/);
5216
+ classArr.forEach(function (item) {
5217
+ return Object(utils_dom["i" /* removeClass */])(modalDom, item);
5218
+ });
5219
+ }
5220
+ if (modalDom.parentNode) modalDom.parentNode.removeChild(modalDom);
5221
+ modalDom.style.display = 'none';
5222
+ PopupManager.modalDom = undefined;
5223
+ }
5224
+ Object(utils_dom["i" /* removeClass */])(modalDom, 'v-modal-leave');
5225
+ }, 200);
5226
+ } else {
5227
+ if (topItem && topItem.modalClass) {
5228
+ var classArr = topItem.modalClass.trim().split(/\s+/);
5229
+ classArr.forEach(function (item) {
5230
+ return Object(utils_dom["i" /* removeClass */])(modalDom, item);
5231
+ });
5232
+ }
5233
+ }
5234
+ }
5235
+ };
5236
+
5237
+ Object.defineProperty(PopupManager, 'zIndex', {
5238
+ configurable: true,
5239
+ get: function get() {
5240
+ if (!hasInitZIndex) {
5241
+ if (!popup_manager_zIndex) {
5242
+ popup_manager_zIndex = popup_manager_zIndex || (external_vue_default.a.prototype.$EOSS || {}).zIndex || 2000;
5243
+ }
5244
+ hasInitZIndex = true;
5245
+ }
5246
+ return popup_manager_zIndex;
5247
+ },
5248
+ set: function set(value) {
5249
+ popup_manager_zIndex = value;
5250
+ }
5251
+ });
5252
+
5253
+ var popup_manager_getTopPopup = function getTopPopup() {
5254
+ if (external_vue_default.a.prototype.$isServer) return;
5255
+ if (PopupManager.modalStack.length > 0) {
5256
+ var topPopup = PopupManager.modalStack[PopupManager.modalStack.length - 1];
5257
+ if (!topPopup) return;
5258
+ var instance = PopupManager.getInstance(topPopup.id);
5259
+
5260
+ return instance;
5261
+ }
5262
+ };
5263
+
5264
+ if (!external_vue_default.a.prototype.$isServer) {
5265
+ // handle `esc` key when the popup is shown
5266
+ window.addEventListener('keydown', function (event) {
5267
+ if (event.keyCode === 27) {
5268
+ var topPopup = popup_manager_getTopPopup();
5269
+
5270
+ if (topPopup && topPopup.closeOnPressEscape) {
5271
+ topPopup.handleClose ? topPopup.handleClose() : topPopup.handleAction ? topPopup.handleAction('cancel') : topPopup.close();
5272
+ }
5273
+ }
5274
+ });
5275
+ }
5276
+
5277
+ /* harmony default export */ var popup_manager = (PopupManager);
5278
+ // EXTERNAL MODULE: ./src/utils/scrollbar.js
5279
+ var scrollbar = __webpack_require__(15);
5280
+
5281
+ // CONCATENATED MODULE: ./src/utils/popup/index.js
5282
+
5283
+
5284
+
5285
+
5286
+
5287
+
5288
+ var idSeed = 1;
5289
+
5290
+ var scrollBarWidth = void 0;
5291
+
5292
+ /* harmony default export */ var popup = __webpack_exports__["b"] = ({
5293
+ props: {
5294
+ visible: {
5295
+ type: Boolean,
5296
+ default: false
5297
+ },
5298
+ openDelay: {},
5299
+ closeDelay: {},
5300
+ zIndex: {},
5301
+ modal: {
5302
+ type: Boolean,
5303
+ default: false
5304
+ },
5305
+ modalFade: {
5306
+ type: Boolean,
5307
+ default: true
5308
+ },
5309
+ modalClass: {},
5310
+ modalAppendToBody: {
5311
+ type: Boolean,
5312
+ default: false
5313
+ },
5314
+ lockScroll: {
5315
+ type: Boolean,
5316
+ default: true
5317
+ },
5318
+ closeOnPressEscape: {
5319
+ type: Boolean,
5320
+ default: false
5321
+ },
5322
+ closeOnClickModal: {
5323
+ type: Boolean,
5324
+ default: false
5325
+ },
5326
+ lazy: {
5327
+ type: Boolean,
5328
+ default: true
5329
+ }
5330
+ },
5331
+
5332
+ beforeMount: function beforeMount() {
5333
+ this._popupId = 'popup-' + idSeed++;
5334
+ popup_manager.register(this._popupId, this);
5335
+ },
5336
+ mounted: function mounted() {
5337
+ var _this = this;
5338
+
5339
+ // 监听组件的 'opened' 事件,在过渡动画完成后设置 rendered = true
5340
+ this.$on('opened', function () {
5341
+ _this.$nextTick(function () {
5342
+ _this.rendered = true;
5343
+ });
5344
+ });
5345
+ },
5346
+ beforeDestroy: function beforeDestroy() {
5347
+ popup_manager.deregister(this._popupId);
5348
+ popup_manager.closeModal(this._popupId);
5349
+
5350
+ this.restoreBodyStyle();
5351
+ },
5352
+ data: function data() {
5353
+ return {
5354
+ opened: false,
5355
+ bodyPaddingRight: null,
5356
+ computedBodyPaddingRight: 0,
5357
+ withoutHiddenClass: true,
5358
+ rendered: !this.lazy
5359
+ };
5360
+ },
5361
+
5362
+
5363
+ watch: {
5364
+ visible: function visible(val) {
5365
+ var _this2 = this;
5366
+
5367
+ if (val) {
5368
+ if (this._opening) return;
5369
+ if (!this.rendered) {
5370
+ external_vue_default.a.nextTick(function () {
5371
+ _this2.open();
5372
+ });
5373
+ } else {
5374
+ this.open();
5375
+ }
5376
+ } else {
5377
+ this.close();
5378
+ }
5379
+ }
5380
+ },
5381
+
5382
+ methods: {
5383
+ open: function open(options) {
5384
+ var _this3 = this;
5385
+
5386
+ var props = Object(merge["a" /* default */])({}, this.$props || this, options);
5387
+
5388
+ if (this._closeTimer) {
5389
+ clearTimeout(this._closeTimer);
5390
+ this._closeTimer = null;
5391
+ }
5392
+ clearTimeout(this._openTimer);
5393
+
5394
+ var openDelay = Number(props.openDelay);
5395
+ if (openDelay > 0) {
5396
+ this._openTimer = setTimeout(function () {
5397
+ _this3._openTimer = null;
5398
+ _this3.doOpen(props);
5399
+ }, openDelay);
5400
+ } else {
5401
+ this.doOpen(props);
5402
+ }
5403
+ },
5404
+ doOpen: function doOpen(props) {
5405
+ if (this.$isServer) return;
5406
+ if (this.willOpen && !this.willOpen()) return;
5407
+ if (this.opened) return;
5408
+
5409
+ this._opening = true;
5410
+
5411
+ var dom = this.$el;
5412
+
5413
+ var modal = props.modal;
5414
+
5415
+ var zIndex = props.zIndex;
5416
+ if (zIndex) {
5417
+ popup_manager.zIndex = zIndex;
5418
+ }
5419
+
5420
+ if (modal) {
5421
+ if (this._closing) {
5422
+ popup_manager.closeModal(this._popupId);
5423
+ this._closing = false;
5424
+ }
5425
+ popup_manager.openModal(this._popupId, popup_manager.nextZIndex(), this.modalAppendToBody ? undefined : dom, props.modalClass, props.modalFade);
5426
+ if (props.lockScroll) {
5427
+ this.withoutHiddenClass = !Object(utils_dom["d" /* hasClass */])(document.body, 'es-popup-parent--hidden');
5428
+ if (this.withoutHiddenClass) {
5429
+ this.bodyPaddingRight = document.body.style.paddingRight;
5430
+ this.computedBodyPaddingRight = parseInt(Object(utils_dom["c" /* getStyle */])(document.body, 'paddingRight'), 10);
5431
+ }
5432
+ scrollBarWidth = Object(scrollbar["b" /* getScrollbarWidth */])();
5433
+ var bodyHasOverflow = document.documentElement.clientHeight < document.body.scrollHeight;
5434
+ var bodyOverflowY = Object(utils_dom["c" /* getStyle */])(document.body, 'overflowY');
5435
+ if (scrollBarWidth > 0 && (bodyHasOverflow || bodyOverflowY === 'scroll') && this.withoutHiddenClass) {
5436
+ document.body.style.paddingRight = this.computedBodyPaddingRight + scrollBarWidth + 'px';
5437
+ }
5438
+ Object(utils_dom["a" /* addClass */])(document.body, 'es-popup-parent--hidden');
5439
+ }
5440
+ }
5441
+
5442
+ if (getComputedStyle(dom).position === 'static') {
5443
+ dom.style.position = 'absolute';
5444
+ }
5445
+
5446
+ dom.style.zIndex = popup_manager.nextZIndex();
5447
+ this.opened = true;
5448
+
5449
+ this.onOpen && this.onOpen();
5450
+
5451
+ this.doAfterOpen();
5452
+ },
5453
+ doAfterOpen: function doAfterOpen() {
5454
+ this._opening = false;
5455
+ },
5456
+ close: function close() {
5457
+ var _this4 = this;
5458
+
5459
+ if (this.willClose && !this.willClose()) return;
5460
+
5461
+ if (this._openTimer !== null) {
5462
+ clearTimeout(this._openTimer);
5463
+ this._openTimer = null;
5464
+ }
5465
+ clearTimeout(this._closeTimer);
5466
+
5467
+ var closeDelay = Number(this.closeDelay);
5468
+
5469
+ if (closeDelay > 0) {
5470
+ this._closeTimer = setTimeout(function () {
5471
+ _this4._closeTimer = null;
5472
+ _this4.doClose();
5473
+ }, closeDelay);
5474
+ } else {
5475
+ this.doClose();
5476
+ }
5477
+ },
5478
+ doClose: function doClose() {
5479
+ this._closing = true;
5480
+
5481
+ this.onClose && this.onClose();
5482
+
5483
+ if (this.lockScroll) {
5484
+ setTimeout(this.restoreBodyStyle, 200);
5485
+ }
5486
+
5487
+ this.opened = false;
5488
+
5489
+ this.doAfterClose();
5490
+ },
5491
+ doAfterClose: function doAfterClose() {
5492
+ popup_manager.closeModal(this._popupId);
5493
+ this._closing = false;
5494
+ },
5495
+ restoreBodyStyle: function restoreBodyStyle() {
5496
+ if (this.modal && this.withoutHiddenClass) {
5497
+ document.body.style.paddingRight = this.bodyPaddingRight;
5498
+ Object(utils_dom["i" /* removeClass */])(document.body, 'es-popup-parent--hidden');
5499
+ }
5500
+ this.withoutHiddenClass = true;
5501
+ }
5502
+ }
5503
+ });
5504
+
5505
+
5506
+
5507
+ /***/ }),
5508
+
5509
+ /***/ 3:
5510
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
5511
+
5512
+ "use strict";
5513
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
5514
+ /* globals __VUE_SSR_CONTEXT__ */
5515
+
5516
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
5517
+ // This module is a runtime utility for cleaner component module output and will
5518
+ // be included in the final webpack user bundle.
5519
+
5520
+ function normalizeComponent(
5521
+ scriptExports,
5522
+ render,
5523
+ staticRenderFns,
5524
+ functionalTemplate,
5525
+ injectStyles,
5526
+ scopeId,
5527
+ moduleIdentifier /* server only */,
5528
+ shadowMode /* vue-cli only */
5529
+ ) {
5530
+ // Vue.extend constructor export interop
5531
+ var options =
5532
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
5533
+
5534
+ // render functions
5535
+ if (render) {
5536
+ options.render = render
5537
+ options.staticRenderFns = staticRenderFns
5538
+ options._compiled = true
5539
+ }
5540
+
5541
+ // functional template
5542
+ if (functionalTemplate) {
5543
+ options.functional = true
5544
+ }
5545
+
5546
+ // scopedId
5547
+ if (scopeId) {
5548
+ options._scopeId = 'data-v-' + scopeId
5549
+ }
5550
+
5551
+ var hook
5552
+ if (moduleIdentifier) {
5553
+ // server build
5554
+ hook = function (context) {
5555
+ // 2.3 injection
5556
+ context =
5557
+ context || // cached call
5558
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
5559
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
5560
+ // 2.2 with runInNewContext: true
5561
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
5562
+ context = __VUE_SSR_CONTEXT__
5563
+ }
5564
+ // inject component styles
5565
+ if (injectStyles) {
5566
+ injectStyles.call(this, context)
5567
+ }
5568
+ // register component module identifier for async chunk inferrence
5569
+ if (context && context._registeredComponents) {
5570
+ context._registeredComponents.add(moduleIdentifier)
5571
+ }
5572
+ }
5573
+ // used by ssr in case component is cached and beforeCreate
5574
+ // never gets called
5575
+ options._ssrRegister = hook
5576
+ } else if (injectStyles) {
5577
+ hook = shadowMode
5578
+ ? function () {
5579
+ injectStyles.call(
5580
+ this,
5581
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
5582
+ )
5583
+ }
5584
+ : injectStyles
5585
+ }
5586
+
5587
+ if (hook) {
5588
+ if (options.functional) {
5589
+ // for template-only hot-reload because in that case the render fn doesn't
5590
+ // go through the normalizer
5591
+ options._injectStyles = hook
5592
+ // register for functional component in vue file
5593
+ var originalRender = options.render
5594
+ options.render = function renderWithStyleInjection(h, context) {
5595
+ hook.call(context)
5596
+ return originalRender(h, context)
5597
+ }
5598
+ } else {
5599
+ // inject component registration as beforeCreate hook
5600
+ var existing = options.beforeCreate
5601
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
5602
+ }
5603
+ }
5604
+
5605
+ return {
5606
+ exports: scriptExports,
5607
+ options: options
5608
+ }
5609
+ }
5610
+
5611
+
5612
+ /***/ }),
5613
+
5614
+ /***/ 4:
5615
+ /***/ (function(module, exports) {
5616
+
5617
+ module.exports = require("vue");
5618
+
5619
+ /***/ }),
5620
+
5621
+ /***/ 5:
5622
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
5623
+
5624
+ "use strict";
5625
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return on; });
5626
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return off; });
5627
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return once; });
5628
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return hasClass; });
5629
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addClass; });
5630
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return removeClass; });
5631
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getStyle; });
5632
+ /* unused harmony export setStyle */
5633
+ /* unused harmony export isScroll */
5634
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getScrollContainer; });
5635
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isInContainer; });
5636
+ /* unused harmony export insertAfter */
5637
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
5638
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
5639
+ 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; };
5640
+
5641
+ /* istanbul ignore next */
5642
+
5643
+
5644
+
5645
+ var isServer = vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer;
5646
+ var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
5647
+ var MOZ_HACK_REGEXP = /^moz([A-Z])/;
5648
+ var ieVersion = isServer ? 0 : Number(document.documentMode);
5649
+
5650
+ /* istanbul ignore next */
5651
+ var trim = function trim(string) {
5652
+ return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
5653
+ };
5654
+ /* istanbul ignore next */
5655
+ var camelCase = function camelCase(name) {
5656
+ return name.replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) {
5657
+ return offset ? letter.toUpperCase() : letter;
5658
+ }).replace(MOZ_HACK_REGEXP, 'Moz$1');
5659
+ };
5660
+
5661
+ /* istanbul ignore next */
5662
+ var on = function () {
5663
+ if (!isServer && document.addEventListener) {
5664
+ return function (element, event, handler) {
5665
+ if (element && event && handler) {
5666
+ element.addEventListener(event, handler, false);
5667
+ }
5668
+ };
5669
+ } else {
5670
+ return function (element, event, handler) {
5671
+ if (element && event && handler) {
5672
+ element.attachEvent('on' + event, handler);
5673
+ }
5674
+ };
5675
+ }
5676
+ }();
5677
+
5678
+ /* istanbul ignore next */
5679
+ var off = function () {
5680
+ if (!isServer && document.removeEventListener) {
5681
+ return function (element, event, handler) {
5682
+ if (element && event) {
5683
+ element.removeEventListener(event, handler, false);
5684
+ }
5685
+ };
5686
+ } else {
5687
+ return function (element, event, handler) {
5688
+ if (element && event) {
5689
+ element.detachEvent('on' + event, handler);
5690
+ }
5691
+ };
5692
+ }
5693
+ }();
5694
+
5695
+ /* istanbul ignore next */
5696
+ var once = function once(el, event, fn) {
5697
+ var listener = function listener() {
5698
+ if (fn) {
5699
+ fn.apply(this, arguments);
5700
+ }
5701
+ off(el, event, listener);
5702
+ };
5703
+ on(el, event, listener);
5704
+ };
5705
+
5706
+ /* istanbul ignore next */
5707
+ function hasClass(el, cls) {
5708
+ if (!el || !cls) return false;
5709
+ if (cls.indexOf(' ') !== -1) {
5710
+ throw new Error('className should not contain space.');
5711
+ }
5712
+ if (el.classList) {
5713
+ return el.classList.contains(cls);
5714
+ } else {
5715
+ return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1;
5716
+ }
5717
+ }
5718
+
5719
+ /* istanbul ignore next */
5720
+ function addClass(el, cls) {
5721
+ if (!el) return;
5722
+ var curClass = el.className;
5723
+ var classes = (cls || '').split(' ');
5724
+
5725
+ for (var i = 0, j = classes.length; i < j; i++) {
5726
+ var clsName = classes[i];
5727
+ if (!clsName) continue;
5728
+
5729
+ if (el.classList) {
5730
+ el.classList.add(clsName);
5731
+ } else if (!hasClass(el, clsName)) {
5732
+ curClass += ' ' + clsName;
5733
+ }
5734
+ }
5735
+ if (!el.classList) {
5736
+ el.className = curClass;
5737
+ }
5738
+ }
5739
+
5740
+ /* istanbul ignore next */
5741
+ function removeClass(el, cls) {
5742
+ if (!el || !cls) return;
5743
+ var classes = cls.split(' ');
5744
+ var curClass = ' ' + el.className + ' ';
5745
+
5746
+ for (var i = 0, j = classes.length; i < j; i++) {
5747
+ var clsName = classes[i];
5748
+ if (!clsName) continue;
5749
+
5750
+ if (el.classList) {
5751
+ el.classList.remove(clsName);
5752
+ } else if (hasClass(el, clsName)) {
5753
+ curClass = curClass.replace(' ' + clsName + ' ', ' ');
5754
+ }
5755
+ }
5756
+ if (!el.classList) {
5757
+ el.className = trim(curClass);
5758
+ }
5759
+ }
5760
+
5761
+ /* istanbul ignore next */
5762
+ var getStyle = ieVersion < 9 ? function (element, styleName) {
5763
+ if (isServer) return;
5764
+ if (!element || !styleName) return null;
5765
+ styleName = camelCase(styleName);
5766
+ if (styleName === 'float') {
5767
+ styleName = 'styleFloat';
5768
+ }
5769
+ try {
5770
+ switch (styleName) {
5771
+ case 'opacity':
5772
+ try {
5773
+ return element.filters.item('alpha').opacity / 100;
5774
+ } catch (e) {
5775
+ return 1.0;
5776
+ }
5777
+ default:
5778
+ return element.style[styleName] || element.currentStyle ? element.currentStyle[styleName] : null;
5779
+ }
5780
+ } catch (e) {
5781
+ return element.style[styleName];
5782
+ }
5783
+ } : function (element, styleName) {
5784
+ if (isServer) return;
5785
+ if (!element || !styleName) return null;
5786
+ styleName = camelCase(styleName);
5787
+ if (styleName === 'float') {
5788
+ styleName = 'cssFloat';
5789
+ }
5790
+ try {
5791
+ var computed = document.defaultView.getComputedStyle(element, '');
5792
+ return element.style[styleName] || computed ? computed[styleName] : null;
5793
+ } catch (e) {
5794
+ return element.style[styleName];
5795
+ }
5796
+ };
5797
+
5798
+ /* istanbul ignore next */
5799
+ function setStyle(element, styleName, value) {
5800
+ if (!element || !styleName) return;
5801
+
5802
+ if ((typeof styleName === 'undefined' ? 'undefined' : _typeof(styleName)) === 'object') {
5803
+ for (var prop in styleName) {
5804
+ if (styleName.hasOwnProperty(prop)) {
5805
+ setStyle(element, prop, styleName[prop]);
5806
+ }
5807
+ }
5808
+ } else {
5809
+ styleName = camelCase(styleName);
5810
+ if (styleName === 'opacity' && ieVersion < 9) {
5811
+ element.style.filter = isNaN(value) ? '' : 'alpha(opacity=' + value * 100 + ')';
5812
+ } else {
5813
+ element.style[styleName] = value;
5814
+ }
5815
+ }
5816
+ }
5817
+
5818
+ var isScroll = function isScroll(el, vertical) {
5819
+ if (isServer) return;
5820
+
5821
+ var determinedDirection = vertical !== null || vertical !== undefined;
5822
+ var overflow = determinedDirection ? vertical ? getStyle(el, 'overflow-y') : getStyle(el, 'overflow-x') : getStyle(el, 'overflow');
5823
+
5824
+ return overflow.match(/(scroll|auto)/);
5825
+ };
5826
+
5827
+ var getScrollContainer = function getScrollContainer(el, vertical) {
5828
+ if (isServer) return;
5829
+
5830
+ var parent = el;
5831
+ while (parent) {
5832
+ if ([window, document, document.documentElement].includes(parent)) {
5833
+ return window;
5834
+ }
5835
+ if (isScroll(parent, vertical)) {
5836
+ return parent;
5837
+ }
5838
+ parent = parent.parentNode;
5839
+ }
5840
+
5841
+ return parent;
5842
+ };
5843
+
5844
+ var isInContainer = function isInContainer(el, container) {
5845
+ if (isServer || !el || !container) return false;
5846
+
5847
+ var elRect = el.getBoundingClientRect();
5848
+ var containerRect = void 0;
5849
+
5850
+ if ([window, document, document.documentElement, null, undefined].includes(container)) {
5851
+ containerRect = {
5852
+ top: 0,
5853
+ right: window.innerWidth,
5854
+ bottom: window.innerHeight,
5855
+ left: 0
5856
+ };
5857
+ } else {
5858
+ containerRect = container.getBoundingClientRect();
5859
+ }
5860
+
5861
+ return elRect.top < containerRect.bottom && elRect.bottom > containerRect.top && elRect.right > containerRect.left && elRect.left < containerRect.right;
5862
+ };
5863
+
5723
5864
  /**
5724
- * 获取当前日期时间
5725
- * @date 2022年5月7日
5726
- * @param {string} format - 日期时间格式,默认为'YYYY-MM-DD HH:mm:ss'
5727
- * @returns {string} 当前日期时间的格式化字符串
5728
- */
5729
- const getCurrentDateTime = function (format = 'YYYY-MM-DD HH:mm:ss') {
5730
- return formatDate(new Date(), format);
5731
- };
5732
-
5865
+ * 在元素前插入元素
5866
+ * @param {HTMLElement} newEl 新DOM元素
5867
+ * @param {HTMLElement} targetEl 在指定目标DOM元素前插入
5868
+ */
5869
+ function insertAfter(newEl, targetEl) {
5870
+ var parentEl = targetEl.parentNode;
5871
+ if (parentEl.lastChild === targetEl) {
5872
+ parentEl.appendChild(newEl);
5873
+ } else {
5874
+ parentEl.insertBefore(newEl, targetEl.nextSibling);
5875
+ }
5876
+ }
5877
+
5878
+ /***/ }),
5879
+
5880
+ /***/ 6:
5881
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
5882
+
5883
+ "use strict";
5884
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isString; });
5885
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isObject; });
5886
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isHtmlElement; });
5887
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isFunction; });
5888
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isUndefined; });
5889
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isDefined; });
5733
5890
  /**
5734
- * 获取小时
5735
- * @date 2022年5月7日
5736
- * @param {Date|string} [date] - 日期对象或日期字符串
5737
- * @returns {number} 小时数(0-23)
5738
- */
5739
- const getHour = function (date) {
5740
- if (!date) {
5741
- return new Date().getHours();
5742
- }
5743
- if (typeof date === 'string') {
5744
- date = new Date(date);
5745
- }
5746
- return date.getHours();
5747
- };
5748
-
5891
+ * 检查一个值是否为字符串类型
5892
+ * @param {*} obj 要检查的值
5893
+ * @returns {boolean} 如果值为字符串则返回true,否则返回false
5894
+ */
5895
+ function isString(obj) {
5896
+ return Object.prototype.toString.call(obj) === '[object String]';
5897
+ }
5898
+
5749
5899
  /**
5750
- * 获取分钟
5751
- * @date 2022年5月7日
5752
- * @param {Date|string} [date] - 日期对象或日期字符串
5753
- * @returns {number} 分钟数(0-59)
5754
- */
5755
- const getMinute = function (date) {
5756
- if (!date) {
5757
- return new Date().getMinutes();
5758
- }
5759
- if (typeof date === 'string') {
5760
- date = new Date(date);
5761
- }
5762
- return date.getMinutes();
5763
- };
5764
-
5900
+ * 检查一个值是否为对象类型
5901
+ * @param {*} obj 要检查的值
5902
+ * @returns {boolean} 如果值为对象则返回true,否则返回false
5903
+ */
5904
+ function isObject(obj) {
5905
+ return Object.prototype.toString.call(obj) === '[object Object]';
5906
+ }
5907
+
5765
5908
  /**
5766
- * 获取月份
5767
- * @date 2022年5月7日
5768
- * @param {Date|string} [date] - 日期对象或日期字符串
5769
- * @returns {number} 月份数(1-12)
5770
- */
5771
- const getMonth = function (date) {
5772
- if (!date) {
5773
- return new Date().getMonth() + 1;
5774
- }
5775
- if (typeof date === 'string') {
5776
- date = new Date(date);
5777
- }
5778
- return date.getMonth() + 1;
5779
- };
5780
-
5909
+ * 检查一个节点是否为HTML元素
5910
+ * @param {Node} node 要检查的节点
5911
+ * @returns {boolean} 如果节点为HTML元素则返回true,否则返回false
5912
+ */
5913
+ function isHtmlElement(node) {
5914
+ return node && node.nodeType === Node.ELEMENT_NODE;
5915
+ }
5916
+
5781
5917
  /**
5782
- * 获取秒
5783
- * @date 2022年5月7日
5784
- * @param {Date|string} [date] - 日期对象或日期字符串
5785
- * @returns {number} 秒数(0-59)
5786
- */
5787
- const getSecond = function (date) {
5788
- if (!date) {
5789
- return new Date().getSeconds();
5790
- }
5791
- if (typeof date === 'string') {
5792
- date = new Date(date);
5793
- }
5794
- return date.getSeconds();
5795
- };
5796
-
5918
+ * 检查一个值是否为函数类型
5919
+ * @param {*} functionToCheck 要检查的值
5920
+ * @returns {boolean} 如果值为函数则返回true,否则返回false
5921
+ */
5922
+ function isFunction(functionToCheck) {
5923
+ var getType = {};
5924
+ return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
5925
+ }
5926
+
5797
5927
  /**
5798
- * 获取星期几
5799
- * @date 2022年5月7日
5800
- * @param {Date|string} [date] - 日期对象或日期字符串
5801
- * @returns {number} 星期几(0-6,0表示星期日)
5802
- */
5803
- const getWeekday = function (date) {
5804
- if (!date) {
5805
- return new Date().getDay();
5806
- }
5807
- if (typeof date === 'string') {
5808
- date = new Date(date);
5809
- }
5810
- return date.getDay();
5811
- };
5812
-
5813
-
5928
+ * 检查一个值是否为undefined
5929
+ * @param {*} val 要检查的值
5930
+ * @returns {boolean} 如果值为undefined则返回true,否则返回false
5931
+ */
5932
+ function isUndefined(val) {
5933
+ return val === void 0;
5934
+ }
5935
+
5814
5936
  /**
5815
- * @desc 获取上午/下午/晚上
5816
- * @author huangbo
5817
- * @date 2022年5月7日
5818
- * @param {String} [time] - 时间
5819
- **/
5820
- const timeCycle = function (time) {
5821
- let hour = 0;
5822
- if (!time) {
5823
- hour = new Date().getHours();
5824
- } else if (typeof time === 'string') {
5825
- // 从时间字符串中提取小时
5826
- const match = time.match(/^(\d{1,2})/);
5827
- if (match) {
5828
- hour = parseInt(match[1], 10);
5829
- }
5830
- } else if (typeof time === 'number') {
5831
- hour = time;
5832
- }
5833
- // 判断时间段
5834
- if (hour >= 5 && hour < 12) {
5835
- return '上午';
5836
- } else if (hour >= 12 && hour < 18) {
5837
- return '下午';
5838
- } else {
5839
- return '晚上';
5840
- }
5841
- };
5937
+ * 检查一个值是否已定义(不是undefined或null)
5938
+ * @param {*} val 要检查的值
5939
+ * @returns {boolean} 如果值已定义则返回true,否则返回false
5940
+ */
5941
+ function isDefined(val) {
5942
+ return val !== undefined && val !== null;
5943
+ }
5944
+
5945
+ /***/ }),
5946
+
5947
+ /***/ 8:
5948
+ /***/ (function(module, exports) {
5949
+
5950
+ module.exports = require("eoss/lib/message-box");
5842
5951
 
5843
5952
  /***/ }),
5844
5953
 
5845
- /***/ 64:
5954
+ /***/ 85:
5846
5955
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5847
5956
 
5848
5957
  "use strict";
@@ -5861,13 +5970,6 @@ function isVNode(node) {
5861
5970
  return node !== null && (typeof node === 'undefined' ? 'undefined' : _typeof(node)) === 'object' && Object(eoss_src_utils_util__WEBPACK_IMPORTED_MODULE_0__[/* hasOwn */ "x"])(node, 'componentOptions');
5862
5971
  }
5863
5972
 
5864
- /***/ }),
5865
-
5866
- /***/ 8:
5867
- /***/ (function(module, exports) {
5868
-
5869
- module.exports = require("eoss/lib/message-box");
5870
-
5871
5973
  /***/ })
5872
5974
 
5873
5975
  /******/ });