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.
- package/lib/account-login.js +1943 -1890
- package/lib/alert.js +4 -4
- package/lib/aside.js +4 -4
- package/lib/autocomplete.js +4936 -4834
- package/lib/avatar.js +4 -4
- package/lib/backtop.js +4 -4
- package/lib/badge.js +4 -4
- package/lib/breadcrumb-item.js +6 -6
- package/lib/breadcrumb.js +7 -7
- package/lib/button-group.js +11 -14
- package/lib/button.js +6 -6
- package/lib/ca-login.js +2480 -2382
- package/lib/calendar.js +798 -798
- package/lib/card.js +4 -4
- package/lib/carousel-item.js +911 -813
- package/lib/carousel.js +1646 -1548
- package/lib/cascader-panel.js +2556 -2458
- package/lib/cascader.js +4546 -4444
- package/lib/checkbox-button.js +4 -4
- package/lib/checkbox-group.js +2894 -2841
- package/lib/checkbox.js +4 -4
- package/lib/col.js +2 -2
- package/lib/collapse-item.js +35159 -2572
- package/lib/collapse.js +35410 -2762
- package/lib/color-picker.js +494 -490
- package/lib/config/api.js +15 -1
- package/lib/container.js +4 -4
- package/lib/cron.js +4 -4
- package/lib/data-table.js +1895 -1842
- package/lib/date-picker.js +6422 -6320
- package/lib/dialog.js +2912 -2806
- package/lib/divider.js +4 -4
- package/lib/drawer.js +311 -299
- package/lib/dropdown-item.js +6 -6
- package/lib/dropdown-menu.js +539 -535
- package/lib/dropdown.js +2270 -2172
- package/lib/email-login.js +1783 -1730
- package/lib/empty.js +723 -0
- package/lib/eoss.common.js +63680 -56193
- package/lib/flip.js +4 -4
- package/lib/flow-group.js +2985 -2887
- package/lib/flow.js +28067 -28022
- package/lib/footer.js +4 -4
- package/lib/form-item.js +1935 -1837
- package/lib/form.js +9230 -9092
- package/lib/header.js +4 -4
- package/lib/icon.js +1708 -1590
- package/lib/icons.js +4 -4
- package/lib/image-viewer.js +1660 -1562
- package/lib/image.js +162 -162
- package/lib/index.js +1 -1
- package/lib/infinite-scroll.js +76 -76
- package/lib/input-number.js +172 -172
- package/lib/input.js +1362 -1264
- package/lib/link.js +4 -4
- package/lib/loading.js +321 -317
- package/lib/login.js +3306 -3300
- package/lib/lowcode.js +13320 -0
- package/lib/main.js +14465 -14339
- package/lib/marquee.js +1237 -1139
- package/lib/menu-item-group.js +119 -119
- package/lib/menu-item.js +114 -114
- package/lib/menu.js +6193 -6091
- package/lib/message-box.js +3582 -3480
- package/lib/message.js +2265 -2163
- package/lib/notification.js +2430 -2328
- package/lib/option-group.js +4 -4
- package/lib/option.js +842 -744
- package/lib/page-header.js +4 -4
- package/lib/pagination.js +1916 -1815
- package/lib/phone-login.js +1788 -1735
- package/lib/popconfirm.js +8 -8
- package/lib/popover.js +4559 -4457
- package/lib/progress.js +4 -4
- package/lib/qr-code.js +9 -9
- package/lib/qrcode-login.js +1600 -1543
- package/lib/radio-button.js +6 -6
- package/lib/radio-group.js +2142 -2089
- package/lib/radio.js +6 -6
- package/lib/rate.js +1226 -1128
- package/lib/row.js +2 -2
- package/lib/scrollbar.js +2695 -2597
- package/lib/select.js +5985 -5961
- package/lib/selector-panel.js +5239 -5186
- package/lib/selector.js +1712 -1659
- package/lib/slider.js +16 -16
- package/lib/step.js +35836 -2736
- package/lib/steps.js +1281 -1183
- package/lib/submenu.js +461 -457
- package/lib/switch.js +1010 -912
- package/lib/tab-pane.js +4 -4
- package/lib/table-column.js +2595 -2497
- package/lib/table.js +9225 -9239
- package/lib/tabs.js +2414 -2320
- package/lib/tag.js +4 -4
- package/lib/theme-chalk/account-login.css +1 -1
- package/lib/theme-chalk/autocomplete.css +1 -1
- package/lib/theme-chalk/base.css +1 -1
- package/lib/theme-chalk/cascader.css +1 -1
- package/lib/theme-chalk/date-picker.css +1 -1
- package/lib/theme-chalk/empty.css +1 -0
- package/lib/theme-chalk/fonts/iconfont.ttf +0 -0
- package/lib/theme-chalk/fonts/iconfont.woff +0 -0
- package/lib/theme-chalk/form.css +1 -1
- package/lib/theme-chalk/icon.css +1 -1
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/input-number.css +1 -1
- package/lib/theme-chalk/input.css +1 -1
- package/lib/theme-chalk/login.css +1 -1
- package/lib/theme-chalk/lowcode.css +1 -0
- package/lib/theme-chalk/main.css +1 -1
- package/lib/theme-chalk/message-box.css +1 -1
- package/lib/theme-chalk/pagination.css +1 -1
- package/lib/theme-chalk/qrcode-login.css +1 -1
- package/lib/theme-chalk/select.css +1 -1
- package/lib/theme-chalk/slider.css +1 -1
- package/lib/theme-chalk/tabs.css +1 -1
- package/lib/theme-chalk/time-picker.css +1 -1
- package/lib/theme-chalk/transfer.css +1 -1
- package/lib/time-picker.js +5823 -5819
- package/lib/time-select.js +3578 -3574
- package/lib/timeline-item.js +4 -4
- package/lib/timeline.js +4 -4
- package/lib/tips.js +1633 -1580
- package/lib/toolbar.js +213 -213
- package/lib/tooltip.js +4441 -4339
- package/lib/transfer.js +938 -840
- package/lib/tree-group.js +1875 -1757
- package/lib/tree.js +2626 -2573
- package/lib/upload.js +7209 -7156
- package/lib/utils/ajax.js +185 -243
- package/lib/utils/bus.js +2 -2
- package/lib/utils/popup/index.js +5 -1
- package/lib/utils/util.js +108 -11
- package/package.json +2 -2
- package/packages/button/src/button-group.vue +1 -4
- package/packages/collapse/src/collapse-item.vue +47 -33
- package/packages/dialog/src/dialog.vue +4 -1
- package/packages/drawer/src/drawer.vue +12 -4
- package/packages/empty/index.js +7 -0
- package/packages/empty/src/img-empty.vue +132 -0
- package/packages/empty/src/index.vue +49 -0
- package/packages/form/src/form-item-render.vue +16 -18
- package/packages/form/src/form.vue +27 -5
- package/packages/icons/src/icon.json +1 -1
- package/packages/login/src/login.vue +19 -21
- package/packages/login/src/mixins.js +2 -1
- package/packages/lowcode/index.js +5 -0
- package/packages/lowcode/src/aside.vue +331 -0
- package/packages/lowcode/src/attribute/bind.vue +441 -0
- package/packages/lowcode/src/attribute/dependency.vue +325 -0
- package/packages/lowcode/src/attribute/function.vue +112 -0
- package/packages/lowcode/src/attribute/property.vue +331 -0
- package/packages/lowcode/src/attribute/styles.vue +318 -0
- package/packages/lowcode/src/attribute.vue +135 -0
- package/packages/lowcode/src/canvas.vue +296 -0
- package/packages/lowcode/src/json.vue +32 -0
- package/packages/lowcode/src/lowcode.vue +539 -0
- package/packages/lowcode/src/modules.vue +93 -0
- package/packages/lowcode/src/pages.vue +91 -0
- package/packages/lowcode/src/render.vue +247 -0
- package/packages/lowcode/src/source.vue +32 -0
- package/packages/lowcode/src/toolbar.vue +162 -0
- package/packages/main/src/components/pages.vue +28 -2
- package/packages/main/src/components/set-menus.vue +3 -3
- package/packages/main/src/components/user.vue +6 -1
- package/packages/main/src/early.vue +2 -2
- package/packages/main/src/gzw.vue +55 -61
- package/packages/main/src/minxs.js +113 -36
- package/packages/pagination/src/pager.vue +2 -2
- package/packages/pagination/src/pagination.js +4 -1
- package/packages/qrcode-login/src/qrcode-login.vue +6 -2
- package/packages/select/src/select.vue +28 -6
- package/packages/steps/src/step.vue +7 -5
- package/packages/tabs/src/tab-nav.vue +1 -0
- package/packages/tabs/src/tabs.vue +0 -2
- package/packages/theme-chalk/dist/fonts/iconfont.ttf +0 -0
- package/packages/theme-chalk/dist/fonts/iconfont.woff +0 -0
- package/packages/theme-chalk/gulpfile.js +3 -0
- package/packages/theme-chalk/src/account-login.scss +1 -0
- package/packages/theme-chalk/src/base.scss +1 -1
- package/packages/theme-chalk/src/common/var.scss +16 -0
- package/packages/theme-chalk/src/empty.scss +45 -0
- package/packages/theme-chalk/src/fonts/iconfont.ttf +0 -0
- package/packages/theme-chalk/src/fonts/iconfont.woff +0 -0
- package/packages/theme-chalk/src/form.scss +1 -8
- package/packages/theme-chalk/src/icon.scss +30 -1
- package/packages/theme-chalk/src/index.scss +2 -0
- package/packages/theme-chalk/src/input-number.scss +0 -4
- package/packages/theme-chalk/src/input.scss +9 -0
- package/packages/theme-chalk/src/login.scss +32 -29
- package/packages/theme-chalk/src/lowcode.scss +461 -0
- package/packages/theme-chalk/src/main.scss +28 -65
- package/packages/theme-chalk/src/pagination.scss +4 -55
- package/packages/theme-chalk/src/qrcode-login.scss +3 -1
- package/packages/theme-chalk/src/tabs.scss +81 -50
- package/src/config/api.js +13 -0
- package/src/index.js +17 -4
- package/src/utils/ajax.js +61 -65
- package/src/utils/bus.js +2 -2
- package/src/utils/popup/index.js +5 -1
- package/src/utils/util.js +104 -7
- package/lib/index_/345/211/257/346/234/254.js +0 -583
- package/packages/dialog copy/index.js +0 -8
- package/packages/dialog copy/src/dialog.vue +0 -615
- package/src/index_/345/211/257/346/234/254.js +0 -359
- /package/{packages/form/src → src/components}/field-render.vue +0 -0
package/lib/pagination.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 =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 177);
|
|
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__, "
|
|
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__, "
|
|
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__, "
|
|
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__, "
|
|
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__, "
|
|
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__, "
|
|
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__, "
|
|
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__, "
|
|
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__, "
|
|
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__, "
|
|
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__, "
|
|
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__, "
|
|
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__, "
|
|
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__, "
|
|
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__, "
|
|
184
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "
|
|
185
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "
|
|
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__, "
|
|
191
|
-
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
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__(
|
|
194
|
-
/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
195
|
-
/* harmony import */ var _storage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
|
|
196
|
-
/* harmony import */ var _date__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
|
|
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__(
|
|
207
|
-
var _set = __webpack_require__(
|
|
208
|
-
var _cloneDeep = __webpack_require__(
|
|
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
|
|
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] ===
|
|
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__(
|
|
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
|
|
2167
|
-
var layerlevel = attributes.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
|
|
2247
|
-
var _digit = parseInt(decimalPart[
|
|
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[
|
|
2347
|
+
decimalCapital += chineseNumbers[_digit] + decimalUnits[_i6];
|
|
2250
2348
|
} else if (decimalCapital[decimalCapital.length - 1] !== chineseNumbers[0]) {
|
|
2251
2349
|
decimalCapital += chineseNumbers[_digit];
|
|
2252
2350
|
}
|
|
@@ -2912,1646 +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
|
-
/***/ 110:
|
|
3151
|
-
/***/ (function(module, exports) {
|
|
3152
|
-
|
|
3153
|
-
module.exports = require("eoss/lib/select");
|
|
3154
|
-
|
|
3155
|
-
/***/ }),
|
|
3156
|
-
|
|
3157
|
-
/***/ 111:
|
|
3158
|
-
/***/ (function(module, exports) {
|
|
3159
|
-
|
|
3160
|
-
module.exports = require("eoss/lib/option");
|
|
3161
|
-
|
|
3162
|
-
/***/ }),
|
|
3163
|
-
|
|
3164
|
-
/***/ 12:
|
|
3165
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3166
|
-
|
|
3167
|
-
"use strict";
|
|
3168
|
-
/* unused harmony export getHue */
|
|
3169
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getColor; });
|
|
3170
|
-
/* unused harmony export getLightness */
|
|
3171
|
-
/* unused harmony export getSaturation */
|
|
3172
|
-
/* unused harmony export rgbToHsv */
|
|
3173
|
-
/* unused harmony export hsvTorgb */
|
|
3174
|
-
/* unused harmony export mixColor */
|
|
3175
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getRgb; });
|
|
3176
|
-
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
3177
|
-
|
|
3178
|
-
var $hueStep = 2;
|
|
3179
|
-
var $saturationStep1 = 0.16;
|
|
3180
|
-
var $saturationStep2 = 0.05;
|
|
3181
|
-
var $brightnessStep1 = 0.05;
|
|
3182
|
-
var $brightnessStep2 = 0.15;
|
|
3183
|
-
var $lightColorCount = 5;
|
|
3184
|
-
var $darkColorCount = 4;
|
|
3185
|
-
/**
|
|
3186
|
-
* getHue
|
|
3187
|
-
* @desc:转换色相
|
|
3188
|
-
* @author huangbo
|
|
3189
|
-
* @date 2022年5月7日
|
|
3190
|
-
**/
|
|
3191
|
-
var getHue = function getHue($h, $i, $isLight) {
|
|
3192
|
-
var $hue = void 0;
|
|
3193
|
-
if ($h >= 60 && $h <= 240) {
|
|
3194
|
-
$hue = $isLight ? $h - $hueStep * $i : $h + $hueStep * $i;
|
|
3195
|
-
} else {
|
|
3196
|
-
$hue = $isLight ? $h + $hueStep * $i : $h - $hueStep * $i;
|
|
3197
|
-
}
|
|
3198
|
-
$hue = ($hue + 360) % 360;
|
|
3199
|
-
return Math.round($hue);
|
|
3200
|
-
};
|
|
3201
|
-
|
|
3202
|
-
/**
|
|
3203
|
-
* getColor
|
|
3204
|
-
* @desc:根据颜色和对应的色板位置,计算出对应的色板颜色
|
|
3205
|
-
* @author huangbo
|
|
3206
|
-
* @date 2022年5月7日
|
|
3207
|
-
**/
|
|
3208
|
-
var getColor = function getColor($color, $n) {
|
|
3209
|
-
var $isLight = $n < 7;
|
|
3210
|
-
var $hsv = rgbToHsv($color);
|
|
3211
|
-
// 这里将i转换成以主色为中心,两侧的i值逐渐增大
|
|
3212
|
-
var $i = $isLight ? $lightColorCount + 1 - $n : $n - $lightColorCount - 1;
|
|
3213
|
-
var color = hsvTorgb(getHue($hsv[0], $i, $isLight), getSaturation($hsv[1], $i, $isLight), getLightness($hsv[2], $i, $isLight));
|
|
3214
|
-
return color;
|
|
3215
|
-
};
|
|
3216
|
-
|
|
3217
|
-
/**
|
|
3218
|
-
* getLightness
|
|
3219
|
-
* @desc:转换明度
|
|
3220
|
-
* @author huangbo
|
|
3221
|
-
* @date 2022年5月7日
|
|
3222
|
-
* @return {string,array} 元素类名或者id
|
|
3223
|
-
**/
|
|
3224
|
-
var getLightness = function getLightness($v, $i, $isLight) {
|
|
3225
|
-
var $value = $isLight ? $v + $brightnessStep1 * $i : $v - $brightnessStep2 * $i;
|
|
3226
|
-
$value = $value < 1 ? $value : 1;
|
|
3227
|
-
return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "T"])($value, 2);
|
|
3228
|
-
};
|
|
3229
|
-
|
|
3230
|
-
/**
|
|
3231
|
-
* getSaturation
|
|
3232
|
-
* @desc:转换饱和度
|
|
3233
|
-
* @author huangbo
|
|
3234
|
-
* @date 2022年5月7日
|
|
3235
|
-
**/
|
|
3236
|
-
var getSaturation = function getSaturation($s, $i, $isLight) {
|
|
3237
|
-
var $saturation = void 0;
|
|
3238
|
-
if ($isLight) {
|
|
3239
|
-
$saturation = $s - $saturationStep1 * $i;
|
|
3240
|
-
} else if ($i === $darkColorCount) {
|
|
3241
|
-
$saturation = $s + $saturationStep1;
|
|
3242
|
-
} else {
|
|
3243
|
-
$saturation = $s + $saturationStep2 * $i;
|
|
3244
|
-
}
|
|
3245
|
-
$saturation = $saturation < 1 ? $saturation : 1;
|
|
3246
|
-
|
|
3247
|
-
if ($isLight && $i === $lightColorCount && $saturation > 0.1) {
|
|
3248
|
-
$saturation = 0.1;
|
|
3249
|
-
}
|
|
3250
|
-
$saturation = $saturation > 0.06 ? $saturation : 0.06;
|
|
3251
|
-
return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "T"])($saturation, 2);
|
|
3252
|
-
};
|
|
3253
|
-
|
|
3254
|
-
/**
|
|
3255
|
-
* rgbToHsv
|
|
3256
|
-
* @desc:rgb转化成hsv
|
|
3257
|
-
* @author huangbo
|
|
3258
|
-
* @date 2022年5月7日
|
|
3259
|
-
* @param {string} [$color] - 颜色值
|
|
3260
|
-
**/
|
|
3261
|
-
var rgbToHsv = function rgbToHsv($color) {
|
|
3262
|
-
var rgb = getRgb($color);
|
|
3263
|
-
var $red = rgb[0];
|
|
3264
|
-
var $green = rgb[1];
|
|
3265
|
-
var $blue = rgb[2];
|
|
3266
|
-
var $max = Math.max($red, $green, $blue);
|
|
3267
|
-
var $min = Math.min($red, $green, $blue);
|
|
3268
|
-
var $diff = $max - $min;
|
|
3269
|
-
var $h = 0;
|
|
3270
|
-
if ($max === $min) {
|
|
3271
|
-
$h = 0;
|
|
3272
|
-
} else if ($max === $red) {
|
|
3273
|
-
$h = 60 * ($green - $blue) / $diff + ($green > $blue - 1 ? 0 : 360);
|
|
3274
|
-
} else if ($max === $green) {
|
|
3275
|
-
$h = 60 * ($blue - $red) / $diff + 120;
|
|
3276
|
-
} else if ($max === $blue) {
|
|
3277
|
-
$h = 60 * ($red - $green) / $diff + 240;
|
|
3278
|
-
}
|
|
3279
|
-
var $s = $max === 0 ? 0 : $diff / $max;
|
|
3280
|
-
var $v = $max / 255;
|
|
3281
|
-
return [$h, $s, $v];
|
|
3282
|
-
};
|
|
3283
|
-
|
|
3284
|
-
/**
|
|
3285
|
-
* hsvTorgb
|
|
3286
|
-
* @desc:hsv转化成rgb
|
|
3287
|
-
* @author huangbo
|
|
3288
|
-
* @date 2022年5月7日
|
|
3289
|
-
* @param {string} [$color] - 颜色值
|
|
3290
|
-
**/
|
|
3291
|
-
var hsvTorgb = function hsvTorgb($h, $s, $v) {
|
|
3292
|
-
var $th = Math.floor($h / 60);
|
|
3293
|
-
var $t1 = $h / 60 - $th;
|
|
3294
|
-
var $t2 = $v * (1 - $s);
|
|
3295
|
-
var $t3 = $v * (1 - $t1 * $s);
|
|
3296
|
-
var $t4 = $v * (1 - (1 - $t1) * $s);
|
|
3297
|
-
var $r = [$v, $t3, $t2, $t2, $t4, $v][$th % 6];
|
|
3298
|
-
var $g = [$t4, $v, $v, $t3, $t2, $t2][$th % 6];
|
|
3299
|
-
var $b = [$t2, $t2, $t4, $v, $v, $t3][$th % 6];
|
|
3300
|
-
// return `rgb(${Math.round($r * 255)}, ${Math.round($g * 255)}, ${Math.round($b * 255)})`;
|
|
3301
|
-
var red = Math.round($r * 255);
|
|
3302
|
-
var green = Math.round($g * 255);
|
|
3303
|
-
var blue = Math.round($b * 255);
|
|
3304
|
-
red = red.toString(16);
|
|
3305
|
-
green = green.toString(16);
|
|
3306
|
-
blue = blue.toString(16);
|
|
3307
|
-
red = red.length === 1 ? '0' + red : red;
|
|
3308
|
-
green = green.length === 1 ? '0' + green : green;
|
|
3309
|
-
blue = blue.length === 1 ? '0' + blue : blue;
|
|
3310
|
-
return '#' + red + green + blue;
|
|
3311
|
-
};
|
|
3312
|
-
|
|
3313
|
-
/**
|
|
3314
|
-
* mixColor
|
|
3315
|
-
* @desc:生成混合色
|
|
3316
|
-
* @author huangbo
|
|
3317
|
-
* @date 2022年5月7日
|
|
3318
|
-
* @param {string} [$color1] - 颜色值
|
|
3319
|
-
* @param {string} [$color2] - 颜色值
|
|
3320
|
-
* @param {string} [$n] - 百分比 0~1
|
|
3321
|
-
**/
|
|
3322
|
-
var mixColor = function mixColor($color1, $color2, $n) {
|
|
3323
|
-
var rgb1 = getRgb($color1);
|
|
3324
|
-
var rgb2 = getRgb($color2);
|
|
3325
|
-
var r = rgb1[0] * $n + rgb2[0] * (1 - $n);
|
|
3326
|
-
var g = rgb1[1] * $n + rgb2[1] * (1 - $n);
|
|
3327
|
-
var b = rgb1[2] * $n + rgb2[2] * (1 - $n);
|
|
3328
|
-
return '#' + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
|
|
3329
|
-
};
|
|
3330
|
-
|
|
3331
|
-
/**
|
|
3332
|
-
* getRgb
|
|
3333
|
-
* @desc:获取颜色值的rgb值
|
|
3334
|
-
* @author huangbo
|
|
3335
|
-
* @date 2022年5月7日
|
|
3336
|
-
* @param {string} [$color] - 颜色值
|
|
3337
|
-
**/
|
|
3338
|
-
var getRgb = function getRgb($color) {
|
|
3339
|
-
var rgb = [];
|
|
3340
|
-
// 16进制颜色值的正则
|
|
3341
|
-
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
|
|
3342
|
-
// 把颜色值变成小写
|
|
3343
|
-
$color = $color.toLowerCase();
|
|
3344
|
-
if (reg.test($color)) {
|
|
3345
|
-
// 如果只有三位的值,需变成六位,如:#fff => #ffffff
|
|
3346
|
-
if ($color.length === 4) {
|
|
3347
|
-
var colorNew = '#';
|
|
3348
|
-
for (var i = 1; i < 4; i++) {
|
|
3349
|
-
colorNew += $color.slice(i, i + 1).concat($color.slice(i, i + 1));
|
|
3350
|
-
}
|
|
3351
|
-
$color = colorNew;
|
|
3352
|
-
}
|
|
3353
|
-
// 处理六位的颜色值,转为RGB
|
|
3354
|
-
for (var _i = 1; _i < 7; _i += 2) {
|
|
3355
|
-
rgb.push(parseInt('0x' + $color.slice(_i, _i + 2), 16));
|
|
3356
|
-
}
|
|
3357
|
-
} else {
|
|
3358
|
-
rgb = $color.replace(/(?:\(|\)|rgb|RGB)*/g, '').split(',');
|
|
3359
|
-
}
|
|
3360
|
-
return rgb;
|
|
3361
|
-
};
|
|
3362
|
-
|
|
3363
|
-
/***/ }),
|
|
3364
|
-
|
|
3365
|
-
/***/ 13:
|
|
3366
|
-
/***/ (function(module, exports) {
|
|
3367
|
-
|
|
3368
|
-
module.exports = require("eoss/lib/loading");
|
|
3369
|
-
|
|
3370
|
-
/***/ }),
|
|
3371
|
-
|
|
3372
|
-
/***/ 15:
|
|
3373
|
-
/***/ (function(module, exports) {
|
|
3374
|
-
|
|
3375
|
-
module.exports = require("lodash/get");
|
|
3376
|
-
|
|
3377
|
-
/***/ }),
|
|
3378
|
-
|
|
3379
|
-
/***/ 16:
|
|
3380
|
-
/***/ (function(module, exports) {
|
|
3381
|
-
|
|
3382
|
-
module.exports = require("lodash/set");
|
|
3383
|
-
|
|
3384
|
-
/***/ }),
|
|
3385
|
-
|
|
3386
|
-
/***/ 17:
|
|
3387
|
-
/***/ (function(module, exports) {
|
|
3388
|
-
|
|
3389
|
-
module.exports = require("lodash/cloneDeep");
|
|
3390
|
-
|
|
3391
|
-
/***/ }),
|
|
3392
|
-
|
|
3393
|
-
/***/ 173:
|
|
3394
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3395
|
-
|
|
3396
|
-
"use strict";
|
|
3397
|
-
// ESM COMPAT FLAG
|
|
3398
|
-
__webpack_require__.r(__webpack_exports__);
|
|
3399
|
-
|
|
3400
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/pagination/src/pager.vue?vue&type=template&id=4574baf9&
|
|
3401
|
-
var render = function () {
|
|
3402
|
-
var _vm = this
|
|
3403
|
-
var _h = _vm.$createElement
|
|
3404
|
-
var _c = _vm._self._c || _h
|
|
3405
|
-
return _c(
|
|
3406
|
-
"ul",
|
|
3407
|
-
{ staticClass: "es-pager", on: { click: _vm.onPagerClick } },
|
|
3408
|
-
[
|
|
3409
|
-
_vm.pageCount > 0
|
|
3410
|
-
? _c(
|
|
3411
|
-
"li",
|
|
3412
|
-
{
|
|
3413
|
-
staticClass: "number",
|
|
3414
|
-
class: {
|
|
3415
|
-
active: _vm.currentPage === 1,
|
|
3416
|
-
disabled: _vm.disabled,
|
|
3417
|
-
},
|
|
3418
|
-
},
|
|
3419
|
-
[_vm._v("\n 1\n ")]
|
|
3420
|
-
)
|
|
3421
|
-
: _vm._e(),
|
|
3422
|
-
_vm.showPrevMore
|
|
3423
|
-
? _c("li", {
|
|
3424
|
-
staticClass: "es-icon more btn-quickprev",
|
|
3425
|
-
class: [_vm.quickprevIconClass, { disabled: _vm.disabled }],
|
|
3426
|
-
on: {
|
|
3427
|
-
mouseenter: function ($event) {
|
|
3428
|
-
return _vm.onMouseenter("left")
|
|
3429
|
-
},
|
|
3430
|
-
mouseleave: function ($event) {
|
|
3431
|
-
_vm.quickprevIconClass = "es-icon-more"
|
|
3432
|
-
},
|
|
3433
|
-
},
|
|
3434
|
-
})
|
|
3435
|
-
: _vm._e(),
|
|
3436
|
-
_vm._l(_vm.pagers, function (pager) {
|
|
3437
|
-
return _c(
|
|
3438
|
-
"li",
|
|
3439
|
-
{
|
|
3440
|
-
key: pager,
|
|
3441
|
-
staticClass: "number",
|
|
3442
|
-
class: {
|
|
3443
|
-
active: _vm.currentPage === pager,
|
|
3444
|
-
disabled: _vm.disabled,
|
|
3445
|
-
},
|
|
3446
|
-
},
|
|
3447
|
-
[_vm._v("\n " + _vm._s(pager) + "\n ")]
|
|
3448
|
-
)
|
|
3449
|
-
}),
|
|
3450
|
-
_vm.showNextMore
|
|
3451
|
-
? _c("li", {
|
|
3452
|
-
staticClass: "es-icon more btn-quicknext",
|
|
3453
|
-
class: [_vm.quicknextIconClass, { disabled: _vm.disabled }],
|
|
3454
|
-
on: {
|
|
3455
|
-
mouseenter: function ($event) {
|
|
3456
|
-
return _vm.onMouseenter("right")
|
|
3457
|
-
},
|
|
3458
|
-
mouseleave: function ($event) {
|
|
3459
|
-
_vm.quicknextIconClass = "es-icon-more"
|
|
3460
|
-
},
|
|
3461
|
-
},
|
|
3462
|
-
})
|
|
3463
|
-
: _vm._e(),
|
|
3464
|
-
_vm.pageCount > 1
|
|
3465
|
-
? _c(
|
|
3466
|
-
"li",
|
|
3467
|
-
{
|
|
3468
|
-
staticClass: "number",
|
|
3469
|
-
class: {
|
|
3470
|
-
active: _vm.currentPage === _vm.pageCount,
|
|
3471
|
-
disabled: _vm.disabled,
|
|
3472
|
-
},
|
|
3473
|
-
},
|
|
3474
|
-
[_vm._v("\n " + _vm._s(_vm.pageCount) + "\n ")]
|
|
3475
|
-
)
|
|
3476
|
-
: _vm._e(),
|
|
3477
|
-
],
|
|
3478
|
-
2
|
|
3479
|
-
)
|
|
3480
|
-
}
|
|
3481
|
-
var staticRenderFns = []
|
|
3482
|
-
render._withStripped = true
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
// CONCATENATED MODULE: ./packages/pagination/src/pager.vue?vue&type=template&id=4574baf9&
|
|
3486
|
-
|
|
3487
|
-
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/pagination/src/pager.vue?vue&type=script&lang=js&
|
|
3488
|
-
//
|
|
3489
|
-
//
|
|
3490
|
-
//
|
|
3491
|
-
//
|
|
3492
|
-
//
|
|
3493
|
-
//
|
|
3494
|
-
//
|
|
3495
|
-
//
|
|
3496
|
-
//
|
|
3497
|
-
//
|
|
3498
|
-
//
|
|
3499
|
-
//
|
|
3500
|
-
//
|
|
3501
|
-
//
|
|
3502
|
-
//
|
|
3503
|
-
//
|
|
3504
|
-
//
|
|
3505
|
-
//
|
|
3506
|
-
//
|
|
3507
|
-
//
|
|
3508
|
-
//
|
|
3509
|
-
//
|
|
3510
|
-
//
|
|
3511
|
-
//
|
|
3512
|
-
//
|
|
3513
|
-
//
|
|
3514
|
-
//
|
|
3515
|
-
//
|
|
3516
|
-
//
|
|
3517
|
-
//
|
|
3518
|
-
//
|
|
3519
|
-
//
|
|
3520
|
-
//
|
|
3521
|
-
//
|
|
3522
|
-
//
|
|
3523
|
-
//
|
|
3524
|
-
//
|
|
3525
|
-
//
|
|
3526
|
-
//
|
|
3527
|
-
//
|
|
3528
|
-
//
|
|
3529
|
-
//
|
|
3530
|
-
//
|
|
3531
|
-
//
|
|
3532
|
-
//
|
|
3533
|
-
//
|
|
3534
|
-
//
|
|
3535
|
-
//
|
|
3536
|
-
//
|
|
3537
|
-
//
|
|
3538
|
-
//
|
|
3539
|
-
//
|
|
3540
|
-
//
|
|
3541
|
-
//
|
|
3542
|
-
//
|
|
3543
|
-
//
|
|
3544
|
-
//
|
|
3545
|
-
//
|
|
3546
|
-
//
|
|
3547
|
-
|
|
3548
|
-
/**
|
|
3549
|
-
* 分页器组件
|
|
3550
|
-
* @component EsPager
|
|
3551
|
-
*/
|
|
3552
|
-
/* harmony default export */ var pagervue_type_script_lang_js_ = ({
|
|
3553
|
-
name: 'EsPager',
|
|
3554
|
-
componentName: 'EsPager',
|
|
3555
|
-
|
|
3556
|
-
props: {
|
|
3557
|
-
// 当前页码
|
|
3558
|
-
currentPage: {
|
|
3559
|
-
type: Number,
|
|
3560
|
-
required: true
|
|
3561
|
-
},
|
|
3562
|
-
|
|
3563
|
-
// 总页数
|
|
3564
|
-
pageCount: {
|
|
3565
|
-
type: Number,
|
|
3566
|
-
required: true
|
|
3567
|
-
},
|
|
3568
|
-
|
|
3569
|
-
// 页码按钮数量
|
|
3570
|
-
pagerCount: {
|
|
3571
|
-
type: Number,
|
|
3572
|
-
required: true
|
|
3573
|
-
},
|
|
3574
|
-
|
|
3575
|
-
// 是否禁用
|
|
3576
|
-
disabled: {
|
|
3577
|
-
type: Boolean,
|
|
3578
|
-
default: false
|
|
3579
|
-
}
|
|
3580
|
-
},
|
|
3581
|
-
|
|
3582
|
-
data: function data() {
|
|
3583
|
-
return {
|
|
3584
|
-
// 内部变量,未使用
|
|
3585
|
-
current: null,
|
|
3586
|
-
// 是否显示上一页更多按钮
|
|
3587
|
-
showPrevMore: false,
|
|
3588
|
-
// 是否显示下一页更多按钮
|
|
3589
|
-
showNextMore: false,
|
|
3590
|
-
// 下一页更多按钮图标类名
|
|
3591
|
-
quicknextIconClass: 'es-icon-more',
|
|
3592
|
-
// 上一页更多按钮图标类名
|
|
3593
|
-
quickprevIconClass: 'es-icon-more'
|
|
3594
|
-
};
|
|
3595
|
-
},
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
watch: {
|
|
3599
|
-
// 监听上一页更多按钮状态变化
|
|
3600
|
-
showPrevMore: function showPrevMore(val) {
|
|
3601
|
-
if (!val) {
|
|
3602
|
-
this.quickprevIconClass = 'es-icon-more';
|
|
3603
|
-
}
|
|
3604
|
-
},
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
// 监听下一页更多按钮状态变化
|
|
3608
|
-
showNextMore: function showNextMore(val) {
|
|
3609
|
-
if (!val) {
|
|
3610
|
-
this.quicknextIconClass = 'es-icon-more';
|
|
3611
|
-
}
|
|
3612
|
-
}
|
|
3613
|
-
},
|
|
3614
|
-
|
|
3615
|
-
computed: {
|
|
3616
|
-
// 计算中间页码数组
|
|
3617
|
-
pagers: function pagers() {
|
|
3618
|
-
var pagerCount = this.pagerCount;
|
|
3619
|
-
var halfPagerCount = (pagerCount - 1) / 2;
|
|
3620
|
-
var currentPage = Number(this.currentPage);
|
|
3621
|
-
var pageCount = Number(this.pageCount);
|
|
3622
|
-
|
|
3623
|
-
// 边界检查
|
|
3624
|
-
if (!Number.isInteger(pageCount) || pageCount <= 0) {
|
|
3625
|
-
return [];
|
|
3626
|
-
}
|
|
3627
|
-
|
|
3628
|
-
var showPrevMore = false;
|
|
3629
|
-
var showNextMore = false;
|
|
3630
|
-
|
|
3631
|
-
// 判断是否需要显示更多按钮
|
|
3632
|
-
if (pageCount > pagerCount) {
|
|
3633
|
-
if (currentPage > pagerCount - halfPagerCount) {
|
|
3634
|
-
showPrevMore = true;
|
|
3635
|
-
}
|
|
3636
|
-
|
|
3637
|
-
if (currentPage < pageCount - halfPagerCount) {
|
|
3638
|
-
showNextMore = true;
|
|
3639
|
-
}
|
|
3640
|
-
}
|
|
3641
|
-
|
|
3642
|
-
var array = [];
|
|
3643
|
-
|
|
3644
|
-
// 根据不同情况生成页码数组
|
|
3645
|
-
if (showPrevMore && !showNextMore) {
|
|
3646
|
-
// 只显示上一页更多
|
|
3647
|
-
var startPage = Math.max(2, pageCount - (pagerCount - 2));
|
|
3648
|
-
for (var i = startPage; i < pageCount; i++) {
|
|
3649
|
-
array.push(i);
|
|
3650
|
-
}
|
|
3651
|
-
} else if (!showPrevMore && showNextMore) {
|
|
3652
|
-
// 只显示下一页更多
|
|
3653
|
-
for (var _i = 2; _i < Math.min(pagerCount, pageCount); _i++) {
|
|
3654
|
-
array.push(_i);
|
|
3655
|
-
}
|
|
3656
|
-
} else if (showPrevMore && showNextMore) {
|
|
3657
|
-
// 同时显示上下页更多
|
|
3658
|
-
var offset = Math.floor(pagerCount / 2) - 1;
|
|
3659
|
-
var start = Math.max(2, currentPage - offset);
|
|
3660
|
-
var end = Math.min(pageCount - 1, currentPage + offset);
|
|
3661
|
-
for (var _i2 = start; _i2 <= end; _i2++) {
|
|
3662
|
-
array.push(_i2);
|
|
3663
|
-
}
|
|
3664
|
-
} else {
|
|
3665
|
-
// 不显示更多按钮
|
|
3666
|
-
for (var _i3 = 2; _i3 < pageCount; _i3++) {
|
|
3667
|
-
array.push(_i3);
|
|
3668
|
-
}
|
|
3669
|
-
}
|
|
3670
|
-
|
|
3671
|
-
// 更新状态
|
|
3672
|
-
this.showPrevMore = showPrevMore;
|
|
3673
|
-
this.showNextMore = showNextMore;
|
|
3674
|
-
|
|
3675
|
-
return array;
|
|
3676
|
-
}
|
|
3677
|
-
},
|
|
3678
|
-
|
|
3679
|
-
methods: {
|
|
3680
|
-
// 处理页码点击事件
|
|
3681
|
-
onPagerClick: function onPagerClick(event) {
|
|
3682
|
-
var target = event.target;
|
|
3683
|
-
// 禁用状态或点击的是ul容器,不处理
|
|
3684
|
-
if (this.disabled || target.tagName === 'UL') {
|
|
3685
|
-
return;
|
|
3686
|
-
}
|
|
3687
|
-
|
|
3688
|
-
var newPage = Number(target.textContent);
|
|
3689
|
-
var pageCount = this.pageCount;
|
|
3690
|
-
var currentPage = this.currentPage;
|
|
3691
|
-
var pagerCountOffset = this.pagerCount - 2;
|
|
3692
|
-
|
|
3693
|
-
// 处理快速跳转按钮
|
|
3694
|
-
if (target.classList.contains('more')) {
|
|
3695
|
-
if (target.classList.contains('quickprev')) {
|
|
3696
|
-
newPage = currentPage - pagerCountOffset;
|
|
3697
|
-
} else if (target.classList.contains('quicknext')) {
|
|
3698
|
-
newPage = currentPage + pagerCountOffset;
|
|
3699
|
-
}
|
|
3700
|
-
}
|
|
3701
|
-
|
|
3702
|
-
// 验证并调整页码范围
|
|
3703
|
-
if (!isNaN(newPage)) {
|
|
3704
|
-
newPage = Math.max(1, Math.min(pageCount, newPage));
|
|
3705
|
-
} else {
|
|
3706
|
-
// 不是有效数字,不处理
|
|
3707
|
-
return;
|
|
3708
|
-
}
|
|
3709
|
-
|
|
3710
|
-
// 页码变化时触发事件
|
|
3711
|
-
if (newPage !== currentPage) {
|
|
3712
|
-
this.$emit('change', newPage);
|
|
3713
|
-
}
|
|
3714
|
-
},
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
// 处理鼠标悬停事件
|
|
3718
|
-
onMouseenter: function onMouseenter(direction) {
|
|
3719
|
-
if (this.disabled) {
|
|
3720
|
-
return;
|
|
3721
|
-
}
|
|
3722
|
-
// 根据方向更新图标
|
|
3723
|
-
if (direction === 'left') {
|
|
3724
|
-
this.quickprevIconClass = 'es-icon-zuo';
|
|
3725
|
-
} else {
|
|
3726
|
-
this.quicknextIconClass = 'es-icon-arrow-right';
|
|
3727
|
-
}
|
|
3728
|
-
}
|
|
3729
|
-
}
|
|
3730
|
-
});
|
|
3731
|
-
// CONCATENATED MODULE: ./packages/pagination/src/pager.vue?vue&type=script&lang=js&
|
|
3732
|
-
/* harmony default export */ var src_pagervue_type_script_lang_js_ = (pagervue_type_script_lang_js_);
|
|
3733
|
-
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
3734
|
-
var componentNormalizer = __webpack_require__(5);
|
|
3735
|
-
|
|
3736
|
-
// CONCATENATED MODULE: ./packages/pagination/src/pager.vue
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
/* normalize component */
|
|
3743
|
-
|
|
3744
|
-
var component = Object(componentNormalizer["a" /* default */])(
|
|
3745
|
-
src_pagervue_type_script_lang_js_,
|
|
3746
|
-
render,
|
|
3747
|
-
staticRenderFns,
|
|
3748
|
-
false,
|
|
3749
|
-
null,
|
|
3750
|
-
null,
|
|
3751
|
-
null
|
|
3752
|
-
|
|
3753
|
-
)
|
|
3754
|
-
|
|
3755
|
-
/* harmony default export */ var pager = (component.exports);
|
|
3756
|
-
// EXTERNAL MODULE: external "eoss/lib/select"
|
|
3757
|
-
var select_ = __webpack_require__(110);
|
|
3758
|
-
var select_default = /*#__PURE__*/__webpack_require__.n(select_);
|
|
3759
|
-
|
|
3760
|
-
// EXTERNAL MODULE: external "eoss/lib/option"
|
|
3761
|
-
var option_ = __webpack_require__(111);
|
|
3762
|
-
var option_default = /*#__PURE__*/__webpack_require__.n(option_);
|
|
3763
|
-
|
|
3764
|
-
// EXTERNAL MODULE: external "eoss/lib/input"
|
|
3765
|
-
var input_ = __webpack_require__(26);
|
|
3766
|
-
var input_default = /*#__PURE__*/__webpack_require__.n(input_);
|
|
3767
|
-
|
|
3768
|
-
// EXTERNAL MODULE: ./src/utils/util.js
|
|
3769
|
-
var util = __webpack_require__(0);
|
|
3770
|
-
|
|
3771
|
-
// CONCATENATED MODULE: ./packages/pagination/src/pagination.js
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
/**
|
|
3779
|
-
* 分页组件
|
|
3780
|
-
* @component EsPagination
|
|
3781
|
-
*/
|
|
3782
|
-
/* harmony default export */ var pagination = ({
|
|
3783
|
-
name: 'EsPagination',
|
|
3784
|
-
componentName: 'EsPagination',
|
|
3785
|
-
|
|
3786
|
-
props: {
|
|
3787
|
-
/**
|
|
3788
|
-
* 每页显示条目个数
|
|
3789
|
-
* @type {Number}
|
|
3790
|
-
* @default 10
|
|
3791
|
-
*/
|
|
3792
|
-
pageSize: {
|
|
3793
|
-
type: Number,
|
|
3794
|
-
default: 10
|
|
3795
|
-
},
|
|
3796
|
-
/**
|
|
3797
|
-
* 是否使用小型分页样式
|
|
3798
|
-
* @type {Boolean}
|
|
3799
|
-
* @default false
|
|
3800
|
-
*/
|
|
3801
|
-
small: Boolean,
|
|
3802
|
-
/**
|
|
3803
|
-
* 总条目数
|
|
3804
|
-
* @type {Number}
|
|
3805
|
-
* @default undefined
|
|
3806
|
-
*/
|
|
3807
|
-
total: Number,
|
|
3808
|
-
/**
|
|
3809
|
-
* 自定义显示总数文本
|
|
3810
|
-
* @type {String}
|
|
3811
|
-
* @default undefined
|
|
3812
|
-
*/
|
|
3813
|
-
totalText: String,
|
|
3814
|
-
/**
|
|
3815
|
-
* 总页数
|
|
3816
|
-
* @type {Number}
|
|
3817
|
-
* @default undefined
|
|
3818
|
-
*/
|
|
3819
|
-
pageCount: Number,
|
|
3820
|
-
/**
|
|
3821
|
-
* 页码按钮的数量,当总页数超过该值时会折叠
|
|
3822
|
-
* @type {Number}
|
|
3823
|
-
* @default 7
|
|
3824
|
-
* @validator 大于等于5且小于等于21的奇数
|
|
3825
|
-
*/
|
|
3826
|
-
pagerCount: {
|
|
3827
|
-
type: Number,
|
|
3828
|
-
validator: function validator(value) {
|
|
3829
|
-
return Number.isInteger(value) && value > 4 && value < 22 && value % 2 === 1;
|
|
3830
|
-
},
|
|
3831
|
-
|
|
3832
|
-
default: 7
|
|
3833
|
-
},
|
|
3834
|
-
/**
|
|
3835
|
-
* 当前页码
|
|
3836
|
-
* @type {Number}
|
|
3837
|
-
* @default 1
|
|
3838
|
-
*/
|
|
3839
|
-
currentPage: {
|
|
3840
|
-
type: Number,
|
|
3841
|
-
default: 1
|
|
3842
|
-
},
|
|
3843
|
-
/**
|
|
3844
|
-
* 组件布局,子组件名用逗号分隔
|
|
3845
|
-
* @type {String}
|
|
3846
|
-
* @default 'total,separate, sizes, prev, pager, next, jumper, ->'
|
|
3847
|
-
*/
|
|
3848
|
-
layout: {
|
|
3849
|
-
default: 'total,separate, sizes, prev, pager, next, jumper, ->'
|
|
3850
|
-
},
|
|
3851
|
-
/**
|
|
3852
|
-
* 每页显示个数选择器的选项设置
|
|
3853
|
-
* @type {Array<Number>}
|
|
3854
|
-
* @default [10, 20, 30, 40, 50, 100]
|
|
3855
|
-
*/
|
|
3856
|
-
pageSizes: {
|
|
3857
|
-
type: Array,
|
|
3858
|
-
default: function _default() {
|
|
3859
|
-
return [10, 20, 30, 40, 50, 100];
|
|
3860
|
-
}
|
|
3861
|
-
},
|
|
3862
|
-
/**
|
|
3863
|
-
* 每页显示个数选择器的下拉框类名
|
|
3864
|
-
* @type {String}
|
|
3865
|
-
* @default ''
|
|
3866
|
-
*/
|
|
3867
|
-
popperClass: String,
|
|
3868
|
-
/**
|
|
3869
|
-
* 替代图标显示的上一页文本
|
|
3870
|
-
* @type {String}
|
|
3871
|
-
* @default ''
|
|
3872
|
-
*/
|
|
3873
|
-
prevText: String,
|
|
3874
|
-
/**
|
|
3875
|
-
* 替代图标显示的下一页文本
|
|
3876
|
-
* @type {String}
|
|
3877
|
-
* @default ''
|
|
3878
|
-
*/
|
|
3879
|
-
nextText: String,
|
|
3880
|
-
/**
|
|
3881
|
-
* 是否为分页按钮添加背景色
|
|
3882
|
-
* @type {Boolean}
|
|
3883
|
-
* @default false
|
|
3884
|
-
*/
|
|
3885
|
-
background: Boolean,
|
|
3886
|
-
/**
|
|
3887
|
-
* 是否显示边框
|
|
3888
|
-
* @type {Boolean}
|
|
3889
|
-
* @default true
|
|
3890
|
-
*/
|
|
3891
|
-
border: {
|
|
3892
|
-
type: Boolean,
|
|
3893
|
-
default: true
|
|
3894
|
-
},
|
|
3895
|
-
/**
|
|
3896
|
-
* 是否禁用
|
|
3897
|
-
* @type {Boolean}
|
|
3898
|
-
* @default false
|
|
3899
|
-
*/
|
|
3900
|
-
disabled: Boolean,
|
|
3901
|
-
/**
|
|
3902
|
-
* 只有一页时是否隐藏
|
|
3903
|
-
* @type {Boolean}
|
|
3904
|
-
* @default false
|
|
3905
|
-
*/
|
|
3906
|
-
hideOnSinglePage: Boolean,
|
|
3907
|
-
/**
|
|
3908
|
-
* 是否显示每页单位文本
|
|
3909
|
-
* @type {Boolean}
|
|
3910
|
-
* @default true
|
|
3911
|
-
*/
|
|
3912
|
-
unit: {
|
|
3913
|
-
type: Boolean,
|
|
3914
|
-
default: true
|
|
3915
|
-
}
|
|
3916
|
-
},
|
|
3917
|
-
|
|
3918
|
-
data: function data() {
|
|
3919
|
-
return {
|
|
3920
|
-
internalCurrentPage: 1,
|
|
3921
|
-
internalPageSize: 0,
|
|
3922
|
-
lastEmittedPage: -1,
|
|
3923
|
-
userChangePageSize: false
|
|
3924
|
-
};
|
|
3925
|
-
},
|
|
3926
|
-
render: function render(h) {
|
|
3927
|
-
var layout = this.layout;
|
|
3928
|
-
// 无布局或单页隐藏模式下不渲染
|
|
3929
|
-
if (!layout) return null;
|
|
3930
|
-
if (this.hideOnSinglePage && (!this.internalPageCount || this.internalPageCount === 1)) return null;
|
|
3931
|
-
|
|
3932
|
-
// 创建主容器
|
|
3933
|
-
var template = h('div', { 'class': ['es-pagination', {
|
|
3934
|
-
'is-background': this.background,
|
|
3935
|
-
'is-border': this.border,
|
|
3936
|
-
'es-pagination--small': this.small
|
|
3937
|
-
}] });
|
|
3938
|
-
|
|
3939
|
-
// 定义组件映射关系
|
|
3940
|
-
var TEMPLATE_MAP = {
|
|
3941
|
-
separate: h('div', { 'class': 'es-pagination__separate' }),
|
|
3942
|
-
prev: h('prev'),
|
|
3943
|
-
jumper: h('jumper'),
|
|
3944
|
-
pager: h('pager', {
|
|
3945
|
-
attrs: {
|
|
3946
|
-
currentPage: this.internalCurrentPage,
|
|
3947
|
-
pageCount: this.internalPageCount,
|
|
3948
|
-
pagerCount: this.pagerCount,
|
|
3949
|
-
|
|
3950
|
-
disabled: this.disabled },
|
|
3951
|
-
on: {
|
|
3952
|
-
'change': this.handleCurrentChange
|
|
3953
|
-
}
|
|
3954
|
-
}),
|
|
3955
|
-
next: h('next'),
|
|
3956
|
-
sizes: h('sizes', {
|
|
3957
|
-
attrs: { pageSizes: this.pageSizes }
|
|
3958
|
-
}),
|
|
3959
|
-
slot: h('slot', [this.$slots.default || '']),
|
|
3960
|
-
total: h('total')
|
|
3961
|
-
};
|
|
3962
|
-
|
|
3963
|
-
// 解析布局配置
|
|
3964
|
-
var components = layout.split(',').map(function (item) {
|
|
3965
|
-
return item.trim();
|
|
3966
|
-
});
|
|
3967
|
-
var rightWrapper = h('div', { 'class': 'es-pagination__rightwrapper' });
|
|
3968
|
-
var haveRightWrapper = false;
|
|
3969
|
-
|
|
3970
|
-
template.children = template.children || [];
|
|
3971
|
-
rightWrapper.children = rightWrapper.children || [];
|
|
3972
|
-
|
|
3973
|
-
// 构建组件结构
|
|
3974
|
-
components.forEach(function (compo) {
|
|
3975
|
-
if (compo === '->') {
|
|
3976
|
-
haveRightWrapper = true;
|
|
3977
|
-
return;
|
|
3978
|
-
}
|
|
3979
|
-
|
|
3980
|
-
var component = TEMPLATE_MAP[compo];
|
|
3981
|
-
if (component) {
|
|
3982
|
-
if (!haveRightWrapper) {
|
|
3983
|
-
template.children.push(component);
|
|
3984
|
-
} else {
|
|
3985
|
-
rightWrapper.children.push(component);
|
|
3986
|
-
}
|
|
3987
|
-
}
|
|
3988
|
-
});
|
|
3989
|
-
|
|
3990
|
-
// 添加右侧包装器
|
|
3991
|
-
if (haveRightWrapper && rightWrapper.children.length > 0) {
|
|
3992
|
-
template.children.unshift(rightWrapper);
|
|
3993
|
-
}
|
|
3994
|
-
|
|
3995
|
-
return template;
|
|
3996
|
-
},
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
components: {
|
|
4000
|
-
// 上一页组件
|
|
4001
|
-
Prev: {
|
|
4002
|
-
render: function render(h) {
|
|
4003
|
-
var parent = this.$parent;
|
|
4004
|
-
return h(
|
|
4005
|
-
'button',
|
|
4006
|
-
{
|
|
4007
|
-
attrs: {
|
|
4008
|
-
type: 'button',
|
|
4009
|
-
|
|
4010
|
-
disabled: parent.disabled || parent.internalCurrentPage <= 1
|
|
4011
|
-
},
|
|
4012
|
-
'class': 'btn-prev', on: {
|
|
4013
|
-
'click': parent.prev
|
|
4014
|
-
}
|
|
4015
|
-
},
|
|
4016
|
-
[parent.prevText ? h('span', [parent.prevText]) : h('i', { 'class': 'es-icon es-icon-zuo' })]
|
|
4017
|
-
);
|
|
4018
|
-
}
|
|
4019
|
-
},
|
|
4020
|
-
|
|
4021
|
-
// 下一页组件
|
|
4022
|
-
Next: {
|
|
4023
|
-
render: function render(h) {
|
|
4024
|
-
var parent = this.$parent;
|
|
4025
|
-
return h(
|
|
4026
|
-
'button',
|
|
4027
|
-
{
|
|
4028
|
-
attrs: {
|
|
4029
|
-
type: 'button',
|
|
4030
|
-
|
|
4031
|
-
disabled: parent.disabled || parent.internalCurrentPage === parent.internalPageCount || parent.internalPageCount === 0
|
|
4032
|
-
},
|
|
4033
|
-
'class': 'btn-next', on: {
|
|
4034
|
-
'click': parent.next
|
|
4035
|
-
}
|
|
4036
|
-
},
|
|
4037
|
-
[parent.nextText ? h('span', [parent.nextText]) : h('i', { 'class': 'es-icon es-icon-you' })]
|
|
4038
|
-
);
|
|
4039
|
-
}
|
|
4040
|
-
},
|
|
4041
|
-
|
|
4042
|
-
// 每页条数选择组件
|
|
4043
|
-
Sizes: {
|
|
4044
|
-
props: {
|
|
4045
|
-
pageSizes: Array
|
|
4046
|
-
},
|
|
4047
|
-
|
|
4048
|
-
watch: {
|
|
4049
|
-
pageSizes: {
|
|
4050
|
-
immediate: true,
|
|
4051
|
-
handler: function handler(newVal, oldVal) {
|
|
4052
|
-
if (Object(util["Y" /* valueEquals */])(newVal, oldVal)) return;
|
|
4053
|
-
if (Array.isArray(newVal)) {
|
|
4054
|
-
var parent = this.$parent;
|
|
4055
|
-
parent.internalPageSize = newVal.indexOf(parent.pageSize) > -1 ? parent.pageSize : this.pageSizes[0];
|
|
4056
|
-
}
|
|
4057
|
-
}
|
|
4058
|
-
}
|
|
4059
|
-
},
|
|
4060
|
-
|
|
4061
|
-
render: function render(h) {
|
|
4062
|
-
var parent = this.$parent;
|
|
4063
|
-
return h(
|
|
4064
|
-
'span',
|
|
4065
|
-
{ 'class': 'es-pagination__sizes' },
|
|
4066
|
-
[h(
|
|
4067
|
-
'es-select',
|
|
4068
|
-
{
|
|
4069
|
-
attrs: {
|
|
4070
|
-
value: parent.internalPageSize,
|
|
4071
|
-
popperClass: parent.popperClass || '',
|
|
4072
|
-
size: 'medium',
|
|
4073
|
-
|
|
4074
|
-
disabled: parent.disabled },
|
|
4075
|
-
on: {
|
|
4076
|
-
'input': this.handleChange
|
|
4077
|
-
}
|
|
4078
|
-
},
|
|
4079
|
-
[this.pageSizes.map(function (item) {
|
|
4080
|
-
return h('es-option', {
|
|
4081
|
-
key: item,
|
|
4082
|
-
attrs: { value: item,
|
|
4083
|
-
label: item + (parent.unit ? '条/页' : '') }
|
|
4084
|
-
});
|
|
4085
|
-
})]
|
|
4086
|
-
)]
|
|
4087
|
-
);
|
|
4088
|
-
},
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
components: {
|
|
4092
|
-
EsSelect: select_default.a,
|
|
4093
|
-
EsOption: option_default.a
|
|
4094
|
-
},
|
|
4095
|
-
|
|
4096
|
-
methods: {
|
|
4097
|
-
handleChange: function handleChange(val) {
|
|
4098
|
-
var parent = this.$parent;
|
|
4099
|
-
if (val !== parent.internalPageSize) {
|
|
4100
|
-
parent.internalPageSize = val = parseInt(val, 10);
|
|
4101
|
-
parent.userChangePageSize = true;
|
|
4102
|
-
parent.$emit('update:pageSize', val);
|
|
4103
|
-
parent.$emit('size-change', val);
|
|
4104
|
-
}
|
|
4105
|
-
}
|
|
4106
|
-
}
|
|
4107
|
-
},
|
|
4108
|
-
|
|
4109
|
-
// 页码跳转组件
|
|
4110
|
-
Jumper: {
|
|
4111
|
-
components: { EsInput: input_default.a },
|
|
4112
|
-
|
|
4113
|
-
data: function data() {
|
|
4114
|
-
return {
|
|
4115
|
-
userInput: null
|
|
4116
|
-
};
|
|
4117
|
-
},
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
watch: {
|
|
4121
|
-
'$parent.internalCurrentPage': function $parentInternalCurrentPage() {
|
|
4122
|
-
// 页码变化时重置用户输入
|
|
4123
|
-
this.userInput = null;
|
|
4124
|
-
}
|
|
4125
|
-
},
|
|
4126
|
-
|
|
4127
|
-
methods: {
|
|
4128
|
-
// 处理键盘事件
|
|
4129
|
-
handleKeyup: function handleKeyup(_ref) {
|
|
4130
|
-
var keyCode = _ref.keyCode,
|
|
4131
|
-
target = _ref.target;
|
|
4132
|
-
|
|
4133
|
-
// Enter键触发跳转
|
|
4134
|
-
if (keyCode === 13) {
|
|
4135
|
-
this.handleChange(target.value);
|
|
4136
|
-
}
|
|
4137
|
-
},
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
// 处理输入变化
|
|
4141
|
-
handleInput: function handleInput(value) {
|
|
4142
|
-
this.userInput = value;
|
|
4143
|
-
},
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
// 处理跳转逻辑
|
|
4147
|
-
handleChange: function handleChange(value) {
|
|
4148
|
-
var parent = this.$parent;
|
|
4149
|
-
parent.internalCurrentPage = parent.getValidCurrentPage(value);
|
|
4150
|
-
parent.emitChange();
|
|
4151
|
-
this.userInput = null;
|
|
4152
|
-
}
|
|
4153
|
-
},
|
|
4154
|
-
|
|
4155
|
-
render: function render(h) {
|
|
4156
|
-
var parent = this.$parent;
|
|
4157
|
-
// 检查是否有有效页数且页数大于1
|
|
4158
|
-
var hasPageCount = typeof parent.internalPageCount === 'number' && parent.internalPageCount > 1;
|
|
4159
|
-
|
|
4160
|
-
return h(
|
|
4161
|
-
'span',
|
|
4162
|
-
{ 'class': 'es-pagination__jump' },
|
|
4163
|
-
[h('span', ['\u8DF3\u81F3']), h(
|
|
4164
|
-
'es-input',
|
|
4165
|
-
{
|
|
4166
|
-
'class': ['es-pagination__editor', hasPageCount && 'es-pagination__pageCount', 'is-in-pagination'].filter(Boolean).join(' '),
|
|
4167
|
-
attrs: { min: 1,
|
|
4168
|
-
max: parent.internalPageCount,
|
|
4169
|
-
value: this.userInput !== null ? this.userInput : parent.internalCurrentPage,
|
|
4170
|
-
type: 'number',
|
|
4171
|
-
disabled: parent.disabled
|
|
4172
|
-
},
|
|
4173
|
-
nativeOn: {
|
|
4174
|
-
'keyup': this.handleKeyup
|
|
4175
|
-
},
|
|
4176
|
-
on: {
|
|
4177
|
-
'input': this.handleInput,
|
|
4178
|
-
'change': this.handleChange
|
|
4179
|
-
}
|
|
4180
|
-
},
|
|
4181
|
-
[hasPageCount ? h(
|
|
4182
|
-
'template',
|
|
4183
|
-
{ slot: 'append' },
|
|
4184
|
-
['/', parent.internalPageCount, '\u9875']
|
|
4185
|
-
) : '']
|
|
4186
|
-
)]
|
|
4187
|
-
);
|
|
4188
|
-
}
|
|
4189
|
-
},
|
|
4190
|
-
|
|
4191
|
-
// 总数显示组件
|
|
4192
|
-
Total: {
|
|
4193
|
-
render: function render(h) {
|
|
4194
|
-
var parent = this.$parent;
|
|
4195
|
-
|
|
4196
|
-
return typeof parent.total === 'number' ? h(
|
|
4197
|
-
'span',
|
|
4198
|
-
{ 'class': 'es-pagination__total' },
|
|
4199
|
-
[parent.totalText ? parent.totalText.replace('{total}', parent.total) : '\u5171 ' + parent.total + ' \u9879\u6570\u636E']
|
|
4200
|
-
) : '';
|
|
4201
|
-
}
|
|
4202
|
-
},
|
|
4203
|
-
|
|
4204
|
-
Pager: pager
|
|
4205
|
-
},
|
|
4206
|
-
|
|
4207
|
-
methods: {
|
|
4208
|
-
/**
|
|
4209
|
-
* 处理页码变化
|
|
4210
|
-
* @param {Number} val - 新的页码
|
|
4211
|
-
*/
|
|
4212
|
-
handleCurrentChange: function handleCurrentChange(val) {
|
|
4213
|
-
this.internalCurrentPage = this.getValidCurrentPage(val);
|
|
4214
|
-
this.userChangePageSize = true;
|
|
4215
|
-
this.emitChange();
|
|
4216
|
-
},
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
/**
|
|
4220
|
-
* 上一页
|
|
4221
|
-
*/
|
|
4222
|
-
prev: function prev() {
|
|
4223
|
-
if (this.disabled) return;
|
|
4224
|
-
var newVal = this.internalCurrentPage - 1;
|
|
4225
|
-
this.internalCurrentPage = this.getValidCurrentPage(newVal);
|
|
4226
|
-
this.$emit('prev-click', this.internalCurrentPage);
|
|
4227
|
-
this.emitChange();
|
|
4228
|
-
},
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
/**
|
|
4232
|
-
* 下一页
|
|
4233
|
-
*/
|
|
4234
|
-
next: function next() {
|
|
4235
|
-
if (this.disabled) return;
|
|
4236
|
-
var newVal = this.internalCurrentPage + 1;
|
|
4237
|
-
this.internalCurrentPage = this.getValidCurrentPage(newVal);
|
|
4238
|
-
this.$emit('next-click', this.internalCurrentPage);
|
|
4239
|
-
this.emitChange();
|
|
4240
|
-
},
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
/**
|
|
4244
|
-
* 获取有效的当前页码
|
|
4245
|
-
* @param {Number} value - 输入的页码
|
|
4246
|
-
* @returns {Number} 有效的页码
|
|
4247
|
-
*/
|
|
4248
|
-
getValidCurrentPage: function getValidCurrentPage(value) {
|
|
4249
|
-
// 转换为整数
|
|
4250
|
-
value = parseInt(value, 10);
|
|
4251
|
-
|
|
4252
|
-
var havePageCount = typeof this.internalPageCount === 'number';
|
|
4253
|
-
var resetValue = void 0;
|
|
4254
|
-
|
|
4255
|
-
if (!havePageCount) {
|
|
4256
|
-
// 没有总页数限制时,确保页码至少为1
|
|
4257
|
-
if (isNaN(value) || value < 1) {
|
|
4258
|
-
resetValue = 1;
|
|
4259
|
-
}
|
|
4260
|
-
} else {
|
|
4261
|
-
// 有总页数限制时,确保页码在有效范围内
|
|
4262
|
-
if (value < 1) {
|
|
4263
|
-
resetValue = 1;
|
|
4264
|
-
} else if (value > this.internalPageCount) {
|
|
4265
|
-
resetValue = this.internalPageCount;
|
|
4266
|
-
}
|
|
4267
|
-
}
|
|
4268
|
-
|
|
4269
|
-
// 处理特殊情况
|
|
4270
|
-
if (resetValue === undefined && isNaN(value)) {
|
|
4271
|
-
resetValue = 1;
|
|
4272
|
-
} else if (resetValue === 0) {
|
|
4273
|
-
resetValue = 1;
|
|
4274
|
-
}
|
|
4275
|
-
|
|
4276
|
-
return resetValue === undefined ? value : resetValue;
|
|
4277
|
-
},
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
/**
|
|
4281
|
-
* 触发页码变化事件
|
|
4282
|
-
*/
|
|
4283
|
-
emitChange: function emitChange() {
|
|
4284
|
-
var _this = this;
|
|
4285
|
-
|
|
4286
|
-
this.$nextTick(function () {
|
|
4287
|
-
if (_this.internalCurrentPage !== _this.lastEmittedPage || _this.userChangePageSize) {
|
|
4288
|
-
_this.$emit('current-change', _this.internalCurrentPage);
|
|
4289
|
-
_this.lastEmittedPage = _this.internalCurrentPage;
|
|
4290
|
-
_this.userChangePageSize = false;
|
|
4291
|
-
}
|
|
4292
|
-
});
|
|
4293
|
-
}
|
|
4294
|
-
},
|
|
4295
|
-
|
|
4296
|
-
computed: {
|
|
4297
|
-
/**
|
|
4298
|
-
* 计算内部总页数
|
|
4299
|
-
* @returns {Number|null} 总页数或null
|
|
4300
|
-
*/
|
|
4301
|
-
internalPageCount: function internalPageCount() {
|
|
4302
|
-
if (typeof this.total === 'number') {
|
|
4303
|
-
// 根据总数和每页条数计算总页数
|
|
4304
|
-
return Math.max(1, Math.ceil(this.total / this.internalPageSize));
|
|
4305
|
-
} else if (typeof this.pageCount === 'number') {
|
|
4306
|
-
// 使用传入的总页数
|
|
4307
|
-
return Math.max(1, this.pageCount);
|
|
4308
|
-
}
|
|
4309
|
-
return null;
|
|
4310
|
-
}
|
|
4311
|
-
},
|
|
4312
|
-
|
|
4313
|
-
watch: {
|
|
4314
|
-
// 监听外部当前页码变化
|
|
4315
|
-
currentPage: {
|
|
4316
|
-
immediate: true,
|
|
4317
|
-
handler: function handler(val) {
|
|
4318
|
-
this.internalCurrentPage = this.getValidCurrentPage(val);
|
|
4319
|
-
}
|
|
4320
|
-
},
|
|
4321
|
-
|
|
4322
|
-
// 监听每页显示条数变化
|
|
4323
|
-
pageSize: {
|
|
4324
|
-
immediate: true,
|
|
4325
|
-
handler: function handler(val) {
|
|
4326
|
-
this.internalPageSize = isNaN(val) ? 10 : val;
|
|
4327
|
-
}
|
|
4328
|
-
},
|
|
4329
|
-
|
|
4330
|
-
// 监听内部当前页码变化
|
|
4331
|
-
internalCurrentPage: {
|
|
4332
|
-
immediate: true,
|
|
4333
|
-
handler: function handler(newVal) {
|
|
4334
|
-
this.$emit('update:currentPage', newVal);
|
|
4335
|
-
this.lastEmittedPage = -1;
|
|
4336
|
-
}
|
|
4337
|
-
},
|
|
4338
|
-
|
|
4339
|
-
// 监听总页数变化
|
|
4340
|
-
internalPageCount: function internalPageCount(newVal) {
|
|
4341
|
-
var oldPage = this.internalCurrentPage;
|
|
4342
|
-
if (newVal > 0 && oldPage === 0) {
|
|
4343
|
-
this.internalCurrentPage = 1;
|
|
4344
|
-
} else if (oldPage > newVal) {
|
|
4345
|
-
this.internalCurrentPage = newVal === 0 ? 1 : newVal;
|
|
4346
|
-
if (this.userChangePageSize) {
|
|
4347
|
-
this.emitChange();
|
|
4348
|
-
}
|
|
4349
|
-
}
|
|
4350
|
-
this.userChangePageSize = false;
|
|
4351
|
-
}
|
|
4352
|
-
}
|
|
4353
|
-
});
|
|
4354
|
-
// CONCATENATED MODULE: ./packages/pagination/index.js
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
/* istanbul ignore next */
|
|
4358
|
-
pagination.install = function (Vue) {
|
|
4359
|
-
Vue.component(pagination.name, pagination);
|
|
4360
|
-
};
|
|
4361
|
-
|
|
4362
|
-
/* harmony default export */ var packages_pagination = __webpack_exports__["default"] = (pagination);
|
|
4363
|
-
|
|
4364
|
-
/***/ }),
|
|
4365
|
-
|
|
4366
|
-
/***/ 2:
|
|
4367
|
-
/***/ (function(module, exports) {
|
|
4368
|
-
|
|
4369
|
-
module.exports = require("vue");
|
|
4370
|
-
|
|
4371
|
-
/***/ }),
|
|
4372
|
-
|
|
4373
|
-
/***/ 26:
|
|
4374
|
-
/***/ (function(module, exports) {
|
|
4375
|
-
|
|
4376
|
-
module.exports = require("eoss/lib/input");
|
|
4377
|
-
|
|
4378
|
-
/***/ }),
|
|
4379
|
-
|
|
4380
|
-
/***/ 3:
|
|
4381
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
4382
|
-
|
|
4383
|
-
"use strict";
|
|
4384
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isString; });
|
|
4385
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isObject; });
|
|
4386
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isHtmlElement; });
|
|
4387
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isFunction; });
|
|
4388
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isUndefined; });
|
|
4389
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isDefined; });
|
|
4390
|
-
/**
|
|
4391
|
-
* 检查一个值是否为字符串类型
|
|
4392
|
-
* @param {*} obj 要检查的值
|
|
4393
|
-
* @returns {boolean} 如果值为字符串则返回true,否则返回false
|
|
4394
|
-
*/
|
|
4395
|
-
function isString(obj) {
|
|
4396
|
-
return Object.prototype.toString.call(obj) === '[object String]';
|
|
4397
|
-
}
|
|
4398
|
-
|
|
4399
|
-
/**
|
|
4400
|
-
* 检查一个值是否为对象类型
|
|
4401
|
-
* @param {*} obj 要检查的值
|
|
4402
|
-
* @returns {boolean} 如果值为对象则返回true,否则返回false
|
|
4403
|
-
*/
|
|
4404
|
-
function isObject(obj) {
|
|
4405
|
-
return Object.prototype.toString.call(obj) === '[object Object]';
|
|
4406
|
-
}
|
|
4407
|
-
|
|
4408
|
-
/**
|
|
4409
|
-
* 检查一个节点是否为HTML元素
|
|
4410
|
-
* @param {Node} node 要检查的节点
|
|
4411
|
-
* @returns {boolean} 如果节点为HTML元素则返回true,否则返回false
|
|
4412
|
-
*/
|
|
4413
|
-
function isHtmlElement(node) {
|
|
4414
|
-
return node && node.nodeType === Node.ELEMENT_NODE;
|
|
4415
|
-
}
|
|
4416
|
-
|
|
4417
|
-
/**
|
|
4418
|
-
* 检查一个值是否为函数类型
|
|
4419
|
-
* @param {*} functionToCheck 要检查的值
|
|
4420
|
-
* @returns {boolean} 如果值为函数则返回true,否则返回false
|
|
4421
|
-
*/
|
|
4422
|
-
function isFunction(functionToCheck) {
|
|
4423
|
-
var getType = {};
|
|
4424
|
-
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
|
|
4425
|
-
}
|
|
4426
|
-
|
|
4427
|
-
/**
|
|
4428
|
-
* 检查一个值是否为undefined
|
|
4429
|
-
* @param {*} val 要检查的值
|
|
4430
|
-
* @returns {boolean} 如果值为undefined则返回true,否则返回false
|
|
4431
|
-
*/
|
|
4432
|
-
function isUndefined(val) {
|
|
4433
|
-
return val === void 0;
|
|
4434
|
-
}
|
|
4435
|
-
|
|
4436
|
-
/**
|
|
4437
|
-
* 检查一个值是否已定义(不是undefined或null)
|
|
4438
|
-
* @param {*} val 要检查的值
|
|
4439
|
-
* @returns {boolean} 如果值已定义则返回true,否则返回false
|
|
4440
|
-
*/
|
|
4441
|
-
function isDefined(val) {
|
|
4442
|
-
return val !== undefined && val !== null;
|
|
4443
|
-
}
|
|
4444
|
-
|
|
4445
|
-
/***/ }),
|
|
4446
|
-
|
|
4447
|
-
/***/ 5:
|
|
4448
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
4449
|
-
|
|
4450
|
-
"use strict";
|
|
4451
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
|
|
4452
|
-
/* globals __VUE_SSR_CONTEXT__ */
|
|
4453
|
-
|
|
4454
|
-
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
|
|
4455
|
-
// This module is a runtime utility for cleaner component module output and will
|
|
4456
|
-
// be included in the final webpack user bundle.
|
|
4457
|
-
|
|
4458
|
-
function normalizeComponent(
|
|
4459
|
-
scriptExports,
|
|
4460
|
-
render,
|
|
4461
|
-
staticRenderFns,
|
|
4462
|
-
functionalTemplate,
|
|
4463
|
-
injectStyles,
|
|
4464
|
-
scopeId,
|
|
4465
|
-
moduleIdentifier /* server only */,
|
|
4466
|
-
shadowMode /* vue-cli only */
|
|
4467
|
-
) {
|
|
4468
|
-
// Vue.extend constructor export interop
|
|
4469
|
-
var options =
|
|
4470
|
-
typeof scriptExports === 'function' ? scriptExports.options : scriptExports
|
|
4471
|
-
|
|
4472
|
-
// render functions
|
|
4473
|
-
if (render) {
|
|
4474
|
-
options.render = render
|
|
4475
|
-
options.staticRenderFns = staticRenderFns
|
|
4476
|
-
options._compiled = true
|
|
4477
|
-
}
|
|
4478
|
-
|
|
4479
|
-
// functional template
|
|
4480
|
-
if (functionalTemplate) {
|
|
4481
|
-
options.functional = true
|
|
4482
|
-
}
|
|
4483
|
-
|
|
4484
|
-
// scopedId
|
|
4485
|
-
if (scopeId) {
|
|
4486
|
-
options._scopeId = 'data-v-' + scopeId
|
|
4487
|
-
}
|
|
4488
|
-
|
|
4489
|
-
var hook
|
|
4490
|
-
if (moduleIdentifier) {
|
|
4491
|
-
// server build
|
|
4492
|
-
hook = function (context) {
|
|
4493
|
-
// 2.3 injection
|
|
4494
|
-
context =
|
|
4495
|
-
context || // cached call
|
|
4496
|
-
(this.$vnode && this.$vnode.ssrContext) || // stateful
|
|
4497
|
-
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
|
|
4498
|
-
// 2.2 with runInNewContext: true
|
|
4499
|
-
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
4500
|
-
context = __VUE_SSR_CONTEXT__
|
|
4501
|
-
}
|
|
4502
|
-
// inject component styles
|
|
4503
|
-
if (injectStyles) {
|
|
4504
|
-
injectStyles.call(this, context)
|
|
4505
|
-
}
|
|
4506
|
-
// register component module identifier for async chunk inferrence
|
|
4507
|
-
if (context && context._registeredComponents) {
|
|
4508
|
-
context._registeredComponents.add(moduleIdentifier)
|
|
4509
|
-
}
|
|
4510
|
-
}
|
|
4511
|
-
// used by ssr in case component is cached and beforeCreate
|
|
4512
|
-
// never gets called
|
|
4513
|
-
options._ssrRegister = hook
|
|
4514
|
-
} else if (injectStyles) {
|
|
4515
|
-
hook = shadowMode
|
|
4516
|
-
? function () {
|
|
4517
|
-
injectStyles.call(
|
|
4518
|
-
this,
|
|
4519
|
-
(options.functional ? this.parent : this).$root.$options.shadowRoot
|
|
4520
|
-
)
|
|
4521
|
-
}
|
|
4522
|
-
: injectStyles
|
|
4523
|
-
}
|
|
4524
|
-
|
|
4525
|
-
if (hook) {
|
|
4526
|
-
if (options.functional) {
|
|
4527
|
-
// for template-only hot-reload because in that case the render fn doesn't
|
|
4528
|
-
// go through the normalizer
|
|
4529
|
-
options._injectStyles = hook
|
|
4530
|
-
// register for functional component in vue file
|
|
4531
|
-
var originalRender = options.render
|
|
4532
|
-
options.render = function renderWithStyleInjection(h, context) {
|
|
4533
|
-
hook.call(context)
|
|
4534
|
-
return originalRender(h, context)
|
|
4535
|
-
}
|
|
4536
|
-
} else {
|
|
4537
|
-
// inject component registration as beforeCreate hook
|
|
4538
|
-
var existing = options.beforeCreate
|
|
4539
|
-
options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
|
|
4540
|
-
}
|
|
4541
|
-
}
|
|
4542
|
-
|
|
4543
|
-
return {
|
|
4544
|
-
exports: scriptExports,
|
|
4545
|
-
options: options
|
|
4546
|
-
}
|
|
4547
|
-
}
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
/***/ }),
|
|
4551
|
-
|
|
4552
|
-
/***/ 6:
|
|
4553
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
4554
|
-
|
|
4555
3013
|
"use strict";
|
|
4556
3014
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return fecha; });
|
|
4557
3015
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return getSettings; });
|
|
@@ -5386,156 +3844,1799 @@ const dateDiff = function (start_date, end_date, unit = 'day') {
|
|
|
5386
3844
|
};
|
|
5387
3845
|
|
|
5388
3846
|
/**
|
|
5389
|
-
* 获取月份中的日期
|
|
5390
|
-
* @param {string} date - 日期字符串,格式为 "YYYY-MM-DD"
|
|
5391
|
-
* @returns {number} 月份中的日期(1-31)
|
|
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表示星期日)
|
|
5392
3957
|
*/
|
|
5393
|
-
const
|
|
5394
|
-
if (
|
|
5395
|
-
|
|
5396
|
-
"Invalid input. Please provide a valid date string in the format 'YYYY-MM-DD'."
|
|
5397
|
-
);
|
|
3958
|
+
const getWeekday = function (date) {
|
|
3959
|
+
if (!date) {
|
|
3960
|
+
return new Date().getDay();
|
|
5398
3961
|
}
|
|
5399
|
-
|
|
5400
|
-
|
|
5401
|
-
if (isNaN(dateObj.getTime())) {
|
|
5402
|
-
throw new Error(
|
|
5403
|
-
"Invalid date format. Please provide a valid date string in the format 'YYYY-MM-DD'."
|
|
5404
|
-
);
|
|
3962
|
+
if (typeof date === 'string') {
|
|
3963
|
+
date = new Date(date);
|
|
5405
3964
|
}
|
|
5406
|
-
|
|
5407
|
-
return dateObj.getDate();
|
|
3965
|
+
return date.getDay();
|
|
5408
3966
|
};
|
|
5409
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
|
+
/***/ 112:
|
|
4001
|
+
/***/ (function(module, exports) {
|
|
4002
|
+
|
|
4003
|
+
module.exports = require("eoss/lib/select");
|
|
4004
|
+
|
|
4005
|
+
/***/ }),
|
|
4006
|
+
|
|
4007
|
+
/***/ 113:
|
|
4008
|
+
/***/ (function(module, exports) {
|
|
4009
|
+
|
|
4010
|
+
module.exports = require("eoss/lib/option");
|
|
4011
|
+
|
|
4012
|
+
/***/ }),
|
|
4013
|
+
|
|
4014
|
+
/***/ 13:
|
|
4015
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
4016
|
+
|
|
4017
|
+
"use strict";
|
|
4018
|
+
/* unused harmony export getHue */
|
|
4019
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getColor; });
|
|
4020
|
+
/* unused harmony export getLightness */
|
|
4021
|
+
/* unused harmony export getSaturation */
|
|
4022
|
+
/* unused harmony export rgbToHsv */
|
|
4023
|
+
/* unused harmony export hsvTorgb */
|
|
4024
|
+
/* unused harmony export mixColor */
|
|
4025
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getRgb; });
|
|
4026
|
+
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
4027
|
+
|
|
4028
|
+
var $hueStep = 2;
|
|
4029
|
+
var $saturationStep1 = 0.16;
|
|
4030
|
+
var $saturationStep2 = 0.05;
|
|
4031
|
+
var $brightnessStep1 = 0.05;
|
|
4032
|
+
var $brightnessStep2 = 0.15;
|
|
4033
|
+
var $lightColorCount = 5;
|
|
4034
|
+
var $darkColorCount = 4;
|
|
4035
|
+
/**
|
|
4036
|
+
* getHue
|
|
4037
|
+
* @desc:转换色相
|
|
4038
|
+
* @author huangbo
|
|
4039
|
+
* @date 2022年5月7日
|
|
4040
|
+
**/
|
|
4041
|
+
var getHue = function getHue($h, $i, $isLight) {
|
|
4042
|
+
var $hue = void 0;
|
|
4043
|
+
if ($h >= 60 && $h <= 240) {
|
|
4044
|
+
$hue = $isLight ? $h - $hueStep * $i : $h + $hueStep * $i;
|
|
4045
|
+
} else {
|
|
4046
|
+
$hue = $isLight ? $h + $hueStep * $i : $h - $hueStep * $i;
|
|
4047
|
+
}
|
|
4048
|
+
$hue = ($hue + 360) % 360;
|
|
4049
|
+
return Math.round($hue);
|
|
4050
|
+
};
|
|
4051
|
+
|
|
4052
|
+
/**
|
|
4053
|
+
* getColor
|
|
4054
|
+
* @desc:根据颜色和对应的色板位置,计算出对应的色板颜色
|
|
4055
|
+
* @author huangbo
|
|
4056
|
+
* @date 2022年5月7日
|
|
4057
|
+
**/
|
|
4058
|
+
var getColor = function getColor($color, $n) {
|
|
4059
|
+
var $isLight = $n < 7;
|
|
4060
|
+
var $hsv = rgbToHsv($color);
|
|
4061
|
+
// 这里将i转换成以主色为中心,两侧的i值逐渐增大
|
|
4062
|
+
var $i = $isLight ? $lightColorCount + 1 - $n : $n - $lightColorCount - 1;
|
|
4063
|
+
var color = hsvTorgb(getHue($hsv[0], $i, $isLight), getSaturation($hsv[1], $i, $isLight), getLightness($hsv[2], $i, $isLight));
|
|
4064
|
+
return color;
|
|
4065
|
+
};
|
|
4066
|
+
|
|
4067
|
+
/**
|
|
4068
|
+
* getLightness
|
|
4069
|
+
* @desc:转换明度
|
|
4070
|
+
* @author huangbo
|
|
4071
|
+
* @date 2022年5月7日
|
|
4072
|
+
* @return {string,array} 元素类名或者id
|
|
4073
|
+
**/
|
|
4074
|
+
var getLightness = function getLightness($v, $i, $isLight) {
|
|
4075
|
+
var $value = $isLight ? $v + $brightnessStep1 * $i : $v - $brightnessStep2 * $i;
|
|
4076
|
+
$value = $value < 1 ? $value : 1;
|
|
4077
|
+
return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "U"])($value, 2);
|
|
4078
|
+
};
|
|
4079
|
+
|
|
4080
|
+
/**
|
|
4081
|
+
* getSaturation
|
|
4082
|
+
* @desc:转换饱和度
|
|
4083
|
+
* @author huangbo
|
|
4084
|
+
* @date 2022年5月7日
|
|
4085
|
+
**/
|
|
4086
|
+
var getSaturation = function getSaturation($s, $i, $isLight) {
|
|
4087
|
+
var $saturation = void 0;
|
|
4088
|
+
if ($isLight) {
|
|
4089
|
+
$saturation = $s - $saturationStep1 * $i;
|
|
4090
|
+
} else if ($i === $darkColorCount) {
|
|
4091
|
+
$saturation = $s + $saturationStep1;
|
|
4092
|
+
} else {
|
|
4093
|
+
$saturation = $s + $saturationStep2 * $i;
|
|
4094
|
+
}
|
|
4095
|
+
$saturation = $saturation < 1 ? $saturation : 1;
|
|
4096
|
+
|
|
4097
|
+
if ($isLight && $i === $lightColorCount && $saturation > 0.1) {
|
|
4098
|
+
$saturation = 0.1;
|
|
4099
|
+
}
|
|
4100
|
+
$saturation = $saturation > 0.06 ? $saturation : 0.06;
|
|
4101
|
+
return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* toFixed */ "U"])($saturation, 2);
|
|
4102
|
+
};
|
|
4103
|
+
|
|
4104
|
+
/**
|
|
4105
|
+
* rgbToHsv
|
|
4106
|
+
* @desc:rgb转化成hsv
|
|
4107
|
+
* @author huangbo
|
|
4108
|
+
* @date 2022年5月7日
|
|
4109
|
+
* @param {string} [$color] - 颜色值
|
|
4110
|
+
**/
|
|
4111
|
+
var rgbToHsv = function rgbToHsv($color) {
|
|
4112
|
+
var rgb = getRgb($color);
|
|
4113
|
+
var $red = rgb[0];
|
|
4114
|
+
var $green = rgb[1];
|
|
4115
|
+
var $blue = rgb[2];
|
|
4116
|
+
var $max = Math.max($red, $green, $blue);
|
|
4117
|
+
var $min = Math.min($red, $green, $blue);
|
|
4118
|
+
var $diff = $max - $min;
|
|
4119
|
+
var $h = 0;
|
|
4120
|
+
if ($max === $min) {
|
|
4121
|
+
$h = 0;
|
|
4122
|
+
} else if ($max === $red) {
|
|
4123
|
+
$h = 60 * ($green - $blue) / $diff + ($green > $blue - 1 ? 0 : 360);
|
|
4124
|
+
} else if ($max === $green) {
|
|
4125
|
+
$h = 60 * ($blue - $red) / $diff + 120;
|
|
4126
|
+
} else if ($max === $blue) {
|
|
4127
|
+
$h = 60 * ($red - $green) / $diff + 240;
|
|
4128
|
+
}
|
|
4129
|
+
var $s = $max === 0 ? 0 : $diff / $max;
|
|
4130
|
+
var $v = $max / 255;
|
|
4131
|
+
return [$h, $s, $v];
|
|
4132
|
+
};
|
|
4133
|
+
|
|
4134
|
+
/**
|
|
4135
|
+
* hsvTorgb
|
|
4136
|
+
* @desc:hsv转化成rgb
|
|
4137
|
+
* @author huangbo
|
|
4138
|
+
* @date 2022年5月7日
|
|
4139
|
+
* @param {string} [$color] - 颜色值
|
|
4140
|
+
**/
|
|
4141
|
+
var hsvTorgb = function hsvTorgb($h, $s, $v) {
|
|
4142
|
+
var $th = Math.floor($h / 60);
|
|
4143
|
+
var $t1 = $h / 60 - $th;
|
|
4144
|
+
var $t2 = $v * (1 - $s);
|
|
4145
|
+
var $t3 = $v * (1 - $t1 * $s);
|
|
4146
|
+
var $t4 = $v * (1 - (1 - $t1) * $s);
|
|
4147
|
+
var $r = [$v, $t3, $t2, $t2, $t4, $v][$th % 6];
|
|
4148
|
+
var $g = [$t4, $v, $v, $t3, $t2, $t2][$th % 6];
|
|
4149
|
+
var $b = [$t2, $t2, $t4, $v, $v, $t3][$th % 6];
|
|
4150
|
+
// return `rgb(${Math.round($r * 255)}, ${Math.round($g * 255)}, ${Math.round($b * 255)})`;
|
|
4151
|
+
var red = Math.round($r * 255);
|
|
4152
|
+
var green = Math.round($g * 255);
|
|
4153
|
+
var blue = Math.round($b * 255);
|
|
4154
|
+
red = red.toString(16);
|
|
4155
|
+
green = green.toString(16);
|
|
4156
|
+
blue = blue.toString(16);
|
|
4157
|
+
red = red.length === 1 ? '0' + red : red;
|
|
4158
|
+
green = green.length === 1 ? '0' + green : green;
|
|
4159
|
+
blue = blue.length === 1 ? '0' + blue : blue;
|
|
4160
|
+
return '#' + red + green + blue;
|
|
4161
|
+
};
|
|
4162
|
+
|
|
4163
|
+
/**
|
|
4164
|
+
* mixColor
|
|
4165
|
+
* @desc:生成混合色
|
|
4166
|
+
* @author huangbo
|
|
4167
|
+
* @date 2022年5月7日
|
|
4168
|
+
* @param {string} [$color1] - 颜色值
|
|
4169
|
+
* @param {string} [$color2] - 颜色值
|
|
4170
|
+
* @param {string} [$n] - 百分比 0~1
|
|
4171
|
+
**/
|
|
4172
|
+
var mixColor = function mixColor($color1, $color2, $n) {
|
|
4173
|
+
var rgb1 = getRgb($color1);
|
|
4174
|
+
var rgb2 = getRgb($color2);
|
|
4175
|
+
var r = rgb1[0] * $n + rgb2[0] * (1 - $n);
|
|
4176
|
+
var g = rgb1[1] * $n + rgb2[1] * (1 - $n);
|
|
4177
|
+
var b = rgb1[2] * $n + rgb2[2] * (1 - $n);
|
|
4178
|
+
return '#' + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
|
|
4179
|
+
};
|
|
4180
|
+
|
|
4181
|
+
/**
|
|
4182
|
+
* getRgb
|
|
4183
|
+
* @desc:获取颜色值的rgb值
|
|
4184
|
+
* @author huangbo
|
|
4185
|
+
* @date 2022年5月7日
|
|
4186
|
+
* @param {string} [$color] - 颜色值
|
|
4187
|
+
**/
|
|
4188
|
+
var getRgb = function getRgb($color) {
|
|
4189
|
+
var rgb = [];
|
|
4190
|
+
// 16进制颜色值的正则
|
|
4191
|
+
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
|
|
4192
|
+
// 把颜色值变成小写
|
|
4193
|
+
$color = $color.toLowerCase();
|
|
4194
|
+
if (reg.test($color)) {
|
|
4195
|
+
// 如果只有三位的值,需变成六位,如:#fff => #ffffff
|
|
4196
|
+
if ($color.length === 4) {
|
|
4197
|
+
var colorNew = '#';
|
|
4198
|
+
for (var i = 1; i < 4; i++) {
|
|
4199
|
+
colorNew += $color.slice(i, i + 1).concat($color.slice(i, i + 1));
|
|
4200
|
+
}
|
|
4201
|
+
$color = colorNew;
|
|
4202
|
+
}
|
|
4203
|
+
// 处理六位的颜色值,转为RGB
|
|
4204
|
+
for (var _i = 1; _i < 7; _i += 2) {
|
|
4205
|
+
rgb.push(parseInt('0x' + $color.slice(_i, _i + 2), 16));
|
|
4206
|
+
}
|
|
4207
|
+
} else {
|
|
4208
|
+
rgb = $color.replace(/(?:\(|\)|rgb|RGB)*/g, '').split(',');
|
|
4209
|
+
}
|
|
4210
|
+
return rgb;
|
|
4211
|
+
};
|
|
4212
|
+
|
|
4213
|
+
/***/ }),
|
|
4214
|
+
|
|
4215
|
+
/***/ 17:
|
|
4216
|
+
/***/ (function(module, exports) {
|
|
4217
|
+
|
|
4218
|
+
module.exports = require("eoss/lib/input");
|
|
4219
|
+
|
|
4220
|
+
/***/ }),
|
|
4221
|
+
|
|
4222
|
+
/***/ 177:
|
|
4223
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
4224
|
+
|
|
4225
|
+
"use strict";
|
|
4226
|
+
// ESM COMPAT FLAG
|
|
4227
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4228
|
+
|
|
4229
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/pagination/src/pager.vue?vue&type=template&id=069e764e&
|
|
4230
|
+
var render = function () {
|
|
4231
|
+
var _vm = this
|
|
4232
|
+
var _h = _vm.$createElement
|
|
4233
|
+
var _c = _vm._self._c || _h
|
|
4234
|
+
return _c(
|
|
4235
|
+
"ul",
|
|
4236
|
+
{ staticClass: "es-pager", on: { click: _vm.onPagerClick } },
|
|
4237
|
+
[
|
|
4238
|
+
_vm.pageCount > 0
|
|
4239
|
+
? _c(
|
|
4240
|
+
"li",
|
|
4241
|
+
{
|
|
4242
|
+
staticClass: "number",
|
|
4243
|
+
class: {
|
|
4244
|
+
active: _vm.currentPage === 1,
|
|
4245
|
+
disabled: _vm.disabled,
|
|
4246
|
+
},
|
|
4247
|
+
},
|
|
4248
|
+
[_vm._v("\n 1\n ")]
|
|
4249
|
+
)
|
|
4250
|
+
: _vm._e(),
|
|
4251
|
+
_vm.showPrevMore
|
|
4252
|
+
? _c("li", {
|
|
4253
|
+
staticClass: "es-icon more btn-quickprev",
|
|
4254
|
+
class: [_vm.quickprevIconClass, { disabled: _vm.disabled }],
|
|
4255
|
+
on: {
|
|
4256
|
+
mouseenter: function ($event) {
|
|
4257
|
+
return _vm.onMouseenter("left")
|
|
4258
|
+
},
|
|
4259
|
+
mouseleave: function ($event) {
|
|
4260
|
+
_vm.quickprevIconClass = "es-icon-more"
|
|
4261
|
+
},
|
|
4262
|
+
},
|
|
4263
|
+
})
|
|
4264
|
+
: _vm._e(),
|
|
4265
|
+
_vm._l(_vm.pagers, function (pager) {
|
|
4266
|
+
return _c(
|
|
4267
|
+
"li",
|
|
4268
|
+
{
|
|
4269
|
+
key: pager,
|
|
4270
|
+
staticClass: "number",
|
|
4271
|
+
class: {
|
|
4272
|
+
active: _vm.currentPage === pager,
|
|
4273
|
+
disabled: _vm.disabled,
|
|
4274
|
+
},
|
|
4275
|
+
},
|
|
4276
|
+
[_vm._v("\n " + _vm._s(pager) + "\n ")]
|
|
4277
|
+
)
|
|
4278
|
+
}),
|
|
4279
|
+
_vm.showNextMore
|
|
4280
|
+
? _c("li", {
|
|
4281
|
+
staticClass: "es-icon more btn-quicknext",
|
|
4282
|
+
class: [_vm.quicknextIconClass, { disabled: _vm.disabled }],
|
|
4283
|
+
on: {
|
|
4284
|
+
mouseenter: function ($event) {
|
|
4285
|
+
return _vm.onMouseenter("right")
|
|
4286
|
+
},
|
|
4287
|
+
mouseleave: function ($event) {
|
|
4288
|
+
_vm.quicknextIconClass = "es-icon-more"
|
|
4289
|
+
},
|
|
4290
|
+
},
|
|
4291
|
+
})
|
|
4292
|
+
: _vm._e(),
|
|
4293
|
+
_vm.pageCount > 1
|
|
4294
|
+
? _c(
|
|
4295
|
+
"li",
|
|
4296
|
+
{
|
|
4297
|
+
staticClass: "number",
|
|
4298
|
+
class: {
|
|
4299
|
+
active: _vm.currentPage === _vm.pageCount,
|
|
4300
|
+
disabled: _vm.disabled,
|
|
4301
|
+
},
|
|
4302
|
+
},
|
|
4303
|
+
[_vm._v("\n " + _vm._s(_vm.pageCount) + "\n ")]
|
|
4304
|
+
)
|
|
4305
|
+
: _vm._e(),
|
|
4306
|
+
],
|
|
4307
|
+
2
|
|
4308
|
+
)
|
|
4309
|
+
}
|
|
4310
|
+
var staticRenderFns = []
|
|
4311
|
+
render._withStripped = true
|
|
4312
|
+
|
|
4313
|
+
|
|
4314
|
+
// CONCATENATED MODULE: ./packages/pagination/src/pager.vue?vue&type=template&id=069e764e&
|
|
4315
|
+
|
|
4316
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/pagination/src/pager.vue?vue&type=script&lang=js&
|
|
4317
|
+
//
|
|
4318
|
+
//
|
|
4319
|
+
//
|
|
4320
|
+
//
|
|
4321
|
+
//
|
|
4322
|
+
//
|
|
4323
|
+
//
|
|
4324
|
+
//
|
|
4325
|
+
//
|
|
4326
|
+
//
|
|
4327
|
+
//
|
|
4328
|
+
//
|
|
4329
|
+
//
|
|
4330
|
+
//
|
|
4331
|
+
//
|
|
4332
|
+
//
|
|
4333
|
+
//
|
|
4334
|
+
//
|
|
4335
|
+
//
|
|
4336
|
+
//
|
|
4337
|
+
//
|
|
4338
|
+
//
|
|
4339
|
+
//
|
|
4340
|
+
//
|
|
4341
|
+
//
|
|
4342
|
+
//
|
|
4343
|
+
//
|
|
4344
|
+
//
|
|
4345
|
+
//
|
|
4346
|
+
//
|
|
4347
|
+
//
|
|
4348
|
+
//
|
|
4349
|
+
//
|
|
4350
|
+
//
|
|
4351
|
+
//
|
|
4352
|
+
//
|
|
4353
|
+
//
|
|
4354
|
+
//
|
|
4355
|
+
//
|
|
4356
|
+
//
|
|
4357
|
+
//
|
|
4358
|
+
//
|
|
4359
|
+
//
|
|
4360
|
+
//
|
|
4361
|
+
//
|
|
4362
|
+
//
|
|
4363
|
+
//
|
|
4364
|
+
//
|
|
4365
|
+
//
|
|
4366
|
+
//
|
|
4367
|
+
//
|
|
4368
|
+
//
|
|
4369
|
+
//
|
|
4370
|
+
//
|
|
4371
|
+
//
|
|
4372
|
+
//
|
|
4373
|
+
//
|
|
4374
|
+
//
|
|
4375
|
+
//
|
|
4376
|
+
|
|
5410
4377
|
/**
|
|
5411
|
-
*
|
|
5412
|
-
* @
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
|
|
4378
|
+
* 分页器组件
|
|
4379
|
+
* @component EsPager
|
|
4380
|
+
*/
|
|
4381
|
+
/* harmony default export */ var pagervue_type_script_lang_js_ = ({
|
|
4382
|
+
name: 'EsPager',
|
|
4383
|
+
componentName: 'EsPager',
|
|
4384
|
+
|
|
4385
|
+
props: {
|
|
4386
|
+
// 当前页码
|
|
4387
|
+
currentPage: {
|
|
4388
|
+
type: Number,
|
|
4389
|
+
required: true
|
|
4390
|
+
},
|
|
4391
|
+
|
|
4392
|
+
// 总页数
|
|
4393
|
+
pageCount: {
|
|
4394
|
+
type: Number,
|
|
4395
|
+
required: true
|
|
4396
|
+
},
|
|
4397
|
+
|
|
4398
|
+
// 页码按钮数量
|
|
4399
|
+
pagerCount: {
|
|
4400
|
+
type: Number,
|
|
4401
|
+
required: true
|
|
4402
|
+
},
|
|
4403
|
+
|
|
4404
|
+
// 是否禁用
|
|
4405
|
+
disabled: {
|
|
4406
|
+
type: Boolean,
|
|
4407
|
+
default: false
|
|
4408
|
+
}
|
|
4409
|
+
},
|
|
4410
|
+
|
|
4411
|
+
data: function data() {
|
|
4412
|
+
return {
|
|
4413
|
+
// 内部变量,未使用
|
|
4414
|
+
current: null,
|
|
4415
|
+
// 是否显示上一页更多按钮
|
|
4416
|
+
showPrevMore: false,
|
|
4417
|
+
// 是否显示下一页更多按钮
|
|
4418
|
+
showNextMore: false,
|
|
4419
|
+
// 下一页更多按钮图标类名
|
|
4420
|
+
quicknextIconClass: 'es-icon-more',
|
|
4421
|
+
// 上一页更多按钮图标类名
|
|
4422
|
+
quickprevIconClass: 'es-icon-more'
|
|
4423
|
+
};
|
|
4424
|
+
},
|
|
4425
|
+
|
|
4426
|
+
|
|
4427
|
+
watch: {
|
|
4428
|
+
// 监听上一页更多按钮状态变化
|
|
4429
|
+
showPrevMore: function showPrevMore(val) {
|
|
4430
|
+
if (!val) {
|
|
4431
|
+
this.quickprevIconClass = 'es-icon-more';
|
|
4432
|
+
}
|
|
4433
|
+
},
|
|
4434
|
+
|
|
4435
|
+
|
|
4436
|
+
// 监听下一页更多按钮状态变化
|
|
4437
|
+
showNextMore: function showNextMore(val) {
|
|
4438
|
+
if (!val) {
|
|
4439
|
+
this.quicknextIconClass = 'es-icon-more';
|
|
4440
|
+
}
|
|
4441
|
+
}
|
|
4442
|
+
},
|
|
4443
|
+
|
|
4444
|
+
computed: {
|
|
4445
|
+
// 计算中间页码数组
|
|
4446
|
+
pagers: function pagers() {
|
|
4447
|
+
var pagerCount = this.pagerCount;
|
|
4448
|
+
var halfPagerCount = (pagerCount - 1) / 2;
|
|
4449
|
+
var currentPage = Number(this.currentPage);
|
|
4450
|
+
var pageCount = Number(this.pageCount);
|
|
4451
|
+
|
|
4452
|
+
// 边界检查
|
|
4453
|
+
if (!Number.isInteger(pageCount) || pageCount <= 0) {
|
|
4454
|
+
return [];
|
|
4455
|
+
}
|
|
4456
|
+
|
|
4457
|
+
var showPrevMore = false;
|
|
4458
|
+
var showNextMore = false;
|
|
4459
|
+
|
|
4460
|
+
// 判断是否需要显示更多按钮
|
|
4461
|
+
if (pageCount > pagerCount) {
|
|
4462
|
+
if (currentPage > pagerCount - halfPagerCount) {
|
|
4463
|
+
showPrevMore = true;
|
|
4464
|
+
}
|
|
4465
|
+
|
|
4466
|
+
if (currentPage < pageCount - halfPagerCount) {
|
|
4467
|
+
showNextMore = true;
|
|
4468
|
+
}
|
|
4469
|
+
}
|
|
4470
|
+
|
|
4471
|
+
var array = [];
|
|
4472
|
+
|
|
4473
|
+
// 根据不同情况生成页码数组
|
|
4474
|
+
if (showPrevMore && !showNextMore) {
|
|
4475
|
+
// 只显示上一页更多
|
|
4476
|
+
var startPage = Math.max(2, pageCount - (pagerCount - 2));
|
|
4477
|
+
for (var i = startPage; i < pageCount; i++) {
|
|
4478
|
+
array.push(i);
|
|
4479
|
+
}
|
|
4480
|
+
} else if (!showPrevMore && showNextMore) {
|
|
4481
|
+
// 只显示下一页更多
|
|
4482
|
+
for (var _i = 2; _i < Math.min(pagerCount, pageCount); _i++) {
|
|
4483
|
+
array.push(_i);
|
|
4484
|
+
}
|
|
4485
|
+
} else if (showPrevMore && showNextMore) {
|
|
4486
|
+
// 同时显示上下页更多
|
|
4487
|
+
var offset = Math.floor(pagerCount / 2) - 1;
|
|
4488
|
+
var start = Math.max(2, currentPage - offset);
|
|
4489
|
+
var end = Math.min(pageCount - 1, currentPage + offset);
|
|
4490
|
+
for (var _i2 = start; _i2 <= end; _i2++) {
|
|
4491
|
+
array.push(_i2);
|
|
4492
|
+
}
|
|
4493
|
+
} else {
|
|
4494
|
+
// 不显示更多按钮
|
|
4495
|
+
for (var _i3 = 2; _i3 < pageCount; _i3++) {
|
|
4496
|
+
array.push(_i3);
|
|
4497
|
+
}
|
|
4498
|
+
}
|
|
4499
|
+
|
|
4500
|
+
// 更新状态
|
|
4501
|
+
this.showPrevMore = showPrevMore;
|
|
4502
|
+
this.showNextMore = showNextMore;
|
|
4503
|
+
|
|
4504
|
+
return array;
|
|
4505
|
+
}
|
|
4506
|
+
},
|
|
4507
|
+
|
|
4508
|
+
methods: {
|
|
4509
|
+
// 处理页码点击事件
|
|
4510
|
+
onPagerClick: function onPagerClick(event) {
|
|
4511
|
+
var target = event.target;
|
|
4512
|
+
// 禁用状态或点击的是ul容器,不处理
|
|
4513
|
+
if (this.disabled || target.tagName === 'UL') {
|
|
4514
|
+
return;
|
|
4515
|
+
}
|
|
4516
|
+
|
|
4517
|
+
var newPage = Number(target.textContent);
|
|
4518
|
+
var pageCount = this.pageCount;
|
|
4519
|
+
var currentPage = this.currentPage;
|
|
4520
|
+
var pagerCountOffset = this.pagerCount - 2;
|
|
4521
|
+
|
|
4522
|
+
// 处理快速跳转按钮
|
|
4523
|
+
if (target.classList.contains('more')) {
|
|
4524
|
+
if (target.classList.contains('btn-quickprev')) {
|
|
4525
|
+
newPage = currentPage - pagerCountOffset;
|
|
4526
|
+
} else if (target.classList.contains('btn-quicknext')) {
|
|
4527
|
+
newPage = currentPage + pagerCountOffset;
|
|
4528
|
+
}
|
|
4529
|
+
}
|
|
4530
|
+
|
|
4531
|
+
// 验证并调整页码范围
|
|
4532
|
+
if (!isNaN(newPage)) {
|
|
4533
|
+
newPage = Math.max(1, Math.min(pageCount, newPage));
|
|
4534
|
+
} else {
|
|
4535
|
+
// 不是有效数字,不处理
|
|
4536
|
+
return;
|
|
4537
|
+
}
|
|
4538
|
+
|
|
4539
|
+
// 页码变化时触发事件
|
|
4540
|
+
if (newPage !== currentPage) {
|
|
4541
|
+
this.$emit('change', newPage);
|
|
4542
|
+
}
|
|
4543
|
+
},
|
|
4544
|
+
|
|
4545
|
+
|
|
4546
|
+
// 处理鼠标悬停事件
|
|
4547
|
+
onMouseenter: function onMouseenter(direction) {
|
|
4548
|
+
if (this.disabled) {
|
|
4549
|
+
return;
|
|
4550
|
+
}
|
|
4551
|
+
// 根据方向更新图标
|
|
4552
|
+
if (direction === 'left') {
|
|
4553
|
+
this.quickprevIconClass = 'es-icon-zuo';
|
|
4554
|
+
} else {
|
|
4555
|
+
this.quicknextIconClass = 'es-icon-arrow-right';
|
|
4556
|
+
}
|
|
4557
|
+
}
|
|
4558
|
+
}
|
|
4559
|
+
});
|
|
4560
|
+
// CONCATENATED MODULE: ./packages/pagination/src/pager.vue?vue&type=script&lang=js&
|
|
4561
|
+
/* harmony default export */ var src_pagervue_type_script_lang_js_ = (pagervue_type_script_lang_js_);
|
|
4562
|
+
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
4563
|
+
var componentNormalizer = __webpack_require__(3);
|
|
4564
|
+
|
|
4565
|
+
// CONCATENATED MODULE: ./packages/pagination/src/pager.vue
|
|
4566
|
+
|
|
4567
|
+
|
|
4568
|
+
|
|
4569
|
+
|
|
4570
|
+
|
|
4571
|
+
/* normalize component */
|
|
4572
|
+
|
|
4573
|
+
var component = Object(componentNormalizer["a" /* default */])(
|
|
4574
|
+
src_pagervue_type_script_lang_js_,
|
|
4575
|
+
render,
|
|
4576
|
+
staticRenderFns,
|
|
4577
|
+
false,
|
|
4578
|
+
null,
|
|
4579
|
+
null,
|
|
4580
|
+
null
|
|
4581
|
+
|
|
4582
|
+
)
|
|
4583
|
+
|
|
4584
|
+
/* harmony default export */ var pager = (component.exports);
|
|
4585
|
+
// EXTERNAL MODULE: external "eoss/lib/select"
|
|
4586
|
+
var select_ = __webpack_require__(112);
|
|
4587
|
+
var select_default = /*#__PURE__*/__webpack_require__.n(select_);
|
|
4588
|
+
|
|
4589
|
+
// EXTERNAL MODULE: external "eoss/lib/option"
|
|
4590
|
+
var option_ = __webpack_require__(113);
|
|
4591
|
+
var option_default = /*#__PURE__*/__webpack_require__.n(option_);
|
|
4592
|
+
|
|
4593
|
+
// EXTERNAL MODULE: external "eoss/lib/input"
|
|
4594
|
+
var input_ = __webpack_require__(17);
|
|
4595
|
+
var input_default = /*#__PURE__*/__webpack_require__.n(input_);
|
|
4596
|
+
|
|
4597
|
+
// EXTERNAL MODULE: ./src/utils/util.js
|
|
4598
|
+
var util = __webpack_require__(0);
|
|
4599
|
+
|
|
4600
|
+
// CONCATENATED MODULE: ./packages/pagination/src/pagination.js
|
|
4601
|
+
|
|
4602
|
+
|
|
4603
|
+
|
|
4604
|
+
|
|
4605
|
+
|
|
4606
|
+
|
|
5420
4607
|
/**
|
|
5421
|
-
*
|
|
5422
|
-
* @
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
|
|
5428
|
-
|
|
5429
|
-
|
|
4608
|
+
* 分页组件
|
|
4609
|
+
* @component EsPagination
|
|
4610
|
+
*/
|
|
4611
|
+
/* harmony default export */ var pagination = ({
|
|
4612
|
+
name: 'EsPagination',
|
|
4613
|
+
componentName: 'EsPagination',
|
|
4614
|
+
|
|
4615
|
+
props: {
|
|
4616
|
+
/**
|
|
4617
|
+
* 每页显示条目个数
|
|
4618
|
+
* @type {Number}
|
|
4619
|
+
* @default 10
|
|
4620
|
+
*/
|
|
4621
|
+
pageSize: {
|
|
4622
|
+
type: Number,
|
|
4623
|
+
default: 10
|
|
4624
|
+
},
|
|
4625
|
+
/**
|
|
4626
|
+
* 是否使用小型分页样式
|
|
4627
|
+
* @type {Boolean}
|
|
4628
|
+
* @default false
|
|
4629
|
+
*/
|
|
4630
|
+
small: Boolean,
|
|
4631
|
+
/**
|
|
4632
|
+
* 总条目数
|
|
4633
|
+
* @type {Number}
|
|
4634
|
+
* @default undefined
|
|
4635
|
+
*/
|
|
4636
|
+
total: Number,
|
|
4637
|
+
/**
|
|
4638
|
+
* 自定义显示总数文本
|
|
4639
|
+
* @type {String}
|
|
4640
|
+
* @default undefined
|
|
4641
|
+
*/
|
|
4642
|
+
totalText: String,
|
|
4643
|
+
/**
|
|
4644
|
+
* 总页数
|
|
4645
|
+
* @type {Number}
|
|
4646
|
+
* @default undefined
|
|
4647
|
+
*/
|
|
4648
|
+
pageCount: Number,
|
|
4649
|
+
/**
|
|
4650
|
+
* 页码按钮的数量,当总页数超过该值时会折叠
|
|
4651
|
+
* @type {Number}
|
|
4652
|
+
* @default 7
|
|
4653
|
+
* @validator 大于等于5且小于等于21的奇数
|
|
4654
|
+
*/
|
|
4655
|
+
pagerCount: {
|
|
4656
|
+
type: Number,
|
|
4657
|
+
validator: function validator(value) {
|
|
4658
|
+
return Number.isInteger(value) && value > 4 && value < 22 && value % 2 === 1;
|
|
4659
|
+
},
|
|
4660
|
+
|
|
4661
|
+
default: 7
|
|
4662
|
+
},
|
|
4663
|
+
/**
|
|
4664
|
+
* 当前页码
|
|
4665
|
+
* @type {Number}
|
|
4666
|
+
* @default 1
|
|
4667
|
+
*/
|
|
4668
|
+
currentPage: {
|
|
4669
|
+
type: Number,
|
|
4670
|
+
default: 1
|
|
4671
|
+
},
|
|
4672
|
+
/**
|
|
4673
|
+
* 组件布局,子组件名用逗号分隔
|
|
4674
|
+
* @type {String}
|
|
4675
|
+
* @default 'total,separate, sizes, prev, pager, next, jumper, ->'
|
|
4676
|
+
*/
|
|
4677
|
+
layout: {
|
|
4678
|
+
default: 'total,separate, sizes, prev, pager, next, jumper, ->'
|
|
4679
|
+
},
|
|
4680
|
+
/**
|
|
4681
|
+
* 每页显示个数选择器的选项设置
|
|
4682
|
+
* @type {Array<Number>}
|
|
4683
|
+
* @default [10, 20, 30, 40, 50, 100]
|
|
4684
|
+
*/
|
|
4685
|
+
pageSizes: {
|
|
4686
|
+
type: Array,
|
|
4687
|
+
default: function _default() {
|
|
4688
|
+
return [10, 20, 30, 40, 50, 100];
|
|
4689
|
+
}
|
|
4690
|
+
},
|
|
4691
|
+
/**
|
|
4692
|
+
* 每页显示个数选择器的下拉框类名
|
|
4693
|
+
* @type {String}
|
|
4694
|
+
* @default ''
|
|
4695
|
+
*/
|
|
4696
|
+
popperClass: String,
|
|
4697
|
+
/**
|
|
4698
|
+
* 替代图标显示的上一页文本
|
|
4699
|
+
* @type {String}
|
|
4700
|
+
* @default ''
|
|
4701
|
+
*/
|
|
4702
|
+
prevText: String,
|
|
4703
|
+
/**
|
|
4704
|
+
* 替代图标显示的下一页文本
|
|
4705
|
+
* @type {String}
|
|
4706
|
+
* @default ''
|
|
4707
|
+
*/
|
|
4708
|
+
nextText: String,
|
|
4709
|
+
/**
|
|
4710
|
+
* 是否为分页按钮添加背景色
|
|
4711
|
+
* @type {Boolean}
|
|
4712
|
+
* @default false
|
|
4713
|
+
*/
|
|
4714
|
+
background: {
|
|
4715
|
+
type: Boolean,
|
|
4716
|
+
default: true
|
|
4717
|
+
},
|
|
4718
|
+
/**
|
|
4719
|
+
* 是否显示边框
|
|
4720
|
+
* @type {Boolean}
|
|
4721
|
+
* @default true
|
|
4722
|
+
*/
|
|
4723
|
+
border: {
|
|
4724
|
+
type: Boolean,
|
|
4725
|
+
default: true
|
|
4726
|
+
},
|
|
4727
|
+
/**
|
|
4728
|
+
* 是否禁用
|
|
4729
|
+
* @type {Boolean}
|
|
4730
|
+
* @default false
|
|
4731
|
+
*/
|
|
4732
|
+
disabled: Boolean,
|
|
4733
|
+
/**
|
|
4734
|
+
* 只有一页时是否隐藏
|
|
4735
|
+
* @type {Boolean}
|
|
4736
|
+
* @default false
|
|
4737
|
+
*/
|
|
4738
|
+
hideOnSinglePage: Boolean,
|
|
4739
|
+
/**
|
|
4740
|
+
* 是否显示每页单位文本
|
|
4741
|
+
* @type {Boolean}
|
|
4742
|
+
* @default true
|
|
4743
|
+
*/
|
|
4744
|
+
unit: {
|
|
4745
|
+
type: Boolean,
|
|
4746
|
+
default: true
|
|
4747
|
+
}
|
|
4748
|
+
},
|
|
4749
|
+
|
|
4750
|
+
data: function data() {
|
|
4751
|
+
return {
|
|
4752
|
+
internalCurrentPage: 1,
|
|
4753
|
+
internalPageSize: 0,
|
|
4754
|
+
lastEmittedPage: -1,
|
|
4755
|
+
userChangePageSize: false
|
|
4756
|
+
};
|
|
4757
|
+
},
|
|
4758
|
+
render: function render(h) {
|
|
4759
|
+
var layout = this.layout;
|
|
4760
|
+
// 无布局或单页隐藏模式下不渲染
|
|
4761
|
+
if (!layout) return null;
|
|
4762
|
+
if (this.hideOnSinglePage && (!this.internalPageCount || this.internalPageCount === 1)) return null;
|
|
4763
|
+
|
|
4764
|
+
// 创建主容器
|
|
4765
|
+
var template = h('div', { 'class': ['es-pagination', {
|
|
4766
|
+
'is-background': this.background,
|
|
4767
|
+
'is-border': this.border,
|
|
4768
|
+
'es-pagination--small': this.small
|
|
4769
|
+
}] });
|
|
4770
|
+
|
|
4771
|
+
// 定义组件映射关系
|
|
4772
|
+
var TEMPLATE_MAP = {
|
|
4773
|
+
separate: h('div', { 'class': 'es-pagination__separate' }),
|
|
4774
|
+
prev: h('prev'),
|
|
4775
|
+
jumper: h('jumper'),
|
|
4776
|
+
pager: h('pager', {
|
|
4777
|
+
attrs: {
|
|
4778
|
+
currentPage: this.internalCurrentPage,
|
|
4779
|
+
pageCount: this.internalPageCount,
|
|
4780
|
+
pagerCount: this.pagerCount,
|
|
4781
|
+
|
|
4782
|
+
disabled: this.disabled },
|
|
4783
|
+
on: {
|
|
4784
|
+
'change': this.handleCurrentChange
|
|
4785
|
+
}
|
|
4786
|
+
}),
|
|
4787
|
+
next: h('next'),
|
|
4788
|
+
sizes: h('sizes', {
|
|
4789
|
+
attrs: { pageSizes: this.pageSizes }
|
|
4790
|
+
}),
|
|
4791
|
+
slot: h('slot', [this.$slots.default || '']),
|
|
4792
|
+
total: h('total')
|
|
4793
|
+
};
|
|
4794
|
+
|
|
4795
|
+
// 解析布局配置
|
|
4796
|
+
var components = layout.split(',').map(function (item) {
|
|
4797
|
+
return item.trim();
|
|
4798
|
+
});
|
|
4799
|
+
var rightWrapper = h('div', { 'class': 'es-pagination__rightwrapper' });
|
|
4800
|
+
var haveRightWrapper = false;
|
|
4801
|
+
|
|
4802
|
+
template.children = template.children || [];
|
|
4803
|
+
rightWrapper.children = rightWrapper.children || [];
|
|
4804
|
+
|
|
4805
|
+
// 构建组件结构
|
|
4806
|
+
components.forEach(function (compo) {
|
|
4807
|
+
if (compo === '->') {
|
|
4808
|
+
haveRightWrapper = true;
|
|
4809
|
+
return;
|
|
4810
|
+
}
|
|
4811
|
+
|
|
4812
|
+
var component = TEMPLATE_MAP[compo];
|
|
4813
|
+
if (component) {
|
|
4814
|
+
if (!haveRightWrapper) {
|
|
4815
|
+
template.children.push(component);
|
|
4816
|
+
} else {
|
|
4817
|
+
rightWrapper.children.push(component);
|
|
4818
|
+
}
|
|
4819
|
+
}
|
|
4820
|
+
});
|
|
4821
|
+
|
|
4822
|
+
// 添加右侧包装器
|
|
4823
|
+
if (haveRightWrapper && rightWrapper.children.length > 0) {
|
|
4824
|
+
template.children.unshift(rightWrapper);
|
|
4825
|
+
}
|
|
4826
|
+
|
|
4827
|
+
return template;
|
|
4828
|
+
},
|
|
4829
|
+
|
|
4830
|
+
|
|
4831
|
+
components: {
|
|
4832
|
+
// 上一页组件
|
|
4833
|
+
Prev: {
|
|
4834
|
+
render: function render(h) {
|
|
4835
|
+
var parent = this.$parent;
|
|
4836
|
+
return h(
|
|
4837
|
+
'button',
|
|
4838
|
+
{
|
|
4839
|
+
attrs: {
|
|
4840
|
+
type: 'button',
|
|
4841
|
+
|
|
4842
|
+
disabled: parent.disabled || parent.internalCurrentPage <= 1
|
|
4843
|
+
},
|
|
4844
|
+
'class': 'btn-prev', on: {
|
|
4845
|
+
'click': parent.prev
|
|
4846
|
+
}
|
|
4847
|
+
},
|
|
4848
|
+
[parent.prevText ? h('span', [parent.prevText]) : h('i', { 'class': 'es-icon es-icon-zuo' })]
|
|
4849
|
+
);
|
|
4850
|
+
}
|
|
4851
|
+
},
|
|
4852
|
+
|
|
4853
|
+
// 下一页组件
|
|
4854
|
+
Next: {
|
|
4855
|
+
render: function render(h) {
|
|
4856
|
+
var parent = this.$parent;
|
|
4857
|
+
return h(
|
|
4858
|
+
'button',
|
|
4859
|
+
{
|
|
4860
|
+
attrs: {
|
|
4861
|
+
type: 'button',
|
|
4862
|
+
|
|
4863
|
+
disabled: parent.disabled || parent.internalCurrentPage === parent.internalPageCount || parent.internalPageCount === 0
|
|
4864
|
+
},
|
|
4865
|
+
'class': 'btn-next', on: {
|
|
4866
|
+
'click': parent.next
|
|
4867
|
+
}
|
|
4868
|
+
},
|
|
4869
|
+
[parent.nextText ? h('span', [parent.nextText]) : h('i', { 'class': 'es-icon es-icon-you' })]
|
|
4870
|
+
);
|
|
4871
|
+
}
|
|
4872
|
+
},
|
|
4873
|
+
|
|
4874
|
+
// 每页条数选择组件
|
|
4875
|
+
Sizes: {
|
|
4876
|
+
props: {
|
|
4877
|
+
pageSizes: Array
|
|
4878
|
+
},
|
|
4879
|
+
|
|
4880
|
+
watch: {
|
|
4881
|
+
pageSizes: {
|
|
4882
|
+
immediate: true,
|
|
4883
|
+
handler: function handler(newVal, oldVal) {
|
|
4884
|
+
if (Object(util["Z" /* valueEquals */])(newVal, oldVal)) return;
|
|
4885
|
+
if (Array.isArray(newVal)) {
|
|
4886
|
+
var parent = this.$parent;
|
|
4887
|
+
parent.internalPageSize = newVal.indexOf(parent.pageSize) > -1 ? parent.pageSize : this.pageSizes[0];
|
|
4888
|
+
}
|
|
4889
|
+
}
|
|
4890
|
+
}
|
|
4891
|
+
},
|
|
4892
|
+
|
|
4893
|
+
render: function render(h) {
|
|
4894
|
+
var parent = this.$parent;
|
|
4895
|
+
return h(
|
|
4896
|
+
'span',
|
|
4897
|
+
{ 'class': 'es-pagination__sizes' },
|
|
4898
|
+
[h(
|
|
4899
|
+
'es-select',
|
|
4900
|
+
{
|
|
4901
|
+
attrs: {
|
|
4902
|
+
value: parent.internalPageSize,
|
|
4903
|
+
popperClass: parent.popperClass || '',
|
|
4904
|
+
size: 'medium',
|
|
4905
|
+
|
|
4906
|
+
disabled: parent.disabled },
|
|
4907
|
+
on: {
|
|
4908
|
+
'input': this.handleChange
|
|
4909
|
+
}
|
|
4910
|
+
},
|
|
4911
|
+
[this.pageSizes.map(function (item) {
|
|
4912
|
+
return h('es-option', {
|
|
4913
|
+
key: item,
|
|
4914
|
+
attrs: { value: item,
|
|
4915
|
+
label: item + (parent.unit ? '条/页' : '') }
|
|
4916
|
+
});
|
|
4917
|
+
})]
|
|
4918
|
+
)]
|
|
4919
|
+
);
|
|
4920
|
+
},
|
|
4921
|
+
|
|
4922
|
+
|
|
4923
|
+
components: {
|
|
4924
|
+
EsSelect: select_default.a,
|
|
4925
|
+
EsOption: option_default.a
|
|
4926
|
+
},
|
|
4927
|
+
|
|
4928
|
+
methods: {
|
|
4929
|
+
handleChange: function handleChange(val) {
|
|
4930
|
+
var parent = this.$parent;
|
|
4931
|
+
if (val !== parent.internalPageSize) {
|
|
4932
|
+
parent.internalPageSize = val = parseInt(val, 10);
|
|
4933
|
+
parent.userChangePageSize = true;
|
|
4934
|
+
parent.$emit('update:pageSize', val);
|
|
4935
|
+
parent.$emit('size-change', val);
|
|
4936
|
+
}
|
|
4937
|
+
}
|
|
4938
|
+
}
|
|
4939
|
+
},
|
|
4940
|
+
|
|
4941
|
+
// 页码跳转组件
|
|
4942
|
+
Jumper: {
|
|
4943
|
+
components: { EsInput: input_default.a },
|
|
4944
|
+
|
|
4945
|
+
data: function data() {
|
|
4946
|
+
return {
|
|
4947
|
+
userInput: null
|
|
4948
|
+
};
|
|
4949
|
+
},
|
|
4950
|
+
|
|
4951
|
+
|
|
4952
|
+
watch: {
|
|
4953
|
+
'$parent.internalCurrentPage': function $parentInternalCurrentPage() {
|
|
4954
|
+
// 页码变化时重置用户输入
|
|
4955
|
+
this.userInput = null;
|
|
4956
|
+
}
|
|
4957
|
+
},
|
|
4958
|
+
|
|
4959
|
+
methods: {
|
|
4960
|
+
// 处理键盘事件
|
|
4961
|
+
handleKeyup: function handleKeyup(_ref) {
|
|
4962
|
+
var keyCode = _ref.keyCode,
|
|
4963
|
+
target = _ref.target;
|
|
4964
|
+
|
|
4965
|
+
// Enter键触发跳转
|
|
4966
|
+
if (keyCode === 13) {
|
|
4967
|
+
this.handleChange(target.value);
|
|
4968
|
+
}
|
|
4969
|
+
},
|
|
4970
|
+
|
|
4971
|
+
|
|
4972
|
+
// 处理输入变化
|
|
4973
|
+
handleInput: function handleInput(value) {
|
|
4974
|
+
this.userInput = value;
|
|
4975
|
+
},
|
|
4976
|
+
|
|
4977
|
+
|
|
4978
|
+
// 处理跳转逻辑
|
|
4979
|
+
handleChange: function handleChange(value) {
|
|
4980
|
+
var parent = this.$parent;
|
|
4981
|
+
parent.internalCurrentPage = parent.getValidCurrentPage(value);
|
|
4982
|
+
parent.emitChange();
|
|
4983
|
+
this.userInput = null;
|
|
4984
|
+
}
|
|
4985
|
+
},
|
|
4986
|
+
|
|
4987
|
+
render: function render(h) {
|
|
4988
|
+
var parent = this.$parent;
|
|
4989
|
+
// 检查是否有有效页数且页数大于1
|
|
4990
|
+
var hasPageCount = typeof parent.internalPageCount === 'number' && parent.internalPageCount > 1;
|
|
4991
|
+
|
|
4992
|
+
return h(
|
|
4993
|
+
'span',
|
|
4994
|
+
{ 'class': 'es-pagination__jump' },
|
|
4995
|
+
[h('span', ['\u8DF3\u81F3']), h(
|
|
4996
|
+
'es-input',
|
|
4997
|
+
{
|
|
4998
|
+
'class': ['es-pagination__editor', hasPageCount && 'es-pagination__pageCount', 'is-in-pagination'].filter(Boolean).join(' '),
|
|
4999
|
+
attrs: { min: 1,
|
|
5000
|
+
max: parent.internalPageCount,
|
|
5001
|
+
value: this.userInput !== null ? this.userInput : parent.internalCurrentPage,
|
|
5002
|
+
type: 'number',
|
|
5003
|
+
disabled: parent.disabled
|
|
5004
|
+
},
|
|
5005
|
+
nativeOn: {
|
|
5006
|
+
'keyup': this.handleKeyup
|
|
5007
|
+
},
|
|
5008
|
+
on: {
|
|
5009
|
+
'input': this.handleInput,
|
|
5010
|
+
'change': this.handleChange
|
|
5011
|
+
}
|
|
5012
|
+
},
|
|
5013
|
+
[hasPageCount ? h(
|
|
5014
|
+
'template',
|
|
5015
|
+
{ slot: 'append' },
|
|
5016
|
+
['/', parent.internalPageCount, '\u9875']
|
|
5017
|
+
) : '']
|
|
5018
|
+
)]
|
|
5019
|
+
);
|
|
5020
|
+
}
|
|
5021
|
+
},
|
|
5022
|
+
|
|
5023
|
+
// 总数显示组件
|
|
5024
|
+
Total: {
|
|
5025
|
+
render: function render(h) {
|
|
5026
|
+
var parent = this.$parent;
|
|
5027
|
+
|
|
5028
|
+
return typeof parent.total === 'number' ? h(
|
|
5029
|
+
'span',
|
|
5030
|
+
{ 'class': 'es-pagination__total' },
|
|
5031
|
+
[parent.totalText ? parent.totalText.replace('{total}', parent.total) : '\u5171 ' + parent.total + ' \u9879\u6570\u636E']
|
|
5032
|
+
) : '';
|
|
5033
|
+
}
|
|
5034
|
+
},
|
|
5035
|
+
|
|
5036
|
+
Pager: pager
|
|
5037
|
+
},
|
|
5038
|
+
|
|
5039
|
+
methods: {
|
|
5040
|
+
/**
|
|
5041
|
+
* 处理页码变化
|
|
5042
|
+
* @param {Number} val - 新的页码
|
|
5043
|
+
*/
|
|
5044
|
+
handleCurrentChange: function handleCurrentChange(val) {
|
|
5045
|
+
this.internalCurrentPage = this.getValidCurrentPage(val);
|
|
5046
|
+
this.userChangePageSize = true;
|
|
5047
|
+
this.emitChange();
|
|
5048
|
+
},
|
|
5049
|
+
|
|
5050
|
+
|
|
5051
|
+
/**
|
|
5052
|
+
* 上一页
|
|
5053
|
+
*/
|
|
5054
|
+
prev: function prev() {
|
|
5055
|
+
if (this.disabled) return;
|
|
5056
|
+
var newVal = this.internalCurrentPage - 1;
|
|
5057
|
+
this.internalCurrentPage = this.getValidCurrentPage(newVal);
|
|
5058
|
+
this.$emit('prev-click', this.internalCurrentPage);
|
|
5059
|
+
this.emitChange();
|
|
5060
|
+
},
|
|
5061
|
+
|
|
5062
|
+
|
|
5063
|
+
/**
|
|
5064
|
+
* 下一页
|
|
5065
|
+
*/
|
|
5066
|
+
next: function next() {
|
|
5067
|
+
if (this.disabled) return;
|
|
5068
|
+
var newVal = this.internalCurrentPage + 1;
|
|
5069
|
+
this.internalCurrentPage = this.getValidCurrentPage(newVal);
|
|
5070
|
+
this.$emit('next-click', this.internalCurrentPage);
|
|
5071
|
+
this.emitChange();
|
|
5072
|
+
},
|
|
5073
|
+
|
|
5074
|
+
|
|
5075
|
+
/**
|
|
5076
|
+
* 获取有效的当前页码
|
|
5077
|
+
* @param {Number} value - 输入的页码
|
|
5078
|
+
* @returns {Number} 有效的页码
|
|
5079
|
+
*/
|
|
5080
|
+
getValidCurrentPage: function getValidCurrentPage(value) {
|
|
5081
|
+
// 转换为整数
|
|
5082
|
+
value = parseInt(value, 10);
|
|
5083
|
+
|
|
5084
|
+
var havePageCount = typeof this.internalPageCount === 'number';
|
|
5085
|
+
var resetValue = void 0;
|
|
5086
|
+
|
|
5087
|
+
if (!havePageCount) {
|
|
5088
|
+
// 没有总页数限制时,确保页码至少为1
|
|
5089
|
+
if (isNaN(value) || value < 1) {
|
|
5090
|
+
resetValue = 1;
|
|
5091
|
+
}
|
|
5092
|
+
} else {
|
|
5093
|
+
// 有总页数限制时,确保页码在有效范围内
|
|
5094
|
+
if (value < 1) {
|
|
5095
|
+
resetValue = 1;
|
|
5096
|
+
} else if (value > this.internalPageCount) {
|
|
5097
|
+
resetValue = this.internalPageCount;
|
|
5098
|
+
}
|
|
5099
|
+
}
|
|
5100
|
+
|
|
5101
|
+
// 处理特殊情况
|
|
5102
|
+
if (resetValue === undefined && isNaN(value)) {
|
|
5103
|
+
resetValue = 1;
|
|
5104
|
+
} else if (resetValue === 0) {
|
|
5105
|
+
resetValue = 1;
|
|
5106
|
+
}
|
|
5107
|
+
|
|
5108
|
+
return resetValue === undefined ? value : resetValue;
|
|
5109
|
+
},
|
|
5110
|
+
|
|
5111
|
+
|
|
5112
|
+
/**
|
|
5113
|
+
* 触发页码变化事件
|
|
5114
|
+
*/
|
|
5115
|
+
emitChange: function emitChange() {
|
|
5116
|
+
var _this = this;
|
|
5117
|
+
|
|
5118
|
+
this.$nextTick(function () {
|
|
5119
|
+
if (_this.internalCurrentPage !== _this.lastEmittedPage || _this.userChangePageSize) {
|
|
5120
|
+
_this.$emit('current-change', _this.internalCurrentPage);
|
|
5121
|
+
_this.lastEmittedPage = _this.internalCurrentPage;
|
|
5122
|
+
_this.userChangePageSize = false;
|
|
5123
|
+
}
|
|
5124
|
+
});
|
|
5125
|
+
}
|
|
5126
|
+
},
|
|
5127
|
+
|
|
5128
|
+
computed: {
|
|
5129
|
+
/**
|
|
5130
|
+
* 计算内部总页数
|
|
5131
|
+
* @returns {Number|null} 总页数或null
|
|
5132
|
+
*/
|
|
5133
|
+
internalPageCount: function internalPageCount() {
|
|
5134
|
+
if (typeof this.total === 'number') {
|
|
5135
|
+
// 根据总数和每页条数计算总页数
|
|
5136
|
+
return Math.max(1, Math.ceil(this.total / this.internalPageSize));
|
|
5137
|
+
} else if (typeof this.pageCount === 'number') {
|
|
5138
|
+
// 使用传入的总页数
|
|
5139
|
+
return Math.max(1, this.pageCount);
|
|
5140
|
+
}
|
|
5141
|
+
return null;
|
|
5142
|
+
}
|
|
5143
|
+
},
|
|
5144
|
+
|
|
5145
|
+
watch: {
|
|
5146
|
+
// 监听外部当前页码变化
|
|
5147
|
+
currentPage: {
|
|
5148
|
+
immediate: true,
|
|
5149
|
+
handler: function handler(val) {
|
|
5150
|
+
this.internalCurrentPage = this.getValidCurrentPage(val);
|
|
5151
|
+
}
|
|
5152
|
+
},
|
|
5153
|
+
|
|
5154
|
+
// 监听每页显示条数变化
|
|
5155
|
+
pageSize: {
|
|
5156
|
+
immediate: true,
|
|
5157
|
+
handler: function handler(val) {
|
|
5158
|
+
this.internalPageSize = isNaN(val) ? 10 : val;
|
|
5159
|
+
}
|
|
5160
|
+
},
|
|
5161
|
+
|
|
5162
|
+
// 监听内部当前页码变化
|
|
5163
|
+
internalCurrentPage: {
|
|
5164
|
+
immediate: true,
|
|
5165
|
+
handler: function handler(newVal) {
|
|
5166
|
+
this.$emit('update:currentPage', newVal);
|
|
5167
|
+
this.lastEmittedPage = -1;
|
|
5168
|
+
}
|
|
5169
|
+
},
|
|
5170
|
+
|
|
5171
|
+
// 监听总页数变化
|
|
5172
|
+
internalPageCount: function internalPageCount(newVal) {
|
|
5173
|
+
var oldPage = this.internalCurrentPage;
|
|
5174
|
+
if (newVal > 0 && oldPage === 0) {
|
|
5175
|
+
this.internalCurrentPage = 1;
|
|
5176
|
+
} else if (oldPage > newVal) {
|
|
5177
|
+
this.internalCurrentPage = newVal === 0 ? 1 : newVal;
|
|
5178
|
+
if (this.userChangePageSize) {
|
|
5179
|
+
this.emitChange();
|
|
5180
|
+
}
|
|
5181
|
+
}
|
|
5182
|
+
this.userChangePageSize = false;
|
|
5183
|
+
}
|
|
5184
|
+
}
|
|
5185
|
+
});
|
|
5186
|
+
// CONCATENATED MODULE: ./packages/pagination/index.js
|
|
5187
|
+
|
|
5188
|
+
|
|
5189
|
+
/* istanbul ignore next */
|
|
5190
|
+
pagination.install = function (Vue) {
|
|
5191
|
+
Vue.component(pagination.name, pagination);
|
|
5192
|
+
};
|
|
5193
|
+
|
|
5194
|
+
/* harmony default export */ var packages_pagination = __webpack_exports__["default"] = (pagination);
|
|
5195
|
+
|
|
5196
|
+
/***/ }),
|
|
5197
|
+
|
|
5198
|
+
/***/ 19:
|
|
5199
|
+
/***/ (function(module, exports) {
|
|
5200
|
+
|
|
5201
|
+
module.exports = require("eoss/lib/loading");
|
|
5202
|
+
|
|
5203
|
+
/***/ }),
|
|
5204
|
+
|
|
5205
|
+
/***/ 2:
|
|
5206
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
5207
|
+
|
|
5208
|
+
"use strict";
|
|
5209
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return setStorage; });
|
|
5210
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getStorage; });
|
|
5211
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return removeStorage; });
|
|
5212
|
+
/* unused harmony export setCookie */
|
|
5213
|
+
/* unused harmony export getCookie */
|
|
5214
|
+
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; };
|
|
5215
|
+
|
|
5216
|
+
/**
|
|
5217
|
+
* setStorage
|
|
5218
|
+
* @desc:设置本地储存数据
|
|
5219
|
+
* @author huangbo
|
|
5220
|
+
* @date 2022年5月7日
|
|
5221
|
+
* @param {String|Object} [key] - 数据的名称或包含type、key、value的对象
|
|
5222
|
+
* @param {String} [value] - 数据的值(当第一个参数为字符串时使用)
|
|
5223
|
+
**/
|
|
5224
|
+
var setStorage = function setStorage(key, value) {
|
|
5225
|
+
// 解析参数,支持两种调用方式:setStorage(key, value) 和 setStorage({type, key, value})
|
|
5226
|
+
var type = void 0,
|
|
5227
|
+
finalKey = void 0,
|
|
5228
|
+
finalValue = void 0;
|
|
5229
|
+
|
|
5230
|
+
if ((typeof key === 'undefined' ? 'undefined' : _typeof(key)) === 'object' && key !== null) {
|
|
5231
|
+
// 对象调用方式:setStorage({type, key, value})
|
|
5232
|
+
type = key.type;
|
|
5233
|
+
finalKey = key.key;
|
|
5234
|
+
finalValue = key.value;
|
|
5235
|
+
} else {
|
|
5236
|
+
// 字符串调用方式:setStorage(key, value)
|
|
5237
|
+
type = getStorage('storageType');
|
|
5238
|
+
finalKey = key;
|
|
5239
|
+
finalValue = value;
|
|
5240
|
+
}
|
|
5241
|
+
|
|
5242
|
+
// 使用默认存储类型如果未指定
|
|
5243
|
+
type = type || getStorage('storageType');
|
|
5244
|
+
|
|
5245
|
+
// 获取存储对象
|
|
5246
|
+
var storage = type === 'localStorage' ? localStorage : sessionStorage;
|
|
5247
|
+
|
|
5248
|
+
// 处理不同类型的key
|
|
5249
|
+
if (typeof finalKey === 'string') {
|
|
5250
|
+
// 单个字符串key
|
|
5251
|
+
var storedValue = (typeof finalValue === 'undefined' ? 'undefined' : _typeof(finalValue)) === 'object' ? JSON.stringify(finalValue) : finalValue;
|
|
5252
|
+
storage.setItem(finalKey, storedValue);
|
|
5253
|
+
if (finalKey === 'token') {
|
|
5254
|
+
setCookie('token', storedValue);
|
|
5255
|
+
}
|
|
5256
|
+
} else if (Array.isArray(finalKey)) {
|
|
5257
|
+
// 数组key,为多个key设置同一个value
|
|
5258
|
+
var _storedValue = (typeof finalValue === 'undefined' ? 'undefined' : _typeof(finalValue)) === 'object' ? JSON.stringify(finalValue) : finalValue;
|
|
5259
|
+
for (var i = 0; i < finalKey.length; i++) {
|
|
5260
|
+
storage.setItem(finalKey[i], _storedValue);
|
|
5261
|
+
if (finalKey[i] === 'token') {
|
|
5262
|
+
setCookie('token', _storedValue);
|
|
5263
|
+
}
|
|
5264
|
+
}
|
|
5265
|
+
} else if ((typeof finalKey === 'undefined' ? 'undefined' : _typeof(finalKey)) === 'object' && finalKey !== null) {
|
|
5266
|
+
// 对象key,对象的属性名称作为key,属性值作为value
|
|
5267
|
+
for (var k in finalKey) {
|
|
5268
|
+
if (Object.prototype.hasOwnProperty.call(finalKey, k)) {
|
|
5269
|
+
var _storedValue2 = _typeof(finalKey[k]) === 'object' ? JSON.stringify(finalKey[k]) : finalKey[k];
|
|
5270
|
+
storage.setItem(k, _storedValue2);
|
|
5271
|
+
if (k === 'token') {
|
|
5272
|
+
setCookie('token', _storedValue2);
|
|
5273
|
+
}
|
|
5274
|
+
}
|
|
5275
|
+
}
|
|
5276
|
+
}
|
|
5277
|
+
};
|
|
5278
|
+
|
|
5279
|
+
/**
|
|
5280
|
+
* getStorage
|
|
5281
|
+
* @desc:获取本地储存数据
|
|
5282
|
+
* @author huangbo
|
|
5283
|
+
* @date 2022年5月7日
|
|
5284
|
+
* @param {String} [key] - 获取的名称
|
|
5285
|
+
**/
|
|
5286
|
+
var getStorage = function getStorage(key) {
|
|
5287
|
+
if (key) {
|
|
5288
|
+
var res = sessionStorage.getItem(key) || localStorage.getItem(key);
|
|
5289
|
+
if (!res && key === 'token') {
|
|
5290
|
+
res = getCookie('token');
|
|
5291
|
+
}
|
|
5292
|
+
if (key === 'host' && !res) {
|
|
5293
|
+
res = '';
|
|
5294
|
+
}
|
|
5295
|
+
return res;
|
|
5296
|
+
}
|
|
5297
|
+
var defaults = {};
|
|
5298
|
+
var token = sessionStorage.getItem('token') || localStorage.getItem('token') || getCookie('token');
|
|
5299
|
+
var ssId = sessionStorage.getItem('ssId') || localStorage.getItem('ssId') || getCookie('ssId');
|
|
5300
|
+
|
|
5301
|
+
var deviceUnique = sessionStorage.getItem('deviceUnique') || localStorage.getItem('deviceUnique') || getCookie('deviceUnique');
|
|
5302
|
+
if (token) {
|
|
5303
|
+
defaults.Authorization = token;
|
|
5304
|
+
}
|
|
5305
|
+
if (ssId) {
|
|
5306
|
+
defaults.ssId = ssId;
|
|
5307
|
+
}
|
|
5308
|
+
if (deviceUnique) {
|
|
5309
|
+
defaults.deviceUnique = deviceUnique;
|
|
5310
|
+
}
|
|
5311
|
+
return defaults;
|
|
5312
|
+
};
|
|
5313
|
+
|
|
5314
|
+
/**
|
|
5315
|
+
* removeStorage
|
|
5316
|
+
* @desc:删除本地储存数据
|
|
5317
|
+
* @author huangbo
|
|
5318
|
+
* @date 2022年5月7日
|
|
5319
|
+
* @param {String, Array} [key] - 获取的名称
|
|
5320
|
+
**/
|
|
5321
|
+
var removeStorage = function removeStorage(key) {
|
|
5322
|
+
if (Array.isArray(key)) {
|
|
5323
|
+
for (var i = 0; i < key.length; i++) {
|
|
5324
|
+
sessionStorage.removeItem(key[i]);
|
|
5325
|
+
localStorage.removeItem(key[i]);
|
|
5326
|
+
if (key[i] === 'token') {
|
|
5327
|
+
removeCookie('token');
|
|
5328
|
+
}
|
|
5329
|
+
}
|
|
5330
|
+
} else if (key) {
|
|
5331
|
+
sessionStorage.removeItem(key);
|
|
5332
|
+
localStorage.removeItem(key);
|
|
5333
|
+
if (key === 'token') {
|
|
5334
|
+
removeCookie('token');
|
|
5335
|
+
}
|
|
5336
|
+
} else {
|
|
5337
|
+
sessionStorage.clear();
|
|
5338
|
+
localStorage.clear();
|
|
5339
|
+
removeCookie('token');
|
|
5340
|
+
}
|
|
5341
|
+
};
|
|
5342
|
+
|
|
5343
|
+
/**
|
|
5344
|
+
* setCookie
|
|
5345
|
+
* @desc 设置cookie
|
|
5346
|
+
* @author huangbo
|
|
5347
|
+
* @param {string} [name] cookie名称
|
|
5348
|
+
* @param {string} [value] cookie值
|
|
5349
|
+
* @param {boolean} [isSession] 是否是会话cookie
|
|
5350
|
+
**/
|
|
5351
|
+
var setCookie = function setCookie(name, value) {
|
|
5352
|
+
var isSession = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
5353
|
+
var time = arguments[3];
|
|
5354
|
+
|
|
5355
|
+
try {
|
|
5356
|
+
var cookieParts = [encodeURIComponent(name) + '=' + encodeURIComponent(value), 'path=/' // 仅保留path设置,确保全站访问
|
|
5357
|
+
];
|
|
5358
|
+
// 会话/持久Cookie设置
|
|
5359
|
+
if (!isSession) {
|
|
5360
|
+
if (/MSIE|Trident/.test(navigator.userAgent)) {
|
|
5361
|
+
// IE使用expires
|
|
5362
|
+
var date = new Date();
|
|
5363
|
+
date.setTime(date.getTime() + (time || 7 * 24 * 60 * 60 * 1000));
|
|
5364
|
+
cookieParts.push('expires=' + date.toUTCString());
|
|
5365
|
+
} else {
|
|
5366
|
+
// 其他浏览器使用max-age
|
|
5367
|
+
cookieParts.push('max-age=' + (time || 7 * 24 * 60 * 60));
|
|
5368
|
+
}
|
|
5369
|
+
}
|
|
5370
|
+
// 内核兼容处理
|
|
5371
|
+
if (/MSIE|Trident/.test(navigator.userAgent)) {
|
|
5372
|
+
// IE特殊处理:添加P3P协议头
|
|
5373
|
+
cookieParts.push('P3P=CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
|
|
5374
|
+
} else {
|
|
5375
|
+
// 现代浏览器设置
|
|
5376
|
+
cookieParts.push('samesite=lax');
|
|
5377
|
+
if (window.location.protocol === 'https:') {
|
|
5378
|
+
cookieParts.push('secure');
|
|
5379
|
+
}
|
|
5380
|
+
}
|
|
5381
|
+
|
|
5382
|
+
// 设置Cookie
|
|
5383
|
+
document.cookie = cookieParts.join('; ');
|
|
5384
|
+
return true;
|
|
5385
|
+
} catch (e) {
|
|
5386
|
+
console.error('Cookie设置失败:', e);
|
|
5387
|
+
return false;
|
|
5388
|
+
}
|
|
5389
|
+
};
|
|
5390
|
+
|
|
5391
|
+
/**
|
|
5392
|
+
* getCookie
|
|
5393
|
+
* @desc 获取cookie中指定名称的值
|
|
5394
|
+
* @author huangbo
|
|
5395
|
+
* @param {string} [name] cookie名称
|
|
5396
|
+
**/
|
|
5397
|
+
var getCookie = function getCookie(name) {
|
|
5398
|
+
var cookies = document.cookie.split(';');
|
|
5399
|
+
for (var _iterator = cookies, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
|
|
5400
|
+
var _ref;
|
|
5401
|
+
|
|
5402
|
+
if (_isArray) {
|
|
5403
|
+
if (_i >= _iterator.length) break;
|
|
5404
|
+
_ref = _iterator[_i++];
|
|
5405
|
+
} else {
|
|
5406
|
+
_i = _iterator.next();
|
|
5407
|
+
if (_i.done) break;
|
|
5408
|
+
_ref = _i.value;
|
|
5409
|
+
}
|
|
5410
|
+
|
|
5411
|
+
var cookie = _ref;
|
|
5412
|
+
|
|
5413
|
+
var _cookie$trim$split = cookie.trim().split('='),
|
|
5414
|
+
cookieName = _cookie$trim$split[0],
|
|
5415
|
+
cookieValue = _cookie$trim$split[1];
|
|
5416
|
+
|
|
5417
|
+
if (decodeURIComponent(cookieName) === name) {
|
|
5418
|
+
return decodeURIComponent(cookieValue);
|
|
5419
|
+
}
|
|
5420
|
+
}
|
|
5421
|
+
return null;
|
|
5422
|
+
};
|
|
5423
|
+
|
|
5424
|
+
/**
|
|
5425
|
+
* removeCookie
|
|
5426
|
+
* @desc:删除cookie
|
|
5427
|
+
* @author huangbo
|
|
5428
|
+
* @date 2022年5月7日
|
|
5429
|
+
* @param {String, Array} [key] - 获取的名称
|
|
5430
|
+
**/
|
|
5431
|
+
var removeCookie = function removeCookie(key) {
|
|
5432
|
+
if (Array.isArray(key)) {
|
|
5433
|
+
for (var i = 0; i < key.length; i++) {
|
|
5434
|
+
document.cookie = encodeURIComponent(key[i]) + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
|
|
5435
|
+
}
|
|
5436
|
+
} else {
|
|
5437
|
+
document.cookie = encodeURIComponent(key) + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
|
|
5438
|
+
}
|
|
5439
|
+
};
|
|
5440
|
+
|
|
5441
|
+
/***/ }),
|
|
5442
|
+
|
|
5443
|
+
/***/ 20:
|
|
5444
|
+
/***/ (function(module, exports) {
|
|
5445
|
+
|
|
5446
|
+
module.exports = require("lodash/get");
|
|
5447
|
+
|
|
5448
|
+
/***/ }),
|
|
5449
|
+
|
|
5450
|
+
/***/ 21:
|
|
5451
|
+
/***/ (function(module, exports) {
|
|
5452
|
+
|
|
5453
|
+
module.exports = require("lodash/set");
|
|
5454
|
+
|
|
5455
|
+
/***/ }),
|
|
5456
|
+
|
|
5457
|
+
/***/ 22:
|
|
5458
|
+
/***/ (function(module, exports) {
|
|
5459
|
+
|
|
5460
|
+
module.exports = require("lodash/cloneDeep");
|
|
5461
|
+
|
|
5462
|
+
/***/ }),
|
|
5463
|
+
|
|
5464
|
+
/***/ 3:
|
|
5465
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
5466
|
+
|
|
5467
|
+
"use strict";
|
|
5468
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
|
|
5469
|
+
/* globals __VUE_SSR_CONTEXT__ */
|
|
5470
|
+
|
|
5471
|
+
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
|
|
5472
|
+
// This module is a runtime utility for cleaner component module output and will
|
|
5473
|
+
// be included in the final webpack user bundle.
|
|
5474
|
+
|
|
5475
|
+
function normalizeComponent(
|
|
5476
|
+
scriptExports,
|
|
5477
|
+
render,
|
|
5478
|
+
staticRenderFns,
|
|
5479
|
+
functionalTemplate,
|
|
5480
|
+
injectStyles,
|
|
5481
|
+
scopeId,
|
|
5482
|
+
moduleIdentifier /* server only */,
|
|
5483
|
+
shadowMode /* vue-cli only */
|
|
5484
|
+
) {
|
|
5485
|
+
// Vue.extend constructor export interop
|
|
5486
|
+
var options =
|
|
5487
|
+
typeof scriptExports === 'function' ? scriptExports.options : scriptExports
|
|
5488
|
+
|
|
5489
|
+
// render functions
|
|
5490
|
+
if (render) {
|
|
5491
|
+
options.render = render
|
|
5492
|
+
options.staticRenderFns = staticRenderFns
|
|
5493
|
+
options._compiled = true
|
|
5494
|
+
}
|
|
5495
|
+
|
|
5496
|
+
// functional template
|
|
5497
|
+
if (functionalTemplate) {
|
|
5498
|
+
options.functional = true
|
|
5499
|
+
}
|
|
5500
|
+
|
|
5501
|
+
// scopedId
|
|
5502
|
+
if (scopeId) {
|
|
5503
|
+
options._scopeId = 'data-v-' + scopeId
|
|
5504
|
+
}
|
|
5505
|
+
|
|
5506
|
+
var hook
|
|
5507
|
+
if (moduleIdentifier) {
|
|
5508
|
+
// server build
|
|
5509
|
+
hook = function (context) {
|
|
5510
|
+
// 2.3 injection
|
|
5511
|
+
context =
|
|
5512
|
+
context || // cached call
|
|
5513
|
+
(this.$vnode && this.$vnode.ssrContext) || // stateful
|
|
5514
|
+
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
|
|
5515
|
+
// 2.2 with runInNewContext: true
|
|
5516
|
+
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
5517
|
+
context = __VUE_SSR_CONTEXT__
|
|
5518
|
+
}
|
|
5519
|
+
// inject component styles
|
|
5520
|
+
if (injectStyles) {
|
|
5521
|
+
injectStyles.call(this, context)
|
|
5522
|
+
}
|
|
5523
|
+
// register component module identifier for async chunk inferrence
|
|
5524
|
+
if (context && context._registeredComponents) {
|
|
5525
|
+
context._registeredComponents.add(moduleIdentifier)
|
|
5526
|
+
}
|
|
5527
|
+
}
|
|
5528
|
+
// used by ssr in case component is cached and beforeCreate
|
|
5529
|
+
// never gets called
|
|
5530
|
+
options._ssrRegister = hook
|
|
5531
|
+
} else if (injectStyles) {
|
|
5532
|
+
hook = shadowMode
|
|
5533
|
+
? function () {
|
|
5534
|
+
injectStyles.call(
|
|
5535
|
+
this,
|
|
5536
|
+
(options.functional ? this.parent : this).$root.$options.shadowRoot
|
|
5537
|
+
)
|
|
5538
|
+
}
|
|
5539
|
+
: injectStyles
|
|
5540
|
+
}
|
|
5541
|
+
|
|
5542
|
+
if (hook) {
|
|
5543
|
+
if (options.functional) {
|
|
5544
|
+
// for template-only hot-reload because in that case the render fn doesn't
|
|
5545
|
+
// go through the normalizer
|
|
5546
|
+
options._injectStyles = hook
|
|
5547
|
+
// register for functional component in vue file
|
|
5548
|
+
var originalRender = options.render
|
|
5549
|
+
options.render = function renderWithStyleInjection(h, context) {
|
|
5550
|
+
hook.call(context)
|
|
5551
|
+
return originalRender(h, context)
|
|
5552
|
+
}
|
|
5553
|
+
} else {
|
|
5554
|
+
// inject component registration as beforeCreate hook
|
|
5555
|
+
var existing = options.beforeCreate
|
|
5556
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
|
|
5557
|
+
}
|
|
5558
|
+
}
|
|
5559
|
+
|
|
5560
|
+
return {
|
|
5561
|
+
exports: scriptExports,
|
|
5562
|
+
options: options
|
|
5563
|
+
}
|
|
5564
|
+
}
|
|
5565
|
+
|
|
5566
|
+
|
|
5567
|
+
/***/ }),
|
|
5568
|
+
|
|
5569
|
+
/***/ 4:
|
|
5570
|
+
/***/ (function(module, exports) {
|
|
5571
|
+
|
|
5572
|
+
module.exports = require("vue");
|
|
5573
|
+
|
|
5574
|
+
/***/ }),
|
|
5575
|
+
|
|
5576
|
+
/***/ 6:
|
|
5577
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
5578
|
+
|
|
5579
|
+
"use strict";
|
|
5580
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isString; });
|
|
5581
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isObject; });
|
|
5582
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isHtmlElement; });
|
|
5583
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isFunction; });
|
|
5584
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isUndefined; });
|
|
5585
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isDefined; });
|
|
5430
5586
|
/**
|
|
5431
|
-
*
|
|
5432
|
-
* @
|
|
5433
|
-
* @
|
|
5434
|
-
|
|
5435
|
-
|
|
5436
|
-
|
|
5437
|
-
|
|
5438
|
-
|
|
5439
|
-
}
|
|
5440
|
-
if (typeof date === 'string') {
|
|
5441
|
-
date = new Date(date);
|
|
5442
|
-
}
|
|
5443
|
-
return date.getHours();
|
|
5444
|
-
};
|
|
5445
|
-
|
|
5587
|
+
* 检查一个值是否为字符串类型
|
|
5588
|
+
* @param {*} obj 要检查的值
|
|
5589
|
+
* @returns {boolean} 如果值为字符串则返回true,否则返回false
|
|
5590
|
+
*/
|
|
5591
|
+
function isString(obj) {
|
|
5592
|
+
return Object.prototype.toString.call(obj) === '[object String]';
|
|
5593
|
+
}
|
|
5594
|
+
|
|
5446
5595
|
/**
|
|
5447
|
-
*
|
|
5448
|
-
* @
|
|
5449
|
-
* @
|
|
5450
|
-
|
|
5451
|
-
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
|
|
5455
|
-
}
|
|
5456
|
-
if (typeof date === 'string') {
|
|
5457
|
-
date = new Date(date);
|
|
5458
|
-
}
|
|
5459
|
-
return date.getMinutes();
|
|
5460
|
-
};
|
|
5461
|
-
|
|
5596
|
+
* 检查一个值是否为对象类型
|
|
5597
|
+
* @param {*} obj 要检查的值
|
|
5598
|
+
* @returns {boolean} 如果值为对象则返回true,否则返回false
|
|
5599
|
+
*/
|
|
5600
|
+
function isObject(obj) {
|
|
5601
|
+
return Object.prototype.toString.call(obj) === '[object Object]';
|
|
5602
|
+
}
|
|
5603
|
+
|
|
5462
5604
|
/**
|
|
5463
|
-
*
|
|
5464
|
-
* @
|
|
5465
|
-
* @
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
|
|
5471
|
-
}
|
|
5472
|
-
if (typeof date === 'string') {
|
|
5473
|
-
date = new Date(date);
|
|
5474
|
-
}
|
|
5475
|
-
return date.getMonth() + 1;
|
|
5476
|
-
};
|
|
5477
|
-
|
|
5605
|
+
* 检查一个节点是否为HTML元素
|
|
5606
|
+
* @param {Node} node 要检查的节点
|
|
5607
|
+
* @returns {boolean} 如果节点为HTML元素则返回true,否则返回false
|
|
5608
|
+
*/
|
|
5609
|
+
function isHtmlElement(node) {
|
|
5610
|
+
return node && node.nodeType === Node.ELEMENT_NODE;
|
|
5611
|
+
}
|
|
5612
|
+
|
|
5478
5613
|
/**
|
|
5479
|
-
*
|
|
5480
|
-
* @
|
|
5481
|
-
* @
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
if (typeof date === 'string') {
|
|
5489
|
-
date = new Date(date);
|
|
5490
|
-
}
|
|
5491
|
-
return date.getSeconds();
|
|
5492
|
-
};
|
|
5493
|
-
|
|
5614
|
+
* 检查一个值是否为函数类型
|
|
5615
|
+
* @param {*} functionToCheck 要检查的值
|
|
5616
|
+
* @returns {boolean} 如果值为函数则返回true,否则返回false
|
|
5617
|
+
*/
|
|
5618
|
+
function isFunction(functionToCheck) {
|
|
5619
|
+
var getType = {};
|
|
5620
|
+
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
|
|
5621
|
+
}
|
|
5622
|
+
|
|
5494
5623
|
/**
|
|
5495
|
-
*
|
|
5496
|
-
* @
|
|
5497
|
-
* @
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
}
|
|
5504
|
-
if (typeof date === 'string') {
|
|
5505
|
-
date = new Date(date);
|
|
5506
|
-
}
|
|
5507
|
-
return date.getDay();
|
|
5508
|
-
};
|
|
5509
|
-
|
|
5510
|
-
|
|
5624
|
+
* 检查一个值是否为undefined
|
|
5625
|
+
* @param {*} val 要检查的值
|
|
5626
|
+
* @returns {boolean} 如果值为undefined则返回true,否则返回false
|
|
5627
|
+
*/
|
|
5628
|
+
function isUndefined(val) {
|
|
5629
|
+
return val === void 0;
|
|
5630
|
+
}
|
|
5631
|
+
|
|
5511
5632
|
/**
|
|
5512
|
-
*
|
|
5513
|
-
* @
|
|
5514
|
-
* @
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
if (!time) {
|
|
5520
|
-
hour = new Date().getHours();
|
|
5521
|
-
} else if (typeof time === 'string') {
|
|
5522
|
-
// 从时间字符串中提取小时
|
|
5523
|
-
const match = time.match(/^(\d{1,2})/);
|
|
5524
|
-
if (match) {
|
|
5525
|
-
hour = parseInt(match[1], 10);
|
|
5526
|
-
}
|
|
5527
|
-
} else if (typeof time === 'number') {
|
|
5528
|
-
hour = time;
|
|
5529
|
-
}
|
|
5530
|
-
// 判断时间段
|
|
5531
|
-
if (hour >= 5 && hour < 12) {
|
|
5532
|
-
return '上午';
|
|
5533
|
-
} else if (hour >= 12 && hour < 18) {
|
|
5534
|
-
return '下午';
|
|
5535
|
-
} else {
|
|
5536
|
-
return '晚上';
|
|
5537
|
-
}
|
|
5538
|
-
};
|
|
5633
|
+
* 检查一个值是否已定义(不是undefined或null)
|
|
5634
|
+
* @param {*} val 要检查的值
|
|
5635
|
+
* @returns {boolean} 如果值已定义则返回true,否则返回false
|
|
5636
|
+
*/
|
|
5637
|
+
function isDefined(val) {
|
|
5638
|
+
return val !== undefined && val !== null;
|
|
5639
|
+
}
|
|
5539
5640
|
|
|
5540
5641
|
/***/ }),
|
|
5541
5642
|
|