1 |
|
2 |
|
3 |
|
4 |
|
5 | (function webpackUniversalModuleDefinition(root, factory) {
|
6 | if(typeof exports === 'object' && typeof module === 'object')
|
7 | module.exports = factory(require("react"));
|
8 | else if(typeof define === 'function' && define.amd)
|
9 | define(["react"], factory);
|
10 | else if(typeof exports === 'object')
|
11 | exports["UMD"] = factory(require("react"));
|
12 | else
|
13 | root["UMD"] = factory(root["React"]);
|
14 | })(window, function(__WEBPACK_EXTERNAL_MODULE__1__) {
|
15 | return (function(modules) {
|
16 |
|
17 | var installedModules = {};
|
18 |
|
19 |
|
20 | function __webpack_require__(moduleId) {
|
21 |
|
22 |
|
23 | if(installedModules[moduleId]) {
|
24 | return installedModules[moduleId].exports;
|
25 | }
|
26 |
|
27 | var module = installedModules[moduleId] = {
|
28 | i: moduleId,
|
29 | l: false,
|
30 | exports: {}
|
31 | };
|
32 |
|
33 |
|
34 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
35 |
|
36 |
|
37 | module.l = true;
|
38 |
|
39 |
|
40 | return module.exports;
|
41 | }
|
42 |
|
43 |
|
44 |
|
45 | __webpack_require__.m = modules;
|
46 |
|
47 |
|
48 | __webpack_require__.c = installedModules;
|
49 |
|
50 |
|
51 | __webpack_require__.d = function(exports, name, getter) {
|
52 | if(!__webpack_require__.o(exports, name)) {
|
53 | Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
54 | }
|
55 | };
|
56 |
|
57 |
|
58 | __webpack_require__.r = function(exports) {
|
59 | if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
60 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
61 | }
|
62 | Object.defineProperty(exports, '__esModule', { value: true });
|
63 | };
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 | __webpack_require__.t = function(value, mode) {
|
71 | if(mode & 1) value = __webpack_require__(value);
|
72 | if(mode & 8) return value;
|
73 | if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
74 | var ns = Object.create(null);
|
75 | __webpack_require__.r(ns);
|
76 | Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
77 | if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
78 | return ns;
|
79 | };
|
80 |
|
81 |
|
82 | __webpack_require__.n = function(module) {
|
83 | var getter = module && module.__esModule ?
|
84 | function getDefault() { return module['default']; } :
|
85 | function getModuleExports() { return module; };
|
86 | __webpack_require__.d(getter, 'a', getter);
|
87 | return getter;
|
88 | };
|
89 |
|
90 |
|
91 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
92 |
|
93 |
|
94 | __webpack_require__.p = "";
|
95 |
|
96 |
|
97 |
|
98 | return __webpack_require__(__webpack_require__.s = 15);
|
99 | })
|
100 |
|
101 | ([
|
102 |
|
103 | (function(module, exports, __webpack_require__) {
|
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 |
|
110 |
|
111 |
|
112 | if (false) { var throwOnDirectAccess, ReactIs; } else {
|
113 |
|
114 |
|
115 | module.exports = __webpack_require__(25)();
|
116 | }
|
117 |
|
118 |
|
119 | }),
|
120 |
|
121 | (function(module, exports) {
|
122 |
|
123 | module.exports = __WEBPACK_EXTERNAL_MODULE__1__;
|
124 |
|
125 | }),
|
126 |
|
127 | (function(module, exports, __webpack_require__) {
|
128 |
|
129 | "use strict";
|
130 |
|
131 |
|
132 | function checkDCE() {
|
133 |
|
134 | if (
|
135 | typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||
|
136 | typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'
|
137 | ) {
|
138 | return;
|
139 | }
|
140 | if (false) {}
|
141 | try {
|
142 |
|
143 | __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
|
144 | } catch (err) {
|
145 |
|
146 |
|
147 | console.error(err);
|
148 | }
|
149 | }
|
150 |
|
151 | if (true) {
|
152 |
|
153 |
|
154 | checkDCE();
|
155 | module.exports = __webpack_require__(27);
|
156 | } else {}
|
157 |
|
158 |
|
159 | }),
|
160 |
|
161 | (function(module, exports, __webpack_require__) {
|
162 |
|
163 | "use strict";
|
164 |
|
165 |
|
166 | var bind = __webpack_require__(5);
|
167 | var isBuffer = __webpack_require__(32);
|
168 |
|
169 |
|
170 |
|
171 |
|
172 |
|
173 | var toString = Object.prototype.toString;
|
174 |
|
175 |
|
176 |
|
177 |
|
178 |
|
179 |
|
180 |
|
181 | function isArray(val) {
|
182 | return toString.call(val) === '[object Array]';
|
183 | }
|
184 |
|
185 |
|
186 |
|
187 |
|
188 |
|
189 |
|
190 |
|
191 | function isArrayBuffer(val) {
|
192 | return toString.call(val) === '[object ArrayBuffer]';
|
193 | }
|
194 |
|
195 |
|
196 |
|
197 |
|
198 |
|
199 |
|
200 |
|
201 | function isFormData(val) {
|
202 | return (typeof FormData !== 'undefined') && (val instanceof FormData);
|
203 | }
|
204 |
|
205 |
|
206 |
|
207 |
|
208 |
|
209 |
|
210 |
|
211 | function isArrayBufferView(val) {
|
212 | var result;
|
213 | if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
|
214 | result = ArrayBuffer.isView(val);
|
215 | } else {
|
216 | result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
|
217 | }
|
218 | return result;
|
219 | }
|
220 |
|
221 |
|
222 |
|
223 |
|
224 |
|
225 |
|
226 |
|
227 | function isString(val) {
|
228 | return typeof val === 'string';
|
229 | }
|
230 |
|
231 |
|
232 |
|
233 |
|
234 |
|
235 |
|
236 |
|
237 | function isNumber(val) {
|
238 | return typeof val === 'number';
|
239 | }
|
240 |
|
241 |
|
242 |
|
243 |
|
244 |
|
245 |
|
246 |
|
247 | function isUndefined(val) {
|
248 | return typeof val === 'undefined';
|
249 | }
|
250 |
|
251 |
|
252 |
|
253 |
|
254 |
|
255 |
|
256 |
|
257 | function isObject(val) {
|
258 | return val !== null && typeof val === 'object';
|
259 | }
|
260 |
|
261 |
|
262 |
|
263 |
|
264 |
|
265 |
|
266 |
|
267 | function isDate(val) {
|
268 | return toString.call(val) === '[object Date]';
|
269 | }
|
270 |
|
271 |
|
272 |
|
273 |
|
274 |
|
275 |
|
276 |
|
277 | function isFile(val) {
|
278 | return toString.call(val) === '[object File]';
|
279 | }
|
280 |
|
281 |
|
282 |
|
283 |
|
284 |
|
285 |
|
286 |
|
287 | function isBlob(val) {
|
288 | return toString.call(val) === '[object Blob]';
|
289 | }
|
290 |
|
291 |
|
292 |
|
293 |
|
294 |
|
295 |
|
296 |
|
297 | function isFunction(val) {
|
298 | return toString.call(val) === '[object Function]';
|
299 | }
|
300 |
|
301 |
|
302 |
|
303 |
|
304 |
|
305 |
|
306 |
|
307 | function isStream(val) {
|
308 | return isObject(val) && isFunction(val.pipe);
|
309 | }
|
310 |
|
311 |
|
312 |
|
313 |
|
314 |
|
315 |
|
316 |
|
317 | function isURLSearchParams(val) {
|
318 | return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
|
319 | }
|
320 |
|
321 |
|
322 |
|
323 |
|
324 |
|
325 |
|
326 |
|
327 | function trim(str) {
|
328 | return str.replace(/^\s*/, '').replace(/\s*$/, '');
|
329 | }
|
330 |
|
331 |
|
332 |
|
333 |
|
334 |
|
335 |
|
336 |
|
337 |
|
338 |
|
339 |
|
340 |
|
341 |
|
342 |
|
343 |
|
344 |
|
345 |
|
346 | function isStandardBrowserEnv() {
|
347 | if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
|
348 | navigator.product === 'NativeScript' ||
|
349 | navigator.product === 'NS')) {
|
350 | return false;
|
351 | }
|
352 | return (
|
353 | typeof window !== 'undefined' &&
|
354 | typeof document !== 'undefined'
|
355 | );
|
356 | }
|
357 |
|
358 |
|
359 |
|
360 |
|
361 |
|
362 |
|
363 |
|
364 |
|
365 |
|
366 |
|
367 |
|
368 |
|
369 |
|
370 | function forEach(obj, fn) {
|
371 |
|
372 | if (obj === null || typeof obj === 'undefined') {
|
373 | return;
|
374 | }
|
375 |
|
376 |
|
377 | if (typeof obj !== 'object') {
|
378 |
|
379 | obj = [obj];
|
380 | }
|
381 |
|
382 | if (isArray(obj)) {
|
383 |
|
384 | for (var i = 0, l = obj.length; i < l; i++) {
|
385 | fn.call(null, obj[i], i, obj);
|
386 | }
|
387 | } else {
|
388 |
|
389 | for (var key in obj) {
|
390 | if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
391 | fn.call(null, obj[key], key, obj);
|
392 | }
|
393 | }
|
394 | }
|
395 | }
|
396 |
|
397 |
|
398 |
|
399 |
|
400 |
|
401 |
|
402 |
|
403 |
|
404 |
|
405 |
|
406 |
|
407 |
|
408 |
|
409 |
|
410 |
|
411 |
|
412 |
|
413 |
|
414 | function merge(/* obj1, obj2, obj3, ... */) {
|
415 | var result = {};
|
416 | function assignValue(val, key) {
|
417 | if (typeof result[key] === 'object' && typeof val === 'object') {
|
418 | result[key] = merge(result[key], val);
|
419 | } else {
|
420 | result[key] = val;
|
421 | }
|
422 | }
|
423 |
|
424 | for (var i = 0, l = arguments.length; i < l; i++) {
|
425 | forEach(arguments[i], assignValue);
|
426 | }
|
427 | return result;
|
428 | }
|
429 |
|
430 |
|
431 |
|
432 |
|
433 |
|
434 |
|
435 |
|
436 |
|
437 |
|
438 | function deepMerge(/* obj1, obj2, obj3, ... */) {
|
439 | var result = {};
|
440 | function assignValue(val, key) {
|
441 | if (typeof result[key] === 'object' && typeof val === 'object') {
|
442 | result[key] = deepMerge(result[key], val);
|
443 | } else if (typeof val === 'object') {
|
444 | result[key] = deepMerge({}, val);
|
445 | } else {
|
446 | result[key] = val;
|
447 | }
|
448 | }
|
449 |
|
450 | for (var i = 0, l = arguments.length; i < l; i++) {
|
451 | forEach(arguments[i], assignValue);
|
452 | }
|
453 | return result;
|
454 | }
|
455 |
|
456 |
|
457 |
|
458 |
|
459 |
|
460 |
|
461 |
|
462 |
|
463 |
|
464 | function extend(a, b, thisArg) {
|
465 | forEach(b, function assignValue(val, key) {
|
466 | if (thisArg && typeof val === 'function') {
|
467 | a[key] = bind(val, thisArg);
|
468 | } else {
|
469 | a[key] = val;
|
470 | }
|
471 | });
|
472 | return a;
|
473 | }
|
474 |
|
475 | module.exports = {
|
476 | isArray: isArray,
|
477 | isArrayBuffer: isArrayBuffer,
|
478 | isBuffer: isBuffer,
|
479 | isFormData: isFormData,
|
480 | isArrayBufferView: isArrayBufferView,
|
481 | isString: isString,
|
482 | isNumber: isNumber,
|
483 | isObject: isObject,
|
484 | isUndefined: isUndefined,
|
485 | isDate: isDate,
|
486 | isFile: isFile,
|
487 | isBlob: isBlob,
|
488 | isFunction: isFunction,
|
489 | isStream: isStream,
|
490 | isURLSearchParams: isURLSearchParams,
|
491 | isStandardBrowserEnv: isStandardBrowserEnv,
|
492 | forEach: forEach,
|
493 | merge: merge,
|
494 | deepMerge: deepMerge,
|
495 | extend: extend,
|
496 | trim: trim
|
497 | };
|
498 |
|
499 |
|
500 | }),
|
501 |
|
502 | (function(module, exports, __webpack_require__) {
|
503 |
|
504 | module.exports = __webpack_require__(31);
|
505 |
|
506 | }),
|
507 |
|
508 | (function(module, exports, __webpack_require__) {
|
509 |
|
510 | "use strict";
|
511 |
|
512 |
|
513 | module.exports = function bind(fn, thisArg) {
|
514 | return function wrap() {
|
515 | var args = new Array(arguments.length);
|
516 | for (var i = 0; i < args.length; i++) {
|
517 | args[i] = arguments[i];
|
518 | }
|
519 | return fn.apply(thisArg, args);
|
520 | };
|
521 | };
|
522 |
|
523 |
|
524 | }),
|
525 |
|
526 | (function(module, exports, __webpack_require__) {
|
527 |
|
528 | "use strict";
|
529 |
|
530 |
|
531 | var utils = __webpack_require__(3);
|
532 |
|
533 | function encode(val) {
|
534 | return encodeURIComponent(val).
|
535 | replace(/%40/gi, '@').
|
536 | replace(/%3A/gi, ':').
|
537 | replace(/%24/g, '$').
|
538 | replace(/%2C/gi, ',').
|
539 | replace(/%20/g, '+').
|
540 | replace(/%5B/gi, '[').
|
541 | replace(/%5D/gi, ']');
|
542 | }
|
543 |
|
544 |
|
545 |
|
546 |
|
547 |
|
548 |
|
549 |
|
550 |
|
551 | module.exports = function buildURL(url, params, paramsSerializer) {
|
552 |
|
553 | if (!params) {
|
554 | return url;
|
555 | }
|
556 |
|
557 | var serializedParams;
|
558 | if (paramsSerializer) {
|
559 | serializedParams = paramsSerializer(params);
|
560 | } else if (utils.isURLSearchParams(params)) {
|
561 | serializedParams = params.toString();
|
562 | } else {
|
563 | var parts = [];
|
564 |
|
565 | utils.forEach(params, function serialize(val, key) {
|
566 | if (val === null || typeof val === 'undefined') {
|
567 | return;
|
568 | }
|
569 |
|
570 | if (utils.isArray(val)) {
|
571 | key = key + '[]';
|
572 | } else {
|
573 | val = [val];
|
574 | }
|
575 |
|
576 | utils.forEach(val, function parseValue(v) {
|
577 | if (utils.isDate(v)) {
|
578 | v = v.toISOString();
|
579 | } else if (utils.isObject(v)) {
|
580 | v = JSON.stringify(v);
|
581 | }
|
582 | parts.push(encode(key) + '=' + encode(v));
|
583 | });
|
584 | });
|
585 |
|
586 | serializedParams = parts.join('&');
|
587 | }
|
588 |
|
589 | if (serializedParams) {
|
590 | var hashmarkIndex = url.indexOf('#');
|
591 | if (hashmarkIndex !== -1) {
|
592 | url = url.slice(0, hashmarkIndex);
|
593 | }
|
594 |
|
595 | url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
|
596 | }
|
597 |
|
598 | return url;
|
599 | };
|
600 |
|
601 |
|
602 | }),
|
603 |
|
604 | (function(module, exports, __webpack_require__) {
|
605 |
|
606 | "use strict";
|
607 |
|
608 |
|
609 | module.exports = function isCancel(value) {
|
610 | return !!(value && value.__CANCEL__);
|
611 | };
|
612 |
|
613 |
|
614 | }),
|
615 |
|
616 | (function(module, exports, __webpack_require__) {
|
617 |
|
618 | "use strict";
|
619 | (function(process) {
|
620 |
|
621 | var utils = __webpack_require__(3);
|
622 | var normalizeHeaderName = __webpack_require__(38);
|
623 |
|
624 | var DEFAULT_CONTENT_TYPE = {
|
625 | 'Content-Type': 'application/x-www-form-urlencoded'
|
626 | };
|
627 |
|
628 | function setContentTypeIfUnset(headers, value) {
|
629 | if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
|
630 | headers['Content-Type'] = value;
|
631 | }
|
632 | }
|
633 |
|
634 | function getDefaultAdapter() {
|
635 | var adapter;
|
636 |
|
637 | if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
|
638 |
|
639 | adapter = __webpack_require__(9);
|
640 | } else if (typeof XMLHttpRequest !== 'undefined') {
|
641 |
|
642 | adapter = __webpack_require__(9);
|
643 | }
|
644 | return adapter;
|
645 | }
|
646 |
|
647 | var defaults = {
|
648 | adapter: getDefaultAdapter(),
|
649 |
|
650 | transformRequest: [function transformRequest(data, headers) {
|
651 | normalizeHeaderName(headers, 'Accept');
|
652 | normalizeHeaderName(headers, 'Content-Type');
|
653 | if (utils.isFormData(data) ||
|
654 | utils.isArrayBuffer(data) ||
|
655 | utils.isBuffer(data) ||
|
656 | utils.isStream(data) ||
|
657 | utils.isFile(data) ||
|
658 | utils.isBlob(data)
|
659 | ) {
|
660 | return data;
|
661 | }
|
662 | if (utils.isArrayBufferView(data)) {
|
663 | return data.buffer;
|
664 | }
|
665 | if (utils.isURLSearchParams(data)) {
|
666 | setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
|
667 | return data.toString();
|
668 | }
|
669 | if (utils.isObject(data)) {
|
670 | setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
|
671 | return JSON.stringify(data);
|
672 | }
|
673 | return data;
|
674 | }],
|
675 |
|
676 | transformResponse: [function transformResponse(data) {
|
677 |
|
678 | if (typeof data === 'string') {
|
679 | try {
|
680 | data = JSON.parse(data);
|
681 | } catch (e) { }
|
682 | }
|
683 | return data;
|
684 | }],
|
685 |
|
686 | |
687 |
|
688 |
|
689 |
|
690 | timeout: 0,
|
691 |
|
692 | xsrfCookieName: 'XSRF-TOKEN',
|
693 | xsrfHeaderName: 'X-XSRF-TOKEN',
|
694 |
|
695 | maxContentLength: -1,
|
696 |
|
697 | validateStatus: function validateStatus(status) {
|
698 | return status >= 200 && status < 300;
|
699 | }
|
700 | };
|
701 |
|
702 | defaults.headers = {
|
703 | common: {
|
704 | 'Accept': 'application/json, text/plain, */*'
|
705 | }
|
706 | };
|
707 |
|
708 | utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
|
709 | defaults.headers[method] = {};
|
710 | });
|
711 |
|
712 | utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
713 | defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
|
714 | });
|
715 |
|
716 | module.exports = defaults;
|
717 |
|
718 | }.call(this, __webpack_require__(37)))
|
719 |
|
720 | }),
|
721 |
|
722 | (function(module, exports, __webpack_require__) {
|
723 |
|
724 | "use strict";
|
725 |
|
726 |
|
727 | var utils = __webpack_require__(3);
|
728 | var settle = __webpack_require__(39);
|
729 | var buildURL = __webpack_require__(6);
|
730 | var parseHeaders = __webpack_require__(41);
|
731 | var isURLSameOrigin = __webpack_require__(42);
|
732 | var createError = __webpack_require__(10);
|
733 |
|
734 | module.exports = function xhrAdapter(config) {
|
735 | return new Promise(function dispatchXhrRequest(resolve, reject) {
|
736 | var requestData = config.data;
|
737 | var requestHeaders = config.headers;
|
738 |
|
739 | if (utils.isFormData(requestData)) {
|
740 | delete requestHeaders['Content-Type'];
|
741 | }
|
742 |
|
743 | var request = new XMLHttpRequest();
|
744 |
|
745 |
|
746 | if (config.auth) {
|
747 | var username = config.auth.username || '';
|
748 | var password = config.auth.password || '';
|
749 | requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
|
750 | }
|
751 |
|
752 | request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);
|
753 |
|
754 |
|
755 | request.timeout = config.timeout;
|
756 |
|
757 |
|
758 | request.onreadystatechange = function handleLoad() {
|
759 | if (!request || request.readyState !== 4) {
|
760 | return;
|
761 | }
|
762 |
|
763 |
|
764 |
|
765 |
|
766 |
|
767 | if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
|
768 | return;
|
769 | }
|
770 |
|
771 |
|
772 | var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
|
773 | var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
|
774 | var response = {
|
775 | data: responseData,
|
776 | status: request.status,
|
777 | statusText: request.statusText,
|
778 | headers: responseHeaders,
|
779 | config: config,
|
780 | request: request
|
781 | };
|
782 |
|
783 | settle(resolve, reject, response);
|
784 |
|
785 |
|
786 | request = null;
|
787 | };
|
788 |
|
789 |
|
790 | request.onabort = function handleAbort() {
|
791 | if (!request) {
|
792 | return;
|
793 | }
|
794 |
|
795 | reject(createError('Request aborted', config, 'ECONNABORTED', request));
|
796 |
|
797 |
|
798 | request = null;
|
799 | };
|
800 |
|
801 |
|
802 | request.onerror = function handleError() {
|
803 |
|
804 |
|
805 | reject(createError('Network Error', config, null, request));
|
806 |
|
807 |
|
808 | request = null;
|
809 | };
|
810 |
|
811 |
|
812 | request.ontimeout = function handleTimeout() {
|
813 | reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',
|
814 | request));
|
815 |
|
816 |
|
817 | request = null;
|
818 | };
|
819 |
|
820 |
|
821 |
|
822 |
|
823 | if (utils.isStandardBrowserEnv()) {
|
824 | var cookies = __webpack_require__(43);
|
825 |
|
826 |
|
827 | var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?
|
828 | cookies.read(config.xsrfCookieName) :
|
829 | undefined;
|
830 |
|
831 | if (xsrfValue) {
|
832 | requestHeaders[config.xsrfHeaderName] = xsrfValue;
|
833 | }
|
834 | }
|
835 |
|
836 |
|
837 | if ('setRequestHeader' in request) {
|
838 | utils.forEach(requestHeaders, function setRequestHeader(val, key) {
|
839 | if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
|
840 |
|
841 | delete requestHeaders[key];
|
842 | } else {
|
843 |
|
844 | request.setRequestHeader(key, val);
|
845 | }
|
846 | });
|
847 | }
|
848 |
|
849 |
|
850 | if (config.withCredentials) {
|
851 | request.withCredentials = true;
|
852 | }
|
853 |
|
854 |
|
855 | if (config.responseType) {
|
856 | try {
|
857 | request.responseType = config.responseType;
|
858 | } catch (e) {
|
859 |
|
860 |
|
861 | if (config.responseType !== 'json') {
|
862 | throw e;
|
863 | }
|
864 | }
|
865 | }
|
866 |
|
867 |
|
868 | if (typeof config.onDownloadProgress === 'function') {
|
869 | request.addEventListener('progress', config.onDownloadProgress);
|
870 | }
|
871 |
|
872 |
|
873 | if (typeof config.onUploadProgress === 'function' && request.upload) {
|
874 | request.upload.addEventListener('progress', config.onUploadProgress);
|
875 | }
|
876 |
|
877 | if (config.cancelToken) {
|
878 |
|
879 | config.cancelToken.promise.then(function onCanceled(cancel) {
|
880 | if (!request) {
|
881 | return;
|
882 | }
|
883 |
|
884 | request.abort();
|
885 | reject(cancel);
|
886 |
|
887 | request = null;
|
888 | });
|
889 | }
|
890 |
|
891 | if (requestData === undefined) {
|
892 | requestData = null;
|
893 | }
|
894 |
|
895 |
|
896 | request.send(requestData);
|
897 | });
|
898 | };
|
899 |
|
900 |
|
901 | }),
|
902 |
|
903 | (function(module, exports, __webpack_require__) {
|
904 |
|
905 | "use strict";
|
906 |
|
907 |
|
908 | var enhanceError = __webpack_require__(40);
|
909 |
|
910 |
|
911 |
|
912 |
|
913 |
|
914 |
|
915 |
|
916 |
|
917 |
|
918 |
|
919 |
|
920 | module.exports = function createError(message, config, code, request, response) {
|
921 | var error = new Error(message);
|
922 | return enhanceError(error, config, code, request, response);
|
923 | };
|
924 |
|
925 |
|
926 | }),
|
927 |
|
928 | (function(module, exports, __webpack_require__) {
|
929 |
|
930 | "use strict";
|
931 |
|
932 |
|
933 | var utils = __webpack_require__(3);
|
934 |
|
935 |
|
936 |
|
937 |
|
938 |
|
939 |
|
940 |
|
941 |
|
942 |
|
943 | module.exports = function mergeConfig(config1, config2) {
|
944 |
|
945 | config2 = config2 || {};
|
946 | var config = {};
|
947 |
|
948 | utils.forEach(['url', 'method', 'params', 'data'], function valueFromConfig2(prop) {
|
949 | if (typeof config2[prop] !== 'undefined') {
|
950 | config[prop] = config2[prop];
|
951 | }
|
952 | });
|
953 |
|
954 | utils.forEach(['headers', 'auth', 'proxy'], function mergeDeepProperties(prop) {
|
955 | if (utils.isObject(config2[prop])) {
|
956 | config[prop] = utils.deepMerge(config1[prop], config2[prop]);
|
957 | } else if (typeof config2[prop] !== 'undefined') {
|
958 | config[prop] = config2[prop];
|
959 | } else if (utils.isObject(config1[prop])) {
|
960 | config[prop] = utils.deepMerge(config1[prop]);
|
961 | } else if (typeof config1[prop] !== 'undefined') {
|
962 | config[prop] = config1[prop];
|
963 | }
|
964 | });
|
965 |
|
966 | utils.forEach([
|
967 | 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',
|
968 | 'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
|
969 | 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'maxContentLength',
|
970 | 'validateStatus', 'maxRedirects', 'httpAgent', 'httpsAgent', 'cancelToken',
|
971 | 'socketPath'
|
972 | ], function defaultToConfig2(prop) {
|
973 | if (typeof config2[prop] !== 'undefined') {
|
974 | config[prop] = config2[prop];
|
975 | } else if (typeof config1[prop] !== 'undefined') {
|
976 | config[prop] = config1[prop];
|
977 | }
|
978 | });
|
979 |
|
980 | return config;
|
981 | };
|
982 |
|
983 |
|
984 | }),
|
985 |
|
986 | (function(module, exports, __webpack_require__) {
|
987 |
|
988 | "use strict";
|
989 |
|
990 |
|
991 |
|
992 |
|
993 |
|
994 |
|
995 |
|
996 |
|
997 | function Cancel(message) {
|
998 | this.message = message;
|
999 | }
|
1000 |
|
1001 | Cancel.prototype.toString = function toString() {
|
1002 | return 'Cancel' + (this.message ? ': ' + this.message : '');
|
1003 | };
|
1004 |
|
1005 | Cancel.prototype.__CANCEL__ = true;
|
1006 |
|
1007 | module.exports = Cancel;
|
1008 |
|
1009 |
|
1010 | }),
|
1011 |
|
1012 | (function(module, exports) {
|
1013 |
|
1014 | (function(__webpack_amd_options__) {
|
1015 | module.exports = __webpack_amd_options__;
|
1016 |
|
1017 | }.call(this, {}))
|
1018 |
|
1019 | }),
|
1020 |
|
1021 | (function(module, __webpack_exports__, __webpack_require__) {
|
1022 |
|
1023 | "use strict";
|
1024 | (function(module) {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; };
|
1025 |
|
1026 |
|
1027 | var _FastClick = null
|
1028 |
|
1029 | ;(function () {
|
1030 | 'use strict';
|
1031 |
|
1032 | |
1033 |
|
1034 |
|
1035 |
|
1036 |
|
1037 |
|
1038 |
|
1039 |
|
1040 |
|
1041 |
|
1042 |
|
1043 | |
1044 |
|
1045 |
|
1046 |
|
1047 |
|
1048 |
|
1049 |
|
1050 |
|
1051 |
|
1052 | _FastClick = function FastClick(layer, options) {
|
1053 | var oldOnClick;
|
1054 |
|
1055 | options = options || {};
|
1056 |
|
1057 | |
1058 |
|
1059 |
|
1060 |
|
1061 |
|
1062 | this.trackingClick = false;
|
1063 |
|
1064 | |
1065 |
|
1066 |
|
1067 |
|
1068 |
|
1069 | this.trackingClickStart = 0;
|
1070 |
|
1071 | |
1072 |
|
1073 |
|
1074 |
|
1075 |
|
1076 | this.targetElement = null;
|
1077 |
|
1078 | |
1079 |
|
1080 |
|
1081 |
|
1082 |
|
1083 | this.touchStartX = 0;
|
1084 |
|
1085 | |
1086 |
|
1087 |
|
1088 |
|
1089 |
|
1090 | this.touchStartY = 0;
|
1091 |
|
1092 | |
1093 |
|
1094 |
|
1095 |
|
1096 |
|
1097 | this.lastTouchIdentifier = 0;
|
1098 |
|
1099 | |
1100 |
|
1101 |
|
1102 |
|
1103 |
|
1104 | this.touchBoundary = options.touchBoundary || 10;
|
1105 |
|
1106 | |
1107 |
|
1108 |
|
1109 |
|
1110 |
|
1111 | this.layer = layer;
|
1112 |
|
1113 | |
1114 |
|
1115 |
|
1116 |
|
1117 |
|
1118 | this.tapDelay = options.tapDelay || 200;
|
1119 |
|
1120 | |
1121 |
|
1122 |
|
1123 |
|
1124 |
|
1125 | this.tapTimeout = options.tapTimeout || 700;
|
1126 |
|
1127 | if (_FastClick.notNeeded(layer)) {
|
1128 | return;
|
1129 | }
|
1130 |
|
1131 |
|
1132 | function bind(method, context) {
|
1133 | return function () {
|
1134 | return method.apply(context, arguments);
|
1135 | };
|
1136 | }
|
1137 |
|
1138 | var methods = ['onMouse', 'onClick', 'onTouchStart', 'onTouchMove', 'onTouchEnd', 'onTouchCancel'];
|
1139 | var context = this;
|
1140 | for (var i = 0, l = methods.length; i < l; i++) {
|
1141 | context[methods[i]] = bind(context[methods[i]], context);
|
1142 | }
|
1143 |
|
1144 |
|
1145 | if (deviceIsAndroid) {
|
1146 | layer.addEventListener('mouseover', this.onMouse, true);
|
1147 | layer.addEventListener('mousedown', this.onMouse, true);
|
1148 | layer.addEventListener('mouseup', this.onMouse, true);
|
1149 | }
|
1150 |
|
1151 | layer.addEventListener('click', this.onClick, true);
|
1152 | layer.addEventListener('touchstart', this.onTouchStart, false);
|
1153 | layer.addEventListener('touchmove', this.onTouchMove, false);
|
1154 | layer.addEventListener('touchend', this.onTouchEnd, false);
|
1155 | layer.addEventListener('touchcancel', this.onTouchCancel, false);
|
1156 |
|
1157 |
|
1158 |
|
1159 |
|
1160 | if (!Event.prototype.stopImmediatePropagation) {
|
1161 | layer.removeEventListener = function (type, callback, capture) {
|
1162 | var rmv = Node.prototype.removeEventListener;
|
1163 | if (type === 'click') {
|
1164 | rmv.call(layer, type, callback.hijacked || callback, capture);
|
1165 | } else {
|
1166 | rmv.call(layer, type, callback, capture);
|
1167 | }
|
1168 | };
|
1169 |
|
1170 | layer.addEventListener = function (type, callback, capture) {
|
1171 | var adv = Node.prototype.addEventListener;
|
1172 | if (type === 'click') {
|
1173 | adv.call(layer, type, callback.hijacked || (callback.hijacked = function (event) {
|
1174 | if (!event.propagationStopped) {
|
1175 | callback(event);
|
1176 | }
|
1177 | }), capture);
|
1178 | } else {
|
1179 | adv.call(layer, type, callback, capture);
|
1180 | }
|
1181 | };
|
1182 | }
|
1183 |
|
1184 |
|
1185 |
|
1186 |
|
1187 | if (typeof layer.onclick === 'function') {
|
1188 |
|
1189 |
|
1190 |
|
1191 | oldOnClick = layer.onclick;
|
1192 | layer.addEventListener('click', function (event) {
|
1193 | oldOnClick(event);
|
1194 | }, false);
|
1195 | layer.onclick = null;
|
1196 | }
|
1197 | };
|
1198 |
|
1199 | |
1200 |
|
1201 |
|
1202 |
|
1203 |
|
1204 | var deviceIsWindowsPhone = navigator.userAgent.indexOf("Windows Phone") >= 0;
|
1205 |
|
1206 | |
1207 |
|
1208 |
|
1209 |
|
1210 |
|
1211 | var deviceIsAndroid = navigator.userAgent.indexOf('Android') > 0 && !deviceIsWindowsPhone;
|
1212 |
|
1213 | |
1214 |
|
1215 |
|
1216 |
|
1217 |
|
1218 | var deviceIsIOS = /iP(ad|hone|od)/.test(navigator.userAgent) && !deviceIsWindowsPhone;
|
1219 |
|
1220 | |
1221 |
|
1222 |
|
1223 |
|
1224 |
|
1225 | var deviceIsIOS4 = deviceIsIOS && /OS 4_\d(_\d)?/.test(navigator.userAgent);
|
1226 |
|
1227 | |
1228 |
|
1229 |
|
1230 |
|
1231 |
|
1232 | var deviceIsIOSWithBadTarget = deviceIsIOS && /OS [6-7]_\d/.test(navigator.userAgent);
|
1233 |
|
1234 | |
1235 |
|
1236 |
|
1237 |
|
1238 |
|
1239 | var deviceIsBlackBerry10 = navigator.userAgent.indexOf('BB10') > 0;
|
1240 |
|
1241 | |
1242 |
|
1243 |
|
1244 |
|
1245 |
|
1246 |
|
1247 | _FastClick.prototype.needsClick = function (target) {
|
1248 | switch (target.nodeName.toLowerCase()) {
|
1249 |
|
1250 |
|
1251 | case 'button':
|
1252 | case 'select':
|
1253 | case 'textarea':
|
1254 | if (target.disabled) {
|
1255 | return true;
|
1256 | }
|
1257 |
|
1258 | break;
|
1259 | case 'input':
|
1260 |
|
1261 |
|
1262 | if (deviceIsIOS && target.type === 'file' || target.disabled) {
|
1263 | return true;
|
1264 | }
|
1265 |
|
1266 | break;
|
1267 | case 'label':
|
1268 | case 'iframe':
|
1269 | case 'video':
|
1270 | return true;
|
1271 | }
|
1272 |
|
1273 | return (/\bneedsclick\b/.test(target.className)
|
1274 | );
|
1275 | };
|
1276 |
|
1277 | |
1278 |
|
1279 |
|
1280 |
|
1281 |
|
1282 |
|
1283 | _FastClick.prototype.needsFocus = function (target) {
|
1284 | switch (target.nodeName.toLowerCase()) {
|
1285 | case 'textarea':
|
1286 | return true;
|
1287 | case 'select':
|
1288 | return !deviceIsAndroid;
|
1289 | case 'input':
|
1290 | switch (target.type) {
|
1291 | case 'button':
|
1292 | case 'checkbox':
|
1293 | case 'file':
|
1294 | case 'image':
|
1295 | case 'radio':
|
1296 | case 'submit':
|
1297 | return false;
|
1298 | }
|
1299 |
|
1300 |
|
1301 | return !target.disabled && !target.readOnly;
|
1302 | default:
|
1303 | return (/\bneedsfocus\b/.test(target.className)
|
1304 | );
|
1305 | }
|
1306 | };
|
1307 |
|
1308 | |
1309 |
|
1310 |
|
1311 |
|
1312 |
|
1313 |
|
1314 | _FastClick.prototype.sendClick = function (targetElement, event) {
|
1315 | var clickEvent, touch;
|
1316 |
|
1317 |
|
1318 | if (document.activeElement && document.activeElement !== targetElement) {
|
1319 | document.activeElement.blur();
|
1320 | }
|
1321 |
|
1322 | touch = event.changedTouches[0];
|
1323 |
|
1324 |
|
1325 | clickEvent = document.createEvent('MouseEvents');
|
1326 | clickEvent.initMouseEvent(this.determineEventType(targetElement), true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null);
|
1327 | clickEvent.forwardedTouchEvent = true;
|
1328 | targetElement.dispatchEvent(clickEvent);
|
1329 | };
|
1330 |
|
1331 | _FastClick.prototype.determineEventType = function (targetElement) {
|
1332 |
|
1333 |
|
1334 | if (deviceIsAndroid && targetElement.tagName.toLowerCase() === 'select') {
|
1335 | return 'mousedown';
|
1336 | }
|
1337 |
|
1338 | return 'click';
|
1339 | };
|
1340 |
|
1341 | |
1342 |
|
1343 |
|
1344 | _FastClick.prototype.focus = function (targetElement) {
|
1345 | var length;
|
1346 |
|
1347 |
|
1348 | if (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time' && targetElement.type !== 'month' && targetElement.type !== 'email') {
|
1349 | length = targetElement.value.length;
|
1350 |
|
1351 |
|
1352 | if (deviceIsIOS) {
|
1353 | try {
|
1354 | length = targetElement.value.length;
|
1355 | targetElement.setSelectionRange(length, length);
|
1356 | } catch (error) {
|
1357 | console.log(error);
|
1358 | }
|
1359 |
|
1360 | targetElement.focus();
|
1361 | }
|
1362 | } else {
|
1363 | targetElement.focus();
|
1364 | }
|
1365 | };
|
1366 |
|
1367 | |
1368 |
|
1369 |
|
1370 |
|
1371 |
|
1372 | _FastClick.prototype.updateScrollParent = function (targetElement) {
|
1373 | var scrollParent, parentElement;
|
1374 |
|
1375 | scrollParent = targetElement.fastClickScrollParent;
|
1376 |
|
1377 |
|
1378 |
|
1379 | if (!scrollParent || !scrollParent.contains(targetElement)) {
|
1380 | parentElement = targetElement;
|
1381 | do {
|
1382 | if (parentElement.scrollHeight > parentElement.offsetHeight) {
|
1383 | scrollParent = parentElement;
|
1384 | targetElement.fastClickScrollParent = parentElement;
|
1385 | break;
|
1386 | }
|
1387 |
|
1388 | parentElement = parentElement.parentElement;
|
1389 | } while (parentElement);
|
1390 | }
|
1391 |
|
1392 |
|
1393 | if (scrollParent) {
|
1394 | scrollParent.fastClickLastScrollTop = scrollParent.scrollTop;
|
1395 | }
|
1396 | };
|
1397 |
|
1398 | |
1399 |
|
1400 |
|
1401 |
|
1402 | _FastClick.prototype.getTargetElementFromEventTarget = function (eventTarget) {
|
1403 |
|
1404 |
|
1405 | if (eventTarget.nodeType === Node.TEXT_NODE) {
|
1406 | return eventTarget.parentNode;
|
1407 | }
|
1408 |
|
1409 | return eventTarget;
|
1410 | };
|
1411 |
|
1412 | |
1413 |
|
1414 |
|
1415 |
|
1416 |
|
1417 |
|
1418 | _FastClick.prototype.onTouchStart = function (event) {
|
1419 | var targetElement, touch, selection;
|
1420 |
|
1421 |
|
1422 | if (event.targetTouches.length > 1) {
|
1423 | return true;
|
1424 | }
|
1425 |
|
1426 | targetElement = this.getTargetElementFromEventTarget(event.target);
|
1427 | touch = event.targetTouches[0];
|
1428 |
|
1429 | if (deviceIsIOS) {
|
1430 |
|
1431 |
|
1432 | selection = window.getSelection();
|
1433 | if (selection.rangeCount && !selection.isCollapsed) {
|
1434 | return true;
|
1435 | }
|
1436 |
|
1437 | if (!deviceIsIOS4) {
|
1438 |
|
1439 |
|
1440 |
|
1441 |
|
1442 |
|
1443 |
|
1444 |
|
1445 |
|
1446 |
|
1447 | if (touch.identifier && touch.identifier === this.lastTouchIdentifier) {
|
1448 | event.preventDefault();
|
1449 | return false;
|
1450 | }
|
1451 |
|
1452 | this.lastTouchIdentifier = touch.identifier;
|
1453 |
|
1454 |
|
1455 |
|
1456 |
|
1457 |
|
1458 |
|
1459 |
|
1460 | this.updateScrollParent(targetElement);
|
1461 | }
|
1462 | }
|
1463 |
|
1464 | this.trackingClick = true;
|
1465 | this.trackingClickStart = event.timeStamp;
|
1466 | this.targetElement = targetElement;
|
1467 |
|
1468 | this.touchStartX = touch.pageX;
|
1469 | this.touchStartY = touch.pageY;
|
1470 |
|
1471 |
|
1472 | if (event.timeStamp - this.lastClickTime < this.tapDelay) {
|
1473 | event.preventDefault();
|
1474 | }
|
1475 |
|
1476 | return true;
|
1477 | };
|
1478 |
|
1479 | |
1480 |
|
1481 |
|
1482 |
|
1483 |
|
1484 |
|
1485 | _FastClick.prototype.touchHasMoved = function (event) {
|
1486 | var touch = event.changedTouches[0],
|
1487 | boundary = this.touchBoundary;
|
1488 |
|
1489 | if (Math.abs(touch.pageX - this.touchStartX) > boundary || Math.abs(touch.pageY - this.touchStartY) > boundary) {
|
1490 | return true;
|
1491 | }
|
1492 |
|
1493 | return false;
|
1494 | };
|
1495 |
|
1496 | |
1497 |
|
1498 |
|
1499 |
|
1500 |
|
1501 |
|
1502 | _FastClick.prototype.onTouchMove = function (event) {
|
1503 | if (!this.trackingClick) {
|
1504 | return true;
|
1505 | }
|
1506 |
|
1507 |
|
1508 | if (this.targetElement !== this.getTargetElementFromEventTarget(event.target) || this.touchHasMoved(event)) {
|
1509 | this.trackingClick = false;
|
1510 | this.targetElement = null;
|
1511 | }
|
1512 |
|
1513 | return true;
|
1514 | };
|
1515 |
|
1516 | |
1517 |
|
1518 |
|
1519 |
|
1520 |
|
1521 |
|
1522 | _FastClick.prototype.findControl = function (labelElement) {
|
1523 |
|
1524 |
|
1525 | if (labelElement.control !== undefined) {
|
1526 | return labelElement.control;
|
1527 | }
|
1528 |
|
1529 |
|
1530 | if (labelElement.htmlFor) {
|
1531 | return document.getElementById(labelElement.htmlFor);
|
1532 | }
|
1533 |
|
1534 |
|
1535 |
|
1536 | return labelElement.querySelector('button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea');
|
1537 | };
|
1538 |
|
1539 | |
1540 |
|
1541 |
|
1542 |
|
1543 |
|
1544 |
|
1545 | _FastClick.prototype.onTouchEnd = function (event) {
|
1546 | var forElement,
|
1547 | trackingClickStart,
|
1548 | targetTagName,
|
1549 | scrollParent,
|
1550 | touch,
|
1551 | targetElement = this.targetElement;
|
1552 |
|
1553 | if (!this.trackingClick) {
|
1554 | return true;
|
1555 | }
|
1556 |
|
1557 |
|
1558 | if (event.timeStamp - this.lastClickTime < this.tapDelay) {
|
1559 | this.cancelNextClick = true;
|
1560 | return true;
|
1561 | }
|
1562 |
|
1563 | if (event.timeStamp - this.trackingClickStart > this.tapTimeout) {
|
1564 | return true;
|
1565 | }
|
1566 |
|
1567 |
|
1568 | this.cancelNextClick = false;
|
1569 |
|
1570 | this.lastClickTime = event.timeStamp;
|
1571 |
|
1572 | trackingClickStart = this.trackingClickStart;
|
1573 | this.trackingClick = false;
|
1574 | this.trackingClickStart = 0;
|
1575 |
|
1576 |
|
1577 |
|
1578 |
|
1579 |
|
1580 | if (deviceIsIOSWithBadTarget) {
|
1581 | touch = event.changedTouches[0];
|
1582 |
|
1583 |
|
1584 | targetElement = document.elementFromPoint(touch.pageX - window.pageXOffset, touch.pageY - window.pageYOffset) || targetElement;
|
1585 | targetElement.fastClickScrollParent = this.targetElement.fastClickScrollParent;
|
1586 | }
|
1587 |
|
1588 | targetTagName = targetElement.tagName.toLowerCase();
|
1589 | if (targetTagName === 'label') {
|
1590 | forElement = this.findControl(targetElement);
|
1591 | if (forElement) {
|
1592 | this.focus(targetElement);
|
1593 | if (deviceIsAndroid) {
|
1594 | return false;
|
1595 | }
|
1596 |
|
1597 | targetElement = forElement;
|
1598 | }
|
1599 | } else if (this.needsFocus(targetElement)) {
|
1600 |
|
1601 |
|
1602 |
|
1603 | if (event.timeStamp - trackingClickStart > 100 || deviceIsIOS && window.top !== window && targetTagName === 'input') {
|
1604 | this.targetElement = null;
|
1605 | return false;
|
1606 | }
|
1607 |
|
1608 | this.focus(targetElement);
|
1609 | this.sendClick(targetElement, event);
|
1610 |
|
1611 |
|
1612 |
|
1613 | if (!deviceIsIOS || targetTagName !== 'select') {
|
1614 | this.targetElement = null;
|
1615 | event.preventDefault();
|
1616 | }
|
1617 |
|
1618 | return false;
|
1619 | }
|
1620 |
|
1621 | if (deviceIsIOS && !deviceIsIOS4) {
|
1622 |
|
1623 |
|
1624 |
|
1625 | scrollParent = targetElement.fastClickScrollParent;
|
1626 | if (scrollParent && scrollParent.fastClickLastScrollTop !== scrollParent.scrollTop) {
|
1627 | return true;
|
1628 | }
|
1629 | }
|
1630 |
|
1631 |
|
1632 |
|
1633 | if (!this.needsClick(targetElement)) {
|
1634 | event.preventDefault();
|
1635 | this.sendClick(targetElement, event);
|
1636 | }
|
1637 |
|
1638 | return false;
|
1639 | };
|
1640 |
|
1641 | |
1642 |
|
1643 |
|
1644 |
|
1645 |
|
1646 | _FastClick.prototype.onTouchCancel = function () {
|
1647 | this.trackingClick = false;
|
1648 | this.targetElement = null;
|
1649 | };
|
1650 |
|
1651 | |
1652 |
|
1653 |
|
1654 |
|
1655 |
|
1656 |
|
1657 | _FastClick.prototype.onMouse = function (event) {
|
1658 |
|
1659 |
|
1660 | if (!this.targetElement) {
|
1661 | return true;
|
1662 | }
|
1663 |
|
1664 | if (event.forwardedTouchEvent) {
|
1665 | return true;
|
1666 | }
|
1667 |
|
1668 |
|
1669 | if (!event.cancelable) {
|
1670 | return true;
|
1671 | }
|
1672 |
|
1673 |
|
1674 |
|
1675 |
|
1676 | if (!this.needsClick(this.targetElement) || this.cancelNextClick) {
|
1677 |
|
1678 |
|
1679 | if (event.stopImmediatePropagation) {
|
1680 | event.stopImmediatePropagation();
|
1681 | } else {
|
1682 |
|
1683 |
|
1684 | event.propagationStopped = true;
|
1685 | }
|
1686 |
|
1687 |
|
1688 | event.stopPropagation();
|
1689 | event.preventDefault();
|
1690 |
|
1691 | return false;
|
1692 | }
|
1693 |
|
1694 |
|
1695 | return true;
|
1696 | };
|
1697 |
|
1698 | |
1699 |
|
1700 |
|
1701 |
|
1702 |
|
1703 |
|
1704 |
|
1705 |
|
1706 | _FastClick.prototype.onClick = function (event) {
|
1707 | var permitted;
|
1708 |
|
1709 |
|
1710 | if (this.trackingClick) {
|
1711 | this.targetElement = null;
|
1712 | this.trackingClick = false;
|
1713 | return true;
|
1714 | }
|
1715 |
|
1716 |
|
1717 | if (event.target.type === 'submit' && event.detail === 0) {
|
1718 | return true;
|
1719 | }
|
1720 |
|
1721 | permitted = this.onMouse(event);
|
1722 |
|
1723 |
|
1724 | if (!permitted) {
|
1725 | this.targetElement = null;
|
1726 | }
|
1727 |
|
1728 |
|
1729 | return permitted;
|
1730 | };
|
1731 |
|
1732 | |
1733 |
|
1734 |
|
1735 |
|
1736 |
|
1737 | _FastClick.prototype.destroy = function () {
|
1738 | var layer = this.layer;
|
1739 |
|
1740 | if (deviceIsAndroid) {
|
1741 | layer.removeEventListener('mouseover', this.onMouse, true);
|
1742 | layer.removeEventListener('mousedown', this.onMouse, true);
|
1743 | layer.removeEventListener('mouseup', this.onMouse, true);
|
1744 | }
|
1745 |
|
1746 | layer.removeEventListener('click', this.onClick, true);
|
1747 | layer.removeEventListener('touchstart', this.onTouchStart, false);
|
1748 | layer.removeEventListener('touchmove', this.onTouchMove, false);
|
1749 | layer.removeEventListener('touchend', this.onTouchEnd, false);
|
1750 | layer.removeEventListener('touchcancel', this.onTouchCancel, false);
|
1751 | };
|
1752 |
|
1753 | |
1754 |
|
1755 |
|
1756 |
|
1757 |
|
1758 | _FastClick.notNeeded = function (layer) {
|
1759 | var metaViewport;
|
1760 | var chromeVersion;
|
1761 | var blackberryVersion;
|
1762 | var firefoxVersion;
|
1763 |
|
1764 |
|
1765 | if (typeof window.ontouchstart === 'undefined') {
|
1766 | return true;
|
1767 | }
|
1768 |
|
1769 |
|
1770 | chromeVersion = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [, 0])[1];
|
1771 |
|
1772 | if (chromeVersion) {
|
1773 |
|
1774 | if (deviceIsAndroid) {
|
1775 | metaViewport = document.querySelector('meta[name=viewport]');
|
1776 |
|
1777 | if (metaViewport) {
|
1778 |
|
1779 | if (metaViewport.content.indexOf('user-scalable=no') !== -1) {
|
1780 | return true;
|
1781 | }
|
1782 |
|
1783 | if (chromeVersion > 31 && document.documentElement.scrollWidth <= window.outerWidth) {
|
1784 | return true;
|
1785 | }
|
1786 | }
|
1787 |
|
1788 |
|
1789 | } else {
|
1790 | return true;
|
1791 | }
|
1792 | }
|
1793 |
|
1794 | if (deviceIsBlackBerry10) {
|
1795 | blackberryVersion = navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/);
|
1796 |
|
1797 |
|
1798 |
|
1799 | if (blackberryVersion[1] >= 10 && blackberryVersion[2] >= 3) {
|
1800 | metaViewport = document.querySelector('meta[name=viewport]');
|
1801 |
|
1802 | if (metaViewport) {
|
1803 |
|
1804 | if (metaViewport.content.indexOf('user-scalable=no') !== -1) {
|
1805 | return true;
|
1806 | }
|
1807 |
|
1808 | if (document.documentElement.scrollWidth <= window.outerWidth) {
|
1809 | return true;
|
1810 | }
|
1811 | }
|
1812 | }
|
1813 | }
|
1814 |
|
1815 |
|
1816 | if (layer.style.msTouchAction === 'none' || layer.style.touchAction === 'manipulation') {
|
1817 | return true;
|
1818 | }
|
1819 |
|
1820 |
|
1821 | firefoxVersion = +(/Firefox\/([0-9]+)/.exec(navigator.userAgent) || [, 0])[1];
|
1822 |
|
1823 | if (firefoxVersion >= 27) {
|
1824 |
|
1825 |
|
1826 | metaViewport = document.querySelector('meta[name=viewport]');
|
1827 | if (metaViewport && (metaViewport.content.indexOf('user-scalable=no') !== -1 || document.documentElement.scrollWidth <= window.outerWidth)) {
|
1828 | return true;
|
1829 | }
|
1830 | }
|
1831 |
|
1832 |
|
1833 |
|
1834 | if (layer.style.touchAction === 'none' || layer.style.touchAction === 'manipulation') {
|
1835 | return true;
|
1836 | }
|
1837 |
|
1838 | return false;
|
1839 | };
|
1840 |
|
1841 | |
1842 |
|
1843 |
|
1844 |
|
1845 |
|
1846 |
|
1847 | _FastClick.attach = function (layer, options) {
|
1848 | return new _FastClick(layer, options);
|
1849 | };
|
1850 |
|
1851 | if (typeof define === 'function' && _typeof(__webpack_require__(13)) === 'object' && __webpack_require__(13)) {
|
1852 |
|
1853 |
|
1854 | define(function () {
|
1855 | return _FastClick;
|
1856 | });
|
1857 | } else if (typeof module !== 'undefined' && module.exports) {
|
1858 | module.exports = _FastClick.attach;
|
1859 | module.exports.FastClick = _FastClick;
|
1860 | } else {
|
1861 | window.FastClick = _FastClick;
|
1862 | }
|
1863 | })();
|
1864 |
|
1865 |
|
1866 |
|
1867 | __webpack_exports__["a"] = (_FastClick);
|
1868 | }.call(this, __webpack_require__(48)(module)))
|
1869 |
|
1870 | }),
|
1871 |
|
1872 | (function(module, exports, __webpack_require__) {
|
1873 |
|
1874 | module.exports = __webpack_require__(49);
|
1875 |
|
1876 |
|
1877 | }),
|
1878 |
|
1879 | (function(module, exports, __webpack_require__) {
|
1880 |
|
1881 |
|
1882 |
|
1883 | }),
|
1884 | ,
|
1885 |
|
1886 | (function(module, exports) {
|
1887 |
|
1888 | 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; };
|
1889 |
|
1890 |
|
1891 | if (!window.Array.prototype.includes) {
|
1892 | window.Array.prototype.includes = function (searchElement) {
|
1893 | return this.some(function (el) {
|
1894 | return el === searchElement;
|
1895 | });
|
1896 | };
|
1897 | }
|
1898 |
|
1899 |
|
1900 | window.Array.prototype.powerset = function () {
|
1901 | var ps = [[]];
|
1902 | for (var i = 0; i < this.length; i++) {
|
1903 | for (var j = 0, len = ps.length; j < len; j++) {
|
1904 | ps.push(ps[j].concat(this[i]));
|
1905 | }
|
1906 | }
|
1907 | return ps;
|
1908 | };
|
1909 |
|
1910 |
|
1911 | window.Array.prototype.toOneColumn = function () {
|
1912 | var reg = /[\d\.]+\,([\d\.]+)/g;
|
1913 | return this.join(',').replace(reg, '$1').split(',');
|
1914 | };
|
1915 |
|
1916 |
|
1917 | window.Array.prototype.contains = function (arg) {
|
1918 | if (toString.call(arg) !== '[object Array]') {
|
1919 | return this.indexOf(arg) > -1;
|
1920 | }
|
1921 | return this.filter(function (elem) {
|
1922 | return arg.indexOf(elem) > -1;
|
1923 | }).length === arg.length;
|
1924 | };
|
1925 |
|
1926 |
|
1927 | if (window.Array.prototype.equals) {
|
1928 | console.warn('覆盖现有的window.Array.prototype.equals。 可能的原因:新的API定义了方法,存在框架冲突,或者在代码中包含了双重包含。');
|
1929 | }
|
1930 | window.Array.prototype.equals = function (array) {
|
1931 | if (!array) return false;
|
1932 |
|
1933 |
|
1934 | if (this.length !== array.length) return false;
|
1935 |
|
1936 | for (var i = 0; i < this.length; i++) {
|
1937 |
|
1938 | if (this[i] instanceof Array && array[i] instanceof Array) {
|
1939 |
|
1940 | if (!this[i].equals(array[i])) return false;
|
1941 | }
|
1942 |
|
1943 | else if (this[i] instanceof Object && array[i] instanceof Object) {
|
1944 | for (var n in this[i]) {
|
1945 | if (this[i][n] !== array[i][n]) return false;
|
1946 | }
|
1947 | } else if (this[i] !== array[i]) {
|
1948 |
|
1949 | return false;
|
1950 | }
|
1951 | }
|
1952 | return true;
|
1953 | };
|
1954 |
|
1955 | Object.defineProperty(window.Array.prototype, "equals", { enumerable: false });
|
1956 |
|
1957 |
|
1958 | window.Array.prototype.isRepeatArray = function () {
|
1959 | var arrStr = this.join(',') + ',';
|
1960 | for (var _iterator = this, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
|
1961 | var _ref;
|
1962 |
|
1963 | if (_isArray) {
|
1964 | if (_i >= _iterator.length) break;
|
1965 | _ref = _iterator[_i++];
|
1966 | } else {
|
1967 | _i = _iterator.next();
|
1968 | if (_i.done) break;
|
1969 | _ref = _i.value;
|
1970 | }
|
1971 |
|
1972 | var item = _ref;
|
1973 |
|
1974 | if (arrStr.replace(item + ',', '').indexOf(item + ',') >= 0) return true;
|
1975 | }
|
1976 | return false;
|
1977 | };
|
1978 |
|
1979 | window.Array.prototype.removeProperties = function (properties) {
|
1980 | for (var _iterator2 = this, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
|
1981 | var _ref2;
|
1982 |
|
1983 | if (_isArray2) {
|
1984 | if (_i2 >= _iterator2.length) break;
|
1985 | _ref2 = _iterator2[_i2++];
|
1986 | } else {
|
1987 | _i2 = _iterator2.next();
|
1988 | if (_i2.done) break;
|
1989 | _ref2 = _i2.value;
|
1990 | }
|
1991 |
|
1992 | var item = _ref2;
|
1993 |
|
1994 | for (var n in item) {
|
1995 | for (var _iterator3 = properties, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
|
1996 | var _ref3;
|
1997 |
|
1998 | if (_isArray3) {
|
1999 | if (_i3 >= _iterator3.length) break;
|
2000 | _ref3 = _iterator3[_i3++];
|
2001 | } else {
|
2002 | _i3 = _iterator3.next();
|
2003 | if (_i3.done) break;
|
2004 | _ref3 = _i3.value;
|
2005 | }
|
2006 |
|
2007 | var property = _ref3;
|
2008 |
|
2009 | if (n === property) delete item[n];
|
2010 | }
|
2011 | }
|
2012 | }
|
2013 | return this;
|
2014 | };
|
2015 |
|
2016 | window.Array.prototype.toStringOption = function () {
|
2017 | return this.map(function (item) {
|
2018 | if ((typeof item === 'undefined' ? 'undefined' : _typeof(item)) === 'object' || typeof item === 'function') return JSON.stringify(item);
|
2019 | return item;
|
2020 | });
|
2021 | };
|
2022 |
|
2023 |
|
2024 |
|
2025 |
|
2026 |
|
2027 |
|
2028 | window.Array.prototype.flattenTree = function () {
|
2029 | var list = this;
|
2030 | if (!Array.isArray(list) || !list.length) return list;
|
2031 | return _buildTreeToFlatten(list);
|
2032 | };
|
2033 | function _buildTreeToFlatten(list) {
|
2034 |
|
2035 | var tree = [];
|
2036 | var temp = [];
|
2037 |
|
2038 | for (var i = 0; i < list.length; i++) {
|
2039 | temp.push(list[i]);
|
2040 | }
|
2041 | while (temp.length) {
|
2042 |
|
2043 | var item = temp.shift();
|
2044 |
|
2045 | if (item.children && item.children.length) {
|
2046 |
|
2047 | for (var c = 0; c < item.children.length; c++) {
|
2048 | item.children[c].parentid = item.id;
|
2049 | }
|
2050 | temp = item.children.concat(temp);
|
2051 | }
|
2052 |
|
2053 | delete item.children;
|
2054 |
|
2055 | tree.push(item);
|
2056 | }
|
2057 | return tree;
|
2058 | }
|
2059 |
|
2060 |
|
2061 | window.Array.prototype.getFlattenTreeRoots = function () {
|
2062 | var list = this;
|
2063 | var roots = [];
|
2064 | var objList = {};
|
2065 |
|
2066 | list.forEach(function (item) {
|
2067 | objList[item.id] = item;
|
2068 | });
|
2069 |
|
2070 | list.forEach(function (item) {
|
2071 | if (!objList[item.parentid]) roots.push(item);
|
2072 | });
|
2073 | return roots;
|
2074 | };
|
2075 |
|
2076 |
|
2077 | window.Array.prototype.getFlattenTreeChildren = function (id) {
|
2078 | var list = this;
|
2079 | var children = [];
|
2080 | for (var i = 0, child; child = list[i++];) {
|
2081 |
|
2082 | if (id && child.parentid === id.toString()) {
|
2083 | children.push(child);
|
2084 | }
|
2085 | }
|
2086 | return children;
|
2087 | };
|
2088 |
|
2089 |
|
2090 | window.Array.prototype.getFlattenTreeDescendants = function (id) {
|
2091 | var list = this;
|
2092 | var descendants = [];
|
2093 | function buildChildren(list, id) {
|
2094 | for (var i = 0, item; item = list[i++];) {
|
2095 |
|
2096 | if (id && item.parentid === id.toString()) {
|
2097 | descendants.push(item);
|
2098 | buildChildren(list, item.id);
|
2099 | }
|
2100 | }
|
2101 | }
|
2102 | buildChildren(list, id);
|
2103 | return descendants;
|
2104 | };
|
2105 |
|
2106 |
|
2107 | window.Array.prototype.getFlattenTreeNode = function (id) {
|
2108 | var list = this;
|
2109 | var item = list.filter(function (option) {
|
2110 | if (option.id === id) return true;
|
2111 | return false;
|
2112 | });
|
2113 | if (item && item.length > 0) {
|
2114 | item = item[0];
|
2115 | }
|
2116 | return item;
|
2117 | };
|
2118 |
|
2119 |
|
2120 |
|
2121 |
|
2122 |
|
2123 |
|
2124 | window.Array.prototype.deepTree = function () {
|
2125 | var list = this;
|
2126 | if (!Array.isArray(list) || !list.length) return list;
|
2127 | if (!list[0].hasOwnProperty('parentid')) return list;
|
2128 |
|
2129 |
|
2130 | function _buildTreeToDeep(item) {
|
2131 | var children = list.getFlattenTreeChildren(item.id);
|
2132 | if (children && children.length) {
|
2133 | if (item.children) {
|
2134 | item.children.push(children);
|
2135 | } else {
|
2136 | item.children = children;
|
2137 | }
|
2138 | for (var i = 0, child; child = children[i++];) {
|
2139 |
|
2140 | _buildTreeToDeep(child);
|
2141 | }
|
2142 | }
|
2143 | }
|
2144 | var trees = list.getFlattenTreeRoots();
|
2145 | for (var i = 0, tree; tree = trees[i++];) {
|
2146 |
|
2147 | _buildTreeToDeep(tree);
|
2148 | }
|
2149 | return trees;
|
2150 | };
|
2151 |
|
2152 |
|
2153 | window.Array.prototype.getDeepTreeNode = function (id) {
|
2154 | var list = Object.clone(this);
|
2155 | var temp = [];
|
2156 |
|
2157 | for (var i = 0; i < list.length; i++) {
|
2158 | temp.push(list[i]);
|
2159 | }
|
2160 | while (temp.length) {
|
2161 |
|
2162 | var item = temp.shift();
|
2163 | if (item.id === id) return item;
|
2164 |
|
2165 | if (item.children && item.children.length) {
|
2166 |
|
2167 | for (var c = 0; c < item.children.length; c++) {
|
2168 | item.children[c].parentid = item.id;
|
2169 | }
|
2170 | temp = item.children.concat(temp);
|
2171 | }
|
2172 |
|
2173 | delete item.children;
|
2174 | }
|
2175 | return {};
|
2176 | };
|
2177 |
|
2178 | }),
|
2179 |
|
2180 | (function(module, exports) {
|
2181 |
|
2182 | if (!window._seeds_lang) window._seeds_lang = {};
|
2183 |
|
2184 |
|
2185 |
|
2186 | Math.Calc = function () {
|
2187 | |
2188 |
|
2189 |
|
2190 |
|
2191 |
|
2192 | function toInteger(argNum, argDigits, round) {
|
2193 | var result = { times: 1, num: 0 };
|
2194 | var argNumStr = argNum + '';
|
2195 | if (argNumStr.indexOf('.') === -1) {
|
2196 | result.num = argNum;
|
2197 | return result;
|
2198 | }
|
2199 | var digits = isNaN(argDigits) ? argNumStr.substr(argNumStr.indexOf('.') + 1).length : argDigits;
|
2200 | var times = Math.pow(10, digits);
|
2201 | var num = parseInt(Math.abs(argNum) * times + (round === false ? 0 : 0.5), 10);
|
2202 | var isNegative = argNum < 0;
|
2203 | result.times = times;
|
2204 | result.num = isNegative ? -num : num;
|
2205 | return result;
|
2206 | }
|
2207 |
|
2208 | |
2209 |
|
2210 |
|
2211 |
|
2212 |
|
2213 |
|
2214 |
|
2215 |
|
2216 | function operation(a, b, digits, op) {
|
2217 | var o1 = toInteger(a);
|
2218 | var o2 = toInteger(b);
|
2219 | var n1 = o1.num;
|
2220 | var n2 = o2.num;
|
2221 | var t1 = o1.times;
|
2222 | var t2 = o2.times;
|
2223 | var max = t1 > t2 ? t1 : t2;
|
2224 | var result = null;
|
2225 | switch (op) {
|
2226 | case 'add':
|
2227 | if (t1 === t2) {
|
2228 |
|
2229 | result = Number(n1) + Number(n2);
|
2230 | } else if (t1 > t2) {
|
2231 |
|
2232 | result = Number(n1) + Number(n2 * (t1 / t2));
|
2233 | } else {
|
2234 |
|
2235 | result = Number(n1 * (t2 / t1)) + Number(n2);
|
2236 | }
|
2237 | result = result / max;
|
2238 | break;
|
2239 | case 'subtract':
|
2240 | if (t1 === t2) {
|
2241 | result = n1 - n2;
|
2242 | } else if (t1 > t2) {
|
2243 | result = n1 - n2 * (t1 / t2);
|
2244 | } else {
|
2245 | result = n1 * (t2 / t1) - n2;
|
2246 | }
|
2247 | result = result / max;
|
2248 | break;
|
2249 | case 'multiply':
|
2250 | result = n1 * n2 / (t1 * t2);
|
2251 | break;
|
2252 | case 'divide':
|
2253 | result = n1 / n2 * (t2 / t1);
|
2254 | break;
|
2255 | default:
|
2256 | result = 0;
|
2257 | }
|
2258 | if (digits && !isNaN(digits)) {
|
2259 |
|
2260 | return result.toFixed(digits);
|
2261 | }
|
2262 | return result;
|
2263 | }
|
2264 |
|
2265 |
|
2266 | function add(a, b, digits) {
|
2267 | return operation(a, b, digits, 'add');
|
2268 | }
|
2269 | function subtract(a, b, digits) {
|
2270 | return operation(a, b, digits, 'subtract');
|
2271 | }
|
2272 | function multiply(a, b, digits) {
|
2273 | return operation(a, b, digits, 'multiply');
|
2274 | }
|
2275 | function divide(a, b, digits) {
|
2276 | return operation(a, b, digits, 'divide');
|
2277 | }
|
2278 |
|
2279 | function toFixed(argNum, argDigits, fixed, round) {
|
2280 | var result = toInteger(argNum, argDigits, round);
|
2281 | if (fixed) return (result.num / result.times).toFixed(argDigits);
|
2282 | return result.num / result.times;
|
2283 | }
|
2284 |
|
2285 | function toThousandth(num) {
|
2286 | if (!num) return '0';
|
2287 | var sExpr = /^(\d+)((\.\d+)?)$/;
|
2288 | var n1 = num.toString().replace(sExpr, function (s, s1, s2) {
|
2289 | var reExpr = /\d{1,3}(?=(\d{3})+$)/g;
|
2290 | return s1.replace(reExpr, '$&,') + s2;
|
2291 | });
|
2292 | return n1;
|
2293 | }
|
2294 |
|
2295 | function correctNumber(argNumstr, options) {
|
2296 | var max = options.max,
|
2297 | min = options.min,
|
2298 | digits = options.digits,
|
2299 | maxLength = options.maxLength,
|
2300 | required = options.required,
|
2301 | onError = options.onError;
|
2302 |
|
2303 | if (argNumstr === '' || isNaN(argNumstr) || min - max >= 0) {
|
2304 |
|
2305 | if (required) return min ? '' + min : '0';
|
2306 | return '';
|
2307 | }
|
2308 | var value = String(argNumstr || '');
|
2309 |
|
2310 | if (!isNaN(max) && value - max > 0) {
|
2311 |
|
2312 | if (onError) onError({ errMsg: window._seeds_lang['hint_cannot_be_greater_than'] || '不能大于' + max });
|
2313 | return '' + max;
|
2314 | }
|
2315 |
|
2316 | if (!isNaN(min) && value - min < 0) {
|
2317 |
|
2318 | if (onError) onError({ errMsg: window._seeds_lang['hint_cannot_be_less_than'] || '不能小于' + min });
|
2319 | return '' + min;
|
2320 | }
|
2321 |
|
2322 | if (!isNaN(digits)) {
|
2323 | console.log(digits);
|
2324 | if (value.indexOf('.') !== -1 && digits - 0 >= 0 && digits.toString().indexOf('.') === -1) {
|
2325 | if (digits - 0 === 0) {
|
2326 |
|
2327 | value = value.substring(0, value.indexOf('.'));
|
2328 | } else {
|
2329 |
|
2330 | value = value.substring(0, value.indexOf('.') + Number(digits) + 1);
|
2331 | }
|
2332 | }
|
2333 | }
|
2334 |
|
2335 | if (maxLength && value && value.length > maxLength) {
|
2336 | value = value.substring(0, maxLength);
|
2337 | }
|
2338 |
|
2339 | if (value.indexOf('.') === -1) {
|
2340 | return '' + Number(value);
|
2341 | }
|
2342 | return '' + value;
|
2343 | }
|
2344 |
|
2345 | function correctPhone(argPhone, options) {
|
2346 | var onError = options.onError;
|
2347 |
|
2348 | var value = argPhone;
|
2349 |
|
2350 | if (isNaN(value)) {
|
2351 | var result = value.match(/[0-9]{1,}/);
|
2352 | if (result) value = result[0];else value = '';
|
2353 |
|
2354 | if (onError) onError({ errMsg: window._seeds_lang['hint_must_number'] || '必须要输入数字哦' });
|
2355 | }
|
2356 | return value;
|
2357 | }
|
2358 |
|
2359 | return {
|
2360 | add: add,
|
2361 | subtract: subtract,
|
2362 | multiply: multiply,
|
2363 | divide: divide,
|
2364 | toFixed: toFixed,
|
2365 | toThousandth: toThousandth,
|
2366 | correctNumber: correctNumber,
|
2367 | correctPhone: correctPhone
|
2368 | };
|
2369 | }();
|
2370 |
|
2371 | }),
|
2372 |
|
2373 | (function(module, exports) {
|
2374 |
|
2375 | 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; };
|
2376 |
|
2377 |
|
2378 |
|
2379 |
|
2380 | Object.isEmptyObject = function (obj) {
|
2381 | if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object') return false;
|
2382 | for (var n in obj) {
|
2383 | if (obj.hasOwnProperty(n)) {
|
2384 | return false;
|
2385 | }
|
2386 | }
|
2387 | return true;
|
2388 | };
|
2389 |
|
2390 |
|
2391 |
|
2392 | Object.isPlainObject = function (obj) {
|
2393 | var proto;
|
2394 | var Ctor;
|
2395 | if (!obj || toString.call(obj) !== '[object Object]') {
|
2396 | return false;
|
2397 | }
|
2398 |
|
2399 | proto = Object.getPrototypeOf(obj);
|
2400 |
|
2401 |
|
2402 | if (!proto) {
|
2403 | return true;
|
2404 | }
|
2405 |
|
2406 |
|
2407 | Ctor = {}.hasOwnProperty.call(proto, 'constructor') && proto.constructor;
|
2408 | return typeof Ctor === 'function' && {}.hasOwnProperty.toString.call(Ctor) === {}.hasOwnProperty.toString.call(Object);
|
2409 | };
|
2410 |
|
2411 |
|
2412 |
|
2413 |
|
2414 | Object.clone = function (obj) {
|
2415 | var copy;
|
2416 | if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object') {
|
2417 | if (obj === null) {
|
2418 | copy = null;
|
2419 | } else {
|
2420 | if (obj instanceof Array) {
|
2421 | copy = [];
|
2422 | for (var i = 0; i < obj.length; i++) {
|
2423 | copy.push(this.clone(obj[i]));
|
2424 | }
|
2425 | } else {
|
2426 | copy = {};
|
2427 | for (var j in obj) {
|
2428 | copy[j] = this.clone(obj[j]);
|
2429 | }
|
2430 | }
|
2431 | }
|
2432 | } else {
|
2433 | copy = obj;
|
2434 | }
|
2435 | return copy;
|
2436 | };
|
2437 |
|
2438 |
|
2439 |
|
2440 |
|
2441 |
|
2442 |
|
2443 | Object.params = function (obj, splitter, isNotEnCode) {
|
2444 | if (!Object.isPlainObject(obj)) return obj;
|
2445 | if (obj instanceof Object && obj.length > 0) return '';
|
2446 |
|
2447 | if (splitter === 'dot') {
|
2448 | var arr = [];
|
2449 | for (var n in obj) {
|
2450 | arr.push(n + '=' + JSON.stringify(obj[n]));
|
2451 | }
|
2452 | return arr.join('&');
|
2453 | }
|
2454 |
|
2455 | var result = '';
|
2456 | function buildParams(obj, prevKey) {
|
2457 | for (var key in obj) {
|
2458 | if (obj[key] instanceof Object) {
|
2459 | var prefix = prevKey ? prevKey + '.' + key : key;
|
2460 | buildParams(obj[key], prefix);
|
2461 | } else {
|
2462 | if (prevKey) {
|
2463 |
|
2464 | if (splitter !== 'bracket') result += '&' + prevKey + '.' + key + '=' + (isNotEnCode ? obj[key] : encodeURIComponent(obj[key]));
|
2465 | if (splitter === 'bracket') result += '&' + prevKey + '[' + key + ']=' + (isNotEnCode ? obj[key] : encodeURIComponent(obj[key]));
|
2466 | } else {
|
2467 |
|
2468 | result += '&' + key + '=' + (isNotEnCode ? obj[key] : encodeURIComponent(obj[key]));
|
2469 | }
|
2470 | }
|
2471 | }
|
2472 | return result;
|
2473 | }
|
2474 | buildParams(obj);
|
2475 |
|
2476 | if (result) {
|
2477 | result = result.slice(1);
|
2478 | }
|
2479 | return result;
|
2480 | };
|
2481 |
|
2482 |
|
2483 |
|
2484 |
|
2485 |
|
2486 |
|
2487 |
|
2488 |
|
2489 |
|
2490 |
|
2491 |
|
2492 |
|
2493 |
|
2494 |
|
2495 |
|
2496 |
|
2497 | Object.type = function (obj) {
|
2498 | if (!obj) {
|
2499 | return obj + '';
|
2500 | }
|
2501 | var type = Object.prototype.toString.call(obj).replace('[', '').replace(']', '').split(' ')[1].toLowerCase();
|
2502 | if (type === 'object') {
|
2503 | var objStr = JSON.stringify(obj);
|
2504 | try {
|
2505 | JSON.parse(objStr);
|
2506 | return 'json';
|
2507 | } catch (e) {}
|
2508 | }
|
2509 | return type;
|
2510 | };
|
2511 |
|
2512 |
|
2513 |
|
2514 |
|
2515 | Object.charType = function (char) {
|
2516 | if (char >= 48 && char <= 57) return 'number';
|
2517 | if (char >= 65 && char <= 90) return 'capitalize';
|
2518 | if (char >= 97 && char <= 122) return 'lowercase';
|
2519 | else return 'other';
|
2520 | };
|
2521 | Object.passwordLvl = function (value) {
|
2522 | var mode = {};
|
2523 | for (var i = 0; i < value.length; i++) {
|
2524 | mode[Object.charType(value.charCodeAt(i))] = '';
|
2525 | }
|
2526 | var lvl = 0;
|
2527 |
|
2528 | for (m in mode) {
|
2529 | lvl++;
|
2530 | }
|
2531 |
|
2532 | if (value.length > 0 && value.length < 6) return 1;
|
2533 | return lvl;
|
2534 | };
|
2535 |
|
2536 |
|
2537 |
|
2538 | Object.isFunction = function (obj) {
|
2539 | return Object.type(obj) === 'function';
|
2540 | };
|
2541 |
|
2542 |
|
2543 |
|
2544 |
|
2545 | Object.isWindow = function (obj) {
|
2546 | return obj != null && obj === obj.window;
|
2547 | };
|
2548 |
|
2549 |
|
2550 |
|
2551 |
|
2552 | Object.extend = function () {
|
2553 | var options;
|
2554 | var name;
|
2555 | var src;
|
2556 | var copy;
|
2557 | var copyIsArray;
|
2558 | var clone;
|
2559 | var target = arguments[0] || {};
|
2560 | var i = 1;
|
2561 | var length = arguments.length;
|
2562 | var deep = false;
|
2563 |
|
2564 |
|
2565 | if (typeof target === 'boolean') {
|
2566 | deep = target;
|
2567 |
|
2568 |
|
2569 | target = arguments[i] || {};
|
2570 | i++;
|
2571 | }
|
2572 |
|
2573 |
|
2574 | if ((typeof target === 'undefined' ? 'undefined' : _typeof(target)) !== 'object' && !Object.isFunction(target)) {
|
2575 | target = {};
|
2576 | }
|
2577 |
|
2578 |
|
2579 | if (i === length) {
|
2580 | target = this;
|
2581 | i--;
|
2582 | }
|
2583 |
|
2584 | for (; i < length; i++) {
|
2585 |
|
2586 | options = arguments[i];
|
2587 | if (options != null) {
|
2588 |
|
2589 | for (name in options) {
|
2590 | src = target[name];
|
2591 | copy = options[name];
|
2592 |
|
2593 |
|
2594 | if (target === copy) {
|
2595 | continue;
|
2596 | }
|
2597 |
|
2598 |
|
2599 | if (deep && copy && (Object.isPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) {
|
2600 |
|
2601 | if (copyIsArray) {
|
2602 | copyIsArray = false;
|
2603 | clone = src && Array.isArray(src) ? src : [];
|
2604 | } else {
|
2605 | clone = src && Object.isPlainObject(src) ? src : {};
|
2606 | }
|
2607 |
|
2608 |
|
2609 | target[name] = Object.extend(deep, clone, copy);
|
2610 |
|
2611 |
|
2612 | } else if (copy !== undefined) {
|
2613 | target[name] = copy;
|
2614 | }
|
2615 | }
|
2616 | }
|
2617 | }
|
2618 |
|
2619 |
|
2620 | return target;
|
2621 | };
|
2622 |
|
2623 |
|
2624 |
|
2625 | Object.generateGUID = function () {
|
2626 | var d = new Date().getTime();
|
2627 | var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
2628 | var r = (d + Math.random() * 16) % 16 | 0;
|
2629 | d = Math.floor(d / 16);
|
2630 | return (c === 'x' ? r : r & 0x3 | 0x8).toString(16);
|
2631 | });
|
2632 | return uuid;
|
2633 | };
|
2634 |
|
2635 |
|
2636 |
|
2637 | Object.equals = function (object1, object2) {
|
2638 |
|
2639 |
|
2640 | for (var propName in object1) {
|
2641 |
|
2642 |
|
2643 | if (object1.hasOwnProperty(propName) !== object2.hasOwnProperty(propName)) {
|
2644 | return false;
|
2645 | }
|
2646 |
|
2647 | else if (_typeof(object1[propName]) !== _typeof(object2[propName])) {
|
2648 |
|
2649 | return false;
|
2650 | }
|
2651 | }
|
2652 |
|
2653 | for (propName in object2) {
|
2654 |
|
2655 | if (object1.hasOwnProperty(propName) !== object2.hasOwnProperty(propName)) {
|
2656 | return false;
|
2657 | } else if (_typeof(object1[propName]) !== _typeof(object2[propName])) {
|
2658 | return false;
|
2659 | }
|
2660 |
|
2661 | if (!object1.hasOwnProperty(propName)) continue;
|
2662 |
|
2663 |
|
2664 |
|
2665 |
|
2666 |
|
2667 | if (object1[propName] instanceof Array && object2[propName] instanceof Array) {
|
2668 |
|
2669 | if (!Object.equals(object1[propName], object2[propName])) return false;
|
2670 | } else if (object1[propName] instanceof Object && object2[propName] instanceof Object) {
|
2671 |
|
2672 |
|
2673 | if (!Object.equals(object1[propName], object2[propName])) return false;
|
2674 | }
|
2675 |
|
2676 | else if (object1[propName] !== object2[propName]) {
|
2677 | return false;
|
2678 | }
|
2679 | }
|
2680 |
|
2681 | return true;
|
2682 | };
|
2683 |
|
2684 |
|
2685 |
|
2686 |
|
2687 |
|
2688 |
|
2689 |
|
2690 | Object.getArgs = function (e, parameters) {
|
2691 | var args = parameters ? Object.clone(parameters) : parameters;
|
2692 | if (args !== undefined) {
|
2693 | if (typeof args === 'string' && args === '$event') {
|
2694 | args = e;
|
2695 | } else if (Array.isArray(args) && args.indexOf('$event') > -1) {
|
2696 | args[args.indexOf('$event')] = e;
|
2697 | }
|
2698 | } else {
|
2699 | args = e;
|
2700 | }
|
2701 | return args;
|
2702 | };
|
2703 |
|
2704 | }),
|
2705 |
|
2706 | (function(module, exports) {
|
2707 |
|
2708 |
|
2709 | window.String.prototype.toJson = function (split) {
|
2710 | var array = this.split(split);
|
2711 | var json = {};
|
2712 | for (var i in array) {
|
2713 | var ary = array[i];
|
2714 | json[ary] ? json[ary]++ : json[ary] = 1;
|
2715 | }
|
2716 | return json;
|
2717 | };
|
2718 | function left_zero_4(str) {
|
2719 | if (str && str.length === 2) {
|
2720 | return '00' + str;
|
2721 | }
|
2722 | return str;
|
2723 | }
|
2724 |
|
2725 | window.String.prototype.toASCII = function () {
|
2726 | var value = '';
|
2727 | for (var i = 0; i < this.length; i++) {
|
2728 | value += '\\u' + left_zero_4(parseInt(this.charCodeAt(i), 10).toString(16));
|
2729 | }
|
2730 | return value;
|
2731 | };
|
2732 | window.String.prototype.fromASCII = function () {
|
2733 | return this.replace(/(\\u)(\w{1,4})/gi, function ($0) {
|
2734 | return String.fromCharCode(parseInt(escape($0).replace(/(%5Cu)(\w{1,4})/g, "$2"), 16));
|
2735 | });
|
2736 | };
|
2737 |
|
2738 | window.String.prototype.toUnicode = function () {
|
2739 | var value = '';
|
2740 | for (var i = 0; i < this.length; i++) {
|
2741 | value += '&#' + this.charCodeAt(i) + ';';
|
2742 | }return value;
|
2743 | };
|
2744 | window.String.prototype.fromUnicode = function () {
|
2745 | return this.replace(/(&#x)(\w{1,4});/gi, function ($0) {
|
2746 | return String.fromCharCode(parseInt(escape($0).replace(/(%26%23x)(\w{1,4})(%3B)/g, "$2"), 16));
|
2747 | });
|
2748 | };
|
2749 |
|
2750 | window.String.prototype.toUTF8 = function () {
|
2751 | var value = '';
|
2752 | for (var i = 0; i < this.length; i++) {
|
2753 | value += '&#x' + left_zero_4(parseInt(this.charCodeAt(i), 10).toString(16)) + ';';
|
2754 | }
|
2755 | return value;
|
2756 | };
|
2757 | window.String.prototype.fromUTF8 = function () {
|
2758 | return this.replace(/(&#)(\d{1,6});/gi, function ($0) {
|
2759 | return String.fromCharCode(parseInt(escape($0).replace(/(%26%23)(\d{1,6})(%3B)/g, "$2"), 10));
|
2760 | });
|
2761 | };
|
2762 |
|
2763 | window.String.prototype.toURI = function () {
|
2764 | return encodeURI(this);
|
2765 | };
|
2766 | window.String.prototype.fromURI = function () {
|
2767 | return decodeURI(this);
|
2768 | };
|
2769 |
|
2770 | window.String.prototype.toURIComponent = function () {
|
2771 | return encodeURIComponent(this);
|
2772 | };
|
2773 | window.String.prototype.fromURIComponent = function () {
|
2774 | return decodeURIComponent(this);
|
2775 | };
|
2776 |
|
2777 | window.String.prototype.encode = function () {
|
2778 | return this.toASCII();
|
2779 | };
|
2780 | window.String.prototype.decode = function () {
|
2781 | return this.fromASCII();
|
2782 | };
|
2783 |
|
2784 |
|
2785 | window.String.prototype.trim = function (trimPos) {
|
2786 | if (trimPos === 'left') {
|
2787 | return this.replace(/(^\s*)/g, '');
|
2788 | } else if (trimPos === 'right') {
|
2789 | return this.replace(/(\s*$)/g, '');
|
2790 | }
|
2791 | return this.replace(/(^\s*)|(\s*$)/g, '');
|
2792 | };
|
2793 |
|
2794 |
|
2795 | window.String.prototype.isQueryId = function () {
|
2796 | if (!this.length) return false;
|
2797 | var idExpr = /^#([\w-]*)$/;
|
2798 | var match = idExpr.exec(this);
|
2799 | if (!match || !match[1]) {
|
2800 | return false;
|
2801 | }
|
2802 | return true;
|
2803 | };
|
2804 |
|
2805 | window.String.prototype.isDate = function (split) {
|
2806 | return new RegExp('^[0-9]{4}' + (split || '-') + '[0-9]{2}' + (split || '-') + '[0-9]{2}$').test(this);
|
2807 | };
|
2808 |
|
2809 | window.String.prototype.isMonth = function (split) {
|
2810 | return new RegExp('^[0-9]{4}' + (split || '-') + '[0-9]{2}$').test(this);
|
2811 | };
|
2812 |
|
2813 | window.String.prototype.isDateTime = function (split) {
|
2814 | return new RegExp('^[0-9]{4}' + (split || '-') + '[0-9]{2}' + (split || '-') + '[0-9]{2}\\s[0-9]{2}:[0-9]{2}(:[0-9]{2})?$').test(this);
|
2815 | };
|
2816 |
|
2817 | window.String.prototype.isTime = function () {
|
2818 | return new RegExp('^[0-9]{2}:[0-9]{2}(:[0-9]{2})?$').test(this);
|
2819 | };
|
2820 |
|
2821 | window.String.prototype.toDate = function (dateSplit) {
|
2822 | var date = new Date();
|
2823 | var dateStrArr = [date.getFullYear(), date.getMonth(), date.getDate()];
|
2824 | var timeStrArr = [date.getHours(), date.getMinutes(), date.getSeconds()];
|
2825 | if (this.isDate()) {
|
2826 | dateStrArr = this.split(dateSplit || '-');
|
2827 | } else if (this.isDateTime()) {
|
2828 | var tempDateStrArr = this.split(dateSplit || '-');
|
2829 | var tempTimeStrArr = tempDateStrArr[2].split(' ')[1].split(':');
|
2830 | dateStrArr[0] = tempDateStrArr[0];
|
2831 | dateStrArr[1] = tempDateStrArr[1];
|
2832 | dateStrArr[2] = tempDateStrArr[2].split(' ')[0];
|
2833 | timeStrArr[0] = tempTimeStrArr[0];
|
2834 | timeStrArr[1] = tempTimeStrArr[1];
|
2835 | timeStrArr[2] = tempTimeStrArr[2] || timeStrArr[2];
|
2836 | } else if (this.isMonth()) {
|
2837 | tempDateStrArr = this.split(dateSplit || '-');
|
2838 | dateStrArr[0] = tempDateStrArr[0];
|
2839 | dateStrArr[1] = tempDateStrArr[1];
|
2840 | } else if (this.isTime()) {
|
2841 | tempTimeStrArr = this.split(':');
|
2842 | timeStrArr[0] = tempTimeStrArr[0];
|
2843 | timeStrArr[1] = tempTimeStrArr[1];
|
2844 | timeStrArr[2] = tempTimeStrArr[2] || timeStrArr[2];
|
2845 | }
|
2846 | date.setYear(dateStrArr[0]);
|
2847 | date.setMonth(dateStrArr[1] - 1, dateStrArr[2]);
|
2848 | date.setHours(timeStrArr[0], timeStrArr[1], timeStrArr[2]);
|
2849 | return date;
|
2850 | };
|
2851 |
|
2852 | window.String.prototype.hasClass = function (name) {
|
2853 | var classStr = this;
|
2854 | if (this.indexOf('class=') > -1) {
|
2855 | var res = classStr.match(/class=["'](.*)["']/);
|
2856 | if (res[1]) {
|
2857 | classStr = res[1];
|
2858 | } else {
|
2859 | classStr = '';
|
2860 | }
|
2861 | }
|
2862 | var names = classStr.split(' ');
|
2863 | for (var i = 0; i < names.length; i++) {
|
2864 | if (names[i] === name) return true;
|
2865 | }
|
2866 | return false;
|
2867 | };
|
2868 |
|
2869 | window.String.prototype.addClass = function (name) {
|
2870 | var str = String(this);
|
2871 | var className = 'class="' + name + '"';
|
2872 | if (this.indexOf('class=') > -1) {
|
2873 |
|
2874 | var res = this.match(/class=["'](.*)["']/);
|
2875 | if (res[1] && !res[1].hasClass(name)) {
|
2876 |
|
2877 | className = 'class="' + res[1] + ' ' + name + '"';
|
2878 | str = str.replace(/class=["'](.*)["']/, className);
|
2879 | return str;
|
2880 | }
|
2881 | return str;
|
2882 | } else {
|
2883 |
|
2884 | res = str.match(/<\w+/);
|
2885 | if (res[0]) {
|
2886 | return str.replace(/<\w+/, res[0] + ' ' + className);
|
2887 | }
|
2888 | return str;
|
2889 | }
|
2890 | };
|
2891 |
|
2892 |
|
2893 | window.String.prototype.clearImgProtocol = function () {
|
2894 | return this.replace(/<img\s+src="https:/gim, '<img src="').replace(/<img\s+src="http:/gim, '<img src="');
|
2895 | };
|
2896 |
|
2897 |
|
2898 | window.String.prototype.clearProtocol = function () {
|
2899 | return this.replace(/https:/gim, '').replace(/http:/gim, '');
|
2900 | };
|
2901 |
|
2902 |
|
2903 | window.String.prototype.isQueryId = function () {
|
2904 | if (!this.length) return false;
|
2905 | var idExpr = /^#([\w-]*)$/;
|
2906 | var match = idExpr.exec(this);
|
2907 | if (match && match.length > 0) {
|
2908 | return match[1];
|
2909 | }
|
2910 | return false;
|
2911 | };
|
2912 |
|
2913 | window.String.prototype.isQueryClass = function () {
|
2914 | if (!this.length) return false;
|
2915 | var classExpr = /^\.([\w-]*)$/;
|
2916 | var match = classExpr.exec(this);
|
2917 | if (match && match.length > 0) {
|
2918 | return match[1];
|
2919 | }
|
2920 | return false;
|
2921 | };
|
2922 |
|
2923 | window.String.prototype.isTag = function () {
|
2924 | if (!this.length) return false;
|
2925 | var tagExpr = /^<(\w+)\s*.*\/\w*>$/im;
|
2926 | var match = tagExpr.exec(this);
|
2927 | if (match && match.length > 0) {
|
2928 | return true;
|
2929 | }
|
2930 | return false;
|
2931 | };
|
2932 |
|
2933 | window.String.prototype.getUnitValue = function (argSuffix) {
|
2934 |
|
2935 | var suffix = argSuffix || 'px';
|
2936 | var patt = new RegExp('^[+-]?(0|([1-9][0-9]*))(.[0-9]?)' + suffix + '$');
|
2937 | if (patt.test(this)) {
|
2938 | return this.substring(0, this.indexOf(suffix));
|
2939 | }
|
2940 | return 0;
|
2941 | };
|
2942 |
|
2943 | String.charType = function (char) {
|
2944 | if (char >= 48 && char <= 57) return 'number';
|
2945 | if (char >= 65 && char <= 90) return 'capitalize';
|
2946 | if (char >= 97 && char <= 122) return 'lowercase';
|
2947 | else return 'other';
|
2948 | };
|
2949 | window.String.prototype.safeLvl = function () {
|
2950 | if (this.length > 0 && this.length < 6) return 1;
|
2951 | var mode = {};
|
2952 | for (var i = 0; i < this.length; i++) {
|
2953 | mode[String.charType(this.charCodeAt(i))] = '';
|
2954 | }
|
2955 | return Object.values(mode).length;
|
2956 | };
|
2957 |
|
2958 | }),
|
2959 |
|
2960 | (function(module, exports) {
|
2961 |
|
2962 |
|
2963 | Number.prototype.toDuration = function (start) {
|
2964 | var milli = this;
|
2965 |
|
2966 | if (start === 'second') {
|
2967 | return {
|
2968 | seconds: milli / 1000
|
2969 | };
|
2970 | }
|
2971 |
|
2972 | var secondMilli = 1000;
|
2973 | var minuteMilli = 60 * secondMilli;
|
2974 | var hourMilli = 60 * minuteMilli;
|
2975 | var dayMilli = 24 * hourMilli;
|
2976 |
|
2977 | var daysDiff = Math.floor(milli / dayMilli);
|
2978 |
|
2979 | var dayMilliRemainder = milli % dayMilli;
|
2980 | var hoursDiff = Math.floor(dayMilliRemainder / hourMilli);
|
2981 |
|
2982 | var minuteMilliRemainder = dayMilliRemainder % hourMilli;
|
2983 | var minutesDiff = Math.floor(minuteMilliRemainder / minuteMilli);
|
2984 |
|
2985 | var secondMilliRemainder = minuteMilliRemainder % minuteMilli;
|
2986 | var secondsDiff = Math.round(secondMilliRemainder / secondMilli);
|
2987 |
|
2988 |
|
2989 | if (start === 'hour') {
|
2990 | return {
|
2991 | hours: hoursDiff + daysDiff * 24,
|
2992 | minutes: minutesDiff,
|
2993 | seconds: secondsDiff
|
2994 | };
|
2995 | }
|
2996 |
|
2997 | if (start === 'minute') {
|
2998 | return {
|
2999 | minutes: minutesDiff + hoursDiff * 60 + daysDiff * 24 * 60,
|
3000 | seconds: secondsDiff
|
3001 | };
|
3002 | }
|
3003 |
|
3004 | return {
|
3005 | days: daysDiff,
|
3006 | hours: hoursDiff,
|
3007 | minutes: minutesDiff,
|
3008 | seconds: secondsDiff
|
3009 | };
|
3010 | };
|
3011 |
|
3012 | }),
|
3013 |
|
3014 | (function(module, exports) {
|
3015 |
|
3016 |
|
3017 | window.Date.prototype.minuteMilliSecond = 60 * 1000;
|
3018 | window.Date.prototype.hourMilliSecond = 60 * 60 * 1000;
|
3019 | window.Date.prototype.dayMilliSecond = 24 * 60 * 60 * 1000;
|
3020 | window.Date.prototype.weekMilliSecond = 7 * 24 * 60 * 60 * 1000;
|
3021 |
|
3022 |
|
3023 |
|
3024 |
|
3025 |
|
3026 | window.Date.prototype.year = function (year) {
|
3027 | if (year) this.setYear(year);
|
3028 | return this.getFullYear().toString();
|
3029 | };
|
3030 |
|
3031 | window.Date.prototype.prevYear = function (count) {
|
3032 | this.setYear(this.getFullYear() - (count || 1));
|
3033 | return this;
|
3034 | };
|
3035 |
|
3036 | window.Date.prototype.nextYear = function (count) {
|
3037 | this.setYear(this.getFullYear() + (count || 1));
|
3038 | return this;
|
3039 | };
|
3040 |
|
3041 | window.Date.prototype.isLeap = function () {
|
3042 | var year = this.getFullYear();
|
3043 | return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
3044 | };
|
3045 |
|
3046 | window.Date.prototype.firstYearDate = function () {
|
3047 | this.setMonth(0, 1);
|
3048 | return this;
|
3049 | };
|
3050 |
|
3051 | window.Date.prototype.lastYearDate = function () {
|
3052 | this.setMonth(11, 31);
|
3053 | return this;
|
3054 | };
|
3055 |
|
3056 | window.Date.prototype.getYearDate = function () {
|
3057 | return this.isLeap() ? 366 : 365;
|
3058 | };
|
3059 |
|
3060 |
|
3061 |
|
3062 |
|
3063 |
|
3064 | window.Date.prototype.season = function (argCount) {
|
3065 | var count = argCount || Math.ceil((this.getMonth() + 1) / 3);
|
3066 |
|
3067 | this.setMonth(count * 3 - 3, 1);
|
3068 | return count;
|
3069 | };
|
3070 |
|
3071 | window.Date.prototype.prevSeason = function (count) {
|
3072 |
|
3073 | this.setMonth(this.getMonth() - 3 * (count || 1), 1);
|
3074 | return Math.ceil((this.getMonth() + 1) / 3);
|
3075 | };
|
3076 |
|
3077 | window.Date.prototype.nextSeason = function (count) {
|
3078 |
|
3079 | this.setMonth(this.getMonth() + 3 * (count || 1), 1);
|
3080 | return Math.ceil((this.getMonth() + 1) / 3);
|
3081 | };
|
3082 |
|
3083 | window.Date.prototype.firstSeason = function () {
|
3084 | this.season(1);
|
3085 | return 1;
|
3086 | };
|
3087 |
|
3088 | window.Date.prototype.lastSeason = function () {
|
3089 | this.season(4);
|
3090 | return 4;
|
3091 | };
|
3092 |
|
3093 | window.Date.prototype.firstSeasonDate = function () {
|
3094 | var count = Math.ceil((this.getMonth() + 1) / 3);
|
3095 | this.setYear(this.getFullYear());
|
3096 | this.setMonth(count * 3 - 3, 1);
|
3097 | return this;
|
3098 | };
|
3099 |
|
3100 | window.Date.prototype.lastSeasonDate = function () {
|
3101 | var count = Math.ceil((this.getMonth() + 1) / 3);
|
3102 | this.setYear(this.getFullYear());
|
3103 | this.setMonth(count * 3, 0);
|
3104 | return this;
|
3105 | };
|
3106 |
|
3107 | window.Date.prototype.getSeasonDate = function () {
|
3108 |
|
3109 | var count = Math.ceil((this.getMonth() + 1) / 3);
|
3110 |
|
3111 | if (count === 1) return this.isLeap() ? 91 : 90;
|
3112 | if (count === 2) return 91;
|
3113 | if (count === 3 || count === 4) return 92;
|
3114 | };
|
3115 |
|
3116 |
|
3117 |
|
3118 |
|
3119 | window.Date.prototype.month = function (month) {
|
3120 | var targetYear = null;
|
3121 | var targetMonth = null;
|
3122 | var targetMaxDate = null;
|
3123 |
|
3124 | if (month) {
|
3125 | if (/^\d{1,2}$/.test(month)) {
|
3126 | targetMonth = month - 1;
|
3127 | targetMaxDate = new Date(this.getFullYear(), targetMonth + 1, 0).getDate();
|
3128 | if (this.getMonthDate() > targetMaxDate) {
|
3129 | this.setMonth(targetMonth, targetMaxDate);
|
3130 | } else {
|
3131 | this.setMonth(targetMonth);
|
3132 | }
|
3133 | } else if (/^(\d{4}).(\d{1,2})/.test(month)) {
|
3134 | var arr = month.match(/^(\d{4}).(\d{1,2})/);
|
3135 | targetYear = Number(arr[1]);
|
3136 | targetMonth = arr[2] - 1;
|
3137 | targetMaxDate = new Date(targetYear, targetMonth + 1, 0).getDate();
|
3138 | if (this.getMonthDate() > targetMaxDate) {
|
3139 | this.setYear(targetYear);
|
3140 | this.setMonth(targetMonth, targetMaxDate);
|
3141 | } else {
|
3142 | this.setYear(targetYear);
|
3143 | this.setMonth(targetMonth);
|
3144 | }
|
3145 | }
|
3146 | }
|
3147 | var num = this.getMonth() + 1;
|
3148 | return num < 10 ? '0' + num : num;
|
3149 | };
|
3150 |
|
3151 | window.Date.prototype.prevMonth = function (count) {
|
3152 | var targetMonth = this.getMonth() - (count || 1);
|
3153 | var targetMaxDate = new Date(this.getFullYear(), targetMonth + 1, 0).getDate();
|
3154 | if (this.getDate() > targetMaxDate) {
|
3155 | this.setMonth(targetMonth, targetMaxDate);
|
3156 | } else {
|
3157 | this.setMonth(targetMonth);
|
3158 | }
|
3159 | return targetMonth < 10 ? '0' + targetMonth : targetMonth;
|
3160 | };
|
3161 |
|
3162 | window.Date.prototype.nextMonth = function (count) {
|
3163 | var targetMonth = this.getMonth() + (count || 1);
|
3164 | var targetMaxDate = new Date(this.getFullYear(), targetMonth + 1, 0).getDate();
|
3165 | if (this.getDate() > targetMaxDate) {
|
3166 | this.setMonth(targetMonth, targetMaxDate);
|
3167 | } else {
|
3168 | this.setMonth(targetMonth);
|
3169 | }
|
3170 | return targetMonth < 10 ? '0' + targetMonth : targetMonth;
|
3171 | };
|
3172 |
|
3173 | window.Date.prototype.firstMonth = function () {
|
3174 | this.setMonth(0);
|
3175 | return '01';
|
3176 | };
|
3177 |
|
3178 | window.Date.prototype.lastMonth = function () {
|
3179 | this.setMonth(11);
|
3180 | return '12';
|
3181 | };
|
3182 |
|
3183 | window.Date.prototype.firstMonthDate = function () {
|
3184 | this.setDate(1);
|
3185 | return this;
|
3186 | };
|
3187 |
|
3188 | window.Date.prototype.lastMonthDate = function () {
|
3189 | this.setMonth(this.getMonth() + 1, 0);
|
3190 | return this;
|
3191 | };
|
3192 |
|
3193 | window.Date.prototype.getMonthDate = function () {
|
3194 | return new Date(this.getFullYear(), this.getMonth() + 1, '0').getDate();
|
3195 | };
|
3196 |
|
3197 |
|
3198 |
|
3199 |
|
3200 |
|
3201 | window.Date.prototype.day = function (language) {
|
3202 | var chDay = { 1: '一', 2: '二', 3: '三', 4: '四', 5: '五', 6: '六', 0: '日' };
|
3203 | if (language === 'zh_cn') {
|
3204 | return chDay[this.getDay()];
|
3205 | }
|
3206 | return this.getDay();
|
3207 | };
|
3208 |
|
3209 | window.Date.prototype.week = function (count) {
|
3210 |
|
3211 | var january1 = new Date(this.getFullYear(), 0, 1);
|
3212 | var january1Day = january1.getDay();
|
3213 | if (january1Day === 0) january1Day = 7;
|
3214 |
|
3215 | if (count) {
|
3216 | this.setTime(january1.getTime() + this.weekMilliSecond * count);
|
3217 | return count;
|
3218 | }
|
3219 |
|
3220 | var num = Math.ceil((this.getTime() - january1.getTime()) / this.weekMilliSecond);
|
3221 | return num;
|
3222 | };
|
3223 |
|
3224 | window.Date.prototype.prevWeek = function (count) {
|
3225 | this.setTime(this.getTime() - this.weekMilliSecond * (count || 1));
|
3226 | return this;
|
3227 | };
|
3228 |
|
3229 | window.Date.prototype.nextWeek = function (count) {
|
3230 | this.setTime(this.getTime() + this.weekMilliSecond * (count || 1));
|
3231 | return this;
|
3232 | };
|
3233 |
|
3234 | window.Date.prototype.sunday = function () {
|
3235 | var day = this.getDay();
|
3236 | this.setTime(this.getTime() - this.dayMilliSecond * day);
|
3237 | return this;
|
3238 | };
|
3239 |
|
3240 | window.Date.prototype.monday = function () {
|
3241 | var day = this.getDay();
|
3242 | this.setTime(this.getTime() + this.dayMilliSecond * (1 - day));
|
3243 | return this;
|
3244 | };
|
3245 |
|
3246 | window.Date.prototype.tuesday = function () {
|
3247 | var day = this.getDay();
|
3248 | this.setTime(this.getTime() + this.dayMilliSecond * (2 - day));
|
3249 | return this;
|
3250 | };
|
3251 |
|
3252 | window.Date.prototype.wednesday = function () {
|
3253 | var day = this.getDay();
|
3254 | this.setTime(this.getTime() + this.dayMilliSecond * (3 - day));
|
3255 | return this;
|
3256 | };
|
3257 |
|
3258 | window.Date.prototype.thursday = function () {
|
3259 | var day = this.getDay();
|
3260 | this.setTime(this.getTime() + this.dayMilliSecond * (4 - day));
|
3261 | return this;
|
3262 | };
|
3263 |
|
3264 | window.Date.prototype.friday = function () {
|
3265 | var day = this.getDay();
|
3266 | this.setTime(this.getTime() + this.dayMilliSecond * (5 - day));
|
3267 | return this;
|
3268 | };
|
3269 |
|
3270 | window.Date.prototype.saturday = function () {
|
3271 | var day = this.getDay();
|
3272 | this.setTime(this.getTime() + this.dayMilliSecond * (6 - day));
|
3273 | return this;
|
3274 | };
|
3275 |
|
3276 |
|
3277 |
|
3278 |
|
3279 | window.Date.prototype.date = function (date) {
|
3280 | if (date) this.setDate(date);
|
3281 | var num = this.getDate();
|
3282 | return num < 10 ? '0' + num : num;
|
3283 | };
|
3284 |
|
3285 | window.Date.prototype.prevDate = function (count) {
|
3286 | this.setTime(this.getTime() - this.dayMilliSecond * (count || 1));
|
3287 | return this;
|
3288 | };
|
3289 |
|
3290 | window.Date.prototype.nextDate = function (count) {
|
3291 | this.setTime(this.getTime() + this.dayMilliSecond * (count || 1));
|
3292 | return this;
|
3293 | };
|
3294 |
|
3295 |
|
3296 |
|
3297 |
|
3298 |
|
3299 | window.Date.prototype.hour = function (hour) {
|
3300 | if (hour) this.setHours(hour);
|
3301 | var num = this.getHours();
|
3302 | return num < 10 ? '0' + num : num;
|
3303 | };
|
3304 |
|
3305 | window.Date.prototype.prevHour = function (count) {
|
3306 | this.setTime(this.getTime() - this.hourMilliSecond * (count || 1));
|
3307 | return this;
|
3308 | };
|
3309 |
|
3310 | window.Date.prototype.nextHour = function (count) {
|
3311 | this.setTime(this.getTime() + this.hourMilliSecond * (count || 1));
|
3312 | return this;
|
3313 | };
|
3314 |
|
3315 |
|
3316 |
|
3317 |
|
3318 | window.Date.prototype.minute = function (minute) {
|
3319 | if (minute) this.setMinutes(minute);
|
3320 | var num = this.getMinutes();
|
3321 | return num < 10 ? '0' + num : num;
|
3322 | };
|
3323 |
|
3324 | window.Date.prototype.prevMinute = function (count) {
|
3325 | this.setTime(this.getTime() - this.minuteMilliSecond * (count || 1));
|
3326 | return this;
|
3327 | };
|
3328 |
|
3329 | window.Date.prototype.nextMinute = function (count) {
|
3330 | this.setTime(this.getTime() + this.minuteMilliSecond * (count || 1));
|
3331 | return this;
|
3332 | };
|
3333 |
|
3334 | window.Date.prototype.nextMinuteSpace = function (argSpace) {
|
3335 | var space = argSpace ? argSpace : 5;
|
3336 | var minute = this.getMinutes();
|
3337 | var hasRemainder = minute % space === 0;
|
3338 |
|
3339 | var percentNum = Math.ceil(minute / space);
|
3340 | percentNum = hasRemainder ? parseInt(percentNum, 10) + 1 : percentNum;
|
3341 |
|
3342 | var result = percentNum * space;
|
3343 | this.setMinutes(result);
|
3344 | return this.minute();
|
3345 | };
|
3346 |
|
3347 | window.Date.prototype.prevMinuteSpace = function (argSpace) {
|
3348 | var space = argSpace ? argSpace : 5;
|
3349 | var minute = this.getMinutes();
|
3350 | var hasRemainder = minute % space === 0;
|
3351 |
|
3352 | var percentNum = Math.floor(minute / space);
|
3353 | percentNum = hasRemainder ? parseInt(percentNum, 10) - 1 : percentNum;
|
3354 |
|
3355 | var result = percentNum * space;
|
3356 | this.setMinutes(result);
|
3357 | return this.minute();
|
3358 | };
|
3359 |
|
3360 |
|
3361 |
|
3362 |
|
3363 | window.Date.prototype.diff = function (date) {
|
3364 | var dateStart = this;
|
3365 | var dateEnd = date;
|
3366 |
|
3367 | var secondMilli = 1000;
|
3368 | var minuteMilli = 60 * secondMilli;
|
3369 | var hourMilli = 60 * minuteMilli;
|
3370 | var dayMilli = 24 * hourMilli;
|
3371 |
|
3372 | var timeDiff = dateEnd.getTime() - dateStart.getTime();
|
3373 |
|
3374 |
|
3375 | var daysDiff = Math.floor(timeDiff / dayMilli);
|
3376 |
|
3377 | var dayMilliRemainder = timeDiff % dayMilli;
|
3378 | var hoursDiff = Math.floor(dayMilliRemainder / hourMilli);
|
3379 |
|
3380 | var minuteMilliRemainder = dayMilliRemainder % hourMilli;
|
3381 | var minutesDiff = Math.floor(minuteMilliRemainder / minuteMilli);
|
3382 |
|
3383 | var secondMilliRemainder = minuteMilliRemainder % minuteMilli;
|
3384 | var secondsDiff = Math.round(secondMilliRemainder / secondMilli);
|
3385 |
|
3386 |
|
3387 | var hoursAllDiff = Math.floor(timeDiff / hourMilli);
|
3388 |
|
3389 | var minutesAllDiff = Math.floor(timeDiff / minuteMilli);
|
3390 |
|
3391 | var secondsAllDiff = Math.floor(timeDiff / secondMilli);
|
3392 |
|
3393 | return {
|
3394 | days: daysDiff,
|
3395 | hours: hoursDiff,
|
3396 | minutes: minutesDiff,
|
3397 | seconds: secondsDiff,
|
3398 | hoursAll: hoursAllDiff,
|
3399 | minutesAll: minutesAllDiff,
|
3400 | secondsAll: secondsAllDiff
|
3401 | };
|
3402 | };
|
3403 |
|
3404 | window.Date.prototype.compareDateTime = function (date) {
|
3405 | var date1 = new Date(this);
|
3406 | var date2 = new Date(date);
|
3407 | date1.setSeconds(0, 0);
|
3408 | date2.setSeconds(0, 0);
|
3409 | var t1 = date1.getTime();
|
3410 | var t2 = date2.getTime();
|
3411 |
|
3412 | if (t1 === t2) return 0;
|
3413 | return t1 > t2 ? 1 : -1;
|
3414 | };
|
3415 |
|
3416 | window.Date.prototype.compareDate = function (date) {
|
3417 | var date1 = new Date(this);
|
3418 | var date2 = new Date(date);
|
3419 | date1.setHours(0, 0, 0, 0);
|
3420 | date2.setHours(0, 0, 0, 0);
|
3421 | var t1 = date1.getTime();
|
3422 | var t2 = date2.getTime();
|
3423 |
|
3424 | if (t1 === t2) return 0;
|
3425 | return t1 > t2 ? 1 : -1;
|
3426 | };
|
3427 |
|
3428 | window.Date.prototype.compareMonth = function (date) {
|
3429 | var date1 = new Date(this);
|
3430 | var date2 = new Date(date);
|
3431 | date1.setDate(0);
|
3432 | date1.setHours(0, 0, 0, 0);
|
3433 | date2.setDate(0);
|
3434 | date2.setHours(0, 0, 0, 0);
|
3435 | var t1 = date1.getTime();
|
3436 | var t2 = date2.getTime();
|
3437 |
|
3438 | if (t1 === t2) return 0;
|
3439 | return t1 > t2 ? 1 : -1;
|
3440 | };
|
3441 |
|
3442 | window.Date.prototype.compareTime = function (date) {
|
3443 | var date1 = new Date(this);
|
3444 | date1.setYear(0);
|
3445 | date1.setMonth(0, 0);
|
3446 | date1.setSeconds(0, 0);
|
3447 | var date2 = new Date();
|
3448 | if (date instanceof Date) {
|
3449 | date2 = date;
|
3450 | } else if (/^[0-9]{2}:[0-9]{2}$/.test(date)) {
|
3451 | date2.setHours(date.split(':')[0], date.split(':')[1], 0, 0);
|
3452 | } else {
|
3453 | console.log('请传入hh:mm的字符串,或者一个Date对象');
|
3454 | return false;
|
3455 | }
|
3456 | date2.setYear(0);
|
3457 | date2.setMonth(0, 0);
|
3458 | var t1 = date1.getTime();
|
3459 | var t2 = date2.getTime();
|
3460 |
|
3461 | if (t1 === t2) return 0;
|
3462 | return t1 > t2 ? 1 : -1;
|
3463 | };
|
3464 |
|
3465 |
|
3466 |
|
3467 |
|
3468 |
|
3469 | window.Date.prototype.expires = function (expires) {
|
3470 |
|
3471 | if (!expires) {
|
3472 | this.nextHour(2);
|
3473 | return this;
|
3474 | }
|
3475 |
|
3476 | if (expires instanceof Date === true) {
|
3477 |
|
3478 | if (expires.compareDateTime(this) === 1) {
|
3479 | return expires;
|
3480 | }
|
3481 | return this;
|
3482 | }
|
3483 |
|
3484 | if (!isNaN(expires)) {
|
3485 | this.nextHour(expires);
|
3486 | return this;
|
3487 | }
|
3488 |
|
3489 | if (expires === 'today') {
|
3490 | this.setHours(0, 0, 0, 0);
|
3491 | this.nextDate();
|
3492 | return this;
|
3493 | }
|
3494 | };
|
3495 |
|
3496 |
|
3497 |
|
3498 |
|
3499 |
|
3500 | window.Date.prototype.format = function (formatStr) {
|
3501 |
|
3502 | var year = this.getFullYear();
|
3503 | if (formatStr.indexOf('YYYY') !== -1) {
|
3504 | formatStr = formatStr.replace(/YYYY/gm, year);
|
3505 | }
|
3506 | if (formatStr.indexOf('YY') !== -1) {
|
3507 | formatStr = formatStr.replace(/YY/gm, year.substring(2, 4));
|
3508 | }
|
3509 |
|
3510 | var month = this.getMonth() + 1;
|
3511 | if (formatStr.indexOf('MM') !== -1) {
|
3512 | formatStr = formatStr.replace(/MM/gm, month < 10 ? '0' + month : month);
|
3513 | }
|
3514 | if (formatStr.indexOf('M') !== -1) {
|
3515 | formatStr = formatStr.replace(/M/gm, month);
|
3516 | }
|
3517 |
|
3518 | var date = this.getDate();
|
3519 | if (formatStr.indexOf('DD') !== -1) {
|
3520 | formatStr = formatStr.replace(/DD/gm, date < 10 ? '0' + date : date);
|
3521 | }
|
3522 | if (formatStr.indexOf('D') !== -1) {
|
3523 | formatStr = formatStr.replace(/D/gm, date);
|
3524 | }
|
3525 |
|
3526 |
|
3527 | var quarter = Math.ceil((this.getMonth() + 1) / 3);
|
3528 | if (formatStr.indexOf('Q') !== -1) {
|
3529 | formatStr = formatStr.replace(/Q/gm, quarter);
|
3530 | }
|
3531 |
|
3532 |
|
3533 | var week = this.week();
|
3534 | if (formatStr.indexOf('WW') !== -1) {
|
3535 | formatStr = formatStr.replace(/WW/gm, week < 10 ? '0' + week : week);
|
3536 | }
|
3537 | if (formatStr.indexOf('W') !== -1) {
|
3538 | formatStr = formatStr.replace(/W/gm, week);
|
3539 | }
|
3540 |
|
3541 | var chinaWeek = { 1: '一', 2: '二', 3: '三', 4: '四', 5: '五', 6: '六', 0: '日' };
|
3542 | var day = this.getDay();
|
3543 | if (formatStr.indexOf('EE') !== -1) {
|
3544 | formatStr = formatStr.replace(/EE/gm, chinaWeek[day]);
|
3545 | }
|
3546 | if (formatStr.indexOf('E') !== -1) {
|
3547 | formatStr = formatStr.replace(/E/gm, day);
|
3548 | }
|
3549 |
|
3550 |
|
3551 | var hour = this.getHours();
|
3552 | if (formatStr.indexOf('hh') !== -1) {
|
3553 | formatStr = formatStr.replace(/hh/gm, hour < 10 ? '0' + hour : hour);
|
3554 | }
|
3555 | if (formatStr.indexOf('h') !== -1) {
|
3556 | formatStr = formatStr.replace(/h/gm, hour);
|
3557 | }
|
3558 |
|
3559 | var minute = this.getMinutes();
|
3560 | if (formatStr.indexOf('mm') !== -1) {
|
3561 | formatStr = formatStr.replace(/mm/gm, minute < 10 ? '0' + minute : minute);
|
3562 | }
|
3563 | if (formatStr.indexOf('m') !== -1) {
|
3564 | formatStr = formatStr.replace(/m/gm, minute);
|
3565 | }
|
3566 |
|
3567 | var second = this.getSeconds();
|
3568 | if (formatStr.indexOf('ss') !== -1) {
|
3569 | formatStr = formatStr.replace(/ss/gm, second < 10 ? '0' + second : second);
|
3570 | }
|
3571 | if (formatStr.indexOf('s') !== -1) {
|
3572 | formatStr = formatStr.replace(/s/gm, second);
|
3573 | }
|
3574 | return formatStr;
|
3575 | };
|
3576 |
|
3577 |
|
3578 |
|
3579 |
|
3580 |
|
3581 | window.Date.prototype.getMonthData = function () {
|
3582 |
|
3583 |
|
3584 | var firstDay = new Date(this).firstMonthDate();
|
3585 | var firstDayIndex = firstDay.getDay();
|
3586 |
|
3587 | var startDayMs = firstDay.getTime() - this.dayMilliSecond * firstDayIndex;
|
3588 |
|
3589 | var data = [];
|
3590 |
|
3591 | for (var i = 0; i < 42; i++) {
|
3592 | data.push(new Date());
|
3593 | if (i === 0) data[0].setTime(startDayMs);else data[i].setTime(data[i - 1].getTime() + this.dayMilliSecond);
|
3594 |
|
3595 |
|
3596 | data[i].isCurrent = false;
|
3597 | if (data[i].month() === this.month()) data[i].isCurrent = true;
|
3598 | }
|
3599 | return data;
|
3600 | };
|
3601 | window.Date.prototype.getPrevMonthData = function () {
|
3602 |
|
3603 | var date = new Date(this);
|
3604 | date.prevMonth();
|
3605 | return date.getMonthData();
|
3606 | };
|
3607 | window.Date.prototype.getNextMonthData = function () {
|
3608 |
|
3609 | var date = new Date(this);
|
3610 | date.nextMonth();
|
3611 | return date.getMonthData();
|
3612 | };
|
3613 | window.Date.prototype.getCalendarData = function () {
|
3614 |
|
3615 | var data = this.getPrevMonthData().concat(this.getMonthData()).concat(this.getNextMonthData());
|
3616 |
|
3617 |
|
3618 | var activeIndex = this.getDate() + new Date(this).firstMonthDate().getDay();
|
3619 |
|
3620 | data.activeRowIndex = Math.ceil(activeIndex / 7) - 1;
|
3621 |
|
3622 | data.activeIndex = activeIndex + 41;
|
3623 | return data;
|
3624 | };
|
3625 |
|
3626 | window.Date.prototype.getPrevMonth = function (count) {
|
3627 |
|
3628 | if (count) {
|
3629 | var months = [];
|
3630 | var tempDate = new Date(this);
|
3631 | for (var i = 0; i < count; i++) {
|
3632 | tempDate.prevMonth();
|
3633 | var prevMonth = new Date(tempDate);
|
3634 | months.push(prevMonth);
|
3635 | }
|
3636 | return months;
|
3637 | }
|
3638 | var date = new Date(this);
|
3639 | date.prevMonth();
|
3640 | return date;
|
3641 | };
|
3642 |
|
3643 |
|
3644 | window.Date.prototype.getWeekData = function () {
|
3645 |
|
3646 | var date = new Date(this);
|
3647 | var sunday = date.sunday();
|
3648 | var data = [];
|
3649 | for (var i = 0; i < 7; i++) {
|
3650 | data.push(new Date(sunday.getTime() + this.dayMilliSecond * i));
|
3651 | }
|
3652 | return data;
|
3653 | };
|
3654 | window.Date.prototype.getPrevWeekData = function () {
|
3655 |
|
3656 | var date = new Date(this);
|
3657 | date.prevWeek();
|
3658 | return date.getWeekData();
|
3659 | };
|
3660 | window.Date.prototype.getNextWeekData = function () {
|
3661 |
|
3662 | var date = new Date(this);
|
3663 | date.nextWeek();
|
3664 | return date.getWeekData();
|
3665 | };
|
3666 |
|
3667 | window.Date.prototype.getPrevWeek = function (count) {
|
3668 |
|
3669 | if (count) {
|
3670 | var days = [];
|
3671 | var tempDate = new Date(this);
|
3672 | for (var i = 0; i < count; i++) {
|
3673 | tempDate.prevWeek();
|
3674 | var prevWeek = new Date(tempDate);
|
3675 | days.push(prevWeek);
|
3676 | }
|
3677 | return days;
|
3678 | }
|
3679 | var date = new Date(this);
|
3680 | date.prevDate();
|
3681 | return date;
|
3682 | };
|
3683 |
|
3684 |
|
3685 | window.Date.prototype.getPrevDate = function (count) {
|
3686 |
|
3687 | if (count) {
|
3688 | var dates = [];
|
3689 | var tempDate = new Date(this);
|
3690 | for (var i = 0; i < count; i++) {
|
3691 | tempDate.prevDate();
|
3692 | var prevDate = new Date(tempDate);
|
3693 | dates.push(prevDate);
|
3694 | }
|
3695 | return dates;
|
3696 | }
|
3697 | var date = new Date(this);
|
3698 | date.prevDate();
|
3699 | return date;
|
3700 | };
|
3701 |
|
3702 |
|
3703 | window.Date.parse = function (str, type) {
|
3704 | var date = new Date();
|
3705 | if (type === 'time') {
|
3706 | if (/^[0-9]{2}:[0-9]{2}$/.test(str)) {
|
3707 | date.setHours(str.split(':')[0], str.split(':')[1], 0);
|
3708 | }
|
3709 | return date;
|
3710 | }
|
3711 | if (type === 'date') {
|
3712 | if (/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/.test(str)) {
|
3713 | date.setYear(str.split('-')[0]);
|
3714 | date.setMonth(str.split('-')[1], str.split('-')[2]);
|
3715 | }
|
3716 | return date;
|
3717 | }
|
3718 | if (type === 'month') {
|
3719 | if (/^[0-9]{4}-[0-9]{2}$/.test(str)) {
|
3720 | date.setYear(str.split('-')[0]);
|
3721 | date.setMonth(str.split('-')[1]);
|
3722 | }
|
3723 | return date;
|
3724 | }
|
3725 | if (type === 'datetime') {
|
3726 | if (/^[0-9]{4}-[0-9]{2}-[0-9]{2}\s[0-9]{2}:[0-9]{2}$/.test(str)) {
|
3727 |
|
3728 | var strArr = str.split(' ');
|
3729 | var str1 = strArr[0];
|
3730 | var str2 = strArr[1];
|
3731 | date.setYear(str1.split('-')[0]);
|
3732 | date.setMonth(str1.split('-')[1], str1.split('-')[2]);
|
3733 | date.setHours(str2.split(':')[0], str2.split(':')[1], 0);
|
3734 | }
|
3735 | return date;
|
3736 | }
|
3737 | };
|
3738 |
|
3739 | }),
|
3740 |
|
3741 | (function(module, exports) {
|
3742 |
|
3743 |
|
3744 | var PinyinHelper = function () {
|
3745 | var pinyins = { 'a': '\u554A\u963F\u9515', 'ai': '\u57C3\u6328\u54CE\u5509\u54C0\u7691\u764C\u853C\u77EE\u827E\u788D\u7231\u9698\u8BF6\u6371\u55F3\u55CC\u5AD2\u7477\u66A7\u7839\u953F\u972D', 'an': '\u978D\u6C28\u5B89\u4FFA\u6309\u6697\u5CB8\u80FA\u6848\u8C19\u57EF\u63DE\u72B4\u5EB5\u6849\u94F5\u9E4C\u9878\u9EEF', 'ang': '\u80AE\u6602\u76CE', 'ao': '\u51F9\u6556\u71AC\u7FF1\u8884\u50B2\u5965\u61CA\u6FB3\u5773\u62D7\u55F7\u5662\u5C99\u5ED2\u9068\u5AAA\u9A9C\u8071\u87AF\u93CA\u9CCC\u93D6', 'ba': '\u82AD\u634C\u6252\u53ED\u5427\u7B06\u516B\u75A4\u5DF4\u62D4\u8DCB\u9776\u628A\u8019\u575D\u9738\u7F62\u7238\u8307\u83DD\u8406\u636D\u5C9C\u705E\u6777\u94AF\u7C91\u9C85\u9B43', 'bai': '\u767D\u67CF\u767E\u6446\u4F70\u8D25\u62DC\u7A17\u859C\u63B0\u97B4', 'ban': '\u6591\u73ED\u642C\u6273\u822C\u9881\u677F\u7248\u626E\u62CC\u4F34\u74E3\u534A\u529E\u7ECA\u962A\u5742\u8C73\u94A3\u7622\u764D\u8228', 'bang': '\u90A6\u5E2E\u6886\u699C\u8180\u7ED1\u68D2\u78C5\u868C\u9551\u508D\u8C24\u84A1\u8783', 'bao': '\u82DE\u80DE\u5305\u8912\u96F9\u4FDD\u5821\u9971\u5B9D\u62B1\u62A5\u66B4\u8C79\u9C8D\u7206\u52F9\u8446\u5B80\u5B62\u7172\u9E28\u8913\u8DB5\u9F85', 'bo': '\u5265\u8584\u73BB\u83E0\u64AD\u62E8\u94B5\u6CE2\u535A\u52C3\u640F\u94C2\u7B94\u4F2F\u5E1B\u8236\u8116\u818A\u6E24\u6CCA\u9A73\u4EB3\u8543\u5575\u997D\u6A97\u64D8\u7934\u94B9\u9E41\u7C38\u8DDB', 'bei': '\u676F\u7891\u60B2\u5351\u5317\u8F88\u80CC\u8D1D\u94A1\u500D\u72C8\u5907\u60EB\u7119\u88AB\u5B5B\u9642\u90B6\u57E4\u84D3\u5457\u602B\u6096\u789A\u9E4E\u8919\u943E', 'ben': '\u5954\u82EF\u672C\u7B28\u755A\u574C\u951B', 'beng': '\u5D29\u7EF7\u752D\u6CF5\u8E66\u8FF8\u552A\u5623\u750F', 'bi': '\u903C\u9F3B\u6BD4\u9119\u7B14\u5F7C\u78A7\u84D6\u853D\u6BD5\u6BD9\u6BD6\u5E01\u5E87\u75F9\u95ED\u655D\u5F0A\u5FC5\u8F9F\u58C1\u81C2\u907F\u965B\u5315\u4EF3\u4FFE\u8298\u835C\u8378\u5421\u54D4\u72F4\u5EB3\u610E\u6ED7\u6FDE\u5F3C\u59A3\u5A62\u5B16\u74A7\u8D32\u7540\u94CB\u79D5\u88E8\u7B5A\u7B85\u7BE6\u822D\u895E\u8DF8\u9AC0', 'bian': '\u97AD\u8FB9\u7F16\u8D2C\u6241\u4FBF\u53D8\u535E\u8FA8\u8FA9\u8FAB\u904D\u533E\u5F01\u82C4\u5FED\u6C74\u7F0F\u7178\u782D\u78A5\u7A39\u7A86\u8759\u7B3E\u9CCA', 'biao': '\u6807\u5F6A\u8198\u8868\u5A4A\u9AA0\u98D1\u98D9\u98DA\u706C\u9556\u9573\u762D\u88F1\u9CD4', 'bie': '\u9CD6\u618B\u522B\u762A\u8E69\u9CD8', 'bin': '\u5F6C\u658C\u6FD2\u6EE8\u5BBE\u6448\u50A7\u6D5C\u7F24\u73A2\u6BA1\u8191\u9554\u9ACC\u9B13', 'bing': '\u5175\u51B0\u67C4\u4E19\u79C9\u997C\u70B3\u75C5\u5E76\u7980\u90B4\u6452\u7EE0\u678B\u69DF\u71F9', 'bu': '\u6355\u535C\u54FA\u8865\u57E0\u4E0D\u5E03\u6B65\u7C3F\u90E8\u6016\u62CA\u535F\u900B\u74FF\u6661\u949A\u91AD', 'ca': '\u64E6\u5693\u7924', 'cai': '\u731C\u88C1\u6750\u624D\u8D22\u776C\u8E29\u91C7\u5F69\u83DC\u8521', 'can': '\u9910\u53C2\u8695\u6B8B\u60ED\u60E8\u707F\u9A96\u74A8\u7CB2\u9EEA', 'cang': '\u82CD\u8231\u4ED3\u6CA7\u85CF\u4F27', 'cao': '\u64CD\u7CD9\u69FD\u66F9\u8349\u8279\u5608\u6F15\u87AC\u825A', 'ce': '\u5395\u7B56\u4FA7\u518C\u6D4B\u5202\u5E3B\u607B', 'ceng': '\u5C42\u8E6D\u564C', 'cha': '\u63D2\u53C9\u832C\u8336\u67E5\u78B4\u643D\u5BDF\u5C94\u5DEE\u8BE7\u7339\u9987\u6C4A\u59F9\u6748\u6942\u69CE\u6AAB\u9497\u9538\u9572\u8869', 'chai': '\u62C6\u67F4\u8C7A\u4FAA\u8308\u7625\u867F\u9F87', 'chan': '\u6400\u63BA\u8749\u998B\u8C17\u7F20\u94F2\u4EA7\u9610\u98A4\u5181\u8C04\u8C36\u8487\u5EDB\u5FCF\u6F7A\u6FB6\u5B71\u7FBC\u5A75\u5B17\u9AA3\u89C7\u7985\u9561\u88E3\u87FE\u8E94', 'chang': '\u660C\u7316\u573A\u5C1D\u5E38\u957F\u507F\u80A0\u5382\u655E\u7545\u5531\u5021\u4F25\u9B2F\u82CC\u83D6\u5F9C\u6005\u60DD\u960A\u5A3C\u5AE6\u6636\u6C05\u9CB3', 'chao': '\u8D85\u6284\u949E\u671D\u5632\u6F6E\u5DE2\u5435\u7092\u600A\u7EC9\u6641\u8016', 'che': '\u8F66\u626F\u64A4\u63A3\u5F7B\u6F88\u577C\u5C6E\u7817', 'chen': '\u90F4\u81E3\u8FB0\u5C18\u6668\u5FF1\u6C89\u9648\u8D81\u886C\u79F0\u8C0C\u62BB\u55D4\u5BB8\u741B\u6987\u809C\u80C2\u789C\u9F80', 'cheng': '\u6491\u57CE\u6A59\u6210\u5448\u4E58\u7A0B\u60E9\u6F84\u8BDA\u627F\u901E\u9A8B\u79E4\u57D5\u5D4A\u5FB5\u6D48\u67A8\u67FD\u6A18\u665F\u584D\u77A0\u94D6\u88CE\u86CF\u9172', 'chi': '\u5403\u75F4\u6301\u5319\u6C60\u8FDF\u5F1B\u9A70\u803B\u9F7F\u4F88\u5C3A\u8D64\u7FC5\u65A5\u70BD\u50BA\u5880\u82AA\u830C\u640B\u53F1\u54E7\u557B\u55E4\u5F73\u996C\u6CB2\u5AB8\u6555\u80DD\u7719\u7735\u9E31\u761B\u892B\u86A9\u87AD\u7B1E\u7BEA\u8C49\u8E05\u8E1F\u9B51', 'chong': '\u5145\u51B2\u866B\u5D07\u5BA0\u833A\u5FE1\u61A7\u94F3\u825F', 'chou': '\u62BD\u916C\u7574\u8E0C\u7A20\u6101\u7B79\u4EC7\u7EF8\u7785\u4E11\u4FE6\u5733\u5E31\u60C6\u6EB4\u59AF\u7633\u96E0\u9C8B', 'chu': '\u81ED\u521D\u51FA\u6A71\u53A8\u8E87\u9504\u96CF\u6EC1\u9664\u695A\u7840\u50A8\u77D7\u6410\u89E6\u5904\u4E8D\u520D\u61B7\u7ECC\u6775\u696E\u6A17\u870D\u8E70\u9EDC', 'chuan': '\u63E3\u5DDD\u7A7F\u693D\u4F20\u8239\u5598\u4E32\u63BE\u821B\u60F4\u9044\u5DDB\u6C1A\u948F\u9569\u8221', 'chuang': '\u75AE\u7A97\u5E62\u5E8A\u95EF\u521B\u6006', 'chui': '\u5439\u708A\u6376\u9524\u5782\u9672\u68F0\u69CC', 'chun': '\u6625\u693F\u9187\u5507\u6DF3\u7EAF\u8822\u4FC3\u83BC\u6C8C\u80AB\u6710\u9E51\u877D', 'chuo': '\u6233\u7EF0\u851F\u8FB6\u8F8D\u955E\u8E14\u9F8A', 'ci': '\u75B5\u8328\u78C1\u96CC\u8F9E\u6148\u74F7\u8BCD\u6B64\u523A\u8D50\u6B21\u8360\u5472\u5D6F\u9E5A\u8785\u7CCD\u8D91', 'cong': '\u806A\u8471\u56F1\u5306\u4ECE\u4E1B\u506C\u82C1\u6DD9\u9AA2\u742E\u7481\u679E', 'cu': '\u51D1\u7C97\u918B\u7C07\u731D\u6B82\u8E59', 'cuan': '\u8E7F\u7BE1\u7A9C\u6C46\u64BA\u6615\u7228', 'cui': '\u6467\u5D14\u50AC\u8106\u7601\u7CB9\u6DEC\u7FE0\u8403\u60B4\u7480\u69B1\u96B9', 'cun': '\u6751\u5B58\u5BF8\u78CB\u5FD6\u76B4', 'cuo': '\u64AE\u6413\u63AA\u632B\u9519\u539D\u811E\u9509\u77EC\u75E4\u9E7E\u8E49\u8E9C', 'da': '\u642D\u8FBE\u7B54\u7629\u6253\u5927\u8037\u54D2\u55D2\u601B\u59B2\u75B8\u8921\u7B2A\u977C\u9791', 'dai': '\u5446\u6B79\u50A3\u6234\u5E26\u6B86\u4EE3\u8D37\u888B\u5F85\u902E\u6020\u57ED\u7519\u5454\u5CB1\u8FE8\u902F\u9A80\u7ED0\u73B3\u9EDB', 'dan': '\u803D\u62C5\u4E39\u5355\u90F8\u63B8\u80C6\u65E6\u6C2E\u4F46\u60EE\u6DE1\u8BDE\u5F39\u86CB\u4EBB\u510B\u5369\u840F\u5556\u6FB9\u6A90\u6B9A\u8D55\u7708\u7605\u8043\u7BAA', 'dang': '\u5F53\u6321\u515A\u8361\u6863\u8C20\u51FC\u83EA\u5B95\u7800\u94DB\u88C6', 'dao': '\u5200\u6363\u8E48\u5012\u5C9B\u7977\u5BFC\u5230\u7A3B\u60BC\u9053\u76D7\u53E8\u5541\u5FC9\u6D2E\u6C18\u7118\u5FD1\u7E9B', 'de': '\u5FB7\u5F97\u7684\u951D', 'deng': '\u8E6C\u706F\u767B\u7B49\u77AA\u51F3\u9093\u5654\u5D9D\u6225\u78F4\u956B\u7C26', 'di': '\u5824\u4F4E\u6EF4\u8FEA\u654C\u7B1B\u72C4\u6DA4\u7FDF\u5AE1\u62B5\u5E95\u5730\u8482\u7B2C\u5E1D\u5F1F\u9012\u7F14\u6C10\u7C74\u8BCB\u8C1B\u90B8\u577B\u839C\u837B\u5600\u5A23\u67E2\u68E3\u89CC\u7825\u78B2\u7747\u955D\u7F9D\u9AB6', 'dian': '\u98A0\u6382\u6EC7\u7898\u70B9\u5178\u975B\u57AB\u7535\u4F43\u7538\u5E97\u60E6\u5960\u6DC0\u6BBF\u4E36\u963D\u576B\u57DD\u5DC5\u73B7\u765C\u766B\u7C1F\u8E2E', 'diao': '\u7889\u53FC\u96D5\u51CB\u5201\u6389\u540A\u9493\u8C03\u8F7A\u94DE\u8729\u7C9C\u8C82', 'die': '\u8DCC\u7239\u789F\u8776\u8FED\u8C0D\u53E0\u4F5A\u57A4\u581E\u63F2\u558B\u6E2B\u8F76\u7252\u74DE\u8936\u800B\u8E40\u9CBD\u9CCE', 'ding': '\u4E01\u76EF\u53EE\u9489\u9876\u9F0E\u952D\u5B9A\u8BA2\u4E22\u4EC3\u5576\u738E\u815A\u7887\u753A\u94E4\u7594\u8035\u914A', 'dong': '\u4E1C\u51AC\u8463\u61C2\u52A8\u680B\u4F97\u606B\u51BB\u6D1E\u578C\u549A\u5CBD\u5CD2\u5902\u6C21\u80E8\u80F4\u7850\u9E2B', 'dou': '\u515C\u6296\u6597\u9661\u8C46\u9017\u75D8\u8538\u94AD\u7AA6\u7AAC\u86AA\u7BFC\u9161', 'du': '\u90FD\u7763\u6BD2\u728A\u72EC\u8BFB\u5835\u7779\u8D4C\u675C\u9540\u809A\u5EA6\u6E21\u5992\u828F\u561F\u6E0E\u691F\u6A50\u724D\u8839\u7B03\u9AD1\u9EE9', 'duan': '\u7AEF\u77ED\u953B\u6BB5\u65AD\u7F0E\u5F56\u6934\u7145\u7C16', 'dui': '\u5806\u5151\u961F\u5BF9\u603C\u619D\u7893', 'dun': '\u58A9\u5428\u8E72\u6566\u987F\u56E4\u949D\u76FE\u9041\u7096\u7818\u7905\u76F9\u9566\u8DB8', 'duo': '\u6387\u54C6\u591A\u593A\u579B\u8EB2\u6735\u8DFA\u8235\u5241\u60F0\u5815\u5484\u54DA\u7F0D\u67C1\u94CE\u88F0\u8E31', 'e': '\u86FE\u5CE8\u9E45\u4FC4\u989D\u8BB9\u5A25\u6076\u5384\u627C\u904F\u9102\u997F\u5669\u8C14\u57A9\u57AD\u82CA\u83AA\u843C\u5443\u6115\u5C59\u5A40\u8F6D\u66F7\u816D\u786A\u9507\u9537\u9E57\u989A\u9CC4', 'en': '\u6069\u84BD\u6441\u5514\u55EF', 'er': '\u800C\u513F\u8033\u5C14\u9975\u6D31\u4E8C\u8D30\u8FE9\u73E5\u94D2\u9E38\u9C95', 'fa': '\u53D1\u7F5A\u7B4F\u4F10\u4E4F\u9600\u6CD5\u73D0\u57A1\u781D', 'fan': '\u85E9\u5E06\u756A\u7FFB\u6A0A\u77FE\u9492\u7E41\u51E1\u70E6\u53CD\u8FD4\u8303\u8D29\u72AF\u996D\u6CDB\u8629\u5E61\u72AD\u68B5\u6535\u71D4\u7548\u8E6F', 'fang': '\u574A\u82B3\u65B9\u80AA\u623F\u9632\u59A8\u4EFF\u8BBF\u7EBA\u653E\u531A\u90A1\u5F77\u94AB\u822B\u9C82', 'fei': '\u83F2\u975E\u5561\u98DE\u80A5\u532A\u8BFD\u5420\u80BA\u5E9F\u6CB8\u8D39\u82BE\u72D2\u60B1\u6DDD\u5983\u7ECB\u7EEF\u69A7\u8153\u6590\u6249\u7953\u7829\u9544\u75F1\u871A\u7BDA\u7FE1\u970F\u9CB1', 'fen': '\u82AC\u915A\u5429\u6C1B\u5206\u7EB7\u575F\u711A\u6C7E\u7C89\u594B\u4EFD\u5FFF\u6124\u7CAA\u507E\u7035\u68FC\u610D\u9CBC\u9F22', 'feng': '\u4E30\u5C01\u67AB\u8702\u5CF0\u950B\u98CE\u75AF\u70FD\u9022\u51AF\u7F1D\u8BBD\u5949\u51E4\u4FF8\u9146\u8451\u6CA3\u781C', 'fu': '\u4F5B\u5426\u592B\u6577\u80A4\u5B75\u6276\u62C2\u8F90\u5E45\u6C1F\u7B26\u4F0F\u4FD8\u670D\u6D6E\u6DAA\u798F\u88B1\u5F17\u752B\u629A\u8F85\u4FEF\u91DC\u65A7\u812F\u8151\u5E9C\u8150\u8D74\u526F\u8986\u8D4B\u590D\u5085\u4ED8\u961C\u7236\u8179\u8D1F\u5BCC\u8BA3\u9644\u5987\u7F1A\u5490\u5310\u51EB\u90DB\u8299\u82FB\u832F\u83A9\u83D4\u544B\u5E5E\u6ECF\u8274\u5B5A\u9A78\u7EC2\u6874\u8D59\u9EFB\u9EFC\u7F58\u7A03\u99A5\u864D\u86A8\u8709\u8760\u876E\u9EB8\u8DBA\u8DD7\u9CC6', 'ga': '\u5676\u560E\u86E4\u5C2C\u5477\u5C15\u5C1C\u65EE\u9486', 'gai': '\u8BE5\u6539\u6982\u9499\u76D6\u6E89\u4E10\u9654\u5793\u6224\u8D45\u80F2', 'gan': '\u5E72\u7518\u6746\u67D1\u7AFF\u809D\u8D76\u611F\u79C6\u6562\u8D63\u5769\u82F7\u5C34\u64C0\u6CD4\u6DE6\u6F89\u7EC0\u6A44\u65F0\u77F8\u75B3\u9150', 'gang': '\u5188\u521A\u94A2\u7F38\u809B\u7EB2\u5C97\u6E2F\u6206\u7F61\u9883\u7B7B', 'gong': '\u6760\u5DE5\u653B\u529F\u606D\u9F9A\u4F9B\u8EAC\u516C\u5BAB\u5F13\u5DE9\u6C5E\u62F1\u8D21\u5171\u857B\u5EFE\u54A3\u73D9\u80B1\u86A3\u86E9\u89E5', 'gao': '\u7BD9\u768B\u9AD8\u818F\u7F94\u7CD5\u641E\u9550\u7A3F\u544A\u777E\u8BF0\u90DC\u84BF\u85C1\u7F1F\u69D4\u69C1\u6772\u9506', 'ge': '\u54E5\u6B4C\u6401\u6208\u9E3D\u80F3\u7599\u5272\u9769\u845B\u683C\u9601\u9694\u94EC\u4E2A\u5404\u9B32\u4EE1\u54FF\u5865\u55DD\u7EA5\u643F\u8188\u784C\u94EA\u9549\u88BC\u988C\u867C\u8238\u9ABC\u9AC2', 'gei': '\u7ED9', 'gen': '\u6839\u8DDF\u4E98\u831B\u54CF\u826E', 'geng': '\u8015\u66F4\u5E9A\u7FB9\u57C2\u803F\u6897\u54FD\u8D53\u9CA0', 'gou': '\u94A9\u52FE\u6C9F\u82DF\u72D7\u57A2\u6784\u8D2D\u591F\u4F5D\u8BDF\u5CA3\u9058\u5ABE\u7F11\u89CF\u5F40\u9E32\u7B31\u7BDD\u97B2', 'gu': '\u8F9C\u83C7\u5495\u7B8D\u4F30\u6CBD\u5B64\u59D1\u9F13\u53E4\u86CA\u9AA8\u8C37\u80A1\u6545\u987E\u56FA\u96C7\u560F\u8BC2\u83F0\u54CC\u5D2E\u6C69\u688F\u8F71\u726F\u727F\u80CD\u81CC\u6BC2\u77BD\u7F5F\u94B4\u9522\u74E0\u9E2A\u9E44\u75FC\u86C4\u9164\u89DA\u9CB4\u9AB0\u9E58', 'gua': '\u522E\u74DC\u5250\u5BE1\u6302\u8902\u5366\u8BD6\u5471\u681D\u9E39', 'guai': '\u4E56\u62D0\u602A\u54D9', 'guan': '\u68FA\u5173\u5B98\u51A0\u89C2\u7BA1\u9986\u7F50\u60EF\u704C\u8D2F\u500C\u839E\u63BC\u6DAB\u76E5\u9E73\u9CCF', 'guang': '\u5149\u5E7F\u901B\u72B7\u6844\u80F1\u7592', 'gui': '\u7470\u89C4\u572D\u7845\u5F52\u9F9F\u95FA\u8F68\u9B3C\u8BE1\u7678\u6842\u67DC\u8DEA\u8D35\u523D\u5326\u523F\u5E8B\u5B84\u59AB\u6867\u7085\u6677\u7688\u7C0B\u9C91\u9CDC', 'gun': '\u8F8A\u6EDA\u68CD\u4E28\u886E\u7EF2\u78D9\u9CA7', 'guo': '\u9505\u90ED\u56FD\u679C\u88F9\u8FC7\u9998\u8803\u57DA\u63B4\u5459\u56D7\u5E3C\u5D1E\u7313\u6901\u8662\u951E\u8052\u872E\u873E\u8748', 'ha': '\u54C8', 'hai': '\u9AB8\u5B69\u6D77\u6C26\u4EA5\u5BB3\u9A87\u54B4\u55E8\u988F\u91A2', 'han': '\u9163\u61A8\u90AF\u97E9\u542B\u6DB5\u5BD2\u51FD\u558A\u7F55\u7FF0\u64BC\u634D\u65F1\u61BE\u608D\u710A\u6C57\u6C49\u9097\u83E1\u6496\u961A\u701A\u6657\u7113\u9894\u86B6\u9F3E', 'hen': '\u592F\u75D5\u5F88\u72E0\u6068', 'hang': '\u676D\u822A\u6C86\u7ED7\u73E9\u6841', 'hao': '\u58D5\u568E\u8C6A\u6BEB\u90DD\u597D\u8017\u53F7\u6D69\u8585\u55E5\u5686\u6FE0\u704F\u660A\u7693\u98A2\u869D', 'he': '\u5475\u559D\u8377\u83CF\u6838\u79BE\u548C\u4F55\u5408\u76D2\u8C89\u9602\u6CB3\u6DB8\u8D6B\u8910\u9E64\u8D3A\u8BC3\u52BE\u58D1\u85FF\u55D1\u55EC\u9616\u76CD\u86B5\u7FEE', 'hei': '\u563F\u9ED1', 'heng': '\u54FC\u4EA8\u6A2A\u8861\u6052\u8A07\u8605', 'hong': '\u8F70\u54C4\u70D8\u8679\u9E3F\u6D2A\u5B8F\u5F18\u7EA2\u9EC9\u8BA7\u836D\u85A8\u95F3\u6CD3', 'hou': '\u5589\u4FAF\u7334\u543C\u539A\u5019\u540E\u5820\u5F8C\u9005\u760A\u7BCC\u7CC7\u9C8E\u9ABA', 'hu': '\u547C\u4E4E\u5FFD\u745A\u58F6\u846B\u80E1\u8774\u72D0\u7CCA\u6E56\u5F27\u864E\u552C\u62A4\u4E92\u6CAA\u6237\u51B1\u553F\u56EB\u5CB5\u7322\u6019\u60DA\u6D52\u6EF9\u7425\u69F2\u8F77\u89F3\u70C0\u7173\u623D\u6248\u795C\u9E55\u9E71\u7B0F\u9190\u659B', 'hua': '\u82B1\u54D7\u534E\u733E\u6ED1\u753B\u5212\u5316\u8BDD\u5290\u6D4D\u9A85\u6866\u94E7\u7A1E', 'huai': '\u69D0\u5F8A\u6000\u6DEE\u574F\u8FD8\u8E1D', 'huan': '\u6B22\u73AF\u6853\u7F13\u6362\u60A3\u5524\u75EA\u8C62\u7115\u6DA3\u5BA6\u5E7B\u90C7\u5942\u57B8\u64D0\u571C\u6D39\u6D63\u6F36\u5BF0\u902D\u7F33\u953E\u9CA9\u9B1F', 'huang': '\u8352\u614C\u9EC4\u78FA\u8757\u7C27\u7687\u51F0\u60F6\u714C\u6643\u5E4C\u604D\u8C0E\u968D\u5FA8\u6E5F\u6F62\u9051\u749C\u8093\u7640\u87E5\u7BC1\u9CC7', 'hui': '\u7070\u6325\u8F89\u5FBD\u6062\u86D4\u56DE\u6BC1\u6094\u6167\u5349\u60E0\u6666\u8D3F\u79FD\u4F1A\u70E9\u6C47\u8BB3\u8BF2\u7ED8\u8BD9\u8334\u835F\u8559\u54D5\u5599\u96B3\u6D04\u5F57\u7F0B\u73F2\u6656\u605A\u867A\u87EA\u9EBE', 'hun': '\u8364\u660F\u5A5A\u9B42\u6D51\u6DF7\u8BE8\u9984\u960D\u6EB7\u7F17', 'huo': '\u8C41\u6D3B\u4F19\u706B\u83B7\u6216\u60D1\u970D\u8D27\u7978\u6509\u56AF\u5925\u94AC\u952A\u956C\u8020\u8816', 'ji': '\u51FB\u573E\u57FA\u673A\u7578\u7A3D\u79EF\u7B95\u808C\u9965\u8FF9\u6FC0\u8BA5\u9E21\u59EC\u7EE9\u7F09\u5409\u6781\u68D8\u8F91\u7C4D\u96C6\u53CA\u6025\u75BE\u6C72\u5373\u5AC9\u7EA7\u6324\u51E0\u810A\u5DF1\u84DF\u6280\u5180\u5B63\u4F0E\u796D\u5242\u60B8\u6D4E\u5BC4\u5BC2\u8BA1\u8BB0\u65E2\u5FCC\u9645\u5993\u7EE7\u7EAA\u5C45\u4E0C\u4E69\u525E\u4F76\u4F74\u8114\u58BC\u82A8\u82B0\u8401\u84BA\u857A\u638E\u53FD\u54AD\u54DC\u5527\u5C8C\u5D74\u6D0E\u5F50\u5C50\u9AA5\u757F\u7391\u696B\u6B9B\u621F\u6222\u8D4D\u89CA\u7284\u9F51\u77F6\u7F81\u5D47\u7A37\u7620\u7635\u866E\u7B08\u7B04\u66A8\u8DFB\u8DFD\u9701\u9C9A\u9CAB\u9AFB\u9E82', 'jia': '\u5609\u67B7\u5939\u4F73\u5BB6\u52A0\u835A\u988A\u8D3E\u7532\u94BE\u5047\u7A3C\u4EF7\u67B6\u9A7E\u5AC1\u4F3D\u90CF\u62EE\u5CAC\u6D43\u8FE6\u73C8\u621B\u80DB\u605D\u94D7\u9553\u75C2\u86F1\u7B33\u8888\u8DCF', 'jian': '\u6B7C\u76D1\u575A\u5C16\u7B3A\u95F4\u714E\u517C\u80A9\u8270\u5978\u7F04\u8327\u68C0\u67EC\u78B1\u7877\u62E3\u6361\u7B80\u4FED\u526A\u51CF\u8350\u69DB\u9274\u8DF5\u8D31\u89C1\u952E\u7BAD\u4EF6\u5065\u8230\u5251\u996F\u6E10\u6E85\u6DA7\u5EFA\u50ED\u8C0F\u8C2B\u83C5\u84B9\u641B\u56DD\u6E54\u8E47\u8B07\u7F23\u67A7\u67D9\u6957\u620B\u622C\u726E\u728D\u6BFD\u8171\u7751\u950F\u9E63\u88E5\u7B15\u7BB4\u7FE6\u8DBC\u8E3A\u9CA3\u97AF', 'jiang': '\u50F5\u59DC\u5C06\u6D46\u6C5F\u7586\u848B\u6868\u5956\u8BB2\u5320\u9171\u964D\u8333\u6D1A\u7EDB\u7F30\u729F\u7913\u8029\u7CE8\u8C47', 'jiao': '\u8549\u6912\u7901\u7126\u80F6\u4EA4\u90CA\u6D47\u9A84\u5A07\u56BC\u6405\u94F0\u77EB\u4FA5\u811A\u72E1\u89D2\u997A\u7F34\u7EDE\u527F\u6559\u9175\u8F7F\u8F83\u53EB\u4F7C\u50EC\u832D\u6322\u564D\u5CE4\u5FBC\u59E3\u7E9F\u656B\u768E\u9E6A\u86DF\u91AE\u8DE4\u9C9B', 'jie': '\u7A96\u63ED\u63A5\u7686\u79F8\u8857\u9636\u622A\u52AB\u8282\u6854\u6770\u6377\u776B\u7AED\u6D01\u7ED3\u89E3\u59D0\u6212\u85C9\u82A5\u754C\u501F\u4ECB\u75A5\u8BEB\u5C4A\u5048\u8BA6\u8BD8\u5588\u55DF\u736C\u5A55\u5B51\u6840\u7352\u78A3\u9534\u7596\u88B7\u9889\u86A7\u7FAF\u9C92\u9AB1\u9AEB', 'jin': '\u5DFE\u7B4B\u65A4\u91D1\u4ECA\u6D25\u895F\u7D27\u9526\u4EC5\u8C28\u8FDB\u9773\u664B\u7981\u8FD1\u70EC\u6D78\u5C3D\u537A\u8369\u5807\u5664\u9991\u5ED1\u5997\u7F19\u747E\u69FF\u8D46\u89D0\u9485\u9513\u887F\u77DC', 'jing': '\u52B2\u8346\u5162\u830E\u775B\u6676\u9CB8\u4EAC\u60CA\u7CBE\u7CB3\u7ECF\u4E95\u8B66\u666F\u9888\u9759\u5883\u656C\u955C\u5F84\u75C9\u9756\u7ADF\u7ADE\u51C0\u522D\u5106\u9631\u83C1\u734D\u61AC\u6CFE\u8FF3\u5F2A\u5A67\u80BC\u80EB\u8148\u65CC', 'jiong': '\u70AF\u7A98\u5182\u8FE5\u6243', 'jiu': '\u63EA\u7A76\u7EA0\u7396\u97ED\u4E45\u7078\u4E5D\u9152\u53A9\u6551\u65E7\u81FC\u8205\u548E\u5C31\u759A\u50E6\u557E\u9604\u67E9\u6855\u9E6B\u8D73\u9B0F', 'ju': '\u97A0\u62D8\u72D9\u75BD\u9A79\u83CA\u5C40\u5480\u77E9\u4E3E\u6CAE\u805A\u62D2\u636E\u5DE8\u5177\u8DDD\u8E1E\u952F\u4FF1\u53E5\u60E7\u70AC\u5267\u5028\u8BB5\u82E3\u82F4\u8392\u63AC\u907D\u5C66\u741A\u67B8\u6910\u6998\u6989\u6A58\u728B\u98D3\u949C\u9514\u7AAD\u88FE\u8D84\u91B5\u8E3D\u9F83\u96CE\u97AB', 'juan': '\u6350\u9E43\u5A1F\u5026\u7737\u5377\u7EE2\u9104\u72F7\u6D93\u684A\u8832\u9529\u954C\u96BD', 'jue': '\u6485\u652B\u6289\u6398\u5014\u7235\u89C9\u51B3\u8BC0\u7EDD\u53A5\u5282\u8C32\u77CD\u8568\u5658\u5D1B\u7357\u5B53\u73CF\u6877\u6A5B\u721D\u9562\u8E76\u89D6', 'jun': '\u5747\u83CC\u94A7\u519B\u541B\u5CFB\u4FCA\u7AE3\u6D5A\u90E1\u9A8F\u6343\u72FB\u76B2\u7B60\u9E87', 'ka': '\u5580\u5496\u5361\u4F67\u5494\u80E9', 'ke': '\u54AF\u5777\u82DB\u67EF\u68F5\u78D5\u9897\u79D1\u58F3\u54B3\u53EF\u6E34\u514B\u523B\u5BA2\u8BFE\u5CA2\u606A\u6E98\u9A92\u7F02\u73C2\u8F72\u6C2A\u778C\u94B6\u75B4\u7AA0\u874C\u9AC1', 'kai': '\u5F00\u63E9\u6977\u51EF\u6168\u5240\u57B2\u8488\u5FFE\u607A\u94E0\u950E', 'kan': '\u520A\u582A\u52D8\u574E\u780D\u770B\u4F83\u51F5\u83B0\u83B6\u6221\u9F9B\u77B0', 'kang': '\u5EB7\u6177\u7CE0\u625B\u6297\u4EA2\u7095\u5751\u4F09\u95F6\u94AA', 'kao': '\u8003\u62F7\u70E4\u9760\u5C3B\u6832\u7292\u94D0', 'ken': '\u80AF\u5543\u57A6\u6073\u57A0\u88C9\u9880', 'keng': '\u542D\u5FD0\u94FF', 'kong': '\u7A7A\u6050\u5B54\u63A7\u5025\u5D06\u7B9C', 'kou': '\u62A0\u53E3\u6263\u5BC7\u82A4\u853B\u53E9\u770D\u7B58', 'ku': '\u67AF\u54ED\u7A9F\u82E6\u9177\u5E93\u88E4\u5233\u5800\u55BE\u7ED4\u9AB7', 'kua': '\u5938\u57AE\u630E\u8DE8\u80EF\u4F89', 'kuai': '\u5757\u7B77\u4FA9\u5FEB\u84AF\u90D0\u8489\u72EF\u810D', 'kuan': '\u5BBD\u6B3E\u9ACB', 'kuang': '\u5321\u7B50\u72C2\u6846\u77FF\u7736\u65F7\u51B5\u8BD3\u8BF3\u909D\u5739\u593C\u54D0\u7EA9\u8D36', 'kui': '\u4E8F\u76D4\u5CBF\u7AA5\u8475\u594E\u9B41\u5080\u9988\u6127\u6E83\u9997\u532E\u5914\u9697\u63C6\u55B9\u559F\u609D\u6126\u9615\u9035\u668C\u777D\u8069\u8770\u7BD1\u81FE\u8DEC', 'kun': '\u5764\u6606\u6346\u56F0\u6083\u9603\u7428\u951F\u918C\u9CB2\u9AE1', 'kuo': '\u62EC\u6269\u5ED3\u9614\u86DE', 'la': '\u5783\u62C9\u5587\u8721\u814A\u8FA3\u5566\u524C\u647A\u908B\u65EF\u782C\u760C', 'lai': '\u83B1\u6765\u8D56\u5D03\u5F95\u6D9E\u6FD1\u8D49\u7750\u94FC\u765E\u7C41', 'lan': '\u84DD\u5A6A\u680F\u62E6\u7BEE\u9611\u5170\u6F9C\u8C30\u63FD\u89C8\u61D2\u7F06\u70C2\u6EE5\u5549\u5C9A\u61D4\u6F24\u6984\u6593\u7F71\u9567\u8934', 'lang': '\u7405\u6994\u72FC\u5ECA\u90CE\u6717\u6D6A\u83A8\u8497\u5577\u9606\u9512\u7A02\u8782', 'lao': '\u635E\u52B3\u7262\u8001\u4F6C\u59E5\u916A\u70D9\u6D9D\u5520\u5D02\u6833\u94D1\u94F9\u75E8\u91AA', 'le': '\u52D2\u4E50\u808B\u4EC2\u53FB\u561E\u6CD0\u9CD3', 'lei': '\u96F7\u956D\u857E\u78CA\u7D2F\u5121\u5792\u64C2\u7C7B\u6CEA\u7FB8\u8BD4\u837D\u54A7\u6F2F\u5AD8\u7F27\u6A91\u8012\u9179', 'ling': '\u68F1\u51B7\u62CE\u73B2\u83F1\u96F6\u9F84\u94C3\u4F36\u7F9A\u51CC\u7075\u9675\u5CAD\u9886\u53E6\u4EE4\u9143\u5844\u82D3\u5464\u56F9\u6CE0\u7EEB\u67C3\u68C2\u74F4\u8046\u86C9\u7FCE\u9CAE', 'leng': '\u695E\u6123', 'li': '\u5398\u68A8\u7281\u9ECE\u7BF1\u72F8\u79BB\u6F13\u7406\u674E\u91CC\u9CA4\u793C\u8389\u8354\u540F\u6817\u4E3D\u5389\u52B1\u783E\u5386\u5229\u5088\u4F8B\u4FD0\u75E2\u7ACB\u7C92\u6CA5\u96B6\u529B\u7483\u54E9\u4FEA\u4FDA\u90E6\u575C\u82C8\u8385\u84E0\u85DC\u6369\u5456\u5533\u55B1\u7301\u6EA7\u6FA7\u9026\u5A0C\u5AE0\u9A8A\u7F21\u73DE\u67A5\u680E\u8F79\u623E\u783A\u8A48\u7F79\u9502\u9E42\u75A0\u75AC\u86CE\u870A\u8821\u7B20\u7BE5\u7C9D\u91B4\u8DDE\u96F3\u9CA1\u9CE2\u9EE7', 'lian': '\u4FE9\u8054\u83B2\u8FDE\u9570\u5EC9\u601C\u6D9F\u5E18\u655B\u8138\u94FE\u604B\u70BC\u7EC3\u631B\u8539\u5941\u6F4B\u6FC2\u5A08\u740F\u695D\u6B93\u81C1\u81A6\u88E2\u880A\u9CA2', 'liang': '\u7CAE\u51C9\u6881\u7CB1\u826F\u4E24\u8F86\u91CF\u667E\u4EAE\u8C05\u589A\u690B\u8E09\u9753\u9B49', 'liao': '\u64A9\u804A\u50DA\u7597\u71CE\u5BE5\u8FBD\u6F66\u4E86\u6482\u9563\u5ED6\u6599\u84FC\u5C25\u5639\u7360\u5BEE\u7F2D\u948C\u9E69\u8022', 'lie': '\u5217\u88C2\u70C8\u52A3\u730E\u51BD\u57D2\u6D0C\u8D94\u8E90\u9B23', 'lin': '\u7433\u6797\u78F7\u9716\u4E34\u90BB\u9CDE\u6DCB\u51DB\u8D41\u541D\u853A\u5D99\u5EEA\u9074\u6AA9\u8F9A\u77B5\u7CBC\u8E8F\u9E9F', 'liu': '\u6E9C\u7409\u69B4\u786B\u998F\u7559\u5218\u7624\u6D41\u67F3\u516D\u62A1\u507B\u848C\u6CD6\u6D4F\u905B\u9A9D\u7EFA\u65D2\u7198\u950D\u954F\u9E68\u938F', 'long': '\u9F99\u804B\u5499\u7B3C\u7ABF\u9686\u5784\u62E2\u9647\u5F04\u5785\u830F\u6CF7\u73D1\u680A\u80E7\u783B\u7643', 'lou': '\u697C\u5A04\u6402\u7BD3\u6F0F\u964B\u55BD\u5D5D\u9542\u7618\u8027\u877C\u9AC5', 'lu': '\u82A6\u5362\u9885\u5E90\u7089\u63B3\u5364\u864F\u9C81\u9E93\u788C\u9732\u8DEF\u8D42\u9E7F\u6F5E\u7984\u5F55\u9646\u622E\u5786\u6445\u64B8\u565C\u6CF8\u6E0C\u6F09\u7490\u680C\u6A79\u8F73\u8F82\u8F98\u6C07\u80EA\u9565\u9E2C\u9E6D\u7C0F\u823B\u9C88', 'lv': '\u9A74\u5415\u94DD\u4FA3\u65C5\u5C65\u5C61\u7F15\u8651\u6C2F\u5F8B\u7387\u6EE4\u7EFF\u634B\u95FE\u6988\u8182\u7A06\u891B', 'luan': '\u5CE6\u5B6A\u6EE6\u5375\u4E71\u683E\u9E3E\u92AE', 'lue': '\u63A0\u7565\u950A', 'lun': '\u8F6E\u4F26\u4ED1\u6CA6\u7EB6\u8BBA\u56F5', 'luo': '\u841D\u87BA\u7F57\u903B\u9523\u7BA9\u9AA1\u88F8\u843D\u6D1B\u9A86\u7EDC\u502E\u8366\u645E\u7321\u6CFA\u6924\u8136\u9559\u7630\u96D2', 'ma': '\u5988\u9EBB\u739B\u7801\u8682\u9A6C\u9A82\u561B\u5417\u551B\u72B8\u5B37\u6769\u9EBD', 'mai': '\u57CB\u4E70\u9EA6\u5356\u8FC8\u8109\u52A2\u836C\u54AA\u973E', 'man': '\u7792\u9992\u86EE\u6EE1\u8513\u66FC\u6162\u6F2B\u8C29\u5881\u5E54\u7F26\u71B3\u9558\u989F\u87A8\u9CD7\u9794', 'mang': '\u8292\u832B\u76F2\u5FD9\u83BD\u9099\u6F2D\u6726\u786D\u87D2', 'meng': '\u6C13\u840C\u8499\u6AAC\u76DF\u9530\u731B\u68A6\u5B5F\u52D0\u750D\u77A2\u61F5\u791E\u867B\u8722\u8813\u824B\u8268\u9EFE', 'miao': '\u732B\u82D7\u63CF\u7784\u85D0\u79D2\u6E3A\u5E99\u5999\u55B5\u9088\u7F08\u7F2A\u676A\u6DFC\u7707\u9E4B\u8731', 'mao': '\u8305\u951A\u6BDB\u77DB\u94C6\u536F\u8302\u5192\u5E3D\u8C8C\u8D38\u4F94\u88A4\u52D6\u8306\u5CC1\u7441\u6634\u7266\u8004\u65C4\u61CB\u7780\u86D1\u8765\u87CA\u9AE6', 'me': '\u4E48', 'mei': '\u73AB\u679A\u6885\u9176\u9709\u7164\u6CA1\u7709\u5A92\u9541\u6BCF\u7F8E\u6627\u5BD0\u59B9\u5A9A\u5776\u8393\u5D4B\u7338\u6D7C\u6E44\u6963\u9545\u9E5B\u8882\u9B45', 'men': '\u95E8\u95F7\u4EEC\u626A\u739F\u7116\u61D1\u9494', 'mi': '\u772F\u919A\u9761\u7CDC\u8FF7\u8C1C\u5F25\u7C73\u79D8\u89C5\u6CCC\u871C\u5BC6\u5E42\u8288\u5196\u8C27\u863C\u5627\u7315\u736F\u6C68\u5B93\u5F2D\u8112\u6549\u7CF8\u7E3B\u9E8B', 'mian': '\u68C9\u7720\u7EF5\u5195\u514D\u52C9\u5A29\u7F05\u9762\u6C94\u6E4E\u817C\u7704', 'mie': '\u8511\u706D\u54A9\u881B\u7BFE', 'min': '\u6C11\u62BF\u76BF\u654F\u60AF\u95FD\u82E0\u5CB7\u95F5\u6CEF\u73C9', 'ming': '\u660E\u879F\u9E23\u94ED\u540D\u547D\u51A5\u8317\u6E9F\u669D\u7791\u9169', 'miu': '\u8C2C', 'mo': '\u6478\u6479\u8611\u6A21\u819C\u78E8\u6469\u9B54\u62B9\u672B\u83AB\u58A8\u9ED8\u6CAB\u6F20\u5BDE\u964C\u8C1F\u8309\u84E6\u998D\u5AEB\u9546\u79E3\u763C\u8031\u87C6\u8C8A\u8C98', 'mou': '\u8C0B\u725F\u67D0\u53B6\u54DE\u5A7A\u7738\u936A', 'mu': '\u62C7\u7261\u4EA9\u59C6\u6BCD\u5893\u66AE\u5E55\u52DF\u6155\u6728\u76EE\u7766\u7267\u7A46\u4EEB\u82DC\u5452\u6C90\u6BEA\u94BC', 'na': '\u62FF\u54EA\u5450\u94A0\u90A3\u5A1C\u7EB3\u5185\u637A\u80AD\u954E\u8872\u7BAC', 'nai': '\u6C16\u4E43\u5976\u8010\u5948\u9F10\u827F\u8418\u67F0', 'nan': '\u5357\u7537\u96BE\u56CA\u5583\u56E1\u6960\u8169\u877B\u8D67', 'nao': '\u6320\u8111\u607C\u95F9\u5B6C\u57B4\u7331\u7459\u7847\u94D9\u86F2', 'ne': '\u6DD6\u5462\u8BB7', 'nei': '\u9981', 'nen': '\u5AE9\u80FD\u6798\u6041', 'ni': '\u59AE\u9713\u502A\u6CE5\u5C3C\u62DF\u4F60\u533F\u817B\u9006\u6EBA\u4F32\u576D\u730A\u6029\u6EE0\u6635\u65CE\u7962\u615D\u7768\u94CC\u9CB5', 'nian': '\u852B\u62C8\u5E74\u78BE\u64B5\u637B\u5FF5\u5EFF\u8F87\u9ECF\u9C87\u9CB6', 'niang': '\u5A18\u917F', 'niao': '\u9E1F\u5C3F\u8311\u5B32\u8132\u8885', 'nie': '\u634F\u8042\u5B7D\u556E\u954A\u954D\u6D85\u4E5C\u9667\u8616\u55EB\u8080\u989E\u81EC\u8E51', 'nin': '\u60A8\u67E0', 'ning': '\u72DE\u51DD\u5B81\u62E7\u6CDE\u4F5E\u84E5\u549B\u752F\u804D', 'niu': '\u725B\u626D\u94AE\u7EBD\u72C3\u5FF8\u599E\u86B4', 'nong': '\u8113\u6D53\u519C\u4FAC', 'nu': '\u5974\u52AA\u6012\u5476\u5E11\u5F29\u80EC\u5B65\u9A7D', 'nv': '\u5973\u6067\u9495\u8844', 'nuan': '\u6696', 'nuenue': '\u8650', 'nue': '\u759F\u8C11', 'nuo': '\u632A\u61E6\u7CEF\u8BFA\u50A9\u6426\u558F\u9518', 'ou': '\u54E6\u6B27\u9E25\u6BB4\u85D5\u5455\u5076\u6CA4\u6004\u74EF\u8026', 'pa': '\u556A\u8DB4\u722C\u5E15\u6015\u7436\u8469\u7B62', 'pai': '\u62CD\u6392\u724C\u5F98\u6E43\u6D3E\u4FF3\u848E', 'pan': '\u6500\u6F58\u76D8\u78D0\u76FC\u7554\u5224\u53DB\u723F\u6CEE\u88A2\u897B\u87E0\u8E52', 'pang': '\u4E53\u5E9E\u65C1\u802A\u80D6\u6EC2\u9004', 'pao': '\u629B\u5486\u5228\u70AE\u888D\u8DD1\u6CE1\u530F\u72CD\u5E96\u812C\u75B1', 'pei': '\u5478\u80DA\u57F9\u88F4\u8D54\u966A\u914D\u4F69\u6C9B\u638A\u8F94\u5E14\u6DE0\u65C6\u952B\u9185\u9708', 'pen': '\u55B7\u76C6\u6E53', 'peng': '\u7830\u62A8\u70F9\u6F8E\u5F6D\u84EC\u68DA\u787C\u7BF7\u81A8\u670B\u9E4F\u6367\u78B0\u576F\u580B\u562D\u6026\u87DB', 'pi': '\u7812\u9739\u6279\u62AB\u5288\u7435\u6BD7\u5564\u813E\u75B2\u76AE\u5339\u75DE\u50FB\u5C41\u8B6C\u4E15\u9674\u90B3\u90EB\u572E\u9F19\u64D7\u567C\u5E80\u5AB2\u7EB0\u6787\u7513\u7765\u7F74\u94CD\u75E6\u7656\u758B\u868D\u8C94', 'pian': '\u7BC7\u504F\u7247\u9A97\u8C1D\u9A88\u728F\u80FC\u890A\u7FE9\u8E41', 'piao': '\u98D8\u6F02\u74E2\u7968\u527D\u560C\u5AD6\u7F25\u6B8D\u779F\u87B5', 'pie': '\u6487\u77A5\u4E3F\u82E4\u6C15', 'pin': '\u62FC\u9891\u8D2B\u54C1\u8058\u62DA\u59D8\u5AD4\u6980\u725D\u98A6', 'ping': '\u4E52\u576A\u82F9\u840D\u5E73\u51ED\u74F6\u8BC4\u5C4F\u4FDC\u5A09\u67B0\u9C86', 'po': '\u5761\u6CFC\u9887\u5A46\u7834\u9B44\u8FEB\u7C95\u53F5\u9131\u6EA5\u73C0\u948B\u94B7\u76A4\u7B38', 'pou': '\u5256\u88D2\u8E23', 'pu': '\u6251\u94FA\u4EC6\u8386\u8461\u83E9\u84B2\u57D4\u6734\u5703\u666E\u6D66\u8C31\u66DD\u7011\u530D\u5657\u6FEE\u749E\u6C06\u9564\u9568\u8E7C', 'qi': '\u671F\u6B3A\u6816\u621A\u59BB\u4E03\u51C4\u6F06\u67D2\u6C8F\u5176\u68CB\u5947\u6B67\u7566\u5D0E\u8110\u9F50\u65D7\u7948\u7941\u9A91\u8D77\u5C82\u4E5E\u4F01\u542F\u5951\u780C\u5668\u6C14\u8FC4\u5F03\u6C7D\u6CE3\u8BAB\u4E9F\u4E93\u573B\u8291\u840B\u847A\u5601\u5C7A\u5C90\u6C54\u6DC7\u9A90\u7EEE\u742A\u7426\u675E\u6864\u69ED\u6B39\u797A\u61A9\u789B\u86F4\u871E\u7DA6\u7DAE\u8DBF\u8E4A\u9CCD\u9E92', 'qia': '\u6390\u6070\u6D3D\u845C', 'qian': '\u7275\u6266\u948E\u94C5\u5343\u8FC1\u7B7E\u4EDF\u8C26\u4E7E\u9ED4\u94B1\u94B3\u524D\u6F5C\u9063\u6D45\u8C34\u5811\u5D4C\u6B20\u6B49\u4F65\u9621\u828A\u82A1\u8368\u63AE\u5C8D\u60AD\u614A\u9A9E\u6434\u8930\u7F31\u6920\u80B7\u6106\u94A4\u8654\u7B9D', 'qiang': '\u67AA\u545B\u8154\u7F8C\u5899\u8537\u5F3A\u62A2\u5AF1\u6A2F\u6217\u709D\u9516\u9535\u956A\u8941\u8723\u7F9F\u8DEB\u8DC4', 'qiao': '\u6A47\u9539\u6572\u6084\u6865\u77A7\u4E54\u4FA8\u5DE7\u9798\u64AC\u7FD8\u5CED\u4FCF\u7A8D\u5281\u8BEE\u8C2F\u835E\u6100\u6194\u7F32\u6A35\u6BF3\u7857\u8DF7\u9792', 'qie': '\u5207\u8304\u4E14\u602F\u7A83\u90C4\u553C\u60EC\u59BE\u6308\u9532\u7BA7', 'qin': '\u94A6\u4FB5\u4EB2\u79E6\u7434\u52E4\u82B9\u64D2\u79BD\u5BDD\u6C81\u82A9\u84C1\u8572\u63FF\u5423\u55EA\u5659\u6EB1\u6A8E\u8793\u887E', 'qing': '\u9752\u8F7B\u6C22\u503E\u537F\u6E05\u64CE\u6674\u6C30\u60C5\u9877\u8BF7\u5E86\u5029\u82D8\u570A\u6AA0\u78EC\u873B\u7F44\u7B90\u8B26\u9CAD\u9EE5', 'qiong': '\u743C\u7A77\u909B\u8315\u7A79\u7B47\u928E', 'qiu': '\u79CB\u4E18\u90B1\u7403\u6C42\u56DA\u914B\u6CC5\u4FC5\u6C3D\u5DEF\u827D\u72B0\u6E6B\u9011\u9052\u6978\u8D47\u9E20\u866C\u86AF\u8764\u88D8\u7CD7\u9CC5\u9F3D', 'qu': '\u8D8B\u533A\u86C6\u66F2\u8EAF\u5C48\u9A71\u6E20\u53D6\u5A36\u9F8B\u8DA3\u53BB\u8BCE\u52AC\u8556\u8627\u5C96\u8862\u9612\u74A9\u89D1\u6C0D\u795B\u78F2\u766F\u86D0\u883C\u9EB4\u77BF\u9EE2', 'quan': '\u5708\u98A7\u6743\u919B\u6CC9\u5168\u75CA\u62F3\u72AC\u5238\u529D\u8BE0\u8343\u737E\u609B\u7EFB\u8F81\u754E\u94E8\u8737\u7B4C\u9B08', 'que': '\u7F3A\u7094\u7638\u5374\u9E4A\u69B7\u786E\u96C0\u9619\u60AB', 'qun': '\u88D9\u7FA4\u9021', 'ran': '\u7136\u71C3\u5189\u67D3\u82D2\u9AEF', 'rang': '\u74E4\u58E4\u6518\u56B7\u8BA9\u79B3\u7A70', 'rao': '\u9976\u6270\u7ED5\u835B\u5A06\u6861', 'ruo': '\u60F9\u82E5\u5F31', 're': '\u70ED\u504C', 'ren': '\u58EC\u4EC1\u4EBA\u5FCD\u97E7\u4EFB\u8BA4\u5203\u598A\u7EAB\u4EDE\u834F\u845A\u996A\u8F6B\u7A14\u887D', 'reng': '\u6254\u4ECD', 'ri': '\u65E5', 'rong': '\u620E\u8338\u84C9\u8363\u878D\u7194\u6EB6\u5BB9\u7ED2\u5197\u5D58\u72E8\u7F1B\u6995\u877E', 'rou': '\u63C9\u67D4\u8089\u7CC5\u8E42\u97A3', 'ru': '\u8339\u8815\u5112\u5B7A\u5982\u8FB1\u4E73\u6C5D\u5165\u8925\u84D0\u85B7\u5685\u6D33\u6EBD\u6FE1\u94F7\u8966\u98A5', 'ruan': '\u8F6F\u962E\u670A', 'rui': '\u854A\u745E\u9510\u82AE\u8564\u777F\u868B', 'run': '\u95F0\u6DA6', 'sa': '\u6492\u6D12\u8428\u5345\u4EE8\u6332\u98D2', 'sai': '\u816E\u9CC3\u585E\u8D5B\u567B', 'san': '\u4E09\u53C1\u4F1E\u6563\u5F61\u9993\u6C35\u6BF5\u7CC1\u9730', 'sang': '\u6851\u55D3\u4E27\u6421\u78C9\u98A1', 'sao': '\u6414\u9A9A\u626B\u5AC2\u57FD\u81CA\u7619\u9CCB', 'se': '\u745F\u8272\u6DA9\u556C\u94E9\u94EF\u7A51', 'sen': '\u68EE', 'seng': '\u50E7', 'sha': '\u838E\u7802\u6740\u5239\u6C99\u7EB1\u50BB\u5565\u715E\u810E\u6B43\u75E7\u88DF\u970E\u9CA8', 'shai': '\u7B5B\u6652\u917E', 'shan': '\u73CA\u82EB\u6749\u5C71\u5220\u717D\u886B\u95EA\u9655\u64C5\u8D61\u81B3\u5584\u6C55\u6247\u7F2E\u5261\u8BAA\u912F\u57CF\u829F\u6F78\u59D7\u9A9F\u81BB\u9490\u759D\u87EE\u8222\u8DDA\u9CDD', 'shang': '\u5892\u4F24\u5546\u8D4F\u664C\u4E0A\u5C1A\u88F3\u57A7\u7EF1\u6B87\u71B5\u89DE', 'shao': '\u68A2\u634E\u7A0D\u70E7\u828D\u52FA\u97F6\u5C11\u54E8\u90B5\u7ECD\u52AD\u82D5\u6F72\u86F8\u7B24\u7B72\u8244', 'she': '\u5962\u8D4A\u86C7\u820C\u820D\u8D66\u6444\u5C04\u6151\u6D89\u793E\u8BBE\u538D\u4F58\u731E\u7572\u9E9D', 'shen': '\u7837\u7533\u547B\u4F38\u8EAB\u6DF1\u5A20\u7EC5\u795E\u6C88\u5BA1\u5A76\u751A\u80BE\u614E\u6E17\u8BDC\u8C02\u5432\u54C2\u6E16\u6939\u77E7\u8703', 'sheng': '\u58F0\u751F\u7525\u7272\u5347\u7EF3\u7701\u76DB\u5269\u80DC\u5723\u4E1E\u6E11\u5AB5\u771A\u7B19', 'shi': '\u5E08\u5931\u72EE\u65BD\u6E7F\u8BD7\u5C38\u8671\u5341\u77F3\u62FE\u65F6\u4EC0\u98DF\u8680\u5B9E\u8BC6\u53F2\u77E2\u4F7F\u5C4E\u9A76\u59CB\u5F0F\u793A\u58EB\u4E16\u67FF\u4E8B\u62ED\u8A93\u901D\u52BF\u662F\u55DC\u566C\u9002\u4ED5\u4F8D\u91CA\u9970\u6C0F\u5E02\u6043\u5BA4\u89C6\u8BD5\u8C25\u57D8\u83B3\u84CD\u5F11\u5511\u9963\u8F7C\u8006\u8D33\u70BB\u793B\u94C8\u94CA\u87AB\u8210\u7B6E\u8C55\u9CA5\u9CBA', 'shou': '\u6536\u624B\u9996\u5B88\u5BFF\u6388\u552E\u53D7\u7626\u517D\u624C\u72E9\u7EF6\u824F', 'shu': '\u852C\u67A2\u68B3\u6B8A\u6292\u8F93\u53D4\u8212\u6DD1\u758F\u4E66\u8D4E\u5B70\u719F\u85AF\u6691\u66D9\u7F72\u8700\u9ECD\u9F20\u5C5E\u672F\u8FF0\u6811\u675F\u620D\u7AD6\u5885\u5EB6\u6570\u6F31\u6055\u500F\u587E\u83FD\u5FC4\u6CAD\u6D91\u6F8D\u59DD\u7EBE\u6BF9\u8167\u6BB3\u956F\u79EB\u9E6C', 'shua': '\u5237\u800D\u5530\u6DAE', 'shuai': '\u6454\u8870\u7529\u5E05\u87C0', 'shuan': '\u6813\u62F4\u95E9', 'shuang': '\u971C\u53CC\u723D\u5B40', 'shui': '\u8C01\u6C34\u7761\u7A0E', 'shun': '\u542E\u77AC\u987A\u821C\u6042', 'shuo': '\u8BF4\u7855\u6714\u70C1\u84B4\u6420\u55CD\u6FEF\u5981\u69CA\u94C4', 'si': '\u65AF\u6495\u5636\u601D\u79C1\u53F8\u4E1D\u6B7B\u8086\u5BFA\u55E3\u56DB\u4F3A\u4F3C\u9972\u5DF3\u53AE\u4FDF\u5155\u83E5\u549D\u6C5C\u6CD7\u6F8C\u59D2\u9A77\u7F0C\u7940\u7960\u9536\u9E36\u801C\u86F3\u7B25', 'song': '\u677E\u8038\u6002\u9882\u9001\u5B8B\u8BBC\u8BF5\u51C7\u83D8\u5D27\u5D69\u5FEA\u609A\u6DDE\u7AE6', 'sou': '\u641C\u8258\u64DE\u55FD\u53DF\u55D6\u55FE\u998A\u6EB2\u98D5\u778D\u953C\u878B', 'su': '\u82CF\u9165\u4FD7\u7D20\u901F\u7C9F\u50F3\u5851\u6EAF\u5BBF\u8BC9\u8083\u5919\u8C21\u850C\u55C9\u612B\u7C0C\u89EB\u7A23', 'suan': '\u9178\u849C\u7B97', 'sui': '\u867D\u968B\u968F\u7EE5\u9AD3\u788E\u5C81\u7A57\u9042\u96A7\u795F\u84D1\u51AB\u8C07\u6FC9\u9083\u71E7\u772D\u7762', 'sun': '\u5B59\u635F\u7B0B\u836A\u72F2\u98E7\u69AB\u8DE3\u96BC', 'suo': '\u68AD\u5506\u7F29\u7410\u7D22\u9501\u6240\u5522\u55E6\u5A11\u686B\u7743\u7FA7', 'ta': '\u584C\u4ED6\u5B83\u5979\u5854\u736D\u631E\u8E4B\u8E0F\u95FC\u6EBB\u9062\u69BB\u6C93', 'tai': '\u80CE\u82D4\u62AC\u53F0\u6CF0\u915E\u592A\u6001\u6C70\u90B0\u85B9\u80BD\u70B1\u949B\u8DC6\u9C90', 'tan': '\u574D\u644A\u8D2A\u762B\u6EE9\u575B\u6A80\u75F0\u6F6D\u8C2D\u8C08\u5766\u6BEF\u8892\u78B3\u63A2\u53F9\u70AD\u90EF\u8548\u6619\u94BD\u952C\u8983', 'tang': '\u6C64\u5858\u642A\u5802\u68E0\u819B\u5510\u7CD6\u50A5\u9967\u6E8F\u746D\u94F4\u9557\u8025\u8797\u87B3\u7FB0\u91A3', 'thang': '\u5018\u8EBA\u6DCC', 'theng': '\u8D9F\u70EB', 'tao': '\u638F\u6D9B\u6ED4\u7EE6\u8404\u6843\u9003\u6DD8\u9676\u8BA8\u5957\u6311\u9F17\u5555\u97EC\u9955', 'te': '\u7279', 'teng': '\u85E4\u817E\u75BC\u8A8A\u6ED5', 'ti': '\u68AF\u5254\u8E22\u9511\u63D0\u9898\u8E44\u557C\u4F53\u66FF\u568F\u60D5\u6D95\u5243\u5C49\u8351\u608C\u9016\u7EE8\u7F07\u9E48\u88FC\u918D', 'tian': '\u5929\u6DFB\u586B\u7530\u751C\u606C\u8214\u8146\u63AD\u5FDD\u9617\u6B84\u754B\u94BF\u86BA', 'tiao': '\u6761\u8FE2\u773A\u8DF3\u4F7B\u7967\u94EB\u7A95\u9F86\u9CA6', 'tie': '\u8D34\u94C1\u5E16\u841C\u992E', 'ting': '\u5385\u542C\u70C3\u6C40\u5EF7\u505C\u4EAD\u5EAD\u633A\u8247\u839B\u8476\u5A77\u6883\u8713\u9706', 'tong': '\u901A\u6850\u916E\u77B3\u540C\u94DC\u5F64\u7AE5\u6876\u6345\u7B52\u7EDF\u75DB\u4F5F\u50EE\u4EDD\u833C\u55F5\u6078\u6F7C\u783C', 'tou': '\u5077\u6295\u5934\u900F\u4EA0', 'tu': '\u51F8\u79C3\u7A81\u56FE\u5F92\u9014\u6D82\u5C60\u571F\u5410\u5154\u580D\u837C\u83DF\u948D\u9174', 'tuan': '\u6E4D\u56E2\u7583', 'tui': '\u63A8\u9893\u817F\u8715\u892A\u9000\u5FD2\u717A', 'tun': '\u541E\u5C6F\u81C0\u9968\u66BE\u8C5A\u7A80', 'tuo': '\u62D6\u6258\u8131\u9E35\u9640\u9A6E\u9A7C\u692D\u59A5\u62D3\u553E\u4E47\u4F57\u5768\u5EB9\u6CB1\u67DD\u7823\u7BA8\u8204\u8DCE\u9F0D', 'wa': '\u6316\u54C7\u86D9\u6D3C\u5A03\u74E6\u889C\u4F64\u5A32\u817D', 'wai': '\u6B6A\u5916', 'wan': '\u8C4C\u5F2F\u6E7E\u73A9\u987D\u4E38\u70F7\u5B8C\u7897\u633D\u665A\u7696\u60CB\u5B9B\u5A49\u4E07\u8155\u525C\u8284\u82CB\u83C0\u7EA8\u7EFE\u742C\u8118\u7579\u873F\u7BA2', 'wang': '\u6C6A\u738B\u4EA1\u6789\u7F51\u5F80\u65FA\u671B\u5FD8\u5984\u7F54\u5C22\u60D8\u8F8B\u9B4D', 'wei': '\u5A01\u5DCD\u5FAE\u5371\u97E6\u8FDD\u6845\u56F4\u552F\u60DF\u4E3A\u6F4D\u7EF4\u82C7\u840E\u59D4\u4F1F\u4F2A\u5C3E\u7EAC\u672A\u851A\u5473\u754F\u80C3\u5582\u9B4F\u4F4D\u6E2D\u8C13\u5C09\u6170\u536B\u502D\u504E\u8BFF\u9688\u8473\u8587\u5E0F\u5E37\u5D34\u5D6C\u7325\u732C\u95F1\u6CA9\u6D27\u6DA0\u9036\u5A13\u73AE\u97EA\u8ECE\u709C\u7168\u71A8\u75FF\u8249\u9C94', 'wen': '\u761F\u6E29\u868A\u6587\u95FB\u7EB9\u543B\u7A33\u7D0A\u95EE\u520E\u6120\u960C\u6C76\u74BA\u97EB\u6B81\u96EF', 'weng': '\u55E1\u7FC1\u74EE\u84CA\u8579', 'wo': '\u631D\u8717\u6DA1\u7A9D\u6211\u65A1\u5367\u63E1\u6C83\u83B4\u5E44\u6E25\u674C\u809F\u9F8C', 'wu': '\u5DEB\u545C\u94A8\u4E4C\u6C61\u8BEC\u5C4B\u65E0\u829C\u68A7\u543E\u5434\u6BCB\u6B66\u4E94\u6342\u5348\u821E\u4F0D\u4FAE\u575E\u620A\u96FE\u6664\u7269\u52FF\u52A1\u609F\u8BEF\u5140\u4EF5\u9622\u90AC\u572C\u82B4\u5E91\u6003\u5FE4\u6D6F\u5BE4\u8FD5\u59A9\u9A9B\u727E\u7110\u9E49\u9E5C\u8708\u92C8\u9F2F', 'xi': '\u6614\u7199\u6790\u897F\u7852\u77FD\u6670\u563B\u5438\u9521\u727A\u7A00\u606F\u5E0C\u6089\u819D\u5915\u60DC\u7184\u70EF\u6EAA\u6C50\u7280\u6A84\u88AD\u5E2D\u4E60\u5AB3\u559C\u94E3\u6D17\u7CFB\u9699\u620F\u7EC6\u50D6\u516E\u96B0\u90D7\u831C\u8478\u84F0\u595A\u550F\u5F99\u9969\u960B\u6D60\u6DC5\u5C63\u5B09\u73BA\u6A28\u66E6\u89CB\u6B37\u71B9\u798A\u79A7\u94B8\u7699\u7A78\u8725\u87CB\u823E\u7FB2\u7C9E\u7FD5\u91AF\u9F37', 'xia': '\u778E\u867E\u5323\u971E\u8F96\u6687\u5CE1\u4FA0\u72ED\u4E0B\u53A6\u590F\u5413\u6380\u846D\u55C4\u72CE\u9050\u7455\u7856\u7615\u7F45\u9EE0', 'xian': '\u9528\u5148\u4ED9\u9C9C\u7EA4\u54B8\u8D24\u8854\u8237\u95F2\u6D8E\u5F26\u5ACC\u663E\u9669\u73B0\u732E\u53BF\u817A\u9985\u7FA1\u5BAA\u9677\u9650\u7EBF\u51BC\u85D3\u5C98\u7303\u66B9\u5A34\u6C19\u7946\u9E47\u75EB\u86AC\u7B45\u7C7C\u9170\u8DF9', 'xiang': '\u76F8\u53A2\u9576\u9999\u7BB1\u8944\u6E58\u4E61\u7FD4\u7965\u8BE6\u60F3\u54CD\u4EAB\u9879\u5DF7\u6A61\u50CF\u5411\u8C61\u8297\u8459\u9977\u5EA0\u9AA7\u7F03\u87D3\u9C9E\u98E8', 'xiao': '\u8427\u785D\u9704\u524A\u54EE\u56A3\u9500\u6D88\u5BB5\u6DC6\u6653\u5C0F\u5B5D\u6821\u8096\u5578\u7B11\u6548\u54D3\u54BB\u5D24\u6F47\u900D\u9A81\u7EE1\u67AD\u67B5\u7B71\u7BAB\u9B48', 'xie': '\u6954\u4E9B\u6B47\u874E\u978B\u534F\u631F\u643A\u90AA\u659C\u80C1\u8C10\u5199\u68B0\u5378\u87F9\u61C8\u6CC4\u6CFB\u8C22\u5C51\u5055\u4EB5\u52F0\u71EE\u85A4\u64B7\u5EE8\u7023\u9082\u7EC1\u7F2C\u69AD\u698D\u6B59\u8E9E', 'xin': '\u85AA\u82AF\u950C\u6B23\u8F9B\u65B0\u5FFB\u5FC3\u4FE1\u8845\u56DF\u99A8\u8398\u6B46\u94FD\u946B', 'xing': '\u661F\u8165\u7329\u60FA\u5174\u5211\u578B\u5F62\u90A2\u884C\u9192\u5E78\u674F\u6027\u59D3\u9649\u8347\u8365\u64E4\u60BB\u784E', 'xiong': '\u5144\u51F6\u80F8\u5308\u6C79\u96C4\u718A\u828E', 'xiu': '\u4F11\u4FEE\u7F9E\u673D\u55C5\u9508\u79C0\u8896\u7EE3\u83A0\u5CAB\u9990\u5EA5\u9E3A\u8C85\u9AF9', 'xu': '\u589F\u620C\u9700\u865A\u5618\u987B\u5F90\u8BB8\u84C4\u9157\u53D9\u65ED\u5E8F\u755C\u6064\u7D6E\u5A7F\u7EEA\u7EED\u8BB4\u8BE9\u5729\u84FF\u6035\u6D2B\u6E86\u987C\u6829\u7166\u7809\u76F1\u80E5\u7CC8\u9191', 'xuan': '\u8F69\u55A7\u5BA3\u60AC\u65CB\u7384\u9009\u7663\u7729\u7EDA\u5107\u8C16\u8431\u63CE\u9994\u6CEB\u6D35\u6E32\u6F29\u7487\u6966\u6684\u70AB\u714A\u78B9\u94C9\u955F\u75C3', 'xue': '\u9774\u859B\u5B66\u7A74\u96EA\u8840\u5671\u6CF6\u9CD5', 'xun': '\u52CB\u718F\u5FAA\u65EC\u8BE2\u5BFB\u9A6F\u5DE1\u6B89\u6C5B\u8BAD\u8BAF\u900A\u8FC5\u5DFD\u57D9\u8340\u85B0\u5CCB\u5F87\u6D54\u66DB\u7AA8\u91BA\u9C9F', 'ya': '\u538B\u62BC\u9E26\u9E2D\u5440\u4E2B\u82BD\u7259\u869C\u5D16\u8859\u6DAF\u96C5\u54D1\u4E9A\u8BB6\u4F22\u63E0\u5416\u5C88\u8FD3\u5A05\u740A\u6860\u6C29\u7811\u775A\u75D6', 'yan': '\u7109\u54BD\u9609\u70DF\u6DF9\u76D0\u4E25\u7814\u8712\u5CA9\u5EF6\u8A00\u989C\u960E\u708E\u6CBF\u5944\u63A9\u773C\u884D\u6F14\u8273\u5830\u71D5\u538C\u781A\u96C1\u5501\u5F66\u7130\u5BB4\u8C1A\u9A8C\u53A3\u9765\u8D5D\u4FE8\u5043\u5156\u8BA0\u8C33\u90FE\u9122\u82AB\u83F8\u5D26\u6079\u95EB\u960F\u6D07\u6E6E\u6EDF\u598D\u5AE3\u7430\u664F\u80ED\u814C\u7131\u7F68\u7B75\u917D\u9B47\u990D\u9F39', 'yang': '\u6B83\u592E\u9E2F\u79E7\u6768\u626C\u4F6F\u75A1\u7F8A\u6D0B\u9633\u6C27\u4EF0\u75D2\u517B\u6837\u6F3E\u5F89\u600F\u6CF1\u7080\u70CA\u6059\u86D8\u9785', 'yao': '\u9080\u8170\u5996\u7476\u6447\u5C27\u9065\u7A91\u8C23\u59DA\u54AC\u8200\u836F\u8981\u8000\u592D\u723B\u5406\u5D3E\u5FAD\u7039\u5E7A\u73E7\u6773\u66DC\u80B4\u9E5E\u7A88\u7E47\u9CD0', 'ye': '\u6930\u564E\u8036\u7237\u91CE\u51B6\u4E5F\u9875\u6396\u4E1A\u53F6\u66F3\u814B\u591C\u6DB2\u8C12\u90BA\u63F6\u9980\u6654\u70E8\u94D8', 'yi': '\u4E00\u58F9\u533B\u63D6\u94F1\u4F9D\u4F0A\u8863\u9890\u5937\u9057\u79FB\u4EEA\u80F0\u7591\u6C82\u5B9C\u59E8\u5F5D\u6905\u8681\u501A\u5DF2\u4E59\u77E3\u4EE5\u827A\u6291\u6613\u9091\u5C79\u4EBF\u5F79\u81C6\u9038\u8084\u75AB\u4EA6\u88D4\u610F\u6BC5\u5FC6\u4E49\u76CA\u6EA2\u8BE3\u8BAE\u8C0A\u8BD1\u5F02\u7FFC\u7FCC\u7ECE\u5208\u5293\u4F7E\u8BD2\u572A\u572F\u57F8\u61FF\u82E1\u858F\u5F08\u5955\u6339\u5F0B\u5453\u54A6\u54BF\u566B\u5CC4\u5DB7\u7317\u9974\u603F\u6021\u6092\u6F2A\u8FE4\u9A7F\u7F22\u6BAA\u8D3B\u65D6\u71A0\u9487\u9552\u9571\u75CD\u7617\u7654\u7FCA\u8864\u8734\u8223\u7FBF\u7FF3\u914F\u9EDF', 'yin': '\u8335\u836B\u56E0\u6BB7\u97F3\u9634\u59FB\u541F\u94F6\u6DEB\u5BC5\u996E\u5C39\u5F15\u9690\u5370\u80E4\u911E\u5819\u831A\u5591\u72FA\u5924\u6C24\u94DF\u763E\u8693\u972A\u9F88', 'ying': '\u82F1\u6A31\u5A74\u9E70\u5E94\u7F28\u83B9\u8424\u8425\u8367\u8747\u8FCE\u8D62\u76C8\u5F71\u9896\u786C\u6620\u5B34\u90E2\u8314\u83BA\u8426\u6484\u5624\u81BA\u6EE2\u6F46\u701B\u745B\u748E\u6979\u9E66\u763F\u988D\u7F42', 'yo': '\u54DF\u5537', 'yong': '\u62E5\u4F63\u81C3\u75C8\u5EB8\u96CD\u8E0A\u86F9\u548F\u6CF3\u6D8C\u6C38\u607F\u52C7\u7528\u4FD1\u58C5\u5889\u6175\u9095\u955B\u752C\u9CD9\u9954', 'you': '\u5E7D\u4F18\u60A0\u5FE7\u5C24\u7531\u90AE\u94C0\u72B9\u6CB9\u6E38\u9149\u6709\u53CB\u53F3\u4F51\u91C9\u8BF1\u53C8\u5E7C\u5363\u6538\u4F91\u83B8\u5466\u56FF\u5BA5\u67DA\u7337\u7256\u94D5\u75A3\u8763\u9C7F\u9EDD\u9F2C', 'yu': '\u8FC2\u6DE4\u4E8E\u76C2\u6986\u865E\u611A\u8206\u4F59\u4FDE\u903E\u9C7C\u6109\u6E1D\u6E14\u9685\u4E88\u5A31\u96E8\u4E0E\u5C7F\u79B9\u5B87\u8BED\u7FBD\u7389\u57DF\u828B\u90C1\u5401\u9047\u55BB\u5CEA\u5FA1\u6108\u6B32\u72F1\u80B2\u8A89\u6D74\u5BD3\u88D5\u9884\u8C6B\u9A6D\u79BA\u6BD3\u4F1B\u4FE3\u8C00\u8C15\u8438\u84E3\u63C4\u5581\u5704\u5709\u5D5B\u72F3\u996B\u5EBE\u9608\u59AA\u59A4\u7EA1\u745C\u6631\u89CE\u8174\u6B24\u65BC\u715C\u71E0\u807F\u94B0\u9E46\u7610\u7600\u7AB3\u8753\u7AFD\u8201\u96E9\u9F89', 'yuan': '\u9E33\u6E0A\u51A4\u5143\u57A3\u8881\u539F\u63F4\u8F95\u56ED\u5458\u5706\u733F\u6E90\u7F18\u8FDC\u82D1\u613F\u6028\u9662\u586C\u6C85\u5A9B\u7457\u6A7C\u7230\u7722\u9E22\u8788\u9F0B', 'yue': '\u66F0\u7EA6\u8D8A\u8DC3\u94A5\u5CB3\u7CA4\u6708\u60A6\u9605\u9FA0\u6A3E\u5216\u94BA', 'yun': '\u8018\u4E91\u90E7\u5300\u9668\u5141\u8FD0\u8574\u915D\u6655\u97F5\u5B55\u90D3\u82B8\u72C1\u607D\u7EAD\u6B92\u6600\u6C32', 'za': '\u531D\u7838\u6742\u62F6\u5482', 'zai': '\u683D\u54C9\u707E\u5BB0\u8F7D\u518D\u5728\u54B1\u5D3D\u753E', 'zan': '\u6512\u6682\u8D5E\u74D2\u661D\u7C2A\u7CCC\u8DB1\u933E', 'zang': '\u8D43\u810F\u846C\u5958\u6215\u81E7', 'zao': '\u906D\u7CDF\u51FF\u85FB\u67A3\u65E9\u6FA1\u86A4\u8E81\u566A\u9020\u7682\u7076\u71E5\u5523\u7F2B', 'ze': '\u8D23\u62E9\u5219\u6CFD\u4EC4\u8D5C\u5567\u8FEE\u6603\u7B2E\u7BA6\u8234', 'zei': '\u8D3C', 'zen': '\u600E\u8C2E', 'zeng': '\u589E\u618E\u66FE\u8D60\u7F2F\u7511\u7F7E\u9503', 'zha': '\u624E\u55B3\u6E23\u672D\u8F67\u94E1\u95F8\u7728\u6805\u69A8\u548B\u4E4D\u70B8\u8BC8\u63F8\u5412\u54A4\u54F3\u600D\u781F\u75C4\u86B1\u9F44', 'zhai': '\u6458\u658B\u5B85\u7A84\u503A\u5BE8\u7826', 'zhan': '\u77BB\u6BE1\u8A79\u7C98\u6CBE\u76CF\u65A9\u8F97\u5D2D\u5C55\u8638\u6808\u5360\u6218\u7AD9\u6E5B\u7EFD\u8C35\u640C\u65C3', 'zhang': '\u6A1F\u7AE0\u5F70\u6F33\u5F20\u638C\u6DA8\u6756\u4E08\u5E10\u8D26\u4ED7\u80C0\u7634\u969C\u4EC9\u9123\u5E5B\u5D82\u7350\u5ADC\u748B\u87D1', 'zhao': '\u62DB\u662D\u627E\u6CBC\u8D75\u7167\u7F69\u5146\u8087\u53EC\u722A\u8BCF\u68F9\u948A\u7B0A', 'zhe': '\u906E\u6298\u54F2\u86F0\u8F99\u8005\u9517\u8517\u8FD9\u6D59\u8C2A\u966C\u67D8\u8F84\u78D4\u9E67\u891A\u8707\u8D6D', 'zhen': '\u73CD\u659F\u771F\u7504\u7827\u81FB\u8D1E\u9488\u4FA6\u6795\u75B9\u8BCA\u9707\u632F\u9547\u9635\u7F1C\u6862\u699B\u8F78\u8D48\u80D7\u6715\u796F\u755B\u9E29', 'zheng': '\u84B8\u6323\u7741\u5F81\u72F0\u4E89\u6014\u6574\u62EF\u6B63\u653F\u5E27\u75C7\u90D1\u8BC1\u8BE4\u5CE5\u94B2\u94EE\u7B5D', 'zhi': '\u829D\u679D\u652F\u5431\u8718\u77E5\u80A2\u8102\u6C41\u4E4B\u7EC7\u804C\u76F4\u690D\u6B96\u6267\u503C\u4F84\u5740\u6307\u6B62\u8DBE\u53EA\u65E8\u7EB8\u5FD7\u631A\u63B7\u81F3\u81F4\u7F6E\u5E1C\u5CD9\u5236\u667A\u79E9\u7A1A\u8D28\u7099\u75D4\u6EDE\u6CBB\u7A92\u536E\u965F\u90C5\u57F4\u82B7\u646D\u5E19\u5FEE\u5F58\u54AB\u9A98\u6809\u67B3\u6800\u684E\u8F75\u8F7E\u6534\u8D3D\u81A3\u7949\u7957\u9EF9\u96C9\u9E37\u75E3\u86ED\u7D77\u916F\u8DD6\u8E2C\u8E2F\u8C78\u89EF', 'zhong': '\u4E2D\u76C5\u5FE0\u949F\u8877\u7EC8\u79CD\u80BF\u91CD\u4EF2\u4F17\u51A2\u953A\u87BD\u8202\u822F\u8E35', 'zhou': '\u821F\u5468\u5DDE\u6D32\u8BCC\u7CA5\u8F74\u8098\u5E1A\u5492\u76B1\u5B99\u663C\u9AA4\u5544\u7740\u501C\u8BF9\u836E\u9B3B\u7EA3\u80C4\u78A1\u7C40\u8233\u914E\u9CB7', 'zhu': '\u73E0\u682A\u86DB\u6731\u732A\u8BF8\u8BDB\u9010\u7AF9\u70DB\u716E\u62C4\u77A9\u5631\u4E3B\u8457\u67F1\u52A9\u86C0\u8D2E\u94F8\u7B51\u4F4F\u6CE8\u795D\u9A7B\u4F2B\u4F8F\u90BE\u82CE\u8331\u6D19\u6E1A\u6F74\u9A7A\u677C\u69E0\u6A65\u70B7\u94E2\u75B0\u7603\u86B0\u7AFA\u7BB8\u7FE5\u8E85\u9E88', 'zhua': '\u6293', 'zhuai': '\u62FD', 'zhuan': '\u4E13\u7816\u8F6C\u64B0\u8D5A\u7BC6\u629F\u556D\u989B', 'zhuang': '\u6869\u5E84\u88C5\u5986\u649E\u58EE\u72B6\u4E2C', 'zhui': '\u690E\u9525\u8FFD\u8D58\u5760\u7F00\u8411\u9A93\u7F12', 'zhun': '\u8C06\u51C6', 'zhuo': '\u6349\u62D9\u5353\u684C\u7422\u8301\u914C\u707C\u6D4A\u502C\u8BFC\u5EF4\u855E\u64E2\u555C\u6D5E\u6DBF\u6753\u712F\u799A\u65AB', 'zi': '\u5179\u54A8\u8D44\u59FF\u6ECB\u6DC4\u5B5C\u7D2B\u4ED4\u7C7D\u6ED3\u5B50\u81EA\u6E0D\u5B57\u8C18\u5D6B\u59CA\u5B73\u7F01\u6893\u8F8E\u8D40\u6063\u7726\u9531\u79ED\u8014\u7B2B\u7CA2\u89DC\u8A3E\u9CBB\u9AED', 'zong': '\u9B03\u68D5\u8E2A\u5B97\u7EFC\u603B\u7EB5\u8159\u7CBD', 'zou': '\u90B9\u8D70\u594F\u63CD\u9139\u9CB0', 'zu': '\u79DF\u8DB3\u5352\u65CF\u7956\u8BC5\u963B\u7EC4\u4FCE\u83F9\u5550\u5F82\u9A75\u8E74', 'zuan': '\u94BB\u7E82\u6525\u7F35', 'zui': '\u5634\u9189\u6700\u7F6A', 'zun': '\u5C0A\u9075\u6499\u6A3D\u9CDF', 'zuo': '\u6628\u5DE6\u4F50\u67DE\u505A\u4F5C\u5750\u5EA7\u961D\u963C\u80D9\u795A\u9162', 'cou': '\u85AE\u6971\u8F8F\u8160', 'nang': '\u652E\u54DD\u56D4\u9995\u66E9', 'o': '\u5594', 'dia': '\u55F2', 'chuai': '\u562C\u81AA\u8E39', 'cen': '\u5C91\u6D94', 'diu': '\u94E5', 'nou': '\u8028', 'fou': '\u7F36', 'bia': '\u9ADF' };
|
3746 | function getPinyin(ch) {
|
3747 | for (var pinyin in pinyins) {
|
3748 | if (pinyins[pinyin].indexOf(ch) !== -1) {
|
3749 | return pinyin;
|
3750 | }
|
3751 | }
|
3752 | }
|
3753 | return {
|
3754 | toPinyin: function toPinyin(chs) {
|
3755 | var result;
|
3756 | var pinyin = chs;
|
3757 | var chExpr = /[\u4E00-\u9FA5]/gm;
|
3758 | while ((result = chExpr.exec(chs)) != null) {
|
3759 | var ch = result[0];
|
3760 | var charPinyin = getPinyin(ch);
|
3761 | pinyin = pinyin.replace(result[0], charPinyin);
|
3762 | }
|
3763 | return pinyin;
|
3764 | },
|
3765 | toCapitalize: function toCapitalize(word) {
|
3766 | if (word.length > 0) {
|
3767 | var wordFirst = word.substr(0, 1).toUpperCase();
|
3768 | var wordExtra = word.substr(1, word.length);
|
3769 | return wordFirst + wordExtra;
|
3770 | }
|
3771 | },
|
3772 | colors: {
|
3773 | 'a': '#52c7fe',
|
3774 | 'b': '#52c7fe',
|
3775 | 'c': '#52c7fe',
|
3776 | 'd': '#52c7fe',
|
3777 | 'e': '#52c7fe',
|
3778 | 'f': '#ffaf01',
|
3779 | 'g': '#ffaf01',
|
3780 | 'h': '#ffaf01',
|
3781 | 'i': '#ffaf01',
|
3782 | 'j': '#ffaf01',
|
3783 | 'k': '#3ae3eb',
|
3784 | 'l': '#3ae3eb',
|
3785 | 'm': '#3ae3eb',
|
3786 | 'n': '#3ae3eb',
|
3787 | 'o': '#3ae3eb',
|
3788 | 'p': '#ff6e36',
|
3789 | 'q': '#ff6e36',
|
3790 | 'r': '#ff6e36',
|
3791 | 's': '#ff6e36',
|
3792 | 't': '#ff6e36',
|
3793 | 'u': '#cf7af3',
|
3794 | 'v': '#cf7af3',
|
3795 | 'w': '#cf7af3',
|
3796 | 'x': '#cf7af3',
|
3797 | 'y': '#cf7af3',
|
3798 | 'z': '#4cd32e',
|
3799 | '0': '#52c7fe',
|
3800 | '1': '#52c7fe',
|
3801 | '2': '#52c7fe',
|
3802 | '3': '#52c7fe',
|
3803 | '4': '#52c7fe',
|
3804 | '5': '#ffaf01',
|
3805 | '6': '#ffaf01',
|
3806 | '7': '#ffaf01',
|
3807 | '8': '#ffaf01',
|
3808 | '9': '#ffaf01'
|
3809 | }
|
3810 | };
|
3811 | }();
|
3812 |
|
3813 | window.String.prototype.toPinyin = function () {
|
3814 | return PinyinHelper.toPinyin(this);
|
3815 | };
|
3816 | window.String.prototype.toCapitalize = function () {
|
3817 | return PinyinHelper.toCapitalize(this);
|
3818 | };
|
3819 | window.String.prototype.toColor = function () {
|
3820 | if (!/^[A-Za-z0-9]+$/.test(this)) return;
|
3821 | if (this.length > 1) return PinyinHelper.colors[this.substring(0, 1).toLowerCase()];
|
3822 | return PinyinHelper.colors[this.toLowerCase()];
|
3823 | };
|
3824 |
|
3825 | }),
|
3826 |
|
3827 | (function(module, exports, __webpack_require__) {
|
3828 |
|
3829 | "use strict";
|
3830 |
|
3831 |
|
3832 |
|
3833 |
|
3834 |
|
3835 |
|
3836 |
|
3837 |
|
3838 |
|
3839 | var ReactPropTypesSecret = __webpack_require__(26);
|
3840 |
|
3841 | function emptyFunction() {}
|
3842 | function emptyFunctionWithReset() {}
|
3843 | emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
3844 |
|
3845 | module.exports = function() {
|
3846 | function shim(props, propName, componentName, location, propFullName, secret) {
|
3847 | if (secret === ReactPropTypesSecret) {
|
3848 |
|
3849 | return;
|
3850 | }
|
3851 | var err = new Error(
|
3852 | 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
3853 | 'Use PropTypes.checkPropTypes() to call them. ' +
|
3854 | 'Read more at http://fb.me/use-check-prop-types'
|
3855 | );
|
3856 | err.name = 'Invariant Violation';
|
3857 | throw err;
|
3858 | };
|
3859 | shim.isRequired = shim;
|
3860 | function getShim() {
|
3861 | return shim;
|
3862 | };
|
3863 |
|
3864 |
|
3865 | var ReactPropTypes = {
|
3866 | array: shim,
|
3867 | bool: shim,
|
3868 | func: shim,
|
3869 | number: shim,
|
3870 | object: shim,
|
3871 | string: shim,
|
3872 | symbol: shim,
|
3873 |
|
3874 | any: shim,
|
3875 | arrayOf: getShim,
|
3876 | element: shim,
|
3877 | elementType: shim,
|
3878 | instanceOf: getShim,
|
3879 | node: shim,
|
3880 | objectOf: getShim,
|
3881 | oneOf: getShim,
|
3882 | oneOfType: getShim,
|
3883 | shape: getShim,
|
3884 | exact: getShim,
|
3885 |
|
3886 | checkPropTypes: emptyFunctionWithReset,
|
3887 | resetWarningCache: emptyFunction
|
3888 | };
|
3889 |
|
3890 | ReactPropTypes.PropTypes = ReactPropTypes;
|
3891 |
|
3892 | return ReactPropTypes;
|
3893 | };
|
3894 |
|
3895 |
|
3896 | }),
|
3897 |
|
3898 | (function(module, exports, __webpack_require__) {
|
3899 |
|
3900 | "use strict";
|
3901 |
|
3902 |
|
3903 |
|
3904 |
|
3905 |
|
3906 |
|
3907 |
|
3908 |
|
3909 |
|
3910 | var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
3911 |
|
3912 | module.exports = ReactPropTypesSecret;
|
3913 |
|
3914 |
|
3915 | }),
|
3916 |
|
3917 | (function(module, exports, __webpack_require__) {
|
3918 |
|
3919 | "use strict";
|
3920 |
|
3921 |
|
3922 |
|
3923 |
|
3924 |
|
3925 |
|
3926 |
|
3927 |
|
3928 |
|
3929 |
|
3930 |
|
3931 |
|
3932 | var aa=__webpack_require__(1),m=__webpack_require__(28),q=__webpack_require__(29);function t(a){for(var b=a.message,c="https://reactjs.org/docs/error-decoder.html?invariant="+b,d=1;d<arguments.length;d++)c+="&args[]="+encodeURIComponent(arguments[d]);a.message="Minified React error #"+b+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ";return a}if(!aa)throw t(Error(227));var ba=null,ca={};
|
3933 | function da(){if(ba)for(var a in ca){var b=ca[a],c=ba.indexOf(a);if(!(-1<c))throw t(Error(96),a);if(!ea[c]){if(!b.extractEvents)throw t(Error(97),a);ea[c]=b;c=b.eventTypes;for(var d in c){var e=void 0;var f=c[d],h=b,g=d;if(fa.hasOwnProperty(g))throw t(Error(99),g);fa[g]=f;var k=f.phasedRegistrationNames;if(k){for(e in k)k.hasOwnProperty(e)&&ha(k[e],h,g);e=!0}else f.registrationName?(ha(f.registrationName,h,g),e=!0):e=!1;if(!e)throw t(Error(98),d,a);}}}}
|
3934 | function ha(a,b,c){if(ia[a])throw t(Error(100),a);ia[a]=b;ja[a]=b.eventTypes[c].dependencies}var ea=[],fa={},ia={},ja={};function ka(a,b,c,d,e,f,h,g,k){var l=Array.prototype.slice.call(arguments,3);try{b.apply(c,l)}catch(n){this.onError(n)}}var la=!1,ma=null,na=!1,oa=null,pa={onError:function(a){la=!0;ma=a}};function qa(a,b,c,d,e,f,h,g,k){la=!1;ma=null;ka.apply(pa,arguments)}
|
3935 | function ra(a,b,c,d,e,f,h,g,k){qa.apply(this,arguments);if(la){if(la){var l=ma;la=!1;ma=null}else throw t(Error(198));na||(na=!0,oa=l)}}var sa=null,ta=null,va=null;function wa(a,b,c){var d=a.type||"unknown-event";a.currentTarget=va(c);ra(d,b,void 0,a);a.currentTarget=null}function xa(a,b){if(null==b)throw t(Error(30));if(null==a)return b;if(Array.isArray(a)){if(Array.isArray(b))return a.push.apply(a,b),a;a.push(b);return a}return Array.isArray(b)?[a].concat(b):[a,b]}
|
3936 | function ya(a,b,c){Array.isArray(a)?a.forEach(b,c):a&&b.call(c,a)}var za=null;function Aa(a){if(a){var b=a._dispatchListeners,c=a._dispatchInstances;if(Array.isArray(b))for(var d=0;d<b.length&&!a.isPropagationStopped();d++)wa(a,b[d],c[d]);else b&&wa(a,b,c);a._dispatchListeners=null;a._dispatchInstances=null;a.isPersistent()||a.constructor.release(a)}}function Ba(a){null!==a&&(za=xa(za,a));a=za;za=null;if(a){ya(a,Aa);if(za)throw t(Error(95));if(na)throw a=oa,na=!1,oa=null,a;}}
|
3937 | var Ca={injectEventPluginOrder:function(a){if(ba)throw t(Error(101));ba=Array.prototype.slice.call(a);da()},injectEventPluginsByName:function(a){var b=!1,c;for(c in a)if(a.hasOwnProperty(c)){var d=a[c];if(!ca.hasOwnProperty(c)||ca[c]!==d){if(ca[c])throw t(Error(102),c);ca[c]=d;b=!0}}b&&da()}};
|
3938 | function Da(a,b){var c=a.stateNode;if(!c)return null;var d=sa(c);if(!d)return null;c=d[b];a:switch(b){case "onClick":case "onClickCapture":case "onDoubleClick":case "onDoubleClickCapture":case "onMouseDown":case "onMouseDownCapture":case "onMouseMove":case "onMouseMoveCapture":case "onMouseUp":case "onMouseUpCapture":(d=!d.disabled)||(a=a.type,d=!("button"===a||"input"===a||"select"===a||"textarea"===a));a=!d;break a;default:a=!1}if(a)return null;if(c&&"function"!==typeof c)throw t(Error(231),b,typeof c);
|
3939 | return c}var Ea=Math.random().toString(36).slice(2),Fa="__reactInternalInstance$"+Ea,Ga="__reactEventHandlers$"+Ea;function Ha(a){if(a[Fa])return a[Fa];for(;!a[Fa];)if(a.parentNode)a=a.parentNode;else return null;a=a[Fa];return 5===a.tag||6===a.tag?a:null}function Ia(a){a=a[Fa];return!a||5!==a.tag&&6!==a.tag?null:a}function Ja(a){if(5===a.tag||6===a.tag)return a.stateNode;throw t(Error(33));}function Ka(a){return a[Ga]||null}function La(a){do a=a.return;while(a&&5!==a.tag);return a?a:null}
|
3940 | function Ma(a,b,c){if(b=Da(a,c.dispatchConfig.phasedRegistrationNames[b]))c._dispatchListeners=xa(c._dispatchListeners,b),c._dispatchInstances=xa(c._dispatchInstances,a)}function Na(a){if(a&&a.dispatchConfig.phasedRegistrationNames){for(var b=a._targetInst,c=[];b;)c.push(b),b=La(b);for(b=c.length;0<b--;)Ma(c[b],"captured",a);for(b=0;b<c.length;b++)Ma(c[b],"bubbled",a)}}
|
3941 | function Oa(a,b,c){a&&c&&c.dispatchConfig.registrationName&&(b=Da(a,c.dispatchConfig.registrationName))&&(c._dispatchListeners=xa(c._dispatchListeners,b),c._dispatchInstances=xa(c._dispatchInstances,a))}function Pa(a){a&&a.dispatchConfig.registrationName&&Oa(a._targetInst,null,a)}function Qa(a){ya(a,Na)}var Ra=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement);
|
3942 | function Sa(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c["Webkit"+a]="webkit"+b;c["Moz"+a]="moz"+b;return c}var Ta={animationend:Sa("Animation","AnimationEnd"),animationiteration:Sa("Animation","AnimationIteration"),animationstart:Sa("Animation","AnimationStart"),transitionend:Sa("Transition","TransitionEnd")},Ua={},Va={};
|
3943 | Ra&&(Va=document.createElement("div").style,"AnimationEvent"in window||(delete Ta.animationend.animation,delete Ta.animationiteration.animation,delete Ta.animationstart.animation),"TransitionEvent"in window||delete Ta.transitionend.transition);function Wa(a){if(Ua[a])return Ua[a];if(!Ta[a])return a;var b=Ta[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in Va)return Ua[a]=b[c];return a}
|
3944 | var Xa=Wa("animationend"),Ya=Wa("animationiteration"),Za=Wa("animationstart"),ab=Wa("transitionend"),bb="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),cb=null,db=null,eb=null;
|
3945 | function fb(){if(eb)return eb;var a,b=db,c=b.length,d,e="value"in cb?cb.value:cb.textContent,f=e.length;for(a=0;a<c&&b[a]===e[a];a++);var h=c-a;for(d=1;d<=h&&b[c-d]===e[f-d];d++);return eb=e.slice(a,1<d?1-d:void 0)}function gb(){return!0}function hb(){return!1}
|
3946 | function y(a,b,c,d){this.dispatchConfig=a;this._targetInst=b;this.nativeEvent=c;a=this.constructor.Interface;for(var e in a)a.hasOwnProperty(e)&&((b=a[e])?this[e]=b(c):"target"===e?this.target=d:this[e]=c[e]);this.isDefaultPrevented=(null!=c.defaultPrevented?c.defaultPrevented:!1===c.returnValue)?gb:hb;this.isPropagationStopped=hb;return this}
|
3947 | m(y.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():"unknown"!==typeof a.returnValue&&(a.returnValue=!1),this.isDefaultPrevented=gb)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():"unknown"!==typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=gb)},persist:function(){this.isPersistent=gb},isPersistent:hb,destructor:function(){var a=this.constructor.Interface,
|
3948 | b;for(b in a)this[b]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null;this.isPropagationStopped=this.isDefaultPrevented=hb;this._dispatchInstances=this._dispatchListeners=null}});y.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};
|
3949 | y.extend=function(a){function b(){}function c(){return d.apply(this,arguments)}var d=this;b.prototype=d.prototype;var e=new b;m(e,c.prototype);c.prototype=e;c.prototype.constructor=c;c.Interface=m({},d.Interface,a);c.extend=d.extend;ib(c);return c};ib(y);function jb(a,b,c,d){if(this.eventPool.length){var e=this.eventPool.pop();this.call(e,a,b,c,d);return e}return new this(a,b,c,d)}
|
3950 | function kb(a){if(!(a instanceof this))throw t(Error(279));a.destructor();10>this.eventPool.length&&this.eventPool.push(a)}function ib(a){a.eventPool=[];a.getPooled=jb;a.release=kb}var lb=y.extend({data:null}),mb=y.extend({data:null}),nb=[9,13,27,32],ob=Ra&&"CompositionEvent"in window,pb=null;Ra&&"documentMode"in document&&(pb=document.documentMode);
|
3951 | var qb=Ra&&"TextEvent"in window&&!pb,sb=Ra&&(!ob||pb&&8<pb&&11>=pb),tb=String.fromCharCode(32),ub={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",
|
3952 | captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},vb=!1;
|
3953 | function wb(a,b){switch(a){case "keyup":return-1!==nb.indexOf(b.keyCode);case "keydown":return 229!==b.keyCode;case "keypress":case "mousedown":case "blur":return!0;default:return!1}}function xb(a){a=a.detail;return"object"===typeof a&&"data"in a?a.data:null}var yb=!1;function Ab(a,b){switch(a){case "compositionend":return xb(b);case "keypress":if(32!==b.which)return null;vb=!0;return tb;case "textInput":return a=b.data,a===tb&&vb?null:a;default:return null}}
|
3954 | function Bb(a,b){if(yb)return"compositionend"===a||!ob&&wb(a,b)?(a=fb(),eb=db=cb=null,yb=!1,a):null;switch(a){case "paste":return null;case "keypress":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1<b.char.length)return b.char;if(b.which)return String.fromCharCode(b.which)}return null;case "compositionend":return sb&&"ko"!==b.locale?null:b.data;default:return null}}
|
3955 | var Cb={eventTypes:ub,extractEvents:function(a,b,c,d){var e=void 0;var f=void 0;if(ob)b:{switch(a){case "compositionstart":e=ub.compositionStart;break b;case "compositionend":e=ub.compositionEnd;break b;case "compositionupdate":e=ub.compositionUpdate;break b}e=void 0}else yb?wb(a,c)&&(e=ub.compositionEnd):"keydown"===a&&229===c.keyCode&&(e=ub.compositionStart);e?(sb&&"ko"!==c.locale&&(yb||e!==ub.compositionStart?e===ub.compositionEnd&&yb&&(f=fb()):(cb=d,db="value"in cb?cb.value:cb.textContent,yb=
|
3956 | !0)),e=lb.getPooled(e,b,c,d),f?e.data=f:(f=xb(c),null!==f&&(e.data=f)),Qa(e),f=e):f=null;(a=qb?Ab(a,c):Bb(a,c))?(b=mb.getPooled(ub.beforeInput,b,c,d),b.data=a,Qa(b)):b=null;return null===f?b:null===b?f:[f,b]}},Db=null,Eb=null,Fb=null;function Gb(a){if(a=ta(a)){if("function"!==typeof Db)throw t(Error(280));var b=sa(a.stateNode);Db(a.stateNode,a.type,b)}}function Hb(a){Eb?Fb?Fb.push(a):Fb=[a]:Eb=a}function Ib(){if(Eb){var a=Eb,b=Fb;Fb=Eb=null;Gb(a);if(b)for(a=0;a<b.length;a++)Gb(b[a])}}
|
3957 | function Jb(a,b){return a(b)}function Kb(a,b,c,d){return a(b,c,d)}function Lb(){}var Mb=Jb,Nb=!1;function Ob(){if(null!==Eb||null!==Fb)Lb(),Ib()}var Pb={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Qb(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return"input"===b?!!Pb[a.type]:"textarea"===b?!0:!1}
|
3958 | function Rb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}function Sb(a){if(!Ra)return!1;a="on"+a;var b=a in document;b||(b=document.createElement("div"),b.setAttribute(a,"return;"),b="function"===typeof b[a]);return b}function Tb(a){var b=a.type;return(a=a.nodeName)&&"input"===a.toLowerCase()&&("checkbox"===b||"radio"===b)}
|
3959 | function Ub(a){var b=Tb(a)?"checked":"value",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=""+a[b];if(!a.hasOwnProperty(b)&&"undefined"!==typeof c&&"function"===typeof c.get&&"function"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=""+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=""+a},stopTracking:function(){a._valueTracker=
|
3960 | null;delete a[b]}}}}function Vb(a){a._valueTracker||(a._valueTracker=Ub(a))}function Wb(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d="";a&&(d=Tb(a)?a.checked?"true":"false":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}var Xb=aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Xb.hasOwnProperty("ReactCurrentDispatcher")||(Xb.ReactCurrentDispatcher={current:null});Xb.hasOwnProperty("ReactCurrentBatchConfig")||(Xb.ReactCurrentBatchConfig={suspense:null});
|
3961 | var Yb=/^(.*)[\\\/]/,B="function"===typeof Symbol&&Symbol.for,Zb=B?Symbol.for("react.element"):60103,$b=B?Symbol.for("react.portal"):60106,ac=B?Symbol.for("react.fragment"):60107,bc=B?Symbol.for("react.strict_mode"):60108,cc=B?Symbol.for("react.profiler"):60114,dc=B?Symbol.for("react.provider"):60109,ec=B?Symbol.for("react.context"):60110,fc=B?Symbol.for("react.concurrent_mode"):60111,gc=B?Symbol.for("react.forward_ref"):60112,hc=B?Symbol.for("react.suspense"):60113,ic=B?Symbol.for("react.suspense_list"):
|
3962 | 60120,jc=B?Symbol.for("react.memo"):60115,kc=B?Symbol.for("react.lazy"):60116;B&&Symbol.for("react.fundamental");B&&Symbol.for("react.responder");var lc="function"===typeof Symbol&&Symbol.iterator;function mc(a){if(null===a||"object"!==typeof a)return null;a=lc&&a[lc]||a["@@iterator"];return"function"===typeof a?a:null}
|
3963 | function oc(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case ac:return"Fragment";case $b:return"Portal";case cc:return"Profiler";case bc:return"StrictMode";case hc:return"Suspense";case ic:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case ec:return"Context.Consumer";case dc:return"Context.Provider";case gc:var b=a.render;b=b.displayName||b.name||"";return a.displayName||(""!==b?"ForwardRef("+b+")":
|
3964 | "ForwardRef");case jc:return oc(a.type);case kc:if(a=1===a._status?a._result:null)return oc(a)}return null}function pc(a){var b="";do{a:switch(a.tag){case 3:case 4:case 6:case 7:case 10:case 9:var c="";break a;default:var d=a._debugOwner,e=a._debugSource,f=oc(a.type);c=null;d&&(c=oc(d.type));d=f;f="";e?f=" (at "+e.fileName.replace(Yb,"")+":"+e.lineNumber+")":c&&(f=" (created by "+c+")");c="\n in "+(d||"Unknown")+f}b+=c;a=a.return}while(a);return b}
|
3965 | var qc=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,rc=Object.prototype.hasOwnProperty,sc={},tc={};
|
3966 | function uc(a){if(rc.call(tc,a))return!0;if(rc.call(sc,a))return!1;if(qc.test(a))return tc[a]=!0;sc[a]=!0;return!1}function vc(a,b,c,d){if(null!==c&&0===c.type)return!1;switch(typeof b){case "function":case "symbol":return!0;case "boolean":if(d)return!1;if(null!==c)return!c.acceptsBooleans;a=a.toLowerCase().slice(0,5);return"data-"!==a&&"aria-"!==a;default:return!1}}
|
3967 | function wc(a,b,c,d){if(null===b||"undefined"===typeof b||vc(a,b,c,d))return!0;if(d)return!1;if(null!==c)switch(c.type){case 3:return!b;case 4:return!1===b;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return!1}function D(a,b,c,d,e,f){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f}var F={};
|
3968 | "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){F[a]=new D(a,0,!1,a,null,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];F[b]=new D(b,1,!1,a[1],null,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){F[a]=new D(a,2,!1,a.toLowerCase(),null,!1)});
|
3969 | ["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){F[a]=new D(a,2,!1,a,null,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){F[a]=new D(a,3,!1,a.toLowerCase(),null,!1)});
|
3970 | ["checked","multiple","muted","selected"].forEach(function(a){F[a]=new D(a,3,!0,a,null,!1)});["capture","download"].forEach(function(a){F[a]=new D(a,4,!1,a,null,!1)});["cols","rows","size","span"].forEach(function(a){F[a]=new D(a,6,!1,a,null,!1)});["rowSpan","start"].forEach(function(a){F[a]=new D(a,5,!1,a.toLowerCase(),null,!1)});var xc=/[\-:]([a-z])/g;function yc(a){return a[1].toUpperCase()}
|
3971 | "accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var b=a.replace(xc,
|
3972 | yc);F[b]=new D(b,1,!1,a,null,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(xc,yc);F[b]=new D(b,1,!1,a,"http://www.w3.org/1999/xlink",!1)});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(xc,yc);F[b]=new D(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1)});["tabIndex","crossOrigin"].forEach(function(a){F[a]=new D(a,1,!1,a.toLowerCase(),null,!1)});
|
3973 | F.xlinkHref=new D("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0);["src","href","action","formAction"].forEach(function(a){F[a]=new D(a,1,!1,a.toLowerCase(),null,!0)});
|
3974 | function zc(a,b,c,d){var e=F.hasOwnProperty(b)?F[b]:null;var f=null!==e?0===e.type:d?!1:!(2<b.length)||"o"!==b[0]&&"O"!==b[0]||"n"!==b[1]&&"N"!==b[1]?!1:!0;f||(wc(b,c,e,d)&&(c=null),d||null===e?uc(b)&&(null===c?a.removeAttribute(b):a.setAttribute(b,""+c)):e.mustUseProperty?a[e.propertyName]=null===c?3===e.type?!1:"":c:(b=e.attributeName,d=e.attributeNamespace,null===c?a.removeAttribute(b):(e=e.type,c=3===e||4===e&&!0===c?"":""+c,d?a.setAttributeNS(d,b,c):a.setAttribute(b,c))))}
|
3975 | function Ac(a){switch(typeof a){case "boolean":case "number":case "object":case "string":case "undefined":return a;default:return""}}function Bc(a,b){var c=b.checked;return m({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}
|
3976 | function Cc(a,b){var c=null==b.defaultValue?"":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Ac(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:"checkbox"===b.type||"radio"===b.type?null!=b.checked:null!=b.value}}function Dc(a,b){b=b.checked;null!=b&&zc(a,"checked",b,!1)}
|
3977 | function Ec(a,b){Dc(a,b);var c=Ac(b.value),d=b.type;if(null!=c)if("number"===d){if(0===c&&""===a.value||a.value!=c)a.value=""+c}else a.value!==""+c&&(a.value=""+c);else if("submit"===d||"reset"===d){a.removeAttribute("value");return}b.hasOwnProperty("value")?Fc(a,b.type,c):b.hasOwnProperty("defaultValue")&&Fc(a,b.type,Ac(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}
|
3978 | function Gc(a,b,c){if(b.hasOwnProperty("value")||b.hasOwnProperty("defaultValue")){var d=b.type;if(!("submit"!==d&&"reset"!==d||void 0!==b.value&&null!==b.value))return;b=""+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;""!==c&&(a.name="");a.defaultChecked=!a.defaultChecked;a.defaultChecked=!!a._wrapperState.initialChecked;""!==c&&(a.name=c)}
|
3979 | function Fc(a,b,c){if("number"!==b||a.ownerDocument.activeElement!==a)null==c?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+c&&(a.defaultValue=""+c)}var Hc={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}};function Ic(a,b,c){a=y.getPooled(Hc.change,a,b,c);a.type="change";Hb(c);Qa(a);return a}var Jc=null,Kc=null;function Lc(a){Ba(a)}
|
3980 | function Mc(a){var b=Ja(a);if(Wb(b))return a}function Nc(a,b){if("change"===a)return b}var Oc=!1;Ra&&(Oc=Sb("input")&&(!document.documentMode||9<document.documentMode));function Pc(){Jc&&(Jc.detachEvent("onpropertychange",Qc),Kc=Jc=null)}function Qc(a){if("value"===a.propertyName&&Mc(Kc))if(a=Ic(Kc,a,Rb(a)),Nb)Ba(a);else{Nb=!0;try{Jb(Lc,a)}finally{Nb=!1,Ob()}}}function Rc(a,b,c){"focus"===a?(Pc(),Jc=b,Kc=c,Jc.attachEvent("onpropertychange",Qc)):"blur"===a&&Pc()}
|
3981 | function Sc(a){if("selectionchange"===a||"keyup"===a||"keydown"===a)return Mc(Kc)}function Tc(a,b){if("click"===a)return Mc(b)}function Uc(a,b){if("input"===a||"change"===a)return Mc(b)}
|
3982 | var Vc={eventTypes:Hc,_isInputEventSupported:Oc,extractEvents:function(a,b,c,d){var e=b?Ja(b):window,f=void 0,h=void 0,g=e.nodeName&&e.nodeName.toLowerCase();"select"===g||"input"===g&&"file"===e.type?f=Nc:Qb(e)?Oc?f=Uc:(f=Sc,h=Rc):(g=e.nodeName)&&"input"===g.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)&&(f=Tc);if(f&&(f=f(a,b)))return Ic(f,c,d);h&&h(a,e,b);"blur"===a&&(a=e._wrapperState)&&a.controlled&&"number"===e.type&&Fc(e,"number",e.value)}},Wc=y.extend({view:null,detail:null}),Xc={Alt:"altKey",
|
3983 | Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Yc(a){var b=this.nativeEvent;return b.getModifierState?b.getModifierState(a):(a=Xc[a])?!!b[a]:!1}function Zc(){return Yc}
|
3984 | var $c=0,ad=0,bd=!1,cd=!1,dd=Wc.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:Zc,button:null,buttons:null,relatedTarget:function(a){return a.relatedTarget||(a.fromElement===a.srcElement?a.toElement:a.fromElement)},movementX:function(a){if("movementX"in a)return a.movementX;var b=$c;$c=a.screenX;return bd?"mousemove"===a.type?a.screenX-b:0:(bd=!0,0)},movementY:function(a){if("movementY"in a)return a.movementY;
|
3985 | var b=ad;ad=a.screenY;return cd?"mousemove"===a.type?a.screenY-b:0:(cd=!0,0)}}),ed=dd.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),fd={mouseEnter:{registrationName:"onMouseEnter",dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave",
|
3986 | dependencies:["pointerout","pointerover"]}},gd={eventTypes:fd,extractEvents:function(a,b,c,d){var e="mouseover"===a||"pointerover"===a,f="mouseout"===a||"pointerout"===a;if(e&&(c.relatedTarget||c.fromElement)||!f&&!e)return null;e=d.window===d?d:(e=d.ownerDocument)?e.defaultView||e.parentWindow:window;f?(f=b,b=(b=c.relatedTarget||c.toElement)?Ha(b):null):f=null;if(f===b)return null;var h=void 0,g=void 0,k=void 0,l=void 0;if("mouseout"===a||"mouseover"===a)h=dd,g=fd.mouseLeave,k=fd.mouseEnter,l="mouse";
|
3987 | else if("pointerout"===a||"pointerover"===a)h=ed,g=fd.pointerLeave,k=fd.pointerEnter,l="pointer";var n=null==f?e:Ja(f);e=null==b?e:Ja(b);a=h.getPooled(g,f,c,d);a.type=l+"leave";a.target=n;a.relatedTarget=e;c=h.getPooled(k,b,c,d);c.type=l+"enter";c.target=e;c.relatedTarget=n;d=b;if(f&&d)a:{b=f;e=d;l=0;for(h=b;h;h=La(h))l++;h=0;for(k=e;k;k=La(k))h++;for(;0<l-h;)b=La(b),l--;for(;0<h-l;)e=La(e),h--;for(;l--;){if(b===e||b===e.alternate)break a;b=La(b);e=La(e)}b=null}else b=null;e=b;for(b=[];f&&f!==e;){l=
|
3988 | f.alternate;if(null!==l&&l===e)break;b.push(f);f=La(f)}for(f=[];d&&d!==e;){l=d.alternate;if(null!==l&&l===e)break;f.push(d);d=La(d)}for(d=0;d<b.length;d++)Oa(b[d],"bubbled",a);for(d=f.length;0<d--;)Oa(f[d],"captured",c);return[a,c]}};function hd(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var id=Object.prototype.hasOwnProperty;
|
3989 | function jd(a,b){if(hd(a,b))return!0;if("object"!==typeof a||null===a||"object"!==typeof b||null===b)return!1;var c=Object.keys(a),d=Object.keys(b);if(c.length!==d.length)return!1;for(d=0;d<c.length;d++)if(!id.call(b,c[d])||!hd(a[c[d]],b[c[d]]))return!1;return!0}function kd(a,b){return{responder:a,props:b}}new Map;new Map;new Set;new Map;
|
3990 | function ld(a){var b=a;if(a.alternate)for(;b.return;)b=b.return;else{if(0!==(b.effectTag&2))return 1;for(;b.return;)if(b=b.return,0!==(b.effectTag&2))return 1}return 3===b.tag?2:3}function od(a){if(2!==ld(a))throw t(Error(188));}
|
3991 | function pd(a){var b=a.alternate;if(!b){b=ld(a);if(3===b)throw t(Error(188));return 1===b?null:a}for(var c=a,d=b;;){var e=c.return;if(null===e)break;var f=e.alternate;if(null===f){d=e.return;if(null!==d){c=d;continue}break}if(e.child===f.child){for(f=e.child;f;){if(f===c)return od(e),a;if(f===d)return od(e),b;f=f.sibling}throw t(Error(188));}if(c.return!==d.return)c=e,d=f;else{for(var h=!1,g=e.child;g;){if(g===c){h=!0;c=e;d=f;break}if(g===d){h=!0;d=e;c=f;break}g=g.sibling}if(!h){for(g=f.child;g;){if(g===
|
3992 | c){h=!0;c=f;d=e;break}if(g===d){h=!0;d=f;c=e;break}g=g.sibling}if(!h)throw t(Error(189));}}if(c.alternate!==d)throw t(Error(190));}if(3!==c.tag)throw t(Error(188));return c.stateNode.current===c?a:b}function qd(a){a=pd(a);if(!a)return null;for(var b=a;;){if(5===b.tag||6===b.tag)return b;if(b.child)b.child.return=b,b=b.child;else{if(b===a)break;for(;!b.sibling;){if(!b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}}return null}
|
3993 | var rd=y.extend({animationName:null,elapsedTime:null,pseudoElement:null}),sd=y.extend({clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),td=Wc.extend({relatedTarget:null});function ud(a){var b=a.keyCode;"charCode"in a?(a=a.charCode,0===a&&13===b&&(a=13)):a=b;10===a&&(a=13);return 32<=a||13===a?a:0}
|
3994 | var vd={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wd={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",
|
3995 | 116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},xd=Wc.extend({key:function(a){if(a.key){var b=vd[a.key]||a.key;if("Unidentified"!==b)return b}return"keypress"===a.type?(a=ud(a),13===a?"Enter":String.fromCharCode(a)):"keydown"===a.type||"keyup"===a.type?wd[a.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:Zc,charCode:function(a){return"keypress"===
|
3996 | a.type?ud(a):0},keyCode:function(a){return"keydown"===a.type||"keyup"===a.type?a.keyCode:0},which:function(a){return"keypress"===a.type?ud(a):"keydown"===a.type||"keyup"===a.type?a.keyCode:0}}),yd=dd.extend({dataTransfer:null}),zd=Wc.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:Zc}),Ad=y.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),Bd=dd.extend({deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in
|
3997 | a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:null,deltaMode:null}),Cd=[["blur","blur",0],["cancel","cancel",0],["click","click",0],["close","close",0],["contextmenu","contextMenu",0],["copy","copy",0],["cut","cut",0],["auxclick","auxClick",0],["dblclick","doubleClick",0],["dragend","dragEnd",0],["dragstart","dragStart",0],["drop","drop",0],["focus","focus",0],["input","input",0],["invalid","invalid",0],
|
3998 | ["keydown","keyDown",0],["keypress","keyPress",0],["keyup","keyUp",0],["mousedown","mouseDown",0],["mouseup","mouseUp",0],["paste","paste",0],["pause","pause",0],["play","play",0],["pointercancel","pointerCancel",0],["pointerdown","pointerDown",0],["pointerup","pointerUp",0],["ratechange","rateChange",0],["reset","reset",0],["seeked","seeked",0],["submit","submit",0],["touchcancel","touchCancel",0],["touchend","touchEnd",0],["touchstart","touchStart",0],["volumechange","volumeChange",0],["drag","drag",
|
3999 | 1],["dragenter","dragEnter",1],["dragexit","dragExit",1],["dragleave","dragLeave",1],["dragover","dragOver",1],["mousemove","mouseMove",1],["mouseout","mouseOut",1],["mouseover","mouseOver",1],["pointermove","pointerMove",1],["pointerout","pointerOut",1],["pointerover","pointerOver",1],["scroll","scroll",1],["toggle","toggle",1],["touchmove","touchMove",1],["wheel","wheel",1],["abort","abort",2],[Xa,"animationEnd",2],[Ya,"animationIteration",2],[Za,"animationStart",2],["canplay","canPlay",2],["canplaythrough",
|
4000 | "canPlayThrough",2],["durationchange","durationChange",2],["emptied","emptied",2],["encrypted","encrypted",2],["ended","ended",2],["error","error",2],["gotpointercapture","gotPointerCapture",2],["load","load",2],["loadeddata","loadedData",2],["loadedmetadata","loadedMetadata",2],["loadstart","loadStart",2],["lostpointercapture","lostPointerCapture",2],["playing","playing",2],["progress","progress",2],["seeking","seeking",2],["stalled","stalled",2],["suspend","suspend",2],["timeupdate","timeUpdate",
|
4001 | 2],[ab,"transitionEnd",2],["waiting","waiting",2]],Dd={},Ed={},Fd=0;for(;Fd<Cd.length;Fd++){var Gd=Cd[Fd],Hd=Gd[0],Id=Gd[1],Jd=Gd[2],Kd="on"+(Id[0].toUpperCase()+Id.slice(1)),Ld={phasedRegistrationNames:{bubbled:Kd,captured:Kd+"Capture"},dependencies:[Hd],eventPriority:Jd};Dd[Id]=Ld;Ed[Hd]=Ld}
|
4002 | var Md={eventTypes:Dd,getEventPriority:function(a){a=Ed[a];return void 0!==a?a.eventPriority:2},extractEvents:function(a,b,c,d){var e=Ed[a];if(!e)return null;switch(a){case "keypress":if(0===ud(c))return null;case "keydown":case "keyup":a=xd;break;case "blur":case "focus":a=td;break;case "click":if(2===c.button)return null;case "auxclick":case "dblclick":case "mousedown":case "mousemove":case "mouseup":case "mouseout":case "mouseover":case "contextmenu":a=dd;break;case "drag":case "dragend":case "dragenter":case "dragexit":case "dragleave":case "dragover":case "dragstart":case "drop":a=
|
4003 | yd;break;case "touchcancel":case "touchend":case "touchmove":case "touchstart":a=zd;break;case Xa:case Ya:case Za:a=rd;break;case ab:a=Ad;break;case "scroll":a=Wc;break;case "wheel":a=Bd;break;case "copy":case "cut":case "paste":a=sd;break;case "gotpointercapture":case "lostpointercapture":case "pointercancel":case "pointerdown":case "pointermove":case "pointerout":case "pointerover":case "pointerup":a=ed;break;default:a=y}b=a.getPooled(e,b,c,d);Qa(b);return b}},Nd=Md.getEventPriority,Od=[];
|
4004 | function Pd(a){var b=a.targetInst,c=b;do{if(!c){a.ancestors.push(c);break}var d;for(d=c;d.return;)d=d.return;d=3!==d.tag?null:d.stateNode.containerInfo;if(!d)break;a.ancestors.push(c);c=Ha(d)}while(c);for(c=0;c<a.ancestors.length;c++){b=a.ancestors[c];var e=Rb(a.nativeEvent);d=a.topLevelType;for(var f=a.nativeEvent,h=null,g=0;g<ea.length;g++){var k=ea[g];k&&(k=k.extractEvents(d,b,f,e))&&(h=xa(h,k))}Ba(h)}}var Qd=!0;function G(a,b){Rd(b,a,!1)}
|
4005 | function Rd(a,b,c){switch(Nd(b)){case 0:var d=Sd.bind(null,b,1);break;case 1:d=Td.bind(null,b,1);break;default:d=Ud.bind(null,b,1)}c?a.addEventListener(b,d,!0):a.addEventListener(b,d,!1)}function Sd(a,b,c){Nb||Lb();var d=Ud,e=Nb;Nb=!0;try{Kb(d,a,b,c)}finally{(Nb=e)||Ob()}}function Td(a,b,c){Ud(a,b,c)}
|
4006 | function Ud(a,b,c){if(Qd){b=Rb(c);b=Ha(b);null===b||"number"!==typeof b.tag||2===ld(b)||(b=null);if(Od.length){var d=Od.pop();d.topLevelType=a;d.nativeEvent=c;d.targetInst=b;a=d}else a={topLevelType:a,nativeEvent:c,targetInst:b,ancestors:[]};try{if(c=a,Nb)Pd(c,void 0);else{Nb=!0;try{Mb(Pd,c,void 0)}finally{Nb=!1,Ob()}}}finally{a.topLevelType=null,a.nativeEvent=null,a.targetInst=null,a.ancestors.length=0,10>Od.length&&Od.push(a)}}}var Vd=new ("function"===typeof WeakMap?WeakMap:Map);
|
4007 | function Wd(a){var b=Vd.get(a);void 0===b&&(b=new Set,Vd.set(a,b));return b}function Xd(a){a=a||("undefined"!==typeof document?document:void 0);if("undefined"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}function Yd(a){for(;a&&a.firstChild;)a=a.firstChild;return a}
|
4008 | function Zd(a,b){var c=Yd(a);a=0;for(var d;c;){if(3===c.nodeType){d=a+c.textContent.length;if(a<=b&&d>=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Yd(c)}}function $d(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?$d(a,b.parentNode):"contains"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}
|
4009 | function ae(){for(var a=window,b=Xd();b instanceof a.HTMLIFrameElement;){try{var c="string"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Xd(a.document)}return b}function be(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type||"password"===a.type)||"textarea"===b||"true"===a.contentEditable)}
|
4010 | var ce=Ra&&"documentMode"in document&&11>=document.documentMode,de={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},ee=null,fe=null,ge=null,he=!1;
|
4011 | function ie(a,b){var c=b.window===b?b.document:9===b.nodeType?b:b.ownerDocument;if(he||null==ee||ee!==Xd(c))return null;c=ee;"selectionStart"in c&&be(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset});return ge&&jd(ge,c)?null:(ge=c,a=y.getPooled(de.select,fe,a,b),a.type="select",a.target=ee,Qa(a),a)}
|
4012 | var je={eventTypes:de,extractEvents:function(a,b,c,d){var e=d.window===d?d.document:9===d.nodeType?d:d.ownerDocument,f;if(!(f=!e)){a:{e=Wd(e);f=ja.onSelect;for(var h=0;h<f.length;h++)if(!e.has(f[h])){e=!1;break a}e=!0}f=!e}if(f)return null;e=b?Ja(b):window;switch(a){case "focus":if(Qb(e)||"true"===e.contentEditable)ee=e,fe=b,ge=null;break;case "blur":ge=fe=ee=null;break;case "mousedown":he=!0;break;case "contextmenu":case "mouseup":case "dragend":return he=!1,ie(c,d);case "selectionchange":if(ce)break;
|
4013 | case "keydown":case "keyup":return ie(c,d)}return null}};Ca.injectEventPluginOrder("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" "));sa=Ka;ta=Ia;va=Ja;Ca.injectEventPluginsByName({SimpleEventPlugin:Md,EnterLeaveEventPlugin:gd,ChangeEventPlugin:Vc,SelectEventPlugin:je,BeforeInputEventPlugin:Cb});function ke(a){var b="";aa.Children.forEach(a,function(a){null!=a&&(b+=a)});return b}
|
4014 | function le(a,b){a=m({children:void 0},b);if(b=ke(b.children))a.children=b;return a}function me(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e<c.length;e++)b["$"+c[e]]=!0;for(c=0;c<a.length;c++)e=b.hasOwnProperty("$"+a[c].value),a[c].selected!==e&&(a[c].selected=e),e&&d&&(a[c].defaultSelected=!0)}else{c=""+Ac(c);b=null;for(e=0;e<a.length;e++){if(a[e].value===c){a[e].selected=!0;d&&(a[e].defaultSelected=!0);return}null!==b||a[e].disabled||(b=a[e])}null!==b&&(b.selected=!0)}}
|
4015 | function ne(a,b){if(null!=b.dangerouslySetInnerHTML)throw t(Error(91));return m({},b,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function oe(a,b){var c=b.value;if(null==c){c=b.defaultValue;b=b.children;if(null!=b){if(null!=c)throw t(Error(92));if(Array.isArray(b)){if(!(1>=b.length))throw t(Error(93));b=b[0]}c=b}null==c&&(c="")}a._wrapperState={initialValue:Ac(c)}}
|
4016 | function pe(a,b){var c=Ac(b.value),d=Ac(b.defaultValue);null!=c&&(c=""+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=""+d)}function qe(a){var b=a.textContent;b===a._wrapperState.initialValue&&(a.value=b)}var re={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};
|
4017 | function se(a){switch(a){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function te(a,b){return null==a||"http://www.w3.org/1999/xhtml"===a?se(b):"http://www.w3.org/2000/svg"===a&&"foreignObject"===b?"http://www.w3.org/1999/xhtml":a}
|
4018 | var ue=void 0,ve=function(a){return"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)})}:a}(function(a,b){if(a.namespaceURI!==re.svg||"innerHTML"in a)a.innerHTML=b;else{ue=ue||document.createElement("div");ue.innerHTML="<svg>"+b+"</svg>";for(b=ue.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});
|
4019 | function we(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}
|
4020 | var xe={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,
|
4021 | floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ye=["Webkit","ms","Moz","O"];Object.keys(xe).forEach(function(a){ye.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);xe[b]=xe[a]})});function ze(a,b,c){return null==b||"boolean"===typeof b||""===b?"":c||"number"!==typeof b||0===b||xe.hasOwnProperty(a)&&xe[a]?(""+b).trim():b+"px"}
|
4022 | function Ae(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf("--"),e=ze(c,b[c],d);"float"===c&&(c="cssFloat");d?a.setProperty(c,e):a[c]=e}}var Ce=m({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});
|
4023 | function De(a,b){if(b){if(Ce[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw t(Error(137),a,"");if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw t(Error(60));if(!("object"===typeof b.dangerouslySetInnerHTML&&"__html"in b.dangerouslySetInnerHTML))throw t(Error(61));}if(null!=b.style&&"object"!==typeof b.style)throw t(Error(62),"");}}
|
4024 | function Ee(a,b){if(-1===a.indexOf("-"))return"string"===typeof b.is;switch(a){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":return!1;default:return!0}}
|
4025 | function Fe(a,b){a=9===a.nodeType||11===a.nodeType?a:a.ownerDocument;var c=Wd(a);b=ja[b];for(var d=0;d<b.length;d++){var e=b[d];if(!c.has(e)){switch(e){case "scroll":Rd(a,"scroll",!0);break;case "focus":case "blur":Rd(a,"focus",!0);Rd(a,"blur",!0);c.add("blur");c.add("focus");break;case "cancel":case "close":Sb(e)&&Rd(a,e,!0);break;case "invalid":case "submit":case "reset":break;default:-1===bb.indexOf(e)&&G(e,a)}c.add(e)}}}function Ge(){}var He=null,Ie=null;
|
4026 | function Je(a,b){switch(a){case "button":case "input":case "select":case "textarea":return!!b.autoFocus}return!1}function Ke(a,b){return"textarea"===a||"option"===a||"noscript"===a||"string"===typeof b.children||"number"===typeof b.children||"object"===typeof b.dangerouslySetInnerHTML&&null!==b.dangerouslySetInnerHTML&&null!=b.dangerouslySetInnerHTML.__html}var Le="function"===typeof setTimeout?setTimeout:void 0,Me="function"===typeof clearTimeout?clearTimeout:void 0;
|
4027 | function Ne(a){for(;null!=a;a=a.nextSibling){var b=a.nodeType;if(1===b||3===b)break}return a}new Set;var Oe=[],Pe=-1;function H(a){0>Pe||(a.current=Oe[Pe],Oe[Pe]=null,Pe--)}function J(a,b){Pe++;Oe[Pe]=a.current;a.current=b}var Qe={},L={current:Qe},M={current:!1},Re=Qe;
|
4028 | function Se(a,b){var c=a.type.contextTypes;if(!c)return Qe;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function N(a){a=a.childContextTypes;return null!==a&&void 0!==a}function Te(a){H(M,a);H(L,a)}function Ue(a){H(M,a);H(L,a)}
|
4029 | function Ve(a,b,c){if(L.current!==Qe)throw t(Error(168));J(L,b,a);J(M,c,a)}function We(a,b,c){var d=a.stateNode;a=b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in a))throw t(Error(108),oc(b)||"Unknown",e);return m({},c,d)}function Xe(a){var b=a.stateNode;b=b&&b.__reactInternalMemoizedMergedChildContext||Qe;Re=L.current;J(L,b,a);J(M,M.current,a);return!0}
|
4030 | function Ye(a,b,c){var d=a.stateNode;if(!d)throw t(Error(169));c?(b=We(a,b,Re),d.__reactInternalMemoizedMergedChildContext=b,H(M,a),H(L,a),J(L,b,a)):H(M,a);J(M,c,a)}
|
4031 | var Ze=q.unstable_runWithPriority,$e=q.unstable_scheduleCallback,af=q.unstable_cancelCallback,bf=q.unstable_shouldYield,cf=q.unstable_requestPaint,df=q.unstable_now,ef=q.unstable_getCurrentPriorityLevel,ff=q.unstable_ImmediatePriority,hf=q.unstable_UserBlockingPriority,jf=q.unstable_NormalPriority,kf=q.unstable_LowPriority,lf=q.unstable_IdlePriority,mf={},nf=void 0!==cf?cf:function(){},of=null,pf=null,qf=!1,rf=df(),sf=1E4>rf?df:function(){return df()-rf};
|
4032 | function tf(){switch(ef()){case ff:return 99;case hf:return 98;case jf:return 97;case kf:return 96;case lf:return 95;default:throw t(Error(332));}}function uf(a){switch(a){case 99:return ff;case 98:return hf;case 97:return jf;case 96:return kf;case 95:return lf;default:throw t(Error(332));}}function vf(a,b){a=uf(a);return Ze(a,b)}function wf(a,b,c){a=uf(a);return $e(a,b,c)}function xf(a){null===of?(of=[a],pf=$e(ff,yf)):of.push(a);return mf}function O(){null!==pf&&af(pf);yf()}
|
4033 | function yf(){if(!qf&&null!==of){qf=!0;var a=0;try{var b=of;vf(99,function(){for(;a<b.length;a++){var c=b[a];do c=c(!0);while(null!==c)}});of=null}catch(c){throw null!==of&&(of=of.slice(a+1)),$e(ff,O),c;}finally{qf=!1}}}function zf(a,b){if(1073741823===b)return 99;if(1===b)return 95;a=10*(1073741821-b)-10*(1073741821-a);return 0>=a?99:250>=a?98:5250>=a?97:95}function Af(a,b){if(a&&a.defaultProps){b=m({},b);a=a.defaultProps;for(var c in a)void 0===b[c]&&(b[c]=a[c])}return b}
|
4034 | function Bf(a){var b=a._result;switch(a._status){case 1:return b;case 2:throw b;case 0:throw b;default:a._status=0;b=a._ctor;b=b();b.then(function(b){0===a._status&&(b=b.default,a._status=1,a._result=b)},function(b){0===a._status&&(a._status=2,a._result=b)});switch(a._status){case 1:return a._result;case 2:throw a._result;}a._result=b;throw b;}}var Cf={current:null},Df=null,Ef=null,Ff=null;function Gf(){Ff=Ef=Df=null}
|
4035 | function Hf(a,b){var c=a.type._context;J(Cf,c._currentValue,a);c._currentValue=b}function If(a){var b=Cf.current;H(Cf,a);a.type._context._currentValue=b}function Jf(a,b){for(;null!==a;){var c=a.alternate;if(a.childExpirationTime<b)a.childExpirationTime=b,null!==c&&c.childExpirationTime<b&&(c.childExpirationTime=b);else if(null!==c&&c.childExpirationTime<b)c.childExpirationTime=b;else break;a=a.return}}
|
4036 | function Kf(a,b){Df=a;Ff=Ef=null;a=a.dependencies;null!==a&&null!==a.firstContext&&(a.expirationTime>=b&&(Lf=!0),a.firstContext=null)}function Mf(a,b){if(Ff!==a&&!1!==b&&0!==b){if("number"!==typeof b||1073741823===b)Ff=a,b=1073741823;b={context:a,observedBits:b,next:null};if(null===Ef){if(null===Df)throw t(Error(308));Ef=b;Df.dependencies={expirationTime:0,firstContext:b,responders:null}}else Ef=Ef.next=b}return a._currentValue}var Nf=!1;
|
4037 | function Of(a){return{baseState:a,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Pf(a){return{baseState:a.baseState,firstUpdate:a.firstUpdate,lastUpdate:a.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}
|
4038 | function Qf(a,b){return{expirationTime:a,suspenseConfig:b,tag:0,payload:null,callback:null,next:null,nextEffect:null}}function Rf(a,b){null===a.lastUpdate?a.firstUpdate=a.lastUpdate=b:(a.lastUpdate.next=b,a.lastUpdate=b)}
|
4039 | function Sf(a,b){var c=a.alternate;if(null===c){var d=a.updateQueue;var e=null;null===d&&(d=a.updateQueue=Of(a.memoizedState))}else d=a.updateQueue,e=c.updateQueue,null===d?null===e?(d=a.updateQueue=Of(a.memoizedState),e=c.updateQueue=Of(c.memoizedState)):d=a.updateQueue=Pf(e):null===e&&(e=c.updateQueue=Pf(d));null===e||d===e?Rf(d,b):null===d.lastUpdate||null===e.lastUpdate?(Rf(d,b),Rf(e,b)):(Rf(d,b),e.lastUpdate=b)}
|
4040 | function Tf(a,b){var c=a.updateQueue;c=null===c?a.updateQueue=Of(a.memoizedState):Uf(a,c);null===c.lastCapturedUpdate?c.firstCapturedUpdate=c.lastCapturedUpdate=b:(c.lastCapturedUpdate.next=b,c.lastCapturedUpdate=b)}function Uf(a,b){var c=a.alternate;null!==c&&b===c.updateQueue&&(b=a.updateQueue=Pf(b));return b}
|
4041 | function Vf(a,b,c,d,e,f){switch(c.tag){case 1:return a=c.payload,"function"===typeof a?a.call(f,d,e):a;case 3:a.effectTag=a.effectTag&-2049|64;case 0:a=c.payload;e="function"===typeof a?a.call(f,d,e):a;if(null===e||void 0===e)break;return m({},d,e);case 2:Nf=!0}return d}
|
4042 | function Wf(a,b,c,d,e){Nf=!1;b=Uf(a,b);for(var f=b.baseState,h=null,g=0,k=b.firstUpdate,l=f;null!==k;){var n=k.expirationTime;n<e?(null===h&&(h=k,f=l),g<n&&(g=n)):(Xf(n,k.suspenseConfig),l=Vf(a,b,k,l,c,d),null!==k.callback&&(a.effectTag|=32,k.nextEffect=null,null===b.lastEffect?b.firstEffect=b.lastEffect=k:(b.lastEffect.nextEffect=k,b.lastEffect=k)));k=k.next}n=null;for(k=b.firstCapturedUpdate;null!==k;){var z=k.expirationTime;z<e?(null===n&&(n=k,null===h&&(f=l)),g<z&&(g=z)):(l=Vf(a,b,k,l,c,d),null!==
|
4043 | k.callback&&(a.effectTag|=32,k.nextEffect=null,null===b.lastCapturedEffect?b.firstCapturedEffect=b.lastCapturedEffect=k:(b.lastCapturedEffect.nextEffect=k,b.lastCapturedEffect=k)));k=k.next}null===h&&(b.lastUpdate=null);null===n?b.lastCapturedUpdate=null:a.effectTag|=32;null===h&&null===n&&(f=l);b.baseState=f;b.firstUpdate=h;b.firstCapturedUpdate=n;a.expirationTime=g;a.memoizedState=l}
|
4044 | function Yf(a,b,c){null!==b.firstCapturedUpdate&&(null!==b.lastUpdate&&(b.lastUpdate.next=b.firstCapturedUpdate,b.lastUpdate=b.lastCapturedUpdate),b.firstCapturedUpdate=b.lastCapturedUpdate=null);Zf(b.firstEffect,c);b.firstEffect=b.lastEffect=null;Zf(b.firstCapturedEffect,c);b.firstCapturedEffect=b.lastCapturedEffect=null}function Zf(a,b){for(;null!==a;){var c=a.callback;if(null!==c){a.callback=null;var d=b;if("function"!==typeof c)throw t(Error(191),c);c.call(d)}a=a.nextEffect}}
|
4045 | var $f=Xb.ReactCurrentBatchConfig,ag=(new aa.Component).refs;function bg(a,b,c,d){b=a.memoizedState;c=c(d,b);c=null===c||void 0===c?b:m({},b,c);a.memoizedState=c;d=a.updateQueue;null!==d&&0===a.expirationTime&&(d.baseState=c)}
|
4046 | var fg={isMounted:function(a){return(a=a._reactInternalFiber)?2===ld(a):!1},enqueueSetState:function(a,b,c){a=a._reactInternalFiber;var d=cg(),e=$f.suspense;d=dg(d,a,e);e=Qf(d,e);e.payload=b;void 0!==c&&null!==c&&(e.callback=c);Sf(a,e);eg(a,d)},enqueueReplaceState:function(a,b,c){a=a._reactInternalFiber;var d=cg(),e=$f.suspense;d=dg(d,a,e);e=Qf(d,e);e.tag=1;e.payload=b;void 0!==c&&null!==c&&(e.callback=c);Sf(a,e);eg(a,d)},enqueueForceUpdate:function(a,b){a=a._reactInternalFiber;var c=cg(),d=$f.suspense;
|
4047 | c=dg(c,a,d);d=Qf(c,d);d.tag=2;void 0!==b&&null!==b&&(d.callback=b);Sf(a,d);eg(a,c)}};function gg(a,b,c,d,e,f,h){a=a.stateNode;return"function"===typeof a.shouldComponentUpdate?a.shouldComponentUpdate(d,f,h):b.prototype&&b.prototype.isPureReactComponent?!jd(c,d)||!jd(e,f):!0}
|
4048 | function hg(a,b,c){var d=!1,e=Qe;var f=b.contextType;"object"===typeof f&&null!==f?f=Mf(f):(e=N(b)?Re:L.current,d=b.contextTypes,f=(d=null!==d&&void 0!==d)?Se(a,e):Qe);b=new b(c,f);a.memoizedState=null!==b.state&&void 0!==b.state?b.state:null;b.updater=fg;a.stateNode=b;b._reactInternalFiber=a;d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=e,a.__reactInternalMemoizedMaskedChildContext=f);return b}
|
4049 | function ig(a,b,c,d){a=b.state;"function"===typeof b.componentWillReceiveProps&&b.componentWillReceiveProps(c,d);"function"===typeof b.UNSAFE_componentWillReceiveProps&&b.UNSAFE_componentWillReceiveProps(c,d);b.state!==a&&fg.enqueueReplaceState(b,b.state,null)}
|
4050 | function jg(a,b,c,d){var e=a.stateNode;e.props=c;e.state=a.memoizedState;e.refs=ag;var f=b.contextType;"object"===typeof f&&null!==f?e.context=Mf(f):(f=N(b)?Re:L.current,e.context=Se(a,f));f=a.updateQueue;null!==f&&(Wf(a,f,c,e,d),e.state=a.memoizedState);f=b.getDerivedStateFromProps;"function"===typeof f&&(bg(a,b,f,c),e.state=a.memoizedState);"function"===typeof b.getDerivedStateFromProps||"function"===typeof e.getSnapshotBeforeUpdate||"function"!==typeof e.UNSAFE_componentWillMount&&"function"!==
|
4051 | typeof e.componentWillMount||(b=e.state,"function"===typeof e.componentWillMount&&e.componentWillMount(),"function"===typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),b!==e.state&&fg.enqueueReplaceState(e,e.state,null),f=a.updateQueue,null!==f&&(Wf(a,f,c,e,d),e.state=a.memoizedState));"function"===typeof e.componentDidMount&&(a.effectTag|=4)}var kg=Array.isArray;
|
4052 | function lg(a,b,c){a=c.ref;if(null!==a&&"function"!==typeof a&&"object"!==typeof a){if(c._owner){c=c._owner;var d=void 0;if(c){if(1!==c.tag)throw t(Error(309));d=c.stateNode}if(!d)throw t(Error(147),a);var e=""+a;if(null!==b&&null!==b.ref&&"function"===typeof b.ref&&b.ref._stringRef===e)return b.ref;b=function(a){var b=d.refs;b===ag&&(b=d.refs={});null===a?delete b[e]:b[e]=a};b._stringRef=e;return b}if("string"!==typeof a)throw t(Error(284));if(!c._owner)throw t(Error(290),a);}return a}
|
4053 | function mg(a,b){if("textarea"!==a.type)throw t(Error(31),"[object Object]"===Object.prototype.toString.call(b)?"object with keys {"+Object.keys(b).join(", ")+"}":b,"");}
|
4054 | function ng(a){function b(b,c){if(a){var d=b.lastEffect;null!==d?(d.nextEffect=c,b.lastEffect=c):b.firstEffect=b.lastEffect=c;c.nextEffect=null;c.effectTag=8}}function c(c,d){if(!a)return null;for(;null!==d;)b(c,d),d=d.sibling;return null}function d(a,b){for(a=new Map;null!==b;)null!==b.key?a.set(b.key,b):a.set(b.index,b),b=b.sibling;return a}function e(a,b,c){a=og(a,b,c);a.index=0;a.sibling=null;return a}function f(b,c,d){b.index=d;if(!a)return c;d=b.alternate;if(null!==d)return d=d.index,d<c?(b.effectTag=
|
4055 | 2,c):d;b.effectTag=2;return c}function h(b){a&&null===b.alternate&&(b.effectTag=2);return b}function g(a,b,c,d){if(null===b||6!==b.tag)return b=pg(c,a.mode,d),b.return=a,b;b=e(b,c,d);b.return=a;return b}function k(a,b,c,d){if(null!==b&&b.elementType===c.type)return d=e(b,c.props,d),d.ref=lg(a,b,c),d.return=a,d;d=qg(c.type,c.key,c.props,null,a.mode,d);d.ref=lg(a,b,c);d.return=a;return d}function l(a,b,c,d){if(null===b||4!==b.tag||b.stateNode.containerInfo!==c.containerInfo||b.stateNode.implementation!==
|
4056 | c.implementation)return b=rg(c,a.mode,d),b.return=a,b;b=e(b,c.children||[],d);b.return=a;return b}function n(a,b,c,d,f){if(null===b||7!==b.tag)return b=sg(c,a.mode,d,f),b.return=a,b;b=e(b,c,d);b.return=a;return b}function z(a,b,c){if("string"===typeof b||"number"===typeof b)return b=pg(""+b,a.mode,c),b.return=a,b;if("object"===typeof b&&null!==b){switch(b.$$typeof){case Zb:return c=qg(b.type,b.key,b.props,null,a.mode,c),c.ref=lg(a,null,b),c.return=a,c;case $b:return b=rg(b,a.mode,c),b.return=a,b}if(kg(b)||
|
4057 | mc(b))return b=sg(b,a.mode,c,null),b.return=a,b;mg(a,b)}return null}function x(a,b,c,d){var e=null!==b?b.key:null;if("string"===typeof c||"number"===typeof c)return null!==e?null:g(a,b,""+c,d);if("object"===typeof c&&null!==c){switch(c.$$typeof){case Zb:return c.key===e?c.type===ac?n(a,b,c.props.children,d,e):k(a,b,c,d):null;case $b:return c.key===e?l(a,b,c,d):null}if(kg(c)||mc(c))return null!==e?null:n(a,b,c,d,null);mg(a,c)}return null}function v(a,b,c,d,e){if("string"===typeof d||"number"===typeof d)return a=
|
4058 | a.get(c)||null,g(b,a,""+d,e);if("object"===typeof d&&null!==d){switch(d.$$typeof){case Zb:return a=a.get(null===d.key?c:d.key)||null,d.type===ac?n(b,a,d.props.children,e,d.key):k(b,a,d,e);case $b:return a=a.get(null===d.key?c:d.key)||null,l(b,a,d,e)}if(kg(d)||mc(d))return a=a.get(c)||null,n(b,a,d,e,null);mg(b,d)}return null}function rb(e,h,g,k){for(var l=null,u=null,n=h,w=h=0,C=null;null!==n&&w<g.length;w++){n.index>w?(C=n,n=null):C=n.sibling;var p=x(e,n,g[w],k);if(null===p){null===n&&(n=C);break}a&&
|
4059 | n&&null===p.alternate&&b(e,n);h=f(p,h,w);null===u?l=p:u.sibling=p;u=p;n=C}if(w===g.length)return c(e,n),l;if(null===n){for(;w<g.length;w++)n=z(e,g[w],k),null!==n&&(h=f(n,h,w),null===u?l=n:u.sibling=n,u=n);return l}for(n=d(e,n);w<g.length;w++)C=v(n,e,w,g[w],k),null!==C&&(a&&null!==C.alternate&&n.delete(null===C.key?w:C.key),h=f(C,h,w),null===u?l=C:u.sibling=C,u=C);a&&n.forEach(function(a){return b(e,a)});return l}function Be(e,h,g,k){var l=mc(g);if("function"!==typeof l)throw t(Error(150));g=l.call(g);
|
4060 | if(null==g)throw t(Error(151));for(var n=l=null,u=h,w=h=0,C=null,p=g.next();null!==u&&!p.done;w++,p=g.next()){u.index>w?(C=u,u=null):C=u.sibling;var r=x(e,u,p.value,k);if(null===r){null===u&&(u=C);break}a&&u&&null===r.alternate&&b(e,u);h=f(r,h,w);null===n?l=r:n.sibling=r;n=r;u=C}if(p.done)return c(e,u),l;if(null===u){for(;!p.done;w++,p=g.next())p=z(e,p.value,k),null!==p&&(h=f(p,h,w),null===n?l=p:n.sibling=p,n=p);return l}for(u=d(e,u);!p.done;w++,p=g.next())p=v(u,e,w,p.value,k),null!==p&&(a&&null!==
|
4061 | p.alternate&&u.delete(null===p.key?w:p.key),h=f(p,h,w),null===n?l=p:n.sibling=p,n=p);a&&u.forEach(function(a){return b(e,a)});return l}return function(a,d,f,g){var k="object"===typeof f&&null!==f&&f.type===ac&&null===f.key;k&&(f=f.props.children);var l="object"===typeof f&&null!==f;if(l)switch(f.$$typeof){case Zb:a:{l=f.key;for(k=d;null!==k;){if(k.key===l){if(7===k.tag?f.type===ac:k.elementType===f.type){c(a,k.sibling);d=e(k,f.type===ac?f.props.children:f.props,g);d.ref=lg(a,k,f);d.return=a;a=d;break a}c(a,
|
4062 | k);break}else b(a,k);k=k.sibling}f.type===ac?(d=sg(f.props.children,a.mode,g,f.key),d.return=a,a=d):(g=qg(f.type,f.key,f.props,null,a.mode,g),g.ref=lg(a,d,f),g.return=a,a=g)}return h(a);case $b:a:{for(k=f.key;null!==d;){if(d.key===k){if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[],g);d.return=a;a=d;break a}c(a,d);break}else b(a,d);d=d.sibling}d=rg(f,a.mode,g);d.return=a;a=d}return h(a)}if("string"===typeof f||
|
4063 | "number"===typeof f)return f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f,g),d.return=a,a=d):(c(a,d),d=pg(f,a.mode,g),d.return=a,a=d),h(a);if(kg(f))return rb(a,d,f,g);if(mc(f))return Be(a,d,f,g);l&&mg(a,f);if("undefined"===typeof f&&!k)switch(a.tag){case 1:case 0:throw a=a.type,t(Error(152),a.displayName||a.name||"Component");}return c(a,d)}}var tg=ng(!0),ug=ng(!1),vg={},wg={current:vg},xg={current:vg},yg={current:vg};function zg(a){if(a===vg)throw t(Error(174));return a}
|
4064 | function Ag(a,b){J(yg,b,a);J(xg,a,a);J(wg,vg,a);var c=b.nodeType;switch(c){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:te(null,"");break;default:c=8===c?b.parentNode:b,b=c.namespaceURI||null,c=c.tagName,b=te(b,c)}H(wg,a);J(wg,b,a)}function Bg(a){H(wg,a);H(xg,a);H(yg,a)}function Cg(a){zg(yg.current);var b=zg(wg.current);var c=te(b,a.type);b!==c&&(J(xg,a,a),J(wg,c,a))}function Dg(a){xg.current===a&&(H(wg,a),H(xg,a))}var Eg=1,Fg=1,Gg=2,P={current:0};
|
4065 | function Hg(a){for(var b=a;null!==b;){if(13===b.tag){if(null!==b.memoizedState)return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.effectTag&64))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}
|
4066 | var Ig=0,Jg=2,Kg=4,Lg=8,Mg=16,Ng=32,Og=64,Pg=128,Qg=Xb.ReactCurrentDispatcher,Rg=0,Sg=null,Q=null,Tg=null,Ug=null,R=null,Vg=null,Wg=0,Xg=null,Yg=0,Zg=!1,$g=null,ah=0;function bh(){throw t(Error(321));}function ch(a,b){if(null===b)return!1;for(var c=0;c<b.length&&c<a.length;c++)if(!hd(a[c],b[c]))return!1;return!0}
|
4067 | function dh(a,b,c,d,e,f){Rg=f;Sg=b;Tg=null!==a?a.memoizedState:null;Qg.current=null===Tg?eh:fh;b=c(d,e);if(Zg){do Zg=!1,ah+=1,Tg=null!==a?a.memoizedState:null,Vg=Ug,Xg=R=Q=null,Qg.current=fh,b=c(d,e);while(Zg);$g=null;ah=0}Qg.current=hh;a=Sg;a.memoizedState=Ug;a.expirationTime=Wg;a.updateQueue=Xg;a.effectTag|=Yg;a=null!==Q&&null!==Q.next;Rg=0;Vg=R=Ug=Tg=Q=Sg=null;Wg=0;Xg=null;Yg=0;if(a)throw t(Error(300));return b}
|
4068 | function ih(){Qg.current=hh;Rg=0;Vg=R=Ug=Tg=Q=Sg=null;Wg=0;Xg=null;Yg=0;Zg=!1;$g=null;ah=0}function jh(){var a={memoizedState:null,baseState:null,queue:null,baseUpdate:null,next:null};null===R?Ug=R=a:R=R.next=a;return R}function kh(){if(null!==Vg)R=Vg,Vg=R.next,Q=Tg,Tg=null!==Q?Q.next:null;else{if(null===Tg)throw t(Error(310));Q=Tg;var a={memoizedState:Q.memoizedState,baseState:Q.baseState,queue:Q.queue,baseUpdate:Q.baseUpdate,next:null};R=null===R?Ug=a:R.next=a;Tg=Q.next}return R}
|
4069 | function lh(a,b){return"function"===typeof b?b(a):b}
|
4070 | function mh(a){var b=kh(),c=b.queue;if(null===c)throw t(Error(311));c.lastRenderedReducer=a;if(0<ah){var d=c.dispatch;if(null!==$g){var e=$g.get(c);if(void 0!==e){$g.delete(c);var f=b.memoizedState;do f=a(f,e.action),e=e.next;while(null!==e);hd(f,b.memoizedState)||(Lf=!0);b.memoizedState=f;b.baseUpdate===c.last&&(b.baseState=f);c.lastRenderedState=f;return[f,d]}}return[b.memoizedState,d]}d=c.last;var h=b.baseUpdate;f=b.baseState;null!==h?(null!==d&&(d.next=null),d=h.next):d=null!==d?d.next:null;if(null!==
|
4071 | d){var g=e=null,k=d,l=!1;do{var n=k.expirationTime;n<Rg?(l||(l=!0,g=h,e=f),n>Wg&&(Wg=n)):(Xf(n,k.suspenseConfig),f=k.eagerReducer===a?k.eagerState:a(f,k.action));h=k;k=k.next}while(null!==k&&k!==d);l||(g=h,e=f);hd(f,b.memoizedState)||(Lf=!0);b.memoizedState=f;b.baseUpdate=g;b.baseState=e;c.lastRenderedState=f}return[b.memoizedState,c.dispatch]}
|
4072 | function nh(a,b,c,d){a={tag:a,create:b,destroy:c,deps:d,next:null};null===Xg?(Xg={lastEffect:null},Xg.lastEffect=a.next=a):(b=Xg.lastEffect,null===b?Xg.lastEffect=a.next=a:(c=b.next,b.next=a,a.next=c,Xg.lastEffect=a));return a}function oh(a,b,c,d){var e=jh();Yg|=a;e.memoizedState=nh(b,c,void 0,void 0===d?null:d)}
|
4073 | function ph(a,b,c,d){var e=kh();d=void 0===d?null:d;var f=void 0;if(null!==Q){var h=Q.memoizedState;f=h.destroy;if(null!==d&&ch(d,h.deps)){nh(Ig,c,f,d);return}}Yg|=a;e.memoizedState=nh(b,c,f,d)}function qh(a,b){if("function"===typeof b)return a=a(),b(a),function(){b(null)};if(null!==b&&void 0!==b)return a=a(),b.current=a,function(){b.current=null}}function rh(){}
|
4074 | function sh(a,b,c){if(!(25>ah))throw t(Error(301));var d=a.alternate;if(a===Sg||null!==d&&d===Sg)if(Zg=!0,a={expirationTime:Rg,suspenseConfig:null,action:c,eagerReducer:null,eagerState:null,next:null},null===$g&&($g=new Map),c=$g.get(b),void 0===c)$g.set(b,a);else{for(b=c;null!==b.next;)b=b.next;b.next=a}else{var e=cg(),f=$f.suspense;e=dg(e,a,f);f={expirationTime:e,suspenseConfig:f,action:c,eagerReducer:null,eagerState:null,next:null};var h=b.last;if(null===h)f.next=f;else{var g=h.next;null!==g&&
|
4075 | (f.next=g);h.next=f}b.last=f;if(0===a.expirationTime&&(null===d||0===d.expirationTime)&&(d=b.lastRenderedReducer,null!==d))try{var k=b.lastRenderedState,l=d(k,c);f.eagerReducer=d;f.eagerState=l;if(hd(l,k))return}catch(n){}finally{}eg(a,e)}}
|
4076 | var hh={readContext:Mf,useCallback:bh,useContext:bh,useEffect:bh,useImperativeHandle:bh,useLayoutEffect:bh,useMemo:bh,useReducer:bh,useRef:bh,useState:bh,useDebugValue:bh,useResponder:bh},eh={readContext:Mf,useCallback:function(a,b){jh().memoizedState=[a,void 0===b?null:b];return a},useContext:Mf,useEffect:function(a,b){return oh(516,Pg|Og,a,b)},useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return oh(4,Kg|Ng,qh.bind(null,b,a),c)},useLayoutEffect:function(a,b){return oh(4,
|
4077 | Kg|Ng,a,b)},useMemo:function(a,b){var c=jh();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=jh();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a=d.queue={last:null,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};a=a.dispatch=sh.bind(null,Sg,a);return[d.memoizedState,a]},useRef:function(a){var b=jh();a={current:a};return b.memoizedState=a},useState:function(a){var b=jh();"function"===typeof a&&(a=a());b.memoizedState=b.baseState=a;a=b.queue=
|
4078 | {last:null,dispatch:null,lastRenderedReducer:lh,lastRenderedState:a};a=a.dispatch=sh.bind(null,Sg,a);return[b.memoizedState,a]},useDebugValue:rh,useResponder:kd},fh={readContext:Mf,useCallback:function(a,b){var c=kh();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&ch(b,d[1]))return d[0];c.memoizedState=[a,b];return a},useContext:Mf,useEffect:function(a,b){return ph(516,Pg|Og,a,b)},useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return ph(4,Kg|Ng,qh.bind(null,
|
4079 | b,a),c)},useLayoutEffect:function(a,b){return ph(4,Kg|Ng,a,b)},useMemo:function(a,b){var c=kh();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&ch(b,d[1]))return d[0];a=a();c.memoizedState=[a,b];return a},useReducer:mh,useRef:function(){return kh().memoizedState},useState:function(a){return mh(lh,a)},useDebugValue:rh,useResponder:kd},th=null,uh=null,vh=!1;
|
4080 | function wh(a,b){var c=xh(5,null,null,0);c.elementType="DELETED";c.type="DELETED";c.stateNode=b;c.return=a;c.effectTag=8;null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect=a.lastEffect=c}function yh(a,b){switch(a.tag){case 5:var c=a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,!0):!1;case 6:return b=""===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,!0):!1;case 13:return!1;default:return!1}}
|
4081 | function zh(a){if(vh){var b=uh;if(b){var c=b;if(!yh(a,b)){b=Ne(c.nextSibling);if(!b||!yh(a,b)){a.effectTag|=2;vh=!1;th=a;return}wh(th,c)}th=a;uh=Ne(b.firstChild)}else a.effectTag|=2,vh=!1,th=a}}function Ah(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag&&18!==a.tag;)a=a.return;th=a}
|
4082 | function Bh(a){if(a!==th)return!1;if(!vh)return Ah(a),vh=!0,!1;var b=a.type;if(5!==a.tag||"head"!==b&&"body"!==b&&!Ke(b,a.memoizedProps))for(b=uh;b;)wh(a,b),b=Ne(b.nextSibling);Ah(a);uh=th?Ne(a.stateNode.nextSibling):null;return!0}function Ch(){uh=th=null;vh=!1}var Dh=Xb.ReactCurrentOwner,Lf=!1;function S(a,b,c,d){b.child=null===a?ug(b,null,c,d):tg(b,a.child,c,d)}
|
4083 | function Eh(a,b,c,d,e){c=c.render;var f=b.ref;Kf(b,e);d=dh(a,b,c,d,f,e);if(null!==a&&!Lf)return b.updateQueue=a.updateQueue,b.effectTag&=-517,a.expirationTime<=e&&(a.expirationTime=0),Fh(a,b,e);b.effectTag|=1;S(a,b,d,e);return b.child}
|
4084 | function Gh(a,b,c,d,e,f){if(null===a){var h=c.type;if("function"===typeof h&&!Hh(h)&&void 0===h.defaultProps&&null===c.compare&&void 0===c.defaultProps)return b.tag=15,b.type=h,Ih(a,b,h,d,e,f);a=qg(c.type,null,d,null,b.mode,f);a.ref=b.ref;a.return=b;return b.child=a}h=a.child;if(e<f&&(e=h.memoizedProps,c=c.compare,c=null!==c?c:jd,c(e,d)&&a.ref===b.ref))return Fh(a,b,f);b.effectTag|=1;a=og(h,d,f);a.ref=b.ref;a.return=b;return b.child=a}
|
4085 | function Ih(a,b,c,d,e,f){return null!==a&&jd(a.memoizedProps,d)&&a.ref===b.ref&&(Lf=!1,e<f)?Fh(a,b,f):Jh(a,b,c,d,f)}function Kh(a,b){var c=b.ref;if(null===a&&null!==c||null!==a&&a.ref!==c)b.effectTag|=128}function Jh(a,b,c,d,e){var f=N(c)?Re:L.current;f=Se(b,f);Kf(b,e);c=dh(a,b,c,d,f,e);if(null!==a&&!Lf)return b.updateQueue=a.updateQueue,b.effectTag&=-517,a.expirationTime<=e&&(a.expirationTime=0),Fh(a,b,e);b.effectTag|=1;S(a,b,c,e);return b.child}
|
4086 | function Lh(a,b,c,d,e){if(N(c)){var f=!0;Xe(b)}else f=!1;Kf(b,e);if(null===b.stateNode)null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2),hg(b,c,d,e),jg(b,c,d,e),d=!0;else if(null===a){var h=b.stateNode,g=b.memoizedProps;h.props=g;var k=h.context,l=c.contextType;"object"===typeof l&&null!==l?l=Mf(l):(l=N(c)?Re:L.current,l=Se(b,l));var n=c.getDerivedStateFromProps,z="function"===typeof n||"function"===typeof h.getSnapshotBeforeUpdate;z||"function"!==typeof h.UNSAFE_componentWillReceiveProps&&
|
4087 | "function"!==typeof h.componentWillReceiveProps||(g!==d||k!==l)&&ig(b,h,d,l);Nf=!1;var x=b.memoizedState;k=h.state=x;var v=b.updateQueue;null!==v&&(Wf(b,v,d,h,e),k=b.memoizedState);g!==d||x!==k||M.current||Nf?("function"===typeof n&&(bg(b,c,n,d),k=b.memoizedState),(g=Nf||gg(b,c,g,d,x,k,l))?(z||"function"!==typeof h.UNSAFE_componentWillMount&&"function"!==typeof h.componentWillMount||("function"===typeof h.componentWillMount&&h.componentWillMount(),"function"===typeof h.UNSAFE_componentWillMount&&
|
4088 | h.UNSAFE_componentWillMount()),"function"===typeof h.componentDidMount&&(b.effectTag|=4)):("function"===typeof h.componentDidMount&&(b.effectTag|=4),b.memoizedProps=d,b.memoizedState=k),h.props=d,h.state=k,h.context=l,d=g):("function"===typeof h.componentDidMount&&(b.effectTag|=4),d=!1)}else h=b.stateNode,g=b.memoizedProps,h.props=b.type===b.elementType?g:Af(b.type,g),k=h.context,l=c.contextType,"object"===typeof l&&null!==l?l=Mf(l):(l=N(c)?Re:L.current,l=Se(b,l)),n=c.getDerivedStateFromProps,(z=
|
4089 | "function"===typeof n||"function"===typeof h.getSnapshotBeforeUpdate)||"function"!==typeof h.UNSAFE_componentWillReceiveProps&&"function"!==typeof h.componentWillReceiveProps||(g!==d||k!==l)&&ig(b,h,d,l),Nf=!1,k=b.memoizedState,x=h.state=k,v=b.updateQueue,null!==v&&(Wf(b,v,d,h,e),x=b.memoizedState),g!==d||k!==x||M.current||Nf?("function"===typeof n&&(bg(b,c,n,d),x=b.memoizedState),(n=Nf||gg(b,c,g,d,k,x,l))?(z||"function"!==typeof h.UNSAFE_componentWillUpdate&&"function"!==typeof h.componentWillUpdate||
|
4090 | ("function"===typeof h.componentWillUpdate&&h.componentWillUpdate(d,x,l),"function"===typeof h.UNSAFE_componentWillUpdate&&h.UNSAFE_componentWillUpdate(d,x,l)),"function"===typeof h.componentDidUpdate&&(b.effectTag|=4),"function"===typeof h.getSnapshotBeforeUpdate&&(b.effectTag|=256)):("function"!==typeof h.componentDidUpdate||g===a.memoizedProps&&k===a.memoizedState||(b.effectTag|=4),"function"!==typeof h.getSnapshotBeforeUpdate||g===a.memoizedProps&&k===a.memoizedState||(b.effectTag|=256),b.memoizedProps=
|
4091 | d,b.memoizedState=x),h.props=d,h.state=x,h.context=l,d=n):("function"!==typeof h.componentDidUpdate||g===a.memoizedProps&&k===a.memoizedState||(b.effectTag|=4),"function"!==typeof h.getSnapshotBeforeUpdate||g===a.memoizedProps&&k===a.memoizedState||(b.effectTag|=256),d=!1);return Mh(a,b,c,d,f,e)}
|
4092 | function Mh(a,b,c,d,e,f){Kh(a,b);var h=0!==(b.effectTag&64);if(!d&&!h)return e&&Ye(b,c,!1),Fh(a,b,f);d=b.stateNode;Dh.current=b;var g=h&&"function"!==typeof c.getDerivedStateFromError?null:d.render();b.effectTag|=1;null!==a&&h?(b.child=tg(b,a.child,null,f),b.child=tg(b,null,g,f)):S(a,b,g,f);b.memoizedState=d.state;e&&Ye(b,c,!0);return b.child}function Nh(a){var b=a.stateNode;b.pendingContext?Ve(a,b.pendingContext,b.pendingContext!==b.context):b.context&&Ve(a,b.context,!1);Ag(a,b.containerInfo)}
|
4093 | var Oh={};
|
4094 | function Ph(a,b,c){var d=b.mode,e=b.pendingProps,f=P.current,h=null,g=!1,k;(k=0!==(b.effectTag&64))||(k=0!==(f&Gg)&&(null===a||null!==a.memoizedState));k?(h=Oh,g=!0,b.effectTag&=-65):null!==a&&null===a.memoizedState||void 0===e.fallback||!0===e.unstable_avoidThisFallback||(f|=Fg);f&=Eg;J(P,f,b);if(null===a)if(g){e=e.fallback;a=sg(null,d,0,null);a.return=b;if(0===(b.mode&2))for(g=null!==b.memoizedState?b.child.child:b.child,a.child=g;null!==g;)g.return=a,g=g.sibling;c=sg(e,d,c,null);c.return=b;a.sibling=
|
4095 | c;d=a}else d=c=ug(b,null,e.children,c);else{if(null!==a.memoizedState)if(f=a.child,d=f.sibling,g){e=e.fallback;c=og(f,f.pendingProps,0);c.return=b;if(0===(b.mode&2)&&(g=null!==b.memoizedState?b.child.child:b.child,g!==f.child))for(c.child=g;null!==g;)g.return=c,g=g.sibling;e=og(d,e,d.expirationTime);e.return=b;c.sibling=e;d=c;c.childExpirationTime=0;c=e}else d=c=tg(b,f.child,e.children,c);else if(f=a.child,g){g=e.fallback;e=sg(null,d,0,null);e.return=b;e.child=f;null!==f&&(f.return=e);if(0===(b.mode&
|
4096 | 2))for(f=null!==b.memoizedState?b.child.child:b.child,e.child=f;null!==f;)f.return=e,f=f.sibling;c=sg(g,d,c,null);c.return=b;e.sibling=c;c.effectTag|=2;d=e;e.childExpirationTime=0}else c=d=tg(b,f,e.children,c);b.stateNode=a.stateNode}b.memoizedState=h;b.child=d;return c}function Qh(a,b,c,d,e){var f=a.memoizedState;null===f?a.memoizedState={isBackwards:b,rendering:null,last:d,tail:c,tailExpiration:0,tailMode:e}:(f.isBackwards=b,f.rendering=null,f.last=d,f.tail=c,f.tailExpiration=0,f.tailMode=e)}
|
4097 | function Rh(a,b,c){var d=b.pendingProps,e=d.revealOrder,f=d.tail;S(a,b,d.children,c);d=P.current;if(0!==(d&Gg))d=d&Eg|Gg,b.effectTag|=64;else{if(null!==a&&0!==(a.effectTag&64))a:for(a=b.child;null!==a;){if(13===a.tag){if(null!==a.memoizedState){a.expirationTime<c&&(a.expirationTime=c);var h=a.alternate;null!==h&&h.expirationTime<c&&(h.expirationTime=c);Jf(a.return,c)}}else if(null!==a.child){a.child.return=a;a=a.child;continue}if(a===b)break a;for(;null===a.sibling;){if(null===a.return||a.return===
|
4098 | b)break a;a=a.return}a.sibling.return=a.return;a=a.sibling}d&=Eg}J(P,d,b);if(0===(b.mode&2))b.memoizedState=null;else switch(e){case "forwards":c=b.child;for(e=null;null!==c;)d=c.alternate,null!==d&&null===Hg(d)&&(e=c),c=c.sibling;c=e;null===c?(e=b.child,b.child=null):(e=c.sibling,c.sibling=null);Qh(b,!1,e,c,f);break;case "backwards":c=null;e=b.child;for(b.child=null;null!==e;){d=e.alternate;if(null!==d&&null===Hg(d)){b.child=e;break}d=e.sibling;e.sibling=c;c=e;e=d}Qh(b,!0,c,null,f);break;case "together":Qh(b,
|
4099 | !1,null,null,void 0);break;default:b.memoizedState=null}return b.child}function Fh(a,b,c){null!==a&&(b.dependencies=a.dependencies);if(b.childExpirationTime<c)return null;if(null!==a&&b.child!==a.child)throw t(Error(153));if(null!==b.child){a=b.child;c=og(a,a.pendingProps,a.expirationTime);b.child=c;for(c.return=b;null!==a.sibling;)a=a.sibling,c=c.sibling=og(a,a.pendingProps,a.expirationTime),c.return=b;c.sibling=null}return b.child}function Sh(a){a.effectTag|=4}
|
4100 | var Th=void 0,Uh=void 0,Vh=void 0,Wh=void 0;Th=function(a,b){for(var c=b.child;null!==c;){if(5===c.tag||6===c.tag)a.appendChild(c.stateNode);else if(20===c.tag)a.appendChild(c.stateNode.instance);else if(4!==c.tag&&null!==c.child){c.child.return=c;c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return}c.sibling.return=c.return;c=c.sibling}};Uh=function(){};
|
4101 | Vh=function(a,b,c,d,e){var f=a.memoizedProps;if(f!==d){var h=b.stateNode;zg(wg.current);a=null;switch(c){case "input":f=Bc(h,f);d=Bc(h,d);a=[];break;case "option":f=le(h,f);d=le(h,d);a=[];break;case "select":f=m({},f,{value:void 0});d=m({},d,{value:void 0});a=[];break;case "textarea":f=ne(h,f);d=ne(h,d);a=[];break;default:"function"!==typeof f.onClick&&"function"===typeof d.onClick&&(h.onclick=Ge)}De(c,d);h=c=void 0;var g=null;for(c in f)if(!d.hasOwnProperty(c)&&f.hasOwnProperty(c)&&null!=f[c])if("style"===
|
4102 | c){var k=f[c];for(h in k)k.hasOwnProperty(h)&&(g||(g={}),g[h]="")}else"dangerouslySetInnerHTML"!==c&&"children"!==c&&"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(ia.hasOwnProperty(c)?a||(a=[]):(a=a||[]).push(c,null));for(c in d){var l=d[c];k=null!=f?f[c]:void 0;if(d.hasOwnProperty(c)&&l!==k&&(null!=l||null!=k))if("style"===c)if(k){for(h in k)!k.hasOwnProperty(h)||l&&l.hasOwnProperty(h)||(g||(g={}),g[h]="");for(h in l)l.hasOwnProperty(h)&&k[h]!==l[h]&&(g||
|
4103 | (g={}),g[h]=l[h])}else g||(a||(a=[]),a.push(c,g)),g=l;else"dangerouslySetInnerHTML"===c?(l=l?l.__html:void 0,k=k?k.__html:void 0,null!=l&&k!==l&&(a=a||[]).push(c,""+l)):"children"===c?k===l||"string"!==typeof l&&"number"!==typeof l||(a=a||[]).push(c,""+l):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&(ia.hasOwnProperty(c)?(null!=l&&Fe(e,c),a||k===l||(a=[])):(a=a||[]).push(c,l))}g&&(a=a||[]).push("style",g);e=a;(b.updateQueue=e)&&Sh(b)}};Wh=function(a,b,c,d){c!==d&&Sh(b)};
|
4104 | function $h(a,b){switch(a.tailMode){case "hidden":b=a.tail;for(var c=null;null!==b;)null!==b.alternate&&(c=b),b=b.sibling;null===c?a.tail=null:c.sibling=null;break;case "collapsed":c=a.tail;for(var d=null;null!==c;)null!==c.alternate&&(d=c),c=c.sibling;null===d?b||null===a.tail?a.tail=null:a.tail.sibling=null:d.sibling=null}}
|
4105 | function ai(a){switch(a.tag){case 1:N(a.type)&&Te(a);var b=a.effectTag;return b&2048?(a.effectTag=b&-2049|64,a):null;case 3:Bg(a);Ue(a);b=a.effectTag;if(0!==(b&64))throw t(Error(285));a.effectTag=b&-2049|64;return a;case 5:return Dg(a),null;case 13:return H(P,a),b=a.effectTag,b&2048?(a.effectTag=b&-2049|64,a):null;case 18:return null;case 19:return H(P,a),null;case 4:return Bg(a),null;case 10:return If(a),null;default:return null}}function bi(a,b){return{value:a,source:b,stack:pc(b)}}
|
4106 | var ci="function"===typeof WeakSet?WeakSet:Set;function di(a,b){var c=b.source,d=b.stack;null===d&&null!==c&&(d=pc(c));null!==c&&oc(c.type);b=b.value;null!==a&&1===a.tag&&oc(a.type);try{console.error(b)}catch(e){setTimeout(function(){throw e;})}}function ei(a,b){try{b.props=a.memoizedProps,b.state=a.memoizedState,b.componentWillUnmount()}catch(c){fi(a,c)}}function gi(a){var b=a.ref;if(null!==b)if("function"===typeof b)try{b(null)}catch(c){fi(a,c)}else b.current=null}
|
4107 | function hi(a,b,c){c=c.updateQueue;c=null!==c?c.lastEffect:null;if(null!==c){var d=c=c.next;do{if((d.tag&a)!==Ig){var e=d.destroy;d.destroy=void 0;void 0!==e&&e()}(d.tag&b)!==Ig&&(e=d.create,d.destroy=e());d=d.next}while(d!==c)}}
|
4108 | function ii(a,b){"function"===typeof ji&&ji(a);switch(a.tag){case 0:case 11:case 14:case 15:var c=a.updateQueue;if(null!==c&&(c=c.lastEffect,null!==c)){var d=c.next;vf(97<b?97:b,function(){var b=d;do{var c=b.destroy;if(void 0!==c){var h=a;try{c()}catch(g){fi(h,g)}}b=b.next}while(b!==d)})}break;case 1:gi(a);b=a.stateNode;"function"===typeof b.componentWillUnmount&&ei(a,b);break;case 5:gi(a);break;case 4:ki(a,b)}}
|
4109 | function li(a,b){for(var c=a;;)if(ii(c,b),null!==c.child&&4!==c.tag)c.child.return=c,c=c.child;else{if(c===a)break;for(;null===c.sibling;){if(null===c.return||c.return===a)return;c=c.return}c.sibling.return=c.return;c=c.sibling}}function mi(a){return 5===a.tag||3===a.tag||4===a.tag}
|
4110 | function ni(a){a:{for(var b=a.return;null!==b;){if(mi(b)){var c=b;break a}b=b.return}throw t(Error(160));}b=c.stateNode;switch(c.tag){case 5:var d=!1;break;case 3:b=b.containerInfo;d=!0;break;case 4:b=b.containerInfo;d=!0;break;default:throw t(Error(161));}c.effectTag&16&&(we(b,""),c.effectTag&=-17);a:b:for(c=a;;){for(;null===c.sibling;){if(null===c.return||mi(c.return)){c=null;break a}c=c.return}c.sibling.return=c.return;for(c=c.sibling;5!==c.tag&&6!==c.tag&&18!==c.tag;){if(c.effectTag&2)continue b;
|
4111 | if(null===c.child||4===c.tag)continue b;else c.child.return=c,c=c.child}if(!(c.effectTag&2)){c=c.stateNode;break a}}for(var e=a;;){var f=5===e.tag||6===e.tag;if(f||20===e.tag){var h=f?e.stateNode:e.stateNode.instance;if(c)if(d){f=b;var g=h;h=c;8===f.nodeType?f.parentNode.insertBefore(g,h):f.insertBefore(g,h)}else b.insertBefore(h,c);else d?(g=b,8===g.nodeType?(f=g.parentNode,f.insertBefore(h,g)):(f=g,f.appendChild(h)),g=g._reactRootContainer,null!==g&&void 0!==g||null!==f.onclick||(f.onclick=Ge)):
|
4112 | b.appendChild(h)}else if(4!==e.tag&&null!==e.child){e.child.return=e;e=e.child;continue}if(e===a)break;for(;null===e.sibling;){if(null===e.return||e.return===a)return;e=e.return}e.sibling.return=e.return;e=e.sibling}}
|
4113 | function ki(a,b){for(var c=a,d=!1,e=void 0,f=void 0;;){if(!d){d=c.return;a:for(;;){if(null===d)throw t(Error(160));e=d.stateNode;switch(d.tag){case 5:f=!1;break a;case 3:e=e.containerInfo;f=!0;break a;case 4:e=e.containerInfo;f=!0;break a}d=d.return}d=!0}if(5===c.tag||6===c.tag)if(li(c,b),f){var h=e,g=c.stateNode;8===h.nodeType?h.parentNode.removeChild(g):h.removeChild(g)}else e.removeChild(c.stateNode);else if(20===c.tag)g=c.stateNode.instance,li(c,b),f?(h=e,8===h.nodeType?h.parentNode.removeChild(g):
|
4114 | h.removeChild(g)):e.removeChild(g);else if(4===c.tag){if(null!==c.child){e=c.stateNode.containerInfo;f=!0;c.child.return=c;c=c.child;continue}}else if(ii(c,b),null!==c.child){c.child.return=c;c=c.child;continue}if(c===a)break;for(;null===c.sibling;){if(null===c.return||c.return===a)return;c=c.return;4===c.tag&&(d=!1)}c.sibling.return=c.return;c=c.sibling}}
|
4115 | function oi(a,b){switch(b.tag){case 0:case 11:case 14:case 15:hi(Kg,Lg,b);break;case 1:break;case 5:var c=b.stateNode;if(null!=c){var d=b.memoizedProps,e=null!==a?a.memoizedProps:d;a=b.type;var f=b.updateQueue;b.updateQueue=null;if(null!==f){c[Ga]=d;"input"===a&&"radio"===d.type&&null!=d.name&&Dc(c,d);Ee(a,e);b=Ee(a,d);for(e=0;e<f.length;e+=2){var h=f[e],g=f[e+1];"style"===h?Ae(c,g):"dangerouslySetInnerHTML"===h?ve(c,g):"children"===h?we(c,g):zc(c,h,g,b)}switch(a){case "input":Ec(c,d);break;case "textarea":pe(c,
|
4116 | d);break;case "select":b=c._wrapperState.wasMultiple,c._wrapperState.wasMultiple=!!d.multiple,a=d.value,null!=a?me(c,!!d.multiple,a,!1):b!==!!d.multiple&&(null!=d.defaultValue?me(c,!!d.multiple,d.defaultValue,!0):me(c,!!d.multiple,d.multiple?[]:"",!1))}}}break;case 6:if(null===b.stateNode)throw t(Error(162));b.stateNode.nodeValue=b.memoizedProps;break;case 3:break;case 12:break;case 13:c=b;null===b.memoizedState?d=!1:(d=!0,c=b.child,pi=sf());if(null!==c)a:for(a=c;;){if(5===a.tag)f=a.stateNode,d?(f=
|
4117 | f.style,"function"===typeof f.setProperty?f.setProperty("display","none","important"):f.display="none"):(f=a.stateNode,e=a.memoizedProps.style,e=void 0!==e&&null!==e&&e.hasOwnProperty("display")?e.display:null,f.style.display=ze("display",e));else if(6===a.tag)a.stateNode.nodeValue=d?"":a.memoizedProps;else if(13===a.tag&&null!==a.memoizedState){f=a.child.sibling;f.return=a;a=f;continue}else if(null!==a.child){a.child.return=a;a=a.child;continue}if(a===c)break a;for(;null===a.sibling;){if(null===
|
4118 | a.return||a.return===c)break a;a=a.return}a.sibling.return=a.return;a=a.sibling}qi(b);break;case 19:qi(b);break;case 17:break;case 20:break;default:throw t(Error(163));}}function qi(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new ci);b.forEach(function(b){var d=ri.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}}var si="function"===typeof WeakMap?WeakMap:Map;
|
4119 | function ti(a,b,c){c=Qf(c,null);c.tag=3;c.payload={element:null};var d=b.value;c.callback=function(){ui||(ui=!0,vi=d);di(a,b)};return c}
|
4120 | function wi(a,b,c){c=Qf(c,null);c.tag=3;var d=a.type.getDerivedStateFromError;if("function"===typeof d){var e=b.value;c.payload=function(){di(a,b);return d(e)}}var f=a.stateNode;null!==f&&"function"===typeof f.componentDidCatch&&(c.callback=function(){"function"!==typeof d&&(null===xi?xi=new Set([this]):xi.add(this),di(a,b));var c=b.stack;this.componentDidCatch(b.value,{componentStack:null!==c?c:""})});return c}
|
4121 | var yi=Math.ceil,zi=Xb.ReactCurrentDispatcher,Ai=Xb.ReactCurrentOwner,T=0,Bi=8,Ci=16,Di=32,Ei=0,Fi=1,Gi=2,Hi=3,Ii=4,U=T,Ji=null,V=null,W=0,X=Ei,Ki=1073741823,Li=1073741823,Mi=null,Ni=!1,pi=0,Oi=500,Y=null,ui=!1,vi=null,xi=null,Pi=!1,Qi=null,Ri=90,Si=0,Ti=null,Ui=0,Vi=null,Wi=0;function cg(){return(U&(Ci|Di))!==T?1073741821-(sf()/10|0):0!==Wi?Wi:Wi=1073741821-(sf()/10|0)}
|
4122 | function dg(a,b,c){b=b.mode;if(0===(b&2))return 1073741823;var d=tf();if(0===(b&4))return 99===d?1073741823:1073741822;if((U&Ci)!==T)return W;if(null!==c)a=1073741821-25*(((1073741821-a+(c.timeoutMs|0||5E3)/10)/25|0)+1);else switch(d){case 99:a=1073741823;break;case 98:a=1073741821-10*(((1073741821-a+15)/10|0)+1);break;case 97:case 96:a=1073741821-25*(((1073741821-a+500)/25|0)+1);break;case 95:a=1;break;default:throw t(Error(326));}null!==Ji&&a===W&&--a;return a}var Xi=0;
|
4123 | function eg(a,b){if(50<Ui)throw Ui=0,Vi=null,t(Error(185));a=Yi(a,b);if(null!==a){a.pingTime=0;var c=tf();if(1073741823===b)if((U&Bi)!==T&&(U&(Ci|Di))===T)for(var d=Z(a,1073741823,!0);null!==d;)d=d(!0);else Zi(a,99,1073741823),U===T&&O();else Zi(a,c,b);(U&4)===T||98!==c&&99!==c||(null===Ti?Ti=new Map([[a,b]]):(c=Ti.get(a),(void 0===c||c>b)&&Ti.set(a,b)))}}
|
4124 | function Yi(a,b){a.expirationTime<b&&(a.expirationTime=b);var c=a.alternate;null!==c&&c.expirationTime<b&&(c.expirationTime=b);var d=a.return,e=null;if(null===d&&3===a.tag)e=a.stateNode;else for(;null!==d;){c=d.alternate;d.childExpirationTime<b&&(d.childExpirationTime=b);null!==c&&c.childExpirationTime<b&&(c.childExpirationTime=b);if(null===d.return&&3===d.tag){e=d.stateNode;break}d=d.return}null!==e&&(b>e.firstPendingTime&&(e.firstPendingTime=b),a=e.lastPendingTime,0===a||b<a)&&(e.lastPendingTime=
|
4125 | b);return e}function Zi(a,b,c){if(a.callbackExpirationTime<c){var d=a.callbackNode;null!==d&&d!==mf&&af(d);a.callbackExpirationTime=c;1073741823===c?a.callbackNode=xf($i.bind(null,a,Z.bind(null,a,c))):(d=null,1!==c&&(d={timeout:10*(1073741821-c)-sf()}),a.callbackNode=wf(b,$i.bind(null,a,Z.bind(null,a,c)),d))}}function $i(a,b,c){var d=a.callbackNode,e=null;try{return e=b(c),null!==e?$i.bind(null,a,e):null}finally{null===e&&d===a.callbackNode&&(a.callbackNode=null,a.callbackExpirationTime=0)}}
|
4126 | function aj(){(U&(1|Ci|Di))===T&&(bj(),cj())}function dj(a,b){var c=a.firstBatch;return null!==c&&c._defer&&c._expirationTime>=b?(wf(97,function(){c._onComplete();return null}),!0):!1}function bj(){if(null!==Ti){var a=Ti;Ti=null;a.forEach(function(a,c){xf(Z.bind(null,c,a))});O()}}function ej(a,b){var c=U;U|=1;try{return a(b)}finally{U=c,U===T&&O()}}function fj(a,b,c,d){var e=U;U|=4;try{return vf(98,a.bind(null,b,c,d))}finally{U=e,U===T&&O()}}
|
4127 | function gj(a,b){var c=U;U&=-2;U|=Bi;try{return a(b)}finally{U=c,U===T&&O()}}
|
4128 | function hj(a,b){a.finishedWork=null;a.finishedExpirationTime=0;var c=a.timeoutHandle;-1!==c&&(a.timeoutHandle=-1,Me(c));if(null!==V)for(c=V.return;null!==c;){var d=c;switch(d.tag){case 1:var e=d.type.childContextTypes;null!==e&&void 0!==e&&Te(d);break;case 3:Bg(d);Ue(d);break;case 5:Dg(d);break;case 4:Bg(d);break;case 13:H(P,d);break;case 19:H(P,d);break;case 10:If(d)}c=c.return}Ji=a;V=og(a.current,null,b);W=b;X=Ei;Li=Ki=1073741823;Mi=null;Ni=!1}
|
4129 | function Z(a,b,c){if((U&(Ci|Di))!==T)throw t(Error(327));if(a.firstPendingTime<b)return null;if(c&&a.finishedExpirationTime===b)return ij.bind(null,a);cj();if(a!==Ji||b!==W)hj(a,b);else if(X===Hi)if(Ni)hj(a,b);else{var d=a.lastPendingTime;if(d<b)return Z.bind(null,a,d)}if(null!==V){d=U;U|=Ci;var e=zi.current;null===e&&(e=hh);zi.current=hh;if(c){if(1073741823!==b){var f=cg();if(f<b)return U=d,Gf(),zi.current=e,Z.bind(null,a,f)}}else Wi=0;do try{if(c)for(;null!==V;)V=jj(V);else for(;null!==V&&!bf();)V=
|
4130 | jj(V);break}catch(rb){Gf();ih();f=V;if(null===f||null===f.return)throw hj(a,b),U=d,rb;a:{var h=a,g=f.return,k=f,l=rb,n=W;k.effectTag|=1024;k.firstEffect=k.lastEffect=null;if(null!==l&&"object"===typeof l&&"function"===typeof l.then){var z=l,x=0!==(P.current&Fg);l=g;do{var v;if(v=13===l.tag)null!==l.memoizedState?v=!1:(v=l.memoizedProps,v=void 0===v.fallback?!1:!0!==v.unstable_avoidThisFallback?!0:x?!1:!0);if(v){g=l.updateQueue;null===g?(g=new Set,g.add(z),l.updateQueue=g):g.add(z);if(0===(l.mode&
|
4131 | 2)){l.effectTag|=64;k.effectTag&=-1957;1===k.tag&&(null===k.alternate?k.tag=17:(n=Qf(1073741823,null),n.tag=2,Sf(k,n)));k.expirationTime=1073741823;break a}k=h;h=n;x=k.pingCache;null===x?(x=k.pingCache=new si,g=new Set,x.set(z,g)):(g=x.get(z),void 0===g&&(g=new Set,x.set(z,g)));g.has(h)||(g.add(h),k=kj.bind(null,k,z,h),z.then(k,k));l.effectTag|=2048;l.expirationTime=n;break a}l=l.return}while(null!==l);l=Error((oc(k.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display."+
|
4132 | pc(k))}X!==Ii&&(X=Fi);l=bi(l,k);k=g;do{switch(k.tag){case 3:k.effectTag|=2048;k.expirationTime=n;n=ti(k,l,n);Tf(k,n);break a;case 1:if(z=l,h=k.type,g=k.stateNode,0===(k.effectTag&64)&&("function"===typeof h.getDerivedStateFromError||null!==g&&"function"===typeof g.componentDidCatch&&(null===xi||!xi.has(g)))){k.effectTag|=2048;k.expirationTime=n;n=wi(k,z,n);Tf(k,n);break a}}k=k.return}while(null!==k)}V=lj(f)}while(1);U=d;Gf();zi.current=e;if(null!==V)return Z.bind(null,a,b)}a.finishedWork=a.current.alternate;
|
4133 | a.finishedExpirationTime=b;if(dj(a,b))return null;Ji=null;switch(X){case Ei:throw t(Error(328));case Fi:return d=a.lastPendingTime,d<b?Z.bind(null,a,d):c?ij.bind(null,a):(hj(a,b),xf(Z.bind(null,a,b)),null);case Gi:if(1073741823===Ki&&!c&&(c=pi+Oi-sf(),10<c)){if(Ni)return hj(a,b),Z.bind(null,a,b);d=a.lastPendingTime;if(d<b)return Z.bind(null,a,d);a.timeoutHandle=Le(ij.bind(null,a),c);return null}return ij.bind(null,a);case Hi:if(!c){if(Ni)return hj(a,b),Z.bind(null,a,b);c=a.lastPendingTime;if(c<b)return Z.bind(null,
|
4134 | a,c);1073741823!==Li?c=10*(1073741821-Li)-sf():1073741823===Ki?c=0:(c=10*(1073741821-Ki)-5E3,d=sf(),b=10*(1073741821-b)-d,c=d-c,0>c&&(c=0),c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3E3>c?3E3:4320>c?4320:1960*yi(c/1960))-c,b<c&&(c=b));if(10<c)return a.timeoutHandle=Le(ij.bind(null,a),c),null}return ij.bind(null,a);case Ii:return!c&&1073741823!==Ki&&null!==Mi&&(d=Ki,e=Mi,b=e.busyMinDurationMs|0,0>=b?b=0:(c=e.busyDelayMs|0,d=sf()-(10*(1073741821-d)-(e.timeoutMs|0||5E3)),b=d<=c?0:c+b-d),10<b)?(a.timeoutHandle=
|
4135 | Le(ij.bind(null,a),b),null):ij.bind(null,a);default:throw t(Error(329));}}function Xf(a,b){a<Ki&&1<a&&(Ki=a);null!==b&&a<Li&&1<a&&(Li=a,Mi=b)}function jj(a){var b=mj(a.alternate,a,W);a.memoizedProps=a.pendingProps;null===b&&(b=lj(a));Ai.current=null;return b}
|
4136 | function lj(a){V=a;do{var b=V.alternate;a=V.return;if(0===(V.effectTag&1024)){a:{var c=b;b=V;var d=W,e=b.pendingProps;switch(b.tag){case 2:break;case 16:break;case 15:case 0:break;case 1:N(b.type)&&Te(b);break;case 3:Bg(b);Ue(b);d=b.stateNode;d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null);if(null===c||null===c.child)Bh(b),b.effectTag&=-3;Uh(b);break;case 5:Dg(b);d=zg(yg.current);var f=b.type;if(null!==c&&null!=b.stateNode)Vh(c,b,f,e,d),c.ref!==b.ref&&(b.effectTag|=128);else if(e){var h=
|
4137 | zg(wg.current);if(Bh(b)){c=b;e=void 0;f=c.stateNode;var g=c.type,k=c.memoizedProps;f[Fa]=c;f[Ga]=k;switch(g){case "iframe":case "object":case "embed":G("load",f);break;case "video":case "audio":for(var l=0;l<bb.length;l++)G(bb[l],f);break;case "source":G("error",f);break;case "img":case "image":case "link":G("error",f);G("load",f);break;case "form":G("reset",f);G("submit",f);break;case "details":G("toggle",f);break;case "input":Cc(f,k);G("invalid",f);Fe(d,"onChange");break;case "select":f._wrapperState=
|
4138 | {wasMultiple:!!k.multiple};G("invalid",f);Fe(d,"onChange");break;case "textarea":oe(f,k),G("invalid",f),Fe(d,"onChange")}De(g,k);l=null;for(e in k)k.hasOwnProperty(e)&&(h=k[e],"children"===e?"string"===typeof h?f.textContent!==h&&(l=["children",h]):"number"===typeof h&&f.textContent!==""+h&&(l=["children",""+h]):ia.hasOwnProperty(e)&&null!=h&&Fe(d,e));switch(g){case "input":Vb(f);Gc(f,k,!0);break;case "textarea":Vb(f);qe(f,k);break;case "select":case "option":break;default:"function"===typeof k.onClick&&
|
4139 | (f.onclick=Ge)}d=l;c.updateQueue=d;null!==d&&Sh(b)}else{k=f;c=e;g=b;l=9===d.nodeType?d:d.ownerDocument;h===re.html&&(h=se(k));h===re.html?"script"===k?(k=l.createElement("div"),k.innerHTML="<script>\x3c/script>",l=k.removeChild(k.firstChild)):"string"===typeof c.is?l=l.createElement(k,{is:c.is}):(l=l.createElement(k),"select"===k&&(k=l,c.multiple?k.multiple=!0:c.size&&(k.size=c.size))):l=l.createElementNS(h,k);k=l;k[Fa]=g;k[Ga]=c;c=k;Th(c,b,!1,!1);g=c;var n=d,z=Ee(f,e);switch(f){case "iframe":case "object":case "embed":G("load",
|
4140 | g);d=e;break;case "video":case "audio":for(d=0;d<bb.length;d++)G(bb[d],g);d=e;break;case "source":G("error",g);d=e;break;case "img":case "image":case "link":G("error",g);G("load",g);d=e;break;case "form":G("reset",g);G("submit",g);d=e;break;case "details":G("toggle",g);d=e;break;case "input":Cc(g,e);d=Bc(g,e);G("invalid",g);Fe(n,"onChange");break;case "option":d=le(g,e);break;case "select":g._wrapperState={wasMultiple:!!e.multiple};d=m({},e,{value:void 0});G("invalid",g);Fe(n,"onChange");break;case "textarea":oe(g,
|
4141 | e);d=ne(g,e);G("invalid",g);Fe(n,"onChange");break;default:d=e}De(f,d);k=void 0;l=f;h=g;var x=d;for(k in x)if(x.hasOwnProperty(k)){var v=x[k];"style"===k?Ae(h,v):"dangerouslySetInnerHTML"===k?(v=v?v.__html:void 0,null!=v&&ve(h,v)):"children"===k?"string"===typeof v?("textarea"!==l||""!==v)&&we(h,v):"number"===typeof v&&we(h,""+v):"suppressContentEditableWarning"!==k&&"suppressHydrationWarning"!==k&&"autoFocus"!==k&&(ia.hasOwnProperty(k)?null!=v&&Fe(n,k):null!=v&&zc(h,k,v,z))}switch(f){case "input":Vb(g);
|
4142 | Gc(g,e,!1);break;case "textarea":Vb(g);qe(g,e);break;case "option":null!=e.value&&g.setAttribute("value",""+Ac(e.value));break;case "select":d=g;g=e;d.multiple=!!g.multiple;k=g.value;null!=k?me(d,!!g.multiple,k,!1):null!=g.defaultValue&&me(d,!!g.multiple,g.defaultValue,!0);break;default:"function"===typeof d.onClick&&(g.onclick=Ge)}Je(f,e)&&Sh(b);b.stateNode=c}null!==b.ref&&(b.effectTag|=128)}else if(null===b.stateNode)throw t(Error(166));break;case 6:if(c&&null!=b.stateNode)Wh(c,b,c.memoizedProps,
|
4143 | e);else{if("string"!==typeof e&&null===b.stateNode)throw t(Error(166));c=zg(yg.current);zg(wg.current);Bh(b)?(d=b.stateNode,c=b.memoizedProps,d[Fa]=b,d.nodeValue!==c&&Sh(b)):(d=b,c=(9===c.nodeType?c:c.ownerDocument).createTextNode(e),c[Fa]=b,d.stateNode=c)}break;case 11:break;case 13:H(P,b);e=b.memoizedState;if(0!==(b.effectTag&64)){b.expirationTime=d;break a}d=null!==e;e=!1;null===c?Bh(b):(f=c.memoizedState,e=null!==f,d||null===f||(f=c.child.sibling,null!==f&&(g=b.firstEffect,null!==g?(b.firstEffect=
|
4144 | f,f.nextEffect=g):(b.firstEffect=b.lastEffect=f,f.nextEffect=null),f.effectTag=8)));if(d&&!e&&0!==(b.mode&2))if(null===c&&!0!==b.memoizedProps.unstable_avoidThisFallback||0!==(P.current&Fg))X===Ei&&(X=Gi);else if(X===Ei||X===Gi)X=Hi;if(d||e)b.effectTag|=4;break;case 7:break;case 8:break;case 12:break;case 4:Bg(b);Uh(b);break;case 10:If(b);break;case 9:break;case 14:break;case 17:N(b.type)&&Te(b);break;case 18:break;case 19:H(P,b);e=b.memoizedState;if(null===e)break;f=0!==(b.effectTag&64);g=e.rendering;
|
4145 | if(null===g)if(f)$h(e,!1);else{if(X!==Ei||null!==c&&0!==(c.effectTag&64))for(c=b.child;null!==c;){g=Hg(c);if(null!==g){b.effectTag|=64;$h(e,!1);c=g.updateQueue;null!==c&&(b.updateQueue=c,b.effectTag|=4);b.firstEffect=b.lastEffect=null;for(c=b.child;null!==c;)e=c,f=d,e.effectTag&=2,e.nextEffect=null,e.firstEffect=null,e.lastEffect=null,g=e.alternate,null===g?(e.childExpirationTime=0,e.expirationTime=f,e.child=null,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null):(e.childExpirationTime=
|
4146 | g.childExpirationTime,e.expirationTime=g.expirationTime,e.child=g.child,e.memoizedProps=g.memoizedProps,e.memoizedState=g.memoizedState,e.updateQueue=g.updateQueue,f=g.dependencies,e.dependencies=null===f?null:{expirationTime:f.expirationTime,firstContext:f.firstContext,responders:f.responders}),c=c.sibling;J(P,P.current&Eg|Gg,b);b=b.child;break a}c=c.sibling}}else{if(!f)if(c=Hg(g),null!==c){if(b.effectTag|=64,f=!0,$h(e,!0),null===e.tail&&"hidden"===e.tailMode){d=c.updateQueue;null!==d&&(b.updateQueue=
|
4147 | d,b.effectTag|=4);b=b.lastEffect=e.lastEffect;null!==b&&(b.nextEffect=null);break}}else sf()>e.tailExpiration&&1<d&&(b.effectTag|=64,f=!0,$h(e,!1),b.expirationTime=b.childExpirationTime=d-1);e.isBackwards?(g.sibling=b.child,b.child=g):(d=e.last,null!==d?d.sibling=g:b.child=g,e.last=g)}if(null!==e.tail){0===e.tailExpiration&&(e.tailExpiration=sf()+500);d=e.tail;e.rendering=d;e.tail=d.sibling;e.lastEffect=b.lastEffect;d.sibling=null;c=P.current;c=f?c&Eg|Gg:c&Eg;J(P,c,b);b=d;break a}break;case 20:break;
|
4148 | default:throw t(Error(156));}b=null}d=V;if(1===W||1!==d.childExpirationTime){c=0;for(e=d.child;null!==e;)f=e.expirationTime,g=e.childExpirationTime,f>c&&(c=f),g>c&&(c=g),e=e.sibling;d.childExpirationTime=c}if(null!==b)return b;null!==a&&0===(a.effectTag&1024)&&(null===a.firstEffect&&(a.firstEffect=V.firstEffect),null!==V.lastEffect&&(null!==a.lastEffect&&(a.lastEffect.nextEffect=V.firstEffect),a.lastEffect=V.lastEffect),1<V.effectTag&&(null!==a.lastEffect?a.lastEffect.nextEffect=V:a.firstEffect=V,
|
4149 | a.lastEffect=V))}else{b=ai(V,W);if(null!==b)return b.effectTag&=1023,b;null!==a&&(a.firstEffect=a.lastEffect=null,a.effectTag|=1024)}b=V.sibling;if(null!==b)return b;V=a}while(null!==V);X===Ei&&(X=Ii);return null}function ij(a){var b=tf();vf(99,nj.bind(null,a,b));null!==Qi&&wf(97,function(){cj();return null});return null}
|
4150 | function nj(a,b){cj();if((U&(Ci|Di))!==T)throw t(Error(327));var c=a.finishedWork,d=a.finishedExpirationTime;if(null===c)return null;a.finishedWork=null;a.finishedExpirationTime=0;if(c===a.current)throw t(Error(177));a.callbackNode=null;a.callbackExpirationTime=0;var e=c.expirationTime,f=c.childExpirationTime;e=f>e?f:e;a.firstPendingTime=e;e<a.lastPendingTime&&(a.lastPendingTime=e);a===Ji&&(V=Ji=null,W=0);1<c.effectTag?null!==c.lastEffect?(c.lastEffect.nextEffect=c,e=c.firstEffect):e=c:e=c.firstEffect;
|
4151 | if(null!==e){f=U;U|=Di;Ai.current=null;He=Qd;var h=ae();if(be(h)){if("selectionStart"in h)var g={start:h.selectionStart,end:h.selectionEnd};else a:{g=(g=h.ownerDocument)&&g.defaultView||window;var k=g.getSelection&&g.getSelection();if(k&&0!==k.rangeCount){g=k.anchorNode;var l=k.anchorOffset,n=k.focusNode;k=k.focusOffset;try{g.nodeType,n.nodeType}catch(zb){g=null;break a}var z=0,x=-1,v=-1,rb=0,Be=0,u=h,w=null;b:for(;;){for(var C;;){u!==g||0!==l&&3!==u.nodeType||(x=z+l);u!==n||0!==k&&3!==u.nodeType||
|
4152 | (v=z+k);3===u.nodeType&&(z+=u.nodeValue.length);if(null===(C=u.firstChild))break;w=u;u=C}for(;;){if(u===h)break b;w===g&&++rb===l&&(x=z);w===n&&++Be===k&&(v=z);if(null!==(C=u.nextSibling))break;u=w;w=u.parentNode}u=C}g=-1===x||-1===v?null:{start:x,end:v}}else g=null}g=g||{start:0,end:0}}else g=null;Ie={focusedElem:h,selectionRange:g};Qd=!1;Y=e;do try{for(;null!==Y;){if(0!==(Y.effectTag&256)){var I=Y.alternate;h=Y;switch(h.tag){case 0:case 11:case 15:hi(Jg,Ig,h);break;case 1:if(h.effectTag&256&&null!==
|
4153 | I){var E=I.memoizedProps,ua=I.memoizedState,gh=h.stateNode,oj=gh.getSnapshotBeforeUpdate(h.elementType===h.type?E:Af(h.type,E),ua);gh.__reactInternalSnapshotBeforeUpdate=oj}break;case 3:case 5:case 6:case 4:case 17:break;default:throw t(Error(163));}}Y=Y.nextEffect}}catch(zb){if(null===Y)throw t(Error(330));fi(Y,zb);Y=Y.nextEffect}while(null!==Y);Y=e;do try{for(I=b;null!==Y;){var A=Y.effectTag;A&16&&we(Y.stateNode,"");if(A&128){var p=Y.alternate;if(null!==p){var r=p.ref;null!==r&&("function"===typeof r?
|
4154 | r(null):r.current=null)}}switch(A&14){case 2:ni(Y);Y.effectTag&=-3;break;case 6:ni(Y);Y.effectTag&=-3;oi(Y.alternate,Y);break;case 4:oi(Y.alternate,Y);break;case 8:E=Y;ki(E,I);E.return=null;E.child=null;E.memoizedState=null;E.updateQueue=null;E.dependencies=null;var K=E.alternate;null!==K&&(K.return=null,K.child=null,K.memoizedState=null,K.updateQueue=null,K.dependencies=null)}Y=Y.nextEffect}}catch(zb){if(null===Y)throw t(Error(330));fi(Y,zb);Y=Y.nextEffect}while(null!==Y);r=Ie;p=ae();A=r.focusedElem;
|
4155 | I=r.selectionRange;if(p!==A&&A&&A.ownerDocument&&$d(A.ownerDocument.documentElement,A)){null!==I&&be(A)&&(p=I.start,r=I.end,void 0===r&&(r=p),"selectionStart"in A?(A.selectionStart=p,A.selectionEnd=Math.min(r,A.value.length)):(r=(p=A.ownerDocument||document)&&p.defaultView||window,r.getSelection&&(r=r.getSelection(),E=A.textContent.length,K=Math.min(I.start,E),I=void 0===I.end?K:Math.min(I.end,E),!r.extend&&K>I&&(E=I,I=K,K=E),E=Zd(A,K),ua=Zd(A,I),E&&ua&&(1!==r.rangeCount||r.anchorNode!==E.node||r.anchorOffset!==
|
4156 | E.offset||r.focusNode!==ua.node||r.focusOffset!==ua.offset)&&(p=p.createRange(),p.setStart(E.node,E.offset),r.removeAllRanges(),K>I?(r.addRange(p),r.extend(ua.node,ua.offset)):(p.setEnd(ua.node,ua.offset),r.addRange(p))))));p=[];for(r=A;r=r.parentNode;)1===r.nodeType&&p.push({element:r,left:r.scrollLeft,top:r.scrollTop});"function"===typeof A.focus&&A.focus();for(A=0;A<p.length;A++)r=p[A],r.element.scrollLeft=r.left,r.element.scrollTop=r.top}Ie=null;Qd=!!He;He=null;a.current=c;Y=e;do try{for(A=d;null!==
|
4157 | Y;){var $a=Y.effectTag;if($a&36){var nc=Y.alternate;p=Y;r=A;switch(p.tag){case 0:case 11:case 15:hi(Mg,Ng,p);break;case 1:var md=p.stateNode;if(p.effectTag&4)if(null===nc)md.componentDidMount();else{var Fj=p.elementType===p.type?nc.memoizedProps:Af(p.type,nc.memoizedProps);md.componentDidUpdate(Fj,nc.memoizedState,md.__reactInternalSnapshotBeforeUpdate)}var Xh=p.updateQueue;null!==Xh&&Yf(p,Xh,md,r);break;case 3:var Yh=p.updateQueue;if(null!==Yh){K=null;if(null!==p.child)switch(p.child.tag){case 5:K=
|
4158 | p.child.stateNode;break;case 1:K=p.child.stateNode}Yf(p,Yh,K,r)}break;case 5:var Gj=p.stateNode;null===nc&&p.effectTag&4&&(r=Gj,Je(p.type,p.memoizedProps)&&r.focus());break;case 6:break;case 4:break;case 12:break;case 13:case 19:case 17:case 20:break;default:throw t(Error(163));}}if($a&128){var nd=Y.ref;if(null!==nd){var Zh=Y.stateNode;switch(Y.tag){case 5:var gf=Zh;break;default:gf=Zh}"function"===typeof nd?nd(gf):nd.current=gf}}$a&512&&(Pi=!0);Y=Y.nextEffect}}catch(zb){if(null===Y)throw t(Error(330));
|
4159 | fi(Y,zb);Y=Y.nextEffect}while(null!==Y);Y=null;nf();U=f}else a.current=c;if(Pi)Pi=!1,Qi=a,Si=d,Ri=b;else for(Y=e;null!==Y;)b=Y.nextEffect,Y.nextEffect=null,Y=b;b=a.firstPendingTime;0!==b?($a=cg(),$a=zf($a,b),Zi(a,$a,b)):xi=null;"function"===typeof pj&&pj(c.stateNode,d);1073741823===b?a===Vi?Ui++:(Ui=0,Vi=a):Ui=0;if(ui)throw ui=!1,a=vi,vi=null,a;if((U&Bi)!==T)return null;O();return null}
|
4160 | function cj(){if(null===Qi)return!1;var a=Qi,b=Si,c=Ri;Qi=null;Si=0;Ri=90;return vf(97<c?97:c,qj.bind(null,a,b))}function qj(a){if((U&(Ci|Di))!==T)throw t(Error(331));var b=U;U|=Di;for(a=a.current.firstEffect;null!==a;){try{var c=a;if(0!==(c.effectTag&512))switch(c.tag){case 0:case 11:case 15:hi(Pg,Ig,c),hi(Ig,Og,c)}}catch(d){if(null===a)throw t(Error(330));fi(a,d)}c=a.nextEffect;a.nextEffect=null;a=c}U=b;O();return!0}
|
4161 | function rj(a,b,c){b=bi(c,b);b=ti(a,b,1073741823);Sf(a,b);a=Yi(a,1073741823);null!==a&&Zi(a,99,1073741823)}function fi(a,b){if(3===a.tag)rj(a,a,b);else for(var c=a.return;null!==c;){if(3===c.tag){rj(c,a,b);break}else if(1===c.tag){var d=c.stateNode;if("function"===typeof c.type.getDerivedStateFromError||"function"===typeof d.componentDidCatch&&(null===xi||!xi.has(d))){a=bi(b,a);a=wi(c,a,1073741823);Sf(c,a);c=Yi(c,1073741823);null!==c&&Zi(c,99,1073741823);break}}c=c.return}}
|
4162 | function kj(a,b,c){var d=a.pingCache;null!==d&&d.delete(b);Ji===a&&W===c?X===Hi||X===Gi&&1073741823===Ki&&sf()-pi<Oi?hj(a,W):Ni=!0:a.lastPendingTime<c||(b=a.pingTime,0!==b&&b<c||(a.pingTime=c,a.finishedExpirationTime===c&&(a.finishedExpirationTime=0,a.finishedWork=null),b=cg(),b=zf(b,c),Zi(a,b,c)))}function ri(a,b){var c=a.stateNode;null!==c&&c.delete(b);c=cg();b=dg(c,a,null);c=zf(c,b);a=Yi(a,b);null!==a&&Zi(a,c,b)}var mj=void 0;
|
4163 | mj=function(a,b,c){var d=b.expirationTime;if(null!==a){var e=b.pendingProps;if(a.memoizedProps!==e||M.current)Lf=!0;else if(d<c){Lf=!1;switch(b.tag){case 3:Nh(b);Ch();break;case 5:Cg(b);if(b.mode&4&&1!==c&&e.hidden)return b.expirationTime=b.childExpirationTime=1,null;break;case 1:N(b.type)&&Xe(b);break;case 4:Ag(b,b.stateNode.containerInfo);break;case 10:Hf(b,b.memoizedProps.value);break;case 13:if(null!==b.memoizedState){d=b.child.childExpirationTime;if(0!==d&&d>=c)return Ph(a,b,c);J(P,P.current&
|
4164 | Eg,b);b=Fh(a,b,c);return null!==b?b.sibling:null}J(P,P.current&Eg,b);break;case 19:d=b.childExpirationTime>=c;if(0!==(a.effectTag&64)){if(d)return Rh(a,b,c);b.effectTag|=64}e=b.memoizedState;null!==e&&(e.rendering=null,e.tail=null);J(P,P.current,b);if(!d)return null}return Fh(a,b,c)}}else Lf=!1;b.expirationTime=0;switch(b.tag){case 2:d=b.type;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);a=b.pendingProps;e=Se(b,L.current);Kf(b,c);e=dh(null,b,d,a,e,c);b.effectTag|=1;if("object"===typeof e&&
|
4165 | null!==e&&"function"===typeof e.render&&void 0===e.$$typeof){b.tag=1;ih();if(N(d)){var f=!0;Xe(b)}else f=!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;var h=d.getDerivedStateFromProps;"function"===typeof h&&bg(b,d,h,a);e.updater=fg;b.stateNode=e;e._reactInternalFiber=b;jg(b,d,a,c);b=Mh(null,b,d,!0,f,c)}else b.tag=0,S(null,b,e,c),b=b.child;return b;case 16:e=b.elementType;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);a=b.pendingProps;e=Bf(e);b.type=e;f=b.tag=sj(e);
|
4166 | a=Af(e,a);switch(f){case 0:b=Jh(null,b,e,a,c);break;case 1:b=Lh(null,b,e,a,c);break;case 11:b=Eh(null,b,e,a,c);break;case 14:b=Gh(null,b,e,Af(e.type,a),d,c);break;default:throw t(Error(306),e,"");}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Af(d,e),Jh(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Af(d,e),Lh(a,b,d,e,c);case 3:Nh(b);d=b.updateQueue;if(null===d)throw t(Error(282));e=b.memoizedState;e=null!==e?e.element:null;Wf(b,d,b.pendingProps,
|
4167 | null,c);d=b.memoizedState.element;if(d===e)Ch(),b=Fh(a,b,c);else{e=b.stateNode;if(e=(null===a||null===a.child)&&e.hydrate)uh=Ne(b.stateNode.containerInfo.firstChild),th=b,e=vh=!0;e?(b.effectTag|=2,b.child=ug(b,null,d,c)):(S(a,b,d,c),Ch());b=b.child}return b;case 5:return Cg(b),null===a&&zh(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,h=e.children,Ke(d,e)?h=null:null!==f&&Ke(d,f)&&(b.effectTag|=16),Kh(a,b),b.mode&4&&1!==c&&e.hidden?(b.expirationTime=b.childExpirationTime=1,b=null):
|
4168 | (S(a,b,h,c),b=b.child),b;case 6:return null===a&&zh(b),null;case 13:return Ph(a,b,c);case 4:return Ag(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=tg(b,null,d,c):S(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Af(d,e),Eh(a,b,d,e,c);case 7:return S(a,b,b.pendingProps,c),b.child;case 8:return S(a,b,b.pendingProps.children,c),b.child;case 12:return S(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;h=b.memoizedProps;
|
4169 | f=e.value;Hf(b,f);if(null!==h){var g=h.value;f=hd(g,f)?0:("function"===typeof d._calculateChangedBits?d._calculateChangedBits(g,f):1073741823)|0;if(0===f){if(h.children===e.children&&!M.current){b=Fh(a,b,c);break a}}else for(g=b.child,null!==g&&(g.return=b);null!==g;){var k=g.dependencies;if(null!==k){h=g.child;for(var l=k.firstContext;null!==l;){if(l.context===d&&0!==(l.observedBits&f)){1===g.tag&&(l=Qf(c,null),l.tag=2,Sf(g,l));g.expirationTime<c&&(g.expirationTime=c);l=g.alternate;null!==l&&l.expirationTime<
|
4170 | c&&(l.expirationTime=c);Jf(g.return,c);k.expirationTime<c&&(k.expirationTime=c);break}l=l.next}}else h=10===g.tag?g.type===b.type?null:g.child:g.child;if(null!==h)h.return=g;else for(h=g;null!==h;){if(h===b){h=null;break}g=h.sibling;if(null!==g){g.return=h.return;h=g;break}h=h.return}g=h}}S(a,b,e.children,c);b=b.child}return b;case 9:return e=b.type,f=b.pendingProps,d=f.children,Kf(b,c),e=Mf(e,f.unstable_observedBits),d=d(e),b.effectTag|=1,S(a,b,d,c),b.child;case 14:return e=b.type,f=Af(e,b.pendingProps),
|
4171 | f=Af(e.type,f),Gh(a,b,e,f,d,c);case 15:return Ih(a,b,b.type,b.pendingProps,d,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Af(d,e),null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2),b.tag=1,N(d)?(a=!0,Xe(b)):a=!1,Kf(b,c),hg(b,d,e,c),jg(b,d,e,c),Mh(null,b,d,!0,a,c);case 19:return Rh(a,b,c)}throw t(Error(156));};var pj=null,ji=null;
|
4172 | function tj(a){if("undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(b.isDisabled||!b.supportsFiber)return!0;try{var c=b.inject(a);pj=function(a){try{b.onCommitFiberRoot(c,a,void 0,64===(a.current.effectTag&64))}catch(e){}};ji=function(a){try{b.onCommitFiberUnmount(c,a)}catch(e){}}}catch(d){}return!0}
|
4173 | function uj(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.effectTag=0;this.lastEffect=this.firstEffect=this.nextEffect=null;this.childExpirationTime=this.expirationTime=0;this.alternate=null}function xh(a,b,c,d){return new uj(a,b,c,d)}
|
4174 | function Hh(a){a=a.prototype;return!(!a||!a.isReactComponent)}function sj(a){if("function"===typeof a)return Hh(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===gc)return 11;if(a===jc)return 14}return 2}
|
4175 | function og(a,b){var c=a.alternate;null===c?(c=xh(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.effectTag=0,c.nextEffect=null,c.firstEffect=null,c.lastEffect=null);c.childExpirationTime=a.childExpirationTime;c.expirationTime=a.expirationTime;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{expirationTime:b.expirationTime,
|
4176 | firstContext:b.firstContext,responders:b.responders};c.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}
|
4177 | function qg(a,b,c,d,e,f){var h=2;d=a;if("function"===typeof a)Hh(a)&&(h=1);else if("string"===typeof a)h=5;else a:switch(a){case ac:return sg(c.children,e,f,b);case fc:h=8;e|=7;break;case bc:h=8;e|=1;break;case cc:return a=xh(12,c,b,e|8),a.elementType=cc,a.type=cc,a.expirationTime=f,a;case hc:return a=xh(13,c,b,e),a.type=hc,a.elementType=hc,a.expirationTime=f,a;case ic:return a=xh(19,c,b,e),a.elementType=ic,a.expirationTime=f,a;default:if("object"===typeof a&&null!==a)switch(a.$$typeof){case dc:h=
|
4178 | 10;break a;case ec:h=9;break a;case gc:h=11;break a;case jc:h=14;break a;case kc:h=16;d=null;break a}throw t(Error(130),null==a?a:typeof a,"");}b=xh(h,c,b,e);b.elementType=a;b.type=d;b.expirationTime=f;return b}function sg(a,b,c,d){a=xh(7,a,d,b);a.expirationTime=c;return a}function pg(a,b,c){a=xh(6,a,null,b);a.expirationTime=c;return a}
|
4179 | function rg(a,b,c){b=xh(4,null!==a.children?a.children:[],a.key,b);b.expirationTime=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}
|
4180 | function vj(a,b,c){this.tag=b;this.current=null;this.containerInfo=a;this.pingCache=this.pendingChildren=null;this.finishedExpirationTime=0;this.finishedWork=null;this.timeoutHandle=-1;this.pendingContext=this.context=null;this.hydrate=c;this.callbackNode=this.firstBatch=null;this.pingTime=this.lastPendingTime=this.firstPendingTime=this.callbackExpirationTime=0}function wj(a,b,c){a=new vj(a,b,c);b=xh(3,null,null,2===b?7:1===b?3:0);a.current=b;return b.stateNode=a}
|
4181 | function xj(a,b,c,d,e,f){var h=b.current;a:if(c){c=c._reactInternalFiber;b:{if(2!==ld(c)||1!==c.tag)throw t(Error(170));var g=c;do{switch(g.tag){case 3:g=g.stateNode.context;break b;case 1:if(N(g.type)){g=g.stateNode.__reactInternalMemoizedMergedChildContext;break b}}g=g.return}while(null!==g);throw t(Error(171));}if(1===c.tag){var k=c.type;if(N(k)){c=We(c,k,g);break a}}c=g}else c=Qe;null===b.context?b.context=c:b.pendingContext=c;b=f;e=Qf(d,e);e.payload={element:a};b=void 0===b?null:b;null!==b&&
|
4182 | (e.callback=b);Sf(h,e);eg(h,d);return d}function yj(a,b,c,d){var e=b.current,f=cg(),h=$f.suspense;e=dg(f,e,h);return xj(a,b,c,e,h,d)}function zj(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function Aj(a,b,c){var d=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:$b,key:null==d?null:""+d,children:a,containerInfo:b,implementation:c}}
|
4183 | Db=function(a,b,c){switch(b){case "input":Ec(a,c);b=c.name;if("radio"===c.type&&null!=b){for(c=a;c.parentNode;)c=c.parentNode;c=c.querySelectorAll("input[name="+JSON.stringify(""+b)+'][type="radio"]');for(b=0;b<c.length;b++){var d=c[b];if(d!==a&&d.form===a.form){var e=Ka(d);if(!e)throw t(Error(90));Wb(d);Ec(d,e)}}}break;case "textarea":pe(a,c);break;case "select":b=c.value,null!=b&&me(a,!!c.multiple,b,!1)}};
|
4184 | function Bj(a){var b=1073741821-25*(((1073741821-cg()+500)/25|0)+1);b<=Xi&&--b;this._expirationTime=Xi=b;this._root=a;this._callbacks=this._next=null;this._hasChildren=this._didComplete=!1;this._children=null;this._defer=!0}Bj.prototype.render=function(a){if(!this._defer)throw t(Error(250));this._hasChildren=!0;this._children=a;var b=this._root._internalRoot,c=this._expirationTime,d=new Cj;xj(a,b,null,c,null,d._onCommit);return d};
|
4185 | Bj.prototype.then=function(a){if(this._didComplete)a();else{var b=this._callbacks;null===b&&(b=this._callbacks=[]);b.push(a)}};
|
4186 | Bj.prototype.commit=function(){var a=this._root._internalRoot,b=a.firstBatch;if(!this._defer||null===b)throw t(Error(251));if(this._hasChildren){var c=this._expirationTime;if(b!==this){this._hasChildren&&(c=this._expirationTime=b._expirationTime,this.render(this._children));for(var d=null,e=b;e!==this;)d=e,e=e._next;if(null===d)throw t(Error(251));d._next=e._next;this._next=b;a.firstBatch=this}this._defer=!1;b=c;if((U&(Ci|Di))!==T)throw t(Error(253));xf(Z.bind(null,a,b));O();b=this._next;this._next=
|
4187 | null;b=a.firstBatch=b;null!==b&&b._hasChildren&&b.render(b._children)}else this._next=null,this._defer=!1};Bj.prototype._onComplete=function(){if(!this._didComplete){this._didComplete=!0;var a=this._callbacks;if(null!==a)for(var b=0;b<a.length;b++)(0,a[b])()}};function Cj(){this._callbacks=null;this._didCommit=!1;this._onCommit=this._onCommit.bind(this)}Cj.prototype.then=function(a){if(this._didCommit)a();else{var b=this._callbacks;null===b&&(b=this._callbacks=[]);b.push(a)}};
|
4188 | Cj.prototype._onCommit=function(){if(!this._didCommit){this._didCommit=!0;var a=this._callbacks;if(null!==a)for(var b=0;b<a.length;b++){var c=a[b];if("function"!==typeof c)throw t(Error(191),c);c()}}};function Dj(a,b,c){this._internalRoot=wj(a,b,c)}function Ej(a,b){this._internalRoot=wj(a,2,b)}Ej.prototype.render=Dj.prototype.render=function(a,b){var c=this._internalRoot,d=new Cj;b=void 0===b?null:b;null!==b&&d.then(b);yj(a,c,null,d._onCommit);return d};
|
4189 | Ej.prototype.unmount=Dj.prototype.unmount=function(a){var b=this._internalRoot,c=new Cj;a=void 0===a?null:a;null!==a&&c.then(a);yj(null,b,null,c._onCommit);return c};Ej.prototype.createBatch=function(){var a=new Bj(this),b=a._expirationTime,c=this._internalRoot,d=c.firstBatch;if(null===d)c.firstBatch=a,a._next=null;else{for(c=null;null!==d&&d._expirationTime>=b;)c=d,d=d._next;a._next=d;null!==c&&(c._next=a)}return a};
|
4190 | function Hj(a){return!(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType&&(8!==a.nodeType||" react-mount-point-unstable "!==a.nodeValue))}Jb=ej;Kb=fj;Lb=aj;Mb=function(a,b){var c=U;U|=2;try{return a(b)}finally{U=c,U===T&&O()}};function Ij(a,b){b||(b=a?9===a.nodeType?a.documentElement:a.firstChild:null,b=!(!b||1!==b.nodeType||!b.hasAttribute("data-reactroot")));if(!b)for(var c;c=a.lastChild;)a.removeChild(c);return new Dj(a,0,b)}
|
4191 | function Jj(a,b,c,d,e){var f=c._reactRootContainer,h=void 0;if(f){h=f._internalRoot;if("function"===typeof e){var g=e;e=function(){var a=zj(h);g.call(a)}}yj(b,h,a,e)}else{f=c._reactRootContainer=Ij(c,d);h=f._internalRoot;if("function"===typeof e){var k=e;e=function(){var a=zj(h);k.call(a)}}gj(function(){yj(b,h,a,e)})}return zj(h)}function Kj(a,b){var c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Hj(b))throw t(Error(200));return Aj(a,b,null,c)}
|
4192 | var Nj={createPortal:Kj,findDOMNode:function(a){if(null==a)a=null;else if(1!==a.nodeType){var b=a._reactInternalFiber;if(void 0===b){if("function"===typeof a.render)throw t(Error(188));throw t(Error(268),Object.keys(a));}a=qd(b);a=null===a?null:a.stateNode}return a},hydrate:function(a,b,c){if(!Hj(b))throw t(Error(200));return Jj(null,a,b,!0,c)},render:function(a,b,c){if(!Hj(b))throw t(Error(200));return Jj(null,a,b,!1,c)},unstable_renderSubtreeIntoContainer:function(a,b,c,d){if(!Hj(c))throw t(Error(200));
|
4193 | if(null==a||void 0===a._reactInternalFiber)throw t(Error(38));return Jj(a,b,c,!1,d)},unmountComponentAtNode:function(a){if(!Hj(a))throw t(Error(40));return a._reactRootContainer?(gj(function(){Jj(null,null,a,!1,function(){a._reactRootContainer=null})}),!0):!1},unstable_createPortal:function(){return Kj.apply(void 0,arguments)},unstable_batchedUpdates:ej,unstable_interactiveUpdates:function(a,b,c,d){aj();return fj(a,b,c,d)},unstable_discreteUpdates:fj,unstable_flushDiscreteUpdates:aj,flushSync:function(a,
|
4194 | b){if((U&(Ci|Di))!==T)throw t(Error(187));var c=U;U|=1;try{return vf(99,a.bind(null,b))}finally{U=c,O()}},unstable_createRoot:Lj,unstable_createSyncRoot:Mj,unstable_flushControlled:function(a){var b=U;U|=1;try{vf(99,a)}finally{U=b,U===T&&O()}},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{Events:[Ia,Ja,Ka,Ca.injectEventPluginsByName,fa,Qa,function(a){ya(a,Pa)},Hb,Ib,Ud,Ba,cj,{current:!1}]}};
|
4195 | function Lj(a,b){if(!Hj(a))throw t(Error(299),"unstable_createRoot");return new Ej(a,null!=b&&!0===b.hydrate)}function Mj(a,b){if(!Hj(a))throw t(Error(299),"unstable_createRoot");return new Dj(a,1,null!=b&&!0===b.hydrate)}
|
4196 | (function(a){var b=a.findFiberByHostInstance;return tj(m({},a,{overrideHookState:null,overrideProps:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Xb.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=qd(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null}))})({findFiberByHostInstance:Ha,bundleType:0,version:"16.9.0",
|
4197 | rendererPackageName:"react-dom"});var Oj={default:Nj},Pj=Oj&&Nj||Oj;module.exports=Pj.default||Pj;
|
4198 |
|
4199 |
|
4200 | }),
|
4201 |
|
4202 | (function(module, exports, __webpack_require__) {
|
4203 |
|
4204 | "use strict";
|
4205 |
|
4206 |
|
4207 |
|
4208 |
|
4209 |
|
4210 |
|
4211 |
|
4212 |
|
4213 | var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
4214 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
4215 | var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
4216 |
|
4217 | function toObject(val) {
|
4218 | if (val === null || val === undefined) {
|
4219 | throw new TypeError('Object.assign cannot be called with null or undefined');
|
4220 | }
|
4221 |
|
4222 | return Object(val);
|
4223 | }
|
4224 |
|
4225 | function shouldUseNative() {
|
4226 | try {
|
4227 | if (!Object.assign) {
|
4228 | return false;
|
4229 | }
|
4230 |
|
4231 |
|
4232 |
|
4233 |
|
4234 | var test1 = new String('abc');
|
4235 | test1[5] = 'de';
|
4236 | if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
4237 | return false;
|
4238 | }
|
4239 |
|
4240 |
|
4241 | var test2 = {};
|
4242 | for (var i = 0; i < 10; i++) {
|
4243 | test2['_' + String.fromCharCode(i)] = i;
|
4244 | }
|
4245 | var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
4246 | return test2[n];
|
4247 | });
|
4248 | if (order2.join('') !== '0123456789') {
|
4249 | return false;
|
4250 | }
|
4251 |
|
4252 |
|
4253 | var test3 = {};
|
4254 | 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
4255 | test3[letter] = letter;
|
4256 | });
|
4257 | if (Object.keys(Object.assign({}, test3)).join('') !==
|
4258 | 'abcdefghijklmnopqrst') {
|
4259 | return false;
|
4260 | }
|
4261 |
|
4262 | return true;
|
4263 | } catch (err) {
|
4264 |
|
4265 | return false;
|
4266 | }
|
4267 | }
|
4268 |
|
4269 | module.exports = shouldUseNative() ? Object.assign : function (target, source) {
|
4270 | var from;
|
4271 | var to = toObject(target);
|
4272 | var symbols;
|
4273 |
|
4274 | for (var s = 1; s < arguments.length; s++) {
|
4275 | from = Object(arguments[s]);
|
4276 |
|
4277 | for (var key in from) {
|
4278 | if (hasOwnProperty.call(from, key)) {
|
4279 | to[key] = from[key];
|
4280 | }
|
4281 | }
|
4282 |
|
4283 | if (getOwnPropertySymbols) {
|
4284 | symbols = getOwnPropertySymbols(from);
|
4285 | for (var i = 0; i < symbols.length; i++) {
|
4286 | if (propIsEnumerable.call(from, symbols[i])) {
|
4287 | to[symbols[i]] = from[symbols[i]];
|
4288 | }
|
4289 | }
|
4290 | }
|
4291 | }
|
4292 |
|
4293 | return to;
|
4294 | };
|
4295 |
|
4296 |
|
4297 | }),
|
4298 |
|
4299 | (function(module, exports, __webpack_require__) {
|
4300 |
|
4301 | "use strict";
|
4302 |
|
4303 |
|
4304 | if (true) {
|
4305 | module.exports = __webpack_require__(30);
|
4306 | } else {}
|
4307 |
|
4308 |
|
4309 | }),
|
4310 |
|
4311 | (function(module, exports, __webpack_require__) {
|
4312 |
|
4313 | "use strict";
|
4314 |
|
4315 |
|
4316 |
|
4317 |
|
4318 |
|
4319 |
|
4320 |
|
4321 |
|
4322 |
|
4323 | Object.defineProperty(exports,"__esModule",{value:!0});var d=void 0,e=void 0,g=void 0,m=void 0,n=void 0;exports.unstable_now=void 0;exports.unstable_forceFrameRate=void 0;
|
4324 | if("undefined"===typeof window||"function"!==typeof MessageChannel){var p=null,q=null,r=function(){if(null!==p)try{var a=exports.unstable_now();p(!0,a);p=null}catch(b){throw setTimeout(r,0),b;}};exports.unstable_now=function(){return Date.now()};d=function(a){null!==p?setTimeout(d,0,a):(p=a,setTimeout(r,0))};e=function(a,b){q=setTimeout(a,b)};g=function(){clearTimeout(q)};m=function(){return!1};n=exports.unstable_forceFrameRate=function(){}}else{var t=window.performance,u=window.Date,v=window.setTimeout,
|
4325 | w=window.clearTimeout,x=window.requestAnimationFrame,y=window.cancelAnimationFrame;"undefined"!==typeof console&&("function"!==typeof x&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!==typeof y&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"));exports.unstable_now="object"===typeof t&&
|
4326 | "function"===typeof t.now?function(){return t.now()}:function(){return u.now()};var z=!1,A=null,B=-1,C=-1,D=33.33,E=-1,F=-1,G=0,H=!1;m=function(){return exports.unstable_now()>=G};n=function(){};exports.unstable_forceFrameRate=function(a){0>a||125<a?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):0<a?(D=Math.floor(1E3/a),H=!0):(D=33.33,H=!1)};var J=function(){if(null!==A){var a=exports.unstable_now(),b=0<G-a;try{A(b,
|
4327 | a)||(A=null)}catch(c){throw I.postMessage(null),c;}}},K=new MessageChannel,I=K.port2;K.port1.onmessage=J;var L=function(a){if(null===A)F=E=-1,z=!1;else{z=!0;x(function(a){w(B);L(a)});var b=function(){G=exports.unstable_now()+D/2;J();B=v(b,3*D)};B=v(b,3*D);if(-1!==E&&.1<a-E){var c=a-E;!H&&-1!==F&&c<D&&F<D&&(D=c<F?F:c,8.33>D&&(D=8.33));F=c}E=a;G=a+D;I.postMessage(null)}};d=function(a){A=a;z||(z=!0,x(function(a){L(a)}))};e=function(a,b){C=v(function(){a(exports.unstable_now())},b)};g=function(){w(C);
|
4328 | C=-1}}var M=null,N=null,O=null,P=3,Q=!1,R=!1,S=!1;
|
4329 | function T(a,b){var c=a.next;if(c===a)M=null;else{a===M&&(M=c);var f=a.previous;f.next=c;c.previous=f}a.next=a.previous=null;c=a.callback;f=P;var l=O;P=a.priorityLevel;O=a;try{var h=a.expirationTime<=b;switch(P){case 1:var k=c(h);break;case 2:k=c(h);break;case 3:k=c(h);break;case 4:k=c(h);break;case 5:k=c(h)}}catch(Z){throw Z;}finally{P=f,O=l}if("function"===typeof k)if(b=a.expirationTime,a.callback=k,null===M)M=a.next=a.previous=a;else{k=null;h=M;do{if(b<=h.expirationTime){k=h;break}h=h.next}while(h!==
|
4330 | M);null===k?k=M:k===M&&(M=a);b=k.previous;b.next=k.previous=a;a.next=k;a.previous=b}}function U(a){if(null!==N&&N.startTime<=a){do{var b=N,c=b.next;if(b===c)N=null;else{N=c;var f=b.previous;f.next=c;c.previous=f}b.next=b.previous=null;V(b,b.expirationTime)}while(null!==N&&N.startTime<=a)}}function W(a){S=!1;U(a);R||(null!==M?(R=!0,d(X)):null!==N&&e(W,N.startTime-a))}
|
4331 | function X(a,b){R=!1;S&&(S=!1,g());U(b);Q=!0;try{if(!a)for(;null!==M&&M.expirationTime<=b;)T(M,b),b=exports.unstable_now(),U(b);else if(null!==M){do T(M,b),b=exports.unstable_now(),U(b);while(null!==M&&!m())}if(null!==M)return!0;null!==N&&e(W,N.startTime-b);return!1}finally{Q=!1}}function Y(a){switch(a){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1E4;default:return 5E3}}
|
4332 | function V(a,b){if(null===M)M=a.next=a.previous=a;else{var c=null,f=M;do{if(b<f.expirationTime){c=f;break}f=f.next}while(f!==M);null===c?c=M:c===M&&(M=a);b=c.previous;b.next=c.previous=a;a.next=c;a.previous=b}}var aa=n;exports.unstable_ImmediatePriority=1;exports.unstable_UserBlockingPriority=2;exports.unstable_NormalPriority=3;exports.unstable_IdlePriority=5;exports.unstable_LowPriority=4;
|
4333 | exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=P;P=a;try{return b()}finally{P=c}};exports.unstable_next=function(a){switch(P){case 1:case 2:case 3:var b=3;break;default:b=P}var c=P;P=b;try{return a()}finally{P=c}};
|
4334 | exports.unstable_scheduleCallback=function(a,b,c){var f=exports.unstable_now();if("object"===typeof c&&null!==c){var l=c.delay;l="number"===typeof l&&0<l?f+l:f;c="number"===typeof c.timeout?c.timeout:Y(a)}else c=Y(a),l=f;c=l+c;a={callback:b,priorityLevel:a,startTime:l,expirationTime:c,next:null,previous:null};if(l>f){c=l;if(null===N)N=a.next=a.previous=a;else{b=null;var h=N;do{if(c<h.startTime){b=h;break}h=h.next}while(h!==N);null===b?b=N:b===N&&(N=a);c=b.previous;c.next=b.previous=a;a.next=b;a.previous=
|
4335 | c}null===M&&N===a&&(S?g():S=!0,e(W,l-f))}else V(a,c),R||Q||(R=!0,d(X));return a};exports.unstable_cancelCallback=function(a){var b=a.next;if(null!==b){if(a===b)a===M?M=null:a===N&&(N=null);else{a===M?M=b:a===N&&(N=b);var c=a.previous;c.next=b;b.previous=c}a.next=a.previous=null}};exports.unstable_wrapCallback=function(a){var b=P;return function(){var c=P;P=b;try{return a.apply(this,arguments)}finally{P=c}}};exports.unstable_getCurrentPriorityLevel=function(){return P};
|
4336 | exports.unstable_shouldYield=function(){var a=exports.unstable_now();U(a);return null!==O&&null!==M&&M.startTime<=a&&M.expirationTime<O.expirationTime||m()};exports.unstable_requestPaint=aa;exports.unstable_continueExecution=function(){R||Q||(R=!0,d(X))};exports.unstable_pauseExecution=function(){};exports.unstable_getFirstCallbackNode=function(){return M};
|
4337 |
|
4338 |
|
4339 | }),
|
4340 |
|
4341 | (function(module, exports, __webpack_require__) {
|
4342 |
|
4343 | "use strict";
|
4344 |
|
4345 |
|
4346 | var utils = __webpack_require__(3);
|
4347 | var bind = __webpack_require__(5);
|
4348 | var Axios = __webpack_require__(33);
|
4349 | var mergeConfig = __webpack_require__(11);
|
4350 | var defaults = __webpack_require__(8);
|
4351 |
|
4352 |
|
4353 |
|
4354 |
|
4355 |
|
4356 |
|
4357 |
|
4358 | function createInstance(defaultConfig) {
|
4359 | var context = new Axios(defaultConfig);
|
4360 | var instance = bind(Axios.prototype.request, context);
|
4361 |
|
4362 |
|
4363 | utils.extend(instance, Axios.prototype, context);
|
4364 |
|
4365 |
|
4366 | utils.extend(instance, context);
|
4367 |
|
4368 | return instance;
|
4369 | }
|
4370 |
|
4371 |
|
4372 | var axios = createInstance(defaults);
|
4373 |
|
4374 |
|
4375 | axios.Axios = Axios;
|
4376 |
|
4377 |
|
4378 | axios.create = function create(instanceConfig) {
|
4379 | return createInstance(mergeConfig(axios.defaults, instanceConfig));
|
4380 | };
|
4381 |
|
4382 |
|
4383 | axios.Cancel = __webpack_require__(12);
|
4384 | axios.CancelToken = __webpack_require__(46);
|
4385 | axios.isCancel = __webpack_require__(7);
|
4386 |
|
4387 |
|
4388 | axios.all = function all(promises) {
|
4389 | return Promise.all(promises);
|
4390 | };
|
4391 | axios.spread = __webpack_require__(47);
|
4392 |
|
4393 | module.exports = axios;
|
4394 |
|
4395 |
|
4396 | module.exports.default = axios;
|
4397 |
|
4398 |
|
4399 | }),
|
4400 |
|
4401 | (function(module, exports) {
|
4402 |
|
4403 |
|
4404 |
|
4405 |
|
4406 |
|
4407 |
|
4408 |
|
4409 |
|
4410 | module.exports = function isBuffer (obj) {
|
4411 | return obj != null && obj.constructor != null &&
|
4412 | typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
|
4413 | }
|
4414 |
|
4415 |
|
4416 | }),
|
4417 |
|
4418 | (function(module, exports, __webpack_require__) {
|
4419 |
|
4420 | "use strict";
|
4421 |
|
4422 |
|
4423 | var utils = __webpack_require__(3);
|
4424 | var buildURL = __webpack_require__(6);
|
4425 | var InterceptorManager = __webpack_require__(34);
|
4426 | var dispatchRequest = __webpack_require__(35);
|
4427 | var mergeConfig = __webpack_require__(11);
|
4428 |
|
4429 |
|
4430 |
|
4431 |
|
4432 |
|
4433 |
|
4434 | function Axios(instanceConfig) {
|
4435 | this.defaults = instanceConfig;
|
4436 | this.interceptors = {
|
4437 | request: new InterceptorManager(),
|
4438 | response: new InterceptorManager()
|
4439 | };
|
4440 | }
|
4441 |
|
4442 |
|
4443 |
|
4444 |
|
4445 |
|
4446 |
|
4447 | Axios.prototype.request = function request(config) {
|
4448 |
|
4449 |
|
4450 | if (typeof config === 'string') {
|
4451 | config = arguments[1] || {};
|
4452 | config.url = arguments[0];
|
4453 | } else {
|
4454 | config = config || {};
|
4455 | }
|
4456 |
|
4457 | config = mergeConfig(this.defaults, config);
|
4458 | config.method = config.method ? config.method.toLowerCase() : 'get';
|
4459 |
|
4460 |
|
4461 | var chain = [dispatchRequest, undefined];
|
4462 | var promise = Promise.resolve(config);
|
4463 |
|
4464 | this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
4465 | chain.unshift(interceptor.fulfilled, interceptor.rejected);
|
4466 | });
|
4467 |
|
4468 | this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
|
4469 | chain.push(interceptor.fulfilled, interceptor.rejected);
|
4470 | });
|
4471 |
|
4472 | while (chain.length) {
|
4473 | promise = promise.then(chain.shift(), chain.shift());
|
4474 | }
|
4475 |
|
4476 | return promise;
|
4477 | };
|
4478 |
|
4479 | Axios.prototype.getUri = function getUri(config) {
|
4480 | config = mergeConfig(this.defaults, config);
|
4481 | return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
|
4482 | };
|
4483 |
|
4484 |
|
4485 | utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
4486 |
|
4487 | Axios.prototype[method] = function(url, config) {
|
4488 | return this.request(utils.merge(config || {}, {
|
4489 | method: method,
|
4490 | url: url
|
4491 | }));
|
4492 | };
|
4493 | });
|
4494 |
|
4495 | utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
4496 |
|
4497 | Axios.prototype[method] = function(url, data, config) {
|
4498 | return this.request(utils.merge(config || {}, {
|
4499 | method: method,
|
4500 | url: url,
|
4501 | data: data
|
4502 | }));
|
4503 | };
|
4504 | });
|
4505 |
|
4506 | module.exports = Axios;
|
4507 |
|
4508 |
|
4509 | }),
|
4510 |
|
4511 | (function(module, exports, __webpack_require__) {
|
4512 |
|
4513 | "use strict";
|
4514 |
|
4515 |
|
4516 | var utils = __webpack_require__(3);
|
4517 |
|
4518 | function InterceptorManager() {
|
4519 | this.handlers = [];
|
4520 | }
|
4521 |
|
4522 |
|
4523 |
|
4524 |
|
4525 |
|
4526 |
|
4527 |
|
4528 |
|
4529 |
|
4530 | InterceptorManager.prototype.use = function use(fulfilled, rejected) {
|
4531 | this.handlers.push({
|
4532 | fulfilled: fulfilled,
|
4533 | rejected: rejected
|
4534 | });
|
4535 | return this.handlers.length - 1;
|
4536 | };
|
4537 |
|
4538 |
|
4539 |
|
4540 |
|
4541 |
|
4542 |
|
4543 | InterceptorManager.prototype.eject = function eject(id) {
|
4544 | if (this.handlers[id]) {
|
4545 | this.handlers[id] = null;
|
4546 | }
|
4547 | };
|
4548 |
|
4549 |
|
4550 |
|
4551 |
|
4552 |
|
4553 |
|
4554 |
|
4555 |
|
4556 |
|
4557 | InterceptorManager.prototype.forEach = function forEach(fn) {
|
4558 | utils.forEach(this.handlers, function forEachHandler(h) {
|
4559 | if (h !== null) {
|
4560 | fn(h);
|
4561 | }
|
4562 | });
|
4563 | };
|
4564 |
|
4565 | module.exports = InterceptorManager;
|
4566 |
|
4567 |
|
4568 | }),
|
4569 |
|
4570 | (function(module, exports, __webpack_require__) {
|
4571 |
|
4572 | "use strict";
|
4573 |
|
4574 |
|
4575 | var utils = __webpack_require__(3);
|
4576 | var transformData = __webpack_require__(36);
|
4577 | var isCancel = __webpack_require__(7);
|
4578 | var defaults = __webpack_require__(8);
|
4579 | var isAbsoluteURL = __webpack_require__(44);
|
4580 | var combineURLs = __webpack_require__(45);
|
4581 |
|
4582 |
|
4583 |
|
4584 |
|
4585 | function throwIfCancellationRequested(config) {
|
4586 | if (config.cancelToken) {
|
4587 | config.cancelToken.throwIfRequested();
|
4588 | }
|
4589 | }
|
4590 |
|
4591 |
|
4592 |
|
4593 |
|
4594 |
|
4595 |
|
4596 |
|
4597 | module.exports = function dispatchRequest(config) {
|
4598 | throwIfCancellationRequested(config);
|
4599 |
|
4600 |
|
4601 | if (config.baseURL && !isAbsoluteURL(config.url)) {
|
4602 | config.url = combineURLs(config.baseURL, config.url);
|
4603 | }
|
4604 |
|
4605 |
|
4606 | config.headers = config.headers || {};
|
4607 |
|
4608 |
|
4609 | config.data = transformData(
|
4610 | config.data,
|
4611 | config.headers,
|
4612 | config.transformRequest
|
4613 | );
|
4614 |
|
4615 |
|
4616 | config.headers = utils.merge(
|
4617 | config.headers.common || {},
|
4618 | config.headers[config.method] || {},
|
4619 | config.headers || {}
|
4620 | );
|
4621 |
|
4622 | utils.forEach(
|
4623 | ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
4624 | function cleanHeaderConfig(method) {
|
4625 | delete config.headers[method];
|
4626 | }
|
4627 | );
|
4628 |
|
4629 | var adapter = config.adapter || defaults.adapter;
|
4630 |
|
4631 | return adapter(config).then(function onAdapterResolution(response) {
|
4632 | throwIfCancellationRequested(config);
|
4633 |
|
4634 |
|
4635 | response.data = transformData(
|
4636 | response.data,
|
4637 | response.headers,
|
4638 | config.transformResponse
|
4639 | );
|
4640 |
|
4641 | return response;
|
4642 | }, function onAdapterRejection(reason) {
|
4643 | if (!isCancel(reason)) {
|
4644 | throwIfCancellationRequested(config);
|
4645 |
|
4646 |
|
4647 | if (reason && reason.response) {
|
4648 | reason.response.data = transformData(
|
4649 | reason.response.data,
|
4650 | reason.response.headers,
|
4651 | config.transformResponse
|
4652 | );
|
4653 | }
|
4654 | }
|
4655 |
|
4656 | return Promise.reject(reason);
|
4657 | });
|
4658 | };
|
4659 |
|
4660 |
|
4661 | }),
|
4662 |
|
4663 | (function(module, exports, __webpack_require__) {
|
4664 |
|
4665 | "use strict";
|
4666 |
|
4667 |
|
4668 | var utils = __webpack_require__(3);
|
4669 |
|
4670 |
|
4671 |
|
4672 |
|
4673 |
|
4674 |
|
4675 |
|
4676 |
|
4677 |
|
4678 | module.exports = function transformData(data, headers, fns) {
|
4679 |
|
4680 | utils.forEach(fns, function transform(fn) {
|
4681 | data = fn(data, headers);
|
4682 | });
|
4683 |
|
4684 | return data;
|
4685 | };
|
4686 |
|
4687 |
|
4688 | }),
|
4689 |
|
4690 | (function(module, exports) {
|
4691 |
|
4692 |
|
4693 | var process = module.exports = {};
|
4694 |
|
4695 |
|
4696 |
|
4697 |
|
4698 |
|
4699 |
|
4700 | var cachedSetTimeout;
|
4701 | var cachedClearTimeout;
|
4702 |
|
4703 | function defaultSetTimout() {
|
4704 | throw new Error('setTimeout has not been defined');
|
4705 | }
|
4706 | function defaultClearTimeout () {
|
4707 | throw new Error('clearTimeout has not been defined');
|
4708 | }
|
4709 | (function () {
|
4710 | try {
|
4711 | if (typeof setTimeout === 'function') {
|
4712 | cachedSetTimeout = setTimeout;
|
4713 | } else {
|
4714 | cachedSetTimeout = defaultSetTimout;
|
4715 | }
|
4716 | } catch (e) {
|
4717 | cachedSetTimeout = defaultSetTimout;
|
4718 | }
|
4719 | try {
|
4720 | if (typeof clearTimeout === 'function') {
|
4721 | cachedClearTimeout = clearTimeout;
|
4722 | } else {
|
4723 | cachedClearTimeout = defaultClearTimeout;
|
4724 | }
|
4725 | } catch (e) {
|
4726 | cachedClearTimeout = defaultClearTimeout;
|
4727 | }
|
4728 | } ())
|
4729 | function runTimeout(fun) {
|
4730 | if (cachedSetTimeout === setTimeout) {
|
4731 |
|
4732 | return setTimeout(fun, 0);
|
4733 | }
|
4734 |
|
4735 | if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
4736 | cachedSetTimeout = setTimeout;
|
4737 | return setTimeout(fun, 0);
|
4738 | }
|
4739 | try {
|
4740 |
|
4741 | return cachedSetTimeout(fun, 0);
|
4742 | } catch(e){
|
4743 | try {
|
4744 |
|
4745 | return cachedSetTimeout.call(null, fun, 0);
|
4746 | } catch(e){
|
4747 |
|
4748 | return cachedSetTimeout.call(this, fun, 0);
|
4749 | }
|
4750 | }
|
4751 |
|
4752 |
|
4753 | }
|
4754 | function runClearTimeout(marker) {
|
4755 | if (cachedClearTimeout === clearTimeout) {
|
4756 |
|
4757 | return clearTimeout(marker);
|
4758 | }
|
4759 |
|
4760 | if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
4761 | cachedClearTimeout = clearTimeout;
|
4762 | return clearTimeout(marker);
|
4763 | }
|
4764 | try {
|
4765 |
|
4766 | return cachedClearTimeout(marker);
|
4767 | } catch (e){
|
4768 | try {
|
4769 |
|
4770 | return cachedClearTimeout.call(null, marker);
|
4771 | } catch (e){
|
4772 |
|
4773 |
|
4774 | return cachedClearTimeout.call(this, marker);
|
4775 | }
|
4776 | }
|
4777 |
|
4778 |
|
4779 |
|
4780 | }
|
4781 | var queue = [];
|
4782 | var draining = false;
|
4783 | var currentQueue;
|
4784 | var queueIndex = -1;
|
4785 |
|
4786 | function cleanUpNextTick() {
|
4787 | if (!draining || !currentQueue) {
|
4788 | return;
|
4789 | }
|
4790 | draining = false;
|
4791 | if (currentQueue.length) {
|
4792 | queue = currentQueue.concat(queue);
|
4793 | } else {
|
4794 | queueIndex = -1;
|
4795 | }
|
4796 | if (queue.length) {
|
4797 | drainQueue();
|
4798 | }
|
4799 | }
|
4800 |
|
4801 | function drainQueue() {
|
4802 | if (draining) {
|
4803 | return;
|
4804 | }
|
4805 | var timeout = runTimeout(cleanUpNextTick);
|
4806 | draining = true;
|
4807 |
|
4808 | var len = queue.length;
|
4809 | while(len) {
|
4810 | currentQueue = queue;
|
4811 | queue = [];
|
4812 | while (++queueIndex < len) {
|
4813 | if (currentQueue) {
|
4814 | currentQueue[queueIndex].run();
|
4815 | }
|
4816 | }
|
4817 | queueIndex = -1;
|
4818 | len = queue.length;
|
4819 | }
|
4820 | currentQueue = null;
|
4821 | draining = false;
|
4822 | runClearTimeout(timeout);
|
4823 | }
|
4824 |
|
4825 | process.nextTick = function (fun) {
|
4826 | var args = new Array(arguments.length - 1);
|
4827 | if (arguments.length > 1) {
|
4828 | for (var i = 1; i < arguments.length; i++) {
|
4829 | args[i - 1] = arguments[i];
|
4830 | }
|
4831 | }
|
4832 | queue.push(new Item(fun, args));
|
4833 | if (queue.length === 1 && !draining) {
|
4834 | runTimeout(drainQueue);
|
4835 | }
|
4836 | };
|
4837 |
|
4838 |
|
4839 | function Item(fun, array) {
|
4840 | this.fun = fun;
|
4841 | this.array = array;
|
4842 | }
|
4843 | Item.prototype.run = function () {
|
4844 | this.fun.apply(null, this.array);
|
4845 | };
|
4846 | process.title = 'browser';
|
4847 | process.browser = true;
|
4848 | process.env = {};
|
4849 | process.argv = [];
|
4850 | process.version = '';
|
4851 | process.versions = {};
|
4852 |
|
4853 | function noop() {}
|
4854 |
|
4855 | process.on = noop;
|
4856 | process.addListener = noop;
|
4857 | process.once = noop;
|
4858 | process.off = noop;
|
4859 | process.removeListener = noop;
|
4860 | process.removeAllListeners = noop;
|
4861 | process.emit = noop;
|
4862 | process.prependListener = noop;
|
4863 | process.prependOnceListener = noop;
|
4864 |
|
4865 | process.listeners = function (name) { return [] }
|
4866 |
|
4867 | process.binding = function (name) {
|
4868 | throw new Error('process.binding is not supported');
|
4869 | };
|
4870 |
|
4871 | process.cwd = function () { return '/' };
|
4872 | process.chdir = function (dir) {
|
4873 | throw new Error('process.chdir is not supported');
|
4874 | };
|
4875 | process.umask = function() { return 0; };
|
4876 |
|
4877 |
|
4878 | }),
|
4879 |
|
4880 | (function(module, exports, __webpack_require__) {
|
4881 |
|
4882 | "use strict";
|
4883 |
|
4884 |
|
4885 | var utils = __webpack_require__(3);
|
4886 |
|
4887 | module.exports = function normalizeHeaderName(headers, normalizedName) {
|
4888 | utils.forEach(headers, function processHeader(value, name) {
|
4889 | if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
|
4890 | headers[normalizedName] = value;
|
4891 | delete headers[name];
|
4892 | }
|
4893 | });
|
4894 | };
|
4895 |
|
4896 |
|
4897 | }),
|
4898 |
|
4899 | (function(module, exports, __webpack_require__) {
|
4900 |
|
4901 | "use strict";
|
4902 |
|
4903 |
|
4904 | var createError = __webpack_require__(10);
|
4905 |
|
4906 |
|
4907 |
|
4908 |
|
4909 |
|
4910 |
|
4911 |
|
4912 |
|
4913 | module.exports = function settle(resolve, reject, response) {
|
4914 | var validateStatus = response.config.validateStatus;
|
4915 | if (!validateStatus || validateStatus(response.status)) {
|
4916 | resolve(response);
|
4917 | } else {
|
4918 | reject(createError(
|
4919 | 'Request failed with status code ' + response.status,
|
4920 | response.config,
|
4921 | null,
|
4922 | response.request,
|
4923 | response
|
4924 | ));
|
4925 | }
|
4926 | };
|
4927 |
|
4928 |
|
4929 | }),
|
4930 |
|
4931 | (function(module, exports, __webpack_require__) {
|
4932 |
|
4933 | "use strict";
|
4934 |
|
4935 |
|
4936 |
|
4937 |
|
4938 |
|
4939 |
|
4940 |
|
4941 |
|
4942 |
|
4943 |
|
4944 |
|
4945 |
|
4946 | module.exports = function enhanceError(error, config, code, request, response) {
|
4947 | error.config = config;
|
4948 | if (code) {
|
4949 | error.code = code;
|
4950 | }
|
4951 |
|
4952 | error.request = request;
|
4953 | error.response = response;
|
4954 | error.isAxiosError = true;
|
4955 |
|
4956 | error.toJSON = function() {
|
4957 | return {
|
4958 |
|
4959 | message: this.message,
|
4960 | name: this.name,
|
4961 |
|
4962 | description: this.description,
|
4963 | number: this.number,
|
4964 |
|
4965 | fileName: this.fileName,
|
4966 | lineNumber: this.lineNumber,
|
4967 | columnNumber: this.columnNumber,
|
4968 | stack: this.stack,
|
4969 |
|
4970 | config: this.config,
|
4971 | code: this.code
|
4972 | };
|
4973 | };
|
4974 | return error;
|
4975 | };
|
4976 |
|
4977 |
|
4978 | }),
|
4979 |
|
4980 | (function(module, exports, __webpack_require__) {
|
4981 |
|
4982 | "use strict";
|
4983 |
|
4984 |
|
4985 | var utils = __webpack_require__(3);
|
4986 |
|
4987 |
|
4988 |
|
4989 | var ignoreDuplicateOf = [
|
4990 | 'age', 'authorization', 'content-length', 'content-type', 'etag',
|
4991 | 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
|
4992 | 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
|
4993 | 'referer', 'retry-after', 'user-agent'
|
4994 | ];
|
4995 |
|
4996 |
|
4997 |
|
4998 |
|
4999 |
|
5000 |
|
5001 |
|
5002 |
|
5003 |
|
5004 |
|
5005 |
|
5006 |
|
5007 |
|
5008 |
|
5009 | module.exports = function parseHeaders(headers) {
|
5010 | var parsed = {};
|
5011 | var key;
|
5012 | var val;
|
5013 | var i;
|
5014 |
|
5015 | if (!headers) { return parsed; }
|
5016 |
|
5017 | utils.forEach(headers.split('\n'), function parser(line) {
|
5018 | i = line.indexOf(':');
|
5019 | key = utils.trim(line.substr(0, i)).toLowerCase();
|
5020 | val = utils.trim(line.substr(i + 1));
|
5021 |
|
5022 | if (key) {
|
5023 | if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
|
5024 | return;
|
5025 | }
|
5026 | if (key === 'set-cookie') {
|
5027 | parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
|
5028 | } else {
|
5029 | parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
5030 | }
|
5031 | }
|
5032 | });
|
5033 |
|
5034 | return parsed;
|
5035 | };
|
5036 |
|
5037 |
|
5038 | }),
|
5039 |
|
5040 | (function(module, exports, __webpack_require__) {
|
5041 |
|
5042 | "use strict";
|
5043 |
|
5044 |
|
5045 | var utils = __webpack_require__(3);
|
5046 |
|
5047 | module.exports = (
|
5048 | utils.isStandardBrowserEnv() ?
|
5049 |
|
5050 |
|
5051 |
|
5052 | (function standardBrowserEnv() {
|
5053 | var msie = /(msie|trident)/i.test(navigator.userAgent);
|
5054 | var urlParsingNode = document.createElement('a');
|
5055 | var originURL;
|
5056 |
|
5057 | |
5058 |
|
5059 |
|
5060 |
|
5061 |
|
5062 |
|
5063 | function resolveURL(url) {
|
5064 | var href = url;
|
5065 |
|
5066 | if (msie) {
|
5067 |
|
5068 | urlParsingNode.setAttribute('href', href);
|
5069 | href = urlParsingNode.href;
|
5070 | }
|
5071 |
|
5072 | urlParsingNode.setAttribute('href', href);
|
5073 |
|
5074 |
|
5075 | return {
|
5076 | href: urlParsingNode.href,
|
5077 | protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
|
5078 | host: urlParsingNode.host,
|
5079 | search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
|
5080 | hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
|
5081 | hostname: urlParsingNode.hostname,
|
5082 | port: urlParsingNode.port,
|
5083 | pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
|
5084 | urlParsingNode.pathname :
|
5085 | '/' + urlParsingNode.pathname
|
5086 | };
|
5087 | }
|
5088 |
|
5089 | originURL = resolveURL(window.location.href);
|
5090 |
|
5091 | |
5092 |
|
5093 |
|
5094 |
|
5095 |
|
5096 |
|
5097 | return function isURLSameOrigin(requestURL) {
|
5098 | var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
|
5099 | return (parsed.protocol === originURL.protocol &&
|
5100 | parsed.host === originURL.host);
|
5101 | };
|
5102 | })() :
|
5103 |
|
5104 |
|
5105 | (function nonStandardBrowserEnv() {
|
5106 | return function isURLSameOrigin() {
|
5107 | return true;
|
5108 | };
|
5109 | })()
|
5110 | );
|
5111 |
|
5112 |
|
5113 | }),
|
5114 |
|
5115 | (function(module, exports, __webpack_require__) {
|
5116 |
|
5117 | "use strict";
|
5118 |
|
5119 |
|
5120 | var utils = __webpack_require__(3);
|
5121 |
|
5122 | module.exports = (
|
5123 | utils.isStandardBrowserEnv() ?
|
5124 |
|
5125 |
|
5126 | (function standardBrowserEnv() {
|
5127 | return {
|
5128 | write: function write(name, value, expires, path, domain, secure) {
|
5129 | var cookie = [];
|
5130 | cookie.push(name + '=' + encodeURIComponent(value));
|
5131 |
|
5132 | if (utils.isNumber(expires)) {
|
5133 | cookie.push('expires=' + new Date(expires).toGMTString());
|
5134 | }
|
5135 |
|
5136 | if (utils.isString(path)) {
|
5137 | cookie.push('path=' + path);
|
5138 | }
|
5139 |
|
5140 | if (utils.isString(domain)) {
|
5141 | cookie.push('domain=' + domain);
|
5142 | }
|
5143 |
|
5144 | if (secure === true) {
|
5145 | cookie.push('secure');
|
5146 | }
|
5147 |
|
5148 | document.cookie = cookie.join('; ');
|
5149 | },
|
5150 |
|
5151 | read: function read(name) {
|
5152 | var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
|
5153 | return (match ? decodeURIComponent(match[3]) : null);
|
5154 | },
|
5155 |
|
5156 | remove: function remove(name) {
|
5157 | this.write(name, '', Date.now() - 86400000);
|
5158 | }
|
5159 | };
|
5160 | })() :
|
5161 |
|
5162 |
|
5163 | (function nonStandardBrowserEnv() {
|
5164 | return {
|
5165 | write: function write() {},
|
5166 | read: function read() { return null; },
|
5167 | remove: function remove() {}
|
5168 | };
|
5169 | })()
|
5170 | );
|
5171 |
|
5172 |
|
5173 | }),
|
5174 |
|
5175 | (function(module, exports, __webpack_require__) {
|
5176 |
|
5177 | "use strict";
|
5178 |
|
5179 |
|
5180 |
|
5181 |
|
5182 |
|
5183 |
|
5184 |
|
5185 |
|
5186 | module.exports = function isAbsoluteURL(url) {
|
5187 |
|
5188 |
|
5189 |
|
5190 | return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
|
5191 | };
|
5192 |
|
5193 |
|
5194 | }),
|
5195 |
|
5196 | (function(module, exports, __webpack_require__) {
|
5197 |
|
5198 | "use strict";
|
5199 |
|
5200 |
|
5201 |
|
5202 |
|
5203 |
|
5204 |
|
5205 |
|
5206 |
|
5207 |
|
5208 | module.exports = function combineURLs(baseURL, relativeURL) {
|
5209 | return relativeURL
|
5210 | ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
|
5211 | : baseURL;
|
5212 | };
|
5213 |
|
5214 |
|
5215 | }),
|
5216 |
|
5217 | (function(module, exports, __webpack_require__) {
|
5218 |
|
5219 | "use strict";
|
5220 |
|
5221 |
|
5222 | var Cancel = __webpack_require__(12);
|
5223 |
|
5224 |
|
5225 |
|
5226 |
|
5227 |
|
5228 |
|
5229 |
|
5230 | function CancelToken(executor) {
|
5231 | if (typeof executor !== 'function') {
|
5232 | throw new TypeError('executor must be a function.');
|
5233 | }
|
5234 |
|
5235 | var resolvePromise;
|
5236 | this.promise = new Promise(function promiseExecutor(resolve) {
|
5237 | resolvePromise = resolve;
|
5238 | });
|
5239 |
|
5240 | var token = this;
|
5241 | executor(function cancel(message) {
|
5242 | if (token.reason) {
|
5243 |
|
5244 | return;
|
5245 | }
|
5246 |
|
5247 | token.reason = new Cancel(message);
|
5248 | resolvePromise(token.reason);
|
5249 | });
|
5250 | }
|
5251 |
|
5252 |
|
5253 |
|
5254 |
|
5255 | CancelToken.prototype.throwIfRequested = function throwIfRequested() {
|
5256 | if (this.reason) {
|
5257 | throw this.reason;
|
5258 | }
|
5259 | };
|
5260 |
|
5261 |
|
5262 |
|
5263 |
|
5264 |
|
5265 | CancelToken.source = function source() {
|
5266 | var cancel;
|
5267 | var token = new CancelToken(function executor(c) {
|
5268 | cancel = c;
|
5269 | });
|
5270 | return {
|
5271 | token: token,
|
5272 | cancel: cancel
|
5273 | };
|
5274 | };
|
5275 |
|
5276 | module.exports = CancelToken;
|
5277 |
|
5278 |
|
5279 | }),
|
5280 |
|
5281 | (function(module, exports, __webpack_require__) {
|
5282 |
|
5283 | "use strict";
|
5284 |
|
5285 |
|
5286 |
|
5287 |
|
5288 |
|
5289 |
|
5290 |
|
5291 |
|
5292 |
|
5293 |
|
5294 |
|
5295 |
|
5296 |
|
5297 |
|
5298 |
|
5299 |
|
5300 |
|
5301 |
|
5302 |
|
5303 |
|
5304 |
|
5305 |
|
5306 | module.exports = function spread(callback) {
|
5307 | return function wrap(arr) {
|
5308 | return callback.apply(null, arr);
|
5309 | };
|
5310 | };
|
5311 |
|
5312 |
|
5313 | }),
|
5314 |
|
5315 | (function(module, exports) {
|
5316 |
|
5317 | module.exports = function(originalModule) {
|
5318 | if (!originalModule.webpackPolyfill) {
|
5319 | var module = Object.create(originalModule);
|
5320 |
|
5321 | if (!module.children) module.children = [];
|
5322 | Object.defineProperty(module, "loaded", {
|
5323 | enumerable: true,
|
5324 | get: function() {
|
5325 | return module.l;
|
5326 | }
|
5327 | });
|
5328 | Object.defineProperty(module, "id", {
|
5329 | enumerable: true,
|
5330 | get: function() {
|
5331 | return module.i;
|
5332 | }
|
5333 | });
|
5334 | Object.defineProperty(module, "exports", {
|
5335 | enumerable: true
|
5336 | });
|
5337 | module.webpackPolyfill = 1;
|
5338 | }
|
5339 | return module;
|
5340 | };
|
5341 |
|
5342 |
|
5343 | }),
|
5344 |
|
5345 | (function(module, __webpack_exports__, __webpack_require__) {
|
5346 |
|
5347 | "use strict";
|
5348 | __webpack_require__.r(__webpack_exports__);
|
5349 |
|
5350 |
|
5351 | var seedsui = __webpack_require__(16);
|
5352 |
|
5353 |
|
5354 | var PrototypeArray = __webpack_require__(18);
|
5355 |
|
5356 |
|
5357 | var PrototypeMath = __webpack_require__(19);
|
5358 |
|
5359 |
|
5360 | var PrototypeObject = __webpack_require__(20);
|
5361 |
|
5362 |
|
5363 | var PrototypeString = __webpack_require__(21);
|
5364 |
|
5365 |
|
5366 | var PrototypeNumber = __webpack_require__(22);
|
5367 |
|
5368 |
|
5369 | var PrototypeDate = __webpack_require__(23);
|
5370 |
|
5371 |
|
5372 | var PrototypePinyin = __webpack_require__(24);
|
5373 |
|
5374 |
|
5375 | var external_root_React_commonjs2_react_commonjs_react_amd_react_ = __webpack_require__(1);
|
5376 | var external_root_React_commonjs2_react_commonjs_react_amd_react_default = __webpack_require__.n(external_root_React_commonjs2_react_commonjs_react_amd_react_);
|
5377 |
|
5378 |
|
5379 | var prop_types = __webpack_require__(0);
|
5380 | var prop_types_default = __webpack_require__.n(prop_types);
|
5381 |
|
5382 |
|
5383 | var react_dom = __webpack_require__(2);
|
5384 |
|
5385 |
|
5386 | var _class, _temp;
|
5387 |
|
5388 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
5389 |
|
5390 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
5391 |
|
5392 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
5393 |
|
5394 |
|
5395 |
|
5396 |
|
5397 |
|
5398 | if (!window._seeds_lang) window._seeds_lang = {};
|
5399 |
|
5400 | var Actionsheet_Actionsheet = (_temp = _class = function (_Component) {
|
5401 | _inherits(Actionsheet, _Component);
|
5402 |
|
5403 | function Actionsheet(props) {
|
5404 | _classCallCheck(this, Actionsheet);
|
5405 |
|
5406 | var _this = _possibleConstructorReturn(this, _Component.call(this, props));
|
5407 |
|
5408 | _this.componentDidMount = function () {};
|
5409 |
|
5410 | _this.onClick = function (e) {
|
5411 | var target = e.target;
|
5412 | if (target.classList.contains('actionsheet-mask')) {
|
5413 | if (_this.props.onClickMask) {
|
5414 | _this.props.onClickMask(e);
|
5415 | e.stopPropagation();
|
5416 | }
|
5417 | } else if (target.classList.contains('actionsheet-option')) {
|
5418 | var index = target.getAttribute('data-index');
|
5419 | if (_this.props.onClick) {
|
5420 | _this.props.onClick(e, _this.props.list[index], Number(index));
|
5421 | e.stopPropagation();
|
5422 | }
|
5423 | } else if (target.classList.contains('actionsheet-cancel')) {
|
5424 | if (_this.props.onClickCancel) {
|
5425 | _this.props.onClickCancel(e);
|
5426 | e.stopPropagation();
|
5427 | }
|
5428 | }
|
5429 | };
|
5430 |
|
5431 | return _this;
|
5432 | }
|
5433 |
|
5434 | Actionsheet.prototype.render = function render() {
|
5435 | var _this2 = this;
|
5436 |
|
5437 | var _props = this.props,
|
5438 | duration = _props.duration,
|
5439 | show = _props.show,
|
5440 | maskClassName = _props.maskClassName,
|
5441 | maskStyle = _props.maskStyle,
|
5442 | className = _props.className,
|
5443 | style = _props.style,
|
5444 | list = _props.list,
|
5445 | groupStyle = _props.groupStyle,
|
5446 | groupClassName = _props.groupClassName,
|
5447 | optionStyle = _props.optionStyle,
|
5448 | optionClassName = _props.optionClassName,
|
5449 | cancelCaption = _props.cancelCaption,
|
5450 | cancelStyle = _props.cancelStyle,
|
5451 | cancelClassName = _props.cancelClassName,
|
5452 | onClickCancel = _props.onClickCancel;
|
5453 |
|
5454 | return Object(react_dom["createPortal"])(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
5455 | 'div',
|
5456 | { ref: function ref(el) {
|
5457 | _this2.$el = el;
|
5458 | }, className: 'mask actionsheet-mask' + (maskClassName ? ' ' + maskClassName : '') + (show ? ' active' : ''), style: Object.assign(duration !== undefined ? { WebkitTransitionDuration: duration + 'ms' } : {}, maskStyle), onClick: this.onClick },
|
5459 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
5460 | 'div',
|
5461 | { className: 'actionsheet' + (className ? ' ' + className : '') + (show ? ' active' : ''), style: Object.assign(duration !== undefined ? { WebkitTransitionDuration: duration + 'ms' } : {}, style), 'data-animation': 'slideUp' },
|
5462 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
5463 | 'div',
|
5464 | { className: 'actionsheet-group' + (groupClassName ? ' ' + groupClassName : ''), style: groupStyle },
|
5465 | list && list.map(function (item, index) {
|
5466 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
5467 | 'a',
|
5468 | { className: 'actionsheet-option' + (optionClassName ? ' ' + optionClassName : ''), style: optionStyle, key: index, 'data-index': index },
|
5469 | item.caption
|
5470 | );
|
5471 | })
|
5472 | ),
|
5473 | onClickCancel && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
5474 | 'a',
|
5475 | { className: 'actionsheet-cancel' + (cancelClassName ? ' ' + cancelClassName : ''), style: cancelStyle },
|
5476 | cancelCaption
|
5477 | )
|
5478 | )
|
5479 | ), this.props.portal || document.getElementById('root'));
|
5480 | };
|
5481 |
|
5482 | return Actionsheet;
|
5483 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), _class.propTypes = {
|
5484 | portal: prop_types_default.a.object,
|
5485 | show: prop_types_default.a.bool,
|
5486 |
|
5487 | duration: prop_types_default.a.number,
|
5488 |
|
5489 | list: prop_types_default.a.array,
|
5490 |
|
5491 | maskStyle: prop_types_default.a.object,
|
5492 | maskClassName: prop_types_default.a.string,
|
5493 | onClickMask: prop_types_default.a.func,
|
5494 |
|
5495 | style: prop_types_default.a.object,
|
5496 | className: prop_types_default.a.string,
|
5497 |
|
5498 | groupStyle: prop_types_default.a.object,
|
5499 | groupClassName: prop_types_default.a.string,
|
5500 |
|
5501 | optionStyle: prop_types_default.a.object,
|
5502 | optionClassName: prop_types_default.a.string,
|
5503 |
|
5504 | cancelStyle: prop_types_default.a.object,
|
5505 | cancelClassName: prop_types_default.a.string,
|
5506 | cancelCaption: prop_types_default.a.node,
|
5507 | onClickCancel: prop_types_default.a.func,
|
5508 |
|
5509 | onClick: prop_types_default.a.func
|
5510 | }, _class.defaultProps = {
|
5511 | cancelCaption: window._seeds_lang['cancel'] || '取消',
|
5512 | optionClassName: 'border-b'
|
5513 | }, _temp);
|
5514 |
|
5515 |
|
5516 |
|
5517 |
|
5518 | var src_Actionsheet = (Actionsheet_Actionsheet);
|
5519 |
|
5520 | var Alert_class, Alert_temp;
|
5521 |
|
5522 | function Alert_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
5523 |
|
5524 | function Alert_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
5525 |
|
5526 | function Alert_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
5527 |
|
5528 |
|
5529 |
|
5530 |
|
5531 |
|
5532 | if (!window._seeds_lang) window._seeds_lang = {};
|
5533 |
|
5534 | var Alert_Alert = (Alert_temp = Alert_class = function (_Component) {
|
5535 | Alert_inherits(Alert, _Component);
|
5536 |
|
5537 | function Alert(props) {
|
5538 | Alert_classCallCheck(this, Alert);
|
5539 |
|
5540 | var _this = Alert_possibleConstructorReturn(this, _Component.call(this, props));
|
5541 |
|
5542 | _this.componentDidMount = function () {};
|
5543 |
|
5544 | _this.onClickMask = function (e) {
|
5545 | if (_this.props.onClickMask) _this.props.onClickMask(Object.getArgs(e, _this.props.args));
|
5546 | e.stopPropagation();
|
5547 | };
|
5548 |
|
5549 | _this.onClickCancel = function (e) {
|
5550 | if (_this.props.onClickCancel) _this.props.onClickCancel(Object.getArgs(e, _this.props.args));
|
5551 | e.stopPropagation();
|
5552 | };
|
5553 |
|
5554 | _this.onClickSubmit = function (e) {
|
5555 | if (_this.props.onClickSubmit) _this.props.onClickSubmit(Object.getArgs(e, _this.props.args));
|
5556 | e.stopPropagation();
|
5557 | };
|
5558 |
|
5559 | return _this;
|
5560 | }
|
5561 |
|
5562 | Alert.prototype.render = function render() {
|
5563 | var _this2 = this;
|
5564 |
|
5565 | var _props = this.props,
|
5566 | duration = _props.duration,
|
5567 | show = _props.show,
|
5568 | maskClassName = _props.maskClassName,
|
5569 | maskStyle = _props.maskStyle,
|
5570 | className = _props.className,
|
5571 | style = _props.style,
|
5572 | caption = _props.caption,
|
5573 | captionStyle = _props.captionStyle,
|
5574 | captionClassName = _props.captionClassName,
|
5575 | contentStyle = _props.contentStyle,
|
5576 | contentClassName = _props.contentClassName,
|
5577 | icon = _props.icon,
|
5578 | children = _props.children,
|
5579 | submitCaption = _props.submitCaption,
|
5580 | submitStyle = _props.submitStyle,
|
5581 | submitClassName = _props.submitClassName,
|
5582 | onClickSubmit = _props.onClickSubmit,
|
5583 | disabled = _props.disabled,
|
5584 | cancelCaption = _props.cancelCaption,
|
5585 | cancelStyle = _props.cancelStyle,
|
5586 | cancelClassName = _props.cancelClassName,
|
5587 | onClickCancel = _props.onClickCancel;
|
5588 |
|
5589 | return Object(react_dom["createPortal"])(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
5590 | 'div',
|
5591 | { ref: function ref(el) {
|
5592 | _this2.$el = el;
|
5593 | }, className: 'mask alert-mask' + (maskClassName ? ' ' + maskClassName : '') + (show ? ' active' : ''), style: Object.assign(duration !== undefined ? { WebkitTransitionDuration: duration + 'ms' } : {}, maskStyle), onClick: this.onClickMask },
|
5594 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
5595 | 'div',
|
5596 | { className: 'alert' + (className ? ' ' + className : '') + (show ? ' active' : ''), style: Object.assign(duration !== undefined ? { WebkitTransitionDuration: duration + 'ms' } : {}, style), 'data-animation': 'zoom' },
|
5597 | caption && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
5598 | 'h1',
|
5599 | { className: captionClassName, style: captionStyle },
|
5600 | caption
|
5601 | ),
|
5602 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
5603 | 'div',
|
5604 | { className: 'alert-content' + (contentClassName ? ' ' + contentClassName : ''), style: contentStyle },
|
5605 | icon,
|
5606 | children
|
5607 | ),
|
5608 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
5609 | 'div',
|
5610 | { className: 'alert-handler' },
|
5611 | onClickCancel && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
5612 | 'a',
|
5613 | { className: 'alert-cancel button lg' + (cancelClassName ? ' ' + cancelClassName : ''), style: cancelStyle, onClick: this.onClickCancel },
|
5614 | cancelCaption
|
5615 | ),
|
5616 | onClickSubmit && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
5617 | 'a',
|
5618 | { className: 'alert-submit button lg' + (submitClassName ? ' ' + submitClassName : ''), style: submitStyle, onClick: this.onClickSubmit, disabled: disabled },
|
5619 | submitCaption
|
5620 | )
|
5621 | )
|
5622 | )
|
5623 | ), this.props.portal || document.getElementById('root'));
|
5624 | };
|
5625 |
|
5626 | return Alert;
|
5627 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Alert_class.propTypes = {
|
5628 | portal: prop_types_default.a.object,
|
5629 | args: prop_types_default.a.any,
|
5630 | show: prop_types_default.a.bool,
|
5631 |
|
5632 | duration: prop_types_default.a.number,
|
5633 |
|
5634 | maskStyle: prop_types_default.a.object,
|
5635 | maskClassName: prop_types_default.a.string,
|
5636 | onClickMask: prop_types_default.a.func,
|
5637 |
|
5638 | style: prop_types_default.a.object,
|
5639 | className: prop_types_default.a.string,
|
5640 |
|
5641 | caption: prop_types_default.a.node,
|
5642 | captionStyle: prop_types_default.a.object,
|
5643 | captionClassName: prop_types_default.a.string,
|
5644 |
|
5645 | icon: prop_types_default.a.node,
|
5646 |
|
5647 | contentStyle: prop_types_default.a.object,
|
5648 | contentClassName: prop_types_default.a.string,
|
5649 | children: prop_types_default.a.node,
|
5650 |
|
5651 | submitStyle: prop_types_default.a.object,
|
5652 | submitClassName: prop_types_default.a.string,
|
5653 | submitCaption: prop_types_default.a.node,
|
5654 | disabled: prop_types_default.a.bool,
|
5655 | onClickSubmit: prop_types_default.a.func,
|
5656 |
|
5657 | cancelStyle: prop_types_default.a.object,
|
5658 | cancelClassName: prop_types_default.a.string,
|
5659 | cancelCaption: prop_types_default.a.node,
|
5660 | onClickCancel: prop_types_default.a.func
|
5661 | }, Alert_class.defaultProps = {
|
5662 | submitCaption: window._seeds_lang['ok'] || '确定',
|
5663 | cancelCaption: window._seeds_lang['cancel'] || '取消'
|
5664 | }, Alert_temp);
|
5665 |
|
5666 |
|
5667 |
|
5668 |
|
5669 | var src_Alert = (Alert_Alert);
|
5670 |
|
5671 | 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; };
|
5672 |
|
5673 | var Badge_class, Badge_temp;
|
5674 |
|
5675 | function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
5676 |
|
5677 | function Badge_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
5678 |
|
5679 | function Badge_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
5680 |
|
5681 | function Badge_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
5682 |
|
5683 |
|
5684 |
|
5685 |
|
5686 | var Badge_Badge = (Badge_temp = Badge_class = function (_Component) {
|
5687 | Badge_inherits(Badge, _Component);
|
5688 |
|
5689 | function Badge(props) {
|
5690 | Badge_classCallCheck(this, Badge);
|
5691 |
|
5692 | var _this = Badge_possibleConstructorReturn(this, _Component.call(this, props));
|
5693 |
|
5694 | _this.state = {};
|
5695 | return _this;
|
5696 | }
|
5697 |
|
5698 | Badge.prototype.render = function render() {
|
5699 | var _this2 = this;
|
5700 |
|
5701 | var _props = this.props,
|
5702 | className = _props.className,
|
5703 | style = _props.style,
|
5704 | children = _props.children,
|
5705 | limit = _props.limit,
|
5706 | ellipsis = _props.ellipsis,
|
5707 | others = _objectWithoutProperties(_props, ['className', 'style', 'children', 'limit', 'ellipsis']);
|
5708 |
|
5709 |
|
5710 |
|
5711 | var caption = children;
|
5712 |
|
5713 | var autoWidthClass = '';
|
5714 | if (children && (typeof children === 'string' || typeof children === 'number')) {
|
5715 |
|
5716 | if (!isNaN(children)) {
|
5717 | caption = children.length > limit ? '99999'.substring(0, limit) + ellipsis : children;
|
5718 | }
|
5719 |
|
5720 | autoWidthClass = children.length >= 2 ? 'badge-max-width' : '';
|
5721 | }
|
5722 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
5723 | 'span',
|
5724 | _extends({ ref: function ref(el) {
|
5725 | _this2.$el = el;
|
5726 | }, className: 'badge' + (autoWidthClass ? ' ' + autoWidthClass : '') + (className ? ' ' + className : ''), style: style }, others),
|
5727 | caption
|
5728 | );
|
5729 | };
|
5730 |
|
5731 | return Badge;
|
5732 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Badge_class.propTypes = {
|
5733 | className: prop_types_default.a.string,
|
5734 | style: prop_types_default.a.object,
|
5735 | children: prop_types_default.a.node,
|
5736 | limit: prop_types_default.a.number,
|
5737 | ellipsis: prop_types_default.a.string
|
5738 | }, Badge_class.defaultProps = {
|
5739 | children: '0',
|
5740 | limit: 2,
|
5741 | ellipsis: '+'
|
5742 | }, Badge_temp);
|
5743 |
|
5744 |
|
5745 |
|
5746 |
|
5747 | var src_Badge = (Badge_Badge);
|
5748 |
|
5749 | var BiClock_class, BiClock_temp;
|
5750 |
|
5751 | function BiClock_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
5752 |
|
5753 | function BiClock_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
5754 |
|
5755 | function BiClock_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
5756 |
|
5757 |
|
5758 |
|
5759 |
|
5760 | var BiClock_BiClock = (BiClock_temp = BiClock_class = function (_Component) {
|
5761 | BiClock_inherits(BiClock, _Component);
|
5762 |
|
5763 | function BiClock(props) {
|
5764 | BiClock_classCallCheck(this, BiClock);
|
5765 |
|
5766 | var _this = BiClock_possibleConstructorReturn(this, _Component.call(this, props));
|
5767 |
|
5768 | _this.getHourDeg = function (hour) {
|
5769 | return hour * 30;
|
5770 | };
|
5771 |
|
5772 | _this.getMinuteDeg = function (minute) {
|
5773 | return minute * 6;
|
5774 | };
|
5775 |
|
5776 | _this.aniRotate = function () {
|
5777 | var _this$props = _this.props,
|
5778 | time = _this$props.time,
|
5779 | duration = _this$props.duration;
|
5780 |
|
5781 | var hour = '00';
|
5782 | var minute = '00';
|
5783 | if (/\d{2}:\d{2}/.test(time)) {
|
5784 | hour = time.split(':')[0];
|
5785 | minute = time.split(':')[1];
|
5786 | }
|
5787 | setTimeout(function () {
|
5788 | if (_this.$hour) {
|
5789 | _this.$hour.style.WebkitTransitionDuration = duration + 'ms';
|
5790 | _this.$hour.style.WebkitTransform = 'rotate(' + _this.getHourDeg(hour) + 'deg)';
|
5791 | }
|
5792 | if (_this.$minute) {
|
5793 | _this.$minute.style.WebkitTransitionDuration = duration + 'ms';
|
5794 | _this.$minute.style.WebkitTransform = 'rotate(' + _this.getMinuteDeg(minute) + 'deg)';
|
5795 | }
|
5796 | }, _this.props.delay);
|
5797 | };
|
5798 |
|
5799 | return _this;
|
5800 | }
|
5801 |
|
5802 | BiClock.prototype.render = function render() {
|
5803 | var _this2 = this;
|
5804 |
|
5805 | var _props = this.props,
|
5806 | lineWidth = _props.lineWidth,
|
5807 | size = _props.size,
|
5808 | className = _props.className;
|
5809 |
|
5810 |
|
5811 | this.aniRotate();
|
5812 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
5813 | 'div',
|
5814 | { ref: function ref(el) {
|
5815 | _this2.$el = el;
|
5816 | }, className: 'bi-clock' + (className ? ' ' + className : ''), style: { width: size + 'px', height: size + 'px', borderWidth: lineWidth + 'px' } },
|
5817 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { ref: function ref(el) {
|
5818 | _this2.$hour = el;
|
5819 | }, className: 'bi-clock-hour', style: { width: lineWidth + 'px' } }),
|
5820 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { ref: function ref(el) {
|
5821 | _this2.$minute = el;
|
5822 | }, className: 'bi-clock-minute', style: { width: lineWidth + 'px' } }),
|
5823 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'bi-clock-origin', style: { width: lineWidth + 1 + 'px', height: lineWidth + 1 + 'px' } })
|
5824 | );
|
5825 | };
|
5826 |
|
5827 | return BiClock;
|
5828 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), BiClock_class.propTypes = {
|
5829 | lineWidth: prop_types_default.a.number,
|
5830 | size: prop_types_default.a.number,
|
5831 | time: prop_types_default.a.string,
|
5832 | style: prop_types_default.a.object,
|
5833 | className: prop_types_default.a.string,
|
5834 | duration: prop_types_default.a.number,
|
5835 | delay: prop_types_default.a.number
|
5836 | }, BiClock_class.defaultProps = {
|
5837 | lineWidth: 2,
|
5838 | size: 50,
|
5839 | duration: 500,
|
5840 | delay: 0
|
5841 | }, BiClock_temp);
|
5842 |
|
5843 |
|
5844 |
|
5845 |
|
5846 | var src_BiClock = (BiClock_BiClock);
|
5847 |
|
5848 | var BiDoughnut_class, BiDoughnut_temp;
|
5849 |
|
5850 | function BiDoughnut_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
5851 |
|
5852 | function BiDoughnut_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
5853 |
|
5854 | function BiDoughnut_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
5855 |
|
5856 |
|
5857 |
|
5858 |
|
5859 | var BiDoughnut_BiDoughnut = (BiDoughnut_temp = BiDoughnut_class = function (_Component) {
|
5860 | BiDoughnut_inherits(BiDoughnut, _Component);
|
5861 |
|
5862 | function BiDoughnut(props, context) {
|
5863 | BiDoughnut_classCallCheck(this, BiDoughnut);
|
5864 |
|
5865 | var _this = BiDoughnut_possibleConstructorReturn(this, _Component.call(this, props, context));
|
5866 |
|
5867 | _this.getDuration = function () {
|
5868 | var _this$props = _this.props,
|
5869 | duration = _this$props.duration,
|
5870 | rotate = _this$props.rotate;
|
5871 |
|
5872 | var correctRotate = rotate > 360 ? 360 : rotate;
|
5873 | var duration1 = duration / 360;
|
5874 | var durationRotate = duration1 * correctRotate;
|
5875 | var durationLeft = 0;
|
5876 | var durationRight = durationRotate;
|
5877 | if (correctRotate > 180) {
|
5878 | durationRight = duration1 * 180;
|
5879 | durationLeft = duration1 * (correctRotate - 180);
|
5880 | }
|
5881 | return {
|
5882 | durationRotate: durationRotate,
|
5883 | delayLeft: durationRight,
|
5884 | durationLeft: durationLeft,
|
5885 | durationRight: durationRight
|
5886 | };
|
5887 | };
|
5888 |
|
5889 | _this.getRotate = function () {
|
5890 | var rotate = _this.props.rotate;
|
5891 |
|
5892 | var rotateLeft = -135;
|
5893 | var rotateRight = -135 + rotate;
|
5894 | if (rotate > 180) {
|
5895 | rotateRight = 45;
|
5896 | rotateLeft = -135 + (rotate - 180);
|
5897 | }
|
5898 | return {
|
5899 | rotateLeft: rotateLeft,
|
5900 | rotateRight: rotateRight
|
5901 | };
|
5902 | };
|
5903 |
|
5904 | _this.aniRotate = function () {
|
5905 |
|
5906 | var duration = _this.getDuration();
|
5907 | var durationLeft = duration.durationLeft;
|
5908 | var delayLeft = duration.delayLeft;
|
5909 | var durationRight = duration.durationRight;
|
5910 |
|
5911 | var rotate = _this.getRotate();
|
5912 | var rotateLeft = rotate.rotateLeft;
|
5913 | var rotateRight = rotate.rotateRight;
|
5914 | setTimeout(function () {
|
5915 | if (_this.$elLeftCircle) {
|
5916 | _this.$elLeftCircle.style.WebkitTransitionDuration = durationLeft + 'ms';
|
5917 | _this.$elLeftCircle.style.WebkitTransitionDelay = delayLeft + 'ms';
|
5918 | }
|
5919 | if (_this.$elRightCircle) {
|
5920 | _this.$elRightCircle.style.WebkitTransitionDuration = durationRight + 'ms';
|
5921 | }
|
5922 | if (_this.$elLeftCircle) {
|
5923 | _this.$elLeftCircle.style.WebkitTransform = 'rotate(' + rotateLeft + 'deg)';
|
5924 | }
|
5925 | if (_this.$elRightCircle) {
|
5926 | _this.$elRightCircle.style.WebkitTransform = 'rotate(' + rotateRight + 'deg)';
|
5927 | }
|
5928 | }, _this.props.delay);
|
5929 | };
|
5930 |
|
5931 | return _this;
|
5932 | }
|
5933 |
|
5934 |
|
5935 |
|
5936 | BiDoughnut.prototype.render = function render() {
|
5937 | var _this2 = this;
|
5938 |
|
5939 | var _props = this.props,
|
5940 | lineWidth = _props.lineWidth,
|
5941 | size = _props.size,
|
5942 | className = _props.className,
|
5943 | children = _props.children,
|
5944 | captionClassName = _props.captionClassName,
|
5945 | captionStyle = _props.captionStyle;
|
5946 |
|
5947 |
|
5948 | this.aniRotate();
|
5949 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
5950 | 'div',
|
5951 | { className: 'bi-doughtut ' + className, style: { width: size + 'px', height: size + 'px' } },
|
5952 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
5953 | 'div',
|
5954 | { className: 'bi-doughtut-wrapper left' },
|
5955 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { ref: function ref(el) {
|
5956 | _this2.$elLeftCircle = el;
|
5957 | }, className: 'bi-doughtut-circle left', style: { borderWidth: lineWidth + 'px', width: size - lineWidth * 2 + 'px', height: size - lineWidth * 2 + 'px' } })
|
5958 | ),
|
5959 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
5960 | 'div',
|
5961 | { className: 'bi-doughtut-wrapper right' },
|
5962 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { ref: function ref(el) {
|
5963 | _this2.$elRightCircle = el;
|
5964 | }, className: 'bi-doughtut-circle right', style: { borderWidth: lineWidth + 'px', width: size - lineWidth * 2 + 'px', height: size - lineWidth * 2 + 'px' } })
|
5965 | ),
|
5966 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
5967 | 'div',
|
5968 | { className: 'bi-doughtut-caption' + (captionClassName ? ' ' + captionClassName : ''), style: captionStyle },
|
5969 | children
|
5970 | )
|
5971 | );
|
5972 | };
|
5973 |
|
5974 | return BiDoughnut;
|
5975 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), BiDoughnut_class.propTypes = {
|
5976 | lineWidth: prop_types_default.a.number,
|
5977 | size: prop_types_default.a.number,
|
5978 | duration: prop_types_default.a.number,
|
5979 | rotate: prop_types_default.a.number,
|
5980 | delay: prop_types_default.a.number,
|
5981 |
|
5982 | className: prop_types_default.a.string,
|
5983 |
|
5984 | children: prop_types_default.a.node,
|
5985 | captionClassName: prop_types_default.a.string,
|
5986 | captionStyle: prop_types_default.a.object
|
5987 | }, BiDoughnut_class.defaultProps = {
|
5988 | lineWidth: 3,
|
5989 | size: 50,
|
5990 | duration: 1000,
|
5991 | rotate: 0,
|
5992 | delay: 100,
|
5993 | className: 'disabled'
|
5994 | }, BiDoughnut_temp);
|
5995 |
|
5996 |
|
5997 |
|
5998 |
|
5999 | var src_BiDoughnut = (BiDoughnut_BiDoughnut);
|
6000 |
|
6001 | var BiGauge_class, BiGauge_temp;
|
6002 |
|
6003 | function BiGauge_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
6004 |
|
6005 | function BiGauge_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
6006 |
|
6007 | function BiGauge_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
6008 |
|
6009 |
|
6010 |
|
6011 |
|
6012 | var BiGauge_BiGauge = (BiGauge_temp = BiGauge_class = function (_Component) {
|
6013 | BiGauge_inherits(BiGauge, _Component);
|
6014 |
|
6015 | function BiGauge(props, context) {
|
6016 | BiGauge_classCallCheck(this, BiGauge);
|
6017 |
|
6018 | var _this = BiGauge_possibleConstructorReturn(this, _Component.call(this, props, context));
|
6019 |
|
6020 | _this.getDuration = function () {
|
6021 | var _this$props = _this.props,
|
6022 | duration = _this$props.duration,
|
6023 | rotate = _this$props.rotate;
|
6024 |
|
6025 | return duration / 270 * rotate;
|
6026 | };
|
6027 |
|
6028 | _this.getRotate = function () {
|
6029 | var rotate = _this.props.rotate;
|
6030 |
|
6031 | return rotate > 270 ? 270 : rotate;
|
6032 | };
|
6033 |
|
6034 | _this.getBgLvl = function () {
|
6035 | var rotate = _this.props.rotate;
|
6036 |
|
6037 | var lvl = Math.round(rotate / 27);
|
6038 | return lvl > 10 ? 10 : 1;
|
6039 | };
|
6040 |
|
6041 | _this.aniRotate = function () {
|
6042 |
|
6043 | var duration = _this.getDuration();
|
6044 |
|
6045 | var rotate = _this.getRotate();
|
6046 |
|
6047 | var bgLvl = 'bg' + _this.getBgLvl();
|
6048 | setTimeout(function () {
|
6049 | if (_this.$el) {
|
6050 | _this.$el.style.WebkitAnimationDuration = duration + 'ms';
|
6051 | _this.$el.classList.add(bgLvl);
|
6052 | }
|
6053 | if (_this.$elPointer) {
|
6054 | _this.$elPointer.style.WebkitTransitionDuration = duration + 'ms';
|
6055 | _this.$elPointer.style.WebkitTransform = 'rotate(' + rotate + 'deg)';
|
6056 | }
|
6057 | }, _this.props.delay);
|
6058 | };
|
6059 |
|
6060 | return _this;
|
6061 | }
|
6062 |
|
6063 |
|
6064 |
|
6065 | BiGauge.prototype.render = function render() {
|
6066 | var _this2 = this;
|
6067 |
|
6068 | var _props = this.props,
|
6069 | className = _props.className,
|
6070 | style = _props.style,
|
6071 | children = _props.children,
|
6072 | captionClassName = _props.captionClassName,
|
6073 | captionStyle = _props.captionStyle;
|
6074 |
|
6075 |
|
6076 | this.aniRotate();
|
6077 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
6078 | 'div',
|
6079 | { ref: function ref(el) {
|
6080 | _this2.$el = el;
|
6081 | }, className: 'bi-gauge-box' + (className ? ' ' + className : ''), style: style },
|
6082 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
6083 | 'div',
|
6084 | { className: 'bi-gauge' },
|
6085 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { ref: function ref(el) {
|
6086 | _this2.$elPointer = el;
|
6087 | }, className: 'bi-gauge-pointer' }),
|
6088 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
6089 | 'div',
|
6090 | { className: 'bi-gauge-caption' + (captionClassName ? ' ' + captionClassName : ''), style: captionStyle },
|
6091 | children
|
6092 | )
|
6093 | )
|
6094 | );
|
6095 | };
|
6096 |
|
6097 | return BiGauge;
|
6098 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), BiGauge_class.propTypes = {
|
6099 | duration: prop_types_default.a.number,
|
6100 | rotate: prop_types_default.a.number,
|
6101 | delay: prop_types_default.a.number,
|
6102 |
|
6103 | className: prop_types_default.a.string,
|
6104 | style: prop_types_default.a.object,
|
6105 | children: prop_types_default.a.node,
|
6106 | captionClassName: prop_types_default.a.string,
|
6107 | captionStyle: prop_types_default.a.object
|
6108 | }, BiGauge_class.defaultProps = {
|
6109 | duration: 1000,
|
6110 | rotate: 0,
|
6111 | delay: 100
|
6112 | }, BiGauge_temp);
|
6113 |
|
6114 |
|
6115 |
|
6116 |
|
6117 | var src_BiGauge = (BiGauge_BiGauge);
|
6118 |
|
6119 |
|
6120 | var Device = function () {
|
6121 | var ua = navigator.userAgent.toLowerCase();
|
6122 |
|
6123 | var kernel = '';
|
6124 | if (ua.indexOf('trident') > -1) {
|
6125 | kernel = 'trident';
|
6126 | } else if (ua.indexOf('presto') > -1) {
|
6127 | kernel = 'presto';
|
6128 | } else if (ua.indexOf('applewebkit') > -1) {
|
6129 | kernel = 'webkit';
|
6130 | } else if (ua.indexOf('gecko') > -1 && ua.indexOf('khtml') === -1) {
|
6131 | kernel = 'gecko';
|
6132 | }
|
6133 |
|
6134 | var device = '';
|
6135 | if (ua.match(/applewebkit.*mobile.*/)) {
|
6136 | device = 'mobile';
|
6137 | } else {
|
6138 | device = 'pc';
|
6139 | }
|
6140 |
|
6141 | var os = '';
|
6142 | var osVersion = '';
|
6143 | var andriodExp = ua.match(/android\s*(\d*\.*\d*)/);
|
6144 | var iosExp = ua.match(/cpu iphone os (.*?) like mac os/);
|
6145 | if (andriodExp) {
|
6146 | os = 'andriod';
|
6147 | osVersion = andriodExp[1];
|
6148 | } else if (iosExp) {
|
6149 | os = 'ios';
|
6150 | osVersion = iosExp[1];
|
6151 | }
|
6152 |
|
6153 | var platform = '';
|
6154 | var platformVersion = '';
|
6155 | var platformMatch = null;
|
6156 | if (device === 'pc') {
|
6157 | platform = 'browser';
|
6158 | } else if (ua.indexOf('wxwork') > -1) {
|
6159 | platform = 'weixinwork';
|
6160 | platformMatch = ua.match(/wxwork\/([0-9.]+)/i);
|
6161 | if (platformMatch && platformMatch[1]) platformVersion = platformMatch[1];
|
6162 | } else if (ua.indexOf('micromessenger') > -1) {
|
6163 | platform = 'weixin';
|
6164 | platformMatch = ua.match(/micromessenger\/([0-9.]+)/i);
|
6165 | if (platformMatch && platformMatch[1]) platformVersion = platformMatch[1];
|
6166 | } else if (ua.indexOf('miniprogram') > -1) {
|
6167 | platform = 'weixinminiprogram';
|
6168 | platformMatch = ua.match(/micromessenger\/([0-9.]+)/i);
|
6169 | if (platformMatch && platformMatch[1]) platformVersion = platformMatch[1];
|
6170 | } else if (ua.indexOf('mqqbrowser') > -1) {
|
6171 | platform = 'qq';
|
6172 | } else if (ua.indexOf('ucbrowser') > -1) {
|
6173 | platform = 'uc';
|
6174 | } else if (ua.indexOf('dinghuoappversion') > -1) {
|
6175 | platform = 'dinghuo';
|
6176 | platformMatch = ua.match(/dinghuoappversion\/\s*([0-9.]+)/);
|
6177 | if (platformMatch && platformMatch[1]) platformVersion = platformMatch[1];
|
6178 | } else if (ua.indexOf('wqappversion') > -1) {
|
6179 | platform = 'waiqin';
|
6180 | platformMatch = ua.match(/wqappversion\/([\w.]*)/);
|
6181 | if (platformMatch && platformMatch[1]) platformVersion = platformMatch[1];
|
6182 | } else {
|
6183 | platform = 'browser';
|
6184 | }
|
6185 |
|
6186 |
|
6187 | function appleModel() {
|
6188 |
|
6189 | if (ua && /(iphone|ipad|ipod|ios)/i.test(ua)) {
|
6190 | var m = ua.match(/mobile\/([\w.]*)/);
|
6191 | if (m && m[1]) {
|
6192 | return m[1];
|
6193 | }
|
6194 | }
|
6195 | return '';
|
6196 | }
|
6197 | function getAppleDevice() {
|
6198 |
|
6199 |
|
6200 | if (/iphone/gi.test(ua) && window.screen.height === 812 && window.screen.width === 375) return 'iPhoneX';
|
6201 |
|
6202 | if (/iphone/gi.test(ua) && window.screen.height === 896 && window.screen.width === 414) return 'iPhoneXSM';
|
6203 | var model = appleModel();
|
6204 | switch (model) {
|
6205 | case '15b150':
|
6206 | return 'iPhone6s';
|
6207 | case '15b202':
|
6208 | return 'iPhone6';
|
6209 | case '13g36':
|
6210 | return 'iPhone5SE';
|
6211 | case '14e304':
|
6212 | return 'iPhone6P';
|
6213 | default:
|
6214 | return '';
|
6215 | }
|
6216 | }
|
6217 |
|
6218 |
|
6219 | var onLineCallback;
|
6220 | function handleOnline(e) {
|
6221 | onLineCallback(true);
|
6222 | }
|
6223 | function handleOffline(e) {
|
6224 | onLineCallback(false);
|
6225 | }
|
6226 | function onLine(callback) {
|
6227 | onLineCallback = callback;
|
6228 | window.removeEventListener('online', handleOnline, false);
|
6229 | window.removeEventListener('offline', handleOffline, false);
|
6230 | window.addEventListener('online', handleOnline, false);
|
6231 | window.addEventListener('offline', handleOffline, false);
|
6232 | }
|
6233 |
|
6234 |
|
6235 | function adapterIPhoneX(el) {
|
6236 | var root = document.getElementById('root');
|
6237 | if (el && Object.prototype.toString.call(el).indexOf('[object HTML') === 0) root = el;
|
6238 | if (!root) return;
|
6239 |
|
6240 | var isX = getAppleDevice().indexOf('iPhoneX') >= 0;
|
6241 | function changeSafeArea() {
|
6242 | if (isX && root) {
|
6243 | switch (window.orientation) {
|
6244 | case 0:
|
6245 |
|
6246 | root.style.left = '0';
|
6247 | root.style.right = '0';
|
6248 | root.style.bottom = '34px';
|
6249 | break;
|
6250 | case 90:
|
6251 |
|
6252 | root.style.left = '40px';
|
6253 | root.style.right = '40px';
|
6254 | root.style.bottom = '34px';
|
6255 | break;
|
6256 | case -90:
|
6257 |
|
6258 | root.style.left = '40px';
|
6259 | root.style.right = '40px';
|
6260 | root.style.bottom = '34px';
|
6261 | break;
|
6262 | default:
|
6263 | break;
|
6264 | }
|
6265 | }
|
6266 | }
|
6267 |
|
6268 | changeSafeArea();
|
6269 | window.removeEventListener('orientationchange', changeSafeArea, false);
|
6270 | window.addEventListener('orientationchange', changeSafeArea, false);
|
6271 | }
|
6272 | |
6273 |
|
6274 |
|
6275 |
|
6276 |
|
6277 | function dynamicLoadBridge(callback) {
|
6278 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
6279 |
|
6280 | if (platform !== 'weixin' && platform !== 'weixinwork' && platform !== 'waiqin' && platform !== 'dinghuo') {
|
6281 | if (callback) window.addEventListener('load', callback, false);
|
6282 | return;
|
6283 | }
|
6284 | var script = document.createElement('script');
|
6285 | script.type = 'text/javascript';
|
6286 | script.defer = 'defer';
|
6287 | if (platform === 'weixin' || platform === 'weixinwork') {
|
6288 |
|
6289 | script.src = options.wxUrl || '//res.wx.qq.com/open/js/jweixin-1.4.0.js';
|
6290 | if (callback) {
|
6291 | script.onload = function () {
|
6292 | callback();
|
6293 | };
|
6294 | }
|
6295 | } else if (platform === 'waiqin') {
|
6296 |
|
6297 | script.src = options.wqUrl || '//res.waiqin365.com/d/common_mobile/component/cordova/cordova.js';
|
6298 | if (callback) {
|
6299 | script.onload = function () {
|
6300 | document.addEventListener('deviceready', function () {
|
6301 | callback();
|
6302 | });
|
6303 | };
|
6304 | }
|
6305 | } else if (platform === 'dinghuo') {
|
6306 | callback();
|
6307 | }
|
6308 | if (script.src) document.body.appendChild(script);
|
6309 | }
|
6310 |
|
6311 | function getUrlParameter(argName, argSearch) {
|
6312 | var url = window.location.href;
|
6313 | if (argSearch) url = argSearch;
|
6314 | var params = {};
|
6315 |
|
6316 | if (url.indexOf('?') !== -1) {
|
6317 |
|
6318 | var options = url.split('?')[1].split('&');
|
6319 | if (options.length) {
|
6320 | for (var i = 0; i < options.length; i++) {
|
6321 |
|
6322 | var option = options[i].split('=');
|
6323 | if (option.length === 2) {
|
6324 | if (argName) {
|
6325 | if (argName === option[0]) return option[1];
|
6326 | } else {
|
6327 | params[option[0]] = option[1];
|
6328 | }
|
6329 | }
|
6330 | }
|
6331 | }
|
6332 | }
|
6333 | if (Object.keys(params).length) return params;
|
6334 | return '';
|
6335 | }
|
6336 |
|
6337 | function getScreenWidth() {
|
6338 | if (window.innerWidth) return window.innerWidth;
|
6339 | if (window.screen.width) return window.screen.width;
|
6340 | if (window.screen.availWidth) return window.screen.availWidth;
|
6341 | }
|
6342 | function getScreenHeight() {
|
6343 | if (window.innerHeight) return window.innerHeight;
|
6344 | if (window.screen.height) return window.screen.height;
|
6345 | if (window.screen.availHeight) return window.screen.availHeight;
|
6346 | }
|
6347 | return {
|
6348 | protocol: window.location.protocol,
|
6349 | host: window.location.host,
|
6350 | domain: window.location.protocol + '//' + window.location.host,
|
6351 | kernel: kernel,
|
6352 | device: device,
|
6353 | os: os,
|
6354 | osVersion: osVersion,
|
6355 | platform: platform,
|
6356 | platformVersion: platformVersion,
|
6357 | appleDevice: getAppleDevice(),
|
6358 |
|
6359 | language: (window.navigator.browserLanguage || window.navigator.language).toLowerCase(),
|
6360 | appVersion: window.navigator.appVersion,
|
6361 | onLine: onLine,
|
6362 | isOnLine: window.navigator.onLine || true,
|
6363 | ua: ua,
|
6364 | orientation: window.orientation || '请在真机上测试',
|
6365 | adapterIPhoneX: adapterIPhoneX,
|
6366 | dynamicLoadBridge: dynamicLoadBridge,
|
6367 | getUrlParameter: getUrlParameter,
|
6368 | screenWidth: getScreenWidth(),
|
6369 | screenHeight: getScreenHeight()
|
6370 | };
|
6371 | }();
|
6372 |
|
6373 | var Device_Device = (Device);
|
6374 |
|
6375 |
|
6376 |
|
6377 | var src_Device = (Device_Device);
|
6378 |
|
6379 |
|
6380 |
|
6381 |
|
6382 |
|
6383 | var jsonp_count = 0;
|
6384 |
|
6385 |
|
6386 |
|
6387 |
|
6388 |
|
6389 | function noop() {}
|
6390 |
|
6391 |
|
6392 |
|
6393 |
|
6394 |
|
6395 |
|
6396 |
|
6397 |
|
6398 |
|
6399 |
|
6400 |
|
6401 |
|
6402 |
|
6403 |
|
6404 |
|
6405 | function jsonp(url, opts, fn) {
|
6406 | if ('function' === typeof opts) {
|
6407 | fn = opts;
|
6408 | opts = {};
|
6409 | }
|
6410 | if (!opts) opts = {};
|
6411 |
|
6412 | var prefix = opts.prefix || '__jp';
|
6413 |
|
6414 |
|
6415 |
|
6416 | var id = opts.name || prefix + jsonp_count++;
|
6417 |
|
6418 | var param = opts.param || 'callback';
|
6419 | var timeout = null != opts.timeout ? opts.timeout : 60000;
|
6420 | var enc = encodeURIComponent;
|
6421 | var target = document.getElementsByTagName('script')[0] || document.head;
|
6422 | var script;
|
6423 | var timer;
|
6424 |
|
6425 | if (timeout) {
|
6426 | timer = setTimeout(function () {
|
6427 | cleanup();
|
6428 | if (fn) fn(new Error('Timeout'));
|
6429 | }, timeout);
|
6430 | }
|
6431 |
|
6432 | function cleanup() {
|
6433 | if (script.parentNode) script.parentNode.removeChild(script);
|
6434 | window[id] = noop;
|
6435 | if (timer) clearTimeout(timer);
|
6436 | }
|
6437 |
|
6438 | function cancel() {
|
6439 | if (window[id]) {
|
6440 | cleanup();
|
6441 | }
|
6442 | }
|
6443 |
|
6444 | window[id] = function (data) {
|
6445 | cleanup();
|
6446 | if (fn) fn(null, data);
|
6447 | };
|
6448 |
|
6449 |
|
6450 | url += (~url.indexOf('?') ? '&' : '?') + param + '=' + enc(id);
|
6451 | url = url.replace('?&', '?');
|
6452 |
|
6453 |
|
6454 | script = document.createElement('script');
|
6455 | script.src = url;
|
6456 | target.parentNode.insertBefore(script, target);
|
6457 |
|
6458 | return cancel;
|
6459 | }
|
6460 |
|
6461 | var jsonp_jsonp = (jsonp);
|
6462 |
|
6463 |
|
6464 |
|
6465 | var src_jsonp = (jsonp_jsonp);
|
6466 |
|
6467 |
|
6468 | var DB = function () {
|
6469 | function checkManifest() {
|
6470 | window.addEventListener('updateready', function (e) {
|
6471 | console.log('离线缓存状态:' + window.applicationCache.status);
|
6472 | if (window.applicationCache.status === window.applicationCache.UPDATEREADY) {
|
6473 | window.applicationCache.swapCache();
|
6474 | if (window.confirm('发现此manifest文件有更新,是否更新?')) {
|
6475 | window.location.reload();
|
6476 | }
|
6477 | } else {
|
6478 | console.log('manifest文件没有变化');
|
6479 | }
|
6480 | }, false);
|
6481 | }
|
6482 | function stringifyData(val) {
|
6483 | if (typeof val === 'number') {
|
6484 | return '_number:' + val.toString();
|
6485 | }
|
6486 | if (typeof val === 'boolean') {
|
6487 | return '_boolean:' + val.toString();
|
6488 | }
|
6489 | if (!val) {
|
6490 | return '';
|
6491 | }
|
6492 | if (typeof val === 'string') {
|
6493 | return val;
|
6494 | }
|
6495 | if (val instanceof Function) {
|
6496 | return '_function:' + val.toString();
|
6497 | }
|
6498 | if (val instanceof Object) {
|
6499 | return '_json:' + JSON.stringify(val);
|
6500 | }
|
6501 | }
|
6502 | function parseData(val) {
|
6503 | if (!val) {
|
6504 | return null;
|
6505 | }
|
6506 | if (val.indexOf('_number:') === 0) {
|
6507 | return Number(val.replace(/^_number:/, ''));
|
6508 | }
|
6509 | if (val.indexOf('_boolean:') === 0) {
|
6510 | return Boolean(val.replace(/^_boolean:/, ''));
|
6511 | }
|
6512 | if (val.indexOf('_function:') === 0) {
|
6513 | return val.replace(/^_function:/, '');
|
6514 | }
|
6515 | if (val.indexOf('_json:') === 0) {
|
6516 | return JSON.parse(val.replace(/^_json:/, ''));
|
6517 | }
|
6518 | return val;
|
6519 | }
|
6520 | var store = window.localStorage;
|
6521 | var session = window.sessionStorage;
|
6522 | return {
|
6523 |
|
6524 | checkManifest: checkManifest,
|
6525 |
|
6526 | setStore: function setStore(key, val) {
|
6527 | store.setItem(key.toString(), stringifyData(val));
|
6528 | },
|
6529 | getStore: function getStore(key) {
|
6530 | if (typeof key === 'number') {
|
6531 | return parseData(store.key(key));
|
6532 | }
|
6533 | return parseData(store.getItem(key));
|
6534 | },
|
6535 | getAllStore: function getAllStore() {
|
6536 | return store.valueOf();
|
6537 | },
|
6538 | removeStore: function removeStore(key) {
|
6539 | store.removeItem(key);
|
6540 | },
|
6541 | clearStore: function clearStore() {
|
6542 | store.clear();
|
6543 | },
|
6544 |
|
6545 | setSession: function setSession(key, value) {
|
6546 | session.setItem(key.toString(), stringifyData(value));
|
6547 | },
|
6548 | getSession: function getSession(key) {
|
6549 | if (typeof key === 'number') {
|
6550 | return parseData(session.key(key));
|
6551 | }
|
6552 | return parseData(session.getItem(key));
|
6553 | },
|
6554 | getAllSession: function getAllSession() {
|
6555 | return session.valueOf();
|
6556 | },
|
6557 | removeSession: function removeSession(key) {
|
6558 | session.removeItem(key);
|
6559 | },
|
6560 | clearSession: function clearSession() {
|
6561 | session.clear();
|
6562 | },
|
6563 | setCookie: function setCookie(key, value, second) {
|
6564 | var cookieStr = key + '=' + escape(value);
|
6565 | if (second) {
|
6566 | var expires = new Date();
|
6567 | expires.setTime(expires.getTime() + second * 1000);
|
6568 | cookieStr += ';expires=' + expires.toGMTString();
|
6569 | }
|
6570 | document.cookie = cookieStr;
|
6571 | },
|
6572 | getCookie: function getCookie(key) {
|
6573 | var arrCookie = document.cookie.split('; ');
|
6574 |
|
6575 | for (var i = 0, item; item = arrCookie[i++];) {
|
6576 |
|
6577 | var arrItem = item.split("=");
|
6578 |
|
6579 | if (String(key) === arrItem[0]) {
|
6580 | return unescape(arrItem[1]);
|
6581 | }
|
6582 | }
|
6583 | return null;
|
6584 | },
|
6585 | removeCookie: function removeCookie(key) {
|
6586 | var expires = new Date();
|
6587 | expires.setTime(expires.getTime() - 1);
|
6588 | var val = this.getCookie(key);
|
6589 | if (val != null) {
|
6590 | document.cookie = key + '=' + val + 'expires=' + expires.toGMTString();
|
6591 | }
|
6592 | },
|
6593 | clearCookie: function clearCookie() {
|
6594 | alert('抱歉,cookie不可以全部清空!');
|
6595 | }
|
6596 | };
|
6597 | }();
|
6598 |
|
6599 | var DB_DB = (DB);
|
6600 |
|
6601 |
|
6602 |
|
6603 | var src_DB = (DB_DB);
|
6604 |
|
6605 |
|
6606 | var instance_Toast = function Toast(params) {
|
6607 | |
6608 |
|
6609 |
|
6610 | var defaults = {
|
6611 | mask: null,
|
6612 | parent: document.body,
|
6613 |
|
6614 | maskClass: 'mask toast-mask',
|
6615 | maskActiveClass: 'active',
|
6616 |
|
6617 | toastClass: 'toast bottom',
|
6618 | toastActiveClass: 'active',
|
6619 | wrapperClass: 'toast-wrapper',
|
6620 | captionClass: 'toast-caption',
|
6621 | iconClass: 'toast-icon',
|
6622 |
|
6623 | duration: 300,
|
6624 | delay: 0,
|
6625 | html: '',
|
6626 | icon: ''
|
6627 |
|
6628 | |
6629 |
|
6630 |
|
6631 |
|
6632 | };
|
6633 | params = params || {};
|
6634 | for (var def in defaults) {
|
6635 | if (params[def] === undefined) {
|
6636 | params[def] = defaults[def];
|
6637 | }
|
6638 | }
|
6639 | var s = this;
|
6640 | s.params = params;
|
6641 | s.parent = typeof s.params.parent === 'string' ? document.querySelector(s.params.parent) : s.params.parent;
|
6642 | s.toast = null;
|
6643 | s.wrapper = null;
|
6644 |
|
6645 | s.createMask = function () {
|
6646 | var mask = document.createElement('div');
|
6647 | mask.setAttribute('class', s.params.maskClass);
|
6648 | return mask;
|
6649 | };
|
6650 | s.createToast = function () {
|
6651 | var toast = document.createElement('div');
|
6652 | toast.setAttribute('class', s.params.toastClass);
|
6653 | return toast;
|
6654 | };
|
6655 | s.createToastWrapper = function () {
|
6656 | var wrapper = document.createElement('div');
|
6657 | wrapper.setAttribute('class', s.params.wrapperClass);
|
6658 | return wrapper;
|
6659 | };
|
6660 | s.createToastIcon = function () {
|
6661 | var icon = document.createElement('span');
|
6662 | if (!s.params.icon) return icon;
|
6663 | icon.setAttribute('class', s.params.iconClass + (s.params.icon ? ' ' + s.params.icon : ''));
|
6664 | return icon;
|
6665 | };
|
6666 | s.createToastCaption = function () {
|
6667 | var caption = document.createElement('span');
|
6668 | caption.setAttribute('class', s.params.captionClass);
|
6669 | if (s.params.html) caption.innerHTML = s.params.html;
|
6670 | return caption;
|
6671 | };
|
6672 | s.create = function () {
|
6673 | s.mask = s.createMask();
|
6674 | s.toast = s.createToast();
|
6675 | s.wrapper = s.createToastWrapper();
|
6676 | s.caption = s.createToastCaption();
|
6677 | s.icon = s.createToastIcon();
|
6678 | if (s.icon) s.wrapper.appendChild(s.icon);
|
6679 | s.wrapper.appendChild(s.caption);
|
6680 | s.toast.appendChild(s.wrapper);
|
6681 | s.mask.appendChild(s.toast);
|
6682 | s.parent.appendChild(s.mask);
|
6683 | };
|
6684 | s.update = function () {
|
6685 | if (s.params.mask) s.mask = typeof s.params.mask === 'string' ? document.querySelector(s.params.mask) : s.params.mask;
|
6686 | if (s.mask) {
|
6687 | s.toast = s.mask.querySelector('.' + s.params.toastClass);
|
6688 | s.wrapper = s.mask.querySelector('.' + s.params.wrapperClass);
|
6689 | } else {
|
6690 | s.create();
|
6691 | }
|
6692 | s.toast.style.webkitTransitionDuration = s.params.duration + 'ms';
|
6693 | };
|
6694 | s.update();
|
6695 |
|
6696 | |
6697 |
|
6698 |
|
6699 | s.setMaskClassName = function (className) {
|
6700 | s.params.maskClass = className;
|
6701 | s.mask.setAttribute('class', s.params.maskClass);
|
6702 | };
|
6703 | s.setToastClassName = function (className) {
|
6704 | s.params.toastClass = className;
|
6705 | s.toast.setAttribute('class', s.params.toastClass);
|
6706 | };
|
6707 | s.setIcon = function (className) {
|
6708 | s.params.icon = className;
|
6709 | if (s.params.icon) {
|
6710 | s.icon.setAttribute('class', s.params.iconClass + (s.params.icon ? ' ' + s.params.icon : ''));
|
6711 | } else {
|
6712 | s.icon.setAttribute('class', '');
|
6713 | }
|
6714 | };
|
6715 | s.setDelay = function (delay) {
|
6716 | s.params.delay = delay;
|
6717 | };
|
6718 | s.setHTML = function (html) {
|
6719 | s.caption.innerHTML = html;
|
6720 | };
|
6721 |
|
6722 | s.showMask = function () {
|
6723 | s.mask.classList.add(s.params.maskActiveClass);
|
6724 | };
|
6725 | s.hideMask = function () {
|
6726 | s.mask.classList.remove(s.params.maskActiveClass);
|
6727 | };
|
6728 | s.destroyMask = function () {
|
6729 | s.mask.parentNode.removeChild(s.mask);
|
6730 | };
|
6731 |
|
6732 | s.showToast = function () {
|
6733 | s.toast.classList.add(s.params.toastActiveClass);
|
6734 | };
|
6735 | s.hideToast = function () {
|
6736 | s.toast.classList.remove(s.params.toastActiveClass);
|
6737 | };
|
6738 |
|
6739 | s.isHid = true;
|
6740 | s.hide = function () {
|
6741 | s.isHid = true;
|
6742 | s.hideMask();
|
6743 | s.hideToast();
|
6744 | if (s.params.duration === 0) s.onTransitionEnd();
|
6745 | };
|
6746 | s.show = function () {
|
6747 | s.isHid = false;
|
6748 | s.showMask();
|
6749 | s.showToast();
|
6750 | if (s.params.duration === 0) s.onTransitionEnd();
|
6751 |
|
6752 |
|
6753 | if (s.params.delay) {
|
6754 | if (s.delayer) window.clearTimeout(s.delayer);
|
6755 | s.delayer = setTimeout(function () {
|
6756 | s.hide();
|
6757 | }, s.params.delay);
|
6758 | }
|
6759 | };
|
6760 | s.destroy = function () {
|
6761 | s.destroyMask();
|
6762 | };
|
6763 | |
6764 |
|
6765 |
|
6766 | s.events = function (detach) {
|
6767 | var target = s.toast;
|
6768 | var action = detach ? 'removeEventListener' : 'addEventListener';
|
6769 | target[action]('webkitTransitionEnd', s.onTransitionEnd, false);
|
6770 |
|
6771 | };
|
6772 | s.attach = function () {
|
6773 | s.events();
|
6774 | };
|
6775 | s.detach = function () {
|
6776 | s.events(false);
|
6777 | };
|
6778 | s.transitionFlag = true;
|
6779 |
|
6780 | s.onTransitionEnd = function (e) {
|
6781 | if (e.propertyName === 'visibility') return;
|
6782 |
|
6783 | if (s.transitionFlag) {
|
6784 | s.transitionFlag = false;
|
6785 | if (s.isHid) {
|
6786 |
|
6787 | if (s.params.onHid) s.params.onHid(s);
|
6788 | } else {
|
6789 |
|
6790 | if (s.params.onShowed) s.params.onShowed(s);
|
6791 | }
|
6792 | }
|
6793 | };
|
6794 | |
6795 |
|
6796 |
|
6797 | s.init = function () {
|
6798 | s.attach();
|
6799 | };
|
6800 | s.init();
|
6801 | };
|
6802 |
|
6803 | var Toast_instance = (instance_Toast);
|
6804 |
|
6805 |
|
6806 | var instance_Alert = function Alert(params) {
|
6807 | if (!window._seeds_lang) window._seeds_lang = {};
|
6808 | |
6809 |
|
6810 |
|
6811 | var defaults = {
|
6812 | overflowContainerActiveClass: 'overflow-hidden',
|
6813 |
|
6814 | maskClass: 'mask alert-mask',
|
6815 | maskActiveClass: 'active',
|
6816 |
|
6817 | duration: 300,
|
6818 | animationAttr: 'data-animation',
|
6819 | animation: 'zoom',
|
6820 |
|
6821 | alertClass: 'alert',
|
6822 | alertActiveClass: 'active',
|
6823 | contentClass: 'alert-content',
|
6824 | handlerClass: 'alert-handler',
|
6825 | buttonSubmitClass: 'alert-submit button',
|
6826 | buttonCancelClass: 'alert-cancel button',
|
6827 |
|
6828 | caption: '',
|
6829 | html: '',
|
6830 | buttonSubmitHTML: window._seeds_lang['ok'] || '确定',
|
6831 | buttonCancelHTML: window._seeds_lang['cancel'] || '取消',
|
6832 |
|
6833 | isClickMaskHide: false,
|
6834 | args: null
|
6835 | |
6836 |
|
6837 |
|
6838 |
|
6839 |
|
6840 |
|
6841 |
|
6842 | };
|
6843 | params = params || {};
|
6844 | for (var def in defaults) {
|
6845 | if (params[def] === undefined) {
|
6846 | params[def] = defaults[def];
|
6847 | }
|
6848 | }
|
6849 | var s = this;
|
6850 | s.params = params;
|
6851 |
|
6852 | s.params.mask = null;
|
6853 | if (params.mask) {
|
6854 | s.params.mask = params.mask;
|
6855 | }
|
6856 |
|
6857 | s.params.parent = document.body;
|
6858 | if (params.parent) {
|
6859 | s.params.parent = params.parent;
|
6860 | }
|
6861 |
|
6862 | s.params.overflowContainer = document.body;
|
6863 | if (params.overflowContainer) {
|
6864 | s.params.overflowContainer = params.overflowContainer;
|
6865 | }
|
6866 |
|
6867 | s.parent = typeof s.params.parent === 'string' ? document.querySelector(s.params.parent) : s.params.parent;
|
6868 | s.overflowContainer = typeof s.params.overflowContainer === 'string' ? document.querySelector(s.params.overflowContainer) : s.params.overflowContainer;
|
6869 |
|
6870 | s.mask = null;
|
6871 | s.alert = null;
|
6872 | s.html = null;
|
6873 | s.buttonBox = null;
|
6874 | s.buttonSubmit = null;
|
6875 | s.buttonCancel = null;
|
6876 |
|
6877 | s.createMask = function () {
|
6878 | s.mask = document.createElement('div');
|
6879 | s.mask.setAttribute('class', s.params.maskClass);
|
6880 | };
|
6881 |
|
6882 | s.createButton = function (html, className) {
|
6883 | var button = document.createElement('a');
|
6884 | button.setAttribute('class', className);
|
6885 | button.innerHTML = html;
|
6886 | return button;
|
6887 | };
|
6888 | s.createAlert = function () {
|
6889 | s.alert = document.createElement('div');
|
6890 | s.alert.setAttribute('class', s.params.alertClass);
|
6891 | s.alert.setAttribute(s.params.animationAttr, s.params.animation);
|
6892 |
|
6893 | s.html = document.createElement('div');
|
6894 | s.html.setAttribute('class', s.params.contentClass);
|
6895 | s.html.innerHTML = s.params.html;
|
6896 |
|
6897 | s.buttonBox = document.createElement('div');
|
6898 | s.buttonBox.setAttribute('class', s.params.handlerClass);
|
6899 |
|
6900 |
|
6901 | if (s.params.onClickCancel) {
|
6902 | s.buttonCancel = s.createButton(s.params.buttonCancelHTML, s.params.buttonCancelClass);
|
6903 | s.buttonBox.appendChild(s.buttonCancel);
|
6904 | }
|
6905 | s.buttonSubmit = s.createButton(s.params.buttonSubmitHTML, s.params.buttonSubmitClass);
|
6906 |
|
6907 | s.buttonBox.appendChild(s.buttonSubmit);
|
6908 |
|
6909 | if (s.params.caption && s.params.caption !== '') {
|
6910 | s.caption = document.createElement('h1');
|
6911 | s.caption.innerHTML = s.params.caption;
|
6912 | s.alert.appendChild(s.caption);
|
6913 | }
|
6914 |
|
6915 | s.alert.appendChild(s.html);
|
6916 | s.alert.appendChild(s.buttonBox);
|
6917 | };
|
6918 | s.create = function () {
|
6919 | s.createMask();
|
6920 | s.createAlert();
|
6921 | s.mask.appendChild(s.alert);
|
6922 | s.parent.appendChild(s.mask);
|
6923 | };
|
6924 | s.updateDOM = function () {
|
6925 | if (s.alert) {
|
6926 | s.alert.setAttribute('class', s.params.alertClass);
|
6927 | s.alert.setAttribute(s.params.animationAttr, s.params.animation);
|
6928 | }
|
6929 |
|
6930 | if (s.html) {
|
6931 | s.html.setAttribute('class', s.params.contentClass);
|
6932 | s.html.innerHTML = s.params.html;
|
6933 | }
|
6934 |
|
6935 | if (s.caption && s.params.caption) s.caption.innerHTML = s.params.caption;
|
6936 |
|
6937 | if (s.buttonBox) {
|
6938 | s.buttonBox.setAttribute('class', s.params.handlerClass);
|
6939 | }
|
6940 |
|
6941 | if (s.buttonSubmit) {
|
6942 | s.buttonSubmit.innerHTML = s.params.buttonSubmitHTML;
|
6943 | s.buttonSubmit.setAttribute('class', s.params.buttonSubmitClass);
|
6944 | }
|
6945 |
|
6946 | if (s.buttonCancel) {
|
6947 | s.buttonCancel.innerHTML = s.params.buttonCancelHTML;
|
6948 | s.buttonCancel.setAttribute('class', s.params.buttonCancelClass);
|
6949 | }
|
6950 | };
|
6951 | s.update = function () {
|
6952 | if (s.params.mask) s.mask = typeof s.params.mask === 'string' ? document.querySelector(s.params.mask) : s.params.mask;
|
6953 | if (s.mask) {
|
6954 | if (!s.alert) s.alert = s.mask.querySelector('.' + s.params.alertClass);
|
6955 | if (!s.buttonSubmit) s.buttonSubmit = s.alert.querySelector('.' + s.params.buttonSubmitClass);
|
6956 | if (!s.buttonCancel) s.buttonCancel = s.alert.querySelector('.' + s.params.buttonCancelClass);
|
6957 | } else {
|
6958 | s.create();
|
6959 | }
|
6960 | s.mask.style.webkitTransitionDuration = s.params.duration + 'ms';
|
6961 | s.alert.style.webkitTransitionDuration = s.params.duration + 'ms';
|
6962 | };
|
6963 | s.update();
|
6964 | |
6965 |
|
6966 |
|
6967 | s.showMask = function () {
|
6968 | s.mask.classList.add(s.params.maskActiveClass);
|
6969 | };
|
6970 | s.hideMask = function () {
|
6971 | s.mask.classList.remove(s.params.maskActiveClass);
|
6972 | };
|
6973 | s.destroyMask = function () {
|
6974 | s.mask.parentNode.removeChild(s.mask);
|
6975 | };
|
6976 | s.showAlert = function () {
|
6977 | s.alert.classList.add(s.params.alertActiveClass);
|
6978 | };
|
6979 | s.hideAlert = function () {
|
6980 | s.alert.classList.remove(s.params.alertActiveClass);
|
6981 | };
|
6982 | s.isHid = true;
|
6983 | s.hide = function () {
|
6984 | s.isHid = true;
|
6985 |
|
6986 | s.hideMask();
|
6987 |
|
6988 | s.hideAlert();
|
6989 |
|
6990 | if (s.overflowContainer) s.overflowContainer.classList.remove(s.params.overflowContainerActiveClass);
|
6991 |
|
6992 | if (s.params.duration === 0) s.onTransitionEnd();
|
6993 | };
|
6994 | s.show = function () {
|
6995 | s.isHid = false;
|
6996 |
|
6997 | s.showMask();
|
6998 |
|
6999 | s.showAlert();
|
7000 |
|
7001 | if (s.overflowContainer) s.overflowContainer.classList.add(s.params.overflowContainerActiveClass);
|
7002 |
|
7003 | if (s.params.duration === 0) s.onTransitionEnd();
|
7004 | };
|
7005 | s.destroy = function () {
|
7006 | s.destroyMask();
|
7007 | };
|
7008 |
|
7009 | s.reset = function () {
|
7010 | s.params = defaults;
|
7011 | s.updateDOM();
|
7012 | };
|
7013 |
|
7014 | s.setHTML = function (html) {
|
7015 | s.html.innerHTML = html;
|
7016 | };
|
7017 | s.setCaption = function (caption) {
|
7018 | s.caption.innerHTML = caption;
|
7019 | };
|
7020 | s.setOnClick = function (fn) {
|
7021 | s.params.onClick = fn;
|
7022 | };
|
7023 | s.setOnClickSubmit = function (fn) {
|
7024 | s.params.onClickSubmit = fn;
|
7025 | };
|
7026 | s.setOnClickCancel = function (fn) {
|
7027 |
|
7028 | if (!s.params.onClickCancel) {
|
7029 | s.buttonCancel = s.createButtonCancel();
|
7030 | s.buttonBox.insertBefore(s.buttonCancel, s.buttonSubmit);
|
7031 | }
|
7032 | s.params.onClickCancel = fn;
|
7033 | };
|
7034 | |
7035 |
|
7036 |
|
7037 | s.events = function (detach) {
|
7038 | var touchTarget = s.alert;
|
7039 | var action = detach ? 'removeEventListener' : 'addEventListener';
|
7040 | touchTarget[action]('click', s.onClick, false);
|
7041 | touchTarget[action]('webkitTransitionEnd', s.onTransitionEnd, false);
|
7042 |
|
7043 | s.mask[action]('click', s.onClickMask, false);
|
7044 | };
|
7045 |
|
7046 | s.attach = function (event) {
|
7047 | s.events();
|
7048 | };
|
7049 | s.detach = function (event) {
|
7050 | s.events(true);
|
7051 | };
|
7052 | s.getArgs = function (e) {
|
7053 | var args = s.params.args;
|
7054 | if (args !== undefined) {
|
7055 | if (typeof args === 'string' && args === '$event') {
|
7056 | args = e;
|
7057 | } else if (Array.isArray(args) && args.indexOf('$event') > -1) {
|
7058 | args[args.indexOf('$event')] = e;
|
7059 | }
|
7060 | } else {
|
7061 | args = e;
|
7062 | }
|
7063 | return args;
|
7064 | };
|
7065 | s.onClick = function (e) {
|
7066 | s.event = e;
|
7067 |
|
7068 | if (s.params.onClick) s.params.onClick(s, s.getArgs(e));
|
7069 | if (e.target.className.indexOf(s.params.buttonSubmitClass) !== -1) {
|
7070 | if (s.params.onClickSubmit) s.params.onClickSubmit(s, s.getArgs(e));else s.hide();
|
7071 | } else if (e.target.className.indexOf(s.params.buttonCancelClass) !== -1) {
|
7072 | if (s.params.onClickCancel) s.params.onClickCancel(s, s.getArgs(e));else s.hide();
|
7073 | }
|
7074 | };
|
7075 | s.setOnClick = function (fn) {
|
7076 | s.params.onClick = fn;
|
7077 | };
|
7078 | s.setOnClickSubmit = function (fn) {
|
7079 | s.params.onClickSubmit = fn;
|
7080 | };
|
7081 | s.setOnClickCancel = function (fn) {
|
7082 | s.params.onClickCancel = fn;
|
7083 | };
|
7084 | s.onClickMask = function (e) {
|
7085 | if (e.target === s.mask) {
|
7086 | s.target = e.target;
|
7087 | if (s.params.onClickMask) s.params.onClickMask(s, s.getArgs(e));
|
7088 | if (s.params.isClickMaskHide) s.hide();
|
7089 | }
|
7090 | };
|
7091 | s.setOnClickMask = function (fn) {
|
7092 | s.params.onClickMask = fn;
|
7093 | };
|
7094 | s.onTransitionEnd = function (e) {
|
7095 | if (e && e.propertyName === 'visibility') return;
|
7096 | if (s.isHid) {
|
7097 |
|
7098 | if (s.params.onHid) s.params.onHid(s, s.getArgs(e));
|
7099 | } else {
|
7100 |
|
7101 | if (s.params.onShowed) s.params.onShowed(s, s.getArgs(e));
|
7102 | }
|
7103 | };
|
7104 | |
7105 |
|
7106 |
|
7107 | s.init = function () {
|
7108 | s.attach();
|
7109 | };
|
7110 | s.init();
|
7111 | };
|
7112 |
|
7113 | var Alert_instance = (instance_Alert);
|
7114 |
|
7115 |
|
7116 | var instance_Loading = function Loading(params) {
|
7117 | if (!window._seeds_lang) window._seeds_lang = {};
|
7118 | |
7119 |
|
7120 |
|
7121 | var defaults = {
|
7122 | mask: null,
|
7123 | parent: document.body,
|
7124 |
|
7125 | maskCss: '',
|
7126 | maskClass: 'mask loading-mask',
|
7127 | maskActiveClass: 'active',
|
7128 | loadingClass: 'loading',
|
7129 | loadingActiveClass: 'active',
|
7130 |
|
7131 | types: ['floating', 'filling', 'custom'],
|
7132 | type: 'floating',
|
7133 | iconClass: 'loading-custom-icon',
|
7134 | icon: '',
|
7135 | caption: window._seeds_lang['loading'] || '正在加载...'
|
7136 | };
|
7137 | params = params || {};
|
7138 | for (var def in defaults) {
|
7139 | if (params[def] === undefined) {
|
7140 | params[def] = defaults[def];
|
7141 | }
|
7142 | }
|
7143 | var s = this;
|
7144 | s.params = params;
|
7145 | s.parent = typeof s.params.parent === 'string' ? document.querySelector(s.params.parent) : s.params.parent;
|
7146 | s.mask = null;
|
7147 | s.loading = null;
|
7148 |
|
7149 |
|
7150 | s.createMask = function () {
|
7151 | var mask = document.createElement('div');
|
7152 | mask.setAttribute('class', s.params.maskClass);
|
7153 | mask.setAttribute('style', s.params.maskCss);
|
7154 | return mask;
|
7155 | };
|
7156 |
|
7157 | s.createLoading = function () {
|
7158 | var loading = document.createElement('div');
|
7159 | loading.setAttribute('class', s.params.loadingClass + ' loading-floating animated');
|
7160 |
|
7161 | var html = '<div class="loading-floating-icon">' + '<div class="loading-floating-blade"></div>' + '<div class="loading-floating-blade"></div>' + '<div class="loading-floating-blade"></div>' + '<div class="loading-floating-blade"></div>' + '<div class="loading-floating-blade"></div>' + '<div class="loading-floating-blade"></div>' + '<div class="loading-floating-blade"></div>' + '<div class="loading-floating-blade"></div>' + '<div class="loading-floating-blade"></div>' + '<div class="loading-floating-blade"></div>' + '<div class="loading-floating-blade"></div>' + '<div class="loading-floating-blade"></div>' + '</div>' + '<div class="loading-floating-caption caption">' + s.params.caption + '</div>';
|
7162 | if (s.params.type === 'filling') {
|
7163 |
|
7164 | loading.setAttribute('class', s.params.loadingClass + ' loading-filling');
|
7165 | html = '<div class="loading-filling-icon"></div>' + '<div class="loading-filling-caption caption">' + s.params.caption + '</div>';
|
7166 | } else if (s.params.type === 'custom') {
|
7167 |
|
7168 | loading.setAttribute('class', s.params.loadingClass + ' loading-custom');
|
7169 | html = '<span class="' + s.params.iconClass + ' ' + s.params.icon + '"></span><p class="loading-custom-caption caption">' + s.params.caption + '</p>';
|
7170 | }
|
7171 | loading.innerHTML = html;
|
7172 | return loading;
|
7173 | };
|
7174 | s.create = function () {
|
7175 | s.mask = s.createMask();
|
7176 | s.loading = s.createLoading();
|
7177 | s.mask.appendChild(s.loading);
|
7178 | s.parent.appendChild(s.mask);
|
7179 | };
|
7180 | s.update = function () {
|
7181 | if (s.params.mask) s.mask = typeof s.params.mask === 'string' ? document.querySelector(s.params.mask) : s.params.mask;
|
7182 | if (s.mask) {
|
7183 | s.loading = s.mask.querySelector('.' + s.params.loadingClass);
|
7184 | } else {
|
7185 | s.create();
|
7186 | }
|
7187 | };
|
7188 | s.update();
|
7189 |
|
7190 | |
7191 |
|
7192 |
|
7193 | s.setMaskCss = function (css) {
|
7194 | if (css) s.params.maskCss = css;
|
7195 | s.mask.setAttribute('style', s.params.maskCss);
|
7196 | };
|
7197 | s.setMaskClassName = function (className) {
|
7198 | if (className) s.params.maskClass = className;
|
7199 | s.mask.setAttribute('class', s.params.maskClass);
|
7200 | };
|
7201 | s.setType = function (type) {
|
7202 | if (s.params.type === type || s.params.types.indexOf(type) === -1) return;
|
7203 | s.params.type = type;
|
7204 | s.loading = s.createLoading();
|
7205 | };
|
7206 | s.setCaption = function (caption) {
|
7207 | if (!caption) return;
|
7208 | s.params.caption = caption;
|
7209 | var captionEl = s.loading.querySelector('.caption');
|
7210 | if (captionEl) {
|
7211 | captionEl.innerHTML = caption;
|
7212 | }
|
7213 | };
|
7214 | s.setIcon = function (className) {
|
7215 | s.params.icon = className;
|
7216 | var icon = s.loading.querySelector('.' + s.params.iconClass);
|
7217 | if (icon) {
|
7218 | icon.className = s.params.iconClass + (s.params.icon ? ' ' + s.params.icon : '');
|
7219 | }
|
7220 | };
|
7221 | s.setHTML = function (html) {
|
7222 | s.mask.innerHTML = html;
|
7223 | };
|
7224 |
|
7225 | s.showMask = function () {
|
7226 | s.mask.classList.add(s.params.maskActiveClass);
|
7227 | };
|
7228 | s.hideMask = function () {
|
7229 | s.mask.classList.remove(s.params.maskActiveClass);
|
7230 | };
|
7231 | s.destroyMask = function () {
|
7232 | s.mask.parentNode.removeChild(s.mask);
|
7233 | };
|
7234 |
|
7235 | s.showLoading = function () {
|
7236 | s.loading.classList.add(s.params.loadingActiveClass);
|
7237 | };
|
7238 | s.hideLoading = function () {
|
7239 | s.loading.classList.remove(s.params.loadingActiveClass);
|
7240 | };
|
7241 |
|
7242 | s.hide = function () {
|
7243 | s.hideMask();
|
7244 | s.hideLoading();
|
7245 | };
|
7246 | s.show = function () {
|
7247 | s.showMask();
|
7248 | s.showLoading();
|
7249 | };
|
7250 | s.destroy = function () {
|
7251 | s.destroyMask();
|
7252 | };
|
7253 | };
|
7254 |
|
7255 | var Loading_instance = (instance_Loading);
|
7256 |
|
7257 |
|
7258 |
|
7259 |
|
7260 |
|
7261 |
|
7262 |
|
7263 |
|
7264 |
|
7265 |
|
7266 |
|
7267 |
|
7268 |
|
7269 |
|
7270 |
|
7271 |
|
7272 |
|
7273 |
|
7274 |
|
7275 |
|
7276 |
|
7277 |
|
7278 |
|
7279 |
|
7280 |
|
7281 |
|
7282 |
|
7283 |
|
7284 |
|
7285 |
|
7286 |
|
7287 | if (typeof Object.assign != 'function') {
|
7288 |
|
7289 | Object.defineProperty(Object, "assign", {
|
7290 | value: function assign(target, varArgs) {
|
7291 |
|
7292 | if (target == null) {
|
7293 |
|
7294 | throw new TypeError('Cannot convert undefined or null to object');
|
7295 | }
|
7296 |
|
7297 | var to = Object(target);
|
7298 |
|
7299 | for (var index = 1; index < arguments.length; index++) {
|
7300 | var nextSource = arguments[index];
|
7301 |
|
7302 | if (nextSource != null) {
|
7303 |
|
7304 | for (var nextKey in nextSource) {
|
7305 |
|
7306 | if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
|
7307 | to[nextKey] = nextSource[nextKey];
|
7308 | }
|
7309 | }
|
7310 | }
|
7311 | }
|
7312 | return to;
|
7313 | },
|
7314 | writable: true,
|
7315 | configurable: true
|
7316 | });
|
7317 | }
|
7318 |
|
7319 | if (typeof Array.from != 'function') {
|
7320 | Array.from = function (object) {
|
7321 | return [].slice.call(object);
|
7322 | };
|
7323 | }
|
7324 |
|
7325 |
|
7326 | var buildElement = function buildElement(str) {
|
7327 |
|
7328 | var tmp = document.implementation.createHTMLDocument('');
|
7329 | tmp.body.innerHTML = str;
|
7330 | return Array.from(tmp.body.children)[0];
|
7331 | };
|
7332 |
|
7333 | var triggerEvent = function triggerEvent(el, name) {
|
7334 | var event = document.createEvent('HTMLEvents');
|
7335 | event.initEvent(name, true, false);
|
7336 | el.dispatchEvent(event);
|
7337 | };
|
7338 |
|
7339 | var definePinchZoom = function definePinchZoom() {
|
7340 |
|
7341 | |
7342 |
|
7343 |
|
7344 |
|
7345 |
|
7346 |
|
7347 | var PinchZoom = function PinchZoom(el, options) {
|
7348 | this.el = el;
|
7349 | this.zoomFactor = 1;
|
7350 | this.lastScale = 1;
|
7351 | this.offset = {
|
7352 | x: 0,
|
7353 | y: 0
|
7354 | };
|
7355 | this.initialOffset = {
|
7356 | x: 0,
|
7357 | y: 0
|
7358 | };
|
7359 | this.options = Object.assign({}, this.defaults, options);
|
7360 | this.setupMarkup();
|
7361 | this.bindEvents();
|
7362 | this.update();
|
7363 |
|
7364 |
|
7365 |
|
7366 | if (this.isImageLoaded(this.el)) {
|
7367 | this.updateAspectRatio();
|
7368 | this.setupOffsets();
|
7369 | }
|
7370 |
|
7371 | this.enable();
|
7372 | },
|
7373 | sum = function sum(a, b) {
|
7374 | return a + b;
|
7375 | },
|
7376 | isCloseTo = function isCloseTo(value, expected) {
|
7377 | return value > expected - 0.01 && value < expected + 0.01;
|
7378 | };
|
7379 |
|
7380 | PinchZoom.prototype = {
|
7381 |
|
7382 | defaults: {
|
7383 | tapZoomFactor: 2,
|
7384 | zoomOutFactor: 1.3,
|
7385 | animationDuration: 300,
|
7386 | maxZoom: 4,
|
7387 | minZoom: 0.5,
|
7388 | draggableUnzoomed: true,
|
7389 | lockDragAxis: false,
|
7390 | setOffsetsOnce: false,
|
7391 | use2d: true,
|
7392 | zoomStartEventName: 'pz_zoomstart',
|
7393 | zoomUpdateEventName: 'pz_zoomupdate',
|
7394 | zoomEndEventName: 'pz_zoomend',
|
7395 | dragStartEventName: 'pz_dragstart',
|
7396 | dragUpdateEventName: 'pz_dragupdate',
|
7397 | dragEndEventName: 'pz_dragend',
|
7398 | doubleTapEventName: 'pz_doubletap',
|
7399 | verticalPadding: 0,
|
7400 | horizontalPadding: 0,
|
7401 | onZoomStart: null,
|
7402 | onZoomEnd: null,
|
7403 | onZoomUpdate: null,
|
7404 | onDragStart: null,
|
7405 | onDragEnd: null,
|
7406 | onDragUpdate: null,
|
7407 | onDoubleTap: null
|
7408 | },
|
7409 |
|
7410 | |
7411 |
|
7412 |
|
7413 |
|
7414 | handleDragStart: function handleDragStart(event) {
|
7415 | triggerEvent(this.el, this.options.dragStartEventName);
|
7416 | if (typeof this.options.onDragStart == "function") {
|
7417 | this.options.onDragStart(this, event);
|
7418 | }
|
7419 | this.stopAnimation();
|
7420 | this.lastDragPosition = false;
|
7421 | this.hasInteraction = true;
|
7422 | this.handleDrag(event);
|
7423 | },
|
7424 |
|
7425 | |
7426 |
|
7427 |
|
7428 |
|
7429 | handleDrag: function handleDrag(event) {
|
7430 | var touch = this.getTouches(event)[0];
|
7431 | this.drag(touch, this.lastDragPosition);
|
7432 | this.offset = this.sanitizeOffset(this.offset);
|
7433 | this.lastDragPosition = touch;
|
7434 | },
|
7435 |
|
7436 | handleDragEnd: function handleDragEnd() {
|
7437 | triggerEvent(this.el, this.options.dragEndEventName);
|
7438 | if (typeof this.options.onDragEnd == "function") {
|
7439 | this.options.onDragEnd(this, event);
|
7440 | }
|
7441 | this.end();
|
7442 | },
|
7443 |
|
7444 | |
7445 |
|
7446 |
|
7447 |
|
7448 | handleZoomStart: function handleZoomStart(event) {
|
7449 | triggerEvent(this.el, this.options.zoomStartEventName);
|
7450 | if (typeof this.options.onZoomStart == "function") {
|
7451 | this.options.onZoomStart(this, event);
|
7452 | }
|
7453 | this.stopAnimation();
|
7454 | this.lastScale = 1;
|
7455 | this.nthZoom = 0;
|
7456 | this.lastZoomCenter = false;
|
7457 | this.hasInteraction = true;
|
7458 | },
|
7459 |
|
7460 | |
7461 |
|
7462 |
|
7463 |
|
7464 | handleZoom: function handleZoom(event, newScale) {
|
7465 |
|
7466 | var touchCenter = this.getTouchCenter(this.getTouches(event)),
|
7467 | scale = newScale / this.lastScale;
|
7468 | this.lastScale = newScale;
|
7469 |
|
7470 |
|
7471 | this.nthZoom += 1;
|
7472 | if (this.nthZoom > 3) {
|
7473 |
|
7474 | this.scale(scale, touchCenter);
|
7475 | this.drag(touchCenter, this.lastZoomCenter);
|
7476 | }
|
7477 | this.lastZoomCenter = touchCenter;
|
7478 | },
|
7479 |
|
7480 | handleZoomEnd: function handleZoomEnd() {
|
7481 | triggerEvent(this.el, this.options.zoomEndEventName);
|
7482 | if (typeof this.options.onZoomEnd == "function") {
|
7483 | this.options.onZoomEnd(this, event);
|
7484 | }
|
7485 | this.end();
|
7486 | },
|
7487 |
|
7488 | |
7489 |
|
7490 |
|
7491 |
|
7492 | handleDoubleTap: function handleDoubleTap(event) {
|
7493 | var center = this.getTouches(event)[0],
|
7494 | zoomFactor = this.zoomFactor > 1 ? 1 : this.options.tapZoomFactor,
|
7495 | startZoomFactor = this.zoomFactor,
|
7496 | updateProgress = function (progress) {
|
7497 | this.scaleTo(startZoomFactor + progress * (zoomFactor - startZoomFactor), center);
|
7498 | }.bind(this);
|
7499 |
|
7500 | if (this.hasInteraction) {
|
7501 | return;
|
7502 | }
|
7503 |
|
7504 | this.isDoubleTap = true;
|
7505 |
|
7506 | if (startZoomFactor > zoomFactor) {
|
7507 | center = this.getCurrentZoomCenter();
|
7508 | }
|
7509 |
|
7510 | this.animate(this.options.animationDuration, updateProgress, this.swing);
|
7511 | triggerEvent(this.el, this.options.doubleTapEventName);
|
7512 | if (typeof this.options.onDoubleTap == "function") {
|
7513 | this.options.onDoubleTap(this, event);
|
7514 | }
|
7515 | },
|
7516 |
|
7517 | |
7518 |
|
7519 |
|
7520 |
|
7521 |
|
7522 | computeInitialOffset: function computeInitialOffset() {
|
7523 | this.initialOffset = {
|
7524 | x: -Math.abs(this.el.offsetWidth * this.getInitialZoomFactor() - this.container.offsetWidth) / 2,
|
7525 | y: -Math.abs(this.el.offsetHeight * this.getInitialZoomFactor() - this.container.offsetHeight) / 2
|
7526 | };
|
7527 | },
|
7528 |
|
7529 | |
7530 |
|
7531 |
|
7532 | resetOffset: function resetOffset() {
|
7533 | this.offset.x = this.initialOffset.x;
|
7534 | this.offset.y = this.initialOffset.y;
|
7535 | },
|
7536 |
|
7537 | |
7538 |
|
7539 |
|
7540 | isImageLoaded: function isImageLoaded(el) {
|
7541 | if (el.nodeName === 'IMG') {
|
7542 | return el.complete && el.naturalHeight !== 0;
|
7543 | } else {
|
7544 | return Array.from(el.querySelectorAll('img')).every(this.isImageLoaded);
|
7545 | }
|
7546 | },
|
7547 |
|
7548 | setupOffsets: function setupOffsets() {
|
7549 | if (this.options.setOffsetsOnce && this._isOffsetsSet) {
|
7550 | return;
|
7551 | }
|
7552 |
|
7553 | this._isOffsetsSet = true;
|
7554 |
|
7555 | this.computeInitialOffset();
|
7556 | this.resetOffset();
|
7557 | },
|
7558 |
|
7559 | |
7560 |
|
7561 |
|
7562 |
|
7563 |
|
7564 | sanitizeOffset: function sanitizeOffset(offset) {
|
7565 | var elWidth = this.el.offsetWidth * this.getInitialZoomFactor() * this.zoomFactor;
|
7566 | var elHeight = this.el.offsetHeight * this.getInitialZoomFactor() * this.zoomFactor;
|
7567 | var maxX = elWidth - this.getContainerX() + this.options.horizontalPadding,
|
7568 | maxY = elHeight - this.getContainerY() + this.options.verticalPadding,
|
7569 | maxOffsetX = Math.max(maxX, 0),
|
7570 | maxOffsetY = Math.max(maxY, 0),
|
7571 | minOffsetX = Math.min(maxX, 0) - this.options.horizontalPadding,
|
7572 | minOffsetY = Math.min(maxY, 0) - this.options.verticalPadding;
|
7573 |
|
7574 | return {
|
7575 | x: Math.min(Math.max(offset.x, minOffsetX), maxOffsetX),
|
7576 | y: Math.min(Math.max(offset.y, minOffsetY), maxOffsetY)
|
7577 | };
|
7578 | },
|
7579 |
|
7580 | |
7581 |
|
7582 |
|
7583 |
|
7584 |
|
7585 | scaleTo: function scaleTo(zoomFactor, center) {
|
7586 | this.scale(zoomFactor / this.zoomFactor, center);
|
7587 | },
|
7588 |
|
7589 | |
7590 |
|
7591 |
|
7592 |
|
7593 |
|
7594 | scale: function scale(_scale, center) {
|
7595 | _scale = this.scaleZoomFactor(_scale);
|
7596 | this.addOffset({
|
7597 | x: (_scale - 1) * (center.x + this.offset.x),
|
7598 | y: (_scale - 1) * (center.y + this.offset.y)
|
7599 | });
|
7600 | triggerEvent(this.el, this.options.zoomUpdateEventName);
|
7601 | if (typeof this.options.onZoomUpdate == "function") {
|
7602 | this.options.onZoomUpdate(this, event);
|
7603 | }
|
7604 | },
|
7605 |
|
7606 | |
7607 |
|
7608 |
|
7609 |
|
7610 |
|
7611 | scaleZoomFactor: function scaleZoomFactor(scale) {
|
7612 | var originalZoomFactor = this.zoomFactor;
|
7613 | this.zoomFactor *= scale;
|
7614 | this.zoomFactor = Math.min(this.options.maxZoom, Math.max(this.zoomFactor, this.options.minZoom));
|
7615 | return this.zoomFactor / originalZoomFactor;
|
7616 | },
|
7617 |
|
7618 | |
7619 |
|
7620 |
|
7621 |
|
7622 |
|
7623 |
|
7624 |
|
7625 |
|
7626 | canDrag: function canDrag() {
|
7627 | return this.options.draggableUnzoomed || !isCloseTo(this.zoomFactor, 1);
|
7628 | },
|
7629 |
|
7630 | |
7631 |
|
7632 |
|
7633 |
|
7634 |
|
7635 | drag: function drag(center, lastCenter) {
|
7636 | if (lastCenter) {
|
7637 | if (this.options.lockDragAxis) {
|
7638 |
|
7639 | if (Math.abs(center.x - lastCenter.x) > Math.abs(center.y - lastCenter.y)) {
|
7640 | this.addOffset({
|
7641 | x: -(center.x - lastCenter.x),
|
7642 | y: 0
|
7643 | });
|
7644 | } else {
|
7645 | this.addOffset({
|
7646 | y: -(center.y - lastCenter.y),
|
7647 | x: 0
|
7648 | });
|
7649 | }
|
7650 | } else {
|
7651 | this.addOffset({
|
7652 | y: -(center.y - lastCenter.y),
|
7653 | x: -(center.x - lastCenter.x)
|
7654 | });
|
7655 | }
|
7656 | triggerEvent(this.el, this.options.dragUpdateEventName);
|
7657 | if (typeof this.options.onDragUpdate == "function") {
|
7658 | this.options.onDragUpdate(this, event);
|
7659 | }
|
7660 | }
|
7661 | },
|
7662 |
|
7663 | |
7664 |
|
7665 |
|
7666 |
|
7667 |
|
7668 | getTouchCenter: function getTouchCenter(touches) {
|
7669 | return this.getVectorAvg(touches);
|
7670 | },
|
7671 |
|
7672 | |
7673 |
|
7674 |
|
7675 | getVectorAvg: function getVectorAvg(vectors) {
|
7676 | return {
|
7677 | x: vectors.map(function (v) {
|
7678 | return v.x;
|
7679 | }).reduce(sum) / vectors.length,
|
7680 | y: vectors.map(function (v) {
|
7681 | return v.y;
|
7682 | }).reduce(sum) / vectors.length
|
7683 | };
|
7684 | },
|
7685 |
|
7686 | |
7687 |
|
7688 |
|
7689 |
|
7690 |
|
7691 | addOffset: function addOffset(offset) {
|
7692 | this.offset = {
|
7693 | x: this.offset.x + offset.x,
|
7694 | y: this.offset.y + offset.y
|
7695 | };
|
7696 | },
|
7697 |
|
7698 | sanitize: function sanitize() {
|
7699 | if (this.zoomFactor < this.options.zoomOutFactor) {
|
7700 | this.zoomOutAnimation();
|
7701 | } else if (this.isInsaneOffset(this.offset)) {
|
7702 | this.sanitizeOffsetAnimation();
|
7703 | }
|
7704 | },
|
7705 |
|
7706 | |
7707 |
|
7708 |
|
7709 |
|
7710 |
|
7711 | isInsaneOffset: function isInsaneOffset(offset) {
|
7712 | var sanitizedOffset = this.sanitizeOffset(offset);
|
7713 | return sanitizedOffset.x !== offset.x || sanitizedOffset.y !== offset.y;
|
7714 | },
|
7715 |
|
7716 | |
7717 |
|
7718 |
|
7719 | sanitizeOffsetAnimation: function sanitizeOffsetAnimation() {
|
7720 | var targetOffset = this.sanitizeOffset(this.offset),
|
7721 | startOffset = {
|
7722 | x: this.offset.x,
|
7723 | y: this.offset.y
|
7724 | },
|
7725 | updateProgress = function (progress) {
|
7726 | this.offset.x = startOffset.x + progress * (targetOffset.x - startOffset.x);
|
7727 | this.offset.y = startOffset.y + progress * (targetOffset.y - startOffset.y);
|
7728 | this.update();
|
7729 | }.bind(this);
|
7730 |
|
7731 | this.animate(this.options.animationDuration, updateProgress, this.swing);
|
7732 | },
|
7733 |
|
7734 | |
7735 |
|
7736 |
|
7737 |
|
7738 | zoomOutAnimation: function zoomOutAnimation() {
|
7739 | if (this.zoomFactor === 1) {
|
7740 | return;
|
7741 | }
|
7742 |
|
7743 | var startZoomFactor = this.zoomFactor,
|
7744 | zoomFactor = 1,
|
7745 | center = this.getCurrentZoomCenter(),
|
7746 | updateProgress = function (progress) {
|
7747 | this.scaleTo(startZoomFactor + progress * (zoomFactor - startZoomFactor), center);
|
7748 | }.bind(this);
|
7749 |
|
7750 | this.animate(this.options.animationDuration, updateProgress, this.swing);
|
7751 | },
|
7752 |
|
7753 | |
7754 |
|
7755 |
|
7756 |
|
7757 |
|
7758 |
|
7759 | updateAspectRatio: function updateAspectRatio() {
|
7760 | this.unsetContainerY();
|
7761 | this.setContainerY(this.container.parentElement.offsetHeight);
|
7762 | },
|
7763 |
|
7764 | |
7765 |
|
7766 |
|
7767 |
|
7768 | getInitialZoomFactor: function getInitialZoomFactor() {
|
7769 | var xZoomFactor = this.container.offsetWidth / this.el.offsetWidth;
|
7770 | var yZoomFactor = this.container.offsetHeight / this.el.offsetHeight;
|
7771 |
|
7772 | return Math.min(xZoomFactor, yZoomFactor);
|
7773 | },
|
7774 |
|
7775 | |
7776 |
|
7777 |
|
7778 |
|
7779 | getAspectRatio: function getAspectRatio() {
|
7780 | return this.el.offsetWidth / this.el.offsetHeight;
|
7781 | },
|
7782 |
|
7783 | |
7784 |
|
7785 |
|
7786 |
|
7787 |
|
7788 | getCurrentZoomCenter: function getCurrentZoomCenter() {
|
7789 | var offsetLeft = this.offset.x - this.initialOffset.x;
|
7790 | var centerX = -1 * this.offset.x - offsetLeft / (1 / this.zoomFactor - 1);
|
7791 |
|
7792 | var offsetTop = this.offset.y - this.initialOffset.y;
|
7793 | var centerY = -1 * this.offset.y - offsetTop / (1 / this.zoomFactor - 1);
|
7794 |
|
7795 | return {
|
7796 | x: centerX,
|
7797 | y: centerY
|
7798 | };
|
7799 | },
|
7800 |
|
7801 | |
7802 |
|
7803 |
|
7804 |
|
7805 |
|
7806 | getTouches: function getTouches(event) {
|
7807 | var rect = this.container.getBoundingClientRect();
|
7808 | var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
|
7809 | var scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft;
|
7810 | var posTop = rect.top + scrollTop;
|
7811 | var posLeft = rect.left + scrollLeft;
|
7812 |
|
7813 | return Array.prototype.slice.call(event.touches).map(function (touch) {
|
7814 | return {
|
7815 | x: touch.pageX - posLeft,
|
7816 | y: touch.pageY - posTop
|
7817 | };
|
7818 | });
|
7819 | },
|
7820 |
|
7821 | |
7822 |
|
7823 |
|
7824 |
|
7825 |
|
7826 |
|
7827 |
|
7828 |
|
7829 | animate: function animate(duration, framefn, timefn, callback) {
|
7830 | var startTime = new Date().getTime(),
|
7831 | renderFrame = function () {
|
7832 | if (!this.inAnimation) {
|
7833 | return;
|
7834 | }
|
7835 | var frameTime = new Date().getTime() - startTime,
|
7836 | progress = frameTime / duration;
|
7837 | if (frameTime >= duration) {
|
7838 | framefn(1);
|
7839 | if (callback) {
|
7840 | callback();
|
7841 | }
|
7842 | this.update();
|
7843 | this.stopAnimation();
|
7844 | this.update();
|
7845 | } else {
|
7846 | if (timefn) {
|
7847 | progress = timefn(progress);
|
7848 | }
|
7849 | framefn(progress);
|
7850 | this.update();
|
7851 | requestAnimationFrame(renderFrame);
|
7852 | }
|
7853 | }.bind(this);
|
7854 | this.inAnimation = true;
|
7855 | requestAnimationFrame(renderFrame);
|
7856 | },
|
7857 |
|
7858 | |
7859 |
|
7860 |
|
7861 | stopAnimation: function stopAnimation() {
|
7862 | this.inAnimation = false;
|
7863 | },
|
7864 |
|
7865 | |
7866 |
|
7867 |
|
7868 |
|
7869 |
|
7870 | swing: function swing(p) {
|
7871 | return -Math.cos(p * Math.PI) / 2 + 0.5;
|
7872 | },
|
7873 |
|
7874 | getContainerX: function getContainerX() {
|
7875 | return this.container.offsetWidth;
|
7876 | },
|
7877 |
|
7878 | getContainerY: function getContainerY() {
|
7879 | return this.container.offsetHeight;
|
7880 | },
|
7881 |
|
7882 | setContainerY: function setContainerY(y) {
|
7883 | return this.container.style.height = y + 'px';
|
7884 | },
|
7885 |
|
7886 | unsetContainerY: function unsetContainerY() {
|
7887 | this.container.style.height = null;
|
7888 | },
|
7889 |
|
7890 | |
7891 |
|
7892 |
|
7893 | setupMarkup: function setupMarkup() {
|
7894 | this.container = buildElement('<div class="pinch-zoom-container"></div>');
|
7895 | this.el.parentNode.insertBefore(this.container, this.el);
|
7896 | this.container.appendChild(this.el);
|
7897 |
|
7898 | this.container.style.overflow = 'hidden';
|
7899 | this.container.style.position = 'relative';
|
7900 |
|
7901 | this.el.style.webkitTransformOrigin = '0% 0%';
|
7902 | this.el.style.mozTransformOrigin = '0% 0%';
|
7903 | this.el.style.msTransformOrigin = '0% 0%';
|
7904 | this.el.style.oTransformOrigin = '0% 0%';
|
7905 | this.el.style.transformOrigin = '0% 0%';
|
7906 |
|
7907 | this.el.style.position = 'absolute';
|
7908 | },
|
7909 |
|
7910 | end: function end() {
|
7911 | this.hasInteraction = false;
|
7912 | this.sanitize();
|
7913 | this.update();
|
7914 | },
|
7915 |
|
7916 | |
7917 |
|
7918 |
|
7919 | bindEvents: function bindEvents() {
|
7920 | var self = this;
|
7921 | detectGestures(this.container, this);
|
7922 |
|
7923 | window.addEventListener('resize', this.update.bind(this));
|
7924 | Array.from(this.el.querySelectorAll('img')).forEach(function (imgEl) {
|
7925 | imgEl.addEventListener('load', self.update.bind(self));
|
7926 | });
|
7927 |
|
7928 | if (this.el.nodeName === 'IMG') {
|
7929 | this.el.addEventListener('load', this.update.bind(this));
|
7930 | }
|
7931 | },
|
7932 |
|
7933 | |
7934 |
|
7935 |
|
7936 | update: function update(event) {
|
7937 | if (this.updatePlaned) {
|
7938 | return;
|
7939 | }
|
7940 | this.updatePlaned = true;
|
7941 |
|
7942 | window.setTimeout(function () {
|
7943 | this.updatePlaned = false;
|
7944 |
|
7945 | if (event && event.type === 'resize') {
|
7946 | this.updateAspectRatio();
|
7947 | this.setupOffsets();
|
7948 | }
|
7949 |
|
7950 | if (event && event.type === 'load') {
|
7951 | this.updateAspectRatio();
|
7952 | this.setupOffsets();
|
7953 | }
|
7954 |
|
7955 | var zoomFactor = this.getInitialZoomFactor() * this.zoomFactor,
|
7956 | offsetX = -this.offset.x / zoomFactor,
|
7957 | offsetY = -this.offset.y / zoomFactor,
|
7958 | transform3d = 'scale3d(' + zoomFactor + ', ' + zoomFactor + ',1) ' + 'translate3d(' + offsetX + 'px,' + offsetY + 'px,0px)',
|
7959 | transform2d = 'scale(' + zoomFactor + ', ' + zoomFactor + ') ' + 'translate(' + offsetX + 'px,' + offsetY + 'px)',
|
7960 | removeClone = function () {
|
7961 | if (this.clone) {
|
7962 | this.clone.parentNode.removeChild(this.clone);
|
7963 | delete this.clone;
|
7964 | }
|
7965 | }.bind(this);
|
7966 |
|
7967 |
|
7968 |
|
7969 |
|
7970 |
|
7971 | if (!this.options.use2d || this.hasInteraction || this.inAnimation) {
|
7972 | this.is3d = true;
|
7973 | removeClone();
|
7974 |
|
7975 | this.el.style.webkitTransform = transform3d;
|
7976 | this.el.style.mozTransform = transform2d;
|
7977 | this.el.style.msTransform = transform2d;
|
7978 | this.el.style.oTransform = transform2d;
|
7979 | this.el.style.transform = transform3d;
|
7980 | } else {
|
7981 |
|
7982 |
|
7983 |
|
7984 | if (this.is3d) {
|
7985 | this.clone = this.el.cloneNode(true);
|
7986 | this.clone.style.pointerEvents = 'none';
|
7987 | this.container.appendChild(this.clone);
|
7988 | window.setTimeout(removeClone, 200);
|
7989 | }
|
7990 |
|
7991 | this.el.style.webkitTransform = transform2d;
|
7992 | this.el.style.mozTransform = transform2d;
|
7993 | this.el.style.msTransform = transform2d;
|
7994 | this.el.style.oTransform = transform2d;
|
7995 | this.el.style.transform = transform2d;
|
7996 |
|
7997 | this.is3d = false;
|
7998 | }
|
7999 | }.bind(this), 0);
|
8000 | },
|
8001 |
|
8002 | |
8003 |
|
8004 |
|
8005 | enable: function enable() {
|
8006 | this.enabled = true;
|
8007 | },
|
8008 |
|
8009 | |
8010 |
|
8011 |
|
8012 | disable: function disable() {
|
8013 | this.enabled = false;
|
8014 | }
|
8015 | };
|
8016 |
|
8017 | var detectGestures = function detectGestures(el, target) {
|
8018 | var interaction = null,
|
8019 | fingers = 0,
|
8020 | lastTouchStart = null,
|
8021 | startTouches = null,
|
8022 | setInteraction = function setInteraction(newInteraction, event) {
|
8023 | if (interaction !== newInteraction) {
|
8024 |
|
8025 | if (interaction && !newInteraction) {
|
8026 | switch (interaction) {
|
8027 | case "zoom":
|
8028 | target.handleZoomEnd(event);
|
8029 | break;
|
8030 | case 'drag':
|
8031 | target.handleDragEnd(event);
|
8032 | break;
|
8033 | }
|
8034 | }
|
8035 |
|
8036 | switch (newInteraction) {
|
8037 | case 'zoom':
|
8038 | target.handleZoomStart(event);
|
8039 | break;
|
8040 | case 'drag':
|
8041 | target.handleDragStart(event);
|
8042 | break;
|
8043 | }
|
8044 | }
|
8045 | interaction = newInteraction;
|
8046 | },
|
8047 | updateInteraction = function updateInteraction(event) {
|
8048 | if (fingers === 2) {
|
8049 | setInteraction('zoom');
|
8050 | } else if (fingers === 1 && target.canDrag()) {
|
8051 | setInteraction('drag', event);
|
8052 | } else {
|
8053 | setInteraction(null, event);
|
8054 | }
|
8055 | },
|
8056 | targetTouches = function targetTouches(touches) {
|
8057 | return Array.from(touches).map(function (touch) {
|
8058 | return {
|
8059 | x: touch.pageX,
|
8060 | y: touch.pageY
|
8061 | };
|
8062 | });
|
8063 | },
|
8064 | getDistance = function getDistance(a, b) {
|
8065 | var x, y;
|
8066 | x = a.x - b.x;
|
8067 | y = a.y - b.y;
|
8068 | return Math.sqrt(x * x + y * y);
|
8069 | },
|
8070 | calculateScale = function calculateScale(startTouches, endTouches) {
|
8071 | var startDistance = getDistance(startTouches[0], startTouches[1]),
|
8072 | endDistance = getDistance(endTouches[0], endTouches[1]);
|
8073 | return endDistance / startDistance;
|
8074 | },
|
8075 | cancelEvent = function cancelEvent(event) {
|
8076 | event.stopPropagation();
|
8077 | event.preventDefault();
|
8078 | },
|
8079 | detectDoubleTap = function detectDoubleTap(event) {
|
8080 | var time = new Date().getTime();
|
8081 |
|
8082 | if (fingers > 1) {
|
8083 | lastTouchStart = null;
|
8084 | }
|
8085 |
|
8086 | if (time - lastTouchStart < 300) {
|
8087 | cancelEvent(event);
|
8088 |
|
8089 | target.handleDoubleTap(event);
|
8090 | switch (interaction) {
|
8091 | case "zoom":
|
8092 | target.handleZoomEnd(event);
|
8093 | break;
|
8094 | case 'drag':
|
8095 | target.handleDragEnd(event);
|
8096 | break;
|
8097 | }
|
8098 | } else {
|
8099 | target.isDoubleTap = false;
|
8100 | }
|
8101 |
|
8102 | if (fingers === 1) {
|
8103 | lastTouchStart = time;
|
8104 | }
|
8105 | },
|
8106 | firstMove = true;
|
8107 |
|
8108 | el.addEventListener('touchstart', function (event) {
|
8109 | if (target.enabled) {
|
8110 | firstMove = true;
|
8111 | fingers = event.touches.length;
|
8112 | detectDoubleTap(event);
|
8113 | }
|
8114 | });
|
8115 |
|
8116 | el.addEventListener('touchmove', function (event) {
|
8117 | if (target.enabled && !target.isDoubleTap) {
|
8118 | if (firstMove) {
|
8119 | updateInteraction(event);
|
8120 | if (interaction) {
|
8121 | cancelEvent(event);
|
8122 | }
|
8123 | startTouches = targetTouches(event.touches);
|
8124 | } else {
|
8125 | switch (interaction) {
|
8126 | case 'zoom':
|
8127 | target.handleZoom(event, calculateScale(startTouches, targetTouches(event.touches)));
|
8128 | break;
|
8129 | case 'drag':
|
8130 | target.handleDrag(event);
|
8131 | break;
|
8132 | }
|
8133 | if (interaction) {
|
8134 | cancelEvent(event);
|
8135 | target.update();
|
8136 | }
|
8137 | }
|
8138 |
|
8139 | firstMove = false;
|
8140 | }
|
8141 | });
|
8142 |
|
8143 | el.addEventListener('touchend', function (event) {
|
8144 | if (target.enabled) {
|
8145 | fingers = event.touches.length;
|
8146 | updateInteraction(event);
|
8147 | }
|
8148 | });
|
8149 | };
|
8150 |
|
8151 | return PinchZoom;
|
8152 | };
|
8153 |
|
8154 | var PinchZoom = definePinchZoom();
|
8155 |
|
8156 | var pinch_zoom = (PinchZoom);
|
8157 |
|
8158 |
|
8159 |
|
8160 |
|
8161 |
|
8162 | var instance_Preview = function Preview(params) {
|
8163 | if (!window._seeds_lang) window._seeds_lang = {};
|
8164 | |
8165 |
|
8166 |
|
8167 | var defaults = {
|
8168 | src: '',
|
8169 | layerHTML: '',
|
8170 |
|
8171 | hash: 's_preview',
|
8172 | hashReplace: /(isFromApp=\w+)&?/,
|
8173 | route: true,
|
8174 |
|
8175 | mask: null,
|
8176 | maskClass: 'preview-mask',
|
8177 | maskActiveClass: 'active',
|
8178 |
|
8179 | showHeader: false,
|
8180 | headerClass: 'preview-header',
|
8181 | headerBackClass: 'preview-header-back',
|
8182 |
|
8183 | containerClass: 'preview-container',
|
8184 |
|
8185 | wrapperClass: 'preview-wrapper',
|
8186 |
|
8187 | layerClass: 'preview-layer',
|
8188 |
|
8189 | clickDelay: 300
|
8190 | |
8191 |
|
8192 |
|
8193 |
|
8194 |
|
8195 |
|
8196 |
|
8197 |
|
8198 |
|
8199 | };
|
8200 | params = params || {};
|
8201 | for (var def in defaults) {
|
8202 | if (params[def] === undefined) {
|
8203 | params[def] = defaults[def];
|
8204 | }
|
8205 | }
|
8206 | var s = this;
|
8207 | s.params = params;
|
8208 | |
8209 |
|
8210 |
|
8211 | s.setSrc = function (src) {
|
8212 | if (src) {
|
8213 | s.params.src = src;
|
8214 | }
|
8215 | };
|
8216 | s.setLayerHTML = function (layerHTML) {
|
8217 | if (layerHTML) {
|
8218 | s.params.layerHTML = layerHTML;
|
8219 | }
|
8220 | };
|
8221 | s.setOnSuccess = function (onSuccess) {
|
8222 | if (onSuccess) {
|
8223 | s.params.onSuccess = onSuccess;
|
8224 | }
|
8225 | };
|
8226 | s.setOnError = function (onError) {
|
8227 | if (onError) {
|
8228 | s.params.onError = onError;
|
8229 | }
|
8230 | };
|
8231 |
|
8232 | s.mask = typeof s.params.mask === 'string' ? document.querySelector(s.params.mask) : s.params.mask;
|
8233 | s.header = null;
|
8234 | s.headerBack = null;
|
8235 | s.container = null;
|
8236 | s.img = null;
|
8237 | s.createPreview = function (img, layerHTML) {
|
8238 | if (!s.mask) {
|
8239 | s.mask = document.createElement('div');
|
8240 | s.mask.setAttribute('class', s.params.maskClass);
|
8241 |
|
8242 | s.header = document.createElement('div');
|
8243 | s.header.setAttribute('class', s.params.headerClass);
|
8244 |
|
8245 | s.headerBack = document.createElement('div');
|
8246 | s.headerBack.setAttribute('class', s.params.headerBackClass);
|
8247 | s.headerBack.addEventListener('click', s.onClickBack, false);
|
8248 |
|
8249 | s.header.appendChild(s.headerBack);
|
8250 |
|
8251 | s.container = document.createElement('div');
|
8252 | s.container.setAttribute('class', s.params.containerClass);
|
8253 |
|
8254 | s.mask.appendChild(s.header);
|
8255 | s.mask.appendChild(s.container);
|
8256 | s.mask.addEventListener('click', s.onClick, false);
|
8257 | document.body.appendChild(s.mask);
|
8258 | } else {
|
8259 | s.mask.addEventListener('click', s.onClick, false);
|
8260 |
|
8261 | s.header = s.mask.querySelector('.' + s.params.headerClass);
|
8262 | s.headerBack = s.mask.querySelector('.' + s.params.headerBackClass);
|
8263 | s.headerBack.addEventListener('click', s.onClickBack, false);
|
8264 |
|
8265 | s.container = s.mask.querySelector('.' + s.params.containerClass);
|
8266 |
|
8267 | s.container.innerHTML = '';
|
8268 | }
|
8269 | if (s.params.showHeader === false) s.header.style.display = 'none';
|
8270 |
|
8271 |
|
8272 | s.img = img;
|
8273 | s.container.appendChild(s.img);
|
8274 |
|
8275 |
|
8276 | s.container.innerHTML = s.container.innerHTML + layerHTML;
|
8277 | };
|
8278 |
|
8279 | s.removePreview = function () {
|
8280 | if (s.mask) document.body.removeChild(s.mask);
|
8281 | s.mask = null;
|
8282 | s.header = null;
|
8283 | s.headerBack = null;
|
8284 | s.container = null;
|
8285 | s.img = null;
|
8286 | };
|
8287 |
|
8288 | s.validSrc = null;
|
8289 |
|
8290 | s.PinchZoom = null;
|
8291 |
|
8292 | s.update = function () {
|
8293 | if (!s.params.src) {
|
8294 | s.validSrc = false;
|
8295 | return;
|
8296 | }
|
8297 | s.removePreview();
|
8298 | var img = new Image();
|
8299 | img.src = s.params.src;
|
8300 | img.addEventListener('load', function () {
|
8301 | if (img.width > img.height) {
|
8302 |
|
8303 | img.style.height = '100%';
|
8304 | } else {
|
8305 |
|
8306 | img.style.width = '100%';
|
8307 | }
|
8308 | s.createPreview(img, s.params.layerHTML);
|
8309 | s.validSrc = true;
|
8310 |
|
8311 | s.PinchZoom = new pinch_zoom(s.container, {
|
8312 | onZoomUpdate: function onZoomUpdate() {
|
8313 | if (s.clickTimeout) {
|
8314 | window.clearTimeout(s.clickTimeout);
|
8315 | s.clickTimeout = null;
|
8316 | }
|
8317 | },
|
8318 | onDragUpdate: function onDragUpdate() {
|
8319 | if (s.clickTimeout) {
|
8320 | window.clearTimeout(s.clickTimeout);
|
8321 | s.clickTimeout = null;
|
8322 | }
|
8323 | }
|
8324 | });
|
8325 |
|
8326 |
|
8327 |
|
8328 |
|
8329 |
|
8330 |
|
8331 |
|
8332 |
|
8333 |
|
8334 |
|
8335 |
|
8336 |
|
8337 |
|
8338 |
|
8339 |
|
8340 |
|
8341 |
|
8342 |
|
8343 |
|
8344 |
|
8345 |
|
8346 |
|
8347 | setTimeout(function () {
|
8348 | s.container.style.backgroundColor = '#000';
|
8349 | }, 100);
|
8350 |
|
8351 | if (s.params.onSuccess) s.params.onSuccess(s);
|
8352 | }, false);
|
8353 | img.addEventListener('error', function () {
|
8354 | s.validSrc = false;
|
8355 |
|
8356 | if (s.params.onError) s.params.onError(s);
|
8357 | }, false);
|
8358 | };
|
8359 | s.update();
|
8360 | |
8361 |
|
8362 |
|
8363 |
|
8364 | s.addHash = function () {
|
8365 | if (!s.params.route) return;
|
8366 | var href = window.location.href;
|
8367 | if (href.indexOf(s.params.hash) !== -1) return;
|
8368 |
|
8369 | if (href.indexOf('#') !== -1) {
|
8370 |
|
8371 | if (s.params.hashReplace.test(href)) {
|
8372 |
|
8373 | href = href.replace(RegExp.$1, '');
|
8374 | }
|
8375 | href = href + (href.indexOf('?') !== -1 ? '&' : '?') + s.params.hash;
|
8376 | } else {
|
8377 |
|
8378 | href = href + '#' + s.params.hash;
|
8379 | }
|
8380 | window.location.href = href;
|
8381 | };
|
8382 | s.removeHash = function () {
|
8383 | if (!s.params.route) return;
|
8384 | if (window.location.href.indexOf(s.params.hash) !== -1) {
|
8385 | window.history.go(-1);
|
8386 | }
|
8387 | };
|
8388 |
|
8389 | s.hideMask = function () {
|
8390 | s.mask.classList.remove(s.params.maskActiveClass);
|
8391 | };
|
8392 | s.hide = function () {
|
8393 | s.removeHash();
|
8394 | s.hideMask();
|
8395 | };
|
8396 |
|
8397 | s.showMask = function () {
|
8398 | s.mask.classList.add(s.params.maskActiveClass);
|
8399 | };
|
8400 | s.show = function () {
|
8401 | if (s.validSrc) {
|
8402 | if (s.params.onShowSuccess) s.params.onShowSuccess(s);
|
8403 | s.addHash();
|
8404 | s.showMask();
|
8405 | } else {
|
8406 | if (s.params.onShowError) s.params.onShowError(s, window._seeds_lang['hint_image_failed_to_load'] || '图片加载失败');
|
8407 | }
|
8408 | };
|
8409 | |
8410 |
|
8411 |
|
8412 | s.events = function (detach) {
|
8413 | var action = detach ? 'removeEventListener' : 'addEventListener';
|
8414 | if (s.params.route) {
|
8415 | window[action]('popstate', s.onPopstate, false);
|
8416 | }
|
8417 | };
|
8418 |
|
8419 | s.attach = function (event) {
|
8420 | s.events();
|
8421 | };
|
8422 | s.detach = function (event) {
|
8423 | s.events(true);
|
8424 | };
|
8425 | s.onPopstate = function () {
|
8426 | if (window.location.href.indexOf(s.params.hash) === -1) {
|
8427 |
|
8428 | if (s.mask.classList.contains(s.params.maskActiveClass)) {
|
8429 | s.hideMask();
|
8430 | }
|
8431 | } else {
|
8432 |
|
8433 | s.showMask();
|
8434 | }
|
8435 | };
|
8436 | s.clickTimeout = null;
|
8437 | s.onClick = function () {
|
8438 | if (s.clickTimeout) {
|
8439 | window.clearTimeout(s.clickTimeout);
|
8440 | s.clickTimeout = null;
|
8441 | }
|
8442 | s.clickTimeout = window.setTimeout(function () {
|
8443 | if (s.params.onClick) s.params.onClick(s);else s.hide();
|
8444 | }, s.params.clickDelay);
|
8445 | };
|
8446 | s.onClickBack = function () {
|
8447 | if (s.params.onClickBack) s.params.onClickBack(s);else s.hide();
|
8448 | };
|
8449 |
|
8450 | s.init = function () {
|
8451 | s.attach();
|
8452 | };
|
8453 |
|
8454 | s.init();
|
8455 | };
|
8456 |
|
8457 | var Preview_instance = (instance_Preview);
|
8458 |
|
8459 |
|
8460 | var MediaUtil = {
|
8461 | |
8462 |
|
8463 |
|
8464 | audio: function audio(src) {
|
8465 | return new Audio(src);
|
8466 | },
|
8467 | video: function video(src) {
|
8468 | if (!src) return null;
|
8469 | var video = document.createElement('video');
|
8470 | video.controls = true;
|
8471 | var source = document.createElement('source');
|
8472 | source.type = this.sourceType(src);
|
8473 | source.src = src;
|
8474 | video.appendChild(source);
|
8475 | return video;
|
8476 | },
|
8477 | getFileURL: function getFileURL(file) {
|
8478 |
|
8479 | var url = null;
|
8480 | if (window.createObjcectURL !== undefined) {
|
8481 | url = window.createOjcectURL(file);
|
8482 | } else if (window.URL !== undefined) {
|
8483 | url = window.URL.createObjectURL(file);
|
8484 | } else if (window.webkitURL !== undefined) {
|
8485 | url = window.webkitURL.createObjectURL(file);
|
8486 | }
|
8487 | return url;
|
8488 | },
|
8489 | getFileSize: function getFileSize(file) {
|
8490 |
|
8491 | return file.size;
|
8492 | },
|
8493 | getFileType: function getFileType(file) {
|
8494 |
|
8495 | return file.type;
|
8496 | },
|
8497 | getFileBase64: function getFileBase64(file, callback) {
|
8498 |
|
8499 | var reader = new FileReader();
|
8500 | reader.onload = function (e) {
|
8501 | callback(e.target.result);
|
8502 | };
|
8503 | reader.readAsDataURL(file);
|
8504 | },
|
8505 | convertTime: function convertTime(sec) {
|
8506 |
|
8507 | if (sec < 0) sec = -sec;
|
8508 | var sec_num = parseInt(sec, 10);
|
8509 | var hours = Math.floor(sec_num / 3600);
|
8510 | var minutes = Math.floor((sec_num - hours * 3600) / 60);
|
8511 | var seconds = sec_num - hours * 3600 - minutes * 60;
|
8512 | if (hours < 10) {
|
8513 | hours = '0' + hours;
|
8514 | }
|
8515 | if (minutes < 10) {
|
8516 | minutes = '0' + minutes;
|
8517 | }
|
8518 | if (seconds < 10) {
|
8519 | seconds = '0' + seconds;
|
8520 | }
|
8521 | return minutes + ':' + seconds;
|
8522 | },
|
8523 | convertSize: function convertSize(bytes) {
|
8524 |
|
8525 | if (isNaN(bytes)) return 0;
|
8526 | if (bytes > 1024 * 1024) return (Math.round(bytes * 1000 / (1024 * 1024)) / 1000).toString() + 'MB';
|
8527 | return (Math.round(bytes * 1000 / 1024) / 1000).toString() + 'KB';
|
8528 | },
|
8529 | play: function play(target) {
|
8530 | target.play();
|
8531 | },
|
8532 | pause: function pause(target) {
|
8533 | target.pause();
|
8534 | },
|
8535 | resume: function resume(target) {
|
8536 | if (target.paused) {
|
8537 | target.play();
|
8538 | } else {
|
8539 | target.pause();
|
8540 | }
|
8541 | },
|
8542 | loop: function loop(target, _loop) {
|
8543 | target.loop = _loop || false;
|
8544 | },
|
8545 | autoplay: function autoplay(target, _autoplay) {
|
8546 | target.autoplay = _autoplay || false;
|
8547 | },
|
8548 | isReady: function isReady(target) {
|
8549 |
|
8550 | if (target.readyState !== 4) {
|
8551 | return false;
|
8552 | }
|
8553 | return true;
|
8554 | },
|
8555 | toggleFullScreen: function toggleFullScreen(target) {
|
8556 |
|
8557 | if (target.requestFullscreen) {
|
8558 | target.exitFullscreen();
|
8559 | } else {
|
8560 | target.requestFullscreen();
|
8561 | }
|
8562 | },
|
8563 | duration: function duration(target) {
|
8564 | if (!this.isReady(target)) return;
|
8565 | return target.duration;
|
8566 | },
|
8567 | currentTime: function currentTime(target, time) {
|
8568 | if (!this.isReady(target)) return;
|
8569 | if (!isNaN(time)) {
|
8570 | target.currentTime = time;
|
8571 | }
|
8572 | return time;
|
8573 | },
|
8574 | volume: function volume(target, _volume) {
|
8575 | if (!isNaN(_volume)) {
|
8576 | target.volume = _volume;
|
8577 | }
|
8578 | return target.volume;
|
8579 | },
|
8580 | volumeLvl: function volumeLvl(target) {
|
8581 | var volnumber = target.volume;
|
8582 | if (volnumber === 0) {
|
8583 | return 0;
|
8584 | } else if (volnumber > 0 && volnumber < 0.3) {
|
8585 | return 1;
|
8586 | } else if (volnumber > 0.3 && volnumber < 0.6) {
|
8587 | return 2;
|
8588 | } else if (volnumber > 0.6 && volnumber < 0.9) {
|
8589 | return 3;
|
8590 | } else {
|
8591 | return 4;
|
8592 | }
|
8593 | },
|
8594 | rate: function rate(target, _rate) {
|
8595 |
|
8596 | if (!isNaN(_rate)) {
|
8597 | target.defaultPlaybackRate = _rate;
|
8598 | }
|
8599 | return target.defaultPlaybackRate;
|
8600 | },
|
8601 | suffixTypes: function suffixTypes(suffix) {
|
8602 | var type = '';
|
8603 | var codeType = '';
|
8604 | switch (suffix) {
|
8605 |
|
8606 | case 'aac':
|
8607 | type = 'audio/mp4';
|
8608 | codeType = 'audio/mp4; codecs="mp4a.40.2"';
|
8609 | break;
|
8610 | case 'vorbis':
|
8611 |
|
8612 | type = 'audio/ogg';
|
8613 | codeType = 'audio/ogg; codecs="vorbis"';
|
8614 | break;
|
8615 | case 'wav':
|
8616 | type = 'audio/wav';
|
8617 | codeType = 'audio/wav; codecs="1"';
|
8618 | break;
|
8619 |
|
8620 | case 'h.264':
|
8621 |
|
8622 | type = 'video/mp4';
|
8623 | codeType = 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"';
|
8624 | break;
|
8625 | case 'mp4':
|
8626 | type = 'video/mp4';
|
8627 | codeType = 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"';
|
8628 | break;
|
8629 | case 'theora':
|
8630 |
|
8631 | type = 'video/ogg';
|
8632 | codeType = 'video/ogg; codecs="theora"';
|
8633 | break;
|
8634 | case 'ogg':
|
8635 | type = 'video/ogg';
|
8636 | codeType = 'video/ogg; codecs="theora"';
|
8637 | break;
|
8638 | case 'webm':
|
8639 |
|
8640 | type = 'video/webm';
|
8641 | codeType = 'video/webm; codecs="vp8, vorbis"';
|
8642 | break;
|
8643 | default:
|
8644 | type = '';
|
8645 | codeType = '';
|
8646 | }
|
8647 | return [type, codeType];
|
8648 | },
|
8649 | isSupport: function isSupport(suffix) {
|
8650 |
|
8651 | var types = this.suffixTypes(suffix);
|
8652 | var type = types[0];
|
8653 | var codeType = types[1];
|
8654 | var player = document.createElement('video');
|
8655 | if (type !== '' && codeType !== '' && (player.canPlayType(type) || player.canPlayType(codeType))) {
|
8656 | return true;
|
8657 | }
|
8658 | return false;
|
8659 | },
|
8660 | sourceType: function sourceType(src) {
|
8661 | if (!src) return src;
|
8662 | return this.suffixTypes(src.substring(src.lastIndexOf('.') + 1, src.length).toLowerCase())[0];
|
8663 | }
|
8664 | |
8665 |
|
8666 |
|
8667 |
|
8668 |
|
8669 |
|
8670 |
|
8671 |
|
8672 |
|
8673 |
|
8674 |
|
8675 |
|
8676 |
|
8677 |
|
8678 |
|
8679 |
|
8680 |
|
8681 |
|
8682 |
|
8683 |
|
8684 |
|
8685 |
|
8686 |
|
8687 |
|
8688 |
|
8689 |
|
8690 |
|
8691 | };
|
8692 |
|
8693 | var MediaUtil_MediaUtil = (MediaUtil);
|
8694 |
|
8695 |
|
8696 |
|
8697 | var src_MediaUtil = (MediaUtil_MediaUtil);
|
8698 |
|
8699 |
|
8700 | var FullScreen = {
|
8701 |
|
8702 | support: function support() {
|
8703 | var requestFullscreen = document.body.requestFullscreen || document.body.webkitRequestFullscreen || document.body.mozRequestFullScreen || document.body.msRequestFullscreen;
|
8704 | var fullscreenEnabled = document.fullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled;
|
8705 | return !!(requestFullscreen && fullscreenEnabled);
|
8706 | },
|
8707 |
|
8708 | getFullscreenElement: function getFullscreenElement() {
|
8709 | return document.fullscreenElement || document.webkitFullscreenElement || document.msFullscreenElement || document.mozFullScreenElement || null;
|
8710 | },
|
8711 |
|
8712 | isFull: function isFull(el) {
|
8713 | var target = el || document;
|
8714 | return !!(target.webkitIsFullScreen || this.getFullscreenElement());
|
8715 | },
|
8716 |
|
8717 | enter: function enter(el) {
|
8718 | var target = el || document.body;
|
8719 | var requestMethod = target.requestFullScreen || target.webkitRequestFullScreen || target.mozRequestFullScreen || target.msRequestFullScreen;
|
8720 | if (requestMethod) {
|
8721 | requestMethod.call(target);
|
8722 | } else if (typeof window.ActiveXObject !== 'undefined') {
|
8723 | var wscript = new window.ActiveXObject('WScript.Shell');
|
8724 | if (wscript !== null) {
|
8725 | wscript.SendKeys('{F11}');
|
8726 | }
|
8727 | }
|
8728 | },
|
8729 |
|
8730 | exit: function exit(el) {
|
8731 | var target = el || document;
|
8732 | if (document.exitFullscreen) {
|
8733 | target.exitFullscreen();
|
8734 | } else if (document.mozCancelFullScreen) {
|
8735 | target.mozCancelFullScreen();
|
8736 | } else if (document.webkitExitFullscreen) {
|
8737 | target.webkitExitFullscreen();
|
8738 | } else if (document.msExitFullscreen) {
|
8739 | target.msExitFullscreen();
|
8740 | }
|
8741 | return this;
|
8742 | },
|
8743 |
|
8744 | toggle: function toggle(el) {
|
8745 | if (this.isFull()) this.exit();else this.enter(el);
|
8746 | },
|
8747 |
|
8748 | addHandler: function addHandler(element, handler) {
|
8749 | var target = element || document;
|
8750 | target.addEventListener('webkitfullscreenchange', handler, false);
|
8751 | target.addEventListener('mozfullscreenchange', handler, false);
|
8752 | target.addEventListener('fullscreenchange', handler, false);
|
8753 | target.addEventListener('MSFullscreenChange', handler, false);
|
8754 | }
|
8755 | };
|
8756 |
|
8757 | var FullScreen_FullScreen = (FullScreen);
|
8758 |
|
8759 |
|
8760 |
|
8761 | var src_FullScreen = (FullScreen_FullScreen);
|
8762 |
|
8763 | var bridgeBrowser_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; };
|
8764 |
|
8765 |
|
8766 |
|
8767 |
|
8768 |
|
8769 |
|
8770 |
|
8771 |
|
8772 |
|
8773 |
|
8774 |
|
8775 | if (!window._seeds_lang) window._seeds_lang = {};
|
8776 |
|
8777 | var Bridge = {
|
8778 | |
8779 |
|
8780 |
|
8781 | debug: false,
|
8782 |
|
8783 | tel: function tel(number) {
|
8784 | if (src_Device.device === 'pc') {
|
8785 | this.showToast(window._seeds_lang['hint_only_mobile'] || '此功能仅可在手机中使用', { mask: false });
|
8786 | return;
|
8787 | }
|
8788 | if (isNaN(number)) return;
|
8789 | window.location.href = 'tel:' + number;
|
8790 | },
|
8791 |
|
8792 | toast: null,
|
8793 | showToast: function showToast(msg) {
|
8794 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
8795 |
|
8796 | if (!msg) return;
|
8797 | if (!this.toast) {
|
8798 |
|
8799 | this.toast = new Toast_instance({
|
8800 | parent: document.body,
|
8801 | maskClass: 'mask toast-mask' + (params.mask === false ? ' toast-propagation' : ''),
|
8802 | toastClass: 'toast ' + (params.position ? params.position : 'middle'),
|
8803 | icon: params.icon || '',
|
8804 | html: msg,
|
8805 | delay: params.delay || 2000
|
8806 | });
|
8807 | } else {
|
8808 | this.toast.setHTML(msg);
|
8809 | this.toast.setMaskClassName('mask toast-mask' + (params.mask === false ? ' toast-propagation' : ''));
|
8810 | this.toast.setToastClassName('toast ' + (params.position ? params.position : 'middle'));
|
8811 | this.toast.setIcon(params.icon || '');
|
8812 | this.toast.setDelay(params.delay || 2000);
|
8813 | }
|
8814 | this.toast.show();
|
8815 | if (params.success) {
|
8816 | setTimeout(function () {
|
8817 | params.success();
|
8818 | }, params.delay ? Math.round(params.delay / 2) : 1000);
|
8819 | }
|
8820 | },
|
8821 |
|
8822 | loading: null,
|
8823 | showLoading: function showLoading() {
|
8824 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
8825 |
|
8826 | if (!this.loading) {
|
8827 | this.loading = new Loading_instance({
|
8828 | caption: params.caption || window._seeds_lang['loading'] || '正在加载...',
|
8829 | type: params.type,
|
8830 | icon: params.icon || '',
|
8831 | maskCss: params.css || null
|
8832 | });
|
8833 | } else {
|
8834 | if (params.caption) this.loading.setCaption(params.caption);
|
8835 | if (params.type) this.loading.setType(params.type);
|
8836 | if (params.css) this.loading.setMaskCss(params.css);
|
8837 | if (params.icon) this.toast.setIcon(params.icon || '');
|
8838 | if (params.mask) this.loading.setMaskClassName('mask loading-mask ' + (params.mask === false ? ' loading-propagation' : ''));
|
8839 | }
|
8840 | this.loading.show();
|
8841 | },
|
8842 | hideLoading: function hideLoading() {
|
8843 | if (!this.loading) {
|
8844 | this.toast.showToast(window._seeds_lang['hint_hideloading_after_showloading'] || 'showLoading后才能hideLoading');
|
8845 | } else {
|
8846 | this.loading.hide();
|
8847 | }
|
8848 | },
|
8849 |
|
8850 | alert: null,
|
8851 | showAlert: function showAlert(msg) {
|
8852 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
8853 |
|
8854 | if (!this.alert) {
|
8855 | this.alert = new Alert_instance(bridgeBrowser_extends({}, params, {
|
8856 | html: msg,
|
8857 | onClickSubmit: function onClickSubmit(e) {
|
8858 | if (params.success) params.success(e);else e.hide();
|
8859 | }
|
8860 | }));
|
8861 | } else {
|
8862 | if (params) {
|
8863 | this.alert.reset();
|
8864 | for (var n in params) {
|
8865 | this.alert.params[n] = params[n];
|
8866 | }
|
8867 | this.alert.updateDOM();
|
8868 | this.alert.setHTML(msg);
|
8869 | }
|
8870 | }
|
8871 | this.alert.show();
|
8872 | },
|
8873 |
|
8874 | confirm: null,
|
8875 | showConfirm: function showConfirm(msg) {
|
8876 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
8877 |
|
8878 | if (!this.confirm) {
|
8879 | this.confirm = new Alert_instance(bridgeBrowser_extends({}, params, {
|
8880 | html: msg,
|
8881 | onClickSubmit: function onClickSubmit(e) {
|
8882 | if (params.success) params.success(e);
|
8883 | },
|
8884 | onClickCancel: function onClickCancel(e) {
|
8885 | if (params.fail) params.fail(e);else e.hide();
|
8886 | }
|
8887 | }));
|
8888 | } else {
|
8889 | if (params) {
|
8890 | this.confirm.reset();
|
8891 | for (var n in params) {
|
8892 | this.confirm.params[n] = params[n];
|
8893 | }
|
8894 | this.confirm.updateDOM();
|
8895 | if (params.success) this.confirm.setOnClickSubmit(params.success);
|
8896 | if (params.fail) this.confirm.setOnClickCancel(params.fail);
|
8897 | }
|
8898 | this.confirm.setHTML(msg);
|
8899 | }
|
8900 | this.confirm.show();
|
8901 | },
|
8902 | |
8903 |
|
8904 |
|
8905 |
|
8906 |
|
8907 | getAddress: function getAddress() {
|
8908 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
8909 |
|
8910 | var url = 'https://api.map.baidu.com/geocoder/v2/?callback=renderReverse&location=' + params.latitude + ',' + params.longitude + '&output=json&pois=1&ak=IlfRglMOvFxapn5eGrmAj65H&ret_coordtype=gcj02ll';
|
8911 | src_jsonp(url, null, function (err, data) {
|
8912 | if (err) {
|
8913 | if (params.fail) params.fail({ errMsg: 'getAddress:' + (window._seeds_lang['hint_address_failed'] || '获取地址失败, 请稍后重试') + err });
|
8914 | } else {
|
8915 | var addrs = {};
|
8916 | if (data.result && data.result.formatted_address) {
|
8917 | addrs.address = data.result.formatted_address;
|
8918 | if (params.success) params.success(addrs);
|
8919 | } else {
|
8920 | if (params.fail) params.fail({ errMsg: 'getAddress:' + (window._seeds_lang['hint_address_failed'] || '获取地址失败, 请稍后重试') });
|
8921 | }
|
8922 | }
|
8923 | });
|
8924 | },
|
8925 | |
8926 |
|
8927 |
|
8928 |
|
8929 |
|
8930 | getWeather: function getWeather() {
|
8931 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
8932 |
|
8933 | var url = 'http://api.map.baidu.com/telematics/v3/weather?location=' + (params.location || '南京市') + '&output=json&ak=IlfRglMOvFxapn5eGrmAj65H';
|
8934 | src_jsonp(url, null, function (err, data) {
|
8935 | if (err) {
|
8936 | if (params.fail) params.fail({ errMsg: 'getWeather:' + (window._seeds_lang['hint_weather_failed'] || '获取天气失败, 请稍后重试') + err });
|
8937 | } else {
|
8938 | if (data.results && data.results.length) {
|
8939 | if (params.success) params.success(data.results);
|
8940 | } else {
|
8941 | if (params.fail) params.fail({ errMsg: 'getWeather:' + (window._seeds_lang['hint_weather_failed'] || '获取天气失败, 请稍后重试') });
|
8942 | }
|
8943 | }
|
8944 | });
|
8945 | },
|
8946 |
|
8947 | back: function back(argHistory, argBackLvl) {
|
8948 |
|
8949 | var _history = window.history;
|
8950 | if (argHistory && argHistory.go) _history = argHistory;
|
8951 | var _backLvl = argBackLvl || -1;
|
8952 |
|
8953 |
|
8954 | var isFromApp = src_Device.getUrlParameter('isFromApp', location.search) || '';
|
8955 | if (isFromApp === '1') {
|
8956 |
|
8957 | try {
|
8958 | Bridge.closeWindow();
|
8959 | } catch (error) {
|
8960 | console.log(error);
|
8961 | }
|
8962 | } else if (isFromApp === 'home') {
|
8963 |
|
8964 | try {
|
8965 | Bridge.goHome();
|
8966 | } catch (error) {
|
8967 | console.log(error);
|
8968 | }
|
8969 | } else if (isFromApp === 'confirm') {
|
8970 |
|
8971 | Bridge.showConfirm(Bridge.confirmCaption || window._seeds_lang['confirm_quit_page'] || '您确定要离开此页面吗?', {
|
8972 | success: function success(e) {
|
8973 | e.hide();
|
8974 | _history.go(_backLvl);
|
8975 | }
|
8976 | });
|
8977 | } else if (isFromApp === 'confirm-close') {
|
8978 |
|
8979 | Bridge.showConfirm(Bridge.confirmCaption || window._seeds_lang['confirm_quit_page'] || '您确定要离开此页面吗?', {
|
8980 | success: function success(e) {
|
8981 | e.hide();
|
8982 | Bridge.closeWindow();
|
8983 | }
|
8984 | });
|
8985 | } else if (isFromApp === 'custom') {
|
8986 | console.log('自定义');
|
8987 | } else {
|
8988 |
|
8989 | _history.go(_backLvl);
|
8990 | }
|
8991 | },
|
8992 |
|
8993 | isHomePage: function isHomePage(callback, rule) {
|
8994 | if (rule && window.location.href.indexOf(rule) >= 0) {
|
8995 | callback(true);
|
8996 | return;
|
8997 | }
|
8998 | callback(false);
|
8999 | },
|
9000 |
|
9001 | getAppVersion: function getAppVersion() {
|
9002 | return window.navigator.appVersion;
|
9003 | },
|
9004 |
|
9005 | logOut: function logOut() {
|
9006 | console.log('logOut方法仅在app上工作');
|
9007 | },
|
9008 |
|
9009 | goHome: function goHome() {
|
9010 | window.history.go(-1);
|
9011 | },
|
9012 |
|
9013 | openWindow: function openWindow() {
|
9014 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9015 |
|
9016 | if (params.url) window.location.href = params.url;
|
9017 | },
|
9018 |
|
9019 | closeWindow: function closeWindow() {
|
9020 | window.history.go(-1);
|
9021 | },
|
9022 |
|
9023 | addBackPress: function addBackPress() {
|
9024 | console.log('addBackPress方法在浏览器上无法运行');
|
9025 | },
|
9026 |
|
9027 | removeBackPress: function removeBackPress() {
|
9028 | console.log('removeBackPress方法在浏览器上无法运行');
|
9029 | },
|
9030 | |
9031 |
|
9032 |
|
9033 |
|
9034 | |
9035 |
|
9036 |
|
9037 | platform: 'browser',
|
9038 |
|
9039 | config: function config() {
|
9040 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9041 |
|
9042 | if (params.debug) this.debug = params.debug;
|
9043 | if (!this.debug) {
|
9044 | console.log('config方法仅在微信上工作');
|
9045 | return;
|
9046 | }
|
9047 | src_DB.setSession('bridge_isready', '1');
|
9048 | if (params.success) params.success();
|
9049 | },
|
9050 |
|
9051 | previewVideo: function previewVideo() {
|
9052 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9053 |
|
9054 | var target = document.getElementById('seedsui_preview_video');
|
9055 | if (!target) {
|
9056 | target = src_MediaUtil.video(params.src);
|
9057 | target.id = 'seedsui_preview_video';
|
9058 | target.style = 'position:absolute;top:-1000px;left:-1000px;width:100;height:100px;';
|
9059 | document.body.appendChild(target);
|
9060 | }
|
9061 | if (target) {
|
9062 | src_FullScreen.enter(target);
|
9063 | setTimeout(function () {
|
9064 | target.play();
|
9065 | }, 500);
|
9066 | }
|
9067 | },
|
9068 | |
9069 |
|
9070 |
|
9071 |
|
9072 | chooseImage: function chooseImage() {
|
9073 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9074 |
|
9075 | if (!this.debug) {
|
9076 | this.showToast(window._seeds_lang['hint_only_app_and_wx'] || '此功能仅可在微信或APP中使用', { mask: false });
|
9077 | return;
|
9078 | }
|
9079 | var res = {
|
9080 | sourceType: 'camera',
|
9081 | errMsg: 'chooseImage:ok',
|
9082 | localIds: ['https://static.zcool.cn/git_z/z/common/images/svg/logo.svg', 'https://static.zcool.cn/v3.5.180706.5/zcool/client/image/logo.png']
|
9083 | };
|
9084 | if (params.success) params.success(res);
|
9085 | },
|
9086 |
|
9087 | uploadImage: function uploadImage() {
|
9088 | var _this = this;
|
9089 |
|
9090 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9091 |
|
9092 | if (!this.debug) {
|
9093 | this.showToast(window._seeds_lang['hint_only_app_and_wx'] || '此功能仅可在微信或APP中使用', { mask: false });
|
9094 | return;
|
9095 | }
|
9096 | this.showLoading();
|
9097 | setTimeout(function () {
|
9098 | _this.hideLoading();
|
9099 | _this.showToast(window._seeds_lang['uploaded_completed'] || '上传完成', { mask: false });
|
9100 | var res = {
|
9101 | errMsg: 'uploadImage:ok',
|
9102 | mediaUrl: '',
|
9103 | serverId: new Date().getTime()
|
9104 | };
|
9105 | if (params.success) params.success(res);
|
9106 |
|
9107 | }, 1000);
|
9108 | },
|
9109 |
|
9110 |
|
9111 | preview: null,
|
9112 | previewImage: function previewImage() {
|
9113 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9114 |
|
9115 | if (!params.urls || !params.urls.length) {
|
9116 | Bridge.showToast('urls' + (window._seeds_lang['wrong_parameter'] || '参数不正确') + ', ' + (window._seeds_lang['cannot_preview'] || '无法预览'), { mask: false });
|
9117 | return;
|
9118 | }
|
9119 | var src = params.urls[params.index || 0];
|
9120 | if (!src) {
|
9121 | Bridge.showToast('index' + (window._seeds_lang['wrong_parameter'] || '参数不正确') + ', ' + (window._seeds_lang['cannot_preview'] || '无法预览'), { mask: false });
|
9122 | return;
|
9123 | }
|
9124 | var layerHTML = params.layerHTML || '';
|
9125 | if (!this.preview) {
|
9126 | this.preview = new Preview_instance({
|
9127 | src: src,
|
9128 | layerHTML: layerHTML,
|
9129 | onSuccess: function onSuccess(s) {
|
9130 | s.show();
|
9131 | if (params.onSuccess) params.onSuccess(s);
|
9132 | },
|
9133 | onError: function onError() {
|
9134 | Bridge.showToast('' + (window._seeds_lang['invalid_image_src'] || '图片地址无效'), { mask: false });
|
9135 | }
|
9136 | });
|
9137 | } else {
|
9138 | this.preview.setSrc(src);
|
9139 | this.preview.setLayerHTML(layerHTML);
|
9140 | this.preview.update();
|
9141 | }
|
9142 | return this.preview;
|
9143 | },
|
9144 | |
9145 |
|
9146 |
|
9147 |
|
9148 | chooseVideo: function chooseVideo() {
|
9149 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9150 |
|
9151 | console.log('chooseVideo方法在浏览器上无法运行');
|
9152 | var res = {
|
9153 | sourceType: 'camera',
|
9154 | errMsg: 'chooseVideo:ok',
|
9155 | tempFilePath: 'http://res.waiqin365.com/video/v2001.MP4',
|
9156 | duration: '',
|
9157 | size: '',
|
9158 | height: '',
|
9159 | width: ''
|
9160 | };
|
9161 | if (params.success) params.success(res);
|
9162 | },
|
9163 | |
9164 |
|
9165 |
|
9166 | getContactMore: function getContactMore() {
|
9167 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9168 |
|
9169 | if (!this.debug) {
|
9170 | this.showToast(window._seeds_lang['hint_only_wqapp'] || '此功能仅可在外勤客户端中使用', { mask: false });
|
9171 | return;
|
9172 | }
|
9173 | if (params.success) params.success([{
|
9174 | id: '4655721687632479006',
|
9175 | name: '员工1'
|
9176 | }, {
|
9177 | id: '4655721687632479007',
|
9178 | name: '员工2'
|
9179 | }]);
|
9180 | },
|
9181 | getContact: function getContact() {
|
9182 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9183 |
|
9184 | if (!this.debug) {
|
9185 | this.showToast(window._seeds_lang['hint_only_wqapp'] || '此功能仅可在外勤客户端中使用', { mask: false });
|
9186 | return;
|
9187 | }
|
9188 | if (params.success) params.success({
|
9189 | id: '4655721687632479006',
|
9190 | name: '员工1'
|
9191 | });
|
9192 | },
|
9193 | |
9194 |
|
9195 |
|
9196 | customerMore: [{
|
9197 | "check": true,
|
9198 | "distance": 31,
|
9199 | "labelType": 0,
|
9200 | "addr": "南京市建邺区康文路康缘智汇港附近",
|
9201 | "approval_status": "3",
|
9202 | "code": "20180403004",
|
9203 | "cooperate_status": "1",
|
9204 | "district_id": "",
|
9205 | "id": "5330457627710680963",
|
9206 | "lat": "",
|
9207 | "location": "31.983362,118.73069",
|
9208 | "lon": "",
|
9209 | "manager_name": "",
|
9210 | "name": "客户门店经销商1",
|
9211 | "name_py": "20180403004 20180403004",
|
9212 | "trade_type": "3",
|
9213 | "type_id": "",
|
9214 | "type_image": ""
|
9215 | }, {
|
9216 | "check": true,
|
9217 | "distance": 5,
|
9218 | "labelType": 0,
|
9219 | "addr": "江苏省南京市建邺区康文路康缘智汇港附近",
|
9220 | "approval_status": "3",
|
9221 | "code": "storethree",
|
9222 | "cooperate_status": "1",
|
9223 | "district_id": "",
|
9224 | "id": "8834765014408029232",
|
9225 | "lat": "",
|
9226 | "location": "31.983679,118.730766",
|
9227 | "lon": "",
|
9228 | "manager_name": "",
|
9229 | "name": "客户门店经销商2",
|
9230 | "name_py": "mendian3 md3",
|
9231 | "trade_type": "3",
|
9232 | "type_id": "",
|
9233 | "type_image": ""
|
9234 | }, {
|
9235 | "addr": "南京市建邺区康文路南京金贝网络科技有限公司附近",
|
9236 | "approval_status": "3",
|
9237 | "check": false,
|
9238 | "code": "CUS000084",
|
9239 | "cooperate_status": "1",
|
9240 | "distance": -1,
|
9241 | "district_id": "-1",
|
9242 | "id": "8045732772848971055",
|
9243 | "labelType": 2,
|
9244 | "lat": "31.983311",
|
9245 | "location": "31.983311,118.730527",
|
9246 | "lon": "118.730527",
|
9247 | "manager_name": "大表哥",
|
9248 | "name": "客户门店经销商3",
|
9249 | "name_py": "201801171557 201801171557",
|
9250 | "trade_type": "3",
|
9251 | "type_id": "-1",
|
9252 | "type_image": ""
|
9253 | }, {
|
9254 | "addr": "南京市建邺区康文路南京金贝网络科技有限公司附近",
|
9255 | "approval_status": "3",
|
9256 | "check": true,
|
9257 | "code": "CUS000085",
|
9258 | "cooperate_status": "1",
|
9259 | "distance": 46,
|
9260 | "district_id": "",
|
9261 | "id": "8353170616312361122",
|
9262 | "labelType": 0,
|
9263 | "lat": "",
|
9264 | "location": "31.983301,118.730517",
|
9265 | "lon": "",
|
9266 | "manager_name": "",
|
9267 | "name": "客户门店经销商4",
|
9268 | "name_py": "201801171624 201801171624",
|
9269 | "trade_type": "3",
|
9270 | "type_id": "",
|
9271 | "type_image": ""
|
9272 | }],
|
9273 | customerMoreLen: 1,
|
9274 | getCustomerMore: function getCustomerMore() {
|
9275 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9276 |
|
9277 | if (!this.debug) {
|
9278 | this.showToast(window._seeds_lang['hint_only_wqapp'] || '此功能仅可在外勤客户端中使用', { mask: false });
|
9279 | return;
|
9280 | }
|
9281 | var result = [];
|
9282 | for (var i = 0; i < this.customerMoreLen; i++) {
|
9283 | result.push(this.customerMore[i]);
|
9284 | }
|
9285 | this.customerMoreLen++;
|
9286 | if (this.customerMoreLen > this.customerMore.length) {
|
9287 | this.customerMoreLen = 1;
|
9288 | }
|
9289 | if (params.success) params.success(result);
|
9290 | },
|
9291 | getCustomer: function getCustomer() {
|
9292 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9293 |
|
9294 | if (!this.debug) {
|
9295 | this.showToast(window._seeds_lang['hint_only_wqapp'] || '此功能仅可在外勤客户端中使用', { mask: false });
|
9296 | return;
|
9297 | }
|
9298 | if (params.success) params.success({
|
9299 | id: '6468207804099075062',
|
9300 | name: '客户门店经销商1'
|
9301 | });
|
9302 | },
|
9303 | getCustomerType: function getCustomerType() {
|
9304 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9305 |
|
9306 | if (!this.debug) {
|
9307 | this.showToast(window._seeds_lang['hint_only_wqapp'] || '此功能仅可在外勤客户端中使用', { mask: false });
|
9308 | return;
|
9309 | }
|
9310 | if (params.success) params.success({
|
9311 | id: '5365268129453435373',
|
9312 | name: '客户类型1'
|
9313 | });
|
9314 | },
|
9315 | getCustomerAreaMore: function getCustomerAreaMore() {
|
9316 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9317 |
|
9318 | if (!this.debug) {
|
9319 | this.showToast(window._seeds_lang['hint_only_wqapp'] || '此功能仅可在外勤客户端中使用', { mask: false });
|
9320 | return;
|
9321 | }
|
9322 | if (params.success) params.success([{
|
9323 | id: '5365268129453435373',
|
9324 | name: '客户区域1'
|
9325 | }, {
|
9326 | id: '5365268129453435374',
|
9327 | name: '客户区域2'
|
9328 | }]);
|
9329 | },
|
9330 | getCustomerArea: function getCustomerArea() {
|
9331 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9332 |
|
9333 | if (!this.debug) {
|
9334 | this.showToast(window._seeds_lang['hint_only_wqapp'] || '此功能仅可在外勤客户端中使用', { mask: false });
|
9335 | return;
|
9336 | }
|
9337 | if (params.success) params.success({
|
9338 | id: '5365268129453435373',
|
9339 | name: '客户区域1'
|
9340 | });
|
9341 | },
|
9342 |
|
9343 | getDepartmentMore: function getDepartmentMore(params) {
|
9344 | this.showToast(window._seeds_lang['hint_only_wqapp'] || '此功能仅可在外勤客户端中使用', { mask: false });
|
9345 | },
|
9346 | getDepartment: function getDepartment() {
|
9347 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9348 |
|
9349 | if (!this.debug) {
|
9350 | this.showToast(window._seeds_lang['hint_only_wqapp'] || '此功能仅可在外勤客户端中使用', { mask: false });
|
9351 | return;
|
9352 | }
|
9353 | params.success({
|
9354 | id: '5343180131602024954',
|
9355 | name: '开发一部'
|
9356 | });
|
9357 | },
|
9358 |
|
9359 | getGoods: function getGoods() {
|
9360 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9361 |
|
9362 | if (!this.debug) {
|
9363 | this.showToast(window._seeds_lang['hint_only_wqapp'] || '此功能仅可在外勤客户端中使用', { mask: false });
|
9364 | return;
|
9365 | }
|
9366 | if (params.success) params.success({
|
9367 | id: '5343180131602024954',
|
9368 | name: '商品1',
|
9369 | propvalues: '',
|
9370 | nameSpec: '',
|
9371 | productRemarks: '',
|
9372 | props: '',
|
9373 | propDetail: '',
|
9374 | reportUnitName: '',
|
9375 | reportUnitID: '',
|
9376 | reportUnitRatio: ''
|
9377 | });
|
9378 | },
|
9379 |
|
9380 | |
9381 |
|
9382 |
|
9383 |
|
9384 |
|
9385 |
|
9386 |
|
9387 |
|
9388 |
|
9389 |
|
9390 | getLocation: function getLocation() {
|
9391 | var _this2 = this;
|
9392 |
|
9393 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9394 |
|
9395 | if (!this.debug) {
|
9396 | this.showToast(window._seeds_lang['hint_only_app_and_wx'] || '此功能仅可在微信或APP中使用', { mask: false });
|
9397 | setTimeout(function () {
|
9398 | if (params.fail) params.fail({ errMsg: 'getLocation:' + (window._seeds_lang['hint_only_app_and_wx'] || '此功能仅可在微信或APP中使用') });
|
9399 | }, 1000);
|
9400 | return;
|
9401 | }
|
9402 |
|
9403 | var appLocation = src_DB.getCookie('app_location');
|
9404 | if (appLocation === 'undefined') {
|
9405 | src_DB.removeCookie('app_location');
|
9406 | appLocation = '';
|
9407 | }
|
9408 | try {
|
9409 | if (appLocation) appLocation = JSON.parse(appLocation);
|
9410 | } catch (error) {
|
9411 | appLocation = '';
|
9412 | }
|
9413 | if (appLocation) {
|
9414 | if (params.success) params.success(appLocation);
|
9415 | return;
|
9416 | }
|
9417 |
|
9418 | if (this.locating) return;
|
9419 | this.locating = true;
|
9420 | console.log('调用定位...');
|
9421 | setTimeout(function () {
|
9422 | _this2.locating = false;
|
9423 | var res = { longitude: '118.730515', latitude: '31.982473', speed: '0.0', accuracy: '3.0.0'
|
9424 |
|
9425 | };if (params.cache) src_DB.setCookie('app_location', JSON.stringify(res), params.cache || 60);
|
9426 | if (params.success) params.success(res);
|
9427 | }, 2000);
|
9428 | },
|
9429 |
|
9430 | getLocationMap: function getLocationMap() {
|
9431 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9432 |
|
9433 | if (!this.debug) {
|
9434 | this.showToast(window._seeds_lang['hint_only_wqapp'] || '此功能仅可在微信或APP中使用', { mask: false });
|
9435 | if (params.fail) params.fail({ errMsg: 'getLocationMap:' + (window._seeds_lang['hint_only_wqapp'] || '此功能仅可在微信或APP中使用') });
|
9436 | return;
|
9437 | }
|
9438 | setTimeout(function () {
|
9439 | if (params.success) params.success({ longitude: '118.730515', latitude: '31.982473', speed: '0.0', accuracy: '3.0.0', address: '江苏省南京市新城科技园' });
|
9440 | }, 500);
|
9441 | },
|
9442 |
|
9443 | |
9444 |
|
9445 |
|
9446 |
|
9447 | scanQRCode: function scanQRCode() {
|
9448 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9449 |
|
9450 | if (!this.debug) {
|
9451 | this.showToast(window._seeds_lang['hint_only_app_and_wx'] || '此功能仅可在微信或APP中使用', { mask: false });
|
9452 | if (params.fail) params.fail({ errMsg: 'scanQRCode:' + (window._seeds_lang['hint_scan_failed'] || '扫码失败') + ', ' + (window._seeds_lang['hint_try_again_later'] || '请稍后重试') });
|
9453 | return;
|
9454 | }
|
9455 | setTimeout(function () {
|
9456 | if (params.success) params.success({ resultStr: '504823170310092750280333' });
|
9457 | }, 500);
|
9458 | },
|
9459 | |
9460 |
|
9461 |
|
9462 |
|
9463 |
|
9464 |
|
9465 |
|
9466 |
|
9467 | Image: function Image() {
|
9468 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9469 |
|
9470 | var s = this;
|
9471 | var msg = '';
|
9472 |
|
9473 | s.choose = function () {
|
9474 | var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9475 |
|
9476 | if (!Bridge.debug) {
|
9477 | if (params.onChooseFail) params.onChooseFail({ errMsg: 'chooseImage:' + (window._seeds_lang['hint_only_app_and_wx'] || '此功能仅可在微信或APP中使用') });else Bridge.showToast(window._seeds_lang['hint_only_app_and_wx'] || '此功能仅可在微信或APP中使用', { mask: false });
|
9478 | return;
|
9479 | }
|
9480 | var option = {
|
9481 | enableSafe: args.enableSafe || false,
|
9482 | max: args.max || 5,
|
9483 | currentCount: args.currentCount || 0,
|
9484 | sourceType: args.sourceType || ['album', 'camera'],
|
9485 | sizeType: args.sizeType || ['original', 'compressed'],
|
9486 | chooseOptions: args.chooseOptions || {},
|
9487 | localIds: args.localIds || []
|
9488 | };
|
9489 | var count = option.max - option.currentCount;
|
9490 | if (count <= 0) {
|
9491 | msg = (window._seeds_lang['hint_max_upload'] || '最多只能传') + option.max + (window._seeds_lang['photos'] || '张照片');
|
9492 | Bridge.showToast(msg);
|
9493 | return;
|
9494 | }
|
9495 |
|
9496 | if (option.enableSafe) count = 1;
|
9497 | Bridge.chooseImage(Object.assign({
|
9498 | count: count,
|
9499 | sizeType: option.sizeType,
|
9500 | sourceType: option.sourceType,
|
9501 | success: function success(res) {
|
9502 | var imgMap = {};
|
9503 | for (var i = 0, localId; localId = res.localIds[i++];) {
|
9504 |
|
9505 | if (option.localIds.indexOf(localId) === -1) {
|
9506 | imgMap[localId] = {
|
9507 | serverId: '',
|
9508 | sourceType: res.sourceType
|
9509 | };
|
9510 | }
|
9511 | }
|
9512 | if (params.onChooseSuccess) params.onChooseSuccess(imgMap, res);
|
9513 | s.upload(imgMap);
|
9514 | },
|
9515 | fail: function fail(res) {
|
9516 | Bridge.showToast(window._seeds_lang['hint_choose_image_failed'] || '选择图片失败, 请稍后再试', { mask: false });
|
9517 | },
|
9518 | cancel: function cancel() {},
|
9519 | complete: function complete() {}
|
9520 | }, option.chooseOptions));
|
9521 | };
|
9522 |
|
9523 | s.upload = function (imgMap) {
|
9524 | var imgs = Object.keys(imgMap);
|
9525 | var loop = function loop(index) {
|
9526 | if (index >= imgs.length) {
|
9527 | return;
|
9528 | }
|
9529 | var img = imgs[index];
|
9530 | if (imgMap[img].serverId) {
|
9531 | loop(++index);
|
9532 | return;
|
9533 | }
|
9534 | Bridge.uploadImage({
|
9535 | localId: img,
|
9536 | isShowProgressTips: 1,
|
9537 | success: function success(res) {
|
9538 | var serverId = res.serverId;
|
9539 | imgMap[img].serverId = serverId;
|
9540 | if (params.onUploadSuccess) params.onUploadSuccess(imgMap, res);
|
9541 | if (index >= imgs.length - 1 && params.onUploadsSuccess) params.onUploadsSuccess(imgMap);
|
9542 | loop(++index);
|
9543 | },
|
9544 | fail: function fail() {
|
9545 | var deleteItem = imgMap[img];
|
9546 | if (params.onUploadFail) params.onUploadFail(imgMap, { id: img, index: index, item: deleteItem, errMsg: 'uploadImage:' + msg });
|
9547 | if (index >= imgs.length - 1 && params.onUploadsSuccess) params.onUploadsSuccess(imgMap);
|
9548 | loop(++index);
|
9549 | }
|
9550 | });
|
9551 | };
|
9552 | loop(0);
|
9553 | };
|
9554 | }
|
9555 | };
|
9556 | var bridgeBrowser = (Bridge);
|
9557 |
|
9558 | var bridgeWeixin_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; };
|
9559 |
|
9560 |
|
9561 |
|
9562 |
|
9563 |
|
9564 |
|
9565 |
|
9566 |
|
9567 | if (!window._seeds_lang) window._seeds_lang = {};
|
9568 |
|
9569 | var bridgeWeixin_Bridge = {
|
9570 | |
9571 |
|
9572 |
|
9573 | debug: false,
|
9574 |
|
9575 | tel: function tel(number) {
|
9576 | if (src_Device.device === 'pc') {
|
9577 | this.showToast(window._seeds_lang['hint_only_mobile'] || '此功能仅可在手机中使用');
|
9578 | return;
|
9579 | }
|
9580 | if (isNaN(number)) return;
|
9581 | window.location.href = 'tel:' + number;
|
9582 | },
|
9583 |
|
9584 | toast: null,
|
9585 | showToast: function showToast(msg) {
|
9586 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
9587 |
|
9588 | if (!msg) return;
|
9589 | if (!this.toast) {
|
9590 |
|
9591 | this.toast = new Toast_instance({
|
9592 | parent: document.body,
|
9593 | maskClass: 'mask toast-mask' + (params.mask === false ? ' toast-propagation' : ''),
|
9594 | toastClass: 'toast ' + (params.position ? params.position : 'middle'),
|
9595 | icon: params.icon || '',
|
9596 | html: msg,
|
9597 | delay: params.delay || 2000
|
9598 | });
|
9599 | } else {
|
9600 | this.toast.setHTML(msg);
|
9601 | this.toast.setMaskClassName('mask toast-mask' + (params.mask === false ? ' toast-propagation' : ''));
|
9602 | this.toast.setToastClassName('toast ' + (params.position ? params.position : 'middle'));
|
9603 | this.toast.setIcon(params.icon || '');
|
9604 | this.toast.setDelay(params.delay || 2000);
|
9605 | }
|
9606 | this.toast.show();
|
9607 | if (params.success) {
|
9608 | setTimeout(function () {
|
9609 | params.success();
|
9610 | }, params.delay ? Math.round(params.delay / 2) : 1000);
|
9611 | }
|
9612 | },
|
9613 |
|
9614 | loading: null,
|
9615 | showLoading: function showLoading() {
|
9616 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9617 |
|
9618 | if (!this.loading) {
|
9619 | this.loading = new Loading_instance({
|
9620 | caption: params.caption || window._seeds_lang['loading'] || '正在加载...',
|
9621 | type: params.type,
|
9622 | icon: params.icon || '',
|
9623 | maskCss: params.css || null
|
9624 | });
|
9625 | } else {
|
9626 | if (params.caption) this.loading.setCaption(params.caption);
|
9627 | if (params.type) this.loading.setType(params.type);
|
9628 | if (params.css) this.loading.setMaskCss(params.css);
|
9629 | if (params.icon) this.toast.setIcon(params.icon || '');
|
9630 | if (params.mask) this.loading.setMaskClassName('mask loading-mask ' + (params.mask === false ? ' loading-propagation' : ''));
|
9631 | }
|
9632 | this.loading.show();
|
9633 | },
|
9634 | hideLoading: function hideLoading() {
|
9635 | if (!this.loading) {
|
9636 | this.toast.showToast(window._seeds_lang['hint_hideloading_after_showloading'] || 'showLoading后才能hideLoading');
|
9637 | } else {
|
9638 | this.loading.hide();
|
9639 | }
|
9640 | },
|
9641 |
|
9642 | alert: null,
|
9643 | showAlert: function showAlert(msg) {
|
9644 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
9645 |
|
9646 | if (!this.alert) {
|
9647 | this.alert = new Alert_instance(bridgeWeixin_extends({}, params, {
|
9648 | html: msg,
|
9649 | onClickSubmit: function onClickSubmit(e) {
|
9650 | if (params.success) params.success(e);else e.hide();
|
9651 | }
|
9652 | }));
|
9653 | } else {
|
9654 | if (params) {
|
9655 | this.alert.reset();
|
9656 | for (var n in params) {
|
9657 | this.alert.params[n] = params[n];
|
9658 | }
|
9659 | this.alert.updateDOM();
|
9660 | this.alert.setHTML(msg);
|
9661 | }
|
9662 | }
|
9663 | this.alert.show();
|
9664 | },
|
9665 |
|
9666 | confirm: null,
|
9667 | showConfirm: function showConfirm(msg) {
|
9668 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
9669 |
|
9670 | if (!this.confirm) {
|
9671 | this.confirm = new Alert_instance(bridgeWeixin_extends({}, params, {
|
9672 | html: msg,
|
9673 | onClickSubmit: function onClickSubmit(e) {
|
9674 | if (params.success) params.success(e);
|
9675 | },
|
9676 | onClickCancel: function onClickCancel(e) {
|
9677 | if (params.fail) params.fail(e);else e.hide();
|
9678 | }
|
9679 | }));
|
9680 | } else {
|
9681 | if (params) {
|
9682 | this.confirm.reset();
|
9683 | for (var n in params) {
|
9684 | this.confirm.params[n] = params[n];
|
9685 | }
|
9686 | this.confirm.updateDOM();
|
9687 | if (params.success) this.confirm.setOnClickSubmit(params.success);
|
9688 | if (params.fail) this.confirm.setOnClickCancel(params.fail);
|
9689 | }
|
9690 | this.confirm.setHTML(msg);
|
9691 | }
|
9692 | this.confirm.show();
|
9693 | },
|
9694 | |
9695 |
|
9696 |
|
9697 |
|
9698 |
|
9699 | getAddress: function getAddress() {
|
9700 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9701 |
|
9702 | var url = 'https://api.map.baidu.com/geocoder/v2/?callback=renderReverse&location=' + params.latitude + ',' + params.longitude + '&output=json&pois=1&ak=IlfRglMOvFxapn5eGrmAj65H&ret_coordtype=gcj02ll';
|
9703 | src_jsonp(url, null, function (err, data) {
|
9704 | if (err) {
|
9705 | if (params.fail) params.fail({ errMsg: 'getAddress:' + (window._seeds_lang['hint_address_failed'] || '获取地址失败, 请稍后重试') + err });
|
9706 | } else {
|
9707 | var addrs = {};
|
9708 | if (data.result && data.result.formatted_address) {
|
9709 | addrs.address = data.result.formatted_address;
|
9710 | if (params.success) params.success(addrs);
|
9711 | } else {
|
9712 | if (params.fail) params.fail({ errMsg: 'getAddress:' + (window._seeds_lang['hint_address_failed'] || '获取地址失败, 请稍后重试') });
|
9713 | }
|
9714 | }
|
9715 | });
|
9716 | },
|
9717 | |
9718 |
|
9719 |
|
9720 |
|
9721 |
|
9722 | getWeather: function getWeather() {
|
9723 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9724 |
|
9725 | var url = 'http://api.map.baidu.com/telematics/v3/weather?location=' + (params.location || '南京市') + '&output=json&ak=IlfRglMOvFxapn5eGrmAj65H';
|
9726 | src_jsonp(url, null, function (err, data) {
|
9727 | if (err) {
|
9728 | if (params.fail) params.fail({ errMsg: 'getWeather:' + (window._seeds_lang['hint_weather_failed'] || '获取天气失败, 请稍后重试') + err });
|
9729 | } else {
|
9730 | if (data.results && data.results.length) {
|
9731 | if (params.success) params.success(data.results);
|
9732 | } else {
|
9733 | if (params.fail) params.fail({ errMsg: 'getWeather:' + (window._seeds_lang['hint_weather_failed'] || '获取天气失败, 请稍后重试') });
|
9734 | }
|
9735 | }
|
9736 | });
|
9737 | },
|
9738 |
|
9739 | back: function back(argHistory, argBackLvl) {
|
9740 |
|
9741 | var _history = window.history;
|
9742 | if (argHistory && argHistory.go) _history = argHistory;
|
9743 | var _backLvl = argBackLvl || -1;
|
9744 |
|
9745 |
|
9746 | var isFromApp = src_Device.getUrlParameter('isFromApp', location.search) || '';
|
9747 | if (isFromApp === '1') {
|
9748 |
|
9749 | try {
|
9750 | bridgeWeixin_Bridge.closeWindow();
|
9751 | } catch (error) {
|
9752 | console.log(error);
|
9753 | }
|
9754 | } else if (isFromApp === 'home') {
|
9755 |
|
9756 | try {
|
9757 | bridgeWeixin_Bridge.goHome();
|
9758 | } catch (error) {
|
9759 | console.log(error);
|
9760 | }
|
9761 | } else if (isFromApp === 'confirm') {
|
9762 |
|
9763 | bridgeWeixin_Bridge.showConfirm(bridgeWeixin_Bridge.confirmCaption || window._seeds_lang['confirm_quit_page'] || '您确定要离开此页面吗?', {
|
9764 | success: function success(e) {
|
9765 | e.hide();
|
9766 | _history.go(_backLvl);
|
9767 | }
|
9768 | });
|
9769 | } else if (isFromApp === 'confirm-close') {
|
9770 |
|
9771 | bridgeWeixin_Bridge.showConfirm(bridgeWeixin_Bridge.confirmCaption || window._seeds_lang['confirm_quit_page'] || '您确定要离开此页面吗?', {
|
9772 | success: function success(e) {
|
9773 | e.hide();
|
9774 | bridgeWeixin_Bridge.closeWindow();
|
9775 | }
|
9776 | });
|
9777 | } else if (isFromApp === 'custom') {
|
9778 | console.log('自定义');
|
9779 | } else {
|
9780 |
|
9781 | _history.go(_backLvl);
|
9782 | }
|
9783 | },
|
9784 |
|
9785 | isHomePage: function isHomePage(callback, rule) {
|
9786 | if (rule && window.location.href.indexOf(rule) >= 0) {
|
9787 | callback(true);
|
9788 | return;
|
9789 | }
|
9790 | callback(false);
|
9791 | },
|
9792 |
|
9793 | getAppVersion: function getAppVersion() {
|
9794 | return window.navigator.appVersion;
|
9795 | },
|
9796 |
|
9797 | goHome: function goHome() {
|
9798 | window.history.go(-1);
|
9799 | },
|
9800 |
|
9801 | logOut: function logOut() {
|
9802 | console.log('logOut方法仅在app上工作');
|
9803 | },
|
9804 |
|
9805 | openWindow: function openWindow() {
|
9806 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9807 |
|
9808 | if (params.url) window.location.href = params.url;
|
9809 | },
|
9810 |
|
9811 | closeWindow: function closeWindow() {
|
9812 | wx.closeWindow();
|
9813 | },
|
9814 |
|
9815 | addBackPress: function addBackPress(callback) {
|
9816 | if (wx.onHistoryBack) {
|
9817 |
|
9818 | wx.onHistoryBack(function () {
|
9819 |
|
9820 | if (callback) {
|
9821 | callback();
|
9822 | } else {
|
9823 | bridgeWeixin_Bridge.back();
|
9824 | }
|
9825 | return false;
|
9826 | });
|
9827 | }
|
9828 | },
|
9829 |
|
9830 | removeBackPress: function removeBackPress() {
|
9831 | if (wx.onHistoryBack) {
|
9832 |
|
9833 | wx.onHistoryBack(function () {
|
9834 |
|
9835 | return true;
|
9836 | });
|
9837 | }
|
9838 | },
|
9839 | |
9840 |
|
9841 |
|
9842 |
|
9843 | |
9844 |
|
9845 |
|
9846 | platform: src_Device.platform,
|
9847 | |
9848 |
|
9849 |
|
9850 |
|
9851 |
|
9852 |
|
9853 |
|
9854 |
|
9855 |
|
9856 | getLocation: function getLocation() {
|
9857 | var _this = this;
|
9858 |
|
9859 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9860 |
|
9861 |
|
9862 | var appLocation = src_DB.getCookie('app_location');
|
9863 | if (appLocation === 'undefined') {
|
9864 | src_DB.removeCookie('app_location');
|
9865 | appLocation = '';
|
9866 | }
|
9867 | try {
|
9868 | if (appLocation) appLocation = JSON.parse(appLocation);
|
9869 | } catch (error) {
|
9870 | appLocation = '';
|
9871 | }
|
9872 | if (appLocation) {
|
9873 | if (params.success) params.success(appLocation);
|
9874 | return;
|
9875 | }
|
9876 |
|
9877 | if (this.locating) return;
|
9878 | this.locating = true;
|
9879 | console.log('调用定位...');
|
9880 | wx.getLocation({
|
9881 |
|
9882 | type: 'gcj02',
|
9883 | success: function success(res) {
|
9884 | _this.locating = false;
|
9885 |
|
9886 | if (res.latitude && res.latitude) {
|
9887 | if (params.cache) src_DB.setCookie('app_location', JSON.stringify(res), params.cache || 60);
|
9888 | if (params.success) params.success(res);
|
9889 | } else {
|
9890 | if (params.fail) params.fail(res);else bridgeWeixin_Bridge.showToast('没有获取到经纬度', { mask: false });
|
9891 | }
|
9892 | },
|
9893 | fail: function fail(res) {
|
9894 | _this.locating = false;
|
9895 | if (params.fail) params.fail(res);else bridgeWeixin_Bridge.showToast('定位失败,请检查微信定位权限是否开启', { mask: false });
|
9896 | },
|
9897 | complete: function complete(res) {
|
9898 | _this.locating = false;
|
9899 | if (params.complete) params.complete(res);
|
9900 | }
|
9901 | });
|
9902 | },
|
9903 | |
9904 |
|
9905 |
|
9906 |
|
9907 | scanQRCode: function scanQRCode() {
|
9908 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9909 |
|
9910 | wx.scanQRCode({
|
9911 | needResult: params.needResult || 1,
|
9912 | scanType: params.scanType || ['qrCode', 'barCode'],
|
9913 | desc: params.desc || '二维码/条码',
|
9914 | success: function success(res) {
|
9915 | if (!params.success) return;
|
9916 | var wxRes = res;
|
9917 |
|
9918 | if (!params.prefix) {
|
9919 | if (res.resultStr.indexOf('QR,') >= 0) {
|
9920 | wxRes.resultStr = res.resultStr.substring('QR,'.length);
|
9921 | } else if (res.resultStr.indexOf('EAN_13,') >= 0) {
|
9922 | wxRes.resultStr = res.resultStr.substring('EAN_13,'.length);
|
9923 | } else if (res.resultStr.indexOf('EAN_8,') >= 0) {
|
9924 | wxRes.resultStr = res.resultStr.substring('EAN_8,'.length);
|
9925 | } else if (res.resultStr.indexOf('AZTEC,') >= 0) {
|
9926 | wxRes.resultStr = res.resultStr.substring('AZTEC,'.length);
|
9927 | } else if (res.resultStr.indexOf('DATAMATRIX,') >= 0) {
|
9928 | wxRes.resultStr = res.resultStr.substring('DATAMATRIX,'.length);
|
9929 | } else if (res.resultStr.indexOf('UPCA,') >= 0) {
|
9930 | wxRes.resultStr = res.resultStr.substring('UPCA,'.length);
|
9931 | } else if (res.resultStr.indexOf('UPCE,') >= 0) {
|
9932 | wxRes.resultStr = res.resultStr.substring('UPCE,'.length);
|
9933 | } else if (res.resultStr.indexOf('CODABAR,') >= 0) {
|
9934 | wxRes.resultStr = res.resultStr.substring('CODABAR,'.length);
|
9935 | } else if (res.resultStr.indexOf('CODE_39,') >= 0) {
|
9936 | wxRes.resultStr = res.resultStr.substring('CODE_39,'.length);
|
9937 | } else if (res.resultStr.indexOf('CODE_93,') >= 0) {
|
9938 | wxRes.resultStr = res.resultStr.substring('CODE_93,'.length);
|
9939 | } else if (res.resultStr.indexOf('CODE_128,') >= 0) {
|
9940 | wxRes.resultStr = res.resultStr.substring('CODE_128,'.length);
|
9941 | } else if (res.resultStr.indexOf('ITF,') >= 0) {
|
9942 | wxRes.resultStr = res.resultStr.substring('ITF,'.length);
|
9943 | } else if (res.resultStr.indexOf('MAXICODE,') >= 0) {
|
9944 | wxRes.resultStr = res.resultStr.substring('MAXICODE,'.length);
|
9945 | } else if (res.resultStr.indexOf('PDF_417,') >= 0) {
|
9946 | wxRes.resultStr = res.resultStr.substring('PDF_417,'.length);
|
9947 | } else if (res.resultStr.indexOf('RSS_14,') >= 0) {
|
9948 | wxRes.resultStr = res.resultStr.substring('RSS_14,'.length);
|
9949 | } else if (res.resultStr.indexOf('RSSEXPANDED,') >= 0) {
|
9950 | wxRes.resultStr = res.resultStr.substring('RSSEXPANDED,'.length);
|
9951 | }
|
9952 | }
|
9953 |
|
9954 | params.success(wxRes);
|
9955 | },
|
9956 | fail: function fail(res) {
|
9957 | if (params.fail) params.fail(res);else bridgeWeixin_Bridge.showToast(res.errMsg, { mask: false });
|
9958 | },
|
9959 | cancel: function cancel(res) {
|
9960 | if (params.cancel) params.cancel(res);
|
9961 | },
|
9962 | complete: function complete(res) {
|
9963 | if (params.complete) params.complete(res);
|
9964 | }
|
9965 | });
|
9966 | },
|
9967 |
|
9968 | |
9969 |
|
9970 |
|
9971 |
|
9972 |
|
9973 | chooseImage: function chooseImage(params) {
|
9974 | wx.chooseImage(params);
|
9975 | },
|
9976 | |
9977 |
|
9978 |
|
9979 |
|
9980 |
|
9981 |
|
9982 |
|
9983 |
|
9984 |
|
9985 |
|
9986 | uploadImage: function uploadImage(params) {
|
9987 | wx.uploadImage(params);
|
9988 | },
|
9989 | |
9990 |
|
9991 |
|
9992 |
|
9993 | previewImage: function previewImage(params) {
|
9994 | wx.previewImage(params);
|
9995 | },
|
9996 | |
9997 |
|
9998 |
|
9999 |
|
10000 |
|
10001 |
|
10002 |
|
10003 |
|
10004 | Image: function Image(params) {
|
10005 | var s = this;
|
10006 | var msg = '';
|
10007 |
|
10008 | s.choose = function () {
|
10009 | var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
10010 |
|
10011 | var option = {
|
10012 | enableSafe: args.enableSafe || false,
|
10013 | max: args.max || 5,
|
10014 | currentCount: args.currentCount || 0,
|
10015 | sourceType: args.sourceType || ['album', 'camera'],
|
10016 | sizeType: args.sizeType || ['original', 'compressed'],
|
10017 | chooseOptions: args.chooseOptions || {},
|
10018 | localIds: args.localIds || []
|
10019 | };
|
10020 | var count = option.max - option.currentCount;
|
10021 | if (count <= 0) {
|
10022 | msg = (window._seeds_lang['hint_max_upload'] || '最多只能传') + option.max + (window._seeds_lang['photos'] || '张照片');
|
10023 | bridgeWeixin_Bridge.showToast(msg);
|
10024 | return;
|
10025 | }
|
10026 |
|
10027 | if (option.enableSafe) count = 1;
|
10028 | bridgeWeixin_Bridge.chooseImage(Object.assign({
|
10029 | count: count,
|
10030 | sizeType: option.sizeType,
|
10031 | sourceType: option.sourceType,
|
10032 | success: function success(res) {
|
10033 | var imgMap = {};
|
10034 | for (var i = 0, localId; localId = res.localIds[i++];) {
|
10035 |
|
10036 | if (option.localIds.indexOf(localId) === -1) {
|
10037 | imgMap[localId] = {
|
10038 | serverId: '',
|
10039 | sourceType: res.sourceType
|
10040 | };
|
10041 | }
|
10042 | }
|
10043 | if (params.onChooseSuccess) params.onChooseSuccess(imgMap, res);
|
10044 | s.upload(imgMap);
|
10045 | },
|
10046 | fail: function fail(res) {
|
10047 | if (params.onChooseFail) params.onChooseFail(res);else bridgeWeixin_Bridge.showToast('选择照片失败', { mask: false });
|
10048 | },
|
10049 | cancel: function cancel() {},
|
10050 | complete: function complete() {}
|
10051 | }, option.chooseOptions));
|
10052 | };
|
10053 |
|
10054 | s.upload = function (imgMap) {
|
10055 | var imgs = Object.keys(imgMap);
|
10056 | var loop = function loop(index) {
|
10057 | if (index >= imgs.length) {
|
10058 | return;
|
10059 | }
|
10060 | var img = imgs[index];
|
10061 | if (imgMap[img].serverId) {
|
10062 | loop(++index);
|
10063 | return;
|
10064 | }
|
10065 | bridgeWeixin_Bridge.uploadImage({
|
10066 | localId: img,
|
10067 | isShowProgressTips: 1,
|
10068 | success: function success(res) {
|
10069 | var serverId = res.serverId;
|
10070 | imgMap[img].serverId = serverId;
|
10071 | if (params.onUploadSuccess) params.onUploadSuccess(imgMap, res);
|
10072 | if (index >= imgs.length - 1 && params.onUploadsSuccess) params.onUploadsSuccess(imgMap);
|
10073 | loop(++index);
|
10074 | },
|
10075 | fail: function fail() {
|
10076 | var deleteItem = imgMap[img];
|
10077 | if (params.onUploadFail) params.onUploadFail(imgMap, { id: img, index: index, item: deleteItem, errMsg: 'uploadImage:' + msg });
|
10078 | if (index >= imgs.length - 1 && params.onUploadsSuccess) params.onUploadsSuccess(imgMap);
|
10079 | loop(++index);
|
10080 | }
|
10081 | });
|
10082 | };
|
10083 | loop(0);
|
10084 | };
|
10085 | }
|
10086 | };
|
10087 |
|
10088 | var bridgeWeixin = (bridgeWeixin_Bridge);
|
10089 |
|
10090 | var bridgeDinghuo_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; };
|
10091 |
|
10092 |
|
10093 |
|
10094 |
|
10095 |
|
10096 |
|
10097 |
|
10098 |
|
10099 | if (!window._seeds_lang) window._seeds_lang = {};
|
10100 |
|
10101 | var bridgeDinghuo_Bridge = {
|
10102 | |
10103 |
|
10104 |
|
10105 | debug: false,
|
10106 |
|
10107 | tel: function tel(number) {
|
10108 | if (src_Device.device === 'pc') {
|
10109 | this.showToast(window._seeds_lang['hint_only_mobile'] || '此功能仅可在手机中使用');
|
10110 | return;
|
10111 | }
|
10112 | if (isNaN(number)) return;
|
10113 | window.location.href = 'tel:' + number;
|
10114 | },
|
10115 |
|
10116 | toast: null,
|
10117 | showToast: function showToast(msg) {
|
10118 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
10119 |
|
10120 | if (!msg) return;
|
10121 | if (!this.toast) {
|
10122 |
|
10123 | this.toast = new Toast_instance({
|
10124 | parent: document.body,
|
10125 | maskClass: 'mask toast-mask' + (params.mask === false ? ' toast-propagation' : ''),
|
10126 | toastClass: 'toast ' + (params.position ? params.position : 'middle'),
|
10127 | icon: params.icon || '',
|
10128 | html: msg,
|
10129 | delay: params.delay || 2000
|
10130 | });
|
10131 | } else {
|
10132 | this.toast.setHTML(msg);
|
10133 | this.toast.setMaskClassName('mask toast-mask' + (params.mask === false ? ' toast-propagation' : ''));
|
10134 | this.toast.setToastClassName('toast ' + (params.position ? params.position : 'middle'));
|
10135 | this.toast.setIcon(params.icon || '');
|
10136 | this.toast.setDelay(params.delay || 2000);
|
10137 | }
|
10138 | this.toast.show();
|
10139 | if (params.success) {
|
10140 | setTimeout(function () {
|
10141 | params.success();
|
10142 | }, params.delay ? Math.round(params.delay / 2) : 1000);
|
10143 | }
|
10144 | },
|
10145 |
|
10146 | loading: null,
|
10147 | showLoading: function showLoading() {
|
10148 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
10149 |
|
10150 | if (!this.loading) {
|
10151 | this.loading = new Loading_instance({
|
10152 | caption: params.caption || window._seeds_lang['loading'] || '正在加载...',
|
10153 | type: params.type,
|
10154 | icon: params.icon || '',
|
10155 | maskCss: params.css || null
|
10156 | });
|
10157 | } else {
|
10158 | if (params.caption) this.loading.setCaption(params.caption);
|
10159 | if (params.type) this.loading.setType(params.type);
|
10160 | if (params.css) this.loading.setMaskCss(params.css);
|
10161 | if (params.icon) this.toast.setIcon(params.icon || '');
|
10162 | if (params.mask) this.loading.setMaskClassName('mask loading-mask ' + (params.mask === false ? ' loading-propagation' : ''));
|
10163 | }
|
10164 | this.loading.show();
|
10165 | },
|
10166 | hideLoading: function hideLoading() {
|
10167 | if (!this.loading) {
|
10168 | this.toast.showToast(window._seeds_lang['hint_hideloading_after_showloading'] || 'showLoading后才能hideLoading');
|
10169 | } else {
|
10170 | this.loading.hide();
|
10171 | }
|
10172 | },
|
10173 |
|
10174 | alert: null,
|
10175 | showAlert: function showAlert(msg) {
|
10176 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
10177 |
|
10178 | if (!this.alert) {
|
10179 | this.alert = new Alert_instance(bridgeDinghuo_extends({}, params, {
|
10180 | html: msg,
|
10181 | onClickSubmit: function onClickSubmit(e) {
|
10182 | if (params.success) params.success(e);else e.hide();
|
10183 | }
|
10184 | }));
|
10185 | } else {
|
10186 | if (params) {
|
10187 | this.alert.reset();
|
10188 | for (var n in params) {
|
10189 | this.alert.params[n] = params[n];
|
10190 | }
|
10191 | this.alert.updateDOM();
|
10192 | this.alert.setHTML(msg);
|
10193 | }
|
10194 | }
|
10195 | this.alert.show();
|
10196 | },
|
10197 |
|
10198 | confirm: null,
|
10199 | showConfirm: function showConfirm(msg) {
|
10200 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
10201 |
|
10202 | if (!this.confirm) {
|
10203 | this.confirm = new Alert_instance(bridgeDinghuo_extends({}, params, {
|
10204 | html: msg,
|
10205 | onClickSubmit: function onClickSubmit(e) {
|
10206 | if (params.success) params.success(e);
|
10207 | },
|
10208 | onClickCancel: function onClickCancel(e) {
|
10209 | if (params.fail) params.fail(e);else e.hide();
|
10210 | }
|
10211 | }));
|
10212 | } else {
|
10213 | if (params) {
|
10214 | this.confirm.reset();
|
10215 | for (var n in params) {
|
10216 | this.confirm.params[n] = params[n];
|
10217 | }
|
10218 | this.confirm.updateDOM();
|
10219 | if (params.success) this.confirm.setOnClickSubmit(params.success);
|
10220 | if (params.fail) this.confirm.setOnClickCancel(params.fail);
|
10221 | }
|
10222 | this.confirm.setHTML(msg);
|
10223 | }
|
10224 | this.confirm.show();
|
10225 | },
|
10226 | |
10227 |
|
10228 |
|
10229 |
|
10230 |
|
10231 | getAddress: function getAddress() {
|
10232 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
10233 |
|
10234 | var url = 'https://api.map.baidu.com/geocoder/v2/?callback=renderReverse&location=' + params.latitude + ',' + params.longitude + '&output=json&pois=1&ak=IlfRglMOvFxapn5eGrmAj65H&ret_coordtype=gcj02ll';
|
10235 | src_jsonp(url, null, function (err, data) {
|
10236 | if (err) {
|
10237 | if (params.fail) params.fail({ errMsg: 'getAddress:' + (window._seeds_lang['hint_address_failed'] || '获取地址失败, 请稍后重试') + err });
|
10238 | } else {
|
10239 | var addrs = {};
|
10240 | if (data.result && data.result.formatted_address) {
|
10241 | addrs.address = data.result.formatted_address;
|
10242 | if (params.success) params.success(addrs);
|
10243 | } else {
|
10244 | if (params.fail) params.fail({ errMsg: 'getAddress:' + (window._seeds_lang['hint_address_failed'] || '获取地址失败, 请稍后重试') });
|
10245 | }
|
10246 | }
|
10247 | });
|
10248 | },
|
10249 | |
10250 |
|
10251 |
|
10252 |
|
10253 |
|
10254 | getWeather: function getWeather() {
|
10255 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
10256 |
|
10257 | var url = 'http://api.map.baidu.com/telematics/v3/weather?location=' + (params.location || '南京市') + '&output=json&ak=IlfRglMOvFxapn5eGrmAj65H';
|
10258 | src_jsonp(url, null, function (err, data) {
|
10259 | if (err) {
|
10260 | if (params.fail) params.fail({ errMsg: 'getWeather:' + (window._seeds_lang['hint_weather_failed'] || '获取天气失败, 请稍后重试') + err });
|
10261 | } else {
|
10262 | if (data.results && data.results.length) {
|
10263 | if (params.success) params.success(data.results);
|
10264 | } else {
|
10265 | if (params.fail) params.fail({ errMsg: 'getWeather:' + (window._seeds_lang['hint_weather_failed'] || '获取天气失败, 请稍后重试') });
|
10266 | }
|
10267 | }
|
10268 | });
|
10269 | },
|
10270 |
|
10271 | back: function back(argHistory, argBackLvl) {
|
10272 |
|
10273 | var _history = window.history;
|
10274 | if (argHistory && argHistory.go) _history = argHistory;
|
10275 | var _backLvl = argBackLvl || -1;
|
10276 |
|
10277 |
|
10278 | var isFromApp = src_Device.getUrlParameter('isFromApp', location.search) || '';
|
10279 | if (isFromApp === '1') {
|
10280 |
|
10281 | try {
|
10282 | bridgeDinghuo_Bridge.closeWindow();
|
10283 | } catch (error) {
|
10284 | console.log(error);
|
10285 | }
|
10286 | } else if (isFromApp === 'home') {
|
10287 |
|
10288 | try {
|
10289 | bridgeDinghuo_Bridge.goHome();
|
10290 | } catch (error) {
|
10291 | console.log(error);
|
10292 | }
|
10293 | } else if (isFromApp === 'confirm') {
|
10294 |
|
10295 | bridgeDinghuo_Bridge.showConfirm(bridgeDinghuo_Bridge.confirmCaption || window._seeds_lang['confirm_quit_page'] || '您确定要离开此页面吗?', {
|
10296 | success: function success(e) {
|
10297 | e.hide();
|
10298 | _history.go(_backLvl);
|
10299 | }
|
10300 | });
|
10301 | } else if (isFromApp === 'confirm-close') {
|
10302 |
|
10303 | bridgeDinghuo_Bridge.showConfirm(bridgeDinghuo_Bridge.confirmCaption || window._seeds_lang['confirm_quit_page'] || '您确定要离开此页面吗?', {
|
10304 | success: function success(e) {
|
10305 | e.hide();
|
10306 | bridgeDinghuo_Bridge.closeWindow();
|
10307 | }
|
10308 | });
|
10309 | } else if (isFromApp === 'custom') {
|
10310 | console.log('自定义');
|
10311 | } else {
|
10312 |
|
10313 | _history.go(_backLvl);
|
10314 | }
|
10315 | },
|
10316 |
|
10317 | isHomePage: function isHomePage(callback) {
|
10318 | this.invoke('isHomePage', null, function (data) {
|
10319 | if (data.result.toString() === '1') {
|
10320 | callback(true);
|
10321 | } else {
|
10322 | callback(false);
|
10323 | }
|
10324 | });
|
10325 | },
|
10326 |
|
10327 | getAppVersion: function getAppVersion() {
|
10328 | var ua = navigator.userAgent.toLowerCase();
|
10329 | var verExp = ua.match(/dinghuoappversion\/.{0,}(\d+\.\d+\.\d+)/);
|
10330 | if (verExp && verExp[1]) return verExp[1].trim();
|
10331 | return '';
|
10332 | },
|
10333 |
|
10334 | goHome: function goHome(callback) {
|
10335 | this.invoke('goHome', null, callback);
|
10336 | },
|
10337 |
|
10338 | logOut: function logOut() {
|
10339 | this.invoke('logOut');
|
10340 | },
|
10341 |
|
10342 | openWindow: function openWindow(params, callback) {
|
10343 | this.invoke('openWindow', params, callback);
|
10344 | },
|
10345 |
|
10346 | closeWindow: function closeWindow(callback) {
|
10347 | this.invoke('closeWindow', null, callback);
|
10348 | },
|
10349 |
|
10350 | addBackPress: function addBackPress(callback) {
|
10351 | try {
|
10352 | this.setBackEnable(true);
|
10353 | window.addEventListener('onBackPress', callback || this.back);
|
10354 |
|
10355 | this.addIosBackPress(callback);
|
10356 | } catch (error) {
|
10357 | console.log(error);
|
10358 | }
|
10359 | },
|
10360 |
|
10361 | removeBackPress: function removeBackPress(callback) {
|
10362 | try {
|
10363 | this.setBackEnable(false);
|
10364 | window.removeEventListener('onBackPress', callback || this.back);
|
10365 | } catch (error) {
|
10366 | console.log(error);
|
10367 | }
|
10368 | },
|
10369 | |
10370 |
|
10371 |
|
10372 |
|
10373 | |
10374 |
|
10375 |
|
10376 | platform: 'dinghuo',
|
10377 | config: function config() {
|
10378 |
|
10379 | this.addBackPress();
|
10380 | src_DB.setSession('bridge_isready', '1');
|
10381 | this.registerHandler(['getGoodsByApp', 'getCartGoodsByApp', 'onBackPress', 'setOnlineByApp']);
|
10382 | },
|
10383 |
|
10384 | invoke: function invoke(name, param, callback) {
|
10385 | if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
|
10386 |
|
10387 |
|
10388 | this.setup(function (bridge) {
|
10389 | bridge.callHandler(name, param, function (response) {
|
10390 | if (callback) {
|
10391 | try {
|
10392 | callback(JSON.parse(response));
|
10393 | } catch (e) {
|
10394 | callback(response);
|
10395 | }
|
10396 | }
|
10397 | });
|
10398 | });
|
10399 |
|
10400 | } else if (/(Android)/i.test(navigator.userAgent)) {
|
10401 |
|
10402 |
|
10403 | if (window.WebViewJavascriptBridge) {
|
10404 | window.WebViewJavascriptBridge.callHandler(name, param && JSON.stringify(param), function (response) {
|
10405 | if (callback) {
|
10406 | try {
|
10407 | callback(JSON.parse(response));
|
10408 | } catch (e) {
|
10409 | callback(response);
|
10410 | }
|
10411 | }
|
10412 | });
|
10413 | } else {
|
10414 | document.addEventListener('WebViewJavascriptBridgeReady', function () {
|
10415 | window.WebViewJavascriptBridge.callHandler(name, param && JSON.stringify(param), function (response) {
|
10416 | if (callback) {
|
10417 | try {
|
10418 | callback(JSON.parse(response));
|
10419 | } catch (e) {
|
10420 | callback(response);
|
10421 | }
|
10422 | }
|
10423 | });
|
10424 | }, false);
|
10425 | }
|
10426 | }
|
10427 | },
|
10428 | setup: function setup(callback) {
|
10429 |
|
10430 | if (window.WebViewJavascriptBridge) {
|
10431 | return callback(WebViewJavascriptBridge);
|
10432 | }
|
10433 | if (window.WVJBCallbacks) {
|
10434 | return window.WVJBCallbacks.push(callback);
|
10435 | }
|
10436 | window.WVJBCallbacks = [callback];
|
10437 | var WVJBIframe = document.createElement('iframe');
|
10438 | WVJBIframe.style.display = 'none';
|
10439 | WVJBIframe.src = 'https://__bridge_loaded__';
|
10440 | document.documentElement.appendChild(WVJBIframe);
|
10441 | setTimeout(function () {
|
10442 | document.documentElement.removeChild(WVJBIframe);
|
10443 | }, 0);
|
10444 |
|
10445 | },
|
10446 |
|
10447 |
|
10448 | registerHandler: function registerHandler(events) {
|
10449 | if (typeof window !== 'undefined') {
|
10450 | if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
|
10451 |
|
10452 |
|
10453 | this.setup(function (bridge) {
|
10454 | events.forEach(function (eventName) {
|
10455 | bridge.registerHandler(eventName, function () {
|
10456 | var event = new CustomEvent(eventName);
|
10457 |
|
10458 | window.dispatchEvent(event);
|
10459 | });
|
10460 | });
|
10461 | });
|
10462 |
|
10463 | } else if (/(Android)/i.test(navigator.userAgent)) {
|
10464 |
|
10465 |
|
10466 | if (window.WebViewJavascriptBridge) {
|
10467 | events.forEach(function (eventName) {
|
10468 | window.WebViewJavascriptBridge.registerHandler(eventName, function () {
|
10469 | var event = new CustomEvent(eventName);
|
10470 |
|
10471 | window.dispatchEvent(event);
|
10472 | });
|
10473 | });
|
10474 | } else {
|
10475 | document.addEventListener('WebViewJavascriptBridgeReady', function () {
|
10476 | events.forEach(function (eventName) {
|
10477 | window.WebViewJavascriptBridge.registerHandler(eventName, function () {
|
10478 | var event = new CustomEvent(eventName);
|
10479 |
|
10480 | window.dispatchEvent(event);
|
10481 | });
|
10482 | });
|
10483 | }, false);
|
10484 | }
|
10485 | }
|
10486 | }
|
10487 | },
|
10488 | |
10489 |
|
10490 |
|
10491 |
|
10492 |
|
10493 |
|
10494 | alipay: function alipay(params, callback) {
|
10495 | this.invoke('alipay', params, callback);
|
10496 | },
|
10497 | |
10498 |
|
10499 |
|
10500 |
|
10501 |
|
10502 | slopenpay: function slopenpay(params, callback) {
|
10503 | this.invoke('slopenpay', params, callback);
|
10504 | },
|
10505 | |
10506 |
|
10507 |
|
10508 |
|
10509 |
|
10510 | qmfpay: function qmfpay(params, callback) {
|
10511 |
|
10512 |
|
10513 |
|
10514 |
|
10515 |
|
10516 |
|
10517 |
|
10518 |
|
10519 |
|
10520 |
|
10521 |
|
10522 | if (bridgeDinghuo_Bridge.getAppVersion() < '2.3.6') {
|
10523 | callback({ resultCode: '5004', resultInfo: '{"resultMsg":"请安装2.3.6以上版本"}' });
|
10524 | return;
|
10525 | }
|
10526 | this.invoke('qmfpay', params, callback);
|
10527 | },
|
10528 | |
10529 |
|
10530 |
|
10531 |
|
10532 |
|
10533 | setTitle: function setTitle(params, callback) {
|
10534 | this.invoke('setTitle', params, callback);
|
10535 | },
|
10536 | |
10537 |
|
10538 |
|
10539 |
|
10540 |
|
10541 | onHistoryBack: function onHistoryBack(callback) {
|
10542 | this.invoke('onHistoryBack', null, callback);
|
10543 | },
|
10544 |
|
10545 | addIosBackPress: function addIosBackPress(callback) {
|
10546 | var _this = this;
|
10547 |
|
10548 | this.onHistoryBack(function () {
|
10549 | if (callback) callback();else if (_this.back) _this.back();
|
10550 | _this.addIosBackPress(callback);
|
10551 | });
|
10552 | },
|
10553 | |
10554 |
|
10555 |
|
10556 |
|
10557 |
|
10558 |
|
10559 |
|
10560 |
|
10561 |
|
10562 |
|
10563 |
|
10564 | shareText: function shareText(params, callback) {
|
10565 | this.invoke('shareText', params, callback);
|
10566 | },
|
10567 | |
10568 |
|
10569 |
|
10570 |
|
10571 | getIdentification: function getIdentification(callback) {
|
10572 | if (bridgeDinghuo_Bridge.getAppVersion() < '2.3.6') {
|
10573 | callback({});
|
10574 | return;
|
10575 | }
|
10576 | this.invoke('getIdentification', null, callback);
|
10577 | },
|
10578 | |
10579 |
|
10580 |
|
10581 | |
10582 |
|
10583 |
|
10584 |
|
10585 |
|
10586 |
|
10587 |
|
10588 |
|
10589 | isExistsFile: function isExistsFile(params, callback) {
|
10590 | this.invoke('isExistsFile', params, callback);
|
10591 | },
|
10592 | |
10593 |
|
10594 |
|
10595 |
|
10596 |
|
10597 |
|
10598 |
|
10599 |
|
10600 |
|
10601 | downloadFile: function downloadFile(params, callback) {
|
10602 | this.invoke('downloadFile', params, callback);
|
10603 | },
|
10604 | |
10605 |
|
10606 |
|
10607 |
|
10608 |
|
10609 |
|
10610 | openFile: function openFile(params, callback) {
|
10611 | this.invoke('openFile', params, callback);
|
10612 | },
|
10613 | |
10614 |
|
10615 |
|
10616 |
|
10617 | scanQRCode: function scanQRCode(params) {
|
10618 | this.invoke('scanQRCode', null, params.success);
|
10619 | },
|
10620 | |
10621 |
|
10622 |
|
10623 |
|
10624 |
|
10625 |
|
10626 |
|
10627 |
|
10628 |
|
10629 | getLocation: function getLocation() {
|
10630 | var _this2 = this;
|
10631 |
|
10632 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
10633 |
|
10634 |
|
10635 | var appLocation = src_DB.getCookie('app_location');
|
10636 | if (appLocation === 'undefined') {
|
10637 | src_DB.removeCookie('app_location');
|
10638 | appLocation = '';
|
10639 | }
|
10640 | try {
|
10641 | if (appLocation) appLocation = JSON.parse(appLocation);
|
10642 | } catch (error) {
|
10643 | appLocation = '';
|
10644 | }
|
10645 | if (appLocation) {
|
10646 | if (params.success) params.success(appLocation);
|
10647 | return;
|
10648 | }
|
10649 |
|
10650 |
|
10651 | if (this.locating) return;
|
10652 | this.locating = true;
|
10653 | console.log('调用定位...');
|
10654 | this.invoke('getLocation', 'gcj02', function (res) {
|
10655 | _this2.locating = false;
|
10656 | if (res && res.latitude) {
|
10657 |
|
10658 | if (params.cache) src_DB.setCookie('app_location', JSON.stringify(res), params.cache || 60);
|
10659 | if (params.success) params.success(res);
|
10660 | } else {
|
10661 | if (params.fail) params.fail({ errMsg: 'getLocation:定位失败,请检查订货365定位权限是否开启' });else bridgeDinghuo_Bridge.showToast('定位失败,请检查订货365定位权限是否开启', { mask: false });
|
10662 | }
|
10663 | });
|
10664 | },
|
10665 | |
10666 |
|
10667 |
|
10668 |
|
10669 | getNetworkType: function getNetworkType(callback) {
|
10670 | this.invoke('getNetworkType', null, callback);
|
10671 | },
|
10672 | |
10673 |
|
10674 |
|
10675 |
|
10676 |
|
10677 |
|
10678 |
|
10679 |
|
10680 |
|
10681 |
|
10682 | chooseImage: function chooseImage(params) {
|
10683 | this.invoke('chooseImage', params, function (res) {
|
10684 | res.localIds = res.localIds.map(function (id) {
|
10685 | return 'LocalResource://imageid' + id;
|
10686 | });
|
10687 | if (params.success) params.success(res);
|
10688 | });
|
10689 | },
|
10690 | |
10691 |
|
10692 |
|
10693 |
|
10694 |
|
10695 |
|
10696 |
|
10697 |
|
10698 |
|
10699 | uploadImage: function uploadImage() {
|
10700 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
10701 |
|
10702 | if (!params.dir) {
|
10703 | bridgeDinghuo_Bridge.showToast(window._seeds_lang['hint_upload_image_must_dir'] || '没有上传目录', { mask: false });
|
10704 | return;
|
10705 | }
|
10706 | if (!params.localIds || Object.isEmptyObject(params.localIds)) {
|
10707 | bridgeDinghuo_Bridge.showToast(window._seeds_lang['hint_upload_image_must_localIds'] || '没有上传图片地址', { mask: false });
|
10708 | return;
|
10709 | }
|
10710 | if (!params.tenantId) {
|
10711 | bridgeDinghuo_Bridge.showToast(window._seeds_lang['hint_upload_image_must_tenantId'] || '没有上传企业id', { mask: false });
|
10712 | return;
|
10713 | }
|
10714 |
|
10715 |
|
10716 |
|
10717 |
|
10718 |
|
10719 |
|
10720 | params.localIds = params.localIds.map(function (localId) {
|
10721 | return localId.replace(new RegExp('LocalResource://imageid'), '');
|
10722 | });
|
10723 |
|
10724 | var uploadParams = {
|
10725 | localIds: params.localIds,
|
10726 | uploadDir: params.dir
|
10727 | };
|
10728 | if (params.tenantId) uploadParams.tenantId = params.tenantId;
|
10729 | if (params.isAI) uploadParams.isAI = params.isAI;
|
10730 | this.invoke('uploadImage', uploadParams);
|
10731 | },
|
10732 | |
10733 |
|
10734 |
|
10735 |
|
10736 |
|
10737 |
|
10738 |
|
10739 |
|
10740 |
|
10741 | previewImage: function previewImage(params) {
|
10742 | if (!params.urls || !params.urls.length) {
|
10743 | bridgeDinghuo_Bridge.showToast(window._seeds_lang['hint_preview_image_must_urls'] || '没有预览图片地址', { mask: false });
|
10744 | return;
|
10745 | }
|
10746 | this.invoke('previewImage', params);
|
10747 | },
|
10748 | |
10749 |
|
10750 |
|
10751 |
|
10752 | setBackEnable: function setBackEnable(flag) {
|
10753 | if (/(Android)/i.test(navigator.userAgent)) {
|
10754 |
|
10755 | this.invoke('setBackEnable', flag);
|
10756 | }
|
10757 | },
|
10758 |
|
10759 | getImagePrefix: function getImagePrefix() {
|
10760 | return 'LocalResource://imageid';
|
10761 | },
|
10762 |
|
10763 | downloadImage: function downloadImage() {},
|
10764 |
|
10765 | onMenuShareAppMessage: function onMenuShareAppMessage() {},
|
10766 |
|
10767 | onMenuShareTimeline: function onMenuShareTimeline() {},
|
10768 |
|
10769 | loginInfo: function loginInfo(callback) {
|
10770 | this.invoke('getLoginInfo', null, callback);
|
10771 | },
|
10772 |
|
10773 | getLoginInfo: function getLoginInfo(key, callback) {
|
10774 | this.loginInfo(function (result) {
|
10775 | callback(result[key]);
|
10776 | });
|
10777 | },
|
10778 |
|
10779 |
|
10780 | systemParameter: function systemParameter(callback) {
|
10781 | this.invoke('getSystemParameter', null, callback);
|
10782 | },
|
10783 |
|
10784 |
|
10785 | changeBadgeNum: function changeBadgeNum(count) {
|
10786 | this.invoke('setBadgeNum', { key: count });
|
10787 | },
|
10788 |
|
10789 | |
10790 |
|
10791 |
|
10792 |
|
10793 |
|
10794 | Image: function Image() {
|
10795 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
10796 |
|
10797 | var s = this;
|
10798 | var msg = '';
|
10799 |
|
10800 | s.choose = function () {
|
10801 | var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
10802 |
|
10803 | var option = {
|
10804 | enableSafe: args.enableSafe || false,
|
10805 | max: args.max || 5,
|
10806 | currentCount: args.currentCount || 0,
|
10807 | sourceType: args.sourceType || ['album', 'camera'],
|
10808 | sizeType: args.sizeType || ['original', 'compressed'],
|
10809 | chooseOptions: args.chooseOptions || {}
|
10810 | |
10811 |
|
10812 |
|
10813 |
|
10814 |
|
10815 |
|
10816 |
|
10817 | };var count = option.max - option.currentCount;
|
10818 | if (count <= 0) {
|
10819 | msg = (window._seeds_lang['hint_max_upload'] || '最多只能传') + option.max + (window._seeds_lang['photos'] || '张照片');
|
10820 | bridgeDinghuo_Bridge.showToast(msg);
|
10821 | return;
|
10822 | }
|
10823 |
|
10824 | if (option.enableSafe) count = 1;
|
10825 | bridgeDinghuo_Bridge.chooseImage(Object.assign({
|
10826 | count: count,
|
10827 | sizeType: option.sizeType,
|
10828 | sourceType: option.sourceType,
|
10829 | success: function success(res) {
|
10830 | var imgMap = {};
|
10831 | for (var i = 0, localId; localId = res.localIds[i++];) {
|
10832 |
|
10833 | imgMap[localId] = {
|
10834 | serverId: '',
|
10835 | sourceType: JSON.stringify(option.sourceType) === JSON.stringify(['camera']) ? 'camera' : 'album'
|
10836 | };
|
10837 | }
|
10838 | if (params.onChooseSuccess) params.onChooseSuccess(imgMap, res);
|
10839 | }
|
10840 | }, option.chooseOptions));
|
10841 | };
|
10842 | }
|
10843 | };
|
10844 |
|
10845 | var bridgeDinghuo = (bridgeDinghuo_Bridge);
|
10846 |
|
10847 | var bridgeWaiqin_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; };
|
10848 |
|
10849 |
|
10850 |
|
10851 |
|
10852 |
|
10853 |
|
10854 |
|
10855 |
|
10856 | if (!window._seeds_lang) window._seeds_lang = {};
|
10857 |
|
10858 | var bridgeWaiqin_Bridge = {
|
10859 | |
10860 |
|
10861 |
|
10862 | debug: false,
|
10863 |
|
10864 | tel: function tel(number) {
|
10865 | if (src_Device.device === 'pc') {
|
10866 | this.showToast(window._seeds_lang['hint_only_mobile'] || '此功能仅可在手机中使用');
|
10867 | return;
|
10868 | }
|
10869 | if (isNaN(number)) return;
|
10870 | window.location.href = 'tel:' + number;
|
10871 | },
|
10872 |
|
10873 | toast: null,
|
10874 | showToast: function showToast(msg) {
|
10875 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
10876 |
|
10877 | if (!msg) return;
|
10878 | if (!this.toast) {
|
10879 |
|
10880 | this.toast = new Toast_instance({
|
10881 | parent: document.body,
|
10882 | maskClass: 'mask toast-mask' + (params.mask === false ? ' toast-propagation' : ''),
|
10883 | toastClass: 'toast ' + (params.position ? params.position : 'middle'),
|
10884 | icon: params.icon || '',
|
10885 | html: msg,
|
10886 | delay: params.delay || 2000
|
10887 | });
|
10888 | } else {
|
10889 | this.toast.setHTML(msg);
|
10890 | this.toast.setMaskClassName('mask toast-mask' + (params.mask === false ? ' toast-propagation' : ''));
|
10891 | this.toast.setToastClassName('toast ' + (params.position ? params.position : 'middle'));
|
10892 | this.toast.setIcon(params.icon || '');
|
10893 | this.toast.setDelay(params.delay || 2000);
|
10894 | }
|
10895 | this.toast.show();
|
10896 | if (params.success) {
|
10897 | setTimeout(function () {
|
10898 | params.success();
|
10899 | }, params.delay ? Math.round(params.delay / 2) : 1000);
|
10900 | }
|
10901 | },
|
10902 |
|
10903 | loading: null,
|
10904 | showLoading: function showLoading() {
|
10905 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
10906 |
|
10907 | if (!this.loading) {
|
10908 | this.loading = new Loading_instance({
|
10909 | caption: params.caption || window._seeds_lang['loading'] || '正在加载...',
|
10910 | type: params.type,
|
10911 | icon: params.icon || '',
|
10912 | maskCss: params.css || null
|
10913 | });
|
10914 | } else {
|
10915 | if (params.caption) this.loading.setCaption(params.caption);
|
10916 | if (params.type) this.loading.setType(params.type);
|
10917 | if (params.css) this.loading.setMaskCss(params.css);
|
10918 | if (params.icon) this.toast.setIcon(params.icon || '');
|
10919 | if (params.mask) this.loading.setMaskClassName('mask loading-mask ' + (params.mask === false ? ' loading-propagation' : ''));
|
10920 | }
|
10921 | this.loading.show();
|
10922 | },
|
10923 | hideLoading: function hideLoading() {
|
10924 | if (!this.loading) {
|
10925 | this.toast.showToast(window._seeds_lang['hint_hideloading_after_showloading'] || 'showLoading后才能hideLoading');
|
10926 | } else {
|
10927 | this.loading.hide();
|
10928 | }
|
10929 | },
|
10930 |
|
10931 | alert: null,
|
10932 | showAlert: function showAlert(msg) {
|
10933 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
10934 |
|
10935 | if (!this.alert) {
|
10936 | this.alert = new Alert_instance(bridgeWaiqin_extends({}, params, {
|
10937 | html: msg,
|
10938 | onClickSubmit: function onClickSubmit(e) {
|
10939 | if (params.success) params.success(e);else e.hide();
|
10940 | }
|
10941 | }));
|
10942 | } else {
|
10943 | if (params) {
|
10944 | this.alert.reset();
|
10945 | for (var n in params) {
|
10946 | this.alert.params[n] = params[n];
|
10947 | }
|
10948 | this.alert.updateDOM();
|
10949 | this.alert.setHTML(msg);
|
10950 | }
|
10951 | }
|
10952 | this.alert.show();
|
10953 | },
|
10954 |
|
10955 | confirm: null,
|
10956 | showConfirm: function showConfirm(msg) {
|
10957 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
10958 |
|
10959 | if (!this.confirm) {
|
10960 | this.confirm = new Alert_instance(bridgeWaiqin_extends({}, params, {
|
10961 | html: msg,
|
10962 | onClickSubmit: function onClickSubmit(e) {
|
10963 | if (params.success) params.success(e);
|
10964 | },
|
10965 | onClickCancel: function onClickCancel(e) {
|
10966 | if (params.fail) params.fail(e);else e.hide();
|
10967 | }
|
10968 | }));
|
10969 | } else {
|
10970 | if (params) {
|
10971 | this.confirm.reset();
|
10972 | for (var n in params) {
|
10973 | this.confirm.params[n] = params[n];
|
10974 | }
|
10975 | this.confirm.updateDOM();
|
10976 | if (params.success) this.confirm.setOnClickSubmit(params.success);
|
10977 | if (params.fail) this.confirm.setOnClickCancel(params.fail);
|
10978 | }
|
10979 | this.confirm.setHTML(msg);
|
10980 | }
|
10981 | this.confirm.show();
|
10982 | },
|
10983 | |
10984 |
|
10985 |
|
10986 |
|
10987 |
|
10988 | getAddress: function getAddress() {
|
10989 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
10990 |
|
10991 | var url = 'https://api.map.baidu.com/geocoder/v2/?callback=renderReverse&location=' + params.latitude + ',' + params.longitude + '&output=json&pois=1&ak=IlfRglMOvFxapn5eGrmAj65H&ret_coordtype=gcj02ll';
|
10992 | src_jsonp(url, null, function (err, data) {
|
10993 | if (err) {
|
10994 | if (params.fail) params.fail({ errMsg: 'getAddress:' + (window._seeds_lang['hint_address_failed'] || '获取地址失败, 请稍后重试') + err });
|
10995 | } else {
|
10996 | var addrs = {};
|
10997 | if (data.result && data.result.formatted_address) {
|
10998 | addrs.address = data.result.formatted_address;
|
10999 | if (params.success) params.success(addrs);
|
11000 | } else {
|
11001 | if (params.fail) params.fail({ errMsg: 'getAddress:' + (window._seeds_lang['hint_address_failed'] || '获取地址失败, 请稍后重试') });
|
11002 | }
|
11003 | }
|
11004 | });
|
11005 | },
|
11006 | |
11007 |
|
11008 |
|
11009 |
|
11010 |
|
11011 | getWeather: function getWeather() {
|
11012 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
11013 |
|
11014 | var url = 'http://api.map.baidu.com/telematics/v3/weather?location=' + (params.location || '南京市') + '&output=json&ak=IlfRglMOvFxapn5eGrmAj65H';
|
11015 | src_jsonp(url, null, function (err, data) {
|
11016 | if (err) {
|
11017 | if (params.fail) params.fail({ errMsg: 'getWeather:' + (window._seeds_lang['hint_weather_failed'] || '获取天气失败, 请稍后重试') + err });
|
11018 | } else {
|
11019 | if (data.results && data.results.length) {
|
11020 | if (params.success) params.success(data.results);
|
11021 | } else {
|
11022 | if (params.fail) params.fail({ errMsg: 'getWeather:' + (window._seeds_lang['hint_weather_failed'] || '获取天气失败, 请稍后重试') });
|
11023 | }
|
11024 | }
|
11025 | });
|
11026 | },
|
11027 |
|
11028 | back: function back(argHistory, argBackLvl) {
|
11029 |
|
11030 | var _history = window.history;
|
11031 | if (argHistory && argHistory.go) _history = argHistory;
|
11032 | var _backLvl = argBackLvl || -1;
|
11033 |
|
11034 |
|
11035 | var isFromApp = src_Device.getUrlParameter('isFromApp', location.search) || '';
|
11036 | if (isFromApp === '1') {
|
11037 |
|
11038 | try {
|
11039 | bridgeWaiqin_Bridge.closeWindow();
|
11040 | } catch (error) {
|
11041 | console.log(error);
|
11042 | }
|
11043 | } else if (isFromApp === 'home') {
|
11044 |
|
11045 | try {
|
11046 | bridgeWaiqin_Bridge.goHome();
|
11047 | } catch (error) {
|
11048 | console.log(error);
|
11049 | }
|
11050 | } else if (isFromApp === 'confirm') {
|
11051 |
|
11052 | bridgeWaiqin_Bridge.showConfirm(bridgeWaiqin_Bridge.confirmCaption || window._seeds_lang['confirm_quit_page'] || '您确定要离开此页面吗?', {
|
11053 | success: function success(e) {
|
11054 | e.hide();
|
11055 | _history.go(_backLvl);
|
11056 | }
|
11057 | });
|
11058 | } else if (isFromApp === 'confirm-close') {
|
11059 |
|
11060 | bridgeWaiqin_Bridge.showConfirm(bridgeWaiqin_Bridge.confirmCaption || window._seeds_lang['confirm_quit_page'] || '您确定要离开此页面吗?', {
|
11061 | success: function success(e) {
|
11062 | e.hide();
|
11063 | bridgeWaiqin_Bridge.closeWindow();
|
11064 | }
|
11065 | });
|
11066 | } else if (isFromApp === 'custom') {
|
11067 | console.log('自定义');
|
11068 | } else {
|
11069 |
|
11070 | _history.go(_backLvl);
|
11071 | }
|
11072 | },
|
11073 |
|
11074 | isHomePage: function isHomePage(callback, rule) {
|
11075 | if (rule && window.location.href.indexOf(rule) >= 0) {
|
11076 | callback(true);
|
11077 | return;
|
11078 | }
|
11079 | callback(false);
|
11080 | },
|
11081 |
|
11082 | getAppVersion: function getAppVersion() {
|
11083 | var ua = navigator.userAgent;
|
11084 | var verExp = ua.match(/WqAppVersion\/.{0,}(\d+\.\d+\.\d+)/);
|
11085 | if (verExp && verExp[1]) return verExp[1].trim();
|
11086 | return '';
|
11087 | },
|
11088 |
|
11089 | goHome: function goHome() {
|
11090 | window.history.go(-1);
|
11091 | },
|
11092 |
|
11093 | logOut: function logOut(msg) {
|
11094 | wq.wqload.wqBackToLogin(JSON.stringify({ message: msg || '您的帐号因正在它处登录, 需要您重新登录' }));
|
11095 | },
|
11096 |
|
11097 | openWindow: function openWindow(params, callback) {
|
11098 | wq.wqload.wqOpenUrl(callback ? callback : null, null, params ? JSON.stringify(params) : null);
|
11099 | },
|
11100 |
|
11101 | closeWindow: function closeWindow() {
|
11102 | wq.wqload.wqClosePage();
|
11103 | },
|
11104 |
|
11105 | addBackPress: function addBackPress(callback) {
|
11106 | document.addEventListener('backbutton', callback || this.back, false);
|
11107 | },
|
11108 |
|
11109 | removeBackPress: function removeBackPress(callback) {
|
11110 | document.removeEventListener('backbutton', callback || this.back, false);
|
11111 | },
|
11112 | |
11113 |
|
11114 |
|
11115 |
|
11116 | |
11117 |
|
11118 |
|
11119 | platform: 'waiqin',
|
11120 | config: function config() {
|
11121 | var _this = this;
|
11122 |
|
11123 | document.addEventListener('deviceready', function () {
|
11124 | _this.addBackPress();
|
11125 | src_DB.setSession('bridge_isready', '1');
|
11126 | });
|
11127 | },
|
11128 | |
11129 |
|
11130 |
|
11131 |
|
11132 |
|
11133 |
|
11134 | alipay: function alipay(params, callback) {
|
11135 | wq.wqpay.alipay(function (result) {
|
11136 |
|
11137 | if (callback) callback(result);
|
11138 | }, null, params ? JSON.stringify(params) : null);
|
11139 | },
|
11140 | |
11141 |
|
11142 |
|
11143 |
|
11144 |
|
11145 | slopenpay: function slopenpay(params, callback) {
|
11146 | wq.wqpay.slopenpay(function (result) {
|
11147 |
|
11148 | if (callback) callback(result);
|
11149 | }, null, params ? JSON.stringify(params) : null);
|
11150 | },
|
11151 | |
11152 |
|
11153 |
|
11154 |
|
11155 |
|
11156 | qmfpay: function qmfpay(params, callback) {
|
11157 | wq.wqpay.qmfpay(function (result) {
|
11158 |
|
11159 | if (callback) callback(result);
|
11160 | }, null, params ? JSON.stringify(params) : null);
|
11161 | },
|
11162 | |
11163 |
|
11164 |
|
11165 |
|
11166 | getApp: function getApp(callback) {
|
11167 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { operation: 'AllInfo' };
|
11168 |
|
11169 | wq.wqapp.getApp(function (result) {
|
11170 |
|
11171 | if (callback) callback(result);
|
11172 | }, null, JSON.stringify(params));
|
11173 | },
|
11174 | |
11175 |
|
11176 |
|
11177 | |
11178 |
|
11179 |
|
11180 |
|
11181 |
|
11182 |
|
11183 |
|
11184 |
|
11185 | isExistsFile: function isExistsFile(params, callback) {
|
11186 | wq.wqio.verifyFileHasExist(function (result) {
|
11187 |
|
11188 | if (callback) callback(result);
|
11189 | }, params ? JSON.stringify(params) : null);
|
11190 | },
|
11191 | |
11192 |
|
11193 |
|
11194 |
|
11195 |
|
11196 |
|
11197 |
|
11198 |
|
11199 |
|
11200 | downloadFile: function downloadFile(params, callback) {
|
11201 | wq.wqio.downloadFile(function (result) {
|
11202 |
|
11203 | if (callback) callback(result);
|
11204 | }, params ? JSON.stringify(params) : null);
|
11205 | },
|
11206 | |
11207 |
|
11208 |
|
11209 |
|
11210 |
|
11211 |
|
11212 | openFile: function openFile(params, callback) {
|
11213 | wq.wqio.openFile(function (result) {
|
11214 |
|
11215 | if (callback) callback(result);
|
11216 | }, params ? JSON.stringify(params) : null);
|
11217 | },
|
11218 | |
11219 |
|
11220 |
|
11221 |
|
11222 |
|
11223 |
|
11224 |
|
11225 | wqUrlToBase64: function wqUrlToBase64(params, callback) {
|
11226 | wq.wqphoto.wqUrlToBase64(function (result) {
|
11227 |
|
11228 | if (callback) callback(result);
|
11229 | }, params ? JSON.stringify(params) : null);
|
11230 | },
|
11231 | |
11232 |
|
11233 |
|
11234 |
|
11235 | previewVideo: function previewVideo() {
|
11236 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
11237 |
|
11238 | if (src_Device.platformVersion < '6.2.2') {
|
11239 | bridgeWaiqin_Bridge.showToast('视频播放功能需要升级至6.2.2及以上的客户端', { mask: false });
|
11240 | return;
|
11241 | }
|
11242 | wq.wqload.wqOpenCustomerPager(JSON.stringify({
|
11243 | IOSViewController: 'JNCVideoPlayerVC',
|
11244 | androidUIR: 'com.waiqin365.lightapp.jiannanchun.VideoPlayActivity',
|
11245 | androidParma: {
|
11246 | videoUrl: params.src,
|
11247 | title: params.title || '视频播放'
|
11248 | },
|
11249 | IOSParma: {
|
11250 | videoUrl: params.src,
|
11251 | title: params.title || '视频播放'
|
11252 | }
|
11253 | }));
|
11254 | },
|
11255 | |
11256 |
|
11257 |
|
11258 |
|
11259 |
|
11260 | videoRecord: function videoRecord() {
|
11261 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
11262 |
|
11263 | if (src_Device.platformVersion < '6.2.2') {
|
11264 | bridgeWaiqin_Bridge.showToast(window._seeds_lang['hint_video_record_version'] || '视频录制功能需要升级至6.2.2及以上的客户端', { mask: false });
|
11265 | return;
|
11266 | }
|
11267 | wq.wqjnc.videoRecord(function (res) {
|
11268 |
|
11269 | if (res.result === '1') {
|
11270 | if (params.success) params.success(res);
|
11271 | } else {
|
11272 | if (params.fail) params.fail({ errMsg: 'videoRecord:录制失败' });else bridgeWaiqin_Bridge.showToast(window._seeds_lang['hint_video_record_version'] || '录制失败', { mask: false });
|
11273 | }
|
11274 | }, JSON.stringify(params));
|
11275 | },
|
11276 | |
11277 |
|
11278 |
|
11279 |
|
11280 |
|
11281 | videoUpload: function videoUpload() {
|
11282 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
11283 |
|
11284 | if (src_Device.platformVersion < '6.2.2') {
|
11285 | bridgeWaiqin_Bridge.showToast(window._seeds_lang['hint_video_upload_version'] || '视频上传功能需要升级至6.2.2及以上的客户端', { mask: false });
|
11286 | return;
|
11287 | }
|
11288 | wq.wqjnc.videoUpload(function (res) {
|
11289 |
|
11290 | if (res.result === '1') {
|
11291 | if (params.success) params.success(res);
|
11292 | } else {
|
11293 | if (params.fail) params.fail({ errMsg: 'videoUpload:上传失败' });else bridgeWaiqin_Bridge.showToast(window._seeds_lang['hint_video_upload_failed'] || '上传失败', { mask: false });
|
11294 | }
|
11295 | }, JSON.stringify(params));
|
11296 | },
|
11297 | |
11298 |
|
11299 |
|
11300 |
|
11301 |
|
11302 | videoInfo: function videoInfo() {
|
11303 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
11304 |
|
11305 | if (src_Device.platformVersion < '6.2.2') {
|
11306 | bridgeWaiqin_Bridge.showToast(window._seeds_lang['hint_video_info_version'] || '视频功能需要升级至6.2.2及以上的客户端', { mask: false });
|
11307 | return;
|
11308 | }
|
11309 | wq.wqjnc.videoInfo(function (res) {
|
11310 |
|
11311 | if (res.result === '1') {
|
11312 | if (params.success) params.success(res);
|
11313 | } else {
|
11314 | if (params.fail) params.fail({ errMsg: 'videoInfo:' + (window._seeds_lang['hint_video_info_failed'] || '未查到此视频信息') });
|
11315 | }
|
11316 | }, JSON.stringify(params));
|
11317 | },
|
11318 | |
11319 |
|
11320 |
|
11321 |
|
11322 | scanQRCode: function scanQRCode() {
|
11323 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
11324 |
|
11325 | wq.wqhardware.getQrCode(function (res) {
|
11326 |
|
11327 | if (res && res.qrCode) {
|
11328 | var wqRes = res;
|
11329 | wqRes.resultStr = res.qrCode;
|
11330 | if (params && params.success) params.success(wqRes);
|
11331 | } else {
|
11332 | if (params.fail) params.fail({ errMsg: 'scanQRCode:' + (window._seeds_lang['hint_scan_failed'] || '扫码失败') + ', ' + (window._seeds_lang['hint_try_again_later'] || '请稍后重试') });else bridgeWaiqin_Bridge.showToast('scanQRCode:' + (window._seeds_lang['hint_scan_failed'] || '扫码失败') + ', ' + (window._seeds_lang['hint_try_again_later'] || '请稍后重试'), { mask: false });
|
11333 | }
|
11334 | });
|
11335 | },
|
11336 | |
11337 |
|
11338 |
|
11339 |
|
11340 |
|
11341 |
|
11342 |
|
11343 |
|
11344 |
|
11345 | |
11346 |
|
11347 |
|
11348 |
|
11349 |
|
11350 |
|
11351 |
|
11352 |
|
11353 |
|
11354 |
|
11355 |
|
11356 |
|
11357 |
|
11358 |
|
11359 |
|
11360 |
|
11361 |
|
11362 | getLocation: function getLocation() {
|
11363 | var _this2 = this;
|
11364 |
|
11365 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
11366 |
|
11367 |
|
11368 | var appLocation = src_DB.getCookie('app_location');
|
11369 | if (appLocation === 'undefined') {
|
11370 | src_DB.removeCookie('app_location');
|
11371 | appLocation = '';
|
11372 | }
|
11373 | try {
|
11374 | if (appLocation) appLocation = JSON.parse(appLocation);
|
11375 | } catch (error) {
|
11376 | appLocation = '';
|
11377 | }
|
11378 | if (appLocation) {
|
11379 | if (params.success) params.success(appLocation);
|
11380 | return;
|
11381 | }
|
11382 |
|
11383 |
|
11384 | if (this.locating) return;
|
11385 | this.locating = true;
|
11386 | console.log('调用定位...');
|
11387 |
|
11388 | wq.wqlocation.getLocationBackground(function (res) {
|
11389 |
|
11390 | _this2.locating = false;
|
11391 | if (res && res.wqLatitude) {
|
11392 |
|
11393 | var location = {
|
11394 | latitude: res.wqLatitude,
|
11395 | longitude: res.wqLongitude,
|
11396 | speed: null,
|
11397 | accuracy: res.radius,
|
11398 | address: res.wqAddress,
|
11399 | country: '中国',
|
11400 | province: res.province,
|
11401 | city: res.city,
|
11402 | area: res.district,
|
11403 | street: res.street
|
11404 |
|
11405 | };if (params.cache) src_DB.setCookie('app_location', JSON.stringify(location), params.cache || 60);
|
11406 | if (params.success) params.success(location);
|
11407 | } else {
|
11408 | if (params.fail) params.fail({ errMsg: 'getLocation: ' + (window._seeds_lang['hint_location_failed'] || '定位失败,请检查定位权限是否开启') });else bridgeWaiqin_Bridge.showToast(window._seeds_lang['hint_location_failed'] || '定位失败, 请检查定位权限是否开启', { mask: false });
|
11409 | }
|
11410 | }, JSON.stringify({ locationType: '1' }));
|
11411 | },
|
11412 | |
11413 |
|
11414 |
|
11415 |
|
11416 |
|
11417 |
|
11418 |
|
11419 |
|
11420 |
|
11421 |
|
11422 |
|
11423 |
|
11424 |
|
11425 |
|
11426 |
|
11427 |
|
11428 |
|
11429 |
|
11430 |
|
11431 | getLocationMap: function getLocationMap() {
|
11432 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
11433 |
|
11434 | wq.wqlocation.getLocationMap(function (res) {
|
11435 |
|
11436 | if (res && res.wqLatitude) {
|
11437 |
|
11438 | var location = {
|
11439 | latitude: res.wqLatitude,
|
11440 | longitude: res.wqLongitude,
|
11441 | speed: null,
|
11442 | accuracy: res.radius,
|
11443 | address: res.poiname || res.wqAddress,
|
11444 | country: '中国',
|
11445 | province: res.province,
|
11446 | city: res.city,
|
11447 | area: res.district,
|
11448 | street: res.street,
|
11449 | locationLie: res.mokelocation
|
11450 | };
|
11451 | if (params.success) params.success(location);
|
11452 | } else {
|
11453 | if (params.fail) params.fail({ errMsg: 'getLocationMap:' + (window._seeds_lang['hint_location_map_failed'] || '定位失败, 请检查外勤365定位权限是否开启') });else bridgeWaiqin_Bridge.showToast(window._seeds_lang['hint_location_map_failed'] || '定位失败, 请检查外勤365定位权限是否开启', { mask: false });
|
11454 | }
|
11455 | }, JSON.stringify(Object.assign({ editable: '1' }, params)));
|
11456 | },
|
11457 | |
11458 |
|
11459 |
|
11460 |
|
11461 |
|
11462 |
|
11463 |
|
11464 |
|
11465 |
|
11466 |
|
11467 |
|
11468 |
|
11469 |
|
11470 |
|
11471 |
|
11472 |
|
11473 |
|
11474 |
|
11475 |
|
11476 |
|
11477 |
|
11478 |
|
11479 |
|
11480 |
|
11481 |
|
11482 |
|
11483 |
|
11484 |
|
11485 |
|
11486 |
|
11487 |
|
11488 |
|
11489 | chooseImage: function chooseImage(argParams) {
|
11490 | var params = Object.clone(argParams);
|
11491 |
|
11492 | var operation = '2';
|
11493 | if (argParams && argParams.sourceType) {
|
11494 | if (argParams.sourceType.indexOf('album') >= 0 && argParams.sourceType.indexOf('camera') >= 0) {
|
11495 | operation = '2';
|
11496 | } else if (argParams.sourceType.indexOf('album') >= 0) {
|
11497 | operation = '1';
|
11498 | } else {
|
11499 | operation = '0';
|
11500 | }
|
11501 | params.operation = operation;
|
11502 | }
|
11503 |
|
11504 | var pwidth = null;
|
11505 | if (argParams && argParams.sizeType) {
|
11506 | if (!isNaN(argParams.sizeType)) {
|
11507 | pwidth = argParams.sizeType;
|
11508 | } else if (argParams.sizeType.indexOf('compressed') >= 0) {
|
11509 | pwidth = '750';
|
11510 | }
|
11511 | }
|
11512 | if (pwidth) params.pwidth = pwidth;
|
11513 |
|
11514 | var max = 5;
|
11515 | if (argParams && argParams.count) {
|
11516 | max = argParams.count;
|
11517 | params.max = '' + max;
|
11518 | }
|
11519 |
|
11520 | params.viewId = '' + new Date().getTime();
|
11521 | if (argParams && argParams.viewId) {
|
11522 | params.viewId = argParams.viewId;
|
11523 | }
|
11524 |
|
11525 | wq.wqphoto.getPhoto(function (result) {
|
11526 |
|
11527 | if (argParams && argParams.success) {
|
11528 |
|
11529 | var res = {
|
11530 | sourceType: operation === '0' ? 'camera' : 'album',
|
11531 | errMsg: 'chooseImage:ok',
|
11532 | results: result,
|
11533 | localIds: []
|
11534 |
|
11535 | };var imgMap = {};
|
11536 | for (var i = 0, item; item = result[i++];) {
|
11537 |
|
11538 | imgMap[item.name] = {
|
11539 | serverId: '',
|
11540 | name: item.name,
|
11541 | sourceType: res.sourceType,
|
11542 | base64: item.path,
|
11543 | src: item.src
|
11544 | };
|
11545 | res.localIds.push(item.name);
|
11546 | }
|
11547 | argParams.success(res, imgMap);
|
11548 | }
|
11549 | }, null, JSON.stringify(params));
|
11550 | },
|
11551 | |
11552 |
|
11553 |
|
11554 |
|
11555 |
|
11556 | uploadImage: function uploadImage() {
|
11557 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
11558 |
|
11559 | if (!params.dir) {
|
11560 | bridgeWaiqin_Bridge.showToast(window._seeds_lang['hint_upload_image_must_dir'] || '没有上传目录', { mask: false });
|
11561 | return;
|
11562 | }
|
11563 | if (!params.localIds || Object.isEmptyObject(params.localIds)) {
|
11564 | bridgeWaiqin_Bridge.showToast(window._seeds_lang['hint_upload_image_must_localIds'] || '没有上传图片地址', { mask: false });
|
11565 | return;
|
11566 | }
|
11567 |
|
11568 | var uploadParams = {
|
11569 | filePathList: params.localIds.map(function (item) {
|
11570 | if (params.isAI) {
|
11571 | return {
|
11572 | isAI: params.isAI,
|
11573 | path: item
|
11574 | };
|
11575 | }
|
11576 | return { path: item };
|
11577 | }),
|
11578 | url: params.dir
|
11579 | };
|
11580 | if (params.tenantId) uploadParams.tenantId = params.tenantId;
|
11581 | wq.wqphoto.startUpload(JSON.stringify(uploadParams));
|
11582 | },
|
11583 | |
11584 |
|
11585 |
|
11586 |
|
11587 |
|
11588 |
|
11589 |
|
11590 |
|
11591 |
|
11592 | previewImage: function previewImage(argParams) {
|
11593 | if (!argParams.urls || !argParams.urls.length) {
|
11594 | bridgeWaiqin_Bridge.showToast(window._seeds_lang['hint_preview_image_must_urls'] || '没有预览图片地址', { mask: false });
|
11595 | return;
|
11596 | }
|
11597 |
|
11598 | var position = 0;
|
11599 | if (argParams && argParams.index) position = argParams.index;
|
11600 |
|
11601 | var photos = [];
|
11602 | if (argParams && argParams.urls && argParams.urls.length) {
|
11603 | photos = argParams.urls.map(function (item) {
|
11604 | return {
|
11605 | path: item
|
11606 | };
|
11607 | });
|
11608 | }
|
11609 | var params = {
|
11610 | position: position,
|
11611 | photos: photos
|
11612 | };
|
11613 | wq.wqphoto.photoPreview(JSON.stringify(params));
|
11614 | },
|
11615 | |
11616 |
|
11617 |
|
11618 |
|
11619 | getContactMore: function getContactMore() {
|
11620 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
11621 |
|
11622 | wq.wqcontact.getContactMore(function (args) {
|
11623 |
|
11624 | if (params.success) params.success(args);
|
11625 | }, JSON.stringify(params));
|
11626 | },
|
11627 | getContact: function getContact() {
|
11628 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
11629 |
|
11630 | wq.wqcontact.getContact(function (args) {
|
11631 |
|
11632 | if (params.success) params.success(args);
|
11633 | }, JSON.stringify(params));
|
11634 | },
|
11635 | |
11636 |
|
11637 |
|
11638 |
|
11639 |
|
11640 |
|
11641 |
|
11642 |
|
11643 |
|
11644 |
|
11645 |
|
11646 | getCustomerMore: function getCustomerMore() {
|
11647 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
11648 |
|
11649 | wq.wqcustomer.getCustomerMore(function (args) {
|
11650 |
|
11651 | if (params.success) params.success(args);
|
11652 | }, JSON.stringify(Object.assign({ hiddenAdd: true }, params)));
|
11653 | },
|
11654 | getCustomer: function getCustomer() {
|
11655 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
11656 |
|
11657 | wq.wqcustomer.getCustomer(function (args) {
|
11658 |
|
11659 | if (params.success) params.success(args);
|
11660 | }, JSON.stringify(Object.assign({ hiddenAdd: true }, params)));
|
11661 | },
|
11662 | getCustomerType: function getCustomerType() {
|
11663 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
11664 |
|
11665 | wq.wqcustomer.getCustomerType(function (args) {
|
11666 |
|
11667 | if (params.success) params.success(args);
|
11668 | }, JSON.stringify(params));
|
11669 | },
|
11670 | getCustomerAreaMore: function getCustomerAreaMore() {
|
11671 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
11672 |
|
11673 | if (src_Device.platformVersion < '6.2.2') {
|
11674 | bridgeWaiqin_Bridge.showToast(window._seeds_lang['hint_get_customer_area_more_version'] || '此功能需要升级至6.2.2及以上的客户端', { mask: false });
|
11675 | return;
|
11676 | }
|
11677 | wq.wqcustomer.getCustomerAreaMore(function (args) {
|
11678 |
|
11679 | if (params.success) params.success(args);
|
11680 | }, JSON.stringify(params));
|
11681 | },
|
11682 | getCustomerArea: function getCustomerArea() {
|
11683 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
11684 |
|
11685 | wq.wqcustomer.getCustomerArea(function (args) {
|
11686 |
|
11687 | if (params.success) params.success(args);
|
11688 | }, JSON.stringify(params));
|
11689 | },
|
11690 | |
11691 |
|
11692 |
|
11693 |
|
11694 | getDepartmentMore: function getDepartmentMore() {
|
11695 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
11696 |
|
11697 | wq.wqdepartment.getDepartmentMore(function (args) {
|
11698 |
|
11699 | if (params.success) params.success(args);
|
11700 | }, JSON.stringify(params));
|
11701 | },
|
11702 | getDepartment: function getDepartment() {
|
11703 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
11704 |
|
11705 | wq.wqdepartment.getDepartment(function (args) {
|
11706 |
|
11707 | if (params.success) params.success(args);
|
11708 | }, JSON.stringify(params));
|
11709 | },
|
11710 | |
11711 |
|
11712 |
|
11713 |
|
11714 |
|
11715 |
|
11716 |
|
11717 |
|
11718 |
|
11719 |
|
11720 |
|
11721 |
|
11722 |
|
11723 |
|
11724 |
|
11725 | getGoods: function getGoods() {
|
11726 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
11727 |
|
11728 | wq.wqproduct.wqSelectSingleProduct(function (args) {
|
11729 |
|
11730 | if (params.success) params.success(args);
|
11731 | }, JSON.stringify(params));
|
11732 | },
|
11733 | |
11734 |
|
11735 |
|
11736 |
|
11737 | openNativePage: function openNativePage() {
|
11738 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { ios: {}, android: {} };
|
11739 |
|
11740 | if (!params.ios.url) {
|
11741 | bridgeWaiqin_Bridge.showToast(window._seeds_lang['hint_open_native_page_must_ios_url'] || 'ios参数url不能为空', { mask: false });
|
11742 | return;
|
11743 | }
|
11744 | if (!params.android.url) {
|
11745 | bridgeWaiqin_Bridge.showToast(window._seeds_lang['hint_open_native_page_must_android_url'] || 'android参数url不能为空', { mask: false });
|
11746 | return;
|
11747 | }
|
11748 | window.wq.wqload.wqOpenCustomerPager({
|
11749 | androidUIR: params.android.url,
|
11750 | androidParma: params.android.params,
|
11751 | IOSViewController: params.ios.url,
|
11752 | IOSParma: params.ios.params
|
11753 | });
|
11754 | },
|
11755 | |
11756 |
|
11757 |
|
11758 |
|
11759 |
|
11760 | Image: function Image() {
|
11761 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
11762 |
|
11763 | var s = this;
|
11764 | var msg = '';
|
11765 |
|
11766 | s.choose = function (args) {
|
11767 | var option = {
|
11768 | enableSafe: args.enableSafe || false,
|
11769 | max: args.max || 5,
|
11770 | currentCount: args.currentCount || 0,
|
11771 | sourceType: args.sourceType || ['album', 'camera'],
|
11772 | sizeType: args.sizeType || ['original', 'compressed'],
|
11773 | chooseOptions: args.chooseOptions || {}
|
11774 | |
11775 |
|
11776 |
|
11777 |
|
11778 | };var count = option.max - option.currentCount;
|
11779 | if (count <= 0) {
|
11780 | msg = (window._seeds_lang['hint_max_upload'] || '最多只能传') + option.max + (window._seeds_lang['photos'] || '张照片');
|
11781 | bridgeWaiqin_Bridge.showToast(msg);
|
11782 | return;
|
11783 | }
|
11784 |
|
11785 | if (option.enableSafe) count = 1;
|
11786 | bridgeWaiqin_Bridge.chooseImage(Object.assign({
|
11787 | count: count,
|
11788 | sizeType: option.sizeType,
|
11789 | sourceType: option.sourceType,
|
11790 | success: function success(res, imgMap) {
|
11791 | if (params.onChooseSuccess) params.onChooseSuccess(imgMap, res);
|
11792 | }
|
11793 | }, option.chooseOptions));
|
11794 | };
|
11795 | }
|
11796 | };
|
11797 |
|
11798 | var bridgeWaiqin = (bridgeWaiqin_Bridge);
|
11799 |
|
11800 |
|
11801 |
|
11802 |
|
11803 |
|
11804 |
|
11805 |
|
11806 | var Bridge_Bridge = {};
|
11807 | if (src_Device.platform === 'weixin') {
|
11808 | Bridge_Bridge = bridgeWeixin;
|
11809 | } else if (src_Device.platform === 'weixinwork') {
|
11810 | Bridge_Bridge = bridgeWeixin;
|
11811 | } else if (src_Device.platform === 'dinghuo') {
|
11812 | Bridge_Bridge = bridgeDinghuo;
|
11813 | Bridge_Bridge.config();
|
11814 | } else if (src_Device.platform === 'waiqin') {
|
11815 | Bridge_Bridge = bridgeWaiqin;
|
11816 | Bridge_Bridge.config();
|
11817 | } else {
|
11818 | Bridge_Bridge = bridgeBrowser;
|
11819 | }
|
11820 |
|
11821 | var src_Bridge_Bridge = (Bridge_Bridge);
|
11822 |
|
11823 |
|
11824 |
|
11825 | var src_Bridge = (src_Bridge_Bridge);
|
11826 |
|
11827 | var Button_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; };
|
11828 |
|
11829 | var Button_class, Button_temp;
|
11830 |
|
11831 | function Button_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
11832 |
|
11833 | function Button_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
11834 |
|
11835 | function Button_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
11836 |
|
11837 | function Button_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
11838 |
|
11839 |
|
11840 |
|
11841 |
|
11842 | var Button_Button = (Button_temp = Button_class = function (_Component) {
|
11843 | Button_inherits(Button, _Component);
|
11844 |
|
11845 | function Button(props) {
|
11846 | Button_classCallCheck(this, Button);
|
11847 |
|
11848 | var _this = Button_possibleConstructorReturn(this, _Component.call(this, props));
|
11849 |
|
11850 | _this.onClick = function (e) {
|
11851 | if (_this.props.onClick) _this.props.onClick(Object.getArgs(e, _this.props.args));
|
11852 | };
|
11853 |
|
11854 | _this.state = {};
|
11855 | return _this;
|
11856 | }
|
11857 |
|
11858 | Button.prototype.render = function render() {
|
11859 | var _this2 = this;
|
11860 |
|
11861 | var _props = this.props,
|
11862 | args = _props.args,
|
11863 | className = _props.className,
|
11864 | style = _props.style,
|
11865 | disabled = _props.disabled,
|
11866 | children = _props.children,
|
11867 | onClick = _props.onClick,
|
11868 | others = Button_objectWithoutProperties(_props, ['args', 'className', 'style', 'disabled', 'children', 'onClick']);
|
11869 |
|
11870 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
11871 | 'a',
|
11872 | Button_extends({ ref: function ref(el) {
|
11873 | _this2.$el = el;
|
11874 | }, className: 'button' + (className ? ' ' + className : ''), disabled: disabled, style: style, onClick: this.onClick }, others),
|
11875 | children
|
11876 | );
|
11877 | };
|
11878 |
|
11879 | return Button;
|
11880 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Button_class.propTypes = {
|
11881 | args: prop_types_default.a.any,
|
11882 | style: prop_types_default.a.object,
|
11883 | className: prop_types_default.a.string,
|
11884 | disabled: prop_types_default.a.bool,
|
11885 | onClick: prop_types_default.a.func,
|
11886 |
|
11887 | children: prop_types_default.a.node
|
11888 | }, Button_class.defaultProps = {}, Button_temp);
|
11889 |
|
11890 |
|
11891 |
|
11892 |
|
11893 | var src_Button = (Button_Button);
|
11894 |
|
11895 |
|
11896 | var instance_Calendar = function Calendar(container, params) {
|
11897 | if (!window._seeds_lang) window._seeds_lang = {};
|
11898 | |
11899 |
|
11900 |
|
11901 | var defaults = {
|
11902 | viewType: 'month',
|
11903 | disableBeforeDate: null,
|
11904 | disableAfterDate: null,
|
11905 | defaultDate: null,
|
11906 | threshold: '50',
|
11907 | duration: '300',
|
11908 | dateHeight: '40',
|
11909 | verticalDrag: true,
|
11910 |
|
11911 | titleFormat: 'YYYY-MM-DD',
|
11912 | showTitleWeek: false,
|
11913 | showTitleDay: false,
|
11914 |
|
11915 | calendarClass: 'calendar',
|
11916 | disableClass: 'calendar-disabled',
|
11917 |
|
11918 | headerClass: 'calendar-header',
|
11919 | titleClass: 'calendar-title',
|
11920 | prevClass: 'calendar-prev',
|
11921 | nextClass: 'calendar-next',
|
11922 | prevHTML: '<',
|
11923 | nextHTML: '>',
|
11924 |
|
11925 | weekContainerClass: 'calendar-day-box',
|
11926 | weekClass: 'calendar-day',
|
11927 |
|
11928 | wrapperClass: 'calendar-wrapper',
|
11929 | wrapperXClass: 'calendar-wrapper-x',
|
11930 | wrapperYClass: 'calendar-wrapper-y',
|
11931 | monthClass: 'calendar-month',
|
11932 | monthRowClass: 'calendar-monthrow',
|
11933 | dateClass: 'calendar-date',
|
11934 | dateNumClass: 'calendar-datenum',
|
11935 |
|
11936 |
|
11937 | currentClass: 'calendar-current',
|
11938 | notcurrentClass: 'calendar-notcurrent',
|
11939 | todayClass: 'calendar-today',
|
11940 | activeClass: 'calendar-active',
|
11941 | selectedClass: 'calendar-selected'
|
11942 |
|
11943 | |
11944 |
|
11945 |
|
11946 |
|
11947 |
|
11948 |
|
11949 |
|
11950 |
|
11951 |
|
11952 |
|
11953 | };
|
11954 | params = params || {};
|
11955 | for (var def in defaults) {
|
11956 | if (params[def] === undefined) {
|
11957 | params[def] = defaults[def];
|
11958 | }
|
11959 | }
|
11960 | var s = this;
|
11961 | s.params = params;
|
11962 | s.params.wrapperHeight = s.params.dateHeight * 6;
|
11963 |
|
11964 | Object.defineProperty(s.params, 'defaultDate', {
|
11965 | enumerable: true,
|
11966 | configurable: true,
|
11967 | writable: false
|
11968 | });
|
11969 |
|
11970 |
|
11971 | s.today = new Date();
|
11972 |
|
11973 | s.activeDate = new Date(s.params.defaultDate || null);
|
11974 |
|
11975 | s.selectedDate = new Date(s.params.defaultDate || null);
|
11976 |
|
11977 | s.container = typeof container === 'string' ? document.querySelector(container) : container;
|
11978 | if (!s.container) {
|
11979 | console.log('SeedsUI Error:未找到Calendar的DOM对象,请检查传入参数是否正确');
|
11980 | return;
|
11981 | }
|
11982 | s.container.width = s.container.clientWidth;
|
11983 | if (!s.container.width) s.container.width = window.innerWidth || document.documentElement.clientWidth;
|
11984 |
|
11985 | s.header = null;
|
11986 | s.title = null;
|
11987 | s.prev = null;
|
11988 | s.next = null;
|
11989 |
|
11990 | s.weekContainer = null;
|
11991 | s.weeks = [];
|
11992 |
|
11993 | s.wrapper = null;
|
11994 | s.wrapperX = null;
|
11995 | s.wrapperY = null;
|
11996 | s.months = new Array(3);
|
11997 | s.dates = [];
|
11998 |
|
11999 | s.touches = {
|
12000 | startX: 0,
|
12001 | startY: 0,
|
12002 | currentX: 0,
|
12003 | currentY: 0,
|
12004 | endX: 0,
|
12005 | endY: 0,
|
12006 | diffX: 0,
|
12007 | diffY: 0,
|
12008 | posX: 0,
|
12009 | posY: 0,
|
12010 | maxPosY: s.params.wrapperHeight - s.params.dateHeight,
|
12011 | h: s.params.wrapperHeight,
|
12012 | direction: 0,
|
12013 | horizontal: 0,
|
12014 | vertical: 0
|
12015 |
|
12016 | };s.createHeader = function () {
|
12017 | var header = document.createElement('div');
|
12018 | header.setAttribute('class', s.params.headerClass);
|
12019 | return header;
|
12020 | };
|
12021 | s.createPrev = function () {
|
12022 | var prev = document.createElement('div');
|
12023 | prev.setAttribute('class', s.params.prevClass);
|
12024 | prev.innerHTML = s.params.prevHTML;
|
12025 | return prev;
|
12026 | };
|
12027 | s.createNext = function () {
|
12028 | var next = document.createElement('div');
|
12029 | next.setAttribute('class', s.params.nextClass);
|
12030 | next.innerHTML = s.params.nextHTML;
|
12031 | return next;
|
12032 | };
|
12033 | s.createTitle = function () {
|
12034 | var title = document.createElement('div');
|
12035 | title.setAttribute('class', s.params.titleClass);
|
12036 | return title;
|
12037 | };
|
12038 |
|
12039 | s.createWeekContainer = function () {
|
12040 | var weekContainer = document.createElement('div');
|
12041 | weekContainer.setAttribute('class', s.params.weekContainerClass);
|
12042 |
|
12043 | var weekNames = ['日', '一', '二', '三', '四', '五', '六'];
|
12044 |
|
12045 | for (var i = 0, weekName; weekName = weekNames[i++];) {
|
12046 | var week = document.createElement('div');
|
12047 | week.setAttribute('class', s.params.weekClass);
|
12048 | week.innerHTML = weekName;
|
12049 | weekContainer.appendChild(week);
|
12050 | s.weeks.push(week);
|
12051 | }
|
12052 |
|
12053 |
|
12054 | return weekContainer;
|
12055 | };
|
12056 |
|
12057 | s.createWrapper = function () {
|
12058 | var wrapper = document.createElement('div');
|
12059 | wrapper.setAttribute('class', s.params.wrapperClass);
|
12060 | return wrapper;
|
12061 | };
|
12062 | s.createWrapperY = function () {
|
12063 | var wrapperY = document.createElement('div');
|
12064 | wrapperY.setAttribute('class', s.params.wrapperYClass);
|
12065 | return wrapperY;
|
12066 | };
|
12067 | s.createWrapperX = function () {
|
12068 | var wrapperX = document.createElement('div');
|
12069 | wrapperX.setAttribute('class', s.params.wrapperXClass);
|
12070 | wrapperX.width = s.container.width * 3;
|
12071 | wrapperX.style.width = s.container.width * 3 + 'px';
|
12072 | |
12073 |
|
12074 |
|
12075 |
|
12076 | for (var i = 0; i < 3; i++) {
|
12077 | s.months[i] = document.createElement('div');
|
12078 | s.months[i].setAttribute('class', s.params.monthClass);
|
12079 | s.months[i].style.width = s.container.width + 'px';
|
12080 | wrapperX.appendChild(s.months[i]);
|
12081 | }
|
12082 | return wrapperX;
|
12083 | };
|
12084 | s.createDates = function () {
|
12085 | for (var i = 0; i < 3; i++) {
|
12086 |
|
12087 | for (var j = 0; j < 6; j++) {
|
12088 |
|
12089 | var monthRow = document.createElement('div');
|
12090 | monthRow.setAttribute('class', s.params.monthRowClass);
|
12091 |
|
12092 | for (var k = 0; k < 7; k++) {
|
12093 |
|
12094 | var elDate = document.createElement('div');
|
12095 | elDate.setAttribute('class', s.params.dateClass);
|
12096 | elDate.style.height = s.params.dateHeight + 'px';
|
12097 | elDate.style.lineHeight = s.params.dateHeight + 'px';
|
12098 | var elDateNum = document.createElement('div');
|
12099 | elDateNum.setAttribute('class', s.params.dateNumClass);
|
12100 |
|
12101 | elDate.appendChild(elDateNum);
|
12102 | monthRow.appendChild(elDate);
|
12103 |
|
12104 | s.dates.push(elDateNum);
|
12105 | }
|
12106 | s.months[i].appendChild(monthRow);
|
12107 | }
|
12108 | }
|
12109 | };
|
12110 |
|
12111 | s.create = function () {
|
12112 |
|
12113 | if (s.container.querySelector('.' + s.params.headerClass)) {
|
12114 | s.header = s.container.querySelector('.' + s.params.headerClass);
|
12115 | s.prev = s.container.querySelector('.' + s.params.prevClass);
|
12116 | s.next = s.container.querySelector('.' + s.params.nextClass);
|
12117 | s.title = s.container.querySelector('.' + s.params.titleClass);
|
12118 | } else {
|
12119 | s.header = s.createHeader();
|
12120 | s.prev = s.createPrev();
|
12121 | s.next = s.createNext();
|
12122 | s.title = s.createTitle();
|
12123 |
|
12124 | s.header.appendChild(s.prev);
|
12125 | s.header.appendChild(s.title);
|
12126 | s.header.appendChild(s.next);
|
12127 | s.container.appendChild(s.header);
|
12128 | }
|
12129 |
|
12130 | if (s.container.querySelector('.' + s.params.weekContainerClass)) {
|
12131 | s.weekContainer = s.container.querySelector('.' + s.params.weekContainerClass);
|
12132 | } else {
|
12133 | s.weekContainer = s.createWeekContainer();
|
12134 |
|
12135 | s.container.appendChild(s.weekContainer);
|
12136 | }
|
12137 |
|
12138 | s.wrapper = s.createWrapper();
|
12139 | s.wrapperX = s.createWrapperX();
|
12140 | s.wrapperY = s.createWrapperY();
|
12141 | s.wrapperY.appendChild(s.wrapperX);
|
12142 | s.wrapper.appendChild(s.wrapperY);
|
12143 | s.container.appendChild(s.wrapper);
|
12144 | s.createDates();
|
12145 | };
|
12146 | s.create();
|
12147 | |
12148 |
|
12149 |
|
12150 |
|
12151 | s.addDuration = function () {
|
12152 | s.wrapper.style.webkitTransitionDuration = s.params.duration + 'ms';
|
12153 | s.wrapperY.style.webkitTransitionDuration = s.params.duration + 'ms';
|
12154 | s.wrapperX.style.webkitTransitionDuration = s.params.duration + 'ms';
|
12155 | };
|
12156 | s.removeDuration = function () {
|
12157 | s.wrapper.style.webkitTransitionDuration = '0ms';
|
12158 | s.wrapperY.style.webkitTransitionDuration = '0ms';
|
12159 | s.wrapperX.style.webkitTransitionDuration = '0ms';
|
12160 | };
|
12161 | s.updateTranslateX = function () {
|
12162 | s.removeDuration();
|
12163 | s.touches.posX = -s.container.width;
|
12164 | s.wrapperX.style.webkitTransform = 'translateX(' + s.touches.posX + 'px)';
|
12165 | };
|
12166 | s.updateContainerHeight = function () {
|
12167 |
|
12168 | if (s.params.viewType === 'month') {
|
12169 |
|
12170 | s.touches.h = s.params.wrapperHeight;
|
12171 | } else if (s.params.viewType === 'week') {
|
12172 |
|
12173 | s.touches.h = s.params.dateHeight;
|
12174 | }
|
12175 | s.wrapper.style.height = s.touches.h + 'px';
|
12176 | s.wrapperY.style.webkitTransform = 'translateY(-' + s.touches.posY + 'px)';
|
12177 | };
|
12178 | s.updateContainerWidth = function () {
|
12179 |
|
12180 | s.container.width = s.container.clientWidth;
|
12181 | s.wrapperX.width = s.container.width * 3 + 'px';
|
12182 | |
12183 |
|
12184 |
|
12185 |
|
12186 | for (var i = 0; i < 3; i++) {
|
12187 | s.months[i].style.width = s.container.width + 'px';
|
12188 | }
|
12189 | };
|
12190 | s.updateContainerSize = function () {
|
12191 | s.updateContainerHeight();
|
12192 | s.updateContainerWidth();
|
12193 | s.updateTranslateX();
|
12194 | };
|
12195 | s.updateClasses = function () {
|
12196 |
|
12197 | s.updateContainerHeight();
|
12198 |
|
12199 | s.updateTranslateX();
|
12200 | };
|
12201 | s.updateClasses();
|
12202 |
|
12203 | s.slideXTo = function (index) {
|
12204 | s.touches.posX = -s.container.width * index;
|
12205 | s.addDuration();
|
12206 | s.wrapperX.style.webkitTransform = 'translateX(' + s.touches.posX + 'px)';
|
12207 |
|
12208 | if (index === 0) {
|
12209 |
|
12210 | if (s.params.viewType === 'month') {
|
12211 | s.activeDate.prevMonth();
|
12212 | } else if (s.params.viewType === 'week') {
|
12213 | s.wrapperY.style.webkitTransitionDuration = '0ms';
|
12214 | s.activeDate.prevWeek();
|
12215 | }
|
12216 | } else if (index === 2) {
|
12217 |
|
12218 | if (s.params.viewType === 'month') {
|
12219 | s.activeDate.nextMonth();
|
12220 | } else if (s.params.viewType === 'week') {
|
12221 | s.wrapperY.style.webkitTransitionDuration = '0ms';
|
12222 | s.activeDate.nextWeek();
|
12223 | }
|
12224 | }
|
12225 | |
12226 |
|
12227 |
|
12228 |
|
12229 |
|
12230 |
|
12231 | s.draw();
|
12232 | };
|
12233 |
|
12234 | s.dragY = function (heightY) {
|
12235 | s.wrapper.style.height = heightY + 'px';
|
12236 | var translateY = s.params.wrapperHeight - heightY;
|
12237 | if (translateY <= s.touches.maxPosY) {
|
12238 | s.wrapperY.style.webkitTransform = 'translateY(-' + translateY + 'px)';
|
12239 | }
|
12240 | };
|
12241 | s.slideYTo = function (index) {
|
12242 | s.addDuration();
|
12243 | if (index === 1) {
|
12244 |
|
12245 | s.params.viewType = 'month';
|
12246 | s.touches.posY = 0;
|
12247 | s.draw(1);
|
12248 | } else if (index === -1) {
|
12249 |
|
12250 | s.params.viewType = 'week';
|
12251 | s.touches.posY = s.touches.maxPosY;
|
12252 | s.draw(-1);
|
12253 | } else {
|
12254 | s.dragY(s.touches.h);
|
12255 | }
|
12256 | };
|
12257 |
|
12258 | var today = new Date();
|
12259 | s.isToday = function (date) {
|
12260 | if (date.getDate() === today.getDate() && date.getMonth() === today.getMonth() && date.getFullYear() === today.getFullYear()) return true;
|
12261 | return false;
|
12262 | };
|
12263 | s.data = [];
|
12264 | s.updateData = function () {
|
12265 | s.data = s.activeDate.getCalendarData();
|
12266 | var activeRowIndex = s.data.activeRowIndex;
|
12267 | if (s.params.viewType === 'week') {
|
12268 | s.touches.maxPosY = activeRowIndex * s.params.dateHeight;
|
12269 | s.touches.posY = s.touches.maxPosY;
|
12270 | var prevWeek = s.activeDate.getPrevWeekData();
|
12271 | var nextWeek = s.activeDate.getNextWeekData();
|
12272 | var start1 = activeRowIndex * 7;
|
12273 | var start2 = start1 + 84;
|
12274 |
|
12275 | for (var i = 0, datIndex1 = start1; i < 7; i++) {
|
12276 | s.data[datIndex1] = prevWeek[i];
|
12277 | datIndex1++;
|
12278 | }
|
12279 |
|
12280 | for (var j = 0, datIndex2 = start2; j < 7; j++) {
|
12281 | s.data[datIndex2] = nextWeek[j];
|
12282 | datIndex2++;
|
12283 | }
|
12284 | }
|
12285 | };
|
12286 | s.drawHeader = function () {
|
12287 | var activeDate = s.activeDate;
|
12288 | var titleFormatStr = s.params.titleFormat;
|
12289 | if (titleFormatStr) {
|
12290 | s.title.innerHTML = activeDate.format(titleFormatStr);
|
12291 | } else {
|
12292 | activeDate.format('YYYY-MM-DD');
|
12293 | }
|
12294 | };
|
12295 | s.draw = function (vertical) {
|
12296 |
|
12297 |
|
12298 | s.updateData();
|
12299 |
|
12300 | var activeIndex = s.data.activeIndex;
|
12301 | for (var i = 0; i < s.dates.length; i++) {
|
12302 | s.dates[i].innerHTML = s.data[i].getDate();
|
12303 |
|
12304 | s.dates[i].index = i;
|
12305 |
|
12306 | s.dates[i].className = s.params.dateNumClass;
|
12307 |
|
12308 | if (s.data[i].isCurrent) s.dates[i].classList.add(s.params.currentClass);else s.dates[i].classList.add(s.params.notcurrentClass);
|
12309 |
|
12310 | if (s.isToday(s.data[i])) s.dates[i].classList.add(s.params.todayClass);
|
12311 |
|
12312 | if (i === activeIndex && s.activeDate) s.dates[i].classList.add(s.params.activeClass);
|
12313 |
|
12314 | if (s.data[i].toLocaleDateString() === s.selectedDate.toLocaleDateString()) {
|
12315 | s.dates[i].classList.add(s.params.selectedClass);
|
12316 | }
|
12317 |
|
12318 | if (s.params.disableBeforeDate && s.data[i].setHours(0, 0, 0, 0) < s.params.disableBeforeDate.setHours(0, 0, 0, 0)) {
|
12319 | s.dates[i].classList.add(s.params.disableClass);
|
12320 | }
|
12321 | if (s.params.disableAfterDate && s.data[i].setHours(0, 0, 0, 0) > s.params.disableAfterDate.setHours(0, 0, 0, 0)) {
|
12322 | s.dates[i].classList.add(s.params.disableClass);
|
12323 | }
|
12324 | }
|
12325 | s.updateContainerHeight();
|
12326 |
|
12327 | if (s.params.disableBeforeDate && s.activeDate < s.params.disableBeforeDate) {
|
12328 | var msg = '禁止访问' + s.params.disableBeforeDate.format('YYYY年MM月DD日') + '前的日期';
|
12329 | console.log('SeedsUI Warn:' + msg);
|
12330 | if (s.params.onError) s.params.onError(msg);
|
12331 | s.activeDate.nextMonth();
|
12332 | s.draw();
|
12333 | return;
|
12334 | }
|
12335 | if (s.params.disableAfterDate && s.activeDate > s.params.disableAfterDate) {
|
12336 | msg = '禁止访问' + s.params.disableAfterDate.format('YYYY年MM月DD日') + '后的日期';
|
12337 | console.log('SeedsUI Warn:' + msg);
|
12338 | if (s.params.onError) s.params.onError(msg);
|
12339 | s.activeDate.prevMonth();
|
12340 | s.draw();
|
12341 | return;
|
12342 | }
|
12343 |
|
12344 | s.drawHeader();
|
12345 | if (vertical) {
|
12346 | s.vertical = vertical;
|
12347 |
|
12348 | if (s.params.onHeightChange) s.params.onHeightChange(s);
|
12349 | } else {
|
12350 |
|
12351 | if (s.params.onChange) s.params.onChange(s);
|
12352 | }
|
12353 | };
|
12354 | s.draw();
|
12355 | s.setActiveDate = function (target) {
|
12356 | for (var i = 0; i < s.dates.length; i++) {
|
12357 | s.dates[i].classList.remove(s.params.activeClass);
|
12358 | s.dates[i].classList.remove(s.params.selectedClass);
|
12359 | }
|
12360 |
|
12361 | s.activeDate.setTime(s.data[target.index].getTime());
|
12362 | s.selectedDate.setTime(s.data[target.index].getTime());
|
12363 |
|
12364 | s.draw();
|
12365 | };
|
12366 | s.showMonth = function () {
|
12367 | s.slideYTo(1);
|
12368 | };
|
12369 | s.showWeek = function () {
|
12370 | s.slideYTo(-1);
|
12371 | };
|
12372 | s.setToday = function () {
|
12373 | s.activeDate.setTime(s.today.getTime());
|
12374 | s.draw();
|
12375 | };
|
12376 | s.setDefaultDate = function () {
|
12377 | if (!s.params.defaultDate) {
|
12378 | console.log('SeedsUI Warn: 没有设置defaultDate默认时间');
|
12379 | return;
|
12380 | }
|
12381 |
|
12382 | s.activeDate.setTime(s.params.defaultDate.getTime());
|
12383 |
|
12384 | s.draw();
|
12385 | };
|
12386 | |
12387 |
|
12388 |
|
12389 | s.events = function (detach) {
|
12390 | var action = detach ? 'removeEventListener' : 'addEventListener';
|
12391 | s.wrapper[action]('touchstart', s.onTouchStart, false);
|
12392 | s.wrapper[action]('touchmove', s.onTouchMove, false);
|
12393 | s.wrapper[action]('touchend', s.onTouchEnd, false);
|
12394 | s.wrapper[action]('touchcancel', s.onTouchEnd, false);
|
12395 | s.wrapper[action]('webkitTransitionEnd', s.onTransitionEnd, false);
|
12396 | s.wrapper[action]('click', s.onClick, false);
|
12397 |
|
12398 | s.prev[action]('click', s.onClickPrev, false);
|
12399 | s.next[action]('click', s.onClickNext, false);
|
12400 | };
|
12401 |
|
12402 | s.attach = function (event) {
|
12403 | s.events();
|
12404 | };
|
12405 | s.detach = function (event) {
|
12406 | s.events(true);
|
12407 | };
|
12408 | s.preventDefault = function (e) {
|
12409 | e.preventDefault();
|
12410 | };
|
12411 |
|
12412 | s.onClickPrev = function (e) {
|
12413 | s.slideXTo(0);
|
12414 | };
|
12415 | s.onClickNext = function (e) {
|
12416 | s.slideXTo(2);
|
12417 | };
|
12418 | s.onClick = function (e) {
|
12419 | s.target = e.target;
|
12420 |
|
12421 | if (e.target.classList.contains(s.params.disableClass)) return;
|
12422 |
|
12423 | s.removeDuration();
|
12424 | if (e.target.classList.contains(s.params.dateNumClass)) {
|
12425 | s.setActiveDate(e.target);
|
12426 | }
|
12427 |
|
12428 | if (s.params.onClick) s.params.onClick(s);
|
12429 | };
|
12430 | s.onTouchStart = function (e) {
|
12431 | e.stopPropagation();
|
12432 | s.container.addEventListener('touchmove', s.preventDefault, false);
|
12433 | s.touches.startX = e.touches[0].clientX;
|
12434 | s.touches.startY = e.touches[0].clientY;
|
12435 | };
|
12436 | s.onTouchMove = function (e) {
|
12437 | e.stopPropagation();
|
12438 | s.touches.currentX = e.touches[0].clientX;
|
12439 | s.touches.currentY = e.touches[0].clientY;
|
12440 | s.touches.diffX = s.touches.startX - s.touches.currentX;
|
12441 | s.touches.diffY = s.touches.startY - s.touches.currentY;
|
12442 |
|
12443 |
|
12444 | if (s.touches.direction === 0) {
|
12445 | s.touches.direction = Math.abs(s.touches.diffX) > Math.abs(s.touches.diffY) ? 1 : -1;
|
12446 | }
|
12447 |
|
12448 | if (s.touches.direction === 1) {
|
12449 |
|
12450 | var moveX = s.touches.posX - s.touches.diffX;
|
12451 | if (moveX < 0 && Math.abs(moveX) < s.container.width * 2) {
|
12452 |
|
12453 | s.touches.horizontal = moveX < s.touches.posX ? 1 : -1;
|
12454 | s.wrapperX.style.webkitTransform = 'translateX(' + moveX + 'px)';
|
12455 | }
|
12456 | } else if (s.touches.direction === -1) {
|
12457 |
|
12458 | if (s.params.verticalDrag === true) {
|
12459 |
|
12460 | var heightY = s.touches.h - s.touches.diffY;
|
12461 | if (heightY > s.params.dateHeight && heightY < s.params.wrapperHeight) {
|
12462 |
|
12463 | s.touches.vertical = heightY > s.touches.h ? 1 : -1;
|
12464 | s.dragY(heightY);
|
12465 | }
|
12466 | } else {
|
12467 | s.container.removeEventListener('touchmove', s.preventDefault, false);
|
12468 | }
|
12469 | }
|
12470 | };
|
12471 | s.onTouchEnd = function (e) {
|
12472 | e.stopPropagation();
|
12473 | if (s.touches.direction === 1) {
|
12474 |
|
12475 | if (Math.abs(s.touches.diffX) < s.params.threshold) s.touches.horizontal = 0;
|
12476 | if (s.touches.horizontal === 1) s.slideXTo(2);
|
12477 | else if (s.touches.horizontal === -1) s.slideXTo(0);
|
12478 | else s.slideXTo(1);
|
12479 | } else if (s.touches.direction === -1) {
|
12480 |
|
12481 | if (s.params.verticalDrag === true) {
|
12482 |
|
12483 | if (Math.abs(s.touches.diffY) < s.params.threshold) s.touches.vertical = 0;
|
12484 | if (s.touches.vertical === 1) s.slideYTo(1);
|
12485 | else if (s.touches.vertical === -1) s.slideYTo(-1);
|
12486 | else s.slideYTo(0);
|
12487 | }
|
12488 | }
|
12489 |
|
12490 |
|
12491 | s.touches.direction = 0;
|
12492 | s.touches.horizontal = 0;
|
12493 | s.touches.vertical = 0;
|
12494 | };
|
12495 | s.onTransitionEnd = function (e) {
|
12496 | s.target = e.target;
|
12497 |
|
12498 | if (s.target.classList.contains(s.params.wrapperXClass)) {
|
12499 |
|
12500 | s.updateTranslateX();
|
12501 |
|
12502 | if (s.params.onHorizontalTransitionEnd) s.params.onHorizontalTransitionEnd(s);
|
12503 | }
|
12504 |
|
12505 | if (s.target.classList.contains(s.params.wrapperYClass)) {
|
12506 |
|
12507 | if (s.params.onVerticalTransitionEnd) s.params.onVerticalTransitionEnd(s);
|
12508 | }
|
12509 |
|
12510 | if (s.params.onTransitionEnd) s.params.onTransitionEnd(s);
|
12511 | };
|
12512 | |
12513 |
|
12514 |
|
12515 | s.init = function () {
|
12516 | s.attach();
|
12517 | };
|
12518 | s.init();
|
12519 | };
|
12520 |
|
12521 | var Calendar_instance = (instance_Calendar);
|
12522 |
|
12523 | var Calendar_class, Calendar_temp;
|
12524 |
|
12525 | function Calendar_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
12526 |
|
12527 | function Calendar_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
12528 |
|
12529 | function Calendar_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
12530 |
|
12531 |
|
12532 |
|
12533 |
|
12534 |
|
12535 | var Calendar_Calendar = (Calendar_temp = Calendar_class = function (_Component) {
|
12536 | Calendar_inherits(Calendar, _Component);
|
12537 |
|
12538 | function Calendar(props) {
|
12539 | Calendar_classCallCheck(this, Calendar);
|
12540 |
|
12541 | return Calendar_possibleConstructorReturn(this, _Component.call(this, props));
|
12542 | }
|
12543 |
|
12544 | Calendar.prototype.componentDidMount = function componentDidMount() {
|
12545 | if (this.instance) return;
|
12546 | var _props = this.props,
|
12547 | type = _props.type,
|
12548 | titleFormat = _props.titleFormat,
|
12549 | disableBeforeDate = _props.disableBeforeDate,
|
12550 | disableAfterDate = _props.disableAfterDate,
|
12551 | verticalDrag = _props.verticalDrag,
|
12552 | defaultDate = _props.defaultDate,
|
12553 | prevHTML = _props.prevHTML,
|
12554 | nextHTML = _props.nextHTML,
|
12555 | onChange = _props.onChange,
|
12556 | onClick = _props.onClick,
|
12557 | onError = _props.onError;
|
12558 |
|
12559 | var instance = new Calendar_instance(this.$el, {
|
12560 | viewType: type,
|
12561 | titleFormat: titleFormat,
|
12562 |
|
12563 | disableBeforeDate: disableBeforeDate,
|
12564 | disableAfterDate: disableAfterDate,
|
12565 | verticalDrag: verticalDrag,
|
12566 | defaultDate: defaultDate,
|
12567 | prevHTML: prevHTML,
|
12568 | nextHTML: nextHTML,
|
12569 | onChange: onChange,
|
12570 | onClick: onClick,
|
12571 | onError: onError
|
12572 | });
|
12573 | this.instance = instance;
|
12574 | };
|
12575 |
|
12576 | Calendar.prototype.render = function render() {
|
12577 | var _this2 = this;
|
12578 |
|
12579 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { ref: function ref(el) {
|
12580 | _this2.$el = el;
|
12581 | }, className: 'calendar' });
|
12582 | };
|
12583 |
|
12584 | return Calendar;
|
12585 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Calendar_class.propTypes = {
|
12586 | type: prop_types_default.a.string,
|
12587 | titleFormat: prop_types_default.a.string,
|
12588 | disableBeforeDate: prop_types_default.a.object,
|
12589 | disableAfterDate: prop_types_default.a.object,
|
12590 | verticalDrag: prop_types_default.a.bool,
|
12591 | defaultDate: prop_types_default.a.object,
|
12592 | prevHTML: prop_types_default.a.string,
|
12593 | nextHTML: prop_types_default.a.string,
|
12594 | onChange: prop_types_default.a.func,
|
12595 | onClick: prop_types_default.a.func,
|
12596 | onError: prop_types_default.a.func
|
12597 | }, Calendar_class.defaultProps = {
|
12598 | type: 'month',
|
12599 | verticalDrag: true,
|
12600 | prevHTML: '<',
|
12601 | nextHTML: '>'
|
12602 | }, Calendar_temp);
|
12603 |
|
12604 |
|
12605 |
|
12606 |
|
12607 | var src_Calendar = (Calendar_Calendar);
|
12608 |
|
12609 | var Card_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; };
|
12610 |
|
12611 | var Card_class, Card_temp;
|
12612 |
|
12613 | function Card_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
12614 |
|
12615 | function Card_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
12616 |
|
12617 | function Card_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
12618 |
|
12619 | function Card_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
12620 |
|
12621 |
|
12622 |
|
12623 |
|
12624 | var Card_Card = (Card_temp = Card_class = function (_Component) {
|
12625 | Card_inherits(Card, _Component);
|
12626 |
|
12627 | function Card(props) {
|
12628 | Card_classCallCheck(this, Card);
|
12629 |
|
12630 | var _this = Card_possibleConstructorReturn(this, _Component.call(this, props));
|
12631 |
|
12632 | _this.onClick = function (e) {
|
12633 | if (_this.props.onClick) _this.props.onClick(Object.getArgs(e, _this.props.args));
|
12634 | };
|
12635 |
|
12636 | return _this;
|
12637 | }
|
12638 |
|
12639 | Card.prototype.render = function render() {
|
12640 | var _this2 = this;
|
12641 |
|
12642 | var _props = this.props,
|
12643 | args = _props.args,
|
12644 | children = _props.children,
|
12645 | className = _props.className,
|
12646 | onClick = _props.onClick,
|
12647 | others = Card_objectWithoutProperties(_props, ['args', 'children', 'className', 'onClick']);
|
12648 |
|
12649 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
12650 | 'div',
|
12651 | Card_extends({ ref: function ref(el) {
|
12652 | _this2.$el = el;
|
12653 | }, className: 'card' + (className ? ' ' + className : ''), onClick: this.onClick }, others),
|
12654 | children
|
12655 | );
|
12656 | };
|
12657 |
|
12658 | return Card;
|
12659 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Card_class.propTypes = {
|
12660 | args: prop_types_default.a.any,
|
12661 |
|
12662 | className: prop_types_default.a.string,
|
12663 | children: prop_types_default.a.node,
|
12664 | onClick: prop_types_default.a.func
|
12665 | }, Card_temp);
|
12666 |
|
12667 |
|
12668 |
|
12669 |
|
12670 | var src_Card = (Card_Card);
|
12671 |
|
12672 |
|
12673 |
|
12674 |
|
12675 | var instance_Carrousel = function Carrousel(container, params) {
|
12676 | function getPureChildren(children, className) {
|
12677 | var arr = [];
|
12678 | for (var i = 0; i < children.length; i++) {
|
12679 | if (children[i].classList.contains(className)) arr.push(children[i]);
|
12680 | }
|
12681 | return arr;
|
12682 | }
|
12683 | function getElementByParent(parent, selector) {
|
12684 | return typeof selector === 'string' && selector !== '' ? parent.querySelector(selector) : selector;
|
12685 | }
|
12686 |
|
12687 | |
12688 |
|
12689 |
|
12690 | var defaults = {
|
12691 | stopPropagation: true,
|
12692 | pagination: '.carrousel-pagination',
|
12693 | controlPrev: null,
|
12694 | controlNext: null,
|
12695 | autoplay: 0,
|
12696 | slidesPerView: 1,
|
12697 | threshold: '50',
|
12698 | duration: '300',
|
12699 | height: null,
|
12700 | width: null,
|
12701 | imglazyQuery: '.carrousel-lazy',
|
12702 | imgLoadAttr: 'data-load-src',
|
12703 |
|
12704 |
|
12705 | loop: false,
|
12706 | slideDuplicateClass: 'carrousel-slide-duplicate',
|
12707 |
|
12708 |
|
12709 | pageClass: 'carrousel-page',
|
12710 | wrapperClass: 'carrousel-wrapper',
|
12711 | slideClass: 'carrousel-slide',
|
12712 | slideActiveClass: 'active',
|
12713 | bulletClass: 'bullet',
|
12714 | bulletActiveClass: 'active',
|
12715 | controlPrevClass: 'carrousel-prev',
|
12716 | controlNextClass: 'carrousel-next'
|
12717 |
|
12718 | |
12719 |
|
12720 |
|
12721 |
|
12722 |
|
12723 |
|
12724 |
|
12725 | };
|
12726 | params = params || {};
|
12727 | for (var def in defaults) {
|
12728 | if (params[def] === undefined) {
|
12729 | params[def] = defaults[def];
|
12730 | }
|
12731 | }
|
12732 |
|
12733 | var s = this;
|
12734 |
|
12735 |
|
12736 | s.params = params;
|
12737 |
|
12738 |
|
12739 | s.container = getElementByParent(document, container);
|
12740 | if (!s.container) {
|
12741 | console.log('SeedsUI Error:未找到Slider的ID,请检查传入参数是否正确');
|
12742 | return;
|
12743 | }
|
12744 |
|
12745 |
|
12746 | s.wrapper = s.container.querySelector('.' + s.params.wrapperClass);
|
12747 |
|
12748 |
|
12749 | s.pagination = getElementByParent(s.container, s.params.pagination);
|
12750 | s.bullets = [];
|
12751 | s.updateBullets = function () {
|
12752 | if (!s.pagination) return;
|
12753 |
|
12754 | s.bullets = [];
|
12755 | s.pagination.innerHTML = '';
|
12756 |
|
12757 | for (var i = 0; i < s.slides.length; i++) {
|
12758 | var bullet = document.createElement('span');
|
12759 | bullet.setAttribute('class', s.params.bulletClass);
|
12760 | bullet.setAttribute('data-index', i);
|
12761 | s.pagination.appendChild(bullet);
|
12762 | s.bullets.push(bullet);
|
12763 | }
|
12764 | };
|
12765 |
|
12766 | s.controlPrev = getElementByParent(s.container, s.params.controlPrev);
|
12767 | s.controlNext = getElementByParent(s.container, s.params.controlNext);
|
12768 |
|
12769 | s.activeIndexTruth = 0;
|
12770 | s.max = 0;
|
12771 |
|
12772 | s.updateSlides = function () {
|
12773 | s.slides = getPureChildren(s.wrapper.children, s.params.slideClass);
|
12774 | };
|
12775 |
|
12776 | s.dupSlides = [];
|
12777 | s.createLoop = function () {
|
12778 | if (!s.params.loop) return;
|
12779 |
|
12780 | s.destroyLoop();
|
12781 | var beforeDupSlides = [];
|
12782 | var afterDupSlides = [];
|
12783 |
|
12784 | if (s.params.slidesPerView > s.slides.length) return;
|
12785 | var i;
|
12786 | var dup;
|
12787 | s.slides.forEach(function (n, i, a) {
|
12788 | if (i < s.params.slidesPerView) afterDupSlides.push(n.cloneNode(true));
|
12789 | if (i < s.slides.length && i >= s.slides.length - s.params.slidesPerView) beforeDupSlides.push(n.cloneNode(true));
|
12790 | });
|
12791 | for (i = 0; i < afterDupSlides.length; i++) {
|
12792 | dup = s.wrapper.appendChild(afterDupSlides[i]);
|
12793 | dup.classList.add(s.params.slideDuplicateClass);
|
12794 | dup.classList.remove(s.params.slideClass);
|
12795 | }
|
12796 | for (i = beforeDupSlides.length - 1; i >= 0; i--) {
|
12797 | dup = s.wrapper.insertBefore(beforeDupSlides[i], s.wrapper.firstElementChild);
|
12798 | dup.classList.add(s.params.slideDuplicateClass);
|
12799 | dup.classList.remove(s.params.slideClass);
|
12800 | }
|
12801 | s.activeIndexTruth = s.params.slidesPerView;
|
12802 | s.dupSlides = beforeDupSlides.concat(afterDupSlides);
|
12803 | };
|
12804 | s.destroyLoop = function () {
|
12805 | var slideDuplicate = getPureChildren(s.wrapper.children, s.params.slideDuplicateClass);
|
12806 |
|
12807 |
|
12808 | for (var i = 0, slideDu; slideDu = slideDuplicate[i++];) {
|
12809 | s.wrapper.removeChild(slideDu);
|
12810 | }
|
12811 |
|
12812 | };
|
12813 |
|
12814 | s.touches = {
|
12815 | direction: 0,
|
12816 | vertical: 0,
|
12817 | horizontal: 0,
|
12818 | startX: 0,
|
12819 | startY: 0,
|
12820 | currentX: 0,
|
12821 | currentY: 0,
|
12822 | endX: 0,
|
12823 | endY: 0,
|
12824 | diffX: 0,
|
12825 | diffY: 0,
|
12826 | posX: 0
|
12827 | |
12828 |
|
12829 |
|
12830 | };s.activeIndex = s.activeIndexTruth;
|
12831 |
|
12832 | s.updateClasses = function () {
|
12833 | s.activeIndex = s.activeIndexTruth;
|
12834 | if (s.params.loop) {
|
12835 | s.activeIndex = s.activeIndexTruth - s.params.slidesPerView;
|
12836 | if (s.max - s.params.slidesPerView === s.activeIndexTruth) {
|
12837 |
|
12838 | s.activeIndex = 0;
|
12839 | }
|
12840 | if (s.activeIndex < 0) {
|
12841 |
|
12842 | s.activeIndex = s.slides.length + s.activeIndex;
|
12843 | }
|
12844 | }
|
12845 | var i;
|
12846 |
|
12847 | for (i = 0; i < s.slides.length; i++) {
|
12848 | s.slides[i].classList.remove(s.params.slideActiveClass);
|
12849 | }
|
12850 | s.slides[s.activeIndex].classList.add(s.params.slideActiveClass);
|
12851 |
|
12852 |
|
12853 | if (!s.pagination) return;
|
12854 | for (i = 0; i < s.bullets.length; i++) {
|
12855 | s.bullets[i].classList.remove(s.params.bulletActiveClass);
|
12856 | }
|
12857 | s.bullets[s.activeIndex].classList.add(s.params.bulletActiveClass);
|
12858 | };
|
12859 | s.updateWidth = function () {
|
12860 | if (s.params.width && !isNaN(s.params.width)) {
|
12861 | s.width = s.params.width;
|
12862 | } else if (/(\d+)px/.test(s.params.width)) {
|
12863 | s.width = /(\d+)px/.exec(s.params.width)[1];
|
12864 | } else if (/(\d+)px/.test(s.container.style.width)) {
|
12865 | s.width = /(\d+)px/.exec(s.container.style.width)[1];
|
12866 | } else {
|
12867 | s.width = s.container.clientWidth ? s.container.clientWidth : src_Device.screenWidth;
|
12868 | }
|
12869 | s.container.style.width = s.width + 'px';
|
12870 |
|
12871 | s.slideWidth = Math.floor(s.width / s.params.slidesPerView);
|
12872 |
|
12873 |
|
12874 | s.wrapperWidth = s.slideWidth * s.max;
|
12875 | s.wrapper.style.width = s.wrapperWidth + 'px';
|
12876 |
|
12877 |
|
12878 | s.slides.forEach(function (n, i, a) {
|
12879 | n.style.width = s.slideWidth + 'px';
|
12880 | });
|
12881 |
|
12882 |
|
12883 | s.dupSlides.forEach(function (n, i, a) {
|
12884 | n.style.width = s.slideWidth + 'px';
|
12885 | });
|
12886 | };
|
12887 | s.updateHeight = function () {
|
12888 | if (s.params.height && !isNaN(s.params.height)) {
|
12889 | s.height = s.params.height;
|
12890 | } else if (/(\d+)px/.test(s.params.height)) {
|
12891 | s.height = /(\d+)px/.exec(s.params.height)[1];
|
12892 | } else if (/(\d+)px/.test(s.container.style.height)) {
|
12893 | s.height = /(\d+)px/.exec(s.container.style.height)[1];
|
12894 | } else if (s.container.classList.contains(s.params.pageClass)) {
|
12895 |
|
12896 | s.height = null;
|
12897 | } else {
|
12898 |
|
12899 | s.height = s.container.clientHeight ? s.container.clientHeight : s.wrapper.clientHeight;
|
12900 | }
|
12901 | if (!s.height) return;
|
12902 |
|
12903 | s.container.style.height = s.height + 'px';
|
12904 |
|
12905 | s.wrapper.style.height = s.height + 'px';
|
12906 |
|
12907 | s.slides.forEach(function (n, i, a) {
|
12908 | n.style.height = s.height + 'px';
|
12909 | });
|
12910 |
|
12911 | s.dupSlides.forEach(function (n, i, a) {
|
12912 | n.style.height = s.height + 'px';
|
12913 | });
|
12914 | };
|
12915 |
|
12916 | s.updateContainerSize = function () {
|
12917 | s.max = parseInt(s.slides.length, 10) + parseInt(s.dupSlides.length, 10);
|
12918 |
|
12919 | s.updateWidth();
|
12920 |
|
12921 |
|
12922 | s.updateHeight();
|
12923 |
|
12924 |
|
12925 | s.updateClasses();
|
12926 |
|
12927 |
|
12928 | if (s.params.loop) {
|
12929 | moveToIndex(0);
|
12930 | }
|
12931 | };
|
12932 |
|
12933 | var imgs = [];
|
12934 | var cacheImgs = [];
|
12935 | function imgLoad(e) {
|
12936 | var target = e.target;
|
12937 | var imgTarget = imgs[target.index];
|
12938 | if (!imgTarget) return;
|
12939 | if (imgTarget.tagName === 'IMG') {
|
12940 | imgTarget.src = target.src;
|
12941 | } else {
|
12942 | imgTarget.style.backgroundImage = 'url(' + target.src + ')';
|
12943 | }
|
12944 | }
|
12945 | s.updateLazyImg = function () {
|
12946 | imgs = this.container.querySelectorAll(s.params.imglazyQuery);
|
12947 | for (var i = 0; i < imgs.length; i++) {
|
12948 | var src = imgs[i].getAttribute(s.params.imgLoadAttr);
|
12949 | cacheImgs[i] = new Image();
|
12950 | cacheImgs[i].index = i;
|
12951 | cacheImgs[i].src = src;
|
12952 | cacheImgs[i].addEventListener('load', imgLoad, false);
|
12953 | }
|
12954 | };
|
12955 |
|
12956 |
|
12957 | s.update = function () {
|
12958 | s.updateSlides();
|
12959 | s.updateBullets();
|
12960 | s.createLoop();
|
12961 | s.updateContainerSize();
|
12962 | if (s.params.imglazyQuery) s.updateLazyImg();
|
12963 | };
|
12964 | s.update();
|
12965 | if (s.slides.length <= 0) {
|
12966 | return;
|
12967 | }
|
12968 | |
12969 |
|
12970 |
|
12971 |
|
12972 | s.isSupportTouch = 'ontouchstart' in window;
|
12973 | s.events = function (detach) {
|
12974 | var touchTarget = s.container;
|
12975 | var action = detach ? 'removeEventListener' : 'addEventListener';
|
12976 |
|
12977 | if (s.isSupportTouch) {
|
12978 | touchTarget[action]('touchstart', s.onTouchStart, false);
|
12979 | touchTarget[action]('touchmove', s.onTouchMove, false);
|
12980 | touchTarget[action]('touchend', s.onTouchEnd, false);
|
12981 | touchTarget[action]('touchcancel', s.onTouchEnd, false);
|
12982 | } else {
|
12983 | touchTarget[action]('click', s.onClick, false);
|
12984 | }
|
12985 | };
|
12986 |
|
12987 | s.attach = function (event) {
|
12988 | s.events();
|
12989 | };
|
12990 | s.detach = function (event) {
|
12991 | s.events(true);
|
12992 | };
|
12993 | |
12994 |
|
12995 |
|
12996 | function preventDefault(e) {
|
12997 | e.preventDefault();
|
12998 | }
|
12999 | s.onTouchStart = function (e) {
|
13000 | if (s.params.stopPropagation) e.stopPropagation();
|
13001 | s.container.addEventListener('touchmove', preventDefault, false);
|
13002 | s.touches.startX = e.clientX || e.touches[0].clientX;
|
13003 | s.touches.startY = e.clientY || e.touches[0].clientY;
|
13004 |
|
13005 | s.stopAutoplay();
|
13006 | };
|
13007 | s.onTouchMove = function (e) {
|
13008 | if (s.params.stopPropagation) e.stopPropagation();
|
13009 | s.touches.currentX = e.clientX || e.touches[0].clientX;
|
13010 | s.touches.currentY = e.clientY || e.touches[0].clientY;
|
13011 | s.touches.diffX = s.touches.startX - s.touches.currentX;
|
13012 | s.touches.diffY = s.touches.startY - s.touches.currentY;
|
13013 |
|
13014 | if (s.params.onSlideChange) s.params.onSlideChange(s);
|
13015 |
|
13016 |
|
13017 | if (s.touches.direction === 0) {
|
13018 |
|
13019 | s.touches.direction = Math.abs(s.touches.diffX) > Math.abs(s.touches.diffY) ? 1 : -1;
|
13020 | }
|
13021 | if (s.touches.direction === -1) {
|
13022 |
|
13023 | s.touches.vertical = s.touches.diffY < 0 ? 1 : -1;
|
13024 | }
|
13025 | if (s.touches.direction === 1) {
|
13026 |
|
13027 | s.touches.horizontal = s.touches.diffX < 0 ? 1 : -1;
|
13028 | }
|
13029 |
|
13030 |
|
13031 | if (s.touches.vertical !== 0) {
|
13032 | s.container.removeEventListener('touchmove', preventDefault, false);
|
13033 | return;
|
13034 | }
|
13035 |
|
13036 |
|
13037 | var moveX = s.touches.posX - s.touches.diffX;
|
13038 |
|
13039 | if (moveX > 0 || Number(-moveX) + Number(s.width) >= s.wrapperWidth) {
|
13040 | return;
|
13041 | }
|
13042 | s.wrapper.style.webkitTransform = 'translate(' + moveX + 'px,0px)';
|
13043 | };
|
13044 | s.onTouchEnd = function (e) {
|
13045 | if (s.params.stopPropagation) e.stopPropagation();
|
13046 |
|
13047 | s.touches.endX = e.clientX || e.changedTouches[0].clientX;
|
13048 | s.touches.endY = e.clientY || e.changedTouches[0].clientY;
|
13049 |
|
13050 |
|
13051 | if (Math.abs(s.touches.startX - s.touches.endX) < 6 && Math.abs(s.touches.startY - s.touches.endY) < 6) {
|
13052 | if (s.params.onClick) s.params.onClick(s, e);
|
13053 |
|
13054 | } else if (s.touches.direction === 1) {
|
13055 | if (s.touches.diffX > s.params.threshold) {
|
13056 |
|
13057 | s.activeIndexTruth++;
|
13058 | } else if (s.touches.diffX < -s.params.threshold) {
|
13059 |
|
13060 | s.activeIndexTruth--;
|
13061 | }
|
13062 | s.slideTo(s.activeIndexTruth);
|
13063 | }
|
13064 |
|
13065 |
|
13066 | s.touches.direction = 0;
|
13067 | s.touches.vertical = 0;
|
13068 | s.touches.horizontal = 0;
|
13069 |
|
13070 |
|
13071 | s.startAutoplay();
|
13072 | };
|
13073 | s.onClick = function (e) {
|
13074 | e.stopPropagation();
|
13075 | if (e.target.classList.contains(s.params.bulletClass)) {
|
13076 | s.onClickBullet(e);
|
13077 | } else if (e.target.classList.contains(s.params.controlPrevClass)) {
|
13078 | s.onClickPrev(e);
|
13079 | } else if (e.target.classList.contains(s.params.controlNextClass)) {
|
13080 | s.onClickNext(e);
|
13081 | } else {
|
13082 | if (s.params.onClick) s.params.onClick(s, e);
|
13083 | }
|
13084 | };
|
13085 | s.onClickBullet = function (e) {
|
13086 | var index = Number(e.target.getAttribute('data-index')) || 0;
|
13087 |
|
13088 | if (s.params.loop) {
|
13089 | index += s.params.slidesPerView;
|
13090 | }
|
13091 | s.slideTo(index);
|
13092 | };
|
13093 | s.onClickPrev = function (e) {
|
13094 | s.slideTo(s.activeIndexTruth - 1);
|
13095 | };
|
13096 | s.onClickNext = function (e) {
|
13097 | s.slideTo(s.activeIndexTruth + 1);
|
13098 | };
|
13099 | |
13100 |
|
13101 |
|
13102 | s.startAutoplay = function () {
|
13103 | if (!s.params.autoplay) return;
|
13104 | s.autoplayer = window.setInterval(function () {
|
13105 | s.activeIndexTruth++;
|
13106 | if (s.activeIndexTruth >= s.max) {
|
13107 | s.activeIndexTruth = 0;
|
13108 | }
|
13109 | s.slideTo(s.activeIndexTruth);
|
13110 | }, s.params.autoplay);
|
13111 | };
|
13112 |
|
13113 | s.stopAutoplay = function (internal) {
|
13114 | if (s.autoplayer) {
|
13115 | window.clearInterval(s.autoplayer);
|
13116 | }
|
13117 | };
|
13118 |
|
13119 | |
13120 |
|
13121 |
|
13122 | function moveToIndex(speed) {
|
13123 | s.wrapper.style.webkitTransitionDuration = speed + 'ms';
|
13124 | s.touches.posX = -s.activeIndexTruth * s.slideWidth;
|
13125 | s.wrapper.style.webkitTransform = 'translate(' + s.touches.posX + 'px,0px)';
|
13126 | }
|
13127 | s.slideTo = function (slideIndex, speed, runCallbacks) {
|
13128 | var duration = isNaN(speed) ? s.params.duration : speed;
|
13129 | if (slideIndex >= 0) {
|
13130 | s.activeIndexTruth = slideIndex;
|
13131 | }
|
13132 |
|
13133 | if (s.activeIndexTruth < 0) {
|
13134 | s.activeIndexTruth = 0;
|
13135 | }
|
13136 |
|
13137 | if (s.activeIndexTruth > s.max - 1) {
|
13138 | s.activeIndexTruth = s.max - 1;
|
13139 | }
|
13140 |
|
13141 | if (s.params.slidesPerView > 1 && s.activeIndexTruth > s.max - params.slidesPerView) {
|
13142 | s.activeIndexTruth = s.max - s.params.slidesPerView;
|
13143 | }
|
13144 |
|
13145 |
|
13146 | s.updateClasses();
|
13147 |
|
13148 | moveToIndex(duration);
|
13149 |
|
13150 | setTimeout(function () {
|
13151 | s.wrapper.style.webkitTransitionDuration = '0ms';
|
13152 |
|
13153 | s.target = s.slides[s.activeIndexTruth];
|
13154 | if (s.params.onSlideChangeEnd && runCallbacks !== false) s.params.onSlideChangeEnd(s);
|
13155 |
|
13156 | if (s.params.loop) {
|
13157 | if (s.touches.posX === 0) {
|
13158 | s.activeIndexTruth = s.max - s.params.slidesPerView * 2;
|
13159 |
|
13160 | moveToIndex(0);
|
13161 | return;
|
13162 | }
|
13163 | if (Number(-s.touches.posX) + Number(s.width) >= Number(s.wrapperWidth)) {
|
13164 | s.activeIndexTruth = s.params.slidesPerView;
|
13165 |
|
13166 | moveToIndex(0);
|
13167 | return;
|
13168 | }
|
13169 | }
|
13170 | }, duration);
|
13171 | };
|
13172 |
|
13173 | s.setParams = function (params) {
|
13174 | for (var n in params) {
|
13175 | s.params[n] = params[n];
|
13176 | }
|
13177 | };
|
13178 |
|
13179 | s.init = function () {
|
13180 |
|
13181 | s.attach();
|
13182 | if (s.params.autoplay) s.startAutoplay();
|
13183 |
|
13184 | s.target = s.slides[s.activeIndexTruth];
|
13185 | if (s.params.onInit) s.params.onInit(s);
|
13186 | };
|
13187 |
|
13188 | s.init();
|
13189 |
|
13190 | return s;
|
13191 | };
|
13192 |
|
13193 |
|
13194 |
|
13195 |
|
13196 |
|
13197 |
|
13198 | var Carrousel_instance = (instance_Carrousel);
|
13199 |
|
13200 | var Carrousel_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; };
|
13201 |
|
13202 | var Carrousel_class, Carrousel_temp;
|
13203 |
|
13204 | function Carrousel_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
13205 |
|
13206 | function Carrousel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
13207 |
|
13208 | function Carrousel_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
13209 |
|
13210 | function Carrousel_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
13211 |
|
13212 |
|
13213 |
|
13214 |
|
13215 |
|
13216 | var Carrousel_Carrousel = (Carrousel_temp = Carrousel_class = function (_Component) {
|
13217 | Carrousel_inherits(Carrousel, _Component);
|
13218 |
|
13219 | function Carrousel(props) {
|
13220 | Carrousel_classCallCheck(this, Carrousel);
|
13221 |
|
13222 | var _this = Carrousel_possibleConstructorReturn(this, _Component.call(this, props));
|
13223 |
|
13224 | _this.componentDidUpdate = function (prevProps) {
|
13225 | if (_this.instance && _this.instance.activeIndex !== _this.props.activeIndex) {
|
13226 | _this.instance.slideTo(_this.props.activeIndex, _this.props.speed, _this.props.enableOnChange);
|
13227 | }
|
13228 | if (_this.props.stopPropagation !== prevProps.stopPropagation) {
|
13229 | _this.instance.setParams({ stopPropagation: _this.props.stopPropagation });
|
13230 | }
|
13231 | if (!_this.props.list.equals(prevProps.list)) {
|
13232 | _this.update();
|
13233 | }
|
13234 | };
|
13235 |
|
13236 | _this.componentDidMount = function () {
|
13237 | _this.instance();
|
13238 |
|
13239 | if (!(_this.props.style && _this.props.style.height) && _this.props.list.length && _this.props.delay) {
|
13240 | setTimeout(function () {
|
13241 | _this.instance.updateContainerSize();
|
13242 | }, _this.props.delay);
|
13243 | }
|
13244 | };
|
13245 |
|
13246 | _this.instance = function () {
|
13247 | var instance = new Carrousel_instance(_this.$el, {
|
13248 | height: _this.props.style && _this.props.style.height ? _this.props.style.height : null,
|
13249 | width: _this.props.style && _this.props.style.width ? _this.props.style.width : null,
|
13250 | stopPropagation: _this.props.stopPropagation,
|
13251 | autoplay: _this.props.autoplay,
|
13252 | slidesPerView: _this.props.slidesPerView,
|
13253 | loop: _this.props.loop,
|
13254 | onClick: _this.onClick,
|
13255 | onSlideChangeEnd: _this.props.onChange ? _this.props.onChange : null
|
13256 | });
|
13257 | _this.instance = instance;
|
13258 | };
|
13259 |
|
13260 | _this.onClick = function (s, e) {
|
13261 | var index = s.activeIndex;
|
13262 | if (_this.props.onClick) _this.props.onClick(_this.props.list[index], index, s, e);
|
13263 | };
|
13264 |
|
13265 | _this.getCarrouselClassName = function () {
|
13266 | var _this$props = _this.props,
|
13267 | className = _this$props.className,
|
13268 | list = _this$props.list;
|
13269 |
|
13270 | if (className) {
|
13271 | if (className.indexOf('carrousel-container') !== -1 || className.indexOf('carrousel-page') !== -1) {
|
13272 | return className;
|
13273 | }
|
13274 | }
|
13275 | return (list.length > 0 ? 'carrousel-container' : 'carrousel-page') + (className ? ' ' + className : '');
|
13276 | };
|
13277 |
|
13278 | _this.getSlideStyle = function (item) {
|
13279 | var slideParams = _this.props.slideParams;
|
13280 |
|
13281 | if (item.bg) {
|
13282 | return Object.assign({ backgroundImage: 'url(' + _this.props.defaultSrc + ')' }, slideParams.style);
|
13283 | }
|
13284 | return slideParams.style;
|
13285 | };
|
13286 |
|
13287 | _this.update = function () {
|
13288 |
|
13289 | var imgs = _this.$el.querySelectorAll('.carrousel-lazy');
|
13290 | for (var i = 0; i < imgs.length; i++) {
|
13291 | var imgTarget = imgs[i];
|
13292 | if (!imgTarget) continue;
|
13293 | if (imgTarget.tagName === 'IMG') {
|
13294 | imgTarget.src = _this.props.defaultSrc;
|
13295 | } else {
|
13296 | imgTarget.style.backgroundImage = 'url(' + _this.props.defaultSrc + ')';
|
13297 | }
|
13298 | }
|
13299 |
|
13300 | if (_this.instance) _this.instance.update();
|
13301 | };
|
13302 |
|
13303 | return _this;
|
13304 | }
|
13305 |
|
13306 | Carrousel.prototype.render = function render() {
|
13307 | var _this2 = this;
|
13308 |
|
13309 | var _props = this.props,
|
13310 | className = _props.className,
|
13311 | style = _props.style,
|
13312 | slideParams = _props.slideParams,
|
13313 | pagination = _props.pagination,
|
13314 | paginationParams = _props.paginationParams,
|
13315 | prevParams = _props.prevParams,
|
13316 | nextParams = _props.nextParams,
|
13317 | stopPropagation = _props.stopPropagation,
|
13318 | activeIndex = _props.activeIndex,
|
13319 | loop = _props.loop,
|
13320 | autoplay = _props.autoplay,
|
13321 | slidesPerView = _props.slidesPerView,
|
13322 | defaultSrc = _props.defaultSrc,
|
13323 | list = _props.list,
|
13324 | enableOnChange = _props.enableOnChange,
|
13325 | speed = _props.speed,
|
13326 | onClick = _props.onClick,
|
13327 | onChange = _props.onChange,
|
13328 | delay = _props.delay,
|
13329 | children = _props.children,
|
13330 | others = Carrousel_objectWithoutProperties(_props, ['className', 'style', 'slideParams', 'pagination', 'paginationParams', 'prevParams', 'nextParams', 'stopPropagation', 'activeIndex', 'loop', 'autoplay', 'slidesPerView', 'defaultSrc', 'list', 'enableOnChange', 'speed', 'onClick', 'onChange', 'delay', 'children']);
|
13331 |
|
13332 | var childrenArr = external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.Children.toArray(children);
|
13333 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
13334 | 'div',
|
13335 | Carrousel_extends({ ref: function ref(el) {
|
13336 | _this2.$el = el;
|
13337 | }, className: this.getCarrouselClassName(), style: style }, others),
|
13338 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
13339 | 'div',
|
13340 | { className: 'carrousel-wrapper' },
|
13341 | list.length > 0 && list.map(function (item, index) {
|
13342 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
13343 | 'div',
|
13344 | { className: 'carrousel-slide' + (slideParams.className ? ' ' + slideParams.className : '') + (item.bg ? ' carrousel-lazy' : ''), style: _this2.getSlideStyle(item), key: index, 'data-load-src': item.bg },
|
13345 | item.img && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('img', { className: 'carrousel-slide-img carrousel-lazy', alt: '', src: defaultSrc, 'data-load-src': item.img }),
|
13346 | item.caption && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
13347 | 'div',
|
13348 | { className: 'carrousel-summary' },
|
13349 | item.iconParams && item.iconParams.className && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('i', Carrousel_extends({}, item.iconParams, { className: 'icon carrousel-summary-icon' + (item.iconParams.className ? ' ' + item.iconParams.className : '') })),
|
13350 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
13351 | 'span',
|
13352 | { className: 'nowrap carrousel-summary-caption', style: { marginRight: '20px' } },
|
13353 | item.caption
|
13354 | )
|
13355 | )
|
13356 | );
|
13357 | }),
|
13358 | list.length === 0 && childrenArr && childrenArr.map(function (item, index) {
|
13359 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
13360 | 'div',
|
13361 | { className: 'carrousel-slide', key: index },
|
13362 | item
|
13363 | );
|
13364 | })
|
13365 | ),
|
13366 | pagination === true && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', Carrousel_extends({}, paginationParams, { className: 'carrousel-pagination' + (paginationParams.className ? ' ' + paginationParams.className : '') })),
|
13367 | pagination && pagination !== true && pagination,
|
13368 | list.length > 1 && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', Carrousel_extends({}, prevParams, { className: 'carrousel-prev' + (prevParams.className ? ' ' + prevParams.className : '') })),
|
13369 | list.length > 1 && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', Carrousel_extends({}, nextParams, { className: 'carrousel-next' + (nextParams.className ? ' ' + nextParams.className : '') }))
|
13370 | );
|
13371 | };
|
13372 |
|
13373 | return Carrousel;
|
13374 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Carrousel_class.propTypes = {
|
13375 | style: prop_types_default.a.object,
|
13376 | className: prop_types_default.a.string,
|
13377 |
|
13378 | slideParams: prop_types_default.a.object,
|
13379 |
|
13380 | pagination: prop_types_default.a.oneOfType([
|
13381 | prop_types_default.a.bool, prop_types_default.a.node]),
|
13382 | paginationParams: prop_types_default.a.object,
|
13383 |
|
13384 | prevParams: prop_types_default.a.object,
|
13385 | nextParams: prop_types_default.a.object,
|
13386 |
|
13387 | stopPropagation: prop_types_default.a.bool,
|
13388 | activeIndex: prop_types_default.a.number,
|
13389 |
|
13390 | loop: prop_types_default.a.bool,
|
13391 | autoplay: prop_types_default.a.number,
|
13392 | slidesPerView: prop_types_default.a.number,
|
13393 | defaultSrc: prop_types_default.a.string,
|
13394 | list: prop_types_default.a.array,
|
13395 | enableOnChange: prop_types_default.a.bool,
|
13396 | speed: prop_types_default.a.number,
|
13397 | onClick: prop_types_default.a.func,
|
13398 | onChange: prop_types_default.a.func,
|
13399 | delay: prop_types_default.a.number,
|
13400 |
|
13401 | children: prop_types_default.a.node
|
13402 | }, Carrousel_class.defaultProps = {
|
13403 | slideParams: {},
|
13404 | paginationParams: {},
|
13405 | prevParams: {},
|
13406 | nextParams: {},
|
13407 | stopPropagation: false,
|
13408 | activeIndex: 0,
|
13409 | page: 0,
|
13410 | loop: false,
|
13411 | pagination: false,
|
13412 | autoplay: 0,
|
13413 | slidesPerView: 1,
|
13414 | list: [],
|
13415 | defaultSrc: '//res.waiqin365.com/d/seedsui/carrousel/default.png',
|
13416 | enableOnChange: true,
|
13417 | speed: 300,
|
13418 | delay: 500
|
13419 | }, Carrousel_temp);
|
13420 |
|
13421 |
|
13422 |
|
13423 |
|
13424 | var src_Carrousel = (Carrousel_Carrousel);
|
13425 |
|
13426 | var Chat_class, Chat_temp;
|
13427 |
|
13428 | function Chat_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
13429 |
|
13430 | function Chat_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
13431 |
|
13432 | function Chat_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
13433 |
|
13434 |
|
13435 |
|
13436 |
|
13437 | var Chat_Chat = (Chat_temp = Chat_class = function (_Component) {
|
13438 | Chat_inherits(Chat, _Component);
|
13439 |
|
13440 | function Chat(props) {
|
13441 | Chat_classCallCheck(this, Chat);
|
13442 |
|
13443 | var _this = Chat_possibleConstructorReturn(this, _Component.call(this, props));
|
13444 |
|
13445 | _this.onClick = function (e) {
|
13446 | var onClick = _this.props.onClick;
|
13447 |
|
13448 | if (onClick) {
|
13449 | onClick(Object.getArgs(e, _this.props.args));
|
13450 | e.stopPropagation();
|
13451 | }
|
13452 | };
|
13453 |
|
13454 | _this.onClickContent = function (e) {
|
13455 | if (_this.props.onClickContent) {
|
13456 | _this.props.onClickContent(Object.getArgs(e, _this.props.args));
|
13457 | e.stopPropagation();
|
13458 | }
|
13459 | };
|
13460 |
|
13461 | _this.onClickAvatar = function (e) {
|
13462 | if (_this.props.onClickAvatar) {
|
13463 | _this.props.onClickAvatar(Object.getArgs(e, _this.props.args));
|
13464 | e.stopPropagation();
|
13465 | }
|
13466 | };
|
13467 |
|
13468 | _this.state = {};
|
13469 | return _this;
|
13470 | }
|
13471 |
|
13472 | Chat.prototype.render = function render() {
|
13473 | var _this2 = this;
|
13474 |
|
13475 | var _props = this.props,
|
13476 | style = _props.style,
|
13477 | className = _props.className,
|
13478 | showAvatar = _props.showAvatar,
|
13479 | avatarSrc = _props.avatarSrc,
|
13480 | avatarClassName = _props.avatarClassName,
|
13481 | avatarStyle = _props.avatarStyle,
|
13482 | avatarAfter = _props.avatarAfter,
|
13483 | author = _props.author,
|
13484 | authorClassName = _props.authorClassName,
|
13485 | authorStyle = _props.authorStyle,
|
13486 | contentClassName = _props.contentClassName,
|
13487 | contentStyle = _props.contentStyle,
|
13488 | children = _props.children;
|
13489 |
|
13490 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
13491 | 'div',
|
13492 | { ref: function ref(el) {
|
13493 | _this2.$el = el;
|
13494 | }, className: 'chat' + (className ? ' ' + className : ''), style: style, onClick: this.onClick },
|
13495 | showAvatar && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
13496 | 'div',
|
13497 | { className: 'chat-photo', onClick: this.onClickAvatar },
|
13498 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
13499 | 'div',
|
13500 | { className: 'chat-avatar' + (avatarClassName ? ' ' + avatarClassName : ''), style: Object.assign(avatarSrc ? { backgroundImage: 'url(' + avatarSrc + ')' } : {}, avatarStyle) },
|
13501 | avatarAfter
|
13502 | ),
|
13503 | author && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
13504 | 'div',
|
13505 | { className: 'chat-author' + (authorClassName ? ' ' + authorClassName : ''), style: authorStyle },
|
13506 | author
|
13507 | )
|
13508 | ),
|
13509 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
13510 | 'div',
|
13511 | { className: 'chat-content-box' },
|
13512 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
13513 | 'div',
|
13514 | { onClick: this.onClickContent, className: 'chat-content' + (contentClassName ? ' ' + contentClassName : ''), style: contentStyle },
|
13515 | children
|
13516 | )
|
13517 | )
|
13518 | );
|
13519 | };
|
13520 |
|
13521 | return Chat;
|
13522 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Chat_class.propTypes = {
|
13523 | args: prop_types_default.a.any,
|
13524 | style: prop_types_default.a.object,
|
13525 | className: prop_types_default.a.string,
|
13526 | onClick: prop_types_default.a.func,
|
13527 |
|
13528 | showAvatar: prop_types_default.a.bool,
|
13529 | avatarClassName: prop_types_default.a.string,
|
13530 | avatarStyle: prop_types_default.a.object,
|
13531 | avatarSrc: prop_types_default.a.string,
|
13532 | avatarAfter: prop_types_default.a.node,
|
13533 | onClickAvatar: prop_types_default.a.func,
|
13534 |
|
13535 | author: prop_types_default.a.string,
|
13536 | authorClassName: prop_types_default.a.string,
|
13537 | authorStyle: prop_types_default.a.object,
|
13538 |
|
13539 | contentClassName: prop_types_default.a.string,
|
13540 | contentStyle: prop_types_default.a.object,
|
13541 | onClickContent: prop_types_default.a.func,
|
13542 |
|
13543 | children: prop_types_default.a.node
|
13544 | }, Chat_class.defaultProps = {
|
13545 | args: null
|
13546 | }, Chat_temp);
|
13547 |
|
13548 |
|
13549 |
|
13550 |
|
13551 | var src_Chat = (Chat_Chat);
|
13552 |
|
13553 | var Checkbox_class, Checkbox_temp;
|
13554 |
|
13555 | function Checkbox_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
13556 |
|
13557 | function Checkbox_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
13558 |
|
13559 | function Checkbox_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
13560 |
|
13561 |
|
13562 |
|
13563 |
|
13564 | var Checkbox_Checkbox = (Checkbox_temp = Checkbox_class = function (_Component) {
|
13565 | Checkbox_inherits(Checkbox, _Component);
|
13566 |
|
13567 | function Checkbox(props) {
|
13568 | Checkbox_classCallCheck(this, Checkbox);
|
13569 |
|
13570 | var _this = Checkbox_possibleConstructorReturn(this, _Component.call(this, props));
|
13571 |
|
13572 | _this.onClick = function (e) {
|
13573 | if (_this.props.disabled) return;
|
13574 | if (_this.props.onClick) _this.props.onClick(_this.$input.checked, Object.getArgs(e, _this.props.args));
|
13575 | };
|
13576 |
|
13577 | return _this;
|
13578 | }
|
13579 |
|
13580 | Checkbox.prototype.render = function render() {
|
13581 | var _this2 = this;
|
13582 |
|
13583 | var _props = this.props,
|
13584 | style = _props.style,
|
13585 | className = _props.className,
|
13586 | name = _props.name,
|
13587 | value = _props.value,
|
13588 | checked = _props.checked,
|
13589 | caption = _props.caption,
|
13590 | captionClassName = _props.captionClassName,
|
13591 | captionStyle = _props.captionStyle;
|
13592 |
|
13593 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
13594 | 'div',
|
13595 | { ref: function ref(el) {
|
13596 | _this2.$el = el;
|
13597 | }, className: 'checkbox-box' + (className ? ' ' + className : ''), onClick: this.onClick, style: style },
|
13598 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('input', { readOnly: true, checked: checked, type: 'checkbox', className: 'checkbox events-none', name: name, value: value, ref: function ref(el) {
|
13599 | _this2.$input = el;
|
13600 | } }),
|
13601 | caption && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
13602 | 'span',
|
13603 | { className: 'checkbox-caption' + (captionClassName ? ' ' + captionClassName : ''), style: captionStyle },
|
13604 | caption
|
13605 | )
|
13606 | );
|
13607 | };
|
13608 |
|
13609 | return Checkbox;
|
13610 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Checkbox_class.propTypes = {
|
13611 | args: prop_types_default.a.any,
|
13612 | style: prop_types_default.a.object,
|
13613 | className: prop_types_default.a.string,
|
13614 | onClick: prop_types_default.a.func,
|
13615 |
|
13616 | name: prop_types_default.a.string,
|
13617 | value: prop_types_default.a.string,
|
13618 | checked: prop_types_default.a.bool,
|
13619 | disabled: prop_types_default.a.bool,
|
13620 |
|
13621 | caption: prop_types_default.a.string,
|
13622 | captionClassName: prop_types_default.a.string,
|
13623 | captionStyle: prop_types_default.a.object
|
13624 | }, Checkbox_class.defaultProps = {
|
13625 | args: null,
|
13626 | value: '',
|
13627 | checked: false
|
13628 | }, Checkbox_temp);
|
13629 |
|
13630 |
|
13631 |
|
13632 |
|
13633 | var src_Checkbox = (Checkbox_Checkbox);
|
13634 |
|
13635 |
|
13636 |
|
13637 |
|
13638 |
|
13639 | var ImgLazy_ImgLazy = function ImgLazy(params) {
|
13640 | |
13641 |
|
13642 |
|
13643 | var defaults = {
|
13644 | overflowContainer: document.body,
|
13645 | load: 'scroll',
|
13646 | threshold: 300,
|
13647 | loadAttr: 'data-load-src',
|
13648 | errorAttr: 'data-error-src',
|
13649 | completeAttr: 'data-complete'
|
13650 | };
|
13651 | params = params || {};
|
13652 | for (var def in defaults) {
|
13653 | if (params[def] === undefined) {
|
13654 | params[def] = defaults[def];
|
13655 | }
|
13656 | }
|
13657 | var s = this;
|
13658 | s.params = params;
|
13659 |
|
13660 | s.overflowContainer = typeof s.params.overflowContainer === 'string' ? document.querySelector(s.params.overflowContainer) : s.params.overflowContainer;
|
13661 | if (!s.overflowContainer) {
|
13662 | console.log('SeedsUI Error : Dragrefresh overflowContainer不存在,请检查页面中是否有此元素');
|
13663 | return;
|
13664 | }
|
13665 |
|
13666 | s.imgs = [];
|
13667 |
|
13668 | s.scrollTop = 0;
|
13669 | |
13670 |
|
13671 |
|
13672 |
|
13673 | s.getOffsetTop = function (el) {
|
13674 | var offsetTop = el.offsetTop;
|
13675 | if (el.offsetParent != null) offsetTop += s.getOffsetTop(el.offsetParent);
|
13676 |
|
13677 | return offsetTop;
|
13678 | };
|
13679 |
|
13680 | s.isInScreen = function (el) {
|
13681 | var offsetTop = s.getOffsetTop(el);
|
13682 | if (offsetTop > s.scrollTop - s.params.threshold && offsetTop < parseInt(s.scrollTop, 10) + parseInt(window.innerHeight, 10)) {
|
13683 | return true;
|
13684 | }
|
13685 | return false;
|
13686 | };
|
13687 |
|
13688 | s.completeList = [];
|
13689 | s.updateCompleteList = function (src) {
|
13690 | s.completeList = src_DB.getSession('seedsui_imglazy_complete_list') || [];
|
13691 | if (src && typeof src === 'string') {
|
13692 | s.completeList.push(src.clearProtocol());
|
13693 | src_DB.setSession('seedsui_imglazy_complete_list', s.completeList);
|
13694 | }
|
13695 | };
|
13696 | s.updateCompleteList();
|
13697 |
|
13698 | s.isComplete = function (src) {
|
13699 | if (src && typeof src === 'string' && s.completeList.indexOf(src.clearProtocol()) !== -1) {
|
13700 | return true;
|
13701 | }
|
13702 | return false;
|
13703 | };
|
13704 | |
13705 |
|
13706 |
|
13707 | s.events = function (detach) {
|
13708 | var action = detach ? 'removeEventListener' : 'addEventListener';
|
13709 | if (s.params.load === 'scroll') {
|
13710 | var scrollTarget = s.overflowContainer === document.body ? window : s.overflowContainer;
|
13711 | scrollTarget[action]('scroll', s.onScroll, false);
|
13712 | }
|
13713 | };
|
13714 | s.attach = function () {
|
13715 | s.events();
|
13716 | };
|
13717 | s.detach = function () {
|
13718 | s.events(false);
|
13719 | };
|
13720 |
|
13721 | s.onLoad = function (e) {
|
13722 | var target = e.target;
|
13723 | var imgTarget = target.$el;
|
13724 | imgTarget.setAttribute(s.params.completeAttr, '1');
|
13725 |
|
13726 | s.updateCompleteList(target.src);
|
13727 |
|
13728 |
|
13729 | s.render(imgTarget, target.src);
|
13730 |
|
13731 | };
|
13732 |
|
13733 | s.render = function (target, src) {
|
13734 | if (target.tagName === 'IMG') {
|
13735 | target.src = src;
|
13736 | } else {
|
13737 | target.style.backgroundImage = 'url(' + src + ')';
|
13738 | }
|
13739 | };
|
13740 |
|
13741 | s.onError = function (e) {
|
13742 | var target = e.target;
|
13743 | var imgTarget = target.$el;
|
13744 | imgTarget.setAttribute(s.params.completeAttr, '0');
|
13745 | if (target.errorSrc) {
|
13746 |
|
13747 | s.render(imgTarget, target.errorSrc);
|
13748 | }
|
13749 |
|
13750 | };
|
13751 |
|
13752 | var timer;
|
13753 | var millisec = 300;
|
13754 | s.getScrollTop = function () {
|
13755 | return s.overflowContainer === document.body ? document.documentElement.scrollTop : s.overflowContainer.scrollTop;
|
13756 | };
|
13757 | s.onScroll = function () {
|
13758 | s.scrollTop = s.getScrollTop();
|
13759 | if (timer) {
|
13760 | clearTimeout(timer);
|
13761 | }
|
13762 | timer = setTimeout(function () {
|
13763 | if (s.scrollTop === s.getScrollTop()) {
|
13764 | s.onScrollEnd();
|
13765 | clearTimeout(timer);
|
13766 | return;
|
13767 | }
|
13768 | timer = null;
|
13769 | }, millisec);
|
13770 | };
|
13771 | s.onScrollEnd = function () {
|
13772 | console.log('停止滚动');
|
13773 | s.load();
|
13774 | };
|
13775 | |
13776 |
|
13777 |
|
13778 | s.load = function () {
|
13779 |
|
13780 | s.updateCompleteList();
|
13781 |
|
13782 |
|
13783 | s.imgs = [].slice.call(s.overflowContainer.querySelectorAll('[' + s.params.loadAttr + ']')).filter(function (n) {
|
13784 | if (n.getAttribute(s.params.loadAttr)) return true;
|
13785 | return false;
|
13786 | });
|
13787 |
|
13788 |
|
13789 | if (s.params.load === 'queue') {
|
13790 | s.queue(0);
|
13791 | return;
|
13792 | }
|
13793 |
|
13794 |
|
13795 | for (var i = 0; i < s.imgs.length; i++) {
|
13796 |
|
13797 | var loadSrc = s.imgs[i].getAttribute(s.params.loadAttr);
|
13798 | var errorSrc = s.imgs[i].getAttribute(s.params.imgErrorAttr) || '';
|
13799 |
|
13800 | if (s.isComplete(loadSrc)) {
|
13801 | s.render(s.imgs[i], loadSrc);
|
13802 | continue;
|
13803 | }
|
13804 |
|
13805 | var flag = true;
|
13806 | if (s.params.load === 'scroll') flag = s.isInScreen(s.imgs[i]);
|
13807 | if (flag && !s.imgs[i].getAttribute(s.params.completeAttr)) {
|
13808 | console.log('加载' + loadSrc);
|
13809 | var image = new Image();
|
13810 | image.$el = s.imgs[i];
|
13811 | image.src = loadSrc;
|
13812 | image.errorSrc = errorSrc;
|
13813 | image.addEventListener('load', s.onLoad, false);
|
13814 | image.addEventListener('error', s.onError, false);
|
13815 | }
|
13816 | }
|
13817 | };
|
13818 |
|
13819 | s.queue = function (i) {
|
13820 |
|
13821 | var loadSrc = s.imgs[i].getAttribute(s.params.loadAttr);
|
13822 | var errorSrc = s.imgs[i].getAttribute(s.params.imgErrorAttr) || '';
|
13823 |
|
13824 | if (s.isComplete(loadSrc)) {
|
13825 | s.render(s.imgs[i], loadSrc);
|
13826 | s.queue(i++);
|
13827 | return;
|
13828 | }
|
13829 |
|
13830 | if (s.imgs[i].getAttribute(s.params.completeAttr)) {
|
13831 | i++;
|
13832 | }
|
13833 | if (!s.imgs[i]) {
|
13834 | return;
|
13835 | }
|
13836 |
|
13837 | var image = new Image();
|
13838 | image.$el = s.imgs[i];
|
13839 | image.src = loadSrc;
|
13840 | image.errorSrc = errorSrc;
|
13841 | image.addEventListener('load', function (e) {
|
13842 | console.log('加载第' + i + '张');
|
13843 | s.onLoad(e);
|
13844 | s.queue(i++);
|
13845 | }, false);
|
13846 | image.addEventListener('error', function (e) {
|
13847 | console.log('第' + i + '张加载失败');
|
13848 | s.onError(e);
|
13849 | s.queue(i++);
|
13850 | }, false);
|
13851 | };
|
13852 | s.update = function () {
|
13853 | if (s.params.load === 'scroll') {
|
13854 | s.detach();
|
13855 | s.attach();
|
13856 | }
|
13857 | };
|
13858 | s.update();
|
13859 | };
|
13860 |
|
13861 | var src_ImgLazy_ImgLazy = (ImgLazy_ImgLazy);
|
13862 |
|
13863 |
|
13864 |
|
13865 | var src_ImgLazy = (src_ImgLazy_ImgLazy);
|
13866 |
|
13867 | var Container_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; };
|
13868 |
|
13869 | var Container_class, Container_temp;
|
13870 |
|
13871 | function Container_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
13872 |
|
13873 | function Container_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
13874 |
|
13875 | function Container_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
13876 |
|
13877 | function Container_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
13878 |
|
13879 |
|
13880 |
|
13881 |
|
13882 |
|
13883 | var Container_Container = (Container_temp = Container_class = function (_Component) {
|
13884 | Container_inherits(Container, _Component);
|
13885 |
|
13886 | function Container(props) {
|
13887 | Container_classCallCheck(this, Container);
|
13888 |
|
13889 | var _this = Container_possibleConstructorReturn(this, _Component.call(this, props));
|
13890 |
|
13891 | _this.state = {
|
13892 | lazyLoadInstance: null
|
13893 | };
|
13894 | return _this;
|
13895 | }
|
13896 |
|
13897 | Container.prototype.componentDidMount = function componentDidMount() {
|
13898 | if (this.props.lazyLoad) {
|
13899 | var imglazy = new src_ImgLazy({
|
13900 | overflowContainer: this.$el
|
13901 | });
|
13902 | imglazy.load();
|
13903 | this.setState({
|
13904 | lazyLoadInstance: imglazy
|
13905 | });
|
13906 | }
|
13907 | };
|
13908 |
|
13909 | Container.prototype.render = function render() {
|
13910 | var _this2 = this;
|
13911 |
|
13912 | var _props = this.props,
|
13913 | style = _props.style,
|
13914 | className = _props.className,
|
13915 | lazyLoad = _props.lazyLoad,
|
13916 | children = _props.children,
|
13917 | others = Container_objectWithoutProperties(_props, ['style', 'className', 'lazyLoad', 'children']);
|
13918 |
|
13919 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
13920 | 'article',
|
13921 | Container_extends({ ref: function ref(el) {
|
13922 | _this2.$el = el;
|
13923 | }, className: 'container' + (className ? ' ' + className : ''), style: style }, others),
|
13924 | children
|
13925 | );
|
13926 | };
|
13927 |
|
13928 | return Container;
|
13929 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Container_class.propTypes = {
|
13930 | style: prop_types_default.a.object,
|
13931 | className: prop_types_default.a.string,
|
13932 | lazyLoad: prop_types_default.a.bool,
|
13933 | children: prop_types_default.a.node
|
13934 | }, Container_temp);
|
13935 |
|
13936 |
|
13937 |
|
13938 |
|
13939 | var src_Container = (Container_Container);
|
13940 |
|
13941 |
|
13942 | var instance_Counter = function Counter(counter, params) {
|
13943 | |
13944 |
|
13945 |
|
13946 | var defaults = {
|
13947 | fromAttr: 'data-from',
|
13948 | toAttr: 'data-to',
|
13949 | durationAttr: 'data-duration',
|
13950 | suffixAttr: 'data-suffix',
|
13951 | maxMilliSec: 50,
|
13952 | maxCountSec: 20
|
13953 | };
|
13954 | params = params || {};
|
13955 | for (var def in defaults) {
|
13956 | if (params[def] === undefined) {
|
13957 | params[def] = defaults[def];
|
13958 | }
|
13959 | }
|
13960 |
|
13961 | var s = this;
|
13962 |
|
13963 |
|
13964 | s.params = params;
|
13965 |
|
13966 |
|
13967 | s.counter = typeof counter === 'string' ? document.querySelector(counter) : counter;
|
13968 |
|
13969 |
|
13970 | s.from = s.counter.getAttribute(s.params.fromAttr) ? s.counter.getAttribute(s.params.fromAttr) : 0;
|
13971 |
|
13972 | s.to = s.counter.getAttribute(s.params.toAttr) ? s.counter.getAttribute(s.params.toAttr) : 0;
|
13973 |
|
13974 | s.suffix = s.counter.getAttribute(s.params.suffixAttr) ? s.counter.getAttribute(s.params.suffixAttr) : '';
|
13975 |
|
13976 | s.current = s.from;
|
13977 |
|
13978 | s.duration = s.counter.getAttribute(s.params.durationAttr) ? s.counter.getAttribute(s.params.durationAttr) : 5000;
|
13979 |
|
13980 |
|
13981 | s.diff = s.to - s.from;
|
13982 |
|
13983 |
|
13984 | var secNum = Math.round(s.diff / (s.duration / 1000));
|
13985 |
|
13986 | s.step = 1;
|
13987 |
|
13988 | s.milliSec = Math.round(s.params.maxMilliSec);
|
13989 | if (secNum > s.params.maxCountSec) {
|
13990 |
|
13991 | s.step = Math.round(secNum / s.params.maxCountSec);
|
13992 | s.milliSec = s.params.maxMilliSec;
|
13993 | } else {
|
13994 | s.step = secNum;
|
13995 | s.milliSec = 1000 / secNum;
|
13996 | }
|
13997 |
|
13998 |
|
13999 |
|
14000 |
|
14001 | s.interval = null;
|
14002 | |
14003 |
|
14004 |
|
14005 | s.play = function () {
|
14006 | if (s.diff < 0 || isNaN(s.from) || isNaN(s.to)) {
|
14007 | console.error('SeedsUI Counter开始时间与结束时间不正确!');
|
14008 | return;
|
14009 | }
|
14010 | s.interval = window.setInterval(function () {
|
14011 | s.current = parseInt(s.current, 10) + parseInt(s.step, 10);
|
14012 | s.counter.innerHTML = s.current + s.suffix;
|
14013 | if (s.current >= s.to) {
|
14014 | s.counter.innerHTML = s.to + s.suffix;
|
14015 | clearInterval(s.interval);
|
14016 | }
|
14017 | }, s.milliSec);
|
14018 | };
|
14019 | };
|
14020 | var Counters = function Counters(params) {
|
14021 | params = params || {};
|
14022 | var counterClass = 'counter';
|
14023 | var s = this;
|
14024 | s.counters = [];
|
14025 | s.update = function () {
|
14026 | var elements = document.querySelectorAll('.' + counterClass);
|
14027 | for (var i = 0; i < elements.length; i++) {
|
14028 | s.counters[i] = new instance_Counter(elements[i], s.params);
|
14029 | }
|
14030 | };
|
14031 | s.update();
|
14032 | s.play = function () {
|
14033 | for (var i = 0; i < s.counters.length; i++) {
|
14034 | s.counters[i].play();
|
14035 | }
|
14036 | };
|
14037 | };
|
14038 |
|
14039 |
|
14040 |
|
14041 | var Counter_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; };
|
14042 |
|
14043 | var Counter_class, Counter_temp;
|
14044 |
|
14045 | function Counter_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
14046 |
|
14047 | function Counter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
14048 |
|
14049 | function Counter_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
14050 |
|
14051 | function Counter_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
14052 |
|
14053 |
|
14054 |
|
14055 |
|
14056 |
|
14057 | var Counter_Counter = (Counter_temp = Counter_class = function (_Component) {
|
14058 | Counter_inherits(Counter, _Component);
|
14059 |
|
14060 | function Counter(props) {
|
14061 | Counter_classCallCheck(this, Counter);
|
14062 |
|
14063 | var _this = Counter_possibleConstructorReturn(this, _Component.call(this, props));
|
14064 |
|
14065 | _this.componentDidMount = function () {
|
14066 | var instance = new instance_Counter(_this.$el);
|
14067 | if (_this.props.autoplay) {
|
14068 | instance.play();
|
14069 | }
|
14070 | _this.instance = instance;
|
14071 | };
|
14072 |
|
14073 | _this.play = function () {
|
14074 | if (_this.instance) {
|
14075 | _this.instance.play();
|
14076 | }
|
14077 | };
|
14078 |
|
14079 | return _this;
|
14080 | }
|
14081 |
|
14082 | Counter.prototype.render = function render() {
|
14083 | var _this2 = this;
|
14084 |
|
14085 | var _props = this.props,
|
14086 | style = _props.style,
|
14087 | className = _props.className,
|
14088 | duration = _props.duration,
|
14089 | from = _props.from,
|
14090 | to = _props.to,
|
14091 | suffix = _props.suffix,
|
14092 | autoplay = _props.autoplay,
|
14093 | others = Counter_objectWithoutProperties(_props, ['style', 'className', 'duration', 'from', 'to', 'suffix', 'autoplay']);
|
14094 |
|
14095 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
14096 | 'span',
|
14097 | Counter_extends({ ref: function ref(el) {
|
14098 | _this2.$el = el;
|
14099 | }, className: 'counter' + (className ? ' ' + className : ''), style: style, 'data-duration': duration, 'data-from': from, 'data-to': to, 'data-suffix': suffix }, others),
|
14100 | '1'
|
14101 | );
|
14102 | };
|
14103 |
|
14104 | return Counter;
|
14105 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Counter_class.propTypes = {
|
14106 | style: prop_types_default.a.object,
|
14107 | className: prop_types_default.a.string,
|
14108 |
|
14109 | duration: prop_types_default.a.number,
|
14110 | from: prop_types_default.a.number,
|
14111 | to: prop_types_default.a.number,
|
14112 | suffix: prop_types_default.a.string,
|
14113 | autoplay: prop_types_default.a.bool
|
14114 | }, Counter_class.defaultProps = {
|
14115 | duration: 5000,
|
14116 | from: 0,
|
14117 | to: 10,
|
14118 | autoplay: true
|
14119 | }, Counter_temp);
|
14120 |
|
14121 |
|
14122 |
|
14123 |
|
14124 | var src_Counter = (Counter_Counter);
|
14125 |
|
14126 | var Dialog_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; };
|
14127 |
|
14128 | var Dialog_class, Dialog_temp;
|
14129 |
|
14130 | function Dialog_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
14131 |
|
14132 | function Dialog_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
14133 |
|
14134 | function Dialog_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
14135 |
|
14136 | function Dialog_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
14137 |
|
14138 |
|
14139 |
|
14140 |
|
14141 |
|
14142 | var Dialog_Dialog = (Dialog_temp = Dialog_class = function (_Component) {
|
14143 | Dialog_inherits(Dialog, _Component);
|
14144 |
|
14145 | function Dialog(props) {
|
14146 | Dialog_classCallCheck(this, Dialog);
|
14147 |
|
14148 | var _this = Dialog_possibleConstructorReturn(this, _Component.call(this, props));
|
14149 |
|
14150 | _this.componentDidUpdate = function (prevProps) {};
|
14151 |
|
14152 | _this.componentDidMount = function () {};
|
14153 |
|
14154 | _this.onClickMask = function (e) {
|
14155 | if (_this.props.onClickMask) _this.props.onClickMask(Object.getArgs(e, _this.props.args));
|
14156 | e.stopPropagation();
|
14157 | };
|
14158 |
|
14159 | _this.onClickDialog = function (e) {
|
14160 | e.stopPropagation();
|
14161 | };
|
14162 |
|
14163 | return _this;
|
14164 | }
|
14165 | |
14166 |
|
14167 |
|
14168 |
|
14169 |
|
14170 |
|
14171 |
|
14172 |
|
14173 | Dialog.prototype.render = function render() {
|
14174 | var _this2 = this;
|
14175 |
|
14176 | var _props = this.props,
|
14177 | portal = _props.portal,
|
14178 | args = _props.args,
|
14179 | maskClassName = _props.maskClassName,
|
14180 | maskStyle = _props.maskStyle,
|
14181 | isClickMaskHide = _props.isClickMaskHide,
|
14182 | onClickMask = _props.onClickMask,
|
14183 | onShowed = _props.onShowed,
|
14184 | onHid = _props.onHid,
|
14185 | duration = _props.duration,
|
14186 | show = _props.show,
|
14187 | className = _props.className,
|
14188 | style = _props.style,
|
14189 | animation = _props.animation,
|
14190 | children = _props.children,
|
14191 | others = Dialog_objectWithoutProperties(_props, ['portal', 'args', 'maskClassName', 'maskStyle', 'isClickMaskHide', 'onClickMask', 'onShowed', 'onHid', 'duration', 'show', 'className', 'style', 'animation', 'children']);
|
14192 |
|
14193 | var transformOrigin = 'middle';
|
14194 | switch (animation) {
|
14195 | case 'slideLeft':
|
14196 | transformOrigin = 'right-middle';
|
14197 | break;
|
14198 | case 'slideRight':
|
14199 | transformOrigin = 'left-middle';
|
14200 | break;
|
14201 | case 'slideUp':
|
14202 | transformOrigin = 'bottom-center';
|
14203 | break;
|
14204 | case 'slideDown':
|
14205 | transformOrigin = 'top-center';
|
14206 | break;
|
14207 | case 'zoom':
|
14208 | transformOrigin = 'middle';
|
14209 | break;
|
14210 | case 'fade':
|
14211 | transformOrigin = 'middle';
|
14212 | break;
|
14213 | default:
|
14214 | transformOrigin = 'middle';
|
14215 | }
|
14216 | return Object(react_dom["createPortal"])(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
14217 | 'div',
|
14218 | Dialog_extends({ ref: function ref(el) {
|
14219 | _this2.$el = el;
|
14220 | }, className: 'mask dialog-mask' + (maskClassName ? ' ' + maskClassName : '') + (show ? ' active' : ''), style: Object.assign(duration !== undefined ? { WebkitTransitionDuration: duration + 'ms' } : {}, maskStyle), onClick: this.onClickMask }, others),
|
14221 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
14222 | 'div',
|
14223 | { className: 'dialog' + (transformOrigin ? ' ' + transformOrigin : '') + (className ? ' ' + className : '') + (show ? ' active' : ''), style: Object.assign(duration !== undefined ? { WebkitTransitionDuration: duration + 'ms' } : {}, style), 'data-animation': animation, onClick: this.onClickDialog },
|
14224 | children && children
|
14225 | )
|
14226 | ), this.props.portal || document.getElementById('root'));
|
14227 | };
|
14228 |
|
14229 | return Dialog;
|
14230 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Dialog_class.propTypes = {
|
14231 | portal: prop_types_default.a.object,
|
14232 | args: prop_types_default.a.any,
|
14233 | show: prop_types_default.a.bool,
|
14234 |
|
14235 | animation: prop_types_default.a.string,
|
14236 | duration: prop_types_default.a.number,
|
14237 | isClickMaskHide: prop_types_default.a.bool,
|
14238 | onClickMask: prop_types_default.a.func,
|
14239 | onShowed: prop_types_default.a.func,
|
14240 | onHid: prop_types_default.a.func,
|
14241 |
|
14242 | maskClassName: prop_types_default.a.string,
|
14243 | maskStyle: prop_types_default.a.object,
|
14244 |
|
14245 | className: prop_types_default.a.string,
|
14246 | style: prop_types_default.a.object,
|
14247 |
|
14248 | children: prop_types_default.a.node
|
14249 | }, Dialog_class.defaultProps = {
|
14250 | args: null,
|
14251 | isClickMaskHide: false,
|
14252 | animation: 'fade'
|
14253 | }, Dialog_temp);
|
14254 |
|
14255 |
|
14256 |
|
14257 |
|
14258 | var src_Dialog = (Dialog_Dialog);
|
14259 |
|
14260 | var Dot_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; };
|
14261 |
|
14262 | var Dot_class, Dot_temp;
|
14263 |
|
14264 | function Dot_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
14265 |
|
14266 | function Dot_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
14267 |
|
14268 | function Dot_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
14269 |
|
14270 | function Dot_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
14271 |
|
14272 |
|
14273 |
|
14274 |
|
14275 | var Dot_Dot = (Dot_temp = Dot_class = function (_Component) {
|
14276 | Dot_inherits(Dot, _Component);
|
14277 |
|
14278 | function Dot(props) {
|
14279 | Dot_classCallCheck(this, Dot);
|
14280 |
|
14281 | return Dot_possibleConstructorReturn(this, _Component.call(this, props));
|
14282 | }
|
14283 |
|
14284 | Dot.prototype.render = function render() {
|
14285 | var _this2 = this;
|
14286 |
|
14287 | var _props = this.props,
|
14288 | className = _props.className,
|
14289 | style = _props.style,
|
14290 | size = _props.size,
|
14291 | others = Dot_objectWithoutProperties(_props, ['className', 'style', 'size']);
|
14292 |
|
14293 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('i', Dot_extends({ ref: function ref(el) {
|
14294 | _this2.$el = el;
|
14295 | }, className: 'dot' + (className ? ' ' + className : ''), style: Object.assign(style, size ? { width: size, height: size } : {}) }, others));
|
14296 | };
|
14297 |
|
14298 | return Dot;
|
14299 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Dot_class.propTypes = {
|
14300 | className: prop_types_default.a.string,
|
14301 | style: prop_types_default.a.object,
|
14302 | size: prop_types_default.a.string
|
14303 | }, Dot_class.defaultProps = {
|
14304 | style: {}
|
14305 | }, Dot_temp);
|
14306 |
|
14307 |
|
14308 |
|
14309 |
|
14310 | var src_Dot = (Dot_Dot);
|
14311 |
|
14312 | var Notice_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; };
|
14313 |
|
14314 | var Notice_class, Notice_temp;
|
14315 |
|
14316 | function Notice_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
14317 |
|
14318 | function Notice_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
14319 |
|
14320 | function Notice_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
14321 |
|
14322 | function Notice_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
14323 |
|
14324 |
|
14325 |
|
14326 |
|
14327 | var Notice_Notice = (Notice_temp = Notice_class = function (_Component) {
|
14328 | Notice_inherits(Notice, _Component);
|
14329 |
|
14330 | function Notice(props) {
|
14331 | Notice_classCallCheck(this, Notice);
|
14332 |
|
14333 | return Notice_possibleConstructorReturn(this, _Component.call(this, props));
|
14334 | }
|
14335 |
|
14336 | Notice.prototype.render = function render() {
|
14337 | var _this2 = this;
|
14338 |
|
14339 | var _props = this.props,
|
14340 | className = _props.className,
|
14341 | style = _props.style,
|
14342 | wrapperParams = _props.wrapperParams,
|
14343 | icon = _props.icon,
|
14344 | caption = _props.caption,
|
14345 | captionParams = _props.captionParams,
|
14346 | sndcaption = _props.sndcaption,
|
14347 | sndcaptionParams = _props.sndcaptionParams,
|
14348 | children = _props.children,
|
14349 | others = Notice_objectWithoutProperties(_props, ['className', 'style', 'wrapperParams', 'icon', 'caption', 'captionParams', 'sndcaption', 'sndcaptionParams', 'children']);
|
14350 |
|
14351 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
14352 | 'div',
|
14353 | Notice_extends({ ref: function ref(el) {
|
14354 | _this2.$el = el;
|
14355 | }, className: 'notice' + (className ? ' ' + className : ''), style: style }, others),
|
14356 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
14357 | 'div',
|
14358 | Notice_extends({}, wrapperParams, { className: 'notice-wrapper' + (wrapperParams.className ? ' ' + wrapperParams.className : '') }),
|
14359 | icon ? icon : external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('i', { className: 'icon notice-icon notice-icon-nodata' }),
|
14360 | caption && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
14361 | 'div',
|
14362 | Notice_extends({}, captionParams, { className: 'notice-caption' + (captionParams.className ? ' ' + captionParams.className : '') }),
|
14363 | caption
|
14364 | ),
|
14365 | sndcaption && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
14366 | 'div',
|
14367 | Notice_extends({}, sndcaptionParams, { className: 'notice-sndcaption' + (sndcaptionParams.className ? ' ' + sndcaptionParams.className : '') }),
|
14368 | sndcaption
|
14369 | ),
|
14370 | children
|
14371 | )
|
14372 | );
|
14373 | };
|
14374 |
|
14375 | return Notice;
|
14376 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Notice_class.propTypes = {
|
14377 | className: prop_types_default.a.string,
|
14378 | style: prop_types_default.a.object,
|
14379 |
|
14380 | wrapperParams: prop_types_default.a.object,
|
14381 |
|
14382 | icon: prop_types_default.a.node,
|
14383 |
|
14384 | caption: prop_types_default.a.node,
|
14385 | captionParams: prop_types_default.a.object,
|
14386 | sndcaption: prop_types_default.a.node,
|
14387 | sndcaptionParams: prop_types_default.a.object,
|
14388 |
|
14389 | children: prop_types_default.a.node
|
14390 | }, Notice_class.defaultProps = {
|
14391 | wrapperParams: {},
|
14392 | caption: '暂无数据',
|
14393 | captionParams: {},
|
14394 | sndcaptionParams: {}
|
14395 | }, Notice_temp);
|
14396 |
|
14397 |
|
14398 |
|
14399 |
|
14400 | var src_Notice = (Notice_Notice);
|
14401 |
|
14402 |
|
14403 | var instance_Dragrefresh = function Dragrefresh(params) {
|
14404 | |
14405 |
|
14406 |
|
14407 | var defaults = {
|
14408 | container: document.body,
|
14409 | duration: 150,
|
14410 | threshold: 100,
|
14411 | begin: 0,
|
14412 | end: 200,
|
14413 | endRefresh: false,
|
14414 | moveTimeout: 0,
|
14415 |
|
14416 | isTopPosition: 0,
|
14417 |
|
14418 | topContainer: null
|
14419 |
|
14420 | |
14421 |
|
14422 |
|
14423 |
|
14424 |
|
14425 |
|
14426 |
|
14427 |
|
14428 |
|
14429 |
|
14430 |
|
14431 |
|
14432 | };
|
14433 | params = params || {};
|
14434 | for (var def in defaults) {
|
14435 | if (params[def] === undefined) {
|
14436 | params[def] = defaults[def];
|
14437 | }
|
14438 | }
|
14439 | var s = this;
|
14440 | s.params = params;
|
14441 |
|
14442 | s.container = typeof s.params.container === 'string' ? document.querySelector(s.params.container) : s.params.container;
|
14443 | if (!s.container) {
|
14444 | console.log('SeedsUI Error : Dragrefresh container不存在,请检查页面中是否有此元素');
|
14445 | return;
|
14446 | }
|
14447 |
|
14448 | s.topContainer = typeof s.params.topContainer === 'string' ? document.querySelector(s.params.topContainer) : s.params.topContainer;
|
14449 | if (!s.topContainer) {
|
14450 | console.log('SeedsUI Warn : topContainer不存在,请检查页面中是否有此元素');
|
14451 | }
|
14452 |
|
14453 | s.isLoading = true;
|
14454 | |
14455 |
|
14456 |
|
14457 | s.isHid = false;
|
14458 |
|
14459 | s.hideTop = function () {
|
14460 | if (!s.topContainer) return;
|
14461 | s.topContainer.style.webkitTransitionDuration = s.params.duration + 'ms';
|
14462 | s.touches.posY = s.params.begin;
|
14463 | s.touches.currentPosY = s.params.begin;
|
14464 | s.isHid = true;
|
14465 |
|
14466 | if (s.params.onHideTop) s.params.onHideTop(s);
|
14467 | };
|
14468 |
|
14469 | s.showTop = function () {
|
14470 | if (!s.topContainer) return;
|
14471 | s.topContainer.style.webkitTransitionDuration = s.params.duration + 'ms';
|
14472 | s.touches.posY = s.params.threshold;
|
14473 | s.touches.currentPosY = s.params.begin;
|
14474 | s.isHid = false;
|
14475 |
|
14476 | if (s.params.onShowTop) s.params.onShowTop(s);
|
14477 | };
|
14478 |
|
14479 | s.destroyTop = function () {
|
14480 | s.container.removeChild(s.topContainer);
|
14481 | };
|
14482 | s.destroy = function () {
|
14483 | s.destroyTop();
|
14484 |
|
14485 | s.detach();
|
14486 | };
|
14487 |
|
14488 | s.hasScroll = function () {
|
14489 | var clientHeight = s.container.clientHeight;
|
14490 | var scrollHeight = s.container.scrollHeight;
|
14491 | |
14492 |
|
14493 |
|
14494 | if (clientHeight === scrollHeight) {
|
14495 | return false;
|
14496 | }
|
14497 | return true;
|
14498 | };
|
14499 |
|
14500 | s.topRefresh = function () {
|
14501 | if (s.isLoading) return;
|
14502 | s.isLoading = true;
|
14503 |
|
14504 | if (s.params.onTopRefresh) s.params.onTopRefresh(s);
|
14505 | };
|
14506 |
|
14507 | s.bottomRefresh = function () {
|
14508 | if (s.isLoading) return;
|
14509 | s.isLoading = true;
|
14510 |
|
14511 | if (s.params.onBottomRefresh) s.params.onBottomRefresh(s);
|
14512 | };
|
14513 | |
14514 |
|
14515 |
|
14516 | s.isSupportTouch = 'ontouchstart' in window;
|
14517 | s.events = function (detach) {
|
14518 | var action = detach ? 'removeEventListener' : 'addEventListener';
|
14519 | var touchTarget = s.container;
|
14520 |
|
14521 | if (s.topContainer) {
|
14522 |
|
14523 | if (s.isSupportTouch) {
|
14524 | s.container[action]('touchstart', s.onTouchStart, false);
|
14525 | s.container[action]('touchmove', s.onTouchMove, false);
|
14526 | s.container[action]('touchend', s.onTouchEnd, false);
|
14527 | s.container[action]('touchcancel', s.onTouchEnd, false);
|
14528 | } else {
|
14529 | s.container[action]('mousedown', s.onTouchStart, false);
|
14530 | s.container[action]('mousemove', s.onTouchMove, false);
|
14531 | s.container[action]('mouseup', s.onTouchEnd, false);
|
14532 | }
|
14533 |
|
14534 | s.topContainer[action]('webkitTransitionEnd', s.onTransitionEnd, false);
|
14535 | }
|
14536 |
|
14537 |
|
14538 | if (touchTarget === document.body) {
|
14539 | touchTarget = window;
|
14540 | }
|
14541 | touchTarget[action]('scroll', s.onScroll, false);
|
14542 | };
|
14543 |
|
14544 | s.attach = function () {
|
14545 | s.events();
|
14546 | };
|
14547 | s.detach = function () {
|
14548 | s.events(true);
|
14549 | };
|
14550 |
|
14551 |
|
14552 | s.touches = {
|
14553 | direction: 0,
|
14554 | vertical: 0,
|
14555 | isTop: true,
|
14556 | startX: 0,
|
14557 | startY: 0,
|
14558 | currentX: 0,
|
14559 | currentY: 0,
|
14560 | endX: 0,
|
14561 | endY: 0,
|
14562 | diffX: 0,
|
14563 | diffY: 0,
|
14564 | posY: 0,
|
14565 | currentPosY: 0
|
14566 | };
|
14567 | s.preventDefault = function (e) {
|
14568 | e.preventDefault();
|
14569 | };
|
14570 | s.startMouseMove = false;
|
14571 |
|
14572 | s.preventMove = false;
|
14573 | s.onTouchStart = function (e) {
|
14574 | s.startMouseMove = true;
|
14575 | s.container.addEventListener(s.isSupportTouch ? 'touchmove' : 'mousemove', s.preventDefault, false);
|
14576 | s.preventMove = true;
|
14577 |
|
14578 | if (s.getScrollTop() <= s.params.isTopPosition) s.touches.isTop = true;else s.touches.isTop = false;
|
14579 |
|
14580 | s.topContainer.style.webkitTransitionDuration = '0ms';
|
14581 |
|
14582 | s.touches.startX = e.clientX || e.touches[0].clientX;
|
14583 | s.touches.startY = e.clientY || e.touches[0].clientY;
|
14584 |
|
14585 |
|
14586 | if (s.timeout) clearTimeout(s.timeout);
|
14587 | };
|
14588 |
|
14589 | s.onTouchMove = function (e) {
|
14590 | if (!s.startMouseMove) return;
|
14591 | s.touches.currentX = e.clientX || e.touches[0].clientX;
|
14592 | s.touches.currentY = e.clientY || e.touches[0].clientY;
|
14593 | s.touches.diffY = s.touches.currentY - s.touches.startY;
|
14594 | s.touches.diffX = s.touches.startX - s.touches.currentX;
|
14595 |
|
14596 |
|
14597 | if (s.touches.direction === 0) {
|
14598 | s.touches.direction = Math.abs(s.touches.diffX) > Math.abs(s.touches.diffY) ? 1 : -1;
|
14599 | }
|
14600 |
|
14601 | if (s.touches.direction === -1) {
|
14602 | s.touches.vertical = s.touches.diffY < 0 ? 1 : -1;
|
14603 | }
|
14604 |
|
14605 | if (s.touches.isTop && s.touches.vertical === -1) {
|
14606 | if (s.isLoading) return;
|
14607 |
|
14608 | if (s.preventMove === false) {
|
14609 | console.log('上拉阻止滚动条滚动');
|
14610 | s.container.addEventListener(s.isSupportTouch ? 'touchmove' : 'mousemove', s.preventDefault, false);
|
14611 | s.preventMove = true;
|
14612 | }
|
14613 |
|
14614 | s.touches.currentPosY = s.touches.posY + s.touches.diffY;
|
14615 | if (s.params.end && s.touches.currentPosY >= s.params.end) {
|
14616 |
|
14617 | s.touches.currentPosY = s.params.end;
|
14618 | if (s.params.endRefresh) s.onTouchEnd();
|
14619 | } else {
|
14620 |
|
14621 | if (s.params.onPull) s.params.onPull(s);
|
14622 | }
|
14623 |
|
14624 | if (s.params.moveTimeout) {
|
14625 | if (s.timeout) {
|
14626 | clearTimeout(s.timeout);
|
14627 | }
|
14628 | s.timeout = setTimeout(function () {
|
14629 | console.log('滑动超时');
|
14630 | s.onTouchEnd();
|
14631 | }, s.params.moveTimeout || 1000);
|
14632 | }
|
14633 | } else {
|
14634 | if (s.preventMove === true) {
|
14635 | console.log('滚动移除阻止滚动条');
|
14636 | s.container.removeEventListener(s.isSupportTouch ? 'touchmove' : 'mousemove', s.preventDefault, false);
|
14637 | s.preventMove = false;
|
14638 | }
|
14639 | }
|
14640 | };
|
14641 | s.onTouchEnd = function (e) {
|
14642 | s.startMouseMove = false;
|
14643 |
|
14644 | s.touches.direction = 0;
|
14645 | s.touches.vertical = 0;
|
14646 |
|
14647 | if (s.touches.currentPosY > 0) {
|
14648 | if (s.touches.currentPosY > s.params.threshold) {
|
14649 |
|
14650 | s.showTop();
|
14651 | } else {
|
14652 |
|
14653 | s.hideTop();
|
14654 | }
|
14655 | }
|
14656 |
|
14657 | if (s.timeout) clearTimeout(s.timeout);
|
14658 | };
|
14659 | s.onTransitionEnd = function (e) {
|
14660 | if (e.target !== s.topContainer || e.propertyName === 'visibility') return;
|
14661 |
|
14662 | if (s.touches.posY === s.params.threshold && !s.isLoading) {
|
14663 | s.topRefresh();
|
14664 | }
|
14665 |
|
14666 |
|
14667 |
|
14668 | if (s.params.onTransitionEnd) s.params.onTransitionEnd(s);
|
14669 | if (s.isHid) {
|
14670 |
|
14671 | if (s.params.onTopHid) s.params.onTopHid(s);
|
14672 | } else {
|
14673 |
|
14674 | if (s.params.onTopShowed) s.params.onTopShowed(s);
|
14675 | }
|
14676 | };
|
14677 | s.getScrollTop = function (e) {
|
14678 | var scrollTop = s.container === document.body ? document.documentElement.scrollTop : s.container.scrollTop;
|
14679 | return scrollTop;
|
14680 | };
|
14681 | s.onScroll = function (e) {
|
14682 | if (s.params.onScroll) s.params.onScroll(e);
|
14683 | if (!s.params.onBottomRefresh) return;
|
14684 | var clientHeight = s.container.clientHeight;
|
14685 | var scrollHeight = s.container.scrollHeight;
|
14686 | var scrollTop = s.container === document.body ? document.documentElement.scrollTop : s.container.scrollTop;
|
14687 |
|
14688 | if (scrollTop + clientHeight >= scrollHeight - 2) {
|
14689 | s.bottomRefresh();
|
14690 | }
|
14691 | };
|
14692 |
|
14693 | s.init = function () {
|
14694 | s.attach();
|
14695 | };
|
14696 |
|
14697 | s.init();
|
14698 | };
|
14699 |
|
14700 | var Dragrefresh_instance = (instance_Dragrefresh);
|
14701 |
|
14702 | var Dragrefresh_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; };
|
14703 |
|
14704 | var Dragrefresh_class, Dragrefresh_temp;
|
14705 |
|
14706 | function Dragrefresh_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
14707 |
|
14708 | function Dragrefresh_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
14709 |
|
14710 | function Dragrefresh_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
14711 |
|
14712 |
|
14713 |
|
14714 |
|
14715 |
|
14716 |
|
14717 |
|
14718 | if (!window._seeds_lang) window._seeds_lang = {};
|
14719 |
|
14720 | var Dragrefresh_Dragrefresh = (Dragrefresh_temp = Dragrefresh_class = function (_Component) {
|
14721 | Dragrefresh_inherits(Dragrefresh, _Component);
|
14722 |
|
14723 | function Dragrefresh(props) {
|
14724 | Dragrefresh_classCallCheck(this, Dragrefresh);
|
14725 |
|
14726 | var _this = Dragrefresh_possibleConstructorReturn(this, _Component.call(this, props));
|
14727 |
|
14728 | _this.componentDidUpdate = function (prevProps) {
|
14729 | if (prevProps.hasMore === _this.props.hasMore) return;
|
14730 |
|
14731 | _this.setPagination(prevProps.hasMore, _this.props.hasMore);
|
14732 | };
|
14733 |
|
14734 | _this.init = function () {
|
14735 | var onScroll = _this.props.onScroll;
|
14736 |
|
14737 | var instance = new Dragrefresh_instance({
|
14738 | threshold: _this.props.threshold,
|
14739 | end: _this.props.end,
|
14740 | endRefresh: _this.props.endRefresh,
|
14741 | moveTimeout: _this.props.moveTimeout,
|
14742 | container: _this.$el,
|
14743 | onScroll: onScroll,
|
14744 | onTopRefresh: _this.onTopRefresh,
|
14745 | onBottomRefresh: _this.onBottomRefresh,
|
14746 |
|
14747 | topContainer: _this.$elTopBox,
|
14748 |
|
14749 | duration: 150,
|
14750 | onPull: function onPull(e) {
|
14751 | var topContainer = e.topContainer;
|
14752 | topContainer.style.height = e.touches.currentPosY + 'px';
|
14753 | var topIcon = topContainer.querySelector('.df-pull-icon');
|
14754 | var topCaption = topContainer.querySelector('.df-pull-caption');
|
14755 | if (!e.isLoading) {
|
14756 | if (e.touches.currentPosY >= e.params.threshold) {
|
14757 | if (topIcon) topIcon.classList.add('df-pull-icon-down');
|
14758 | if (topCaption) topCaption.innerHTML = window._seeds_lang['release'] || '释放立即刷新';
|
14759 | } else {
|
14760 | if (topIcon) topIcon.classList.remove('df-pull-icon-down');
|
14761 | if (topCaption) topCaption.innerHTML = window._seeds_lang['pull_down'] || '下拉可以刷新';
|
14762 | }
|
14763 | }
|
14764 | },
|
14765 | onShowTop: function onShowTop(e) {
|
14766 | var topContainer = e.topContainer;
|
14767 | var topIcon = topContainer.querySelector('.df-pull-icon');
|
14768 | var topCaption = topContainer.querySelector('.df-pull-caption');
|
14769 | topContainer.style.height = e.params.threshold + 'px';
|
14770 | if (topIcon) topIcon.classList.remove('df-pull-icon-down');
|
14771 | if (topIcon) topIcon.classList.add('df-pull-icon-loading');
|
14772 | if (topCaption) topCaption.innerHTML = window._seeds_lang['refreshing'] || '正在刷新...';
|
14773 | },
|
14774 | onHideTop: function onHideTop(e) {
|
14775 | var topContainer = e.topContainer;
|
14776 | topContainer.style.height = '0';
|
14777 | },
|
14778 | onTopHid: function onTopHid(e) {
|
14779 | var topContainer = e.topContainer;
|
14780 | var topIcon = topContainer.querySelector('.df-pull-icon');
|
14781 | if (topIcon) topIcon.classList.remove('df-pull-icon-down');
|
14782 | if (topIcon) topIcon.classList.remove('df-pull-icon-loading');
|
14783 | }
|
14784 | });
|
14785 | _this.instance = instance;
|
14786 | };
|
14787 |
|
14788 | _this.onTopRefresh = function () {
|
14789 | _this.props.onTopRefresh();
|
14790 | };
|
14791 |
|
14792 | _this.onBottomRefresh = function () {
|
14793 | if (!_this.props.onBottomRefresh) return;
|
14794 | var hasMore = _this.props.hasMore;
|
14795 |
|
14796 | if (hasMore !== 0 && hasMore !== -1 && hasMore !== 404) {
|
14797 | _this.props.onBottomRefresh();
|
14798 | } else {
|
14799 | if (_this.instance) _this.instance.isLoading = false;
|
14800 | }
|
14801 | };
|
14802 |
|
14803 | _this.lazyLoad = function () {
|
14804 | if (!_this.$el) return;
|
14805 | if (_this.timeout) window.clearTimeout(_this.timeout);
|
14806 | _this.timeout = setTimeout(function () {
|
14807 | if (_this.lazy) {
|
14808 | _this.lazy.load();
|
14809 | } else {
|
14810 | _this.lazy = new src_ImgLazy({
|
14811 | overflowContainer: _this.$el
|
14812 | });
|
14813 | _this.lazy.load();
|
14814 | }
|
14815 | }, 500);
|
14816 | };
|
14817 |
|
14818 | _this.setPagination = function (prevHasMore, hasMore) {
|
14819 |
|
14820 | if (!_this.instance) {
|
14821 | setTimeout(function () {
|
14822 | _this.setPagination(prevHasMore, hasMore);
|
14823 | }, 100);
|
14824 | return;
|
14825 | }
|
14826 | console.log('hasMore: \u7531' + prevHasMore + '\u53D8\u6210' + hasMore);
|
14827 |
|
14828 | if (_this.props.showNoData && hasMore === 404) {
|
14829 | _this.instance.detach();
|
14830 | } else if (_this.props.showNoData && prevHasMore === 404 && hasMore !== 404) {
|
14831 | _this.instance.attach();
|
14832 | }
|
14833 |
|
14834 | if (hasMore !== -2) {
|
14835 | _this.instance.hideTop();
|
14836 | }
|
14837 |
|
14838 | _this.instance.isLoading = false;
|
14839 |
|
14840 | if (hasMore === 1) {
|
14841 |
|
14842 | if (!_this.instance.hasScroll()) {
|
14843 | console.log('还有数据,但没有滚动条,继续加载...');
|
14844 | _this.instance.bottomRefresh();
|
14845 | }
|
14846 | }
|
14847 |
|
14848 | if (_this.props.lazyLoad) _this.lazyLoad();
|
14849 | };
|
14850 |
|
14851 | return _this;
|
14852 | }
|
14853 |
|
14854 | Dragrefresh.prototype.componentDidMount = function componentDidMount() {
|
14855 | this.init();
|
14856 | this.setPagination(undefined, this.props.hasMore);
|
14857 | };
|
14858 |
|
14859 |
|
14860 |
|
14861 |
|
14862 |
|
14863 |
|
14864 |
|
14865 |
|
14866 |
|
14867 |
|
14868 |
|
14869 | Dragrefresh.prototype.render = function render() {
|
14870 | var _this2 = this;
|
14871 |
|
14872 | var _props = this.props,
|
14873 | style = _props.style,
|
14874 | className = _props.className,
|
14875 | onTopRefresh = _props.onTopRefresh,
|
14876 | onBottomRefresh = _props.onBottomRefresh,
|
14877 | showNoData = _props.showNoData,
|
14878 | hasMore = _props.hasMore,
|
14879 | noDataParams = _props.noDataParams,
|
14880 | bottomLoadingCaption = _props.bottomLoadingCaption,
|
14881 | bottomNoDataCaption = _props.bottomNoDataCaption,
|
14882 | bottomErrorCaption = _props.bottomErrorCaption,
|
14883 | onClickBottomError = _props.onClickBottomError;
|
14884 |
|
14885 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
14886 | 'div',
|
14887 | { ref: function ref(el) {
|
14888 | _this2.$el = el;
|
14889 | }, className: 'container' + (className ? ' ' + className : ''), style: style },
|
14890 | onTopRefresh && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
14891 | 'div',
|
14892 | { ref: function ref(el) {
|
14893 | _this2.$elTopBox = el;
|
14894 | }, className: 'SID-Dragrefresh-TopContainer df-pull' },
|
14895 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
14896 | 'div',
|
14897 | { className: 'df-pull-box' },
|
14898 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'df-pull-icon' }),
|
14899 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
14900 | 'div',
|
14901 | { className: 'df-pull-caption' },
|
14902 | window._seeds_lang['pull_down'] || '下拉可以刷新'
|
14903 | )
|
14904 | )
|
14905 | ),
|
14906 | this.props.children,
|
14907 | onBottomRefresh && (hasMore === 1 || hasMore === -2) && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
14908 | 'div',
|
14909 | { className: 'SID-Dragrefresh-BottomContainer df-pull', style: { height: '50px' } },
|
14910 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
14911 | 'div',
|
14912 | { className: 'df-pull-box' },
|
14913 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'df-pull-icon df-pull-icon-loading' }),
|
14914 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
14915 | 'div',
|
14916 | { className: 'df-pull-caption' },
|
14917 | bottomLoadingCaption
|
14918 | )
|
14919 | )
|
14920 | ),
|
14921 | onBottomRefresh && hasMore === 0 && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
14922 | 'div',
|
14923 | { className: 'SID-Dragrefresh-NoDataContainer df-pull', style: { height: '50px' } },
|
14924 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
14925 | 'div',
|
14926 | { className: 'df-pull-box' },
|
14927 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
14928 | 'div',
|
14929 | { className: 'df-pull-caption' },
|
14930 | bottomNoDataCaption
|
14931 | )
|
14932 | )
|
14933 | ),
|
14934 | onBottomRefresh && hasMore === -1 && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
14935 | 'div',
|
14936 | { className: 'SID-Dragrefresh-ErrorContainer df-pull', style: { height: '50px' }, onClick: onClickBottomError },
|
14937 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
14938 | 'div',
|
14939 | { className: 'df-pull-box' },
|
14940 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
14941 | 'div',
|
14942 | { className: 'df-pull-caption' },
|
14943 | bottomErrorCaption
|
14944 | )
|
14945 | )
|
14946 | ),
|
14947 | hasMore === 404 && showNoData && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(src_Notice, Dragrefresh_extends({ caption: '暂无数据' }, noDataParams))
|
14948 | );
|
14949 | };
|
14950 |
|
14951 | return Dragrefresh;
|
14952 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Dragrefresh_class.propTypes = {
|
14953 | style: prop_types_default.a.object,
|
14954 | className: prop_types_default.a.string,
|
14955 |
|
14956 | threshold: prop_types_default.a.number,
|
14957 | end: prop_types_default.a.number,
|
14958 | endRefresh: prop_types_default.a.bool,
|
14959 | moveTimeout: prop_types_default.a.number,
|
14960 | onTopRefresh: prop_types_default.a.func,
|
14961 | onTopComplete: prop_types_default.a.func,
|
14962 | onBottomRefresh: prop_types_default.a.func,
|
14963 | onBottomComplete: prop_types_default.a.func,
|
14964 |
|
14965 | children: prop_types_default.a.node,
|
14966 | hasMore: prop_types_default.a.number,
|
14967 |
|
14968 | showNoData: prop_types_default.a.bool,
|
14969 | noDataParams: prop_types_default.a.object,
|
14970 |
|
14971 | lazyLoad: prop_types_default.a.bool,
|
14972 |
|
14973 | onScroll: prop_types_default.a.func,
|
14974 |
|
14975 |
|
14976 | bottomLoadingCaption: prop_types_default.a.string,
|
14977 |
|
14978 | bottomNoDataCaption: prop_types_default.a.string,
|
14979 |
|
14980 | bottomErrorCaption: prop_types_default.a.string,
|
14981 | onClickBottomError: prop_types_default.a.func
|
14982 | }, Dragrefresh_class.defaultProps = {
|
14983 | showNoData: true,
|
14984 | bottomLoadingCaption: window._seeds_lang['loading'] || '正在加载...',
|
14985 | bottomNoDataCaption: window._seeds_lang['no_more_data'] || '没有更多数据了',
|
14986 | bottomErrorCaption: window._seeds_lang['refreshing_failed'] || '加载失败, 请稍后再试'
|
14987 | }, Dragrefresh_temp);
|
14988 |
|
14989 |
|
14990 |
|
14991 |
|
14992 | var src_Dragrefresh = (Dragrefresh_Dragrefresh);
|
14993 |
|
14994 | var Tabbar_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; };
|
14995 |
|
14996 | var Tabbar_class, Tabbar_temp;
|
14997 |
|
14998 | function Tabbar_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
14999 |
|
15000 | function Tabbar_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
15001 |
|
15002 | function Tabbar_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
15003 |
|
15004 |
|
15005 |
|
15006 |
|
15007 | var Tabbar_Tabbar = (Tabbar_temp = Tabbar_class = function (_Component) {
|
15008 | Tabbar_inherits(Tabbar, _Component);
|
15009 |
|
15010 | function Tabbar(props) {
|
15011 | Tabbar_classCallCheck(this, Tabbar);
|
15012 |
|
15013 | var _this = Tabbar_possibleConstructorReturn(this, _Component.call(this, props));
|
15014 |
|
15015 | _this.onClick = function (e) {
|
15016 | var target = e.target;
|
15017 | if (_this.props.exceptOnClickActive && target.classList.contains('active')) return;
|
15018 | var index = target.getAttribute('data-index');
|
15019 | if (!index) return;
|
15020 | if (_this.props.onClick) {
|
15021 | _this.props.onClick(e, _this.props.list[index], Number(index));
|
15022 | e.stopPropagation();
|
15023 | }
|
15024 | };
|
15025 |
|
15026 | _this.getTabbarStyle = function () {
|
15027 | var _this$props = _this.props,
|
15028 | list = _this$props.list,
|
15029 | className = _this$props.className,
|
15030 | style = _this$props.style;
|
15031 |
|
15032 | var tabbarStyle = {};
|
15033 |
|
15034 | if (className.hasClass('tabbar-rect')) {
|
15035 | switch (list.length) {
|
15036 | case 1:
|
15037 | tabbarStyle = { width: '30%' };
|
15038 | break;
|
15039 | case 2:
|
15040 | tabbarStyle = { width: '50%' };
|
15041 | break;
|
15042 | case 3:
|
15043 | tabbarStyle = { width: '50%' };
|
15044 | break;
|
15045 | default:
|
15046 | tabbarStyle = {};
|
15047 | }
|
15048 | }
|
15049 | return Object.assign({}, tabbarStyle, style);
|
15050 | };
|
15051 |
|
15052 | _this.getTabbarClassName = function () {
|
15053 | var _this$props2 = _this.props,
|
15054 | className = _this$props2.className,
|
15055 | tiled = _this$props2.tiled;
|
15056 |
|
15057 | return 'tabbar animated' + (className ? ' ' + className : ' tabbar-line-width60') + (tiled ? ' tabbar-tiled' : '');
|
15058 | };
|
15059 |
|
15060 | _this.getIconDOM = function (icon, iconActive, isActive) {
|
15061 | if (isActive) {
|
15062 | return iconActive ? iconActive : icon;
|
15063 | }
|
15064 | return icon;
|
15065 | };
|
15066 |
|
15067 | _this.getTabsDOM = function () {
|
15068 | var _this$props3 = _this.props,
|
15069 | list = _this$props3.list,
|
15070 | activeIndex = _this$props3.activeIndex,
|
15071 | captionClassName = _this$props3.captionClassName,
|
15072 | captionStyle = _this$props3.captionStyle,
|
15073 | sndCaptionClassName = _this$props3.sndCaptionClassName,
|
15074 | sndCaptionStyle = _this$props3.sndCaptionStyle;
|
15075 |
|
15076 |
|
15077 | var tabStyle = {};
|
15078 | if (_this.props.style && _this.props.style.height) {
|
15079 | tabStyle = {
|
15080 | height: _this.props.style.height
|
15081 | };
|
15082 | }
|
15083 |
|
15084 | return list.map(function (item, index) {
|
15085 | var icon = item.icon,
|
15086 | iconActive = item.iconActive,
|
15087 | ricon = item.ricon,
|
15088 | riconActive = item.riconActive,
|
15089 | name = item.name,
|
15090 | caption = item.caption,
|
15091 | sndcaption = item.sndcaption,
|
15092 | active = item.active,
|
15093 | _item$attributes = item.attributes,
|
15094 | attributes = _item$attributes === undefined ? {} : _item$attributes,
|
15095 | _item$style = item.style,
|
15096 | style = _item$style === undefined ? {} : _item$style;
|
15097 |
|
15098 | var isActive = active || activeIndex === index;
|
15099 | var liconDOM = null;
|
15100 | if (icon) {
|
15101 | liconDOM = _this.getIconDOM(icon, iconActive, isActive);
|
15102 | }
|
15103 | var riconDOM = null;
|
15104 | if (ricon) {
|
15105 | riconDOM = _this.getIconDOM(ricon, riconActive, isActive);
|
15106 | }
|
15107 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
15108 | 'li',
|
15109 | Tabbar_extends({ className: 'tab' + (isActive ? ' active' : ''), style: Object.assign(tabStyle, style || {}), 'data-index': index, key: index }, attributes),
|
15110 | liconDOM && liconDOM,
|
15111 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
15112 | 'div',
|
15113 | { className: 'tab-content' },
|
15114 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
15115 | 'div',
|
15116 | { className: 'tab-caption' + (captionClassName ? ' ' + captionClassName : ''), style: captionStyle },
|
15117 | caption || name
|
15118 | ),
|
15119 | sndcaption && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
15120 | 'div',
|
15121 | { className: 'tab-sndcaption' + (sndCaptionClassName ? ' ' + sndCaptionClassName : ''), style: sndCaptionStyle },
|
15122 | sndcaption
|
15123 | )
|
15124 | ),
|
15125 | riconDOM && riconDOM
|
15126 | );
|
15127 | });
|
15128 | };
|
15129 |
|
15130 | _this.state = {};
|
15131 | return _this;
|
15132 | }
|
15133 |
|
15134 | Tabbar.prototype.render = function render() {
|
15135 | var _this2 = this;
|
15136 |
|
15137 | var disabled = this.props.disabled;
|
15138 |
|
15139 |
|
15140 | var tabbarStyle = this.getTabbarStyle();
|
15141 |
|
15142 | var tabbarClassName = this.getTabbarClassName();
|
15143 |
|
15144 | var tabsDOM = this.getTabsDOM();
|
15145 |
|
15146 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
15147 | 'ul',
|
15148 | { ref: function ref(el) {
|
15149 | _this2.$el = el;
|
15150 | }, className: tabbarClassName, disabled: disabled, style: tabbarStyle, onClick: this.onClick },
|
15151 | tabsDOM
|
15152 | );
|
15153 | };
|
15154 |
|
15155 | return Tabbar;
|
15156 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Tabbar_class.propTypes = {
|
15157 | style: prop_types_default.a.object,
|
15158 | className: prop_types_default.a.string,
|
15159 |
|
15160 | captionClassName: prop_types_default.a.string,
|
15161 | captionStyle: prop_types_default.a.object,
|
15162 |
|
15163 | sndCaptionClassName: prop_types_default.a.string,
|
15164 | sndCaptionStyle: prop_types_default.a.object,
|
15165 |
|
15166 | list: prop_types_default.a.array,
|
15167 |
|
15168 | tiled: prop_types_default.a.bool,
|
15169 | disabled: prop_types_default.a.bool,
|
15170 | exceptOnClickActive: prop_types_default.a.bool,
|
15171 | onClick: prop_types_default.a.func,
|
15172 | activeIndex: prop_types_default.a.number
|
15173 | }, Tabbar_class.defaultProps = {
|
15174 | list: [],
|
15175 |
|
15176 |
|
15177 |
|
15178 |
|
15179 |
|
15180 |
|
15181 |
|
15182 |
|
15183 |
|
15184 |
|
15185 |
|
15186 |
|
15187 |
|
15188 |
|
15189 |
|
15190 | exceptOnClickActive: true,
|
15191 | className: 'tabbar-line tabbar-line-width70 border-b',
|
15192 | activeIndex: 0
|
15193 | }, Tabbar_temp);
|
15194 |
|
15195 |
|
15196 |
|
15197 |
|
15198 | var src_Tabbar = (Tabbar_Tabbar);
|
15199 |
|
15200 |
|
15201 | var instance_MenuTiled = function MenuTiled(container, params) {
|
15202 | |
15203 |
|
15204 |
|
15205 | var defaults = {
|
15206 |
|
15207 | data: null,
|
15208 | slotClass: 'menutiled-slot',
|
15209 | slotSubClass: 'menutiled-slot-sub',
|
15210 | tagClass: 'menutiled-tag',
|
15211 | moreClass: 'menutiled-more',
|
15212 | activeClass: 'active',
|
15213 | extendClass: 'extend',
|
15214 |
|
15215 | selectedId: ''
|
15216 | |
15217 |
|
15218 |
|
15219 |
|
15220 |
|
15221 | |
15222 |
|
15223 |
|
15224 |
|
15225 |
|
15226 |
|
15227 | };params = params || {};
|
15228 | for (var def in defaults) {
|
15229 | if (params[def] === undefined) {
|
15230 | params[def] = defaults[def];
|
15231 | }
|
15232 | }
|
15233 |
|
15234 | var s = this;
|
15235 |
|
15236 |
|
15237 | s.params = params;
|
15238 |
|
15239 | s.container = typeof container === 'string' ? document.querySelector(container) : container;
|
15240 | if (!s.container) {
|
15241 | console.log('SeedsUI Error:未找到MenuTiled的DOM对象,请检查传入参数是否正确');
|
15242 | return;
|
15243 | }
|
15244 | s.initData = function (list, container) {
|
15245 | if (!list || !list.length) return;
|
15246 | var hasSlot = container.querySelector('.' + s.params.slotClass);
|
15247 | var slot = document.createElement('div');
|
15248 | slot.setAttribute('class', hasSlot ? s.params.slotSubClass : s.params.slotClass);
|
15249 | var html = '';
|
15250 | for (var i = 0, option; option = list[i++];) {
|
15251 |
|
15252 | html += '<div data-index="' + i + '" data-id="' + option.id + '" class="' + s.params.tagClass + (option.id === s.params.selectedId ? ' active' : '') + '">' + '<p class="menutiled-tag-font">' + option.name + '</p>' + (option.children && option.children.length > 0 ? '<i class="menutiled-more"></i>' : '<i class="menutiled-select"></i>') + '</div>';
|
15253 | }
|
15254 | slot.innerHTML = html;
|
15255 | container.appendChild(slot);
|
15256 | };
|
15257 | s.container.innerHTML = '';
|
15258 |
|
15259 | |
15260 |
|
15261 |
|
15262 |
|
15263 | s.setSelectedId = function (id) {
|
15264 | s.params.selectedId = id;
|
15265 | };
|
15266 |
|
15267 | s.setData = function (data) {
|
15268 | s.params.data = data;
|
15269 | s.container.innerHTML = '';
|
15270 | if (!data || !data.length) {
|
15271 | return;
|
15272 | }
|
15273 | s.initData(s.params.data, s.container);
|
15274 | };
|
15275 |
|
15276 | |
15277 |
|
15278 |
|
15279 |
|
15280 | s.events = function (detach) {
|
15281 | var action = detach ? 'removeEventListener' : 'addEventListener';
|
15282 |
|
15283 | s.container[action]('click', s.onClick, false);
|
15284 | };
|
15285 |
|
15286 | s.attach = function () {
|
15287 | s.events();
|
15288 | };
|
15289 | s.detach = function () {
|
15290 | s.events(true);
|
15291 | };
|
15292 | |
15293 |
|
15294 |
|
15295 |
|
15296 | s.onClick = function (e) {
|
15297 | var target = e.target;
|
15298 | s.target = target;
|
15299 | s.targetLine = target;
|
15300 | if (!target.classList.contains(s.params.tagClass)) return;
|
15301 |
|
15302 | var isActived = s.target.classList.contains('active');
|
15303 |
|
15304 | var isExtend = target.classList.contains(s.params.extendClass);
|
15305 |
|
15306 | var id = target.getAttribute('data-id');
|
15307 | var item = s.params.data.getDeepTreeNode(id);
|
15308 |
|
15309 | if (isExtend) {
|
15310 |
|
15311 |
|
15312 | } else {
|
15313 |
|
15314 | var slot = target.parentNode;
|
15315 | var nextSlot = slot.nextElementSibling;
|
15316 | if (nextSlot) slot.parentNode.removeChild(nextSlot);
|
15317 |
|
15318 | var tags = slot.children;
|
15319 | for (var i = 0, tag; tag = tags[i++];) {
|
15320 |
|
15321 | if (tag) {
|
15322 | tag.classList.remove(s.params.extendClass);
|
15323 | tag.classList.remove(s.params.activeClass);
|
15324 | }
|
15325 | }
|
15326 |
|
15327 | target.classList.add(s.params.extendClass);
|
15328 | target.classList.add(s.params.activeClass);
|
15329 |
|
15330 | if (item.children && item.children.length > 0) {
|
15331 | s.initData(item.children, s.container);
|
15332 | }
|
15333 | }
|
15334 |
|
15335 | if (s.params.onClick) s.params.onClick(s, item, isActived, isExtend);
|
15336 | };
|
15337 |
|
15338 | s.init = function () {
|
15339 | if (s.params.data && s.params.data.length) {
|
15340 | if (s.params.data && s.params.data.length) s.initData(s.params.data, s.container);
|
15341 | }
|
15342 | s.attach();
|
15343 | };
|
15344 | s.init();
|
15345 | };
|
15346 |
|
15347 | var MenuTiled_instance = (instance_MenuTiled);
|
15348 |
|
15349 | var MenuTiled_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; };
|
15350 |
|
15351 | var MenuTiled_class, MenuTiled_temp;
|
15352 |
|
15353 | function MenuTiled_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
15354 |
|
15355 | function MenuTiled_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
15356 |
|
15357 | function MenuTiled_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
15358 |
|
15359 | function MenuTiled_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
15360 |
|
15361 |
|
15362 |
|
15363 |
|
15364 |
|
15365 |
|
15366 | var MenuTiled_MenuTiled = (MenuTiled_temp = MenuTiled_class = function (_Component) {
|
15367 | MenuTiled_inherits(MenuTiled, _Component);
|
15368 |
|
15369 | function MenuTiled(props) {
|
15370 | MenuTiled_classCallCheck(this, MenuTiled);
|
15371 |
|
15372 | var _this = MenuTiled_possibleConstructorReturn(this, _Component.call(this, props));
|
15373 |
|
15374 | _this.componentDidUpdate = function (prevProps) {
|
15375 | if (JSON.stringify(prevProps.list) !== JSON.stringify(_this.props.list)) {
|
15376 | if (_this.props.list && _this.props.list.length) {
|
15377 | _this.instance.setSelectedId(_this.props.selectedId);
|
15378 | var list = Object.clone(_this.props.list);
|
15379 | if (JSON.stringify(list).indexOf('"children"') === -1) {
|
15380 | list = list.deepTree();
|
15381 | }
|
15382 | _this.instance.setData(list);
|
15383 | } else {
|
15384 | _this.instance.setData([]);
|
15385 | }
|
15386 | }
|
15387 | };
|
15388 |
|
15389 | _this.componentDidMount = function () {
|
15390 | if (_this.instance) return;
|
15391 | var list = Object.clone(_this.props.list);
|
15392 | if (JSON.stringify(list).indexOf('"children"') === -1) {
|
15393 | list = list.deepTree();
|
15394 | }
|
15395 | var instance = new MenuTiled_instance(_this.$el, {
|
15396 | data: list,
|
15397 | selectedId: _this.props.selectedId,
|
15398 | onClick: _this.onClick
|
15399 | });
|
15400 | _this.instance = instance;
|
15401 | };
|
15402 |
|
15403 | _this.onClick = function (s, item, isActived, isExtend) {
|
15404 |
|
15405 | var childrenCount = item.children && item.children.length ? item.children.length : 0;
|
15406 |
|
15407 | if (_this.props.onClick) _this.props.onClick(s, item, isActived, isExtend, childrenCount);
|
15408 | };
|
15409 |
|
15410 | return _this;
|
15411 | }
|
15412 | |
15413 |
|
15414 |
|
15415 |
|
15416 |
|
15417 |
|
15418 |
|
15419 |
|
15420 | MenuTiled.prototype.render = function render() {
|
15421 | var _this2 = this;
|
15422 |
|
15423 | var _props = this.props,
|
15424 | className = _props.className,
|
15425 | selectedId = _props.selectedId,
|
15426 | onClick = _props.onClick,
|
15427 | list = _props.list,
|
15428 | others = MenuTiled_objectWithoutProperties(_props, ['className', 'selectedId', 'onClick', 'list']);
|
15429 |
|
15430 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', MenuTiled_extends({ ref: function ref(el) {
|
15431 | _this2.$el = el;
|
15432 | }, className: 'menutiled' + (className ? ' ' + className : '') }, others));
|
15433 | };
|
15434 |
|
15435 | return MenuTiled;
|
15436 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), MenuTiled_class.propTypes = {
|
15437 | style: prop_types_default.a.object,
|
15438 | className: prop_types_default.a.string,
|
15439 | selectedId: prop_types_default.a.string,
|
15440 | onClick: prop_types_default.a.func,
|
15441 |
|
15442 | list: prop_types_default.a.array }, MenuTiled_class.defaultProps = {}, MenuTiled_temp);
|
15443 |
|
15444 |
|
15445 |
|
15446 |
|
15447 | var src_MenuTiled = (MenuTiled_MenuTiled);
|
15448 |
|
15449 | var Dropdown_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; };
|
15450 |
|
15451 | var Dropdown_class, Dropdown_temp;
|
15452 |
|
15453 | function Dropdown_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
15454 |
|
15455 | function Dropdown_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
15456 |
|
15457 | function Dropdown_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
15458 |
|
15459 | function Dropdown_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
15460 |
|
15461 |
|
15462 |
|
15463 |
|
15464 |
|
15465 |
|
15466 |
|
15467 | var Dropdown_Dropdown = (Dropdown_temp = Dropdown_class = function (_Component) {
|
15468 | Dropdown_inherits(Dropdown, _Component);
|
15469 |
|
15470 | function Dropdown(props) {
|
15471 | Dropdown_classCallCheck(this, Dropdown);
|
15472 |
|
15473 | var _this = Dropdown_possibleConstructorReturn(this, _Component.call(this, props));
|
15474 |
|
15475 | _this.componentDidUpdate = function (prevProps) {
|
15476 | if (JSON.stringify(prevProps.list) !== JSON.stringify(_this.props.list)) {
|
15477 | _this.refresh();
|
15478 | }
|
15479 | };
|
15480 |
|
15481 | _this.componentDidMount = function () {
|
15482 |
|
15483 | var top = _this.props.top;
|
15484 | if (!top) {
|
15485 | top = _this.$tabbar.$el.offsetTop + 40;
|
15486 | }
|
15487 | _this.setState({
|
15488 | top: top
|
15489 | });
|
15490 |
|
15491 | _this.refresh();
|
15492 | };
|
15493 |
|
15494 | _this.refresh = function () {
|
15495 |
|
15496 | var tabbar = [];
|
15497 | for (var _iterator = _this.props.list, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
|
15498 | var _ref;
|
15499 |
|
15500 | if (_isArray) {
|
15501 | if (_i >= _iterator.length) break;
|
15502 | _ref = _iterator[_i++];
|
15503 | } else {
|
15504 | _i = _iterator.next();
|
15505 | if (_i.done) break;
|
15506 | _ref = _i.value;
|
15507 | }
|
15508 |
|
15509 | var item = _ref;
|
15510 |
|
15511 | tabbar.push({
|
15512 | id: item.id,
|
15513 | name: item.name,
|
15514 | ricon: external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('span', { className: 'icon tab-icon shape-triangle-down' })
|
15515 | });
|
15516 | };
|
15517 | _this.setState({
|
15518 | tabbar: tabbar
|
15519 | });
|
15520 | };
|
15521 |
|
15522 | _this.onClickTab = function (e, item, index) {
|
15523 | if (_this.state.tabbarActiveIndex >= 0) {
|
15524 | _this.setState({
|
15525 |
|
15526 | menusSelectedId: _this.state.tabbar[index].id,
|
15527 | menus: _this.props.list[index].data,
|
15528 |
|
15529 | tabbarActiveIndex: -1,
|
15530 | dialogShow: false
|
15531 | });
|
15532 | } else {
|
15533 | _this.setState({
|
15534 |
|
15535 | menusSelectedId: _this.state.tabbar[index].id,
|
15536 | menus: _this.props.list[index].data,
|
15537 |
|
15538 | tabbarActiveIndex: index,
|
15539 | dialogShow: true
|
15540 | });
|
15541 | }
|
15542 | };
|
15543 |
|
15544 | _this.onClickMask = function () {
|
15545 | _this.setState({
|
15546 | tabbarActiveIndex: -1,
|
15547 | dialogShow: false
|
15548 | });
|
15549 | };
|
15550 |
|
15551 | _this.onClickMenu = function (e, item) {
|
15552 | if (item.children && item.children.length > 0) return;
|
15553 | var tabbar = _this.state.tabbar;
|
15554 | var activeIndex = _this.state.tabbarActiveIndex;
|
15555 |
|
15556 | if (item.id === _this.props.list[activeIndex].id) {
|
15557 | tabbar[activeIndex].id = _this.props.list[activeIndex].id;
|
15558 | tabbar[activeIndex].name = _this.props.list[activeIndex].name;
|
15559 |
|
15560 | } else {
|
15561 | tabbar[activeIndex].id = item.id;
|
15562 | tabbar[activeIndex].name = item.name;
|
15563 | }
|
15564 | _this.setState({
|
15565 | tabbar: tabbar,
|
15566 | tabbarActiveIndex: -1,
|
15567 | dialogShow: false
|
15568 | });
|
15569 |
|
15570 | if (_this.props.onChange) _this.props.onChange(tabbar);
|
15571 | };
|
15572 |
|
15573 | _this.state = {
|
15574 | tabbarActiveIndex: -1,
|
15575 | tabbar: [],
|
15576 | menusSelectedId: '',
|
15577 | menus: [],
|
15578 | top: 0,
|
15579 | dialogShow: false
|
15580 | };
|
15581 | return _this;
|
15582 | }
|
15583 |
|
15584 | Dropdown.prototype.render = function render() {
|
15585 | var _this2 = this;
|
15586 |
|
15587 | var _props = this.props,
|
15588 | portal = _props.portal,
|
15589 | top = _props.top,
|
15590 | disabled = _props.disabled,
|
15591 | onChange = _props.onChange,
|
15592 | list = _props.list,
|
15593 | others = Dropdown_objectWithoutProperties(_props, ['portal', 'top', 'disabled', 'onChange', 'list']);
|
15594 |
|
15595 | var DOM = [external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(src_Tabbar, Dropdown_extends({
|
15596 | key: 'tabbar',
|
15597 | disabled: disabled,
|
15598 | ref: function ref(el) {
|
15599 | _this2.$tabbar = el;
|
15600 | },
|
15601 | exceptOnClickActive: false,
|
15602 | list: this.state.tabbar,
|
15603 | onClick: this.onClickTab,
|
15604 | activeIndex: this.state.tabbarActiveIndex,
|
15605 | className: 'tabbar-dropdown tabbar-tiled border-b'
|
15606 | }, others))];
|
15607 | DOM.push(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
15608 | src_Dialog,
|
15609 | {
|
15610 | key: 'dialog',
|
15611 | portal: this.props.portal,
|
15612 | onClickMask: this.onClickMask,
|
15613 | animation: 'slideDown',
|
15614 | style: { width: '100%' },
|
15615 | maskStyle: { top: this.state.top + 'px' },
|
15616 | show: this.state.dialogShow
|
15617 | },
|
15618 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(src_MenuTiled, {
|
15619 | list: this.state.menus,
|
15620 | selectedId: this.state.menusSelectedId,
|
15621 | onClick: this.onClickMenu
|
15622 | })
|
15623 | ));
|
15624 | return DOM;
|
15625 | };
|
15626 |
|
15627 | return Dropdown;
|
15628 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Dropdown_class.propTypes = {
|
15629 | portal: prop_types_default.a.object,
|
15630 | top: prop_types_default.a.number,
|
15631 | disabled: prop_types_default.a.bool,
|
15632 | onChange: prop_types_default.a.func,
|
15633 | list: prop_types_default.a.array
|
15634 | }, Dropdown_class.defaultProps = {
|
15635 | list: []
|
15636 | }, Dropdown_temp);
|
15637 |
|
15638 |
|
15639 |
|
15640 |
|
15641 | var src_Dropdown = (Dropdown_Dropdown);
|
15642 |
|
15643 | var InputText_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; };
|
15644 |
|
15645 | var InputText_class, InputText_temp;
|
15646 |
|
15647 | function InputText_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
15648 |
|
15649 | function InputText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
15650 |
|
15651 | function InputText_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
15652 |
|
15653 | function InputText_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
15654 |
|
15655 |
|
15656 |
|
15657 |
|
15658 | var InputText_InputText = (InputText_temp = InputText_class = function (_Component) {
|
15659 | InputText_inherits(InputText, _Component);
|
15660 |
|
15661 | function InputText(props) {
|
15662 | InputText_classCallCheck(this, InputText);
|
15663 |
|
15664 | var _this = InputText_possibleConstructorReturn(this, _Component.call(this, props));
|
15665 |
|
15666 | _this.componentDidUpdate = function (prevProps) {
|
15667 | if (prevProps.readOnly !== _this.props.readOnly || prevProps.disabled !== _this.props.disabled) {
|
15668 | _this.updateShowClear();
|
15669 | }
|
15670 | };
|
15671 |
|
15672 | _this.onClick = function (e) {
|
15673 | e.stopPropagation();
|
15674 | var _this$props = _this.props,
|
15675 | onClick = _this$props.onClick,
|
15676 | onClickInput = _this$props.onClickInput,
|
15677 | onClickLicon = _this$props.onClickLicon,
|
15678 | onClickRicon = _this$props.onClickRicon;
|
15679 |
|
15680 | if (_this.props.disabled) return;
|
15681 | var target = e.target;
|
15682 | if (target.classList.contains('clearicon')) {
|
15683 | _this.onClear(e);
|
15684 | } else if (target.classList.contains('licon')) {
|
15685 | if (onClickLicon) onClickLicon(_this.$input.value, Object.getArgs(e, _this.props.args));
|
15686 | } else if (target.classList.contains('ricon')) {
|
15687 | if (onClickRicon) onClickRicon(_this.$input.value, Object.getArgs(e, _this.props.args));
|
15688 | } else if (target.classList.contains('input-text')) {
|
15689 | if (onClick) onClick(_this.$input.value, Object.getArgs(e, _this.props.args));
|
15690 | if (onClickInput) onClickInput(_this.$input.value, Object.getArgs(e, _this.props.args));
|
15691 | } else {
|
15692 | if (onClick) onClick(_this.$input.value, Object.getArgs(e, _this.props.args));
|
15693 | }
|
15694 | };
|
15695 |
|
15696 | _this.preAutoSize = function () {
|
15697 | _this.$input.style.height = _this.$pre.clientHeight + 'px';
|
15698 | };
|
15699 |
|
15700 | _this.onChange = function (e) {
|
15701 | var target = e.target;
|
15702 | var value = target.value;
|
15703 | var _this$props2 = _this.props,
|
15704 | pre = _this$props2.pre,
|
15705 | valueBindProp = _this$props2.valueBindProp,
|
15706 | type = _this$props2.type,
|
15707 | onChange = _this$props2.onChange,
|
15708 | maxLength = _this$props2.maxLength;
|
15709 |
|
15710 |
|
15711 | if (pre) {
|
15712 | _this.$pre.children[0].innerText = value;
|
15713 | _this.preAutoSize();
|
15714 | }
|
15715 |
|
15716 | if (maxLength && value && value.length > maxLength) {
|
15717 | value = value.substring(0, maxLength);
|
15718 | }
|
15719 |
|
15720 | if (type === 'number') {
|
15721 | var _this$props3 = _this.props,
|
15722 | max = _this$props3.max,
|
15723 | digits = _this$props3.digits,
|
15724 | onError = _this$props3.onError;
|
15725 |
|
15726 | value = Math.Calc.correctNumber(e.target.value, { max: max, digits: digits, maxLength: maxLength, onError: onError });
|
15727 | }
|
15728 |
|
15729 | if (onChange) onChange(value, Object.getArgs(e, _this.props.args));
|
15730 |
|
15731 | if (!valueBindProp) _this.updateShowClear(value);
|
15732 | };
|
15733 |
|
15734 | _this.onBlur = function (e) {
|
15735 | var target = e.target;
|
15736 | var value = target.value;
|
15737 | var _this$props4 = _this.props,
|
15738 | valueBindProp = _this$props4.valueBindProp,
|
15739 | min = _this$props4.min,
|
15740 | type = _this$props4.type,
|
15741 | onBlur = _this$props4.onBlur,
|
15742 | onChange = _this$props4.onChange;
|
15743 |
|
15744 | if (type === 'number') {
|
15745 |
|
15746 | value = Math.Calc.correctNumber(value, { min: min });
|
15747 | if (!valueBindProp) target.value = value;
|
15748 | if (onChange) onChange(value, Object.getArgs(e, _this.props.args));
|
15749 | }
|
15750 | if (onBlur) onBlur(value, Object.getArgs(e, _this.props.args));
|
15751 | };
|
15752 |
|
15753 | _this.onFocus = function (e) {
|
15754 | var target = e.target;
|
15755 | var value = target.value;
|
15756 | var _this$props5 = _this.props,
|
15757 | onFocus = _this$props5.onFocus,
|
15758 | readOnly = _this$props5.readOnly;
|
15759 |
|
15760 | if (onFocus) {
|
15761 | onFocus(value, Object.getArgs(e, _this.props.args));
|
15762 | e.stopPropagation();
|
15763 | }
|
15764 | if (readOnly) {
|
15765 | target.blur();
|
15766 | }
|
15767 | };
|
15768 |
|
15769 | _this.onClear = function (e) {
|
15770 | _this.$input.focus();
|
15771 |
|
15772 | var _this$props6 = _this.props,
|
15773 | args = _this$props6.args,
|
15774 | valueBindProp = _this$props6.valueBindProp,
|
15775 | clear = _this$props6.clear,
|
15776 | pre = _this$props6.pre,
|
15777 | onChange = _this$props6.onChange;
|
15778 |
|
15779 | if (!valueBindProp) _this.$input.value = '';
|
15780 | if (clear && typeof clear === 'function') clear('', Object.getArgs(e, args));
|
15781 | if (onChange) {
|
15782 | onChange('', Object.getArgs(e, args));
|
15783 | }
|
15784 |
|
15785 | if (pre) {
|
15786 | _this.preAutoSize();
|
15787 | }
|
15788 | e.stopPropagation();
|
15789 |
|
15790 | if (!valueBindProp) _this.updateShowClear('');
|
15791 | };
|
15792 |
|
15793 | _this.getInputDOM = function () {
|
15794 | var _this$props7 = _this.props,
|
15795 | args = _this$props7.args,
|
15796 | style = _this$props7.style,
|
15797 | className = _this$props7.className,
|
15798 | onClick = _this$props7.onClick,
|
15799 | onChange = _this$props7.onChange,
|
15800 | onClickInput = _this$props7.onClickInput,
|
15801 | onBlur = _this$props7.onBlur,
|
15802 | onFocus = _this$props7.onFocus,
|
15803 | max = _this$props7.max,
|
15804 | min = _this$props7.min,
|
15805 | digits = _this$props7.digits,
|
15806 | licon = _this$props7.licon,
|
15807 | onClickLicon = _this$props7.onClickLicon,
|
15808 | ricon = _this$props7.ricon,
|
15809 | onClickRicon = _this$props7.onClickRicon,
|
15810 | clear = _this$props7.clear,
|
15811 | clearClassName = _this$props7.clearClassName,
|
15812 | clearStyle = _this$props7.clearStyle,
|
15813 | rcaption = _this$props7.rcaption,
|
15814 | pre = _this$props7.pre,
|
15815 | type = _this$props7.type,
|
15816 | valueBindProp = _this$props7.valueBindProp,
|
15817 | autoFocus = _this$props7.autoFocus,
|
15818 | inputClassName = _this$props7.inputClassName,
|
15819 | inputStyle = _this$props7.inputStyle,
|
15820 | maxLength = _this$props7.maxLength,
|
15821 | value = _this$props7.value,
|
15822 | placeholder = _this$props7.placeholder,
|
15823 | readOnly = _this$props7.readOnly,
|
15824 | disabled = _this$props7.disabled,
|
15825 | others = InputText_objectWithoutProperties(_this$props7, ['args', 'style', 'className', 'onClick', 'onChange', 'onClickInput', 'onBlur', 'onFocus', 'max', 'min', 'digits', 'licon', 'onClickLicon', 'ricon', 'onClickRicon', 'clear', 'clearClassName', 'clearStyle', 'rcaption', 'pre', 'type', 'valueBindProp', 'autoFocus', 'inputClassName', 'inputStyle', 'maxLength', 'value', 'placeholder', 'readOnly', 'disabled']);
|
15826 |
|
15827 |
|
15828 |
|
15829 | if (pre) {
|
15830 |
|
15831 | var preLeft = 0;
|
15832 | var preRight = 0;
|
15833 | if (inputStyle) {
|
15834 | if (inputStyle.padding) {
|
15835 | var paddingValues = inputStyle.padding.split(' ');
|
15836 | if (paddingValues.length === 1) {
|
15837 | preLeft = paddingValues[0];
|
15838 | preRight = paddingValues[0];
|
15839 | } else if (paddingValues.length === 2) {
|
15840 | preLeft = paddingValues[1];
|
15841 | preRight = paddingValues[1];
|
15842 | } else if (paddingValues.length === 4) {
|
15843 | preLeft = paddingValues[1];
|
15844 | preRight = paddingValues[3];
|
15845 | }
|
15846 | } else if (inputStyle.paddingLeft || inputStyle.paddingRight) {
|
15847 | preLeft = inputStyle.paddingLeft || '0';
|
15848 | preRight = inputStyle.paddingRight || '0';
|
15849 | }
|
15850 | }
|
15851 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
15852 | 'div',
|
15853 | { className: 'input-pre-box' + (inputClassName ? ' ' + inputClassName : ''), style: inputStyle },
|
15854 | valueBindProp && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('textarea', InputText_extends({ autoFocus: autoFocus, ref: function ref(el) {
|
15855 | _this.$input = el;
|
15856 | }, value: value, maxLength: maxLength, readOnly: readOnly, disabled: disabled, className: 'input-pre', placeholder: placeholder, onChange: _this.onChange, onBlur: _this.onBlur, onFocus: _this.onFocus }, others)),
|
15857 | !valueBindProp && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('textarea', InputText_extends({ autoFocus: autoFocus, ref: function ref(el) {
|
15858 | _this.$input = el;
|
15859 | }, defaultValue: value, maxLength: maxLength, readOnly: readOnly, disabled: disabled, className: 'input-pre', placeholder: placeholder, onChange: _this.onChange, onBlur: _this.onBlur, onFocus: _this.onFocus }, others)),
|
15860 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
15861 | 'pre',
|
15862 | { ref: function ref(el) {
|
15863 | _this.$pre = el;
|
15864 | }, style: { left: preLeft, right: preRight } },
|
15865 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
15866 | 'span',
|
15867 | null,
|
15868 | value
|
15869 | )
|
15870 | )
|
15871 | );
|
15872 | }
|
15873 |
|
15874 | if (type === 'textarea') {
|
15875 |
|
15876 | if (valueBindProp) {
|
15877 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('textarea', InputText_extends({ autoFocus: autoFocus, ref: function ref(el) {
|
15878 | _this.$input = el;
|
15879 | }, value: value, maxLength: maxLength, readOnly: readOnly, disabled: disabled, placeholder: placeholder, onChange: _this.onChange, onBlur: _this.onBlur, onFocus: _this.onFocus, className: 'input-area' + (inputClassName ? ' ' + inputClassName : ''), style: inputStyle }, others));
|
15880 | }
|
15881 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('textarea', InputText_extends({ autoFocus: autoFocus, ref: function ref(el) {
|
15882 | _this.$input = el;
|
15883 | }, defaultValue: value, maxLength: maxLength, readOnly: readOnly, disabled: disabled, placeholder: placeholder, onChange: _this.onChange, onBlur: _this.onBlur, onFocus: _this.onFocus, className: 'input-area' + (inputClassName ? ' ' + inputClassName : ''), style: inputStyle }, others));
|
15884 | }
|
15885 |
|
15886 | if (valueBindProp) {
|
15887 |
|
15888 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('input', InputText_extends({ max: max, min: min, autoFocus: autoFocus, ref: function ref(el) {
|
15889 | _this.$input = el;
|
15890 | }, type: type, value: value, maxLength: maxLength, readOnly: readOnly, disabled: disabled, placeholder: placeholder, onChange: _this.onChange, onBlur: _this.onBlur, onFocus: _this.onFocus, className: 'input-text' + (inputClassName ? ' ' + inputClassName : ''), style: inputStyle }, others));
|
15891 | }
|
15892 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('input', InputText_extends({ max: max, min: min, autoFocus: autoFocus, ref: function ref(el) {
|
15893 | _this.$input = el;
|
15894 | }, type: type, defaultValue: value, maxLength: maxLength, readOnly: readOnly, disabled: disabled, placeholder: placeholder, onChange: _this.onChange, onBlur: _this.onBlur, onFocus: _this.onFocus, className: 'input-text' + (inputClassName ? ' ' + inputClassName : ''), style: inputStyle }, others));
|
15895 | };
|
15896 |
|
15897 | _this.updateShowClear = function (value) {
|
15898 | var _this$props8 = _this.props,
|
15899 | readOnly = _this$props8.readOnly,
|
15900 | disabled = _this$props8.disabled,
|
15901 | clear = _this$props8.clear,
|
15902 | valueBindProp = _this$props8.valueBindProp;
|
15903 |
|
15904 | if (valueBindProp) return;
|
15905 | if (readOnly || disabled || !clear) {
|
15906 | _this.setState({
|
15907 | showClear: false
|
15908 | });
|
15909 | return;
|
15910 | }
|
15911 | var showClear = false;
|
15912 | if (value) {
|
15913 | showClear = true;
|
15914 | } else {
|
15915 | showClear = false;
|
15916 | }
|
15917 | _this.setState({
|
15918 | showClear: showClear
|
15919 | });
|
15920 | };
|
15921 |
|
15922 | _this.state = {
|
15923 | showClear: props.value && props.clear && !props.readOnly && !props.disabled
|
15924 | };
|
15925 | return _this;
|
15926 | }
|
15927 |
|
15928 |
|
15929 |
|
15930 |
|
15931 |
|
15932 |
|
15933 |
|
15934 |
|
15935 |
|
15936 |
|
15937 |
|
15938 |
|
15939 |
|
15940 | InputText.prototype.render = function render() {
|
15941 | var _this2 = this;
|
15942 |
|
15943 | var _props = this.props,
|
15944 | value = _props.value,
|
15945 | valueBindProp = _props.valueBindProp,
|
15946 | readOnly = _props.readOnly,
|
15947 | disabled = _props.disabled,
|
15948 | className = _props.className,
|
15949 | style = _props.style,
|
15950 | licon = _props.licon,
|
15951 | ricon = _props.ricon,
|
15952 | clear = _props.clear,
|
15953 | clearClassName = _props.clearClassName,
|
15954 | clearStyle = _props.clearStyle,
|
15955 | rcaption = _props.rcaption;
|
15956 |
|
15957 |
|
15958 | var showClear = false;
|
15959 | if (value && !readOnly && !disabled) {
|
15960 | showClear = true;
|
15961 | } else {
|
15962 | showClear = false;
|
15963 | }
|
15964 | var isShowClear = valueBindProp ? showClear : this.state.showClear;
|
15965 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
15966 | 'div',
|
15967 | { ref: function ref(el) {
|
15968 | _this2.$el = el;
|
15969 | }, className: 'input-text-box' + (className ? ' ' + className : ''), style: style, onClick: this.onClick },
|
15970 | licon && licon,
|
15971 | this.getInputDOM(),
|
15972 | clear && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('i', { className: 'icon clearicon ' + (isShowClear ? '' : 'hide') + (clearClassName ? ' ' + clearClassName : ''), style: clearStyle }),
|
15973 | ricon && ricon,
|
15974 | rcaption && rcaption
|
15975 | );
|
15976 | };
|
15977 |
|
15978 | return InputText;
|
15979 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), InputText_class.propTypes = {
|
15980 | type: prop_types_default.a.string,
|
15981 | valueBindProp: prop_types_default.a.bool,
|
15982 | pre: prop_types_default.a.bool,
|
15983 |
|
15984 | args: prop_types_default.a.any,
|
15985 | style: prop_types_default.a.object,
|
15986 | className: prop_types_default.a.string,
|
15987 | onClick: prop_types_default.a.func,
|
15988 |
|
15989 | autoFocus: prop_types_default.a.bool,
|
15990 | maxLength: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.number]),
|
15991 | max: prop_types_default.a.oneOfType([
|
15992 | prop_types_default.a.string, prop_types_default.a.number]),
|
15993 | min: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.number]),
|
15994 | digits: prop_types_default.a.oneOfType([prop_types_default.a.bool, prop_types_default.a.string, prop_types_default.a.number]),
|
15995 | readOnly: prop_types_default.a.bool,
|
15996 | disabled: prop_types_default.a.bool,
|
15997 |
|
15998 | inputStyle: prop_types_default.a.object,
|
15999 | inputClassName: prop_types_default.a.string,
|
16000 | value: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.number]),
|
16001 | placeholder: prop_types_default.a.string,
|
16002 | onChange: prop_types_default.a.func,
|
16003 | onClickInput: prop_types_default.a.func,
|
16004 | onBlur: prop_types_default.a.func,
|
16005 | onFocus: prop_types_default.a.func,
|
16006 |
|
16007 | licon: prop_types_default.a.node,
|
16008 | onClickLicon: prop_types_default.a.func,
|
16009 | ricon: prop_types_default.a.node,
|
16010 | onClickRicon: prop_types_default.a.func,
|
16011 |
|
16012 | clear: prop_types_default.a.oneOfType([prop_types_default.a.bool, prop_types_default.a.func]),
|
16013 | clearClassName: prop_types_default.a.string,
|
16014 | clearStyle: prop_types_default.a.object,
|
16015 |
|
16016 | rcaption: prop_types_default.a.node
|
16017 | }, InputText_class.defaultProps = {
|
16018 | type: 'text',
|
16019 | value: '',
|
16020 | readOnly: false,
|
16021 | disabled: false,
|
16022 | clearClassName: 'ricon close-icon-clear size18'
|
16023 | }, InputText_temp);
|
16024 |
|
16025 |
|
16026 |
|
16027 |
|
16028 | var src_InputText = (InputText_InputText);
|
16029 |
|
16030 | var InputPre_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; };
|
16031 |
|
16032 | function InputPre_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
16033 |
|
16034 | function InputPre_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
16035 |
|
16036 | function InputPre_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
16037 |
|
16038 |
|
16039 |
|
16040 |
|
16041 | var InputPre_InputPre = function (_Component) {
|
16042 | InputPre_inherits(InputPre, _Component);
|
16043 |
|
16044 | function InputPre(props) {
|
16045 | InputPre_classCallCheck(this, InputPre);
|
16046 |
|
16047 | return InputPre_possibleConstructorReturn(this, _Component.call(this, props));
|
16048 | }
|
16049 |
|
16050 | InputPre.prototype.componentDidMount = function componentDidMount() {
|
16051 | this.$el = this.refs.$ComponentInputText.$el;
|
16052 | this.$input = this.refs.$ComponentInputText.$input;
|
16053 | };
|
16054 |
|
16055 | InputPre.prototype.render = function render() {
|
16056 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(src_InputText, InputPre_extends({ ref: '$ComponentInputText' }, this.props, { pre: true }));
|
16057 | };
|
16058 |
|
16059 | return InputPre;
|
16060 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]);
|
16061 |
|
16062 |
|
16063 |
|
16064 |
|
16065 |
|
16066 | var src_InputPre = (InputPre_InputPre);
|
16067 |
|
16068 |
|
16069 | var instance_Emoji = function Emoji(params) {
|
16070 | |
16071 |
|
16072 |
|
16073 | var defaults = {
|
16074 | data: null,
|
16075 |
|
16076 | mask: null,
|
16077 | maskClass: 'emoji-mask',
|
16078 | maskActiveClass: 'active',
|
16079 | isClickMaskHide: true,
|
16080 |
|
16081 | containerClass: 'emoji',
|
16082 | containerActiveClass: 'active',
|
16083 |
|
16084 | submitClass: 'emoji-edit-submit',
|
16085 |
|
16086 | textareaClass: 'emoji-edit-input',
|
16087 |
|
16088 | iconClass: 'emoji-edit-icon',
|
16089 |
|
16090 | faceClass: 'emoji-face',
|
16091 | faceNameAttr: 'title',
|
16092 | faceIdAttr: 'data-emoji',
|
16093 | deleteClass: 'emoji-face-delete',
|
16094 |
|
16095 | carrouselClass: 'emoji-carrousel'
|
16096 | |
16097 |
|
16098 |
|
16099 |
|
16100 |
|
16101 |
|
16102 | };
|
16103 | params = params || {};
|
16104 | for (var def in defaults) {
|
16105 | if (params[def] === undefined) {
|
16106 | params[def] = defaults[def];
|
16107 | }
|
16108 | }
|
16109 |
|
16110 |
|
16111 | var s = this;
|
16112 |
|
16113 |
|
16114 | s.params = params;
|
16115 |
|
16116 |
|
16117 | s.mask = typeof s.params.mask === 'string' ? document.querySelector(s.params.mask) : s.params.mask;
|
16118 | if (!s.mask) {
|
16119 | console.log('SeedsUI Error:未找到Emoji的mask元素,请检查传入参数是否正确');
|
16120 | return;
|
16121 | }
|
16122 |
|
16123 |
|
16124 | s.container = s.mask.querySelector('.' + s.params.containerClass);
|
16125 | if (!s.container) {
|
16126 | console.log('SeedsUI Error:未找到Emoji的container元素,请检查传入参数是否正确');
|
16127 | return;
|
16128 | }
|
16129 |
|
16130 |
|
16131 | s.textarea = s.mask.querySelector('.' + s.params.textareaClass + ' textarea');
|
16132 | if (!s.textarea) {
|
16133 | console.log('SeedsUI Error:未找到Emoji的textarea元素,请检查传入参数是否正确');
|
16134 | return;
|
16135 | }
|
16136 | if (s.textarea.tagName !== 'TEXTAREA') {
|
16137 | console.log('SeedsUI Error:Emoji的textarea元素必须为一个textarea');
|
16138 | return;
|
16139 | }
|
16140 |
|
16141 |
|
16142 | s.icon = s.mask.querySelector('.' + s.params.iconClass);
|
16143 | if (!s.textarea) {
|
16144 | console.log('SeedsUI Error:未找到Emoji的icon元素,请检查传入参数是否正确');
|
16145 | return;
|
16146 | }
|
16147 |
|
16148 |
|
16149 | s.carrousel = s.mask.querySelector('.' + s.params.carrouselClass);
|
16150 | if (!s.textarea) {
|
16151 | console.log('SeedsUI Error:未找到Emoji的carrousel元素,请检查传入参数是否正确');
|
16152 | return;
|
16153 | }
|
16154 | |
16155 |
|
16156 |
|
16157 |
|
16158 | s.setData = function (data) {
|
16159 | s.params.data = data;
|
16160 | };
|
16161 |
|
16162 | s.showMask = function () {
|
16163 | s.mask.classList.add(s.params.maskActiveClass);
|
16164 | };
|
16165 | s.hideMask = function () {
|
16166 | s.mask.classList.remove(s.params.maskActiveClass);
|
16167 | };
|
16168 | s.destroyMask = function () {
|
16169 | s.mask.parentNode.removeChild(s.mask);
|
16170 | };
|
16171 | s.showContainer = function () {
|
16172 | s.container.classList.add(s.params.containerActiveClass);
|
16173 | };
|
16174 | s.hideContainer = function () {
|
16175 | s.container.classList.remove(s.params.containerActiveClass);
|
16176 | };
|
16177 | s.show = function () {
|
16178 | s.showMask();
|
16179 | s.showContainer();
|
16180 | };
|
16181 | s.hide = function () {
|
16182 | s.hideMask();
|
16183 | s.hideContainer();
|
16184 | };
|
16185 |
|
16186 | s.parse = function (str) {
|
16187 | var emojiExpr = /(\[[\u4E00-\u9FA5]*\])/gm;
|
16188 | var parseStr = str;
|
16189 | while (emojiExpr.exec(str)) {
|
16190 | if (s.params.data[RegExp.$1]) {
|
16191 | parseStr = parseStr.replace(RegExp.$1, '<span ' + s.params.faceIdAttr + '=' + s.params.data[RegExp.$1] + '></span>');
|
16192 | }
|
16193 | }
|
16194 | return parseStr;
|
16195 | };
|
16196 |
|
16197 | s.cursorOffset = 0;
|
16198 |
|
16199 |
|
16200 | s.insertFace = function (emojiName) {
|
16201 |
|
16202 | var value = s.textarea.value;
|
16203 | var valueBefore = value.substr(0, s.cursorOffset);
|
16204 | var valueAfter = value.substr(s.cursorOffset, value.length);
|
16205 | var valueInsert = emojiName;
|
16206 | s.cursorOffset = s.cursorOffset + emojiName.length;
|
16207 | s.textarea.value = valueBefore + valueInsert + valueAfter;
|
16208 |
|
16209 |
|
16210 |
|
16211 | return s.textarea.value;
|
16212 | };
|
16213 |
|
16214 | s.deleteFace = function () {
|
16215 |
|
16216 | var value = s.textarea.value;
|
16217 | var valueBefore = value.substr(0, s.cursorOffset);
|
16218 | var valueAfter = value.substr(s.cursorOffset, value.length);
|
16219 | var isDeleted = false;
|
16220 | if (!valueBefore) return value;
|
16221 |
|
16222 | for (var face in s.params.data) {
|
16223 | if (valueBefore.lastIndexOf(face) !== -1 && valueBefore.lastIndexOf(face) === valueBefore.length - face.length) {
|
16224 | valueBefore = valueBefore.substring(0, valueBefore.lastIndexOf(face));
|
16225 | isDeleted = true;
|
16226 | break;
|
16227 | }
|
16228 | }
|
16229 |
|
16230 | if (!isDeleted) {
|
16231 | valueBefore = valueBefore.substring(0, valueBefore.length - 1);
|
16232 | }
|
16233 | s.cursorOffset = valueBefore.length;
|
16234 | s.textarea.value = valueBefore + valueAfter;
|
16235 |
|
16236 |
|
16237 |
|
16238 | return s.textarea.value;
|
16239 | };
|
16240 |
|
16241 | s.setCaretPosition = function (input, pos) {
|
16242 | if (!input) return;
|
16243 | if (input.createTextRange) {
|
16244 | var range = input.createTextRange();
|
16245 | range.move('character', pos);
|
16246 | range.select();
|
16247 | } else {
|
16248 | if (input.selectionStart) {
|
16249 | input.focus();
|
16250 | input.setSelectionRange(pos, pos);
|
16251 | } else {
|
16252 | input.focus();
|
16253 | }
|
16254 | }
|
16255 | };
|
16256 | |
16257 |
|
16258 |
|
16259 | s.preventDefault = function (e) {
|
16260 | e.preventDefault();
|
16261 | };
|
16262 | s.events = function (detach) {
|
16263 | var action = detach ? 'removeEventListener' : 'addEventListener';
|
16264 | s.mask[action]('click', s.onClick, false);
|
16265 |
|
16266 | if (navigator.userAgent.toLowerCase().match(/cpu iphone os (.*?) like mac os/)) {
|
16267 |
|
16268 | s.textarea[action]('focus', s.onFocus, false);
|
16269 |
|
16270 | s.mask[action]('touchmove', s.preventDefault, false);
|
16271 |
|
16272 | s.textarea[action]('blur', s.onBlur, false);
|
16273 | }
|
16274 |
|
16275 | document[action]('selectionchange', s.onSelectionChange, false);
|
16276 | s.textarea[action]('input', s.onInput, false);
|
16277 | };
|
16278 | s.attach = function () {
|
16279 | s.events();
|
16280 | };
|
16281 | s.detach = function () {
|
16282 | s.events(false);
|
16283 | };
|
16284 | s.onClick = function (e) {
|
16285 | var target = e.target;
|
16286 | if (target.classList.contains(s.params.faceClass)) {
|
16287 |
|
16288 | var value = s.insertFace(target.getAttribute(s.params.faceNameAttr));
|
16289 | if (s.params.onChange) s.params.onChange(value, s);
|
16290 | } else if (target.classList.contains(s.params.iconClass)) {
|
16291 |
|
16292 | if (s.carrousel.style.display === 'none') {
|
16293 | setTimeout(function () {
|
16294 | s.carrousel.style.display = 'block';
|
16295 | s.icon.classList.add('active');
|
16296 | }, 100);
|
16297 |
|
16298 | s.textarea.disabled = true;
|
16299 | } else {
|
16300 | s.carrousel.style.display = 'none';
|
16301 | s.icon.classList.remove('active');
|
16302 | }
|
16303 | } else if (target.classList.contains(s.params.maskClass)) {
|
16304 |
|
16305 | if (s.params.onClickMask) s.params.onClickMask(s, e);
|
16306 | if (s.params.isClickMaskHide) s.hide();
|
16307 | } else if (target.classList.contains(s.params.submitClass)) {
|
16308 |
|
16309 | if (s.params.onClickSubmit) s.params.onClickSubmit(s.textarea.value, s, e);
|
16310 | if (s.params.isClickMaskHide) s.hide();
|
16311 | } else if (target.classList.contains(s.params.deleteClass)) {
|
16312 |
|
16313 | s.deleteFace();
|
16314 | } else if (target.tagName === 'TEXTAREA') {
|
16315 |
|
16316 | s.icon.classList.remove('active');
|
16317 | s.carrousel.style.display = 'none';
|
16318 | s.textarea.disabled = false;
|
16319 | s.textarea.focus();
|
16320 | }
|
16321 | e.stopPropagation();
|
16322 | };
|
16323 |
|
16324 | s.onFocus = function () {
|
16325 | setTimeout(function () {
|
16326 | document.body.scrollTop = document.body.scrollHeight;
|
16327 | }, 300);
|
16328 | };
|
16329 |
|
16330 | s.onBlur = function () {
|
16331 | setTimeout(function () {
|
16332 | document.body.scrollTop = 0;
|
16333 | }, 10);
|
16334 | };
|
16335 |
|
16336 | s.onSelectionChange = function (e) {
|
16337 | if (Object.prototype.toString.call(e.target.activeElement) === '[object HTMLTextAreaElement]') {
|
16338 | s.cursorOffset = s.textarea.selectionStart;
|
16339 | }
|
16340 | };
|
16341 | s.onInput = function (e) {
|
16342 | s.cursorOffset = e.target.selectionStart;
|
16343 | };
|
16344 | |
16345 |
|
16346 |
|
16347 | s.init = function () {
|
16348 | s.attach();
|
16349 | };
|
16350 | s.init();
|
16351 | };
|
16352 |
|
16353 | var Emoji_instance = (instance_Emoji);
|
16354 |
|
16355 | var emojis = {
|
16356 | '[微笑]': '[weixiao]',
|
16357 | '[撇嘴]': '[piezui]',
|
16358 | '[色]': '[se]',
|
16359 | '[发呆]': '[fadai]',
|
16360 | '[酷]': '[cool]',
|
16361 | '[大哭]': '[daku]',
|
16362 | '[害羞]': '[haixiu]',
|
16363 | '[闭嘴]': '[bizui]',
|
16364 |
|
16365 | '[睡觉]': '[shuijiao]',
|
16366 | '[哭]': '[ku]',
|
16367 | '[尴尬]': '[ganga]',
|
16368 | '[发怒]': '[fanu]',
|
16369 | '[眨眼]': '[zhayan]',
|
16370 | '[龇牙]': '[ziya]',
|
16371 | '[惊讶]': '[jingya]',
|
16372 | '[难过]': '[nanguo]',
|
16373 |
|
16374 | '[得意]': '[deyi]',
|
16375 | '[囧]': '[jiong]',
|
16376 | '[抓狂]': '[zhuakuang]',
|
16377 | '[呕吐]': '[outu]',
|
16378 | '[偷笑]': '[touxiao]',
|
16379 | '[开心]': '[kaixin]',
|
16380 | '[白眼]': '[baiyan]',
|
16381 |
|
16382 | '[傲慢]': '[aoman]',
|
16383 | '[饥饿]': '[jie]',
|
16384 | '[困]': '[kun]',
|
16385 | '[惊吓]': '[jingxia]',
|
16386 | '[流汗]': '[liuhan]',
|
16387 | '[大笑]': '[daxiao]',
|
16388 | '[抽烟]': '[chouyan]',
|
16389 | '[奋斗]': '[fendou]',
|
16390 |
|
16391 | '[骂人]': '[maren]',
|
16392 | '[问]': '[wen]',
|
16393 | '[嘘]': '[xu]',
|
16394 | '[晕]': '[yun]',
|
16395 | '[狂燥]': '[kuangzao]',
|
16396 | '[衰]': '[shuai]',
|
16397 | '[骷髅]': '[kulou]',
|
16398 | '[敲头]': '[qiaotou]',
|
16399 |
|
16400 | '[拜拜]': '[baibai]',
|
16401 | '[擦汗]': '[cahan]',
|
16402 | '[挖鼻孔]': '[wabikong]',
|
16403 | '[恭喜]': '[gongxi]',
|
16404 | '[糗]': '[qiu]',
|
16405 | '[坏笑]': '[huaixiao]',
|
16406 | '[左哼哼]': '[zuohengheng]',
|
16407 |
|
16408 | '[右哼哼]': '[youhengheng]',
|
16409 | '[打哈欠]': '[dahaqian]',
|
16410 | '[鄙视]': '[bishi]',
|
16411 | '[受委屈]': '[shouweiqu]',
|
16412 | '[委屈]': '[weiqu]',
|
16413 | '[奸笑]': '[jianxiao]',
|
16414 | '[亲亲]': '[qingqing]',
|
16415 | '[吓]': '[xia]',
|
16416 |
|
16417 | '[可怜]': '[kelian]',
|
16418 | '[菜刀]': '[caidao]',
|
16419 | '[西瓜]': '[xigua]',
|
16420 | '[啤酒]': '[pijiu]',
|
16421 | '[篮球]': '[lanqiu]',
|
16422 | '[乒乓球]': '[pingpangqiu]',
|
16423 | '[咖啡]': '[kafei]',
|
16424 | '[米饭]': '[mifan]',
|
16425 |
|
16426 | '[猪头]': '[zhutou]',
|
16427 | '[玫瑰]': '[meigui]',
|
16428 | '[花谢了]': '[huaxiele]',
|
16429 | '[红唇]': '[hongchun]',
|
16430 | '[心]': '[xin]',
|
16431 | '[心碎]': '[xinsui]',
|
16432 | '[蛋糕]': '[dangao]',
|
16433 |
|
16434 | '[闪电]': '[shandian]',
|
16435 | '[炸弹]': '[zhadan]',
|
16436 | '[刀]': '[dao]',
|
16437 | '[足球]': '[zuqiu]',
|
16438 | '[瓢虫]': '[piaochong]',
|
16439 | '[大便]': '[dabian]',
|
16440 | '[夜晚]': '[yewan]',
|
16441 | '[太阳]': '[taiyang]',
|
16442 |
|
16443 | '[礼物]': '[liwu]',
|
16444 | '[抱抱]': '[baobao]',
|
16445 | '[强]': '[qiang]',
|
16446 | '[弱]': '[ruo]',
|
16447 | '[握手]': '[woshou]',
|
16448 | '[Yeah]': '[yeah]',
|
16449 | '[抱拳]': '[baoquan]',
|
16450 | '[来]': '[lai]',
|
16451 |
|
16452 | '[加油]': '[jiayou]',
|
16453 | '[差劲]': '[chajin]',
|
16454 | '[我爱你]': '[iloveyou]',
|
16455 | '[No]': '[no]',
|
16456 | '[Ok]': '[ok]'
|
16457 | };
|
16458 |
|
16459 | var instance_data = (emojis);
|
16460 |
|
16461 | var Emoji_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; };
|
16462 |
|
16463 | var Emoji_class, Emoji_temp;
|
16464 |
|
16465 | function Emoji_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
16466 |
|
16467 | function Emoji_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
16468 |
|
16469 | function Emoji_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
16470 |
|
16471 | function Emoji_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
16472 |
|
16473 |
|
16474 |
|
16475 |
|
16476 |
|
16477 |
|
16478 |
|
16479 |
|
16480 |
|
16481 |
|
16482 | if (!window._seeds_lang) window._seeds_lang = {};
|
16483 |
|
16484 | var Emoji_Emoji = (Emoji_temp = Emoji_class = function (_Component) {
|
16485 | Emoji_inherits(Emoji, _Component);
|
16486 |
|
16487 | function Emoji(props) {
|
16488 | Emoji_classCallCheck(this, Emoji);
|
16489 |
|
16490 | var _this = Emoji_possibleConstructorReturn(this, _Component.call(this, props));
|
16491 |
|
16492 | _this.componentDidUpdate = function (prevProps) {
|
16493 |
|
16494 | if (_this.props.autoFocus && prevProps.show !== _this.props.show && _this.props.show === true && _this.$inputPre) {
|
16495 | _this.$inputPre.$input.focus();
|
16496 | }
|
16497 | };
|
16498 |
|
16499 | _this.componentDidMount = function () {
|
16500 | if (_this.props.autoFocus && _this.$inputPre) _this.$inputPre.$input.focus();
|
16501 | if (_this.instance) return;
|
16502 | var instance = new Emoji_instance({
|
16503 | data: _this.props.data,
|
16504 |
|
16505 | mask: _this.$el,
|
16506 | isClickMaskHide: _this.props.isClickMaskHide,
|
16507 | onClickMask: _this.onClickMask,
|
16508 |
|
16509 | onClickSubmit: _this.onClickSubmit,
|
16510 |
|
16511 | onChange: _this.props.onChange
|
16512 | });
|
16513 | _this.instance = instance;
|
16514 | };
|
16515 |
|
16516 | _this.onClickMask = function (s, e) {
|
16517 | if (_this.props.onClickMask) _this.props.onClickMask(Object.getArgs(e, _this.props.args));
|
16518 | };
|
16519 |
|
16520 | _this.onClickSubmit = function (value, s, e) {
|
16521 | if (_this.props.onClickSubmit) _this.props.onClickSubmit(value, Object.getArgs(e, _this.props.args));
|
16522 | };
|
16523 |
|
16524 | _this.getFaceDOM = function () {
|
16525 | var data = _this.props.data;
|
16526 |
|
16527 |
|
16528 | var icons = [];
|
16529 | var page = 0;
|
16530 | var index = 0;
|
16531 | var count = 23;
|
16532 |
|
16533 | for (var name in data) {
|
16534 | if (index !== 0 && index % count === 0) {
|
16535 | page++;
|
16536 | }
|
16537 | if (!icons[page]) icons[page] = [];
|
16538 | icons[page].push({ key: name, value: data[name] });
|
16539 | index++;
|
16540 | }
|
16541 |
|
16542 | return icons.map(function (icon, i) {
|
16543 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
16544 | 'div',
|
16545 | { key: 'page' + i, className: 'emoji-carrousel-slide' },
|
16546 | icon.map(function (item, index) {
|
16547 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
16548 | 'a',
|
16549 | { key: 'face' + index, className: 'emoji-face', 'data-emoji': item.value, title: item.key },
|
16550 | '\xA0'
|
16551 | );
|
16552 | }),
|
16553 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
16554 | 'a',
|
16555 | { className: 'emoji-face-delete' },
|
16556 | '\xA0'
|
16557 | )
|
16558 | );
|
16559 | });
|
16560 | };
|
16561 |
|
16562 | return _this;
|
16563 | }
|
16564 |
|
16565 |
|
16566 |
|
16567 |
|
16568 |
|
16569 |
|
16570 |
|
16571 | Emoji.prototype.render = function render() {
|
16572 | var _this2 = this;
|
16573 |
|
16574 | var _props = this.props,
|
16575 | show = _props.show,
|
16576 | data = _props.data,
|
16577 | portal = _props.portal,
|
16578 | args = _props.args,
|
16579 | autoFocus = _props.autoFocus,
|
16580 | value = _props.value,
|
16581 | placeholder = _props.placeholder,
|
16582 | isClickMaskHide = _props.isClickMaskHide,
|
16583 | onClickMask = _props.onClickMask,
|
16584 | maskClassName = _props.maskClassName,
|
16585 | maskStyle = _props.maskStyle,
|
16586 | className = _props.className,
|
16587 | style = _props.style,
|
16588 | licon = _props.licon,
|
16589 | onChange = _props.onChange,
|
16590 | submitCaption = _props.submitCaption,
|
16591 | submitStyle = _props.submitStyle,
|
16592 | submitClassName = _props.submitClassName,
|
16593 | onClickSubmit = _props.onClickSubmit,
|
16594 | others = Emoji_objectWithoutProperties(_props, ['show', 'data', 'portal', 'args', 'autoFocus', 'value', 'placeholder', 'isClickMaskHide', 'onClickMask', 'maskClassName', 'maskStyle', 'className', 'style', 'licon', 'onChange', 'submitCaption', 'submitStyle', 'submitClassName', 'onClickSubmit']);
|
16595 |
|
16596 | return Object(react_dom["createPortal"])(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
16597 | 'div',
|
16598 | { ref: function ref(el) {
|
16599 | _this2.$el = el;
|
16600 | }, className: 'mask emoji-mask' + (show ? ' active' : '') + (maskClassName ? ' ' + maskClassName : ''), style: maskStyle, onClick: this.onClickMask },
|
16601 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
16602 | 'div',
|
16603 | { ref: function ref(el) {
|
16604 | _this2.$container = el;
|
16605 | }, className: 'emoji active' + (className ? ' ' + className : ''), style: style, onClick: this.onClick },
|
16606 | licon,
|
16607 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
16608 | 'div',
|
16609 | { className: 'emoji-edit' },
|
16610 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(src_InputPre, Emoji_extends({
|
16611 | ref: function ref(el) {
|
16612 | _this2.$inputPre = el;
|
16613 | },
|
16614 | className: 'emoji-edit-input',
|
16615 | inputStyle: { padding: '0' },
|
16616 | valueBindProp: true,
|
16617 | value: value,
|
16618 | onChange: onChange,
|
16619 | placeholder: placeholder
|
16620 | }, others)),
|
16621 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('i', { ref: function ref(el) {
|
16622 | _this2.$icon = el;
|
16623 | }, className: 'icon emoji-edit-icon' }),
|
16624 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
16625 | src_Button,
|
16626 | { className: 'emoji-edit-submit' + (submitClassName ? ' ' + submitClassName : ''), style: submitStyle, disabled: !value },
|
16627 | submitCaption
|
16628 | )
|
16629 | ),
|
16630 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
16631 | src_Carrousel,
|
16632 | { ref: function ref(el) {
|
16633 | _this2.$carrousel = el;
|
16634 | }, pagination: true, className: 'carrousel-container emoji-carrousel', style: { display: 'none' } },
|
16635 | this.getFaceDOM()
|
16636 | )
|
16637 | )
|
16638 | ), this.props.portal || document.getElementById('root'));
|
16639 | };
|
16640 |
|
16641 | return Emoji;
|
16642 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Emoji_class.propTypes = {
|
16643 | show: prop_types_default.a.bool,
|
16644 | data: prop_types_default.a.object,
|
16645 |
|
16646 | portal: prop_types_default.a.object,
|
16647 | args: prop_types_default.a.any,
|
16648 |
|
16649 | autoFocus: prop_types_default.a.bool,
|
16650 |
|
16651 | value: prop_types_default.a.string,
|
16652 | placeholder: prop_types_default.a.string,
|
16653 |
|
16654 | isClickMaskHide: prop_types_default.a.bool,
|
16655 | onClickMask: prop_types_default.a.func,
|
16656 |
|
16657 | maskClassName: prop_types_default.a.string,
|
16658 | maskStyle: prop_types_default.a.object,
|
16659 |
|
16660 | className: prop_types_default.a.string,
|
16661 | style: prop_types_default.a.object,
|
16662 |
|
16663 | licon: prop_types_default.a.node,
|
16664 |
|
16665 | onChange: prop_types_default.a.func,
|
16666 |
|
16667 | submitStyle: prop_types_default.a.object,
|
16668 | submitClassName: prop_types_default.a.string,
|
16669 | submitCaption: prop_types_default.a.node,
|
16670 | onClickSubmit: prop_types_default.a.func
|
16671 | }, Emoji_class.defaultProps = {
|
16672 | autoFocus: false,
|
16673 | data: instance_data,
|
16674 | placeholder: window._seeds_lang['say_something'] || '说点什么吧...',
|
16675 | isClickMaskHide: false,
|
16676 | submitCaption: window._seeds_lang['submit'] || '提交'
|
16677 | }, Emoji_temp);
|
16678 |
|
16679 |
|
16680 |
|
16681 |
|
16682 | var src_Emoji = (Emoji_Emoji);
|
16683 |
|
16684 | var Footer_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; };
|
16685 |
|
16686 | var Footer_class, Footer_temp;
|
16687 |
|
16688 | function Footer_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
16689 |
|
16690 | function Footer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
16691 |
|
16692 | function Footer_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
16693 |
|
16694 | function Footer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
16695 |
|
16696 |
|
16697 |
|
16698 |
|
16699 | var Footer_Footer = (Footer_temp = Footer_class = function (_Component) {
|
16700 | Footer_inherits(Footer, _Component);
|
16701 |
|
16702 | function Footer(props) {
|
16703 | Footer_classCallCheck(this, Footer);
|
16704 |
|
16705 | return Footer_possibleConstructorReturn(this, _Component.call(this, props));
|
16706 | }
|
16707 |
|
16708 | Footer.prototype.render = function render() {
|
16709 | var _this2 = this;
|
16710 |
|
16711 | var _props = this.props,
|
16712 | style = _props.style,
|
16713 | className = _props.className,
|
16714 | children = _props.children,
|
16715 | others = Footer_objectWithoutProperties(_props, ['style', 'className', 'children']);
|
16716 |
|
16717 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
16718 | 'footer',
|
16719 | Footer_extends({ ref: function ref(el) {
|
16720 | _this2.$el = el;
|
16721 | }, className: 'footer' + (className ? ' ' + className : ''), style: style }, others),
|
16722 | children
|
16723 | );
|
16724 | };
|
16725 |
|
16726 | return Footer;
|
16727 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Footer_class.propTypes = {
|
16728 | style: prop_types_default.a.object,
|
16729 | className: prop_types_default.a.string,
|
16730 | children: prop_types_default.a.node
|
16731 | }, Footer_temp);
|
16732 |
|
16733 |
|
16734 |
|
16735 |
|
16736 | var src_Footer = (Footer_Footer);
|
16737 |
|
16738 | var Group_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; };
|
16739 |
|
16740 | var Group_class, Group_temp;
|
16741 |
|
16742 | function Group_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
16743 |
|
16744 | function Group_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
16745 |
|
16746 | function Group_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
16747 |
|
16748 | function Group_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
16749 |
|
16750 |
|
16751 |
|
16752 |
|
16753 | var Group_Group = (Group_temp = Group_class = function (_Component) {
|
16754 | Group_inherits(Group, _Component);
|
16755 |
|
16756 | function Group(props) {
|
16757 | Group_classCallCheck(this, Group);
|
16758 |
|
16759 | var _this = Group_possibleConstructorReturn(this, _Component.call(this, props));
|
16760 |
|
16761 | _this.onClick = function (e) {
|
16762 | if (_this.props.onClick) _this.props.onClick(Object.getArgs(e, _this.props.args));
|
16763 | };
|
16764 |
|
16765 | return _this;
|
16766 | }
|
16767 |
|
16768 | Group.prototype.render = function render() {
|
16769 | var _this2 = this;
|
16770 |
|
16771 | var _props = this.props,
|
16772 | args = _props.args,
|
16773 | children = _props.children,
|
16774 | style = _props.style,
|
16775 | className = _props.className,
|
16776 | onClick = _props.onClick,
|
16777 | others = Group_objectWithoutProperties(_props, ['args', 'children', 'style', 'className', 'onClick']);
|
16778 |
|
16779 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
16780 | 'div',
|
16781 | Group_extends({ ref: function ref(el) {
|
16782 | _this2.$el = el;
|
16783 | }, className: 'group' + (className ? ' ' + className : ''), style: style, onClick: this.onClick }, others),
|
16784 | children
|
16785 | );
|
16786 | };
|
16787 |
|
16788 | return Group;
|
16789 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Group_class.propTypes = {
|
16790 | args: prop_types_default.a.any,
|
16791 |
|
16792 | style: prop_types_default.a.object,
|
16793 | className: prop_types_default.a.string,
|
16794 | children: prop_types_default.a.node,
|
16795 | onClick: prop_types_default.a.func
|
16796 | }, Group_class.defaultProps = {
|
16797 | className: 'border-tb'
|
16798 | }, Group_temp);
|
16799 |
|
16800 |
|
16801 |
|
16802 |
|
16803 | var src_Group = (Group_Group);
|
16804 |
|
16805 | var instance_Handsign = function Handsign(container, params) {
|
16806 | |
16807 |
|
16808 |
|
16809 | var defaults = {
|
16810 | strokeStyle: '#000',
|
16811 | lineWidth: 3,
|
16812 |
|
16813 | suffix: 'image/png',
|
16814 | quality: 0.92
|
16815 | };
|
16816 | params = params || {};
|
16817 | for (var def in defaults) {
|
16818 | if (params[def] === undefined) {
|
16819 | params[def] = defaults[def];
|
16820 | }
|
16821 | }
|
16822 | var s = this;
|
16823 | s.params = params;
|
16824 | s.container = typeof container === 'string' ? document.querySelector(container) : container;
|
16825 | if (!s.container) {
|
16826 | console.log('SeedsUI Error : HandSign container不存在,请检查页面中是否有此元素');
|
16827 | return;
|
16828 | }
|
16829 | s.width = s.container.width;
|
16830 | s.height = s.container.height;
|
16831 | s.ctx = s.container.getContext('2d');
|
16832 | s.stageInfo = s.container.getBoundingClientRect();
|
16833 | s.path = {
|
16834 | beginX: 0,
|
16835 | beginY: 0,
|
16836 | endX: 0,
|
16837 | endY: 0
|
16838 |
|
16839 | };s.isDrew = false;
|
16840 | |
16841 |
|
16842 |
|
16843 | s.setStrokeStyle = function (strokeStyle) {
|
16844 | if (strokeStyle) {
|
16845 | s.params.strokeStyle = strokeStyle;
|
16846 | }
|
16847 | };
|
16848 | s.setLineWidth = function (lineWidth) {
|
16849 | if (lineWidth) {
|
16850 | s.params.lineWidth = lineWidth;
|
16851 | }
|
16852 | };
|
16853 | s.setSuffix = function (suffix) {
|
16854 | if (suffix) {
|
16855 | s.params.suffix = suffix;
|
16856 | }
|
16857 | };
|
16858 | s.setQuality = function (quality) {
|
16859 | if (quality) {
|
16860 | s.params.quality = quality;
|
16861 | }
|
16862 | };
|
16863 | |
16864 |
|
16865 |
|
16866 | s.preventDefault = function (e) {
|
16867 | e.preventDefault();
|
16868 | };
|
16869 | s.events = function (detach) {
|
16870 | var action = detach ? 'removeEventListener' : 'addEventListener';
|
16871 | s.container[action]('touchstart', s.onTouchStart, false);
|
16872 | s.container[action]('touchmove', s.onTouchMove, false);
|
16873 | s.container[action]('touchend', s.onTouchEnd, false);
|
16874 | s.container[action]('touchcancel', s.onTouchEnd, false);
|
16875 | };
|
16876 |
|
16877 | s.attach = function () {
|
16878 | s.events();
|
16879 | };
|
16880 | s.detach = function () {
|
16881 | s.events(true);
|
16882 | };
|
16883 | s.onTouchStart = function (e) {
|
16884 | e.stopPropagation();
|
16885 | s.container.addEventListener('touchmove', s.preventDefault, false);
|
16886 | window.getSelection() ? window.getSelection().removeAllRanges() : document.selection.empty();
|
16887 | s.ctx.strokeStyle = s.params.strokeStyle;
|
16888 | s.ctx.lineWidth = s.params.lineWidth;
|
16889 | s.stageInfo = s.container.getBoundingClientRect();
|
16890 | s.ctx.beginPath();
|
16891 | s.ctx.moveTo(e.changedTouches[0].clientX - s.stageInfo.left, e.changedTouches[0].clientY - s.stageInfo.top);
|
16892 | s.path.beginX = e.changedTouches[0].clientX - s.stageInfo.left;
|
16893 | s.path.beginY = e.changedTouches[0].clientY - s.stageInfo.top;
|
16894 | };
|
16895 | s.onTouchMove = function (e) {
|
16896 | e.stopPropagation();
|
16897 | s.ctx.lineTo(e.changedTouches[0].clientX - s.stageInfo.left, e.changedTouches[0].clientY - s.stageInfo.top);
|
16898 | s.path.endX = e.changedTouches[0].clientX - s.stageInfo.left;
|
16899 | s.path.endY = e.changedTouches[0].clientY - s.stageInfo.top;
|
16900 | s.ctx.stroke();
|
16901 |
|
16902 | s.isDrew = true;
|
16903 | };
|
16904 | s.onTouchEnd = function (e) {
|
16905 | s.container.removeEventListener('touchmove', s.preventDefault, false);
|
16906 | };
|
16907 | |
16908 |
|
16909 |
|
16910 |
|
16911 | s.getPixelRatio = function () {
|
16912 | var context = s.ctx;
|
16913 | var backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1;
|
16914 | return (window.devicePixelRatio || 1) / backingStore;
|
16915 | };
|
16916 |
|
16917 | s.clear = function () {
|
16918 | s.ctx.clearRect(0, 0, s.width, s.height);
|
16919 |
|
16920 | s.isDrew = false;
|
16921 | };
|
16922 |
|
16923 | s.blank = function () {
|
16924 | var blank = document.createElement('canvas');
|
16925 | blank.width = s.container.width;
|
16926 | blank.height = s.container.height;
|
16927 | if (s.container.toDataURL() === blank.toDataURL()) return true;
|
16928 | return false;
|
16929 | };
|
16930 |
|
16931 | s.save = function () {
|
16932 | return s.container.toDataURL(s.params.suffix, s.params.quality);
|
16933 | };
|
16934 |
|
16935 | s.calcPosition = function (w, h, pos) {
|
16936 | var posArr = pos.split(' ').map(function (item, index) {
|
16937 | var x = 0;
|
16938 | var y = 0;
|
16939 |
|
16940 | if (!isNaN(item)) {
|
16941 | if (index === 0) return { x: item };
|
16942 | if (index === 1) return { y: item };
|
16943 | }
|
16944 |
|
16945 | if (item === 'top') return { y: 0 };
|
16946 | if (item === 'left') return { x: 0 };
|
16947 | if (item === 'right') {
|
16948 | x = s.width < w ? 0 : s.width - w;
|
16949 | return { x: x };
|
16950 | }
|
16951 | if (item === 'bottom') {
|
16952 | y = s.height < h ? 0 : s.height - h;
|
16953 | return { y: y };
|
16954 | }
|
16955 | if (item === 'center') {
|
16956 | x = (s.width - w) / 2;
|
16957 | return { x: x };
|
16958 | }
|
16959 | if (item === 'middle') {
|
16960 | y = (s.height - h) / 2;
|
16961 | return { y: y };
|
16962 | }
|
16963 | return { x: 0, y: 0 };
|
16964 | });
|
16965 | var posJson = {
|
16966 | x: 0,
|
16967 | y: 0
|
16968 | };
|
16969 | posArr.forEach(function (item) {
|
16970 | if (item.x) {
|
16971 | posJson.x = item.x;
|
16972 | } else if (item.y) {
|
16973 | posJson.y = item.y;
|
16974 | }
|
16975 | });
|
16976 | return {
|
16977 | x: posJson.x || 0,
|
16978 | y: posJson.y || 0
|
16979 | };
|
16980 | };
|
16981 |
|
16982 | s.drawImg = function (imgSrc) {
|
16983 | var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
16984 |
|
16985 | if (!imgSrc) {
|
16986 | console.log('SeedsUI Error:手写签名drawImg缺少imgSrc');
|
16987 | return;
|
16988 | }
|
16989 | var imgW = opts.width;
|
16990 | var imgH = opts.height;
|
16991 | var imgP = opts.position || 'bottom right';
|
16992 |
|
16993 | var img = new Image();
|
16994 | img.crossOrigin = 'Anonymous';
|
16995 | img.src = imgSrc;
|
16996 | img.onload = function () {
|
16997 | var sx = 0;
|
16998 | var sy = 0;
|
16999 | var width = imgW || img.width;
|
17000 | var height = imgH || img.height;
|
17001 | var swidth = img.width;
|
17002 | var sheight = img.height;
|
17003 | var pos = s.calcPosition(width, height, imgP);
|
17004 | s.ctx.drawImage(img, sx, sy, swidth, sheight, pos.x, pos.y, width, height);
|
17005 |
|
17006 | if (opts.onSuccess) opts.onSuccess();
|
17007 | };
|
17008 | };
|
17009 |
|
17010 | s.drawFont = function (text) {
|
17011 | var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
17012 |
|
17013 | if (!text) {
|
17014 | console.log('SeedsUI Error:手写签名drawFont缺少文字');
|
17015 | return;
|
17016 | }
|
17017 | var fontSize = opts.fontSize || 15;
|
17018 | var fontFamily = opts.fontFamily || 'microsoft yahei';
|
17019 | var fontPosition = opts.position || 'bottom center';
|
17020 | var fontStyle = opts.color || 'rgba(0, 0, 0, 1)';
|
17021 | if (isNaN(fontSize)) {
|
17022 | console.log('SeedsUI Error:文字大小请输入数字类型');
|
17023 | return;
|
17024 | }
|
17025 | var height = fontSize;
|
17026 | var width = text.length * height;
|
17027 | var pos = s.calcPosition(width, height, fontPosition);
|
17028 | var calcY = pos.y === 0 ? Number(pos.y) + Number(height) : Number(pos.y) + Number(height) - 5;
|
17029 |
|
17030 | s.ctx.font = fontSize + 'px ' + fontFamily;
|
17031 | s.ctx.fillStyle = fontStyle;
|
17032 | s.ctx.fillText(text, pos.x, calcY);
|
17033 | };
|
17034 |
|
17035 | s.drawBackgroundColor = function (fillStyle) {
|
17036 | s.ctx.fillStyle = fillStyle;
|
17037 | s.ctx.fillRect(0, 0, s.width, s.height);
|
17038 | };
|
17039 |
|
17040 | s.init = function () {
|
17041 | s.attach();
|
17042 | };
|
17043 |
|
17044 | s.init();
|
17045 | };
|
17046 |
|
17047 | var Handsign_instance = (instance_Handsign);
|
17048 |
|
17049 | var Handsign_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; };
|
17050 |
|
17051 | var Handsign_class, Handsign_temp;
|
17052 |
|
17053 | function Handsign_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
17054 |
|
17055 | function Handsign_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
17056 |
|
17057 | function Handsign_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
17058 |
|
17059 | function Handsign_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
17060 |
|
17061 |
|
17062 |
|
17063 |
|
17064 |
|
17065 | var Handsign_Handsign = (Handsign_temp = Handsign_class = function (_Component) {
|
17066 | Handsign_inherits(Handsign, _Component);
|
17067 |
|
17068 | function Handsign(props) {
|
17069 | Handsign_classCallCheck(this, Handsign);
|
17070 |
|
17071 | return Handsign_possibleConstructorReturn(this, _Component.call(this, props));
|
17072 | }
|
17073 |
|
17074 | Handsign.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
|
17075 | if (this.instance) {
|
17076 | if (prevProps.strokeStyle !== this.props.strokeStyle) {
|
17077 | this.instance.setStrokeStyle(this.props.strokeStyle);
|
17078 | }
|
17079 | if (prevProps.lineWidth !== this.props.lineWidth) {
|
17080 | this.instance.setLineWidth(this.props.lineWidth);
|
17081 | }
|
17082 | if (prevProps.quality !== this.props.quality) {
|
17083 | this.instance.setQuality(this.props.quality);
|
17084 | }
|
17085 | if (prevProps.suffix !== this.props.suffix) {
|
17086 | this.instance.setSuffix(this.props.suffix);
|
17087 | }
|
17088 | }
|
17089 | };
|
17090 |
|
17091 | Handsign.prototype.componentDidMount = function componentDidMount() {
|
17092 | if (this.instance) return;
|
17093 | var instance = new Handsign_instance(this.$el, {
|
17094 | strokeStyle: this.props.strokeStyle,
|
17095 | lineWidth: this.props.lineWidth,
|
17096 | quality: this.props.quality,
|
17097 | suffix: this.props.suffix
|
17098 | });
|
17099 | this.instance = instance;
|
17100 | };
|
17101 |
|
17102 | Handsign.prototype.render = function render() {
|
17103 | var _this2 = this;
|
17104 |
|
17105 | var _props = this.props,
|
17106 | strokeStyle = _props.strokeStyle,
|
17107 | lineWidth = _props.lineWidth,
|
17108 | quality = _props.quality,
|
17109 | width = _props.width,
|
17110 | height = _props.height,
|
17111 | style = _props.style,
|
17112 | className = _props.className,
|
17113 | others = Handsign_objectWithoutProperties(_props, ['strokeStyle', 'lineWidth', 'quality', 'width', 'height', 'style', 'className']);
|
17114 |
|
17115 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
17116 | 'canvas',
|
17117 | Handsign_extends({ ref: function ref(el) {
|
17118 | _this2.$el = el;
|
17119 | }, className: className, style: style, width: width, height: height }, others),
|
17120 | 'Canvas\u753B\u677F'
|
17121 | );
|
17122 | };
|
17123 |
|
17124 | return Handsign;
|
17125 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Handsign_class.propTypes = {
|
17126 | strokeStyle: prop_types_default.a.string,
|
17127 | lineWidth: prop_types_default.a.number,
|
17128 | quality: prop_types_default.a.number,
|
17129 | suffix: prop_types_default.a.string,
|
17130 |
|
17131 | width: prop_types_default.a.number,
|
17132 | height: prop_types_default.a.number,
|
17133 | style: prop_types_default.a.object,
|
17134 | className: prop_types_default.a.string
|
17135 | }, Handsign_class.defaultProps = {
|
17136 | strokeStyle: '#000',
|
17137 | lineWidth: 3,
|
17138 | quality: 0.92,
|
17139 | width: 300,
|
17140 | height: 300
|
17141 | }, Handsign_temp);
|
17142 |
|
17143 |
|
17144 |
|
17145 |
|
17146 | var src_Handsign = (Handsign_Handsign);
|
17147 |
|
17148 | var Header_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; };
|
17149 |
|
17150 | var Header_class, Header_temp;
|
17151 |
|
17152 | function Header_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
17153 |
|
17154 | function Header_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
17155 |
|
17156 | function Header_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
17157 |
|
17158 | function Header_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
17159 |
|
17160 |
|
17161 |
|
17162 |
|
17163 | var Header_Header = (Header_temp = Header_class = function (_Component) {
|
17164 | Header_inherits(Header, _Component);
|
17165 |
|
17166 | function Header(props) {
|
17167 | Header_classCallCheck(this, Header);
|
17168 |
|
17169 | var _this = Header_possibleConstructorReturn(this, _Component.call(this, props));
|
17170 |
|
17171 | _this.state = {};
|
17172 | return _this;
|
17173 | }
|
17174 |
|
17175 | Header.prototype.render = function render() {
|
17176 | var _this2 = this;
|
17177 |
|
17178 | var _props = this.props,
|
17179 | style = _props.style,
|
17180 | className = _props.className,
|
17181 | children = _props.children,
|
17182 | others = Header_objectWithoutProperties(_props, ['style', 'className', 'children']);
|
17183 |
|
17184 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
17185 | 'header',
|
17186 | Header_extends({ ref: function ref(el) {
|
17187 | _this2.$el = el;
|
17188 | }, className: 'header' + (className ? ' ' + className : ''), style: style }, others),
|
17189 | children
|
17190 | );
|
17191 | };
|
17192 |
|
17193 | return Header;
|
17194 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Header_class.propTypes = {
|
17195 | style: prop_types_default.a.object,
|
17196 | className: prop_types_default.a.string,
|
17197 | children: prop_types_default.a.node
|
17198 | }, Header_temp);
|
17199 |
|
17200 |
|
17201 |
|
17202 |
|
17203 | var src_Header = (Header_Header);
|
17204 |
|
17205 | var Imgmark = function Imgmark(container, params) {
|
17206 | |
17207 |
|
17208 |
|
17209 | var defaults = {
|
17210 | loadingClass: 'imgmark-loading',
|
17211 | errorClass: 'imgmark-error',
|
17212 | activeClass: 'active',
|
17213 |
|
17214 | src: '',
|
17215 | isDrawSrc: true,
|
17216 | data: [],
|
17217 | strokeStyle: '#00ff00',
|
17218 | lineWidth: 3,
|
17219 |
|
17220 | suffix: 'image/png',
|
17221 | quality: 0.92
|
17222 |
|
17223 | |
17224 |
|
17225 |
|
17226 |
|
17227 |
|
17228 | };
|
17229 | params = params || {};
|
17230 | for (var def in defaults) {
|
17231 | if (params[def] === undefined) {
|
17232 | params[def] = defaults[def];
|
17233 | }
|
17234 | }
|
17235 | var s = this;
|
17236 | s.params = params;
|
17237 | s.container = typeof container === 'string' ? document.querySelector(container) : container;
|
17238 | if (!s.container) {
|
17239 | console.log('SeedsUI Error : ImgMark container不存在,请检查页面中是否有此元素');
|
17240 | return;
|
17241 | }
|
17242 | s.loadingContainer = s.container.parentNode.querySelector('.' + s.params.loadingClass) || null;
|
17243 | s.errorContainer = s.container.parentNode.querySelector('.' + s.params.errorClass) || null;
|
17244 | s.ctx = s.container.getContext('2d');
|
17245 | s.stageInfo = s.container.getBoundingClientRect();
|
17246 | s.path = {
|
17247 | beginX: 0,
|
17248 | beginY: 0,
|
17249 | endX: 0,
|
17250 | endY: 0
|
17251 | |
17252 |
|
17253 |
|
17254 | };s.setData = function (data) {
|
17255 | if (data) {
|
17256 | s.params.data = data;
|
17257 | }
|
17258 | };
|
17259 | s.setStrokeStyle = function (strokeStyle) {
|
17260 | if (strokeStyle) {
|
17261 | s.params.strokeStyle = strokeStyle;
|
17262 | }
|
17263 | };
|
17264 | s.setLineWidth = function (lineWidth) {
|
17265 | if (lineWidth) {
|
17266 | s.params.lineWidth = lineWidth;
|
17267 | }
|
17268 | };
|
17269 | s.setSuffix = function (suffix) {
|
17270 | if (suffix) {
|
17271 | s.params.suffix = suffix;
|
17272 | }
|
17273 | };
|
17274 | s.setQuality = function (quality) {
|
17275 | if (quality) {
|
17276 | s.params.quality = quality;
|
17277 | }
|
17278 | };
|
17279 | s.setIsDrawSrc = function (isDrawSrc) {
|
17280 | if (isDrawSrc) {
|
17281 | s.params.isDrawSrc = isDrawSrc;
|
17282 | }
|
17283 | };
|
17284 | s.setOnSuccess = function (onSuccess) {
|
17285 | if (onSuccess) {
|
17286 | s.params.onSuccess = onSuccess;
|
17287 | }
|
17288 | };
|
17289 | s.setOnError = function (onError) {
|
17290 | if (onError) {
|
17291 | s.params.onError = onError;
|
17292 | }
|
17293 | };
|
17294 | |
17295 |
|
17296 |
|
17297 |
|
17298 | s.clear = function () {
|
17299 | s.ctx.clearRect(0, 0, s.container.width, s.container.height);
|
17300 | };
|
17301 |
|
17302 | s.save = function () {
|
17303 | try {
|
17304 | return s.container.toDataURL(s.params.suffix, s.params.quality);
|
17305 | } catch (error) {
|
17306 | console.error(error);
|
17307 | return null;
|
17308 | }
|
17309 | };
|
17310 |
|
17311 | s.draw = function (img, data, isDrawSrc) {
|
17312 | if (!img) {
|
17313 | console.log('SeedsUI Error:ImgMark执行draw缺少img');
|
17314 | return;
|
17315 | }
|
17316 | if (!data) {
|
17317 | console.log('SeedsUI Error:ImgMark执行draw缺少img');
|
17318 | return;
|
17319 | }
|
17320 | if (isDrawSrc) {
|
17321 | s.ctx.drawImage(img, 0, 0, img.width, img.height, 0, 0, img.width, img.height);
|
17322 | }
|
17323 | for (var _iterator = data, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
|
17324 | var _ref;
|
17325 |
|
17326 | if (_isArray) {
|
17327 | if (_i >= _iterator.length) break;
|
17328 | _ref = _iterator[_i++];
|
17329 | } else {
|
17330 | _i = _iterator.next();
|
17331 | if (_i.done) break;
|
17332 | _ref = _i.value;
|
17333 | }
|
17334 |
|
17335 | var item = _ref;
|
17336 |
|
17337 | if (item.strokeStyle) s.ctx.strokeStyle = item.strokeStyle;else s.ctx.strokeStyle = s.params.strokeStyle;
|
17338 | if (item.lineWidth) s.ctx.lineWidth = item.lineWidth;else s.ctx.lineWidth = s.params.lineWidth;
|
17339 | if (item.setLineDash) s.ctx.setLineDash(item.setLineDash);
|
17340 | s.ctx.strokeRect(item.x1, item.y1, item.x2 - item.x1, item.y2 - item.y1);
|
17341 | }
|
17342 | };
|
17343 | s.update = function () {
|
17344 | if (s.params.src) {
|
17345 | var img = new Image();
|
17346 | img.src = s.params.src;
|
17347 | img.addEventListener('load', s.onLoad, false);
|
17348 | img.addEventListener('error', s.onError, false);
|
17349 | }
|
17350 | };
|
17351 | |
17352 |
|
17353 |
|
17354 | s.onLoad = function (e) {
|
17355 | var target = e.target;
|
17356 |
|
17357 | if (s.loadingContainer) s.loadingContainer.classList.remove(s.params.activeClass);
|
17358 | if (s.errorContainer) s.errorContainer.classList.remove(s.params.activeClass);
|
17359 | s.container.classList.add(s.params.activeClass);
|
17360 |
|
17361 | s.container.width = target.width;
|
17362 | s.container.height = target.height;
|
17363 | s.draw(target, s.params.data, s.params.isDrawSrc);
|
17364 |
|
17365 | var scale = s.params.height / target.height;
|
17366 | s.container.style.WebkitTransform = 'scale(' + scale + ') translate(-50%,-50%)';
|
17367 | s.container.style.WebkitTransformOrigin = '0 0';
|
17368 |
|
17369 | if (s.params.onSuccess) s.params.onSuccess(s);
|
17370 | };
|
17371 | s.onError = function () {
|
17372 | if (s.loadingContainer) s.loadingContainer.classList.remove(s.params.activeClass);
|
17373 | if (s.errorContainer) s.errorContainer.classList.add(s.params.activeClass);
|
17374 | s.container.classList.remove(s.params.activeClass);
|
17375 |
|
17376 | if (s.params.onError) s.params.onError(s);
|
17377 | };
|
17378 |
|
17379 | s.init = function () {
|
17380 | s.update();
|
17381 | };
|
17382 |
|
17383 | s.init();
|
17384 | };
|
17385 |
|
17386 | var ImgMark_instance = (Imgmark);
|
17387 |
|
17388 | var ImgMark_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; };
|
17389 |
|
17390 | var ImgMark_class, ImgMark_temp;
|
17391 |
|
17392 | function ImgMark_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
17393 |
|
17394 | function ImgMark_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
17395 |
|
17396 | function ImgMark_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
17397 |
|
17398 | function ImgMark_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
17399 |
|
17400 |
|
17401 |
|
17402 |
|
17403 |
|
17404 |
|
17405 |
|
17406 | if (!window._seeds_lang) window._seeds_lang = {};
|
17407 |
|
17408 | var ImgMark_ImgMark = (ImgMark_temp = ImgMark_class = function (_Component) {
|
17409 | ImgMark_inherits(ImgMark, _Component);
|
17410 |
|
17411 | function ImgMark(props) {
|
17412 | ImgMark_classCallCheck(this, ImgMark);
|
17413 |
|
17414 | var _this = ImgMark_possibleConstructorReturn(this, _Component.call(this, props));
|
17415 |
|
17416 | _this.validSrc = false;
|
17417 |
|
17418 | _this.onError = function () {
|
17419 | _this.validSrc = false;
|
17420 | };
|
17421 |
|
17422 | _this.onSuccess = function () {
|
17423 | _this.validSrc = true;
|
17424 | };
|
17425 |
|
17426 | _this.onClick = function () {
|
17427 | var layer = '';
|
17428 | if (_this.props.preview) {
|
17429 | if (!_this.validSrc) {
|
17430 | src_Bridge.showToast((window._seeds_lang['hint_image_failed_to_load'] || '图片加载失败') + ', ' + (window._seeds_lang['cannot_preview'] || '无法预览'), { mask: false });
|
17431 | return;
|
17432 | }
|
17433 | if (_this.props.isDrawSrc) {
|
17434 |
|
17435 | layer = _this.instance.save();
|
17436 | if (layer) {
|
17437 | src_Bridge.previewImage({ urls: [layer], index: 0 });
|
17438 | }
|
17439 | } else {
|
17440 |
|
17441 | layer = _this.instance.save();
|
17442 | var previewHTML = '<div class="preview-layer" style="background-image:url(' + layer + ')"></div>';
|
17443 | if (_this.props.watermark) {
|
17444 |
|
17445 | previewHTML += '<div class="preview-layer" style="background-image:url(' + _this.props.watermark + ');background-repeat: repeat; background-size:auto;"></div>';
|
17446 | }
|
17447 | bridgeBrowser.previewImage({ urls: [_this.props.src], layerHTML: previewHTML });
|
17448 | }
|
17449 | }
|
17450 | if (_this.props.onClick) _this.props.onClick(layer);
|
17451 | };
|
17452 |
|
17453 | return _this;
|
17454 | }
|
17455 |
|
17456 | ImgMark.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
|
17457 | if (this.instance) {
|
17458 | if (prevProps.isDrawSrc !== this.props.isDrawSrc) {
|
17459 | this.instance.setIsDrawSrc(this.props.isDrawSrc);
|
17460 | this.instance.update();
|
17461 | }
|
17462 | if (prevProps.strokeStyle !== this.props.strokeStyle) {
|
17463 | this.instance.setStrokeStyle(this.props.strokeStyle);
|
17464 | this.instance.update();
|
17465 | }
|
17466 | if (prevProps.lineWidth !== this.props.lineWidth) {
|
17467 | this.instance.setLineWidth(this.props.lineWidth);
|
17468 | this.instance.update();
|
17469 | }
|
17470 | if (prevProps.quality !== this.props.quality) {
|
17471 | this.instance.setQuality(this.props.quality);
|
17472 | this.instance.update();
|
17473 | }
|
17474 | if (prevProps.data !== this.props.data) {
|
17475 | this.instance.setData(this.props.data);
|
17476 | this.instance.update();
|
17477 | }
|
17478 | }
|
17479 | };
|
17480 |
|
17481 | ImgMark.prototype.componentDidMount = function componentDidMount() {
|
17482 | if (this.instance) return;
|
17483 | var instance = new ImgMark_instance(this.$el, {
|
17484 | src: this.props.src,
|
17485 | data: this.props.data,
|
17486 | isDrawSrc: this.props.isDrawSrc,
|
17487 | height: this.props.height,
|
17488 | strokeStyle: this.props.strokeStyle,
|
17489 | lineWidth: this.props.lineWidth,
|
17490 | quality: this.props.quality,
|
17491 | onError: this.onError,
|
17492 | onSuccess: this.onSuccess
|
17493 | });
|
17494 | this.instance = instance;
|
17495 | };
|
17496 |
|
17497 | ImgMark.prototype.render = function render() {
|
17498 | var _this2 = this;
|
17499 |
|
17500 | var _props = this.props,
|
17501 | data = _props.data,
|
17502 | src = _props.src,
|
17503 | isDrawSrc = _props.isDrawSrc,
|
17504 | watermark = _props.watermark,
|
17505 | strokeStyle = _props.strokeStyle,
|
17506 | lineWidth = _props.lineWidth,
|
17507 | quality = _props.quality,
|
17508 | width = _props.width,
|
17509 | height = _props.height,
|
17510 | style = _props.style,
|
17511 | className = _props.className,
|
17512 | onClick = _props.onClick,
|
17513 | preview = _props.preview,
|
17514 | children = _props.children,
|
17515 | others = ImgMark_objectWithoutProperties(_props, ['data', 'src', 'isDrawSrc', 'watermark', 'strokeStyle', 'lineWidth', 'quality', 'width', 'height', 'style', 'className', 'onClick', 'preview', 'children']);
|
17516 |
|
17517 | var isDrawSrcStyle = {};
|
17518 | if (!isDrawSrc) {
|
17519 | isDrawSrcStyle = { backgroundImage: 'url(' + src + ')' };
|
17520 | }
|
17521 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
17522 | 'div',
|
17523 | ImgMark_extends({ className: 'imgmark' + (className ? ' ' + className : ''), style: Object({ width: width, height: height }, style), onClick: this.onClick }, others),
|
17524 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
17525 | 'div',
|
17526 | { className: 'imgmark-loading active' },
|
17527 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'imgmark-loading-icon' })
|
17528 | ),
|
17529 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
17530 | 'canvas',
|
17531 | { ref: function ref(el) {
|
17532 | _this2.$el = el;
|
17533 | }, className: 'imgmark-wrapper', style: isDrawSrcStyle },
|
17534 | 'Canvas\u753B\u677F'
|
17535 | ),
|
17536 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
17537 | 'div',
|
17538 | { className: 'imgmark-error' },
|
17539 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'imgmark-error-icon' }),
|
17540 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
17541 | 'div',
|
17542 | { className: 'imgmark-error-caption' },
|
17543 | window._seeds_lang['hint_image_failed_to_load'] || '图片加载失败'
|
17544 | )
|
17545 | ),
|
17546 | children
|
17547 | );
|
17548 | };
|
17549 |
|
17550 | return ImgMark;
|
17551 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), ImgMark_class.propTypes = {
|
17552 |
|
17553 | data: prop_types_default.a.array,
|
17554 | src: prop_types_default.a.string,
|
17555 |
|
17556 | isDrawSrc: prop_types_default.a.bool,
|
17557 | watermark: prop_types_default.a.string,
|
17558 | strokeStyle: prop_types_default.a.string,
|
17559 | lineWidth: prop_types_default.a.number,
|
17560 | quality: prop_types_default.a.number,
|
17561 |
|
17562 | width: prop_types_default.a.number,
|
17563 | height: prop_types_default.a.number,
|
17564 | style: prop_types_default.a.object,
|
17565 | className: prop_types_default.a.string,
|
17566 |
|
17567 | onClick: prop_types_default.a.func,
|
17568 |
|
17569 | preview: prop_types_default.a.bool,
|
17570 |
|
17571 | children: prop_types_default.a.node
|
17572 | }, ImgMark_class.defaultProps = {
|
17573 | isDrawSrc: false,
|
17574 | strokeStyle: '#00ff00',
|
17575 | lineWidth: 3,
|
17576 | quality: 0.92,
|
17577 | height: 300,
|
17578 | preview: true
|
17579 | }, ImgMark_temp);
|
17580 |
|
17581 |
|
17582 |
|
17583 |
|
17584 | var src_ImgMark = (ImgMark_ImgMark);
|
17585 |
|
17586 |
|
17587 | var Indexbar = function Indexbar(params) {
|
17588 | |
17589 |
|
17590 |
|
17591 | var defaults = {
|
17592 | overflowContainer: document.body,
|
17593 | parent: document.body,
|
17594 | indexAttr: 'data-indexbar-name',
|
17595 | indexs: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'G', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'],
|
17596 | barClass: 'indexbar',
|
17597 | barActiveClass: 'active',
|
17598 | tooltipClass: 'indexbar-tooltip'
|
17599 | };
|
17600 | params = params || {};
|
17601 | for (var def in defaults) {
|
17602 | if (params[def] === undefined) {
|
17603 | params[def] = defaults[def];
|
17604 | }
|
17605 | }
|
17606 |
|
17607 | var s = this;
|
17608 |
|
17609 |
|
17610 | s.params = params;
|
17611 |
|
17612 |
|
17613 | s.parent = typeof s.params.parent === 'string' ? document.querySelector(s.params.parent) : s.params.parent;
|
17614 | s.overflowContainer = typeof s.params.overflowContainer === 'string' ? document.querySelector(s.params.overflowContainer) : s.params.overflowContainer;
|
17615 | if (!s.overflowContainer) {
|
17616 | console.warn('SeedsUI Error: IndexBar控件缺少overflowContainer');
|
17617 | return;
|
17618 | }
|
17619 |
|
17620 |
|
17621 | s.bar = null;
|
17622 | s.createBar = function () {
|
17623 | var bar = document.createElement('div');
|
17624 | bar.setAttribute('class', s.params.barClass);
|
17625 | return bar;
|
17626 | };
|
17627 | s.createIndexs = function () {
|
17628 | var indexs = [];
|
17629 | s.params.indexs.forEach(function (n) {
|
17630 | var index = document.createElement('a');
|
17631 | index.innerHTML = n;
|
17632 | indexs.push(index);
|
17633 | });
|
17634 | return indexs;
|
17635 | };
|
17636 |
|
17637 |
|
17638 | s.tooltip = null;
|
17639 | s.createToolTip = function () {
|
17640 | var div = document.createElement('div');
|
17641 | div.setAttribute('class', s.params.tooltipClass);
|
17642 | return div;
|
17643 | };
|
17644 |
|
17645 |
|
17646 | s.update = function () {
|
17647 | s.bar = s.parent.querySelector('.' + s.params.barClass);
|
17648 | if (!s.bar) {
|
17649 | s.bar = s.createBar();
|
17650 | s.indexs = s.createIndexs();
|
17651 | s.indexs.forEach(function (n) {
|
17652 | s.bar.appendChild(n);
|
17653 | });
|
17654 | s.parent.appendChild(s.bar);
|
17655 | }
|
17656 |
|
17657 | s.tooltip = s.parent.querySelector('.' + s.params.tooltipClass);
|
17658 | if (!s.tooltip) {
|
17659 | s.tooltip = s.createToolTip();
|
17660 | s.bar.parentNode.insertBefore(s.tooltip, s.bar.nextSibling);
|
17661 | }
|
17662 | };
|
17663 | s.update();
|
17664 |
|
17665 |
|
17666 | s.tooltip = s.parent.querySelector('.' + s.params.tooltipClass);
|
17667 |
|
17668 | |
17669 |
|
17670 |
|
17671 | s.setOverflowContainer = function (overflowContainer) {
|
17672 | if (!overflowContainer) return;
|
17673 | s.params.overflowContainer = overflowContainer;
|
17674 | s.overflowContainer = typeof s.params.overflowContainer === 'string' ? document.querySelector(s.params.overflowContainer) : s.params.overflowContainer;
|
17675 | };
|
17676 | s.setParent = function (parent) {
|
17677 | if (!parent) return;
|
17678 | s.params.parent = parent;
|
17679 | s.parent = typeof s.params.parent === 'string' ? document.querySelector(s.params.parent) : s.params.parent;
|
17680 | if (s.parent) {
|
17681 | s.parent.insertBefore(s.bar, s.parent.lastChild);
|
17682 | s.bar.parentNode.insertBefore(s.tooltip, s.bar.nextSibling);
|
17683 | }
|
17684 | };
|
17685 | var currentHTML = 'A';
|
17686 | s.goIndex = function (y) {
|
17687 |
|
17688 | var current = document.elementFromPoint(s.touches.startX, y);
|
17689 | if (!current || !current.parentNode || current.parentNode !== s.bar) return;
|
17690 | currentHTML = current.innerHTML;
|
17691 | s.tooltip.innerHTML = currentHTML;
|
17692 |
|
17693 | var target = s.overflowContainer.querySelector('[' + s.params.indexAttr + '=' + currentHTML + ']');
|
17694 | if (!target) return;
|
17695 |
|
17696 | if (target) s.overflowContainer.scrollTop = target.offsetTop;
|
17697 | };
|
17698 |
|
17699 | |
17700 |
|
17701 |
|
17702 |
|
17703 | s.events = function (detach) {
|
17704 | var touchTarget = s.bar;
|
17705 | var action = detach ? 'removeEventListener' : 'addEventListener';
|
17706 | touchTarget[action]('touchstart', s.onTouchStart, false);
|
17707 | touchTarget[action]('touchmove', s.onTouchMove, false);
|
17708 | touchTarget[action]('touchend', s.onTouchEnd, false);
|
17709 | touchTarget[action]('touchcancel', s.onTouchEnd, false);
|
17710 | };
|
17711 |
|
17712 | s.attach = function (event) {
|
17713 | s.events();
|
17714 | };
|
17715 | s.detach = function (event) {
|
17716 | s.events(true);
|
17717 | };
|
17718 | |
17719 |
|
17720 |
|
17721 |
|
17722 | s.touches = {
|
17723 | startX: 0,
|
17724 | startY: 0,
|
17725 | currentX: 0,
|
17726 | currentY: 0,
|
17727 | endX: 0,
|
17728 | endY: 0
|
17729 |
|
17730 |
|
17731 |
|
17732 |
|
17733 | };s.onTouchStart = function (e) {
|
17734 |
|
17735 | s.touches.startX = e.touches[0].clientX;
|
17736 | s.touches.startY = e.touches[0].clientY;
|
17737 |
|
17738 | s.goIndex(s.touches.startY);
|
17739 |
|
17740 | s.bar.classList.add(s.params.barActiveClass);
|
17741 | };
|
17742 | s.onTouchMove = function (e) {
|
17743 | s.touches.currentY = e.touches[0].clientY;
|
17744 | s.goIndex(s.touches.currentY);
|
17745 | };
|
17746 | s.onTouchEnd = function (e) {
|
17747 |
|
17748 |
|
17749 | s.bar.classList.remove(s.params.barActiveClass);
|
17750 | };
|
17751 | s.attach();
|
17752 | };
|
17753 |
|
17754 | var IndexBar_instance = (Indexbar);
|
17755 |
|
17756 | var IndexBar_class, IndexBar_temp;
|
17757 |
|
17758 | function IndexBar_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
17759 |
|
17760 | function IndexBar_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
17761 |
|
17762 | function IndexBar_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
17763 |
|
17764 |
|
17765 |
|
17766 |
|
17767 |
|
17768 | var IndexBar_IndexBar = (IndexBar_temp = IndexBar_class = function (_Component) {
|
17769 | IndexBar_inherits(IndexBar, _Component);
|
17770 |
|
17771 | function IndexBar(props) {
|
17772 | IndexBar_classCallCheck(this, IndexBar);
|
17773 |
|
17774 | var _this = IndexBar_possibleConstructorReturn(this, _Component.call(this, props));
|
17775 |
|
17776 | _this.componentDidUpdate = function (prevProps) {
|
17777 | if (_this.props.overflowContainer !== prevProps.overflowContainer) {
|
17778 | _this.instance.setOverflowContainer(_this.props.overflowContainer);
|
17779 | }
|
17780 | };
|
17781 |
|
17782 | return _this;
|
17783 | }
|
17784 |
|
17785 | IndexBar.prototype.componentDidMount = function componentDidMount() {
|
17786 | var overflowContainer = this.$el.parentNode;
|
17787 | var instance = new IndexBar_instance({
|
17788 | overflowContainer: this.props.overflowContainer || overflowContainer,
|
17789 | parent: this.props.parent || document.body
|
17790 | });
|
17791 | this.instance = instance;
|
17792 | };
|
17793 |
|
17794 | IndexBar.prototype.render = function render() {
|
17795 | var _this2 = this;
|
17796 |
|
17797 | var _props = this.props,
|
17798 | indexs = _props.indexs,
|
17799 | className = _props.className,
|
17800 | style = _props.style;
|
17801 |
|
17802 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
17803 | 'div',
|
17804 | { ref: function ref(el) {
|
17805 | _this2.$el = el;
|
17806 | }, className: 'indexbar' + (className ? ' ' + className : ''), style: style },
|
17807 | indexs.map(function (index, i) {
|
17808 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
17809 | 'a',
|
17810 | { key: 'btn' + i },
|
17811 | index
|
17812 | );
|
17813 | })
|
17814 | );
|
17815 | };
|
17816 |
|
17817 | return IndexBar;
|
17818 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), IndexBar_class.propTypes = {
|
17819 | overflowContainer: prop_types_default.a.any,
|
17820 | parent: prop_types_default.a.any,
|
17821 | className: prop_types_default.a.string,
|
17822 | style: prop_types_default.a.object,
|
17823 | indexs: prop_types_default.a.array
|
17824 | }, IndexBar_class.defaultProps = {
|
17825 | indexs: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'G', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
|
17826 | }, IndexBar_temp);
|
17827 |
|
17828 |
|
17829 |
|
17830 |
|
17831 | var src_IndexBar = (IndexBar_IndexBar);
|
17832 |
|
17833 | var InputArea_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; };
|
17834 |
|
17835 | function InputArea_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
17836 |
|
17837 | function InputArea_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
17838 |
|
17839 | function InputArea_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
17840 |
|
17841 |
|
17842 |
|
17843 |
|
17844 | var InputArea_InputArea = function (_Component) {
|
17845 | InputArea_inherits(InputArea, _Component);
|
17846 |
|
17847 | function InputArea(props) {
|
17848 | InputArea_classCallCheck(this, InputArea);
|
17849 |
|
17850 | return InputArea_possibleConstructorReturn(this, _Component.call(this, props));
|
17851 | }
|
17852 |
|
17853 | InputArea.prototype.componentDidMount = function componentDidMount() {
|
17854 | this.$el = this.refs.$ComponentInputText.$el;
|
17855 | this.$input = this.refs.$ComponentInputText.$input;
|
17856 | };
|
17857 |
|
17858 | InputArea.prototype.render = function render() {
|
17859 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(src_InputText, InputArea_extends({ ref: '$ComponentInputText' }, this.props, { type: 'textarea' }));
|
17860 | };
|
17861 |
|
17862 | return InputArea;
|
17863 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]);
|
17864 |
|
17865 |
|
17866 |
|
17867 |
|
17868 |
|
17869 | var src_InputArea = (InputArea_InputArea);
|
17870 |
|
17871 | var citys = [{
|
17872 | "key": "110000",
|
17873 | "value": "北京",
|
17874 | "children": [{
|
17875 | "key": "110101",
|
17876 | "value": "东城区"
|
17877 | }, {
|
17878 | "key": "110102",
|
17879 | "value": "西城区"
|
17880 | }, {
|
17881 | "key": "110105",
|
17882 | "value": "朝阳区"
|
17883 | }, {
|
17884 | "key": "110106",
|
17885 | "value": "丰台区"
|
17886 | }, {
|
17887 | "key": "110107",
|
17888 | "value": "石景山区"
|
17889 | }, {
|
17890 | "key": "110108",
|
17891 | "value": "海淀区"
|
17892 | }, {
|
17893 | "key": "110109",
|
17894 | "value": "门头沟区"
|
17895 | }, {
|
17896 | "key": "110111",
|
17897 | "value": "房山区"
|
17898 | }, {
|
17899 | "key": "110112",
|
17900 | "value": "通州区"
|
17901 | }, {
|
17902 | "key": "110113",
|
17903 | "value": "顺义区"
|
17904 | }, {
|
17905 | "key": "110114",
|
17906 | "value": "昌平区"
|
17907 | }, {
|
17908 | "key": "110115",
|
17909 | "value": "大兴区"
|
17910 | }, {
|
17911 | "key": "110116",
|
17912 | "value": "怀柔区"
|
17913 | }, {
|
17914 | "key": "110117",
|
17915 | "value": "平谷区"
|
17916 | }, {
|
17917 | "key": "110118",
|
17918 | "value": "密云区"
|
17919 | }, {
|
17920 | "key": "110119",
|
17921 | "value": "延庆区"
|
17922 | }]
|
17923 | }, {
|
17924 | "key": "120000",
|
17925 | "value": "天津",
|
17926 | "children": [{
|
17927 | "key": "120101",
|
17928 | "value": "和平区"
|
17929 | }, {
|
17930 | "key": "120102",
|
17931 | "value": "河东区"
|
17932 | }, {
|
17933 | "key": "120103",
|
17934 | "value": "河西区"
|
17935 | }, {
|
17936 | "key": "120104",
|
17937 | "value": "南开区"
|
17938 | }, {
|
17939 | "key": "120105",
|
17940 | "value": "河北区"
|
17941 | }, {
|
17942 | "key": "120106",
|
17943 | "value": "红桥区"
|
17944 | }, {
|
17945 | "key": "120110",
|
17946 | "value": "东丽区"
|
17947 | }, {
|
17948 | "key": "120111",
|
17949 | "value": "西青区"
|
17950 | }, {
|
17951 | "key": "120112",
|
17952 | "value": "津南区"
|
17953 | }, {
|
17954 | "key": "120113",
|
17955 | "value": "北辰区"
|
17956 | }, {
|
17957 | "key": "120114",
|
17958 | "value": "武清区"
|
17959 | }, {
|
17960 | "key": "120115",
|
17961 | "value": "宝坻区"
|
17962 | }, {
|
17963 | "key": "120116",
|
17964 | "value": "滨海新区"
|
17965 | }, {
|
17966 | "key": "120117",
|
17967 | "value": "宁河区"
|
17968 | }, {
|
17969 | "key": "120118",
|
17970 | "value": "静海区"
|
17971 | }, {
|
17972 | "key": "120119",
|
17973 | "value": "蓟州区"
|
17974 | }]
|
17975 | }, {
|
17976 | "key": "130000",
|
17977 | "value": "河北",
|
17978 | "children": [{
|
17979 | "key": "130100",
|
17980 | "value": "石家庄市",
|
17981 | "children": [{
|
17982 | "key": "130102",
|
17983 | "value": "长安区"
|
17984 | }, {
|
17985 | "key": "130104",
|
17986 | "value": "桥西区"
|
17987 | }, {
|
17988 | "key": "130105",
|
17989 | "value": "新华区"
|
17990 | }, {
|
17991 | "key": "130107",
|
17992 | "value": "井陉矿区"
|
17993 | }, {
|
17994 | "key": "130108",
|
17995 | "value": "裕华区"
|
17996 | }, {
|
17997 | "key": "130109",
|
17998 | "value": "藁城区"
|
17999 | }, {
|
18000 | "key": "130110",
|
18001 | "value": "鹿泉区"
|
18002 | }, {
|
18003 | "key": "130111",
|
18004 | "value": "栾城区"
|
18005 | }, {
|
18006 | "key": "130121",
|
18007 | "value": "井陉县"
|
18008 | }, {
|
18009 | "key": "130123",
|
18010 | "value": "正定县"
|
18011 | }, {
|
18012 | "key": "130125",
|
18013 | "value": "行唐县"
|
18014 | }, {
|
18015 | "key": "130126",
|
18016 | "value": "灵寿县"
|
18017 | }, {
|
18018 | "key": "130127",
|
18019 | "value": "高邑县"
|
18020 | }, {
|
18021 | "key": "130128",
|
18022 | "value": "深泽县"
|
18023 | }, {
|
18024 | "key": "130129",
|
18025 | "value": "赞皇县"
|
18026 | }, {
|
18027 | "key": "130130",
|
18028 | "value": "无极县"
|
18029 | }, {
|
18030 | "key": "130131",
|
18031 | "value": "平山县"
|
18032 | }, {
|
18033 | "key": "130132",
|
18034 | "value": "元氏县"
|
18035 | }, {
|
18036 | "key": "130133",
|
18037 | "value": "赵县"
|
18038 | }, {
|
18039 | "key": "130181",
|
18040 | "value": "辛集市"
|
18041 | }, {
|
18042 | "key": "130183",
|
18043 | "value": "晋州市"
|
18044 | }, {
|
18045 | "key": "130184",
|
18046 | "value": "新乐市"
|
18047 | }]
|
18048 | }, {
|
18049 | "key": "130200",
|
18050 | "value": "唐山市",
|
18051 | "children": [{
|
18052 | "key": "130202",
|
18053 | "value": "路南区"
|
18054 | }, {
|
18055 | "key": "130203",
|
18056 | "value": "路北区"
|
18057 | }, {
|
18058 | "key": "130204",
|
18059 | "value": "古冶区"
|
18060 | }, {
|
18061 | "key": "130205",
|
18062 | "value": "开平区"
|
18063 | }, {
|
18064 | "key": "130207",
|
18065 | "value": "丰南区"
|
18066 | }, {
|
18067 | "key": "130208",
|
18068 | "value": "丰润区"
|
18069 | }, {
|
18070 | "key": "130209",
|
18071 | "value": "曹妃甸区"
|
18072 | }, {
|
18073 | "key": "130223",
|
18074 | "value": "滦县"
|
18075 | }, {
|
18076 | "key": "130224",
|
18077 | "value": "滦南县"
|
18078 | }, {
|
18079 | "key": "130225",
|
18080 | "value": "乐亭县"
|
18081 | }, {
|
18082 | "key": "130227",
|
18083 | "value": "迁西县"
|
18084 | }, {
|
18085 | "key": "130229",
|
18086 | "value": "玉田县"
|
18087 | }, {
|
18088 | "key": "130281",
|
18089 | "value": "遵化市"
|
18090 | }, {
|
18091 | "key": "130283",
|
18092 | "value": "迁安市"
|
18093 | }]
|
18094 | }, {
|
18095 | "key": "130300",
|
18096 | "value": "秦皇岛市",
|
18097 | "children": [{
|
18098 | "key": "130302",
|
18099 | "value": "海港区"
|
18100 | }, {
|
18101 | "key": "130303",
|
18102 | "value": "山海关区"
|
18103 | }, {
|
18104 | "key": "130304",
|
18105 | "value": "北戴河区"
|
18106 | }, {
|
18107 | "key": "130306",
|
18108 | "value": "抚宁区"
|
18109 | }, {
|
18110 | "key": "130321",
|
18111 | "value": "青龙满族自治县"
|
18112 | }, {
|
18113 | "key": "130322",
|
18114 | "value": "昌黎县"
|
18115 | }, {
|
18116 | "key": "130324",
|
18117 | "value": "卢龙县"
|
18118 | }]
|
18119 | }, {
|
18120 | "key": "130400",
|
18121 | "value": "邯郸市",
|
18122 | "children": [{
|
18123 | "key": "130402",
|
18124 | "value": "邯山区"
|
18125 | }, {
|
18126 | "key": "130403",
|
18127 | "value": "丛台区"
|
18128 | }, {
|
18129 | "key": "130404",
|
18130 | "value": "复兴区"
|
18131 | }, {
|
18132 | "key": "130406",
|
18133 | "value": "峰峰矿区"
|
18134 | }, {
|
18135 | "key": "130407",
|
18136 | "value": "肥乡区"
|
18137 | }, {
|
18138 | "key": "130408",
|
18139 | "value": "永年区"
|
18140 | }, {
|
18141 | "key": "130423",
|
18142 | "value": "临漳县"
|
18143 | }, {
|
18144 | "key": "130424",
|
18145 | "value": "成安县"
|
18146 | }, {
|
18147 | "key": "130425",
|
18148 | "value": "大名县"
|
18149 | }, {
|
18150 | "key": "130426",
|
18151 | "value": "涉县"
|
18152 | }, {
|
18153 | "key": "130427",
|
18154 | "value": "磁县"
|
18155 | }, {
|
18156 | "key": "130430",
|
18157 | "value": "邱县"
|
18158 | }, {
|
18159 | "key": "130431",
|
18160 | "value": "鸡泽县"
|
18161 | }, {
|
18162 | "key": "130432",
|
18163 | "value": "广平县"
|
18164 | }, {
|
18165 | "key": "130433",
|
18166 | "value": "馆陶县"
|
18167 | }, {
|
18168 | "key": "130434",
|
18169 | "value": "魏县"
|
18170 | }, {
|
18171 | "key": "130435",
|
18172 | "value": "曲周县"
|
18173 | }, {
|
18174 | "key": "130481",
|
18175 | "value": "武安市"
|
18176 | }]
|
18177 | }, {
|
18178 | "key": "130500",
|
18179 | "value": "邢台市",
|
18180 | "children": [{
|
18181 | "key": "130502",
|
18182 | "value": "桥东区"
|
18183 | }, {
|
18184 | "key": "130503",
|
18185 | "value": "桥西区"
|
18186 | }, {
|
18187 | "key": "130521",
|
18188 | "value": "邢台县"
|
18189 | }, {
|
18190 | "key": "130522",
|
18191 | "value": "临城县"
|
18192 | }, {
|
18193 | "key": "130523",
|
18194 | "value": "内丘县"
|
18195 | }, {
|
18196 | "key": "130524",
|
18197 | "value": "柏乡县"
|
18198 | }, {
|
18199 | "key": "130525",
|
18200 | "value": "隆尧县"
|
18201 | }, {
|
18202 | "key": "130526",
|
18203 | "value": "任县"
|
18204 | }, {
|
18205 | "key": "130527",
|
18206 | "value": "南和县"
|
18207 | }, {
|
18208 | "key": "130528",
|
18209 | "value": "宁晋县"
|
18210 | }, {
|
18211 | "key": "130529",
|
18212 | "value": "巨鹿县"
|
18213 | }, {
|
18214 | "key": "130530",
|
18215 | "value": "新河县"
|
18216 | }, {
|
18217 | "key": "130531",
|
18218 | "value": "广宗县"
|
18219 | }, {
|
18220 | "key": "130532",
|
18221 | "value": "平乡县"
|
18222 | }, {
|
18223 | "key": "130533",
|
18224 | "value": "威县"
|
18225 | }, {
|
18226 | "key": "130534",
|
18227 | "value": "清河县"
|
18228 | }, {
|
18229 | "key": "130535",
|
18230 | "value": "临西县"
|
18231 | }, {
|
18232 | "key": "130581",
|
18233 | "value": "南宫市"
|
18234 | }, {
|
18235 | "key": "130582",
|
18236 | "value": "沙河市"
|
18237 | }]
|
18238 | }, {
|
18239 | "key": "130600",
|
18240 | "value": "保定市",
|
18241 | "children": [{
|
18242 | "key": "130602",
|
18243 | "value": "竞秀区"
|
18244 | }, {
|
18245 | "key": "130606",
|
18246 | "value": "莲池区"
|
18247 | }, {
|
18248 | "key": "130607",
|
18249 | "value": "满城区"
|
18250 | }, {
|
18251 | "key": "130608",
|
18252 | "value": "清苑区"
|
18253 | }, {
|
18254 | "key": "130609",
|
18255 | "value": "徐水区"
|
18256 | }, {
|
18257 | "key": "130623",
|
18258 | "value": "涞水县"
|
18259 | }, {
|
18260 | "key": "130624",
|
18261 | "value": "阜平县"
|
18262 | }, {
|
18263 | "key": "130626",
|
18264 | "value": "定兴县"
|
18265 | }, {
|
18266 | "key": "130627",
|
18267 | "value": "唐县"
|
18268 | }, {
|
18269 | "key": "130628",
|
18270 | "value": "高阳县"
|
18271 | }, {
|
18272 | "key": "130629",
|
18273 | "value": "容城县"
|
18274 | }, {
|
18275 | "key": "130630",
|
18276 | "value": "涞源县"
|
18277 | }, {
|
18278 | "key": "130631",
|
18279 | "value": "望都县"
|
18280 | }, {
|
18281 | "key": "130632",
|
18282 | "value": "安新县"
|
18283 | }, {
|
18284 | "key": "130633",
|
18285 | "value": "易县"
|
18286 | }, {
|
18287 | "key": "130634",
|
18288 | "value": "曲阳县"
|
18289 | }, {
|
18290 | "key": "130635",
|
18291 | "value": "蠡县"
|
18292 | }, {
|
18293 | "key": "130636",
|
18294 | "value": "顺平县"
|
18295 | }, {
|
18296 | "key": "130637",
|
18297 | "value": "博野县"
|
18298 | }, {
|
18299 | "key": "130638",
|
18300 | "value": "雄县"
|
18301 | }, {
|
18302 | "key": "130681",
|
18303 | "value": "涿州市"
|
18304 | }, {
|
18305 | "key": "130682",
|
18306 | "value": "定州市"
|
18307 | }, {
|
18308 | "key": "130683",
|
18309 | "value": "安国市"
|
18310 | }, {
|
18311 | "key": "130684",
|
18312 | "value": "高碑店市"
|
18313 | }]
|
18314 | }, {
|
18315 | "key": "130700",
|
18316 | "value": "张家口市",
|
18317 | "children": [{
|
18318 | "key": "130702",
|
18319 | "value": "桥东区"
|
18320 | }, {
|
18321 | "key": "130703",
|
18322 | "value": "桥西区"
|
18323 | }, {
|
18324 | "key": "130705",
|
18325 | "value": "宣化区"
|
18326 | }, {
|
18327 | "key": "130706",
|
18328 | "value": "下花园区"
|
18329 | }, {
|
18330 | "key": "130708",
|
18331 | "value": "万全区"
|
18332 | }, {
|
18333 | "key": "130709",
|
18334 | "value": "崇礼区"
|
18335 | }, {
|
18336 | "key": "130722",
|
18337 | "value": "张北县"
|
18338 | }, {
|
18339 | "key": "130723",
|
18340 | "value": "康保县"
|
18341 | }, {
|
18342 | "key": "130724",
|
18343 | "value": "沽源县"
|
18344 | }, {
|
18345 | "key": "130725",
|
18346 | "value": "尚义县"
|
18347 | }, {
|
18348 | "key": "130726",
|
18349 | "value": "蔚县"
|
18350 | }, {
|
18351 | "key": "130727",
|
18352 | "value": "阳原县"
|
18353 | }, {
|
18354 | "key": "130728",
|
18355 | "value": "怀安县"
|
18356 | }, {
|
18357 | "key": "130730",
|
18358 | "value": "怀来县"
|
18359 | }, {
|
18360 | "key": "130731",
|
18361 | "value": "涿鹿县"
|
18362 | }, {
|
18363 | "key": "130732",
|
18364 | "value": "赤城县"
|
18365 | }]
|
18366 | }, {
|
18367 | "key": "130800",
|
18368 | "value": "承德市",
|
18369 | "children": [{
|
18370 | "key": "130802",
|
18371 | "value": "双桥区"
|
18372 | }, {
|
18373 | "key": "130803",
|
18374 | "value": "双滦区"
|
18375 | }, {
|
18376 | "key": "130804",
|
18377 | "value": "鹰手营子矿区"
|
18378 | }, {
|
18379 | "key": "130821",
|
18380 | "value": "承德县"
|
18381 | }, {
|
18382 | "key": "130822",
|
18383 | "value": "兴隆县"
|
18384 | }, {
|
18385 | "key": "130824",
|
18386 | "value": "滦平县"
|
18387 | }, {
|
18388 | "key": "130825",
|
18389 | "value": "隆化县"
|
18390 | }, {
|
18391 | "key": "130826",
|
18392 | "value": "丰宁满族自治县"
|
18393 | }, {
|
18394 | "key": "130827",
|
18395 | "value": "宽城满族自治县"
|
18396 | }, {
|
18397 | "key": "130828",
|
18398 | "value": "围场满族蒙古族自治县"
|
18399 | }, {
|
18400 | "key": "130881",
|
18401 | "value": "平泉市"
|
18402 | }]
|
18403 | }, {
|
18404 | "key": "130900",
|
18405 | "value": "沧州市",
|
18406 | "children": [{
|
18407 | "key": "130902",
|
18408 | "value": "新华区"
|
18409 | }, {
|
18410 | "key": "130903",
|
18411 | "value": "运河区"
|
18412 | }, {
|
18413 | "key": "130921",
|
18414 | "value": "沧县"
|
18415 | }, {
|
18416 | "key": "130922",
|
18417 | "value": "青县"
|
18418 | }, {
|
18419 | "key": "130923",
|
18420 | "value": "东光县"
|
18421 | }, {
|
18422 | "key": "130924",
|
18423 | "value": "海兴县"
|
18424 | }, {
|
18425 | "key": "130925",
|
18426 | "value": "盐山县"
|
18427 | }, {
|
18428 | "key": "130926",
|
18429 | "value": "肃宁县"
|
18430 | }, {
|
18431 | "key": "130927",
|
18432 | "value": "南皮县"
|
18433 | }, {
|
18434 | "key": "130928",
|
18435 | "value": "吴桥县"
|
18436 | }, {
|
18437 | "key": "130929",
|
18438 | "value": "献县"
|
18439 | }, {
|
18440 | "key": "130930",
|
18441 | "value": "孟村回族自治县"
|
18442 | }, {
|
18443 | "key": "130981",
|
18444 | "value": "泊头市"
|
18445 | }, {
|
18446 | "key": "130982",
|
18447 | "value": "任丘市"
|
18448 | }, {
|
18449 | "key": "130983",
|
18450 | "value": "黄骅市"
|
18451 | }, {
|
18452 | "key": "130984",
|
18453 | "value": "河间市"
|
18454 | }]
|
18455 | }, {
|
18456 | "key": "131000",
|
18457 | "value": "廊坊市",
|
18458 | "children": [{
|
18459 | "key": "131002",
|
18460 | "value": "安次区"
|
18461 | }, {
|
18462 | "key": "131003",
|
18463 | "value": "广阳区"
|
18464 | }, {
|
18465 | "key": "131022",
|
18466 | "value": "固安县"
|
18467 | }, {
|
18468 | "key": "131023",
|
18469 | "value": "永清县"
|
18470 | }, {
|
18471 | "key": "131024",
|
18472 | "value": "香河县"
|
18473 | }, {
|
18474 | "key": "131025",
|
18475 | "value": "大城县"
|
18476 | }, {
|
18477 | "key": "131026",
|
18478 | "value": "文安县"
|
18479 | }, {
|
18480 | "key": "131028",
|
18481 | "value": "大厂回族自治县"
|
18482 | }, {
|
18483 | "key": "131081",
|
18484 | "value": "霸州市"
|
18485 | }, {
|
18486 | "key": "131082",
|
18487 | "value": "三河市"
|
18488 | }]
|
18489 | }, {
|
18490 | "key": "131100",
|
18491 | "value": "衡水市",
|
18492 | "children": [{
|
18493 | "key": "131102",
|
18494 | "value": "桃城区"
|
18495 | }, {
|
18496 | "key": "131103",
|
18497 | "value": "冀州区"
|
18498 | }, {
|
18499 | "key": "131121",
|
18500 | "value": "枣强县"
|
18501 | }, {
|
18502 | "key": "131122",
|
18503 | "value": "武邑县"
|
18504 | }, {
|
18505 | "key": "131123",
|
18506 | "value": "武强县"
|
18507 | }, {
|
18508 | "key": "131124",
|
18509 | "value": "饶阳县"
|
18510 | }, {
|
18511 | "key": "131125",
|
18512 | "value": "安平县"
|
18513 | }, {
|
18514 | "key": "131126",
|
18515 | "value": "故城县"
|
18516 | }, {
|
18517 | "key": "131127",
|
18518 | "value": "景县"
|
18519 | }, {
|
18520 | "key": "131128",
|
18521 | "value": "阜城县"
|
18522 | }, {
|
18523 | "key": "131182",
|
18524 | "value": "深州市"
|
18525 | }]
|
18526 | }]
|
18527 | }, {
|
18528 | "key": "140000",
|
18529 | "value": "山西",
|
18530 | "children": [{
|
18531 | "key": "140100",
|
18532 | "value": "太原市",
|
18533 | "children": [{
|
18534 | "key": "140105",
|
18535 | "value": "小店区"
|
18536 | }, {
|
18537 | "key": "140106",
|
18538 | "value": "迎泽区"
|
18539 | }, {
|
18540 | "key": "140107",
|
18541 | "value": "杏花岭区"
|
18542 | }, {
|
18543 | "key": "140108",
|
18544 | "value": "尖草坪区"
|
18545 | }, {
|
18546 | "key": "140109",
|
18547 | "value": "万柏林区"
|
18548 | }, {
|
18549 | "key": "140110",
|
18550 | "value": "晋源区"
|
18551 | }, {
|
18552 | "key": "140121",
|
18553 | "value": "清徐县"
|
18554 | }, {
|
18555 | "key": "140122",
|
18556 | "value": "阳曲县"
|
18557 | }, {
|
18558 | "key": "140123",
|
18559 | "value": "娄烦县"
|
18560 | }, {
|
18561 | "key": "140181",
|
18562 | "value": "古交市"
|
18563 | }]
|
18564 | }, {
|
18565 | "key": "140200",
|
18566 | "value": "大同市",
|
18567 | "children": [{
|
18568 | "key": "140202",
|
18569 | "value": "城区"
|
18570 | }, {
|
18571 | "key": "140203",
|
18572 | "value": "矿区"
|
18573 | }, {
|
18574 | "key": "140211",
|
18575 | "value": "南郊区"
|
18576 | }, {
|
18577 | "key": "140212",
|
18578 | "value": "新荣区"
|
18579 | }, {
|
18580 | "key": "140215",
|
18581 | "value": "云州区"
|
18582 | }, {
|
18583 | "key": "140221",
|
18584 | "value": "阳高县"
|
18585 | }, {
|
18586 | "key": "140222",
|
18587 | "value": "天镇县"
|
18588 | }, {
|
18589 | "key": "140223",
|
18590 | "value": "广灵县"
|
18591 | }, {
|
18592 | "key": "140224",
|
18593 | "value": "灵丘县"
|
18594 | }, {
|
18595 | "key": "140225",
|
18596 | "value": "浑源县"
|
18597 | }, {
|
18598 | "key": "140226",
|
18599 | "value": "左云县"
|
18600 | }]
|
18601 | }, {
|
18602 | "key": "140300",
|
18603 | "value": "阳泉市",
|
18604 | "children": [{
|
18605 | "key": "140302",
|
18606 | "value": "城区"
|
18607 | }, {
|
18608 | "key": "140303",
|
18609 | "value": "矿区"
|
18610 | }, {
|
18611 | "key": "140311",
|
18612 | "value": "郊区"
|
18613 | }, {
|
18614 | "key": "140321",
|
18615 | "value": "平定县"
|
18616 | }, {
|
18617 | "key": "140322",
|
18618 | "value": "盂县"
|
18619 | }]
|
18620 | }, {
|
18621 | "key": "140400",
|
18622 | "value": "长治市",
|
18623 | "children": [{
|
18624 | "key": "140402",
|
18625 | "value": "城区"
|
18626 | }, {
|
18627 | "key": "140411",
|
18628 | "value": "郊区"
|
18629 | }, {
|
18630 | "key": "140421",
|
18631 | "value": "长治县"
|
18632 | }, {
|
18633 | "key": "140423",
|
18634 | "value": "襄垣县"
|
18635 | }, {
|
18636 | "key": "140424",
|
18637 | "value": "屯留县"
|
18638 | }, {
|
18639 | "key": "140425",
|
18640 | "value": "平顺县"
|
18641 | }, {
|
18642 | "key": "140426",
|
18643 | "value": "黎城县"
|
18644 | }, {
|
18645 | "key": "140427",
|
18646 | "value": "壶关县"
|
18647 | }, {
|
18648 | "key": "140428",
|
18649 | "value": "长子县"
|
18650 | }, {
|
18651 | "key": "140429",
|
18652 | "value": "武乡县"
|
18653 | }, {
|
18654 | "key": "140430",
|
18655 | "value": "沁县"
|
18656 | }, {
|
18657 | "key": "140431",
|
18658 | "value": "沁源县"
|
18659 | }, {
|
18660 | "key": "140481",
|
18661 | "value": "潞城市"
|
18662 | }]
|
18663 | }, {
|
18664 | "key": "140500",
|
18665 | "value": "晋城市",
|
18666 | "children": [{
|
18667 | "key": "140502",
|
18668 | "value": "城区"
|
18669 | }, {
|
18670 | "key": "140521",
|
18671 | "value": "沁水县"
|
18672 | }, {
|
18673 | "key": "140522",
|
18674 | "value": "阳城县"
|
18675 | }, {
|
18676 | "key": "140524",
|
18677 | "value": "陵川县"
|
18678 | }, {
|
18679 | "key": "140525",
|
18680 | "value": "泽州县"
|
18681 | }, {
|
18682 | "key": "140581",
|
18683 | "value": "高平市"
|
18684 | }]
|
18685 | }, {
|
18686 | "key": "140600",
|
18687 | "value": "朔州市",
|
18688 | "children": [{
|
18689 | "key": "140602",
|
18690 | "value": "朔城区"
|
18691 | }, {
|
18692 | "key": "140603",
|
18693 | "value": "平鲁区"
|
18694 | }, {
|
18695 | "key": "140621",
|
18696 | "value": "山阴县"
|
18697 | }, {
|
18698 | "key": "140622",
|
18699 | "value": "应县"
|
18700 | }, {
|
18701 | "key": "140623",
|
18702 | "value": "右玉县"
|
18703 | }, {
|
18704 | "key": "140681",
|
18705 | "value": "怀仁市"
|
18706 | }]
|
18707 | }, {
|
18708 | "key": "140700",
|
18709 | "value": "晋中市",
|
18710 | "children": [{
|
18711 | "key": "140702",
|
18712 | "value": "榆次区"
|
18713 | }, {
|
18714 | "key": "140721",
|
18715 | "value": "榆社县"
|
18716 | }, {
|
18717 | "key": "140722",
|
18718 | "value": "左权县"
|
18719 | }, {
|
18720 | "key": "140723",
|
18721 | "value": "和顺县"
|
18722 | }, {
|
18723 | "key": "140724",
|
18724 | "value": "昔阳县"
|
18725 | }, {
|
18726 | "key": "140725",
|
18727 | "value": "寿阳县"
|
18728 | }, {
|
18729 | "key": "140726",
|
18730 | "value": "太谷县"
|
18731 | }, {
|
18732 | "key": "140727",
|
18733 | "value": "祁县"
|
18734 | }, {
|
18735 | "key": "140728",
|
18736 | "value": "平遥县"
|
18737 | }, {
|
18738 | "key": "140729",
|
18739 | "value": "灵石县"
|
18740 | }, {
|
18741 | "key": "140781",
|
18742 | "value": "介休市"
|
18743 | }]
|
18744 | }, {
|
18745 | "key": "140800",
|
18746 | "value": "运城市",
|
18747 | "children": [{
|
18748 | "key": "140802",
|
18749 | "value": "盐湖区"
|
18750 | }, {
|
18751 | "key": "140821",
|
18752 | "value": "临猗县"
|
18753 | }, {
|
18754 | "key": "140822",
|
18755 | "value": "万荣县"
|
18756 | }, {
|
18757 | "key": "140823",
|
18758 | "value": "闻喜县"
|
18759 | }, {
|
18760 | "key": "140824",
|
18761 | "value": "稷山县"
|
18762 | }, {
|
18763 | "key": "140825",
|
18764 | "value": "新绛县"
|
18765 | }, {
|
18766 | "key": "140826",
|
18767 | "value": "绛县"
|
18768 | }, {
|
18769 | "key": "140827",
|
18770 | "value": "垣曲县"
|
18771 | }, {
|
18772 | "key": "140828",
|
18773 | "value": "夏县"
|
18774 | }, {
|
18775 | "key": "140829",
|
18776 | "value": "平陆县"
|
18777 | }, {
|
18778 | "key": "140830",
|
18779 | "value": "芮城县"
|
18780 | }, {
|
18781 | "key": "140881",
|
18782 | "value": "永济市"
|
18783 | }, {
|
18784 | "key": "140882",
|
18785 | "value": "河津市"
|
18786 | }]
|
18787 | }, {
|
18788 | "key": "140900",
|
18789 | "value": "忻州市",
|
18790 | "children": [{
|
18791 | "key": "140902",
|
18792 | "value": "忻府区"
|
18793 | }, {
|
18794 | "key": "140921",
|
18795 | "value": "定襄县"
|
18796 | }, {
|
18797 | "key": "140922",
|
18798 | "value": "五台县"
|
18799 | }, {
|
18800 | "key": "140923",
|
18801 | "value": "代县"
|
18802 | }, {
|
18803 | "key": "140924",
|
18804 | "value": "繁峙县"
|
18805 | }, {
|
18806 | "key": "140925",
|
18807 | "value": "宁武县"
|
18808 | }, {
|
18809 | "key": "140926",
|
18810 | "value": "静乐县"
|
18811 | }, {
|
18812 | "key": "140927",
|
18813 | "value": "神池县"
|
18814 | }, {
|
18815 | "key": "140928",
|
18816 | "value": "五寨县"
|
18817 | }, {
|
18818 | "key": "140929",
|
18819 | "value": "岢岚县"
|
18820 | }, {
|
18821 | "key": "140930",
|
18822 | "value": "河曲县"
|
18823 | }, {
|
18824 | "key": "140931",
|
18825 | "value": "保德县"
|
18826 | }, {
|
18827 | "key": "140932",
|
18828 | "value": "偏关县"
|
18829 | }, {
|
18830 | "key": "140981",
|
18831 | "value": "原平市"
|
18832 | }]
|
18833 | }, {
|
18834 | "key": "141000",
|
18835 | "value": "临汾市",
|
18836 | "children": [{
|
18837 | "key": "141002",
|
18838 | "value": "尧都区"
|
18839 | }, {
|
18840 | "key": "141021",
|
18841 | "value": "曲沃县"
|
18842 | }, {
|
18843 | "key": "141022",
|
18844 | "value": "翼城县"
|
18845 | }, {
|
18846 | "key": "141023",
|
18847 | "value": "襄汾县"
|
18848 | }, {
|
18849 | "key": "141024",
|
18850 | "value": "洪洞县"
|
18851 | }, {
|
18852 | "key": "141025",
|
18853 | "value": "古县"
|
18854 | }, {
|
18855 | "key": "141026",
|
18856 | "value": "安泽县"
|
18857 | }, {
|
18858 | "key": "141027",
|
18859 | "value": "浮山县"
|
18860 | }, {
|
18861 | "key": "141028",
|
18862 | "value": "吉县"
|
18863 | }, {
|
18864 | "key": "141029",
|
18865 | "value": "乡宁县"
|
18866 | }, {
|
18867 | "key": "141030",
|
18868 | "value": "大宁县"
|
18869 | }, {
|
18870 | "key": "141031",
|
18871 | "value": "隰县"
|
18872 | }, {
|
18873 | "key": "141032",
|
18874 | "value": "永和县"
|
18875 | }, {
|
18876 | "key": "141033",
|
18877 | "value": "蒲县"
|
18878 | }, {
|
18879 | "key": "141034",
|
18880 | "value": "汾西县"
|
18881 | }, {
|
18882 | "key": "141081",
|
18883 | "value": "侯马市"
|
18884 | }, {
|
18885 | "key": "141082",
|
18886 | "value": "霍州市"
|
18887 | }]
|
18888 | }, {
|
18889 | "key": "141100",
|
18890 | "value": "吕梁市",
|
18891 | "children": [{
|
18892 | "key": "141102",
|
18893 | "value": "离石区"
|
18894 | }, {
|
18895 | "key": "141121",
|
18896 | "value": "文水县"
|
18897 | }, {
|
18898 | "key": "141122",
|
18899 | "value": "交城县"
|
18900 | }, {
|
18901 | "key": "141123",
|
18902 | "value": "兴县"
|
18903 | }, {
|
18904 | "key": "141124",
|
18905 | "value": "临县"
|
18906 | }, {
|
18907 | "key": "141125",
|
18908 | "value": "柳林县"
|
18909 | }, {
|
18910 | "key": "141126",
|
18911 | "value": "石楼县"
|
18912 | }, {
|
18913 | "key": "141127",
|
18914 | "value": "岚县"
|
18915 | }, {
|
18916 | "key": "141128",
|
18917 | "value": "方山县"
|
18918 | }, {
|
18919 | "key": "141129",
|
18920 | "value": "中阳县"
|
18921 | }, {
|
18922 | "key": "141130",
|
18923 | "value": "交口县"
|
18924 | }, {
|
18925 | "key": "141181",
|
18926 | "value": "孝义市"
|
18927 | }, {
|
18928 | "key": "141182",
|
18929 | "value": "汾阳市"
|
18930 | }]
|
18931 | }]
|
18932 | }, {
|
18933 | "key": "150000",
|
18934 | "value": "内蒙古",
|
18935 | "children": [{
|
18936 | "key": "150100",
|
18937 | "value": "呼和浩特市",
|
18938 | "children": [{
|
18939 | "key": "150102",
|
18940 | "value": "新城区"
|
18941 | }, {
|
18942 | "key": "150103",
|
18943 | "value": "回民区"
|
18944 | }, {
|
18945 | "key": "150104",
|
18946 | "value": "玉泉区"
|
18947 | }, {
|
18948 | "key": "150105",
|
18949 | "value": "赛罕区"
|
18950 | }, {
|
18951 | "key": "150121",
|
18952 | "value": "土默特左旗"
|
18953 | }, {
|
18954 | "key": "150122",
|
18955 | "value": "托克托县"
|
18956 | }, {
|
18957 | "key": "150123",
|
18958 | "value": "和林格尔县"
|
18959 | }, {
|
18960 | "key": "150124",
|
18961 | "value": "清水河县"
|
18962 | }, {
|
18963 | "key": "150125",
|
18964 | "value": "武川县"
|
18965 | }]
|
18966 | }, {
|
18967 | "key": "150200",
|
18968 | "value": "包头市",
|
18969 | "children": [{
|
18970 | "key": "150202",
|
18971 | "value": "东河区"
|
18972 | }, {
|
18973 | "key": "150203",
|
18974 | "value": "昆都仑区"
|
18975 | }, {
|
18976 | "key": "150204",
|
18977 | "value": "青山区"
|
18978 | }, {
|
18979 | "key": "150205",
|
18980 | "value": "石拐区"
|
18981 | }, {
|
18982 | "key": "150206",
|
18983 | "value": "白云鄂博矿区"
|
18984 | }, {
|
18985 | "key": "150207",
|
18986 | "value": "九原区"
|
18987 | }, {
|
18988 | "key": "150221",
|
18989 | "value": "土默特右旗"
|
18990 | }, {
|
18991 | "key": "150222",
|
18992 | "value": "固阳县"
|
18993 | }, {
|
18994 | "key": "150223",
|
18995 | "value": "达尔罕茂明安联合旗"
|
18996 | }]
|
18997 | }, {
|
18998 | "key": "150300",
|
18999 | "value": "乌海市",
|
19000 | "children": [{
|
19001 | "key": "150302",
|
19002 | "value": "海勃湾区"
|
19003 | }, {
|
19004 | "key": "150303",
|
19005 | "value": "海南区"
|
19006 | }, {
|
19007 | "key": "150304",
|
19008 | "value": "乌达区"
|
19009 | }]
|
19010 | }, {
|
19011 | "key": "150400",
|
19012 | "value": "赤峰市",
|
19013 | "children": [{
|
19014 | "key": "150402",
|
19015 | "value": "红山区"
|
19016 | }, {
|
19017 | "key": "150403",
|
19018 | "value": "元宝山区"
|
19019 | }, {
|
19020 | "key": "150404",
|
19021 | "value": "松山区"
|
19022 | }, {
|
19023 | "key": "150421",
|
19024 | "value": "阿鲁科尔沁旗"
|
19025 | }, {
|
19026 | "key": "150422",
|
19027 | "value": "巴林左旗"
|
19028 | }, {
|
19029 | "key": "150423",
|
19030 | "value": "巴林右旗"
|
19031 | }, {
|
19032 | "key": "150424",
|
19033 | "value": "林西县"
|
19034 | }, {
|
19035 | "key": "150425",
|
19036 | "value": "克什克腾旗"
|
19037 | }, {
|
19038 | "key": "150426",
|
19039 | "value": "翁牛特旗"
|
19040 | }, {
|
19041 | "key": "150428",
|
19042 | "value": "喀喇沁旗"
|
19043 | }, {
|
19044 | "key": "150429",
|
19045 | "value": "宁城县"
|
19046 | }, {
|
19047 | "key": "150430",
|
19048 | "value": "敖汉旗"
|
19049 | }]
|
19050 | }, {
|
19051 | "key": "150500",
|
19052 | "value": "通辽市",
|
19053 | "children": [{
|
19054 | "key": "150502",
|
19055 | "value": "科尔沁区"
|
19056 | }, {
|
19057 | "key": "150521",
|
19058 | "value": "科尔沁左翼中旗"
|
19059 | }, {
|
19060 | "key": "150522",
|
19061 | "value": "科尔沁左翼后旗"
|
19062 | }, {
|
19063 | "key": "150523",
|
19064 | "value": "开鲁县"
|
19065 | }, {
|
19066 | "key": "150524",
|
19067 | "value": "库伦旗"
|
19068 | }, {
|
19069 | "key": "150525",
|
19070 | "value": "奈曼旗"
|
19071 | }, {
|
19072 | "key": "150526",
|
19073 | "value": "扎鲁特旗"
|
19074 | }, {
|
19075 | "key": "150581",
|
19076 | "value": "霍林郭勒市"
|
19077 | }]
|
19078 | }, {
|
19079 | "key": "150600",
|
19080 | "value": "鄂尔多斯市",
|
19081 | "children": [{
|
19082 | "key": "150602",
|
19083 | "value": "东胜区"
|
19084 | }, {
|
19085 | "key": "150603",
|
19086 | "value": "康巴什区"
|
19087 | }, {
|
19088 | "key": "150621",
|
19089 | "value": "达拉特旗"
|
19090 | }, {
|
19091 | "key": "150622",
|
19092 | "value": "准格尔旗"
|
19093 | }, {
|
19094 | "key": "150623",
|
19095 | "value": "鄂托克前旗"
|
19096 | }, {
|
19097 | "key": "150624",
|
19098 | "value": "鄂托克旗"
|
19099 | }, {
|
19100 | "key": "150625",
|
19101 | "value": "杭锦旗"
|
19102 | }, {
|
19103 | "key": "150626",
|
19104 | "value": "乌审旗"
|
19105 | }, {
|
19106 | "key": "150627",
|
19107 | "value": "伊金霍洛旗"
|
19108 | }]
|
19109 | }, {
|
19110 | "key": "150700",
|
19111 | "value": "呼伦贝尔市",
|
19112 | "children": [{
|
19113 | "key": "150702",
|
19114 | "value": "海拉尔区"
|
19115 | }, {
|
19116 | "key": "150703",
|
19117 | "value": "扎赉诺尔区"
|
19118 | }, {
|
19119 | "key": "150721",
|
19120 | "value": "阿荣旗"
|
19121 | }, {
|
19122 | "key": "150722",
|
19123 | "value": "莫力达瓦达斡尔族自治旗"
|
19124 | }, {
|
19125 | "key": "150723",
|
19126 | "value": "鄂伦春自治旗"
|
19127 | }, {
|
19128 | "key": "150724",
|
19129 | "value": "鄂温克族自治旗"
|
19130 | }, {
|
19131 | "key": "150725",
|
19132 | "value": "陈巴尔虎旗"
|
19133 | }, {
|
19134 | "key": "150726",
|
19135 | "value": "新巴尔虎左旗"
|
19136 | }, {
|
19137 | "key": "150727",
|
19138 | "value": "新巴尔虎右旗"
|
19139 | }, {
|
19140 | "key": "150781",
|
19141 | "value": "满洲里市"
|
19142 | }, {
|
19143 | "key": "150782",
|
19144 | "value": "牙克石市"
|
19145 | }, {
|
19146 | "key": "150783",
|
19147 | "value": "扎兰屯市"
|
19148 | }, {
|
19149 | "key": "150784",
|
19150 | "value": "额尔古纳市"
|
19151 | }, {
|
19152 | "key": "150785",
|
19153 | "value": "根河市"
|
19154 | }]
|
19155 | }, {
|
19156 | "key": "150800",
|
19157 | "value": "巴彦淖尔市",
|
19158 | "children": [{
|
19159 | "key": "150802",
|
19160 | "value": "临河区"
|
19161 | }, {
|
19162 | "key": "150821",
|
19163 | "value": "五原县"
|
19164 | }, {
|
19165 | "key": "150822",
|
19166 | "value": "磴口县"
|
19167 | }, {
|
19168 | "key": "150823",
|
19169 | "value": "乌拉特前旗"
|
19170 | }, {
|
19171 | "key": "150824",
|
19172 | "value": "乌拉特中旗"
|
19173 | }, {
|
19174 | "key": "150825",
|
19175 | "value": "乌拉特后旗"
|
19176 | }, {
|
19177 | "key": "150826",
|
19178 | "value": "杭锦后旗"
|
19179 | }]
|
19180 | }, {
|
19181 | "key": "150900",
|
19182 | "value": "乌兰察布市",
|
19183 | "children": [{
|
19184 | "key": "150902",
|
19185 | "value": "集宁区"
|
19186 | }, {
|
19187 | "key": "150921",
|
19188 | "value": "卓资县"
|
19189 | }, {
|
19190 | "key": "150922",
|
19191 | "value": "化德县"
|
19192 | }, {
|
19193 | "key": "150923",
|
19194 | "value": "商都县"
|
19195 | }, {
|
19196 | "key": "150924",
|
19197 | "value": "兴和县"
|
19198 | }, {
|
19199 | "key": "150925",
|
19200 | "value": "凉城县"
|
19201 | }, {
|
19202 | "key": "150926",
|
19203 | "value": "察哈尔右翼前旗"
|
19204 | }, {
|
19205 | "key": "150927",
|
19206 | "value": "察哈尔右翼中旗"
|
19207 | }, {
|
19208 | "key": "150928",
|
19209 | "value": "察哈尔右翼后旗"
|
19210 | }, {
|
19211 | "key": "150929",
|
19212 | "value": "四子王旗"
|
19213 | }, {
|
19214 | "key": "150981",
|
19215 | "value": "丰镇市"
|
19216 | }]
|
19217 | }, {
|
19218 | "key": "152200",
|
19219 | "value": "兴安盟",
|
19220 | "children": [{
|
19221 | "key": "152201",
|
19222 | "value": "乌兰浩特市"
|
19223 | }, {
|
19224 | "key": "152202",
|
19225 | "value": "阿尔山市"
|
19226 | }, {
|
19227 | "key": "152221",
|
19228 | "value": "科尔沁右翼前旗"
|
19229 | }, {
|
19230 | "key": "152222",
|
19231 | "value": "科尔沁右翼中旗"
|
19232 | }, {
|
19233 | "key": "152223",
|
19234 | "value": "扎赉特旗"
|
19235 | }, {
|
19236 | "key": "152224",
|
19237 | "value": "突泉县"
|
19238 | }]
|
19239 | }, {
|
19240 | "key": "152500",
|
19241 | "value": "锡林郭勒盟",
|
19242 | "children": [{
|
19243 | "key": "152501",
|
19244 | "value": "二连浩特市"
|
19245 | }, {
|
19246 | "key": "152502",
|
19247 | "value": "锡林浩特市"
|
19248 | }, {
|
19249 | "key": "152522",
|
19250 | "value": "阿巴嘎旗"
|
19251 | }, {
|
19252 | "key": "152523",
|
19253 | "value": "苏尼特左旗"
|
19254 | }, {
|
19255 | "key": "152524",
|
19256 | "value": "苏尼特右旗"
|
19257 | }, {
|
19258 | "key": "152525",
|
19259 | "value": "东乌珠穆沁旗"
|
19260 | }, {
|
19261 | "key": "152526",
|
19262 | "value": "西乌珠穆沁旗"
|
19263 | }, {
|
19264 | "key": "152527",
|
19265 | "value": "太仆寺旗"
|
19266 | }, {
|
19267 | "key": "152528",
|
19268 | "value": "镶黄旗"
|
19269 | }, {
|
19270 | "key": "152529",
|
19271 | "value": "正镶白旗"
|
19272 | }, {
|
19273 | "key": "152530",
|
19274 | "value": "正蓝旗"
|
19275 | }, {
|
19276 | "key": "152531",
|
19277 | "value": "多伦县"
|
19278 | }]
|
19279 | }, {
|
19280 | "key": "152900",
|
19281 | "value": "阿拉善盟",
|
19282 | "children": [{
|
19283 | "key": "152921",
|
19284 | "value": "阿拉善左旗"
|
19285 | }, {
|
19286 | "key": "152922",
|
19287 | "value": "阿拉善右旗"
|
19288 | }, {
|
19289 | "key": "152923",
|
19290 | "value": "额济纳旗"
|
19291 | }]
|
19292 | }]
|
19293 | }, {
|
19294 | "key": "210000",
|
19295 | "value": "辽宁",
|
19296 | "children": [{
|
19297 | "key": "210100",
|
19298 | "value": "沈阳市",
|
19299 | "children": [{
|
19300 | "key": "210102",
|
19301 | "value": "和平区"
|
19302 | }, {
|
19303 | "key": "210103",
|
19304 | "value": "沈河区"
|
19305 | }, {
|
19306 | "key": "210104",
|
19307 | "value": "大东区"
|
19308 | }, {
|
19309 | "key": "210105",
|
19310 | "value": "皇姑区"
|
19311 | }, {
|
19312 | "key": "210106",
|
19313 | "value": "铁西区"
|
19314 | }, {
|
19315 | "key": "210111",
|
19316 | "value": "苏家屯区"
|
19317 | }, {
|
19318 | "key": "210112",
|
19319 | "value": "东陵区"
|
19320 | }, {
|
19321 | "key": "210113",
|
19322 | "value": "沈北新区"
|
19323 | }, {
|
19324 | "key": "210114",
|
19325 | "value": "于洪区"
|
19326 | }, {
|
19327 | "key": "210115",
|
19328 | "value": "辽中区"
|
19329 | }, {
|
19330 | "key": "210123",
|
19331 | "value": "康平县"
|
19332 | }, {
|
19333 | "key": "210124",
|
19334 | "value": "法库县"
|
19335 | }, {
|
19336 | "key": "210181",
|
19337 | "value": "新民市"
|
19338 | }]
|
19339 | }, {
|
19340 | "key": "210200",
|
19341 | "value": "大连市",
|
19342 | "children": [{
|
19343 | "key": "210202",
|
19344 | "value": "中山区"
|
19345 | }, {
|
19346 | "key": "210203",
|
19347 | "value": "西岗区"
|
19348 | }, {
|
19349 | "key": "210204",
|
19350 | "value": "沙河口区"
|
19351 | }, {
|
19352 | "key": "210211",
|
19353 | "value": "甘井子区"
|
19354 | }, {
|
19355 | "key": "210212",
|
19356 | "value": "旅顺口区"
|
19357 | }, {
|
19358 | "key": "210213",
|
19359 | "value": "金州区"
|
19360 | }, {
|
19361 | "key": "210214",
|
19362 | "value": "普兰店区"
|
19363 | }, {
|
19364 | "key": "210224",
|
19365 | "value": "长海县"
|
19366 | }, {
|
19367 | "key": "210281",
|
19368 | "value": "瓦房店市"
|
19369 | }, {
|
19370 | "key": "210283",
|
19371 | "value": "庄河市"
|
19372 | }]
|
19373 | }, {
|
19374 | "key": "210300",
|
19375 | "value": "鞍山市",
|
19376 | "children": [{
|
19377 | "key": "210302",
|
19378 | "value": "铁东区"
|
19379 | }, {
|
19380 | "key": "210303",
|
19381 | "value": "铁西区"
|
19382 | }, {
|
19383 | "key": "210304",
|
19384 | "value": "立山区"
|
19385 | }, {
|
19386 | "key": "210311",
|
19387 | "value": "千山区"
|
19388 | }, {
|
19389 | "key": "210321",
|
19390 | "value": "台安县"
|
19391 | }, {
|
19392 | "key": "210323",
|
19393 | "value": "岫岩满族自治县"
|
19394 | }, {
|
19395 | "key": "210381",
|
19396 | "value": "海城市"
|
19397 | }]
|
19398 | }, {
|
19399 | "key": "210400",
|
19400 | "value": "抚顺市",
|
19401 | "children": [{
|
19402 | "key": "210402",
|
19403 | "value": "新抚区"
|
19404 | }, {
|
19405 | "key": "210403",
|
19406 | "value": "东洲区"
|
19407 | }, {
|
19408 | "key": "210404",
|
19409 | "value": "望花区"
|
19410 | }, {
|
19411 | "key": "210411",
|
19412 | "value": "顺城区"
|
19413 | }, {
|
19414 | "key": "210421",
|
19415 | "value": "抚顺县"
|
19416 | }, {
|
19417 | "key": "210422",
|
19418 | "value": "新宾满族自治县"
|
19419 | }, {
|
19420 | "key": "210423",
|
19421 | "value": "清原满族自治县"
|
19422 | }]
|
19423 | }, {
|
19424 | "key": "210500",
|
19425 | "value": "本溪市",
|
19426 | "children": [{
|
19427 | "key": "210502",
|
19428 | "value": "平山区"
|
19429 | }, {
|
19430 | "key": "210503",
|
19431 | "value": "溪湖区"
|
19432 | }, {
|
19433 | "key": "210504",
|
19434 | "value": "明山区"
|
19435 | }, {
|
19436 | "key": "210505",
|
19437 | "value": "南芬区"
|
19438 | }, {
|
19439 | "key": "210521",
|
19440 | "value": "本溪满族自治县"
|
19441 | }, {
|
19442 | "key": "210522",
|
19443 | "value": "桓仁满族自治县"
|
19444 | }]
|
19445 | }, {
|
19446 | "key": "210600",
|
19447 | "value": "丹东市",
|
19448 | "children": [{
|
19449 | "key": "210602",
|
19450 | "value": "元宝区"
|
19451 | }, {
|
19452 | "key": "210603",
|
19453 | "value": "振兴区"
|
19454 | }, {
|
19455 | "key": "210604",
|
19456 | "value": "振安区"
|
19457 | }, {
|
19458 | "key": "210624",
|
19459 | "value": "宽甸满族自治县"
|
19460 | }, {
|
19461 | "key": "210681",
|
19462 | "value": "东港市"
|
19463 | }, {
|
19464 | "key": "210682",
|
19465 | "value": "凤城市"
|
19466 | }]
|
19467 | }, {
|
19468 | "key": "210700",
|
19469 | "value": "锦州市",
|
19470 | "children": [{
|
19471 | "key": "210702",
|
19472 | "value": "古塔区"
|
19473 | }, {
|
19474 | "key": "210703",
|
19475 | "value": "凌河区"
|
19476 | }, {
|
19477 | "key": "210711",
|
19478 | "value": "太和区"
|
19479 | }, {
|
19480 | "key": "210726",
|
19481 | "value": "黑山县"
|
19482 | }, {
|
19483 | "key": "210727",
|
19484 | "value": "义县"
|
19485 | }, {
|
19486 | "key": "210781",
|
19487 | "value": "凌海市"
|
19488 | }, {
|
19489 | "key": "210782",
|
19490 | "value": "北镇市"
|
19491 | }]
|
19492 | }, {
|
19493 | "key": "210800",
|
19494 | "value": "营口市",
|
19495 | "children": [{
|
19496 | "key": "210802",
|
19497 | "value": "站前区"
|
19498 | }, {
|
19499 | "key": "210803",
|
19500 | "value": "西市区"
|
19501 | }, {
|
19502 | "key": "210804",
|
19503 | "value": "鲅鱼圈区"
|
19504 | }, {
|
19505 | "key": "210811",
|
19506 | "value": "老边区"
|
19507 | }, {
|
19508 | "key": "210881",
|
19509 | "value": "盖州市"
|
19510 | }, {
|
19511 | "key": "210882",
|
19512 | "value": "大石桥市"
|
19513 | }]
|
19514 | }, {
|
19515 | "key": "210900",
|
19516 | "value": "阜新市",
|
19517 | "children": [{
|
19518 | "key": "210902",
|
19519 | "value": "海州区"
|
19520 | }, {
|
19521 | "key": "210903",
|
19522 | "value": "新邱区"
|
19523 | }, {
|
19524 | "key": "210904",
|
19525 | "value": "太平区"
|
19526 | }, {
|
19527 | "key": "210905",
|
19528 | "value": "清河门区"
|
19529 | }, {
|
19530 | "key": "210911",
|
19531 | "value": "细河区"
|
19532 | }, {
|
19533 | "key": "210921",
|
19534 | "value": "阜新蒙古族自治县"
|
19535 | }, {
|
19536 | "key": "210922",
|
19537 | "value": "彰武县"
|
19538 | }]
|
19539 | }, {
|
19540 | "key": "211000",
|
19541 | "value": "辽阳市",
|
19542 | "children": [{
|
19543 | "key": "211002",
|
19544 | "value": "白塔区"
|
19545 | }, {
|
19546 | "key": "211003",
|
19547 | "value": "文圣区"
|
19548 | }, {
|
19549 | "key": "211004",
|
19550 | "value": "宏伟区"
|
19551 | }, {
|
19552 | "key": "211005",
|
19553 | "value": "弓长岭区"
|
19554 | }, {
|
19555 | "key": "211011",
|
19556 | "value": "太子河区"
|
19557 | }, {
|
19558 | "key": "211021",
|
19559 | "value": "辽阳县"
|
19560 | }, {
|
19561 | "key": "211081",
|
19562 | "value": "灯塔市"
|
19563 | }]
|
19564 | }, {
|
19565 | "key": "211100",
|
19566 | "value": "盘锦市",
|
19567 | "children": [{
|
19568 | "key": "211102",
|
19569 | "value": "双台子区"
|
19570 | }, {
|
19571 | "key": "211103",
|
19572 | "value": "兴隆台区"
|
19573 | }, {
|
19574 | "key": "211104",
|
19575 | "value": "大洼区"
|
19576 | }, {
|
19577 | "key": "211122",
|
19578 | "value": "盘山县"
|
19579 | }]
|
19580 | }, {
|
19581 | "key": "211200",
|
19582 | "value": "铁岭市",
|
19583 | "children": [{
|
19584 | "key": "211202",
|
19585 | "value": "银州区"
|
19586 | }, {
|
19587 | "key": "211204",
|
19588 | "value": "清河区"
|
19589 | }, {
|
19590 | "key": "211221",
|
19591 | "value": "铁岭县"
|
19592 | }, {
|
19593 | "key": "211223",
|
19594 | "value": "西丰县"
|
19595 | }, {
|
19596 | "key": "211224",
|
19597 | "value": "昌图县"
|
19598 | }, {
|
19599 | "key": "211281",
|
19600 | "value": "调兵山市"
|
19601 | }, {
|
19602 | "key": "211282",
|
19603 | "value": "开原市"
|
19604 | }]
|
19605 | }, {
|
19606 | "key": "211300",
|
19607 | "value": "朝阳市",
|
19608 | "children": [{
|
19609 | "key": "211302",
|
19610 | "value": "双塔区"
|
19611 | }, {
|
19612 | "key": "211303",
|
19613 | "value": "龙城区"
|
19614 | }, {
|
19615 | "key": "211321",
|
19616 | "value": "朝阳县"
|
19617 | }, {
|
19618 | "key": "211322",
|
19619 | "value": "建平县"
|
19620 | }, {
|
19621 | "key": "211324",
|
19622 | "value": "喀喇沁左翼蒙古族自治县"
|
19623 | }, {
|
19624 | "key": "211381",
|
19625 | "value": "北票市"
|
19626 | }, {
|
19627 | "key": "211382",
|
19628 | "value": "凌源市"
|
19629 | }]
|
19630 | }, {
|
19631 | "key": "211400",
|
19632 | "value": "葫芦岛市",
|
19633 | "children": [{
|
19634 | "key": "211402",
|
19635 | "value": "连山区"
|
19636 | }, {
|
19637 | "key": "211403",
|
19638 | "value": "龙港区"
|
19639 | }, {
|
19640 | "key": "211404",
|
19641 | "value": "南票区"
|
19642 | }, {
|
19643 | "key": "211421",
|
19644 | "value": "绥中县"
|
19645 | }, {
|
19646 | "key": "211422",
|
19647 | "value": "建昌县"
|
19648 | }, {
|
19649 | "key": "211481",
|
19650 | "value": "兴城市"
|
19651 | }]
|
19652 | }]
|
19653 | }, {
|
19654 | "key": "220000",
|
19655 | "value": "吉林",
|
19656 | "children": [{
|
19657 | "key": "220100",
|
19658 | "value": "长春市",
|
19659 | "children": [{
|
19660 | "key": "220102",
|
19661 | "value": "南关区"
|
19662 | }, {
|
19663 | "key": "220103",
|
19664 | "value": "宽城区"
|
19665 | }, {
|
19666 | "key": "220104",
|
19667 | "value": "朝阳区"
|
19668 | }, {
|
19669 | "key": "220105",
|
19670 | "value": "二道区"
|
19671 | }, {
|
19672 | "key": "220106",
|
19673 | "value": "绿园区"
|
19674 | }, {
|
19675 | "key": "220112",
|
19676 | "value": "双阳区"
|
19677 | }, {
|
19678 | "key": "220113",
|
19679 | "value": "九台区"
|
19680 | }, {
|
19681 | "key": "220122",
|
19682 | "value": "农安县"
|
19683 | }, {
|
19684 | "key": "220182",
|
19685 | "value": "榆树市"
|
19686 | }, {
|
19687 | "key": "220183",
|
19688 | "value": "德惠市"
|
19689 | }]
|
19690 | }, {
|
19691 | "key": "220200",
|
19692 | "value": "吉林市",
|
19693 | "children": [{
|
19694 | "key": "220202",
|
19695 | "value": "昌邑区"
|
19696 | }, {
|
19697 | "key": "220203",
|
19698 | "value": "龙潭区"
|
19699 | }, {
|
19700 | "key": "220204",
|
19701 | "value": "船营区"
|
19702 | }, {
|
19703 | "key": "220211",
|
19704 | "value": "丰满区"
|
19705 | }, {
|
19706 | "key": "220221",
|
19707 | "value": "永吉县"
|
19708 | }, {
|
19709 | "key": "220281",
|
19710 | "value": "蛟河市"
|
19711 | }, {
|
19712 | "key": "220282",
|
19713 | "value": "桦甸市"
|
19714 | }, {
|
19715 | "key": "220283",
|
19716 | "value": "舒兰市"
|
19717 | }, {
|
19718 | "key": "220284",
|
19719 | "value": "磐石市"
|
19720 | }]
|
19721 | }, {
|
19722 | "key": "220300",
|
19723 | "value": "四平市",
|
19724 | "children": [{
|
19725 | "key": "220302",
|
19726 | "value": "铁西区"
|
19727 | }, {
|
19728 | "key": "220303",
|
19729 | "value": "铁东区"
|
19730 | }, {
|
19731 | "key": "220322",
|
19732 | "value": "梨树县"
|
19733 | }, {
|
19734 | "key": "220323",
|
19735 | "value": "伊通满族自治县"
|
19736 | }, {
|
19737 | "key": "220381",
|
19738 | "value": "公主岭市"
|
19739 | }, {
|
19740 | "key": "220382",
|
19741 | "value": "双辽市"
|
19742 | }]
|
19743 | }, {
|
19744 | "key": "220400",
|
19745 | "value": "辽源市",
|
19746 | "children": [{
|
19747 | "key": "220402",
|
19748 | "value": "龙山区"
|
19749 | }, {
|
19750 | "key": "220403",
|
19751 | "value": "西安区"
|
19752 | }, {
|
19753 | "key": "220421",
|
19754 | "value": "东丰县"
|
19755 | }, {
|
19756 | "key": "220422",
|
19757 | "value": "东辽县"
|
19758 | }]
|
19759 | }, {
|
19760 | "key": "220500",
|
19761 | "value": "通化市",
|
19762 | "children": [{
|
19763 | "key": "220502",
|
19764 | "value": "东昌区"
|
19765 | }, {
|
19766 | "key": "220503",
|
19767 | "value": "二道江区"
|
19768 | }, {
|
19769 | "key": "220521",
|
19770 | "value": "通化县"
|
19771 | }, {
|
19772 | "key": "220523",
|
19773 | "value": "辉南县"
|
19774 | }, {
|
19775 | "key": "220524",
|
19776 | "value": "柳河县"
|
19777 | }, {
|
19778 | "key": "220581",
|
19779 | "value": "梅河口市"
|
19780 | }, {
|
19781 | "key": "220582",
|
19782 | "value": "集安市"
|
19783 | }]
|
19784 | }, {
|
19785 | "key": "220600",
|
19786 | "value": "白山市",
|
19787 | "children": [{
|
19788 | "key": "220602",
|
19789 | "value": "浑江区"
|
19790 | }, {
|
19791 | "key": "220605",
|
19792 | "value": "江源区"
|
19793 | }, {
|
19794 | "key": "220621",
|
19795 | "value": "抚松县"
|
19796 | }, {
|
19797 | "key": "220622",
|
19798 | "value": "靖宇县"
|
19799 | }, {
|
19800 | "key": "220623",
|
19801 | "value": "长白朝鲜族自治县"
|
19802 | }, {
|
19803 | "key": "220681",
|
19804 | "value": "临江市"
|
19805 | }]
|
19806 | }, {
|
19807 | "key": "220700",
|
19808 | "value": "松原市",
|
19809 | "children": [{
|
19810 | "key": "220702",
|
19811 | "value": "宁江区"
|
19812 | }, {
|
19813 | "key": "220721",
|
19814 | "value": "前郭尔罗斯蒙古族自治县"
|
19815 | }, {
|
19816 | "key": "220722",
|
19817 | "value": "长岭县"
|
19818 | }, {
|
19819 | "key": "220723",
|
19820 | "value": "乾安县"
|
19821 | }, {
|
19822 | "key": "220781",
|
19823 | "value": "扶余市"
|
19824 | }]
|
19825 | }, {
|
19826 | "key": "220800",
|
19827 | "value": "白城市",
|
19828 | "children": [{
|
19829 | "key": "220802",
|
19830 | "value": "洮北区"
|
19831 | }, {
|
19832 | "key": "220821",
|
19833 | "value": "镇赉县"
|
19834 | }, {
|
19835 | "key": "220822",
|
19836 | "value": "通榆县"
|
19837 | }, {
|
19838 | "key": "220881",
|
19839 | "value": "洮南市"
|
19840 | }, {
|
19841 | "key": "220882",
|
19842 | "value": "大安市"
|
19843 | }]
|
19844 | }, {
|
19845 | "key": "222400",
|
19846 | "value": "延边朝鲜族自治州",
|
19847 | "children": [{
|
19848 | "key": "222401",
|
19849 | "value": "延吉市"
|
19850 | }, {
|
19851 | "key": "222402",
|
19852 | "value": "图们市"
|
19853 | }, {
|
19854 | "key": "222403",
|
19855 | "value": "敦化市"
|
19856 | }, {
|
19857 | "key": "222404",
|
19858 | "value": "珲春市"
|
19859 | }, {
|
19860 | "key": "222405",
|
19861 | "value": "龙井市"
|
19862 | }, {
|
19863 | "key": "222406",
|
19864 | "value": "和龙市"
|
19865 | }, {
|
19866 | "key": "222424",
|
19867 | "value": "汪清县"
|
19868 | }, {
|
19869 | "key": "222426",
|
19870 | "value": "安图县"
|
19871 | }]
|
19872 | }]
|
19873 | }, {
|
19874 | "key": "230000",
|
19875 | "value": "黑龙江",
|
19876 | "children": [{
|
19877 | "key": "230100",
|
19878 | "value": "哈尔滨市",
|
19879 | "children": [{
|
19880 | "key": "230102",
|
19881 | "value": "道里区"
|
19882 | }, {
|
19883 | "key": "230103",
|
19884 | "value": "南岗区"
|
19885 | }, {
|
19886 | "key": "230104",
|
19887 | "value": "道外区"
|
19888 | }, {
|
19889 | "key": "230108",
|
19890 | "value": "平房区"
|
19891 | }, {
|
19892 | "key": "230109",
|
19893 | "value": "松北区"
|
19894 | }, {
|
19895 | "key": "230110",
|
19896 | "value": "香坊区"
|
19897 | }, {
|
19898 | "key": "230111",
|
19899 | "value": "呼兰区"
|
19900 | }, {
|
19901 | "key": "230112",
|
19902 | "value": "阿城区"
|
19903 | }, {
|
19904 | "key": "230113",
|
19905 | "value": "双城区"
|
19906 | }, {
|
19907 | "key": "230123",
|
19908 | "value": "依兰县"
|
19909 | }, {
|
19910 | "key": "230124",
|
19911 | "value": "方正县"
|
19912 | }, {
|
19913 | "key": "230125",
|
19914 | "value": "宾县"
|
19915 | }, {
|
19916 | "key": "230126",
|
19917 | "value": "巴彦县"
|
19918 | }, {
|
19919 | "key": "230127",
|
19920 | "value": "木兰县"
|
19921 | }, {
|
19922 | "key": "230128",
|
19923 | "value": "通河县"
|
19924 | }, {
|
19925 | "key": "230129",
|
19926 | "value": "延寿县"
|
19927 | }, {
|
19928 | "key": "230183",
|
19929 | "value": "尚志市"
|
19930 | }, {
|
19931 | "key": "230184",
|
19932 | "value": "五常市"
|
19933 | }]
|
19934 | }, {
|
19935 | "key": "230200",
|
19936 | "value": "齐齐哈尔市",
|
19937 | "children": [{
|
19938 | "key": "230202",
|
19939 | "value": "龙沙区"
|
19940 | }, {
|
19941 | "key": "230203",
|
19942 | "value": "建华区"
|
19943 | }, {
|
19944 | "key": "230204",
|
19945 | "value": "铁锋区"
|
19946 | }, {
|
19947 | "key": "230205",
|
19948 | "value": "昂昂溪区"
|
19949 | }, {
|
19950 | "key": "230206",
|
19951 | "value": "富拉尔基区"
|
19952 | }, {
|
19953 | "key": "230207",
|
19954 | "value": "碾子山区"
|
19955 | }, {
|
19956 | "key": "230208",
|
19957 | "value": "梅里斯达斡尔族区"
|
19958 | }, {
|
19959 | "key": "230221",
|
19960 | "value": "龙江县"
|
19961 | }, {
|
19962 | "key": "230223",
|
19963 | "value": "依安县"
|
19964 | }, {
|
19965 | "key": "230224",
|
19966 | "value": "泰来县"
|
19967 | }, {
|
19968 | "key": "230225",
|
19969 | "value": "甘南县"
|
19970 | }, {
|
19971 | "key": "230227",
|
19972 | "value": "富裕县"
|
19973 | }, {
|
19974 | "key": "230229",
|
19975 | "value": "克山县"
|
19976 | }, {
|
19977 | "key": "230230",
|
19978 | "value": "克东县"
|
19979 | }, {
|
19980 | "key": "230231",
|
19981 | "value": "拜泉县"
|
19982 | }, {
|
19983 | "key": "230281",
|
19984 | "value": "讷河市"
|
19985 | }]
|
19986 | }, {
|
19987 | "key": "230300",
|
19988 | "value": "鸡西市",
|
19989 | "children": [{
|
19990 | "key": "230302",
|
19991 | "value": "鸡冠区"
|
19992 | }, {
|
19993 | "key": "230303",
|
19994 | "value": "恒山区"
|
19995 | }, {
|
19996 | "key": "230304",
|
19997 | "value": "滴道区"
|
19998 | }, {
|
19999 | "key": "230305",
|
20000 | "value": "梨树区"
|
20001 | }, {
|
20002 | "key": "230306",
|
20003 | "value": "城子河区"
|
20004 | }, {
|
20005 | "key": "230307",
|
20006 | "value": "麻山区"
|
20007 | }, {
|
20008 | "key": "230321",
|
20009 | "value": "鸡东县"
|
20010 | }, {
|
20011 | "key": "230381",
|
20012 | "value": "虎林市"
|
20013 | }, {
|
20014 | "key": "230382",
|
20015 | "value": "密山市"
|
20016 | }]
|
20017 | }, {
|
20018 | "key": "230400",
|
20019 | "value": "鹤岗市",
|
20020 | "children": [{
|
20021 | "key": "230402",
|
20022 | "value": "向阳区"
|
20023 | }, {
|
20024 | "key": "230403",
|
20025 | "value": "工农区"
|
20026 | }, {
|
20027 | "key": "230404",
|
20028 | "value": "南山区"
|
20029 | }, {
|
20030 | "key": "230405",
|
20031 | "value": "兴安区"
|
20032 | }, {
|
20033 | "key": "230406",
|
20034 | "value": "东山区"
|
20035 | }, {
|
20036 | "key": "230407",
|
20037 | "value": "兴山区"
|
20038 | }, {
|
20039 | "key": "230421",
|
20040 | "value": "萝北县"
|
20041 | }, {
|
20042 | "key": "230422",
|
20043 | "value": "绥滨县"
|
20044 | }]
|
20045 | }, {
|
20046 | "key": "230500",
|
20047 | "value": "双鸭山市",
|
20048 | "children": [{
|
20049 | "key": "230502",
|
20050 | "value": "尖山区"
|
20051 | }, {
|
20052 | "key": "230503",
|
20053 | "value": "岭东区"
|
20054 | }, {
|
20055 | "key": "230505",
|
20056 | "value": "四方台区"
|
20057 | }, {
|
20058 | "key": "230506",
|
20059 | "value": "宝山区"
|
20060 | }, {
|
20061 | "key": "230521",
|
20062 | "value": "集贤县"
|
20063 | }, {
|
20064 | "key": "230522",
|
20065 | "value": "友谊县"
|
20066 | }, {
|
20067 | "key": "230523",
|
20068 | "value": "宝清县"
|
20069 | }, {
|
20070 | "key": "230524",
|
20071 | "value": "饶河县"
|
20072 | }]
|
20073 | }, {
|
20074 | "key": "230600",
|
20075 | "value": "大庆市",
|
20076 | "children": [{
|
20077 | "key": "230602",
|
20078 | "value": "萨尔图区"
|
20079 | }, {
|
20080 | "key": "230603",
|
20081 | "value": "龙凤区"
|
20082 | }, {
|
20083 | "key": "230604",
|
20084 | "value": "让胡路区"
|
20085 | }, {
|
20086 | "key": "230605",
|
20087 | "value": "红岗区"
|
20088 | }, {
|
20089 | "key": "230606",
|
20090 | "value": "大同区"
|
20091 | }, {
|
20092 | "key": "230621",
|
20093 | "value": "肇州县"
|
20094 | }, {
|
20095 | "key": "230622",
|
20096 | "value": "肇源县"
|
20097 | }, {
|
20098 | "key": "230623",
|
20099 | "value": "林甸县"
|
20100 | }, {
|
20101 | "key": "230624",
|
20102 | "value": "杜尔伯特蒙古族自治县"
|
20103 | }]
|
20104 | }, {
|
20105 | "key": "230700",
|
20106 | "value": "伊春市",
|
20107 | "children": [{
|
20108 | "key": "230702",
|
20109 | "value": "伊春区"
|
20110 | }, {
|
20111 | "key": "230703",
|
20112 | "value": "南岔区"
|
20113 | }, {
|
20114 | "key": "230704",
|
20115 | "value": "友好区"
|
20116 | }, {
|
20117 | "key": "230705",
|
20118 | "value": "西林区"
|
20119 | }, {
|
20120 | "key": "230706",
|
20121 | "value": "翠峦区"
|
20122 | }, {
|
20123 | "key": "230707",
|
20124 | "value": "新青区"
|
20125 | }, {
|
20126 | "key": "230708",
|
20127 | "value": "美溪区"
|
20128 | }, {
|
20129 | "key": "230709",
|
20130 | "value": "金山屯区"
|
20131 | }, {
|
20132 | "key": "230710",
|
20133 | "value": "五营区"
|
20134 | }, {
|
20135 | "key": "230711",
|
20136 | "value": "乌马河区"
|
20137 | }, {
|
20138 | "key": "230712",
|
20139 | "value": "汤旺河区"
|
20140 | }, {
|
20141 | "key": "230713",
|
20142 | "value": "带岭区"
|
20143 | }, {
|
20144 | "key": "230714",
|
20145 | "value": "乌伊岭区"
|
20146 | }, {
|
20147 | "key": "230715",
|
20148 | "value": "红星区"
|
20149 | }, {
|
20150 | "key": "230716",
|
20151 | "value": "上甘岭区"
|
20152 | }, {
|
20153 | "key": "230722",
|
20154 | "value": "嘉荫县"
|
20155 | }, {
|
20156 | "key": "230781",
|
20157 | "value": "铁力市"
|
20158 | }]
|
20159 | }, {
|
20160 | "key": "230800",
|
20161 | "value": "佳木斯市",
|
20162 | "children": [{
|
20163 | "key": "230803",
|
20164 | "value": "向阳区"
|
20165 | }, {
|
20166 | "key": "230804",
|
20167 | "value": "前进区"
|
20168 | }, {
|
20169 | "key": "230805",
|
20170 | "value": "东风区"
|
20171 | }, {
|
20172 | "key": "230811",
|
20173 | "value": "郊区"
|
20174 | }, {
|
20175 | "key": "230822",
|
20176 | "value": "桦南县"
|
20177 | }, {
|
20178 | "key": "230826",
|
20179 | "value": "桦川县"
|
20180 | }, {
|
20181 | "key": "230828",
|
20182 | "value": "汤原县"
|
20183 | }, {
|
20184 | "key": "230881",
|
20185 | "value": "同江市"
|
20186 | }, {
|
20187 | "key": "230882",
|
20188 | "value": "富锦市"
|
20189 | }, {
|
20190 | "key": "230883",
|
20191 | "value": "抚远市"
|
20192 | }]
|
20193 | }, {
|
20194 | "key": "230900",
|
20195 | "value": "七台河市",
|
20196 | "children": [{
|
20197 | "key": "230902",
|
20198 | "value": "新兴区"
|
20199 | }, {
|
20200 | "key": "230903",
|
20201 | "value": "桃山区"
|
20202 | }, {
|
20203 | "key": "230904",
|
20204 | "value": "茄子河区"
|
20205 | }, {
|
20206 | "key": "230921",
|
20207 | "value": "勃利县"
|
20208 | }]
|
20209 | }, {
|
20210 | "key": "231000",
|
20211 | "value": "牡丹江市",
|
20212 | "children": [{
|
20213 | "key": "231002",
|
20214 | "value": "东安区"
|
20215 | }, {
|
20216 | "key": "231003",
|
20217 | "value": "阳明区"
|
20218 | }, {
|
20219 | "key": "231004",
|
20220 | "value": "爱民区"
|
20221 | }, {
|
20222 | "key": "231005",
|
20223 | "value": "西安区"
|
20224 | }, {
|
20225 | "key": "231025",
|
20226 | "value": "林口县"
|
20227 | }, {
|
20228 | "key": "231081",
|
20229 | "value": "绥芬河市"
|
20230 | }, {
|
20231 | "key": "231083",
|
20232 | "value": "海林市"
|
20233 | }, {
|
20234 | "key": "231084",
|
20235 | "value": "宁安市"
|
20236 | }, {
|
20237 | "key": "231085",
|
20238 | "value": "穆棱市"
|
20239 | }, {
|
20240 | "key": "231086",
|
20241 | "value": "东宁市"
|
20242 | }]
|
20243 | }, {
|
20244 | "key": "231100",
|
20245 | "value": "黑河市",
|
20246 | "children": [{
|
20247 | "key": "231102",
|
20248 | "value": "爱辉区"
|
20249 | }, {
|
20250 | "key": "231121",
|
20251 | "value": "嫩江县"
|
20252 | }, {
|
20253 | "key": "231123",
|
20254 | "value": "逊克县"
|
20255 | }, {
|
20256 | "key": "231124",
|
20257 | "value": "孙吴县"
|
20258 | }, {
|
20259 | "key": "231181",
|
20260 | "value": "北安市"
|
20261 | }, {
|
20262 | "key": "231182",
|
20263 | "value": "五大连池市"
|
20264 | }]
|
20265 | }, {
|
20266 | "key": "231200",
|
20267 | "value": "绥化市",
|
20268 | "children": [{
|
20269 | "key": "231202",
|
20270 | "value": "北林区"
|
20271 | }, {
|
20272 | "key": "231221",
|
20273 | "value": "望奎县"
|
20274 | }, {
|
20275 | "key": "231222",
|
20276 | "value": "兰西县"
|
20277 | }, {
|
20278 | "key": "231223",
|
20279 | "value": "青冈县"
|
20280 | }, {
|
20281 | "key": "231224",
|
20282 | "value": "庆安县"
|
20283 | }, {
|
20284 | "key": "231225",
|
20285 | "value": "明水县"
|
20286 | }, {
|
20287 | "key": "231226",
|
20288 | "value": "绥棱县"
|
20289 | }, {
|
20290 | "key": "231281",
|
20291 | "value": "安达市"
|
20292 | }, {
|
20293 | "key": "231282",
|
20294 | "value": "肇东市"
|
20295 | }, {
|
20296 | "key": "231283",
|
20297 | "value": "海伦市"
|
20298 | }]
|
20299 | }, {
|
20300 | "key": "232700",
|
20301 | "value": "大兴安岭地区",
|
20302 | "children": [{
|
20303 | "key": "232701",
|
20304 | "value": "加格达奇区"
|
20305 | }, {
|
20306 | "key": "232702",
|
20307 | "value": "松岭区"
|
20308 | }, {
|
20309 | "key": "232703",
|
20310 | "value": "新林区"
|
20311 | }, {
|
20312 | "key": "232704",
|
20313 | "value": "呼中区"
|
20314 | }, {
|
20315 | "key": "232721",
|
20316 | "value": "呼玛县"
|
20317 | }, {
|
20318 | "key": "232722",
|
20319 | "value": "塔河县"
|
20320 | }, {
|
20321 | "key": "232723",
|
20322 | "value": "漠河县"
|
20323 | }]
|
20324 | }]
|
20325 | }, {
|
20326 | "key": "310000",
|
20327 | "value": "上海",
|
20328 | "children": [{
|
20329 | "key": "310101",
|
20330 | "value": "黄浦区"
|
20331 | }, {
|
20332 | "key": "310104",
|
20333 | "value": "徐汇区"
|
20334 | }, {
|
20335 | "key": "310105",
|
20336 | "value": "长宁区"
|
20337 | }, {
|
20338 | "key": "310106",
|
20339 | "value": "静安区"
|
20340 | }, {
|
20341 | "key": "310107",
|
20342 | "value": "普陀区"
|
20343 | }, {
|
20344 | "key": "310109",
|
20345 | "value": "虹口区"
|
20346 | }, {
|
20347 | "key": "310110",
|
20348 | "value": "杨浦区"
|
20349 | }, {
|
20350 | "key": "310112",
|
20351 | "value": "闵行区"
|
20352 | }, {
|
20353 | "key": "310113",
|
20354 | "value": "宝山区"
|
20355 | }, {
|
20356 | "key": "310114",
|
20357 | "value": "嘉定区"
|
20358 | }, {
|
20359 | "key": "310115",
|
20360 | "value": "浦东新区"
|
20361 | }, {
|
20362 | "key": "310116",
|
20363 | "value": "金山区"
|
20364 | }, {
|
20365 | "key": "310117",
|
20366 | "value": "松江区"
|
20367 | }, {
|
20368 | "key": "310118",
|
20369 | "value": "青浦区"
|
20370 | }, {
|
20371 | "key": "310120",
|
20372 | "value": "奉贤区"
|
20373 | }, {
|
20374 | "key": "310151",
|
20375 | "value": "崇明区"
|
20376 | }]
|
20377 | }, {
|
20378 | "key": "320000",
|
20379 | "value": "江苏",
|
20380 | "children": [{
|
20381 | "key": "320100",
|
20382 | "value": "南京市",
|
20383 | "children": [{
|
20384 | "key": "320102",
|
20385 | "value": "玄武区"
|
20386 | }, {
|
20387 | "key": "320104",
|
20388 | "value": "秦淮区"
|
20389 | }, {
|
20390 | "key": "320105",
|
20391 | "value": "建邺区"
|
20392 | }, {
|
20393 | "key": "320106",
|
20394 | "value": "鼓楼区"
|
20395 | }, {
|
20396 | "key": "320111",
|
20397 | "value": "浦口区"
|
20398 | }, {
|
20399 | "key": "320113",
|
20400 | "value": "栖霞区"
|
20401 | }, {
|
20402 | "key": "320114",
|
20403 | "value": "雨花台区"
|
20404 | }, {
|
20405 | "key": "320115",
|
20406 | "value": "江宁区"
|
20407 | }, {
|
20408 | "key": "320116",
|
20409 | "value": "六合区"
|
20410 | }, {
|
20411 | "key": "320117",
|
20412 | "value": "溧水区"
|
20413 | }, {
|
20414 | "key": "320118",
|
20415 | "value": "高淳区"
|
20416 | }]
|
20417 | }, {
|
20418 | "key": "320200",
|
20419 | "value": "无锡市",
|
20420 | "children": [{
|
20421 | "key": "320205",
|
20422 | "value": "锡山区"
|
20423 | }, {
|
20424 | "key": "320206",
|
20425 | "value": "惠山区"
|
20426 | }, {
|
20427 | "key": "320211",
|
20428 | "value": "滨湖区"
|
20429 | }, {
|
20430 | "key": "320213",
|
20431 | "value": "梁溪区"
|
20432 | }, {
|
20433 | "key": "320214",
|
20434 | "value": "新吴区"
|
20435 | }, {
|
20436 | "key": "320281",
|
20437 | "value": "江阴市"
|
20438 | }, {
|
20439 | "key": "320282",
|
20440 | "value": "宜兴市"
|
20441 | }]
|
20442 | }, {
|
20443 | "key": "320300",
|
20444 | "value": "徐州市",
|
20445 | "children": [{
|
20446 | "key": "320302",
|
20447 | "value": "鼓楼区"
|
20448 | }, {
|
20449 | "key": "320303",
|
20450 | "value": "云龙区"
|
20451 | }, {
|
20452 | "key": "320305",
|
20453 | "value": "贾汪区"
|
20454 | }, {
|
20455 | "key": "320311",
|
20456 | "value": "泉山区"
|
20457 | }, {
|
20458 | "key": "320312",
|
20459 | "value": "铜山区"
|
20460 | }, {
|
20461 | "key": "320321",
|
20462 | "value": "丰县"
|
20463 | }, {
|
20464 | "key": "320322",
|
20465 | "value": "沛县"
|
20466 | }, {
|
20467 | "key": "320324",
|
20468 | "value": "睢宁县"
|
20469 | }, {
|
20470 | "key": "320381",
|
20471 | "value": "新沂市"
|
20472 | }, {
|
20473 | "key": "320382",
|
20474 | "value": "邳州市"
|
20475 | }]
|
20476 | }, {
|
20477 | "key": "320400",
|
20478 | "value": "常州市",
|
20479 | "children": [{
|
20480 | "key": "320402",
|
20481 | "value": "天宁区"
|
20482 | }, {
|
20483 | "key": "320404",
|
20484 | "value": "钟楼区"
|
20485 | }, {
|
20486 | "key": "320411",
|
20487 | "value": "新北区"
|
20488 | }, {
|
20489 | "key": "320412",
|
20490 | "value": "武进区"
|
20491 | }, {
|
20492 | "key": "320413",
|
20493 | "value": "金坛区"
|
20494 | }, {
|
20495 | "key": "320481",
|
20496 | "value": "溧阳市"
|
20497 | }]
|
20498 | }, {
|
20499 | "key": "320500",
|
20500 | "value": "苏州市",
|
20501 | "children": [{
|
20502 | "key": "320505",
|
20503 | "value": "虎丘区"
|
20504 | }, {
|
20505 | "key": "320506",
|
20506 | "value": "吴中区"
|
20507 | }, {
|
20508 | "key": "320507",
|
20509 | "value": "相城区"
|
20510 | }, {
|
20511 | "key": "320508",
|
20512 | "value": "姑苏区"
|
20513 | }, {
|
20514 | "key": "320509",
|
20515 | "value": "吴江区"
|
20516 | }, {
|
20517 | "key": "320581",
|
20518 | "value": "常熟市"
|
20519 | }, {
|
20520 | "key": "320582",
|
20521 | "value": "张家港市"
|
20522 | }, {
|
20523 | "key": "320583",
|
20524 | "value": "昆山市"
|
20525 | }, {
|
20526 | "key": "320585",
|
20527 | "value": "太仓市"
|
20528 | }]
|
20529 | }, {
|
20530 | "key": "320600",
|
20531 | "value": "南通市",
|
20532 | "children": [{
|
20533 | "key": "320602",
|
20534 | "value": "崇川区"
|
20535 | }, {
|
20536 | "key": "320611",
|
20537 | "value": "港闸区"
|
20538 | }, {
|
20539 | "key": "320612",
|
20540 | "value": "通州区"
|
20541 | }, {
|
20542 | "key": "320623",
|
20543 | "value": "如东县"
|
20544 | }, {
|
20545 | "key": "320681",
|
20546 | "value": "启东市"
|
20547 | }, {
|
20548 | "key": "320682",
|
20549 | "value": "如皋市"
|
20550 | }, {
|
20551 | "key": "320684",
|
20552 | "value": "海门市"
|
20553 | }, {
|
20554 | "key": "320685",
|
20555 | "value": "海安市"
|
20556 | }]
|
20557 | }, {
|
20558 | "key": "320700",
|
20559 | "value": "连云港市",
|
20560 | "children": [{
|
20561 | "key": "320703",
|
20562 | "value": "连云区"
|
20563 | }, {
|
20564 | "key": "320706",
|
20565 | "value": "海州区"
|
20566 | }, {
|
20567 | "key": "320707",
|
20568 | "value": "赣榆区"
|
20569 | }, {
|
20570 | "key": "320722",
|
20571 | "value": "东海县"
|
20572 | }, {
|
20573 | "key": "320723",
|
20574 | "value": "灌云县"
|
20575 | }, {
|
20576 | "key": "320724",
|
20577 | "value": "灌南县"
|
20578 | }]
|
20579 | }, {
|
20580 | "key": "320800",
|
20581 | "value": "淮安市",
|
20582 | "children": [{
|
20583 | "key": "320803",
|
20584 | "value": "淮安区"
|
20585 | }, {
|
20586 | "key": "320804",
|
20587 | "value": "淮阴区"
|
20588 | }, {
|
20589 | "key": "320812",
|
20590 | "value": "清江浦区"
|
20591 | }, {
|
20592 | "key": "320813",
|
20593 | "value": "洪泽区"
|
20594 | }, {
|
20595 | "key": "320826",
|
20596 | "value": "涟水县"
|
20597 | }, {
|
20598 | "key": "320830",
|
20599 | "value": "盱眙县"
|
20600 | }, {
|
20601 | "key": "320831",
|
20602 | "value": "金湖县"
|
20603 | }]
|
20604 | }, {
|
20605 | "key": "320900",
|
20606 | "value": "盐城市",
|
20607 | "children": [{
|
20608 | "key": "320902",
|
20609 | "value": "亭湖区"
|
20610 | }, {
|
20611 | "key": "320903",
|
20612 | "value": "盐都区"
|
20613 | }, {
|
20614 | "key": "320904",
|
20615 | "value": "大丰区"
|
20616 | }, {
|
20617 | "key": "320921",
|
20618 | "value": "响水县"
|
20619 | }, {
|
20620 | "key": "320922",
|
20621 | "value": "滨海县"
|
20622 | }, {
|
20623 | "key": "320923",
|
20624 | "value": "阜宁县"
|
20625 | }, {
|
20626 | "key": "320924",
|
20627 | "value": "射阳县"
|
20628 | }, {
|
20629 | "key": "320925",
|
20630 | "value": "建湖县"
|
20631 | }, {
|
20632 | "key": "320981",
|
20633 | "value": "东台市"
|
20634 | }]
|
20635 | }, {
|
20636 | "key": "321000",
|
20637 | "value": "扬州市",
|
20638 | "children": [{
|
20639 | "key": "321002",
|
20640 | "value": "广陵区"
|
20641 | }, {
|
20642 | "key": "321003",
|
20643 | "value": "邗江区"
|
20644 | }, {
|
20645 | "key": "321012",
|
20646 | "value": "江都区"
|
20647 | }, {
|
20648 | "key": "321023",
|
20649 | "value": "宝应县"
|
20650 | }, {
|
20651 | "key": "321081",
|
20652 | "value": "仪征市"
|
20653 | }, {
|
20654 | "key": "321084",
|
20655 | "value": "高邮市"
|
20656 | }]
|
20657 | }, {
|
20658 | "key": "321100",
|
20659 | "value": "镇江市",
|
20660 | "children": [{
|
20661 | "key": "321102",
|
20662 | "value": "京口区"
|
20663 | }, {
|
20664 | "key": "321111",
|
20665 | "value": "润州区"
|
20666 | }, {
|
20667 | "key": "321112",
|
20668 | "value": "丹徒区"
|
20669 | }, {
|
20670 | "key": "321181",
|
20671 | "value": "丹阳市"
|
20672 | }, {
|
20673 | "key": "321182",
|
20674 | "value": "扬中市"
|
20675 | }, {
|
20676 | "key": "321183",
|
20677 | "value": "句容市"
|
20678 | }]
|
20679 | }, {
|
20680 | "key": "321200",
|
20681 | "value": "泰州市",
|
20682 | "children": [{
|
20683 | "key": "321202",
|
20684 | "value": "海陵区"
|
20685 | }, {
|
20686 | "key": "321203",
|
20687 | "value": "高港区"
|
20688 | }, {
|
20689 | "key": "321204",
|
20690 | "value": "姜堰区"
|
20691 | }, {
|
20692 | "key": "321281",
|
20693 | "value": "兴化市"
|
20694 | }, {
|
20695 | "key": "321282",
|
20696 | "value": "靖江市"
|
20697 | }, {
|
20698 | "key": "321283",
|
20699 | "value": "泰兴市"
|
20700 | }]
|
20701 | }, {
|
20702 | "key": "321300",
|
20703 | "value": "宿迁市",
|
20704 | "children": [{
|
20705 | "key": "321302",
|
20706 | "value": "宿城区"
|
20707 | }, {
|
20708 | "key": "321311",
|
20709 | "value": "宿豫区"
|
20710 | }, {
|
20711 | "key": "321322",
|
20712 | "value": "沭阳县"
|
20713 | }, {
|
20714 | "key": "321323",
|
20715 | "value": "泗阳县"
|
20716 | }, {
|
20717 | "key": "321324",
|
20718 | "value": "泗洪县"
|
20719 | }]
|
20720 | }]
|
20721 | }, {
|
20722 | "key": "330000",
|
20723 | "value": "浙江",
|
20724 | "children": [{
|
20725 | "key": "330100",
|
20726 | "value": "杭州市",
|
20727 | "children": [{
|
20728 | "key": "330102",
|
20729 | "value": "上城区"
|
20730 | }, {
|
20731 | "key": "330103",
|
20732 | "value": "下城区"
|
20733 | }, {
|
20734 | "key": "330104",
|
20735 | "value": "江干区"
|
20736 | }, {
|
20737 | "key": "330105",
|
20738 | "value": "拱墅区"
|
20739 | }, {
|
20740 | "key": "330106",
|
20741 | "value": "西湖区"
|
20742 | }, {
|
20743 | "key": "330108",
|
20744 | "value": "滨江区"
|
20745 | }, {
|
20746 | "key": "330109",
|
20747 | "value": "萧山区"
|
20748 | }, {
|
20749 | "key": "330110",
|
20750 | "value": "余杭区"
|
20751 | }, {
|
20752 | "key": "330111",
|
20753 | "value": "富阳区"
|
20754 | }, {
|
20755 | "key": "330112",
|
20756 | "value": "临安区"
|
20757 | }, {
|
20758 | "key": "330122",
|
20759 | "value": "桐庐县"
|
20760 | }, {
|
20761 | "key": "330127",
|
20762 | "value": "淳安县"
|
20763 | }, {
|
20764 | "key": "330182",
|
20765 | "value": "建德市"
|
20766 | }]
|
20767 | }, {
|
20768 | "key": "330200",
|
20769 | "value": "宁波市",
|
20770 | "children": [{
|
20771 | "key": "330203",
|
20772 | "value": "海曙区"
|
20773 | }, {
|
20774 | "key": "330205",
|
20775 | "value": "江北区"
|
20776 | }, {
|
20777 | "key": "330206",
|
20778 | "value": "北仑区"
|
20779 | }, {
|
20780 | "key": "330211",
|
20781 | "value": "镇海区"
|
20782 | }, {
|
20783 | "key": "330212",
|
20784 | "value": "鄞州区"
|
20785 | }, {
|
20786 | "key": "330213",
|
20787 | "value": "奉化区"
|
20788 | }, {
|
20789 | "key": "330225",
|
20790 | "value": "象山县"
|
20791 | }, {
|
20792 | "key": "330226",
|
20793 | "value": "宁海县"
|
20794 | }, {
|
20795 | "key": "330281",
|
20796 | "value": "余姚市"
|
20797 | }, {
|
20798 | "key": "330282",
|
20799 | "value": "慈溪市"
|
20800 | }]
|
20801 | }, {
|
20802 | "key": "330300",
|
20803 | "value": "温州市",
|
20804 | "children": [{
|
20805 | "key": "330302",
|
20806 | "value": "鹿城区"
|
20807 | }, {
|
20808 | "key": "330303",
|
20809 | "value": "龙湾区"
|
20810 | }, {
|
20811 | "key": "330304",
|
20812 | "value": "瓯海区"
|
20813 | }, {
|
20814 | "key": "330305",
|
20815 | "value": "洞头区"
|
20816 | }, {
|
20817 | "key": "330324",
|
20818 | "value": "永嘉县"
|
20819 | }, {
|
20820 | "key": "330326",
|
20821 | "value": "平阳县"
|
20822 | }, {
|
20823 | "key": "330327",
|
20824 | "value": "苍南县"
|
20825 | }, {
|
20826 | "key": "330328",
|
20827 | "value": "文成县"
|
20828 | }, {
|
20829 | "key": "330329",
|
20830 | "value": "泰顺县"
|
20831 | }, {
|
20832 | "key": "330381",
|
20833 | "value": "瑞安市"
|
20834 | }, {
|
20835 | "key": "330382",
|
20836 | "value": "乐清市"
|
20837 | }]
|
20838 | }, {
|
20839 | "key": "330400",
|
20840 | "value": "嘉兴市",
|
20841 | "children": [{
|
20842 | "key": "330402",
|
20843 | "value": "南湖区"
|
20844 | }, {
|
20845 | "key": "330411",
|
20846 | "value": "秀洲区"
|
20847 | }, {
|
20848 | "key": "330421",
|
20849 | "value": "嘉善县"
|
20850 | }, {
|
20851 | "key": "330424",
|
20852 | "value": "海盐县"
|
20853 | }, {
|
20854 | "key": "330481",
|
20855 | "value": "海宁市"
|
20856 | }, {
|
20857 | "key": "330482",
|
20858 | "value": "平湖市"
|
20859 | }, {
|
20860 | "key": "330483",
|
20861 | "value": "桐乡市"
|
20862 | }]
|
20863 | }, {
|
20864 | "key": "330500",
|
20865 | "value": "湖州市",
|
20866 | "children": [{
|
20867 | "key": "330502",
|
20868 | "value": "吴兴区"
|
20869 | }, {
|
20870 | "key": "330503",
|
20871 | "value": "南浔区"
|
20872 | }, {
|
20873 | "key": "330521",
|
20874 | "value": "德清县"
|
20875 | }, {
|
20876 | "key": "330522",
|
20877 | "value": "长兴县"
|
20878 | }, {
|
20879 | "key": "330523",
|
20880 | "value": "安吉县"
|
20881 | }]
|
20882 | }, {
|
20883 | "key": "330600",
|
20884 | "value": "绍兴市",
|
20885 | "children": [{
|
20886 | "key": "330602",
|
20887 | "value": "越城区"
|
20888 | }, {
|
20889 | "key": "330603",
|
20890 | "value": "柯桥区"
|
20891 | }, {
|
20892 | "key": "330604",
|
20893 | "value": "上虞区"
|
20894 | }, {
|
20895 | "key": "330624",
|
20896 | "value": "新昌县"
|
20897 | }, {
|
20898 | "key": "330681",
|
20899 | "value": "诸暨市"
|
20900 | }, {
|
20901 | "key": "330683",
|
20902 | "value": "嵊州市"
|
20903 | }]
|
20904 | }, {
|
20905 | "key": "330700",
|
20906 | "value": "金华市",
|
20907 | "children": [{
|
20908 | "key": "330702",
|
20909 | "value": "婺城区"
|
20910 | }, {
|
20911 | "key": "330703",
|
20912 | "value": "金东区"
|
20913 | }, {
|
20914 | "key": "330723",
|
20915 | "value": "武义县"
|
20916 | }, {
|
20917 | "key": "330726",
|
20918 | "value": "浦江县"
|
20919 | }, {
|
20920 | "key": "330727",
|
20921 | "value": "磐安县"
|
20922 | }, {
|
20923 | "key": "330781",
|
20924 | "value": "兰溪市"
|
20925 | }, {
|
20926 | "key": "330782",
|
20927 | "value": "义乌市"
|
20928 | }, {
|
20929 | "key": "330783",
|
20930 | "value": "东阳市"
|
20931 | }, {
|
20932 | "key": "330784",
|
20933 | "value": "永康市"
|
20934 | }]
|
20935 | }, {
|
20936 | "key": "330800",
|
20937 | "value": "衢州市",
|
20938 | "children": [{
|
20939 | "key": "330802",
|
20940 | "value": "柯城区"
|
20941 | }, {
|
20942 | "key": "330803",
|
20943 | "value": "衢江区"
|
20944 | }, {
|
20945 | "key": "330822",
|
20946 | "value": "常山县"
|
20947 | }, {
|
20948 | "key": "330824",
|
20949 | "value": "开化县"
|
20950 | }, {
|
20951 | "key": "330825",
|
20952 | "value": "龙游县"
|
20953 | }, {
|
20954 | "key": "330881",
|
20955 | "value": "江山市"
|
20956 | }]
|
20957 | }, {
|
20958 | "key": "330900",
|
20959 | "value": "舟山市",
|
20960 | "children": [{
|
20961 | "key": "330902",
|
20962 | "value": "定海区"
|
20963 | }, {
|
20964 | "key": "330903",
|
20965 | "value": "普陀区"
|
20966 | }, {
|
20967 | "key": "330921",
|
20968 | "value": "岱山县"
|
20969 | }, {
|
20970 | "key": "330922",
|
20971 | "value": "嵊泗县"
|
20972 | }]
|
20973 | }, {
|
20974 | "key": "331000",
|
20975 | "value": "台州市",
|
20976 | "children": [{
|
20977 | "key": "331002",
|
20978 | "value": "椒江区"
|
20979 | }, {
|
20980 | "key": "331003",
|
20981 | "value": "黄岩区"
|
20982 | }, {
|
20983 | "key": "331004",
|
20984 | "value": "路桥区"
|
20985 | }, {
|
20986 | "key": "331022",
|
20987 | "value": "三门县"
|
20988 | }, {
|
20989 | "key": "331023",
|
20990 | "value": "天台县"
|
20991 | }, {
|
20992 | "key": "331024",
|
20993 | "value": "仙居县"
|
20994 | }, {
|
20995 | "key": "331081",
|
20996 | "value": "温岭市"
|
20997 | }, {
|
20998 | "key": "331082",
|
20999 | "value": "临海市"
|
21000 | }, {
|
21001 | "key": "331083",
|
21002 | "value": "玉环市"
|
21003 | }]
|
21004 | }, {
|
21005 | "key": "331100",
|
21006 | "value": "丽水市",
|
21007 | "children": [{
|
21008 | "key": "331102",
|
21009 | "value": "莲都区"
|
21010 | }, {
|
21011 | "key": "331121",
|
21012 | "value": "青田县"
|
21013 | }, {
|
21014 | "key": "331122",
|
21015 | "value": "缙云县"
|
21016 | }, {
|
21017 | "key": "331123",
|
21018 | "value": "遂昌县"
|
21019 | }, {
|
21020 | "key": "331124",
|
21021 | "value": "松阳县"
|
21022 | }, {
|
21023 | "key": "331125",
|
21024 | "value": "云和县"
|
21025 | }, {
|
21026 | "key": "331126",
|
21027 | "value": "庆元县"
|
21028 | }, {
|
21029 | "key": "331127",
|
21030 | "value": "景宁畲族自治县"
|
21031 | }, {
|
21032 | "key": "331181",
|
21033 | "value": "龙泉市"
|
21034 | }]
|
21035 | }]
|
21036 | }, {
|
21037 | "key": "340000",
|
21038 | "value": "安徽",
|
21039 | "children": [{
|
21040 | "key": "340100",
|
21041 | "value": "合肥市",
|
21042 | "children": [{
|
21043 | "key": "340102",
|
21044 | "value": "瑶海区"
|
21045 | }, {
|
21046 | "key": "340103",
|
21047 | "value": "庐阳区"
|
21048 | }, {
|
21049 | "key": "340104",
|
21050 | "value": "蜀山区"
|
21051 | }, {
|
21052 | "key": "340111",
|
21053 | "value": "包河区"
|
21054 | }, {
|
21055 | "key": "340121",
|
21056 | "value": "长丰县"
|
21057 | }, {
|
21058 | "key": "340122",
|
21059 | "value": "肥东县"
|
21060 | }, {
|
21061 | "key": "340123",
|
21062 | "value": "肥西县"
|
21063 | }, {
|
21064 | "key": "340124",
|
21065 | "value": "庐江县"
|
21066 | }, {
|
21067 | "key": "340181",
|
21068 | "value": "巢湖市"
|
21069 | }]
|
21070 | }, {
|
21071 | "key": "340200",
|
21072 | "value": "芜湖市",
|
21073 | "children": [{
|
21074 | "key": "340202",
|
21075 | "value": "镜湖区"
|
21076 | }, {
|
21077 | "key": "340203",
|
21078 | "value": "弋江区"
|
21079 | }, {
|
21080 | "key": "340207",
|
21081 | "value": "鸠江区"
|
21082 | }, {
|
21083 | "key": "340208",
|
21084 | "value": "三山区"
|
21085 | }, {
|
21086 | "key": "340221",
|
21087 | "value": "芜湖县"
|
21088 | }, {
|
21089 | "key": "340222",
|
21090 | "value": "繁昌县"
|
21091 | }, {
|
21092 | "key": "340223",
|
21093 | "value": "南陵县"
|
21094 | }, {
|
21095 | "key": "340225",
|
21096 | "value": "无为县"
|
21097 | }]
|
21098 | }, {
|
21099 | "key": "340300",
|
21100 | "value": "蚌埠市",
|
21101 | "children": [{
|
21102 | "key": "340302",
|
21103 | "value": "龙子湖区"
|
21104 | }, {
|
21105 | "key": "340303",
|
21106 | "value": "蚌山区"
|
21107 | }, {
|
21108 | "key": "340304",
|
21109 | "value": "禹会区"
|
21110 | }, {
|
21111 | "key": "340311",
|
21112 | "value": "淮上区"
|
21113 | }, {
|
21114 | "key": "340321",
|
21115 | "value": "怀远县"
|
21116 | }, {
|
21117 | "key": "340322",
|
21118 | "value": "五河县"
|
21119 | }, {
|
21120 | "key": "340323",
|
21121 | "value": "固镇县"
|
21122 | }]
|
21123 | }, {
|
21124 | "key": "340400",
|
21125 | "value": "淮南市",
|
21126 | "children": [{
|
21127 | "key": "340402",
|
21128 | "value": "大通区"
|
21129 | }, {
|
21130 | "key": "340403",
|
21131 | "value": "田家庵区"
|
21132 | }, {
|
21133 | "key": "340404",
|
21134 | "value": "谢家集区"
|
21135 | }, {
|
21136 | "key": "340405",
|
21137 | "value": "八公山区"
|
21138 | }, {
|
21139 | "key": "340406",
|
21140 | "value": "潘集区"
|
21141 | }, {
|
21142 | "key": "340421",
|
21143 | "value": "凤台县"
|
21144 | }, {
|
21145 | "key": "340422",
|
21146 | "value": "寿县"
|
21147 | }]
|
21148 | }, {
|
21149 | "key": "340500",
|
21150 | "value": "马鞍山市",
|
21151 | "children": [{
|
21152 | "key": "340503",
|
21153 | "value": "花山区"
|
21154 | }, {
|
21155 | "key": "340504",
|
21156 | "value": "雨山区"
|
21157 | }, {
|
21158 | "key": "340506",
|
21159 | "value": "博望区"
|
21160 | }, {
|
21161 | "key": "340521",
|
21162 | "value": "当涂县"
|
21163 | }, {
|
21164 | "key": "340522",
|
21165 | "value": "含山县"
|
21166 | }, {
|
21167 | "key": "340523",
|
21168 | "value": "和县"
|
21169 | }]
|
21170 | }, {
|
21171 | "key": "340600",
|
21172 | "value": "淮北市",
|
21173 | "children": [{
|
21174 | "key": "340602",
|
21175 | "value": "杜集区"
|
21176 | }, {
|
21177 | "key": "340603",
|
21178 | "value": "相山区"
|
21179 | }, {
|
21180 | "key": "340604",
|
21181 | "value": "烈山区"
|
21182 | }, {
|
21183 | "key": "340621",
|
21184 | "value": "濉溪县"
|
21185 | }]
|
21186 | }, {
|
21187 | "key": "340700",
|
21188 | "value": "铜陵市",
|
21189 | "children": [{
|
21190 | "key": "340705",
|
21191 | "value": "铜官区"
|
21192 | }, {
|
21193 | "key": "340706",
|
21194 | "value": "义安区"
|
21195 | }, {
|
21196 | "key": "340711",
|
21197 | "value": "郊区"
|
21198 | }, {
|
21199 | "key": "340722",
|
21200 | "value": "枞阳县"
|
21201 | }]
|
21202 | }, {
|
21203 | "key": "340800",
|
21204 | "value": "安庆市",
|
21205 | "children": [{
|
21206 | "key": "340802",
|
21207 | "value": "迎江区"
|
21208 | }, {
|
21209 | "key": "340803",
|
21210 | "value": "大观区"
|
21211 | }, {
|
21212 | "key": "340811",
|
21213 | "value": "宜秀区"
|
21214 | }, {
|
21215 | "key": "340822",
|
21216 | "value": "怀宁县"
|
21217 | }, {
|
21218 | "key": "340824",
|
21219 | "value": "潜山县"
|
21220 | }, {
|
21221 | "key": "340825",
|
21222 | "value": "太湖县"
|
21223 | }, {
|
21224 | "key": "340826",
|
21225 | "value": "宿松县"
|
21226 | }, {
|
21227 | "key": "340827",
|
21228 | "value": "望江县"
|
21229 | }, {
|
21230 | "key": "340828",
|
21231 | "value": "岳西县"
|
21232 | }, {
|
21233 | "key": "340881",
|
21234 | "value": "桐城市"
|
21235 | }]
|
21236 | }, {
|
21237 | "key": "341000",
|
21238 | "value": "黄山市",
|
21239 | "children": [{
|
21240 | "key": "341002",
|
21241 | "value": "屯溪区"
|
21242 | }, {
|
21243 | "key": "341003",
|
21244 | "value": "黄山区"
|
21245 | }, {
|
21246 | "key": "341004",
|
21247 | "value": "徽州区"
|
21248 | }, {
|
21249 | "key": "341021",
|
21250 | "value": "歙县"
|
21251 | }, {
|
21252 | "key": "341022",
|
21253 | "value": "休宁县"
|
21254 | }, {
|
21255 | "key": "341023",
|
21256 | "value": "黟县"
|
21257 | }, {
|
21258 | "key": "341024",
|
21259 | "value": "祁门县"
|
21260 | }]
|
21261 | }, {
|
21262 | "key": "341100",
|
21263 | "value": "滁州市",
|
21264 | "children": [{
|
21265 | "key": "341102",
|
21266 | "value": "琅琊区"
|
21267 | }, {
|
21268 | "key": "341103",
|
21269 | "value": "南谯区"
|
21270 | }, {
|
21271 | "key": "341122",
|
21272 | "value": "来安县"
|
21273 | }, {
|
21274 | "key": "341124",
|
21275 | "value": "全椒县"
|
21276 | }, {
|
21277 | "key": "341125",
|
21278 | "value": "定远县"
|
21279 | }, {
|
21280 | "key": "341126",
|
21281 | "value": "凤阳县"
|
21282 | }, {
|
21283 | "key": "341181",
|
21284 | "value": "天长市"
|
21285 | }, {
|
21286 | "key": "341182",
|
21287 | "value": "明光市"
|
21288 | }]
|
21289 | }, {
|
21290 | "key": "341200",
|
21291 | "value": "阜阳市",
|
21292 | "children": [{
|
21293 | "key": "341202",
|
21294 | "value": "颍州区"
|
21295 | }, {
|
21296 | "key": "341203",
|
21297 | "value": "颍东区"
|
21298 | }, {
|
21299 | "key": "341204",
|
21300 | "value": "颍泉区"
|
21301 | }, {
|
21302 | "key": "341221",
|
21303 | "value": "临泉县"
|
21304 | }, {
|
21305 | "key": "341222",
|
21306 | "value": "太和县"
|
21307 | }, {
|
21308 | "key": "341225",
|
21309 | "value": "阜南县"
|
21310 | }, {
|
21311 | "key": "341226",
|
21312 | "value": "颍上县"
|
21313 | }, {
|
21314 | "key": "341282",
|
21315 | "value": "界首市"
|
21316 | }]
|
21317 | }, {
|
21318 | "key": "341300",
|
21319 | "value": "宿州市",
|
21320 | "children": [{
|
21321 | "key": "341302",
|
21322 | "value": "埇桥区"
|
21323 | }, {
|
21324 | "key": "341321",
|
21325 | "value": "砀山县"
|
21326 | }, {
|
21327 | "key": "341322",
|
21328 | "value": "萧县"
|
21329 | }, {
|
21330 | "key": "341323",
|
21331 | "value": "灵璧县"
|
21332 | }, {
|
21333 | "key": "341324",
|
21334 | "value": "泗县"
|
21335 | }]
|
21336 | }, {
|
21337 | "key": "341500",
|
21338 | "value": "六安市",
|
21339 | "children": [{
|
21340 | "key": "341502",
|
21341 | "value": "金安区"
|
21342 | }, {
|
21343 | "key": "341503",
|
21344 | "value": "裕安区"
|
21345 | }, {
|
21346 | "key": "341504",
|
21347 | "value": "叶集区"
|
21348 | }, {
|
21349 | "key": "341522",
|
21350 | "value": "霍邱县"
|
21351 | }, {
|
21352 | "key": "341523",
|
21353 | "value": "舒城县"
|
21354 | }, {
|
21355 | "key": "341524",
|
21356 | "value": "金寨县"
|
21357 | }, {
|
21358 | "key": "341525",
|
21359 | "value": "霍山县"
|
21360 | }]
|
21361 | }, {
|
21362 | "key": "341600",
|
21363 | "value": "亳州市",
|
21364 | "children": [{
|
21365 | "key": "341602",
|
21366 | "value": "谯城区"
|
21367 | }, {
|
21368 | "key": "341621",
|
21369 | "value": "涡阳县"
|
21370 | }, {
|
21371 | "key": "341622",
|
21372 | "value": "蒙城县"
|
21373 | }, {
|
21374 | "key": "341623",
|
21375 | "value": "利辛县"
|
21376 | }]
|
21377 | }, {
|
21378 | "key": "341700",
|
21379 | "value": "池州市",
|
21380 | "children": [{
|
21381 | "key": "341702",
|
21382 | "value": "贵池区"
|
21383 | }, {
|
21384 | "key": "341721",
|
21385 | "value": "东至县"
|
21386 | }, {
|
21387 | "key": "341722",
|
21388 | "value": "石台县"
|
21389 | }, {
|
21390 | "key": "341723",
|
21391 | "value": "青阳县"
|
21392 | }]
|
21393 | }, {
|
21394 | "key": "341800",
|
21395 | "value": "宣城市",
|
21396 | "children": [{
|
21397 | "key": "341802",
|
21398 | "value": "宣州区"
|
21399 | }, {
|
21400 | "key": "341821",
|
21401 | "value": "郎溪县"
|
21402 | }, {
|
21403 | "key": "341822",
|
21404 | "value": "广德县"
|
21405 | }, {
|
21406 | "key": "341823",
|
21407 | "value": "泾县"
|
21408 | }, {
|
21409 | "key": "341824",
|
21410 | "value": "绩溪县"
|
21411 | }, {
|
21412 | "key": "341825",
|
21413 | "value": "旌德县"
|
21414 | }, {
|
21415 | "key": "341881",
|
21416 | "value": "宁国市"
|
21417 | }]
|
21418 | }]
|
21419 | }, {
|
21420 | "key": "350000",
|
21421 | "value": "福建",
|
21422 | "children": [{
|
21423 | "key": "350100",
|
21424 | "value": "福州市",
|
21425 | "children": [{
|
21426 | "key": "350102",
|
21427 | "value": "鼓楼区"
|
21428 | }, {
|
21429 | "key": "350103",
|
21430 | "value": "台江区"
|
21431 | }, {
|
21432 | "key": "350104",
|
21433 | "value": "仓山区"
|
21434 | }, {
|
21435 | "key": "350105",
|
21436 | "value": "马尾区"
|
21437 | }, {
|
21438 | "key": "350111",
|
21439 | "value": "晋安区"
|
21440 | }, {
|
21441 | "key": "350112",
|
21442 | "value": "长乐区"
|
21443 | }, {
|
21444 | "key": "350121",
|
21445 | "value": "闽侯县"
|
21446 | }, {
|
21447 | "key": "350122",
|
21448 | "value": "连江县"
|
21449 | }, {
|
21450 | "key": "350123",
|
21451 | "value": "罗源县"
|
21452 | }, {
|
21453 | "key": "350124",
|
21454 | "value": "闽清县"
|
21455 | }, {
|
21456 | "key": "350125",
|
21457 | "value": "永泰县"
|
21458 | }, {
|
21459 | "key": "350128",
|
21460 | "value": "平潭县"
|
21461 | }, {
|
21462 | "key": "350181",
|
21463 | "value": "福清市"
|
21464 | }]
|
21465 | }, {
|
21466 | "key": "350200",
|
21467 | "value": "厦门市",
|
21468 | "children": [{
|
21469 | "key": "350203",
|
21470 | "value": "思明区"
|
21471 | }, {
|
21472 | "key": "350205",
|
21473 | "value": "海沧区"
|
21474 | }, {
|
21475 | "key": "350206",
|
21476 | "value": "湖里区"
|
21477 | }, {
|
21478 | "key": "350211",
|
21479 | "value": "集美区"
|
21480 | }, {
|
21481 | "key": "350212",
|
21482 | "value": "同安区"
|
21483 | }, {
|
21484 | "key": "350213",
|
21485 | "value": "翔安区"
|
21486 | }]
|
21487 | }, {
|
21488 | "key": "350300",
|
21489 | "value": "莆田市",
|
21490 | "children": [{
|
21491 | "key": "350302",
|
21492 | "value": "城厢区"
|
21493 | }, {
|
21494 | "key": "350303",
|
21495 | "value": "涵江区"
|
21496 | }, {
|
21497 | "key": "350304",
|
21498 | "value": "荔城区"
|
21499 | }, {
|
21500 | "key": "350305",
|
21501 | "value": "秀屿区"
|
21502 | }, {
|
21503 | "key": "350322",
|
21504 | "value": "仙游县"
|
21505 | }]
|
21506 | }, {
|
21507 | "key": "350400",
|
21508 | "value": "三明市",
|
21509 | "children": [{
|
21510 | "key": "350402",
|
21511 | "value": "梅列区"
|
21512 | }, {
|
21513 | "key": "350403",
|
21514 | "value": "三元区"
|
21515 | }, {
|
21516 | "key": "350421",
|
21517 | "value": "明溪县"
|
21518 | }, {
|
21519 | "key": "350423",
|
21520 | "value": "清流县"
|
21521 | }, {
|
21522 | "key": "350424",
|
21523 | "value": "宁化县"
|
21524 | }, {
|
21525 | "key": "350425",
|
21526 | "value": "大田县"
|
21527 | }, {
|
21528 | "key": "350426",
|
21529 | "value": "尤溪县"
|
21530 | }, {
|
21531 | "key": "350427",
|
21532 | "value": "沙县"
|
21533 | }, {
|
21534 | "key": "350428",
|
21535 | "value": "将乐县"
|
21536 | }, {
|
21537 | "key": "350429",
|
21538 | "value": "泰宁县"
|
21539 | }, {
|
21540 | "key": "350430",
|
21541 | "value": "建宁县"
|
21542 | }, {
|
21543 | "key": "350481",
|
21544 | "value": "永安市"
|
21545 | }]
|
21546 | }, {
|
21547 | "key": "350500",
|
21548 | "value": "泉州市",
|
21549 | "children": [{
|
21550 | "key": "350502",
|
21551 | "value": "鲤城区"
|
21552 | }, {
|
21553 | "key": "350503",
|
21554 | "value": "丰泽区"
|
21555 | }, {
|
21556 | "key": "350504",
|
21557 | "value": "洛江区"
|
21558 | }, {
|
21559 | "key": "350505",
|
21560 | "value": "泉港区"
|
21561 | }, {
|
21562 | "key": "350521",
|
21563 | "value": "惠安县"
|
21564 | }, {
|
21565 | "key": "350524",
|
21566 | "value": "安溪县"
|
21567 | }, {
|
21568 | "key": "350525",
|
21569 | "value": "永春县"
|
21570 | }, {
|
21571 | "key": "350526",
|
21572 | "value": "德化县"
|
21573 | }, {
|
21574 | "key": "350527",
|
21575 | "value": "金门县"
|
21576 | }, {
|
21577 | "key": "350581",
|
21578 | "value": "石狮市"
|
21579 | }, {
|
21580 | "key": "350582",
|
21581 | "value": "晋江市"
|
21582 | }, {
|
21583 | "key": "350583",
|
21584 | "value": "南安市"
|
21585 | }]
|
21586 | }, {
|
21587 | "key": "350600",
|
21588 | "value": "漳州市",
|
21589 | "children": [{
|
21590 | "key": "350602",
|
21591 | "value": "芗城区"
|
21592 | }, {
|
21593 | "key": "350603",
|
21594 | "value": "龙文区"
|
21595 | }, {
|
21596 | "key": "350622",
|
21597 | "value": "云霄县"
|
21598 | }, {
|
21599 | "key": "350623",
|
21600 | "value": "漳浦县"
|
21601 | }, {
|
21602 | "key": "350624",
|
21603 | "value": "诏安县"
|
21604 | }, {
|
21605 | "key": "350625",
|
21606 | "value": "长泰县"
|
21607 | }, {
|
21608 | "key": "350626",
|
21609 | "value": "东山县"
|
21610 | }, {
|
21611 | "key": "350627",
|
21612 | "value": "南靖县"
|
21613 | }, {
|
21614 | "key": "350628",
|
21615 | "value": "平和县"
|
21616 | }, {
|
21617 | "key": "350629",
|
21618 | "value": "华安县"
|
21619 | }, {
|
21620 | "key": "350681",
|
21621 | "value": "龙海市"
|
21622 | }]
|
21623 | }, {
|
21624 | "key": "350700",
|
21625 | "value": "南平市",
|
21626 | "children": [{
|
21627 | "key": "350702",
|
21628 | "value": "延平区"
|
21629 | }, {
|
21630 | "key": "350703",
|
21631 | "value": "建阳区"
|
21632 | }, {
|
21633 | "key": "350721",
|
21634 | "value": "顺昌县"
|
21635 | }, {
|
21636 | "key": "350722",
|
21637 | "value": "浦城县"
|
21638 | }, {
|
21639 | "key": "350723",
|
21640 | "value": "光泽县"
|
21641 | }, {
|
21642 | "key": "350724",
|
21643 | "value": "松溪县"
|
21644 | }, {
|
21645 | "key": "350725",
|
21646 | "value": "政和县"
|
21647 | }, {
|
21648 | "key": "350781",
|
21649 | "value": "邵武市"
|
21650 | }, {
|
21651 | "key": "350782",
|
21652 | "value": "武夷山市"
|
21653 | }, {
|
21654 | "key": "350783",
|
21655 | "value": "建瓯市"
|
21656 | }]
|
21657 | }, {
|
21658 | "key": "350800",
|
21659 | "value": "龙岩市",
|
21660 | "children": [{
|
21661 | "key": "350802",
|
21662 | "value": "新罗区"
|
21663 | }, {
|
21664 | "key": "350803",
|
21665 | "value": "永定区"
|
21666 | }, {
|
21667 | "key": "350821",
|
21668 | "value": "长汀县"
|
21669 | }, {
|
21670 | "key": "350823",
|
21671 | "value": "上杭县"
|
21672 | }, {
|
21673 | "key": "350824",
|
21674 | "value": "武平县"
|
21675 | }, {
|
21676 | "key": "350825",
|
21677 | "value": "连城县"
|
21678 | }, {
|
21679 | "key": "350881",
|
21680 | "value": "漳平市"
|
21681 | }]
|
21682 | }, {
|
21683 | "key": "350900",
|
21684 | "value": "宁德市",
|
21685 | "children": [{
|
21686 | "key": "350902",
|
21687 | "value": "蕉城区"
|
21688 | }, {
|
21689 | "key": "350921",
|
21690 | "value": "霞浦县"
|
21691 | }, {
|
21692 | "key": "350922",
|
21693 | "value": "古田县"
|
21694 | }, {
|
21695 | "key": "350923",
|
21696 | "value": "屏南县"
|
21697 | }, {
|
21698 | "key": "350924",
|
21699 | "value": "寿宁县"
|
21700 | }, {
|
21701 | "key": "350925",
|
21702 | "value": "周宁县"
|
21703 | }, {
|
21704 | "key": "350926",
|
21705 | "value": "柘荣县"
|
21706 | }, {
|
21707 | "key": "350981",
|
21708 | "value": "福安市"
|
21709 | }, {
|
21710 | "key": "350982",
|
21711 | "value": "福鼎市"
|
21712 | }]
|
21713 | }]
|
21714 | }, {
|
21715 | "key": "360000",
|
21716 | "value": "江西",
|
21717 | "children": [{
|
21718 | "key": "360100",
|
21719 | "value": "南昌市",
|
21720 | "children": [{
|
21721 | "key": "360102",
|
21722 | "value": "东湖区"
|
21723 | }, {
|
21724 | "key": "360103",
|
21725 | "value": "西湖区"
|
21726 | }, {
|
21727 | "key": "360104",
|
21728 | "value": "青云谱区"
|
21729 | }, {
|
21730 | "key": "360105",
|
21731 | "value": "湾里区"
|
21732 | }, {
|
21733 | "key": "360111",
|
21734 | "value": "青山湖区"
|
21735 | }, {
|
21736 | "key": "360112",
|
21737 | "value": "新建区"
|
21738 | }, {
|
21739 | "key": "360121",
|
21740 | "value": "南昌县"
|
21741 | }, {
|
21742 | "key": "360123",
|
21743 | "value": "安义县"
|
21744 | }, {
|
21745 | "key": "360124",
|
21746 | "value": "进贤县"
|
21747 | }]
|
21748 | }, {
|
21749 | "key": "360200",
|
21750 | "value": "景德镇市",
|
21751 | "children": [{
|
21752 | "key": "360202",
|
21753 | "value": "昌江区"
|
21754 | }, {
|
21755 | "key": "360203",
|
21756 | "value": "珠山区"
|
21757 | }, {
|
21758 | "key": "360222",
|
21759 | "value": "浮梁县"
|
21760 | }, {
|
21761 | "key": "360281",
|
21762 | "value": "乐平市"
|
21763 | }]
|
21764 | }, {
|
21765 | "key": "360300",
|
21766 | "value": "萍乡市",
|
21767 | "children": [{
|
21768 | "key": "360302",
|
21769 | "value": "安源区"
|
21770 | }, {
|
21771 | "key": "360313",
|
21772 | "value": "湘东区"
|
21773 | }, {
|
21774 | "key": "360321",
|
21775 | "value": "莲花县"
|
21776 | }, {
|
21777 | "key": "360322",
|
21778 | "value": "上栗县"
|
21779 | }, {
|
21780 | "key": "360323",
|
21781 | "value": "芦溪县"
|
21782 | }]
|
21783 | }, {
|
21784 | "key": "360400",
|
21785 | "value": "九江市",
|
21786 | "children": [{
|
21787 | "key": "360402",
|
21788 | "value": "庐山区"
|
21789 | }, {
|
21790 | "key": "360403",
|
21791 | "value": "浔阳区"
|
21792 | }, {
|
21793 | "key": "360404",
|
21794 | "value": "柴桑区"
|
21795 | }, {
|
21796 | "key": "360423",
|
21797 | "value": "武宁县"
|
21798 | }, {
|
21799 | "key": "360424",
|
21800 | "value": "修水县"
|
21801 | }, {
|
21802 | "key": "360425",
|
21803 | "value": "永修县"
|
21804 | }, {
|
21805 | "key": "360426",
|
21806 | "value": "德安县"
|
21807 | }, {
|
21808 | "key": "360428",
|
21809 | "value": "都昌县"
|
21810 | }, {
|
21811 | "key": "360429",
|
21812 | "value": "湖口县"
|
21813 | }, {
|
21814 | "key": "360430",
|
21815 | "value": "彭泽县"
|
21816 | }, {
|
21817 | "key": "360481",
|
21818 | "value": "瑞昌市"
|
21819 | }, {
|
21820 | "key": "360482",
|
21821 | "value": "共青城市"
|
21822 | }, {
|
21823 | "key": "360483",
|
21824 | "value": "庐山市"
|
21825 | }]
|
21826 | }, {
|
21827 | "key": "360500",
|
21828 | "value": "新余市",
|
21829 | "children": [{
|
21830 | "key": "360502",
|
21831 | "value": "渝水区"
|
21832 | }, {
|
21833 | "key": "360521",
|
21834 | "value": "分宜县"
|
21835 | }]
|
21836 | }, {
|
21837 | "key": "360600",
|
21838 | "value": "鹰潭市",
|
21839 | "children": [{
|
21840 | "key": "360602",
|
21841 | "value": "月湖区"
|
21842 | }, {
|
21843 | "key": "360603",
|
21844 | "value": "余江区"
|
21845 | }, {
|
21846 | "key": "360681",
|
21847 | "value": "贵溪市"
|
21848 | }]
|
21849 | }, {
|
21850 | "key": "360700",
|
21851 | "value": "赣州市",
|
21852 | "children": [{
|
21853 | "key": "360702",
|
21854 | "value": "章贡区"
|
21855 | }, {
|
21856 | "key": "360703",
|
21857 | "value": "南康区"
|
21858 | }, {
|
21859 | "key": "360704",
|
21860 | "value": "赣县区"
|
21861 | }, {
|
21862 | "key": "360722",
|
21863 | "value": "信丰县"
|
21864 | }, {
|
21865 | "key": "360723",
|
21866 | "value": "大余县"
|
21867 | }, {
|
21868 | "key": "360724",
|
21869 | "value": "上犹县"
|
21870 | }, {
|
21871 | "key": "360725",
|
21872 | "value": "崇义县"
|
21873 | }, {
|
21874 | "key": "360726",
|
21875 | "value": "安远县"
|
21876 | }, {
|
21877 | "key": "360727",
|
21878 | "value": "龙南县"
|
21879 | }, {
|
21880 | "key": "360728",
|
21881 | "value": "定南县"
|
21882 | }, {
|
21883 | "key": "360729",
|
21884 | "value": "全南县"
|
21885 | }, {
|
21886 | "key": "360730",
|
21887 | "value": "宁都县"
|
21888 | }, {
|
21889 | "key": "360731",
|
21890 | "value": "于都县"
|
21891 | }, {
|
21892 | "key": "360732",
|
21893 | "value": "兴国县"
|
21894 | }, {
|
21895 | "key": "360733",
|
21896 | "value": "会昌县"
|
21897 | }, {
|
21898 | "key": "360734",
|
21899 | "value": "寻乌县"
|
21900 | }, {
|
21901 | "key": "360735",
|
21902 | "value": "石城县"
|
21903 | }, {
|
21904 | "key": "360781",
|
21905 | "value": "瑞金市"
|
21906 | }]
|
21907 | }, {
|
21908 | "key": "360800",
|
21909 | "value": "吉安市",
|
21910 | "children": [{
|
21911 | "key": "360802",
|
21912 | "value": "吉州区"
|
21913 | }, {
|
21914 | "key": "360803",
|
21915 | "value": "青原区"
|
21916 | }, {
|
21917 | "key": "360821",
|
21918 | "value": "吉安县"
|
21919 | }, {
|
21920 | "key": "360822",
|
21921 | "value": "吉水县"
|
21922 | }, {
|
21923 | "key": "360823",
|
21924 | "value": "峡江县"
|
21925 | }, {
|
21926 | "key": "360824",
|
21927 | "value": "新干县"
|
21928 | }, {
|
21929 | "key": "360825",
|
21930 | "value": "永丰县"
|
21931 | }, {
|
21932 | "key": "360826",
|
21933 | "value": "泰和县"
|
21934 | }, {
|
21935 | "key": "360827",
|
21936 | "value": "遂川县"
|
21937 | }, {
|
21938 | "key": "360828",
|
21939 | "value": "万安县"
|
21940 | }, {
|
21941 | "key": "360829",
|
21942 | "value": "安福县"
|
21943 | }, {
|
21944 | "key": "360830",
|
21945 | "value": "永新县"
|
21946 | }, {
|
21947 | "key": "360881",
|
21948 | "value": "井冈山市"
|
21949 | }]
|
21950 | }, {
|
21951 | "key": "360900",
|
21952 | "value": "宜春市",
|
21953 | "children": [{
|
21954 | "key": "360902",
|
21955 | "value": "袁州区"
|
21956 | }, {
|
21957 | "key": "360921",
|
21958 | "value": "奉新县"
|
21959 | }, {
|
21960 | "key": "360922",
|
21961 | "value": "万载县"
|
21962 | }, {
|
21963 | "key": "360923",
|
21964 | "value": "上高县"
|
21965 | }, {
|
21966 | "key": "360924",
|
21967 | "value": "宜丰县"
|
21968 | }, {
|
21969 | "key": "360925",
|
21970 | "value": "靖安县"
|
21971 | }, {
|
21972 | "key": "360926",
|
21973 | "value": "铜鼓县"
|
21974 | }, {
|
21975 | "key": "360981",
|
21976 | "value": "丰城市"
|
21977 | }, {
|
21978 | "key": "360982",
|
21979 | "value": "樟树市"
|
21980 | }, {
|
21981 | "key": "360983",
|
21982 | "value": "高安市"
|
21983 | }]
|
21984 | }, {
|
21985 | "key": "361000",
|
21986 | "value": "抚州市",
|
21987 | "children": [{
|
21988 | "key": "361002",
|
21989 | "value": "临川区"
|
21990 | }, {
|
21991 | "key": "361003",
|
21992 | "value": "东乡区"
|
21993 | }, {
|
21994 | "key": "361021",
|
21995 | "value": "南城县"
|
21996 | }, {
|
21997 | "key": "361022",
|
21998 | "value": "黎川县"
|
21999 | }, {
|
22000 | "key": "361023",
|
22001 | "value": "南丰县"
|
22002 | }, {
|
22003 | "key": "361024",
|
22004 | "value": "崇仁县"
|
22005 | }, {
|
22006 | "key": "361025",
|
22007 | "value": "乐安县"
|
22008 | }, {
|
22009 | "key": "361026",
|
22010 | "value": "宜黄县"
|
22011 | }, {
|
22012 | "key": "361027",
|
22013 | "value": "金溪县"
|
22014 | }, {
|
22015 | "key": "361028",
|
22016 | "value": "资溪县"
|
22017 | }, {
|
22018 | "key": "361030",
|
22019 | "value": "广昌县"
|
22020 | }]
|
22021 | }, {
|
22022 | "key": "361100",
|
22023 | "value": "上饶市",
|
22024 | "children": [{
|
22025 | "key": "361102",
|
22026 | "value": "信州区"
|
22027 | }, {
|
22028 | "key": "361103",
|
22029 | "value": "广丰区"
|
22030 | }, {
|
22031 | "key": "361121",
|
22032 | "value": "上饶县"
|
22033 | }, {
|
22034 | "key": "361123",
|
22035 | "value": "玉山县"
|
22036 | }, {
|
22037 | "key": "361124",
|
22038 | "value": "铅山县"
|
22039 | }, {
|
22040 | "key": "361125",
|
22041 | "value": "横峰县"
|
22042 | }, {
|
22043 | "key": "361126",
|
22044 | "value": "弋阳县"
|
22045 | }, {
|
22046 | "key": "361127",
|
22047 | "value": "余干县"
|
22048 | }, {
|
22049 | "key": "361128",
|
22050 | "value": "鄱阳县"
|
22051 | }, {
|
22052 | "key": "361129",
|
22053 | "value": "万年县"
|
22054 | }, {
|
22055 | "key": "361130",
|
22056 | "value": "婺源县"
|
22057 | }, {
|
22058 | "key": "361181",
|
22059 | "value": "德兴市"
|
22060 | }]
|
22061 | }]
|
22062 | }, {
|
22063 | "key": "370000",
|
22064 | "value": "山东",
|
22065 | "children": [{
|
22066 | "key": "370100",
|
22067 | "value": "济南市",
|
22068 | "children": [{
|
22069 | "key": "370102",
|
22070 | "value": "历下区"
|
22071 | }, {
|
22072 | "key": "370103",
|
22073 | "value": "市中区"
|
22074 | }, {
|
22075 | "key": "370104",
|
22076 | "value": "槐荫区"
|
22077 | }, {
|
22078 | "key": "370105",
|
22079 | "value": "天桥区"
|
22080 | }, {
|
22081 | "key": "370112",
|
22082 | "value": "历城区"
|
22083 | }, {
|
22084 | "key": "370113",
|
22085 | "value": "长清区"
|
22086 | }, {
|
22087 | "key": "370114",
|
22088 | "value": "章丘区"
|
22089 | }, {
|
22090 | "key": "370124",
|
22091 | "value": "平阴县"
|
22092 | }, {
|
22093 | "key": "370125",
|
22094 | "value": "济阳县"
|
22095 | }, {
|
22096 | "key": "370126",
|
22097 | "value": "商河县"
|
22098 | }]
|
22099 | }, {
|
22100 | "key": "370200",
|
22101 | "value": "青岛市",
|
22102 | "children": [{
|
22103 | "key": "370202",
|
22104 | "value": "市南区"
|
22105 | }, {
|
22106 | "key": "370203",
|
22107 | "value": "市北区"
|
22108 | }, {
|
22109 | "key": "370211",
|
22110 | "value": "黄岛区"
|
22111 | }, {
|
22112 | "key": "370212",
|
22113 | "value": "崂山区"
|
22114 | }, {
|
22115 | "key": "370213",
|
22116 | "value": "李沧区"
|
22117 | }, {
|
22118 | "key": "370214",
|
22119 | "value": "城阳区"
|
22120 | }, {
|
22121 | "key": "370215",
|
22122 | "value": "即墨区"
|
22123 | }, {
|
22124 | "key": "370281",
|
22125 | "value": "胶州市"
|
22126 | }, {
|
22127 | "key": "370283",
|
22128 | "value": "平度市"
|
22129 | }, {
|
22130 | "key": "370285",
|
22131 | "value": "莱西市"
|
22132 | }]
|
22133 | }, {
|
22134 | "key": "370300",
|
22135 | "value": "淄博市",
|
22136 | "children": [{
|
22137 | "key": "370302",
|
22138 | "value": "淄川区"
|
22139 | }, {
|
22140 | "key": "370303",
|
22141 | "value": "张店区"
|
22142 | }, {
|
22143 | "key": "370304",
|
22144 | "value": "博山区"
|
22145 | }, {
|
22146 | "key": "370305",
|
22147 | "value": "临淄区"
|
22148 | }, {
|
22149 | "key": "370306",
|
22150 | "value": "周村区"
|
22151 | }, {
|
22152 | "key": "370321",
|
22153 | "value": "桓台县"
|
22154 | }, {
|
22155 | "key": "370322",
|
22156 | "value": "高青县"
|
22157 | }, {
|
22158 | "key": "370323",
|
22159 | "value": "沂源县"
|
22160 | }]
|
22161 | }, {
|
22162 | "key": "370400",
|
22163 | "value": "枣庄市",
|
22164 | "children": [{
|
22165 | "key": "370402",
|
22166 | "value": "市中区"
|
22167 | }, {
|
22168 | "key": "370403",
|
22169 | "value": "薛城区"
|
22170 | }, {
|
22171 | "key": "370404",
|
22172 | "value": "峄城区"
|
22173 | }, {
|
22174 | "key": "370405",
|
22175 | "value": "台儿庄区"
|
22176 | }, {
|
22177 | "key": "370406",
|
22178 | "value": "山亭区"
|
22179 | }, {
|
22180 | "key": "370481",
|
22181 | "value": "滕州市"
|
22182 | }]
|
22183 | }, {
|
22184 | "key": "370500",
|
22185 | "value": "东营市",
|
22186 | "children": [{
|
22187 | "key": "370502",
|
22188 | "value": "东营区"
|
22189 | }, {
|
22190 | "key": "370503",
|
22191 | "value": "河口区"
|
22192 | }, {
|
22193 | "key": "370505",
|
22194 | "value": "垦利区"
|
22195 | }, {
|
22196 | "key": "370522",
|
22197 | "value": "利津县"
|
22198 | }, {
|
22199 | "key": "370523",
|
22200 | "value": "广饶县"
|
22201 | }]
|
22202 | }, {
|
22203 | "key": "370600",
|
22204 | "value": "烟台市",
|
22205 | "children": [{
|
22206 | "key": "370602",
|
22207 | "value": "芝罘区"
|
22208 | }, {
|
22209 | "key": "370611",
|
22210 | "value": "福山区"
|
22211 | }, {
|
22212 | "key": "370612",
|
22213 | "value": "牟平区"
|
22214 | }, {
|
22215 | "key": "370613",
|
22216 | "value": "莱山区"
|
22217 | }, {
|
22218 | "key": "370634",
|
22219 | "value": "长岛县"
|
22220 | }, {
|
22221 | "key": "370681",
|
22222 | "value": "龙口市"
|
22223 | }, {
|
22224 | "key": "370682",
|
22225 | "value": "莱阳市"
|
22226 | }, {
|
22227 | "key": "370683",
|
22228 | "value": "莱州市"
|
22229 | }, {
|
22230 | "key": "370684",
|
22231 | "value": "蓬莱市"
|
22232 | }, {
|
22233 | "key": "370685",
|
22234 | "value": "招远市"
|
22235 | }, {
|
22236 | "key": "370686",
|
22237 | "value": "栖霞市"
|
22238 | }, {
|
22239 | "key": "370687",
|
22240 | "value": "海阳市"
|
22241 | }]
|
22242 | }, {
|
22243 | "key": "370700",
|
22244 | "value": "潍坊市",
|
22245 | "children": [{
|
22246 | "key": "370702",
|
22247 | "value": "潍城区"
|
22248 | }, {
|
22249 | "key": "370703",
|
22250 | "value": "寒亭区"
|
22251 | }, {
|
22252 | "key": "370704",
|
22253 | "value": "坊子区"
|
22254 | }, {
|
22255 | "key": "370705",
|
22256 | "value": "奎文区"
|
22257 | }, {
|
22258 | "key": "370724",
|
22259 | "value": "临朐县"
|
22260 | }, {
|
22261 | "key": "370725",
|
22262 | "value": "昌乐县"
|
22263 | }, {
|
22264 | "key": "370781",
|
22265 | "value": "青州市"
|
22266 | }, {
|
22267 | "key": "370782",
|
22268 | "value": "诸城市"
|
22269 | }, {
|
22270 | "key": "370783",
|
22271 | "value": "寿光市"
|
22272 | }, {
|
22273 | "key": "370784",
|
22274 | "value": "安丘市"
|
22275 | }, {
|
22276 | "key": "370785",
|
22277 | "value": "高密市"
|
22278 | }, {
|
22279 | "key": "370786",
|
22280 | "value": "昌邑市"
|
22281 | }]
|
22282 | }, {
|
22283 | "key": "370800",
|
22284 | "value": "济宁市",
|
22285 | "children": [{
|
22286 | "key": "370811",
|
22287 | "value": "任城区"
|
22288 | }, {
|
22289 | "key": "370812",
|
22290 | "value": "兖州区"
|
22291 | }, {
|
22292 | "key": "370826",
|
22293 | "value": "微山县"
|
22294 | }, {
|
22295 | "key": "370827",
|
22296 | "value": "鱼台县"
|
22297 | }, {
|
22298 | "key": "370828",
|
22299 | "value": "金乡县"
|
22300 | }, {
|
22301 | "key": "370829",
|
22302 | "value": "嘉祥县"
|
22303 | }, {
|
22304 | "key": "370830",
|
22305 | "value": "汶上县"
|
22306 | }, {
|
22307 | "key": "370831",
|
22308 | "value": "泗水县"
|
22309 | }, {
|
22310 | "key": "370832",
|
22311 | "value": "梁山县"
|
22312 | }, {
|
22313 | "key": "370881",
|
22314 | "value": "曲阜市"
|
22315 | }, {
|
22316 | "key": "370883",
|
22317 | "value": "邹城市"
|
22318 | }]
|
22319 | }, {
|
22320 | "key": "370900",
|
22321 | "value": "泰安市",
|
22322 | "children": [{
|
22323 | "key": "370902",
|
22324 | "value": "泰山区"
|
22325 | }, {
|
22326 | "key": "370911",
|
22327 | "value": "岱岳区"
|
22328 | }, {
|
22329 | "key": "370921",
|
22330 | "value": "宁阳县"
|
22331 | }, {
|
22332 | "key": "370923",
|
22333 | "value": "东平县"
|
22334 | }, {
|
22335 | "key": "370982",
|
22336 | "value": "新泰市"
|
22337 | }, {
|
22338 | "key": "370983",
|
22339 | "value": "肥城市"
|
22340 | }]
|
22341 | }, {
|
22342 | "key": "371000",
|
22343 | "value": "威海市",
|
22344 | "children": [{
|
22345 | "key": "371002",
|
22346 | "value": "环翠区"
|
22347 | }, {
|
22348 | "key": "371003",
|
22349 | "value": "文登区"
|
22350 | }, {
|
22351 | "key": "371082",
|
22352 | "value": "荣成市"
|
22353 | }, {
|
22354 | "key": "371083",
|
22355 | "value": "乳山市"
|
22356 | }]
|
22357 | }, {
|
22358 | "key": "371100",
|
22359 | "value": "日照市",
|
22360 | "children": [{
|
22361 | "key": "371102",
|
22362 | "value": "东港区"
|
22363 | }, {
|
22364 | "key": "371103",
|
22365 | "value": "岚山区"
|
22366 | }, {
|
22367 | "key": "371121",
|
22368 | "value": "五莲县"
|
22369 | }, {
|
22370 | "key": "371122",
|
22371 | "value": "莒县"
|
22372 | }]
|
22373 | }, {
|
22374 | "key": "371200",
|
22375 | "value": "莱芜市",
|
22376 | "children": [{
|
22377 | "key": "371202",
|
22378 | "value": "莱城区"
|
22379 | }, {
|
22380 | "key": "371203",
|
22381 | "value": "钢城区"
|
22382 | }]
|
22383 | }, {
|
22384 | "key": "371300",
|
22385 | "value": "临沂市",
|
22386 | "children": [{
|
22387 | "key": "371302",
|
22388 | "value": "兰山区"
|
22389 | }, {
|
22390 | "key": "371311",
|
22391 | "value": "罗庄区"
|
22392 | }, {
|
22393 | "key": "371312",
|
22394 | "value": "河东区"
|
22395 | }, {
|
22396 | "key": "371321",
|
22397 | "value": "沂南县"
|
22398 | }, {
|
22399 | "key": "371322",
|
22400 | "value": "郯城县"
|
22401 | }, {
|
22402 | "key": "371323",
|
22403 | "value": "沂水县"
|
22404 | }, {
|
22405 | "key": "371324",
|
22406 | "value": "苍山县"
|
22407 | }, {
|
22408 | "key": "371325",
|
22409 | "value": "费县"
|
22410 | }, {
|
22411 | "key": "371326",
|
22412 | "value": "平邑县"
|
22413 | }, {
|
22414 | "key": "371327",
|
22415 | "value": "莒南县"
|
22416 | }, {
|
22417 | "key": "371328",
|
22418 | "value": "蒙阴县"
|
22419 | }, {
|
22420 | "key": "371329",
|
22421 | "value": "临沭县"
|
22422 | }]
|
22423 | }, {
|
22424 | "key": "371400",
|
22425 | "value": "德州市",
|
22426 | "children": [{
|
22427 | "key": "371402",
|
22428 | "value": "德城区"
|
22429 | }, {
|
22430 | "key": "371403",
|
22431 | "value": "陵城区"
|
22432 | }, {
|
22433 | "key": "371422",
|
22434 | "value": "宁津县"
|
22435 | }, {
|
22436 | "key": "371423",
|
22437 | "value": "庆云县"
|
22438 | }, {
|
22439 | "key": "371424",
|
22440 | "value": "临邑县"
|
22441 | }, {
|
22442 | "key": "371425",
|
22443 | "value": "齐河县"
|
22444 | }, {
|
22445 | "key": "371426",
|
22446 | "value": "平原县"
|
22447 | }, {
|
22448 | "key": "371427",
|
22449 | "value": "夏津县"
|
22450 | }, {
|
22451 | "key": "371428",
|
22452 | "value": "武城县"
|
22453 | }, {
|
22454 | "key": "371481",
|
22455 | "value": "乐陵市"
|
22456 | }, {
|
22457 | "key": "371482",
|
22458 | "value": "禹城市"
|
22459 | }]
|
22460 | }, {
|
22461 | "key": "371500",
|
22462 | "value": "聊城市",
|
22463 | "children": [{
|
22464 | "key": "371502",
|
22465 | "value": "东昌府区"
|
22466 | }, {
|
22467 | "key": "371521",
|
22468 | "value": "阳谷县"
|
22469 | }, {
|
22470 | "key": "371522",
|
22471 | "value": "莘县"
|
22472 | }, {
|
22473 | "key": "371523",
|
22474 | "value": "茌平县"
|
22475 | }, {
|
22476 | "key": "371524",
|
22477 | "value": "东阿县"
|
22478 | }, {
|
22479 | "key": "371525",
|
22480 | "value": "冠县"
|
22481 | }, {
|
22482 | "key": "371526",
|
22483 | "value": "高唐县"
|
22484 | }, {
|
22485 | "key": "371581",
|
22486 | "value": "临清市"
|
22487 | }]
|
22488 | }, {
|
22489 | "key": "371600",
|
22490 | "value": "滨州市",
|
22491 | "children": [{
|
22492 | "key": "371602",
|
22493 | "value": "滨城区"
|
22494 | }, {
|
22495 | "key": "371603",
|
22496 | "value": "沾化区"
|
22497 | }, {
|
22498 | "key": "371621",
|
22499 | "value": "惠民县"
|
22500 | }, {
|
22501 | "key": "371622",
|
22502 | "value": "阳信县"
|
22503 | }, {
|
22504 | "key": "371623",
|
22505 | "value": "无棣县"
|
22506 | }, {
|
22507 | "key": "371625",
|
22508 | "value": "博兴县"
|
22509 | }, {
|
22510 | "key": "371626",
|
22511 | "value": "邹平县"
|
22512 | }]
|
22513 | }, {
|
22514 | "key": "371700",
|
22515 | "value": "菏泽市",
|
22516 | "children": [{
|
22517 | "key": "371702",
|
22518 | "value": "牡丹区"
|
22519 | }, {
|
22520 | "key": "371703",
|
22521 | "value": "定陶区"
|
22522 | }, {
|
22523 | "key": "371721",
|
22524 | "value": "曹县"
|
22525 | }, {
|
22526 | "key": "371722",
|
22527 | "value": "单县"
|
22528 | }, {
|
22529 | "key": "371723",
|
22530 | "value": "成武县"
|
22531 | }, {
|
22532 | "key": "371724",
|
22533 | "value": "巨野县"
|
22534 | }, {
|
22535 | "key": "371725",
|
22536 | "value": "郓城县"
|
22537 | }, {
|
22538 | "key": "371726",
|
22539 | "value": "鄄城县"
|
22540 | }, {
|
22541 | "key": "371728",
|
22542 | "value": "东明县"
|
22543 | }]
|
22544 | }]
|
22545 | }, {
|
22546 | "key": "410000",
|
22547 | "value": "河南",
|
22548 | "children": [{
|
22549 | "key": "410100",
|
22550 | "value": "郑州市",
|
22551 | "children": [{
|
22552 | "key": "410102",
|
22553 | "value": "中原区"
|
22554 | }, {
|
22555 | "key": "410103",
|
22556 | "value": "二七区"
|
22557 | }, {
|
22558 | "key": "410104",
|
22559 | "value": "管城回族区"
|
22560 | }, {
|
22561 | "key": "410105",
|
22562 | "value": "金水区"
|
22563 | }, {
|
22564 | "key": "410106",
|
22565 | "value": "上街区"
|
22566 | }, {
|
22567 | "key": "410108",
|
22568 | "value": "惠济区"
|
22569 | }, {
|
22570 | "key": "410122",
|
22571 | "value": "中牟县"
|
22572 | }, {
|
22573 | "key": "410181",
|
22574 | "value": "巩义市"
|
22575 | }, {
|
22576 | "key": "410182",
|
22577 | "value": "荥阳市"
|
22578 | }, {
|
22579 | "key": "410183",
|
22580 | "value": "新密市"
|
22581 | }, {
|
22582 | "key": "410184",
|
22583 | "value": "新郑市"
|
22584 | }, {
|
22585 | "key": "410185",
|
22586 | "value": "登封市"
|
22587 | }]
|
22588 | }, {
|
22589 | "key": "410200",
|
22590 | "value": "开封市",
|
22591 | "children": [{
|
22592 | "key": "410202",
|
22593 | "value": "龙亭区"
|
22594 | }, {
|
22595 | "key": "410203",
|
22596 | "value": "顺河回族区"
|
22597 | }, {
|
22598 | "key": "410204",
|
22599 | "value": "鼓楼区"
|
22600 | }, {
|
22601 | "key": "410205",
|
22602 | "value": "禹王台区"
|
22603 | }, {
|
22604 | "key": "410212",
|
22605 | "value": "祥符区"
|
22606 | }, {
|
22607 | "key": "410221",
|
22608 | "value": "杞县"
|
22609 | }, {
|
22610 | "key": "410222",
|
22611 | "value": "通许县"
|
22612 | }, {
|
22613 | "key": "410223",
|
22614 | "value": "尉氏县"
|
22615 | }, {
|
22616 | "key": "410225",
|
22617 | "value": "兰考县"
|
22618 | }]
|
22619 | }, {
|
22620 | "key": "410300",
|
22621 | "value": "洛阳市",
|
22622 | "children": [{
|
22623 | "key": "410302",
|
22624 | "value": "老城区"
|
22625 | }, {
|
22626 | "key": "410303",
|
22627 | "value": "西工区"
|
22628 | }, {
|
22629 | "key": "410304",
|
22630 | "value": "瀍河回族区"
|
22631 | }, {
|
22632 | "key": "410305",
|
22633 | "value": "涧西区"
|
22634 | }, {
|
22635 | "key": "410306",
|
22636 | "value": "吉利区"
|
22637 | }, {
|
22638 | "key": "410311",
|
22639 | "value": "洛龙区"
|
22640 | }, {
|
22641 | "key": "410322",
|
22642 | "value": "孟津县"
|
22643 | }, {
|
22644 | "key": "410323",
|
22645 | "value": "新安县"
|
22646 | }, {
|
22647 | "key": "410324",
|
22648 | "value": "栾川县"
|
22649 | }, {
|
22650 | "key": "410325",
|
22651 | "value": "嵩县"
|
22652 | }, {
|
22653 | "key": "410326",
|
22654 | "value": "汝阳县"
|
22655 | }, {
|
22656 | "key": "410327",
|
22657 | "value": "宜阳县"
|
22658 | }, {
|
22659 | "key": "410328",
|
22660 | "value": "洛宁县"
|
22661 | }, {
|
22662 | "key": "410329",
|
22663 | "value": "伊川县"
|
22664 | }, {
|
22665 | "key": "410381",
|
22666 | "value": "偃师市"
|
22667 | }]
|
22668 | }, {
|
22669 | "key": "410400",
|
22670 | "value": "平顶山市",
|
22671 | "children": [{
|
22672 | "key": "410402",
|
22673 | "value": "新华区"
|
22674 | }, {
|
22675 | "key": "410403",
|
22676 | "value": "卫东区"
|
22677 | }, {
|
22678 | "key": "410404",
|
22679 | "value": "石龙区"
|
22680 | }, {
|
22681 | "key": "410411",
|
22682 | "value": "湛河区"
|
22683 | }, {
|
22684 | "key": "410421",
|
22685 | "value": "宝丰县"
|
22686 | }, {
|
22687 | "key": "410422",
|
22688 | "value": "叶县"
|
22689 | }, {
|
22690 | "key": "410423",
|
22691 | "value": "鲁山县"
|
22692 | }, {
|
22693 | "key": "410425",
|
22694 | "value": "郏县"
|
22695 | }, {
|
22696 | "key": "410481",
|
22697 | "value": "舞钢市"
|
22698 | }, {
|
22699 | "key": "410482",
|
22700 | "value": "汝州市"
|
22701 | }]
|
22702 | }, {
|
22703 | "key": "410500",
|
22704 | "value": "安阳市",
|
22705 | "children": [{
|
22706 | "key": "410502",
|
22707 | "value": "文峰区"
|
22708 | }, {
|
22709 | "key": "410503",
|
22710 | "value": "北关区"
|
22711 | }, {
|
22712 | "key": "410505",
|
22713 | "value": "殷都区"
|
22714 | }, {
|
22715 | "key": "410506",
|
22716 | "value": "龙安区"
|
22717 | }, {
|
22718 | "key": "410522",
|
22719 | "value": "安阳县"
|
22720 | }, {
|
22721 | "key": "410523",
|
22722 | "value": "汤阴县"
|
22723 | }, {
|
22724 | "key": "410526",
|
22725 | "value": "滑县"
|
22726 | }, {
|
22727 | "key": "410527",
|
22728 | "value": "内黄县"
|
22729 | }, {
|
22730 | "key": "410581",
|
22731 | "value": "林州市"
|
22732 | }]
|
22733 | }, {
|
22734 | "key": "410600",
|
22735 | "value": "鹤壁市",
|
22736 | "children": [{
|
22737 | "key": "410602",
|
22738 | "value": "鹤山区"
|
22739 | }, {
|
22740 | "key": "410603",
|
22741 | "value": "山城区"
|
22742 | }, {
|
22743 | "key": "410611",
|
22744 | "value": "淇滨区"
|
22745 | }, {
|
22746 | "key": "410621",
|
22747 | "value": "浚县"
|
22748 | }, {
|
22749 | "key": "410622",
|
22750 | "value": "淇县"
|
22751 | }]
|
22752 | }, {
|
22753 | "key": "410700",
|
22754 | "value": "新乡市",
|
22755 | "children": [{
|
22756 | "key": "410702",
|
22757 | "value": "红旗区"
|
22758 | }, {
|
22759 | "key": "410703",
|
22760 | "value": "卫滨区"
|
22761 | }, {
|
22762 | "key": "410704",
|
22763 | "value": "凤泉区"
|
22764 | }, {
|
22765 | "key": "410711",
|
22766 | "value": "牧野区"
|
22767 | }, {
|
22768 | "key": "410721",
|
22769 | "value": "新乡县"
|
22770 | }, {
|
22771 | "key": "410724",
|
22772 | "value": "获嘉县"
|
22773 | }, {
|
22774 | "key": "410725",
|
22775 | "value": "原阳县"
|
22776 | }, {
|
22777 | "key": "410726",
|
22778 | "value": "延津县"
|
22779 | }, {
|
22780 | "key": "410727",
|
22781 | "value": "封丘县"
|
22782 | }, {
|
22783 | "key": "410728",
|
22784 | "value": "长垣县"
|
22785 | }, {
|
22786 | "key": "410781",
|
22787 | "value": "卫辉市"
|
22788 | }, {
|
22789 | "key": "410782",
|
22790 | "value": "辉县市"
|
22791 | }]
|
22792 | }, {
|
22793 | "key": "410800",
|
22794 | "value": "焦作市",
|
22795 | "children": [{
|
22796 | "key": "410802",
|
22797 | "value": "解放区"
|
22798 | }, {
|
22799 | "key": "410803",
|
22800 | "value": "中站区"
|
22801 | }, {
|
22802 | "key": "410804",
|
22803 | "value": "马村区"
|
22804 | }, {
|
22805 | "key": "410811",
|
22806 | "value": "山阳区"
|
22807 | }, {
|
22808 | "key": "410821",
|
22809 | "value": "修武县"
|
22810 | }, {
|
22811 | "key": "410822",
|
22812 | "value": "博爱县"
|
22813 | }, {
|
22814 | "key": "410823",
|
22815 | "value": "武陟县"
|
22816 | }, {
|
22817 | "key": "410825",
|
22818 | "value": "温县"
|
22819 | }, {
|
22820 | "key": "410882",
|
22821 | "value": "沁阳市"
|
22822 | }, {
|
22823 | "key": "410883",
|
22824 | "value": "孟州市"
|
22825 | }]
|
22826 | }, {
|
22827 | "key": "410900",
|
22828 | "value": "濮阳市",
|
22829 | "children": [{
|
22830 | "key": "410902",
|
22831 | "value": "华龙区"
|
22832 | }, {
|
22833 | "key": "410922",
|
22834 | "value": "清丰县"
|
22835 | }, {
|
22836 | "key": "410923",
|
22837 | "value": "南乐县"
|
22838 | }, {
|
22839 | "key": "410926",
|
22840 | "value": "范县"
|
22841 | }, {
|
22842 | "key": "410927",
|
22843 | "value": "台前县"
|
22844 | }, {
|
22845 | "key": "410928",
|
22846 | "value": "濮阳县"
|
22847 | }]
|
22848 | }, {
|
22849 | "key": "411000",
|
22850 | "value": "许昌市",
|
22851 | "children": [{
|
22852 | "key": "411002",
|
22853 | "value": "魏都区"
|
22854 | }, {
|
22855 | "key": "411003",
|
22856 | "value": "建安区"
|
22857 | }, {
|
22858 | "key": "411024",
|
22859 | "value": "鄢陵县"
|
22860 | }, {
|
22861 | "key": "411025",
|
22862 | "value": "襄城县"
|
22863 | }, {
|
22864 | "key": "411081",
|
22865 | "value": "禹州市"
|
22866 | }, {
|
22867 | "key": "411082",
|
22868 | "value": "长葛市"
|
22869 | }]
|
22870 | }, {
|
22871 | "key": "411100",
|
22872 | "value": "漯河市",
|
22873 | "children": [{
|
22874 | "key": "411102",
|
22875 | "value": "源汇区"
|
22876 | }, {
|
22877 | "key": "411103",
|
22878 | "value": "郾城区"
|
22879 | }, {
|
22880 | "key": "411104",
|
22881 | "value": "召陵区"
|
22882 | }, {
|
22883 | "key": "411121",
|
22884 | "value": "舞阳县"
|
22885 | }, {
|
22886 | "key": "411122",
|
22887 | "value": "临颍县"
|
22888 | }]
|
22889 | }, {
|
22890 | "key": "411200",
|
22891 | "value": "三门峡市",
|
22892 | "children": [{
|
22893 | "key": "411202",
|
22894 | "value": "湖滨区"
|
22895 | }, {
|
22896 | "key": "411203",
|
22897 | "value": "陕州区"
|
22898 | }, {
|
22899 | "key": "411221",
|
22900 | "value": "渑池县"
|
22901 | }, {
|
22902 | "key": "411224",
|
22903 | "value": "卢氏县"
|
22904 | }, {
|
22905 | "key": "411281",
|
22906 | "value": "义马市"
|
22907 | }, {
|
22908 | "key": "411282",
|
22909 | "value": "灵宝市"
|
22910 | }]
|
22911 | }, {
|
22912 | "key": "411300",
|
22913 | "value": "南阳市",
|
22914 | "children": [{
|
22915 | "key": "411302",
|
22916 | "value": "宛城区"
|
22917 | }, {
|
22918 | "key": "411303",
|
22919 | "value": "卧龙区"
|
22920 | }, {
|
22921 | "key": "411321",
|
22922 | "value": "南召县"
|
22923 | }, {
|
22924 | "key": "411322",
|
22925 | "value": "方城县"
|
22926 | }, {
|
22927 | "key": "411323",
|
22928 | "value": "西峡县"
|
22929 | }, {
|
22930 | "key": "411324",
|
22931 | "value": "镇平县"
|
22932 | }, {
|
22933 | "key": "411325",
|
22934 | "value": "内乡县"
|
22935 | }, {
|
22936 | "key": "411326",
|
22937 | "value": "淅川县"
|
22938 | }, {
|
22939 | "key": "411327",
|
22940 | "value": "社旗县"
|
22941 | }, {
|
22942 | "key": "411328",
|
22943 | "value": "唐河县"
|
22944 | }, {
|
22945 | "key": "411329",
|
22946 | "value": "新野县"
|
22947 | }, {
|
22948 | "key": "411330",
|
22949 | "value": "桐柏县"
|
22950 | }, {
|
22951 | "key": "411381",
|
22952 | "value": "邓州市"
|
22953 | }]
|
22954 | }, {
|
22955 | "key": "411400",
|
22956 | "value": "商丘市",
|
22957 | "children": [{
|
22958 | "key": "411402",
|
22959 | "value": "梁园区"
|
22960 | }, {
|
22961 | "key": "411403",
|
22962 | "value": "睢阳区"
|
22963 | }, {
|
22964 | "key": "411421",
|
22965 | "value": "民权县"
|
22966 | }, {
|
22967 | "key": "411422",
|
22968 | "value": "睢县"
|
22969 | }, {
|
22970 | "key": "411423",
|
22971 | "value": "宁陵县"
|
22972 | }, {
|
22973 | "key": "411424",
|
22974 | "value": "柘城县"
|
22975 | }, {
|
22976 | "key": "411425",
|
22977 | "value": "虞城县"
|
22978 | }, {
|
22979 | "key": "411426",
|
22980 | "value": "夏邑县"
|
22981 | }, {
|
22982 | "key": "411481",
|
22983 | "value": "永城市"
|
22984 | }]
|
22985 | }, {
|
22986 | "key": "411500",
|
22987 | "value": "信阳市",
|
22988 | "children": [{
|
22989 | "key": "411502",
|
22990 | "value": "浉河区"
|
22991 | }, {
|
22992 | "key": "411503",
|
22993 | "value": "平桥区"
|
22994 | }, {
|
22995 | "key": "411521",
|
22996 | "value": "罗山县"
|
22997 | }, {
|
22998 | "key": "411522",
|
22999 | "value": "光山县"
|
23000 | }, {
|
23001 | "key": "411523",
|
23002 | "value": "新县"
|
23003 | }, {
|
23004 | "key": "411524",
|
23005 | "value": "商城县"
|
23006 | }, {
|
23007 | "key": "411525",
|
23008 | "value": "固始县"
|
23009 | }, {
|
23010 | "key": "411526",
|
23011 | "value": "潢川县"
|
23012 | }, {
|
23013 | "key": "411527",
|
23014 | "value": "淮滨县"
|
23015 | }, {
|
23016 | "key": "411528",
|
23017 | "value": "息县"
|
23018 | }]
|
23019 | }, {
|
23020 | "key": "411600",
|
23021 | "value": "周口市",
|
23022 | "children": [{
|
23023 | "key": "411602",
|
23024 | "value": "川汇区"
|
23025 | }, {
|
23026 | "key": "411621",
|
23027 | "value": "扶沟县"
|
23028 | }, {
|
23029 | "key": "411622",
|
23030 | "value": "西华县"
|
23031 | }, {
|
23032 | "key": "411623",
|
23033 | "value": "商水县"
|
23034 | }, {
|
23035 | "key": "411624",
|
23036 | "value": "沈丘县"
|
23037 | }, {
|
23038 | "key": "411625",
|
23039 | "value": "郸城县"
|
23040 | }, {
|
23041 | "key": "411626",
|
23042 | "value": "淮阳县"
|
23043 | }, {
|
23044 | "key": "411627",
|
23045 | "value": "太康县"
|
23046 | }, {
|
23047 | "key": "411628",
|
23048 | "value": "鹿邑县"
|
23049 | }, {
|
23050 | "key": "411681",
|
23051 | "value": "项城市"
|
23052 | }]
|
23053 | }, {
|
23054 | "key": "411700",
|
23055 | "value": "驻马店市",
|
23056 | "children": [{
|
23057 | "key": "411702",
|
23058 | "value": "驿城区"
|
23059 | }, {
|
23060 | "key": "411721",
|
23061 | "value": "西平县"
|
23062 | }, {
|
23063 | "key": "411722",
|
23064 | "value": "上蔡县"
|
23065 | }, {
|
23066 | "key": "411723",
|
23067 | "value": "平舆县"
|
23068 | }, {
|
23069 | "key": "411724",
|
23070 | "value": "正阳县"
|
23071 | }, {
|
23072 | "key": "411725",
|
23073 | "value": "确山县"
|
23074 | }, {
|
23075 | "key": "411726",
|
23076 | "value": "泌阳县"
|
23077 | }, {
|
23078 | "key": "411727",
|
23079 | "value": "汝南县"
|
23080 | }, {
|
23081 | "key": "411728",
|
23082 | "value": "遂平县"
|
23083 | }, {
|
23084 | "key": "411729",
|
23085 | "value": "新蔡县"
|
23086 | }]
|
23087 | }, {
|
23088 | "key": "419001",
|
23089 | "value": "济源市"
|
23090 | }]
|
23091 | }, {
|
23092 | "key": "420000",
|
23093 | "value": "湖北",
|
23094 | "children": [{
|
23095 | "key": "420100",
|
23096 | "value": "武汉市",
|
23097 | "children": [{
|
23098 | "key": "420102",
|
23099 | "value": "江岸区"
|
23100 | }, {
|
23101 | "key": "420103",
|
23102 | "value": "江汉区"
|
23103 | }, {
|
23104 | "key": "420104",
|
23105 | "value": "硚口区"
|
23106 | }, {
|
23107 | "key": "420105",
|
23108 | "value": "汉阳区"
|
23109 | }, {
|
23110 | "key": "420106",
|
23111 | "value": "武昌区"
|
23112 | }, {
|
23113 | "key": "420107",
|
23114 | "value": "青山区"
|
23115 | }, {
|
23116 | "key": "420111",
|
23117 | "value": "洪山区"
|
23118 | }, {
|
23119 | "key": "420112",
|
23120 | "value": "东西湖区"
|
23121 | }, {
|
23122 | "key": "420113",
|
23123 | "value": "汉南区"
|
23124 | }, {
|
23125 | "key": "420114",
|
23126 | "value": "蔡甸区"
|
23127 | }, {
|
23128 | "key": "420115",
|
23129 | "value": "江夏区"
|
23130 | }, {
|
23131 | "key": "420116",
|
23132 | "value": "黄陂区"
|
23133 | }, {
|
23134 | "key": "420117",
|
23135 | "value": "新洲区"
|
23136 | }]
|
23137 | }, {
|
23138 | "key": "420200",
|
23139 | "value": "黄石市",
|
23140 | "children": [{
|
23141 | "key": "420202",
|
23142 | "value": "黄石港区"
|
23143 | }, {
|
23144 | "key": "420203",
|
23145 | "value": "西塞山区"
|
23146 | }, {
|
23147 | "key": "420204",
|
23148 | "value": "下陆区"
|
23149 | }, {
|
23150 | "key": "420205",
|
23151 | "value": "铁山区"
|
23152 | }, {
|
23153 | "key": "420222",
|
23154 | "value": "阳新县"
|
23155 | }, {
|
23156 | "key": "420281",
|
23157 | "value": "大冶市"
|
23158 | }]
|
23159 | }, {
|
23160 | "key": "420300",
|
23161 | "value": "十堰市",
|
23162 | "children": [{
|
23163 | "key": "420302",
|
23164 | "value": "茅箭区"
|
23165 | }, {
|
23166 | "key": "420303",
|
23167 | "value": "张湾区"
|
23168 | }, {
|
23169 | "key": "420304",
|
23170 | "value": "郧阳区"
|
23171 | }, {
|
23172 | "key": "420322",
|
23173 | "value": "郧西县"
|
23174 | }, {
|
23175 | "key": "420323",
|
23176 | "value": "竹山县"
|
23177 | }, {
|
23178 | "key": "420324",
|
23179 | "value": "竹溪县"
|
23180 | }, {
|
23181 | "key": "420325",
|
23182 | "value": "房县"
|
23183 | }, {
|
23184 | "key": "420381",
|
23185 | "value": "丹江口市"
|
23186 | }]
|
23187 | }, {
|
23188 | "key": "420500",
|
23189 | "value": "宜昌市",
|
23190 | "children": [{
|
23191 | "key": "420502",
|
23192 | "value": "西陵区"
|
23193 | }, {
|
23194 | "key": "420503",
|
23195 | "value": "伍家岗区"
|
23196 | }, {
|
23197 | "key": "420504",
|
23198 | "value": "点军区"
|
23199 | }, {
|
23200 | "key": "420505",
|
23201 | "value": "猇亭区"
|
23202 | }, {
|
23203 | "key": "420506",
|
23204 | "value": "夷陵区"
|
23205 | }, {
|
23206 | "key": "420525",
|
23207 | "value": "远安县"
|
23208 | }, {
|
23209 | "key": "420526",
|
23210 | "value": "兴山县"
|
23211 | }, {
|
23212 | "key": "420527",
|
23213 | "value": "秭归县"
|
23214 | }, {
|
23215 | "key": "420528",
|
23216 | "value": "长阳土家族自治县"
|
23217 | }, {
|
23218 | "key": "420529",
|
23219 | "value": "五峰土家族自治县"
|
23220 | }, {
|
23221 | "key": "420581",
|
23222 | "value": "宜都市"
|
23223 | }, {
|
23224 | "key": "420582",
|
23225 | "value": "当阳市"
|
23226 | }, {
|
23227 | "key": "420583",
|
23228 | "value": "枝江市"
|
23229 | }]
|
23230 | }, {
|
23231 | "key": "420600",
|
23232 | "value": "襄阳市",
|
23233 | "children": [{
|
23234 | "key": "420602",
|
23235 | "value": "襄城区"
|
23236 | }, {
|
23237 | "key": "420606",
|
23238 | "value": "樊城区"
|
23239 | }, {
|
23240 | "key": "420607",
|
23241 | "value": "襄州区"
|
23242 | }, {
|
23243 | "key": "420624",
|
23244 | "value": "南漳县"
|
23245 | }, {
|
23246 | "key": "420625",
|
23247 | "value": "谷城县"
|
23248 | }, {
|
23249 | "key": "420626",
|
23250 | "value": "保康县"
|
23251 | }, {
|
23252 | "key": "420682",
|
23253 | "value": "老河口市"
|
23254 | }, {
|
23255 | "key": "420683",
|
23256 | "value": "枣阳市"
|
23257 | }, {
|
23258 | "key": "420684",
|
23259 | "value": "宜城市"
|
23260 | }]
|
23261 | }, {
|
23262 | "key": "420700",
|
23263 | "value": "鄂州市",
|
23264 | "children": [{
|
23265 | "key": "420702",
|
23266 | "value": "梁子湖区"
|
23267 | }, {
|
23268 | "key": "420703",
|
23269 | "value": "华容区"
|
23270 | }, {
|
23271 | "key": "420704",
|
23272 | "value": "鄂城区"
|
23273 | }]
|
23274 | }, {
|
23275 | "key": "420800",
|
23276 | "value": "荆门市",
|
23277 | "children": [{
|
23278 | "key": "420802",
|
23279 | "value": "东宝区"
|
23280 | }, {
|
23281 | "key": "420804",
|
23282 | "value": "掇刀区"
|
23283 | }, {
|
23284 | "key": "420822",
|
23285 | "value": "沙洋县"
|
23286 | }, {
|
23287 | "key": "420881",
|
23288 | "value": "钟祥市"
|
23289 | }, {
|
23290 | "key": "420882",
|
23291 | "value": "京山市"
|
23292 | }]
|
23293 | }, {
|
23294 | "key": "420900",
|
23295 | "value": "孝感市",
|
23296 | "children": [{
|
23297 | "key": "420902",
|
23298 | "value": "孝南区"
|
23299 | }, {
|
23300 | "key": "420921",
|
23301 | "value": "孝昌县"
|
23302 | }, {
|
23303 | "key": "420922",
|
23304 | "value": "大悟县"
|
23305 | }, {
|
23306 | "key": "420923",
|
23307 | "value": "云梦县"
|
23308 | }, {
|
23309 | "key": "420981",
|
23310 | "value": "应城市"
|
23311 | }, {
|
23312 | "key": "420982",
|
23313 | "value": "安陆市"
|
23314 | }, {
|
23315 | "key": "420984",
|
23316 | "value": "汉川市"
|
23317 | }]
|
23318 | }, {
|
23319 | "key": "421000",
|
23320 | "value": "荆州市",
|
23321 | "children": [{
|
23322 | "key": "421002",
|
23323 | "value": "沙市区"
|
23324 | }, {
|
23325 | "key": "421003",
|
23326 | "value": "荆州区"
|
23327 | }, {
|
23328 | "key": "421022",
|
23329 | "value": "公安县"
|
23330 | }, {
|
23331 | "key": "421023",
|
23332 | "value": "监利县"
|
23333 | }, {
|
23334 | "key": "421024",
|
23335 | "value": "江陵县"
|
23336 | }, {
|
23337 | "key": "421081",
|
23338 | "value": "石首市"
|
23339 | }, {
|
23340 | "key": "421083",
|
23341 | "value": "洪湖市"
|
23342 | }, {
|
23343 | "key": "421087",
|
23344 | "value": "松滋市"
|
23345 | }]
|
23346 | }, {
|
23347 | "key": "421100",
|
23348 | "value": "黄冈市",
|
23349 | "children": [{
|
23350 | "key": "421102",
|
23351 | "value": "黄州区"
|
23352 | }, {
|
23353 | "key": "421121",
|
23354 | "value": "团风县"
|
23355 | }, {
|
23356 | "key": "421122",
|
23357 | "value": "红安县"
|
23358 | }, {
|
23359 | "key": "421123",
|
23360 | "value": "罗田县"
|
23361 | }, {
|
23362 | "key": "421124",
|
23363 | "value": "英山县"
|
23364 | }, {
|
23365 | "key": "421125",
|
23366 | "value": "浠水县"
|
23367 | }, {
|
23368 | "key": "421126",
|
23369 | "value": "蕲春县"
|
23370 | }, {
|
23371 | "key": "421127",
|
23372 | "value": "黄梅县"
|
23373 | }, {
|
23374 | "key": "421181",
|
23375 | "value": "麻城市"
|
23376 | }, {
|
23377 | "key": "421182",
|
23378 | "value": "武穴市"
|
23379 | }]
|
23380 | }, {
|
23381 | "key": "421200",
|
23382 | "value": "咸宁市",
|
23383 | "children": [{
|
23384 | "key": "421202",
|
23385 | "value": "咸安区"
|
23386 | }, {
|
23387 | "key": "421221",
|
23388 | "value": "嘉鱼县"
|
23389 | }, {
|
23390 | "key": "421222",
|
23391 | "value": "通城县"
|
23392 | }, {
|
23393 | "key": "421223",
|
23394 | "value": "崇阳县"
|
23395 | }, {
|
23396 | "key": "421224",
|
23397 | "value": "通山县"
|
23398 | }, {
|
23399 | "key": "421281",
|
23400 | "value": "赤壁市"
|
23401 | }]
|
23402 | }, {
|
23403 | "key": "421300",
|
23404 | "value": "随州市",
|
23405 | "children": [{
|
23406 | "key": "421303",
|
23407 | "value": "曾都区"
|
23408 | }, {
|
23409 | "key": "421321",
|
23410 | "value": "随县"
|
23411 | }, {
|
23412 | "key": "421381",
|
23413 | "value": "广水市"
|
23414 | }]
|
23415 | }, {
|
23416 | "key": "422800",
|
23417 | "value": "恩施土家族苗族自治州",
|
23418 | "children": [{
|
23419 | "key": "422801",
|
23420 | "value": "恩施市"
|
23421 | }, {
|
23422 | "key": "422802",
|
23423 | "value": "利川市"
|
23424 | }, {
|
23425 | "key": "422822",
|
23426 | "value": "建始县"
|
23427 | }, {
|
23428 | "key": "422823",
|
23429 | "value": "巴东县"
|
23430 | }, {
|
23431 | "key": "422825",
|
23432 | "value": "宣恩县"
|
23433 | }, {
|
23434 | "key": "422826",
|
23435 | "value": "咸丰县"
|
23436 | }, {
|
23437 | "key": "422827",
|
23438 | "value": "来凤县"
|
23439 | }, {
|
23440 | "key": "422828",
|
23441 | "value": "鹤峰县"
|
23442 | }]
|
23443 | }, {
|
23444 | "key": "429004",
|
23445 | "value": "仙桃市"
|
23446 | }, {
|
23447 | "key": "429005",
|
23448 | "value": "潜江市"
|
23449 | }, {
|
23450 | "key": "429006",
|
23451 | "value": "天门市"
|
23452 | }, {
|
23453 | "key": "429021",
|
23454 | "value": "神农架林区"
|
23455 | }]
|
23456 | }, {
|
23457 | "key": "430000",
|
23458 | "value": "湖南",
|
23459 | "children": [{
|
23460 | "key": "430100",
|
23461 | "value": "长沙市",
|
23462 | "children": [{
|
23463 | "key": "430102",
|
23464 | "value": "芙蓉区"
|
23465 | }, {
|
23466 | "key": "430103",
|
23467 | "value": "天心区"
|
23468 | }, {
|
23469 | "key": "430104",
|
23470 | "value": "岳麓区"
|
23471 | }, {
|
23472 | "key": "430105",
|
23473 | "value": "开福区"
|
23474 | }, {
|
23475 | "key": "430111",
|
23476 | "value": "雨花区"
|
23477 | }, {
|
23478 | "key": "430112",
|
23479 | "value": "望城区"
|
23480 | }, {
|
23481 | "key": "430121",
|
23482 | "value": "长沙县"
|
23483 | }, {
|
23484 | "key": "430181",
|
23485 | "value": "浏阳市"
|
23486 | }, {
|
23487 | "key": "430182",
|
23488 | "value": "宁乡市"
|
23489 | }]
|
23490 | }, {
|
23491 | "key": "430200",
|
23492 | "value": "株洲市",
|
23493 | "children": [{
|
23494 | "key": "430202",
|
23495 | "value": "荷塘区"
|
23496 | }, {
|
23497 | "key": "430203",
|
23498 | "value": "芦淞区"
|
23499 | }, {
|
23500 | "key": "430204",
|
23501 | "value": "石峰区"
|
23502 | }, {
|
23503 | "key": "430211",
|
23504 | "value": "天元区"
|
23505 | }, {
|
23506 | "key": "430212",
|
23507 | "value": "渌口区"
|
23508 | }, {
|
23509 | "key": "430223",
|
23510 | "value": "攸县"
|
23511 | }, {
|
23512 | "key": "430224",
|
23513 | "value": "茶陵县"
|
23514 | }, {
|
23515 | "key": "430225",
|
23516 | "value": "炎陵县"
|
23517 | }, {
|
23518 | "key": "430281",
|
23519 | "value": "醴陵市"
|
23520 | }]
|
23521 | }, {
|
23522 | "key": "430300",
|
23523 | "value": "湘潭市",
|
23524 | "children": [{
|
23525 | "key": "430302",
|
23526 | "value": "雨湖区"
|
23527 | }, {
|
23528 | "key": "430304",
|
23529 | "value": "岳塘区"
|
23530 | }, {
|
23531 | "key": "430321",
|
23532 | "value": "湘潭县"
|
23533 | }, {
|
23534 | "key": "430381",
|
23535 | "value": "湘乡市"
|
23536 | }, {
|
23537 | "key": "430382",
|
23538 | "value": "韶山市"
|
23539 | }]
|
23540 | }, {
|
23541 | "key": "430400",
|
23542 | "value": "衡阳市",
|
23543 | "children": [{
|
23544 | "key": "430405",
|
23545 | "value": "珠晖区"
|
23546 | }, {
|
23547 | "key": "430406",
|
23548 | "value": "雁峰区"
|
23549 | }, {
|
23550 | "key": "430407",
|
23551 | "value": "石鼓区"
|
23552 | }, {
|
23553 | "key": "430408",
|
23554 | "value": "蒸湘区"
|
23555 | }, {
|
23556 | "key": "430412",
|
23557 | "value": "南岳区"
|
23558 | }, {
|
23559 | "key": "430421",
|
23560 | "value": "衡阳县"
|
23561 | }, {
|
23562 | "key": "430422",
|
23563 | "value": "衡南县"
|
23564 | }, {
|
23565 | "key": "430423",
|
23566 | "value": "衡山县"
|
23567 | }, {
|
23568 | "key": "430424",
|
23569 | "value": "衡东县"
|
23570 | }, {
|
23571 | "key": "430426",
|
23572 | "value": "祁东县"
|
23573 | }, {
|
23574 | "key": "430481",
|
23575 | "value": "耒阳市"
|
23576 | }, {
|
23577 | "key": "430482",
|
23578 | "value": "常宁市"
|
23579 | }]
|
23580 | }, {
|
23581 | "key": "430500",
|
23582 | "value": "邵阳市",
|
23583 | "children": [{
|
23584 | "key": "430502",
|
23585 | "value": "双清区"
|
23586 | }, {
|
23587 | "key": "430503",
|
23588 | "value": "大祥区"
|
23589 | }, {
|
23590 | "key": "430511",
|
23591 | "value": "北塔区"
|
23592 | }, {
|
23593 | "key": "430521",
|
23594 | "value": "邵东县"
|
23595 | }, {
|
23596 | "key": "430522",
|
23597 | "value": "新邵县"
|
23598 | }, {
|
23599 | "key": "430523",
|
23600 | "value": "邵阳县"
|
23601 | }, {
|
23602 | "key": "430524",
|
23603 | "value": "隆回县"
|
23604 | }, {
|
23605 | "key": "430525",
|
23606 | "value": "洞口县"
|
23607 | }, {
|
23608 | "key": "430527",
|
23609 | "value": "绥宁县"
|
23610 | }, {
|
23611 | "key": "430528",
|
23612 | "value": "新宁县"
|
23613 | }, {
|
23614 | "key": "430529",
|
23615 | "value": "城步苗族自治县"
|
23616 | }, {
|
23617 | "key": "430581",
|
23618 | "value": "武冈市"
|
23619 | }]
|
23620 | }, {
|
23621 | "key": "430600",
|
23622 | "value": "岳阳市",
|
23623 | "children": [{
|
23624 | "key": "430602",
|
23625 | "value": "岳阳楼区"
|
23626 | }, {
|
23627 | "key": "430603",
|
23628 | "value": "云溪区"
|
23629 | }, {
|
23630 | "key": "430611",
|
23631 | "value": "君山区"
|
23632 | }, {
|
23633 | "key": "430621",
|
23634 | "value": "岳阳县"
|
23635 | }, {
|
23636 | "key": "430623",
|
23637 | "value": "华容县"
|
23638 | }, {
|
23639 | "key": "430624",
|
23640 | "value": "湘阴县"
|
23641 | }, {
|
23642 | "key": "430626",
|
23643 | "value": "平江县"
|
23644 | }, {
|
23645 | "key": "430681",
|
23646 | "value": "汨罗市"
|
23647 | }, {
|
23648 | "key": "430682",
|
23649 | "value": "临湘市"
|
23650 | }]
|
23651 | }, {
|
23652 | "key": "430700",
|
23653 | "value": "常德市",
|
23654 | "children": [{
|
23655 | "key": "430702",
|
23656 | "value": "武陵区"
|
23657 | }, {
|
23658 | "key": "430703",
|
23659 | "value": "鼎城区"
|
23660 | }, {
|
23661 | "key": "430721",
|
23662 | "value": "安乡县"
|
23663 | }, {
|
23664 | "key": "430722",
|
23665 | "value": "汉寿县"
|
23666 | }, {
|
23667 | "key": "430723",
|
23668 | "value": "澧县"
|
23669 | }, {
|
23670 | "key": "430724",
|
23671 | "value": "临澧县"
|
23672 | }, {
|
23673 | "key": "430725",
|
23674 | "value": "桃源县"
|
23675 | }, {
|
23676 | "key": "430726",
|
23677 | "value": "石门县"
|
23678 | }, {
|
23679 | "key": "430781",
|
23680 | "value": "津市市"
|
23681 | }]
|
23682 | }, {
|
23683 | "key": "430800",
|
23684 | "value": "张家界市",
|
23685 | "children": [{
|
23686 | "key": "430802",
|
23687 | "value": "永定区"
|
23688 | }, {
|
23689 | "key": "430811",
|
23690 | "value": "武陵源区"
|
23691 | }, {
|
23692 | "key": "430821",
|
23693 | "value": "慈利县"
|
23694 | }, {
|
23695 | "key": "430822",
|
23696 | "value": "桑植县"
|
23697 | }]
|
23698 | }, {
|
23699 | "key": "430900",
|
23700 | "value": "益阳市",
|
23701 | "children": [{
|
23702 | "key": "430902",
|
23703 | "value": "资阳区"
|
23704 | }, {
|
23705 | "key": "430903",
|
23706 | "value": "赫山区"
|
23707 | }, {
|
23708 | "key": "430921",
|
23709 | "value": "南县"
|
23710 | }, {
|
23711 | "key": "430922",
|
23712 | "value": "桃江县"
|
23713 | }, {
|
23714 | "key": "430923",
|
23715 | "value": "安化县"
|
23716 | }, {
|
23717 | "key": "430981",
|
23718 | "value": "沅江市"
|
23719 | }]
|
23720 | }, {
|
23721 | "key": "431000",
|
23722 | "value": "郴州市",
|
23723 | "children": [{
|
23724 | "key": "431002",
|
23725 | "value": "北湖区"
|
23726 | }, {
|
23727 | "key": "431003",
|
23728 | "value": "苏仙区"
|
23729 | }, {
|
23730 | "key": "431021",
|
23731 | "value": "桂阳县"
|
23732 | }, {
|
23733 | "key": "431022",
|
23734 | "value": "宜章县"
|
23735 | }, {
|
23736 | "key": "431023",
|
23737 | "value": "永兴县"
|
23738 | }, {
|
23739 | "key": "431024",
|
23740 | "value": "嘉禾县"
|
23741 | }, {
|
23742 | "key": "431025",
|
23743 | "value": "临武县"
|
23744 | }, {
|
23745 | "key": "431026",
|
23746 | "value": "汝城县"
|
23747 | }, {
|
23748 | "key": "431027",
|
23749 | "value": "桂东县"
|
23750 | }, {
|
23751 | "key": "431028",
|
23752 | "value": "安仁县"
|
23753 | }, {
|
23754 | "key": "431081",
|
23755 | "value": "资兴市"
|
23756 | }]
|
23757 | }, {
|
23758 | "key": "431100",
|
23759 | "value": "永州市",
|
23760 | "children": [{
|
23761 | "key": "431102",
|
23762 | "value": "零陵区"
|
23763 | }, {
|
23764 | "key": "431103",
|
23765 | "value": "冷水滩区"
|
23766 | }, {
|
23767 | "key": "431121",
|
23768 | "value": "祁阳县"
|
23769 | }, {
|
23770 | "key": "431122",
|
23771 | "value": "东安县"
|
23772 | }, {
|
23773 | "key": "431123",
|
23774 | "value": "双牌县"
|
23775 | }, {
|
23776 | "key": "431124",
|
23777 | "value": "道县"
|
23778 | }, {
|
23779 | "key": "431125",
|
23780 | "value": "江永县"
|
23781 | }, {
|
23782 | "key": "431126",
|
23783 | "value": "宁远县"
|
23784 | }, {
|
23785 | "key": "431127",
|
23786 | "value": "蓝山县"
|
23787 | }, {
|
23788 | "key": "431128",
|
23789 | "value": "新田县"
|
23790 | }, {
|
23791 | "key": "431129",
|
23792 | "value": "江华瑶族自治县"
|
23793 | }]
|
23794 | }, {
|
23795 | "key": "431200",
|
23796 | "value": "怀化市",
|
23797 | "children": [{
|
23798 | "key": "431202",
|
23799 | "value": "鹤城区"
|
23800 | }, {
|
23801 | "key": "431221",
|
23802 | "value": "中方县"
|
23803 | }, {
|
23804 | "key": "431222",
|
23805 | "value": "沅陵县"
|
23806 | }, {
|
23807 | "key": "431223",
|
23808 | "value": "辰溪县"
|
23809 | }, {
|
23810 | "key": "431224",
|
23811 | "value": "溆浦县"
|
23812 | }, {
|
23813 | "key": "431225",
|
23814 | "value": "会同县"
|
23815 | }, {
|
23816 | "key": "431226",
|
23817 | "value": "麻阳苗族自治县"
|
23818 | }, {
|
23819 | "key": "431227",
|
23820 | "value": "新晃侗族自治县"
|
23821 | }, {
|
23822 | "key": "431228",
|
23823 | "value": "芷江侗族自治县"
|
23824 | }, {
|
23825 | "key": "431229",
|
23826 | "value": "靖州苗族侗族自治县"
|
23827 | }, {
|
23828 | "key": "431230",
|
23829 | "value": "通道侗族自治县"
|
23830 | }, {
|
23831 | "key": "431281",
|
23832 | "value": "洪江市"
|
23833 | }]
|
23834 | }, {
|
23835 | "key": "431300",
|
23836 | "value": "娄底市",
|
23837 | "children": [{
|
23838 | "key": "431302",
|
23839 | "value": "娄星区"
|
23840 | }, {
|
23841 | "key": "431321",
|
23842 | "value": "双峰县"
|
23843 | }, {
|
23844 | "key": "431322",
|
23845 | "value": "新化县"
|
23846 | }, {
|
23847 | "key": "431381",
|
23848 | "value": "冷水江市"
|
23849 | }, {
|
23850 | "key": "431382",
|
23851 | "value": "涟源市"
|
23852 | }]
|
23853 | }, {
|
23854 | "key": "433100",
|
23855 | "value": "湘西土家族苗族自治州",
|
23856 | "children": [{
|
23857 | "key": "433101",
|
23858 | "value": "吉首市"
|
23859 | }, {
|
23860 | "key": "433122",
|
23861 | "value": "泸溪县"
|
23862 | }, {
|
23863 | "key": "433123",
|
23864 | "value": "凤凰县"
|
23865 | }, {
|
23866 | "key": "433124",
|
23867 | "value": "花垣县"
|
23868 | }, {
|
23869 | "key": "433125",
|
23870 | "value": "保靖县"
|
23871 | }, {
|
23872 | "key": "433126",
|
23873 | "value": "古丈县"
|
23874 | }, {
|
23875 | "key": "433127",
|
23876 | "value": "永顺县"
|
23877 | }, {
|
23878 | "key": "433130",
|
23879 | "value": "龙山县"
|
23880 | }]
|
23881 | }]
|
23882 | }, {
|
23883 | "key": "440000",
|
23884 | "value": "广东",
|
23885 | "children": [{
|
23886 | "key": "440100",
|
23887 | "value": "广州市",
|
23888 | "children": [{
|
23889 | "key": "440103",
|
23890 | "value": "荔湾区"
|
23891 | }, {
|
23892 | "key": "440104",
|
23893 | "value": "越秀区"
|
23894 | }, {
|
23895 | "key": "440105",
|
23896 | "value": "海珠区"
|
23897 | }, {
|
23898 | "key": "440106",
|
23899 | "value": "天河区"
|
23900 | }, {
|
23901 | "key": "440111",
|
23902 | "value": "白云区"
|
23903 | }, {
|
23904 | "key": "440112",
|
23905 | "value": "黄埔区"
|
23906 | }, {
|
23907 | "key": "440113",
|
23908 | "value": "番禺区"
|
23909 | }, {
|
23910 | "key": "440114",
|
23911 | "value": "花都区"
|
23912 | }, {
|
23913 | "key": "440115",
|
23914 | "value": "南沙区"
|
23915 | }, {
|
23916 | "key": "440117",
|
23917 | "value": "从化区"
|
23918 | }, {
|
23919 | "key": "440118",
|
23920 | "value": "增城区"
|
23921 | }]
|
23922 | }, {
|
23923 | "key": "440200",
|
23924 | "value": "韶关市",
|
23925 | "children": [{
|
23926 | "key": "440203",
|
23927 | "value": "武江区"
|
23928 | }, {
|
23929 | "key": "440204",
|
23930 | "value": "浈江区"
|
23931 | }, {
|
23932 | "key": "440205",
|
23933 | "value": "曲江区"
|
23934 | }, {
|
23935 | "key": "440222",
|
23936 | "value": "始兴县"
|
23937 | }, {
|
23938 | "key": "440224",
|
23939 | "value": "仁化县"
|
23940 | }, {
|
23941 | "key": "440229",
|
23942 | "value": "翁源县"
|
23943 | }, {
|
23944 | "key": "440232",
|
23945 | "value": "乳源瑶族自治县"
|
23946 | }, {
|
23947 | "key": "440233",
|
23948 | "value": "新丰县"
|
23949 | }, {
|
23950 | "key": "440281",
|
23951 | "value": "乐昌市"
|
23952 | }, {
|
23953 | "key": "440282",
|
23954 | "value": "南雄市"
|
23955 | }]
|
23956 | }, {
|
23957 | "key": "440300",
|
23958 | "value": "深圳市",
|
23959 | "children": [{
|
23960 | "key": "440303",
|
23961 | "value": "罗湖区"
|
23962 | }, {
|
23963 | "key": "440304",
|
23964 | "value": "福田区"
|
23965 | }, {
|
23966 | "key": "440305",
|
23967 | "value": "南山区"
|
23968 | }, {
|
23969 | "key": "440306",
|
23970 | "value": "宝安区"
|
23971 | }, {
|
23972 | "key": "440307",
|
23973 | "value": "龙岗区"
|
23974 | }, {
|
23975 | "key": "440308",
|
23976 | "value": "盐田区"
|
23977 | }, {
|
23978 | "key": "440309",
|
23979 | "value": "龙华区"
|
23980 | }, {
|
23981 | "key": "440310",
|
23982 | "value": "坪山区"
|
23983 | }, {
|
23984 | "key": "440311",
|
23985 | "value": "光明区"
|
23986 | }]
|
23987 | }, {
|
23988 | "key": "440400",
|
23989 | "value": "珠海市",
|
23990 | "children": [{
|
23991 | "key": "440402",
|
23992 | "value": "香洲区"
|
23993 | }, {
|
23994 | "key": "440403",
|
23995 | "value": "斗门区"
|
23996 | }, {
|
23997 | "key": "440404",
|
23998 | "value": "金湾区"
|
23999 | }]
|
24000 | }, {
|
24001 | "key": "440500",
|
24002 | "value": "汕头市",
|
24003 | "children": [{
|
24004 | "key": "440507",
|
24005 | "value": "龙湖区"
|
24006 | }, {
|
24007 | "key": "440511",
|
24008 | "value": "金平区"
|
24009 | }, {
|
24010 | "key": "440512",
|
24011 | "value": "濠江区"
|
24012 | }, {
|
24013 | "key": "440513",
|
24014 | "value": "潮阳区"
|
24015 | }, {
|
24016 | "key": "440514",
|
24017 | "value": "潮南区"
|
24018 | }, {
|
24019 | "key": "440515",
|
24020 | "value": "澄海区"
|
24021 | }, {
|
24022 | "key": "440523",
|
24023 | "value": "南澳县"
|
24024 | }]
|
24025 | }, {
|
24026 | "key": "440600",
|
24027 | "value": "佛山市",
|
24028 | "children": [{
|
24029 | "key": "440604",
|
24030 | "value": "禅城区"
|
24031 | }, {
|
24032 | "key": "440605",
|
24033 | "value": "南海区"
|
24034 | }, {
|
24035 | "key": "440606",
|
24036 | "value": "顺德区"
|
24037 | }, {
|
24038 | "key": "440607",
|
24039 | "value": "三水区"
|
24040 | }, {
|
24041 | "key": "440608",
|
24042 | "value": "高明区"
|
24043 | }]
|
24044 | }, {
|
24045 | "key": "440700",
|
24046 | "value": "江门市",
|
24047 | "children": [{
|
24048 | "key": "440703",
|
24049 | "value": "蓬江区"
|
24050 | }, {
|
24051 | "key": "440704",
|
24052 | "value": "江海区"
|
24053 | }, {
|
24054 | "key": "440705",
|
24055 | "value": "新会区"
|
24056 | }, {
|
24057 | "key": "440781",
|
24058 | "value": "台山市"
|
24059 | }, {
|
24060 | "key": "440783",
|
24061 | "value": "开平市"
|
24062 | }, {
|
24063 | "key": "440784",
|
24064 | "value": "鹤山市"
|
24065 | }, {
|
24066 | "key": "440785",
|
24067 | "value": "恩平市"
|
24068 | }]
|
24069 | }, {
|
24070 | "key": "440800",
|
24071 | "value": "湛江市",
|
24072 | "children": [{
|
24073 | "key": "440802",
|
24074 | "value": "赤坎区"
|
24075 | }, {
|
24076 | "key": "440803",
|
24077 | "value": "霞山区"
|
24078 | }, {
|
24079 | "key": "440804",
|
24080 | "value": "坡头区"
|
24081 | }, {
|
24082 | "key": "440811",
|
24083 | "value": "麻章区"
|
24084 | }, {
|
24085 | "key": "440823",
|
24086 | "value": "遂溪县"
|
24087 | }, {
|
24088 | "key": "440825",
|
24089 | "value": "徐闻县"
|
24090 | }, {
|
24091 | "key": "440881",
|
24092 | "value": "廉江市"
|
24093 | }, {
|
24094 | "key": "440882",
|
24095 | "value": "雷州市"
|
24096 | }, {
|
24097 | "key": "440883",
|
24098 | "value": "吴川市"
|
24099 | }]
|
24100 | }, {
|
24101 | "key": "440900",
|
24102 | "value": "茂名市",
|
24103 | "children": [{
|
24104 | "key": "440902",
|
24105 | "value": "茂南区"
|
24106 | }, {
|
24107 | "key": "440904",
|
24108 | "value": "电白区"
|
24109 | }, {
|
24110 | "key": "440981",
|
24111 | "value": "高州市"
|
24112 | }, {
|
24113 | "key": "440982",
|
24114 | "value": "化州市"
|
24115 | }, {
|
24116 | "key": "440983",
|
24117 | "value": "信宜市"
|
24118 | }]
|
24119 | }, {
|
24120 | "key": "441200",
|
24121 | "value": "肇庆市",
|
24122 | "children": [{
|
24123 | "key": "441202",
|
24124 | "value": "端州区"
|
24125 | }, {
|
24126 | "key": "441203",
|
24127 | "value": "鼎湖区"
|
24128 | }, {
|
24129 | "key": "441204",
|
24130 | "value": "高要区"
|
24131 | }, {
|
24132 | "key": "441223",
|
24133 | "value": "广宁县"
|
24134 | }, {
|
24135 | "key": "441224",
|
24136 | "value": "怀集县"
|
24137 | }, {
|
24138 | "key": "441225",
|
24139 | "value": "封开县"
|
24140 | }, {
|
24141 | "key": "441226",
|
24142 | "value": "德庆县"
|
24143 | }, {
|
24144 | "key": "441284",
|
24145 | "value": "四会市"
|
24146 | }]
|
24147 | }, {
|
24148 | "key": "441300",
|
24149 | "value": "惠州市",
|
24150 | "children": [{
|
24151 | "key": "441302",
|
24152 | "value": "惠城区"
|
24153 | }, {
|
24154 | "key": "441303",
|
24155 | "value": "惠阳区"
|
24156 | }, {
|
24157 | "key": "441322",
|
24158 | "value": "博罗县"
|
24159 | }, {
|
24160 | "key": "441323",
|
24161 | "value": "惠东县"
|
24162 | }, {
|
24163 | "key": "441324",
|
24164 | "value": "龙门县"
|
24165 | }]
|
24166 | }, {
|
24167 | "key": "441400",
|
24168 | "value": "梅州市",
|
24169 | "children": [{
|
24170 | "key": "441402",
|
24171 | "value": "梅江区"
|
24172 | }, {
|
24173 | "key": "441403",
|
24174 | "value": "梅县区"
|
24175 | }, {
|
24176 | "key": "441422",
|
24177 | "value": "大埔县"
|
24178 | }, {
|
24179 | "key": "441423",
|
24180 | "value": "丰顺县"
|
24181 | }, {
|
24182 | "key": "441424",
|
24183 | "value": "五华县"
|
24184 | }, {
|
24185 | "key": "441426",
|
24186 | "value": "平远县"
|
24187 | }, {
|
24188 | "key": "441427",
|
24189 | "value": "蕉岭县"
|
24190 | }, {
|
24191 | "key": "441481",
|
24192 | "value": "兴宁市"
|
24193 | }]
|
24194 | }, {
|
24195 | "key": "441500",
|
24196 | "value": "汕尾市",
|
24197 | "children": [{
|
24198 | "key": "441502",
|
24199 | "value": "城区"
|
24200 | }, {
|
24201 | "key": "441521",
|
24202 | "value": "海丰县"
|
24203 | }, {
|
24204 | "key": "441523",
|
24205 | "value": "陆河县"
|
24206 | }, {
|
24207 | "key": "441581",
|
24208 | "value": "陆丰市"
|
24209 | }]
|
24210 | }, {
|
24211 | "key": "441600",
|
24212 | "value": "河源市",
|
24213 | "children": [{
|
24214 | "key": "441602",
|
24215 | "value": "源城区"
|
24216 | }, {
|
24217 | "key": "441621",
|
24218 | "value": "紫金县"
|
24219 | }, {
|
24220 | "key": "441622",
|
24221 | "value": "龙川县"
|
24222 | }, {
|
24223 | "key": "441623",
|
24224 | "value": "连平县"
|
24225 | }, {
|
24226 | "key": "441624",
|
24227 | "value": "和平县"
|
24228 | }, {
|
24229 | "key": "441625",
|
24230 | "value": "东源县"
|
24231 | }]
|
24232 | }, {
|
24233 | "key": "441700",
|
24234 | "value": "阳江市",
|
24235 | "children": [{
|
24236 | "key": "441702",
|
24237 | "value": "江城区"
|
24238 | }, {
|
24239 | "key": "441704",
|
24240 | "value": "阳东区"
|
24241 | }, {
|
24242 | "key": "441721",
|
24243 | "value": "阳西县"
|
24244 | }, {
|
24245 | "key": "441781",
|
24246 | "value": "阳春市"
|
24247 | }]
|
24248 | }, {
|
24249 | "key": "441800",
|
24250 | "value": "清远市",
|
24251 | "children": [{
|
24252 | "key": "441802",
|
24253 | "value": "清城区"
|
24254 | }, {
|
24255 | "key": "441803",
|
24256 | "value": "清新区"
|
24257 | }, {
|
24258 | "key": "441821",
|
24259 | "value": "佛冈县"
|
24260 | }, {
|
24261 | "key": "441823",
|
24262 | "value": "阳山县"
|
24263 | }, {
|
24264 | "key": "441825",
|
24265 | "value": "连山壮族瑶族自治县"
|
24266 | }, {
|
24267 | "key": "441826",
|
24268 | "value": "连南瑶族自治县"
|
24269 | }, {
|
24270 | "key": "441881",
|
24271 | "value": "英德市"
|
24272 | }, {
|
24273 | "key": "441882",
|
24274 | "value": "连州市"
|
24275 | }]
|
24276 | }, {
|
24277 | "key": "441900",
|
24278 | "value": "东莞市"
|
24279 | }, {
|
24280 | "key": "442000",
|
24281 | "value": "中山市"
|
24282 | }, {
|
24283 | "key": "445100",
|
24284 | "value": "潮州市",
|
24285 | "children": [{
|
24286 | "key": "445102",
|
24287 | "value": "湘桥区"
|
24288 | }, {
|
24289 | "key": "445103",
|
24290 | "value": "潮安区"
|
24291 | }, {
|
24292 | "key": "445122",
|
24293 | "value": "饶平县"
|
24294 | }]
|
24295 | }, {
|
24296 | "key": "445200",
|
24297 | "value": "揭阳市",
|
24298 | "children": [{
|
24299 | "key": "445202",
|
24300 | "value": "榕城区"
|
24301 | }, {
|
24302 | "key": "445203",
|
24303 | "value": "揭东区"
|
24304 | }, {
|
24305 | "key": "445222",
|
24306 | "value": "揭西县"
|
24307 | }, {
|
24308 | "key": "445224",
|
24309 | "value": "惠来县"
|
24310 | }, {
|
24311 | "key": "445281",
|
24312 | "value": "普宁市"
|
24313 | }]
|
24314 | }, {
|
24315 | "key": "445300",
|
24316 | "value": "云浮市",
|
24317 | "children": [{
|
24318 | "key": "445302",
|
24319 | "value": "云城区"
|
24320 | }, {
|
24321 | "key": "445303",
|
24322 | "value": "云安区"
|
24323 | }, {
|
24324 | "key": "445321",
|
24325 | "value": "新兴县"
|
24326 | }, {
|
24327 | "key": "445322",
|
24328 | "value": "郁南县"
|
24329 | }, {
|
24330 | "key": "445381",
|
24331 | "value": "罗定市"
|
24332 | }]
|
24333 | }]
|
24334 | }, {
|
24335 | "key": "450000",
|
24336 | "value": "广西",
|
24337 | "children": [{
|
24338 | "key": "450100",
|
24339 | "value": "南宁市",
|
24340 | "children": [{
|
24341 | "key": "450102",
|
24342 | "value": "兴宁区"
|
24343 | }, {
|
24344 | "key": "450103",
|
24345 | "value": "青秀区"
|
24346 | }, {
|
24347 | "key": "450105",
|
24348 | "value": "江南区"
|
24349 | }, {
|
24350 | "key": "450107",
|
24351 | "value": "西乡塘区"
|
24352 | }, {
|
24353 | "key": "450108",
|
24354 | "value": "良庆区"
|
24355 | }, {
|
24356 | "key": "450109",
|
24357 | "value": "邕宁区"
|
24358 | }, {
|
24359 | "key": "450110",
|
24360 | "value": "武鸣区"
|
24361 | }, {
|
24362 | "key": "450123",
|
24363 | "value": "隆安县"
|
24364 | }, {
|
24365 | "key": "450124",
|
24366 | "value": "马山县"
|
24367 | }, {
|
24368 | "key": "450125",
|
24369 | "value": "上林县"
|
24370 | }, {
|
24371 | "key": "450126",
|
24372 | "value": "宾阳县"
|
24373 | }, {
|
24374 | "key": "450127",
|
24375 | "value": "横县"
|
24376 | }]
|
24377 | }, {
|
24378 | "key": "450200",
|
24379 | "value": "柳州市",
|
24380 | "children": [{
|
24381 | "key": "450202",
|
24382 | "value": "城中区"
|
24383 | }, {
|
24384 | "key": "450203",
|
24385 | "value": "鱼峰区"
|
24386 | }, {
|
24387 | "key": "450204",
|
24388 | "value": "柳南区"
|
24389 | }, {
|
24390 | "key": "450205",
|
24391 | "value": "柳北区"
|
24392 | }, {
|
24393 | "key": "450206",
|
24394 | "value": "柳江区"
|
24395 | }, {
|
24396 | "key": "450222",
|
24397 | "value": "柳城县"
|
24398 | }, {
|
24399 | "key": "450223",
|
24400 | "value": "鹿寨县"
|
24401 | }, {
|
24402 | "key": "450224",
|
24403 | "value": "融安县"
|
24404 | }, {
|
24405 | "key": "450225",
|
24406 | "value": "融水苗族自治县"
|
24407 | }, {
|
24408 | "key": "450226",
|
24409 | "value": "三江侗族自治县"
|
24410 | }]
|
24411 | }, {
|
24412 | "key": "450300",
|
24413 | "value": "桂林市",
|
24414 | "children": [{
|
24415 | "key": "450302",
|
24416 | "value": "秀峰区"
|
24417 | }, {
|
24418 | "key": "450303",
|
24419 | "value": "叠彩区"
|
24420 | }, {
|
24421 | "key": "450304",
|
24422 | "value": "象山区"
|
24423 | }, {
|
24424 | "key": "450305",
|
24425 | "value": "七星区"
|
24426 | }, {
|
24427 | "key": "450311",
|
24428 | "value": "雁山区"
|
24429 | }, {
|
24430 | "key": "450312",
|
24431 | "value": "临桂区"
|
24432 | }, {
|
24433 | "key": "450321",
|
24434 | "value": "阳朔县"
|
24435 | }, {
|
24436 | "key": "450323",
|
24437 | "value": "灵川县"
|
24438 | }, {
|
24439 | "key": "450324",
|
24440 | "value": "全州县"
|
24441 | }, {
|
24442 | "key": "450325",
|
24443 | "value": "兴安县"
|
24444 | }, {
|
24445 | "key": "450326",
|
24446 | "value": "永福县"
|
24447 | }, {
|
24448 | "key": "450327",
|
24449 | "value": "灌阳县"
|
24450 | }, {
|
24451 | "key": "450328",
|
24452 | "value": "龙胜各族自治县"
|
24453 | }, {
|
24454 | "key": "450329",
|
24455 | "value": "资源县"
|
24456 | }, {
|
24457 | "key": "450330",
|
24458 | "value": "平乐县"
|
24459 | }, {
|
24460 | "key": "450332",
|
24461 | "value": "恭城瑶族自治县"
|
24462 | }, {
|
24463 | "key": "450381",
|
24464 | "value": "荔浦市"
|
24465 | }]
|
24466 | }, {
|
24467 | "key": "450400",
|
24468 | "value": "梧州市",
|
24469 | "children": [{
|
24470 | "key": "450403",
|
24471 | "value": "万秀区"
|
24472 | }, {
|
24473 | "key": "450405",
|
24474 | "value": "长洲区"
|
24475 | }, {
|
24476 | "key": "450406",
|
24477 | "value": "龙圩区"
|
24478 | }, {
|
24479 | "key": "450421",
|
24480 | "value": "苍梧县"
|
24481 | }, {
|
24482 | "key": "450422",
|
24483 | "value": "藤县"
|
24484 | }, {
|
24485 | "key": "450423",
|
24486 | "value": "蒙山县"
|
24487 | }, {
|
24488 | "key": "450481",
|
24489 | "value": "岑溪市"
|
24490 | }]
|
24491 | }, {
|
24492 | "key": "450500",
|
24493 | "value": "北海市",
|
24494 | "children": [{
|
24495 | "key": "450502",
|
24496 | "value": "海城区"
|
24497 | }, {
|
24498 | "key": "450503",
|
24499 | "value": "银海区"
|
24500 | }, {
|
24501 | "key": "450512",
|
24502 | "value": "铁山港区"
|
24503 | }, {
|
24504 | "key": "450521",
|
24505 | "value": "合浦县"
|
24506 | }]
|
24507 | }, {
|
24508 | "key": "450600",
|
24509 | "value": "防城港市",
|
24510 | "children": [{
|
24511 | "key": "450602",
|
24512 | "value": "港口区"
|
24513 | }, {
|
24514 | "key": "450603",
|
24515 | "value": "防城区"
|
24516 | }, {
|
24517 | "key": "450621",
|
24518 | "value": "上思县"
|
24519 | }, {
|
24520 | "key": "450681",
|
24521 | "value": "东兴市"
|
24522 | }]
|
24523 | }, {
|
24524 | "key": "450700",
|
24525 | "value": "钦州市",
|
24526 | "children": [{
|
24527 | "key": "450702",
|
24528 | "value": "钦南区"
|
24529 | }, {
|
24530 | "key": "450703",
|
24531 | "value": "钦北区"
|
24532 | }, {
|
24533 | "key": "450721",
|
24534 | "value": "灵山县"
|
24535 | }, {
|
24536 | "key": "450722",
|
24537 | "value": "浦北县"
|
24538 | }]
|
24539 | }, {
|
24540 | "key": "450800",
|
24541 | "value": "贵港市",
|
24542 | "children": [{
|
24543 | "key": "450802",
|
24544 | "value": "港北区"
|
24545 | }, {
|
24546 | "key": "450803",
|
24547 | "value": "港南区"
|
24548 | }, {
|
24549 | "key": "450804",
|
24550 | "value": "覃塘区"
|
24551 | }, {
|
24552 | "key": "450821",
|
24553 | "value": "平南县"
|
24554 | }, {
|
24555 | "key": "450881",
|
24556 | "value": "桂平市"
|
24557 | }]
|
24558 | }, {
|
24559 | "key": "450900",
|
24560 | "value": "玉林市",
|
24561 | "children": [{
|
24562 | "key": "450902",
|
24563 | "value": "玉州区"
|
24564 | }, {
|
24565 | "key": "450903",
|
24566 | "value": "福绵区"
|
24567 | }, {
|
24568 | "key": "450921",
|
24569 | "value": "容县"
|
24570 | }, {
|
24571 | "key": "450922",
|
24572 | "value": "陆川县"
|
24573 | }, {
|
24574 | "key": "450923",
|
24575 | "value": "博白县"
|
24576 | }, {
|
24577 | "key": "450924",
|
24578 | "value": "兴业县"
|
24579 | }, {
|
24580 | "key": "450981",
|
24581 | "value": "北流市"
|
24582 | }]
|
24583 | }, {
|
24584 | "key": "451000",
|
24585 | "value": "百色市",
|
24586 | "children": [{
|
24587 | "key": "451002",
|
24588 | "value": "右江区"
|
24589 | }, {
|
24590 | "key": "451021",
|
24591 | "value": "田阳县"
|
24592 | }, {
|
24593 | "key": "451022",
|
24594 | "value": "田东县"
|
24595 | }, {
|
24596 | "key": "451023",
|
24597 | "value": "平果县"
|
24598 | }, {
|
24599 | "key": "451024",
|
24600 | "value": "德保县"
|
24601 | }, {
|
24602 | "key": "451026",
|
24603 | "value": "那坡县"
|
24604 | }, {
|
24605 | "key": "451027",
|
24606 | "value": "凌云县"
|
24607 | }, {
|
24608 | "key": "451028",
|
24609 | "value": "乐业县"
|
24610 | }, {
|
24611 | "key": "451029",
|
24612 | "value": "田林县"
|
24613 | }, {
|
24614 | "key": "451030",
|
24615 | "value": "西林县"
|
24616 | }, {
|
24617 | "key": "451031",
|
24618 | "value": "隆林各族自治县"
|
24619 | }, {
|
24620 | "key": "451081",
|
24621 | "value": "靖西市"
|
24622 | }]
|
24623 | }, {
|
24624 | "key": "451100",
|
24625 | "value": "贺州市",
|
24626 | "children": [{
|
24627 | "key": "451102",
|
24628 | "value": "八步区"
|
24629 | }, {
|
24630 | "key": "451103",
|
24631 | "value": "平桂区"
|
24632 | }, {
|
24633 | "key": "451121",
|
24634 | "value": "昭平县"
|
24635 | }, {
|
24636 | "key": "451122",
|
24637 | "value": "钟山县"
|
24638 | }, {
|
24639 | "key": "451123",
|
24640 | "value": "富川瑶族自治县"
|
24641 | }]
|
24642 | }, {
|
24643 | "key": "451200",
|
24644 | "value": "河池市",
|
24645 | "children": [{
|
24646 | "key": "451202",
|
24647 | "value": "金城江区"
|
24648 | }, {
|
24649 | "key": "451203",
|
24650 | "value": "宜州区"
|
24651 | }, {
|
24652 | "key": "451221",
|
24653 | "value": "南丹县"
|
24654 | }, {
|
24655 | "key": "451222",
|
24656 | "value": "天峨县"
|
24657 | }, {
|
24658 | "key": "451223",
|
24659 | "value": "凤山县"
|
24660 | }, {
|
24661 | "key": "451224",
|
24662 | "value": "东兰县"
|
24663 | }, {
|
24664 | "key": "451225",
|
24665 | "value": "罗城仫佬族自治县"
|
24666 | }, {
|
24667 | "key": "451226",
|
24668 | "value": "环江毛南族自治县"
|
24669 | }, {
|
24670 | "key": "451227",
|
24671 | "value": "巴马瑶族自治县"
|
24672 | }, {
|
24673 | "key": "451228",
|
24674 | "value": "都安瑶族自治县"
|
24675 | }, {
|
24676 | "key": "451229",
|
24677 | "value": "大化瑶族自治县"
|
24678 | }]
|
24679 | }, {
|
24680 | "key": "451300",
|
24681 | "value": "来宾市",
|
24682 | "children": [{
|
24683 | "key": "451302",
|
24684 | "value": "兴宾区"
|
24685 | }, {
|
24686 | "key": "451321",
|
24687 | "value": "忻城县"
|
24688 | }, {
|
24689 | "key": "451322",
|
24690 | "value": "象州县"
|
24691 | }, {
|
24692 | "key": "451323",
|
24693 | "value": "武宣县"
|
24694 | }, {
|
24695 | "key": "451324",
|
24696 | "value": "金秀瑶族自治县"
|
24697 | }, {
|
24698 | "key": "451381",
|
24699 | "value": "合山市"
|
24700 | }]
|
24701 | }, {
|
24702 | "key": "451400",
|
24703 | "value": "崇左市",
|
24704 | "children": [{
|
24705 | "key": "451402",
|
24706 | "value": "江州区"
|
24707 | }, {
|
24708 | "key": "451421",
|
24709 | "value": "扶绥县"
|
24710 | }, {
|
24711 | "key": "451422",
|
24712 | "value": "宁明县"
|
24713 | }, {
|
24714 | "key": "451423",
|
24715 | "value": "龙州县"
|
24716 | }, {
|
24717 | "key": "451424",
|
24718 | "value": "大新县"
|
24719 | }, {
|
24720 | "key": "451425",
|
24721 | "value": "天等县"
|
24722 | }, {
|
24723 | "key": "451481",
|
24724 | "value": "凭祥市"
|
24725 | }]
|
24726 | }]
|
24727 | }, {
|
24728 | "key": "460000",
|
24729 | "value": "海南",
|
24730 | "children": [{
|
24731 | "key": "460100",
|
24732 | "value": "海口市",
|
24733 | "children": [{
|
24734 | "key": "460105",
|
24735 | "value": "秀英区"
|
24736 | }, {
|
24737 | "key": "460106",
|
24738 | "value": "龙华区"
|
24739 | }, {
|
24740 | "key": "460107",
|
24741 | "value": "琼山区"
|
24742 | }, {
|
24743 | "key": "460108",
|
24744 | "value": "美兰区"
|
24745 | }]
|
24746 | }, {
|
24747 | "key": "460200",
|
24748 | "value": "三亚市",
|
24749 | "children": [{
|
24750 | "key": "460202",
|
24751 | "value": "海棠湾镇"
|
24752 | }, {
|
24753 | "key": "460203",
|
24754 | "value": "吉阳区"
|
24755 | }, {
|
24756 | "key": "460204",
|
24757 | "value": "凤凰镇"
|
24758 | }, {
|
24759 | "key": "460205",
|
24760 | "value": "崖州区"
|
24761 | }]
|
24762 | }, {
|
24763 | "key": "460300",
|
24764 | "value": "三沙市"
|
24765 | }, {
|
24766 | "key": "460400",
|
24767 | "value": "儋州市"
|
24768 | }, {
|
24769 | "key": "469001",
|
24770 | "value": "五指山市"
|
24771 | }, {
|
24772 | "key": "469002",
|
24773 | "value": "琼海市"
|
24774 | }, {
|
24775 | "key": "469005",
|
24776 | "value": "文昌市"
|
24777 | }, {
|
24778 | "key": "469006",
|
24779 | "value": "万宁市"
|
24780 | }, {
|
24781 | "key": "469007",
|
24782 | "value": "东方市"
|
24783 | }, {
|
24784 | "key": "469021",
|
24785 | "value": "定安县"
|
24786 | }, {
|
24787 | "key": "469022",
|
24788 | "value": "屯昌县"
|
24789 | }, {
|
24790 | "key": "469023",
|
24791 | "value": "澄迈县"
|
24792 | }, {
|
24793 | "key": "469024",
|
24794 | "value": "临高县"
|
24795 | }, {
|
24796 | "key": "469025",
|
24797 | "value": "白沙黎族自治县"
|
24798 | }, {
|
24799 | "key": "469026",
|
24800 | "value": "昌江黎族自治县"
|
24801 | }, {
|
24802 | "key": "469027",
|
24803 | "value": "乐东黎族自治县"
|
24804 | }, {
|
24805 | "key": "469028",
|
24806 | "value": "陵水黎族自治县"
|
24807 | }, {
|
24808 | "key": "469029",
|
24809 | "value": "保亭黎族苗族自治县"
|
24810 | }, {
|
24811 | "key": "469030",
|
24812 | "value": "琼中黎族苗族自治县"
|
24813 | }]
|
24814 | }, {
|
24815 | "key": "500000",
|
24816 | "value": "重庆",
|
24817 | "children": [{
|
24818 | "key": "500101",
|
24819 | "value": "万州区"
|
24820 | }, {
|
24821 | "key": "500102",
|
24822 | "value": "涪陵区"
|
24823 | }, {
|
24824 | "key": "500103",
|
24825 | "value": "渝中区"
|
24826 | }, {
|
24827 | "key": "500104",
|
24828 | "value": "大渡口区"
|
24829 | }, {
|
24830 | "key": "500105",
|
24831 | "value": "江北区"
|
24832 | }, {
|
24833 | "key": "500106",
|
24834 | "value": "沙坪坝区"
|
24835 | }, {
|
24836 | "key": "500107",
|
24837 | "value": "九龙坡区"
|
24838 | }, {
|
24839 | "key": "500108",
|
24840 | "value": "南岸区"
|
24841 | }, {
|
24842 | "key": "500109",
|
24843 | "value": "北碚区"
|
24844 | }, {
|
24845 | "key": "500110",
|
24846 | "value": "綦江区"
|
24847 | }, {
|
24848 | "key": "500111",
|
24849 | "value": "大足区"
|
24850 | }, {
|
24851 | "key": "500112",
|
24852 | "value": "渝北区"
|
24853 | }, {
|
24854 | "key": "500113",
|
24855 | "value": "巴南区"
|
24856 | }, {
|
24857 | "key": "500114",
|
24858 | "value": "黔江区"
|
24859 | }, {
|
24860 | "key": "500115",
|
24861 | "value": "长寿区"
|
24862 | }, {
|
24863 | "key": "500116",
|
24864 | "value": "江津区"
|
24865 | }, {
|
24866 | "key": "500117",
|
24867 | "value": "合川区"
|
24868 | }, {
|
24869 | "key": "500118",
|
24870 | "value": "永川区"
|
24871 | }, {
|
24872 | "key": "500119",
|
24873 | "value": "南川区"
|
24874 | }, {
|
24875 | "key": "500120",
|
24876 | "value": "璧山区"
|
24877 | }, {
|
24878 | "key": "500151",
|
24879 | "value": "铜梁区"
|
24880 | }, {
|
24881 | "key": "500152",
|
24882 | "value": "潼南区"
|
24883 | }, {
|
24884 | "key": "500153",
|
24885 | "value": "荣昌区"
|
24886 | }, {
|
24887 | "key": "500154",
|
24888 | "value": "开州区"
|
24889 | }, {
|
24890 | "key": "500155",
|
24891 | "value": "梁平区"
|
24892 | }, {
|
24893 | "key": "500156",
|
24894 | "value": "武隆区"
|
24895 | }, {
|
24896 | "key": "500229",
|
24897 | "value": "城口县"
|
24898 | }, {
|
24899 | "key": "500230",
|
24900 | "value": "丰都县"
|
24901 | }, {
|
24902 | "key": "500231",
|
24903 | "value": "垫江县"
|
24904 | }, {
|
24905 | "key": "500233",
|
24906 | "value": "忠县"
|
24907 | }, {
|
24908 | "key": "500235",
|
24909 | "value": "云阳县"
|
24910 | }, {
|
24911 | "key": "500236",
|
24912 | "value": "奉节县"
|
24913 | }, {
|
24914 | "key": "500237",
|
24915 | "value": "巫山县"
|
24916 | }, {
|
24917 | "key": "500238",
|
24918 | "value": "巫溪县"
|
24919 | }, {
|
24920 | "key": "500240",
|
24921 | "value": "石柱土家族自治县"
|
24922 | }, {
|
24923 | "key": "500241",
|
24924 | "value": "秀山土家族苗族自治县"
|
24925 | }, {
|
24926 | "key": "500242",
|
24927 | "value": "酉阳土家族苗族自治县"
|
24928 | }, {
|
24929 | "key": "500243",
|
24930 | "value": "彭水苗族土家族自治县"
|
24931 | }]
|
24932 | }, {
|
24933 | "key": "510000",
|
24934 | "value": "四川",
|
24935 | "children": [{
|
24936 | "key": "510100",
|
24937 | "value": "成都市",
|
24938 | "children": [{
|
24939 | "key": "510104",
|
24940 | "value": "锦江区"
|
24941 | }, {
|
24942 | "key": "510105",
|
24943 | "value": "青羊区"
|
24944 | }, {
|
24945 | "key": "510106",
|
24946 | "value": "金牛区"
|
24947 | }, {
|
24948 | "key": "510107",
|
24949 | "value": "武侯区"
|
24950 | }, {
|
24951 | "key": "510108",
|
24952 | "value": "成华区"
|
24953 | }, {
|
24954 | "key": "510112",
|
24955 | "value": "龙泉驿区"
|
24956 | }, {
|
24957 | "key": "510113",
|
24958 | "value": "青白江区"
|
24959 | }, {
|
24960 | "key": "510114",
|
24961 | "value": "新都区"
|
24962 | }, {
|
24963 | "key": "510115",
|
24964 | "value": "温江区"
|
24965 | }, {
|
24966 | "key": "510116",
|
24967 | "value": "双流区"
|
24968 | }, {
|
24969 | "key": "510117",
|
24970 | "value": "郫都区"
|
24971 | }, {
|
24972 | "key": "510121",
|
24973 | "value": "金堂县"
|
24974 | }, {
|
24975 | "key": "510129",
|
24976 | "value": "大邑县"
|
24977 | }, {
|
24978 | "key": "510131",
|
24979 | "value": "蒲江县"
|
24980 | }, {
|
24981 | "key": "510132",
|
24982 | "value": "新津县"
|
24983 | }, {
|
24984 | "key": "510181",
|
24985 | "value": "都江堰市"
|
24986 | }, {
|
24987 | "key": "510182",
|
24988 | "value": "彭州市"
|
24989 | }, {
|
24990 | "key": "510183",
|
24991 | "value": "邛崃市"
|
24992 | }, {
|
24993 | "key": "510184",
|
24994 | "value": "崇州市"
|
24995 | }, {
|
24996 | "key": "510185",
|
24997 | "value": "简阳市"
|
24998 | }]
|
24999 | }, {
|
25000 | "key": "510300",
|
25001 | "value": "自贡市",
|
25002 | "children": [{
|
25003 | "key": "510302",
|
25004 | "value": "自流井区"
|
25005 | }, {
|
25006 | "key": "510303",
|
25007 | "value": "贡井区"
|
25008 | }, {
|
25009 | "key": "510304",
|
25010 | "value": "大安区"
|
25011 | }, {
|
25012 | "key": "510311",
|
25013 | "value": "沿滩区"
|
25014 | }, {
|
25015 | "key": "510321",
|
25016 | "value": "荣县"
|
25017 | }, {
|
25018 | "key": "510322",
|
25019 | "value": "富顺县"
|
25020 | }]
|
25021 | }, {
|
25022 | "key": "510400",
|
25023 | "value": "攀枝花市",
|
25024 | "children": [{
|
25025 | "key": "510402",
|
25026 | "value": "东区"
|
25027 | }, {
|
25028 | "key": "510403",
|
25029 | "value": "西区"
|
25030 | }, {
|
25031 | "key": "510411",
|
25032 | "value": "仁和区"
|
25033 | }, {
|
25034 | "key": "510421",
|
25035 | "value": "米易县"
|
25036 | }, {
|
25037 | "key": "510422",
|
25038 | "value": "盐边县"
|
25039 | }]
|
25040 | }, {
|
25041 | "key": "510500",
|
25042 | "value": "泸州市",
|
25043 | "children": [{
|
25044 | "key": "510502",
|
25045 | "value": "江阳区"
|
25046 | }, {
|
25047 | "key": "510503",
|
25048 | "value": "纳溪区"
|
25049 | }, {
|
25050 | "key": "510504",
|
25051 | "value": "龙马潭区"
|
25052 | }, {
|
25053 | "key": "510521",
|
25054 | "value": "泸县"
|
25055 | }, {
|
25056 | "key": "510522",
|
25057 | "value": "合江县"
|
25058 | }, {
|
25059 | "key": "510524",
|
25060 | "value": "叙永县"
|
25061 | }, {
|
25062 | "key": "510525",
|
25063 | "value": "古蔺县"
|
25064 | }]
|
25065 | }, {
|
25066 | "key": "510600",
|
25067 | "value": "德阳市",
|
25068 | "children": [{
|
25069 | "key": "510603",
|
25070 | "value": "旌阳区"
|
25071 | }, {
|
25072 | "key": "510604",
|
25073 | "value": "罗江区"
|
25074 | }, {
|
25075 | "key": "510623",
|
25076 | "value": "中江县"
|
25077 | }, {
|
25078 | "key": "510681",
|
25079 | "value": "广汉市"
|
25080 | }, {
|
25081 | "key": "510682",
|
25082 | "value": "什邡市"
|
25083 | }, {
|
25084 | "key": "510683",
|
25085 | "value": "绵竹市"
|
25086 | }]
|
25087 | }, {
|
25088 | "key": "510700",
|
25089 | "value": "绵阳市",
|
25090 | "children": [{
|
25091 | "key": "510703",
|
25092 | "value": "涪城区"
|
25093 | }, {
|
25094 | "key": "510704",
|
25095 | "value": "游仙区"
|
25096 | }, {
|
25097 | "key": "510705",
|
25098 | "value": "安州区"
|
25099 | }, {
|
25100 | "key": "510722",
|
25101 | "value": "三台县"
|
25102 | }, {
|
25103 | "key": "510723",
|
25104 | "value": "盐亭县"
|
25105 | }, {
|
25106 | "key": "510725",
|
25107 | "value": "梓潼县"
|
25108 | }, {
|
25109 | "key": "510726",
|
25110 | "value": "北川羌族自治县"
|
25111 | }, {
|
25112 | "key": "510727",
|
25113 | "value": "平武县"
|
25114 | }, {
|
25115 | "key": "510781",
|
25116 | "value": "江油市"
|
25117 | }]
|
25118 | }, {
|
25119 | "key": "510800",
|
25120 | "value": "广元市",
|
25121 | "children": [{
|
25122 | "key": "510802",
|
25123 | "value": "利州区"
|
25124 | }, {
|
25125 | "key": "510811",
|
25126 | "value": "元坝区"
|
25127 | }, {
|
25128 | "key": "510812",
|
25129 | "value": "朝天区"
|
25130 | }, {
|
25131 | "key": "510821",
|
25132 | "value": "旺苍县"
|
25133 | }, {
|
25134 | "key": "510822",
|
25135 | "value": "青川县"
|
25136 | }, {
|
25137 | "key": "510823",
|
25138 | "value": "剑阁县"
|
25139 | }, {
|
25140 | "key": "510824",
|
25141 | "value": "苍溪县"
|
25142 | }]
|
25143 | }, {
|
25144 | "key": "510900",
|
25145 | "value": "遂宁市",
|
25146 | "children": [{
|
25147 | "key": "510903",
|
25148 | "value": "船山区"
|
25149 | }, {
|
25150 | "key": "510904",
|
25151 | "value": "安居区"
|
25152 | }, {
|
25153 | "key": "510921",
|
25154 | "value": "蓬溪县"
|
25155 | }, {
|
25156 | "key": "510922",
|
25157 | "value": "射洪县"
|
25158 | }, {
|
25159 | "key": "510923",
|
25160 | "value": "大英县"
|
25161 | }]
|
25162 | }, {
|
25163 | "key": "511000",
|
25164 | "value": "内江市",
|
25165 | "children": [{
|
25166 | "key": "511002",
|
25167 | "value": "市中区"
|
25168 | }, {
|
25169 | "key": "511011",
|
25170 | "value": "东兴区"
|
25171 | }, {
|
25172 | "key": "511024",
|
25173 | "value": "威远县"
|
25174 | }, {
|
25175 | "key": "511025",
|
25176 | "value": "资中县"
|
25177 | }, {
|
25178 | "key": "511083",
|
25179 | "value": "隆昌市"
|
25180 | }]
|
25181 | }, {
|
25182 | "key": "511100",
|
25183 | "value": "乐山市",
|
25184 | "children": [{
|
25185 | "key": "511102",
|
25186 | "value": "市中区"
|
25187 | }, {
|
25188 | "key": "511111",
|
25189 | "value": "沙湾区"
|
25190 | }, {
|
25191 | "key": "511112",
|
25192 | "value": "五通桥区"
|
25193 | }, {
|
25194 | "key": "511113",
|
25195 | "value": "金口河区"
|
25196 | }, {
|
25197 | "key": "511123",
|
25198 | "value": "犍为县"
|
25199 | }, {
|
25200 | "key": "511124",
|
25201 | "value": "井研县"
|
25202 | }, {
|
25203 | "key": "511126",
|
25204 | "value": "夹江县"
|
25205 | }, {
|
25206 | "key": "511129",
|
25207 | "value": "沐川县"
|
25208 | }, {
|
25209 | "key": "511132",
|
25210 | "value": "峨边彝族自治县"
|
25211 | }, {
|
25212 | "key": "511133",
|
25213 | "value": "马边彝族自治县"
|
25214 | }, {
|
25215 | "key": "511181",
|
25216 | "value": "峨眉山市"
|
25217 | }]
|
25218 | }, {
|
25219 | "key": "511300",
|
25220 | "value": "南充市",
|
25221 | "children": [{
|
25222 | "key": "511302",
|
25223 | "value": "顺庆区"
|
25224 | }, {
|
25225 | "key": "511303",
|
25226 | "value": "高坪区"
|
25227 | }, {
|
25228 | "key": "511304",
|
25229 | "value": "嘉陵区"
|
25230 | }, {
|
25231 | "key": "511321",
|
25232 | "value": "南部县"
|
25233 | }, {
|
25234 | "key": "511322",
|
25235 | "value": "营山县"
|
25236 | }, {
|
25237 | "key": "511323",
|
25238 | "value": "蓬安县"
|
25239 | }, {
|
25240 | "key": "511324",
|
25241 | "value": "仪陇县"
|
25242 | }, {
|
25243 | "key": "511325",
|
25244 | "value": "西充县"
|
25245 | }, {
|
25246 | "key": "511381",
|
25247 | "value": "阆中市"
|
25248 | }]
|
25249 | }, {
|
25250 | "key": "511400",
|
25251 | "value": "眉山市",
|
25252 | "children": [{
|
25253 | "key": "511402",
|
25254 | "value": "东坡区"
|
25255 | }, {
|
25256 | "key": "511403",
|
25257 | "value": "彭山区"
|
25258 | }, {
|
25259 | "key": "511421",
|
25260 | "value": "仁寿县"
|
25261 | }, {
|
25262 | "key": "511423",
|
25263 | "value": "洪雅县"
|
25264 | }, {
|
25265 | "key": "511424",
|
25266 | "value": "丹棱县"
|
25267 | }, {
|
25268 | "key": "511425",
|
25269 | "value": "青神县"
|
25270 | }]
|
25271 | }, {
|
25272 | "key": "511500",
|
25273 | "value": "宜宾市",
|
25274 | "children": [{
|
25275 | "key": "511502",
|
25276 | "value": "翠屏区"
|
25277 | }, {
|
25278 | "key": "511503",
|
25279 | "value": "南溪区"
|
25280 | }, {
|
25281 | "key": "511521",
|
25282 | "value": "宜宾县"
|
25283 | }, {
|
25284 | "key": "511523",
|
25285 | "value": "江安县"
|
25286 | }, {
|
25287 | "key": "511524",
|
25288 | "value": "长宁县"
|
25289 | }, {
|
25290 | "key": "511525",
|
25291 | "value": "高县"
|
25292 | }, {
|
25293 | "key": "511526",
|
25294 | "value": "珙县"
|
25295 | }, {
|
25296 | "key": "511527",
|
25297 | "value": "筠连县"
|
25298 | }, {
|
25299 | "key": "511528",
|
25300 | "value": "兴文县"
|
25301 | }, {
|
25302 | "key": "511529",
|
25303 | "value": "屏山县"
|
25304 | }]
|
25305 | }, {
|
25306 | "key": "511600",
|
25307 | "value": "广安市",
|
25308 | "children": [{
|
25309 | "key": "511602",
|
25310 | "value": "广安区"
|
25311 | }, {
|
25312 | "key": "511603",
|
25313 | "value": "前锋区"
|
25314 | }, {
|
25315 | "key": "511621",
|
25316 | "value": "岳池县"
|
25317 | }, {
|
25318 | "key": "511622",
|
25319 | "value": "武胜县"
|
25320 | }, {
|
25321 | "key": "511623",
|
25322 | "value": "邻水县"
|
25323 | }, {
|
25324 | "key": "511681",
|
25325 | "value": "华蓥市"
|
25326 | }]
|
25327 | }, {
|
25328 | "key": "511700",
|
25329 | "value": "达州市",
|
25330 | "children": [{
|
25331 | "key": "511702",
|
25332 | "value": "通川区"
|
25333 | }, {
|
25334 | "key": "511703",
|
25335 | "value": "达川区"
|
25336 | }, {
|
25337 | "key": "511722",
|
25338 | "value": "宣汉县"
|
25339 | }, {
|
25340 | "key": "511723",
|
25341 | "value": "开江县"
|
25342 | }, {
|
25343 | "key": "511724",
|
25344 | "value": "大竹县"
|
25345 | }, {
|
25346 | "key": "511725",
|
25347 | "value": "渠县"
|
25348 | }, {
|
25349 | "key": "511781",
|
25350 | "value": "万源市"
|
25351 | }]
|
25352 | }, {
|
25353 | "key": "511800",
|
25354 | "value": "雅安市",
|
25355 | "children": [{
|
25356 | "key": "511802",
|
25357 | "value": "雨城区"
|
25358 | }, {
|
25359 | "key": "511803",
|
25360 | "value": "名山区"
|
25361 | }, {
|
25362 | "key": "511822",
|
25363 | "value": "荥经县"
|
25364 | }, {
|
25365 | "key": "511823",
|
25366 | "value": "汉源县"
|
25367 | }, {
|
25368 | "key": "511824",
|
25369 | "value": "石棉县"
|
25370 | }, {
|
25371 | "key": "511825",
|
25372 | "value": "天全县"
|
25373 | }, {
|
25374 | "key": "511826",
|
25375 | "value": "芦山县"
|
25376 | }, {
|
25377 | "key": "511827",
|
25378 | "value": "宝兴县"
|
25379 | }]
|
25380 | }, {
|
25381 | "key": "511900",
|
25382 | "value": "巴中市",
|
25383 | "children": [{
|
25384 | "key": "511902",
|
25385 | "value": "巴州区"
|
25386 | }, {
|
25387 | "key": "511903",
|
25388 | "value": "恩阳区"
|
25389 | }, {
|
25390 | "key": "511921",
|
25391 | "value": "通江县"
|
25392 | }, {
|
25393 | "key": "511922",
|
25394 | "value": "南江县"
|
25395 | }, {
|
25396 | "key": "511923",
|
25397 | "value": "平昌县"
|
25398 | }]
|
25399 | }, {
|
25400 | "key": "512000",
|
25401 | "value": "资阳市",
|
25402 | "children": [{
|
25403 | "key": "512002",
|
25404 | "value": "雁江区"
|
25405 | }, {
|
25406 | "key": "512021",
|
25407 | "value": "安岳县"
|
25408 | }, {
|
25409 | "key": "512022",
|
25410 | "value": "乐至县"
|
25411 | }]
|
25412 | }, {
|
25413 | "key": "513200",
|
25414 | "value": "阿坝藏族羌族自治州",
|
25415 | "children": [{
|
25416 | "key": "513201",
|
25417 | "value": "马尔康市"
|
25418 | }, {
|
25419 | "key": "513221",
|
25420 | "value": "汶川县"
|
25421 | }, {
|
25422 | "key": "513222",
|
25423 | "value": "理县"
|
25424 | }, {
|
25425 | "key": "513223",
|
25426 | "value": "茂县"
|
25427 | }, {
|
25428 | "key": "513224",
|
25429 | "value": "松潘县"
|
25430 | }, {
|
25431 | "key": "513225",
|
25432 | "value": "九寨沟县"
|
25433 | }, {
|
25434 | "key": "513226",
|
25435 | "value": "金川县"
|
25436 | }, {
|
25437 | "key": "513227",
|
25438 | "value": "小金县"
|
25439 | }, {
|
25440 | "key": "513228",
|
25441 | "value": "黑水县"
|
25442 | }, {
|
25443 | "key": "513230",
|
25444 | "value": "壤塘县"
|
25445 | }, {
|
25446 | "key": "513231",
|
25447 | "value": "阿坝县"
|
25448 | }, {
|
25449 | "key": "513232",
|
25450 | "value": "若尔盖县"
|
25451 | }, {
|
25452 | "key": "513233",
|
25453 | "value": "红原县"
|
25454 | }]
|
25455 | }, {
|
25456 | "key": "513300",
|
25457 | "value": "甘孜藏族自治州",
|
25458 | "children": [{
|
25459 | "key": "513301",
|
25460 | "value": "康定市"
|
25461 | }, {
|
25462 | "key": "513322",
|
25463 | "value": "泸定县"
|
25464 | }, {
|
25465 | "key": "513323",
|
25466 | "value": "丹巴县"
|
25467 | }, {
|
25468 | "key": "513324",
|
25469 | "value": "九龙县"
|
25470 | }, {
|
25471 | "key": "513325",
|
25472 | "value": "雅江县"
|
25473 | }, {
|
25474 | "key": "513326",
|
25475 | "value": "道孚县"
|
25476 | }, {
|
25477 | "key": "513327",
|
25478 | "value": "炉霍县"
|
25479 | }, {
|
25480 | "key": "513328",
|
25481 | "value": "甘孜县"
|
25482 | }, {
|
25483 | "key": "513329",
|
25484 | "value": "新龙县"
|
25485 | }, {
|
25486 | "key": "513330",
|
25487 | "value": "德格县"
|
25488 | }, {
|
25489 | "key": "513331",
|
25490 | "value": "白玉县"
|
25491 | }, {
|
25492 | "key": "513332",
|
25493 | "value": "石渠县"
|
25494 | }, {
|
25495 | "key": "513333",
|
25496 | "value": "色达县"
|
25497 | }, {
|
25498 | "key": "513334",
|
25499 | "value": "理塘县"
|
25500 | }, {
|
25501 | "key": "513335",
|
25502 | "value": "巴塘县"
|
25503 | }, {
|
25504 | "key": "513336",
|
25505 | "value": "乡城县"
|
25506 | }, {
|
25507 | "key": "513337",
|
25508 | "value": "稻城县"
|
25509 | }, {
|
25510 | "key": "513338",
|
25511 | "value": "得荣县"
|
25512 | }]
|
25513 | }, {
|
25514 | "key": "513400",
|
25515 | "value": "凉山彝族自治州",
|
25516 | "children": [{
|
25517 | "key": "513401",
|
25518 | "value": "西昌市"
|
25519 | }, {
|
25520 | "key": "513422",
|
25521 | "value": "木里藏族自治县"
|
25522 | }, {
|
25523 | "key": "513423",
|
25524 | "value": "盐源县"
|
25525 | }, {
|
25526 | "key": "513424",
|
25527 | "value": "德昌县"
|
25528 | }, {
|
25529 | "key": "513425",
|
25530 | "value": "会理县"
|
25531 | }, {
|
25532 | "key": "513426",
|
25533 | "value": "会东县"
|
25534 | }, {
|
25535 | "key": "513427",
|
25536 | "value": "宁南县"
|
25537 | }, {
|
25538 | "key": "513428",
|
25539 | "value": "普格县"
|
25540 | }, {
|
25541 | "key": "513429",
|
25542 | "value": "布拖县"
|
25543 | }, {
|
25544 | "key": "513430",
|
25545 | "value": "金阳县"
|
25546 | }, {
|
25547 | "key": "513431",
|
25548 | "value": "昭觉县"
|
25549 | }, {
|
25550 | "key": "513432",
|
25551 | "value": "喜德县"
|
25552 | }, {
|
25553 | "key": "513433",
|
25554 | "value": "冕宁县"
|
25555 | }, {
|
25556 | "key": "513434",
|
25557 | "value": "越西县"
|
25558 | }, {
|
25559 | "key": "513435",
|
25560 | "value": "甘洛县"
|
25561 | }, {
|
25562 | "key": "513436",
|
25563 | "value": "美姑县"
|
25564 | }, {
|
25565 | "key": "513437",
|
25566 | "value": "雷波县"
|
25567 | }]
|
25568 | }]
|
25569 | }, {
|
25570 | "key": "520000",
|
25571 | "value": "贵州",
|
25572 | "children": [{
|
25573 | "key": "520100",
|
25574 | "value": "贵阳市",
|
25575 | "children": [{
|
25576 | "key": "520102",
|
25577 | "value": "南明区"
|
25578 | }, {
|
25579 | "key": "520103",
|
25580 | "value": "云岩区"
|
25581 | }, {
|
25582 | "key": "520111",
|
25583 | "value": "花溪区"
|
25584 | }, {
|
25585 | "key": "520112",
|
25586 | "value": "乌当区"
|
25587 | }, {
|
25588 | "key": "520113",
|
25589 | "value": "白云区"
|
25590 | }, {
|
25591 | "key": "520115",
|
25592 | "value": "观山湖区"
|
25593 | }, {
|
25594 | "key": "520121",
|
25595 | "value": "开阳县"
|
25596 | }, {
|
25597 | "key": "520122",
|
25598 | "value": "息烽县"
|
25599 | }, {
|
25600 | "key": "520123",
|
25601 | "value": "修文县"
|
25602 | }, {
|
25603 | "key": "520181",
|
25604 | "value": "清镇市"
|
25605 | }]
|
25606 | }, {
|
25607 | "key": "520200",
|
25608 | "value": "六盘水市",
|
25609 | "children": [{
|
25610 | "key": "520201",
|
25611 | "value": "钟山区"
|
25612 | }, {
|
25613 | "key": "520203",
|
25614 | "value": "六枝特区"
|
25615 | }, {
|
25616 | "key": "520221",
|
25617 | "value": "水城县"
|
25618 | }, {
|
25619 | "key": "520281",
|
25620 | "value": "盘州市"
|
25621 | }]
|
25622 | }, {
|
25623 | "key": "520300",
|
25624 | "value": "遵义市",
|
25625 | "children": [{
|
25626 | "key": "520302",
|
25627 | "value": "红花岗区"
|
25628 | }, {
|
25629 | "key": "520303",
|
25630 | "value": "汇川区"
|
25631 | }, {
|
25632 | "key": "520304",
|
25633 | "value": "播州区"
|
25634 | }, {
|
25635 | "key": "520322",
|
25636 | "value": "桐梓县"
|
25637 | }, {
|
25638 | "key": "520323",
|
25639 | "value": "绥阳县"
|
25640 | }, {
|
25641 | "key": "520324",
|
25642 | "value": "正安县"
|
25643 | }, {
|
25644 | "key": "520325",
|
25645 | "value": "道真仡佬族苗族自治县"
|
25646 | }, {
|
25647 | "key": "520326",
|
25648 | "value": "务川仡佬族苗族自治县"
|
25649 | }, {
|
25650 | "key": "520327",
|
25651 | "value": "凤冈县"
|
25652 | }, {
|
25653 | "key": "520328",
|
25654 | "value": "湄潭县"
|
25655 | }, {
|
25656 | "key": "520329",
|
25657 | "value": "余庆县"
|
25658 | }, {
|
25659 | "key": "520330",
|
25660 | "value": "习水县"
|
25661 | }, {
|
25662 | "key": "520381",
|
25663 | "value": "赤水市"
|
25664 | }, {
|
25665 | "key": "520382",
|
25666 | "value": "仁怀市"
|
25667 | }]
|
25668 | }, {
|
25669 | "key": "520400",
|
25670 | "value": "安顺市",
|
25671 | "children": [{
|
25672 | "key": "520402",
|
25673 | "value": "西秀区"
|
25674 | }, {
|
25675 | "key": "520403",
|
25676 | "value": "平坝区"
|
25677 | }, {
|
25678 | "key": "520422",
|
25679 | "value": "普定县"
|
25680 | }, {
|
25681 | "key": "520423",
|
25682 | "value": "镇宁布依族苗族自治县"
|
25683 | }, {
|
25684 | "key": "520424",
|
25685 | "value": "关岭布依族苗族自治县"
|
25686 | }, {
|
25687 | "key": "520425",
|
25688 | "value": "紫云苗族布依族自治县"
|
25689 | }]
|
25690 | }, {
|
25691 | "key": "520500",
|
25692 | "value": "毕节市",
|
25693 | "children": [{
|
25694 | "key": "520502",
|
25695 | "value": "七星关区"
|
25696 | }, {
|
25697 | "key": "520521",
|
25698 | "value": "大方县"
|
25699 | }, {
|
25700 | "key": "520522",
|
25701 | "value": "黔西县"
|
25702 | }, {
|
25703 | "key": "520523",
|
25704 | "value": "金沙县"
|
25705 | }, {
|
25706 | "key": "520524",
|
25707 | "value": "织金县"
|
25708 | }, {
|
25709 | "key": "520525",
|
25710 | "value": "纳雍县"
|
25711 | }, {
|
25712 | "key": "520526",
|
25713 | "value": "威宁彝族回族苗族自治县"
|
25714 | }, {
|
25715 | "key": "520527",
|
25716 | "value": "赫章县"
|
25717 | }]
|
25718 | }, {
|
25719 | "key": "520600",
|
25720 | "value": "铜仁市",
|
25721 | "children": [{
|
25722 | "key": "520602",
|
25723 | "value": "碧江区"
|
25724 | }, {
|
25725 | "key": "520603",
|
25726 | "value": "万山区"
|
25727 | }, {
|
25728 | "key": "520621",
|
25729 | "value": "江口县"
|
25730 | }, {
|
25731 | "key": "520622",
|
25732 | "value": "玉屏侗族自治县"
|
25733 | }, {
|
25734 | "key": "520623",
|
25735 | "value": "石阡县"
|
25736 | }, {
|
25737 | "key": "520624",
|
25738 | "value": "思南县"
|
25739 | }, {
|
25740 | "key": "520625",
|
25741 | "value": "印江土家族苗族自治县"
|
25742 | }, {
|
25743 | "key": "520626",
|
25744 | "value": "德江县"
|
25745 | }, {
|
25746 | "key": "520627",
|
25747 | "value": "沿河土家族自治县"
|
25748 | }, {
|
25749 | "key": "520628",
|
25750 | "value": "松桃苗族自治县"
|
25751 | }]
|
25752 | }, {
|
25753 | "key": "522300",
|
25754 | "value": "黔西南布依族苗族自治州",
|
25755 | "children": [{
|
25756 | "key": "522301",
|
25757 | "value": "兴义市"
|
25758 | }, {
|
25759 | "key": "522322",
|
25760 | "value": "兴仁县"
|
25761 | }, {
|
25762 | "key": "522323",
|
25763 | "value": "普安县"
|
25764 | }, {
|
25765 | "key": "522324",
|
25766 | "value": "晴隆县"
|
25767 | }, {
|
25768 | "key": "522325",
|
25769 | "value": "贞丰县"
|
25770 | }, {
|
25771 | "key": "522326",
|
25772 | "value": "望谟县"
|
25773 | }, {
|
25774 | "key": "522327",
|
25775 | "value": "册亨县"
|
25776 | }, {
|
25777 | "key": "522328",
|
25778 | "value": "安龙县"
|
25779 | }]
|
25780 | }, {
|
25781 | "key": "522600",
|
25782 | "value": "黔东南苗族侗族自治州",
|
25783 | "children": [{
|
25784 | "key": "522601",
|
25785 | "value": "凯里市"
|
25786 | }, {
|
25787 | "key": "522622",
|
25788 | "value": "黄平县"
|
25789 | }, {
|
25790 | "key": "522623",
|
25791 | "value": "施秉县"
|
25792 | }, {
|
25793 | "key": "522624",
|
25794 | "value": "三穗县"
|
25795 | }, {
|
25796 | "key": "522625",
|
25797 | "value": "镇远县"
|
25798 | }, {
|
25799 | "key": "522626",
|
25800 | "value": "岑巩县"
|
25801 | }, {
|
25802 | "key": "522627",
|
25803 | "value": "天柱县"
|
25804 | }, {
|
25805 | "key": "522628",
|
25806 | "value": "锦屏县"
|
25807 | }, {
|
25808 | "key": "522629",
|
25809 | "value": "剑河县"
|
25810 | }, {
|
25811 | "key": "522630",
|
25812 | "value": "台江县"
|
25813 | }, {
|
25814 | "key": "522631",
|
25815 | "value": "黎平县"
|
25816 | }, {
|
25817 | "key": "522632",
|
25818 | "value": "榕江县"
|
25819 | }, {
|
25820 | "key": "522633",
|
25821 | "value": "从江县"
|
25822 | }, {
|
25823 | "key": "522634",
|
25824 | "value": "雷山县"
|
25825 | }, {
|
25826 | "key": "522635",
|
25827 | "value": "麻江县"
|
25828 | }, {
|
25829 | "key": "522636",
|
25830 | "value": "丹寨县"
|
25831 | }]
|
25832 | }, {
|
25833 | "key": "522700",
|
25834 | "value": "黔南布依族苗族自治州",
|
25835 | "children": [{
|
25836 | "key": "522701",
|
25837 | "value": "都匀市"
|
25838 | }, {
|
25839 | "key": "522702",
|
25840 | "value": "福泉市"
|
25841 | }, {
|
25842 | "key": "522722",
|
25843 | "value": "荔波县"
|
25844 | }, {
|
25845 | "key": "522723",
|
25846 | "value": "贵定县"
|
25847 | }, {
|
25848 | "key": "522725",
|
25849 | "value": "瓮安县"
|
25850 | }, {
|
25851 | "key": "522726",
|
25852 | "value": "独山县"
|
25853 | }, {
|
25854 | "key": "522727",
|
25855 | "value": "平塘县"
|
25856 | }, {
|
25857 | "key": "522728",
|
25858 | "value": "罗甸县"
|
25859 | }, {
|
25860 | "key": "522729",
|
25861 | "value": "长顺县"
|
25862 | }, {
|
25863 | "key": "522730",
|
25864 | "value": "龙里县"
|
25865 | }, {
|
25866 | "key": "522731",
|
25867 | "value": "惠水县"
|
25868 | }, {
|
25869 | "key": "522732",
|
25870 | "value": "三都水族自治县"
|
25871 | }]
|
25872 | }]
|
25873 | }, {
|
25874 | "key": "530000",
|
25875 | "value": "云南",
|
25876 | "children": [{
|
25877 | "key": "530100",
|
25878 | "value": "昆明市",
|
25879 | "children": [{
|
25880 | "key": "530102",
|
25881 | "value": "五华区"
|
25882 | }, {
|
25883 | "key": "530103",
|
25884 | "value": "盘龙区"
|
25885 | }, {
|
25886 | "key": "530111",
|
25887 | "value": "官渡区"
|
25888 | }, {
|
25889 | "key": "530112",
|
25890 | "value": "西山区"
|
25891 | }, {
|
25892 | "key": "530113",
|
25893 | "value": "东川区"
|
25894 | }, {
|
25895 | "key": "530114",
|
25896 | "value": "呈贡区"
|
25897 | }, {
|
25898 | "key": "530115",
|
25899 | "value": "晋宁区"
|
25900 | }, {
|
25901 | "key": "530124",
|
25902 | "value": "富民县"
|
25903 | }, {
|
25904 | "key": "530125",
|
25905 | "value": "宜良县"
|
25906 | }, {
|
25907 | "key": "530126",
|
25908 | "value": "石林彝族自治县"
|
25909 | }, {
|
25910 | "key": "530127",
|
25911 | "value": "嵩明县"
|
25912 | }, {
|
25913 | "key": "530128",
|
25914 | "value": "禄劝彝族苗族自治县"
|
25915 | }, {
|
25916 | "key": "530129",
|
25917 | "value": "寻甸回族彝族自治县"
|
25918 | }, {
|
25919 | "key": "530181",
|
25920 | "value": "安宁市"
|
25921 | }]
|
25922 | }, {
|
25923 | "key": "530300",
|
25924 | "value": "曲靖市",
|
25925 | "children": [{
|
25926 | "key": "530302",
|
25927 | "value": "麒麟区"
|
25928 | }, {
|
25929 | "key": "530303",
|
25930 | "value": "沾益区"
|
25931 | }, {
|
25932 | "key": "530304",
|
25933 | "value": "马龙区"
|
25934 | }, {
|
25935 | "key": "530322",
|
25936 | "value": "陆良县"
|
25937 | }, {
|
25938 | "key": "530323",
|
25939 | "value": "师宗县"
|
25940 | }, {
|
25941 | "key": "530324",
|
25942 | "value": "罗平县"
|
25943 | }, {
|
25944 | "key": "530325",
|
25945 | "value": "富源县"
|
25946 | }, {
|
25947 | "key": "530326",
|
25948 | "value": "会泽县"
|
25949 | }, {
|
25950 | "key": "530381",
|
25951 | "value": "宣威市"
|
25952 | }]
|
25953 | }, {
|
25954 | "key": "530400",
|
25955 | "value": "玉溪市",
|
25956 | "children": [{
|
25957 | "key": "530402",
|
25958 | "value": "红塔区"
|
25959 | }, {
|
25960 | "key": "530403",
|
25961 | "value": "江川区"
|
25962 | }, {
|
25963 | "key": "530422",
|
25964 | "value": "澄江县"
|
25965 | }, {
|
25966 | "key": "530423",
|
25967 | "value": "通海县"
|
25968 | }, {
|
25969 | "key": "530424",
|
25970 | "value": "华宁县"
|
25971 | }, {
|
25972 | "key": "530425",
|
25973 | "value": "易门县"
|
25974 | }, {
|
25975 | "key": "530426",
|
25976 | "value": "峨山彝族自治县"
|
25977 | }, {
|
25978 | "key": "530427",
|
25979 | "value": "新平彝族傣族自治县"
|
25980 | }, {
|
25981 | "key": "530428",
|
25982 | "value": "元江哈尼族彝族傣族自治县"
|
25983 | }]
|
25984 | }, {
|
25985 | "key": "530500",
|
25986 | "value": "保山市",
|
25987 | "children": [{
|
25988 | "key": "530502",
|
25989 | "value": "隆阳区"
|
25990 | }, {
|
25991 | "key": "530521",
|
25992 | "value": "施甸县"
|
25993 | }, {
|
25994 | "key": "530523",
|
25995 | "value": "龙陵县"
|
25996 | }, {
|
25997 | "key": "530524",
|
25998 | "value": "昌宁县"
|
25999 | }, {
|
26000 | "key": "530581",
|
26001 | "value": "腾冲市"
|
26002 | }]
|
26003 | }, {
|
26004 | "key": "530600",
|
26005 | "value": "昭通市",
|
26006 | "children": [{
|
26007 | "key": "530602",
|
26008 | "value": "昭阳区"
|
26009 | }, {
|
26010 | "key": "530621",
|
26011 | "value": "鲁甸县"
|
26012 | }, {
|
26013 | "key": "530622",
|
26014 | "value": "巧家县"
|
26015 | }, {
|
26016 | "key": "530623",
|
26017 | "value": "盐津县"
|
26018 | }, {
|
26019 | "key": "530624",
|
26020 | "value": "大关县"
|
26021 | }, {
|
26022 | "key": "530625",
|
26023 | "value": "永善县"
|
26024 | }, {
|
26025 | "key": "530626",
|
26026 | "value": "绥江县"
|
26027 | }, {
|
26028 | "key": "530627",
|
26029 | "value": "镇雄县"
|
26030 | }, {
|
26031 | "key": "530628",
|
26032 | "value": "彝良县"
|
26033 | }, {
|
26034 | "key": "530629",
|
26035 | "value": "威信县"
|
26036 | }, {
|
26037 | "key": "530681",
|
26038 | "value": "水富市"
|
26039 | }]
|
26040 | }, {
|
26041 | "key": "530700",
|
26042 | "value": "丽江市",
|
26043 | "children": [{
|
26044 | "key": "530702",
|
26045 | "value": "古城区"
|
26046 | }, {
|
26047 | "key": "530721",
|
26048 | "value": "玉龙纳西族自治县"
|
26049 | }, {
|
26050 | "key": "530722",
|
26051 | "value": "永胜县"
|
26052 | }, {
|
26053 | "key": "530723",
|
26054 | "value": "华坪县"
|
26055 | }, {
|
26056 | "key": "530724",
|
26057 | "value": "宁蒗彝族自治县"
|
26058 | }]
|
26059 | }, {
|
26060 | "key": "530800",
|
26061 | "value": "普洱市",
|
26062 | "children": [{
|
26063 | "key": "530802",
|
26064 | "value": "思茅区"
|
26065 | }, {
|
26066 | "key": "530821",
|
26067 | "value": "宁洱哈尼族彝族自治县"
|
26068 | }, {
|
26069 | "key": "530822",
|
26070 | "value": "墨江哈尼族自治县"
|
26071 | }, {
|
26072 | "key": "530823",
|
26073 | "value": "景东彝族自治县"
|
26074 | }, {
|
26075 | "key": "530824",
|
26076 | "value": "景谷傣族彝族自治县"
|
26077 | }, {
|
26078 | "key": "530825",
|
26079 | "value": "镇沅彝族哈尼族拉祜族自治县"
|
26080 | }, {
|
26081 | "key": "530826",
|
26082 | "value": "江城哈尼族彝族自治县"
|
26083 | }, {
|
26084 | "key": "530827",
|
26085 | "value": "孟连傣族拉祜族佤族自治县"
|
26086 | }, {
|
26087 | "key": "530828",
|
26088 | "value": "澜沧拉祜族自治县"
|
26089 | }, {
|
26090 | "key": "530829",
|
26091 | "value": "西盟佤族自治县"
|
26092 | }]
|
26093 | }, {
|
26094 | "key": "530900",
|
26095 | "value": "临沧市",
|
26096 | "children": [{
|
26097 | "key": "530902",
|
26098 | "value": "临翔区"
|
26099 | }, {
|
26100 | "key": "530921",
|
26101 | "value": "凤庆县"
|
26102 | }, {
|
26103 | "key": "530922",
|
26104 | "value": "云县"
|
26105 | }, {
|
26106 | "key": "530923",
|
26107 | "value": "永德县"
|
26108 | }, {
|
26109 | "key": "530924",
|
26110 | "value": "镇康县"
|
26111 | }, {
|
26112 | "key": "530925",
|
26113 | "value": "双江拉祜族佤族布朗族傣族自治县"
|
26114 | }, {
|
26115 | "key": "530926",
|
26116 | "value": "耿马傣族佤族自治县"
|
26117 | }, {
|
26118 | "key": "530927",
|
26119 | "value": "沧源佤族自治县"
|
26120 | }]
|
26121 | }, {
|
26122 | "key": "532300",
|
26123 | "value": "楚雄彝族自治州",
|
26124 | "children": [{
|
26125 | "key": "532301",
|
26126 | "value": "楚雄市"
|
26127 | }, {
|
26128 | "key": "532322",
|
26129 | "value": "双柏县"
|
26130 | }, {
|
26131 | "key": "532323",
|
26132 | "value": "牟定县"
|
26133 | }, {
|
26134 | "key": "532324",
|
26135 | "value": "南华县"
|
26136 | }, {
|
26137 | "key": "532325",
|
26138 | "value": "姚安县"
|
26139 | }, {
|
26140 | "key": "532326",
|
26141 | "value": "大姚县"
|
26142 | }, {
|
26143 | "key": "532327",
|
26144 | "value": "永仁县"
|
26145 | }, {
|
26146 | "key": "532328",
|
26147 | "value": "元谋县"
|
26148 | }, {
|
26149 | "key": "532329",
|
26150 | "value": "武定县"
|
26151 | }, {
|
26152 | "key": "532331",
|
26153 | "value": "禄丰县"
|
26154 | }]
|
26155 | }, {
|
26156 | "key": "532500",
|
26157 | "value": "红河哈尼族彝族自治州",
|
26158 | "children": [{
|
26159 | "key": "532501",
|
26160 | "value": "个旧市"
|
26161 | }, {
|
26162 | "key": "532502",
|
26163 | "value": "开远市"
|
26164 | }, {
|
26165 | "key": "532503",
|
26166 | "value": "蒙自市"
|
26167 | }, {
|
26168 | "key": "532504",
|
26169 | "value": "弥勒市"
|
26170 | }, {
|
26171 | "key": "532523",
|
26172 | "value": "屏边苗族自治县"
|
26173 | }, {
|
26174 | "key": "532524",
|
26175 | "value": "建水县"
|
26176 | }, {
|
26177 | "key": "532525",
|
26178 | "value": "石屏县"
|
26179 | }, {
|
26180 | "key": "532527",
|
26181 | "value": "泸西县"
|
26182 | }, {
|
26183 | "key": "532528",
|
26184 | "value": "元阳县"
|
26185 | }, {
|
26186 | "key": "532529",
|
26187 | "value": "红河县"
|
26188 | }, {
|
26189 | "key": "532530",
|
26190 | "value": "金平苗族瑶族傣族自治县"
|
26191 | }, {
|
26192 | "key": "532531",
|
26193 | "value": "绿春县"
|
26194 | }, {
|
26195 | "key": "532532",
|
26196 | "value": "河口瑶族自治县"
|
26197 | }]
|
26198 | }, {
|
26199 | "key": "532600",
|
26200 | "value": "文山壮族苗族自治州",
|
26201 | "children": [{
|
26202 | "key": "532601",
|
26203 | "value": "文山市"
|
26204 | }, {
|
26205 | "key": "532622",
|
26206 | "value": "砚山县"
|
26207 | }, {
|
26208 | "key": "532623",
|
26209 | "value": "西畴县"
|
26210 | }, {
|
26211 | "key": "532624",
|
26212 | "value": "麻栗坡县"
|
26213 | }, {
|
26214 | "key": "532625",
|
26215 | "value": "马关县"
|
26216 | }, {
|
26217 | "key": "532626",
|
26218 | "value": "丘北县"
|
26219 | }, {
|
26220 | "key": "532627",
|
26221 | "value": "广南县"
|
26222 | }, {
|
26223 | "key": "532628",
|
26224 | "value": "富宁县"
|
26225 | }]
|
26226 | }, {
|
26227 | "key": "532800",
|
26228 | "value": "西双版纳傣族自治州",
|
26229 | "children": [{
|
26230 | "key": "532801",
|
26231 | "value": "景洪市"
|
26232 | }, {
|
26233 | "key": "532822",
|
26234 | "value": "勐海县"
|
26235 | }, {
|
26236 | "key": "532823",
|
26237 | "value": "勐腊县"
|
26238 | }]
|
26239 | }, {
|
26240 | "key": "532900",
|
26241 | "value": "大理白族自治州",
|
26242 | "children": [{
|
26243 | "key": "532901",
|
26244 | "value": "大理市"
|
26245 | }, {
|
26246 | "key": "532922",
|
26247 | "value": "漾濞彝族自治县"
|
26248 | }, {
|
26249 | "key": "532923",
|
26250 | "value": "祥云县"
|
26251 | }, {
|
26252 | "key": "532924",
|
26253 | "value": "宾川县"
|
26254 | }, {
|
26255 | "key": "532925",
|
26256 | "value": "弥渡县"
|
26257 | }, {
|
26258 | "key": "532926",
|
26259 | "value": "南涧彝族自治县"
|
26260 | }, {
|
26261 | "key": "532927",
|
26262 | "value": "巍山彝族回族自治县"
|
26263 | }, {
|
26264 | "key": "532928",
|
26265 | "value": "永平县"
|
26266 | }, {
|
26267 | "key": "532929",
|
26268 | "value": "云龙县"
|
26269 | }, {
|
26270 | "key": "532930",
|
26271 | "value": "洱源县"
|
26272 | }, {
|
26273 | "key": "532931",
|
26274 | "value": "剑川县"
|
26275 | }, {
|
26276 | "key": "532932",
|
26277 | "value": "鹤庆县"
|
26278 | }]
|
26279 | }, {
|
26280 | "key": "533100",
|
26281 | "value": "德宏傣族景颇族自治州",
|
26282 | "children": [{
|
26283 | "key": "533102",
|
26284 | "value": "瑞丽市"
|
26285 | }, {
|
26286 | "key": "533103",
|
26287 | "value": "芒市"
|
26288 | }, {
|
26289 | "key": "533122",
|
26290 | "value": "梁河县"
|
26291 | }, {
|
26292 | "key": "533123",
|
26293 | "value": "盈江县"
|
26294 | }, {
|
26295 | "key": "533124",
|
26296 | "value": "陇川县"
|
26297 | }]
|
26298 | }, {
|
26299 | "key": "533300",
|
26300 | "value": "怒江傈僳族自治州",
|
26301 | "children": [{
|
26302 | "key": "533301",
|
26303 | "value": "泸水市"
|
26304 | }, {
|
26305 | "key": "533323",
|
26306 | "value": "福贡县"
|
26307 | }, {
|
26308 | "key": "533324",
|
26309 | "value": "贡山独龙族怒族自治县"
|
26310 | }, {
|
26311 | "key": "533325",
|
26312 | "value": "兰坪白族普米族自治县"
|
26313 | }]
|
26314 | }, {
|
26315 | "key": "533400",
|
26316 | "value": "迪庆藏族自治州",
|
26317 | "children": [{
|
26318 | "key": "533401",
|
26319 | "value": "香格里拉市"
|
26320 | }, {
|
26321 | "key": "533422",
|
26322 | "value": "德钦县"
|
26323 | }, {
|
26324 | "key": "533423",
|
26325 | "value": "维西傈僳族自治县"
|
26326 | }]
|
26327 | }]
|
26328 | }, {
|
26329 | "key": "540000",
|
26330 | "value": "西藏",
|
26331 | "children": [{
|
26332 | "key": "540100",
|
26333 | "value": "拉萨市",
|
26334 | "children": [{
|
26335 | "key": "540102",
|
26336 | "value": "城关区"
|
26337 | }, {
|
26338 | "key": "540103",
|
26339 | "value": "堆龙德庆区"
|
26340 | }, {
|
26341 | "key": "540104",
|
26342 | "value": "达孜区"
|
26343 | }, {
|
26344 | "key": "540121",
|
26345 | "value": "林周县"
|
26346 | }, {
|
26347 | "key": "540122",
|
26348 | "value": "当雄县"
|
26349 | }, {
|
26350 | "key": "540123",
|
26351 | "value": "尼木县"
|
26352 | }, {
|
26353 | "key": "540124",
|
26354 | "value": "曲水县"
|
26355 | }, {
|
26356 | "key": "540127",
|
26357 | "value": "墨竹工卡县"
|
26358 | }]
|
26359 | }, {
|
26360 | "key": "540200",
|
26361 | "value": "日喀则市",
|
26362 | "children": [{
|
26363 | "key": "540202",
|
26364 | "value": "桑珠孜区"
|
26365 | }, {
|
26366 | "key": "540221",
|
26367 | "value": "南木林县"
|
26368 | }, {
|
26369 | "key": "540222",
|
26370 | "value": "江孜县"
|
26371 | }, {
|
26372 | "key": "540223",
|
26373 | "value": "定日县"
|
26374 | }, {
|
26375 | "key": "540224",
|
26376 | "value": "萨迦县"
|
26377 | }, {
|
26378 | "key": "540225",
|
26379 | "value": "拉孜县"
|
26380 | }, {
|
26381 | "key": "540226",
|
26382 | "value": "昂仁县"
|
26383 | }, {
|
26384 | "key": "540227",
|
26385 | "value": "谢通门县"
|
26386 | }, {
|
26387 | "key": "540228",
|
26388 | "value": "白朗县"
|
26389 | }, {
|
26390 | "key": "540229",
|
26391 | "value": "仁布县"
|
26392 | }, {
|
26393 | "key": "540230",
|
26394 | "value": "康马县"
|
26395 | }, {
|
26396 | "key": "540231",
|
26397 | "value": "定结县"
|
26398 | }, {
|
26399 | "key": "540232",
|
26400 | "value": "仲巴县"
|
26401 | }, {
|
26402 | "key": "540233",
|
26403 | "value": "亚东县"
|
26404 | }, {
|
26405 | "key": "540234",
|
26406 | "value": "吉隆县"
|
26407 | }, {
|
26408 | "key": "540235",
|
26409 | "value": "聂拉木县"
|
26410 | }, {
|
26411 | "key": "540236",
|
26412 | "value": "萨嘎县"
|
26413 | }, {
|
26414 | "key": "540237",
|
26415 | "value": "岗巴县"
|
26416 | }]
|
26417 | }, {
|
26418 | "key": "540300",
|
26419 | "value": "昌都市",
|
26420 | "children": [{
|
26421 | "key": "540302",
|
26422 | "value": "卡若区"
|
26423 | }, {
|
26424 | "key": "540321",
|
26425 | "value": "江达县"
|
26426 | }, {
|
26427 | "key": "540322",
|
26428 | "value": "贡觉县"
|
26429 | }, {
|
26430 | "key": "540323",
|
26431 | "value": "类乌齐县"
|
26432 | }, {
|
26433 | "key": "540324",
|
26434 | "value": "丁青县"
|
26435 | }, {
|
26436 | "key": "540325",
|
26437 | "value": "察雅县"
|
26438 | }, {
|
26439 | "key": "540326",
|
26440 | "value": "八宿县"
|
26441 | }, {
|
26442 | "key": "540327",
|
26443 | "value": "左贡县"
|
26444 | }, {
|
26445 | "key": "540328",
|
26446 | "value": "芒康县"
|
26447 | }, {
|
26448 | "key": "540329",
|
26449 | "value": "洛隆县"
|
26450 | }, {
|
26451 | "key": "540330",
|
26452 | "value": "边坝县"
|
26453 | }]
|
26454 | }, {
|
26455 | "key": "540400",
|
26456 | "value": "林芝市",
|
26457 | "children": [{
|
26458 | "key": "540402",
|
26459 | "value": "巴宜区"
|
26460 | }, {
|
26461 | "key": "540421",
|
26462 | "value": "工布江达县"
|
26463 | }, {
|
26464 | "key": "540422",
|
26465 | "value": "米林县"
|
26466 | }, {
|
26467 | "key": "540423",
|
26468 | "value": "墨脱县"
|
26469 | }, {
|
26470 | "key": "540424",
|
26471 | "value": "波密县"
|
26472 | }, {
|
26473 | "key": "540425",
|
26474 | "value": "察隅县"
|
26475 | }, {
|
26476 | "key": "540426",
|
26477 | "value": "朗县"
|
26478 | }]
|
26479 | }, {
|
26480 | "key": "540500",
|
26481 | "value": "山南市",
|
26482 | "children": [{
|
26483 | "key": "540502",
|
26484 | "value": "乃东县"
|
26485 | }, {
|
26486 | "key": "540521",
|
26487 | "value": "扎囊县"
|
26488 | }, {
|
26489 | "key": "540522",
|
26490 | "value": "贡嘎县"
|
26491 | }, {
|
26492 | "key": "540523",
|
26493 | "value": "桑日县"
|
26494 | }, {
|
26495 | "key": "540524",
|
26496 | "value": "琼结县"
|
26497 | }, {
|
26498 | "key": "540525",
|
26499 | "value": "曲松县"
|
26500 | }, {
|
26501 | "key": "540526",
|
26502 | "value": "措美县"
|
26503 | }, {
|
26504 | "key": "540527",
|
26505 | "value": "洛扎县"
|
26506 | }, {
|
26507 | "key": "540528",
|
26508 | "value": "加查县"
|
26509 | }, {
|
26510 | "key": "540529",
|
26511 | "value": "隆子县"
|
26512 | }, {
|
26513 | "key": "540530",
|
26514 | "value": "错那县"
|
26515 | }, {
|
26516 | "key": "540531",
|
26517 | "value": "浪卡子县"
|
26518 | }]
|
26519 | }, {
|
26520 | "key": "540600",
|
26521 | "value": "那曲市",
|
26522 | "children": [{
|
26523 | "key": "540602",
|
26524 | "value": "色尼区"
|
26525 | }, {
|
26526 | "key": "540621",
|
26527 | "value": "嘉黎县"
|
26528 | }, {
|
26529 | "key": "540622",
|
26530 | "value": "比如县"
|
26531 | }, {
|
26532 | "key": "540623",
|
26533 | "value": "聂荣县"
|
26534 | }, {
|
26535 | "key": "540624",
|
26536 | "value": "安多县"
|
26537 | }, {
|
26538 | "key": "540625",
|
26539 | "value": "申扎县"
|
26540 | }, {
|
26541 | "key": "540626",
|
26542 | "value": "索县"
|
26543 | }, {
|
26544 | "key": "540627",
|
26545 | "value": "班戈县"
|
26546 | }, {
|
26547 | "key": "540628",
|
26548 | "value": "巴青县"
|
26549 | }, {
|
26550 | "key": "540629",
|
26551 | "value": "尼玛县"
|
26552 | }, {
|
26553 | "key": "540630",
|
26554 | "value": "双湖县"
|
26555 | }]
|
26556 | }, {
|
26557 | "key": "542500",
|
26558 | "value": "阿里地区",
|
26559 | "children": [{
|
26560 | "key": "542521",
|
26561 | "value": "普兰县"
|
26562 | }, {
|
26563 | "key": "542522",
|
26564 | "value": "札达县"
|
26565 | }, {
|
26566 | "key": "542523",
|
26567 | "value": "噶尔县"
|
26568 | }, {
|
26569 | "key": "542524",
|
26570 | "value": "日土县"
|
26571 | }, {
|
26572 | "key": "542525",
|
26573 | "value": "革吉县"
|
26574 | }, {
|
26575 | "key": "542526",
|
26576 | "value": "改则县"
|
26577 | }, {
|
26578 | "key": "542527",
|
26579 | "value": "措勤县"
|
26580 | }]
|
26581 | }]
|
26582 | }, {
|
26583 | "key": "610000",
|
26584 | "value": "陕西",
|
26585 | "children": [{
|
26586 | "key": "610100",
|
26587 | "value": "西安市",
|
26588 | "children": [{
|
26589 | "key": "610102",
|
26590 | "value": "新城区"
|
26591 | }, {
|
26592 | "key": "610103",
|
26593 | "value": "碑林区"
|
26594 | }, {
|
26595 | "key": "610104",
|
26596 | "value": "莲湖区"
|
26597 | }, {
|
26598 | "key": "610111",
|
26599 | "value": "灞桥区"
|
26600 | }, {
|
26601 | "key": "610112",
|
26602 | "value": "未央区"
|
26603 | }, {
|
26604 | "key": "610113",
|
26605 | "value": "雁塔区"
|
26606 | }, {
|
26607 | "key": "610114",
|
26608 | "value": "阎良区"
|
26609 | }, {
|
26610 | "key": "610115",
|
26611 | "value": "临潼区"
|
26612 | }, {
|
26613 | "key": "610116",
|
26614 | "value": "长安区"
|
26615 | }, {
|
26616 | "key": "610117",
|
26617 | "value": "高陵区"
|
26618 | }, {
|
26619 | "key": "610118",
|
26620 | "value": "鄠邑区"
|
26621 | }, {
|
26622 | "key": "610122",
|
26623 | "value": "蓝田县"
|
26624 | }, {
|
26625 | "key": "610124",
|
26626 | "value": "周至县"
|
26627 | }]
|
26628 | }, {
|
26629 | "key": "610200",
|
26630 | "value": "铜川市",
|
26631 | "children": [{
|
26632 | "key": "610202",
|
26633 | "value": "王益区"
|
26634 | }, {
|
26635 | "key": "610203",
|
26636 | "value": "印台区"
|
26637 | }, {
|
26638 | "key": "610204",
|
26639 | "value": "耀州区"
|
26640 | }, {
|
26641 | "key": "610222",
|
26642 | "value": "宜君县"
|
26643 | }]
|
26644 | }, {
|
26645 | "key": "610300",
|
26646 | "value": "宝鸡市",
|
26647 | "children": [{
|
26648 | "key": "610302",
|
26649 | "value": "渭滨区"
|
26650 | }, {
|
26651 | "key": "610303",
|
26652 | "value": "金台区"
|
26653 | }, {
|
26654 | "key": "610304",
|
26655 | "value": "陈仓区"
|
26656 | }, {
|
26657 | "key": "610322",
|
26658 | "value": "凤翔县"
|
26659 | }, {
|
26660 | "key": "610323",
|
26661 | "value": "岐山县"
|
26662 | }, {
|
26663 | "key": "610324",
|
26664 | "value": "扶风县"
|
26665 | }, {
|
26666 | "key": "610326",
|
26667 | "value": "眉县"
|
26668 | }, {
|
26669 | "key": "610327",
|
26670 | "value": "陇县"
|
26671 | }, {
|
26672 | "key": "610328",
|
26673 | "value": "千阳县"
|
26674 | }, {
|
26675 | "key": "610329",
|
26676 | "value": "麟游县"
|
26677 | }, {
|
26678 | "key": "610330",
|
26679 | "value": "凤县"
|
26680 | }, {
|
26681 | "key": "610331",
|
26682 | "value": "太白县"
|
26683 | }]
|
26684 | }, {
|
26685 | "key": "610400",
|
26686 | "value": "咸阳市",
|
26687 | "children": [{
|
26688 | "key": "610402",
|
26689 | "value": "秦都区"
|
26690 | }, {
|
26691 | "key": "610403",
|
26692 | "value": "杨陵区"
|
26693 | }, {
|
26694 | "key": "610404",
|
26695 | "value": "渭城区"
|
26696 | }, {
|
26697 | "key": "610422",
|
26698 | "value": "三原县"
|
26699 | }, {
|
26700 | "key": "610423",
|
26701 | "value": "泾阳县"
|
26702 | }, {
|
26703 | "key": "610424",
|
26704 | "value": "乾县"
|
26705 | }, {
|
26706 | "key": "610425",
|
26707 | "value": "礼泉县"
|
26708 | }, {
|
26709 | "key": "610426",
|
26710 | "value": "永寿县"
|
26711 | }, {
|
26712 | "key": "610428",
|
26713 | "value": "长武县"
|
26714 | }, {
|
26715 | "key": "610429",
|
26716 | "value": "旬邑县"
|
26717 | }, {
|
26718 | "key": "610430",
|
26719 | "value": "淳化县"
|
26720 | }, {
|
26721 | "key": "610431",
|
26722 | "value": "武功县"
|
26723 | }, {
|
26724 | "key": "610481",
|
26725 | "value": "兴平市"
|
26726 | }, {
|
26727 | "key": "610482",
|
26728 | "value": "彬州市"
|
26729 | }]
|
26730 | }, {
|
26731 | "key": "610500",
|
26732 | "value": "渭南市",
|
26733 | "children": [{
|
26734 | "key": "610502",
|
26735 | "value": "临渭区"
|
26736 | }, {
|
26737 | "key": "610503",
|
26738 | "value": "华州区"
|
26739 | }, {
|
26740 | "key": "610522",
|
26741 | "value": "潼关县"
|
26742 | }, {
|
26743 | "key": "610523",
|
26744 | "value": "大荔县"
|
26745 | }, {
|
26746 | "key": "610524",
|
26747 | "value": "合阳县"
|
26748 | }, {
|
26749 | "key": "610525",
|
26750 | "value": "澄城县"
|
26751 | }, {
|
26752 | "key": "610526",
|
26753 | "value": "蒲城县"
|
26754 | }, {
|
26755 | "key": "610527",
|
26756 | "value": "白水县"
|
26757 | }, {
|
26758 | "key": "610528",
|
26759 | "value": "富平县"
|
26760 | }, {
|
26761 | "key": "610581",
|
26762 | "value": "韩城市"
|
26763 | }, {
|
26764 | "key": "610582",
|
26765 | "value": "华阴市"
|
26766 | }]
|
26767 | }, {
|
26768 | "key": "610600",
|
26769 | "value": "延安市",
|
26770 | "children": [{
|
26771 | "key": "610602",
|
26772 | "value": "宝塔区"
|
26773 | }, {
|
26774 | "key": "610603",
|
26775 | "value": "安塞区"
|
26776 | }, {
|
26777 | "key": "610621",
|
26778 | "value": "延长县"
|
26779 | }, {
|
26780 | "key": "610622",
|
26781 | "value": "延川县"
|
26782 | }, {
|
26783 | "key": "610623",
|
26784 | "value": "子长县"
|
26785 | }, {
|
26786 | "key": "610625",
|
26787 | "value": "志丹县"
|
26788 | }, {
|
26789 | "key": "610626",
|
26790 | "value": "吴起县"
|
26791 | }, {
|
26792 | "key": "610627",
|
26793 | "value": "甘泉县"
|
26794 | }, {
|
26795 | "key": "610628",
|
26796 | "value": "富县"
|
26797 | }, {
|
26798 | "key": "610629",
|
26799 | "value": "洛川县"
|
26800 | }, {
|
26801 | "key": "610630",
|
26802 | "value": "宜川县"
|
26803 | }, {
|
26804 | "key": "610631",
|
26805 | "value": "黄龙县"
|
26806 | }, {
|
26807 | "key": "610632",
|
26808 | "value": "黄陵县"
|
26809 | }]
|
26810 | }, {
|
26811 | "key": "610700",
|
26812 | "value": "汉中市",
|
26813 | "children": [{
|
26814 | "key": "610702",
|
26815 | "value": "汉台区"
|
26816 | }, {
|
26817 | "key": "610703",
|
26818 | "value": "南郑区"
|
26819 | }, {
|
26820 | "key": "610722",
|
26821 | "value": "城固县"
|
26822 | }, {
|
26823 | "key": "610723",
|
26824 | "value": "洋县"
|
26825 | }, {
|
26826 | "key": "610724",
|
26827 | "value": "西乡县"
|
26828 | }, {
|
26829 | "key": "610725",
|
26830 | "value": "勉县"
|
26831 | }, {
|
26832 | "key": "610726",
|
26833 | "value": "宁强县"
|
26834 | }, {
|
26835 | "key": "610727",
|
26836 | "value": "略阳县"
|
26837 | }, {
|
26838 | "key": "610728",
|
26839 | "value": "镇巴县"
|
26840 | }, {
|
26841 | "key": "610729",
|
26842 | "value": "留坝县"
|
26843 | }, {
|
26844 | "key": "610730",
|
26845 | "value": "佛坪县"
|
26846 | }]
|
26847 | }, {
|
26848 | "key": "610800",
|
26849 | "value": "榆林市",
|
26850 | "children": [{
|
26851 | "key": "610802",
|
26852 | "value": "榆阳区"
|
26853 | }, {
|
26854 | "key": "610803",
|
26855 | "value": "横山区"
|
26856 | }, {
|
26857 | "key": "610822",
|
26858 | "value": "府谷县"
|
26859 | }, {
|
26860 | "key": "610824",
|
26861 | "value": "靖边县"
|
26862 | }, {
|
26863 | "key": "610825",
|
26864 | "value": "定边县"
|
26865 | }, {
|
26866 | "key": "610826",
|
26867 | "value": "绥德县"
|
26868 | }, {
|
26869 | "key": "610827",
|
26870 | "value": "米脂县"
|
26871 | }, {
|
26872 | "key": "610828",
|
26873 | "value": "佳县"
|
26874 | }, {
|
26875 | "key": "610829",
|
26876 | "value": "吴堡县"
|
26877 | }, {
|
26878 | "key": "610830",
|
26879 | "value": "清涧县"
|
26880 | }, {
|
26881 | "key": "610831",
|
26882 | "value": "子洲县"
|
26883 | }, {
|
26884 | "key": "610881",
|
26885 | "value": "神木市"
|
26886 | }]
|
26887 | }, {
|
26888 | "key": "610900",
|
26889 | "value": "安康市",
|
26890 | "children": [{
|
26891 | "key": "610902",
|
26892 | "value": "汉滨区"
|
26893 | }, {
|
26894 | "key": "610921",
|
26895 | "value": "汉阴县"
|
26896 | }, {
|
26897 | "key": "610922",
|
26898 | "value": "石泉县"
|
26899 | }, {
|
26900 | "key": "610923",
|
26901 | "value": "宁陕县"
|
26902 | }, {
|
26903 | "key": "610924",
|
26904 | "value": "紫阳县"
|
26905 | }, {
|
26906 | "key": "610925",
|
26907 | "value": "岚皋县"
|
26908 | }, {
|
26909 | "key": "610926",
|
26910 | "value": "平利县"
|
26911 | }, {
|
26912 | "key": "610927",
|
26913 | "value": "镇坪县"
|
26914 | }, {
|
26915 | "key": "610928",
|
26916 | "value": "旬阳县"
|
26917 | }, {
|
26918 | "key": "610929",
|
26919 | "value": "白河县"
|
26920 | }]
|
26921 | }, {
|
26922 | "key": "611000",
|
26923 | "value": "商洛市",
|
26924 | "children": [{
|
26925 | "key": "611002",
|
26926 | "value": "商州区"
|
26927 | }, {
|
26928 | "key": "611021",
|
26929 | "value": "洛南县"
|
26930 | }, {
|
26931 | "key": "611022",
|
26932 | "value": "丹凤县"
|
26933 | }, {
|
26934 | "key": "611023",
|
26935 | "value": "商南县"
|
26936 | }, {
|
26937 | "key": "611024",
|
26938 | "value": "山阳县"
|
26939 | }, {
|
26940 | "key": "611025",
|
26941 | "value": "镇安县"
|
26942 | }, {
|
26943 | "key": "611026",
|
26944 | "value": "柞水县"
|
26945 | }]
|
26946 | }]
|
26947 | }, {
|
26948 | "key": "620000",
|
26949 | "value": "甘肃",
|
26950 | "children": [{
|
26951 | "key": "620100",
|
26952 | "value": "兰州市",
|
26953 | "children": [{
|
26954 | "key": "620102",
|
26955 | "value": "城关区"
|
26956 | }, {
|
26957 | "key": "620103",
|
26958 | "value": "七里河区"
|
26959 | }, {
|
26960 | "key": "620104",
|
26961 | "value": "西固区"
|
26962 | }, {
|
26963 | "key": "620105",
|
26964 | "value": "安宁区"
|
26965 | }, {
|
26966 | "key": "620111",
|
26967 | "value": "红古区"
|
26968 | }, {
|
26969 | "key": "620121",
|
26970 | "value": "永登县"
|
26971 | }, {
|
26972 | "key": "620122",
|
26973 | "value": "皋兰县"
|
26974 | }, {
|
26975 | "key": "620123",
|
26976 | "value": "榆中县"
|
26977 | }]
|
26978 | }, {
|
26979 | "key": "620200",
|
26980 | "value": "嘉峪关市",
|
26981 | "children": [{
|
26982 | "key": "620201",
|
26983 | "value": "峪泉镇"
|
26984 | }, {
|
26985 | "key": "620202",
|
26986 | "value": "文殊镇"
|
26987 | }, {
|
26988 | "key": "620203",
|
26989 | "value": "新城镇"
|
26990 | }]
|
26991 | }, {
|
26992 | "key": "620300",
|
26993 | "value": "金昌市",
|
26994 | "children": [{
|
26995 | "key": "620302",
|
26996 | "value": "金川区"
|
26997 | }, {
|
26998 | "key": "620321",
|
26999 | "value": "永昌县"
|
27000 | }]
|
27001 | }, {
|
27002 | "key": "620400",
|
27003 | "value": "白银市",
|
27004 | "children": [{
|
27005 | "key": "620402",
|
27006 | "value": "白银区"
|
27007 | }, {
|
27008 | "key": "620403",
|
27009 | "value": "平川区"
|
27010 | }, {
|
27011 | "key": "620421",
|
27012 | "value": "靖远县"
|
27013 | }, {
|
27014 | "key": "620422",
|
27015 | "value": "会宁县"
|
27016 | }, {
|
27017 | "key": "620423",
|
27018 | "value": "景泰县"
|
27019 | }]
|
27020 | }, {
|
27021 | "key": "620500",
|
27022 | "value": "天水市",
|
27023 | "children": [{
|
27024 | "key": "620502",
|
27025 | "value": "秦州区"
|
27026 | }, {
|
27027 | "key": "620503",
|
27028 | "value": "麦积区"
|
27029 | }, {
|
27030 | "key": "620521",
|
27031 | "value": "清水县"
|
27032 | }, {
|
27033 | "key": "620522",
|
27034 | "value": "秦安县"
|
27035 | }, {
|
27036 | "key": "620523",
|
27037 | "value": "甘谷县"
|
27038 | }, {
|
27039 | "key": "620524",
|
27040 | "value": "武山县"
|
27041 | }, {
|
27042 | "key": "620525",
|
27043 | "value": "张家川回族自治县"
|
27044 | }]
|
27045 | }, {
|
27046 | "key": "620600",
|
27047 | "value": "武威市",
|
27048 | "children": [{
|
27049 | "key": "620602",
|
27050 | "value": "凉州区"
|
27051 | }, {
|
27052 | "key": "620621",
|
27053 | "value": "民勤县"
|
27054 | }, {
|
27055 | "key": "620622",
|
27056 | "value": "古浪县"
|
27057 | }, {
|
27058 | "key": "620623",
|
27059 | "value": "天祝藏族自治县"
|
27060 | }]
|
27061 | }, {
|
27062 | "key": "620700",
|
27063 | "value": "张掖市",
|
27064 | "children": [{
|
27065 | "key": "620702",
|
27066 | "value": "甘州区"
|
27067 | }, {
|
27068 | "key": "620721",
|
27069 | "value": "肃南裕固族自治县"
|
27070 | }, {
|
27071 | "key": "620722",
|
27072 | "value": "民乐县"
|
27073 | }, {
|
27074 | "key": "620723",
|
27075 | "value": "临泽县"
|
27076 | }, {
|
27077 | "key": "620724",
|
27078 | "value": "高台县"
|
27079 | }, {
|
27080 | "key": "620725",
|
27081 | "value": "山丹县"
|
27082 | }]
|
27083 | }, {
|
27084 | "key": "620800",
|
27085 | "value": "平凉市",
|
27086 | "children": [{
|
27087 | "key": "620802",
|
27088 | "value": "崆峒区"
|
27089 | }, {
|
27090 | "key": "620821",
|
27091 | "value": "泾川县"
|
27092 | }, {
|
27093 | "key": "620822",
|
27094 | "value": "灵台县"
|
27095 | }, {
|
27096 | "key": "620823",
|
27097 | "value": "崇信县"
|
27098 | }, {
|
27099 | "key": "620825",
|
27100 | "value": "庄浪县"
|
27101 | }, {
|
27102 | "key": "620826",
|
27103 | "value": "静宁县"
|
27104 | }, {
|
27105 | "key": "620881",
|
27106 | "value": "华亭市"
|
27107 | }]
|
27108 | }, {
|
27109 | "key": "620900",
|
27110 | "value": "酒泉市",
|
27111 | "children": [{
|
27112 | "key": "620902",
|
27113 | "value": "肃州区"
|
27114 | }, {
|
27115 | "key": "620921",
|
27116 | "value": "金塔县"
|
27117 | }, {
|
27118 | "key": "620922",
|
27119 | "value": "瓜州县"
|
27120 | }, {
|
27121 | "key": "620923",
|
27122 | "value": "肃北蒙古族自治县"
|
27123 | }, {
|
27124 | "key": "620924",
|
27125 | "value": "阿克塞哈萨克族自治县"
|
27126 | }, {
|
27127 | "key": "620981",
|
27128 | "value": "玉门市"
|
27129 | }, {
|
27130 | "key": "620982",
|
27131 | "value": "敦煌市"
|
27132 | }]
|
27133 | }, {
|
27134 | "key": "621000",
|
27135 | "value": "庆阳市",
|
27136 | "children": [{
|
27137 | "key": "621002",
|
27138 | "value": "西峰区"
|
27139 | }, {
|
27140 | "key": "621021",
|
27141 | "value": "庆城县"
|
27142 | }, {
|
27143 | "key": "621022",
|
27144 | "value": "环县"
|
27145 | }, {
|
27146 | "key": "621023",
|
27147 | "value": "华池县"
|
27148 | }, {
|
27149 | "key": "621024",
|
27150 | "value": "合水县"
|
27151 | }, {
|
27152 | "key": "621025",
|
27153 | "value": "正宁县"
|
27154 | }, {
|
27155 | "key": "621026",
|
27156 | "value": "宁县"
|
27157 | }, {
|
27158 | "key": "621027",
|
27159 | "value": "镇原县"
|
27160 | }]
|
27161 | }, {
|
27162 | "key": "621100",
|
27163 | "value": "定西市",
|
27164 | "children": [{
|
27165 | "key": "621102",
|
27166 | "value": "安定区"
|
27167 | }, {
|
27168 | "key": "621121",
|
27169 | "value": "通渭县"
|
27170 | }, {
|
27171 | "key": "621122",
|
27172 | "value": "陇西县"
|
27173 | }, {
|
27174 | "key": "621123",
|
27175 | "value": "渭源县"
|
27176 | }, {
|
27177 | "key": "621124",
|
27178 | "value": "临洮县"
|
27179 | }, {
|
27180 | "key": "621125",
|
27181 | "value": "漳县"
|
27182 | }, {
|
27183 | "key": "621126",
|
27184 | "value": "岷县"
|
27185 | }]
|
27186 | }, {
|
27187 | "key": "621200",
|
27188 | "value": "陇南市",
|
27189 | "children": [{
|
27190 | "key": "621202",
|
27191 | "value": "武都区"
|
27192 | }, {
|
27193 | "key": "621221",
|
27194 | "value": "成县"
|
27195 | }, {
|
27196 | "key": "621222",
|
27197 | "value": "文县"
|
27198 | }, {
|
27199 | "key": "621223",
|
27200 | "value": "宕昌县"
|
27201 | }, {
|
27202 | "key": "621224",
|
27203 | "value": "康县"
|
27204 | }, {
|
27205 | "key": "621225",
|
27206 | "value": "西和县"
|
27207 | }, {
|
27208 | "key": "621226",
|
27209 | "value": "礼县"
|
27210 | }, {
|
27211 | "key": "621227",
|
27212 | "value": "徽县"
|
27213 | }, {
|
27214 | "key": "621228",
|
27215 | "value": "两当县"
|
27216 | }]
|
27217 | }, {
|
27218 | "key": "622900",
|
27219 | "value": "临夏回族自治州",
|
27220 | "children": [{
|
27221 | "key": "622901",
|
27222 | "value": "临夏市"
|
27223 | }, {
|
27224 | "key": "622921",
|
27225 | "value": "临夏县"
|
27226 | }, {
|
27227 | "key": "622922",
|
27228 | "value": "康乐县"
|
27229 | }, {
|
27230 | "key": "622923",
|
27231 | "value": "永靖县"
|
27232 | }, {
|
27233 | "key": "622924",
|
27234 | "value": "广河县"
|
27235 | }, {
|
27236 | "key": "622925",
|
27237 | "value": "和政县"
|
27238 | }, {
|
27239 | "key": "622926",
|
27240 | "value": "东乡族自治县"
|
27241 | }, {
|
27242 | "key": "622927",
|
27243 | "value": "积石山保安族东乡族撒拉族自治县"
|
27244 | }]
|
27245 | }, {
|
27246 | "key": "623000",
|
27247 | "value": "甘南藏族自治州",
|
27248 | "children": [{
|
27249 | "key": "623001",
|
27250 | "value": "合作市"
|
27251 | }, {
|
27252 | "key": "623021",
|
27253 | "value": "临潭县"
|
27254 | }, {
|
27255 | "key": "623022",
|
27256 | "value": "卓尼县"
|
27257 | }, {
|
27258 | "key": "623023",
|
27259 | "value": "舟曲县"
|
27260 | }, {
|
27261 | "key": "623024",
|
27262 | "value": "迭部县"
|
27263 | }, {
|
27264 | "key": "623025",
|
27265 | "value": "玛曲县"
|
27266 | }, {
|
27267 | "key": "623026",
|
27268 | "value": "碌曲县"
|
27269 | }, {
|
27270 | "key": "623027",
|
27271 | "value": "夏河县"
|
27272 | }]
|
27273 | }]
|
27274 | }, {
|
27275 | "key": "630000",
|
27276 | "value": "青海",
|
27277 | "children": [{
|
27278 | "key": "630100",
|
27279 | "value": "西宁市",
|
27280 | "children": [{
|
27281 | "key": "630102",
|
27282 | "value": "城东区"
|
27283 | }, {
|
27284 | "key": "630103",
|
27285 | "value": "城中区"
|
27286 | }, {
|
27287 | "key": "630104",
|
27288 | "value": "城西区"
|
27289 | }, {
|
27290 | "key": "630105",
|
27291 | "value": "城北区"
|
27292 | }, {
|
27293 | "key": "630121",
|
27294 | "value": "大通回族土族自治县"
|
27295 | }, {
|
27296 | "key": "630122",
|
27297 | "value": "湟中县"
|
27298 | }, {
|
27299 | "key": "630123",
|
27300 | "value": "湟源县"
|
27301 | }]
|
27302 | }, {
|
27303 | "key": "630200",
|
27304 | "value": "海东市",
|
27305 | "children": [{
|
27306 | "key": "630202",
|
27307 | "value": "乐都区"
|
27308 | }, {
|
27309 | "key": "630203",
|
27310 | "value": "平安区"
|
27311 | }, {
|
27312 | "key": "630222",
|
27313 | "value": "民和回族土族自治县"
|
27314 | }, {
|
27315 | "key": "630223",
|
27316 | "value": "互助土族自治县"
|
27317 | }, {
|
27318 | "key": "630224",
|
27319 | "value": "化隆回族自治县"
|
27320 | }, {
|
27321 | "key": "630225",
|
27322 | "value": "循化撒拉族自治县"
|
27323 | }]
|
27324 | }, {
|
27325 | "key": "632200",
|
27326 | "value": "海北藏族自治州",
|
27327 | "children": [{
|
27328 | "key": "632221",
|
27329 | "value": "门源回族自治县"
|
27330 | }, {
|
27331 | "key": "632222",
|
27332 | "value": "祁连县"
|
27333 | }, {
|
27334 | "key": "632223",
|
27335 | "value": "海晏县"
|
27336 | }, {
|
27337 | "key": "632224",
|
27338 | "value": "刚察县"
|
27339 | }]
|
27340 | }, {
|
27341 | "key": "632300",
|
27342 | "value": "黄南藏族自治州",
|
27343 | "children": [{
|
27344 | "key": "632321",
|
27345 | "value": "同仁县"
|
27346 | }, {
|
27347 | "key": "632322",
|
27348 | "value": "尖扎县"
|
27349 | }, {
|
27350 | "key": "632323",
|
27351 | "value": "泽库县"
|
27352 | }, {
|
27353 | "key": "632324",
|
27354 | "value": "河南蒙古族自治县"
|
27355 | }]
|
27356 | }, {
|
27357 | "key": "632500",
|
27358 | "value": "海南藏族自治州",
|
27359 | "children": [{
|
27360 | "key": "632521",
|
27361 | "value": "共和县"
|
27362 | }, {
|
27363 | "key": "632522",
|
27364 | "value": "同德县"
|
27365 | }, {
|
27366 | "key": "632523",
|
27367 | "value": "贵德县"
|
27368 | }, {
|
27369 | "key": "632524",
|
27370 | "value": "兴海县"
|
27371 | }, {
|
27372 | "key": "632525",
|
27373 | "value": "贵南县"
|
27374 | }]
|
27375 | }, {
|
27376 | "key": "632600",
|
27377 | "value": "果洛藏族自治州",
|
27378 | "children": [{
|
27379 | "key": "632621",
|
27380 | "value": "玛沁县"
|
27381 | }, {
|
27382 | "key": "632622",
|
27383 | "value": "班玛县"
|
27384 | }, {
|
27385 | "key": "632623",
|
27386 | "value": "甘德县"
|
27387 | }, {
|
27388 | "key": "632624",
|
27389 | "value": "达日县"
|
27390 | }, {
|
27391 | "key": "632625",
|
27392 | "value": "久治县"
|
27393 | }, {
|
27394 | "key": "632626",
|
27395 | "value": "玛多县"
|
27396 | }]
|
27397 | }, {
|
27398 | "key": "632700",
|
27399 | "value": "玉树藏族自治州",
|
27400 | "children": [{
|
27401 | "key": "632701",
|
27402 | "value": "玉树市"
|
27403 | }, {
|
27404 | "key": "632722",
|
27405 | "value": "杂多县"
|
27406 | }, {
|
27407 | "key": "632723",
|
27408 | "value": "称多县"
|
27409 | }, {
|
27410 | "key": "632724",
|
27411 | "value": "治多县"
|
27412 | }, {
|
27413 | "key": "632725",
|
27414 | "value": "囊谦县"
|
27415 | }, {
|
27416 | "key": "632726",
|
27417 | "value": "曲麻莱县"
|
27418 | }]
|
27419 | }, {
|
27420 | "key": "632800",
|
27421 | "value": "海西蒙古族藏族自治州",
|
27422 | "children": [{
|
27423 | "key": "632801",
|
27424 | "value": "格尔木市"
|
27425 | }, {
|
27426 | "key": "632802",
|
27427 | "value": "德令哈市"
|
27428 | }, {
|
27429 | "key": "632803",
|
27430 | "value": "茫崖市"
|
27431 | }, {
|
27432 | "key": "632821",
|
27433 | "value": "乌兰县"
|
27434 | }, {
|
27435 | "key": "632822",
|
27436 | "value": "都兰县"
|
27437 | }, {
|
27438 | "key": "632823",
|
27439 | "value": "天峻县"
|
27440 | }]
|
27441 | }]
|
27442 | }, {
|
27443 | "key": "640000",
|
27444 | "value": "宁夏",
|
27445 | "children": [{
|
27446 | "key": "640100",
|
27447 | "value": "银川市",
|
27448 | "children": [{
|
27449 | "key": "640104",
|
27450 | "value": "兴庆区"
|
27451 | }, {
|
27452 | "key": "640105",
|
27453 | "value": "西夏区"
|
27454 | }, {
|
27455 | "key": "640106",
|
27456 | "value": "金凤区"
|
27457 | }, {
|
27458 | "key": "640121",
|
27459 | "value": "永宁县"
|
27460 | }, {
|
27461 | "key": "640122",
|
27462 | "value": "贺兰县"
|
27463 | }, {
|
27464 | "key": "640181",
|
27465 | "value": "灵武市"
|
27466 | }]
|
27467 | }, {
|
27468 | "key": "640200",
|
27469 | "value": "石嘴山市",
|
27470 | "children": [{
|
27471 | "key": "640202",
|
27472 | "value": "大武口区"
|
27473 | }, {
|
27474 | "key": "640205",
|
27475 | "value": "惠农区"
|
27476 | }, {
|
27477 | "key": "640221",
|
27478 | "value": "平罗县"
|
27479 | }]
|
27480 | }, {
|
27481 | "key": "640300",
|
27482 | "value": "吴忠市",
|
27483 | "children": [{
|
27484 | "key": "640302",
|
27485 | "value": "利通区"
|
27486 | }, {
|
27487 | "key": "640303",
|
27488 | "value": "红寺堡区"
|
27489 | }, {
|
27490 | "key": "640323",
|
27491 | "value": "盐池县"
|
27492 | }, {
|
27493 | "key": "640324",
|
27494 | "value": "同心县"
|
27495 | }, {
|
27496 | "key": "640381",
|
27497 | "value": "青铜峡市"
|
27498 | }]
|
27499 | }, {
|
27500 | "key": "640400",
|
27501 | "value": "固原市",
|
27502 | "children": [{
|
27503 | "key": "640402",
|
27504 | "value": "原州区"
|
27505 | }, {
|
27506 | "key": "640422",
|
27507 | "value": "西吉县"
|
27508 | }, {
|
27509 | "key": "640423",
|
27510 | "value": "隆德县"
|
27511 | }, {
|
27512 | "key": "640424",
|
27513 | "value": "泾源县"
|
27514 | }, {
|
27515 | "key": "640425",
|
27516 | "value": "彭阳县"
|
27517 | }]
|
27518 | }, {
|
27519 | "key": "640500",
|
27520 | "value": "中卫市",
|
27521 | "children": [{
|
27522 | "key": "640502",
|
27523 | "value": "沙坡头区"
|
27524 | }, {
|
27525 | "key": "640521",
|
27526 | "value": "中宁县"
|
27527 | }, {
|
27528 | "key": "640522",
|
27529 | "value": "海原县"
|
27530 | }]
|
27531 | }]
|
27532 | }, {
|
27533 | "key": "650000",
|
27534 | "value": "新疆",
|
27535 | "children": [{
|
27536 | "key": "650100",
|
27537 | "value": "乌鲁木齐市",
|
27538 | "children": [{
|
27539 | "key": "650102",
|
27540 | "value": "天山区"
|
27541 | }, {
|
27542 | "key": "650103",
|
27543 | "value": "沙依巴克区"
|
27544 | }, {
|
27545 | "key": "650104",
|
27546 | "value": "新市区"
|
27547 | }, {
|
27548 | "key": "650105",
|
27549 | "value": "水磨沟区"
|
27550 | }, {
|
27551 | "key": "650106",
|
27552 | "value": "头屯河区"
|
27553 | }, {
|
27554 | "key": "650107",
|
27555 | "value": "达坂城区"
|
27556 | }, {
|
27557 | "key": "650109",
|
27558 | "value": "米东区"
|
27559 | }, {
|
27560 | "key": "650121",
|
27561 | "value": "乌鲁木齐县"
|
27562 | }]
|
27563 | }, {
|
27564 | "key": "650200",
|
27565 | "value": "克拉玛依市",
|
27566 | "children": [{
|
27567 | "key": "650202",
|
27568 | "value": "独山子区"
|
27569 | }, {
|
27570 | "key": "650203",
|
27571 | "value": "克拉玛依区"
|
27572 | }, {
|
27573 | "key": "650204",
|
27574 | "value": "白碱滩区"
|
27575 | }, {
|
27576 | "key": "650205",
|
27577 | "value": "乌尔禾区"
|
27578 | }]
|
27579 | }, {
|
27580 | "key": "650400",
|
27581 | "value": "吐鲁番市",
|
27582 | "children": [{
|
27583 | "key": "650402",
|
27584 | "value": "高昌区"
|
27585 | }, {
|
27586 | "key": "650421",
|
27587 | "value": "鄯善县"
|
27588 | }, {
|
27589 | "key": "650422",
|
27590 | "value": "托克逊县"
|
27591 | }]
|
27592 | }, {
|
27593 | "key": "650500",
|
27594 | "value": "哈密市",
|
27595 | "children": [{
|
27596 | "key": "650502",
|
27597 | "value": "伊州区"
|
27598 | }, {
|
27599 | "key": "650521",
|
27600 | "value": "巴里坤哈萨克自治县"
|
27601 | }, {
|
27602 | "key": "650522",
|
27603 | "value": "伊吾县"
|
27604 | }]
|
27605 | }, {
|
27606 | "key": "652300",
|
27607 | "value": "昌吉回族自治州",
|
27608 | "children": [{
|
27609 | "key": "652301",
|
27610 | "value": "昌吉市"
|
27611 | }, {
|
27612 | "key": "652302",
|
27613 | "value": "阜康市"
|
27614 | }, {
|
27615 | "key": "652323",
|
27616 | "value": "呼图壁县"
|
27617 | }, {
|
27618 | "key": "652324",
|
27619 | "value": "玛纳斯县"
|
27620 | }, {
|
27621 | "key": "652325",
|
27622 | "value": "奇台县"
|
27623 | }, {
|
27624 | "key": "652327",
|
27625 | "value": "吉木萨尔县"
|
27626 | }, {
|
27627 | "key": "652328",
|
27628 | "value": "木垒哈萨克自治县"
|
27629 | }]
|
27630 | }, {
|
27631 | "key": "652700",
|
27632 | "value": "博尔塔拉蒙古自治州",
|
27633 | "children": [{
|
27634 | "key": "652701",
|
27635 | "value": "博乐市"
|
27636 | }, {
|
27637 | "key": "652702",
|
27638 | "value": "阿拉山口市"
|
27639 | }, {
|
27640 | "key": "652722",
|
27641 | "value": "精河县"
|
27642 | }, {
|
27643 | "key": "652723",
|
27644 | "value": "温泉县"
|
27645 | }]
|
27646 | }, {
|
27647 | "key": "652800",
|
27648 | "value": "巴音郭楞蒙古自治州",
|
27649 | "children": [{
|
27650 | "key": "652801",
|
27651 | "value": "库尔勒市"
|
27652 | }, {
|
27653 | "key": "652822",
|
27654 | "value": "轮台县"
|
27655 | }, {
|
27656 | "key": "652823",
|
27657 | "value": "尉犁县"
|
27658 | }, {
|
27659 | "key": "652824",
|
27660 | "value": "若羌县"
|
27661 | }, {
|
27662 | "key": "652825",
|
27663 | "value": "且末县"
|
27664 | }, {
|
27665 | "key": "652826",
|
27666 | "value": "焉耆回族自治县"
|
27667 | }, {
|
27668 | "key": "652827",
|
27669 | "value": "和静县"
|
27670 | }, {
|
27671 | "key": "652828",
|
27672 | "value": "和硕县"
|
27673 | }, {
|
27674 | "key": "652829",
|
27675 | "value": "博湖县"
|
27676 | }]
|
27677 | }, {
|
27678 | "key": "652900",
|
27679 | "value": "阿克苏地区",
|
27680 | "children": [{
|
27681 | "key": "652901",
|
27682 | "value": "阿克苏市"
|
27683 | }, {
|
27684 | "key": "652922",
|
27685 | "value": "温宿县"
|
27686 | }, {
|
27687 | "key": "652923",
|
27688 | "value": "库车县"
|
27689 | }, {
|
27690 | "key": "652924",
|
27691 | "value": "沙雅县"
|
27692 | }, {
|
27693 | "key": "652925",
|
27694 | "value": "新和县"
|
27695 | }, {
|
27696 | "key": "652926",
|
27697 | "value": "拜城县"
|
27698 | }, {
|
27699 | "key": "652927",
|
27700 | "value": "乌什县"
|
27701 | }, {
|
27702 | "key": "652928",
|
27703 | "value": "阿瓦提县"
|
27704 | }, {
|
27705 | "key": "652929",
|
27706 | "value": "柯坪县"
|
27707 | }]
|
27708 | }, {
|
27709 | "key": "653000",
|
27710 | "value": "克孜勒苏柯尔克孜自治州",
|
27711 | "children": [{
|
27712 | "key": "653001",
|
27713 | "value": "阿图什市"
|
27714 | }, {
|
27715 | "key": "653022",
|
27716 | "value": "阿克陶县"
|
27717 | }, {
|
27718 | "key": "653023",
|
27719 | "value": "阿合奇县"
|
27720 | }, {
|
27721 | "key": "653024",
|
27722 | "value": "乌恰县"
|
27723 | }]
|
27724 | }, {
|
27725 | "key": "653100",
|
27726 | "value": "喀什地区",
|
27727 | "children": [{
|
27728 | "key": "653101",
|
27729 | "value": "喀什市"
|
27730 | }, {
|
27731 | "key": "653121",
|
27732 | "value": "疏附县"
|
27733 | }, {
|
27734 | "key": "653122",
|
27735 | "value": "疏勒县"
|
27736 | }, {
|
27737 | "key": "653123",
|
27738 | "value": "英吉沙县"
|
27739 | }, {
|
27740 | "key": "653124",
|
27741 | "value": "泽普县"
|
27742 | }, {
|
27743 | "key": "653125",
|
27744 | "value": "莎车县"
|
27745 | }, {
|
27746 | "key": "653126",
|
27747 | "value": "叶城县"
|
27748 | }, {
|
27749 | "key": "653127",
|
27750 | "value": "麦盖提县"
|
27751 | }, {
|
27752 | "key": "653128",
|
27753 | "value": "岳普湖县"
|
27754 | }, {
|
27755 | "key": "653129",
|
27756 | "value": "伽师县"
|
27757 | }, {
|
27758 | "key": "653130",
|
27759 | "value": "巴楚县"
|
27760 | }, {
|
27761 | "key": "653131",
|
27762 | "value": "塔什库尔干塔吉克自治县"
|
27763 | }]
|
27764 | }, {
|
27765 | "key": "653200",
|
27766 | "value": "和田地区",
|
27767 | "children": [{
|
27768 | "key": "653201",
|
27769 | "value": "和田市"
|
27770 | }, {
|
27771 | "key": "653221",
|
27772 | "value": "和田县"
|
27773 | }, {
|
27774 | "key": "653222",
|
27775 | "value": "墨玉县"
|
27776 | }, {
|
27777 | "key": "653223",
|
27778 | "value": "皮山县"
|
27779 | }, {
|
27780 | "key": "653224",
|
27781 | "value": "洛浦县"
|
27782 | }, {
|
27783 | "key": "653225",
|
27784 | "value": "策勒县"
|
27785 | }, {
|
27786 | "key": "653226",
|
27787 | "value": "于田县"
|
27788 | }, {
|
27789 | "key": "653227",
|
27790 | "value": "民丰县"
|
27791 | }]
|
27792 | }, {
|
27793 | "key": "654000",
|
27794 | "value": "伊犁哈萨克自治州",
|
27795 | "children": [{
|
27796 | "key": "654002",
|
27797 | "value": "伊宁市"
|
27798 | }, {
|
27799 | "key": "654003",
|
27800 | "value": "奎屯市"
|
27801 | }, {
|
27802 | "key": "654004",
|
27803 | "value": "霍尔果斯市"
|
27804 | }, {
|
27805 | "key": "654021",
|
27806 | "value": "伊宁县"
|
27807 | }, {
|
27808 | "key": "654022",
|
27809 | "value": "察布查尔锡伯自治县"
|
27810 | }, {
|
27811 | "key": "654023",
|
27812 | "value": "霍城县"
|
27813 | }, {
|
27814 | "key": "654024",
|
27815 | "value": "巩留县"
|
27816 | }, {
|
27817 | "key": "654025",
|
27818 | "value": "新源县"
|
27819 | }, {
|
27820 | "key": "654026",
|
27821 | "value": "昭苏县"
|
27822 | }, {
|
27823 | "key": "654027",
|
27824 | "value": "特克斯县"
|
27825 | }, {
|
27826 | "key": "654028",
|
27827 | "value": "尼勒克县"
|
27828 | }]
|
27829 | }, {
|
27830 | "key": "654200",
|
27831 | "value": "塔城地区",
|
27832 | "children": [{
|
27833 | "key": "654201",
|
27834 | "value": "塔城市"
|
27835 | }, {
|
27836 | "key": "654202",
|
27837 | "value": "乌苏市"
|
27838 | }, {
|
27839 | "key": "654221",
|
27840 | "value": "额敏县"
|
27841 | }, {
|
27842 | "key": "654223",
|
27843 | "value": "沙湾县"
|
27844 | }, {
|
27845 | "key": "654224",
|
27846 | "value": "托里县"
|
27847 | }, {
|
27848 | "key": "654225",
|
27849 | "value": "裕民县"
|
27850 | }, {
|
27851 | "key": "654226",
|
27852 | "value": "和布克赛尔蒙古自治县"
|
27853 | }]
|
27854 | }, {
|
27855 | "key": "654300",
|
27856 | "value": "阿勒泰地区",
|
27857 | "children": [{
|
27858 | "key": "654301",
|
27859 | "value": "阿勒泰市"
|
27860 | }, {
|
27861 | "key": "654321",
|
27862 | "value": "布尔津县"
|
27863 | }, {
|
27864 | "key": "654322",
|
27865 | "value": "富蕴县"
|
27866 | }, {
|
27867 | "key": "654323",
|
27868 | "value": "福海县"
|
27869 | }, {
|
27870 | "key": "654324",
|
27871 | "value": "哈巴河县"
|
27872 | }, {
|
27873 | "key": "654325",
|
27874 | "value": "青河县"
|
27875 | }, {
|
27876 | "key": "654326",
|
27877 | "value": "吉木乃县"
|
27878 | }]
|
27879 | }, {
|
27880 | "key": "659001",
|
27881 | "value": "石河子市"
|
27882 | }, {
|
27883 | "key": "659002",
|
27884 | "value": "阿拉尔市"
|
27885 | }, {
|
27886 | "key": "659003",
|
27887 | "value": "图木舒克市"
|
27888 | }, {
|
27889 | "key": "659004",
|
27890 | "value": "五家渠市"
|
27891 | }, {
|
27892 | "key": "659005",
|
27893 | "value": "北屯市"
|
27894 | }, {
|
27895 | "key": "659006",
|
27896 | "value": "铁门关市"
|
27897 | }, {
|
27898 | "key": "659007",
|
27899 | "value": "双河市"
|
27900 | }, {
|
27901 | "key": "659008",
|
27902 | "value": "可克达拉市"
|
27903 | }, {
|
27904 | "key": "659009",
|
27905 | "value": "昆玉市"
|
27906 | }]
|
27907 | }, {
|
27908 | "key": "710000",
|
27909 | "value": "台湾",
|
27910 | "children": [{
|
27911 | "key": "710100",
|
27912 | "value": "台北市",
|
27913 | "children": [{
|
27914 | "key": "710101",
|
27915 | "value": "中正区"
|
27916 | }, {
|
27917 | "key": "710102",
|
27918 | "value": "大同区"
|
27919 | }, {
|
27920 | "key": "710103",
|
27921 | "value": "中山区"
|
27922 | }, {
|
27923 | "key": "710104",
|
27924 | "value": "松山区"
|
27925 | }, {
|
27926 | "key": "710105",
|
27927 | "value": "大安区"
|
27928 | }, {
|
27929 | "key": "710106",
|
27930 | "value": "万华区"
|
27931 | }, {
|
27932 | "key": "710107",
|
27933 | "value": "信义区"
|
27934 | }, {
|
27935 | "key": "710108",
|
27936 | "value": "士林区"
|
27937 | }, {
|
27938 | "key": "710109",
|
27939 | "value": "北投区"
|
27940 | }, {
|
27941 | "key": "710110",
|
27942 | "value": "内湖区"
|
27943 | }, {
|
27944 | "key": "710111",
|
27945 | "value": "南港区"
|
27946 | }, {
|
27947 | "key": "710112",
|
27948 | "value": "文山区"
|
27949 | }]
|
27950 | }, {
|
27951 | "key": "710200",
|
27952 | "value": "基隆市",
|
27953 | "children": [{
|
27954 | "key": "710201",
|
27955 | "value": "仁爱区"
|
27956 | }, {
|
27957 | "key": "710202",
|
27958 | "value": "信义区"
|
27959 | }, {
|
27960 | "key": "710203",
|
27961 | "value": "中正区"
|
27962 | }, {
|
27963 | "key": "710204",
|
27964 | "value": "中山区"
|
27965 | }, {
|
27966 | "key": "710205",
|
27967 | "value": "安乐区"
|
27968 | }, {
|
27969 | "key": "710206",
|
27970 | "value": "暖暖区"
|
27971 | }, {
|
27972 | "key": "710207",
|
27973 | "value": "七堵区"
|
27974 | }]
|
27975 | }, {
|
27976 | "key": "710300",
|
27977 | "value": "新北市",
|
27978 | "children": [{
|
27979 | "key": "710301",
|
27980 | "value": "万里区"
|
27981 | }, {
|
27982 | "key": "710302",
|
27983 | "value": "金山区"
|
27984 | }, {
|
27985 | "key": "710303",
|
27986 | "value": "板桥区"
|
27987 | }, {
|
27988 | "key": "710304",
|
27989 | "value": "汐止区"
|
27990 | }, {
|
27991 | "key": "710305",
|
27992 | "value": "深坑区"
|
27993 | }, {
|
27994 | "key": "710306",
|
27995 | "value": "石碇区"
|
27996 | }, {
|
27997 | "key": "710307",
|
27998 | "value": "瑞芳区"
|
27999 | }, {
|
28000 | "key": "710308",
|
28001 | "value": "平溪区"
|
28002 | }, {
|
28003 | "key": "710309",
|
28004 | "value": "双溪区"
|
28005 | }, {
|
28006 | "key": "710310",
|
28007 | "value": "贡寮区"
|
28008 | }, {
|
28009 | "key": "710311",
|
28010 | "value": "新店区"
|
28011 | }, {
|
28012 | "key": "710312",
|
28013 | "value": "坪林区"
|
28014 | }, {
|
28015 | "key": "710313",
|
28016 | "value": "乌来区"
|
28017 | }, {
|
28018 | "key": "710314",
|
28019 | "value": "永和区"
|
28020 | }, {
|
28021 | "key": "710315",
|
28022 | "value": "中和区"
|
28023 | }, {
|
28024 | "key": "710316",
|
28025 | "value": "土城区"
|
28026 | }, {
|
28027 | "key": "710317",
|
28028 | "value": "三峡区"
|
28029 | }, {
|
28030 | "key": "710318",
|
28031 | "value": "树林区"
|
28032 | }, {
|
28033 | "key": "710319",
|
28034 | "value": "莺歌区"
|
28035 | }, {
|
28036 | "key": "710320",
|
28037 | "value": "三重区"
|
28038 | }, {
|
28039 | "key": "710321",
|
28040 | "value": "新庄区"
|
28041 | }, {
|
28042 | "key": "710322",
|
28043 | "value": "泰山区"
|
28044 | }, {
|
28045 | "key": "710323",
|
28046 | "value": "林口区"
|
28047 | }, {
|
28048 | "key": "710324",
|
28049 | "value": "芦洲区"
|
28050 | }, {
|
28051 | "key": "710325",
|
28052 | "value": "五股区"
|
28053 | }, {
|
28054 | "key": "710326",
|
28055 | "value": "八里区"
|
28056 | }, {
|
28057 | "key": "710327",
|
28058 | "value": "淡水区"
|
28059 | }, {
|
28060 | "key": "710328",
|
28061 | "value": "三芝区"
|
28062 | }, {
|
28063 | "key": "710329",
|
28064 | "value": "石门区"
|
28065 | }]
|
28066 | }, {
|
28067 | "key": "710400",
|
28068 | "value": "连江县",
|
28069 | "children": [{
|
28070 | "key": "710401",
|
28071 | "value": "南竿乡"
|
28072 | }, {
|
28073 | "key": "710402",
|
28074 | "value": "北竿乡"
|
28075 | }, {
|
28076 | "key": "710403",
|
28077 | "value": "莒光乡"
|
28078 | }, {
|
28079 | "key": "710404",
|
28080 | "value": "东引乡"
|
28081 | }]
|
28082 | }, {
|
28083 | "key": "710500",
|
28084 | "value": "宜兰县",
|
28085 | "children": [{
|
28086 | "key": "710501",
|
28087 | "value": "宜兰市"
|
28088 | }, {
|
28089 | "key": "710502",
|
28090 | "value": "壮围乡"
|
28091 | }, {
|
28092 | "key": "710503",
|
28093 | "value": "头城镇"
|
28094 | }, {
|
28095 | "key": "710504",
|
28096 | "value": "礁溪乡"
|
28097 | }, {
|
28098 | "key": "710505",
|
28099 | "value": "员山乡"
|
28100 | }, {
|
28101 | "key": "710506",
|
28102 | "value": "罗东镇"
|
28103 | }, {
|
28104 | "key": "710507",
|
28105 | "value": "三星乡"
|
28106 | }, {
|
28107 | "key": "710508",
|
28108 | "value": "大同乡"
|
28109 | }, {
|
28110 | "key": "710509",
|
28111 | "value": "五结乡"
|
28112 | }, {
|
28113 | "key": "710510",
|
28114 | "value": "冬山乡"
|
28115 | }, {
|
28116 | "key": "710511",
|
28117 | "value": "苏澳镇"
|
28118 | }, {
|
28119 | "key": "710512",
|
28120 | "value": "南澳乡"
|
28121 | }, {
|
28122 | "key": "710513",
|
28123 | "value": "钓鱼台"
|
28124 | }]
|
28125 | }, {
|
28126 | "key": "710600",
|
28127 | "value": "新竹市",
|
28128 | "children": [{
|
28129 | "key": "710601",
|
28130 | "value": "东区"
|
28131 | }, {
|
28132 | "key": "710602",
|
28133 | "value": "北区"
|
28134 | }, {
|
28135 | "key": "710603",
|
28136 | "value": "香山区"
|
28137 | }]
|
28138 | }, {
|
28139 | "key": "710700",
|
28140 | "value": "新竹县",
|
28141 | "children": [{
|
28142 | "key": "710701",
|
28143 | "value": "宝山乡"
|
28144 | }, {
|
28145 | "key": "710702",
|
28146 | "value": "竹北市"
|
28147 | }, {
|
28148 | "key": "710703",
|
28149 | "value": "湖口乡"
|
28150 | }, {
|
28151 | "key": "710704",
|
28152 | "value": "新丰乡"
|
28153 | }, {
|
28154 | "key": "710705",
|
28155 | "value": "新埔镇"
|
28156 | }, {
|
28157 | "key": "710706",
|
28158 | "value": "关西镇"
|
28159 | }, {
|
28160 | "key": "710707",
|
28161 | "value": "芎林乡"
|
28162 | }, {
|
28163 | "key": "710708",
|
28164 | "value": "竹东镇"
|
28165 | }, {
|
28166 | "key": "710709",
|
28167 | "value": "五峰乡"
|
28168 | }, {
|
28169 | "key": "710710",
|
28170 | "value": "横山乡"
|
28171 | }, {
|
28172 | "key": "710711",
|
28173 | "value": "尖石乡"
|
28174 | }, {
|
28175 | "key": "710712",
|
28176 | "value": "北埔乡"
|
28177 | }, {
|
28178 | "key": "710713",
|
28179 | "value": "峨眉乡"
|
28180 | }]
|
28181 | }, {
|
28182 | "key": "710800",
|
28183 | "value": "桃园市",
|
28184 | "children": [{
|
28185 | "key": "710801",
|
28186 | "value": "中坜区"
|
28187 | }, {
|
28188 | "key": "710802",
|
28189 | "value": "平镇区"
|
28190 | }, {
|
28191 | "key": "710803",
|
28192 | "value": "龙潭区"
|
28193 | }, {
|
28194 | "key": "710804",
|
28195 | "value": "杨梅区"
|
28196 | }, {
|
28197 | "key": "710805",
|
28198 | "value": "新屋区"
|
28199 | }, {
|
28200 | "key": "710806",
|
28201 | "value": "观音区"
|
28202 | }, {
|
28203 | "key": "710807",
|
28204 | "value": "桃园区"
|
28205 | }, {
|
28206 | "key": "710808",
|
28207 | "value": "龟山区"
|
28208 | }, {
|
28209 | "key": "710809",
|
28210 | "value": "八德区"
|
28211 | }, {
|
28212 | "key": "710810",
|
28213 | "value": "大溪区"
|
28214 | }, {
|
28215 | "key": "710811",
|
28216 | "value": "复兴区"
|
28217 | }, {
|
28218 | "key": "710812",
|
28219 | "value": "大园区"
|
28220 | }, {
|
28221 | "key": "710813",
|
28222 | "value": "芦竹区"
|
28223 | }]
|
28224 | }, {
|
28225 | "key": "710900",
|
28226 | "value": "苗栗县",
|
28227 | "children": [{
|
28228 | "key": "710901",
|
28229 | "value": "竹南镇"
|
28230 | }, {
|
28231 | "key": "710902",
|
28232 | "value": "头份镇"
|
28233 | }, {
|
28234 | "key": "710903",
|
28235 | "value": "三湾乡"
|
28236 | }, {
|
28237 | "key": "710904",
|
28238 | "value": "南庄乡"
|
28239 | }, {
|
28240 | "key": "710905",
|
28241 | "value": "狮潭乡"
|
28242 | }, {
|
28243 | "key": "710906",
|
28244 | "value": "后龙镇"
|
28245 | }, {
|
28246 | "key": "710907",
|
28247 | "value": "通霄镇"
|
28248 | }, {
|
28249 | "key": "710908",
|
28250 | "value": "苑里镇"
|
28251 | }, {
|
28252 | "key": "710909",
|
28253 | "value": "苗栗市"
|
28254 | }, {
|
28255 | "key": "710910",
|
28256 | "value": "造桥乡"
|
28257 | }, {
|
28258 | "key": "710911",
|
28259 | "value": "头屋乡"
|
28260 | }, {
|
28261 | "key": "710912",
|
28262 | "value": "公馆乡"
|
28263 | }, {
|
28264 | "key": "710913",
|
28265 | "value": "大湖乡"
|
28266 | }, {
|
28267 | "key": "710914",
|
28268 | "value": "泰安乡"
|
28269 | }, {
|
28270 | "key": "710915",
|
28271 | "value": "铜锣乡"
|
28272 | }, {
|
28273 | "key": "710916",
|
28274 | "value": "三义乡"
|
28275 | }, {
|
28276 | "key": "710917",
|
28277 | "value": "西湖乡"
|
28278 | }, {
|
28279 | "key": "710918",
|
28280 | "value": "卓兰镇"
|
28281 | }]
|
28282 | }, {
|
28283 | "key": "711000",
|
28284 | "value": "台中市",
|
28285 | "children": [{
|
28286 | "key": "711001",
|
28287 | "value": "中区"
|
28288 | }, {
|
28289 | "key": "711002",
|
28290 | "value": "东区"
|
28291 | }, {
|
28292 | "key": "711003",
|
28293 | "value": "南区"
|
28294 | }, {
|
28295 | "key": "711004",
|
28296 | "value": "西区"
|
28297 | }, {
|
28298 | "key": "711005",
|
28299 | "value": "北区"
|
28300 | }, {
|
28301 | "key": "711006",
|
28302 | "value": "北屯区"
|
28303 | }, {
|
28304 | "key": "711007",
|
28305 | "value": "西屯区"
|
28306 | }, {
|
28307 | "key": "711008",
|
28308 | "value": "南屯区"
|
28309 | }, {
|
28310 | "key": "711009",
|
28311 | "value": "太平区"
|
28312 | }, {
|
28313 | "key": "711010",
|
28314 | "value": "大理区"
|
28315 | }, {
|
28316 | "key": "711011",
|
28317 | "value": "雾峰区"
|
28318 | }, {
|
28319 | "key": "711012",
|
28320 | "value": "乌日区"
|
28321 | }, {
|
28322 | "key": "711013",
|
28323 | "value": "丰原区"
|
28324 | }, {
|
28325 | "key": "711014",
|
28326 | "value": "后里区"
|
28327 | }, {
|
28328 | "key": "711015",
|
28329 | "value": "石冈区"
|
28330 | }, {
|
28331 | "key": "711016",
|
28332 | "value": "东势区"
|
28333 | }, {
|
28334 | "key": "711017",
|
28335 | "value": "和平区"
|
28336 | }, {
|
28337 | "key": "711018",
|
28338 | "value": "新小区"
|
28339 | }, {
|
28340 | "key": "711019",
|
28341 | "value": "潭子区"
|
28342 | }, {
|
28343 | "key": "711020",
|
28344 | "value": "大雅区"
|
28345 | }, {
|
28346 | "key": "711021",
|
28347 | "value": "神冈区"
|
28348 | }, {
|
28349 | "key": "711022",
|
28350 | "value": "大肚区"
|
28351 | }, {
|
28352 | "key": "711023",
|
28353 | "value": "沙鹿区"
|
28354 | }, {
|
28355 | "key": "711024",
|
28356 | "value": "龙井区"
|
28357 | }, {
|
28358 | "key": "711025",
|
28359 | "value": "梧栖区"
|
28360 | }, {
|
28361 | "key": "711026",
|
28362 | "value": "清水区"
|
28363 | }, {
|
28364 | "key": "711027",
|
28365 | "value": "大甲区"
|
28366 | }, {
|
28367 | "key": "711028",
|
28368 | "value": "外埔区"
|
28369 | }, {
|
28370 | "key": "711029",
|
28371 | "value": "大安区"
|
28372 | }]
|
28373 | }, {
|
28374 | "key": "711100",
|
28375 | "value": "彰化县",
|
28376 | "children": [{
|
28377 | "key": "711101",
|
28378 | "value": "彰化市"
|
28379 | }, {
|
28380 | "key": "711102",
|
28381 | "value": "芬园乡"
|
28382 | }, {
|
28383 | "key": "711103",
|
28384 | "value": "花坛乡"
|
28385 | }, {
|
28386 | "key": "711104",
|
28387 | "value": "秀水乡"
|
28388 | }, {
|
28389 | "key": "711105",
|
28390 | "value": "鹿港镇"
|
28391 | }, {
|
28392 | "key": "711106",
|
28393 | "value": "福兴乡"
|
28394 | }, {
|
28395 | "key": "711107",
|
28396 | "value": "线西乡"
|
28397 | }, {
|
28398 | "key": "711108",
|
28399 | "value": "和美镇"
|
28400 | }, {
|
28401 | "key": "711109",
|
28402 | "value": "伸港乡"
|
28403 | }, {
|
28404 | "key": "711110",
|
28405 | "value": "员林镇"
|
28406 | }, {
|
28407 | "key": "711111",
|
28408 | "value": "社头乡"
|
28409 | }, {
|
28410 | "key": "711112",
|
28411 | "value": "永靖乡"
|
28412 | }, {
|
28413 | "key": "711113",
|
28414 | "value": "埔心乡"
|
28415 | }, {
|
28416 | "key": "711114",
|
28417 | "value": "溪湖镇"
|
28418 | }, {
|
28419 | "key": "711115",
|
28420 | "value": "大村乡"
|
28421 | }, {
|
28422 | "key": "711116",
|
28423 | "value": "埔盐乡"
|
28424 | }, {
|
28425 | "key": "711117",
|
28426 | "value": "田中镇"
|
28427 | }, {
|
28428 | "key": "711118",
|
28429 | "value": "北斗镇"
|
28430 | }, {
|
28431 | "key": "711119",
|
28432 | "value": "田尾乡"
|
28433 | }, {
|
28434 | "key": "711120",
|
28435 | "value": "埤头乡"
|
28436 | }, {
|
28437 | "key": "711121",
|
28438 | "value": "溪州乡"
|
28439 | }, {
|
28440 | "key": "711122",
|
28441 | "value": "竹塘乡"
|
28442 | }, {
|
28443 | "key": "711123",
|
28444 | "value": "二林镇"
|
28445 | }, {
|
28446 | "key": "711124",
|
28447 | "value": "大城乡"
|
28448 | }, {
|
28449 | "key": "711125",
|
28450 | "value": "芳苑乡"
|
28451 | }, {
|
28452 | "key": "711126",
|
28453 | "value": "二水乡"
|
28454 | }]
|
28455 | }, {
|
28456 | "key": "711200",
|
28457 | "value": "南投县",
|
28458 | "children": [{
|
28459 | "key": "711201",
|
28460 | "value": "南投市"
|
28461 | }, {
|
28462 | "key": "711202",
|
28463 | "value": "中寮乡"
|
28464 | }, {
|
28465 | "key": "711203",
|
28466 | "value": "草屯镇"
|
28467 | }, {
|
28468 | "key": "711204",
|
28469 | "value": "国姓乡"
|
28470 | }, {
|
28471 | "key": "711205",
|
28472 | "value": "埔里镇"
|
28473 | }, {
|
28474 | "key": "711206",
|
28475 | "value": "仁爱乡"
|
28476 | }, {
|
28477 | "key": "711207",
|
28478 | "value": "名间乡"
|
28479 | }, {
|
28480 | "key": "711208",
|
28481 | "value": "集集镇"
|
28482 | }, {
|
28483 | "key": "711209",
|
28484 | "value": "水里乡"
|
28485 | }, {
|
28486 | "key": "711210",
|
28487 | "value": "鱼池乡"
|
28488 | }, {
|
28489 | "key": "711211",
|
28490 | "value": "信义乡"
|
28491 | }, {
|
28492 | "key": "711212",
|
28493 | "value": "竹山镇"
|
28494 | }, {
|
28495 | "key": "711213",
|
28496 | "value": "鹿谷乡"
|
28497 | }]
|
28498 | }, {
|
28499 | "key": "711300",
|
28500 | "value": "嘉义市",
|
28501 | "children": [{
|
28502 | "key": "711301",
|
28503 | "value": "西区"
|
28504 | }, {
|
28505 | "key": "711302",
|
28506 | "value": "东区"
|
28507 | }]
|
28508 | }, {
|
28509 | "key": "711400",
|
28510 | "value": "嘉义县",
|
28511 | "children": [{
|
28512 | "key": "711401",
|
28513 | "value": "番路乡"
|
28514 | }, {
|
28515 | "key": "711402",
|
28516 | "value": "梅山乡"
|
28517 | }, {
|
28518 | "key": "711403",
|
28519 | "value": "竹崎乡"
|
28520 | }, {
|
28521 | "key": "711404",
|
28522 | "value": "阿里山乡"
|
28523 | }, {
|
28524 | "key": "711405",
|
28525 | "value": "中埔乡"
|
28526 | }, {
|
28527 | "key": "711406",
|
28528 | "value": "大埔乡"
|
28529 | }, {
|
28530 | "key": "711407",
|
28531 | "value": "水上乡"
|
28532 | }, {
|
28533 | "key": "711408",
|
28534 | "value": "鹿草乡"
|
28535 | }, {
|
28536 | "key": "711409",
|
28537 | "value": "太保市"
|
28538 | }, {
|
28539 | "key": "711410",
|
28540 | "value": "朴子市"
|
28541 | }, {
|
28542 | "key": "711411",
|
28543 | "value": "东石乡"
|
28544 | }, {
|
28545 | "key": "711412",
|
28546 | "value": "六脚乡"
|
28547 | }, {
|
28548 | "key": "711413",
|
28549 | "value": "新港乡"
|
28550 | }, {
|
28551 | "key": "711414",
|
28552 | "value": "民雄乡"
|
28553 | }, {
|
28554 | "key": "711415",
|
28555 | "value": "大林镇"
|
28556 | }, {
|
28557 | "key": "711416",
|
28558 | "value": "溪口乡"
|
28559 | }, {
|
28560 | "key": "711417",
|
28561 | "value": "义竹乡"
|
28562 | }, {
|
28563 | "key": "711418",
|
28564 | "value": "布袋镇"
|
28565 | }]
|
28566 | }, {
|
28567 | "key": "711500",
|
28568 | "value": "云林县",
|
28569 | "children": [{
|
28570 | "key": "711501",
|
28571 | "value": "斗南镇"
|
28572 | }, {
|
28573 | "key": "711502",
|
28574 | "value": "大埤乡"
|
28575 | }, {
|
28576 | "key": "711503",
|
28577 | "value": "虎尾镇"
|
28578 | }, {
|
28579 | "key": "711504",
|
28580 | "value": "土库镇"
|
28581 | }, {
|
28582 | "key": "711505",
|
28583 | "value": "褒忠乡"
|
28584 | }, {
|
28585 | "key": "711506",
|
28586 | "value": "东势乡"
|
28587 | }, {
|
28588 | "key": "711507",
|
28589 | "value": "台西乡"
|
28590 | }, {
|
28591 | "key": "711508",
|
28592 | "value": "仑背乡"
|
28593 | }, {
|
28594 | "key": "711509",
|
28595 | "value": "麦寮乡"
|
28596 | }, {
|
28597 | "key": "711510",
|
28598 | "value": "斗六市"
|
28599 | }, {
|
28600 | "key": "711511",
|
28601 | "value": "林内乡"
|
28602 | }, {
|
28603 | "key": "711512",
|
28604 | "value": "古坑乡"
|
28605 | }, {
|
28606 | "key": "711513",
|
28607 | "value": "莿桐乡"
|
28608 | }, {
|
28609 | "key": "711514",
|
28610 | "value": "西螺镇"
|
28611 | }, {
|
28612 | "key": "711515",
|
28613 | "value": "二仑乡"
|
28614 | }, {
|
28615 | "key": "711516",
|
28616 | "value": "北港镇"
|
28617 | }, {
|
28618 | "key": "711517",
|
28619 | "value": "水林乡"
|
28620 | }, {
|
28621 | "key": "711518",
|
28622 | "value": "口湖乡"
|
28623 | }, {
|
28624 | "key": "711519",
|
28625 | "value": "四湖乡"
|
28626 | }, {
|
28627 | "key": "711520",
|
28628 | "value": "元长乡"
|
28629 | }]
|
28630 | }, {
|
28631 | "key": "711600",
|
28632 | "value": "台南市",
|
28633 | "children": [{
|
28634 | "key": "711601",
|
28635 | "value": "中西区"
|
28636 | }, {
|
28637 | "key": "711602",
|
28638 | "value": "东区"
|
28639 | }, {
|
28640 | "key": "711603",
|
28641 | "value": "南区"
|
28642 | }, {
|
28643 | "key": "711604",
|
28644 | "value": "北区"
|
28645 | }, {
|
28646 | "key": "711605",
|
28647 | "value": "安平区"
|
28648 | }, {
|
28649 | "key": "711606",
|
28650 | "value": "安南区"
|
28651 | }, {
|
28652 | "key": "711607",
|
28653 | "value": "永康区"
|
28654 | }, {
|
28655 | "key": "711608",
|
28656 | "value": "归仁区"
|
28657 | }, {
|
28658 | "key": "711609",
|
28659 | "value": "新化区"
|
28660 | }, {
|
28661 | "key": "711610",
|
28662 | "value": "左镇区"
|
28663 | }, {
|
28664 | "key": "711611",
|
28665 | "value": "玉井区"
|
28666 | }, {
|
28667 | "key": "711612",
|
28668 | "value": "楠西区"
|
28669 | }, {
|
28670 | "key": "711613",
|
28671 | "value": "南化区"
|
28672 | }, {
|
28673 | "key": "711614",
|
28674 | "value": "仁德区"
|
28675 | }, {
|
28676 | "key": "711615",
|
28677 | "value": "关庙区"
|
28678 | }, {
|
28679 | "key": "711616",
|
28680 | "value": "龙崎区"
|
28681 | }, {
|
28682 | "key": "711617",
|
28683 | "value": "官田区"
|
28684 | }, {
|
28685 | "key": "711618",
|
28686 | "value": "麻豆区"
|
28687 | }, {
|
28688 | "key": "711619",
|
28689 | "value": "佳里区"
|
28690 | }, {
|
28691 | "key": "711620",
|
28692 | "value": "西港区"
|
28693 | }, {
|
28694 | "key": "711621",
|
28695 | "value": "七股区"
|
28696 | }, {
|
28697 | "key": "711622",
|
28698 | "value": "将军区"
|
28699 | }, {
|
28700 | "key": "711623",
|
28701 | "value": "学甲区"
|
28702 | }, {
|
28703 | "key": "711624",
|
28704 | "value": "北门区"
|
28705 | }, {
|
28706 | "key": "711625",
|
28707 | "value": "新营区"
|
28708 | }, {
|
28709 | "key": "711626",
|
28710 | "value": "后壁区"
|
28711 | }, {
|
28712 | "key": "711627",
|
28713 | "value": "白河区"
|
28714 | }, {
|
28715 | "key": "711628",
|
28716 | "value": "东山区"
|
28717 | }, {
|
28718 | "key": "711629",
|
28719 | "value": "六甲区"
|
28720 | }, {
|
28721 | "key": "711630",
|
28722 | "value": "下营区"
|
28723 | }, {
|
28724 | "key": "711631",
|
28725 | "value": "柳营区"
|
28726 | }, {
|
28727 | "key": "711632",
|
28728 | "value": "盐水区"
|
28729 | }, {
|
28730 | "key": "711633",
|
28731 | "value": "善化区"
|
28732 | }, {
|
28733 | "key": "711634",
|
28734 | "value": "新市区"
|
28735 | }, {
|
28736 | "key": "711635",
|
28737 | "value": "大内区"
|
28738 | }, {
|
28739 | "key": "711636",
|
28740 | "value": "山上区"
|
28741 | }, {
|
28742 | "key": "711637",
|
28743 | "value": "安定区"
|
28744 | }]
|
28745 | }, {
|
28746 | "key": "711700",
|
28747 | "value": "高雄市",
|
28748 | "children": [{
|
28749 | "key": "711701",
|
28750 | "value": "新兴区"
|
28751 | }, {
|
28752 | "key": "711702",
|
28753 | "value": "前金区"
|
28754 | }, {
|
28755 | "key": "711703",
|
28756 | "value": "苓雅区"
|
28757 | }, {
|
28758 | "key": "711704",
|
28759 | "value": "盐埕区"
|
28760 | }, {
|
28761 | "key": "711705",
|
28762 | "value": "鼓山区"
|
28763 | }, {
|
28764 | "key": "711706",
|
28765 | "value": "旗津区"
|
28766 | }, {
|
28767 | "key": "711707",
|
28768 | "value": "前镇区"
|
28769 | }, {
|
28770 | "key": "711708",
|
28771 | "value": "三民区"
|
28772 | }, {
|
28773 | "key": "711709",
|
28774 | "value": "楠梓区"
|
28775 | }, {
|
28776 | "key": "711710",
|
28777 | "value": "小港区"
|
28778 | }, {
|
28779 | "key": "711711",
|
28780 | "value": "左营区"
|
28781 | }, {
|
28782 | "key": "711712",
|
28783 | "value": "仁武区"
|
28784 | }, {
|
28785 | "key": "711713",
|
28786 | "value": "大小区"
|
28787 | }, {
|
28788 | "key": "711714",
|
28789 | "value": "东沙群岛"
|
28790 | }, {
|
28791 | "key": "711715",
|
28792 | "value": "南沙群岛"
|
28793 | }, {
|
28794 | "key": "711716",
|
28795 | "value": "冈山区"
|
28796 | }, {
|
28797 | "key": "711717",
|
28798 | "value": "路竹区"
|
28799 | }, {
|
28800 | "key": "711718",
|
28801 | "value": "阿莲区"
|
28802 | }, {
|
28803 | "key": "711719",
|
28804 | "value": "田寮区"
|
28805 | }, {
|
28806 | "key": "711720",
|
28807 | "value": "燕巢区"
|
28808 | }, {
|
28809 | "key": "711721",
|
28810 | "value": "桥头区"
|
28811 | }, {
|
28812 | "key": "711722",
|
28813 | "value": "梓官区"
|
28814 | }, {
|
28815 | "key": "711723",
|
28816 | "value": "弥陀区"
|
28817 | }, {
|
28818 | "key": "711724",
|
28819 | "value": "永安区"
|
28820 | }, {
|
28821 | "key": "711725",
|
28822 | "value": "湖内区"
|
28823 | }, {
|
28824 | "key": "711726",
|
28825 | "value": "凤山区"
|
28826 | }, {
|
28827 | "key": "711727",
|
28828 | "value": "大寮区"
|
28829 | }, {
|
28830 | "key": "711728",
|
28831 | "value": "林园区"
|
28832 | }, {
|
28833 | "key": "711729",
|
28834 | "value": "鸟松区"
|
28835 | }, {
|
28836 | "key": "711730",
|
28837 | "value": "大树区"
|
28838 | }, {
|
28839 | "key": "711731",
|
28840 | "value": "旗山区"
|
28841 | }, {
|
28842 | "key": "711732",
|
28843 | "value": "美浓区"
|
28844 | }, {
|
28845 | "key": "711733",
|
28846 | "value": "六龟区"
|
28847 | }, {
|
28848 | "key": "711734",
|
28849 | "value": "内门区"
|
28850 | }, {
|
28851 | "key": "711735",
|
28852 | "value": "杉林区"
|
28853 | }, {
|
28854 | "key": "711736",
|
28855 | "value": "甲仙区"
|
28856 | }, {
|
28857 | "key": "711737",
|
28858 | "value": "桃源区"
|
28859 | }, {
|
28860 | "key": "711738",
|
28861 | "value": "那玛夏区"
|
28862 | }, {
|
28863 | "key": "711739",
|
28864 | "value": "茂林区"
|
28865 | }, {
|
28866 | "key": "711740",
|
28867 | "value": "茄萣区"
|
28868 | }]
|
28869 | }, {
|
28870 | "key": "711800",
|
28871 | "value": "南海岛",
|
28872 | "children": [{
|
28873 | "key": "711801",
|
28874 | "value": "东沙群岛"
|
28875 | }, {
|
28876 | "key": "711802",
|
28877 | "value": "南沙群岛"
|
28878 | }]
|
28879 | }, {
|
28880 | "key": "711900",
|
28881 | "value": "澎湖县",
|
28882 | "children": [{
|
28883 | "key": "711901",
|
28884 | "value": "马公市"
|
28885 | }, {
|
28886 | "key": "711902",
|
28887 | "value": "西屿乡"
|
28888 | }, {
|
28889 | "key": "711903",
|
28890 | "value": "望安乡"
|
28891 | }, {
|
28892 | "key": "711904",
|
28893 | "value": "七美乡"
|
28894 | }, {
|
28895 | "key": "711905",
|
28896 | "value": "白沙乡"
|
28897 | }, {
|
28898 | "key": "711906",
|
28899 | "value": "湖西乡"
|
28900 | }]
|
28901 | }, {
|
28902 | "key": "712000",
|
28903 | "value": "金门县",
|
28904 | "children": [{
|
28905 | "key": "712001",
|
28906 | "value": "金沙镇"
|
28907 | }, {
|
28908 | "key": "712002",
|
28909 | "value": "金湖镇"
|
28910 | }, {
|
28911 | "key": "712003",
|
28912 | "value": "金宁乡"
|
28913 | }, {
|
28914 | "key": "712004",
|
28915 | "value": "金城镇"
|
28916 | }, {
|
28917 | "key": "712005",
|
28918 | "value": "烈屿乡"
|
28919 | }, {
|
28920 | "key": "712006",
|
28921 | "value": "乌坵乡"
|
28922 | }]
|
28923 | }, {
|
28924 | "key": "712100",
|
28925 | "value": "屏东县",
|
28926 | "children": [{
|
28927 | "key": "712101",
|
28928 | "value": "屏东市"
|
28929 | }, {
|
28930 | "key": "712102",
|
28931 | "value": "三地门乡"
|
28932 | }, {
|
28933 | "key": "712103",
|
28934 | "value": "雾台乡"
|
28935 | }, {
|
28936 | "key": "712104",
|
28937 | "value": "玛家乡"
|
28938 | }, {
|
28939 | "key": "712105",
|
28940 | "value": "九如乡"
|
28941 | }, {
|
28942 | "key": "712106",
|
28943 | "value": "里港乡"
|
28944 | }, {
|
28945 | "key": "712107",
|
28946 | "value": "高树乡"
|
28947 | }, {
|
28948 | "key": "712108",
|
28949 | "value": "盐埔乡"
|
28950 | }, {
|
28951 | "key": "712109",
|
28952 | "value": "长治乡"
|
28953 | }, {
|
28954 | "key": "712110",
|
28955 | "value": "麟洛乡"
|
28956 | }, {
|
28957 | "key": "712111",
|
28958 | "value": "竹田乡"
|
28959 | }, {
|
28960 | "key": "712112",
|
28961 | "value": "内埔乡"
|
28962 | }, {
|
28963 | "key": "712113",
|
28964 | "value": "万丹乡"
|
28965 | }, {
|
28966 | "key": "712114",
|
28967 | "value": "潮州镇"
|
28968 | }, {
|
28969 | "key": "712115",
|
28970 | "value": "泰武乡"
|
28971 | }, {
|
28972 | "key": "712116",
|
28973 | "value": "来义乡"
|
28974 | }, {
|
28975 | "key": "712117",
|
28976 | "value": "万峦乡"
|
28977 | }, {
|
28978 | "key": "712118",
|
28979 | "value": "崁顶乡"
|
28980 | }, {
|
28981 | "key": "712119",
|
28982 | "value": "新埤乡"
|
28983 | }, {
|
28984 | "key": "712120",
|
28985 | "value": "南州乡"
|
28986 | }, {
|
28987 | "key": "712121",
|
28988 | "value": "林边乡"
|
28989 | }, {
|
28990 | "key": "712122",
|
28991 | "value": "东港镇"
|
28992 | }, {
|
28993 | "key": "712123",
|
28994 | "value": "琉球乡"
|
28995 | }, {
|
28996 | "key": "712124",
|
28997 | "value": "佳冬乡"
|
28998 | }, {
|
28999 | "key": "712125",
|
29000 | "value": "新园乡"
|
29001 | }, {
|
29002 | "key": "712126",
|
29003 | "value": "枋寮乡"
|
29004 | }, {
|
29005 | "key": "712127",
|
29006 | "value": "枋山乡"
|
29007 | }, {
|
29008 | "key": "712128",
|
29009 | "value": "春日乡"
|
29010 | }, {
|
29011 | "key": "712129",
|
29012 | "value": "狮子乡"
|
29013 | }, {
|
29014 | "key": "712130",
|
29015 | "value": "车城乡"
|
29016 | }, {
|
29017 | "key": "712131",
|
29018 | "value": "牡丹乡"
|
29019 | }, {
|
29020 | "key": "712132",
|
29021 | "value": "恒春镇"
|
29022 | }, {
|
29023 | "key": "712133",
|
29024 | "value": "满州乡"
|
29025 | }]
|
29026 | }, {
|
29027 | "key": "712200",
|
29028 | "value": "台东县",
|
29029 | "children": [{
|
29030 | "key": "712201",
|
29031 | "value": "台东市"
|
29032 | }, {
|
29033 | "key": "712202",
|
29034 | "value": "绿岛乡"
|
29035 | }, {
|
29036 | "key": "712203",
|
29037 | "value": "兰屿乡"
|
29038 | }, {
|
29039 | "key": "712204",
|
29040 | "value": "延平乡"
|
29041 | }, {
|
29042 | "key": "712205",
|
29043 | "value": "卑南乡"
|
29044 | }, {
|
29045 | "key": "712206",
|
29046 | "value": "鹿野乡"
|
29047 | }, {
|
29048 | "key": "712207",
|
29049 | "value": "关山镇"
|
29050 | }, {
|
29051 | "key": "712208",
|
29052 | "value": "海端乡"
|
29053 | }, {
|
29054 | "key": "712209",
|
29055 | "value": "池上乡"
|
29056 | }, {
|
29057 | "key": "712210",
|
29058 | "value": "东河乡"
|
29059 | }, {
|
29060 | "key": "712211",
|
29061 | "value": "成功镇"
|
29062 | }, {
|
29063 | "key": "712212",
|
29064 | "value": "长滨乡"
|
29065 | }, {
|
29066 | "key": "712213",
|
29067 | "value": "太麻里乡"
|
29068 | }, {
|
29069 | "key": "712214",
|
29070 | "value": "金峰乡"
|
29071 | }, {
|
29072 | "key": "712215",
|
29073 | "value": "大武乡"
|
29074 | }, {
|
29075 | "key": "712216",
|
29076 | "value": "达仁乡"
|
29077 | }]
|
29078 | }, {
|
29079 | "key": "712300",
|
29080 | "value": "花莲县",
|
29081 | "children": [{
|
29082 | "key": "712301",
|
29083 | "value": "花莲市"
|
29084 | }, {
|
29085 | "key": "712302",
|
29086 | "value": "新城乡"
|
29087 | }, {
|
29088 | "key": "712303",
|
29089 | "value": "秀林乡"
|
29090 | }, {
|
29091 | "key": "712304",
|
29092 | "value": "吉安乡"
|
29093 | }, {
|
29094 | "key": "712305",
|
29095 | "value": "寿丰乡"
|
29096 | }, {
|
29097 | "key": "712306",
|
29098 | "value": "凤林镇"
|
29099 | }, {
|
29100 | "key": "712307",
|
29101 | "value": "光复乡"
|
29102 | }, {
|
29103 | "key": "712308",
|
29104 | "value": "丰滨乡"
|
29105 | }, {
|
29106 | "key": "712309",
|
29107 | "value": "瑞穗乡"
|
29108 | }, {
|
29109 | "key": "712310",
|
29110 | "value": "万荣乡"
|
29111 | }, {
|
29112 | "key": "712311",
|
29113 | "value": "玉里镇"
|
29114 | }, {
|
29115 | "key": "712312",
|
29116 | "value": "卓溪乡"
|
29117 | }, {
|
29118 | "key": "712313",
|
29119 | "value": "富里乡"
|
29120 | }]
|
29121 | }]
|
29122 | }, {
|
29123 | "key": "810000",
|
29124 | "value": "香港",
|
29125 | "children": [{
|
29126 | "key": "810101",
|
29127 | "value": "中西区"
|
29128 | }, {
|
29129 | "key": "810102",
|
29130 | "value": "湾仔区"
|
29131 | }, {
|
29132 | "key": "810103",
|
29133 | "value": "东区"
|
29134 | }, {
|
29135 | "key": "810104",
|
29136 | "value": "南区"
|
29137 | }, {
|
29138 | "key": "810105",
|
29139 | "value": "油尖旺区"
|
29140 | }, {
|
29141 | "key": "810106",
|
29142 | "value": "深水埗区"
|
29143 | }, {
|
29144 | "key": "810107",
|
29145 | "value": "九龙城区"
|
29146 | }, {
|
29147 | "key": "810108",
|
29148 | "value": "黄大仙区"
|
29149 | }, {
|
29150 | "key": "810109",
|
29151 | "value": "观塘区"
|
29152 | }, {
|
29153 | "key": "810110",
|
29154 | "value": "北区"
|
29155 | }, {
|
29156 | "key": "810111",
|
29157 | "value": "大埔区"
|
29158 | }, {
|
29159 | "key": "810112",
|
29160 | "value": "沙田区"
|
29161 | }, {
|
29162 | "key": "810113",
|
29163 | "value": "西贡区"
|
29164 | }, {
|
29165 | "key": "810114",
|
29166 | "value": "荃湾区"
|
29167 | }, {
|
29168 | "key": "810115",
|
29169 | "value": "屯门区"
|
29170 | }, {
|
29171 | "key": "810116",
|
29172 | "value": "元朗区"
|
29173 | }, {
|
29174 | "key": "810117",
|
29175 | "value": "葵青区"
|
29176 | }, {
|
29177 | "key": "810118",
|
29178 | "value": "离岛区"
|
29179 | }]
|
29180 | }, {
|
29181 | "key": "820000",
|
29182 | "value": "澳门",
|
29183 | "children": [{
|
29184 | "key": "820101",
|
29185 | "value": "花地玛堂区"
|
29186 | }, {
|
29187 | "key": "820102",
|
29188 | "value": "圣安多尼堂区"
|
29189 | }, {
|
29190 | "key": "820103",
|
29191 | "value": "大堂区"
|
29192 | }, {
|
29193 | "key": "820104",
|
29194 | "value": "望德堂区"
|
29195 | }, {
|
29196 | "key": "820105",
|
29197 | "value": "风顺堂区"
|
29198 | }, {
|
29199 | "key": "820106",
|
29200 | "value": "嘉模堂区"
|
29201 | }, {
|
29202 | "key": "820107",
|
29203 | "value": "圣方济各堂区"
|
29204 | }, {
|
29205 | "key": "820108",
|
29206 | "value": "路氹城"
|
29207 | }]
|
29208 | }];
|
29209 |
|
29210 | var PickerCity_instance_data = (citys);
|
29211 |
|
29212 |
|
29213 | var instance_Picker = function Picker(params) {
|
29214 | if (!window._seeds_lang) window._seeds_lang = {};
|
29215 | |
29216 |
|
29217 |
|
29218 | var defaults = {
|
29219 | dataKeyPropertyName: 'key',
|
29220 | dataValuePropertyName: 'value',
|
29221 |
|
29222 | overflowContainer: document.body,
|
29223 | overflowContainerActiveClass: 'overflow-hidden',
|
29224 |
|
29225 | mask: null,
|
29226 |
|
29227 | maskClass: 'mask',
|
29228 | maskActiveClass: 'active',
|
29229 | maskFeatureClass: 'picker-mask',
|
29230 |
|
29231 | pickerClass: 'picker',
|
29232 | pickerActiveClass: 'active',
|
29233 |
|
29234 | headerClass: 'picker-header',
|
29235 | headerSubmitClass: 'picker-submit',
|
29236 | headerSubmitText: window._seeds_lang['finish'] || '完成',
|
29237 | headerCancelClass: 'picker-cancel',
|
29238 | headerCancelText: window._seeds_lang['cancel'] || '取消',
|
29239 |
|
29240 | wrapperClass: 'picker-wrapper',
|
29241 |
|
29242 | slotboxClass: 'picker-slotbox',
|
29243 | slotClass: 'picker-slot',
|
29244 |
|
29245 | layerClass: 'picker-layer',
|
29246 | layerFrameClass: 'picker-layer-frame',
|
29247 | layerFrameHTML: '<div class=picker-layer-frame></div>',
|
29248 |
|
29249 | lockClass: 'lock',
|
29250 |
|
29251 | cellHeight: 44,
|
29252 | bounceRange: 44
|
29253 |
|
29254 | |
29255 |
|
29256 |
|
29257 |
|
29258 |
|
29259 |
|
29260 |
|
29261 |
|
29262 |
|
29263 |
|
29264 |
|
29265 |
|
29266 | };
|
29267 | params = params || {};
|
29268 | for (var def in defaults) {
|
29269 | if (params[def] === undefined) {
|
29270 | params[def] = defaults[def];
|
29271 | }
|
29272 | }
|
29273 |
|
29274 | var s = this;
|
29275 |
|
29276 |
|
29277 | s.params = params;
|
29278 |
|
29279 | s.overflowContainer = typeof s.params.overflowContainer === 'string' ? document.querySelector(s.params.overflowContainer) : s.params.overflowContainer;
|
29280 | if (!s.overflowContainer) {
|
29281 | console.log('SeedsUI Error:未找到Picker的overflowContainer元素,请检查传入参数是否正确');
|
29282 | return;
|
29283 | }
|
29284 | s.picker = null;
|
29285 | s.mask = null;
|
29286 | s.header = null;
|
29287 | s.wrapper = null;
|
29288 | s.slotbox = null;
|
29289 | s.layer = null;
|
29290 | s.headerSubmit = null;
|
29291 | s.headerCancel = null;
|
29292 |
|
29293 |
|
29294 | s.activeOptions = [];
|
29295 |
|
29296 | s.createPicker = function () {
|
29297 | var picker = document.createElement('div');
|
29298 | picker.setAttribute('class', s.params.pickerClass);
|
29299 | return picker;
|
29300 | };
|
29301 |
|
29302 |
|
29303 | s.createHeader = function () {
|
29304 | var header = document.createElement('div');
|
29305 | header.setAttribute('class', s.params.headerClass);
|
29306 | return header;
|
29307 | };
|
29308 |
|
29309 |
|
29310 | s.createHeaderSubmit = function () {
|
29311 | var headerSubmit = document.createElement('a');
|
29312 | headerSubmit.setAttribute('class', s.params.headerSubmitClass);
|
29313 | headerSubmit.innerHTML = s.params.headerSubmitText;
|
29314 | return headerSubmit;
|
29315 | };
|
29316 | s.createHeaderCancel = function () {
|
29317 | var headerCancel = document.createElement('a');
|
29318 | headerCancel.setAttribute('class', s.params.headerCancelClass);
|
29319 | headerCancel.innerHTML = s.params.headerCancelText;
|
29320 | return headerCancel;
|
29321 | };
|
29322 |
|
29323 |
|
29324 | s.createWrapper = function () {
|
29325 | var wrapper = document.createElement('div');
|
29326 | wrapper.setAttribute('class', s.params.wrapperClass);
|
29327 | return wrapper;
|
29328 | };
|
29329 |
|
29330 |
|
29331 | s.createSlotbox = function () {
|
29332 | var slotbox = document.createElement('div');
|
29333 | slotbox.setAttribute('class', s.params.slotboxClass);
|
29334 | return slotbox;
|
29335 | };
|
29336 |
|
29337 |
|
29338 | s.createLayer = function () {
|
29339 | var layer = document.createElement('div');
|
29340 | layer.setAttribute('class', s.params.layerClass);
|
29341 | layer.innerHTML = s.params.layerFrameHTML;
|
29342 | return layer;
|
29343 | };
|
29344 |
|
29345 |
|
29346 | s.createMask = function () {
|
29347 | var mask = document.createElement('div');
|
29348 | mask.setAttribute('class', s.params.maskClass + ' ' + s.params.maskFeatureClass);
|
29349 | return mask;
|
29350 | };
|
29351 |
|
29352 |
|
29353 | s.create = function () {
|
29354 | if (s.params.mask) s.mask = typeof s.params.mask === 'string' ? document.querySelector(s.params.mask) : s.params.mask;
|
29355 |
|
29356 | if (s.mask) {
|
29357 | s.picker = s.mask.querySelector('.' + s.params.pickerClass);
|
29358 | s.header = s.mask.querySelector('.' + s.params.headerClass);
|
29359 | s.headerSubmit = s.mask.querySelector('.' + s.params.headerSubmitClass);
|
29360 | s.headerCancel = s.mask.querySelector('.' + s.params.headerCancelClass);
|
29361 | s.wrapper = s.mask.querySelector('.' + s.params.wrapperClass);
|
29362 | s.slotbox = s.mask.querySelector('.' + s.params.slotboxClass);
|
29363 | s.layer = s.mask.querySelector('.' + s.params.layerClass);
|
29364 | } else {
|
29365 | s.mask = s.createMask();
|
29366 | s.picker = s.createPicker();
|
29367 | s.header = s.createHeader();
|
29368 | s.headerSubmit = s.createHeaderSubmit();
|
29369 | s.headerCancel = s.createHeaderCancel();
|
29370 | s.wrapper = s.createWrapper();
|
29371 | s.slotbox = s.createSlotbox();
|
29372 | s.layer = s.createLayer();
|
29373 |
|
29374 | s.header.appendChild(s.headerCancel);
|
29375 | s.header.appendChild(s.headerSubmit);
|
29376 |
|
29377 | s.wrapper.appendChild(s.layer);
|
29378 | s.wrapper.appendChild(s.slotbox);
|
29379 |
|
29380 | s.picker.appendChild(s.header);
|
29381 | s.picker.appendChild(s.wrapper);
|
29382 |
|
29383 | s.mask.appendChild(s.picker);
|
29384 | s.overflowContainer.appendChild(s.mask);
|
29385 | }
|
29386 |
|
29387 | var andriodExp = navigator.userAgent.toLowerCase().match(/android\s*(\d*\.*\d*)/);
|
29388 | if (andriodExp && andriodExp[1]) {
|
29389 | if (andriodExp[1] < '5.0') s.mask.setAttribute('onTouchStart', '');
|
29390 | }
|
29391 | };
|
29392 | s.create();
|
29393 | |
29394 |
|
29395 |
|
29396 |
|
29397 | s.addSlot = function (values, defaultKey, classes) {
|
29398 | if (!classes) classes = '';
|
29399 |
|
29400 | var slot = document.createElement('ul');
|
29401 | slot.setAttribute('class', s.params.slotClass + ' ' + classes);
|
29402 | slot.values = values;
|
29403 | slot.defaultKey = defaultKey;
|
29404 | if (classes.indexOf(s.params.lockClass) >= 0) slot.isLock = true;else slot.isLock = false;
|
29405 |
|
29406 |
|
29407 | s.slotbox.appendChild(slot);
|
29408 |
|
29409 |
|
29410 | slot.index = s.slotbox.children.length - 1;
|
29411 | s.renderSlot(slot);
|
29412 | };
|
29413 |
|
29414 | s.replaceSlot = function (index, values, defaultKey, classes, fn) {
|
29415 | if (!classes) classes = '';
|
29416 |
|
29417 | var slot = s.slotbox.children[index];
|
29418 | slot.setAttribute('class', s.params.slotClass + ' ' + classes);
|
29419 | slot.values = values;
|
29420 | slot.defaultKey = defaultKey;
|
29421 | if (classes.indexOf(s.params.lockClass) >= 0) slot.isLock = true;else slot.isLock = false;
|
29422 |
|
29423 | if (classes.indexOf(s.params.lockClass) >= 0) s.slotbox.children[index].isLock = true;else s.slotbox.children[index].isLock = false;
|
29424 |
|
29425 | s.renderSlot(slot);
|
29426 |
|
29427 | if (fn) fn(s);
|
29428 | };
|
29429 |
|
29430 | s.renderSlot = function (slot) {
|
29431 |
|
29432 | var index = slot.index;
|
29433 | var values = slot.values;
|
29434 | slot.innerHTML = '';
|
29435 |
|
29436 | var li = '';
|
29437 | var defaultIndex = 0;
|
29438 | for (var i = 0; i < values.length; i++) {
|
29439 |
|
29440 | if (slot.defaultKey && slot.defaultKey == values[i][s.params.dataKeyPropertyName]) {
|
29441 |
|
29442 | defaultIndex = i;
|
29443 | }
|
29444 |
|
29445 |
|
29446 | li += '<li>' + values[i][s.params.dataValuePropertyName] + '</li>';
|
29447 | }
|
29448 | slot.innerHTML = li;
|
29449 |
|
29450 | s.activeOptions[index] = slot.values[defaultIndex];
|
29451 |
|
29452 | |
29453 |
|
29454 |
|
29455 |
|
29456 |
|
29457 | slot.defaultPosY = -defaultIndex * s.params.cellHeight;
|
29458 | slot.posY = -defaultIndex * s.params.cellHeight;
|
29459 | slot.minPosY = 0;
|
29460 | slot.maxPosY = -(slot.values.length - 1) * s.params.cellHeight;
|
29461 | slot.minBouncePosY = s.params.bounceRange;
|
29462 | slot.maxBouncePosY = slot.maxPosY - s.params.bounceRange;
|
29463 |
|
29464 | slot.style.webkitTransform = 'translate(0px,' + slot.posY + 'px)';
|
29465 | };
|
29466 | s.isHid = true;
|
29467 |
|
29468 | s.hide = function () {
|
29469 | s.isHid = true;
|
29470 | s.mask.classList.remove(s.params.maskActiveClass);
|
29471 | s.picker.classList.remove(s.params.pickerActiveClass);
|
29472 |
|
29473 | if (s.overflowContainer) s.overflowContainer.classList.remove(s.params.overflowContainerActiveClass);
|
29474 | };
|
29475 | s.show = function () {
|
29476 |
|
29477 | s.isHid = false;
|
29478 | s.mask.classList.add(s.params.maskActiveClass);
|
29479 | s.picker.classList.add(s.params.pickerActiveClass);
|
29480 |
|
29481 | if (s.overflowContainer) s.overflowContainer.classList.add(s.params.overflowContainerActiveClass);
|
29482 | };
|
29483 | s.clearSlots = function () {
|
29484 |
|
29485 |
|
29486 | s.slotbox.innerHTML = '';
|
29487 | };
|
29488 | s.destroy = function () {
|
29489 |
|
29490 | s.overflowContainer.removeChild(s.mask);
|
29491 | };
|
29492 |
|
29493 | s.calcInertance = function (opts) {
|
29494 |
|
29495 | var friction = 0.002;
|
29496 |
|
29497 | var opRange = opts.range;
|
29498 |
|
29499 | var opDuration = opts.duration;
|
29500 |
|
29501 |
|
29502 | var duration = 2 * opRange / opDuration / friction;
|
29503 |
|
29504 | var range = -(friction / 2) * (duration * duration);
|
29505 | if (opRange < 0) {
|
29506 |
|
29507 | duration = -duration;
|
29508 | range = -range;
|
29509 | }
|
29510 | |
29511 |
|
29512 |
|
29513 |
|
29514 |
|
29515 | var value = opts.current + range;
|
29516 |
|
29517 |
|
29518 | if (value > opts.min) {
|
29519 |
|
29520 |
|
29521 | duration = 300;
|
29522 | value = opts.min;
|
29523 | } else if (value < opts.max) {
|
29524 |
|
29525 | duration = 300;
|
29526 | value = opts.max;
|
29527 | } else {
|
29528 |
|
29529 | var remainder = value % s.params.cellHeight;
|
29530 | if (remainder !== 0) {
|
29531 |
|
29532 | var divided = Math.round(value / s.params.cellHeight);
|
29533 |
|
29534 | value = s.params.cellHeight * divided;
|
29535 | }
|
29536 | }
|
29537 |
|
29538 |
|
29539 | s.updateActiveOptions(s.activeSlot, value);
|
29540 |
|
29541 |
|
29542 | return {
|
29543 | duration: Math.round(duration),
|
29544 | value: Math.round(value)
|
29545 | };
|
29546 | };
|
29547 |
|
29548 | s.updateActiveOptions = function (slot, posY) {
|
29549 | var index = -Math.round((posY - s.params.cellHeight * 2) / s.params.cellHeight) - 2;
|
29550 |
|
29551 | var activeOption = slot.values[index];
|
29552 | s.activeOptions[slot.index] = activeOption;
|
29553 | };
|
29554 | |
29555 |
|
29556 |
|
29557 | s.isSupportTouch = 'ontouchstart' in window;
|
29558 | s.events = function (detach) {
|
29559 | var action = detach ? 'removeEventListener' : 'addEventListener';
|
29560 |
|
29561 | if (s.isSupportTouch) {
|
29562 | s.slotbox[action]('touchstart', s.onTouchStart, false);
|
29563 | s.slotbox[action]('touchmove', s.onTouchMove, false);
|
29564 | s.slotbox[action]('touchend', s.onTouchEnd, false);
|
29565 | s.slotbox[action]('touchcancel', s.onTouchEnd, false);
|
29566 | } else {
|
29567 | s.slotbox[action]('mousedown', s.onTouchStart, false);
|
29568 | s.slotbox[action]('mousemove', s.onTouchMove, false);
|
29569 | s.slotbox[action]('mouseup', s.onTouchEnd, false);
|
29570 | }
|
29571 |
|
29572 | s.picker[action]('webkitTransitionEnd', s.onTransitionEnd, false);
|
29573 |
|
29574 | s.mask[action]('click', s.onClick, false);
|
29575 | };
|
29576 | s.detach = function (event) {
|
29577 | s.events(true);
|
29578 | };
|
29579 | s.attach = function (event) {
|
29580 | s.events();
|
29581 | };
|
29582 |
|
29583 | s.onClick = function (e) {
|
29584 | s.event = e;
|
29585 |
|
29586 | if (s.params.onClick) {
|
29587 | s.params.onClick(s);
|
29588 | }
|
29589 | if (e.target.classList.contains(s.params.maskClass)) {
|
29590 |
|
29591 | s.onClickMask(s);
|
29592 | } else if (e.target.classList.contains(s.params.headerSubmitClass)) {
|
29593 |
|
29594 | s.onClickSubmit(s);
|
29595 | } else if (e.target.classList.contains(s.params.headerCancelClass)) {
|
29596 |
|
29597 | s.onClickCancel(s);
|
29598 | }
|
29599 | };
|
29600 |
|
29601 |
|
29602 | s.onClickMask = function (s) {
|
29603 | if (s.params.onClickMask) s.params.onClickMask(s);else s.hide();
|
29604 | };
|
29605 |
|
29606 |
|
29607 | s.onClickSubmit = function (s) {
|
29608 | if (s.params.onClickSubmit) s.params.onClickSubmit(s);else s.hide();
|
29609 | };
|
29610 | s.onClickCancel = function (s) {
|
29611 | if (s.params.onClickCancel) s.params.onClickCancel(s);else s.hide();
|
29612 | };
|
29613 |
|
29614 | s.touches = {
|
29615 | startX: 0,
|
29616 | startY: 0,
|
29617 | currentX: 0,
|
29618 | currentY: 0,
|
29619 | endX: 0,
|
29620 | endY: 0,
|
29621 | startTimeStamp: 0,
|
29622 | duration: 0,
|
29623 | diffX: 0,
|
29624 | diffY: 0,
|
29625 | posY: 0,
|
29626 | currentPosY: 0,
|
29627 | direction: null
|
29628 | };
|
29629 | s.startMouseMove = false;
|
29630 |
|
29631 | s.onTouchStart = function (e) {
|
29632 | s.startMouseMove = true;
|
29633 | s.touches.startX = e.clientX || e.touches[0].clientX;
|
29634 | s.touches.startY = e.clientY || e.touches[0].clientY;
|
29635 |
|
29636 | s.activeSlot = e.target;
|
29637 |
|
29638 |
|
29639 | if (s.activeSlot.isLock) return;
|
29640 |
|
29641 |
|
29642 | s.touches.posY = s.activeSlot.posY;
|
29643 |
|
29644 |
|
29645 | s.activeSlot.style.webkitTransitionDuration = 0;
|
29646 |
|
29647 |
|
29648 | s.touches.startTimeStamp = e.timeStamp;
|
29649 |
|
29650 | if (s.params.onScrollStart) s.params.onScrollStart(s);
|
29651 | };
|
29652 | s.onTouchMove = function (e) {
|
29653 | if (!s.startMouseMove) return;
|
29654 | e.preventDefault();
|
29655 |
|
29656 | if (s.activeSlot.isLock) return;
|
29657 |
|
29658 | s.touches.currentY = e.clientY || e.touches[0].clientY;
|
29659 | s.touches.diffY = s.touches.startY - s.touches.currentY;
|
29660 | s.touches.currentPosY = s.touches.posY - s.touches.diffY;
|
29661 | if (s.touches.currentPosY > s.activeSlot.minBouncePosY) {
|
29662 | s.touches.currentPosY = s.activeSlot.minBouncePosY;
|
29663 | } else if (s.touches.currentPosY < s.activeSlot.maxBouncePosY) {
|
29664 | s.touches.currentPosY = s.activeSlot.maxBouncePosY;
|
29665 | }
|
29666 | s.activeSlot.style.webkitTransform = 'translate(0px,' + s.touches.currentPosY + 'px)';
|
29667 |
|
29668 |
|
29669 | if (s.params.onScroll) s.params.onScroll(s);
|
29670 | };
|
29671 | s.onTouchEnd = function (e) {
|
29672 | s.startMouseMove = false;
|
29673 |
|
29674 | if (s.activeSlot.isLock) return;
|
29675 |
|
29676 | s.touches.endX = e.clientX || e.changedTouches[0].clientX;
|
29677 | s.touches.endY = e.clientY || e.changedTouches[0].clientY;
|
29678 | s.touches.diffX = s.touches.startX - s.touches.endX;
|
29679 | s.touches.diffY = s.touches.startY - s.touches.endY;
|
29680 |
|
29681 | if (Math.abs(s.touches.diffX) < 6 && Math.abs(s.touches.diffY) < 6) {
|
29682 | return;
|
29683 | }
|
29684 |
|
29685 |
|
29686 | s.touches.duration = e.timeStamp - s.touches.startTimeStamp;
|
29687 |
|
29688 |
|
29689 | var inertance = s.calcInertance({
|
29690 | range: s.touches.diffY,
|
29691 | duration: s.touches.duration,
|
29692 | current: s.touches.currentPosY,
|
29693 | min: s.activeSlot.minPosY,
|
29694 | max: s.activeSlot.maxPosY
|
29695 | });
|
29696 |
|
29697 | s.activeSlot.style.webkitTransitionDuration = inertance.duration + 'ms';
|
29698 | s.activeSlot.posY = inertance.value;
|
29699 | s.activeSlot.style.webkitTransform = 'translate(0px,' + inertance.value + 'px)';
|
29700 |
|
29701 |
|
29702 | if (s.params.onScrollEnd) s.params.onScrollEnd(s);
|
29703 | };
|
29704 |
|
29705 | s.onTransitionEnd = function (e) {
|
29706 | var target = e.target;
|
29707 | if (e.propertyName !== 'transform' || target !== s.picker) {
|
29708 | return;
|
29709 | }
|
29710 |
|
29711 | if (target.classList.contains(s.params.pickerClass)) {
|
29712 | if (s.params.onTransitionEnd) s.params.onTransitionEnd(s);
|
29713 | if (s.isHid) {
|
29714 | if (s.params.onHid) s.params.onHid(s);
|
29715 | } else {
|
29716 | if (s.params.onShowed) s.params.onShowed(s);
|
29717 | }
|
29718 | }
|
29719 | };
|
29720 |
|
29721 | s.init = function () {
|
29722 | if (s.params.onInit) s.params.onInit(s);
|
29723 | s.attach();
|
29724 | };
|
29725 | s.init();
|
29726 | return s;
|
29727 | };
|
29728 |
|
29729 | var Picker_instance = (instance_Picker);
|
29730 |
|
29731 |
|
29732 | var instance_PickerCity = function PickerCity(params) {
|
29733 | var _ref;
|
29734 |
|
29735 |
|
29736 | var onCityClickSubmit = params.onClickSubmit;
|
29737 | var onCityScrollEnd = params.onScrollEnd;
|
29738 | params.onClickSubmit = undefined;
|
29739 | params.onScrollEnd = undefined;
|
29740 | |
29741 |
|
29742 |
|
29743 | var defaults = {
|
29744 | dataKeyPropertyName: 'key',
|
29745 | dataValuePropertyName: 'value',
|
29746 | dataChildPropertyName: 'children',
|
29747 |
|
29748 | split: '-',
|
29749 |
|
29750 | viewType: 'district',
|
29751 | data: null,
|
29752 |
|
29753 | defaultProvinceKey: '',
|
29754 | defaultCityKey: '',
|
29755 | defaultDistrictKey: '',
|
29756 |
|
29757 | defaultProvince: '北京市',
|
29758 | defaultCity: '东城区',
|
29759 | defaultDistrict: '',
|
29760 |
|
29761 | provinceClass: 'text-center',
|
29762 | cityClass: 'text-center',
|
29763 | districtClass: 'text-center',
|
29764 |
|
29765 | onClickSubmit: function onClickSubmit(e) {
|
29766 | e.activeText = getActiveText(e.activeOptions);
|
29767 | setActiveKeys(e.activeOptions);
|
29768 | if (onCityClickSubmit) onCityClickSubmit(e);
|
29769 | },
|
29770 | onScrollEnd: function onScrollEnd(e) {
|
29771 |
|
29772 | var activeOption = e.activeOptions[e.activeSlot.index];
|
29773 | if (e.activeSlot.index === 0) {
|
29774 |
|
29775 | var city = replaceCity(activeOption[s.params.dataKeyPropertyName]);
|
29776 | replaceDistrict(city[0][s.params.dataKeyPropertyName]);
|
29777 | } else if (e.activeSlot.index === 1) {
|
29778 |
|
29779 | replaceDistrict(activeOption[s.params.dataKeyPropertyName]);
|
29780 | }
|
29781 |
|
29782 | if (onCityScrollEnd) onCityScrollEnd(e);
|
29783 | }
|
29784 | };
|
29785 | params = params || {};
|
29786 | for (var def in defaults) {
|
29787 | if (params[def] === undefined || params[def] === null) {
|
29788 | params[def] = defaults[def];
|
29789 | }
|
29790 | }
|
29791 | var s = new Picker_instance(params);
|
29792 |
|
29793 |
|
29794 | s.params.defaultValues = [(_ref = {}, _ref[s.params.dataKeyPropertyName] = '', _ref[s.params.dataValuePropertyName] = '----', _ref)];
|
29795 |
|
29796 |
|
29797 | if (!s.params.data) return;
|
29798 |
|
29799 |
|
29800 | s.province = null;
|
29801 | s.city = null;
|
29802 | s.district = null;
|
29803 |
|
29804 | s.activeProvinceKey = null;
|
29805 | s.activeCityKey = null;
|
29806 | s.activeDistrictKey = null;
|
29807 |
|
29808 |
|
29809 | s.setActiveProvinceKey = function (key) {
|
29810 | s.activeProvinceKey = ('' + key).replace(/(^\s*)|(\s*$)/, '');
|
29811 | };
|
29812 | s.setActiveCityKey = function (key) {
|
29813 | s.activeCityKey = ('' + key).replace(/(^\s*)|(\s*$)/, '');
|
29814 | };
|
29815 | s.setActiveDistrictKey = function (key) {
|
29816 | s.activeDistrictKey = ('' + key).replace(/(^\s*)|(\s*$)/, '');
|
29817 | };
|
29818 |
|
29819 | |
29820 |
|
29821 |
|
29822 |
|
29823 | s.setData = function (data, dataProperty) {
|
29824 | if (data) s.params.data = data;
|
29825 | if (dataProperty && dataProperty.dataKeyPropertyName) s.params.dataKeyPropertyName = dataProperty.dataKeyPropertyName;
|
29826 | if (dataProperty && dataProperty.dataValuePropertyName) s.params.dataValuePropertyName = dataProperty.dataValuePropertyName;
|
29827 | if (dataProperty && dataProperty.dataChildPropertyName) s.params.dataChildPropertyName = dataProperty.dataChildPropertyName;
|
29828 | };
|
29829 |
|
29830 | s.getKeysByValues = function (values) {
|
29831 | var keys = [];
|
29832 | for (var i = 0, province; province = s.params.data[i++];) {
|
29833 |
|
29834 |
|
29835 | if (values[0] && (province[s.params.dataValuePropertyName].indexOf(values[0]) > -1 || values[0].indexOf(province[s.params.dataValuePropertyName]) > -1)) {
|
29836 | keys.push(province[s.params.dataKeyPropertyName]);
|
29837 | for (var j = 0, city; city = province[s.params.dataChildPropertyName][j++];) {
|
29838 |
|
29839 |
|
29840 | if (values[1] && (city[s.params.dataValuePropertyName].indexOf(values[1]) > -1 || values[1].indexOf(city[s.params.dataValuePropertyName]) > -1)) {
|
29841 | keys.push(city[s.params.dataKeyPropertyName]);
|
29842 | if (values[2]) {
|
29843 | for (var k = 0, district; district = city[s.params.dataChildPropertyName][k++];) {
|
29844 |
|
29845 |
|
29846 | if (values[2] && (district[s.params.dataValuePropertyName].indexOf(values[2]) > -1 || values[2].indexOf(district[s.params.dataValuePropertyName]) > -1)) {
|
29847 | keys.push(district[s.params.dataKeyPropertyName]);
|
29848 | return keys;
|
29849 | }
|
29850 | }
|
29851 | } else {
|
29852 | return keys;
|
29853 | }
|
29854 | }
|
29855 | }
|
29856 | }
|
29857 | }
|
29858 |
|
29859 | return [s.params.data[0][s.params.dataKeyPropertyName], s.params.data[0][s.params.dataChildPropertyName][0][s.params.dataKeyPropertyName]];
|
29860 | };
|
29861 |
|
29862 | s.getValuesByKeys = function (keys) {
|
29863 | var values = [];
|
29864 | for (var i = 0, province; province = s.params.data[i++];) {
|
29865 |
|
29866 |
|
29867 | if (keys[0] && province[s.params.dataKeyPropertyName] === keys[0]) {
|
29868 | values.push(province[s.params.dataValuePropertyName]);
|
29869 | for (var j = 0, city; city = province[s.params.dataChildPropertyName][j++];) {
|
29870 |
|
29871 |
|
29872 | if (keys[1] && city[s.params.dataKeyPropertyName] === keys[1]) {
|
29873 | values.push(city[s.params.dataValuePropertyName]);
|
29874 | if (keys[2]) {
|
29875 | for (var k = 0, district; district = city[s.params.dataChildPropertyName][k++];) {
|
29876 |
|
29877 |
|
29878 | if (keys[2] && district[s.params.dataKeyPropertyName] === keys[2]) {
|
29879 | values.push(district[s.params.dataValuePropertyName]);
|
29880 | return values;
|
29881 | }
|
29882 | }
|
29883 | } else {
|
29884 | return values;
|
29885 | }
|
29886 | }
|
29887 | }
|
29888 | }
|
29889 | }
|
29890 |
|
29891 | return [s.params.data[0][s.params.dataValuePropertyName], s.params.data[0][s.params.dataChildPropertyName][0][s.params.dataValuePropertyName]];
|
29892 | };
|
29893 |
|
29894 | s.getValueByKey = function (key) {
|
29895 | for (var i = 0, province; province = s.params.data[i++];) {
|
29896 |
|
29897 |
|
29898 | if (province[s.params.dataKeyPropertyName] === key) return province[s.params.dataValuePropertyName];
|
29899 | for (var j = 0, city; city = province[s.params.dataChildPropertyName][j++];) {
|
29900 |
|
29901 |
|
29902 | if (city[s.params.dataKeyPropertyName] === key) return city[s.params.dataValuePropertyName];
|
29903 | for (var k = 0, district; district = city[s.params.dataChildPropertyName][k++];) {
|
29904 |
|
29905 |
|
29906 | if (district[s.params.dataKeyPropertyName] === key) return district[s.params.dataValuePropertyName];
|
29907 | }
|
29908 | }
|
29909 | }
|
29910 | };
|
29911 |
|
29912 | s.setDefaultValues = function (argActiveValues) {
|
29913 | var activeValues = argActiveValues || '';
|
29914 |
|
29915 | var keys = s.getKeysByValues(activeValues);
|
29916 | if (keys && keys[0]) s.setActiveProvinceKey(keys[0]);
|
29917 | if (keys && keys[1]) s.setActiveCityKey(keys[1]);
|
29918 | if (keys && keys[2]) s.setActiveDistrictKey(keys[2]);
|
29919 | };
|
29920 |
|
29921 | s.setDefaultKeys = function (argActiveKeys) {
|
29922 | if (!Array.isArray(argActiveKeys) || argActiveKeys.length < 2) {
|
29923 | return;
|
29924 | }
|
29925 |
|
29926 | var keys = argActiveKeys;
|
29927 | if (keys && keys[0]) s.setActiveProvinceKey(keys[0]);
|
29928 | if (keys && keys[1]) s.setActiveCityKey(keys[1]);
|
29929 | if (keys && keys[2]) s.setActiveDistrictKey(keys[2]);
|
29930 | };
|
29931 |
|
29932 |
|
29933 | function getActiveText(activeOptions) {
|
29934 | var activeValues = activeOptions.map(function (n, i, a) {
|
29935 | return n[s.params.dataValuePropertyName];
|
29936 | });
|
29937 | var activeText = '';
|
29938 | if (activeValues[0]) activeText += activeValues[0];
|
29939 | if (activeValues[1]) activeText += s.params.split + activeValues[1];
|
29940 | if (activeValues[2] && activeValues[2] !== s.params.defaultValues[0][s.params.dataValuePropertyName]) activeText += s.params.split + activeValues[2];
|
29941 | return activeText;
|
29942 | }
|
29943 |
|
29944 | function setActiveKeys(activeOptions) {
|
29945 | var activeKeys = activeOptions.map(function (n, i, a) {
|
29946 | return n[s.params.dataKeyPropertyName];
|
29947 | });
|
29948 | if (activeKeys[0]) s.setActiveProvinceKey(activeKeys[0]);
|
29949 | if (activeKeys[1]) s.setActiveCityKey(activeKeys[1]);
|
29950 | if (activeKeys[2]) s.setActiveDistrictKey(activeKeys[2]);
|
29951 | }
|
29952 |
|
29953 |
|
29954 | function getPureArray(array) {
|
29955 | var arr = [];
|
29956 |
|
29957 | for (var i = 0, opt; opt = array[i++];) {
|
29958 | var _arr$push;
|
29959 |
|
29960 | arr.push((_arr$push = {}, _arr$push[s.params.dataKeyPropertyName] = opt[s.params.dataKeyPropertyName], _arr$push[s.params.dataValuePropertyName] = opt[s.params.dataValuePropertyName], _arr$push));
|
29961 | }
|
29962 |
|
29963 | return arr;
|
29964 | }
|
29965 |
|
29966 |
|
29967 | function getChildrenByKey(key) {
|
29968 |
|
29969 | if (!key) return getPureArray(s.params.data);
|
29970 |
|
29971 |
|
29972 | for (var i = 0, province; province = s.params.data[i++];) {
|
29973 | if (province[s.params.dataKeyPropertyName] == key) return getPureArray(province[s.params.dataChildPropertyName]);
|
29974 | for (var j = 0, city; city = province[s.params.dataChildPropertyName][j++];) {
|
29975 | if (!city[s.params.dataChildPropertyName]) break;
|
29976 | if (city[s.params.dataKeyPropertyName] == key) return getPureArray(city[s.params.dataChildPropertyName]);
|
29977 | }
|
29978 | }
|
29979 |
|
29980 | return null;
|
29981 | }
|
29982 | |
29983 |
|
29984 |
|
29985 | |
29986 |
|
29987 |
|
29988 |
|
29989 |
|
29990 |
|
29991 |
|
29992 | function replaceCity(key, activeKey) {
|
29993 | var citys = getChildrenByKey(key);
|
29994 | s.replaceSlot(1, citys, activeKey || citys[0][s.params.dataKeyPropertyName], s.params.cityClass);
|
29995 | return citys;
|
29996 | }
|
29997 |
|
29998 | function replaceDistrict(key, activeKey) {
|
29999 | if (s.params.viewType !== 'district') return;
|
30000 | var districts = getChildrenByKey(key);
|
30001 | if (districts && districts.length && districts.length > 0) {
|
30002 | s.replaceSlot(2, districts, activeKey || districts[0][s.params.dataKeyPropertyName], s.params.districtClass);
|
30003 | } else {
|
30004 | s.replaceSlot(2, s.params.defaultValues, s.params.defaultValues[s.params.dataKeyPropertyName], s.params.districtClass);
|
30005 | }
|
30006 | }
|
30007 |
|
30008 | function addProvince() {
|
30009 | s.province = getChildrenByKey();
|
30010 | if (!s.activeProvinceKey) {
|
30011 | s.setActiveProvinceKey(s.province[0][s.params.dataKeyPropertyName]);
|
30012 | }
|
30013 | s.addSlot(s.province, s.activeProvinceKey, s.params.provinceClass);
|
30014 | }
|
30015 |
|
30016 | function addCity() {
|
30017 | s.city = getChildrenByKey(s.activeProvinceKey);
|
30018 |
|
30019 | if (!s.city) {
|
30020 | console.warn('SeedsUI PickerCity: 上级省code' + s.activeProvinceKey + '下级不存在,将默认选中第一个城市');
|
30021 | s.setActiveProvinceKey(s.province[0][s.params.dataKeyPropertyName]);
|
30022 | s.city = getChildrenByKey(s.activeProvinceKey);
|
30023 | s.setActiveCityKey(s.city[0][s.params.dataKeyPropertyName]);
|
30024 | }
|
30025 | if (!s.activeCityKey) {
|
30026 | s.setActiveCityKey(s.city[0][s.params.dataKeyPropertyName]);
|
30027 | }
|
30028 | s.addSlot(s.city, s.activeCityKey, s.params.cityClass);
|
30029 | }
|
30030 |
|
30031 | function addDistrict() {
|
30032 | if (s.params.viewType !== 'district') return;
|
30033 | s.district = getChildrenByKey(s.activeCityKey);
|
30034 |
|
30035 | if (!s.district) {
|
30036 | console.warn('SeedsUI PickerCity: 上级市code' + s.activeCityKey + '下级不存在,将默认选中第一个区县或置空');
|
30037 | s.setActiveCityKey(s.city[0][s.params.dataKeyPropertyName]);
|
30038 | s.district = getChildrenByKey(s.city[0][s.params.dataKeyPropertyName]);
|
30039 | if (s.district) s.setActiveDistrictKey(s.district[0][s.params.dataKeyPropertyName]);
|
30040 | }
|
30041 | if (!s.activeDistrictKey && s.district) {
|
30042 | s.setActiveDistrictKey(s.district[0][s.params.dataKeyPropertyName]);
|
30043 | }
|
30044 | if (s.district) {
|
30045 | s.addSlot(s.district, s.activeDistrictKey, s.params.districtClass);
|
30046 | } else {
|
30047 | s.addSlot(s.params.defaultValues, '', s.params.districtClass);
|
30048 | }
|
30049 | }
|
30050 |
|
30051 | function initSlots() {
|
30052 |
|
30053 | addProvince();
|
30054 | addCity();
|
30055 | addDistrict();
|
30056 | }
|
30057 | s.update = function () {
|
30058 | s.clearSlots();
|
30059 | initSlots();
|
30060 | };
|
30061 |
|
30062 | if (s.params.defaultProvinceKey && s.params.defaultCityKey) {
|
30063 | s.setDefaultKeys([s.params.defaultProvinceKey, s.params.defaultCityKey, s.params.defaultDistrictKey]);
|
30064 | } else {
|
30065 | s.setDefaultValues([s.params.defaultProvince, s.params.defaultCity, s.params.defaultDistrict]);
|
30066 | }
|
30067 |
|
30068 | initSlots();
|
30069 | return s;
|
30070 | };
|
30071 |
|
30072 | var PickerCity_instance = (instance_PickerCity);
|
30073 |
|
30074 | var PickerCity_class, PickerCity_temp;
|
30075 |
|
30076 | function PickerCity_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
30077 |
|
30078 | function PickerCity_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
30079 |
|
30080 | function PickerCity_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
30081 |
|
30082 |
|
30083 |
|
30084 |
|
30085 |
|
30086 |
|
30087 |
|
30088 | if (!window._seeds_lang) window._seeds_lang = {};
|
30089 |
|
30090 | var PickerCity_PickerCity = (PickerCity_temp = PickerCity_class = function (_Component) {
|
30091 | PickerCity_inherits(PickerCity, _Component);
|
30092 |
|
30093 | function PickerCity(props) {
|
30094 | PickerCity_classCallCheck(this, PickerCity);
|
30095 |
|
30096 | var _this = PickerCity_possibleConstructorReturn(this, _Component.call(this, props));
|
30097 |
|
30098 | _this.componentDidMount = function () {
|
30099 | _this.initInstance();
|
30100 | };
|
30101 |
|
30102 | _this.shouldComponentUpdate = function (nextProps) {
|
30103 | if (nextProps.show === _this.props.show) return false;
|
30104 | return true;
|
30105 | };
|
30106 |
|
30107 | _this.componentDidUpdate = function (prevProps) {
|
30108 | if (_this.instance) {
|
30109 | if (_this.props.show) {
|
30110 | if (_this.props.data) {
|
30111 | _this.instance.setData(_this.props.data, {
|
30112 | dataChildPropertyName: _this.props.dataChildPropertyName,
|
30113 | dataKeyPropertyName: _this.props.dataKeyPropertyName,
|
30114 | dataValuePropertyName: _this.props.dataValuePropertyName
|
30115 | });
|
30116 | }
|
30117 | _this.setDefault();
|
30118 | _this.instance.show();
|
30119 | } else _this.instance.hide();
|
30120 | }
|
30121 | };
|
30122 |
|
30123 | _this.setDefault = function () {
|
30124 | var _this$props = _this.props,
|
30125 | valueForKey = _this$props.valueForKey,
|
30126 | split = _this$props.split;
|
30127 |
|
30128 | if (valueForKey && valueForKey.split(split).length > 1 && valueForKey.split(split).some(function (key) {
|
30129 | return !isNaN(key);
|
30130 | })) {
|
30131 | _this.instance.setDefaultKeys(valueForKey.split(split));
|
30132 | } else {
|
30133 | var defaultValues = _this.getDefaultValues();
|
30134 | _this.instance.setDefaultValues(defaultValues);
|
30135 | }
|
30136 | _this.instance.update();
|
30137 | };
|
30138 |
|
30139 | _this.getDefaultValues = function () {
|
30140 |
|
30141 | var defaultValue = _this.props.value;
|
30142 | var defaultValues = [];
|
30143 | if (defaultValue) {
|
30144 | defaultValues = defaultValue.split(_this.props.split).map(function (item) {
|
30145 | return item.trim();
|
30146 | });
|
30147 | }
|
30148 | return defaultValues;
|
30149 | };
|
30150 |
|
30151 | _this.getDefaultKeys = function () {
|
30152 | var _this$props2 = _this.props,
|
30153 | valueForKey = _this$props2.valueForKey,
|
30154 | split = _this$props2.split;
|
30155 |
|
30156 | if (valueForKey && valueForKey.split(split).length > 1) {
|
30157 | return valueForKey.split(split);
|
30158 | }
|
30159 | return ['', '', ''];
|
30160 | };
|
30161 |
|
30162 | _this.initInstance = function () {
|
30163 | var defaultValues = _this.getDefaultValues();
|
30164 | var defaultKeys = _this.getDefaultKeys();
|
30165 |
|
30166 | var instance = new PickerCity_instance({
|
30167 | data: _this.props.data || PickerCity_instance_data,
|
30168 | dataKeyPropertyName: _this.props.dataKeyPropertyName,
|
30169 | dataValuePropertyName: _this.props.dataValuePropertyName,
|
30170 | dataChildPropertyName: _this.props.dataChildPropertyName,
|
30171 |
|
30172 | mask: _this.$el,
|
30173 | split: _this.props.split,
|
30174 | viewType: _this.props.type,
|
30175 | defaultProvinceKey: defaultKeys[0] || '',
|
30176 | defaultCityKey: defaultKeys[1] || '',
|
30177 | defaultDistrictKey: defaultKeys[2] || '',
|
30178 | defaultProvince: defaultValues[0] || '',
|
30179 | defaultCity: defaultValues[1] || '',
|
30180 | defaultDistrict: defaultValues[2] || '',
|
30181 | onClickMask: function onClickMask(e) {
|
30182 | if (_this.props.onClickMask) _this.props.onClickMask(e);
|
30183 | },
|
30184 | onClickCancel: function onClickCancel(e) {
|
30185 |
|
30186 | if (_this.props.onClickCancel) _this.props.onClickCancel(e);
|
30187 | },
|
30188 | onClickSubmit: function onClickSubmit(e) {
|
30189 |
|
30190 | if (_this.props.onClickSubmit) _this.props.onClickSubmit(e);
|
30191 | },
|
30192 | onHid: function onHid(e) {}
|
30193 | });
|
30194 | if (_this.props.show && instance) {
|
30195 | setTimeout(function () {
|
30196 | instance.show();
|
30197 | }, 10);
|
30198 | }
|
30199 | _this.instance = instance;
|
30200 | };
|
30201 |
|
30202 | return _this;
|
30203 | }
|
30204 |
|
30205 | PickerCity.prototype.render = function render() {
|
30206 | var _this2 = this;
|
30207 |
|
30208 | var _props = this.props,
|
30209 | maskClassName = _props.maskClassName,
|
30210 | maskStyle = _props.maskStyle,
|
30211 | className = _props.className,
|
30212 | style = _props.style;
|
30213 |
|
30214 | return Object(react_dom["createPortal"])(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
30215 | 'div',
|
30216 | { className: 'mask picker-mask' + (maskClassName ? ' ' + maskClassName : ''), style: maskStyle, ref: function ref(el) {
|
30217 | _this2.$el = el;
|
30218 | } },
|
30219 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
30220 | 'div',
|
30221 | { className: 'picker' + (className ? ' ' + className : ''), style: style },
|
30222 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
30223 | 'div',
|
30224 | { className: 'picker-header' },
|
30225 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
30226 | 'a',
|
30227 | { className: 'picker-cancel' },
|
30228 | window._seeds_lang['cancel'] || '取消'
|
30229 | ),
|
30230 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
30231 | 'a',
|
30232 | { className: 'picker-submit' },
|
30233 | window._seeds_lang['finish'] || '完成'
|
30234 | )
|
30235 | ),
|
30236 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
30237 | 'div',
|
30238 | { className: 'picker-wrapper' },
|
30239 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
30240 | 'div',
|
30241 | { className: 'picker-layer' },
|
30242 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'picker-layer-frame' })
|
30243 | ),
|
30244 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'picker-slotbox' })
|
30245 | )
|
30246 | )
|
30247 | ), this.props.portal || document.getElementById('root'));
|
30248 | };
|
30249 |
|
30250 | return PickerCity;
|
30251 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), PickerCity_class.propTypes = {
|
30252 | data: prop_types_default.a.array,
|
30253 | dataKeyPropertyName: prop_types_default.a.string,
|
30254 | dataValuePropertyName: prop_types_default.a.string,
|
30255 | dataChildPropertyName: prop_types_default.a.string,
|
30256 |
|
30257 | portal: prop_types_default.a.object,
|
30258 | split: prop_types_default.a.string,
|
30259 | type: prop_types_default.a.string,
|
30260 |
|
30261 | maskClassName: prop_types_default.a.string,
|
30262 | maskStyle: prop_types_default.a.object,
|
30263 | className: prop_types_default.a.string,
|
30264 | style: prop_types_default.a.object,
|
30265 |
|
30266 | value: prop_types_default.a.string,
|
30267 | valueForKey: prop_types_default.a.string,
|
30268 | show: prop_types_default.a.bool,
|
30269 | onClickMask: prop_types_default.a.func,
|
30270 | onClickCancel: prop_types_default.a.func,
|
30271 | onClickSubmit: prop_types_default.a.func
|
30272 | }, PickerCity_class.defaultProps = {
|
30273 | data: null,
|
30274 | dataKeyPropertyName: 'key',
|
30275 | dataValuePropertyName: 'value',
|
30276 | dataChildPropertyName: 'children',
|
30277 |
|
30278 | split: '-',
|
30279 | type: 'district'
|
30280 | }, PickerCity_temp);
|
30281 |
|
30282 |
|
30283 |
|
30284 |
|
30285 | var src_PickerCity = (PickerCity_PickerCity);
|
30286 |
|
30287 | var InputCity_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; };
|
30288 |
|
30289 | var InputCity_class, InputCity_temp;
|
30290 |
|
30291 | function InputCity_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
30292 |
|
30293 | function InputCity_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
30294 |
|
30295 | function InputCity_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
30296 |
|
30297 | function InputCity_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
30298 |
|
30299 |
|
30300 |
|
30301 |
|
30302 |
|
30303 |
|
30304 | var InputCity_InputCity = (InputCity_temp = InputCity_class = function (_Component) {
|
30305 | InputCity_inherits(InputCity, _Component);
|
30306 |
|
30307 | function InputCity(props) {
|
30308 | InputCity_classCallCheck(this, InputCity);
|
30309 |
|
30310 | var _this = InputCity_possibleConstructorReturn(this, _Component.call(this, props));
|
30311 |
|
30312 | _this.onClick = function (value, args) {
|
30313 | if (_this.props.onClick) _this.props.onClick(value, args);
|
30314 | _this.setState({
|
30315 | show: !_this.state.show
|
30316 | });
|
30317 | };
|
30318 |
|
30319 | _this.onClickSubmit = function (e) {
|
30320 | if (!_this.$input) _this.$input = _this.refs.$ComponentInputText.$input;
|
30321 | if (_this.props.onClickSubmit) {
|
30322 | _this.props.onClickSubmit(e);
|
30323 | return;
|
30324 | }
|
30325 | var value = e.activeText;
|
30326 | var options = e.activeOptions;
|
30327 |
|
30328 | if (!_this.props.valueBindProp) _this.$input.value = value;
|
30329 | _this.setState({
|
30330 | show: !_this.state.show
|
30331 | });
|
30332 | if (_this.props.onChange) {
|
30333 | _this.props.onChange(value, options, _this.props.args);
|
30334 | }
|
30335 | };
|
30336 |
|
30337 | _this.onClickCancel = function (e) {
|
30338 | if (_this.props.onClickCancel) {
|
30339 | _this.props.onClickCancel(e);
|
30340 | return;
|
30341 | }
|
30342 | _this.setState({
|
30343 | show: !_this.state.show
|
30344 | });
|
30345 | };
|
30346 |
|
30347 | _this.onClickMask = function (e) {
|
30348 | if (_this.props.onClickMask) {
|
30349 | _this.props.onClickMask(e);
|
30350 | return;
|
30351 | }
|
30352 | _this.setState({
|
30353 | show: !_this.state.show
|
30354 | });
|
30355 | };
|
30356 |
|
30357 | _this.state = {
|
30358 | show: false
|
30359 | };
|
30360 | return _this;
|
30361 | }
|
30362 |
|
30363 | InputCity.prototype.componentDidMount = function componentDidMount() {
|
30364 | this.$el = this.refs.$ComponentInputText.$el;
|
30365 | this.$input = this.refs.$ComponentInputText.$input;
|
30366 | };
|
30367 |
|
30368 | InputCity.prototype.render = function render() {
|
30369 | var _props = this.props,
|
30370 | data = _props.data,
|
30371 | dataKeyPropertyName = _props.dataKeyPropertyName,
|
30372 | dataValuePropertyName = _props.dataValuePropertyName,
|
30373 | dataChildPropertyName = _props.dataChildPropertyName,
|
30374 | valueForKey = _props.valueForKey,
|
30375 | split = _props.split,
|
30376 | type = _props.type,
|
30377 | onClick = _props.onClick,
|
30378 | onChange = _props.onChange,
|
30379 | pickerStyle = _props.pickerStyle,
|
30380 | pickerClassName = _props.pickerClassName,
|
30381 | pickerMaskStyle = _props.pickerMaskStyle,
|
30382 | pickerMaskClassName = _props.pickerMaskClassName,
|
30383 | pickerShow = _props.pickerShow,
|
30384 | onClickSubmit = _props.onClickSubmit,
|
30385 | onClickCancel = _props.onClickCancel,
|
30386 | onClickMask = _props.onClickMask,
|
30387 | others = InputCity_objectWithoutProperties(_props, ['data', 'dataKeyPropertyName', 'dataValuePropertyName', 'dataChildPropertyName', 'valueForKey', 'split', 'type', 'onClick', 'onChange', 'pickerStyle', 'pickerClassName', 'pickerMaskStyle', 'pickerMaskClassName', 'pickerShow', 'onClickSubmit', 'onClickCancel', 'onClickMask']);
|
30388 |
|
30389 | return [external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(src_InputText, InputCity_extends({ key: 'input', ref: '$ComponentInputText' }, others, { type: 'text', readOnly: true, onClick: this.onClick })), external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(src_PickerCity, {
|
30390 | data: data,
|
30391 | dataChildPropertyName: dataChildPropertyName,
|
30392 | dataKeyPropertyName: dataKeyPropertyName,
|
30393 | dataValuePropertyName: dataValuePropertyName,
|
30394 | valueForKey: valueForKey,
|
30395 | split: split,
|
30396 | type: type,
|
30397 | value: this.$input ? this.$input.value : this.props.value, key: 'pickercity',
|
30398 | show: pickerShow === undefined ? this.state.show : pickerShow,
|
30399 | style: pickerStyle, className: pickerClassName,
|
30400 | maskStyle: pickerMaskStyle, maskClassName: pickerMaskClassName,
|
30401 | onClickSubmit: this.onClickSubmit, onClickCancel: this.onClickCancel, onClickMask: this.onClickMask
|
30402 | })];
|
30403 | };
|
30404 |
|
30405 | return InputCity;
|
30406 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), InputCity_class.propTypes = {
|
30407 | data: prop_types_default.a.array,
|
30408 | dataKeyPropertyName: prop_types_default.a.string,
|
30409 | dataValuePropertyName: prop_types_default.a.string,
|
30410 | dataChildPropertyName: prop_types_default.a.string,
|
30411 |
|
30412 | valueBindProp: prop_types_default.a.bool,
|
30413 | valueForKey: prop_types_default.a.string,
|
30414 | split: prop_types_default.a.string,
|
30415 | type: prop_types_default.a.string,
|
30416 | onClick: prop_types_default.a.func,
|
30417 | onChange: prop_types_default.a.func,
|
30418 |
|
30419 |
|
30420 | pickerStyle: prop_types_default.a.object,
|
30421 | pickerClassName: prop_types_default.a.string,
|
30422 | pickerMaskStyle: prop_types_default.a.object,
|
30423 | pickerMaskClassName: prop_types_default.a.string,
|
30424 |
|
30425 | pickerShow: prop_types_default.a.bool,
|
30426 | onClickSubmit: prop_types_default.a.func,
|
30427 | onClickCancel: prop_types_default.a.func,
|
30428 | onClickMask: prop_types_default.a.func
|
30429 | }, InputCity_class.defaultProps = {
|
30430 | split: '-',
|
30431 | type: 'district'
|
30432 | }, InputCity_class.defaultProps = {}, InputCity_temp);
|
30433 |
|
30434 |
|
30435 |
|
30436 |
|
30437 | var src_InputCity = (InputCity_InputCity);
|
30438 |
|
30439 | var InputColor_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; };
|
30440 |
|
30441 | function InputColor_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
30442 |
|
30443 | function InputColor_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
30444 |
|
30445 | function InputColor_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
30446 |
|
30447 |
|
30448 |
|
30449 |
|
30450 | var InputColor_InputColor = function (_Component) {
|
30451 | InputColor_inherits(InputColor, _Component);
|
30452 |
|
30453 | function InputColor(props) {
|
30454 | InputColor_classCallCheck(this, InputColor);
|
30455 |
|
30456 | return InputColor_possibleConstructorReturn(this, _Component.call(this, props));
|
30457 | }
|
30458 |
|
30459 | InputColor.prototype.componentDidMount = function componentDidMount() {
|
30460 | this.$el = this.refs.$ComponentInputText.$el;
|
30461 | this.$input = this.refs.$ComponentInputText.$input;
|
30462 | };
|
30463 |
|
30464 | InputColor.prototype.render = function render() {
|
30465 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(src_InputText, InputColor_extends({ ref: '$ComponentInputText' }, this.props, { type: 'color' }));
|
30466 | };
|
30467 |
|
30468 | return InputColor;
|
30469 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]);
|
30470 |
|
30471 |
|
30472 |
|
30473 |
|
30474 |
|
30475 | var src_InputColor = (InputColor_InputColor);
|
30476 |
|
30477 |
|
30478 |
|
30479 | if (!window._seeds_lang) window._seeds_lang = {};
|
30480 |
|
30481 | var instance_PickerDate = function PickerDate(params) {
|
30482 |
|
30483 | var onDateClickSubmit = params.onClickSubmit;
|
30484 | var onDateScrollEnd = params.onScrollEnd;
|
30485 | params.onClickSubmit = undefined;
|
30486 | params.onScrollEnd = undefined;
|
30487 | var nowDate = new Date();
|
30488 | |
30489 |
|
30490 |
|
30491 | var defaults = {
|
30492 | split: '-',
|
30493 |
|
30494 | viewType: 'date',
|
30495 | isSimpleYear: false,
|
30496 |
|
30497 | yearClass: 'text-center',
|
30498 | monthClass: 'text-center',
|
30499 | dayClass: 'text-center',
|
30500 | hourClass: 'text-center',
|
30501 | minuteClass: 'text-center',
|
30502 |
|
30503 | yearsData: null,
|
30504 | monthsData: null,
|
30505 | daysData: null,
|
30506 | hoursData: null,
|
30507 | minutesData: null,
|
30508 |
|
30509 | defaultYear: '',
|
30510 | defaultMonth: '',
|
30511 | defaultDay: '',
|
30512 | defaultHour: '',
|
30513 | defaultMinute: '',
|
30514 |
|
30515 | minYear: nowDate.getFullYear() - 10,
|
30516 | maxYear: nowDate.getFullYear() + 10,
|
30517 |
|
30518 | yyUnit: window._seeds_lang['unit_year'] || '年',
|
30519 | MMUnit: window._seeds_lang['unit_month'] || '月',
|
30520 | ddUnit: window._seeds_lang['unit_date'] || '日',
|
30521 | hhUnit: window._seeds_lang['unit_hour'] || '时',
|
30522 | mmUnit: window._seeds_lang['unit_minute'] || '分',
|
30523 |
|
30524 | onClickSubmit: function onClickSubmit(e) {
|
30525 | e.activeText = getActiveText(e.activeOptions);
|
30526 | var activeKeys = e.activeOptions.map(function (n, i, a) {
|
30527 | return n['key'];
|
30528 | });
|
30529 | s.setDefaultsByKeys(activeKeys);
|
30530 | if (onDateClickSubmit) onDateClickSubmit(e);
|
30531 | },
|
30532 | onScrollEnd: function onScrollEnd(e) {
|
30533 |
|
30534 | if ((e.params.viewType === 'date' || e.params.viewType === 'datetime') && (e.activeSlot.index === 0 || e.activeSlot.index === 1)) {
|
30535 | var year = e.activeOptions[0]['key'];
|
30536 | var month = e.activeOptions[1]['key'];
|
30537 | var defaultDay = e.activeOptions[2]['key'];
|
30538 | updateDays(year, month, defaultDay);
|
30539 | }
|
30540 |
|
30541 | if (onDateScrollEnd) onDateScrollEnd(e);
|
30542 | }
|
30543 | };
|
30544 | params = params || {};
|
30545 | for (var def in defaults) {
|
30546 | if (params[def] === undefined) {
|
30547 | params[def] = defaults[def];
|
30548 | }
|
30549 | }
|
30550 | var s = new Picker_instance(params);
|
30551 |
|
30552 | function trim(str) {
|
30553 | return str.replace(/(^\s*)|(\s*$)/g, '');
|
30554 | }
|
30555 |
|
30556 | s.setDefaultYear = function (yearKey) {
|
30557 | s.params.defaultYear = trim('' + yearKey);
|
30558 | };
|
30559 | s.setDefaultMonth = function (monthKey) {
|
30560 | s.params.defaultMonth = trim('' + monthKey);
|
30561 | };
|
30562 | s.setDefaultDay = function (dayKey) {
|
30563 | s.params.defaultDay = trim('' + dayKey);
|
30564 | };
|
30565 | s.setDefaultHour = function (hourKey) {
|
30566 | s.params.defaultHour = trim('' + hourKey);
|
30567 | };
|
30568 | s.setDefaultMinute = function (minuteKey) {
|
30569 | s.params.defaultMinute = trim('' + minuteKey);
|
30570 | };
|
30571 |
|
30572 |
|
30573 | s.updateDetault = function () {
|
30574 | nowDate = new Date();
|
30575 |
|
30576 | if (!s.params.defaultYear) {
|
30577 | var yyyy = nowDate.getFullYear();
|
30578 | var _yyyy = '' + yyyy;
|
30579 | s.setDefaultYear(_yyyy);
|
30580 | }
|
30581 | if (!s.params.defaultMonth) {
|
30582 | var MM = nowDate.getMonth() + 1;
|
30583 | var _MM = MM.toString().length === 1 ? '0' + MM : MM;
|
30584 | s.setDefaultMonth(_MM);
|
30585 | }
|
30586 | if (!s.params.defaultDay) {
|
30587 | var dd = nowDate.getDate();
|
30588 | var _dd = dd.toString().length === 1 ? '0' + dd : dd;
|
30589 | s.setDefaultDay(_dd);
|
30590 | }
|
30591 | if (!s.params.defaultHour) {
|
30592 | var hh = nowDate.getHours();
|
30593 | var _hh = hh.toString().length === 1 ? '0' + hh : hh;
|
30594 | s.setDefaultHour(_hh);
|
30595 | }
|
30596 | if (!s.params.defaultMinute) {
|
30597 | var mm = nowDate.getMinutes();
|
30598 | var _mm = mm.toString().length === 1 ? '0' + mm : mm;
|
30599 | s.setDefaultMinute(_mm);
|
30600 | }
|
30601 | };
|
30602 | s.updateDetault();
|
30603 |
|
30604 |
|
30605 | s.years = [];
|
30606 | if (s.params.yearsData) {
|
30607 | s.years = s.params.yearsData;
|
30608 | } else {
|
30609 | for (var yyyy = s.params.minYear; yyyy <= s.params.maxYear; yyyy++) {
|
30610 | s.years.push({
|
30611 | 'key': '' + yyyy,
|
30612 | 'value': s.params.isSimpleYear ? yyyy.toString().substring(2, 4) + s.params.yyUnit : yyyy + s.params.yyUnit
|
30613 | });
|
30614 | }
|
30615 | }
|
30616 |
|
30617 | s.months = [];
|
30618 | if (s.params.monthsData) {
|
30619 | s.months = s.params.monthsData;
|
30620 | } else {
|
30621 | for (var MM = 1; MM <= 12; MM++) {
|
30622 | var _MM = MM.toString().length === 1 ? '0' + MM : MM;
|
30623 | s.months.push({
|
30624 | 'key': '' + _MM,
|
30625 | 'value': _MM + s.params.MMUnit
|
30626 | });
|
30627 | }
|
30628 | }
|
30629 |
|
30630 | s.days = [];
|
30631 | var currentMaxday = new Date(nowDate.getFullYear(), nowDate.getMonth() + 1, 0).getDate();
|
30632 | if (s.params.daysData) {
|
30633 | s.days = Object.clone(s.params.daysData);
|
30634 | } else {
|
30635 | for (var dd = 1; dd <= currentMaxday; dd++) {
|
30636 | var _dd = dd.toString().length === 1 ? '0' + dd : dd;
|
30637 | s.days.push({
|
30638 | 'key': '' + _dd,
|
30639 | 'value': _dd + s.params.ddUnit
|
30640 | });
|
30641 | }
|
30642 | }
|
30643 |
|
30644 | function updateDaysForDefault(year, month) {
|
30645 | var lastDay = '' + new Date(year, month, 0).getDate();
|
30646 | var currentLastDay = s.days[s.days.length - 1]['key'];
|
30647 | if (lastDay === currentLastDay) return;
|
30648 | if (lastDay > currentLastDay) {
|
30649 | for (var i = 1 + parseInt(currentLastDay, 10); i <= lastDay; i++) {
|
30650 | s.days.push({
|
30651 | 'key': '' + i,
|
30652 | 'value': '' + i + s.params.ddUnit
|
30653 | });
|
30654 | }
|
30655 | } else if (lastDay < currentLastDay) {
|
30656 | var spliceCount = currentLastDay - lastDay;
|
30657 | s.days.splice(s.days.length - spliceCount, spliceCount);
|
30658 | }
|
30659 | }
|
30660 | function updateDaysForCustom(year, month) {
|
30661 | var lastDay = '' + new Date(year, month, 0).getDate();
|
30662 | var currentLastDay = s.days[s.days.length - 1]['key'];
|
30663 | var customData = s.params.daysData;
|
30664 | if (lastDay === currentLastDay) return;
|
30665 | if (lastDay > currentLastDay) {
|
30666 | customData.forEach(function (n) {
|
30667 | if (n['key'] <= lastDay && n['key'] > currentLastDay) s.days.push(n);
|
30668 | });
|
30669 | } else if (lastDay < currentLastDay) {
|
30670 | for (var j = currentLastDay; j > lastDay; j--) {
|
30671 | s.days.forEach(function (n) {
|
30672 |
|
30673 | if (n['key'] === '' + j) s.days.pop();
|
30674 | });
|
30675 | }
|
30676 | }
|
30677 | }
|
30678 | function updateDays(year, month, defaultDay) {
|
30679 | if (s.params.daysData) {
|
30680 | updateDaysForCustom(year, month);
|
30681 | } else {
|
30682 | updateDaysForDefault(year, month);
|
30683 | }
|
30684 | var defaultKey = defaultDay;
|
30685 | if (s.days.length < defaultDay) defaultKey = s.days[s.days.length - 1]['key'];
|
30686 | s.replaceSlot(2, s.days, defaultKey, s.params.dayClass);
|
30687 | }
|
30688 |
|
30689 |
|
30690 | s.hours = [];
|
30691 | if (s.params.hoursData) {
|
30692 | s.hours = s.params.hoursData;
|
30693 | } else {
|
30694 | for (var hh = 0; hh <= 23; hh++) {
|
30695 | var _hh = hh.toString().length === 1 ? '0' + hh : hh;
|
30696 | s.hours.push({
|
30697 | 'key': '' + _hh,
|
30698 | 'value': _hh + s.params.hhUnit
|
30699 | });
|
30700 | }
|
30701 | }
|
30702 |
|
30703 |
|
30704 | s.minutes = [];
|
30705 | if (s.params.minutesData) {
|
30706 | s.minutes = s.params.minutesData;
|
30707 | } else {
|
30708 | for (var mm = 0; mm <= 59; mm++) {
|
30709 | var _mm = mm.toString().length === 1 ? '0' + mm : mm;
|
30710 | s.minutes.push({
|
30711 | 'key': '' + _mm,
|
30712 | 'value': _mm + s.params.mmUnit
|
30713 | });
|
30714 | }
|
30715 | }
|
30716 |
|
30717 | |
30718 |
|
30719 |
|
30720 | function getActiveText(activeData) {
|
30721 | var activeKeys = activeData.map(function (n, i, a) {
|
30722 | return n['key'];
|
30723 | });
|
30724 | if (s.params.viewType === 'date') return activeKeys[0] + s.params.split + activeKeys[1] + s.params.split + activeKeys[2];else if (s.params.viewType === 'datetime') return activeKeys[0] + s.params.split + activeKeys[1] + s.params.split + activeKeys[2] + ' ' + activeKeys[3] + ':' + activeKeys[4];else if (s.params.viewType === 'time') return activeKeys[0] + ':' + activeKeys[1];else if (s.params.viewType === 'month') return activeKeys[0] + s.params.split + activeKeys[1];
|
30725 | }
|
30726 | s.setDefaultsByKeys = function (activeKeys) {
|
30727 | if (s.params.viewType === 'date' || s.params.viewType === 'datetime' || s.params.viewType === 'month') {
|
30728 | if (activeKeys[0]) s.setDefaultYear(activeKeys[0]);
|
30729 | if (activeKeys[1]) s.setDefaultMonth(activeKeys[1]);
|
30730 | if (activeKeys[2]) s.setDefaultDay(activeKeys[2]);
|
30731 | if (activeKeys[3]) s.setDefaultHour(activeKeys[3]);
|
30732 | if (activeKeys[4]) s.setDefaultMinute(activeKeys[4]);
|
30733 | } else if (s.params.viewType === 'time') {
|
30734 | if (activeKeys[0]) s.setDefaultHour(activeKeys[0]);
|
30735 | if (activeKeys[1]) s.setDefaultMinute(activeKeys[1]);
|
30736 | }
|
30737 | };
|
30738 | s.setDefaults = function (activeData) {
|
30739 | if (activeData.year) s.setDefaultYear(activeData.year);
|
30740 | if (activeData.month) s.setDefaultMonth(activeData.month);
|
30741 | if (activeData.day) s.setDefaultDay(activeData.day);
|
30742 | if (activeData.hour) s.setDefaultHour(activeData.hour);
|
30743 | if (activeData.minute) s.setDefaultMinute(activeData.minute);
|
30744 | };
|
30745 | |
30746 |
|
30747 |
|
30748 |
|
30749 |
|
30750 | function addMonthSlot() {
|
30751 | s.addSlot(s.years, s.params.defaultYear, s.params.yearClass);
|
30752 | s.addSlot(s.months, s.params.defaultMonth, s.params.monthClass);
|
30753 | }
|
30754 |
|
30755 | function addDateSlot() {
|
30756 | addMonthSlot();
|
30757 | s.addSlot(s.days, s.params.defaultDay, s.params.dayClass);
|
30758 | }
|
30759 |
|
30760 | function addTimeSlot() {
|
30761 | s.addSlot(s.hours, s.params.defaultHour, s.params.hourClass);
|
30762 | s.addSlot(s.minutes, s.params.defaultMinute, s.params.minuteClass);
|
30763 | }
|
30764 |
|
30765 | function addDateTime() {
|
30766 | addDateSlot();
|
30767 | addTimeSlot();
|
30768 | }
|
30769 |
|
30770 | function initSlots() {
|
30771 | switch (s.params.viewType) {
|
30772 | case 'date':
|
30773 | addDateSlot();
|
30774 | break;
|
30775 | case 'month':
|
30776 | addMonthSlot();
|
30777 | break;
|
30778 | case 'time':
|
30779 | addTimeSlot();
|
30780 | break;
|
30781 | case 'datetime':
|
30782 | addDateTime();
|
30783 | break;
|
30784 | default:
|
30785 | console.log('SeedsUI Error: initSlots失败');
|
30786 | }
|
30787 | }
|
30788 | s.update = function () {
|
30789 | s.clearSlots();
|
30790 | initSlots();
|
30791 | };
|
30792 | initSlots();
|
30793 | return s;
|
30794 | };
|
30795 |
|
30796 | var PickerDate_instance = (instance_PickerDate);
|
30797 |
|
30798 | var PickerDate_class, PickerDate_temp;
|
30799 |
|
30800 | function PickerDate_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
30801 |
|
30802 | function PickerDate_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
30803 |
|
30804 | function PickerDate_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
30805 |
|
30806 |
|
30807 |
|
30808 |
|
30809 |
|
30810 |
|
30811 | if (!window._seeds_lang) window._seeds_lang = {};
|
30812 |
|
30813 | var PickerDate_PickerDate = (PickerDate_temp = PickerDate_class = function (_Component) {
|
30814 | PickerDate_inherits(PickerDate, _Component);
|
30815 |
|
30816 | function PickerDate(props) {
|
30817 | PickerDate_classCallCheck(this, PickerDate);
|
30818 |
|
30819 | var _this = PickerDate_possibleConstructorReturn(this, _Component.call(this, props));
|
30820 |
|
30821 | _this.componentDidMount = function () {
|
30822 | _this.initInstance();
|
30823 | };
|
30824 |
|
30825 | _this.shouldComponentUpdate = function (nextProps) {
|
30826 | if (nextProps.show === _this.props.show) return false;
|
30827 | return true;
|
30828 | };
|
30829 |
|
30830 | _this.componentDidUpdate = function () {
|
30831 | if (_this.instance) {
|
30832 | if (_this.props.show) {
|
30833 | _this.setDefault();
|
30834 | _this.instance.show();
|
30835 | } else _this.instance.hide();
|
30836 | }
|
30837 | };
|
30838 |
|
30839 | _this.setDefault = function () {
|
30840 | var def = _this.getDefault();
|
30841 | _this.instance.setDefaults(def);
|
30842 | _this.instance.update();
|
30843 | };
|
30844 |
|
30845 | _this.getDefault = function () {
|
30846 | var _this$props = _this.props,
|
30847 | split = _this$props.split,
|
30848 | type = _this$props.type,
|
30849 | onError = _this$props.onError;
|
30850 |
|
30851 | var defaultValue = _this.props.valueForKey || _this.props.value;
|
30852 | var now = new Date();
|
30853 | var nowYear = now.getFullYear();
|
30854 | var nowMonth = now.getMonth() + 1;
|
30855 | var nowDate = now.getDate();
|
30856 | var nowHour = now.getHours();
|
30857 | var nowMinute = now.getMinutes();
|
30858 | var defaultYear = nowYear;
|
30859 | var defaultMonth = nowMonth < 10 ? '0' + nowMonth : nowMonth;
|
30860 | var defaultDay = nowDate < 10 ? '0' + nowDate : nowDate;
|
30861 | var defaultHour = nowHour < 10 ? '0' + nowHour : nowHour;
|
30862 | var defaultMinute = nowMinute < 10 ? '0' + nowMinute : nowMinute;
|
30863 |
|
30864 | if (type === 'date') {
|
30865 |
|
30866 | if (!defaultValue || !new RegExp('^[0-9]{4}' + (split || '-') + '[0-9]{2}' + (split || '-') + '[0-9]{2}$').test(defaultValue)) {
|
30867 | if (onError) onError('' + (window._seeds_lang['hint_invalid_date'] || '无效的日期格式'));
|
30868 | } else {
|
30869 | var dateValues = defaultValue.split(_this.props.split);
|
30870 | defaultYear = dateValues[0];
|
30871 | defaultMonth = dateValues[1];
|
30872 | defaultDay = dateValues[2] || '01';
|
30873 | }
|
30874 | } else if (type === 'month') {
|
30875 |
|
30876 | if (!defaultValue || !new RegExp('^[0-9]{4}' + (split || '-') + '[0-9]{2}$').test(defaultValue)) {
|
30877 | if (onError) onError((window._seeds_lang['hint_invalid_date'] || '无效的日期格式') + ', YYYY-MM-DD');
|
30878 | } else {
|
30879 | var monthValues = defaultValue.split(_this.props.split);
|
30880 | defaultYear = monthValues[0];
|
30881 | defaultMonth = monthValues[1];
|
30882 | }
|
30883 | } else if (type === 'datetime') {
|
30884 |
|
30885 | if (!defaultValue || !new RegExp('^[0-9]{4}' + (split || '-') + '[0-9]{2}' + (split || '-') + '[0-9]{2}\\s[0-9]{2}:[0-9]{2}(:[0-9]{2})?$').test(defaultValue)) {
|
30886 | if (onError) onError((window._seeds_lang['hint_invalid_date'] || '无效的日期格式') + ', YYYY-MM-DD hh:mm');
|
30887 | } else {
|
30888 | var values = defaultValue.split(' ');
|
30889 | var _dateValues = values[0].split(_this.props.split);
|
30890 | var timeValues = values[1].split(':');
|
30891 | defaultYear = _dateValues[0];
|
30892 | defaultMonth = _dateValues[1];
|
30893 | defaultDay = _dateValues[2];
|
30894 | defaultHour = timeValues[0];
|
30895 | defaultMinute = timeValues[1];
|
30896 | }
|
30897 | } else if (type === 'time') {
|
30898 |
|
30899 | if (!defaultValue || !new RegExp('^[0-9]{2}:[0-9]{2}(:[0-9]{2})?$').test(defaultValue)) {
|
30900 | if (onError) onError((window._seeds_lang['hint_invalid_date'] || '无效的日期格式') + ', hh:mm');
|
30901 | } else {
|
30902 | var _timeValues = defaultValue.split(':');
|
30903 | defaultHour = _timeValues[0];
|
30904 | defaultMinute = _timeValues[1];
|
30905 | }
|
30906 | }
|
30907 | return {
|
30908 | year: defaultYear,
|
30909 | month: defaultMonth,
|
30910 | day: defaultDay,
|
30911 | hour: defaultHour,
|
30912 | minute: defaultMinute
|
30913 | };
|
30914 | };
|
30915 |
|
30916 | _this.getData = function () {
|
30917 |
|
30918 | var yearsData = null;
|
30919 | var monthsData = null;
|
30920 | var daysData = null;
|
30921 | var hoursData = null;
|
30922 | var minutesData = null;
|
30923 | if (_this.props.data) {
|
30924 | if (_this.props.data.year) {
|
30925 | yearsData = _this.props.data.year.map(function (n) {
|
30926 | return {
|
30927 | 'key': '' + n,
|
30928 | 'value': '' + n + (window._seeds_lang['unit_year'] || '年')
|
30929 | };
|
30930 | });
|
30931 | }
|
30932 | if (_this.props.data.month) {
|
30933 | monthsData = _this.props.data.month.map(function (n) {
|
30934 | return {
|
30935 | 'key': '' + n,
|
30936 | 'value': '' + n + (window._seeds_lang['unit_month'] || '月')
|
30937 | };
|
30938 | });
|
30939 | }
|
30940 | if (_this.props.data.day) {
|
30941 | daysData = _this.props.data.day.map(function (n) {
|
30942 | return {
|
30943 | 'key': '' + n,
|
30944 | 'value': '' + n + (window._seeds_lang['unit_date'] || '日')
|
30945 | };
|
30946 | });
|
30947 | }
|
30948 | if (_this.props.data.hour) {
|
30949 | hoursData = _this.props.data.hour.map(function (n) {
|
30950 | return {
|
30951 | 'key': '' + n,
|
30952 | 'value': '' + n + (window._seeds_lang['unit_hour'] || '时')
|
30953 | };
|
30954 | });
|
30955 | }
|
30956 | if (_this.props.data.minute) {
|
30957 | minutesData = _this.props.data.minute.map(function (n) {
|
30958 | return {
|
30959 | 'key': '' + n,
|
30960 | 'value': '' + n + (window._seeds_lang['unit_minute'] || '分')
|
30961 | };
|
30962 | });
|
30963 | }
|
30964 | }
|
30965 | return {
|
30966 | yearsData: yearsData,
|
30967 | monthsData: monthsData,
|
30968 | daysData: daysData,
|
30969 | hoursData: hoursData,
|
30970 | minutesData: minutesData
|
30971 | };
|
30972 | };
|
30973 |
|
30974 | _this.initInstance = function () {
|
30975 | var data = _this.getData();
|
30976 | var def = _this.getDefault();
|
30977 |
|
30978 | var instance = new PickerDate_instance({
|
30979 | mask: _this.$el,
|
30980 | split: _this.props.split,
|
30981 | viewType: _this.props.type,
|
30982 | yearsData: data.yearsData,
|
30983 | monthsData: data.monthsData,
|
30984 | daysData: data.daysData,
|
30985 | hoursData: data.hoursData,
|
30986 | minutesData: data.minutesData,
|
30987 | defaultYear: def.year,
|
30988 | defaultMonth: def.month,
|
30989 | defaultDay: def.day,
|
30990 | defaultHour: def.hour,
|
30991 | defaultMinute: def.minute,
|
30992 | onClickMask: function onClickMask(e) {
|
30993 | if (_this.props.onClickMask) _this.props.onClickMask(e);
|
30994 | },
|
30995 | onClickCancel: function onClickCancel(e) {
|
30996 |
|
30997 | if (_this.props.onClickCancel) _this.props.onClickCancel(e);
|
30998 | },
|
30999 | onClickSubmit: function onClickSubmit(e) {
|
31000 |
|
31001 | if (_this.props.onClickSubmit) _this.props.onClickSubmit(e);
|
31002 | },
|
31003 | onHid: function onHid(e) {}
|
31004 | });
|
31005 | if (_this.props.show && instance) {
|
31006 | setTimeout(function () {
|
31007 | instance.show();
|
31008 | }, 10);
|
31009 | }
|
31010 | _this.instance = instance;
|
31011 | };
|
31012 |
|
31013 | return _this;
|
31014 | }
|
31015 |
|
31016 | PickerDate.prototype.render = function render() {
|
31017 | var _this2 = this;
|
31018 |
|
31019 | var _props = this.props,
|
31020 | maskClassName = _props.maskClassName,
|
31021 | maskStyle = _props.maskStyle,
|
31022 | className = _props.className,
|
31023 | style = _props.style;
|
31024 |
|
31025 | return Object(react_dom["createPortal"])(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
31026 | 'div',
|
31027 | { className: 'mask picker-mask' + (maskClassName ? ' ' + maskClassName : ''), style: maskStyle, ref: function ref(el) {
|
31028 | _this2.$el = el;
|
31029 | } },
|
31030 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
31031 | 'div',
|
31032 | { className: 'picker' + (className ? ' ' + className : ''), style: style },
|
31033 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
31034 | 'div',
|
31035 | { className: 'picker-header' },
|
31036 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
31037 | 'a',
|
31038 | { className: 'picker-cancel' },
|
31039 | window._seeds_lang['cancel'] || '取消'
|
31040 | ),
|
31041 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
31042 | 'a',
|
31043 | { className: 'picker-submit' },
|
31044 | window._seeds_lang['finish'] || '完成'
|
31045 | )
|
31046 | ),
|
31047 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
31048 | 'div',
|
31049 | { className: 'picker-wrapper' },
|
31050 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
31051 | 'div',
|
31052 | { className: 'picker-layer' },
|
31053 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'picker-layer-frame' })
|
31054 | ),
|
31055 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'picker-slotbox' })
|
31056 | )
|
31057 | )
|
31058 | ), this.props.portal || document.getElementById('root'));
|
31059 | };
|
31060 |
|
31061 | return PickerDate;
|
31062 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), PickerDate_class.propTypes = {
|
31063 | portal: prop_types_default.a.object,
|
31064 | split: prop_types_default.a.string,
|
31065 | type: prop_types_default.a.string,
|
31066 |
|
31067 | maskClassName: prop_types_default.a.string,
|
31068 | maskStyle: prop_types_default.a.object,
|
31069 | className: prop_types_default.a.string,
|
31070 | style: prop_types_default.a.object,
|
31071 |
|
31072 | data: prop_types_default.a.object,
|
31073 | value: prop_types_default.a.string,
|
31074 | valueForKey: prop_types_default.a.string,
|
31075 |
|
31076 | show: prop_types_default.a.bool,
|
31077 | onClickMask: prop_types_default.a.func,
|
31078 | onClickCancel: prop_types_default.a.func,
|
31079 | onClickSubmit: prop_types_default.a.func,
|
31080 | onError: prop_types_default.a.func
|
31081 | }, PickerDate_class.defaultProps = {
|
31082 | split: '-',
|
31083 | type: 'date'
|
31084 | }, PickerDate_temp);
|
31085 |
|
31086 |
|
31087 |
|
31088 |
|
31089 | var src_PickerDate = (PickerDate_PickerDate);
|
31090 |
|
31091 | var InputDate_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; };
|
31092 |
|
31093 | var InputDate_class, InputDate_temp;
|
31094 |
|
31095 | function InputDate_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
31096 |
|
31097 | function InputDate_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
31098 |
|
31099 | function InputDate_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
31100 |
|
31101 | function InputDate_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
31102 |
|
31103 |
|
31104 |
|
31105 |
|
31106 |
|
31107 |
|
31108 |
|
31109 | if (!window._seeds_lang) window._seeds_lang = {};
|
31110 |
|
31111 | var InputDate_InputDate = (InputDate_temp = InputDate_class = function (_Component) {
|
31112 | InputDate_inherits(InputDate, _Component);
|
31113 |
|
31114 | function InputDate(props) {
|
31115 | InputDate_classCallCheck(this, InputDate);
|
31116 |
|
31117 | var _this = InputDate_possibleConstructorReturn(this, _Component.call(this, props));
|
31118 |
|
31119 | _this.onClick = function (value, args) {
|
31120 | if (_this.props.onClick) _this.props.onClick(value, args);
|
31121 | _this.setState({
|
31122 | show: !_this.state.show
|
31123 | });
|
31124 | };
|
31125 |
|
31126 | _this.onClickSubmit = function (e) {
|
31127 | if (!_this.$input) _this.$input = _this.refs.$ComponentInputText.$input;
|
31128 | if (_this.props.onClickSubmit) {
|
31129 | _this.props.onClickSubmit(e);
|
31130 | return;
|
31131 | }
|
31132 | var value = _this.correctDate(e.activeText);
|
31133 | if (!value) return;
|
31134 | var options = e.activeOptions;
|
31135 |
|
31136 | if (!_this.props.valueBindProp) _this.$input.value = value;
|
31137 | _this.setState({
|
31138 | show: !_this.state.show
|
31139 | });
|
31140 | if (_this.props.onChange) {
|
31141 | _this.props.onChange(value, options, _this.props.args);
|
31142 | }
|
31143 | };
|
31144 |
|
31145 | _this.onClickCancel = function (e) {
|
31146 | if (_this.props.onClickCancel) {
|
31147 | _this.props.onClickCancel(e);
|
31148 | return;
|
31149 | }
|
31150 | _this.setState({
|
31151 | show: !_this.state.show
|
31152 | });
|
31153 | };
|
31154 |
|
31155 | _this.onClickMask = function (e) {
|
31156 | if (_this.props.onClickMask) {
|
31157 | _this.props.onClickMask(e);
|
31158 | return;
|
31159 | }
|
31160 | _this.setState({
|
31161 | show: !_this.state.show
|
31162 | });
|
31163 | };
|
31164 |
|
31165 | _this.correctDate = function (value) {
|
31166 | var text = value;
|
31167 | var _this$props = _this.props,
|
31168 | type = _this$props.type,
|
31169 | min = _this$props.min,
|
31170 | max = _this$props.max,
|
31171 | onError = _this$props.onError;
|
31172 |
|
31173 | var selectDate = text.toDate();
|
31174 | var current = _this.$input.value;
|
31175 | var error = _this.props.error;
|
31176 | if (min && (/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/.test(min) || /^[0-9]{2}:[0-9]{2}$/.test(min))) {
|
31177 | if (type === 'date' && selectDate.compareDate(min.toDate()) === -1) {
|
31178 | if (onError) {
|
31179 | onError(InputDate_extends({ msg: (window._seeds_lang['hint_cannot_be_less_than'] || '不能小于') + min, select: text, min: min, current: current }, error));
|
31180 | return false;
|
31181 | }
|
31182 | text = min;
|
31183 | } else if (type === 'month' && selectDate.compareMonth(min.toDate()) === -1) {
|
31184 | if (onError) {
|
31185 | onError(InputDate_extends({ msg: (window._seeds_lang['hint_cannot_be_less_than'] || '不能小于') + min, select: text, min: min, current: current }, error));
|
31186 | return false;
|
31187 | }
|
31188 | text = min;
|
31189 | } else if (type === 'time' && selectDate.compareTime(min.toDate()) === -1) {
|
31190 | if (onError) {
|
31191 | onError(InputDate_extends({ msg: (window._seeds_lang['hint_cannot_be_less_than'] || '不能小于') + min, select: text, min: min, current: current }, error));
|
31192 | return false;
|
31193 | }
|
31194 | text = min;
|
31195 | } else if (type === 'datetime' && selectDate.compareDateTime(min.toDate()) === -1) {
|
31196 | if (onError) {
|
31197 | onError(InputDate_extends({ msg: (window._seeds_lang['hint_cannot_be_less_than'] || '不能小于') + min, select: text, min: min, current: current }, error));
|
31198 | return false;
|
31199 | }
|
31200 | text = min;
|
31201 | }
|
31202 | }
|
31203 | if (max && (/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/.test(max) || /^[0-9]{2}:[0-9]{2}$/.test(max))) {
|
31204 | if (type === 'date' && selectDate.compareDate(max.toDate()) === 1) {
|
31205 | if (onError) {
|
31206 | onError(InputDate_extends({ msg: (window._seeds_lang['hint_cannot_be_greater_than'] || '不能大于') + max, select: text, max: max, current: current }, error));
|
31207 | return false;
|
31208 | }
|
31209 | text = max;
|
31210 | } else if (type === 'month' && selectDate.compareMonth(max.toDate()) === 1) {
|
31211 | if (onError) {
|
31212 | onError(InputDate_extends({ msg: (window._seeds_lang['hint_cannot_be_greater_than'] || '不能大于') + max, select: text, max: max, current: current }, error));
|
31213 | return false;
|
31214 | }
|
31215 | text = max;
|
31216 | } else if (type === 'time' && selectDate.compareTime(max.toDate()) === 1) {
|
31217 | if (onError) {
|
31218 | onError(InputDate_extends({ msg: (window._seeds_lang['hint_cannot_be_greater_than'] || '不能大于') + max, select: text, max: max, current: current }, error));
|
31219 | return false;
|
31220 | }
|
31221 | text = max;
|
31222 | } else if (type === 'datetime' && selectDate.compareDateTime(max.toDate()) === 1) {
|
31223 | if (onError) {
|
31224 | onError(InputDate_extends({ msg: (window._seeds_lang['hint_cannot_be_greater_than'] || '不能大于') + max, select: text, max: max, current: current }, error));
|
31225 | return false;
|
31226 | }
|
31227 | text = max;
|
31228 | }
|
31229 | }
|
31230 | return text;
|
31231 | };
|
31232 |
|
31233 | _this.state = {
|
31234 | show: false
|
31235 | };
|
31236 | return _this;
|
31237 | }
|
31238 |
|
31239 | InputDate.prototype.componentDidMount = function componentDidMount() {
|
31240 | this.$input = this.refs.$ComponentInputText.$input;
|
31241 | };
|
31242 |
|
31243 |
|
31244 |
|
31245 | InputDate.prototype.render = function render() {
|
31246 | var _props = this.props,
|
31247 | valueForKey = _props.valueForKey,
|
31248 | split = _props.split,
|
31249 | min = _props.min,
|
31250 | max = _props.max,
|
31251 | type = _props.type,
|
31252 | onClick = _props.onClick,
|
31253 | onChange = _props.onChange,
|
31254 | onError = _props.onError,
|
31255 | pickerStyle = _props.pickerStyle,
|
31256 | pickerClassName = _props.pickerClassName,
|
31257 | pickerMaskStyle = _props.pickerMaskStyle,
|
31258 | pickerMaskClassName = _props.pickerMaskClassName,
|
31259 | pickerShow = _props.pickerShow,
|
31260 | onClickSubmit = _props.onClickSubmit,
|
31261 | onClickCancel = _props.onClickCancel,
|
31262 | onClickMask = _props.onClickMask,
|
31263 | others = InputDate_objectWithoutProperties(_props, ['valueForKey', 'split', 'min', 'max', 'type', 'onClick', 'onChange', 'onError', 'pickerStyle', 'pickerClassName', 'pickerMaskStyle', 'pickerMaskClassName', 'pickerShow', 'onClickSubmit', 'onClickCancel', 'onClickMask']);
|
31264 |
|
31265 | return [external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(src_InputText, InputDate_extends({ key: 'input', ref: '$ComponentInputText' }, others, { type: 'text', readOnly: true, onClick: this.onClick })), external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(src_PickerDate, {
|
31266 | valueForKey: valueForKey,
|
31267 | split: split,
|
31268 | type: type,
|
31269 | value: this.$input ? this.$input.value : this.props.value, key: 'pickerdate',
|
31270 | show: pickerShow === undefined ? this.state.show : pickerShow,
|
31271 | style: pickerStyle, className: pickerClassName,
|
31272 | maskStyle: pickerMaskStyle, maskClassName: pickerMaskClassName,
|
31273 | onClickSubmit: this.onClickSubmit, onClickCancel: this.onClickCancel, onClickMask: this.onClickMask
|
31274 | })];
|
31275 | };
|
31276 |
|
31277 | return InputDate;
|
31278 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), InputDate_class.propTypes = {
|
31279 | valueBindProp: prop_types_default.a.bool,
|
31280 | valueForKey: prop_types_default.a.string,
|
31281 | split: prop_types_default.a.string,
|
31282 | type: prop_types_default.a.string,
|
31283 | min: prop_types_default.a.string,
|
31284 | max: prop_types_default.a.string,
|
31285 |
|
31286 | onClick: prop_types_default.a.func,
|
31287 | onChange: prop_types_default.a.func,
|
31288 | onError: prop_types_default.a.func,
|
31289 |
|
31290 |
|
31291 | pickerStyle: prop_types_default.a.object,
|
31292 | pickerClassName: prop_types_default.a.string,
|
31293 | pickerMaskStyle: prop_types_default.a.object,
|
31294 | pickerMaskClassName: prop_types_default.a.string,
|
31295 |
|
31296 | pickerShow: prop_types_default.a.bool,
|
31297 | onClickSubmit: prop_types_default.a.func,
|
31298 | onClickCancel: prop_types_default.a.func,
|
31299 | onClickMask: prop_types_default.a.func
|
31300 | }, InputDate_class.defaultProps = {
|
31301 | split: '-',
|
31302 | type: 'date'
|
31303 | }, InputDate_temp);
|
31304 |
|
31305 |
|
31306 |
|
31307 |
|
31308 | var src_InputDate = (InputDate_InputDate);
|
31309 |
|
31310 | var InputLocation_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; };
|
31311 |
|
31312 | var InputLocation_class, InputLocation_temp;
|
31313 |
|
31314 | function InputLocation_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
31315 |
|
31316 | function InputLocation_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
31317 |
|
31318 | function InputLocation_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
31319 |
|
31320 | function InputLocation_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
31321 |
|
31322 |
|
31323 |
|
31324 |
|
31325 |
|
31326 |
|
31327 | if (!window._seeds_lang) window._seeds_lang = {};
|
31328 |
|
31329 | var InputLocation_InputLocation = (InputLocation_temp = InputLocation_class = function (_Component) {
|
31330 | InputLocation_inherits(InputLocation, _Component);
|
31331 |
|
31332 | function InputLocation(props) {
|
31333 | InputLocation_classCallCheck(this, InputLocation);
|
31334 |
|
31335 | var _this = InputLocation_possibleConstructorReturn(this, _Component.call(this, props));
|
31336 |
|
31337 | _this.onClick = function (value, args) {
|
31338 | var _this$props = _this.props,
|
31339 | valueBindProp = _this$props.valueBindProp,
|
31340 | locationingText = _this$props.locationingText,
|
31341 | onChange = _this$props.onChange,
|
31342 | onClick = _this$props.onClick;
|
31343 |
|
31344 | if (onClick) onClick(value, args);
|
31345 | if (_this.$input.value === locationingText) return;
|
31346 |
|
31347 | if (!valueBindProp) {
|
31348 | _this.$input.value = locationingText;
|
31349 | }
|
31350 | src_Bridge.getLocation({
|
31351 | type: 'gcj02',
|
31352 | success: function success(data) {
|
31353 |
|
31354 | if (data.address) {
|
31355 |
|
31356 | if (!valueBindProp) _this.$input.value = data.address;
|
31357 | if (onChange) onChange(data.address, data, args);
|
31358 | return;
|
31359 | }
|
31360 | src_Bridge.getAddress({
|
31361 | latitude: data.latitude,
|
31362 | longitude: data.longitude,
|
31363 | success: function success(addrs) {
|
31364 |
|
31365 | if (!valueBindProp) _this.$input.value = addrs.address;
|
31366 | if (onChange) onChange(addrs.address, data, args);
|
31367 | },
|
31368 | fail: function fail(res) {
|
31369 |
|
31370 | if (!valueBindProp) _this.$input.value = '';
|
31371 | if (onChange) onChange('', data, args);
|
31372 |
|
31373 | src_Bridge.showToast(res.errMsg, { mask: false });
|
31374 | }
|
31375 | });
|
31376 | },
|
31377 | fail: function fail(res) {
|
31378 |
|
31379 | if (!valueBindProp) _this.$input.value = '';
|
31380 | if (onChange) onChange('', null, args);
|
31381 |
|
31382 | src_Bridge.showToast(res.errMsg, { mask: false });
|
31383 | }
|
31384 | });
|
31385 | };
|
31386 |
|
31387 | return _this;
|
31388 | }
|
31389 |
|
31390 | InputLocation.prototype.componentDidMount = function componentDidMount() {
|
31391 | this.$el = this.refs.$ComponentInputText.$el;
|
31392 | this.$input = this.refs.$ComponentInputText.$input;
|
31393 | };
|
31394 |
|
31395 | InputLocation.prototype.render = function render() {
|
31396 | var _props = this.props,
|
31397 | locationingText = _props.locationingText,
|
31398 | onChange = _props.onChange,
|
31399 | onClick = _props.onClick,
|
31400 | others = InputLocation_objectWithoutProperties(_props, ['locationingText', 'onChange', 'onClick']);
|
31401 |
|
31402 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(src_InputText, InputLocation_extends({ ref: '$ComponentInputText' }, others, { readOnly: true, onClick: this.onClick }));
|
31403 | };
|
31404 |
|
31405 | return InputLocation;
|
31406 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), InputLocation_class.propTypes = {
|
31407 | valueBindProp: prop_types_default.a.bool,
|
31408 | locationingText: prop_types_default.a.string,
|
31409 | onClick: prop_types_default.a.func,
|
31410 | onChange: prop_types_default.a.func
|
31411 | }, InputLocation_class.defaultProps = {
|
31412 | locationingText: window._seeds_lang['location'] || '定位中...'
|
31413 | }, InputLocation_temp);
|
31414 |
|
31415 |
|
31416 |
|
31417 |
|
31418 | var src_InputLocation = (InputLocation_InputLocation);
|
31419 |
|
31420 | var InputNumber_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; };
|
31421 |
|
31422 | function InputNumber_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
31423 |
|
31424 | function InputNumber_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
31425 |
|
31426 | function InputNumber_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
31427 |
|
31428 |
|
31429 |
|
31430 |
|
31431 | var InputNumber_InputNumber = function (_Component) {
|
31432 | InputNumber_inherits(InputNumber, _Component);
|
31433 |
|
31434 | function InputNumber(props) {
|
31435 | InputNumber_classCallCheck(this, InputNumber);
|
31436 |
|
31437 | return InputNumber_possibleConstructorReturn(this, _Component.call(this, props));
|
31438 | }
|
31439 |
|
31440 | InputNumber.prototype.componentDidMount = function componentDidMount() {
|
31441 | this.$el = this.refs.$ComponentInputText.$el;
|
31442 | this.$input = this.refs.$ComponentInputText.$input;
|
31443 | };
|
31444 |
|
31445 | InputNumber.prototype.render = function render() {
|
31446 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(src_InputText, InputNumber_extends({ ref: '$ComponentInputText' }, this.props, { type: 'number' }));
|
31447 | };
|
31448 |
|
31449 | return InputNumber;
|
31450 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]);
|
31451 |
|
31452 |
|
31453 |
|
31454 |
|
31455 |
|
31456 | var src_InputNumber = (InputNumber_InputNumber);
|
31457 |
|
31458 | var InputPassword_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; };
|
31459 |
|
31460 | function InputPassword_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
31461 |
|
31462 | function InputPassword_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
31463 |
|
31464 | function InputPassword_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
31465 |
|
31466 |
|
31467 |
|
31468 |
|
31469 | var InputPassword_InputPassword = function (_Component) {
|
31470 | InputPassword_inherits(InputPassword, _Component);
|
31471 |
|
31472 | function InputPassword(props) {
|
31473 | InputPassword_classCallCheck(this, InputPassword);
|
31474 |
|
31475 | return InputPassword_possibleConstructorReturn(this, _Component.call(this, props));
|
31476 | }
|
31477 |
|
31478 | InputPassword.prototype.componentDidMount = function componentDidMount() {
|
31479 | this.$el = this.refs.$ComponentInputText.$el;
|
31480 | this.$input = this.refs.$ComponentInputText.$input;
|
31481 | };
|
31482 |
|
31483 | InputPassword.prototype.render = function render() {
|
31484 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(src_InputText, InputPassword_extends({ ref: '$ComponentInputText' }, this.props, { type: 'password' }));
|
31485 | };
|
31486 |
|
31487 | return InputPassword;
|
31488 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]);
|
31489 |
|
31490 |
|
31491 |
|
31492 |
|
31493 |
|
31494 | var src_InputPassword = (InputPassword_InputPassword);
|
31495 |
|
31496 | var InputTel_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; };
|
31497 |
|
31498 | function InputTel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
31499 |
|
31500 | function InputTel_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
31501 |
|
31502 | function InputTel_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
31503 |
|
31504 |
|
31505 |
|
31506 |
|
31507 | var InputTel_InputTel = function (_Component) {
|
31508 | InputTel_inherits(InputTel, _Component);
|
31509 |
|
31510 | function InputTel(props) {
|
31511 | InputTel_classCallCheck(this, InputTel);
|
31512 |
|
31513 | return InputTel_possibleConstructorReturn(this, _Component.call(this, props));
|
31514 | }
|
31515 |
|
31516 | InputTel.prototype.componentDidMount = function componentDidMount() {
|
31517 | this.$el = this.refs.$ComponentInputText.$el;
|
31518 | this.$input = this.refs.$ComponentInputText.$input;
|
31519 | };
|
31520 |
|
31521 | InputTel.prototype.render = function render() {
|
31522 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(src_InputText, InputTel_extends({ ref: '$ComponentInputText' }, this.props, { type: 'tel' }));
|
31523 | };
|
31524 |
|
31525 | return InputTel;
|
31526 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]);
|
31527 |
|
31528 |
|
31529 |
|
31530 |
|
31531 |
|
31532 | var src_InputTel = (InputTel_InputTel);
|
31533 |
|
31534 | var Picker_class, Picker_temp;
|
31535 |
|
31536 | function Picker_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
31537 |
|
31538 | function Picker_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
31539 |
|
31540 | function Picker_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
31541 |
|
31542 |
|
31543 |
|
31544 |
|
31545 |
|
31546 |
|
31547 | if (!window._seeds_lang) window._seeds_lang = {};
|
31548 |
|
31549 | var Picker_Picker = (Picker_temp = Picker_class = function (_Component) {
|
31550 | Picker_inherits(Picker, _Component);
|
31551 |
|
31552 | function Picker(props) {
|
31553 | Picker_classCallCheck(this, Picker);
|
31554 |
|
31555 | var _this = Picker_possibleConstructorReturn(this, _Component.call(this, props));
|
31556 |
|
31557 | _this.componentDidMount = function () {
|
31558 | _this.initInstance();
|
31559 | };
|
31560 |
|
31561 | _this.shouldComponentUpdate = function (nextProps) {
|
31562 | if (nextProps.show === _this.props.show) return false;
|
31563 | return true;
|
31564 | };
|
31565 |
|
31566 | _this.componentDidUpdate = function () {
|
31567 | if (_this.instance) {
|
31568 | if (_this.props.show) {
|
31569 | _this.setDefault();
|
31570 | _this.instance.show();
|
31571 | } else _this.instance.hide();
|
31572 | } else {
|
31573 | if (_this.props.list.length > 0) {
|
31574 | _this.initInstance();
|
31575 | }
|
31576 | }
|
31577 | };
|
31578 |
|
31579 | _this.setDefault = function () {
|
31580 | var _this$props = _this.props,
|
31581 | valueForKey = _this$props.valueForKey,
|
31582 | list = _this$props.list;
|
31583 |
|
31584 | var key = valueForKey || '';
|
31585 | if (!key) {
|
31586 | var defaultOpt = _this.getDefaults();
|
31587 | if (defaultOpt && defaultOpt.key) key = defaultOpt.key;
|
31588 | }
|
31589 | _this.instance.clearSlots();
|
31590 | _this.instance.addSlot(list, key || '', _this.props.slotClassName);
|
31591 | };
|
31592 |
|
31593 | _this.getDefaults = function () {
|
31594 | var _this$props2 = _this.props,
|
31595 | list = _this$props2.list,
|
31596 | valueForKey = _this$props2.valueForKey,
|
31597 | value = _this$props2.value;
|
31598 |
|
31599 | if (!valueForKey && !value) {
|
31600 | if (list && list[0]) return list[0];
|
31601 | return [{ key: '', value: '' }];
|
31602 | }
|
31603 | var values = list.filter(function (item) {
|
31604 | if (valueForKey) {
|
31605 | if (valueForKey === item.key) return true;
|
31606 | } else if (value) {
|
31607 | if (item.value === value) return true;
|
31608 | }
|
31609 | return false;
|
31610 | });
|
31611 | return values[0];
|
31612 | };
|
31613 |
|
31614 | _this.initInstance = function () {
|
31615 | var list = _this.props.list;
|
31616 |
|
31617 | if (!list || list.length === 0 || _this.instance) return;
|
31618 |
|
31619 | var instance = new Picker_instance({
|
31620 | mask: _this.$el,
|
31621 | onClickMask: function onClickMask(e) {
|
31622 | if (_this.props.onClickMask) _this.props.onClickMask(e);
|
31623 | },
|
31624 | onClickCancel: function onClickCancel(e) {
|
31625 |
|
31626 | if (_this.props.onClickCancel) _this.props.onClickCancel(e);
|
31627 | },
|
31628 | onClickSubmit: function onClickSubmit(e) {
|
31629 |
|
31630 | if (_this.props.onClickSubmit) _this.props.onClickSubmit(e);
|
31631 | },
|
31632 | onHid: function onHid(e) {}
|
31633 | });
|
31634 |
|
31635 | var defaultOpt = _this.getDefaults();
|
31636 | var key = '';
|
31637 | if (defaultOpt && defaultOpt.key) key = defaultOpt.key;
|
31638 | instance.addSlot(list, key, _this.props.slotClassName);
|
31639 | if (_this.props.show && instance) {
|
31640 | instance.show();
|
31641 | }
|
31642 | _this.instance = instance;
|
31643 | };
|
31644 |
|
31645 | return _this;
|
31646 | }
|
31647 |
|
31648 | Picker.prototype.render = function render() {
|
31649 | var _this2 = this;
|
31650 |
|
31651 | var _props = this.props,
|
31652 | maskClassName = _props.maskClassName,
|
31653 | maskStyle = _props.maskStyle,
|
31654 | className = _props.className,
|
31655 | style = _props.style;
|
31656 |
|
31657 | return Object(react_dom["createPortal"])(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
31658 | 'div',
|
31659 | { className: 'mask picker-mask' + (maskClassName ? ' ' + maskClassName : ''), style: maskStyle, ref: function ref(el) {
|
31660 | _this2.$el = el;
|
31661 | } },
|
31662 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
31663 | 'div',
|
31664 | { className: 'picker' + (className ? ' ' + className : ''), style: style },
|
31665 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
31666 | 'div',
|
31667 | { className: 'picker-header' },
|
31668 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
31669 | 'a',
|
31670 | { className: 'picker-cancel' },
|
31671 | window._seeds_lang['cancel'] || '取消'
|
31672 | ),
|
31673 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
31674 | 'a',
|
31675 | { className: 'picker-submit' },
|
31676 | window._seeds_lang['finish'] || '完成'
|
31677 | )
|
31678 | ),
|
31679 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
31680 | 'div',
|
31681 | { className: 'picker-wrapper' },
|
31682 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
31683 | 'div',
|
31684 | { className: 'picker-layer' },
|
31685 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'picker-layer-frame' })
|
31686 | ),
|
31687 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'picker-slotbox' })
|
31688 | )
|
31689 | )
|
31690 | ), this.props.portal || document.getElementById('root'));
|
31691 | };
|
31692 |
|
31693 | return Picker;
|
31694 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Picker_class.propTypes = {
|
31695 | portal: prop_types_default.a.object,
|
31696 | list: prop_types_default.a.array,
|
31697 |
|
31698 | maskClassName: prop_types_default.a.string,
|
31699 | maskStyle: prop_types_default.a.object,
|
31700 | className: prop_types_default.a.string,
|
31701 | style: prop_types_default.a.object,
|
31702 |
|
31703 | slotClassName: prop_types_default.a.string,
|
31704 | value: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.number]),
|
31705 | valueForKey: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.number]),
|
31706 | show: prop_types_default.a.bool,
|
31707 | onClickMask: prop_types_default.a.func,
|
31708 | onClickCancel: prop_types_default.a.func,
|
31709 | onClickSubmit: prop_types_default.a.func
|
31710 | }, Picker_class.defaultProps = {
|
31711 | slotClassName: 'text-center'
|
31712 | }, Picker_temp);
|
31713 |
|
31714 |
|
31715 |
|
31716 |
|
31717 | var src_Picker = (Picker_Picker);
|
31718 |
|
31719 | var InputPicker_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; };
|
31720 |
|
31721 | var InputPicker_class, InputPicker_temp;
|
31722 |
|
31723 | function InputPicker_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
31724 |
|
31725 | function InputPicker_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
31726 |
|
31727 | function InputPicker_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
31728 |
|
31729 | function InputPicker_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
31730 |
|
31731 |
|
31732 |
|
31733 |
|
31734 |
|
31735 |
|
31736 | var InputPicker_InputPicker = (InputPicker_temp = InputPicker_class = function (_Component) {
|
31737 | InputPicker_inherits(InputPicker, _Component);
|
31738 |
|
31739 | function InputPicker(props) {
|
31740 | InputPicker_classCallCheck(this, InputPicker);
|
31741 |
|
31742 | var _this = InputPicker_possibleConstructorReturn(this, _Component.call(this, props));
|
31743 |
|
31744 | _this.onClick = function (value, args) {
|
31745 | if (_this.props.onClick) _this.props.onClick(value, args);
|
31746 | _this.setState({
|
31747 | show: !_this.state.show
|
31748 | });
|
31749 | };
|
31750 |
|
31751 | _this.onClickSubmit = function (e) {
|
31752 | if (!_this.$input) _this.$input = _this.refs.$ComponentInputText.$input;
|
31753 | if (_this.props.onClickSubmit) {
|
31754 | _this.props.onClickSubmit(e);
|
31755 | return;
|
31756 | }
|
31757 | var value = e.activeOptions[0].value;
|
31758 |
|
31759 | if (!_this.props.valueBindProp) _this.$input.value = value;
|
31760 | _this.setState({
|
31761 | show: !_this.state.show
|
31762 | });
|
31763 | if (_this.props.onChange) {
|
31764 | _this.props.onChange(value, e.activeOptions[0], _this.props.args);
|
31765 | }
|
31766 | };
|
31767 |
|
31768 | _this.onClickCancel = function (e) {
|
31769 | if (_this.props.onClickCancel) {
|
31770 | _this.props.onClickCancel(e);
|
31771 | return;
|
31772 | }
|
31773 | _this.setState({
|
31774 | show: !_this.state.show
|
31775 | });
|
31776 | };
|
31777 |
|
31778 | _this.onClickMask = function (e) {
|
31779 | if (_this.props.onClickMask) {
|
31780 | _this.props.onClickMask(e);
|
31781 | return;
|
31782 | }
|
31783 | _this.setState({
|
31784 | show: !_this.state.show
|
31785 | });
|
31786 | };
|
31787 |
|
31788 | _this.state = {
|
31789 | show: false
|
31790 | };
|
31791 | return _this;
|
31792 | }
|
31793 |
|
31794 | InputPicker.prototype.componentDidMount = function componentDidMount() {
|
31795 | this.$el = this.refs.$ComponentInputText.$el;
|
31796 | this.$input = this.refs.$ComponentInputText.$input;
|
31797 | };
|
31798 |
|
31799 | InputPicker.prototype.render = function render() {
|
31800 | var _props = this.props,
|
31801 | valueForKey = _props.valueForKey,
|
31802 | list = _props.list,
|
31803 | onClick = _props.onClick,
|
31804 | onChange = _props.onChange,
|
31805 | pickerStyle = _props.pickerStyle,
|
31806 | pickerClassName = _props.pickerClassName,
|
31807 | pickerMaskStyle = _props.pickerMaskStyle,
|
31808 | pickerMaskClassName = _props.pickerMaskClassName,
|
31809 | pickerShow = _props.pickerShow,
|
31810 | onClickSubmit = _props.onClickSubmit,
|
31811 | onClickCancel = _props.onClickCancel,
|
31812 | onClickMask = _props.onClickMask,
|
31813 | others = InputPicker_objectWithoutProperties(_props, ['valueForKey', 'list', 'onClick', 'onChange', 'pickerStyle', 'pickerClassName', 'pickerMaskStyle', 'pickerMaskClassName', 'pickerShow', 'onClickSubmit', 'onClickCancel', 'onClickMask']);
|
31814 |
|
31815 | return [external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(src_InputText, InputPicker_extends({ key: 'input', ref: '$ComponentInputText' }, others, { readOnly: true, onClick: this.onClick })), external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(src_Picker, {
|
31816 | list: list, valueForKey: valueForKey, value: this.$input ? this.$input.value : this.props.value, key: 'picker',
|
31817 | show: pickerShow === undefined ? this.state.show : pickerShow,
|
31818 | style: pickerStyle, className: pickerClassName,
|
31819 | maskStyle: pickerMaskStyle, maskClassName: pickerMaskClassName,
|
31820 | onClickSubmit: this.onClickSubmit, onClickCancel: this.onClickCancel, onClickMask: this.onClickMask
|
31821 | })];
|
31822 | };
|
31823 |
|
31824 | return InputPicker;
|
31825 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), InputPicker_class.propTypes = {
|
31826 | valueBindProp: prop_types_default.a.bool,
|
31827 | value: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.number]),
|
31828 | valueForKey: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.number]),
|
31829 | list: prop_types_default.a.array,
|
31830 | onClick: prop_types_default.a.func,
|
31831 | onChange: prop_types_default.a.func,
|
31832 |
|
31833 |
|
31834 | pickerStyle: prop_types_default.a.object,
|
31835 | pickerClassName: prop_types_default.a.string,
|
31836 | pickerMaskStyle: prop_types_default.a.object,
|
31837 | pickerMaskClassName: prop_types_default.a.string,
|
31838 |
|
31839 | pickerShow: prop_types_default.a.bool,
|
31840 | onClickSubmit: prop_types_default.a.func,
|
31841 | onClickCancel: prop_types_default.a.func,
|
31842 | onClickMask: prop_types_default.a.func
|
31843 | }, InputPicker_class.defaultProps = {}, InputPicker_temp);
|
31844 |
|
31845 |
|
31846 |
|
31847 |
|
31848 | var src_InputPicker = (InputPicker_InputPicker);
|
31849 |
|
31850 |
|
31851 | var instance_InputRange = function InputRange(container, params) {
|
31852 | |
31853 |
|
31854 |
|
31855 | var defaults = {
|
31856 | tooltipClass: 'range-tooltip',
|
31857 | inputClass: 'range-input'
|
31858 | |
31859 |
|
31860 |
|
31861 |
|
31862 | };
|
31863 | params = params || {};
|
31864 | for (var def in defaults) {
|
31865 | if (params[def] === undefined) {
|
31866 | params[def] = defaults[def];
|
31867 | }
|
31868 | }
|
31869 | var s = this;
|
31870 | s.params = params;
|
31871 |
|
31872 |
|
31873 | s.container = typeof container === 'string' ? document.querySelector(container) : container;
|
31874 | if (!s.container) {
|
31875 | console.log('SeedsUI Error:未找到InputRange的DOM对象,请检查传入参数是否正确');
|
31876 | return;
|
31877 | }
|
31878 |
|
31879 |
|
31880 | s.tooltip = s.container.querySelector('.' + s.params.tooltipClass);
|
31881 | if (!s.container) {
|
31882 | console.log('SeedsUI Error:未找到InputRange的tooltip,请检查传入参数是否正确');
|
31883 | return;
|
31884 | }
|
31885 |
|
31886 |
|
31887 | s.input = s.container.querySelector('.' + s.params.inputClass);
|
31888 | if (!s.input) {
|
31889 | console.log('SeedsUI Error:未找到InputRange的input,请检查传入参数是否正确');
|
31890 | return;
|
31891 | }
|
31892 |
|
31893 | |
31894 |
|
31895 |
|
31896 | s.events = function (detach) {
|
31897 | var touchTarget = s.container;
|
31898 | var action = detach ? 'removeEventListener' : 'addEventListener';
|
31899 | touchTarget[action]('touchstart', s.onTouchStart, false);
|
31900 | touchTarget[action]('mousedown', s.onTouchStart, false);
|
31901 | touchTarget[action]('touchmove', s.onTouchMove, false);
|
31902 | touchTarget[action]('touchend', s.onTouchEnd, false);
|
31903 | touchTarget[action]('mouseup', s.onTouchEnd, false);
|
31904 | touchTarget[action]('touchcancel', s.onTouchEnd, false);
|
31905 | touchTarget[action]('click', s.onClick, false);
|
31906 | s.input[action]('input', s.onInput, false);
|
31907 | };
|
31908 |
|
31909 | s.attach = function () {
|
31910 | s.events();
|
31911 | };
|
31912 | s.detach = function () {
|
31913 | s.events(true);
|
31914 | };
|
31915 |
|
31916 | |
31917 |
|
31918 |
|
31919 | s.onTouchStart = function (e) {
|
31920 | e.stopPropagation();
|
31921 | };
|
31922 | s.onTouchMove = function (e) {
|
31923 | e.stopPropagation();
|
31924 | };
|
31925 | s.onTouchEnd = function (e) {
|
31926 | e.stopPropagation();
|
31927 | s.hideToolTip();
|
31928 | s.target = s.input;
|
31929 | if (s.params.onChange && !s.input.disabled) s.params.onChange(s);
|
31930 | };
|
31931 | s.onClick = function () {
|
31932 | if (s.input.disabled) {
|
31933 | s.showToolTip(s.tooltip, s.input);
|
31934 | setTimeout(function () {
|
31935 | s.hideToolTip();
|
31936 | }, 300);
|
31937 | }
|
31938 | };
|
31939 | s.onInput = function () {
|
31940 | s.showToolTip(s.tooltip, s.input);
|
31941 | };
|
31942 | |
31943 |
|
31944 |
|
31945 | s.showToolTip = function (tooltip, input) {
|
31946 |
|
31947 | var percent = ((input.value - input.min) / (input.max - input.min)).toFixed(2);
|
31948 |
|
31949 |
|
31950 | var dragRange = input.clientWidth * percent;
|
31951 | var offsetLeft = input.offsetLeft + dragRange - 10;
|
31952 |
|
31953 |
|
31954 |
|
31955 | var currentBallLeft = 28 * percent;
|
31956 |
|
31957 |
|
31958 | var left = offsetLeft - currentBallLeft;
|
31959 | tooltip.innerHTML = input.value;
|
31960 | tooltip.style.visibility = 'visible';
|
31961 | tooltip.style.left = left + 'px';
|
31962 | };
|
31963 | s.hideToolTip = function () {
|
31964 | s.tooltip.style.visibility = 'hidden';
|
31965 | };
|
31966 | |
31967 |
|
31968 |
|
31969 | s.update = function () {
|
31970 | if (s.container) {
|
31971 | s.detach();
|
31972 | }
|
31973 | s.attach();
|
31974 | };
|
31975 | s.update();
|
31976 | };
|
31977 |
|
31978 | var InputRange_instance = (instance_InputRange);
|
31979 |
|
31980 | var InputRange_class, InputRange_temp;
|
31981 |
|
31982 | function InputRange_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
31983 |
|
31984 | function InputRange_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
31985 |
|
31986 | function InputRange_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
31987 |
|
31988 |
|
31989 |
|
31990 |
|
31991 |
|
31992 | var InputRange_InputRange = (InputRange_temp = InputRange_class = function (_Component) {
|
31993 | InputRange_inherits(InputRange, _Component);
|
31994 |
|
31995 | function InputRange(props) {
|
31996 | InputRange_classCallCheck(this, InputRange);
|
31997 |
|
31998 | var _this = InputRange_possibleConstructorReturn(this, _Component.call(this, props));
|
31999 |
|
32000 | _this.onChange = function (e) {
|
32001 | if (_this.props.onChange) {
|
32002 | _this.props.onChange(_this.$input.value, Object.getArgs(e, _this.props.args));
|
32003 | }
|
32004 | };
|
32005 |
|
32006 | return _this;
|
32007 | }
|
32008 |
|
32009 | InputRange.prototype.componentDidMount = function componentDidMount() {
|
32010 | var instance = new InputRange_instance(this.$el);
|
32011 | this.instance = instance;
|
32012 | };
|
32013 |
|
32014 | InputRange.prototype.render = function render() {
|
32015 | var _this2 = this;
|
32016 |
|
32017 | var _props = this.props,
|
32018 | disabled = _props.disabled,
|
32019 | style = _props.style,
|
32020 | className = _props.className,
|
32021 | value = _props.value,
|
32022 | min = _props.min,
|
32023 | max = _props.max,
|
32024 | step = _props.step;
|
32025 |
|
32026 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
32027 | 'div',
|
32028 | { ref: function ref(el) {
|
32029 | _this2.$el = el;
|
32030 | }, className: 'range' + (className ? ' ' + className : ''), style: style },
|
32031 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('input', { disabled: disabled, ref: function ref(el) {
|
32032 | _this2.$input = el;
|
32033 | }, type: 'range', className: 'range-input', min: min, max: max, step: step, defaultValue: value }),
|
32034 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
32035 | 'div',
|
32036 | { ref: function ref(el) {
|
32037 | _this2.$tooltip = el;
|
32038 | }, className: 'range-tooltip' },
|
32039 | value
|
32040 | )
|
32041 | );
|
32042 | };
|
32043 |
|
32044 | return InputRange;
|
32045 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), InputRange_class.propTypes = {
|
32046 | args: prop_types_default.a.any,
|
32047 | style: prop_types_default.a.object,
|
32048 | className: prop_types_default.a.string,
|
32049 | value: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.number]),
|
32050 | min: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.number]),
|
32051 | max: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.number]),
|
32052 | step: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.number]),
|
32053 | disabled: prop_types_default.a.bool,
|
32054 | onChange: prop_types_default.a.func
|
32055 | }, InputRange_class.defaultProps = {
|
32056 | value: '0',
|
32057 | min: '0',
|
32058 | max: '100',
|
32059 | step: '1'
|
32060 | }, InputRange_temp);
|
32061 |
|
32062 |
|
32063 |
|
32064 |
|
32065 | var src_InputRange = (InputRange_InputRange);
|
32066 |
|
32067 | var InputSafe_class, InputSafe_temp;
|
32068 |
|
32069 | function InputSafe_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
32070 |
|
32071 | function InputSafe_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
32072 |
|
32073 | function InputSafe_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
32074 |
|
32075 |
|
32076 |
|
32077 |
|
32078 |
|
32079 | if (!window._seeds_lang) window._seeds_lang = {};
|
32080 |
|
32081 | var InputSafe_InputSafe = (InputSafe_temp = InputSafe_class = function (_Component) {
|
32082 | InputSafe_inherits(InputSafe, _Component);
|
32083 |
|
32084 | function InputSafe(props) {
|
32085 | InputSafe_classCallCheck(this, InputSafe);
|
32086 |
|
32087 | return InputSafe_possibleConstructorReturn(this, _Component.call(this, props));
|
32088 | }
|
32089 |
|
32090 | InputSafe.prototype.componentDidMount = function componentDidMount() {};
|
32091 |
|
32092 | InputSafe.prototype.render = function render() {
|
32093 | var _props = this.props,
|
32094 | value = _props.value,
|
32095 | style = _props.style,
|
32096 | className = _props.className;
|
32097 |
|
32098 | var lvl = value.safeLvl();
|
32099 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
32100 | 'ul',
|
32101 | { className: 'input-safe lvl' + lvl + (className ? ' ' + className : ''), style: style },
|
32102 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
32103 | 'li',
|
32104 | null,
|
32105 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'input-safe-progress' }),
|
32106 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
32107 | 'span',
|
32108 | { className: 'input-safe-caption' },
|
32109 | window._seeds_lang['low'] || '弱'
|
32110 | )
|
32111 | ),
|
32112 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
32113 | 'li',
|
32114 | null,
|
32115 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'input-safe-progress' }),
|
32116 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
32117 | 'span',
|
32118 | { className: 'input-safe-caption' },
|
32119 | window._seeds_lang['medium'] || '中'
|
32120 | )
|
32121 | ),
|
32122 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
32123 | 'li',
|
32124 | null,
|
32125 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'input-safe-progress' }),
|
32126 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
32127 | 'span',
|
32128 | { className: 'input-safe-caption' },
|
32129 | window._seeds_lang['strong'] || '强'
|
32130 | )
|
32131 | )
|
32132 | );
|
32133 | };
|
32134 |
|
32135 | return InputSafe;
|
32136 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), InputSafe_class.propTypes = {
|
32137 | value: prop_types_default.a.string,
|
32138 |
|
32139 | style: prop_types_default.a.object,
|
32140 | className: prop_types_default.a.string
|
32141 | }, InputSafe_class.defaultProps = {
|
32142 | value: ''
|
32143 | }, InputSafe_temp);
|
32144 |
|
32145 |
|
32146 |
|
32147 |
|
32148 | var src_InputSafe = (InputSafe_InputSafe);
|
32149 |
|
32150 | var SelectPicker_class, SelectPicker_temp;
|
32151 |
|
32152 | function SelectPicker_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
32153 |
|
32154 | function SelectPicker_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
32155 |
|
32156 | function SelectPicker_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
32157 |
|
32158 |
|
32159 |
|
32160 |
|
32161 |
|
32162 | if (!window._seeds_lang) window._seeds_lang = {};
|
32163 |
|
32164 | var SelectPicker_SelectPicker = (SelectPicker_temp = SelectPicker_class = function (_Component) {
|
32165 | SelectPicker_inherits(SelectPicker, _Component);
|
32166 |
|
32167 | function SelectPicker(props) {
|
32168 | SelectPicker_classCallCheck(this, SelectPicker);
|
32169 |
|
32170 | var _this = SelectPicker_possibleConstructorReturn(this, _Component.call(this, props));
|
32171 |
|
32172 | _this.componentDidMount = function () {};
|
32173 |
|
32174 | _this.componentDidUpdate = function (prevProps) {
|
32175 | if (_this.$el && _this.props.show !== prevProps.show) {
|
32176 | var selectedKeys = Object.values(_this.getSelected() || []) || [];
|
32177 | [].slice.call(_this.$el.querySelectorAll('.selectpicker-option')).forEach(function (n, i) {
|
32178 | if (selectedKeys.indexOf(_this.props.list[i].key) !== -1) {
|
32179 | n.classList.add('active');
|
32180 | } else {
|
32181 | n.classList.remove('active');
|
32182 | }
|
32183 | });
|
32184 | }
|
32185 | };
|
32186 |
|
32187 | _this.getSelected = function () {
|
32188 | var selected = _this.props.valueForKey || _this.props.value;
|
32189 | var selectedName = _this.props.valueForKey ? 'key' : 'value';
|
32190 | if (selected) {
|
32191 | var options = selected.split(_this.props.split || ',').map(function (value) {
|
32192 | for (var i = 0, li; li = _this.props.list[i++];) {
|
32193 |
|
32194 | if (li[selectedName] === value) {
|
32195 | return li.key;
|
32196 | }
|
32197 | }
|
32198 | return '';
|
32199 | });
|
32200 | return options;
|
32201 | } else {
|
32202 | return [];
|
32203 | }
|
32204 | };
|
32205 |
|
32206 | _this.onClick = function (e) {
|
32207 | if (e.target.classList.contains('picker-mask')) {
|
32208 |
|
32209 | if (_this.props.onClickMask) _this.props.onClickMask(e);
|
32210 | } else if (e.target.classList.contains('selectpicker-option')) {
|
32211 |
|
32212 | if (_this.props.onClickOption) _this.props.onClickOption(e);
|
32213 | var index = e.target.getAttribute('data-index');
|
32214 | if (!_this.props.multiple && _this.props.onClickSubmit) {
|
32215 | _this.props.onClickSubmit([_this.props.list[index]], Number(index));
|
32216 | } else {
|
32217 | e.target.classList.toggle('active');
|
32218 | }
|
32219 | } else if (e.target.classList.contains('picker-submit')) {
|
32220 |
|
32221 | var selected = [];
|
32222 | [].slice.call(_this.$el.querySelectorAll('.selectpicker-option.active')).forEach(function (n) {
|
32223 | var index = n.getAttribute('data-index');
|
32224 | selected.push(_this.props.list[index]);
|
32225 | });
|
32226 | if (_this.props.onClickSubmit) _this.props.onClickSubmit(selected);
|
32227 | } else if (e.target.classList.contains('picker-cancel')) {
|
32228 |
|
32229 | if (_this.props.onClickCancel) _this.props.onClickCancel(e);
|
32230 | }
|
32231 | };
|
32232 |
|
32233 | return _this;
|
32234 | }
|
32235 |
|
32236 | SelectPicker.prototype.render = function render() {
|
32237 | var _this2 = this;
|
32238 |
|
32239 | var _props = this.props,
|
32240 | show = _props.show,
|
32241 | list = _props.list,
|
32242 | multiple = _props.multiple,
|
32243 | maskClassName = _props.maskClassName,
|
32244 | maskStyle = _props.maskStyle,
|
32245 | className = _props.className,
|
32246 | style = _props.style;
|
32247 |
|
32248 | return Object(react_dom["createPortal"])(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
32249 | 'div',
|
32250 | { className: 'mask picker-mask' + (maskClassName ? ' ' + maskClassName : '') + (show ? ' active' : ''), style: maskStyle, ref: function ref(el) {
|
32251 | _this2.$el = el;
|
32252 | }, onClick: this.onClick },
|
32253 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
32254 | 'div',
|
32255 | { className: 'selectpicker' + (className ? ' ' + className : '') + (show ? ' active' : ''), style: style },
|
32256 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
32257 | 'div',
|
32258 | { className: 'picker-header' },
|
32259 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
32260 | 'a',
|
32261 | { className: 'picker-cancel' },
|
32262 | window._seeds_lang['cancel'] || '取消'
|
32263 | ),
|
32264 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
32265 | 'a',
|
32266 | { className: 'picker-submit' + (multiple ? '' : ' disabled') },
|
32267 | window._seeds_lang['finish'] || '完成'
|
32268 | )
|
32269 | ),
|
32270 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
32271 | 'div',
|
32272 | { className: 'selectpicker-wrapper' },
|
32273 | list && list.length && list.map(function (item, index) {
|
32274 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
32275 | 'div',
|
32276 | { key: index, className: 'selectpicker-option', 'data-index': index },
|
32277 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
32278 | 'p',
|
32279 | { className: 'selectpicker-option-caption' },
|
32280 | item.value
|
32281 | ),
|
32282 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('i', { className: 'selectpicker-option-icon' })
|
32283 | );
|
32284 | })
|
32285 | )
|
32286 | )
|
32287 | ), this.props.portal || document.getElementById('root'));
|
32288 | };
|
32289 |
|
32290 | return SelectPicker;
|
32291 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), SelectPicker_class.propTypes = {
|
32292 | portal: prop_types_default.a.object,
|
32293 | multiple: prop_types_default.a.bool,
|
32294 | list: prop_types_default.a.array,
|
32295 | split: prop_types_default.a.string,
|
32296 | value: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.number]),
|
32297 | valueForKey: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.number]),
|
32298 |
|
32299 | maskClassName: prop_types_default.a.string,
|
32300 | maskStyle: prop_types_default.a.object,
|
32301 | className: prop_types_default.a.string,
|
32302 | style: prop_types_default.a.object,
|
32303 |
|
32304 | slotClassName: prop_types_default.a.string,
|
32305 | show: prop_types_default.a.bool,
|
32306 | onClickMask: prop_types_default.a.func,
|
32307 | onClickCancel: prop_types_default.a.func,
|
32308 | onClickSubmit: prop_types_default.a.func
|
32309 | }, SelectPicker_class.defaultProps = {
|
32310 | split: ',',
|
32311 | slotClassName: 'text-center'
|
32312 | }, SelectPicker_temp);
|
32313 |
|
32314 |
|
32315 |
|
32316 |
|
32317 | var src_SelectPicker = (SelectPicker_SelectPicker);
|
32318 |
|
32319 | var InputSelect_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; };
|
32320 |
|
32321 | var InputSelect_class, InputSelect_temp;
|
32322 |
|
32323 | function InputSelect_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
32324 |
|
32325 | function InputSelect_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
32326 |
|
32327 | function InputSelect_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
32328 |
|
32329 | function InputSelect_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
32330 |
|
32331 |
|
32332 |
|
32333 |
|
32334 |
|
32335 |
|
32336 | var InputSelect_InputSelect = (InputSelect_temp = InputSelect_class = function (_Component) {
|
32337 | InputSelect_inherits(InputSelect, _Component);
|
32338 |
|
32339 | function InputSelect(props) {
|
32340 | InputSelect_classCallCheck(this, InputSelect);
|
32341 |
|
32342 | var _this = InputSelect_possibleConstructorReturn(this, _Component.call(this, props));
|
32343 |
|
32344 | _this.getValue = function (options) {
|
32345 | if (!_this.props.multiple) return options[0].value;
|
32346 | var value = options.map(function (item) {
|
32347 | return item.value;
|
32348 | });
|
32349 | return value.join(_this.props.split || ',');
|
32350 | };
|
32351 |
|
32352 | _this.getOptions = function (options) {
|
32353 | return _this.props.multiple ? options : options[0];
|
32354 | };
|
32355 |
|
32356 | _this.onClick = function (value, args) {
|
32357 | if (_this.props.onClick) _this.props.onClick(value, args);
|
32358 | _this.setState({
|
32359 | show: !_this.state.show
|
32360 | });
|
32361 | };
|
32362 |
|
32363 | _this.onClickSubmit = function (selected) {
|
32364 | if (!_this.$input) _this.$input = _this.refs.$ComponentInputText.$input;
|
32365 | if (_this.props.onClickSubmit) {
|
32366 | _this.props.onClickSubmit(selected);
|
32367 | return;
|
32368 | }
|
32369 | var value = _this.getValue(selected);
|
32370 |
|
32371 | if (!_this.props.valueBindProp) _this.$input.value = value;
|
32372 | _this.setState({
|
32373 | show: !_this.state.show
|
32374 | });
|
32375 | if (_this.props.onChange) {
|
32376 | _this.props.onChange(value, selected, _this.props.args);
|
32377 | }
|
32378 | };
|
32379 |
|
32380 | _this.onClickCancel = function (e) {
|
32381 | if (_this.props.onClickCancel) {
|
32382 | _this.props.onClickCancel(e);
|
32383 | return;
|
32384 | }
|
32385 | _this.setState({
|
32386 | show: !_this.state.show
|
32387 | });
|
32388 | };
|
32389 |
|
32390 | _this.onClickMask = function (e) {
|
32391 | if (_this.props.onClickMask) {
|
32392 | _this.props.onClickMask(e);
|
32393 | return;
|
32394 | }
|
32395 | _this.setState({
|
32396 | show: !_this.state.show
|
32397 | });
|
32398 | };
|
32399 |
|
32400 | _this.state = {
|
32401 | show: false
|
32402 | };
|
32403 | return _this;
|
32404 | }
|
32405 |
|
32406 | InputSelect.prototype.componentDidMount = function componentDidMount() {
|
32407 | this.$el = this.refs.$ComponentInputText.$el;
|
32408 | this.$input = this.refs.$ComponentInputText.$input;
|
32409 | };
|
32410 |
|
32411 | InputSelect.prototype.render = function render() {
|
32412 | var _props = this.props,
|
32413 | valueForKey = _props.valueForKey,
|
32414 | split = _props.split,
|
32415 | list = _props.list,
|
32416 | multiple = _props.multiple,
|
32417 | onClick = _props.onClick,
|
32418 | onChange = _props.onChange,
|
32419 | pickerStyle = _props.pickerStyle,
|
32420 | pickerClassName = _props.pickerClassName,
|
32421 | pickerMaskStyle = _props.pickerMaskStyle,
|
32422 | pickerMaskClassName = _props.pickerMaskClassName,
|
32423 | pickerShow = _props.pickerShow,
|
32424 | onClickSubmit = _props.onClickSubmit,
|
32425 | onClickCancel = _props.onClickCancel,
|
32426 | onClickMask = _props.onClickMask,
|
32427 | others = InputSelect_objectWithoutProperties(_props, ['valueForKey', 'split', 'list', 'multiple', 'onClick', 'onChange', 'pickerStyle', 'pickerClassName', 'pickerMaskStyle', 'pickerMaskClassName', 'pickerShow', 'onClickSubmit', 'onClickCancel', 'onClickMask']);
|
32428 |
|
32429 | return [external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(src_InputText, InputSelect_extends({ key: 'input', ref: '$ComponentInputText' }, others, { readOnly: true, onClick: this.onClick })), external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(src_SelectPicker, {
|
32430 | list: list, valueForKey: valueForKey, value: this.$input ? this.$input.value : this.props.value, key: 'picker',
|
32431 | split: split,
|
32432 | show: pickerShow === undefined ? this.state.show : pickerShow,
|
32433 | multiple: multiple,
|
32434 | maskStyle: pickerMaskStyle, maskClassName: pickerMaskClassName,
|
32435 | style: pickerStyle, className: pickerClassName,
|
32436 | onClickSubmit: this.onClickSubmit, onClickCancel: this.onClickCancel, onClickMask: this.onClickMask
|
32437 | })];
|
32438 | };
|
32439 |
|
32440 | return InputSelect;
|
32441 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), InputSelect_class.propTypes = {
|
32442 | valueBindProp: prop_types_default.a.bool,
|
32443 | valueForKey: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.number]),
|
32444 | split: prop_types_default.a.string,
|
32445 | list: prop_types_default.a.array,
|
32446 | multiple: prop_types_default.a.bool,
|
32447 | onClick: prop_types_default.a.func,
|
32448 | onChange: prop_types_default.a.func,
|
32449 |
|
32450 |
|
32451 | pickerStyle: prop_types_default.a.object,
|
32452 | pickerClassName: prop_types_default.a.string,
|
32453 | pickerMaskStyle: prop_types_default.a.object,
|
32454 | pickerMaskClassName: prop_types_default.a.string,
|
32455 |
|
32456 | pickerShow: prop_types_default.a.bool,
|
32457 | onClickSubmit: prop_types_default.a.func,
|
32458 | onClickCancel: prop_types_default.a.func,
|
32459 | onClickMask: prop_types_default.a.func
|
32460 | }, InputSelect_class.defaultProps = {
|
32461 | split: ','
|
32462 | }, InputSelect_temp);
|
32463 |
|
32464 |
|
32465 |
|
32466 |
|
32467 | var src_InputSelect = (InputSelect_InputSelect);
|
32468 |
|
32469 | var Star_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; };
|
32470 |
|
32471 | var Star_class, Star_temp;
|
32472 |
|
32473 | function Star_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
32474 |
|
32475 | function Star_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
32476 |
|
32477 | function Star_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
32478 |
|
32479 | function Star_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
32480 |
|
32481 |
|
32482 |
|
32483 |
|
32484 | var Star_Star = (Star_temp = Star_class = function (_Component) {
|
32485 | Star_inherits(Star, _Component);
|
32486 |
|
32487 | function Star(props) {
|
32488 | Star_classCallCheck(this, Star);
|
32489 |
|
32490 | var _this = Star_possibleConstructorReturn(this, _Component.call(this, props));
|
32491 |
|
32492 | _this.onClick = function (e) {
|
32493 | if (_this.props.onClick) {
|
32494 | _this.props.onClick(Object.getArgs(e, _this.props.args));
|
32495 | }
|
32496 | };
|
32497 |
|
32498 | return _this;
|
32499 | }
|
32500 |
|
32501 | Star.prototype.render = function render() {
|
32502 | var _props = this.props,
|
32503 | args = _props.args,
|
32504 | className = _props.className,
|
32505 | onClick = _props.onClick,
|
32506 | others = Star_objectWithoutProperties(_props, ['args', 'className', 'onClick']);
|
32507 |
|
32508 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('i', Star_extends({ className: 'star' + (className ? ' ' + className : '') }, others, { onClick: this.onClick }));
|
32509 | };
|
32510 |
|
32511 | return Star;
|
32512 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Star_class.propTypes = {
|
32513 | args: prop_types_default.a.any,
|
32514 | className: prop_types_default.a.string,
|
32515 | onClick: prop_types_default.a.func
|
32516 | }, Star_class.defaultProps = {
|
32517 | args: null
|
32518 | }, Star_temp);
|
32519 |
|
32520 |
|
32521 |
|
32522 |
|
32523 | var src_Star = (Star_Star);
|
32524 |
|
32525 | var InputStar_class, InputStar_temp;
|
32526 |
|
32527 | function InputStar_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
32528 |
|
32529 | function InputStar_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
32530 |
|
32531 | function InputStar_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
32532 |
|
32533 |
|
32534 |
|
32535 |
|
32536 |
|
32537 | if (!window._seeds_lang) window._seeds_lang = {};
|
32538 |
|
32539 | var InputStar_InputStar = (InputStar_temp = InputStar_class = function (_Component) {
|
32540 | InputStar_inherits(InputStar, _Component);
|
32541 |
|
32542 | function InputStar(props) {
|
32543 | InputStar_classCallCheck(this, InputStar);
|
32544 |
|
32545 | return InputStar_possibleConstructorReturn(this, _Component.call(this, props));
|
32546 | }
|
32547 |
|
32548 | InputStar.prototype.onChange = function onChange(e, argNum) {
|
32549 | var _props = this.props,
|
32550 | min = _props.min,
|
32551 | onChange = _props.onChange,
|
32552 | onError = _props.onError;
|
32553 |
|
32554 | var num = argNum;
|
32555 | if (num < min) {
|
32556 | if (onError) {
|
32557 | onError('' + (window._seeds_lang['hint_cannot_be_less_than'] || '不能小于') + min + (window._seeds_lang['star'] || '颗星'));
|
32558 | } else {
|
32559 | num = min;
|
32560 | }
|
32561 | }
|
32562 | if (onChange) onChange(num, Object.getArgs(e, this.props.args));
|
32563 | };
|
32564 |
|
32565 | InputStar.prototype.render = function render() {
|
32566 | var _this2 = this;
|
32567 |
|
32568 | var _props2 = this.props,
|
32569 | max = _props2.max,
|
32570 | min = _props2.min,
|
32571 | value = _props2.value,
|
32572 | className = _props2.className,
|
32573 | style = _props2.style;
|
32574 |
|
32575 | var stars = [];
|
32576 | for (var i = 1; i <= max; i++) {
|
32577 | stars.push(i);
|
32578 | }
|
32579 | var current = value;
|
32580 | if (current < min) current = min;
|
32581 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
32582 | 'div',
|
32583 | { className: 'input-star' + (className ? ' ' + className : ''), style: style },
|
32584 | stars.map(function (index) {
|
32585 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(src_Star, { onClick: function onClick(e) {
|
32586 | _this2.onChange(e, index);
|
32587 | }, key: index, className: index <= current ? 'active' : '' });
|
32588 | })
|
32589 | );
|
32590 | };
|
32591 |
|
32592 | return InputStar;
|
32593 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), InputStar_class.propTypes = {
|
32594 | args: prop_types_default.a.any,
|
32595 | min: prop_types_default.a.number,
|
32596 | max: prop_types_default.a.number,
|
32597 | value: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.number]),
|
32598 | onChange: prop_types_default.a.func,
|
32599 | className: prop_types_default.a.string,
|
32600 | style: prop_types_default.a.object
|
32601 | }, InputStar_class.defaultProps = {
|
32602 | args: null,
|
32603 | value: 0,
|
32604 | min: 0,
|
32605 | max: 5
|
32606 | }, InputStar_temp);
|
32607 |
|
32608 |
|
32609 |
|
32610 |
|
32611 | var src_InputStar = (InputStar_InputStar);
|
32612 |
|
32613 | var Legend_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; };
|
32614 |
|
32615 | var Legend_class, Legend_temp;
|
32616 |
|
32617 | function Legend_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
32618 |
|
32619 | function Legend_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
32620 |
|
32621 | function Legend_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
32622 |
|
32623 | function Legend_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
32624 |
|
32625 |
|
32626 |
|
32627 |
|
32628 | var Legend_Legend = (Legend_temp = Legend_class = function (_Component) {
|
32629 | Legend_inherits(Legend, _Component);
|
32630 |
|
32631 | function Legend(props) {
|
32632 | Legend_classCallCheck(this, Legend);
|
32633 |
|
32634 | return Legend_possibleConstructorReturn(this, _Component.call(this, props));
|
32635 | }
|
32636 |
|
32637 | Legend.prototype.render = function render() {
|
32638 | var _props = this.props,
|
32639 | className = _props.className,
|
32640 | children = _props.children,
|
32641 | others = Legend_objectWithoutProperties(_props, ['className', 'children']);
|
32642 |
|
32643 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
32644 | 'div',
|
32645 | Legend_extends({ className: 'legend' + (className ? ' ' + className : '') }, others),
|
32646 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
32647 | 'div',
|
32648 | { className: 'legend-caption' },
|
32649 | children
|
32650 | )
|
32651 | );
|
32652 | };
|
32653 |
|
32654 | return Legend;
|
32655 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Legend_class.propTypes = {
|
32656 | className: prop_types_default.a.string,
|
32657 | children: prop_types_default.a.node
|
32658 | }, Legend_class.defaultProps = {}, Legend_temp);
|
32659 |
|
32660 |
|
32661 |
|
32662 |
|
32663 | var src_Legend = (Legend_Legend);
|
32664 |
|
32665 |
|
32666 | var instance_ListPull = function ListPull(container, params) {
|
32667 | |
32668 |
|
32669 |
|
32670 | var defaults = {
|
32671 | leftClass: 'list-pull-left',
|
32672 | rightClass: 'list-pull-right',
|
32673 | handlerClass: 'list-pull-handler',
|
32674 | activeClass: 'active',
|
32675 | threshold: 20,
|
32676 | duration: 150
|
32677 | |
32678 |
|
32679 |
|
32680 |
|
32681 |
|
32682 |
|
32683 |
|
32684 | };
|
32685 | params = params || {};
|
32686 | for (var def in defaults) {
|
32687 | if (params[def] === undefined) {
|
32688 | params[def] = defaults[def];
|
32689 | }
|
32690 | }
|
32691 | var s = this;
|
32692 |
|
32693 | s.params = params;
|
32694 |
|
32695 | s.container = typeof container === 'string' ? document.querySelector(container) : container;
|
32696 | if (!s.container) {
|
32697 | console.log('SeedsUI Error:未找到ListPull的DOM对象,请检查传入参数是否正确');
|
32698 | return;
|
32699 | }
|
32700 | |
32701 |
|
32702 |
|
32703 | s.hide = function (target) {
|
32704 | if (!target) {
|
32705 | var actives = s.container.querySelectorAll('.' + s.params.activeClass);
|
32706 | if (actives.length > 0) target = actives[0];
|
32707 | }
|
32708 | if (target) {
|
32709 | target.style.webkitTransitionDuration = s.params.duration + 'ms';
|
32710 | target.style.webkitTransform = 'translate3d(0px,0px,0px)';
|
32711 | target.classList.remove(s.params.activeClass);
|
32712 | }
|
32713 | };
|
32714 | s.show = function (target, direction) {
|
32715 | target.style.webkitTransitionDuration = s.params.duration + 'ms';
|
32716 | var x = direction === 'right' ? -s.rightClientWidth : s.leftClientWidth;
|
32717 | target.style.webkitTransform = 'translate3d(' + x + 'px,0px,0px)';
|
32718 | target.classList.add(s.params.activeClass);
|
32719 |
|
32720 | s.target = target;
|
32721 | if (s.params.onShowedLeft || s.params.onShowedRight) {
|
32722 | setTimeout(function () {
|
32723 | if (direction === 'left' && s.params.onShowedLeft) s.params.onShowedLeft(s);
|
32724 | if (direction === 'right' && s.params.onShowedRight) s.params.onShowedRight(s);
|
32725 | }, s.params.duration);
|
32726 | }
|
32727 | };
|
32728 | |
32729 |
|
32730 |
|
32731 | s.events = function (detach) {
|
32732 | var touchTarget = s.container;
|
32733 | var action = detach ? 'removeEventListener' : 'addEventListener';
|
32734 | touchTarget[action]('touchstart', s.onTouchStart, false);
|
32735 | touchTarget[action]('touchmove', s.onTouchMove, false);
|
32736 | touchTarget[action]('touchend', s.onTouchEnd, false);
|
32737 | touchTarget[action]('touchcancel', s.onTouchEnd, false);
|
32738 | };
|
32739 | s.attach = function (event) {
|
32740 | s.events();
|
32741 | };
|
32742 | s.detach = function (event) {
|
32743 | s.events(true);
|
32744 | };
|
32745 | |
32746 |
|
32747 |
|
32748 |
|
32749 | s.touches = {
|
32750 | direction: 0,
|
32751 | vertical: 0,
|
32752 | horizontal: 0,
|
32753 | startX: 0,
|
32754 | startY: 0,
|
32755 | currentX: 0,
|
32756 | currentY: 0,
|
32757 | endX: 0,
|
32758 | endY: 0,
|
32759 | diffX: 0,
|
32760 | diffY: 0
|
32761 |
|
32762 | };s.activeIndex = 0;
|
32763 |
|
32764 | s.onTouchStart = function (e) {
|
32765 | e.stopPropagation();
|
32766 |
|
32767 | s.touches.direction = 0;
|
32768 | s.touches.vertical = 0;
|
32769 | s.touches.horizontal = 0;
|
32770 |
|
32771 | s.touches.startX = e.touches[0].clientX;
|
32772 | s.touches.startY = e.touches[0].clientY;
|
32773 | s.leftClientWidth = 0;
|
32774 | s.rightClientWidth = 0;
|
32775 |
|
32776 | var actives = s.container.querySelectorAll('.' + s.params.activeClass);
|
32777 | if (actives.length > 0) {
|
32778 | s.hide(actives[0]);
|
32779 | } else if (e.target.classList.contains(s.params.handlerClass)) {
|
32780 |
|
32781 | var left = e.target.parentNode.querySelector('.' + s.params.leftClass);
|
32782 | var right = e.target.parentNode.querySelector('.' + s.params.rightClass);
|
32783 | s.leftClientWidth = left ? left.clientWidth : 0;
|
32784 | s.rightClientWidth = right ? right.clientWidth : 0;
|
32785 | }
|
32786 | };
|
32787 | s.onTouchMove = function (e) {
|
32788 | e.stopPropagation();
|
32789 | if (!s.leftClientWidth && !s.rightClientWidth) return;
|
32790 | s.touches.currentX = e.touches[0].clientX;
|
32791 | s.touches.currentY = e.touches[0].clientY;
|
32792 | s.touches.diffX = s.touches.currentX - s.touches.startX;
|
32793 | s.touches.diffY = s.touches.currentY - s.touches.startY;
|
32794 |
|
32795 |
|
32796 | if (s.touches.direction === 0) {
|
32797 |
|
32798 | s.touches.direction = Math.abs(s.touches.diffX) > Math.abs(s.touches.diffY) ? 1 : -1;
|
32799 | }
|
32800 | if (s.touches.direction === -1) {
|
32801 |
|
32802 | s.touches.vertical = s.touches.diffY < 0 ? 1 : -1;
|
32803 | }
|
32804 | if (s.touches.direction === 1) {
|
32805 |
|
32806 | s.touches.horizontal = s.touches.diffX < 0 ? 1 : -1;
|
32807 | }
|
32808 |
|
32809 |
|
32810 | if (s.touches.vertical !== 0) {
|
32811 | return;
|
32812 | }
|
32813 |
|
32814 | if (s.touches.diffX < -s.rightClientWidth) s.touches.diffX = -s.rightClientWidth;
|
32815 | if (s.touches.diffX > s.leftClientWidth) s.touches.diffX = s.leftClientWidth;
|
32816 |
|
32817 |
|
32818 | if (s.params.onPull) s.params.onPull(s);
|
32819 |
|
32820 |
|
32821 | e.target.style.webkitTransform = 'translate3d(' + s.touches.diffX + 'px,0px,0px)';
|
32822 | };
|
32823 | s.onTouchEnd = function (e) {
|
32824 | e.stopPropagation();
|
32825 | if (s.touches.direction === -1) {
|
32826 |
|
32827 | return;
|
32828 | }
|
32829 | s.touches.endX = e.clientX || e.changedTouches[0].clientX;
|
32830 | s.touches.endY = e.clientY || e.changedTouches[0].clientY;
|
32831 | if (Math.abs(s.touches.startX - s.touches.endX) < 6 && Math.abs(s.touches.startY - s.touches.endY) < 6) {
|
32832 |
|
32833 | s.target = e.target;
|
32834 | s.hide(e.target);
|
32835 |
|
32836 | if (!e.target.classList.contains(s.params.handlerClass) || s.leftClientWidth || s.rightClientWidth) {
|
32837 |
|
32838 | if (s.params.onClick) s.params.onClick(s);
|
32839 | }
|
32840 | } else if (s.leftClientWidth || s.rightClientWidth) {
|
32841 |
|
32842 | if (Math.abs(s.touches.diffX) > s.params.threshold) {
|
32843 | s.show(e.target, s.touches.diffX > 0 ? 'left' : 'right');
|
32844 | } else {
|
32845 | s.hide(e.target);
|
32846 | }
|
32847 | }
|
32848 | };
|
32849 |
|
32850 | s.init = function () {
|
32851 | s.attach();
|
32852 | };
|
32853 | s.init();
|
32854 | };
|
32855 |
|
32856 | var ListPull_instance = (instance_ListPull);
|
32857 |
|
32858 | var ListPull_class, ListPull_temp;
|
32859 |
|
32860 | function ListPull_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
32861 |
|
32862 | function ListPull_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
32863 |
|
32864 | function ListPull_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
32865 |
|
32866 |
|
32867 |
|
32868 |
|
32869 |
|
32870 |
|
32871 | var ListPull_ListPull = (ListPull_temp = ListPull_class = function (_Component) {
|
32872 | ListPull_inherits(ListPull, _Component);
|
32873 |
|
32874 | function ListPull(props) {
|
32875 | ListPull_classCallCheck(this, ListPull);
|
32876 |
|
32877 | return ListPull_possibleConstructorReturn(this, _Component.call(this, props));
|
32878 | }
|
32879 |
|
32880 | ListPull.prototype.componentDidMount = function componentDidMount() {
|
32881 | var _this2 = this;
|
32882 |
|
32883 | var instance = new ListPull_instance(this.$el, {
|
32884 | onClick: function onClick(e) {
|
32885 | var index = e.target.getAttribute('data-index');
|
32886 | var item = _this2.props.list[index];
|
32887 | var btn = null;
|
32888 | var i = e.target.getAttribute('data-i');
|
32889 | var direction = e.target.getAttribute('data-direction');
|
32890 | if (i && direction) {
|
32891 | if (direction === 'left') {
|
32892 | btn = item.lButtons[i];
|
32893 | } else {
|
32894 | btn = item.rButtons[i];
|
32895 | }
|
32896 | }
|
32897 | if (_this2.props.onClick) _this2.props.onClick(item, index, btn);
|
32898 | },
|
32899 | onShowedLeft: this.props.onShowedLeft,
|
32900 | onShowedRight: this.props.onShowedRight
|
32901 | });
|
32902 | this.instance = instance;
|
32903 | };
|
32904 |
|
32905 | ListPull.prototype.render = function render() {
|
32906 | var _this3 = this;
|
32907 |
|
32908 | var _props = this.props,
|
32909 | list = _props.list,
|
32910 | style = _props.style,
|
32911 | className = _props.className;
|
32912 |
|
32913 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
32914 | 'ul',
|
32915 | { ref: function ref(el) {
|
32916 | _this3.$el = el;
|
32917 | }, className: 'list-pull' + (className ? ' ' + className : ''), style: style },
|
32918 | list.map(function (item, index) {
|
32919 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
32920 | 'li',
|
32921 | { key: 'button' + index, 'data-index': '' + index, className: 'border-b list-pull-li' },
|
32922 | item.lButtons && item.lButtons.length && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
32923 | 'div',
|
32924 | { className: 'list-pull-left' },
|
32925 | item.lButtons.map(function (button, i) {
|
32926 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
32927 | src_Button,
|
32928 | { key: 'button' + i, 'data-index': '' + index, 'data-i': '' + i, 'data-direction': 'left', className: 'list-pull-button' + (button.className ? ' ' + button.className : ''), style: button.style },
|
32929 | button.value
|
32930 | );
|
32931 | })
|
32932 | ),
|
32933 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
32934 | 'div',
|
32935 | { className: 'list-pull-handler', 'data-index': '' + index },
|
32936 | item.container
|
32937 | ),
|
32938 | item.rButtons && item.rButtons.length && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
32939 | 'div',
|
32940 | { className: 'list-pull-right' },
|
32941 | item.rButtons.map(function (button, i) {
|
32942 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
32943 | src_Button,
|
32944 | { key: 'button' + i, 'data-index': '' + index, 'data-i': '' + i, 'data-direction': 'right', className: 'list-pull-button' + (button.className ? ' ' + button.className : ''), style: button.style },
|
32945 | button.value
|
32946 | );
|
32947 | })
|
32948 | )
|
32949 | );
|
32950 | })
|
32951 | );
|
32952 | };
|
32953 |
|
32954 | return ListPull;
|
32955 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), ListPull_class.propTypes = {
|
32956 | list: prop_types_default.a.array,
|
32957 | style: prop_types_default.a.object,
|
32958 | className: prop_types_default.a.string,
|
32959 | onClick: prop_types_default.a.func,
|
32960 | onShowedLeft: prop_types_default.a.func,
|
32961 | onShowedRight: prop_types_default.a.func
|
32962 | }, ListPull_class.defaultProps = {}, ListPull_temp);
|
32963 |
|
32964 |
|
32965 |
|
32966 |
|
32967 | var src_ListPull = (ListPull_ListPull);
|
32968 |
|
32969 | var Loading_class, Loading_temp;
|
32970 |
|
32971 | function Loading_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
32972 |
|
32973 | function Loading_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
32974 |
|
32975 | function Loading_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
32976 |
|
32977 |
|
32978 |
|
32979 |
|
32980 |
|
32981 | if (!window._seeds_lang) window._seeds_lang = {};
|
32982 |
|
32983 | var Loading_Loading = (Loading_temp = Loading_class = function (_Component) {
|
32984 | Loading_inherits(Loading, _Component);
|
32985 |
|
32986 | function Loading(props) {
|
32987 | Loading_classCallCheck(this, Loading);
|
32988 |
|
32989 | var _this = Loading_possibleConstructorReturn(this, _Component.call(this, props));
|
32990 |
|
32991 | _this.state = {};
|
32992 | return _this;
|
32993 | }
|
32994 |
|
32995 | Loading.prototype.render = function render() {
|
32996 | var _this2 = this;
|
32997 |
|
32998 | var _props = this.props,
|
32999 | type = _props.type,
|
33000 | maskStyle = _props.maskStyle,
|
33001 | maskClassName = _props.maskClassName,
|
33002 | maskBefore = _props.maskBefore,
|
33003 | style = _props.style,
|
33004 | iconClassName = _props.iconClassName,
|
33005 | iconSrc = _props.iconSrc,
|
33006 | caption = _props.caption;
|
33007 |
|
33008 | var content = external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
33009 | 'div',
|
33010 | null,
|
33011 | '\u52A0\u8F7D\u4E2D...'
|
33012 | );
|
33013 | if (type === 'custom') {
|
33014 |
|
33015 | content = external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
33016 | 'div',
|
33017 | { className: 'loading-custom', style: style },
|
33018 | (iconClassName || iconSrc) && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('span', { style: iconSrc ? { backgroundImage: 'url(' + iconSrc + ')' } : {}, className: 'loading-custom-icon' + (iconClassName ? ' ' + iconClassName : '') }),
|
33019 | caption && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
33020 | 'p',
|
33021 | { className: 'loading-custom-caption' },
|
33022 | caption
|
33023 | )
|
33024 | );
|
33025 | } else if (type === 'filling') {
|
33026 |
|
33027 | content = external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
33028 | 'div',
|
33029 | { className: 'loading-filling active', style: style },
|
33030 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'loading-filling-icon' })
|
33031 | );
|
33032 | } else if (type === 'floating') {
|
33033 |
|
33034 | content = external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
33035 | 'div',
|
33036 | { className: 'loading-floating animated', style: style },
|
33037 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
33038 | 'div',
|
33039 | { className: 'loading-floating-icon' },
|
33040 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'loading-floating-blade' }),
|
33041 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'loading-floating-blade' }),
|
33042 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'loading-floating-blade' }),
|
33043 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'loading-floating-blade' }),
|
33044 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'loading-floating-blade' }),
|
33045 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'loading-floating-blade' }),
|
33046 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'loading-floating-blade' }),
|
33047 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'loading-floating-blade' }),
|
33048 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'loading-floating-blade' }),
|
33049 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'loading-floating-blade' }),
|
33050 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'loading-floating-blade' }),
|
33051 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'loading-floating-blade' })
|
33052 | ),
|
33053 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
33054 | 'div',
|
33055 | { className: 'loading-floating-caption' },
|
33056 | caption
|
33057 | )
|
33058 | );
|
33059 | }
|
33060 | if (this.props.portal) {
|
33061 | return Object(react_dom["createPortal"])(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
33062 | 'div',
|
33063 | { className: 'loading-mask mask active' + (maskClassName ? ' ' + maskClassName : ''), style: maskStyle },
|
33064 | maskBefore,
|
33065 | content
|
33066 | ), this.props.portal);
|
33067 | }
|
33068 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
33069 | 'div',
|
33070 | { ref: function ref(el) {
|
33071 | _this2.$el = el;
|
33072 | }, className: 'loading-mask mask active' + (maskClassName ? ' ' + maskClassName : ''), style: maskStyle },
|
33073 | maskBefore,
|
33074 | content
|
33075 | );
|
33076 | };
|
33077 |
|
33078 | return Loading;
|
33079 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Loading_class.propTypes = {
|
33080 | portal: prop_types_default.a.object,
|
33081 | type: prop_types_default.a.string,
|
33082 |
|
33083 | maskStyle: prop_types_default.a.object,
|
33084 | maskClassName: prop_types_default.a.string,
|
33085 | maskBefore: prop_types_default.a.node,
|
33086 |
|
33087 | style: prop_types_default.a.object,
|
33088 |
|
33089 | iconClassName: prop_types_default.a.string,
|
33090 | iconSrc: prop_types_default.a.string,
|
33091 | caption: prop_types_default.a.string
|
33092 | }, Loading_class.defaultProps = {
|
33093 | caption: window._seeds_lang['loading'] || '正在加载...',
|
33094 | type: 'floating'
|
33095 | }, Loading_temp);
|
33096 |
|
33097 |
|
33098 |
|
33099 |
|
33100 | var src_Loading = (Loading_Loading);
|
33101 |
|
33102 | var instance_LotteryWheel = function LotteryWheel(container, params) {
|
33103 | |
33104 |
|
33105 |
|
33106 | var defaults = {
|
33107 |
|
33108 | spacing: 0,
|
33109 |
|
33110 | data: [],
|
33111 |
|
33112 | fontFamily: 'Arial',
|
33113 | fontSize: 13,
|
33114 | fontTop: 28,
|
33115 | fontFillStyle: '#ef694f',
|
33116 |
|
33117 | bgFillStyle: '#ffdf7d',
|
33118 | bgStrokeStyle: '#fa8b6e',
|
33119 | bgLineWidth: 1,
|
33120 |
|
33121 | iconWidth: 42,
|
33122 | iconHeight: 42,
|
33123 | iconTop: 42,
|
33124 |
|
33125 | around: 6,
|
33126 |
|
33127 | wrapperClass: 'lotterywheel-wrapper',
|
33128 |
|
33129 | suffix: 'image/png',
|
33130 | quality: 0.92
|
33131 |
|
33132 | |
33133 |
|
33134 |
|
33135 |
|
33136 | };
|
33137 | params = params || {};
|
33138 | for (var def in defaults) {
|
33139 | if (params[def] === undefined) {
|
33140 | params[def] = defaults[def];
|
33141 | }
|
33142 | }
|
33143 | var s = this;
|
33144 | s.params = params;
|
33145 |
|
33146 | s.canvas = typeof container === 'string' ? document.querySelector(container) : container;
|
33147 | if (!s.canvas) {
|
33148 | console.log('SeedsUI Error : Lottery container不存在,请检查页面中是否有此元素');
|
33149 | return;
|
33150 | }
|
33151 | s.width = s.canvas.width || 300;
|
33152 | s.height = s.canvas.height || 300;
|
33153 |
|
33154 | s.wrapper = null;
|
33155 | s.createWrapper = function () {
|
33156 | s.wrapper = document.createElement('div');
|
33157 | s.wrapper.setAttribute('class', s.params.wrapperClass + ' animated');
|
33158 | s.wrapper.style.width = s.width + 'px';
|
33159 | s.wrapper.style.height = s.height + 'px';
|
33160 | s.canvas.parentNode.replaceChild(s.wrapper, s.canvas);
|
33161 | s.wrapper.appendChild(s.canvas);
|
33162 | };
|
33163 | s.create = function () {
|
33164 | s.createWrapper();
|
33165 | };
|
33166 | s.create();
|
33167 | s.ctx = s.canvas.getContext('2d');
|
33168 | |
33169 |
|
33170 |
|
33171 |
|
33172 | s.clear = function () {
|
33173 | s.ctx.clearRect(0, 0, s.width, s.height);
|
33174 | };
|
33175 |
|
33176 | s.getPixelRatio = function () {
|
33177 | var context = s.ctx;
|
33178 | var backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1;
|
33179 | return (window.devicePixelRatio || 1) / backingStore;
|
33180 | };
|
33181 |
|
33182 | s.sector = function (x, y, radius, sAngle, eAngle, counterclockwise) {
|
33183 |
|
33184 | s.ctx.beginPath();
|
33185 |
|
33186 | s.ctx.moveTo(x, y);
|
33187 |
|
33188 | s.ctx.arc(x, y, radius, sAngle, eAngle, counterclockwise);
|
33189 |
|
33190 | s.ctx.closePath();
|
33191 | };
|
33192 | s.slotDeg = 0;
|
33193 | s.rad = 0;
|
33194 | s.slotRad = 0;
|
33195 |
|
33196 | s.updateAngle = function () {
|
33197 | s.slotDeg = 360 / s.params.data.length;
|
33198 | s.rad = Math.PI / 180;
|
33199 | s.slotRad = s.rad * s.slotDeg;
|
33200 | };
|
33201 |
|
33202 | s.drawCanvas = function (item, index) {
|
33203 | var ratio = s.getPixelRatio();
|
33204 |
|
33205 | var xy = Math.min(s.width || 300, s.height || 300) / 2;
|
33206 | var r = xy - (s.params.spacing || 0);
|
33207 |
|
33208 | s.ctx.strokeStyle = item.bgStrokeStyle || s.params.bgStrokeStyle;
|
33209 | s.ctx.fillStyle = item.bgFillStyle || s.params.bgFillStyle;
|
33210 | s.ctx.lineWidth = item.bgLineWidth || s.params.bgLineWidth;
|
33211 |
|
33212 |
|
33213 | var startAngel = s.rad * -90 - s.slotRad / 2;
|
33214 | var endAngel = startAngel + s.slotRad;
|
33215 |
|
33216 |
|
33217 | s.ctx.translate(xy, xy);
|
33218 | if (index === 0) s.ctx.rotate(s.slotRad / 2);
|
33219 | if (index !== 0) s.ctx.rotate(s.slotRad);
|
33220 | s.ctx.translate(-xy, -xy);
|
33221 |
|
33222 |
|
33223 |
|
33224 |
|
33225 |
|
33226 | s.sector(xy, xy, r, startAngel, endAngel);
|
33227 | s.ctx.stroke();
|
33228 | s.ctx.fill();
|
33229 |
|
33230 |
|
33231 | var fontSize = (item.fontSize || s.params.fontSize) * ratio;
|
33232 | var fontFamily = item.fontFamily || s.params.fontFamily;
|
33233 | var fontTop = (item.fontTop || s.params.fontTop) * ratio;
|
33234 | s.ctx.font = fontSize + 'px ' + fontFamily;
|
33235 | s.ctx.textAlign = 'center';
|
33236 | s.ctx.textBaseline = 'middle';
|
33237 | s.ctx.fillStyle = item.fontFillStyle || s.params.fontFillStyle;
|
33238 | s.ctx.fillText(item.text || '', xy, fontTop);
|
33239 |
|
33240 |
|
33241 | var img = s.imgs[index];
|
33242 | if (img.getAttribute('data-complete') === '1') {
|
33243 | var imgTop = (item.iconTop || s.params.iconTop) * ratio;
|
33244 | var imgWidth = (item.iconWidth || s.params.iconWidth) * ratio;
|
33245 | var imgHeight = (item.iconHeight || s.params.iconHeight) * ratio;
|
33246 | s.ctx.drawImage(img, xy - imgWidth / 2, imgTop, imgWidth, imgHeight);
|
33247 | }
|
33248 |
|
33249 |
|
33250 |
|
33251 | };
|
33252 |
|
33253 | s.update = function () {
|
33254 |
|
33255 | var ratio = s.getPixelRatio();
|
33256 | s.width = s.width * ratio;
|
33257 | s.height = s.height * ratio;
|
33258 | s.canvas.width = s.width;
|
33259 | s.canvas.height = s.height;
|
33260 | s.ctx.width = s.width;
|
33261 | s.ctx.height = s.height;
|
33262 |
|
33263 | s.canvas.style.WebkitTransform = 'scale(' + 1 / ratio + ')';
|
33264 | s.canvas.style.WebkitTransformOrigin = 'left top';
|
33265 |
|
33266 | s.updateAngle();
|
33267 | };
|
33268 | s.update();
|
33269 | |
33270 |
|
33271 |
|
33272 |
|
33273 | s.imgs = [];
|
33274 | s.initImgs = function () {
|
33275 | if (!s.params.data || !s.params.data.length) return;
|
33276 | s.imgs = [];
|
33277 | for (var i = 0; i < s.params.data.length; i++) {
|
33278 | var item = s.params.data[i];
|
33279 | var img = document.createElement('img');
|
33280 | img.src = item.icon;
|
33281 | img.style.display = 'none';
|
33282 | document.body.appendChild(img);
|
33283 | img.addEventListener('load', s.onIconLoad, false);
|
33284 | img.addEventListener('error', s.onIconError, false);
|
33285 | s.imgs.push(img);
|
33286 | }
|
33287 | };
|
33288 |
|
33289 | s.imgsCompleteDraw = function () {
|
33290 | var complete = s.imgs.filter(function (img) {
|
33291 | return img.getAttribute('data-complete');
|
33292 | });
|
33293 | if (complete.length === s.imgs.length) {
|
33294 | console.log('图片加载完成, 开始绘制');
|
33295 | s.draw();
|
33296 | }
|
33297 | };
|
33298 | s.onIconLoad = function (e) {
|
33299 | e.target.setAttribute('data-complete', '1');
|
33300 |
|
33301 | s.imgsCompleteDraw();
|
33302 | };
|
33303 | s.onIconError = function (e) {
|
33304 | e.target.setAttribute('data-complete', '-1');
|
33305 |
|
33306 | s.imgsCompleteDraw();
|
33307 | };
|
33308 | |
33309 |
|
33310 |
|
33311 | s.events = function (detach) {
|
33312 | var action = detach ? 'removeEventListener' : 'addEventListener';
|
33313 | if (s.wrapper) s.wrapper[action]('webkitTransitionEnd', s.onTransitionEnd, false);
|
33314 | };
|
33315 | s.detach = function (event) {
|
33316 | s.events(true);
|
33317 | };
|
33318 | s.attach = function (event) {
|
33319 | s.events();
|
33320 | };
|
33321 | s.onTransitionEnd = function (e) {
|
33322 | s.event = e;
|
33323 |
|
33324 | if (s.params.onTransitionEnd) s.params.onTransitionEnd(s);
|
33325 |
|
33326 | var target = e.target;
|
33327 | if (target.classList.contains(s.params.wrapperClass)) {
|
33328 | s.playing = false;
|
33329 | if (s.params.onPlayAnimationEnd) s.params.onPlayAnimationEnd(s);
|
33330 | }
|
33331 | };
|
33332 | |
33333 |
|
33334 |
|
33335 |
|
33336 | s.draw = function () {
|
33337 | if (!s.params.data || !s.params.data.length) return;
|
33338 | s.reset();
|
33339 | s.clear();
|
33340 |
|
33341 | s.ctx.save();
|
33342 | for (var i = 0; i < s.params.data.length; i++) {
|
33343 | s.drawCanvas(s.params.data[i], i);
|
33344 | }
|
33345 | };
|
33346 |
|
33347 | s.reset = function () {
|
33348 |
|
33349 | s.updateAngle();
|
33350 |
|
33351 | s.wrapper.classList.remove('animated');
|
33352 | s.wrapper.style.WebkitTransform = 'rotate(0deg)';
|
33353 |
|
33354 | if (s.ctx) s.ctx.restore();
|
33355 | };
|
33356 |
|
33357 | s.playing = false;
|
33358 | s.play = function (count, onPlayAnimationEnd) {
|
33359 | if (s.playing) return;
|
33360 | s.playing = true;
|
33361 | if (!s.params.data || !s.params.data.length) return;
|
33362 | var baseRotate = (s.params.around || 6) * 360;
|
33363 | var rotate = (count + 1) * s.slotDeg - s.slotDeg / 2;
|
33364 |
|
33365 | s.wrapper.classList.add('animated');
|
33366 | s.wrapper.style.WebkitTransform = 'rotate(' + (baseRotate - rotate) + 'deg)';
|
33367 |
|
33368 |
|
33369 | if (onPlayAnimationEnd) s.params.onPlayAnimationEnd = onPlayAnimationEnd;
|
33370 | };
|
33371 |
|
33372 | s.init = function () {
|
33373 | s.initImgs();
|
33374 | s.attach();
|
33375 | };
|
33376 |
|
33377 | s.init();
|
33378 | };
|
33379 |
|
33380 | var LotteryWheel_instance = (instance_LotteryWheel);
|
33381 |
|
33382 | var LotteryWheel_class, LotteryWheel_temp;
|
33383 |
|
33384 | function LotteryWheel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
33385 |
|
33386 | function LotteryWheel_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
33387 |
|
33388 | function LotteryWheel_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
33389 |
|
33390 |
|
33391 |
|
33392 |
|
33393 |
|
33394 | var LotteryWheel_LotteryWheel = (LotteryWheel_temp = LotteryWheel_class = function (_Component) {
|
33395 | LotteryWheel_inherits(LotteryWheel, _Component);
|
33396 |
|
33397 | function LotteryWheel(props) {
|
33398 | LotteryWheel_classCallCheck(this, LotteryWheel);
|
33399 |
|
33400 | return LotteryWheel_possibleConstructorReturn(this, _Component.call(this, props));
|
33401 | }
|
33402 |
|
33403 | LotteryWheel.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
|
33404 | if (JSON.stringify(prevProps.data) !== JSON.stringify(this.props.data)) {
|
33405 | this.instance.params.data = this.props.data;
|
33406 | this.instance.init();
|
33407 | }
|
33408 | };
|
33409 |
|
33410 | LotteryWheel.prototype.componentDidMount = function componentDidMount() {
|
33411 | if (this.instance) return;
|
33412 | var instance = new LotteryWheel_instance(this.$el, {
|
33413 |
|
33414 | spacing: this.props.spacing,
|
33415 |
|
33416 | data: this.props.data,
|
33417 |
|
33418 | font: this.props.font,
|
33419 | fontTop: this.props.fontTop,
|
33420 | fontFillStyle: this.props.fontFillStyle,
|
33421 |
|
33422 | bgFillStyle: this.props.bgFillStyle,
|
33423 | bgStrokeStyle: this.props.bgStrokeStyle,
|
33424 | bgLineWidth: this.props.bgLineWidth,
|
33425 |
|
33426 | iconWidth: this.props.iconWidth,
|
33427 | iconHeight: this.props.iconHeight,
|
33428 | iconTop: this.props.iconTop,
|
33429 |
|
33430 | around: this.props.around,
|
33431 |
|
33432 | suffix: this.props.suffix,
|
33433 | quality: this.props.quality
|
33434 | });
|
33435 | this.instance = instance;
|
33436 | };
|
33437 |
|
33438 | LotteryWheel.prototype.render = function render() {
|
33439 | var _this2 = this;
|
33440 |
|
33441 | var _props = this.props,
|
33442 | width = _props.width,
|
33443 | height = _props.height,
|
33444 | className = _props.className,
|
33445 | style = _props.style;
|
33446 |
|
33447 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
33448 | 'canvas',
|
33449 | { ref: function ref(el) {
|
33450 | _this2.$el = el;
|
33451 | }, width: width, height: height, className: className, style: style },
|
33452 | 'Canvas\u62BD\u5956\u8F6E\u76D8'
|
33453 | );
|
33454 | };
|
33455 |
|
33456 | return LotteryWheel;
|
33457 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), LotteryWheel_class.propTypes = {
|
33458 |
|
33459 | data: prop_types_default.a.array,
|
33460 |
|
33461 | fontFamily: prop_types_default.a.string,
|
33462 | fontSize: prop_types_default.a.number,
|
33463 | fontTop: prop_types_default.a.number,
|
33464 | fontFillStyle: prop_types_default.a.string,
|
33465 |
|
33466 | bgFillStyle: prop_types_default.a.string,
|
33467 | bgStrokeStyle: prop_types_default.a.string,
|
33468 | bgLineWidth: prop_types_default.a.number,
|
33469 |
|
33470 | iconWidth: prop_types_default.a.number,
|
33471 | iconHeight: prop_types_default.a.number,
|
33472 | iconTop: prop_types_default.a.number,
|
33473 |
|
33474 | around: prop_types_default.a.number,
|
33475 |
|
33476 | width: prop_types_default.a.number,
|
33477 | height: prop_types_default.a.number,
|
33478 | style: prop_types_default.a.object,
|
33479 | className: prop_types_default.a.string,
|
33480 |
|
33481 | spacing: prop_types_default.a.number,
|
33482 |
|
33483 | suffix: prop_types_default.a.string,
|
33484 | quality: prop_types_default.a.number
|
33485 | }, LotteryWheel_class.defaultProps = {}, LotteryWheel_temp);
|
33486 |
|
33487 |
|
33488 |
|
33489 |
|
33490 | var src_LotteryWheel = (LotteryWheel_LotteryWheel);
|
33491 |
|
33492 | var BaiduMap_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; };
|
33493 |
|
33494 |
|
33495 | var BaiduMap = function BaiduMap(id, params) {
|
33496 | if (!window._seeds_lang) window._seeds_lang = {};
|
33497 | if (!document.querySelector('#' + id)) {
|
33498 | console.log('SeedsUI Error:未找到BaiduMap的DOM对象,请检查id是否存在');
|
33499 | return;
|
33500 | }
|
33501 | |
33502 |
|
33503 |
|
33504 | var defaults = {
|
33505 | styleOptions: {
|
33506 | strokeColor: '#0C8EFF',
|
33507 | strokeWeight: 1,
|
33508 | strokeOpacity: 0.8,
|
33509 | strokeStyle: 'solid',
|
33510 | fillColor: '#0C8EFF',
|
33511 | fillOpacity: 0.6
|
33512 | },
|
33513 | labelStyleOptions: {
|
33514 | color: 'red',
|
33515 | fontSize: '12px',
|
33516 | height: '20px',
|
33517 | lineHeight: '20px',
|
33518 | fontFamily: '微软雅黑'
|
33519 | |
33520 |
|
33521 |
|
33522 | } };
|
33523 | params = params || {};
|
33524 | for (var def in defaults) {
|
33525 | if (params[def] === undefined) {
|
33526 | params[def] = defaults[def];
|
33527 | }
|
33528 | }
|
33529 |
|
33530 |
|
33531 | var s = this;
|
33532 |
|
33533 |
|
33534 | s.params = params;
|
33535 |
|
33536 | s.map = null;
|
33537 | s.drawingManager = null;
|
33538 | var _window = window,
|
33539 | BMap = _window.BMap,
|
33540 | BMapLib = _window.BMapLib,
|
33541 | BMAP_ANCHOR_BOTTOM_LEFT = _window.BMAP_ANCHOR_BOTTOM_LEFT,
|
33542 | BMAP_ANCHOR_BOTTOM_RIGHT = _window.BMAP_ANCHOR_BOTTOM_RIGHT,
|
33543 | BMAP_ANCHOR_TOP_RIGHT = _window.BMAP_ANCHOR_TOP_RIGHT,
|
33544 | BMAP_DRAWING_POLYGON = _window.BMAP_DRAWING_POLYGON,
|
33545 | BMAP_NAVIGATION_CONTROL_ZOOM = _window.BMAP_NAVIGATION_CONTROL_ZOOM;
|
33546 |
|
33547 |
|
33548 |
|
33549 | s.createMap = function () {
|
33550 | s.map = new BMap.Map('map');
|
33551 | s.map.centerAndZoom(new BMap.Point(116.404, 39.915), 12);
|
33552 | s.map.setCurrentCity('北京');
|
33553 | s.map.enableScrollWheelZoom(true);
|
33554 | };
|
33555 | s.createMap();
|
33556 |
|
33557 |
|
33558 | s.createDrawingManager = function () {
|
33559 | s.drawingManager = new BMapLib.DrawingManager(s.map, {
|
33560 | isOpen: false,
|
33561 | drawingToolOptions: {
|
33562 | anchor: BMAP_ANCHOR_TOP_RIGHT,
|
33563 | offset: new BMap.Size(5, 5)
|
33564 | },
|
33565 | circleOptions: s.params.styleOptions,
|
33566 | polylineOptions: s.params.styleOptions,
|
33567 | polygonOptions: s.params.styleOptions,
|
33568 | rectangleOptions: s.params.styleOptions
|
33569 | });
|
33570 | };
|
33571 | s.createDrawingManager();
|
33572 |
|
33573 | |
33574 |
|
33575 |
|
33576 |
|
33577 | |
33578 |
|
33579 |
|
33580 |
|
33581 | s.formatPoints = function (points) {
|
33582 | if (!points || !Array.isArray(points)) return [];
|
33583 | if (JSON.stringify(points).indexOf('lng') !== -1) return points;
|
33584 | if (!Array.isArray(points[0]) || !points[0][0] || !points[0][1]) return [];
|
33585 | return points.map(function (point) {
|
33586 | var lng = point[0];
|
33587 | var lat = point[1];
|
33588 | if (point[0] < point[1]) {
|
33589 | lng = point[1];
|
33590 | lat = point[0];
|
33591 | }
|
33592 | return {
|
33593 | lng: lng, lat: lat
|
33594 | };
|
33595 | });
|
33596 | };
|
33597 |
|
33598 | s.showScale = function () {
|
33599 | s.map.addControl(new BMap.ScaleControl({ anchor: BMAP_ANCHOR_BOTTOM_LEFT }));
|
33600 | };
|
33601 |
|
33602 | s.showNavigation = function () {
|
33603 | s.map.addControl(new BMap.NavigationControl({ anchor: BMAP_ANCHOR_BOTTOM_RIGHT, type: BMAP_NAVIGATION_CONTROL_ZOOM }));
|
33604 | };
|
33605 |
|
33606 |
|
33607 |
|
33608 |
|
33609 |
|
33610 |
|
33611 |
|
33612 |
|
33613 |
|
33614 |
|
33615 |
|
33616 |
|
33617 |
|
33618 | s.enableManualDraw = function (type) {
|
33619 | if (s.drawingManager) {
|
33620 | s.drawingManager.open();
|
33621 | s.drawingManager.setDrawingMode(type || BMAP_DRAWING_POLYGON);
|
33622 | }
|
33623 | };
|
33624 |
|
33625 | s.autoViewport = function () {
|
33626 | var overlays = s.map.getOverlays();
|
33627 | var points = [];
|
33628 | for (var i = 0; i < overlays.length; i++) {
|
33629 | var overlay = overlays[i];
|
33630 | if (overlay instanceof BMap.Polygon) {
|
33631 | points = points.concat(overlay.getPath());
|
33632 | }
|
33633 | }
|
33634 | s.map.setViewport(points);
|
33635 | };
|
33636 |
|
33637 | s.pointsToPolygon = function (argPoints) {
|
33638 | var points = s.formatPoints(argPoints);
|
33639 | var ps = [];
|
33640 | for (var _iterator = points, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
|
33641 | var _ref;
|
33642 |
|
33643 | if (_isArray) {
|
33644 | if (_i >= _iterator.length) break;
|
33645 | _ref = _iterator[_i++];
|
33646 | } else {
|
33647 | _i = _iterator.next();
|
33648 | if (_i.done) break;
|
33649 | _ref = _i.value;
|
33650 | }
|
33651 |
|
33652 | var point = _ref;
|
33653 |
|
33654 | ps.push(new BMap.Point(point.lng, point.lat));
|
33655 | }
|
33656 | return new BMap.Polygon(ps);
|
33657 | };
|
33658 |
|
33659 | s.pointsToPolygons = function (argPointss) {
|
33660 | var polygons = [];
|
33661 | for (var i = 0; i < argPointss.length; i++) {
|
33662 | var polygon = s.pointsToPolygon(argPointss[i]);
|
33663 | polygons.push(polygon);
|
33664 | }
|
33665 | return polygons;
|
33666 | };
|
33667 |
|
33668 | s.drawBoundary = function () {
|
33669 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
33670 |
|
33671 | var boundary = new BMap.Boundary();
|
33672 | if (!options.area) {
|
33673 | console.warn((window._seeds_lang['hint_pass_in_parameters'] || '请传入参数') + 'area, ' + (window._seeds_lang['hint_for_example_address'] || '例如“江苏省南京市建邺区”'));
|
33674 | options.onError && options.onError({
|
33675 | errMsg: (window._seeds_lang['hint_pass_in_parameters'] || '请传入参数') + 'area, ' + (window._seeds_lang['hint_for_example_address'] || '例如“江苏省南京市建邺区”')
|
33676 | });
|
33677 | return;
|
33678 | }
|
33679 | boundary.get(options.area, function (res) {
|
33680 |
|
33681 | var count = res.boundaries.length;
|
33682 | if (count === 0) {
|
33683 | console.warn((window._seeds_lang['hint_pass_in_correct_parameters'] || '请传入正确的参数') + 'area');
|
33684 | options.onError && options.onError({
|
33685 | errMsg: (window._seeds_lang['hint_pass_in_correct_parameters'] || '请传入正确的参数') + 'area'
|
33686 | });
|
33687 | return;
|
33688 | }
|
33689 | var polygons = [];
|
33690 | var polygonsPath = [];
|
33691 | for (var i = 0; i < count; i++) {
|
33692 | polygons[i] = new BMap.Polygon(res.boundaries[i], options.styleOptions || s.params.styleOptions);
|
33693 | s.map.addOverlay(polygons[i]);
|
33694 | polygonsPath = polygonsPath.concat(polygons[i].getPath());
|
33695 | }
|
33696 |
|
33697 | options.onSuccess && options.onSuccess(BaiduMap_extends({}, res, { polygons: polygons, polygonsPath: polygonsPath }));
|
33698 | });
|
33699 | return boundary;
|
33700 | };
|
33701 |
|
33702 | s.drawPolygon = function () {
|
33703 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
33704 |
|
33705 | var polygon = null;
|
33706 | if (options.polygon && Object.keys(options.polygon) && Object.keys(options.polygon).length) {
|
33707 | polygon = options.polygon;
|
33708 | if (!options.styleOptions) options.styleOptions = {};
|
33709 |
|
33710 | polygon.setStrokeColor(options.styleOptions.strokeColor || s.params.styleOptions.strokeColor);
|
33711 |
|
33712 | polygon.setStrokeWeight(options.styleOptions.strokeWeight || s.params.styleOptions.strokeWeight);
|
33713 |
|
33714 | polygon.setStrokeOpacity(options.styleOptions.strokeOpacity || s.params.styleOptions.strokeOpacity);
|
33715 |
|
33716 | polygon.setStrokeStyle(options.styleOptions.strokeStyle || s.params.styleOptions.strokeStyle);
|
33717 |
|
33718 | polygon.setFillColor(options.styleOptions.fillColor || s.params.styleOptions.fillColor);
|
33719 |
|
33720 | polygon.setFillOpacity(options.styleOptions.fillOpacity || s.params.styleOptions.fillOpacity);
|
33721 | } else if (Array.isArray(options.points) && options.points.length) {
|
33722 | polygon = new BMap.Polygon(s.formatPoints(options.points), options.styleOptions || s.params.styleOptions);
|
33723 | }
|
33724 | if (polygon) {
|
33725 | s.map.addOverlay(polygon);
|
33726 | options.onSuccess && options.onSuccess(polygon);
|
33727 | } else {
|
33728 | console.warn('drawPolygon: ' + (window._seeds_lang['hint_pass_in_parameters'] || '请传入参数') + '{polygon: {}}' + (window._seeds_lang['or'] || '或者') + '{points: []}');
|
33729 | options.onError && options.onError({
|
33730 | errMsg: 'drawPolygon: ' + (window._seeds_lang['hint_pass_in_parameters'] || '请传入参数') + '{polygon: {}}' + (window._seeds_lang['or'] || '或者') + '{points: []}'
|
33731 | });
|
33732 | }
|
33733 | return polygon;
|
33734 | };
|
33735 |
|
33736 | s.drawPolygons = function () {
|
33737 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
33738 |
|
33739 | var polygons = [];
|
33740 | for (var _iterator2 = options, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
|
33741 | var _ref2;
|
33742 |
|
33743 | if (_isArray2) {
|
33744 | if (_i2 >= _iterator2.length) break;
|
33745 | _ref2 = _iterator2[_i2++];
|
33746 | } else {
|
33747 | _i2 = _iterator2.next();
|
33748 | if (_i2.done) break;
|
33749 | _ref2 = _i2.value;
|
33750 | }
|
33751 |
|
33752 | var option = _ref2;
|
33753 |
|
33754 | polygons.push(s.drawPolygon(option));
|
33755 | }
|
33756 | return polygons;
|
33757 | };
|
33758 |
|
33759 | s.drawLabel = function () {
|
33760 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
33761 |
|
33762 | if (!options.point) {
|
33763 | console.warn('drawLabel: ' + (window._seeds_lang['hint_pass_in_parameters'] || '请传入参数') + '{point: }');
|
33764 | options.onError && options.onError({
|
33765 | errMsg: 'drawLabel: ' + (window._seeds_lang['hint_pass_in_parameters'] || '请传入参数') + '{point: }'
|
33766 | });
|
33767 | return;
|
33768 | }
|
33769 | var opts = {
|
33770 | position: options.point,
|
33771 | offset: new BMap.Size(0, 0)
|
33772 | };
|
33773 | var label = new BMap.Label(JSON.stringify(options.point), opts);
|
33774 | label.setStyle(options.styleOptions || s.params.labelStyleOptions);
|
33775 | s.map.addOverlay(label);
|
33776 | options.onSuccess && options.onSuccess(label);
|
33777 | return label;
|
33778 | };
|
33779 |
|
33780 | s.drawMarker = function () {
|
33781 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
33782 |
|
33783 | if (!options.point) {
|
33784 | console.warn('drawMarker: ' + (window._seeds_lang['hint_pass_in_parameters'] || '请传入参数') + '{point: }');
|
33785 | options.onError && options.onError({
|
33786 | errMsg: 'drawMarker: ' + (window._seeds_lang['hint_pass_in_parameters'] || '请传入参数') + '{point: }'
|
33787 | });
|
33788 | return;
|
33789 | }
|
33790 | if (!options.point.lng || !options.point.lat) {
|
33791 | console.warn('drawMarker: ' + (window._seeds_lang['hint_pass_in_correct_parameters'] || '请传入正确的参数') + '{point: {lng: ,lat: }}');
|
33792 | options.onError && options.onError({
|
33793 | errMsg: 'drawMarker: ' + (window._seeds_lang['hint_pass_in_correct_parameters'] || '请传入正确的参数') + '{point: {lng: ,lat: }}'
|
33794 | });
|
33795 | return;
|
33796 | }
|
33797 | var point = new BMap.Point(options.point.lng, options.point.lat);
|
33798 | var marker = new BMap.Marker(point, {
|
33799 | icon: new BMap.Icon(options.icon || 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAwCAMAAABHcohdAAAAOVBMVEUAAAAMjv8Njv8NkP8Nj/8MkP8Nkf8gn/8Nj/8Njv8Mj/8Mj/8Mjv+ZmZn////n8/+Nyv8hj+8vkeUvlTkDAAAADHRSTlMA5oyFdlM8CPPZv6h2+xS8AAAAs0lEQVQ4y+2TWw6EIAxFaQUEvDOo+1/sIFEjKDSZb89vD7TpQ12wHLxzPrBVD4yacEJ6rOOGUECmjA+4MVzjEx6YqvedPwwSc4xzbZi9ftri30Rt0JgFjUTchIgKnQVqC5T7BxQpCraeMnAWeYOTENAhJMH3BJ8E1xOcLMgp5CK5J3BuVAe7t7oF7cNqoo9xN6DxWJgGRlo5aWmltZcORz69O5bXBVhWtqrFJ6PUK7zCv8IP6rMmSWrDD8kAAAAASUVORK5CYII=', new BMap.Size(16, 24), {
|
33800 | imageSize: new BMap.Size(16, 24)
|
33801 | })
|
33802 | }, {
|
33803 | offset: new BMap.Size(8, 12)
|
33804 | });
|
33805 | s.map.addOverlay(marker);
|
33806 | options.onSuccess && options.onSuccess(marker);
|
33807 | return marker;
|
33808 | };
|
33809 |
|
33810 | s.addContextMenu = function (overlay) {
|
33811 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
33812 |
|
33813 | if (!overlay) {
|
33814 | console.warn('addContextMenu: ' + (window._seeds_lang['hint_pass_in_parameters'] || '请传入参数') + 'overlay');
|
33815 | options.onError && options.onError({
|
33816 | errMsg: 'addContextMenu: ' + (window._seeds_lang['hint_pass_in_parameters'] || '请传入参数') + 'overlay'
|
33817 | });
|
33818 | return;
|
33819 | }
|
33820 | if (!options.menus || !Array.isArray(options.menus) || !options.menus[0] || !options.menus[0].text) {
|
33821 | console.warn('addContextMenu: ' + (window._seeds_lang['hint_pass_in_parameters'] || '请传入参数') + '{menus: [{text: "", handler: func()}]}');
|
33822 | options.onError && options.onError({
|
33823 | errMsg: 'addContextMenu: ' + (window._seeds_lang['hint_pass_in_parameters'] || '请传入参数') + '{menus: [{text: "", handler: func()}]}'
|
33824 | });
|
33825 | return;
|
33826 | }
|
33827 | var markerMenu = new BMap.ContextMenu();
|
33828 |
|
33829 | var _loop = function _loop(index, opt) {
|
33830 | markerMenu.addItem(new BMap.MenuItem(opt.text || window._seeds_lang['menu'] || '菜单', function () {
|
33831 | opt.handler(opt, index);
|
33832 | }));
|
33833 | };
|
33834 |
|
33835 | for (var _iterator3 = options.menus.entries(), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
|
33836 | var _ref4;
|
33837 |
|
33838 | if (_isArray3) {
|
33839 | if (_i3 >= _iterator3.length) break;
|
33840 | _ref4 = _iterator3[_i3++];
|
33841 | } else {
|
33842 | _i3 = _iterator3.next();
|
33843 | if (_i3.done) break;
|
33844 | _ref4 = _i3.value;
|
33845 | }
|
33846 |
|
33847 | var _ref3 = _ref4;
|
33848 | var index = _ref3[0];
|
33849 | var opt = _ref3[1];
|
33850 |
|
33851 | _loop(index, opt);
|
33852 | }
|
33853 | overlay.addContextMenu(markerMenu);
|
33854 | return markerMenu;
|
33855 | };
|
33856 | };
|
33857 |
|
33858 | var MapUtil_BaiduMap = (BaiduMap);
|
33859 |
|
33860 |
|
33861 |
|
33862 | var MapUtil = MapUtil_BaiduMap;
|
33863 |
|
33864 | var src_MapUtil = (MapUtil);
|
33865 |
|
33866 | var Mark_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; };
|
33867 |
|
33868 | var Mark_class, Mark_temp;
|
33869 |
|
33870 | function Mark_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
33871 |
|
33872 | function Mark_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
33873 |
|
33874 | function Mark_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
33875 |
|
33876 | function Mark_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
33877 |
|
33878 |
|
33879 |
|
33880 |
|
33881 | var Mark_Mark = (Mark_temp = Mark_class = function (_Component) {
|
33882 | Mark_inherits(Mark, _Component);
|
33883 |
|
33884 | function Mark(props) {
|
33885 | Mark_classCallCheck(this, Mark);
|
33886 |
|
33887 | return Mark_possibleConstructorReturn(this, _Component.call(this, props));
|
33888 | }
|
33889 |
|
33890 | Mark.prototype.render = function render() {
|
33891 | var _this2 = this;
|
33892 |
|
33893 | var _props = this.props,
|
33894 | className = _props.className,
|
33895 | children = _props.children,
|
33896 | others = Mark_objectWithoutProperties(_props, ['className', 'children']);
|
33897 |
|
33898 | return children ? external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
33899 | 'span',
|
33900 | Mark_extends({ ref: function ref(el) {
|
33901 | _this2.$el = el;
|
33902 | }, className: 'mark' + (className ? ' ' + className : '') }, others),
|
33903 | children
|
33904 | ) : null;
|
33905 | };
|
33906 |
|
33907 | return Mark;
|
33908 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Mark_class.propTypes = {
|
33909 | className: prop_types_default.a.string,
|
33910 | children: prop_types_default.a.node
|
33911 | }, Mark_class.defaultProps = {
|
33912 | className: 'info'
|
33913 | }, Mark_temp);
|
33914 |
|
33915 |
|
33916 |
|
33917 |
|
33918 | var src_Mark = (Mark_Mark);
|
33919 |
|
33920 |
|
33921 | var instance_Marquee = function Marquee(container, params) {
|
33922 | |
33923 |
|
33924 |
|
33925 | var defaults = {
|
33926 | start: 0,
|
33927 | end: 300,
|
33928 | step: 50,
|
33929 | duration: 300,
|
33930 | delay: 2000,
|
33931 | direction: 'top',
|
33932 | loop: false,
|
33933 | duplicateClass: 'duplicate'
|
33934 | |
33935 |
|
33936 |
|
33937 |
|
33938 |
|
33939 | };
|
33940 | params = params || {};
|
33941 | for (var def in defaults) {
|
33942 | if (params[def] === undefined) {
|
33943 | params[def] = defaults[def];
|
33944 | }
|
33945 | }
|
33946 | var s = this;
|
33947 | s.params = params;
|
33948 |
|
33949 | s.container = typeof container === 'string' ? document.querySelector(container) : container;
|
33950 |
|
33951 | s.interval = null;
|
33952 |
|
33953 | s.updateLoop = function () {
|
33954 | var dups = [].slice.call(s.container.querySelectorAll('.' + s.params.duplicateClass));
|
33955 | dups.forEach(function (item) {
|
33956 | s.container.removeChild(item);
|
33957 | });
|
33958 | if (s.params.loop) {
|
33959 | var beforeDupContainer = s.container.cloneNode(true);
|
33960 | var afterDupContainer = s.container.cloneNode(true);
|
33961 | beforeDupContainer.classList.add(s.params.duplicateClass);
|
33962 | afterDupContainer.classList.add(s.params.duplicateClass);
|
33963 | s.container.insertBefore(beforeDupContainer, s.container.firstElementChild);
|
33964 | s.container.appendChild(afterDupContainer);
|
33965 | }
|
33966 | };
|
33967 |
|
33968 | s.setStart = function (start) {
|
33969 | s.params.start = start;
|
33970 | };
|
33971 |
|
33972 | s.setEnd = function (end) {
|
33973 | s.params.end = end;
|
33974 | };
|
33975 | |
33976 |
|
33977 |
|
33978 |
|
33979 | s.setDuration = function (duration) {
|
33980 | s.container.style.webkitTransitionDuration = duration + 'ms';
|
33981 | };
|
33982 |
|
33983 | s.setPosition = function (pos) {
|
33984 | switch (s.params.direction) {
|
33985 | case 'top':
|
33986 | s.container.style.webkitTransform = 'translate(0px, ' + pos + 'px)';
|
33987 | break;
|
33988 | default:
|
33989 | s.container.style.webkitTransform = 'translate(0px, ' + pos + 'px)';
|
33990 | }
|
33991 | };
|
33992 |
|
33993 | s.start = 0;
|
33994 | s.end = 0;
|
33995 | s.move = 0;
|
33996 | s.update = function () {
|
33997 | s.start = s.params.start;
|
33998 | s.end = s.params.end;
|
33999 | var range = s.params.end - s.params.start;
|
34000 | if (s.params.loop) {
|
34001 | s.updateLoop();
|
34002 | s.start = s.params.end + s.params.step;
|
34003 | s.end = s.start + range;
|
34004 | }
|
34005 | s.setDuration(0);
|
34006 |
|
34007 | s.setPosition(-s.start);
|
34008 |
|
34009 | setTimeout(function () {
|
34010 | s.setDuration(s.params.duration);
|
34011 | }, 10);
|
34012 |
|
34013 | s.move = s.start;
|
34014 |
|
34015 | if (s.interval) window.clearInterval(s.interval);
|
34016 | };
|
34017 | s.update();
|
34018 |
|
34019 | s.play = function () {
|
34020 | if (s.interval) window.clearInterval(s.interval);
|
34021 | s.interval = window.setInterval(function () {
|
34022 | s.move += s.params.step;
|
34023 | if (s.params.loop) {
|
34024 | if (s.move >= s.end + s.params.step) {
|
34025 |
|
34026 | var initPos = s.start - s.params.step;
|
34027 | s.setDuration(0);
|
34028 | s.setPosition(-initPos);
|
34029 |
|
34030 | s.move = initPos + s.params.step;
|
34031 | setTimeout(function () {
|
34032 | s.setDuration(s.params.duration);
|
34033 | s.setPosition(-s.move);
|
34034 | }, 10);
|
34035 | } else {
|
34036 | s.setPosition(-s.move);
|
34037 | }
|
34038 | } else {
|
34039 | s.setPosition(-s.move);
|
34040 | if (s.move >= s.end) {
|
34041 | window.clearInterval(s.interval);
|
34042 | }
|
34043 | }
|
34044 | }, s.params.delay);
|
34045 | };
|
34046 | s.pause = function () {
|
34047 | window.clearInterval(s.interval);
|
34048 | };
|
34049 | };
|
34050 |
|
34051 | var Marquee_instance = (instance_Marquee);
|
34052 |
|
34053 | var Marquee_class, Marquee_temp;
|
34054 |
|
34055 | function Marquee_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
34056 |
|
34057 | function Marquee_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
34058 |
|
34059 | function Marquee_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
34060 |
|
34061 |
|
34062 |
|
34063 |
|
34064 |
|
34065 | var Marquee_Marquee = (Marquee_temp = Marquee_class = function (_Component) {
|
34066 | Marquee_inherits(Marquee, _Component);
|
34067 |
|
34068 | function Marquee(props) {
|
34069 | Marquee_classCallCheck(this, Marquee);
|
34070 |
|
34071 | var _this = Marquee_possibleConstructorReturn(this, _Component.call(this, props));
|
34072 |
|
34073 | _this.componentDidUpdate = function (prevProps) {
|
34074 | if (!_this.props.list.equals(prevProps.list)) {
|
34075 | _this.update();
|
34076 | }
|
34077 | };
|
34078 |
|
34079 | _this.componentDidMount = function () {
|
34080 | if (_this.instance || _this.props.list.length === 0) return;
|
34081 | _this.init();
|
34082 | };
|
34083 |
|
34084 | _this.update = function () {
|
34085 | _this.instance.setStart(0);
|
34086 | _this.instance.setEnd(_this.props.step * (_this.props.list.length - 1));
|
34087 | _this.instance.update();
|
34088 | _this.instance.play();
|
34089 | };
|
34090 |
|
34091 | _this.init = function () {
|
34092 | var _this$props = _this.props,
|
34093 | list = _this$props.list,
|
34094 | step = _this$props.step,
|
34095 | duration = _this$props.duration,
|
34096 | delay = _this$props.delay,
|
34097 | direction = _this$props.direction,
|
34098 | loop = _this$props.loop;
|
34099 |
|
34100 | var instance = new Marquee_instance(_this.$el, {
|
34101 | start: 0,
|
34102 | end: step * (list.length - 1),
|
34103 | step: step,
|
34104 | duration: duration,
|
34105 | delay: delay,
|
34106 | direction: direction,
|
34107 | loop: loop
|
34108 | });
|
34109 | instance.play();
|
34110 | _this.instance = instance;
|
34111 | };
|
34112 |
|
34113 | _this.onClick = function (item, index) {
|
34114 | if (_this.props.onClick) _this.props.onClick(item, index);
|
34115 | };
|
34116 |
|
34117 | return _this;
|
34118 | }
|
34119 |
|
34120 | Marquee.prototype.render = function render() {
|
34121 | var _this2 = this;
|
34122 |
|
34123 | var _props = this.props,
|
34124 | className = _props.className,
|
34125 | style = _props.style,
|
34126 | list = _props.list,
|
34127 | contentClassName = _props.contentClassName,
|
34128 | contentStyle = _props.contentStyle,
|
34129 | step = _props.step;
|
34130 |
|
34131 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
34132 | 'ul',
|
34133 | { ref: function ref(el) {
|
34134 | _this2.$el = el;
|
34135 | }, className: 'marquee' + (className ? ' ' + className : ''), style: style },
|
34136 | list && list.map(function (item, index) {
|
34137 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
34138 | 'li',
|
34139 | { className: 'marquee-li' + (contentClassName ? ' ' + contentClassName : ''), style: Object.assign({ height: step + 'px' }, contentStyle), key: index, onClick: function onClick() {
|
34140 | _this2.onClick(item, index);
|
34141 | } },
|
34142 | item.value
|
34143 | );
|
34144 | })
|
34145 | );
|
34146 | };
|
34147 |
|
34148 | return Marquee;
|
34149 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Marquee_class.propTypes = {
|
34150 | style: prop_types_default.a.object,
|
34151 | className: prop_types_default.a.string,
|
34152 | list: prop_types_default.a.array,
|
34153 |
|
34154 | contentStyle: prop_types_default.a.object,
|
34155 | contentClassName: prop_types_default.a.string,
|
34156 |
|
34157 | step: prop_types_default.a.number,
|
34158 | duration: prop_types_default.a.number,
|
34159 | delay: prop_types_default.a.number,
|
34160 | direction: prop_types_default.a.string,
|
34161 | loop: prop_types_default.a.bool,
|
34162 | onClick: prop_types_default.a.func
|
34163 | }, Marquee_class.defaultProps = {
|
34164 | step: 50,
|
34165 | duration: 300,
|
34166 | delay: 2000,
|
34167 | direction: 'top',
|
34168 | loop: true
|
34169 | }, Marquee_temp);
|
34170 |
|
34171 |
|
34172 |
|
34173 |
|
34174 | var src_Marquee = (Marquee_Marquee);
|
34175 |
|
34176 |
|
34177 | var instance_MenuTree = function MenuTree(container, params) {
|
34178 | |
34179 |
|
34180 |
|
34181 | var defaults = {
|
34182 |
|
34183 | data: null,
|
34184 | tagClass: 'menutree-tag',
|
34185 | activeClass: 'active',
|
34186 | extendClass: 'extend',
|
34187 |
|
34188 | selectedId: ''
|
34189 |
|
34190 | |
34191 |
|
34192 |
|
34193 |
|
34194 |
|
34195 | |
34196 |
|
34197 |
|
34198 |
|
34199 |
|
34200 |
|
34201 | };params = params || {};
|
34202 | for (var def in defaults) {
|
34203 | if (params[def] === undefined) {
|
34204 | params[def] = defaults[def];
|
34205 | }
|
34206 | }
|
34207 |
|
34208 | var s = this;
|
34209 |
|
34210 |
|
34211 | s.params = params;
|
34212 |
|
34213 | s.container = typeof container === 'string' ? document.querySelector(container) : container;
|
34214 | if (!s.container) {
|
34215 | console.log('SeedsUI Error:未找到MenuTree的DOM对象,请检查传入参数是否正确');
|
34216 | return;
|
34217 | }
|
34218 | s.initData = function (list, ulContainer) {
|
34219 | for (var i = 0, option; option = list[i++];) {
|
34220 |
|
34221 | var li = document.createElement('li');
|
34222 | var html = '<div data-index="' + i + '" data-id="' + option.id + '" class="' + s.params.tagClass + (option.id === s.params.selectedId ? ' active' : '') + '">' + '<p class="menutree-tag-font">' + option.name + '</p>' + (option.children && option.children.length > 0 ? '<i class="menutree-more"></i>' : '') + '</div>';
|
34223 | li.innerHTML = html;
|
34224 | ulContainer.appendChild(li);
|
34225 | if (option.children && option.children.length > 0) {
|
34226 | var ul = document.createElement('ul');
|
34227 | li.appendChild(ul);
|
34228 | s.initData(option.children, ul);
|
34229 | }
|
34230 | }
|
34231 | };
|
34232 | s.container.innerHTML = '';
|
34233 |
|
34234 | |
34235 |
|
34236 |
|
34237 |
|
34238 | s.setSelectedId = function (id) {
|
34239 | s.params.selectedId = id;
|
34240 | };
|
34241 |
|
34242 | s.setData = function (data) {
|
34243 | s.params.data = data;
|
34244 | s.container.innerHTML = '';
|
34245 | if (!data || !data.length) {
|
34246 | return;
|
34247 | }
|
34248 |
|
34249 | s.initData(data, s.container);
|
34250 | s.updateActive();
|
34251 | };
|
34252 |
|
34253 | s.addData = function (data, childNode) {
|
34254 | s.initData(data, childNode);
|
34255 | };
|
34256 |
|
34257 | s.updateActive = function () {
|
34258 | var actives = s.container.querySelectorAll('.' + s.params.activeClass);
|
34259 | if (actives.length === 1 && actives[0].parentNode && actives[0].parentNode.parentNode && actives[0].parentNode.parentNode.previousElementSibling) {
|
34260 | var tag = actives[0].parentNode.parentNode.previousElementSibling;
|
34261 | s.setActive(tag);
|
34262 | }
|
34263 | };
|
34264 | s.setActive = function (target) {
|
34265 | target.classList.add(s.params.activeClass);
|
34266 | target.classList.add(s.params.extendClass);
|
34267 | if (target.parentNode && target.parentNode.parentNode && target.parentNode.parentNode.previousElementSibling) {
|
34268 | var tag = target.parentNode.parentNode.previousElementSibling;
|
34269 | s.setActive(tag);
|
34270 | }
|
34271 | };
|
34272 |
|
34273 | |
34274 |
|
34275 |
|
34276 |
|
34277 | s.isSupportTouch = 'ontouchstart' in window;
|
34278 | s.events = function (detach) {
|
34279 | var action = detach ? 'removeEventListener' : 'addEventListener';
|
34280 |
|
34281 | if (s.isSupportTouch) {
|
34282 | s.container[action]('touchstart', s.onTouchStart, false);
|
34283 | s.container[action]('touchend', s.onTouchEnd, false);
|
34284 | } else {
|
34285 | s.container[action]('click', s.onClick, false);
|
34286 | }
|
34287 | };
|
34288 |
|
34289 | s.attach = function (event) {
|
34290 | s.events();
|
34291 | };
|
34292 | s.detach = function (event) {
|
34293 | s.events(true);
|
34294 | };
|
34295 | |
34296 |
|
34297 |
|
34298 |
|
34299 | s.touches = {
|
34300 | startX: 0,
|
34301 | startY: 0,
|
34302 | endX: 0,
|
34303 | endY: 0,
|
34304 | diffX: 0,
|
34305 | diffY: 0
|
34306 | };
|
34307 | s.onTouchStart = function (e) {
|
34308 | s.touches.startX = e.touches[0].clientX;
|
34309 | s.touches.startY = e.touches[0].clientY;
|
34310 | };
|
34311 | s.onTouchEnd = function (e) {
|
34312 | s.touches.endX = e.changedTouches[0].clientX;
|
34313 | s.touches.endY = e.changedTouches[0].clientY;
|
34314 | s.touches.diffX = s.touches.startX - s.touches.endX;
|
34315 | s.touches.diffY = s.touches.startY - s.touches.endY;
|
34316 |
|
34317 | if (Math.abs(s.touches.diffX) < 6 && Math.abs(s.touches.diffY) < 6) {
|
34318 | s.onClick(e);
|
34319 | }
|
34320 | };
|
34321 |
|
34322 | s.onClick = function (e) {
|
34323 | var target = e.target;
|
34324 | s.target = target;
|
34325 | s.targetLine = target;
|
34326 | if (!target.classList.contains(s.params.tagClass)) return;
|
34327 |
|
34328 | var isActived = target.classList.contains(s.params.activeClass);
|
34329 |
|
34330 | var isExtend = target.classList.contains(s.params.extendClass);
|
34331 |
|
34332 | var id = target.getAttribute('data-id');
|
34333 | var item = s.params.data.getDeepTreeNode(id);
|
34334 |
|
34335 | if (isExtend) {
|
34336 | target.classList.remove(s.params.extendClass);
|
34337 |
|
34338 |
|
34339 |
|
34340 |
|
34341 |
|
34342 |
|
34343 |
|
34344 |
|
34345 | } else {
|
34346 |
|
34347 | var container = target.parentNode.parentNode;
|
34348 | var actives = container.querySelectorAll('.' + s.params.activeClass);
|
34349 | for (var i = 0, tag; tag = actives[i++];) {
|
34350 |
|
34351 |
|
34352 | if (tag) {
|
34353 | tag.classList.remove(s.params.extendClass);
|
34354 | tag.classList.remove(s.params.activeClass);
|
34355 | }
|
34356 | }
|
34357 |
|
34358 | target.classList.add(s.params.extendClass);
|
34359 | target.classList.add(s.params.activeClass);
|
34360 | }
|
34361 |
|
34362 | if (s.params.onClick) s.params.onClick(s, item, isActived, isExtend);
|
34363 | };
|
34364 |
|
34365 | s.init = function () {
|
34366 | if (s.params.data && s.params.data.length) {
|
34367 | if (s.params.data && s.params.data.length) s.initData(s.params.data, s.container);
|
34368 | s.updateActive();
|
34369 | }
|
34370 | s.attach();
|
34371 | };
|
34372 | s.init();
|
34373 | };
|
34374 |
|
34375 | var MenuTree_instance = (instance_MenuTree);
|
34376 |
|
34377 | var MenuTree_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; };
|
34378 |
|
34379 | var MenuTree_class, MenuTree_temp;
|
34380 |
|
34381 | function MenuTree_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
34382 |
|
34383 | function MenuTree_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
34384 |
|
34385 | function MenuTree_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
34386 |
|
34387 | function MenuTree_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
34388 |
|
34389 |
|
34390 |
|
34391 |
|
34392 |
|
34393 |
|
34394 | var MenuTree_MenuTree = (MenuTree_temp = MenuTree_class = function (_Component) {
|
34395 | MenuTree_inherits(MenuTree, _Component);
|
34396 |
|
34397 | function MenuTree(props) {
|
34398 | MenuTree_classCallCheck(this, MenuTree);
|
34399 |
|
34400 | var _this = MenuTree_possibleConstructorReturn(this, _Component.call(this, props));
|
34401 |
|
34402 | _this.componentDidUpdate = function (prevProps) {
|
34403 | if (JSON.stringify(prevProps.list) !== JSON.stringify(_this.props.list)) {
|
34404 | if (_this.props.list && _this.props.list.length) {
|
34405 | _this.instance.setSelectedId(_this.props.selectedId);
|
34406 | var list = Object.clone(_this.props.list);
|
34407 | if (JSON.stringify(list).indexOf('"children"') === -1) {
|
34408 | list = list.deepTree();
|
34409 | }
|
34410 | _this.instance.setData(list);
|
34411 | } else {
|
34412 | _this.instance.setData([]);
|
34413 | }
|
34414 | }
|
34415 | };
|
34416 |
|
34417 | _this.componentDidMount = function () {
|
34418 | if (_this.instance) return;
|
34419 | var list = Object.clone(_this.props.list);
|
34420 | if (JSON.stringify(list).indexOf('"children"') === -1) {
|
34421 | list = list.deepTree();
|
34422 | }
|
34423 | var instance = new MenuTree_instance(_this.$el, {
|
34424 | data: list,
|
34425 | selectedId: _this.props.selectedId,
|
34426 | onClick: _this.onClick
|
34427 | });
|
34428 | _this.instance = instance;
|
34429 | };
|
34430 |
|
34431 | _this.onClick = function (s, item, isActived, isExtend) {
|
34432 |
|
34433 | var childrenCount = item.children && item.children.length ? item.children.length : 0;
|
34434 |
|
34435 | if (_this.props.onClick) _this.props.onClick(s, item, isActived, isExtend, childrenCount);
|
34436 | };
|
34437 |
|
34438 | return _this;
|
34439 | }
|
34440 | |
34441 |
|
34442 |
|
34443 |
|
34444 |
|
34445 |
|
34446 |
|
34447 |
|
34448 | MenuTree.prototype.render = function render() {
|
34449 | var _this2 = this;
|
34450 |
|
34451 | var _props = this.props,
|
34452 | className = _props.className,
|
34453 | selectedId = _props.selectedId,
|
34454 | onClick = _props.onClick,
|
34455 | list = _props.list,
|
34456 | others = MenuTree_objectWithoutProperties(_props, ['className', 'selectedId', 'onClick', 'list']);
|
34457 |
|
34458 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('ul', MenuTree_extends({ ref: function ref(el) {
|
34459 | _this2.$el = el;
|
34460 | }, className: 'menutree' + (className ? ' ' + className : '') }, others));
|
34461 | };
|
34462 |
|
34463 | return MenuTree;
|
34464 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), MenuTree_class.propTypes = {
|
34465 | className: prop_types_default.a.string,
|
34466 | selectedId: prop_types_default.a.string,
|
34467 | onClick: prop_types_default.a.func,
|
34468 |
|
34469 | list: prop_types_default.a.array }, MenuTree_class.defaultProps = {}, MenuTree_temp);
|
34470 |
|
34471 |
|
34472 |
|
34473 |
|
34474 | var src_MenuTree = (MenuTree_MenuTree);
|
34475 |
|
34476 | var NumBox_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; };
|
34477 |
|
34478 | var NumBox_class, NumBox_temp;
|
34479 |
|
34480 | function NumBox_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
34481 |
|
34482 | function NumBox_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
34483 |
|
34484 | function NumBox_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
34485 |
|
34486 | function NumBox_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
34487 |
|
34488 |
|
34489 |
|
34490 |
|
34491 |
|
34492 | var NumBox_NumBox = (NumBox_temp = NumBox_class = function (_Component) {
|
34493 | NumBox_inherits(NumBox, _Component);
|
34494 |
|
34495 | function NumBox(props) {
|
34496 | NumBox_classCallCheck(this, NumBox);
|
34497 |
|
34498 | var _this = NumBox_possibleConstructorReturn(this, _Component.call(this, props));
|
34499 |
|
34500 | _this.onBlur = function (e) {
|
34501 | var _this$props = _this.props,
|
34502 | readOnly = _this$props.readOnly,
|
34503 | disabled = _this$props.disabled,
|
34504 | required = _this$props.required,
|
34505 | min = _this$props.min,
|
34506 | onChange = _this$props.onChange,
|
34507 | onBlur = _this$props.onBlur;
|
34508 |
|
34509 | if (readOnly || disabled) {
|
34510 | return;
|
34511 | }
|
34512 |
|
34513 | var value = Math.Calc.correctNumber(_this.props.value, { required: required, min: min });
|
34514 | if (onChange && '' + value !== '' + _this.props.value) onChange(value, Object.getArgs(e, _this.props.args));
|
34515 | if (onBlur) onBlur(value, Object.getArgs(e, _this.props.args));
|
34516 | };
|
34517 |
|
34518 | _this.onFocus = function (e) {
|
34519 | var _this$props2 = _this.props,
|
34520 | readOnly = _this$props2.readOnly,
|
34521 | disabled = _this$props2.disabled,
|
34522 | onFocus = _this$props2.onFocus;
|
34523 |
|
34524 | if (readOnly || disabled) {
|
34525 | e.target.blur();
|
34526 | return;
|
34527 | }
|
34528 | if (onFocus) onFocus(_this.props.value, Object.getArgs(e, _this.props.args));
|
34529 | };
|
34530 |
|
34531 | _this.autoFocus = function () {
|
34532 | if (_this.props.disabled || _this.props.readOnly || !_this.$input) return;
|
34533 | _this.$input.focus();
|
34534 | if (_this.props.autoSelect) _this.$input.select();
|
34535 |
|
34536 | var iosExp = navigator.userAgent.toLowerCase().match(/cpu iphone os (.*?) like mac os/);
|
34537 | if (iosExp && iosExp[1] && iosExp[1] > '12') {
|
34538 |
|
34539 | if (window.inputToggleTimeout) {
|
34540 | window.clearTimeout(window.inputToggleTimeout);
|
34541 | }
|
34542 | if (!_this.$input.getAttribute('ios-bug-blur')) {
|
34543 | _this.$input.setAttribute('ios-bug-blur', '1');
|
34544 | _this.$input.addEventListener('blur', function () {
|
34545 | window.inputToggleTimeout = window.setTimeout(function () {
|
34546 | document.getElementById('root').scrollIntoView();
|
34547 | }, 100);
|
34548 | }, false);
|
34549 | }
|
34550 | }
|
34551 | };
|
34552 |
|
34553 | _this.onClickInput = function (e) {
|
34554 | var value = e.target.value;
|
34555 | if (value - 0 === 0) {
|
34556 | e.target.value = '';
|
34557 | }
|
34558 | if (_this.props.onClickInput) _this.props.onClickInput(value, Object.getArgs(e, _this.props.args));
|
34559 | };
|
34560 |
|
34561 | _this.onChange = function (e) {
|
34562 | if (e.target.validity.badInput) {
|
34563 | e.target.value = '';
|
34564 | }
|
34565 |
|
34566 | var _this$props3 = _this.props,
|
34567 | max = _this$props3.max,
|
34568 | digits = _this$props3.digits,
|
34569 | maxLength = _this$props3.maxLength,
|
34570 | onError = _this$props3.onError;
|
34571 |
|
34572 | var value = Math.Calc.correctNumber(e.target.value, { max: max, digits: digits, maxLength: maxLength, onError: onError });
|
34573 | if (_this.props.onChange) _this.props.onChange(value, Object.getArgs(e, _this.props.args));
|
34574 | };
|
34575 |
|
34576 | _this.onClickMinus = function (e) {
|
34577 | var value = Math.Calc.correctNumber(Math.Calc.subtract(_this.$input.value, 1), _this.props);
|
34578 |
|
34579 | if (_this.props.onChange) _this.props.onChange(value, Object.getArgs(e, _this.props.args));
|
34580 | if (_this.props.onClickMinus) _this.props.onClickMinus(value, Object.getArgs(e, _this.props.args));
|
34581 | _this.autoFocus();
|
34582 | };
|
34583 |
|
34584 | _this.onClickPlus = function (e) {
|
34585 | var value = Math.Calc.correctNumber(Math.Calc.add(_this.$input.value, 1), _this.props);
|
34586 |
|
34587 | if (_this.props.onChange) _this.props.onChange(value, Object.getArgs(e, _this.props.args));
|
34588 | if (_this.props.onClickPlus) _this.props.onClickPlus(value, Object.getArgs(e, _this.props.args));
|
34589 | _this.autoFocus();
|
34590 | };
|
34591 |
|
34592 | _this.onClick = function (e) {
|
34593 | e.stopPropagation();
|
34594 | var _this$props4 = _this.props,
|
34595 | clear = _this$props4.clear,
|
34596 | onClick = _this$props4.onClick,
|
34597 | onClickLicon = _this$props4.onClickLicon,
|
34598 | onClickRicon = _this$props4.onClickRicon;
|
34599 |
|
34600 | if (_this.props.disabled) return;
|
34601 | var target = e.target;
|
34602 | if (clear && target.classList.contains('clearicon')) {
|
34603 | _this.onClear(e);
|
34604 | }
|
34605 | if (onClickLicon && target.classList.contains('licon')) {
|
34606 | onClickLicon(_this.$input.value, Object.getArgs(e, _this.props.args));
|
34607 | return;
|
34608 | }
|
34609 | if (onClickRicon && target.classList.contains('ricon')) {
|
34610 | onClickLicon(_this.$input.value, Object.getArgs(e, _this.props.args));
|
34611 | return;
|
34612 | }
|
34613 | if (target.classList.contains('numbox-input')) {
|
34614 | _this.onClickInput(e);
|
34615 | return;
|
34616 | }
|
34617 | if (target.classList.contains('numbox-button-plus-flag')) {
|
34618 | _this.onClickPlus(e);
|
34619 | return;
|
34620 | }
|
34621 | if (target.classList.contains('numbox-button-minus-flag')) {
|
34622 | _this.onClickMinus(e);
|
34623 | return;
|
34624 | }
|
34625 | if (onClick) onClick(_this.$input.value, Object.getArgs(e, _this.props.args));
|
34626 | };
|
34627 |
|
34628 | _this.onClear = function (e) {
|
34629 | _this.autoFocus();
|
34630 |
|
34631 | if (_this.props.clear && typeof _this.props.clear === 'function') _this.props.clear('', Object.getArgs(e, _this.props.args));
|
34632 | if (_this.props.onChange) {
|
34633 | _this.props.onChange('', Object.getArgs(e, _this.props.args));
|
34634 | }
|
34635 | e.stopPropagation();
|
34636 | };
|
34637 |
|
34638 | _this.getInputDOM = function () {
|
34639 | var _this$props5 = _this.props,
|
34640 | args = _this$props5.args,
|
34641 | style = _this$props5.style,
|
34642 | className = _this$props5.className,
|
34643 | disabled = _this$props5.disabled,
|
34644 | onClick = _this$props5.onClick,
|
34645 | plusStyle = _this$props5.plusStyle,
|
34646 | plusClassName = _this$props5.plusClassName,
|
34647 | minusStyle = _this$props5.minusStyle,
|
34648 | minusClassName = _this$props5.minusClassName,
|
34649 | onClickMinus = _this$props5.onClickMinus,
|
34650 | onClickPlus = _this$props5.onClickPlus,
|
34651 | licon = _this$props5.licon,
|
34652 | onClickLicon = _this$props5.onClickLicon,
|
34653 | ricon = _this$props5.ricon,
|
34654 | onClickRicon = _this$props5.onClickRicon,
|
34655 | clear = _this$props5.clear,
|
34656 | clearClassName = _this$props5.clearClassName,
|
34657 | clearStyle = _this$props5.clearStyle,
|
34658 | inputStyle = _this$props5.inputStyle,
|
34659 | inputClassName = _this$props5.inputClassName,
|
34660 | value = _this$props5.value,
|
34661 | placeholder = _this$props5.placeholder,
|
34662 | maxLength = _this$props5.maxLength,
|
34663 | readOnly = _this$props5.readOnly,
|
34664 | onClickInput = _this$props5.onClickInput,
|
34665 | onChange = _this$props5.onChange,
|
34666 | onError = _this$props5.onError,
|
34667 | onBlur = _this$props5.onBlur,
|
34668 | onFocus = _this$props5.onFocus,
|
34669 | digits = _this$props5.digits,
|
34670 | max = _this$props5.max,
|
34671 | min = _this$props5.min,
|
34672 | autoFocus = _this$props5.autoFocus,
|
34673 | autoSelect = _this$props5.autoSelect,
|
34674 | others = NumBox_objectWithoutProperties(_this$props5, ['args', 'style', 'className', 'disabled', 'onClick', 'plusStyle', 'plusClassName', 'minusStyle', 'minusClassName', 'onClickMinus', 'onClickPlus', 'licon', 'onClickLicon', 'ricon', 'onClickRicon', 'clear', 'clearClassName', 'clearStyle', 'inputStyle', 'inputClassName', 'value', 'placeholder', 'maxLength', 'readOnly', 'onClickInput', 'onChange', 'onError', 'onBlur', 'onFocus', 'digits', 'max', 'min', 'autoFocus', 'autoSelect']);
|
34675 |
|
34676 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('input', NumBox_extends({
|
34677 | ref: function ref(el) {
|
34678 | _this.$input = el;
|
34679 | },
|
34680 | type: 'number',
|
34681 | value: value,
|
34682 | min: min,
|
34683 | max: max,
|
34684 | disabled: disabled,
|
34685 | readOnly: readOnly,
|
34686 | placeholder: placeholder,
|
34687 | onChange: _this.onChange,
|
34688 | onFocus: _this.onFocus,
|
34689 | onBlur: _this.onBlur,
|
34690 | className: 'numbox-input' + (inputClassName ? ' ' + inputClassName : ''),
|
34691 | style: inputStyle
|
34692 | }, others));
|
34693 | };
|
34694 |
|
34695 | return _this;
|
34696 | }
|
34697 |
|
34698 | NumBox.prototype.componentDidMount = function componentDidMount() {
|
34699 | if (this.props.autoFocus) {
|
34700 | this.autoFocus();
|
34701 | }
|
34702 | };
|
34703 |
|
34704 |
|
34705 |
|
34706 |
|
34707 |
|
34708 |
|
34709 |
|
34710 |
|
34711 |
|
34712 |
|
34713 |
|
34714 |
|
34715 |
|
34716 |
|
34717 |
|
34718 |
|
34719 |
|
34720 |
|
34721 |
|
34722 |
|
34723 |
|
34724 | NumBox.prototype.render = function render() {
|
34725 | var _this2 = this;
|
34726 |
|
34727 | var _props = this.props,
|
34728 | min = _props.min,
|
34729 | max = _props.max,
|
34730 | value = _props.value,
|
34731 | style = _props.style,
|
34732 | className = _props.className,
|
34733 | disabled = _props.disabled,
|
34734 | plusStyle = _props.plusStyle,
|
34735 | plusClassName = _props.plusClassName,
|
34736 | minusStyle = _props.minusStyle,
|
34737 | minusClassName = _props.minusClassName,
|
34738 | licon = _props.licon,
|
34739 | ricon = _props.ricon,
|
34740 | clear = _props.clear,
|
34741 | clearClassName = _props.clearClassName,
|
34742 | clearStyle = _props.clearStyle;
|
34743 |
|
34744 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
34745 | 'div',
|
34746 | { ref: function ref(el) {
|
34747 | _this2.$el = el;
|
34748 | }, disabled: min >= max || disabled, style: style, className: 'numbox' + (className ? ' ' + className : ''), onClick: this.onClick },
|
34749 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('input', {
|
34750 | ref: function ref(el) {
|
34751 | _this2.$minus = el;
|
34752 | },
|
34753 | type: 'button',
|
34754 | className: 'numbox-button numbox-button-minus-flag' + (plusClassName ? ' ' + plusClassName : ''),
|
34755 | style: plusStyle,
|
34756 | value: '-',
|
34757 | disabled: !isNaN(min) ? min - value >= 0 : false
|
34758 | }),
|
34759 | licon && licon,
|
34760 | this.getInputDOM(),
|
34761 | clear && value && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('i', { className: 'icon clearicon' + (clearClassName ? ' ' + clearClassName : ''), style: clearStyle, onClick: this.onClear }),
|
34762 | ricon && ricon,
|
34763 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('input', {
|
34764 | ref: function ref(el) {
|
34765 | _this2.$plus = el;
|
34766 | },
|
34767 | type: 'button',
|
34768 | className: 'numbox-button numbox-button-plus-flag' + (minusClassName ? ' ' + minusClassName : ''),
|
34769 | style: minusStyle, value: '+',
|
34770 | disabled: !isNaN(max) ? max - value <= 0 : false
|
34771 | })
|
34772 | );
|
34773 | };
|
34774 |
|
34775 | return NumBox;
|
34776 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), NumBox_class.propTypes = {
|
34777 | args: prop_types_default.a.any,
|
34778 |
|
34779 | style: prop_types_default.a.object,
|
34780 | className: prop_types_default.a.string,
|
34781 | disabled: prop_types_default.a.bool,
|
34782 |
|
34783 | plusStyle: prop_types_default.a.object,
|
34784 | plusClassName: prop_types_default.a.string,
|
34785 | minusStyle: prop_types_default.a.object,
|
34786 | minusClassName: prop_types_default.a.string,
|
34787 |
|
34788 | inputStyle: prop_types_default.a.object,
|
34789 | inputClassName: prop_types_default.a.string,
|
34790 | value: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.number]),
|
34791 | digits: prop_types_default.a.oneOfType([prop_types_default.a.bool, prop_types_default.a.string, prop_types_default.a.number]),
|
34792 | max: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.number]),
|
34793 | min: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.number]),
|
34794 | placeholder: prop_types_default.a.string,
|
34795 | name: prop_types_default.a.string,
|
34796 | maxLength: prop_types_default.a.string,
|
34797 | readOnly: prop_types_default.a.bool,
|
34798 | required: prop_types_default.a.bool,
|
34799 |
|
34800 | autoFocus: prop_types_default.a.bool,
|
34801 | autoSelect: prop_types_default.a.bool,
|
34802 |
|
34803 | licon: prop_types_default.a.node,
|
34804 | onClickLicon: prop_types_default.a.func,
|
34805 | ricon: prop_types_default.a.node,
|
34806 | onClickRicon: prop_types_default.a.func,
|
34807 |
|
34808 | clear: prop_types_default.a.oneOfType([prop_types_default.a.bool, prop_types_default.a.func]),
|
34809 | clearClassName: prop_types_default.a.string,
|
34810 | clearStyle: prop_types_default.a.object,
|
34811 |
|
34812 | onClick: prop_types_default.a.func,
|
34813 | onClickMinus: prop_types_default.a.func,
|
34814 | onClickPlus: prop_types_default.a.func,
|
34815 | onClickInput: prop_types_default.a.func,
|
34816 | onChange: prop_types_default.a.func,
|
34817 | onBlur: prop_types_default.a.func,
|
34818 | onFocus: prop_types_default.a.func,
|
34819 | onError: prop_types_default.a.func
|
34820 | }, NumBox_class.defaultProps = {
|
34821 | maxLength: '16',
|
34822 | clearClassName: 'ricon close-icon-clear size18'
|
34823 | }, NumBox_temp);
|
34824 |
|
34825 |
|
34826 |
|
34827 |
|
34828 | var src_NumBox = (NumBox_NumBox);
|
34829 |
|
34830 | var NumBoxPop_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; };
|
34831 |
|
34832 | var NumBoxPop_class, NumBoxPop_temp;
|
34833 |
|
34834 | function NumBoxPop_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
34835 |
|
34836 | function NumBoxPop_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
34837 |
|
34838 | function NumBoxPop_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
34839 |
|
34840 | function NumBoxPop_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
34841 |
|
34842 |
|
34843 |
|
34844 |
|
34845 |
|
34846 |
|
34847 | var NumBoxPop_NumBoxPop = (NumBoxPop_temp = NumBoxPop_class = function (_Component) {
|
34848 | NumBoxPop_inherits(NumBoxPop, _Component);
|
34849 |
|
34850 | function NumBoxPop(props) {
|
34851 | NumBoxPop_classCallCheck(this, NumBoxPop);
|
34852 |
|
34853 | var _this = NumBoxPop_possibleConstructorReturn(this, _Component.call(this, props));
|
34854 |
|
34855 | _this.onChange = function (value) {
|
34856 | _this.setState({
|
34857 | value: value
|
34858 | });
|
34859 | };
|
34860 |
|
34861 | _this.onClickSubmit = function (args) {
|
34862 | if (_this.props.onClickSubmit) _this.props.onClickSubmit(_this.state.value, args);
|
34863 | };
|
34864 |
|
34865 | _this.onClickCancel = function (args) {
|
34866 | var value = _this.props.value;
|
34867 |
|
34868 | _this.setState({
|
34869 | value: value
|
34870 | });
|
34871 | if (_this.props.onClickCancel) _this.props.onClickCancel(value, args);
|
34872 | };
|
34873 |
|
34874 | _this.state = {
|
34875 | value: props.value || '1'
|
34876 | };
|
34877 | return _this;
|
34878 | }
|
34879 |
|
34880 | NumBoxPop.prototype.render = function render() {
|
34881 | var _this2 = this;
|
34882 |
|
34883 | var _props = this.props,
|
34884 | args = _props.args,
|
34885 | caption = _props.caption,
|
34886 | value = _props.value,
|
34887 | onClickCancel = _props.onClickCancel,
|
34888 | onClickSubmit = _props.onClickSubmit,
|
34889 | others = NumBoxPop_objectWithoutProperties(_props, ['args', 'caption', 'value', 'onClickCancel', 'onClickSubmit']);
|
34890 |
|
34891 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
34892 | src_Alert,
|
34893 | { args: args, ref: function ref(el) {
|
34894 | _this2.$el = el;
|
34895 | }, duration: 0, caption: caption, show: true, onClickSubmit: this.onClickSubmit, onClickCancel: this.onClickCancel },
|
34896 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(src_NumBox, NumBoxPop_extends({
|
34897 | ref: function ref(el) {
|
34898 | _this2.$numbox = el;
|
34899 | },
|
34900 | value: this.state.value,
|
34901 | style: { margin: '0 auto' },
|
34902 | className: 'flex xl',
|
34903 | onChange: this.onChange,
|
34904 | autoFocus: true,
|
34905 | autoSelect: true
|
34906 | }, others))
|
34907 | );
|
34908 | };
|
34909 |
|
34910 | return NumBoxPop;
|
34911 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), NumBoxPop_class.propTypes = {
|
34912 | args: prop_types_default.a.any,
|
34913 |
|
34914 | caption: prop_types_default.a.string,
|
34915 |
|
34916 | value: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.number]),
|
34917 |
|
34918 | onClickCancel: prop_types_default.a.func,
|
34919 | onClickSubmit: prop_types_default.a.func
|
34920 | }, NumBoxPop_class.defaultProps = {
|
34921 | caption: '修改购买数量'
|
34922 | }, NumBoxPop_temp);
|
34923 |
|
34924 |
|
34925 |
|
34926 |
|
34927 | var src_NumBoxPop = (NumBoxPop_NumBoxPop);
|
34928 |
|
34929 | var NumBoxPopPointer_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; };
|
34930 |
|
34931 | var NumBoxPopPointer_class, NumBoxPopPointer_temp;
|
34932 |
|
34933 | function NumBoxPopPointer_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
34934 |
|
34935 | function NumBoxPopPointer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
34936 |
|
34937 | function NumBoxPopPointer_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
34938 |
|
34939 | function NumBoxPopPointer_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
34940 |
|
34941 |
|
34942 |
|
34943 |
|
34944 |
|
34945 |
|
34946 | var NumBoxPopPointer_NumBoxPopPointer = (NumBoxPopPointer_temp = NumBoxPopPointer_class = function (_Component) {
|
34947 | NumBoxPopPointer_inherits(NumBoxPopPointer, _Component);
|
34948 |
|
34949 | function NumBoxPopPointer(props) {
|
34950 | NumBoxPopPointer_classCallCheck(this, NumBoxPopPointer);
|
34951 |
|
34952 | var _this = NumBoxPopPointer_possibleConstructorReturn(this, _Component.call(this, props));
|
34953 |
|
34954 | _this.onClickCancel = function () {
|
34955 | _this.setState({ show: false });
|
34956 | };
|
34957 |
|
34958 | _this.onClickPlus = function (value, args) {
|
34959 | if (_this.props.onChange) _this.props.onChange(value, args);
|
34960 | };
|
34961 |
|
34962 | _this.onClickMinus = function (value, args) {
|
34963 | if (_this.props.onChange) _this.props.onChange(value, args);
|
34964 | };
|
34965 |
|
34966 | _this.onClickSubmit = function (value, args) {
|
34967 |
|
34968 | if (_this.props.onChange) _this.props.onChange(value, args);
|
34969 |
|
34970 | _this.setState({
|
34971 | show: false
|
34972 | });
|
34973 | };
|
34974 |
|
34975 | _this.onClickNumBox = function () {
|
34976 | _this.setState({
|
34977 | show: true
|
34978 | });
|
34979 | };
|
34980 |
|
34981 | _this.state = {
|
34982 | show: false
|
34983 | };
|
34984 | return _this;
|
34985 | }
|
34986 |
|
34987 | NumBoxPopPointer.prototype.render = function render() {
|
34988 | var _props = this.props,
|
34989 | args = _props.args,
|
34990 | containerClassName = _props.containerClassName,
|
34991 | containerStyle = _props.containerStyle,
|
34992 | className = _props.className,
|
34993 | style = _props.style,
|
34994 | value = _props.value,
|
34995 | disabled = _props.disabled,
|
34996 | min = _props.min,
|
34997 | max = _props.max,
|
34998 | digits = _props.digits,
|
34999 | unitClassName = _props.unitClassName,
|
35000 | unitStyle = _props.unitStyle,
|
35001 | unit = _props.unit,
|
35002 | onChange = _props.onChange,
|
35003 | others = NumBoxPopPointer_objectWithoutProperties(_props, ['args', 'containerClassName', 'containerStyle', 'className', 'style', 'value', 'disabled', 'min', 'max', 'digits', 'unitClassName', 'unitStyle', 'unit', 'onChange']);
|
35004 |
|
35005 | var show = this.state.show;
|
35006 |
|
35007 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
35008 | 'div',
|
35009 | { style: Object.assign({ position: 'relative' }, containerStyle), className: containerClassName },
|
35010 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(src_NumBox, {
|
35011 | args: args,
|
35012 | className: className,
|
35013 | style: style,
|
35014 | value: value,
|
35015 | disabled: disabled,
|
35016 | readOnly: true,
|
35017 | min: min,
|
35018 | max: max,
|
35019 | digits: digits,
|
35020 | onClickInput: this.onClickNumBox,
|
35021 | onClickPlus: this.onClickPlus,
|
35022 | onClickMinus: this.onClickMinus
|
35023 | }),
|
35024 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
35025 | 'span',
|
35026 | { style: unitStyle, className: unitClassName },
|
35027 | unit || ''
|
35028 | ),
|
35029 | show && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(src_NumBoxPop, NumBoxPopPointer_extends({
|
35030 | args: args,
|
35031 | value: value,
|
35032 | min: min,
|
35033 | max: max,
|
35034 | digits: digits,
|
35035 | onClickCancel: this.onClickCancel,
|
35036 | onClickSubmit: this.onClickSubmit
|
35037 | }, others))
|
35038 | );
|
35039 | };
|
35040 |
|
35041 | return NumBoxPopPointer;
|
35042 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), NumBoxPopPointer_class.propTypes = {
|
35043 | args: prop_types_default.a.any,
|
35044 | containerClassName: prop_types_default.a.string,
|
35045 | containerStyle: prop_types_default.a.object,
|
35046 |
|
35047 | className: prop_types_default.a.string,
|
35048 | style: prop_types_default.a.object,
|
35049 | value: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.number]),
|
35050 | digits: prop_types_default.a.oneOfType([prop_types_default.a.bool, prop_types_default.a.number]),
|
35051 | min: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.number]),
|
35052 | max: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.number]),
|
35053 | disabled: prop_types_default.a.bool,
|
35054 |
|
35055 | unitClassName: prop_types_default.a.string,
|
35056 | unitStyle: prop_types_default.a.object,
|
35057 | unit: prop_types_default.a.string,
|
35058 |
|
35059 | onChange: prop_types_default.a.func
|
35060 | }, NumBoxPopPointer_class.defaultProps = {
|
35061 | className: 'sm',
|
35062 | unitStyle: {
|
35063 | fontSize: '13px',
|
35064 | marginLeft: '8px'
|
35065 | }
|
35066 | }, NumBoxPopPointer_temp);
|
35067 |
|
35068 |
|
35069 |
|
35070 |
|
35071 | var src_NumBoxPopPointer = (NumBoxPopPointer_NumBoxPopPointer);
|
35072 |
|
35073 | var OnOff_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; };
|
35074 |
|
35075 | var OnOff_class, OnOff_temp;
|
35076 |
|
35077 | function OnOff_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
35078 |
|
35079 | function OnOff_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
35080 |
|
35081 | function OnOff_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
35082 |
|
35083 | function OnOff_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
35084 |
|
35085 |
|
35086 |
|
35087 |
|
35088 | var OnOff_OnOff = (OnOff_temp = OnOff_class = function (_Component) {
|
35089 | OnOff_inherits(OnOff, _Component);
|
35090 |
|
35091 | function OnOff(props) {
|
35092 | OnOff_classCallCheck(this, OnOff);
|
35093 |
|
35094 | var _this = OnOff_possibleConstructorReturn(this, _Component.call(this, props));
|
35095 |
|
35096 | _this.onClick = function () {
|
35097 | var _this$props = _this.props,
|
35098 | readOnly = _this$props.readOnly,
|
35099 | checked = _this$props.checked,
|
35100 | onClick = _this$props.onClick;
|
35101 |
|
35102 | if (readOnly) return;
|
35103 | if (onClick) {
|
35104 | if (checked) onClick(true);else onClick(false);
|
35105 | }
|
35106 | };
|
35107 |
|
35108 | _this.state = {};
|
35109 | return _this;
|
35110 | }
|
35111 |
|
35112 | OnOff.prototype.render = function render() {
|
35113 | var _props = this.props,
|
35114 | className = _props.className,
|
35115 | style = _props.style,
|
35116 | checked = _props.checked,
|
35117 | onCaption = _props.onCaption,
|
35118 | offCaption = _props.offCaption,
|
35119 | readOnly = _props.readOnly,
|
35120 | onClick = _props.onClick,
|
35121 | others = OnOff_objectWithoutProperties(_props, ['className', 'style', 'checked', 'onCaption', 'offCaption', 'readOnly', 'onClick']);
|
35122 |
|
35123 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
35124 | 'div',
|
35125 | OnOff_extends({ className: 'onoff' + (className ? ' ' + className : '') + (onCaption && offCaption ? '' : ' notext') + (checked ? ' active' : ''), style: style, 'data-on': onCaption, 'data-off': offCaption, onClick: this.onClick }, others),
|
35126 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'onoff-handle' })
|
35127 | );
|
35128 | };
|
35129 |
|
35130 | return OnOff;
|
35131 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), OnOff_class.propTypes = {
|
35132 | className: prop_types_default.a.string,
|
35133 | style: prop_types_default.a.object,
|
35134 | readOnly: prop_types_default.a.bool,
|
35135 | checked: prop_types_default.a.bool,
|
35136 | onCaption: prop_types_default.a.string,
|
35137 | offCaption: prop_types_default.a.string,
|
35138 | onClick: prop_types_default.a.func
|
35139 | }, OnOff_class.defaultProps = {
|
35140 | onCaption: '',
|
35141 | offCaption: ''
|
35142 | }, OnOff_temp);
|
35143 |
|
35144 |
|
35145 |
|
35146 |
|
35147 | var src_OnOff = (OnOff_OnOff);
|
35148 |
|
35149 | var Page_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; };
|
35150 |
|
35151 | var Page_class, Page_temp;
|
35152 |
|
35153 | function Page_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
35154 |
|
35155 | function Page_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
35156 |
|
35157 | function Page_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
35158 |
|
35159 | function Page_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
35160 |
|
35161 |
|
35162 |
|
35163 |
|
35164 | var Page_Page = (Page_temp = Page_class = function (_Component) {
|
35165 | Page_inherits(Page, _Component);
|
35166 |
|
35167 | function Page(props) {
|
35168 | Page_classCallCheck(this, Page);
|
35169 |
|
35170 | var _this = Page_possibleConstructorReturn(this, _Component.call(this, props));
|
35171 |
|
35172 | _this.state = {};
|
35173 | return _this;
|
35174 | }
|
35175 |
|
35176 | Page.prototype.componentDidMount = function componentDidMount() {};
|
35177 |
|
35178 | Page.prototype.render = function render() {
|
35179 | var _this2 = this;
|
35180 |
|
35181 | var _props = this.props,
|
35182 | animation = _props.animation,
|
35183 | style = _props.style,
|
35184 | className = _props.className,
|
35185 | children = _props.children,
|
35186 | others = Page_objectWithoutProperties(_props, ['animation', 'style', 'className', 'children']);
|
35187 |
|
35188 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
35189 | 'section',
|
35190 | Page_extends({ ref: function ref(el) {
|
35191 | _this2.$el = el;
|
35192 | }, className: 'page' + (className ? ' ' + className : ''), 'data-animation': animation, style: style }, others),
|
35193 | children
|
35194 | );
|
35195 | };
|
35196 |
|
35197 | return Page;
|
35198 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Page_class.propTypes = {
|
35199 | style: prop_types_default.a.object,
|
35200 | className: prop_types_default.a.string,
|
35201 | animation: prop_types_default.a.string,
|
35202 | children: prop_types_default.a.node
|
35203 | }, Page_temp);
|
35204 |
|
35205 |
|
35206 |
|
35207 |
|
35208 | var src_Page = (Page_Page);
|
35209 |
|
35210 |
|
35211 | var instance_PagePull = function PagePull(container, params) {
|
35212 | |
35213 |
|
35214 |
|
35215 | var defaults = {
|
35216 | mainClass: 'page',
|
35217 | maskClass: 'mask',
|
35218 | leftClass: 'page-side-left',
|
35219 | rightClass: 'page-side-right',
|
35220 | transition: 'push',
|
35221 |
|
35222 | threshold: 20,
|
35223 | duration: 150,
|
35224 |
|
35225 | isClickMaskHide: true,
|
35226 | drag: false
|
35227 | |
35228 |
|
35229 |
|
35230 |
|
35231 |
|
35232 | };
|
35233 | params = params || {};
|
35234 | for (var def in defaults) {
|
35235 | if (params[def] === undefined) {
|
35236 | params[def] = defaults[def];
|
35237 | }
|
35238 | }
|
35239 | var s = this;
|
35240 | s.params = params;
|
35241 |
|
35242 | s.container = typeof container === 'string' ? document.querySelector(container) : container;
|
35243 | if (!s.container) {
|
35244 | console.log('SeedsUI Error:未找到Aside的DOM对象,请检查传入参数是否正确');
|
35245 | return;
|
35246 | }
|
35247 |
|
35248 | s.main = s.container.querySelector('.' + s.params.mainClass);
|
35249 |
|
35250 | s.mask = s.container.querySelector('.' + s.params.maskClass);
|
35251 | if (!s.container || !s.mask) {
|
35252 | console.log('SeedsUI Error:未找到Aside的Page,请检查传入参数是否正确');
|
35253 | return;
|
35254 | }
|
35255 |
|
35256 | s.left = s.container.querySelector('.' + s.params.leftClass);
|
35257 |
|
35258 | s.right = s.container.querySelector('.' + s.params.rightClass);
|
35259 | if (!s.left && !s.right) {
|
35260 | return;
|
35261 | }
|
35262 | s.target = null;
|
35263 | |
35264 |
|
35265 |
|
35266 | s.showMask = function () {
|
35267 | s.mask.style.visibility = 'visible';
|
35268 | s.mask.style.opacity = '1';
|
35269 | };
|
35270 | s.hideMask = function () {
|
35271 | s.mask.style.visibility = 'hidden';
|
35272 | s.mask.style.opacity = '0';
|
35273 | };
|
35274 | s.show = function (direction) {
|
35275 | var target = s.target;
|
35276 | target.style.webkitTransitionDuration = s.params.duration + 'ms';
|
35277 | var x = direction === 'right' ? -s.rightClientWidth : s.leftClientWidth;
|
35278 | s.touches.posX = x;
|
35279 | target.style.webkitTransform = 'translateX(' + x + 'px)';
|
35280 |
|
35281 | s.target = target;
|
35282 | if (s.params.onShowedLeft || s.params.onShowedRight) {
|
35283 | setTimeout(function () {
|
35284 | if (direction === 'left' && s.params.onShowedLeft) s.params.onShowedLeft(s);
|
35285 | if (direction === 'right' && s.params.onShowedRight) s.params.onShowedRight(s);
|
35286 | }, s.params.duration);
|
35287 | }
|
35288 | };
|
35289 | s.hide = function () {
|
35290 | var target = s.target;
|
35291 | target.style.webkitTransitionDuration = s.params.duration + 'ms';
|
35292 | target.style.webkitTransform = 'translateX(0px)';
|
35293 | s.touches.posX = 0;
|
35294 | s.hideMask();
|
35295 | };
|
35296 | |
35297 |
|
35298 |
|
35299 | s.events = function (detach) {
|
35300 | var touchTarget = s.target;
|
35301 | var action = detach ? 'removeEventListener' : 'addEventListener';
|
35302 | if (s.params.drag) {
|
35303 | touchTarget[action]('touchstart', s.onTouchStart, false);
|
35304 | touchTarget[action]('touchmove', s.onTouchMove, false);
|
35305 | touchTarget[action]('touchend', s.onTouchEnd, false);
|
35306 | touchTarget[action]('touchcancel', s.onTouchEnd, false);
|
35307 | }
|
35308 |
|
35309 | s.mask[action]('click', s.onClickMask, false);
|
35310 | };
|
35311 |
|
35312 | s.attach = function () {
|
35313 | s.events();
|
35314 | };
|
35315 | s.detach = function () {
|
35316 | s.events(true);
|
35317 | };
|
35318 | |
35319 |
|
35320 |
|
35321 |
|
35322 | s.touches = {
|
35323 | direction: 0,
|
35324 | vertical: 0,
|
35325 | horizontal: 0,
|
35326 | startX: 0,
|
35327 | startY: 0,
|
35328 | currentX: 0,
|
35329 | currentY: 0,
|
35330 | endX: 0,
|
35331 | endY: 0,
|
35332 | diffX: 0,
|
35333 | diffY: 0,
|
35334 | posX: 0
|
35335 | };
|
35336 | s.onTouchStart = function (e) {
|
35337 | e.stopPropagation();
|
35338 |
|
35339 | s.touches.direction = 0;
|
35340 | s.touches.vertical = 0;
|
35341 | s.touches.horizontal = 0;
|
35342 |
|
35343 | s.touches.startX = e.touches[0].clientX;
|
35344 | s.touches.startY = e.touches[0].clientY;
|
35345 | s.leftClientWidth = s.left ? s.left.clientWidth : 0;
|
35346 | s.rightClientWidth = s.right ? s.right.clientWidth : 0;
|
35347 | e.currentTarget.style.webkitTransitionDuration = '0ms';
|
35348 | };
|
35349 | s.onTouchMove = function (e) {
|
35350 | e.stopPropagation();
|
35351 | if (!s.leftClientWidth && !s.rightClientWidth) return;
|
35352 | s.touches.currentX = e.touches[0].clientX;
|
35353 | s.touches.currentY = e.touches[0].clientY;
|
35354 | s.touches.diffX = s.touches.currentX - s.touches.startX;
|
35355 | s.touches.diffY = s.touches.currentY - s.touches.startY;
|
35356 |
|
35357 |
|
35358 | if (s.touches.direction === 0) {
|
35359 |
|
35360 | s.touches.direction = Math.abs(s.touches.diffX) > Math.abs(s.touches.diffY) ? 1 : -1;
|
35361 | }
|
35362 | if (s.touches.direction === -1) {
|
35363 |
|
35364 | s.touches.vertical = s.touches.diffY < 0 ? 1 : -1;
|
35365 | }
|
35366 | if (s.touches.direction === 1) {
|
35367 |
|
35368 | s.touches.horizontal = s.touches.diffX < 0 ? 1 : -1;
|
35369 | }
|
35370 |
|
35371 |
|
35372 | if (s.touches.vertical !== 0) {
|
35373 | return;
|
35374 | }
|
35375 |
|
35376 |
|
35377 | if (s.touches.diffX + s.touches.posX < -s.rightClientWidth) s.touches.diffX = -s.rightClientWidth - s.touches.posX;
|
35378 |
|
35379 | if (s.touches.diffX + s.touches.posX > s.leftClientWidth) s.touches.diffX = s.leftClientWidth - s.touches.posX;
|
35380 |
|
35381 |
|
35382 | s.showMask();
|
35383 | e.currentTarget.style.webkitTransform = 'translateX(' + (s.touches.diffX + s.touches.posX) + 'px)';
|
35384 | };
|
35385 | s.onTouchEnd = function (e) {
|
35386 | e.stopPropagation();
|
35387 | if (s.touches.direction === -1) {
|
35388 |
|
35389 | return;
|
35390 | }
|
35391 | s.touches.endX = e.clientX || e.changedTouches[0].clientX;
|
35392 | s.touches.endY = e.clientY || e.changedTouches[0].clientY;
|
35393 | if (Math.abs(s.touches.startX - s.touches.endX) < 6 && Math.abs(s.touches.startY - s.touches.endY) < 6) {
|
35394 |
|
35395 | s.hide();
|
35396 | } else if (s.leftClientWidth || s.rightClientWidth) {
|
35397 |
|
35398 | var direction = s.touches.diffX > 0 ? 'left' : 'right';
|
35399 | if (Math.abs(s.touches.diffX) > s.params.threshold) {
|
35400 |
|
35401 | if (s.touches.posX > 0 && direction === 'right') {
|
35402 | s.hide();
|
35403 |
|
35404 | } else if (s.touches.posX < 0 && direction === 'left') {
|
35405 | s.hide();
|
35406 | } else {
|
35407 | s.show(direction);
|
35408 | }
|
35409 | } else {
|
35410 | if (s.touches.posX !== 0) {
|
35411 | s.show(s.touches.posX > 0 ? 'left' : 'right');
|
35412 | } else {
|
35413 | s.hide();
|
35414 | }
|
35415 | }
|
35416 | }
|
35417 | };
|
35418 | s.onClickMask = function (e) {
|
35419 | s.target = e.target;
|
35420 | if (s.params.onClickMask) s.params.onClickMask(s);
|
35421 | if (s.params.isClickMaskHide) {
|
35422 | s.hide();
|
35423 | }
|
35424 | e.stopPropagation();
|
35425 | };
|
35426 | |
35427 |
|
35428 |
|
35429 | s.update = function () {
|
35430 | if (s.target) {
|
35431 | s.detach();
|
35432 | }
|
35433 | if (this.params.transition === 'reveal') {
|
35434 | s.target = s.main;
|
35435 | } else {
|
35436 | s.target = s.container;
|
35437 | }
|
35438 | s.attach();
|
35439 | };
|
35440 | s.update();
|
35441 | };
|
35442 |
|
35443 | var PagePull_instance = (instance_PagePull);
|
35444 |
|
35445 | var PagePull_class, PagePull_temp;
|
35446 |
|
35447 | function PagePull_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
35448 |
|
35449 | function PagePull_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
35450 |
|
35451 | function PagePull_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
35452 |
|
35453 | function PagePull_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
35454 |
|
35455 |
|
35456 |
|
35457 |
|
35458 |
|
35459 |
|
35460 | var PagePull_PagePull = (PagePull_temp = PagePull_class = function (_Component) {
|
35461 | PagePull_inherits(PagePull, _Component);
|
35462 |
|
35463 | function PagePull(props, context) {
|
35464 | PagePull_classCallCheck(this, PagePull);
|
35465 |
|
35466 | var _this = PagePull_possibleConstructorReturn(this, _Component.call(this, props, context));
|
35467 |
|
35468 | _this.componentDidMount = function () {
|
35469 | var instance = new PagePull_instance(_this.$el, {
|
35470 | drag: true,
|
35471 | transition: _this.props.transition || 'push',
|
35472 | onShowedLeft: _this.props.onShowedLeft,
|
35473 | onShowedRight: _this.props.onShowedRight
|
35474 | });
|
35475 | _this.instance = instance;
|
35476 | };
|
35477 |
|
35478 | return _this;
|
35479 | }
|
35480 |
|
35481 | PagePull.prototype.render = function render() {
|
35482 | var _this2 = this;
|
35483 |
|
35484 | var _props = this.props,
|
35485 | lSide = _props.lSide,
|
35486 | lSideStyle = _props.lSideStyle,
|
35487 | lSideClassName = _props.lSideClassName,
|
35488 | rSide = _props.rSide,
|
35489 | rSideStyle = _props.rSideStyle,
|
35490 | rSideClassName = _props.rSideClassName,
|
35491 | drag = _props.drag,
|
35492 | children = _props.children,
|
35493 | transition = _props.transition,
|
35494 | others = PagePull_objectWithoutProperties(_props, ['lSide', 'lSideStyle', 'lSideClassName', 'rSide', 'rSideStyle', 'rSideClassName', 'drag', 'children', 'transition']);
|
35495 |
|
35496 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
35497 | 'div',
|
35498 | { className: 'page-pull', ref: function ref(el) {
|
35499 | _this2.$el = el;
|
35500 | } },
|
35501 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
35502 | src_Page,
|
35503 | others,
|
35504 | children,
|
35505 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'mask' })
|
35506 | ),
|
35507 | lSide && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
35508 | 'aside',
|
35509 | { className: 'page-side-left' + (lSideClassName ? ' ' + lSideClassName : ''), style: lSideStyle, 'data-transition': transition, ref: function ref(el) {
|
35510 | _this2.$lSide = el;
|
35511 | } },
|
35512 | lSide
|
35513 | ),
|
35514 | rSide && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
35515 | 'aside',
|
35516 | { className: 'page-side-right' + (rSideClassName ? ' ' + rSideClassName : ''), style: rSideStyle, 'data-transition': transition, ref: function ref(el) {
|
35517 | _this2.$rSide = el;
|
35518 | } },
|
35519 | rSide
|
35520 | )
|
35521 | );
|
35522 | };
|
35523 |
|
35524 | return PagePull;
|
35525 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), PagePull_class.propTypes = {
|
35526 |
|
35527 | children: prop_types_default.a.node,
|
35528 |
|
35529 | drag: prop_types_default.a.bool,
|
35530 | lSide: prop_types_default.a.node,
|
35531 | lSideStyle: prop_types_default.a.object,
|
35532 | lSideClassName: prop_types_default.a.string,
|
35533 | rSide: prop_types_default.a.node,
|
35534 | rSideStyle: prop_types_default.a.object,
|
35535 | rSideClassName: prop_types_default.a.string,
|
35536 | transition: prop_types_default.a.string,
|
35537 | onShowedLeft: prop_types_default.a.func,
|
35538 | onShowedRight: prop_types_default.a.func
|
35539 | }, PagePull_class.defaultProps = {
|
35540 | drag: true,
|
35541 | transition: 'push'
|
35542 | }, PagePull_temp);
|
35543 |
|
35544 |
|
35545 |
|
35546 |
|
35547 | var src_PagePull = (PagePull_PagePull);
|
35548 |
|
35549 |
|
35550 | var instance_PDFView = function PDFView(container, params) {
|
35551 | |
35552 |
|
35553 |
|
35554 | var defaults = {
|
35555 | containerClass: 'pdf-container',
|
35556 | wrapperClass: 'pdf-wrapper',
|
35557 | pageClass: 'pdf-page',
|
35558 | canvasClass: 'pdf-page-canvas',
|
35559 | imgClass: 'pdf-page-img',
|
35560 | loadClass: 'pdf-page-load',
|
35561 | loadHTML: '加载中',
|
35562 | errorClass: 'pdf-page-error',
|
35563 | errorHTML: '文件加载失败',
|
35564 | hideClass: 'hide',
|
35565 |
|
35566 | pictures: '',
|
35567 | src: '',
|
35568 | cMapUrl: '',
|
35569 |
|
35570 |
|
35571 | pageAttr: 'data-page',
|
35572 | completeAttr: 'data-complete'
|
35573 | |
35574 |
|
35575 |
|
35576 |
|
35577 |
|
35578 |
|
35579 |
|
35580 | };
|
35581 | params = params || {};
|
35582 | for (var def in defaults) {
|
35583 | if (params[def] === undefined) {
|
35584 | params[def] = defaults[def];
|
35585 | }
|
35586 | }
|
35587 |
|
35588 | var s = this;
|
35589 |
|
35590 |
|
35591 | s.params = params;
|
35592 |
|
35593 |
|
35594 | s.container = typeof container === 'string' && container !== '' ? document.querySelector(container) : container;
|
35595 | if (!s.container) {
|
35596 | console.warn('SeedsUI Error:未找到Container,请检查传入参数是否正确');
|
35597 | return;
|
35598 | }
|
35599 |
|
35600 |
|
35601 | s.wrapper = null;
|
35602 |
|
35603 |
|
35604 | s.create = function () {
|
35605 | s.container.innerHTML = '';
|
35606 |
|
35607 | s.wrapper = document.createElement('div');
|
35608 | s.wrapper.setAttribute('class', s.params.wrapperClass);
|
35609 |
|
35610 | s.container.appendChild(s.wrapper);
|
35611 | };
|
35612 |
|
35613 | s.updateParams = function () {
|
35614 | var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
35615 |
|
35616 | for (var param in params) {
|
35617 | s.params[param] = params[param];
|
35618 | }
|
35619 | };
|
35620 |
|
35621 | s.update = function (params) {
|
35622 | if (!s.container) return;
|
35623 |
|
35624 | s.wrapper = s.container.querySelector('.' + s.params.wrapperClass) || null;
|
35625 |
|
35626 | if (!s.wrapper) {
|
35627 | s.create();
|
35628 | }
|
35629 |
|
35630 |
|
35631 | if (s.init) {
|
35632 | s.wrapper.innerHTML = '';
|
35633 | s.updateParams(params);
|
35634 | s.init();
|
35635 | }
|
35636 | };
|
35637 | s.update();
|
35638 | |
35639 |
|
35640 |
|
35641 |
|
35642 | s.showPageElement = function (pageDOM, elementName) {
|
35643 | var elements = {};
|
35644 |
|
35645 | elements.canvas = pageDOM.querySelector('.' + s.params.canvasClass);
|
35646 | elements.canvas.classList.add(s.params.hideClass);
|
35647 |
|
35648 | elements.img = pageDOM.querySelector('.' + s.params.imgClass);
|
35649 | elements.img.classList.add(s.params.hideClass);
|
35650 |
|
35651 | elements.load = pageDOM.querySelector('.' + s.params.loadClass);
|
35652 | elements.load.classList.add(s.params.hideClass);
|
35653 | elements.load.innerHTML = s.params.loadHTML;
|
35654 |
|
35655 | elements.error = pageDOM.querySelector('.' + s.params.errorClass);
|
35656 | elements.error.classList.add(s.params.hideClass);
|
35657 | elements.error.innerHTML = s.params.errorHTML;
|
35658 |
|
35659 | if (elements[elementName]) elements[elementName].classList.remove(s.params.hideClass);
|
35660 | };
|
35661 |
|
35662 | s.createPage = function () {
|
35663 |
|
35664 | var page = document.createElement('div');
|
35665 | page.setAttribute('class', s.params.pageClass);
|
35666 |
|
35667 | var canvas = document.createElement('canvas');
|
35668 | canvas.setAttribute('class', s.params.canvasClass);
|
35669 | page.appendChild(canvas);
|
35670 |
|
35671 | var img = document.createElement('img');
|
35672 | img.setAttribute('class', s.params.imgClass);
|
35673 | page.appendChild(img);
|
35674 |
|
35675 | var load = document.createElement('div');
|
35676 | load.setAttribute('class', s.params.loadClass);
|
35677 | load.innerHTML = s.params.loadHTML;
|
35678 | page.appendChild(load);
|
35679 |
|
35680 | var error = document.createElement('div');
|
35681 | error.setAttribute('class', s.params.errorClass + ' ' + s.params.hideClass);
|
35682 | error.innerHTML = s.params.errorHTML;
|
35683 | page.appendChild(error);
|
35684 |
|
35685 |
|
35686 | if (s.wrapper) s.wrapper.appendChild(page);
|
35687 |
|
35688 | return page;
|
35689 | };
|
35690 |
|
35691 |
|
35692 | s.canvasToPng = function (canvas) {
|
35693 | var dataURL = canvas.toDataURL('image/png', 1.0);
|
35694 | return dataURL;
|
35695 | };
|
35696 |
|
35697 | s.load = function () {
|
35698 | if (!s.wrapper) {
|
35699 | console.warn('SeedsUI Warn: wrapper为空');
|
35700 | return;
|
35701 | }
|
35702 | if (s.params.pictures && s.params.pictures.length) {
|
35703 |
|
35704 | s.loadImg();
|
35705 | } else if (s.params.src) {
|
35706 |
|
35707 | s.loadPDF();
|
35708 | }
|
35709 | };
|
35710 |
|
35711 |
|
35712 |
|
35713 |
|
35714 |
|
35715 |
|
35716 |
|
35717 |
|
35718 |
|
35719 |
|
35720 |
|
35721 |
|
35722 | s.loadPDF = function () {
|
35723 | try {
|
35724 | var scriptPdf = document.createElement('script');
|
35725 | scriptPdf.type = 'text/javascript';
|
35726 | scriptPdf.src = '//res.waiqin365.com/d/seedsui/pdfview/pdf.min.js';
|
35727 | var scriptPdfWork = document.createElement('script');
|
35728 | scriptPdfWork.type = 'text/javascript';
|
35729 | scriptPdfWork.src = '//res.waiqin365.com/d/seedsui/pdfview/pdf.worker.min.js';
|
35730 | document.body.appendChild(scriptPdf);
|
35731 | document.body.appendChild(scriptPdfWork);
|
35732 | var loadCount = 0;
|
35733 | scriptPdf.onload = function () {
|
35734 | if (!loadCount) loadCount = 1;else loadCount++;
|
35735 | if (loadCount === 2) {
|
35736 | s.initPDF();
|
35737 | }
|
35738 | };
|
35739 | scriptPdfWork.onload = function () {
|
35740 | if (!loadCount) loadCount = 1;else loadCount++;
|
35741 | if (loadCount === 2) {
|
35742 | s.initPDF();
|
35743 | }
|
35744 | };
|
35745 | } catch (error) {
|
35746 | console.log(error);
|
35747 | var pageDOM = s.createPage();
|
35748 | s.showPageElement(pageDOM, 'error');
|
35749 | }
|
35750 | };
|
35751 |
|
35752 | s.initPDF = function () {
|
35753 |
|
35754 | if (s.params.cMapUrl) {
|
35755 | PDFJS.cMapUrl = s.params.cMapUrl;
|
35756 | PDFJS.cMapPacked = true;
|
35757 | }
|
35758 |
|
35759 |
|
35760 |
|
35761 |
|
35762 |
|
35763 |
|
35764 |
|
35765 |
|
35766 |
|
35767 |
|
35768 |
|
35769 |
|
35770 |
|
35771 |
|
35772 |
|
35773 |
|
35774 |
|
35775 | PDFJS.getDocument(s.params.src).then(function (pdf) {
|
35776 | s.renderPDF(pdf);
|
35777 | }).catch(function (error) {
|
35778 | console.log(error);
|
35779 | var pageDOM = s.createPage();
|
35780 | s.showPageElement(pageDOM, 'error');
|
35781 | });
|
35782 | };
|
35783 |
|
35784 | s.loadImg = function () {
|
35785 | var pictures = s.params.pictures;
|
35786 | if (!pictures || !pictures.length) return;
|
35787 | if (!pictures || !pictures.length) {
|
35788 | s.params.onLoadError();
|
35789 | return;
|
35790 | }
|
35791 | s.total = pictures.length;
|
35792 | s.completeCount = 0;
|
35793 | for (var _iterator = pictures.entries(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
|
35794 | var _ref2;
|
35795 |
|
35796 | if (_isArray) {
|
35797 | if (_i >= _iterator.length) break;
|
35798 | _ref2 = _iterator[_i++];
|
35799 | } else {
|
35800 | _i = _iterator.next();
|
35801 | if (_i.done) break;
|
35802 | _ref2 = _i.value;
|
35803 | }
|
35804 |
|
35805 | var _ref = _ref2;
|
35806 | var i = _ref[0];
|
35807 | var picture = _ref[1];
|
35808 |
|
35809 |
|
35810 | var pageDOM = s.createPage();
|
35811 | var img = pageDOM.querySelector('img');
|
35812 |
|
35813 | img.src = picture;
|
35814 | img.setAttribute(s.params.pageAttr, i);
|
35815 | img.addEventListener('load', s.onLoad, false);
|
35816 | img.addEventListener('error', s.onError, false);
|
35817 | }
|
35818 | };
|
35819 |
|
35820 | s.renderPDF = function (pdf) {
|
35821 | s.completeCount = 0;
|
35822 | if (!s.wrapper) return;
|
35823 |
|
35824 | s.total = pdf.numPages;
|
35825 |
|
35826 | var _loop = function _loop(i) {
|
35827 | pdf.getPage(i).then(function (page) {
|
35828 | var viewport = page.getViewport(1);
|
35829 |
|
35830 | var pageDOM = s.createPage();
|
35831 | var canvas = pageDOM.querySelector('canvas');
|
35832 | var img = pageDOM.querySelector('img');
|
35833 |
|
35834 | var context = canvas.getContext('2d');
|
35835 | canvas.height = viewport.height;
|
35836 | canvas.width = viewport.width;
|
35837 | var renderContext = {
|
35838 | canvasContext: context,
|
35839 | viewport: viewport
|
35840 | };
|
35841 | var renderTask = page.render(renderContext);
|
35842 | renderTask.promise.then(function () {
|
35843 | var pngbase64 = s.canvasToPng(canvas);
|
35844 | img.src = pngbase64;
|
35845 | img.setAttribute(s.params.pageAttr, i - 1);
|
35846 | img.addEventListener('load', s.onLoad, false);
|
35847 | img.addEventListener('error', s.onError, false);
|
35848 | });
|
35849 | });
|
35850 | };
|
35851 |
|
35852 | for (var i = 1; i <= s.total; i++) {
|
35853 | _loop(i);
|
35854 | }
|
35855 | };
|
35856 |
|
35857 | s.total = 0;
|
35858 | s.completeCount = 0;
|
35859 | s.onLoad = function (e, isError) {
|
35860 | var target = e.target;
|
35861 | var index = target.getAttribute(s.params.pageAttr);
|
35862 |
|
35863 | if (isError) {
|
35864 | console.log('第' + index + '页加载失败');
|
35865 | target.setAttribute(s.params.completeAttr, '0');
|
35866 | s.showPageElement(target.parentNode, 'error');
|
35867 | } else {
|
35868 | console.log('第' + index + '页加载完成');
|
35869 | target.setAttribute(s.params.completeAttr, '1');
|
35870 | s.showPageElement(target.parentNode, 'img');
|
35871 | }
|
35872 | s.event = e;
|
35873 |
|
35874 | if (s.params.onPageLoad) s.params.onPageLoad(s);
|
35875 |
|
35876 | s.completeCount++;
|
35877 | if (s.completeCount === s.total) {
|
35878 |
|
35879 | if (s.params.onLoad) s.params.onLoad(s);
|
35880 | }
|
35881 | };
|
35882 |
|
35883 | s.onError = function (e) {
|
35884 | s.onLoad(e, true);
|
35885 | };
|
35886 | |
35887 |
|
35888 |
|
35889 |
|
35890 | s.init = function () {
|
35891 | s.load();
|
35892 |
|
35893 | if (s.params.onInit) s.params.onInit(s);
|
35894 | };
|
35895 |
|
35896 | s.init();
|
35897 |
|
35898 | return s;
|
35899 | };
|
35900 |
|
35901 | var PDFView_instance = (instance_PDFView);
|
35902 |
|
35903 |
|
35904 |
|
35905 |
|
35906 |
|
35907 |
|
35908 |
|
35909 |
|
35910 | function spliceOne(list, index) {
|
35911 | for (; index + 1 < list.length; index++) {
|
35912 | list[index] = list[index + 1];
|
35913 | }
|
35914 |
|
35915 | list.pop();
|
35916 | }
|
35917 |
|
35918 | var slicedToArray = function () {
|
35919 | function sliceIterator(arr, i) {
|
35920 | var _arr = [];
|
35921 | var _n = true;
|
35922 | var _d = false;
|
35923 | var _e = undefined;
|
35924 |
|
35925 | try {
|
35926 | for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
35927 | _arr.push(_s.value);
|
35928 |
|
35929 | if (i && _arr.length === i) break;
|
35930 | }
|
35931 | } catch (err) {
|
35932 | _d = true;
|
35933 | _e = err;
|
35934 | } finally {
|
35935 | try {
|
35936 | if (!_n && _i["return"]) _i["return"]();
|
35937 | } finally {
|
35938 | if (_d) throw _e;
|
35939 | }
|
35940 | }
|
35941 |
|
35942 | return _arr;
|
35943 | }
|
35944 |
|
35945 | return function (arr, i) {
|
35946 | if (Array.isArray(arr)) {
|
35947 | return arr;
|
35948 | } else if (Symbol.iterator in Object(arr)) {
|
35949 | return sliceIterator(arr, i);
|
35950 | } else {
|
35951 | throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
35952 | }
|
35953 | };
|
35954 | }();
|
35955 |
|
35956 |
|
35957 |
|
35958 |
|
35959 |
|
35960 |
|
35961 |
|
35962 |
|
35963 |
|
35964 |
|
35965 |
|
35966 |
|
35967 |
|
35968 | var toConsumableArray = function (arr) {
|
35969 | if (Array.isArray(arr)) {
|
35970 | for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
|
35971 |
|
35972 | return arr2;
|
35973 | } else {
|
35974 | return Array.from(arr);
|
35975 | }
|
35976 | };
|
35977 |
|
35978 | function eventMixin(BScroll) {
|
35979 | BScroll.prototype.on = function (type, fn) {
|
35980 | var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this;
|
35981 |
|
35982 | if (!this._events[type]) {
|
35983 | this._events[type] = [];
|
35984 | }
|
35985 |
|
35986 | this._events[type].push([fn, context]);
|
35987 | };
|
35988 |
|
35989 | BScroll.prototype.once = function (type, fn) {
|
35990 | var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this;
|
35991 |
|
35992 | function magic() {
|
35993 | this.off(type, magic);
|
35994 |
|
35995 | fn.apply(context, arguments);
|
35996 | }
|
35997 |
|
35998 | magic.fn = fn;
|
35999 |
|
36000 | this.on(type, magic);
|
36001 | };
|
36002 |
|
36003 | BScroll.prototype.off = function (type, fn) {
|
36004 | var _events = this._events[type];
|
36005 | if (!_events) {
|
36006 | return;
|
36007 | }
|
36008 |
|
36009 | var count = _events.length;
|
36010 | while (count--) {
|
36011 | if (_events[count][0] === fn || _events[count][0] && _events[count][0].fn === fn) {
|
36012 | spliceOne(_events, count);
|
36013 | }
|
36014 | }
|
36015 | };
|
36016 |
|
36017 | BScroll.prototype.trigger = function (type) {
|
36018 | var events = this._events[type];
|
36019 | if (!events) {
|
36020 | return;
|
36021 | }
|
36022 |
|
36023 | var len = events.length;
|
36024 | var eventsCopy = [].concat(toConsumableArray(events));
|
36025 | for (var i = 0; i < len; i++) {
|
36026 | var event = eventsCopy[i];
|
36027 |
|
36028 | var _event = slicedToArray(event, 2),
|
36029 | fn = _event[0],
|
36030 | context = _event[1];
|
36031 |
|
36032 | if (fn) {
|
36033 | fn.apply(context, [].slice.call(arguments, 1));
|
36034 | }
|
36035 | }
|
36036 | };
|
36037 | }
|
36038 |
|
36039 |
|
36040 | var inBrowser = typeof window !== 'undefined';
|
36041 | var ua = inBrowser && navigator.userAgent.toLowerCase();
|
36042 | var isWeChatDevTools = ua && /wechatdevtools/.test(ua);
|
36043 | var isAndroid = ua && ua.indexOf('android') > 0;
|
36044 |
|
36045 | function getNow() {
|
36046 | return window.performance && window.performance.now ? window.performance.now() + window.performance.timing.navigationStart : +new Date();
|
36047 | }
|
36048 |
|
36049 | function extend(target) {
|
36050 | for (var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
36051 | rest[_key - 1] = arguments[_key];
|
36052 | }
|
36053 |
|
36054 | for (var i = 0; i < rest.length; i++) {
|
36055 | var source = rest[i];
|
36056 | for (var key in source) {
|
36057 | target[key] = source[key];
|
36058 | }
|
36059 | }
|
36060 | return target;
|
36061 | }
|
36062 |
|
36063 | function isUndef(v) {
|
36064 | return v === undefined || v === null;
|
36065 | }
|
36066 |
|
36067 | function getDistance(x, y) {
|
36068 | return Math.sqrt(x * x + y * y);
|
36069 | }
|
36070 |
|
36071 | var elementStyle = inBrowser && document.createElement('div').style;
|
36072 |
|
36073 | var vendor = function () {
|
36074 | if (!inBrowser) {
|
36075 | return false;
|
36076 | }
|
36077 |
|
36078 | var transformNames = {
|
36079 | standard: 'transform',
|
36080 | webkit: 'webkitTransform',
|
36081 | Moz: 'MozTransform',
|
36082 | O: 'OTransform',
|
36083 | ms: 'msTransform'
|
36084 | };
|
36085 |
|
36086 | for (var key in transformNames) {
|
36087 | if (elementStyle[transformNames[key]] !== undefined) {
|
36088 | return key;
|
36089 | }
|
36090 | }
|
36091 |
|
36092 | return false;
|
36093 | }();
|
36094 |
|
36095 | function prefixStyle(style) {
|
36096 | if (vendor === false) {
|
36097 | return false;
|
36098 | }
|
36099 |
|
36100 | if (vendor === 'standard') {
|
36101 | if (style === 'transitionEnd') {
|
36102 | return 'transitionend';
|
36103 | }
|
36104 | return style;
|
36105 | }
|
36106 |
|
36107 | return vendor + style.charAt(0).toUpperCase() + style.substr(1);
|
36108 | }
|
36109 |
|
36110 | function addEvent(el, type, fn, capture) {
|
36111 | el.addEventListener(type, fn, { passive: false, capture: !!capture });
|
36112 | }
|
36113 |
|
36114 | function removeEvent(el, type, fn, capture) {
|
36115 | el.removeEventListener(type, fn, { passive: false, capture: !!capture });
|
36116 | }
|
36117 |
|
36118 | function offset(el) {
|
36119 | var left = 0;
|
36120 | var top = 0;
|
36121 |
|
36122 | while (el) {
|
36123 | left -= el.offsetLeft;
|
36124 | top -= el.offsetTop;
|
36125 | el = el.offsetParent;
|
36126 | }
|
36127 |
|
36128 | return {
|
36129 | left: left,
|
36130 | top: top
|
36131 | };
|
36132 | }
|
36133 |
|
36134 | function offsetToBody(el) {
|
36135 | var rect = el.getBoundingClientRect();
|
36136 |
|
36137 | return {
|
36138 | left: -(rect.left + window.pageXOffset),
|
36139 | top: -(rect.top + window.pageYOffset)
|
36140 | };
|
36141 | }
|
36142 |
|
36143 | var cssVendor = vendor && vendor !== 'standard' ? '-' + vendor.toLowerCase() + '-' : '';
|
36144 |
|
36145 | var transform = prefixStyle('transform');
|
36146 | var bscroll_esm_transition = prefixStyle('transition');
|
36147 |
|
36148 | var hasPerspective = inBrowser && prefixStyle('perspective') in elementStyle;
|
36149 |
|
36150 | var hasTouch = inBrowser && ('ontouchstart' in window || isWeChatDevTools);
|
36151 | var hasTransform = transform !== false;
|
36152 | var hasTransition = inBrowser && bscroll_esm_transition in elementStyle;
|
36153 |
|
36154 | var bscroll_esm_style = {
|
36155 | transform: transform,
|
36156 | transition: bscroll_esm_transition,
|
36157 | transitionTimingFunction: prefixStyle('transitionTimingFunction'),
|
36158 | transitionDuration: prefixStyle('transitionDuration'),
|
36159 | transitionDelay: prefixStyle('transitionDelay'),
|
36160 | transformOrigin: prefixStyle('transformOrigin'),
|
36161 | transitionEnd: prefixStyle('transitionEnd')
|
36162 | };
|
36163 |
|
36164 | var TOUCH_EVENT = 1;
|
36165 | var MOUSE_EVENT = 2;
|
36166 |
|
36167 | var eventType = {
|
36168 | touchstart: TOUCH_EVENT,
|
36169 | touchmove: TOUCH_EVENT,
|
36170 | touchend: TOUCH_EVENT,
|
36171 |
|
36172 | mousedown: MOUSE_EVENT,
|
36173 | mousemove: MOUSE_EVENT,
|
36174 | mouseup: MOUSE_EVENT
|
36175 | };
|
36176 |
|
36177 | function getRect(el) {
|
36178 | if (el instanceof window.SVGElement) {
|
36179 | var rect = el.getBoundingClientRect();
|
36180 | return {
|
36181 | top: rect.top,
|
36182 | left: rect.left,
|
36183 | width: rect.width,
|
36184 | height: rect.height
|
36185 | };
|
36186 | } else {
|
36187 | return {
|
36188 | top: el.offsetTop,
|
36189 | left: el.offsetLeft,
|
36190 | width: el.offsetWidth,
|
36191 | height: el.offsetHeight
|
36192 | };
|
36193 | }
|
36194 | }
|
36195 |
|
36196 | function preventDefaultException(el, exceptions) {
|
36197 | for (var i in exceptions) {
|
36198 | if (exceptions[i].test(el[i])) {
|
36199 | return true;
|
36200 | }
|
36201 | }
|
36202 | return false;
|
36203 | }
|
36204 |
|
36205 | function tap(e, eventName) {
|
36206 | var ev = document.createEvent('Event');
|
36207 | ev.initEvent(eventName, true, true);
|
36208 | ev.pageX = e.pageX;
|
36209 | ev.pageY = e.pageY;
|
36210 | e.target.dispatchEvent(ev);
|
36211 | }
|
36212 |
|
36213 | function click(e) {
|
36214 | var event = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'click';
|
36215 |
|
36216 | var eventSource = void 0;
|
36217 | if (e.type === 'mouseup' || e.type === 'mousecancel') {
|
36218 | eventSource = e;
|
36219 | } else if (e.type === 'touchend' || e.type === 'touchcancel') {
|
36220 | eventSource = e.changedTouches[0];
|
36221 | }
|
36222 | var posSrc = {};
|
36223 | if (eventSource) {
|
36224 | posSrc.screenX = eventSource.screenX || 0;
|
36225 | posSrc.screenY = eventSource.screenY || 0;
|
36226 | posSrc.clientX = eventSource.clientX || 0;
|
36227 | posSrc.clientY = eventSource.clientY || 0;
|
36228 | }
|
36229 | var ev = void 0;
|
36230 | var bubbles = true;
|
36231 | var cancelable = true;
|
36232 | if (typeof MouseEvent !== 'undefined') {
|
36233 | try {
|
36234 | ev = new MouseEvent(event, extend({
|
36235 | bubbles: bubbles,
|
36236 | cancelable: cancelable
|
36237 | }, posSrc));
|
36238 | } catch (e) {
|
36239 | createEvent();
|
36240 | }
|
36241 | } else {
|
36242 | createEvent();
|
36243 | }
|
36244 |
|
36245 | function createEvent() {
|
36246 | ev = document.createEvent('Event');
|
36247 | ev.initEvent(event, bubbles, cancelable);
|
36248 | extend(ev, posSrc);
|
36249 | }
|
36250 |
|
36251 |
|
36252 | ev.forwardedTouchEvent = true;
|
36253 | ev._constructed = true;
|
36254 | e.target.dispatchEvent(ev);
|
36255 | }
|
36256 |
|
36257 | function dblclick(e) {
|
36258 | click(e, 'dblclick');
|
36259 | }
|
36260 |
|
36261 | function prepend(el, target) {
|
36262 | if (target.firstChild) {
|
36263 | before(el, target.firstChild);
|
36264 | } else {
|
36265 | target.appendChild(el);
|
36266 | }
|
36267 | }
|
36268 |
|
36269 | function before(el, target) {
|
36270 | target.parentNode.insertBefore(el, target);
|
36271 | }
|
36272 |
|
36273 | function removeChild(el, child) {
|
36274 | el.removeChild(child);
|
36275 | }
|
36276 |
|
36277 | var DEFAULT_OPTIONS = {
|
36278 | startX: 0,
|
36279 | startY: 0,
|
36280 | scrollX: false,
|
36281 | scrollY: true,
|
36282 | freeScroll: false,
|
36283 | directionLockThreshold: 5,
|
36284 | eventPassthrough: '',
|
36285 | click: false,
|
36286 | tap: false,
|
36287 | |
36288 |
|
36289 |
|
36290 |
|
36291 |
|
36292 |
|
36293 |
|
36294 |
|
36295 |
|
36296 | bounce: true,
|
36297 | bounceTime: 800,
|
36298 | momentum: true,
|
36299 | momentumLimitTime: 300,
|
36300 | momentumLimitDistance: 15,
|
36301 | swipeTime: 2500,
|
36302 | swipeBounceTime: 500,
|
36303 | deceleration: 0.0015,
|
36304 | flickLimitTime: 200,
|
36305 | flickLimitDistance: 100,
|
36306 | resizePolling: 60,
|
36307 | probeType: 0,
|
36308 | preventDefault: true,
|
36309 | preventDefaultException: {
|
36310 | tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT|AUDIO)$/
|
36311 | },
|
36312 | HWCompositing: true,
|
36313 | useTransition: true,
|
36314 | useTransform: true,
|
36315 | bindToWrapper: false,
|
36316 | disableMouse: hasTouch,
|
36317 | disableTouch: !hasTouch,
|
36318 | observeDOM: true,
|
36319 | autoBlur: true,
|
36320 | |
36321 |
|
36322 |
|
36323 |
|
36324 |
|
36325 |
|
36326 |
|
36327 |
|
36328 |
|
36329 |
|
36330 | wheel: false,
|
36331 | |
36332 |
|
36333 |
|
36334 |
|
36335 |
|
36336 |
|
36337 |
|
36338 |
|
36339 |
|
36340 |
|
36341 |
|
36342 |
|
36343 |
|
36344 |
|
36345 |
|
36346 |
|
36347 |
|
36348 |
|
36349 | snap: false,
|
36350 | |
36351 |
|
36352 |
|
36353 |
|
36354 |
|
36355 |
|
36356 |
|
36357 | scrollbar: false,
|
36358 | |
36359 |
|
36360 |
|
36361 |
|
36362 |
|
36363 |
|
36364 |
|
36365 | pullDownRefresh: false,
|
36366 | |
36367 |
|
36368 |
|
36369 |
|
36370 |
|
36371 |
|
36372 | pullUpLoad: false,
|
36373 | |
36374 |
|
36375 |
|
36376 |
|
36377 |
|
36378 |
|
36379 |
|
36380 |
|
36381 | mouseWheel: false,
|
36382 | stopPropagation: false,
|
36383 | |
36384 |
|
36385 |
|
36386 |
|
36387 |
|
36388 |
|
36389 |
|
36390 |
|
36391 | zoom: false,
|
36392 | |
36393 |
|
36394 |
|
36395 |
|
36396 |
|
36397 |
|
36398 |
|
36399 |
|
36400 |
|
36401 |
|
36402 |
|
36403 | infinity: false,
|
36404 | |
36405 |
|
36406 |
|
36407 |
|
36408 |
|
36409 |
|
36410 | dblclick: false
|
36411 | };
|
36412 |
|
36413 | function initMixin(BScroll) {
|
36414 | BScroll.prototype._init = function (options) {
|
36415 | this._handleOptions(options);
|
36416 |
|
36417 |
|
36418 | this._events = {};
|
36419 |
|
36420 | this.x = 0;
|
36421 | this.y = 0;
|
36422 | this.directionX = 0;
|
36423 | this.directionY = 0;
|
36424 |
|
36425 | this.setScale(1);
|
36426 |
|
36427 | this._addDOMEvents();
|
36428 |
|
36429 | this._initExtFeatures();
|
36430 |
|
36431 | this._watchTransition();
|
36432 |
|
36433 | if (this.options.observeDOM) {
|
36434 | this._initDOMObserver();
|
36435 | }
|
36436 |
|
36437 | if (this.options.autoBlur) {
|
36438 | this._handleAutoBlur();
|
36439 | }
|
36440 |
|
36441 | this.refresh();
|
36442 |
|
36443 | if (!this.options.snap) {
|
36444 | this.scrollTo(this.options.startX, this.options.startY);
|
36445 | }
|
36446 |
|
36447 | this.enable();
|
36448 | };
|
36449 |
|
36450 | BScroll.prototype.setScale = function (scale) {
|
36451 | this.lastScale = isUndef(this.scale) ? scale : this.scale;
|
36452 | this.scale = scale;
|
36453 | };
|
36454 |
|
36455 | BScroll.prototype._handleOptions = function (options) {
|
36456 | this.options = extend({}, DEFAULT_OPTIONS, options);
|
36457 |
|
36458 | this.translateZ = this.options.HWCompositing && hasPerspective ? ' translateZ(0)' : '';
|
36459 |
|
36460 | this.options.useTransition = this.options.useTransition && hasTransition;
|
36461 | this.options.useTransform = this.options.useTransform && hasTransform;
|
36462 |
|
36463 | this.options.preventDefault = !this.options.eventPassthrough && this.options.preventDefault;
|
36464 |
|
36465 |
|
36466 | this.options.scrollX = this.options.eventPassthrough === 'horizontal' ? false : this.options.scrollX;
|
36467 | this.options.scrollY = this.options.eventPassthrough === 'vertical' ? false : this.options.scrollY;
|
36468 |
|
36469 |
|
36470 | this.options.freeScroll = this.options.freeScroll && !this.options.eventPassthrough;
|
36471 | this.options.directionLockThreshold = this.options.eventPassthrough ? 0 : this.options.directionLockThreshold;
|
36472 |
|
36473 | if (this.options.tap === true) {
|
36474 | this.options.tap = 'tap';
|
36475 | }
|
36476 | };
|
36477 |
|
36478 | BScroll.prototype._addDOMEvents = function () {
|
36479 | var eventOperation = addEvent;
|
36480 | this._handleDOMEvents(eventOperation);
|
36481 | };
|
36482 |
|
36483 | BScroll.prototype._removeDOMEvents = function () {
|
36484 | var eventOperation = removeEvent;
|
36485 | this._handleDOMEvents(eventOperation);
|
36486 | };
|
36487 |
|
36488 | BScroll.prototype._handleDOMEvents = function (eventOperation) {
|
36489 | var target = this.options.bindToWrapper ? this.wrapper : window;
|
36490 | eventOperation(window, 'orientationchange', this);
|
36491 | eventOperation(window, 'resize', this);
|
36492 |
|
36493 | if (this.options.click) {
|
36494 | eventOperation(this.wrapper, 'click', this, true);
|
36495 | }
|
36496 |
|
36497 | if (!this.options.disableMouse) {
|
36498 | eventOperation(this.wrapper, 'mousedown', this);
|
36499 | eventOperation(target, 'mousemove', this);
|
36500 | eventOperation(target, 'mousecancel', this);
|
36501 | eventOperation(target, 'mouseup', this);
|
36502 | }
|
36503 |
|
36504 | if (hasTouch && !this.options.disableTouch) {
|
36505 | eventOperation(this.wrapper, 'touchstart', this);
|
36506 | eventOperation(target, 'touchmove', this);
|
36507 | eventOperation(target, 'touchcancel', this);
|
36508 | eventOperation(target, 'touchend', this);
|
36509 | }
|
36510 |
|
36511 | eventOperation(this.scroller, bscroll_esm_style.transitionEnd, this);
|
36512 | };
|
36513 |
|
36514 | BScroll.prototype._initExtFeatures = function () {
|
36515 | if (this.options.snap) {
|
36516 | this._initSnap();
|
36517 | }
|
36518 | if (this.options.scrollbar) {
|
36519 | this._initScrollbar();
|
36520 | }
|
36521 | if (this.options.pullUpLoad) {
|
36522 | this._initPullUp();
|
36523 | }
|
36524 | if (this.options.pullDownRefresh) {
|
36525 | this._initPullDown();
|
36526 | }
|
36527 | if (this.options.wheel) {
|
36528 | this._initWheel();
|
36529 | }
|
36530 | if (this.options.mouseWheel) {
|
36531 | this._initMouseWheel();
|
36532 | }
|
36533 | if (this.options.zoom) {
|
36534 | this._initZoom();
|
36535 | }
|
36536 | if (this.options.infinity) {
|
36537 | this._initInfinite();
|
36538 | }
|
36539 | };
|
36540 |
|
36541 | BScroll.prototype._watchTransition = function () {
|
36542 | if (typeof Object.defineProperty !== 'function') {
|
36543 | return;
|
36544 | }
|
36545 | var me = this;
|
36546 | var isInTransition = false;
|
36547 | var key = this.options.useTransition ? 'isInTransition' : 'isAnimating';
|
36548 | Object.defineProperty(this, key, {
|
36549 | get: function get() {
|
36550 | return isInTransition;
|
36551 | },
|
36552 | set: function set(newVal) {
|
36553 | isInTransition = newVal;
|
36554 |
|
36555 | var el = me.scroller.children.length ? me.scroller.children : [me.scroller];
|
36556 | var pointerEvents = isInTransition && !me.pulling ? 'none' : 'auto';
|
36557 | for (var i = 0; i < el.length; i++) {
|
36558 | el[i].style.pointerEvents = pointerEvents;
|
36559 | }
|
36560 | }
|
36561 | });
|
36562 | };
|
36563 |
|
36564 | BScroll.prototype._handleAutoBlur = function () {
|
36565 | this.on('scrollStart', function () {
|
36566 | var activeElement = document.activeElement;
|
36567 | if (activeElement && (activeElement.tagName === 'INPUT' || activeElement.tagName === 'TEXTAREA')) {
|
36568 | activeElement.blur();
|
36569 | }
|
36570 | });
|
36571 | };
|
36572 |
|
36573 | BScroll.prototype._initDOMObserver = function () {
|
36574 | var _this = this;
|
36575 |
|
36576 | if (typeof MutationObserver !== 'undefined') {
|
36577 | var timer = void 0;
|
36578 | var observer = new MutationObserver(function (mutations) {
|
36579 |
|
36580 | if (_this._shouldNotRefresh()) {
|
36581 | return;
|
36582 | }
|
36583 | var immediateRefresh = false;
|
36584 | var deferredRefresh = false;
|
36585 | for (var i = 0; i < mutations.length; i++) {
|
36586 | var mutation = mutations[i];
|
36587 | if (mutation.type !== 'attributes') {
|
36588 | immediateRefresh = true;
|
36589 | break;
|
36590 | } else {
|
36591 | if (mutation.target !== _this.scroller) {
|
36592 | deferredRefresh = true;
|
36593 | break;
|
36594 | }
|
36595 | }
|
36596 | }
|
36597 | if (immediateRefresh) {
|
36598 | _this.refresh();
|
36599 | } else if (deferredRefresh) {
|
36600 |
|
36601 | clearTimeout(timer);
|
36602 | timer = setTimeout(function () {
|
36603 | if (!_this._shouldNotRefresh()) {
|
36604 | _this.refresh();
|
36605 | }
|
36606 | }, 60);
|
36607 | }
|
36608 | });
|
36609 | var config = {
|
36610 | attributes: true,
|
36611 | childList: true,
|
36612 | subtree: true
|
36613 | };
|
36614 | observer.observe(this.scroller, config);
|
36615 |
|
36616 | this.on('destroy', function () {
|
36617 | observer.disconnect();
|
36618 | });
|
36619 | } else {
|
36620 | this._checkDOMUpdate();
|
36621 | }
|
36622 | };
|
36623 |
|
36624 | BScroll.prototype._shouldNotRefresh = function () {
|
36625 | var outsideBoundaries = this.x > this.minScrollX || this.x < this.maxScrollX || this.y > this.minScrollY || this.y < this.maxScrollY;
|
36626 |
|
36627 | return this.isInTransition || this.stopFromTransition || outsideBoundaries;
|
36628 | };
|
36629 |
|
36630 | BScroll.prototype._checkDOMUpdate = function () {
|
36631 | var scrollerRect = getRect(this.scroller);
|
36632 | var oldWidth = scrollerRect.width;
|
36633 | var oldHeight = scrollerRect.height;
|
36634 |
|
36635 | function check() {
|
36636 | if (this.destroyed) {
|
36637 | return;
|
36638 | }
|
36639 | scrollerRect = getRect(this.scroller);
|
36640 | var newWidth = scrollerRect.width;
|
36641 | var newHeight = scrollerRect.height;
|
36642 |
|
36643 | if (oldWidth !== newWidth || oldHeight !== newHeight) {
|
36644 | this.refresh();
|
36645 | }
|
36646 | oldWidth = newWidth;
|
36647 | oldHeight = newHeight;
|
36648 |
|
36649 | next.call(this);
|
36650 | }
|
36651 |
|
36652 | function next() {
|
36653 | var _this2 = this;
|
36654 |
|
36655 | setTimeout(function () {
|
36656 | check.call(_this2);
|
36657 | }, 1000);
|
36658 | }
|
36659 |
|
36660 | next.call(this);
|
36661 | };
|
36662 |
|
36663 | BScroll.prototype.handleEvent = function (e) {
|
36664 | switch (e.type) {
|
36665 | case 'touchstart':
|
36666 | case 'mousedown':
|
36667 | this._start(e);
|
36668 | if (this.options.zoom && e.touches && e.touches.length > 1) {
|
36669 | this._zoomStart(e);
|
36670 | }
|
36671 | break;
|
36672 | case 'touchmove':
|
36673 | case 'mousemove':
|
36674 | if (this.options.zoom && e.touches && e.touches.length > 1) {
|
36675 | this._zoom(e);
|
36676 | } else {
|
36677 | this._move(e);
|
36678 | }
|
36679 | break;
|
36680 | case 'touchend':
|
36681 | case 'mouseup':
|
36682 | case 'touchcancel':
|
36683 | case 'mousecancel':
|
36684 | if (this.scaled) {
|
36685 | this._zoomEnd(e);
|
36686 | } else {
|
36687 | this._end(e);
|
36688 | }
|
36689 | break;
|
36690 | case 'orientationchange':
|
36691 | case 'resize':
|
36692 | this._resize();
|
36693 | break;
|
36694 | case 'transitionend':
|
36695 | case 'webkitTransitionEnd':
|
36696 | case 'oTransitionEnd':
|
36697 | case 'MSTransitionEnd':
|
36698 | this._transitionEnd(e);
|
36699 | break;
|
36700 | case 'click':
|
36701 | if (this.enabled && !e._constructed) {
|
36702 | if (!preventDefaultException(e.target, this.options.preventDefaultException)) {
|
36703 | e.preventDefault();
|
36704 | e.stopPropagation();
|
36705 | }
|
36706 | }
|
36707 | break;
|
36708 | case 'wheel':
|
36709 | case 'DOMMouseScroll':
|
36710 | case 'mousewheel':
|
36711 | this._onMouseWheel(e);
|
36712 | break;
|
36713 | }
|
36714 | };
|
36715 |
|
36716 | BScroll.prototype.refresh = function () {
|
36717 | var isWrapperStatic = window.getComputedStyle(this.wrapper, null).position === 'static';
|
36718 | var wrapperRect = getRect(this.wrapper);
|
36719 | this.wrapperWidth = wrapperRect.width;
|
36720 | this.wrapperHeight = wrapperRect.height;
|
36721 |
|
36722 | var scrollerRect = getRect(this.scroller);
|
36723 | this.scrollerWidth = Math.round(scrollerRect.width * this.scale);
|
36724 | this.scrollerHeight = Math.round(scrollerRect.height * this.scale);
|
36725 |
|
36726 | this.relativeX = scrollerRect.left;
|
36727 | this.relativeY = scrollerRect.top;
|
36728 |
|
36729 | if (isWrapperStatic) {
|
36730 | this.relativeX -= wrapperRect.left;
|
36731 | this.relativeY -= wrapperRect.top;
|
36732 | }
|
36733 |
|
36734 | this.minScrollX = 0;
|
36735 | this.minScrollY = 0;
|
36736 |
|
36737 | var wheel = this.options.wheel;
|
36738 | if (wheel) {
|
36739 | this.items = this.scroller.children;
|
36740 |
|
36741 | this._checkWheelAllDisabled();
|
36742 | this.options.itemHeight = this.itemHeight = this.items.length ? this.scrollerHeight / this.items.length : 0;
|
36743 | if (this.selectedIndex === undefined) {
|
36744 | this.selectedIndex = wheel.selectedIndex || 0;
|
36745 | }
|
36746 | this.options.startY = -this.selectedIndex * this.itemHeight;
|
36747 |
|
36748 | this.maxScrollX = 0;
|
36749 | this.maxScrollY = -this.itemHeight * (this.items.length - 1);
|
36750 | } else {
|
36751 | this.maxScrollX = this.wrapperWidth - this.scrollerWidth;
|
36752 | if (!this.options.infinity) {
|
36753 | this.maxScrollY = this.wrapperHeight - this.scrollerHeight;
|
36754 | }
|
36755 | if (this.maxScrollX < 0) {
|
36756 | this.maxScrollX -= this.relativeX;
|
36757 | this.minScrollX = -this.relativeX;
|
36758 | } else if (this.scale > 1) {
|
36759 | this.maxScrollX = this.maxScrollX / 2 - this.relativeX;
|
36760 | this.minScrollX = this.maxScrollX;
|
36761 | }
|
36762 | if (this.maxScrollY < 0) {
|
36763 | this.maxScrollY -= this.relativeY;
|
36764 | this.minScrollY = -this.relativeY;
|
36765 | } else if (this.scale > 1) {
|
36766 | this.maxScrollY = this.maxScrollY / 2 - this.relativeY;
|
36767 | this.minScrollY = this.maxScrollY;
|
36768 | }
|
36769 | }
|
36770 |
|
36771 | this.hasHorizontalScroll = this.options.scrollX && this.maxScrollX < this.minScrollX;
|
36772 | this.hasVerticalScroll = this.options.scrollY && this.maxScrollY < this.minScrollY;
|
36773 |
|
36774 | if (!this.hasHorizontalScroll) {
|
36775 | this.maxScrollX = this.minScrollX;
|
36776 | this.scrollerWidth = this.wrapperWidth;
|
36777 | }
|
36778 |
|
36779 | if (!this.hasVerticalScroll) {
|
36780 | this.maxScrollY = this.minScrollY;
|
36781 | this.scrollerHeight = this.wrapperHeight;
|
36782 | }
|
36783 |
|
36784 | this.endTime = 0;
|
36785 | this.directionX = 0;
|
36786 | this.directionY = 0;
|
36787 | this.wrapperOffset = offset(this.wrapper);
|
36788 |
|
36789 | this.trigger('refresh');
|
36790 |
|
36791 | !this.scaled && this.resetPosition();
|
36792 | };
|
36793 |
|
36794 | BScroll.prototype.enable = function () {
|
36795 | this.enabled = true;
|
36796 | };
|
36797 |
|
36798 | BScroll.prototype.disable = function () {
|
36799 | this.enabled = false;
|
36800 | };
|
36801 | }
|
36802 |
|
36803 | var ease = {
|
36804 |
|
36805 | swipe: {
|
36806 | style: 'cubic-bezier(0.23, 1, 0.32, 1)',
|
36807 | fn: function fn(t) {
|
36808 | return 1 + --t * t * t * t * t;
|
36809 | }
|
36810 | },
|
36811 |
|
36812 | swipeBounce: {
|
36813 | style: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)',
|
36814 | fn: function fn(t) {
|
36815 | return t * (2 - t);
|
36816 | }
|
36817 | },
|
36818 |
|
36819 | bounce: {
|
36820 | style: 'cubic-bezier(0.165, 0.84, 0.44, 1)',
|
36821 | fn: function fn(t) {
|
36822 | return 1 - --t * t * t * t;
|
36823 | }
|
36824 | }
|
36825 | };
|
36826 |
|
36827 | function momentum(current, start, time, lowerMargin, upperMargin, wrapperSize, options, scroll) {
|
36828 | var distance = current - start;
|
36829 | var speed = Math.abs(distance) / time;
|
36830 |
|
36831 | var deceleration = options.deceleration,
|
36832 | itemHeight = options.itemHeight,
|
36833 | swipeBounceTime = options.swipeBounceTime,
|
36834 | wheel = options.wheel,
|
36835 | swipeTime = options.swipeTime;
|
36836 |
|
36837 | var duration = swipeTime;
|
36838 | var rate = wheel ? 4 : 15;
|
36839 |
|
36840 | var destination = current + speed / deceleration * (distance < 0 ? -1 : 1);
|
36841 |
|
36842 | if (wheel && itemHeight) {
|
36843 | destination = scroll._findNearestValidWheel(destination).y;
|
36844 | }
|
36845 |
|
36846 | if (destination < lowerMargin) {
|
36847 | destination = wrapperSize ? Math.max(lowerMargin - wrapperSize / 4, lowerMargin - wrapperSize / rate * speed) : lowerMargin;
|
36848 | duration = swipeBounceTime;
|
36849 | } else if (destination > upperMargin) {
|
36850 | destination = wrapperSize ? Math.min(upperMargin + wrapperSize / 4, upperMargin + wrapperSize / rate * speed) : upperMargin;
|
36851 | duration = swipeBounceTime;
|
36852 | }
|
36853 |
|
36854 | return {
|
36855 | destination: Math.round(destination),
|
36856 | duration: duration
|
36857 | };
|
36858 | }
|
36859 |
|
36860 | var DEFAULT_INTERVAL = 100 / 60;
|
36861 |
|
36862 | function bscroll_esm_noop() {}
|
36863 |
|
36864 | var bscroll_esm_requestAnimationFrame = function () {
|
36865 | if (!inBrowser) {
|
36866 |
|
36867 | return bscroll_esm_noop;
|
36868 | }
|
36869 | return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame ||
|
36870 |
|
36871 | function (callback) {
|
36872 | return window.setTimeout(callback, (callback.interval || DEFAULT_INTERVAL) / 2);
|
36873 | };
|
36874 | }();
|
36875 |
|
36876 | var cancelAnimationFrame = function () {
|
36877 | if (!inBrowser) {
|
36878 |
|
36879 | return bscroll_esm_noop;
|
36880 | }
|
36881 | return window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || function (id) {
|
36882 | window.clearTimeout(id);
|
36883 | };
|
36884 | }();
|
36885 |
|
36886 | var DIRECTION_UP = 1;
|
36887 | var DIRECTION_DOWN = -1;
|
36888 | var DIRECTION_LEFT = 1;
|
36889 | var DIRECTION_RIGHT = -1;
|
36890 |
|
36891 | var PROBE_DEBOUNCE = 1;
|
36892 |
|
36893 | var PROBE_REALTIME = 3;
|
36894 |
|
36895 | function warn(msg) {
|
36896 | console.error('[BScroll warn]: ' + msg);
|
36897 | }
|
36898 |
|
36899 | function assert(condition, msg) {
|
36900 | if (!condition) {
|
36901 | throw new Error('[BScroll] ' + msg);
|
36902 | }
|
36903 | }
|
36904 |
|
36905 | function coreMixin(BScroll) {
|
36906 | BScroll.prototype._start = function (e) {
|
36907 | var _eventType = eventType[e.type];
|
36908 | if (_eventType !== TOUCH_EVENT) {
|
36909 | if (e.button !== 0) {
|
36910 | return;
|
36911 | }
|
36912 | }
|
36913 | if (!this.enabled || this.destroyed || this.initiated && this.initiated !== _eventType) {
|
36914 | return;
|
36915 | }
|
36916 | this.initiated = _eventType;
|
36917 |
|
36918 | if (this.options.preventDefault && !preventDefaultException(e.target, this.options.preventDefaultException)) {
|
36919 | e.preventDefault();
|
36920 | }
|
36921 | if (this.options.stopPropagation) {
|
36922 | e.stopPropagation();
|
36923 | }
|
36924 |
|
36925 | this.moved = false;
|
36926 | this.distX = 0;
|
36927 | this.distY = 0;
|
36928 | this.directionX = 0;
|
36929 | this.directionY = 0;
|
36930 | this.movingDirectionX = 0;
|
36931 | this.movingDirectionY = 0;
|
36932 | this.directionLocked = 0;
|
36933 |
|
36934 | this._transitionTime();
|
36935 | this.startTime = getNow();
|
36936 |
|
36937 | if (this.options.wheel) {
|
36938 | this.target = e.target;
|
36939 | }
|
36940 |
|
36941 | this.stop();
|
36942 |
|
36943 | var point = e.touches ? e.touches[0] : e;
|
36944 |
|
36945 | this.startX = this.x;
|
36946 | this.startY = this.y;
|
36947 | this.absStartX = this.x;
|
36948 | this.absStartY = this.y;
|
36949 | this.pointX = point.pageX;
|
36950 | this.pointY = point.pageY;
|
36951 |
|
36952 | this.trigger('beforeScrollStart');
|
36953 | };
|
36954 |
|
36955 | BScroll.prototype._move = function (e) {
|
36956 | if (!this.enabled || this.destroyed || eventType[e.type] !== this.initiated) {
|
36957 | return;
|
36958 | }
|
36959 |
|
36960 | if (this.options.preventDefault) {
|
36961 | e.preventDefault();
|
36962 | }
|
36963 | if (this.options.stopPropagation) {
|
36964 | e.stopPropagation();
|
36965 | }
|
36966 |
|
36967 | var point = e.touches ? e.touches[0] : e;
|
36968 | var deltaX = point.pageX - this.pointX;
|
36969 | var deltaY = point.pageY - this.pointY;
|
36970 |
|
36971 | this.pointX = point.pageX;
|
36972 | this.pointY = point.pageY;
|
36973 |
|
36974 | this.distX += deltaX;
|
36975 | this.distY += deltaY;
|
36976 |
|
36977 | var absDistX = Math.abs(this.distX);
|
36978 | var absDistY = Math.abs(this.distY);
|
36979 |
|
36980 | var timestamp = getNow();
|
36981 |
|
36982 |
|
36983 | if (timestamp - this.endTime > this.options.momentumLimitTime && !this.moved && absDistY < this.options.momentumLimitDistance && absDistX < this.options.momentumLimitDistance) {
|
36984 | return;
|
36985 | }
|
36986 |
|
36987 |
|
36988 | if (!this.directionLocked && !this.options.freeScroll) {
|
36989 | if (absDistX > absDistY + this.options.directionLockThreshold) {
|
36990 | this.directionLocked = 'h';
|
36991 | } else if (absDistY >= absDistX + this.options.directionLockThreshold) {
|
36992 | this.directionLocked = 'v';
|
36993 | } else {
|
36994 | this.directionLocked = 'n';
|
36995 | }
|
36996 | }
|
36997 |
|
36998 | if (this.directionLocked === 'h') {
|
36999 | if (this.options.eventPassthrough === 'vertical') {
|
37000 | e.preventDefault();
|
37001 | } else if (this.options.eventPassthrough === 'horizontal') {
|
37002 | this.initiated = false;
|
37003 | return;
|
37004 | }
|
37005 | deltaY = 0;
|
37006 | } else if (this.directionLocked === 'v') {
|
37007 | if (this.options.eventPassthrough === 'horizontal') {
|
37008 | e.preventDefault();
|
37009 | } else if (this.options.eventPassthrough === 'vertical') {
|
37010 | this.initiated = false;
|
37011 | return;
|
37012 | }
|
37013 | deltaX = 0;
|
37014 | }
|
37015 |
|
37016 | deltaX = this.hasHorizontalScroll ? deltaX : 0;
|
37017 | deltaY = this.hasVerticalScroll ? deltaY : 0;
|
37018 | this.movingDirectionX = deltaX > 0 ? DIRECTION_RIGHT : deltaX < 0 ? DIRECTION_LEFT : 0;
|
37019 | this.movingDirectionY = deltaY > 0 ? DIRECTION_DOWN : deltaY < 0 ? DIRECTION_UP : 0;
|
37020 |
|
37021 | var newX = this.x + deltaX;
|
37022 | var newY = this.y + deltaY;
|
37023 |
|
37024 | var top = false;
|
37025 | var bottom = false;
|
37026 | var left = false;
|
37027 | var right = false;
|
37028 |
|
37029 | var bounce = this.options.bounce;
|
37030 | if (bounce !== false) {
|
37031 | top = bounce.top === undefined ? true : bounce.top;
|
37032 | bottom = bounce.bottom === undefined ? true : bounce.bottom;
|
37033 | left = bounce.left === undefined ? true : bounce.left;
|
37034 | right = bounce.right === undefined ? true : bounce.right;
|
37035 | }
|
37036 | if (newX > this.minScrollX || newX < this.maxScrollX) {
|
37037 | if (newX > this.minScrollX && left || newX < this.maxScrollX && right) {
|
37038 | newX = this.x + deltaX / 3;
|
37039 | } else {
|
37040 | newX = newX > this.minScrollX ? this.minScrollX : this.maxScrollX;
|
37041 | }
|
37042 | }
|
37043 | if (newY > this.minScrollY || newY < this.maxScrollY) {
|
37044 | if (newY > this.minScrollY && top || newY < this.maxScrollY && bottom) {
|
37045 | newY = this.y + deltaY / 3;
|
37046 | } else {
|
37047 | newY = newY > this.minScrollY ? this.minScrollY : this.maxScrollY;
|
37048 | }
|
37049 | }
|
37050 |
|
37051 | if (!this.moved) {
|
37052 | this.moved = true;
|
37053 | this.trigger('scrollStart');
|
37054 | }
|
37055 |
|
37056 | this._translate(newX, newY);
|
37057 |
|
37058 | if (timestamp - this.startTime > this.options.momentumLimitTime) {
|
37059 | this.startTime = timestamp;
|
37060 | this.startX = this.x;
|
37061 | this.startY = this.y;
|
37062 |
|
37063 | if (this.options.probeType === PROBE_DEBOUNCE) {
|
37064 | this.trigger('scroll', {
|
37065 | x: this.x,
|
37066 | y: this.y
|
37067 | });
|
37068 | }
|
37069 | }
|
37070 |
|
37071 | if (this.options.probeType > PROBE_DEBOUNCE) {
|
37072 | this.trigger('scroll', {
|
37073 | x: this.x,
|
37074 | y: this.y
|
37075 | });
|
37076 | }
|
37077 |
|
37078 | var scrollLeft = document.documentElement.scrollLeft || window.pageXOffset || document.body.scrollLeft;
|
37079 | var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;
|
37080 |
|
37081 | var pX = this.pointX - scrollLeft;
|
37082 | var pY = this.pointY - scrollTop;
|
37083 |
|
37084 | if (pX > document.documentElement.clientWidth - this.options.momentumLimitDistance || pX < this.options.momentumLimitDistance || pY < this.options.momentumLimitDistance || pY > document.documentElement.clientHeight - this.options.momentumLimitDistance) {
|
37085 | this._end(e);
|
37086 | }
|
37087 | };
|
37088 |
|
37089 | BScroll.prototype._end = function (e) {
|
37090 | if (!this.enabled || this.destroyed || eventType[e.type] !== this.initiated) {
|
37091 | return;
|
37092 | }
|
37093 | this.initiated = false;
|
37094 |
|
37095 | if (this.options.preventDefault && !preventDefaultException(e.target, this.options.preventDefaultException)) {
|
37096 | e.preventDefault();
|
37097 | }
|
37098 | if (this.options.stopPropagation) {
|
37099 | e.stopPropagation();
|
37100 | }
|
37101 |
|
37102 | this.trigger('touchEnd', {
|
37103 | x: this.x,
|
37104 | y: this.y
|
37105 | });
|
37106 |
|
37107 | this.isInTransition = false;
|
37108 |
|
37109 |
|
37110 | var newX = Math.round(this.x);
|
37111 | var newY = Math.round(this.y);
|
37112 |
|
37113 | var deltaX = newX - this.absStartX;
|
37114 | var deltaY = newY - this.absStartY;
|
37115 | this.directionX = deltaX > 0 ? DIRECTION_RIGHT : deltaX < 0 ? DIRECTION_LEFT : 0;
|
37116 | this.directionY = deltaY > 0 ? DIRECTION_DOWN : deltaY < 0 ? DIRECTION_UP : 0;
|
37117 |
|
37118 |
|
37119 | if (this.options.pullDownRefresh && this._checkPullDown()) {
|
37120 | return;
|
37121 | }
|
37122 |
|
37123 |
|
37124 | if (this._checkClick(e)) {
|
37125 | this.trigger('scrollCancel');
|
37126 | return;
|
37127 | }
|
37128 |
|
37129 |
|
37130 | if (this.resetPosition(this.options.bounceTime, ease.bounce)) {
|
37131 | return;
|
37132 | }
|
37133 |
|
37134 | this._translate(newX, newY);
|
37135 |
|
37136 | this.endTime = getNow();
|
37137 | var duration = this.endTime - this.startTime;
|
37138 | var absDistX = Math.abs(newX - this.startX);
|
37139 | var absDistY = Math.abs(newY - this.startY);
|
37140 |
|
37141 |
|
37142 | if (this._events.flick && duration < this.options.flickLimitTime && absDistX < this.options.flickLimitDistance && absDistY < this.options.flickLimitDistance) {
|
37143 | this.trigger('flick');
|
37144 | return;
|
37145 | }
|
37146 |
|
37147 | var time = 0;
|
37148 |
|
37149 | if (this.options.momentum && duration < this.options.momentumLimitTime && (absDistY > this.options.momentumLimitDistance || absDistX > this.options.momentumLimitDistance)) {
|
37150 | var top = false;
|
37151 | var bottom = false;
|
37152 | var left = false;
|
37153 | var right = false;
|
37154 | var bounce = this.options.bounce;
|
37155 | if (bounce !== false) {
|
37156 | top = bounce.top === undefined ? true : bounce.top;
|
37157 | bottom = bounce.bottom === undefined ? true : bounce.bottom;
|
37158 | left = bounce.left === undefined ? true : bounce.left;
|
37159 | right = bounce.right === undefined ? true : bounce.right;
|
37160 | }
|
37161 | var wrapperWidth = this.directionX === DIRECTION_RIGHT && left || this.directionX === DIRECTION_LEFT && right ? this.wrapperWidth : 0;
|
37162 | var wrapperHeight = this.directionY === DIRECTION_DOWN && top || this.directionY === DIRECTION_UP && bottom ? this.wrapperHeight : 0;
|
37163 | var momentumX = this.hasHorizontalScroll ? momentum(this.x, this.startX, duration, this.maxScrollX, this.minScrollX, wrapperWidth, this.options, this) : { destination: newX, duration: 0 };
|
37164 | var momentumY = this.hasVerticalScroll ? momentum(this.y, this.startY, duration, this.maxScrollY, this.minScrollY, wrapperHeight, this.options, this) : { destination: newY, duration: 0 };
|
37165 | newX = momentumX.destination;
|
37166 | newY = momentumY.destination;
|
37167 | time = Math.max(momentumX.duration, momentumY.duration);
|
37168 | this.isInTransition = true;
|
37169 | } else {
|
37170 | if (this.options.wheel) {
|
37171 | newY = this._findNearestValidWheel(newY).y;
|
37172 | time = this.options.wheel.adjustTime || 400;
|
37173 | }
|
37174 | }
|
37175 |
|
37176 | var easing = ease.swipe;
|
37177 | if (this.options.snap) {
|
37178 | var snap = this._nearestSnap(newX, newY);
|
37179 | this.currentPage = snap;
|
37180 | time = this.options.snapSpeed || Math.max(Math.max(Math.min(Math.abs(newX - snap.x), 1000), Math.min(Math.abs(newY - snap.y), 1000)), 300);
|
37181 | newX = snap.x;
|
37182 | newY = snap.y;
|
37183 |
|
37184 | this.directionX = 0;
|
37185 | this.directionY = 0;
|
37186 | easing = this.options.snap.easing || ease.bounce;
|
37187 | }
|
37188 |
|
37189 | if (newX !== this.x || newY !== this.y) {
|
37190 |
|
37191 | if (newX > this.minScrollX || newX < this.maxScrollX || newY > this.minScrollY || newY < this.maxScrollY) {
|
37192 | easing = ease.swipeBounce;
|
37193 | }
|
37194 | this.scrollTo(newX, newY, time, easing);
|
37195 | return;
|
37196 | }
|
37197 |
|
37198 | if (this.options.wheel) {
|
37199 | this.selectedIndex = this._findNearestValidWheel(this.y).index;
|
37200 | }
|
37201 |
|
37202 | this.trigger('scrollEnd', {
|
37203 | x: this.x,
|
37204 | y: this.y
|
37205 | });
|
37206 | };
|
37207 |
|
37208 | BScroll.prototype._checkClick = function (e) {
|
37209 |
|
37210 | var preventClick = this.stopFromTransition && !this.pulling;
|
37211 | this.stopFromTransition = false;
|
37212 |
|
37213 |
|
37214 | if (!this.moved) {
|
37215 | if (this.options.wheel) {
|
37216 | if (this.target && this.target.className === this.options.wheel.wheelWrapperClass) {
|
37217 | var index = this._findNearestValidWheel(this.y).index;
|
37218 | var _offset = Math.round((this.pointY + offsetToBody(this.wrapper).top - this.wrapperHeight / 2) / this.itemHeight);
|
37219 | this.target = this.items[index + _offset];
|
37220 | }
|
37221 | var top = offset(this.target).top;
|
37222 | var left = offset(this.target).left;
|
37223 | top -= this.wrapperOffset.top;
|
37224 | top -= Math.round(this.target.offsetHeight / 2 - this.wrapper.offsetHeight / 2) || 0;
|
37225 | left -= this.wrapperOffset.left;
|
37226 | left -= Math.round(this.target.offsetWidth / 2 - this.wrapper.offsetWidth / 2) || 0;
|
37227 |
|
37228 | top = this._findNearestValidWheel(top).y;
|
37229 | this.scrollTo(left, top, this.options.wheel.adjustTime || 400, ease.swipe);
|
37230 | return true;
|
37231 | } else {
|
37232 | if (!preventClick) {
|
37233 | var _dblclick = this.options.dblclick;
|
37234 | var dblclickTrigged = false;
|
37235 | if (_dblclick && this.lastClickTime) {
|
37236 | var _dblclick$delay = _dblclick.delay,
|
37237 | delay = _dblclick$delay === undefined ? 300 : _dblclick$delay;
|
37238 |
|
37239 | if (getNow() - this.lastClickTime < delay) {
|
37240 | dblclickTrigged = true;
|
37241 | dblclick(e);
|
37242 | }
|
37243 | }
|
37244 | if (this.options.tap) {
|
37245 | tap(e, this.options.tap);
|
37246 | }
|
37247 |
|
37248 | if (this.options.click && !preventDefaultException(e.target, this.options.preventDefaultException)) {
|
37249 | click(e);
|
37250 | }
|
37251 | this.lastClickTime = dblclickTrigged ? null : getNow();
|
37252 | return true;
|
37253 | }
|
37254 | return false;
|
37255 | }
|
37256 | }
|
37257 | return false;
|
37258 | };
|
37259 |
|
37260 | BScroll.prototype._resize = function () {
|
37261 | var _this = this;
|
37262 |
|
37263 | if (!this.enabled) {
|
37264 | return;
|
37265 | }
|
37266 |
|
37267 | if (isAndroid) {
|
37268 | this.wrapper.scrollTop = 0;
|
37269 | }
|
37270 | clearTimeout(this.resizeTimeout);
|
37271 | this.resizeTimeout = setTimeout(function () {
|
37272 | _this.refresh();
|
37273 | }, this.options.resizePolling);
|
37274 | };
|
37275 |
|
37276 | BScroll.prototype._startProbe = function () {
|
37277 | cancelAnimationFrame(this.probeTimer);
|
37278 | this.probeTimer = bscroll_esm_requestAnimationFrame(probe);
|
37279 |
|
37280 | var me = this;
|
37281 |
|
37282 | function probe() {
|
37283 | var pos = me.getComputedPosition();
|
37284 | me.trigger('scroll', pos);
|
37285 | if (!me.isInTransition) {
|
37286 | me.trigger('scrollEnd', pos);
|
37287 | return;
|
37288 | }
|
37289 | me.probeTimer = bscroll_esm_requestAnimationFrame(probe);
|
37290 | }
|
37291 | };
|
37292 |
|
37293 | BScroll.prototype._transitionTime = function () {
|
37294 | var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
37295 |
|
37296 | this.scrollerStyle[bscroll_esm_style.transitionDuration] = time + 'ms';
|
37297 |
|
37298 | if (this.options.wheel) {
|
37299 | for (var i = 0; i < this.items.length; i++) {
|
37300 | this.items[i].style[bscroll_esm_style.transitionDuration] = time + 'ms';
|
37301 | }
|
37302 | }
|
37303 |
|
37304 | if (this.indicators) {
|
37305 | for (var _i = 0; _i < this.indicators.length; _i++) {
|
37306 | this.indicators[_i].transitionTime(time);
|
37307 | }
|
37308 | }
|
37309 | };
|
37310 |
|
37311 | BScroll.prototype._transitionTimingFunction = function (easing) {
|
37312 | this.scrollerStyle[bscroll_esm_style.transitionTimingFunction] = easing;
|
37313 |
|
37314 | if (this.options.wheel) {
|
37315 | for (var i = 0; i < this.items.length; i++) {
|
37316 | this.items[i].style[bscroll_esm_style.transitionTimingFunction] = easing;
|
37317 | }
|
37318 | }
|
37319 |
|
37320 | if (this.indicators) {
|
37321 | for (var _i2 = 0; _i2 < this.indicators.length; _i2++) {
|
37322 | this.indicators[_i2].transitionTimingFunction(easing);
|
37323 | }
|
37324 | }
|
37325 | };
|
37326 |
|
37327 | BScroll.prototype._transitionEnd = function (e) {
|
37328 | if (e.target !== this.scroller || !this.isInTransition) {
|
37329 | return;
|
37330 | }
|
37331 |
|
37332 | this._transitionTime();
|
37333 | var needReset = !this.pulling || this.movingDirectionY === DIRECTION_UP;
|
37334 | if (needReset && !this.resetPosition(this.options.bounceTime, ease.bounce)) {
|
37335 | this.isInTransition = false;
|
37336 | if (this.options.probeType !== PROBE_REALTIME) {
|
37337 | this.trigger('scrollEnd', {
|
37338 | x: this.x,
|
37339 | y: this.y
|
37340 | });
|
37341 | }
|
37342 | }
|
37343 | };
|
37344 |
|
37345 | BScroll.prototype._translate = function (x, y, scale) {
|
37346 | assert(!isUndef(x) && !isUndef(y), 'Translate x or y is null or undefined.');
|
37347 | if (isUndef(scale)) {
|
37348 | scale = this.scale;
|
37349 | }
|
37350 | if (this.options.useTransform) {
|
37351 | this.scrollerStyle[bscroll_esm_style.transform] = 'translate(' + x + 'px,' + y + 'px) scale(' + scale + ')' + this.translateZ;
|
37352 | } else {
|
37353 | x = Math.round(x);
|
37354 | y = Math.round(y);
|
37355 | this.scrollerStyle.left = x + 'px';
|
37356 | this.scrollerStyle.top = y + 'px';
|
37357 | }
|
37358 |
|
37359 | if (this.options.wheel) {
|
37360 | var _options$wheel$rotate = this.options.wheel.rotate,
|
37361 | rotate = _options$wheel$rotate === undefined ? 25 : _options$wheel$rotate;
|
37362 |
|
37363 | for (var i = 0; i < this.items.length; i++) {
|
37364 | var deg = rotate * (y / this.itemHeight + i);
|
37365 | this.items[i].style[bscroll_esm_style.transform] = 'rotateX(' + deg + 'deg)';
|
37366 | }
|
37367 | }
|
37368 |
|
37369 | this.x = x;
|
37370 | this.y = y;
|
37371 | this.setScale(scale);
|
37372 |
|
37373 | if (this.indicators) {
|
37374 | for (var _i3 = 0; _i3 < this.indicators.length; _i3++) {
|
37375 | this.indicators[_i3].updatePosition();
|
37376 | }
|
37377 | }
|
37378 | };
|
37379 |
|
37380 | BScroll.prototype._animate = function (destX, destY, duration, easingFn) {
|
37381 | var me = this;
|
37382 | var startX = this.x;
|
37383 | var startY = this.y;
|
37384 | var startScale = this.lastScale;
|
37385 | var destScale = this.scale;
|
37386 | var startTime = getNow();
|
37387 | var destTime = startTime + duration;
|
37388 |
|
37389 | function step() {
|
37390 | var now = getNow();
|
37391 |
|
37392 | if (now >= destTime) {
|
37393 | me.isAnimating = false;
|
37394 | me._translate(destX, destY, destScale);
|
37395 |
|
37396 | me.trigger('scroll', {
|
37397 | x: me.x,
|
37398 | y: me.y
|
37399 | });
|
37400 |
|
37401 | if (!me.pulling && !me.resetPosition(me.options.bounceTime)) {
|
37402 | me.trigger('scrollEnd', {
|
37403 | x: me.x,
|
37404 | y: me.y
|
37405 | });
|
37406 | }
|
37407 | return;
|
37408 | }
|
37409 | now = (now - startTime) / duration;
|
37410 | var easing = easingFn(now);
|
37411 | var newX = (destX - startX) * easing + startX;
|
37412 | var newY = (destY - startY) * easing + startY;
|
37413 | var newScale = (destScale - startScale) * easing + startScale;
|
37414 |
|
37415 | me._translate(newX, newY, newScale);
|
37416 |
|
37417 | if (me.isAnimating) {
|
37418 | me.animateTimer = bscroll_esm_requestAnimationFrame(step);
|
37419 | }
|
37420 |
|
37421 | if (me.options.probeType === PROBE_REALTIME) {
|
37422 | me.trigger('scroll', {
|
37423 | x: me.x,
|
37424 | y: me.y
|
37425 | });
|
37426 | }
|
37427 | }
|
37428 |
|
37429 | this.isAnimating = true;
|
37430 | cancelAnimationFrame(this.animateTimer);
|
37431 | step();
|
37432 | };
|
37433 |
|
37434 | BScroll.prototype.scrollBy = function (x, y) {
|
37435 | var time = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
37436 | var easing = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ease.bounce;
|
37437 |
|
37438 | x = this.x + x;
|
37439 | y = this.y + y;
|
37440 |
|
37441 | this.scrollTo(x, y, time, easing);
|
37442 | };
|
37443 |
|
37444 | BScroll.prototype.scrollTo = function (x, y) {
|
37445 | var time = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
37446 | var easing = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ease.bounce;
|
37447 | var isSilent = arguments[4];
|
37448 |
|
37449 | if (this.options.wheel) {
|
37450 | y = this._findNearestValidWheel(y).y;
|
37451 | }
|
37452 | if (x === this.x && y === this.y) {
|
37453 | return;
|
37454 | }
|
37455 | this.isInTransition = this.options.useTransition && time > 0 && (this.x !== x || this.y !== y);
|
37456 |
|
37457 | if (!time || this.options.useTransition) {
|
37458 | this._transitionTimingFunction(easing.style);
|
37459 | this._transitionTime(time);
|
37460 | this._translate(x, y);
|
37461 |
|
37462 | if (time && this.options.probeType === PROBE_REALTIME) {
|
37463 | this._startProbe();
|
37464 | }
|
37465 | if (!time && !isSilent) {
|
37466 |
|
37467 | if (this.options.zoom) return;
|
37468 | this.trigger('scroll', {
|
37469 | x: x,
|
37470 | y: y
|
37471 | });
|
37472 |
|
37473 | this._reflow = document.body.offsetHeight;
|
37474 | if (!this.resetPosition(this.options.bounceTime, ease.bounce)) {
|
37475 | this.trigger('scrollEnd', {
|
37476 | x: x,
|
37477 | y: y
|
37478 | });
|
37479 | }
|
37480 | }
|
37481 |
|
37482 | if (this.options.wheel) {
|
37483 | this.selectedIndex = this._findNearestValidWheel(y).index;
|
37484 | }
|
37485 | } else {
|
37486 | this._animate(x, y, time, easing.fn);
|
37487 | }
|
37488 | };
|
37489 |
|
37490 | BScroll.prototype.scrollToElement = function (el, time, offsetX, offsetY, easing) {
|
37491 | if (!el) {
|
37492 | return;
|
37493 | }
|
37494 | el = el.nodeType ? el : this.scroller.querySelector(el);
|
37495 |
|
37496 | if (this.options.wheel && !el.classList.contains(this.options.wheel.wheelItemClass)) {
|
37497 | return;
|
37498 | }
|
37499 |
|
37500 | var pos = offset(el);
|
37501 | pos.left -= this.wrapperOffset.left;
|
37502 | pos.top -= this.wrapperOffset.top;
|
37503 |
|
37504 |
|
37505 | if (offsetX === true) {
|
37506 | offsetX = Math.round(el.offsetWidth / 2 - this.wrapper.offsetWidth / 2);
|
37507 | }
|
37508 | if (offsetY === true) {
|
37509 | offsetY = Math.round(el.offsetHeight / 2 - this.wrapper.offsetHeight / 2);
|
37510 | }
|
37511 |
|
37512 | pos.left -= offsetX || 0;
|
37513 | pos.top -= offsetY || 0;
|
37514 | pos.left = pos.left > this.minScrollX ? this.minScrollX : pos.left < this.maxScrollX ? this.maxScrollX : pos.left;
|
37515 | pos.top = pos.top > this.minScrollY ? this.minScrollY : pos.top < this.maxScrollY ? this.maxScrollY : pos.top;
|
37516 |
|
37517 | if (this.options.wheel) {
|
37518 | pos.top = this._findNearestValidWheel(pos.top).y;
|
37519 | }
|
37520 |
|
37521 | this.scrollTo(pos.left, pos.top, time, easing);
|
37522 | };
|
37523 |
|
37524 | BScroll.prototype.resetPosition = function () {
|
37525 | var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
37526 | var easeing = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ease.bounce;
|
37527 |
|
37528 | var x = this.x;
|
37529 | var roundX = Math.round(x);
|
37530 | if (!this.hasHorizontalScroll || roundX > this.minScrollX) {
|
37531 | x = this.minScrollX;
|
37532 | } else if (roundX < this.maxScrollX) {
|
37533 | x = this.maxScrollX;
|
37534 | }
|
37535 |
|
37536 | var y = this.y;
|
37537 | var roundY = Math.round(y);
|
37538 | if (!this.hasVerticalScroll || roundY > this.minScrollY) {
|
37539 | y = this.minScrollY;
|
37540 | } else if (roundY < this.maxScrollY) {
|
37541 | y = this.maxScrollY;
|
37542 | }
|
37543 |
|
37544 | if (x === this.x && y === this.y) {
|
37545 | return false;
|
37546 | }
|
37547 |
|
37548 | this.scrollTo(x, y, time, easeing);
|
37549 |
|
37550 | return true;
|
37551 | };
|
37552 |
|
37553 | BScroll.prototype.getComputedPosition = function () {
|
37554 | var matrix = window.getComputedStyle(this.scroller, null);
|
37555 | var x = void 0;
|
37556 | var y = void 0;
|
37557 |
|
37558 | if (this.options.useTransform) {
|
37559 | matrix = matrix[bscroll_esm_style.transform].split(')')[0].split(', ');
|
37560 | x = +(matrix[12] || matrix[4]);
|
37561 | y = +(matrix[13] || matrix[5]);
|
37562 | } else {
|
37563 | x = +matrix.left.replace(/[^-\d.]/g, '');
|
37564 | y = +matrix.top.replace(/[^-\d.]/g, '');
|
37565 | }
|
37566 |
|
37567 | return {
|
37568 | x: x,
|
37569 | y: y
|
37570 | };
|
37571 | };
|
37572 |
|
37573 | BScroll.prototype.stop = function () {
|
37574 | if (this.options.useTransition && this.isInTransition) {
|
37575 | this.isInTransition = false;
|
37576 | cancelAnimationFrame(this.probeTimer);
|
37577 | var pos = this.getComputedPosition();
|
37578 | this._translate(pos.x, pos.y);
|
37579 | if (this.options.wheel) {
|
37580 | this.target = this.items[this._findNearestValidWheel(pos.y).index];
|
37581 | } else {
|
37582 | this.trigger('scrollEnd', {
|
37583 | x: this.x,
|
37584 | y: this.y
|
37585 | });
|
37586 | }
|
37587 | this.stopFromTransition = true;
|
37588 | } else if (!this.options.useTransition && this.isAnimating) {
|
37589 | this.isAnimating = false;
|
37590 | cancelAnimationFrame(this.animateTimer);
|
37591 | this.trigger('scrollEnd', {
|
37592 | x: this.x,
|
37593 | y: this.y
|
37594 | });
|
37595 | this.stopFromTransition = true;
|
37596 | }
|
37597 | };
|
37598 |
|
37599 | BScroll.prototype.destroy = function () {
|
37600 | this.destroyed = true;
|
37601 | this.trigger('destroy');
|
37602 | if (this.options.useTransition) {
|
37603 | cancelAnimationFrame(this.probeTimer);
|
37604 | } else {
|
37605 | cancelAnimationFrame(this.animateTimer);
|
37606 | }
|
37607 | this._removeDOMEvents();
|
37608 |
|
37609 | this._events = {};
|
37610 | };
|
37611 | }
|
37612 |
|
37613 | function snapMixin(BScroll) {
|
37614 | BScroll.prototype._initSnap = function () {
|
37615 | var _this = this;
|
37616 |
|
37617 | this.currentPage = {};
|
37618 | var snap = this.options.snap;
|
37619 |
|
37620 | if (snap.loop) {
|
37621 | var children = this.scroller.children;
|
37622 | if (children.length > 1) {
|
37623 | prepend(children[children.length - 1].cloneNode(true), this.scroller);
|
37624 | this.scroller.appendChild(children[1].cloneNode(true));
|
37625 | } else {
|
37626 |
|
37627 | snap.loop = false;
|
37628 | }
|
37629 | }
|
37630 |
|
37631 | var el = snap.el;
|
37632 | if (typeof el === 'string') {
|
37633 | el = this.scroller.querySelectorAll(el);
|
37634 | }
|
37635 |
|
37636 | this.on('refresh', function () {
|
37637 | _this.pages = [];
|
37638 |
|
37639 | if (!_this.wrapperWidth || !_this.wrapperHeight || !_this.scrollerWidth || !_this.scrollerHeight) {
|
37640 | return;
|
37641 | }
|
37642 |
|
37643 | var stepX = snap.stepX || _this.wrapperWidth;
|
37644 | var stepY = snap.stepY || _this.wrapperHeight;
|
37645 |
|
37646 | var x = 0;
|
37647 | var y = void 0;
|
37648 | var cx = void 0;
|
37649 | var cy = void 0;
|
37650 | var i = 0;
|
37651 | var l = void 0;
|
37652 | var m = 0;
|
37653 | var n = void 0;
|
37654 | var rect = void 0;
|
37655 | if (!el) {
|
37656 | cx = Math.round(stepX / 2);
|
37657 | cy = Math.round(stepY / 2);
|
37658 |
|
37659 | while (x > -_this.scrollerWidth) {
|
37660 | _this.pages[i] = [];
|
37661 | l = 0;
|
37662 | y = 0;
|
37663 |
|
37664 | while (y > -_this.scrollerHeight) {
|
37665 | _this.pages[i][l] = {
|
37666 | x: Math.max(x, _this.maxScrollX),
|
37667 | y: Math.max(y, _this.maxScrollY),
|
37668 | width: stepX,
|
37669 | height: stepY,
|
37670 | cx: x - cx,
|
37671 | cy: y - cy
|
37672 | };
|
37673 |
|
37674 | y -= stepY;
|
37675 | l++;
|
37676 | }
|
37677 |
|
37678 | x -= stepX;
|
37679 | i++;
|
37680 | }
|
37681 | } else {
|
37682 | l = el.length;
|
37683 | n = -1;
|
37684 |
|
37685 | for (; i < l; i++) {
|
37686 | rect = getRect(el[i]);
|
37687 | if (i === 0 || rect.left <= getRect(el[i - 1]).left) {
|
37688 | m = 0;
|
37689 | n++;
|
37690 | }
|
37691 |
|
37692 | if (!_this.pages[m]) {
|
37693 | _this.pages[m] = [];
|
37694 | }
|
37695 |
|
37696 | x = Math.max(-rect.left, _this.maxScrollX);
|
37697 | y = Math.max(-rect.top, _this.maxScrollY);
|
37698 | cx = x - Math.round(rect.width / 2);
|
37699 | cy = y - Math.round(rect.height / 2);
|
37700 |
|
37701 | _this.pages[m][n] = {
|
37702 | x: x,
|
37703 | y: y,
|
37704 | width: rect.width,
|
37705 | height: rect.height,
|
37706 | cx: cx,
|
37707 | cy: cy
|
37708 | };
|
37709 |
|
37710 | if (x > _this.maxScrollX) {
|
37711 | m++;
|
37712 | }
|
37713 | }
|
37714 | }
|
37715 |
|
37716 | _this._checkSnapLoop();
|
37717 |
|
37718 | var initPageX = snap._loopX ? 1 : 0;
|
37719 | var initPageY = snap._loopY ? 1 : 0;
|
37720 | _this._goToPage(_this.currentPage.pageX || initPageX, _this.currentPage.pageY || initPageY, 0, undefined, true);
|
37721 |
|
37722 |
|
37723 | var snapThreshold = snap.threshold;
|
37724 | if (snapThreshold % 1 === 0) {
|
37725 | _this.snapThresholdX = snapThreshold;
|
37726 | _this.snapThresholdY = snapThreshold;
|
37727 | } else {
|
37728 | _this.snapThresholdX = Math.round(_this.pages[_this.currentPage.pageX][_this.currentPage.pageY].width * snapThreshold);
|
37729 | _this.snapThresholdY = Math.round(_this.pages[_this.currentPage.pageX][_this.currentPage.pageY].height * snapThreshold);
|
37730 | }
|
37731 | });
|
37732 |
|
37733 | this.on('scrollEnd', function () {
|
37734 | if (snap.loop) {
|
37735 | if (snap._loopX) {
|
37736 | if (_this.currentPage.pageX === 0) {
|
37737 | _this._goToPage(_this.pages.length - 2, _this.currentPage.pageY, 0, undefined, true);
|
37738 | }
|
37739 | if (_this.currentPage.pageX === _this.pages.length - 1) {
|
37740 | _this._goToPage(1, _this.currentPage.pageY, 0, undefined, true);
|
37741 | }
|
37742 | } else {
|
37743 | if (_this.currentPage.pageY === 0) {
|
37744 | _this._goToPage(_this.currentPage.pageX, _this.pages[0].length - 2, 0, undefined, true);
|
37745 | }
|
37746 | if (_this.currentPage.pageY === _this.pages[0].length - 1) {
|
37747 | _this._goToPage(_this.currentPage.pageX, 1, 0, undefined, true);
|
37748 | }
|
37749 | }
|
37750 | }
|
37751 | });
|
37752 |
|
37753 | if (snap.listenFlick !== false) {
|
37754 | this.on('flick', function () {
|
37755 | var time = snap.speed || Math.max(Math.max(Math.min(Math.abs(_this.x - _this.startX), 1000), Math.min(Math.abs(_this.y - _this.startY), 1000)), 300);
|
37756 |
|
37757 | _this._goToPage(_this.currentPage.pageX + _this.directionX, _this.currentPage.pageY + _this.directionY, time);
|
37758 | });
|
37759 | }
|
37760 |
|
37761 | this.on('destroy', function () {
|
37762 | if (snap.loop) {
|
37763 | var _children = _this.scroller.children;
|
37764 | if (_children.length > 2) {
|
37765 | removeChild(_this.scroller, _children[_children.length - 1]);
|
37766 | removeChild(_this.scroller, _children[0]);
|
37767 | }
|
37768 | }
|
37769 | });
|
37770 | };
|
37771 |
|
37772 | BScroll.prototype._checkSnapLoop = function () {
|
37773 | var snap = this.options.snap;
|
37774 |
|
37775 | if (!snap.loop || !this.pages || !this.pages.length) {
|
37776 | return;
|
37777 | }
|
37778 |
|
37779 | if (this.pages.length > 1) {
|
37780 | snap._loopX = true;
|
37781 | }
|
37782 | if (this.pages[0] && this.pages[0].length > 1) {
|
37783 | snap._loopY = true;
|
37784 | }
|
37785 | if (snap._loopX && snap._loopY) {
|
37786 | warn('Loop does not support two direction at the same time.');
|
37787 | }
|
37788 | };
|
37789 |
|
37790 | BScroll.prototype._nearestSnap = function (x, y) {
|
37791 | if (!this.pages.length) {
|
37792 | return { x: 0, y: 0, pageX: 0, pageY: 0 };
|
37793 | }
|
37794 |
|
37795 | var i = 0;
|
37796 |
|
37797 | if (Math.abs(x - this.absStartX) <= this.snapThresholdX && Math.abs(y - this.absStartY) <= this.snapThresholdY) {
|
37798 | return this.currentPage;
|
37799 | }
|
37800 |
|
37801 | if (x > this.minScrollX) {
|
37802 | x = this.minScrollX;
|
37803 | } else if (x < this.maxScrollX) {
|
37804 | x = this.maxScrollX;
|
37805 | }
|
37806 |
|
37807 | if (y > this.minScrollY) {
|
37808 | y = this.minScrollY;
|
37809 | } else if (y < this.maxScrollY) {
|
37810 | y = this.maxScrollY;
|
37811 | }
|
37812 |
|
37813 | var l = this.pages.length;
|
37814 | for (; i < l; i++) {
|
37815 | if (x >= this.pages[i][0].cx) {
|
37816 | x = this.pages[i][0].x;
|
37817 | break;
|
37818 | }
|
37819 | }
|
37820 |
|
37821 | l = this.pages[i].length;
|
37822 |
|
37823 | var m = 0;
|
37824 | for (; m < l; m++) {
|
37825 | if (y >= this.pages[0][m].cy) {
|
37826 | y = this.pages[0][m].y;
|
37827 | break;
|
37828 | }
|
37829 | }
|
37830 |
|
37831 | if (i === this.currentPage.pageX) {
|
37832 | i += this.directionX;
|
37833 |
|
37834 | if (i < 0) {
|
37835 | i = 0;
|
37836 | } else if (i >= this.pages.length) {
|
37837 | i = this.pages.length - 1;
|
37838 | }
|
37839 |
|
37840 | x = this.pages[i][0].x;
|
37841 | }
|
37842 |
|
37843 | if (m === this.currentPage.pageY) {
|
37844 | m += this.directionY;
|
37845 |
|
37846 | if (m < 0) {
|
37847 | m = 0;
|
37848 | } else if (m >= this.pages[0].length) {
|
37849 | m = this.pages[0].length - 1;
|
37850 | }
|
37851 |
|
37852 | y = this.pages[0][m].y;
|
37853 | }
|
37854 |
|
37855 | return {
|
37856 | x: x,
|
37857 | y: y,
|
37858 | pageX: i,
|
37859 | pageY: m
|
37860 | };
|
37861 | };
|
37862 |
|
37863 | BScroll.prototype._goToPage = function (x) {
|
37864 | var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
37865 | var time = arguments[2];
|
37866 | var easing = arguments[3];
|
37867 | var isSilent = arguments[4];
|
37868 |
|
37869 | var snap = this.options.snap;
|
37870 |
|
37871 | if (!snap || !this.pages || !this.pages.length) {
|
37872 | return;
|
37873 | }
|
37874 |
|
37875 | easing = easing || snap.easing || ease.bounce;
|
37876 |
|
37877 | if (x >= this.pages.length) {
|
37878 | x = this.pages.length - 1;
|
37879 | } else if (x < 0) {
|
37880 | x = 0;
|
37881 | }
|
37882 |
|
37883 | if (!this.pages[x]) {
|
37884 | return;
|
37885 | }
|
37886 |
|
37887 | if (y >= this.pages[x].length) {
|
37888 | y = this.pages[x].length - 1;
|
37889 | } else if (y < 0) {
|
37890 | y = 0;
|
37891 | }
|
37892 |
|
37893 | var posX = this.pages[x][y].x;
|
37894 | var posY = this.pages[x][y].y;
|
37895 |
|
37896 | time = time === undefined ? snap.speed || Math.max(Math.max(Math.min(Math.abs(posX - this.x), 1000), Math.min(Math.abs(posY - this.y), 1000)), 300) : time;
|
37897 |
|
37898 | this.currentPage = {
|
37899 | x: posX,
|
37900 | y: posY,
|
37901 | pageX: x,
|
37902 | pageY: y
|
37903 | };
|
37904 | this.scrollTo(posX, posY, time, easing, isSilent);
|
37905 | };
|
37906 |
|
37907 | BScroll.prototype.goToPage = function (x, y, time, easing) {
|
37908 | var snap = this.options.snap;
|
37909 | if (!snap || !this.pages || !this.pages.length) {
|
37910 | return;
|
37911 | }
|
37912 |
|
37913 | if (snap.loop) {
|
37914 | var len = void 0;
|
37915 | if (snap._loopX) {
|
37916 | len = this.pages.length - 2;
|
37917 | if (x >= len) {
|
37918 | x = len - 1;
|
37919 | } else if (x < 0) {
|
37920 | x = 0;
|
37921 | }
|
37922 | x += 1;
|
37923 | } else {
|
37924 | len = this.pages[0].length - 2;
|
37925 | if (y >= len) {
|
37926 | y = len - 1;
|
37927 | } else if (y < 0) {
|
37928 | y = 0;
|
37929 | }
|
37930 | y += 1;
|
37931 | }
|
37932 | }
|
37933 | this._goToPage(x, y, time, easing);
|
37934 | };
|
37935 |
|
37936 | BScroll.prototype.next = function (time, easing) {
|
37937 | var snap = this.options.snap;
|
37938 | if (!snap) {
|
37939 | return;
|
37940 | }
|
37941 |
|
37942 | var x = this.currentPage.pageX;
|
37943 | var y = this.currentPage.pageY;
|
37944 |
|
37945 | x++;
|
37946 | if (x >= this.pages.length && this.hasVerticalScroll) {
|
37947 | x = 0;
|
37948 | y++;
|
37949 | }
|
37950 |
|
37951 | this._goToPage(x, y, time, easing);
|
37952 | };
|
37953 |
|
37954 | BScroll.prototype.prev = function (time, easing) {
|
37955 | var snap = this.options.snap;
|
37956 | if (!snap) {
|
37957 | return;
|
37958 | }
|
37959 |
|
37960 | var x = this.currentPage.pageX;
|
37961 | var y = this.currentPage.pageY;
|
37962 |
|
37963 | x--;
|
37964 | if (x < 0 && this.hasVerticalScroll) {
|
37965 | x = 0;
|
37966 | y--;
|
37967 | }
|
37968 |
|
37969 | this._goToPage(x, y, time, easing);
|
37970 | };
|
37971 |
|
37972 | BScroll.prototype.getCurrentPage = function () {
|
37973 | var snap = this.options.snap;
|
37974 | if (!snap) {
|
37975 | return null;
|
37976 | }
|
37977 |
|
37978 | if (snap.loop) {
|
37979 | var currentPage = void 0;
|
37980 | if (snap._loopX) {
|
37981 | currentPage = extend({}, this.currentPage, {
|
37982 | pageX: this.currentPage.pageX - 1
|
37983 | });
|
37984 | } else {
|
37985 | currentPage = extend({}, this.currentPage, {
|
37986 | pageY: this.currentPage.pageY - 1
|
37987 | });
|
37988 | }
|
37989 | return currentPage;
|
37990 | }
|
37991 | return this.currentPage;
|
37992 | };
|
37993 | }
|
37994 |
|
37995 | function wheelMixin(BScroll) {
|
37996 | BScroll.prototype.wheelTo = function () {
|
37997 | var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
37998 |
|
37999 | if (this.options.wheel) {
|
38000 | var y = -index * this.itemHeight;
|
38001 | this.scrollTo(0, y);
|
38002 | }
|
38003 | };
|
38004 |
|
38005 | BScroll.prototype.getSelectedIndex = function () {
|
38006 | return this.options.wheel && this.selectedIndex;
|
38007 | };
|
38008 |
|
38009 | BScroll.prototype._initWheel = function () {
|
38010 | var wheel = this.options.wheel;
|
38011 | if (!wheel.wheelWrapperClass) {
|
38012 | wheel.wheelWrapperClass = 'wheel-scroll';
|
38013 | }
|
38014 | if (!wheel.wheelItemClass) {
|
38015 | wheel.wheelItemClass = 'wheel-item';
|
38016 | }
|
38017 | if (!wheel.wheelDisabledItemClass) {
|
38018 | wheel.wheelDisabledItemClass = 'wheel-disabled-item';
|
38019 | }
|
38020 | if (wheel.selectedIndex === undefined) {
|
38021 | wheel.selectedIndex = 0;
|
38022 | }
|
38023 | };
|
38024 |
|
38025 | BScroll.prototype._findNearestValidWheel = function (y) {
|
38026 | y = y > 0 ? 0 : y < this.maxScrollY ? this.maxScrollY : y;
|
38027 | var wheel = this.options.wheel;
|
38028 | var currentIndex = Math.abs(Math.round(-y / this.itemHeight));
|
38029 | var cacheIndex = currentIndex;
|
38030 | var items = this.items;
|
38031 |
|
38032 |
|
38033 |
|
38034 |
|
38035 | while (currentIndex >= 0) {
|
38036 | if (items[currentIndex].className.indexOf(wheel.wheelDisabledItemClass) === -1) {
|
38037 | break;
|
38038 | }
|
38039 | currentIndex--;
|
38040 | }
|
38041 |
|
38042 | if (currentIndex < 0) {
|
38043 | currentIndex = cacheIndex;
|
38044 | while (currentIndex <= items.length - 1) {
|
38045 | if (items[currentIndex].className.indexOf(wheel.wheelDisabledItemClass) === -1) {
|
38046 | break;
|
38047 | }
|
38048 | currentIndex++;
|
38049 | }
|
38050 | }
|
38051 |
|
38052 |
|
38053 | if (currentIndex === items.length) {
|
38054 | currentIndex = cacheIndex;
|
38055 | }
|
38056 |
|
38057 | return {
|
38058 | index: this.wheelItemsAllDisabled ? -1 : currentIndex,
|
38059 | y: -currentIndex * this.itemHeight
|
38060 | };
|
38061 | };
|
38062 |
|
38063 | BScroll.prototype._checkWheelAllDisabled = function () {
|
38064 | var wheel = this.options.wheel;
|
38065 | var items = this.items;
|
38066 | this.wheelItemsAllDisabled = true;
|
38067 | for (var i = 0; i < items.length; i++) {
|
38068 | if (items[i].className.indexOf(wheel.wheelDisabledItemClass) === -1) {
|
38069 | this.wheelItemsAllDisabled = false;
|
38070 | break;
|
38071 | }
|
38072 | }
|
38073 | };
|
38074 | }
|
38075 |
|
38076 | var INDICATOR_MIN_LEN = 8;
|
38077 |
|
38078 | function scrollbarMixin(BScroll) {
|
38079 | BScroll.prototype._initScrollbar = function () {
|
38080 | var _this = this;
|
38081 |
|
38082 | var _options$scrollbar = this.options.scrollbar,
|
38083 | _options$scrollbar$fa = _options$scrollbar.fade,
|
38084 | fade = _options$scrollbar$fa === undefined ? true : _options$scrollbar$fa,
|
38085 | _options$scrollbar$in = _options$scrollbar.interactive,
|
38086 | interactive = _options$scrollbar$in === undefined ? false : _options$scrollbar$in;
|
38087 |
|
38088 | this.indicators = [];
|
38089 | var indicator = void 0;
|
38090 |
|
38091 | if (this.options.scrollX) {
|
38092 | indicator = {
|
38093 | el: createScrollbar('horizontal'),
|
38094 | direction: 'horizontal',
|
38095 | fade: fade,
|
38096 | interactive: interactive
|
38097 | };
|
38098 | this._insertScrollBar(indicator.el);
|
38099 |
|
38100 | this.indicators.push(new Indicator(this, indicator));
|
38101 | }
|
38102 |
|
38103 | if (this.options.scrollY) {
|
38104 | indicator = {
|
38105 | el: createScrollbar('vertical'),
|
38106 | direction: 'vertical',
|
38107 | fade: fade,
|
38108 | interactive: interactive
|
38109 | };
|
38110 | this._insertScrollBar(indicator.el);
|
38111 | this.indicators.push(new Indicator(this, indicator));
|
38112 | }
|
38113 |
|
38114 | this.on('refresh', function () {
|
38115 | for (var i = 0; i < _this.indicators.length; i++) {
|
38116 | _this.indicators[i].refresh();
|
38117 | }
|
38118 | });
|
38119 |
|
38120 | if (fade) {
|
38121 | this.on('scrollEnd', function () {
|
38122 | for (var i = 0; i < _this.indicators.length; i++) {
|
38123 | _this.indicators[i].fade();
|
38124 | }
|
38125 | });
|
38126 |
|
38127 | this.on('scrollCancel', function () {
|
38128 | for (var i = 0; i < _this.indicators.length; i++) {
|
38129 | _this.indicators[i].fade();
|
38130 | }
|
38131 | });
|
38132 |
|
38133 | this.on('scrollStart', function () {
|
38134 | for (var i = 0; i < _this.indicators.length; i++) {
|
38135 | _this.indicators[i].fade(true);
|
38136 | }
|
38137 | });
|
38138 |
|
38139 | this.on('beforeScrollStart', function () {
|
38140 | for (var i = 0; i < _this.indicators.length; i++) {
|
38141 | _this.indicators[i].fade(true, true);
|
38142 | }
|
38143 | });
|
38144 | }
|
38145 |
|
38146 | this.on('destroy', function () {
|
38147 | _this._removeScrollBars();
|
38148 | });
|
38149 | };
|
38150 |
|
38151 | BScroll.prototype._insertScrollBar = function (scrollbar) {
|
38152 | this.wrapper.appendChild(scrollbar);
|
38153 | };
|
38154 |
|
38155 | BScroll.prototype._removeScrollBars = function () {
|
38156 | for (var i = 0; i < this.indicators.length; i++) {
|
38157 | this.indicators[i].destroy();
|
38158 | }
|
38159 | };
|
38160 | }
|
38161 |
|
38162 | function createScrollbar(direction) {
|
38163 | var scrollbar = document.createElement('div');
|
38164 | var indicator = document.createElement('div');
|
38165 |
|
38166 | scrollbar.style.cssText = 'position:absolute;z-index:9999;pointerEvents:none';
|
38167 | indicator.style.cssText = 'box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px;';
|
38168 |
|
38169 | indicator.className = 'bscroll-indicator';
|
38170 |
|
38171 | if (direction === 'horizontal') {
|
38172 | scrollbar.style.cssText += ';height:7px;left:2px;right:2px;bottom:0';
|
38173 | indicator.style.height = '100%';
|
38174 | scrollbar.className = 'bscroll-horizontal-scrollbar';
|
38175 | } else {
|
38176 | scrollbar.style.cssText += ';width:7px;bottom:2px;top:2px;right:1px';
|
38177 | indicator.style.width = '100%';
|
38178 | scrollbar.className = 'bscroll-vertical-scrollbar';
|
38179 | }
|
38180 |
|
38181 | scrollbar.style.cssText += ';overflow:hidden';
|
38182 | scrollbar.appendChild(indicator);
|
38183 |
|
38184 | return scrollbar;
|
38185 | }
|
38186 |
|
38187 | function Indicator(scroller, options) {
|
38188 | this.wrapper = options.el;
|
38189 | this.wrapperStyle = this.wrapper.style;
|
38190 | this.indicator = this.wrapper.children[0];
|
38191 | this.indicatorStyle = this.indicator.style;
|
38192 | this.scroller = scroller;
|
38193 | this.direction = options.direction;
|
38194 | if (options.fade) {
|
38195 | this.visible = 0;
|
38196 | this.wrapperStyle.opacity = '0';
|
38197 | } else {
|
38198 | this.visible = 1;
|
38199 | }
|
38200 |
|
38201 | this.sizeRatioX = 1;
|
38202 | this.sizeRatioY = 1;
|
38203 | this.maxPosX = 0;
|
38204 | this.maxPosY = 0;
|
38205 | this.x = 0;
|
38206 | this.y = 0;
|
38207 |
|
38208 | if (options.interactive) {
|
38209 | this._addDOMEvents();
|
38210 | }
|
38211 | }
|
38212 |
|
38213 | Indicator.prototype.handleEvent = function (e) {
|
38214 | switch (e.type) {
|
38215 | case 'touchstart':
|
38216 | case 'mousedown':
|
38217 | this._start(e);
|
38218 | break;
|
38219 | case 'touchmove':
|
38220 | case 'mousemove':
|
38221 | this._move(e);
|
38222 | break;
|
38223 | case 'touchend':
|
38224 | case 'mouseup':
|
38225 | case 'touchcancel':
|
38226 | case 'mousecancel':
|
38227 | this._end(e);
|
38228 | break;
|
38229 | }
|
38230 | };
|
38231 |
|
38232 | Indicator.prototype.refresh = function () {
|
38233 | if (this._shouldShow()) {
|
38234 | this.transitionTime();
|
38235 | this._calculate();
|
38236 | this.updatePosition();
|
38237 | }
|
38238 | };
|
38239 |
|
38240 | Indicator.prototype.fade = function (visible, hold) {
|
38241 | var _this2 = this;
|
38242 |
|
38243 | if (hold && !this.visible) {
|
38244 | return;
|
38245 | }
|
38246 |
|
38247 | var time = visible ? 250 : 500;
|
38248 |
|
38249 | visible = visible ? '1' : '0';
|
38250 |
|
38251 | this.wrapperStyle[bscroll_esm_style.transitionDuration] = time + 'ms';
|
38252 |
|
38253 | clearTimeout(this.fadeTimeout);
|
38254 | this.fadeTimeout = setTimeout(function () {
|
38255 | _this2.wrapperStyle.opacity = visible;
|
38256 | _this2.visible = +visible;
|
38257 | }, 0);
|
38258 | };
|
38259 |
|
38260 | Indicator.prototype.updatePosition = function () {
|
38261 | if (this.direction === 'vertical') {
|
38262 | var y = Math.round(this.sizeRatioY * this.scroller.y);
|
38263 |
|
38264 | if (y < 0) {
|
38265 | this.transitionTime(500);
|
38266 | var height = Math.max(this.indicatorHeight + y * 3, INDICATOR_MIN_LEN);
|
38267 | this.indicatorStyle.height = height + 'px';
|
38268 | y = 0;
|
38269 | } else if (y > this.maxPosY) {
|
38270 | this.transitionTime(500);
|
38271 | var _height = Math.max(this.indicatorHeight - (y - this.maxPosY) * 3, INDICATOR_MIN_LEN);
|
38272 | this.indicatorStyle.height = _height + 'px';
|
38273 | y = this.maxPosY + this.indicatorHeight - _height;
|
38274 | } else {
|
38275 | this.indicatorStyle.height = this.indicatorHeight + 'px';
|
38276 | }
|
38277 | this.y = y;
|
38278 |
|
38279 | if (this.scroller.options.useTransform) {
|
38280 | this.indicatorStyle[bscroll_esm_style.transform] = 'translateY(' + y + 'px)' + this.scroller.translateZ;
|
38281 | } else {
|
38282 | this.indicatorStyle.top = y + 'px';
|
38283 | }
|
38284 | } else {
|
38285 | var x = Math.round(this.sizeRatioX * this.scroller.x);
|
38286 |
|
38287 | if (x < 0) {
|
38288 | this.transitionTime(500);
|
38289 | var width = Math.max(this.indicatorWidth + x * 3, INDICATOR_MIN_LEN);
|
38290 | this.indicatorStyle.width = width + 'px';
|
38291 | x = 0;
|
38292 | } else if (x > this.maxPosX) {
|
38293 | this.transitionTime(500);
|
38294 | var _width = Math.max(this.indicatorWidth - (x - this.maxPosX) * 3, INDICATOR_MIN_LEN);
|
38295 | this.indicatorStyle.width = _width + 'px';
|
38296 | x = this.maxPosX + this.indicatorWidth - _width;
|
38297 | } else {
|
38298 | this.indicatorStyle.width = this.indicatorWidth + 'px';
|
38299 | }
|
38300 |
|
38301 | this.x = x;
|
38302 |
|
38303 | if (this.scroller.options.useTransform) {
|
38304 | this.indicatorStyle[bscroll_esm_style.transform] = 'translateX(' + x + 'px)' + this.scroller.translateZ;
|
38305 | } else {
|
38306 | this.indicatorStyle.left = x + 'px';
|
38307 | }
|
38308 | }
|
38309 | };
|
38310 |
|
38311 | Indicator.prototype.transitionTime = function () {
|
38312 | var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
38313 |
|
38314 | this.indicatorStyle[bscroll_esm_style.transitionDuration] = time + 'ms';
|
38315 | };
|
38316 |
|
38317 | Indicator.prototype.transitionTimingFunction = function (easing) {
|
38318 | this.indicatorStyle[bscroll_esm_style.transitionTimingFunction] = easing;
|
38319 | };
|
38320 |
|
38321 | Indicator.prototype.destroy = function () {
|
38322 | this._removeDOMEvents();
|
38323 | this.wrapper.parentNode.removeChild(this.wrapper);
|
38324 | };
|
38325 |
|
38326 | Indicator.prototype._start = function (e) {
|
38327 | var point = e.touches ? e.touches[0] : e;
|
38328 |
|
38329 | e.preventDefault();
|
38330 | e.stopPropagation();
|
38331 |
|
38332 | this.transitionTime();
|
38333 |
|
38334 | this.initiated = true;
|
38335 | this.moved = false;
|
38336 | this.lastPointX = point.pageX;
|
38337 | this.lastPointY = point.pageY;
|
38338 |
|
38339 | this.startTime = getNow();
|
38340 |
|
38341 | this._handleMoveEvents(addEvent);
|
38342 | this.scroller.trigger('beforeScrollStart');
|
38343 | };
|
38344 |
|
38345 | Indicator.prototype._move = function (e) {
|
38346 | var point = e.touches ? e.touches[0] : e;
|
38347 |
|
38348 | e.preventDefault();
|
38349 | e.stopPropagation();
|
38350 |
|
38351 | if (!this.moved) {
|
38352 | this.scroller.trigger('scrollStart');
|
38353 | }
|
38354 |
|
38355 | this.moved = true;
|
38356 |
|
38357 | var deltaX = point.pageX - this.lastPointX;
|
38358 | this.lastPointX = point.pageX;
|
38359 |
|
38360 | var deltaY = point.pageY - this.lastPointY;
|
38361 | this.lastPointY = point.pageY;
|
38362 |
|
38363 | var newX = this.x + deltaX;
|
38364 | var newY = this.y + deltaY;
|
38365 |
|
38366 | this._pos(newX, newY);
|
38367 | };
|
38368 |
|
38369 | Indicator.prototype._end = function (e) {
|
38370 | if (!this.initiated) {
|
38371 | return;
|
38372 | }
|
38373 | this.initiated = false;
|
38374 |
|
38375 | e.preventDefault();
|
38376 | e.stopPropagation();
|
38377 |
|
38378 | this._handleMoveEvents(removeEvent);
|
38379 |
|
38380 | var snapOption = this.scroller.options.snap;
|
38381 | if (snapOption) {
|
38382 | var speed = snapOption.speed,
|
38383 | _snapOption$easing = snapOption.easing,
|
38384 | easing = _snapOption$easing === undefined ? ease.bounce : _snapOption$easing;
|
38385 |
|
38386 | var snap = this.scroller._nearestSnap(this.scroller.x, this.scroller.y);
|
38387 |
|
38388 | var time = speed || Math.max(Math.max(Math.min(Math.abs(this.scroller.x - snap.x), 1000), Math.min(Math.abs(this.scroller.y - snap.y), 1000)), 300);
|
38389 |
|
38390 | if (this.scroller.x !== snap.x || this.scroller.y !== snap.y) {
|
38391 | this.scroller.directionX = 0;
|
38392 | this.scroller.directionY = 0;
|
38393 | this.scroller.currentPage = snap;
|
38394 | this.scroller.scrollTo(snap.x, snap.y, time, easing);
|
38395 | }
|
38396 | }
|
38397 |
|
38398 | if (this.moved) {
|
38399 | this.scroller.trigger('scrollEnd', {
|
38400 | x: this.scroller.x,
|
38401 | y: this.scroller.y
|
38402 | });
|
38403 | }
|
38404 | };
|
38405 |
|
38406 | Indicator.prototype._pos = function (x, y) {
|
38407 | if (x < 0) {
|
38408 | x = 0;
|
38409 | } else if (x > this.maxPosX) {
|
38410 | x = this.maxPosX;
|
38411 | }
|
38412 |
|
38413 | if (y < 0) {
|
38414 | y = 0;
|
38415 | } else if (y > this.maxPosY) {
|
38416 | y = this.maxPosY;
|
38417 | }
|
38418 |
|
38419 | x = Math.round(x / this.sizeRatioX);
|
38420 | y = Math.round(y / this.sizeRatioY);
|
38421 |
|
38422 | this.scroller.scrollTo(x, y);
|
38423 | this.scroller.trigger('scroll', {
|
38424 | x: this.scroller.x,
|
38425 | y: this.scroller.y
|
38426 | });
|
38427 | };
|
38428 |
|
38429 | Indicator.prototype._shouldShow = function () {
|
38430 | if (this.direction === 'vertical' && this.scroller.hasVerticalScroll || this.direction === 'horizontal' && this.scroller.hasHorizontalScroll) {
|
38431 | this.wrapper.style.display = '';
|
38432 | return true;
|
38433 | }
|
38434 | this.wrapper.style.display = 'none';
|
38435 | return false;
|
38436 | };
|
38437 |
|
38438 | Indicator.prototype._calculate = function () {
|
38439 | if (this.direction === 'vertical') {
|
38440 | var wrapperHeight = this.wrapper.clientHeight;
|
38441 | this.indicatorHeight = Math.max(Math.round(wrapperHeight * wrapperHeight / (this.scroller.scrollerHeight || wrapperHeight || 1)), INDICATOR_MIN_LEN);
|
38442 | this.indicatorStyle.height = this.indicatorHeight + 'px';
|
38443 |
|
38444 | this.maxPosY = wrapperHeight - this.indicatorHeight;
|
38445 |
|
38446 | this.sizeRatioY = this.maxPosY / this.scroller.maxScrollY;
|
38447 | } else {
|
38448 | var wrapperWidth = this.wrapper.clientWidth;
|
38449 | this.indicatorWidth = Math.max(Math.round(wrapperWidth * wrapperWidth / (this.scroller.scrollerWidth || wrapperWidth || 1)), INDICATOR_MIN_LEN);
|
38450 | this.indicatorStyle.width = this.indicatorWidth + 'px';
|
38451 |
|
38452 | this.maxPosX = wrapperWidth - this.indicatorWidth;
|
38453 |
|
38454 | this.sizeRatioX = this.maxPosX / this.scroller.maxScrollX;
|
38455 | }
|
38456 | };
|
38457 |
|
38458 | Indicator.prototype._addDOMEvents = function () {
|
38459 | var eventOperation = addEvent;
|
38460 | this._handleDOMEvents(eventOperation);
|
38461 | };
|
38462 |
|
38463 | Indicator.prototype._removeDOMEvents = function () {
|
38464 | var eventOperation = removeEvent;
|
38465 | this._handleDOMEvents(eventOperation);
|
38466 | this._handleMoveEvents(eventOperation);
|
38467 | };
|
38468 |
|
38469 | Indicator.prototype._handleMoveEvents = function (eventOperation) {
|
38470 | if (!this.scroller.options.disableTouch) {
|
38471 | eventOperation(window, 'touchmove', this);
|
38472 | }
|
38473 | if (!this.scroller.options.disableMouse) {
|
38474 | eventOperation(window, 'mousemove', this);
|
38475 | }
|
38476 | };
|
38477 |
|
38478 | Indicator.prototype._handleDOMEvents = function (eventOperation) {
|
38479 | if (!this.scroller.options.disableTouch) {
|
38480 | eventOperation(this.indicator, 'touchstart', this);
|
38481 | eventOperation(window, 'touchend', this);
|
38482 | }
|
38483 | if (!this.scroller.options.disableMouse) {
|
38484 | eventOperation(this.indicator, 'mousedown', this);
|
38485 | eventOperation(window, 'mouseup', this);
|
38486 | }
|
38487 | };
|
38488 |
|
38489 | function pullDownMixin(BScroll) {
|
38490 | BScroll.prototype._initPullDown = function () {
|
38491 |
|
38492 | this.options.probeType = PROBE_REALTIME;
|
38493 | };
|
38494 |
|
38495 | BScroll.prototype._checkPullDown = function () {
|
38496 | var _options$pullDownRefr = this.options.pullDownRefresh,
|
38497 | _options$pullDownRefr2 = _options$pullDownRefr.threshold,
|
38498 | threshold = _options$pullDownRefr2 === undefined ? 90 : _options$pullDownRefr2,
|
38499 | _options$pullDownRefr3 = _options$pullDownRefr.stop,
|
38500 | stop = _options$pullDownRefr3 === undefined ? 40 : _options$pullDownRefr3;
|
38501 |
|
38502 |
|
38503 |
|
38504 | if (this.directionY !== DIRECTION_DOWN || this.y < threshold) {
|
38505 | return false;
|
38506 | }
|
38507 |
|
38508 | if (!this.pulling) {
|
38509 | this.pulling = true;
|
38510 | this.trigger('pullingDown');
|
38511 | }
|
38512 | this.scrollTo(this.x, stop, this.options.bounceTime, ease.bounce);
|
38513 |
|
38514 | return this.pulling;
|
38515 | };
|
38516 |
|
38517 | BScroll.prototype.finishPullDown = function () {
|
38518 | this.pulling = false;
|
38519 | this.resetPosition(this.options.bounceTime, ease.bounce);
|
38520 | };
|
38521 |
|
38522 | BScroll.prototype.openPullDown = function () {
|
38523 | var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
38524 |
|
38525 | this.options.pullDownRefresh = config;
|
38526 | this._initPullDown();
|
38527 | };
|
38528 |
|
38529 | BScroll.prototype.closePullDown = function () {
|
38530 | this.options.pullDownRefresh = false;
|
38531 | };
|
38532 |
|
38533 | BScroll.prototype.autoPullDownRefresh = function () {
|
38534 | var _options$pullDownRefr4 = this.options.pullDownRefresh,
|
38535 | _options$pullDownRefr5 = _options$pullDownRefr4.threshold,
|
38536 | threshold = _options$pullDownRefr5 === undefined ? 90 : _options$pullDownRefr5,
|
38537 | _options$pullDownRefr6 = _options$pullDownRefr4.stop,
|
38538 | stop = _options$pullDownRefr6 === undefined ? 40 : _options$pullDownRefr6;
|
38539 |
|
38540 |
|
38541 | if (this.pulling) {
|
38542 | return;
|
38543 | }
|
38544 | this.pulling = true;
|
38545 |
|
38546 | this.scrollTo(this.x, threshold);
|
38547 | this.trigger('pullingDown');
|
38548 | this.scrollTo(this.x, stop, this.options.bounceTime, ease.bounce);
|
38549 | };
|
38550 | }
|
38551 |
|
38552 | function pullUpMixin(BScroll) {
|
38553 | BScroll.prototype._initPullUp = function () {
|
38554 |
|
38555 | this.options.probeType = PROBE_REALTIME;
|
38556 |
|
38557 | this.pullupWatching = false;
|
38558 | this._watchPullUp();
|
38559 | };
|
38560 |
|
38561 | BScroll.prototype._watchPullUp = function () {
|
38562 | if (this.pullupWatching) {
|
38563 | return;
|
38564 | }
|
38565 | this.pullupWatching = true;
|
38566 | this.on('scroll', this._checkToEnd);
|
38567 | };
|
38568 |
|
38569 | BScroll.prototype._checkToEnd = function (pos) {
|
38570 | var _this = this;
|
38571 |
|
38572 | var _options$pullUpLoad$t = this.options.pullUpLoad.threshold,
|
38573 | threshold = _options$pullUpLoad$t === undefined ? 0 : _options$pullUpLoad$t;
|
38574 |
|
38575 | if (this.movingDirectionY === DIRECTION_UP && pos.y <= this.maxScrollY + threshold) {
|
38576 |
|
38577 | this.once('scrollEnd', function () {
|
38578 | _this.pullupWatching = false;
|
38579 | });
|
38580 | this.trigger('pullingUp');
|
38581 | this.off('scroll', this._checkToEnd);
|
38582 | }
|
38583 | };
|
38584 |
|
38585 | BScroll.prototype.finishPullUp = function () {
|
38586 | var _this2 = this;
|
38587 |
|
38588 | if (this.pullupWatching) {
|
38589 | this.once('scrollEnd', function () {
|
38590 | _this2._watchPullUp();
|
38591 | });
|
38592 | } else {
|
38593 | this._watchPullUp();
|
38594 | }
|
38595 | };
|
38596 |
|
38597 | BScroll.prototype.openPullUp = function () {
|
38598 | var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
38599 |
|
38600 | this.options.pullUpLoad = config;
|
38601 | this._initPullUp();
|
38602 | };
|
38603 |
|
38604 | BScroll.prototype.closePullUp = function () {
|
38605 | this.options.pullUpLoad = false;
|
38606 | if (!this.pullupWatching) {
|
38607 | return;
|
38608 | }
|
38609 | this.pullupWatching = false;
|
38610 | this.off('scroll', this._checkToEnd);
|
38611 | };
|
38612 | }
|
38613 |
|
38614 | function mouseWheelMixin(BScroll) {
|
38615 | BScroll.prototype._initMouseWheel = function () {
|
38616 | var _this = this;
|
38617 |
|
38618 | this._handleMouseWheelEvent(addEvent);
|
38619 |
|
38620 | this.on('destroy', function () {
|
38621 | clearTimeout(_this.mouseWheelTimer);
|
38622 | clearTimeout(_this.mouseWheelEndTimer);
|
38623 | _this._handleMouseWheelEvent(removeEvent);
|
38624 | });
|
38625 |
|
38626 | this.firstWheelOpreation = true;
|
38627 | };
|
38628 |
|
38629 | BScroll.prototype._handleMouseWheelEvent = function (eventOperation) {
|
38630 | eventOperation(this.wrapper, 'wheel', this);
|
38631 | eventOperation(this.wrapper, 'mousewheel', this);
|
38632 | eventOperation(this.wrapper, 'DOMMouseScroll', this);
|
38633 | };
|
38634 |
|
38635 | BScroll.prototype._onMouseWheel = function (e) {
|
38636 | var _this2 = this;
|
38637 |
|
38638 | if (!this.enabled) {
|
38639 | return;
|
38640 | }
|
38641 | e.preventDefault();
|
38642 |
|
38643 | if (this.options.stopPropagation) {
|
38644 | e.stopPropagation();
|
38645 | }
|
38646 |
|
38647 | if (this.firstWheelOpreation) {
|
38648 | this.trigger('scrollStart');
|
38649 | }
|
38650 | this.firstWheelOpreation = false;
|
38651 |
|
38652 | var _options$mouseWheel = this.options.mouseWheel,
|
38653 | _options$mouseWheel$s = _options$mouseWheel.speed,
|
38654 | speed = _options$mouseWheel$s === undefined ? 20 : _options$mouseWheel$s,
|
38655 | _options$mouseWheel$i = _options$mouseWheel.invert,
|
38656 | invert = _options$mouseWheel$i === undefined ? false : _options$mouseWheel$i,
|
38657 | _options$mouseWheel$e = _options$mouseWheel.easeTime,
|
38658 | easeTime = _options$mouseWheel$e === undefined ? 300 : _options$mouseWheel$e;
|
38659 |
|
38660 |
|
38661 | clearTimeout(this.mouseWheelTimer);
|
38662 | this.mouseWheelTimer = setTimeout(function () {
|
38663 | if (!_this2.options.snap && !easeTime) {
|
38664 | _this2.trigger('scrollEnd', {
|
38665 | x: _this2.x,
|
38666 | y: _this2.y
|
38667 | });
|
38668 | }
|
38669 | _this2.firstWheelOpreation = true;
|
38670 | }, 400);
|
38671 |
|
38672 | var wheelDeltaX = void 0;
|
38673 | var wheelDeltaY = void 0;
|
38674 |
|
38675 | switch (true) {
|
38676 | case 'deltaX' in e:
|
38677 | if (e.deltaMode === 1) {
|
38678 | wheelDeltaX = -e.deltaX * speed;
|
38679 | wheelDeltaY = -e.deltaY * speed;
|
38680 | } else {
|
38681 | wheelDeltaX = -e.deltaX;
|
38682 | wheelDeltaY = -e.deltaY;
|
38683 | }
|
38684 | break;
|
38685 | case 'wheelDeltaX' in e:
|
38686 | wheelDeltaX = e.wheelDeltaX / 120 * speed;
|
38687 | wheelDeltaY = e.wheelDeltaY / 120 * speed;
|
38688 | break;
|
38689 | case 'wheelDelta' in e:
|
38690 | wheelDeltaX = wheelDeltaY = e.wheelDelta / 120 * speed;
|
38691 | break;
|
38692 | case 'detail' in e:
|
38693 | wheelDeltaX = wheelDeltaY = -e.detail / 3 * speed;
|
38694 | break;
|
38695 | default:
|
38696 | return;
|
38697 | }
|
38698 |
|
38699 | var direction = invert ? -1 : 1;
|
38700 | wheelDeltaX *= direction;
|
38701 | wheelDeltaY *= direction;
|
38702 |
|
38703 | if (!this.hasVerticalScroll) {
|
38704 | wheelDeltaX = wheelDeltaY;
|
38705 | wheelDeltaY = 0;
|
38706 | }
|
38707 |
|
38708 | var newX = void 0;
|
38709 | var newY = void 0;
|
38710 | if (this.options.snap) {
|
38711 | newX = this.currentPage.pageX;
|
38712 | newY = this.currentPage.pageY;
|
38713 |
|
38714 | if (wheelDeltaX > 0) {
|
38715 | newX--;
|
38716 | } else if (wheelDeltaX < 0) {
|
38717 | newX++;
|
38718 | }
|
38719 |
|
38720 | if (wheelDeltaY > 0) {
|
38721 | newY--;
|
38722 | } else if (wheelDeltaY < 0) {
|
38723 | newY++;
|
38724 | }
|
38725 |
|
38726 | this._goToPage(newX, newY);
|
38727 | return;
|
38728 | }
|
38729 |
|
38730 | newX = this.x + Math.round(this.hasHorizontalScroll ? wheelDeltaX : 0);
|
38731 | newY = this.y + Math.round(this.hasVerticalScroll ? wheelDeltaY : 0);
|
38732 |
|
38733 | this.movingDirectionX = this.directionX = wheelDeltaX > 0 ? -1 : wheelDeltaX < 0 ? 1 : 0;
|
38734 | this.movingDirectionY = this.directionY = wheelDeltaY > 0 ? -1 : wheelDeltaY < 0 ? 1 : 0;
|
38735 |
|
38736 | if (newX > this.minScrollX) {
|
38737 | newX = this.minScrollX;
|
38738 | } else if (newX < this.maxScrollX) {
|
38739 | newX = this.maxScrollX;
|
38740 | }
|
38741 |
|
38742 | if (newY > this.minScrollY) {
|
38743 | newY = this.minScrollY;
|
38744 | } else if (newY < this.maxScrollY) {
|
38745 | newY = this.maxScrollY;
|
38746 | }
|
38747 |
|
38748 | var needTriggerEnd = this.y === newY;
|
38749 | this.scrollTo(newX, newY, easeTime, ease.swipe);
|
38750 | this.trigger('scroll', {
|
38751 | x: this.x,
|
38752 | y: this.y
|
38753 | });
|
38754 | clearTimeout(this.mouseWheelEndTimer);
|
38755 | if (needTriggerEnd) {
|
38756 | this.mouseWheelEndTimer = setTimeout(function () {
|
38757 | _this2.trigger('scrollEnd', {
|
38758 | x: _this2.x,
|
38759 | y: _this2.y
|
38760 | });
|
38761 | }, easeTime);
|
38762 | }
|
38763 | };
|
38764 | }
|
38765 |
|
38766 | function zoomMixin(BScroll) {
|
38767 | BScroll.prototype._initZoom = function () {
|
38768 | var _options$zoom = this.options.zoom,
|
38769 | _options$zoom$start = _options$zoom.start,
|
38770 | start = _options$zoom$start === undefined ? 1 : _options$zoom$start,
|
38771 | _options$zoom$min = _options$zoom.min,
|
38772 | min = _options$zoom$min === undefined ? 1 : _options$zoom$min,
|
38773 | _options$zoom$max = _options$zoom.max,
|
38774 | max = _options$zoom$max === undefined ? 4 : _options$zoom$max;
|
38775 |
|
38776 | this.scale = Math.min(Math.max(start, min), max);
|
38777 | this.setScale(this.scale);
|
38778 | this.scrollerStyle[bscroll_esm_style.transformOrigin] = '0 0';
|
38779 | };
|
38780 |
|
38781 | BScroll.prototype._zoomTo = function (scale, originX, originY, startScale) {
|
38782 | this.scaled = true;
|
38783 |
|
38784 | var lastScale = scale / (startScale || this.scale);
|
38785 | this.setScale(scale);
|
38786 |
|
38787 | this.refresh();
|
38788 |
|
38789 | var newX = Math.round(this.startX - (originX - this.relativeX) * (lastScale - 1));
|
38790 | var newY = Math.round(this.startY - (originY - this.relativeY) * (lastScale - 1));
|
38791 |
|
38792 | if (newX > this.minScrollX) {
|
38793 | newX = this.minScrollX;
|
38794 | } else if (newX < this.maxScrollX) {
|
38795 | newX = this.maxScrollX;
|
38796 | }
|
38797 |
|
38798 | if (newY > this.minScrollY) {
|
38799 | newY = this.minScrollY;
|
38800 | } else if (newY < this.maxScrollY) {
|
38801 | newY = this.maxScrollY;
|
38802 | }
|
38803 |
|
38804 | if (this.x !== newX || this.y !== newY) {
|
38805 | this.scrollTo(newX, newY, this.options.bounceTime);
|
38806 | }
|
38807 |
|
38808 | this.scaled = false;
|
38809 | };
|
38810 |
|
38811 | BScroll.prototype.zoomTo = function (scale, x, y) {
|
38812 | var _offsetToBody = offsetToBody(this.wrapper),
|
38813 | left = _offsetToBody.left,
|
38814 | top = _offsetToBody.top;
|
38815 |
|
38816 | var originX = x + left - this.x;
|
38817 | var originY = y + top - this.y;
|
38818 | this._zoomTo(scale, originX, originY);
|
38819 | };
|
38820 |
|
38821 | BScroll.prototype._zoomStart = function (e) {
|
38822 | var firstFinger = e.touches[0];
|
38823 | var secondFinger = e.touches[1];
|
38824 | var deltaX = Math.abs(firstFinger.pageX - secondFinger.pageX);
|
38825 | var deltaY = Math.abs(firstFinger.pageY - secondFinger.pageY);
|
38826 |
|
38827 | this.startDistance = getDistance(deltaX, deltaY);
|
38828 | this.startScale = this.scale;
|
38829 |
|
38830 | var _offsetToBody2 = offsetToBody(this.wrapper),
|
38831 | left = _offsetToBody2.left,
|
38832 | top = _offsetToBody2.top;
|
38833 |
|
38834 | this.originX = Math.abs(firstFinger.pageX + secondFinger.pageX) / 2 + left - this.x;
|
38835 | this.originY = Math.abs(firstFinger.pageY + secondFinger.pageY) / 2 + top - this.y;
|
38836 |
|
38837 | this.trigger('zoomStart');
|
38838 | };
|
38839 |
|
38840 | BScroll.prototype._zoom = function (e) {
|
38841 | if (!this.enabled || this.destroyed || eventType[e.type] !== this.initiated) {
|
38842 | return;
|
38843 | }
|
38844 |
|
38845 | if (this.options.preventDefault) {
|
38846 | e.preventDefault();
|
38847 | }
|
38848 |
|
38849 | if (this.options.stopPropagation) {
|
38850 | e.stopPropagation();
|
38851 | }
|
38852 |
|
38853 | var firstFinger = e.touches[0];
|
38854 | var secondFinger = e.touches[1];
|
38855 | var deltaX = Math.abs(firstFinger.pageX - secondFinger.pageX);
|
38856 | var deltaY = Math.abs(firstFinger.pageY - secondFinger.pageY);
|
38857 | var distance = getDistance(deltaX, deltaY);
|
38858 | var scale = distance / this.startDistance * this.startScale;
|
38859 |
|
38860 | this.scaled = true;
|
38861 |
|
38862 | var _options$zoom2 = this.options.zoom,
|
38863 | _options$zoom2$min = _options$zoom2.min,
|
38864 | min = _options$zoom2$min === undefined ? 1 : _options$zoom2$min,
|
38865 | _options$zoom2$max = _options$zoom2.max,
|
38866 | max = _options$zoom2$max === undefined ? 4 : _options$zoom2$max;
|
38867 |
|
38868 |
|
38869 | if (scale < min) {
|
38870 | scale = 0.5 * min * Math.pow(2.0, scale / min);
|
38871 | } else if (scale > max) {
|
38872 | scale = 2.0 * max * Math.pow(0.5, max / scale);
|
38873 | }
|
38874 |
|
38875 | var lastScale = scale / this.startScale;
|
38876 |
|
38877 | var x = this.startX - (this.originX - this.relativeX) * (lastScale - 1);
|
38878 | var y = this.startY - (this.originY - this.relativeY) * (lastScale - 1);
|
38879 |
|
38880 | this.setScale(scale);
|
38881 |
|
38882 | this.scrollTo(x, y, 0);
|
38883 | };
|
38884 |
|
38885 | BScroll.prototype._zoomEnd = function (e) {
|
38886 | if (!this.enabled || this.destroyed || eventType[e.type] !== this.initiated) {
|
38887 | return;
|
38888 | }
|
38889 |
|
38890 | if (this.options.preventDefault) {
|
38891 | e.preventDefault();
|
38892 | }
|
38893 |
|
38894 | if (this.options.stopPropagation) {
|
38895 | e.stopPropagation();
|
38896 | }
|
38897 |
|
38898 | this.isInTransition = false;
|
38899 | this.isAnimating = false;
|
38900 | this.initiated = 0;
|
38901 |
|
38902 | var _options$zoom3 = this.options.zoom,
|
38903 | _options$zoom3$min = _options$zoom3.min,
|
38904 | min = _options$zoom3$min === undefined ? 1 : _options$zoom3$min,
|
38905 | _options$zoom3$max = _options$zoom3.max,
|
38906 | max = _options$zoom3$max === undefined ? 4 : _options$zoom3$max;
|
38907 |
|
38908 |
|
38909 | var scale = this.scale > max ? max : this.scale < min ? min : this.scale;
|
38910 |
|
38911 | this._zoomTo(scale, this.originX, this.originY, this.startScale);
|
38912 |
|
38913 | this.trigger('zoomEnd');
|
38914 | };
|
38915 | }
|
38916 |
|
38917 |
|
38918 |
|
38919 |
|
38920 | var RUNWAY_ITEMS = 30;
|
38921 |
|
38922 |
|
38923 | var RUNWAY_ITEMS_OPPOSITE = 10;
|
38924 |
|
38925 |
|
38926 | var ANIMATION_DURATION_MS = 200;
|
38927 |
|
38928 |
|
38929 | var DEFAULT_SCROLL_RUNWAY = 2000;
|
38930 |
|
38931 | function infiniteMixin(BScroll) {
|
38932 | BScroll.prototype._initInfinite = function () {
|
38933 | this.options.probeType = 3;
|
38934 | this.maxScrollY = -DEFAULT_SCROLL_RUNWAY;
|
38935 | this.infiniteScroller = new InfiniteScroller(this, this.options.infinity);
|
38936 | };
|
38937 | }
|
38938 |
|
38939 | function isTombstoneNode(node) {
|
38940 | if (node && node.classList) {
|
38941 | return node.classList.contains('tombstone');
|
38942 | }
|
38943 | }
|
38944 |
|
38945 | function InfiniteScroller(scroller, options) {
|
38946 | var _this = this;
|
38947 |
|
38948 | this.options = options;
|
38949 | assert(typeof this.options.createTombstone === 'function', 'Infinite scroll need createTombstone Function to create tombstone');
|
38950 |
|
38951 | assert(typeof this.options.fetch === 'function', 'Infinite scroll need fetch Function to fetch new data.');
|
38952 |
|
38953 | assert(typeof this.options.render === 'function', 'Infinite scroll need render Function to render each item.');
|
38954 |
|
38955 | this.firstAttachedItem = 0;
|
38956 | this.lastAttachedItem = 0;
|
38957 |
|
38958 | this.anchorScrollTop = 0;
|
38959 | this.anchorItem = {
|
38960 | index: 0,
|
38961 | offset: 0
|
38962 | };
|
38963 | this.tombstoneHeight = 0;
|
38964 | this.tombstoneWidth = 0;
|
38965 | this.tombstones = [];
|
38966 | this.tombstonesAnimationHandlers = [];
|
38967 |
|
38968 | this.items = [];
|
38969 | this.loadedItems = 0;
|
38970 | this.requestInProgress = false;
|
38971 | this.hasMore = true;
|
38972 |
|
38973 | this.scroller = scroller;
|
38974 | this.wrapperEl = this.scroller.wrapper;
|
38975 | this.scrollerEl = this.scroller.scroller;
|
38976 |
|
38977 | this.scroller.on('resize', function () {
|
38978 | _this.onResize();
|
38979 | });
|
38980 | this.scroller.on('destroy', function () {
|
38981 | _this.destroy();
|
38982 | });
|
38983 |
|
38984 |
|
38985 | this._onResizeHandler = setTimeout(function () {
|
38986 | _this.onResize();
|
38987 |
|
38988 |
|
38989 | _this.scroller.on('scroll', function () {
|
38990 | _this.onScroll();
|
38991 | });
|
38992 | });
|
38993 | }
|
38994 |
|
38995 | InfiniteScroller.prototype.destroy = function () {
|
38996 | var _this2 = this;
|
38997 |
|
38998 |
|
38999 | clearTimeout(this._onResizeHandler);
|
39000 | this.tombstonesAnimationHandlers.forEach(function (handler) {
|
39001 | clearTimeout(handler);
|
39002 | });
|
39003 | this.tombstonesAnimationHandlers = null;
|
39004 | this.items.forEach(function (item) {
|
39005 | if (item.node) {
|
39006 | _this2.scrollerEl.removeChild(item.node);
|
39007 | item.node = null;
|
39008 | }
|
39009 | });
|
39010 | this.scroller.infiniteScroller = null;
|
39011 | this.scroller = null;
|
39012 | this.wrapperEl = null;
|
39013 | this.scrollerEl = null;
|
39014 | this.items = null;
|
39015 | this.tombstones = null;
|
39016 | };
|
39017 |
|
39018 | InfiniteScroller.prototype.onScroll = function () {
|
39019 | var scrollTop = -this.scroller.y;
|
39020 | var delta = scrollTop - this.anchorScrollTop;
|
39021 | if (scrollTop === 0) {
|
39022 | this.anchorItem = {
|
39023 | index: 0,
|
39024 | offset: 0
|
39025 | };
|
39026 | } else {
|
39027 | this.anchorItem = this._calculateAnchoredItem(this.anchorItem, delta);
|
39028 | }
|
39029 |
|
39030 | this.anchorScrollTop = scrollTop;
|
39031 | var lastScreenItem = this._calculateAnchoredItem(this.anchorItem, this.scroller.wrapperHeight);
|
39032 |
|
39033 | var start = this.anchorItem.index;
|
39034 | var end = lastScreenItem.index;
|
39035 | if (delta < 0) {
|
39036 | start -= RUNWAY_ITEMS;
|
39037 | end += RUNWAY_ITEMS_OPPOSITE;
|
39038 | } else {
|
39039 | start -= RUNWAY_ITEMS_OPPOSITE;
|
39040 | end += RUNWAY_ITEMS;
|
39041 | }
|
39042 | this.fill(start, end);
|
39043 | this.maybeRequestContent();
|
39044 | };
|
39045 |
|
39046 | InfiniteScroller.prototype.onResize = function () {
|
39047 | var tombstone = this.options.createTombstone();
|
39048 | tombstone.style.position = 'absolute';
|
39049 | this.scrollerEl.appendChild(tombstone);
|
39050 | tombstone.style.display = '';
|
39051 | this.tombstoneHeight = tombstone.offsetHeight;
|
39052 | this.tombstoneWidth = tombstone.offsetWidth;
|
39053 | this.scrollerEl.removeChild(tombstone);
|
39054 |
|
39055 | for (var i = 0; i < this.items.length; i++) {
|
39056 | this.items[i].height = this.items[i].width = 0;
|
39057 | }
|
39058 |
|
39059 | this.onScroll();
|
39060 | };
|
39061 |
|
39062 | InfiniteScroller.prototype.fill = function (start, end) {
|
39063 | this.firstAttachedItem = Math.max(0, start);
|
39064 | if (!this.hasMore) {
|
39065 | end = Math.min(end, this.items.length);
|
39066 | }
|
39067 | this.lastAttachedItem = end;
|
39068 | this.attachContent();
|
39069 | };
|
39070 |
|
39071 | InfiniteScroller.prototype.maybeRequestContent = function () {
|
39072 | var _this3 = this;
|
39073 |
|
39074 | if (this.requestInProgress || !this.hasMore) {
|
39075 | return;
|
39076 | }
|
39077 | var itemsNeeded = this.lastAttachedItem - this.loadedItems;
|
39078 | if (itemsNeeded <= 0) {
|
39079 | return;
|
39080 | }
|
39081 | this.requestInProgress = true;
|
39082 | this.options.fetch(itemsNeeded).then(function (items) {
|
39083 | _this3.requestInProgress = false;
|
39084 | if (items) {
|
39085 | _this3.addContent(items);
|
39086 | } else {
|
39087 | _this3.hasMore = false;
|
39088 | var tombstoneLen = _this3._removeTombstones();
|
39089 | var curPos = 0;
|
39090 | if (_this3.anchorItem.index <= _this3.items.length) {
|
39091 | curPos = _this3._fixScrollPosition();
|
39092 | _this3._setupAnimations({}, curPos);
|
39093 | _this3.scroller.resetPosition(_this3.scroller.options.bounceTime);
|
39094 | } else {
|
39095 | _this3.anchorItem.index -= tombstoneLen;
|
39096 | curPos = _this3._fixScrollPosition();
|
39097 | _this3._setupAnimations({}, curPos);
|
39098 | _this3.scroller.stop();
|
39099 | _this3.scroller.resetPosition();
|
39100 | _this3.onScroll();
|
39101 | }
|
39102 | }
|
39103 | });
|
39104 | };
|
39105 |
|
39106 | InfiniteScroller.prototype.addContent = function (items) {
|
39107 | for (var i = 0; i < items.length; i++) {
|
39108 | if (this.items.length <= this.loadedItems) {
|
39109 | this._addItem();
|
39110 | }
|
39111 | this.items[this.loadedItems++].data = items[i];
|
39112 | }
|
39113 | this.attachContent();
|
39114 | this.maybeRequestContent();
|
39115 | };
|
39116 |
|
39117 | InfiniteScroller.prototype.attachContent = function () {
|
39118 | var unusedNodes = this._collectUnusedNodes();
|
39119 | var tombstoneAnimations = this._createDOMNodes(unusedNodes);
|
39120 | this._cleanupUnusedNodes(unusedNodes);
|
39121 | this._cacheNodeSize();
|
39122 | var curPos = this._fixScrollPosition();
|
39123 | this._setupAnimations(tombstoneAnimations, curPos);
|
39124 | };
|
39125 |
|
39126 | InfiniteScroller.prototype.resetMore = function () {
|
39127 | this.hasMore = true;
|
39128 | };
|
39129 |
|
39130 | InfiniteScroller.prototype._removeTombstones = function () {
|
39131 | var markIndex = void 0;
|
39132 | var tombstoneLen = 0;
|
39133 | var itemLen = this.items.length;
|
39134 | for (var i = 0; i < itemLen; i++) {
|
39135 | var currentNode = this.items[i].node;
|
39136 | var currentData = this.items[i].data;
|
39137 | if ((!currentNode || isTombstoneNode(currentNode)) && !currentData) {
|
39138 |
|
39139 | if (markIndex === void 0) {
|
39140 | markIndex = i;
|
39141 | }
|
39142 | if (currentNode) {
|
39143 | this.scrollerEl.removeChild(currentNode);
|
39144 | }
|
39145 | }
|
39146 | }
|
39147 | tombstoneLen = itemLen - markIndex;
|
39148 | this.items.splice(markIndex);
|
39149 | this.lastAttachedItem = Math.min(this.lastAttachedItem, this.items.length);
|
39150 | return tombstoneLen;
|
39151 | };
|
39152 |
|
39153 | InfiniteScroller.prototype._collectUnusedNodes = function () {
|
39154 | var unusedNodes = [];
|
39155 | for (var i = 0; i < this.items.length; i++) {
|
39156 |
|
39157 | if (i === this.firstAttachedItem) {
|
39158 | i = this.lastAttachedItem - 1;
|
39159 | continue;
|
39160 | }
|
39161 | var currentNode = this.items[i].node;
|
39162 | if (currentNode) {
|
39163 | if (isTombstoneNode(currentNode)) {
|
39164 |
|
39165 | this.tombstones.push(currentNode);
|
39166 | this.tombstones[this.tombstones.length - 1].style.display = 'none';
|
39167 | } else {
|
39168 | unusedNodes.push(currentNode);
|
39169 | }
|
39170 | }
|
39171 | this.items[i].node = null;
|
39172 | }
|
39173 | return unusedNodes;
|
39174 | };
|
39175 |
|
39176 | InfiniteScroller.prototype._createDOMNodes = function (unusedNodes) {
|
39177 | var tombstoneAnimations = {};
|
39178 | for (var i = this.firstAttachedItem; i < this.lastAttachedItem; i++) {
|
39179 | while (this.items.length <= i) {
|
39180 | this._addItem();
|
39181 | }
|
39182 | var currentNode = this.items[i].node;
|
39183 | var currentData = this.items[i].data;
|
39184 | if (currentNode) {
|
39185 | if (isTombstoneNode(currentNode) && currentData) {
|
39186 | currentNode.style.zIndex = 1;
|
39187 | tombstoneAnimations[i] = [currentNode, this.items[i].top - this.anchorScrollTop];
|
39188 | this.items[i].node = null;
|
39189 | } else {
|
39190 | continue;
|
39191 | }
|
39192 | }
|
39193 | var node = currentData ? this.options.render(currentData, unusedNodes.pop()) : this._getTombStone();
|
39194 | node.style.position = 'absolute';
|
39195 | this.items[i].top = -1;
|
39196 | this.scrollerEl.appendChild(node);
|
39197 | this.items[i].node = node;
|
39198 | }
|
39199 | return tombstoneAnimations;
|
39200 | };
|
39201 |
|
39202 | InfiniteScroller.prototype._cleanupUnusedNodes = function (unusedNodes) {
|
39203 | while (unusedNodes.length) {
|
39204 | this.scrollerEl.removeChild(unusedNodes.pop());
|
39205 | }
|
39206 | };
|
39207 |
|
39208 | InfiniteScroller.prototype._cacheNodeSize = function () {
|
39209 | for (var i = this.firstAttachedItem; i < this.lastAttachedItem; i++) {
|
39210 | var item = this.items[i];
|
39211 |
|
39212 | if (item.data && !item.height) {
|
39213 | var isTombstone = isTombstoneNode(item.node);
|
39214 | item.height = isTombstone ? this.tombstoneHeight : item.node.offsetHeight;
|
39215 | item.width = isTombstone ? this.tombstoneWidth : item.node.offsetWidth;
|
39216 | }
|
39217 | }
|
39218 | };
|
39219 |
|
39220 | InfiniteScroller.prototype._fixScrollPosition = function () {
|
39221 | this.anchorScrollTop = 0;
|
39222 | for (var _i = 0; _i < this.anchorItem.index; _i++) {
|
39223 | this.anchorScrollTop += this.items[_i].height || this.tombstoneHeight;
|
39224 | }
|
39225 | this.anchorScrollTop += this.anchorItem.offset;
|
39226 |
|
39227 |
|
39228 | var curPos = this.anchorScrollTop - this.anchorItem.offset;
|
39229 | var i = this.anchorItem.index;
|
39230 | while (i > this.firstAttachedItem) {
|
39231 | curPos -= this.items[i - 1].height || this.tombstoneHeight;
|
39232 | i--;
|
39233 | }
|
39234 |
|
39235 | return curPos;
|
39236 | };
|
39237 |
|
39238 | InfiniteScroller.prototype._setupAnimations = function (tombstoneAnimations, curPos) {
|
39239 | var _this4 = this;
|
39240 |
|
39241 | for (var i in tombstoneAnimations) {
|
39242 | var animation = tombstoneAnimations[i];
|
39243 | this.items[i].node.style[bscroll_esm_style.transform] = 'translateY(' + (this.anchorScrollTop + animation[1]) + 'px) scale(' + this.tombstoneWidth / this.items[i].width + ', ' + this.tombstoneHeight / this.items[i].height + ')';
|
39244 |
|
39245 |
|
39246 | this.items[i].node.offsetTop;
|
39247 | animation[0].offsetTop;
|
39248 | this.items[i].node.style[bscroll_esm_style.transition] = cssVendor + 'transform ' + ANIMATION_DURATION_MS + 'ms';
|
39249 | }
|
39250 |
|
39251 | for (var _i2 = this.firstAttachedItem; _i2 < this.lastAttachedItem; _i2++) {
|
39252 | var _animation = tombstoneAnimations[_i2];
|
39253 | if (_animation) {
|
39254 | var tombstoneNode = _animation[0];
|
39255 | tombstoneNode.style[bscroll_esm_style.transition] = cssVendor + 'transform ' + ANIMATION_DURATION_MS + 'ms, opacity ' + ANIMATION_DURATION_MS + 'ms';
|
39256 | tombstoneNode.style[bscroll_esm_style.transform] = 'translateY(' + curPos + 'px) scale(' + this.items[_i2].width / this.tombstoneWidth + ', ' + this.items[_i2].height / this.tombstoneHeight + ')';
|
39257 | tombstoneNode.style.opacity = 0;
|
39258 | }
|
39259 | if (curPos !== this.items[_i2].top) {
|
39260 | if (!_animation) {
|
39261 | this.items[_i2].node.style[bscroll_esm_style.transition] = '';
|
39262 | }
|
39263 | this.items[_i2].node.style[bscroll_esm_style.transform] = 'translateY(' + curPos + 'px)';
|
39264 | }
|
39265 | this.items[_i2].top = curPos;
|
39266 | curPos += this.items[_i2].height || this.tombstoneHeight;
|
39267 | }
|
39268 |
|
39269 | this.scroller.maxScrollY = -(curPos - this.scroller.wrapperHeight + (this.hasMore ? DEFAULT_SCROLL_RUNWAY : 0));
|
39270 |
|
39271 | var tombstoneAnimationsHandler = setTimeout(function () {
|
39272 | for (var _i3 in tombstoneAnimations) {
|
39273 | var _animation2 = tombstoneAnimations[_i3];
|
39274 | _animation2[0].style.display = 'none';
|
39275 |
|
39276 | _this4.tombstones.push(_animation2[0]);
|
39277 | }
|
39278 | }, ANIMATION_DURATION_MS);
|
39279 |
|
39280 | this.tombstonesAnimationHandlers.push(tombstoneAnimationsHandler);
|
39281 | };
|
39282 |
|
39283 | InfiniteScroller.prototype._getTombStone = function () {
|
39284 | var tombstone = this.tombstones.pop();
|
39285 | if (tombstone) {
|
39286 | tombstone.style.display = '';
|
39287 | tombstone.style.opacity = 1;
|
39288 | tombstone.style[bscroll_esm_style.transform] = '';
|
39289 | tombstone.style[bscroll_esm_style.transition] = '';
|
39290 | return tombstone;
|
39291 | }
|
39292 | return this.options.createTombstone();
|
39293 | };
|
39294 |
|
39295 | InfiniteScroller.prototype._addItem = function () {
|
39296 | this.items.push({
|
39297 | data: null,
|
39298 | node: null,
|
39299 | height: 0,
|
39300 | width: 0,
|
39301 | top: 0
|
39302 | });
|
39303 | };
|
39304 |
|
39305 | InfiniteScroller.prototype._calculateAnchoredItem = function (initialAnchor, delta) {
|
39306 | if (delta === 0) {
|
39307 | return initialAnchor;
|
39308 | }
|
39309 | var i = initialAnchor.index;
|
39310 | var tombstones = 0;
|
39311 |
|
39312 | delta += initialAnchor.offset;
|
39313 | if (delta < 0) {
|
39314 | while (delta < 0 && i > 0 && this.items[i - 1].height) {
|
39315 | delta += this.items[i - 1].height;
|
39316 | i--;
|
39317 | }
|
39318 | tombstones = Math.max(-i, Math.ceil(Math.min(delta, 0) / this.tombstoneHeight));
|
39319 | } else {
|
39320 | while (delta > 0 && i < this.items.length && this.items[i].height && this.items[i].height < delta) {
|
39321 | delta -= this.items[i].height;
|
39322 | i++;
|
39323 | }
|
39324 | if (i >= this.items.length || !this.items[i].height) {
|
39325 | tombstones = Math.floor(Math.max(delta, 0) / this.tombstoneHeight);
|
39326 | }
|
39327 | }
|
39328 | i += tombstones;
|
39329 | delta -= tombstones * this.tombstoneHeight;
|
39330 |
|
39331 | return {
|
39332 | index: i,
|
39333 | offset: delta
|
39334 | };
|
39335 | };
|
39336 |
|
39337 | function BScroll(el, options) {
|
39338 | this.wrapper = typeof el === 'string' ? document.querySelector(el) : el;
|
39339 | if (!this.wrapper) {
|
39340 | warn('Can not resolve the wrapper DOM.');
|
39341 | }
|
39342 | this.scroller = this.wrapper.children[0];
|
39343 | if (!this.scroller) {
|
39344 | warn('The wrapper need at least one child element to be scroller.');
|
39345 | }
|
39346 |
|
39347 | this.scrollerStyle = this.scroller.style;
|
39348 |
|
39349 | this._init(options);
|
39350 | }
|
39351 |
|
39352 | initMixin(BScroll);
|
39353 | coreMixin(BScroll);
|
39354 | eventMixin(BScroll);
|
39355 | snapMixin(BScroll);
|
39356 | wheelMixin(BScroll);
|
39357 | scrollbarMixin(BScroll);
|
39358 | pullDownMixin(BScroll);
|
39359 | pullUpMixin(BScroll);
|
39360 | mouseWheelMixin(BScroll);
|
39361 | zoomMixin(BScroll);
|
39362 | infiniteMixin(BScroll);
|
39363 |
|
39364 | BScroll.Version = '1.15.2';
|
39365 |
|
39366 | var bscroll_esm = (BScroll);
|
39367 |
|
39368 |
|
39369 | var PDFView_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; };
|
39370 |
|
39371 | var PDFView_class, PDFView_temp;
|
39372 |
|
39373 | function PDFView_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
39374 |
|
39375 | function PDFView_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
39376 |
|
39377 | function PDFView_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
39378 |
|
39379 | function PDFView_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
39380 |
|
39381 |
|
39382 |
|
39383 |
|
39384 |
|
39385 |
|
39386 | var PDFView_PDFView = (PDFView_temp = PDFView_class = function (_Component) {
|
39387 | PDFView_inherits(PDFView, _Component);
|
39388 |
|
39389 | function PDFView(props) {
|
39390 | PDFView_classCallCheck(this, PDFView);
|
39391 |
|
39392 | var _this = PDFView_possibleConstructorReturn(this, _Component.call(this, props));
|
39393 |
|
39394 | _this.instance = function () {
|
39395 | var _this$props = _this.props,
|
39396 | src = _this$props.src,
|
39397 | pictures = _this$props.pictures,
|
39398 | errorHTML = _this$props.errorHTML,
|
39399 | loadHTML = _this$props.loadHTML,
|
39400 | cMapUrl = _this$props.cMapUrl;
|
39401 |
|
39402 | if (!src && !pictures) return;
|
39403 | var bscroll = null;
|
39404 | var instance = new PDFView_instance(_this.$el, {
|
39405 | src: src,
|
39406 | pictures: pictures,
|
39407 | errorHTML: errorHTML,
|
39408 | loadHTML: loadHTML,
|
39409 |
|
39410 | cMapUrl: cMapUrl,
|
39411 | onLoad: function onLoad() {
|
39412 | bscroll = new bscroll_esm('.pdf-container', {
|
39413 | scrollX: true,
|
39414 | zoom: {
|
39415 | start: 1,
|
39416 | min: 1,
|
39417 | max: 4
|
39418 | }
|
39419 | });
|
39420 | }
|
39421 | });
|
39422 | _this.bscroll = bscroll;
|
39423 | _this.instance = instance;
|
39424 | };
|
39425 |
|
39426 | return _this;
|
39427 | }
|
39428 |
|
39429 | PDFView.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
|
39430 | var _props = this.props,
|
39431 | src = _props.src,
|
39432 | pictures = _props.pictures,
|
39433 | errorHTML = _props.errorHTML,
|
39434 | loadHTML = _props.loadHTML,
|
39435 | cMapUrl = _props.cMapUrl;
|
39436 |
|
39437 | if (src && src !== prevProps.src || pictures && pictures !== prevProps.pictures) {
|
39438 | if (!this.instance) {
|
39439 | this.instance();
|
39440 | } else {
|
39441 | this.instance.update({
|
39442 | src: src,
|
39443 | pictures: pictures,
|
39444 | errorHTML: errorHTML,
|
39445 | loadHTML: loadHTML,
|
39446 |
|
39447 | cMapUrl: cMapUrl
|
39448 | });
|
39449 | }
|
39450 | }
|
39451 | };
|
39452 |
|
39453 | PDFView.prototype.componentDidMount = function componentDidMount() {
|
39454 | this.instance();
|
39455 | };
|
39456 |
|
39457 | PDFView.prototype.render = function render() {
|
39458 | var _this2 = this;
|
39459 |
|
39460 | var _props2 = this.props,
|
39461 | src = _props2.src,
|
39462 | pictures = _props2.pictures,
|
39463 | errorHTML = _props2.errorHTML,
|
39464 | loadHTML = _props2.loadHTML,
|
39465 | cMapUrl = _props2.cMapUrl,
|
39466 | others = PDFView_objectWithoutProperties(_props2, ['src', 'pictures', 'errorHTML', 'loadHTML', 'cMapUrl']);
|
39467 |
|
39468 | if (!src && !pictures) {
|
39469 | return null;
|
39470 | }
|
39471 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
39472 | 'div',
|
39473 | PDFView_extends({ className: 'pdf-container' }, others, { ref: function ref(el) {
|
39474 | _this2.$el = el;
|
39475 | } }),
|
39476 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'pdf-wrapper' })
|
39477 | );
|
39478 | };
|
39479 |
|
39480 | return PDFView;
|
39481 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), PDFView_class.propTypes = {
|
39482 | pictures: prop_types_default.a.array,
|
39483 | src: prop_types_default.a.string,
|
39484 | errorHTML: prop_types_default.a.string,
|
39485 | loadHTML: prop_types_default.a.string,
|
39486 |
|
39487 | cMapUrl: prop_types_default.a.string
|
39488 | }, PDFView_class.defaultProps = {
|
39489 | loadHTML: '加载中',
|
39490 | errorHTML: '文件加载失败'
|
39491 | }, PDFView_temp);
|
39492 |
|
39493 |
|
39494 |
|
39495 |
|
39496 | var src_PDFView = (PDFView_PDFView);
|
39497 |
|
39498 | var Peg_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; };
|
39499 |
|
39500 | var Peg_class, Peg_temp;
|
39501 |
|
39502 | function Peg_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
39503 |
|
39504 | function Peg_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
39505 |
|
39506 | function Peg_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
39507 |
|
39508 | function Peg_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
39509 |
|
39510 |
|
39511 |
|
39512 |
|
39513 | var Peg_Peg = (Peg_temp = Peg_class = function (_Component) {
|
39514 | Peg_inherits(Peg, _Component);
|
39515 |
|
39516 | function Peg(props) {
|
39517 | Peg_classCallCheck(this, Peg);
|
39518 |
|
39519 | return Peg_possibleConstructorReturn(this, _Component.call(this, props));
|
39520 | }
|
39521 |
|
39522 | Peg.prototype.render = function render() {
|
39523 | var _this2 = this;
|
39524 |
|
39525 | var _props = this.props,
|
39526 | className = _props.className,
|
39527 | others = Peg_objectWithoutProperties(_props, ['className']);
|
39528 |
|
39529 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('i', Peg_extends({ ref: function ref(el) {
|
39530 | _this2.$el = el;
|
39531 | }, className: 'peg' + (className ? ' ' + className : '') }, others));
|
39532 | };
|
39533 |
|
39534 | return Peg;
|
39535 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Peg_class.propTypes = {
|
39536 | className: prop_types_default.a.string
|
39537 | }, Peg_class.defaultProps = {}, Peg_temp);
|
39538 |
|
39539 |
|
39540 |
|
39541 |
|
39542 | var src_Peg = (Peg_Peg);
|
39543 |
|
39544 | var Player_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; };
|
39545 |
|
39546 | var Player_class, Player_temp;
|
39547 |
|
39548 | function Player_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
39549 |
|
39550 | function Player_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
39551 |
|
39552 | function Player_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
39553 |
|
39554 | function Player_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
39555 |
|
39556 |
|
39557 |
|
39558 |
|
39559 |
|
39560 |
|
39561 |
|
39562 | var Player_Player = (Player_temp = Player_class = function (_Component) {
|
39563 | Player_inherits(Player, _Component);
|
39564 |
|
39565 | function Player(props) {
|
39566 | Player_classCallCheck(this, Player);
|
39567 |
|
39568 | var _this = Player_possibleConstructorReturn(this, _Component.call(this, props));
|
39569 |
|
39570 | _this.onClick = function (e) {
|
39571 | if (_this.props.onClick) {
|
39572 | _this.props.onClick(Object.getArgs(e, _this.props.args));
|
39573 | } else {
|
39574 | var target = e.currentTarget.querySelector('video');
|
39575 | src_FullScreen.enter(target);
|
39576 |
|
39577 | setTimeout(function () {
|
39578 | target.play();
|
39579 | }, 500);
|
39580 | }
|
39581 | e.stopPropagation();
|
39582 | };
|
39583 |
|
39584 | _this.getType = function () {
|
39585 | var src = _this.props.src;
|
39586 |
|
39587 | return src_MediaUtil.sourceType(src);
|
39588 | };
|
39589 |
|
39590 | return _this;
|
39591 | }
|
39592 |
|
39593 | Player.prototype.componentDidMount = function componentDidMount() {
|
39594 | var video = this.$video;
|
39595 | src_FullScreen.addHandler(video, function (e) {
|
39596 | if (src_FullScreen.isFull(video)) {
|
39597 | video.play();
|
39598 | } else {
|
39599 | video.pause();
|
39600 | }
|
39601 | });
|
39602 | };
|
39603 |
|
39604 | Player.prototype.render = function render() {
|
39605 | var _this2 = this;
|
39606 |
|
39607 | var _props = this.props,
|
39608 | args = _props.args,
|
39609 | children = _props.children,
|
39610 | style = _props.style,
|
39611 | className = _props.className,
|
39612 | src = _props.src,
|
39613 | onClick = _props.onClick,
|
39614 | others = Player_objectWithoutProperties(_props, ['args', 'children', 'style', 'className', 'src', 'onClick']);
|
39615 |
|
39616 |
|
39617 |
|
39618 | if (src_Device.os === 'andriod' || onClick) {
|
39619 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
39620 | 'div',
|
39621 | { ref: function ref(el) {
|
39622 | _this2.$el = el;
|
39623 | }, className: 'player-thumbnail' + (className ? ' ' + className : ''), style: style, onClick: this.onClick },
|
39624 | !onClick && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
39625 | 'video',
|
39626 | Player_extends({ ref: function ref(el) {
|
39627 | _this2.$video = el;
|
39628 | } }, others),
|
39629 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('source', { src: src, type: this.getType() }),
|
39630 | '\u60A8\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 video \u6807\u7B7E\u3002'
|
39631 | ),
|
39632 | this.props.poster && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { style: { backgroundImage: 'url(' + this.props.poster + ')' }, className: 'player-thumbnail-poster' }),
|
39633 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'player-thumbnail-button' }),
|
39634 | children
|
39635 | );
|
39636 | }
|
39637 |
|
39638 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
39639 | 'div',
|
39640 | { ref: function ref(el) {
|
39641 | _this2.$el = el;
|
39642 | }, className: 'player-thumbnail' + (className ? ' ' + className : ''), style: style },
|
39643 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
39644 | 'video',
|
39645 | Player_extends({ controls: true, ref: function ref(el) {
|
39646 | _this2.$video = el;
|
39647 | } }, others),
|
39648 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('source', { src: src, type: this.getType() }),
|
39649 | '\u60A8\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 video \u6807\u7B7E\u3002'
|
39650 | ),
|
39651 | children
|
39652 | );
|
39653 | };
|
39654 |
|
39655 | return Player;
|
39656 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Player_class.propTypes = {
|
39657 | args: prop_types_default.a.any,
|
39658 | style: prop_types_default.a.object,
|
39659 | className: prop_types_default.a.string,
|
39660 | children: prop_types_default.a.node,
|
39661 |
|
39662 | src: prop_types_default.a.string,
|
39663 | onClick: prop_types_default.a.func
|
39664 | }, Player_class.defaultProps = {}, Player_temp);
|
39665 |
|
39666 |
|
39667 |
|
39668 |
|
39669 | var src_Player = (Player_Player);
|
39670 |
|
39671 | var Popover_class, Popover_temp;
|
39672 |
|
39673 | function Popover_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
39674 |
|
39675 | function Popover_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
39676 |
|
39677 | function Popover_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
39678 |
|
39679 |
|
39680 |
|
39681 |
|
39682 |
|
39683 | var Popover_Popover = (Popover_temp = Popover_class = function (_Component) {
|
39684 | Popover_inherits(Popover, _Component);
|
39685 |
|
39686 | function Popover(props) {
|
39687 | Popover_classCallCheck(this, Popover);
|
39688 |
|
39689 | var _this = Popover_possibleConstructorReturn(this, _Component.call(this, props));
|
39690 |
|
39691 | _this.componentDidMount = function () {};
|
39692 |
|
39693 | _this.onClickMask = function (e) {
|
39694 | if (_this.props.onClickMask) _this.props.onClickMask(Object.getArgs(e, _this.props.args));
|
39695 | e.stopPropagation();
|
39696 | };
|
39697 |
|
39698 | return _this;
|
39699 | }
|
39700 |
|
39701 | Popover.prototype.render = function render() {
|
39702 | var _this2 = this;
|
39703 |
|
39704 | var _props = this.props,
|
39705 | show = _props.show,
|
39706 | maskClassName = _props.maskClassName,
|
39707 | maskStyle = _props.maskStyle,
|
39708 | className = _props.className,
|
39709 | style = _props.style,
|
39710 | animation = _props.animation,
|
39711 | children = _props.children;
|
39712 |
|
39713 | return Object(react_dom["createPortal"])(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
39714 | 'div',
|
39715 | { ref: function ref(el) {
|
39716 | _this2.$el = el;
|
39717 | }, className: 'mask popover-mask' + (maskClassName ? ' ' + maskClassName : '') + (show ? ' active' : ''), style: maskStyle, onClick: this.onClickMask },
|
39718 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
39719 | 'div',
|
39720 | { style: style, className: 'popover' + (className ? ' ' + className : '') + (show ? ' active' : ''), 'data-animation': animation },
|
39721 | children && children
|
39722 | )
|
39723 | ), this.props.portal || document.getElementById('root'));
|
39724 | };
|
39725 |
|
39726 | return Popover;
|
39727 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Popover_class.propTypes = {
|
39728 | args: prop_types_default.a.any,
|
39729 | portal: prop_types_default.a.object,
|
39730 | show: prop_types_default.a.bool,
|
39731 |
|
39732 | animation: prop_types_default.a.string,
|
39733 | isClickMaskHide: prop_types_default.a.bool,
|
39734 |
|
39735 | maskClassName: prop_types_default.a.string,
|
39736 | maskStyle: prop_types_default.a.object,
|
39737 | onClickMask: prop_types_default.a.func,
|
39738 |
|
39739 | className: prop_types_default.a.string,
|
39740 | style: prop_types_default.a.object,
|
39741 |
|
39742 | children: prop_types_default.a.node
|
39743 | }, Popover_class.defaultProps = {
|
39744 | isClickMaskHide: true,
|
39745 | animation: 'zoom'
|
39746 | }, Popover_temp);
|
39747 |
|
39748 |
|
39749 |
|
39750 |
|
39751 | var src_Popover = (Popover_Popover);
|
39752 |
|
39753 | var Preview_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; };
|
39754 |
|
39755 | var Preview_class, Preview_temp;
|
39756 |
|
39757 | function Preview_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
39758 |
|
39759 | function Preview_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
39760 |
|
39761 | function Preview_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
39762 |
|
39763 | function Preview_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
39764 |
|
39765 |
|
39766 |
|
39767 |
|
39768 |
|
39769 |
|
39770 | var Preview_Preview = (Preview_temp = Preview_class = function (_Component) {
|
39771 | Preview_inherits(Preview, _Component);
|
39772 |
|
39773 | function Preview(props) {
|
39774 | Preview_classCallCheck(this, Preview);
|
39775 |
|
39776 | return Preview_possibleConstructorReturn(this, _Component.call(this, props));
|
39777 | }
|
39778 |
|
39779 | Preview.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
|
39780 | if (!this.instance) return false;
|
39781 | if (this.props.src !== prevProps.src || this.props.layerHTML !== prevProps.layerHTML) {
|
39782 | this.instance.setSrc(this.props.src);
|
39783 | this.instance.setLayerHTML(this.props.layerHTML);
|
39784 | this.instance.update();
|
39785 | }
|
39786 | if (this.props.show !== prevProps.show) {
|
39787 | if (this.props.show) this.instance.show();else this.instance.hide();
|
39788 | }
|
39789 | };
|
39790 |
|
39791 | Preview.prototype.componentDidMount = function componentDidMount() {
|
39792 | if (this.instance) return;
|
39793 | var instance = new Preview_instance({
|
39794 | mask: this.$el,
|
39795 | showHeader: this.props.showHeader,
|
39796 | src: this.props.src,
|
39797 | layerHTML: this.props.layerHTML,
|
39798 | onClickBack: this.props.onClickBack,
|
39799 | onClick: this.props.onClickBack
|
39800 | });
|
39801 | this.instance = instance;
|
39802 | };
|
39803 |
|
39804 | Preview.prototype.render = function render() {
|
39805 | var _this2 = this;
|
39806 |
|
39807 | var _props = this.props,
|
39808 | portal = _props.portal,
|
39809 | show = _props.show,
|
39810 | src = _props.src,
|
39811 | layerHTML = _props.layerHTML,
|
39812 | onClickBack = _props.onClickBack,
|
39813 | others = Preview_objectWithoutProperties(_props, ['portal', 'show', 'src', 'layerHTML', 'onClickBack']);
|
39814 |
|
39815 | if (!src) {
|
39816 | return null;
|
39817 | }
|
39818 | return Object(react_dom["createPortal"])(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
39819 | 'div',
|
39820 | Preview_extends({ ref: function ref(el) {
|
39821 | _this2.$el = el;
|
39822 | }, className: 'preview-mask' }, others),
|
39823 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
39824 | 'div',
|
39825 | { className: 'preview-header' },
|
39826 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'preview-header-back' })
|
39827 | ),
|
39828 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'preview-container' })
|
39829 | ), portal || document.getElementById('root'));
|
39830 | };
|
39831 |
|
39832 | return Preview;
|
39833 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Preview_class.propTypes = {
|
39834 | portal: prop_types_default.a.object,
|
39835 | show: prop_types_default.a.bool,
|
39836 | showHeader: prop_types_default.a.bool,
|
39837 |
|
39838 | src: prop_types_default.a.string,
|
39839 | layerHTML: prop_types_default.a.string,
|
39840 |
|
39841 | onClickBack: prop_types_default.a.func
|
39842 | }, Preview_class.defaultProps = {
|
39843 | show: false,
|
39844 | showHeader: false
|
39845 | }, Preview_temp);
|
39846 |
|
39847 |
|
39848 |
|
39849 |
|
39850 | var src_Preview = (Preview_Preview);
|
39851 |
|
39852 | var Progress_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; };
|
39853 |
|
39854 | var Progress_class, Progress_temp;
|
39855 |
|
39856 | function Progress_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
39857 |
|
39858 | function Progress_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
39859 |
|
39860 | function Progress_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
39861 |
|
39862 | function Progress_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
39863 |
|
39864 |
|
39865 |
|
39866 |
|
39867 |
|
39868 | var Progress_Progress = (Progress_temp = Progress_class = function (_Component) {
|
39869 | Progress_inherits(Progress, _Component);
|
39870 |
|
39871 | function Progress(props) {
|
39872 | Progress_classCallCheck(this, Progress);
|
39873 |
|
39874 | var _this = Progress_possibleConstructorReturn(this, _Component.call(this, props));
|
39875 |
|
39876 | _this.componentDidMount = function () {};
|
39877 |
|
39878 | return _this;
|
39879 | }
|
39880 |
|
39881 | Progress.prototype.render = function render() {
|
39882 | var _this2 = this;
|
39883 |
|
39884 | var _props = this.props,
|
39885 | style = _props.style,
|
39886 | className = _props.className,
|
39887 | barStyle = _props.barStyle,
|
39888 | barClassName = _props.barClassName,
|
39889 | captionStyle = _props.captionStyle,
|
39890 | captionClassName = _props.captionClassName,
|
39891 | percentage = _props.percentage,
|
39892 | max = _props.max,
|
39893 | min = _props.min,
|
39894 | value = _props.value,
|
39895 | showPercentage = _props.showPercentage,
|
39896 | children = _props.children,
|
39897 | others = Progress_objectWithoutProperties(_props, ['style', 'className', 'barStyle', 'barClassName', 'captionStyle', 'captionClassName', 'percentage', 'max', 'min', 'value', 'showPercentage', 'children']);
|
39898 |
|
39899 |
|
39900 |
|
39901 |
|
39902 | var barPercentage = 0;
|
39903 | var textPercentage = 0;
|
39904 | if (!isNaN(percentage)) {
|
39905 | barPercentage = textPercentage = percentage;
|
39906 | } else if (!isNaN(max) && !isNaN(value)) {
|
39907 | barPercentage = textPercentage = value / (max - min) * 100;
|
39908 | }
|
39909 | if (barPercentage > 100) {
|
39910 | barPercentage = 100;
|
39911 | } else if (barPercentage < 0) {
|
39912 | barPercentage = 0;
|
39913 | }
|
39914 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
39915 | 'div',
|
39916 | Progress_extends({ className: 'progress' + (className ? ' ' + className : ''), style: style }, others),
|
39917 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
39918 | 'span',
|
39919 | { ref: function ref(el) {
|
39920 | _this2.$bar = el;
|
39921 | }, className: 'progress-bar' + (barClassName ? ' ' + barClassName : ''), style: Object.assign({}, barStyle, { width: barPercentage + '%' }) },
|
39922 | showPercentage && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(src_Counter, { duration: 1000, to: textPercentage, from: 0, suffix: '%', className: 'progress-caption' + (captionClassName ? ' ' + captionClassName : ''), style: captionStyle }),
|
39923 | !showPercentage && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(src_Counter, { duration: 1000, to: Number(value), from: min, suffix: '/' + max, className: 'progress-caption' + (captionClassName ? ' ' + captionClassName : ''), style: captionStyle })
|
39924 | ),
|
39925 | children
|
39926 | );
|
39927 | };
|
39928 |
|
39929 | return Progress;
|
39930 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Progress_class.propTypes = {
|
39931 | style: prop_types_default.a.object,
|
39932 | className: prop_types_default.a.string,
|
39933 |
|
39934 | barStyle: prop_types_default.a.object,
|
39935 | barClassName: prop_types_default.a.string,
|
39936 |
|
39937 | captionClassName: prop_types_default.a.string,
|
39938 | captionStyle: prop_types_default.a.object,
|
39939 |
|
39940 | percentage: prop_types_default.a.number,
|
39941 | max: prop_types_default.a.number,
|
39942 | min: prop_types_default.a.number,
|
39943 | value: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.number]),
|
39944 | showPercentage: prop_types_default.a.bool,
|
39945 |
|
39946 | children: prop_types_default.a.node
|
39947 | }, Progress_class.defaultProps = {
|
39948 | showPercentage: true,
|
39949 | max: 100,
|
39950 | min: 0,
|
39951 | value: 0
|
39952 | }, Progress_temp);
|
39953 |
|
39954 |
|
39955 |
|
39956 |
|
39957 | var src_Progress = (Progress_Progress);
|
39958 |
|
39959 | var Radio_class, Radio_temp;
|
39960 |
|
39961 | function Radio_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
39962 |
|
39963 | function Radio_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
39964 |
|
39965 | function Radio_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
39966 |
|
39967 |
|
39968 |
|
39969 |
|
39970 | var Radio_Radio = (Radio_temp = Radio_class = function (_Component) {
|
39971 | Radio_inherits(Radio, _Component);
|
39972 |
|
39973 | function Radio(props) {
|
39974 | Radio_classCallCheck(this, Radio);
|
39975 |
|
39976 | var _this = Radio_possibleConstructorReturn(this, _Component.call(this, props));
|
39977 |
|
39978 | _this.onClick = function (e) {
|
39979 | if (_this.props.disabled) return;
|
39980 | if (_this.props.onClick) {
|
39981 | _this.props.onClick(_this.$input.checked, Object.getArgs(e, _this.props.args));
|
39982 | }
|
39983 | };
|
39984 |
|
39985 | return _this;
|
39986 | }
|
39987 |
|
39988 | Radio.prototype.render = function render() {
|
39989 | var _this2 = this;
|
39990 |
|
39991 | var _props = this.props,
|
39992 | style = _props.style,
|
39993 | className = _props.className,
|
39994 | name = _props.name,
|
39995 | value = _props.value,
|
39996 | checked = _props.checked,
|
39997 | caption = _props.caption,
|
39998 | captionClassName = _props.captionClassName,
|
39999 | captionStyle = _props.captionStyle;
|
40000 |
|
40001 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
40002 | 'div',
|
40003 | { className: 'radio-box' + (className ? ' ' + className : ''), onClick: this.onClick, style: style },
|
40004 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('input', { readOnly: true, checked: checked, type: 'radio', className: 'radio events-none', name: name, value: value, ref: function ref(el) {
|
40005 | _this2.$input = el;
|
40006 | } }),
|
40007 | caption && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
40008 | 'span',
|
40009 | { className: 'radio-caption' + (captionClassName ? ' ' + captionClassName : ''), style: captionStyle },
|
40010 | caption
|
40011 | )
|
40012 | );
|
40013 | };
|
40014 |
|
40015 | return Radio;
|
40016 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Radio_class.propTypes = {
|
40017 | args: prop_types_default.a.any,
|
40018 | style: prop_types_default.a.object,
|
40019 | className: prop_types_default.a.string,
|
40020 | onClick: prop_types_default.a.func,
|
40021 |
|
40022 | name: prop_types_default.a.string,
|
40023 | value: prop_types_default.a.string,
|
40024 | checked: prop_types_default.a.bool,
|
40025 | disabled: prop_types_default.a.bool,
|
40026 |
|
40027 | caption: prop_types_default.a.string,
|
40028 | captionClassName: prop_types_default.a.string,
|
40029 | captionStyle: prop_types_default.a.object
|
40030 | }, Radio_class.defaultProps = {
|
40031 | args: null,
|
40032 | value: '',
|
40033 | checked: false
|
40034 | }, Radio_temp);
|
40035 |
|
40036 |
|
40037 |
|
40038 |
|
40039 | var src_Radio = (Radio_Radio);
|
40040 |
|
40041 | var SearchBoard_class, SearchBoard_temp;
|
40042 |
|
40043 | function SearchBoard_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
40044 |
|
40045 | function SearchBoard_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
40046 |
|
40047 | function SearchBoard_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
40048 |
|
40049 |
|
40050 |
|
40051 |
|
40052 |
|
40053 | var SearchBoard_SearchBoard = (SearchBoard_temp = SearchBoard_class = function (_Component) {
|
40054 | SearchBoard_inherits(SearchBoard, _Component);
|
40055 |
|
40056 | function SearchBoard(props, context) {
|
40057 | SearchBoard_classCallCheck(this, SearchBoard);
|
40058 |
|
40059 |
|
40060 | var _this = SearchBoard_possibleConstructorReturn(this, _Component.call(this, props, context));
|
40061 |
|
40062 | _this.onClear = function () {
|
40063 | src_DB.removeStore(_this.props.dbKey);
|
40064 | _this.setState({
|
40065 | tags: []
|
40066 | });
|
40067 | if (_this.props.onClear) _this.props.onClear();
|
40068 | };
|
40069 |
|
40070 | _this.add = function (item) {
|
40071 | if (!item.value) return;
|
40072 | var tags = src_DB.getStore(_this.props.dbKey) || [];
|
40073 |
|
40074 | for (var i in tags) {
|
40075 | if (tags[i].value === item.value) {
|
40076 | tags.splice(i, 1);
|
40077 | break;
|
40078 | }
|
40079 | }
|
40080 |
|
40081 | tags.unshift(item);
|
40082 | src_DB.setStore(_this.props.dbKey, tags);
|
40083 | _this.setState({
|
40084 | tags: tags
|
40085 | });
|
40086 | };
|
40087 |
|
40088 | _this.state = {
|
40089 | tags: src_DB.getStore(_this.props.dbKey) || []
|
40090 | };
|
40091 | return _this;
|
40092 | }
|
40093 |
|
40094 |
|
40095 |
|
40096 |
|
40097 |
|
40098 | SearchBoard.prototype.render = function render() {
|
40099 | var tags = this.state.tags;
|
40100 | var _props = this.props,
|
40101 | style = _props.style,
|
40102 | className = _props.className,
|
40103 | show = _props.show,
|
40104 | expandCaption = _props.expandCaption,
|
40105 | expandTags = _props.expandTags,
|
40106 | _onClick = _props.onClick,
|
40107 | onClickExpand = _props.onClickExpand,
|
40108 | children = _props.children;
|
40109 |
|
40110 | var isHide = false;
|
40111 | if (this.props.showValidTags && tags.length === 0) {
|
40112 | isHide = true;
|
40113 | }
|
40114 | var DOM = null;
|
40115 | if (!isHide) {
|
40116 | DOM = external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
40117 | 'div',
|
40118 | { className: 'searchboard ' + (className ? ' ' + className : '') + (show ? '' : ' hide'), style: style },
|
40119 | tags.length > 0 && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
40120 | 'div',
|
40121 | { className: 'searchboard-caption' },
|
40122 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
40123 | 'div',
|
40124 | { className: 'searchboard-caption-title' },
|
40125 | '\u641C\u7D22\u5386\u53F2'
|
40126 | ),
|
40127 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
40128 | 'div',
|
40129 | { className: 'searchboard-caption-ricon', onClick: this.onClear },
|
40130 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('i', { className: 'searchboard-icon-trash' }),
|
40131 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
40132 | 'span',
|
40133 | null,
|
40134 | '\u6E05\u9664'
|
40135 | )
|
40136 | )
|
40137 | ),
|
40138 | tags.map(function (item, index) {
|
40139 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
40140 | 'div',
|
40141 | { className: 'searchboard-tag', onClick: function onClick() {
|
40142 | if (_onClick) _onClick(item, index);
|
40143 | }, key: index },
|
40144 | item.value
|
40145 | );
|
40146 | }),
|
40147 | expandCaption && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
40148 | 'div',
|
40149 | { className: 'searchboard-caption' },
|
40150 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
40151 | 'div',
|
40152 | { className: 'searchboard-caption-title' },
|
40153 | expandCaption
|
40154 | )
|
40155 | ),
|
40156 | expandTags && expandTags.map(function (item, index) {
|
40157 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
40158 | 'div',
|
40159 | { className: 'searchboard-tag', onClick: function onClick() {
|
40160 | if (onClickExpand) onClickExpand(item, index);
|
40161 | }, key: index },
|
40162 | item.value
|
40163 | );
|
40164 | }),
|
40165 | children
|
40166 | );
|
40167 | }
|
40168 | return DOM;
|
40169 | };
|
40170 |
|
40171 | return SearchBoard;
|
40172 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), SearchBoard_class.propTypes = {
|
40173 | style: prop_types_default.a.object,
|
40174 | className: prop_types_default.a.string,
|
40175 | dbKey: prop_types_default.a.string,
|
40176 | show: prop_types_default.a.bool,
|
40177 | showValidTags: prop_types_default.a.bool,
|
40178 | onClick: prop_types_default.a.func,
|
40179 | onClear: prop_types_default.a.func,
|
40180 | expandCaption: prop_types_default.a.string,
|
40181 | expandTags: prop_types_default.a.array,
|
40182 | onClickExpand: prop_types_default.a.func,
|
40183 | children: prop_types_default.a.node
|
40184 | }, SearchBoard_class.defaultProps = {
|
40185 | show: true,
|
40186 | showValidTags: true,
|
40187 | className: 'border-b',
|
40188 | dbKey: 'app_search_history'
|
40189 | }, SearchBoard_temp);
|
40190 |
|
40191 |
|
40192 |
|
40193 |
|
40194 | var src_SearchBoard = (SearchBoard_SearchBoard);
|
40195 |
|
40196 | var Stencil_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; };
|
40197 |
|
40198 | var Stencil_class, Stencil_temp;
|
40199 |
|
40200 | function Stencil_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
40201 |
|
40202 | function Stencil_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
40203 |
|
40204 | function Stencil_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
40205 |
|
40206 | function Stencil_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
40207 |
|
40208 |
|
40209 |
|
40210 |
|
40211 |
|
40212 | var Stencil_Stencil = (Stencil_temp = Stencil_class = function (_Component) {
|
40213 | Stencil_inherits(Stencil, _Component);
|
40214 |
|
40215 | function Stencil(props) {
|
40216 | Stencil_classCallCheck(this, Stencil);
|
40217 |
|
40218 | return Stencil_possibleConstructorReturn(this, _Component.call(this, props));
|
40219 | }
|
40220 |
|
40221 | Stencil.prototype.render = function render() {
|
40222 | var _this2 = this;
|
40223 |
|
40224 | var _props = this.props,
|
40225 | className = _props.className,
|
40226 | others = Stencil_objectWithoutProperties(_props, ['className']);
|
40227 |
|
40228 | return Object(react_dom["createPortal"])(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', Stencil_extends({ ref: function ref(el) {
|
40229 | _this2.$el = el;
|
40230 | }, className: 'stencil' + (className ? ' ' + className : '') }, others)), this.props.portal || document.getElementById('root'));
|
40231 | };
|
40232 |
|
40233 | return Stencil;
|
40234 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Stencil_class.propTypes = {
|
40235 | className: prop_types_default.a.string,
|
40236 | style: prop_types_default.a.object
|
40237 | }, Stencil_class.defaultProps = {
|
40238 | className: 'stencil-list'
|
40239 | }, Stencil_temp);
|
40240 |
|
40241 |
|
40242 |
|
40243 |
|
40244 | var src_Stencil = (Stencil_Stencil);
|
40245 |
|
40246 | var Sticker_class, Sticker_temp;
|
40247 |
|
40248 | function Sticker_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
40249 |
|
40250 | function Sticker_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
40251 |
|
40252 | function Sticker_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
40253 |
|
40254 |
|
40255 |
|
40256 |
|
40257 | var Sticker_Peg = (Sticker_temp = Sticker_class = function (_Component) {
|
40258 | Sticker_inherits(Peg, _Component);
|
40259 |
|
40260 | function Peg(props) {
|
40261 | Sticker_classCallCheck(this, Peg);
|
40262 |
|
40263 | return Sticker_possibleConstructorReturn(this, _Component.call(this, props));
|
40264 | }
|
40265 |
|
40266 | Peg.prototype.render = function render() {
|
40267 | var _this2 = this;
|
40268 |
|
40269 | var _props = this.props,
|
40270 | type = _props.type,
|
40271 | iconClassName = _props.iconClassName,
|
40272 | className = _props.className,
|
40273 | style = _props.style,
|
40274 | children = _props.children;
|
40275 |
|
40276 | var newClassName = '';
|
40277 | switch (type) {
|
40278 | case 'line':
|
40279 | newClassName = 'sticker-line';
|
40280 | break;
|
40281 | default:
|
40282 | newClassName = 'sticker';
|
40283 | }
|
40284 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
40285 | 'span',
|
40286 | { ref: function ref(el) {
|
40287 | _this2.$el = el;
|
40288 | }, className: '' + newClassName + (iconClassName ? ' sticker-icon' : '') + (className ? ' ' + className : ''), style: style },
|
40289 | iconClassName && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('span', { 'class': 'size12 ' + iconClassName }),
|
40290 | children && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
40291 | 'span',
|
40292 | null,
|
40293 | children
|
40294 | )
|
40295 | );
|
40296 | };
|
40297 |
|
40298 | return Peg;
|
40299 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Sticker_class.propTypes = {
|
40300 | type: prop_types_default.a.string,
|
40301 | iconClassName: prop_types_default.a.string,
|
40302 | className: prop_types_default.a.string,
|
40303 | style: prop_types_default.a.object,
|
40304 | children: prop_types_default.a.node
|
40305 | }, Sticker_class.defaultProps = {
|
40306 | className: 'top right'
|
40307 | }, Sticker_temp);
|
40308 |
|
40309 |
|
40310 |
|
40311 |
|
40312 | var Sticker = (Sticker_Peg);
|
40313 |
|
40314 | var Ticket_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; };
|
40315 |
|
40316 | var Ticket_class, Ticket_temp;
|
40317 |
|
40318 | function Ticket_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
40319 |
|
40320 | function Ticket_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
40321 |
|
40322 | function Ticket_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
40323 |
|
40324 | function Ticket_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
40325 |
|
40326 |
|
40327 |
|
40328 |
|
40329 | var Ticket_Ticket = (Ticket_temp = Ticket_class = function (_Component) {
|
40330 | Ticket_inherits(Ticket, _Component);
|
40331 |
|
40332 | function Ticket(props) {
|
40333 | Ticket_classCallCheck(this, Ticket);
|
40334 |
|
40335 | return Ticket_possibleConstructorReturn(this, _Component.call(this, props));
|
40336 | }
|
40337 |
|
40338 | Ticket.prototype.render = function render() {
|
40339 | var _props = this.props,
|
40340 | className = _props.className,
|
40341 | legend = _props.legend,
|
40342 | legendStyle = _props.legendStyle,
|
40343 | legendClassName = _props.legendClassName,
|
40344 | children = _props.children,
|
40345 | containerStyle = _props.containerStyle,
|
40346 | containerClassName = _props.containerClassName,
|
40347 | others = Ticket_objectWithoutProperties(_props, ['className', 'legend', 'legendStyle', 'legendClassName', 'children', 'containerStyle', 'containerClassName']);
|
40348 |
|
40349 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
40350 | 'div',
|
40351 | Ticket_extends({ className: 'ticket' + (className ? ' ' + className : '') }, others),
|
40352 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
40353 | 'div',
|
40354 | { className: 'ticket-legend' + (legendClassName ? ' ' + legendClassName : ''), style: legendStyle },
|
40355 | legend
|
40356 | ),
|
40357 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
40358 | 'div',
|
40359 | { className: 'ticket-container' + (containerClassName ? ' ' + containerClassName : ''), style: containerStyle },
|
40360 | children
|
40361 | )
|
40362 | );
|
40363 | };
|
40364 |
|
40365 | return Ticket;
|
40366 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Ticket_class.propTypes = {
|
40367 | className: prop_types_default.a.string,
|
40368 | legendStyle: prop_types_default.a.object,
|
40369 | legendClassName: prop_types_default.a.string,
|
40370 | legend: prop_types_default.a.node,
|
40371 | containerStyle: prop_types_default.a.object,
|
40372 | containerClassName: prop_types_default.a.string,
|
40373 | children: prop_types_default.a.node
|
40374 | }, Ticket_temp);
|
40375 |
|
40376 |
|
40377 |
|
40378 |
|
40379 | var src_Ticket = (Ticket_Ticket);
|
40380 |
|
40381 | var Timeline_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; };
|
40382 |
|
40383 | var Timeline_class, Timeline_temp;
|
40384 |
|
40385 | function Timeline_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
40386 |
|
40387 | function Timeline_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
40388 |
|
40389 | function Timeline_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
40390 |
|
40391 | function Timeline_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
40392 |
|
40393 |
|
40394 |
|
40395 |
|
40396 |
|
40397 | var Timeline_Timeline = (Timeline_temp = Timeline_class = function (_Component) {
|
40398 | Timeline_inherits(Timeline, _Component);
|
40399 |
|
40400 | function Timeline(props) {
|
40401 | Timeline_classCallCheck(this, Timeline);
|
40402 |
|
40403 | return Timeline_possibleConstructorReturn(this, _Component.call(this, props));
|
40404 | }
|
40405 |
|
40406 | Timeline.prototype.render = function render() {
|
40407 | var _props = this.props,
|
40408 | list = _props.list,
|
40409 | className = _props.className,
|
40410 | style = _props.style,
|
40411 | lineParams = _props.lineParams,
|
40412 | badgeParams = _props.badgeParams,
|
40413 | dotParams = _props.dotParams,
|
40414 | others = Timeline_objectWithoutProperties(_props, ['list', 'className', 'style', 'lineParams', 'badgeParams', 'dotParams']);
|
40415 |
|
40416 | if (!list) return null;
|
40417 | var listDOM = list.map(function (item, index) {
|
40418 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
40419 | 'div',
|
40420 | { key: index, className: 'timeline-case' + (item.active ? ' active' : '') },
|
40421 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
40422 | 'div',
|
40423 | Timeline_extends({}, badgeParams, { className: 'timeline-badge' + (badgeParams.className ? ' ' + badgeParams.className : '') }),
|
40424 | item.icon || external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(src_Dot, Timeline_extends({}, dotParams, { className: item.active ? 'active ' + dotParams.className : dotParams.className }))
|
40425 | ),
|
40426 | item.content,
|
40427 | item.children
|
40428 | );
|
40429 | });
|
40430 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
40431 | 'div',
|
40432 | Timeline_extends({ className: 'timeline' + (className ? ' ' + className : ''), style: style }, others),
|
40433 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('span', Timeline_extends({}, lineParams, { className: 'timeline-line' + (lineParams.className ? ' ' + lineParams.className : '') })),
|
40434 | listDOM
|
40435 | );
|
40436 | };
|
40437 |
|
40438 | return Timeline;
|
40439 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Timeline_class.propTypes = {
|
40440 | list: prop_types_default.a.array,
|
40441 | className: prop_types_default.a.string,
|
40442 | style: prop_types_default.a.object,
|
40443 |
|
40444 | lineParams: prop_types_default.a.object,
|
40445 |
|
40446 | badgeParams: prop_types_default.a.object,
|
40447 |
|
40448 | dotParams: prop_types_default.a.object
|
40449 | }, Timeline_class.defaultProps = {
|
40450 | lineParams: {},
|
40451 | badgeParams: {},
|
40452 | dotParams: {
|
40453 | className: ''
|
40454 | }
|
40455 | }, Timeline_temp);
|
40456 |
|
40457 |
|
40458 |
|
40459 |
|
40460 | var src_Timeline = (Timeline_Timeline);
|
40461 |
|
40462 |
|
40463 | var instance_Timepart = function Timepart(container, params) {
|
40464 | |
40465 |
|
40466 |
|
40467 | var defaults = {
|
40468 | rowClass: 'timepart-row',
|
40469 | progressClass: 'timepart-progress',
|
40470 | progressLegendClass: 'progress-legend',
|
40471 | dataProgressAttr: 'data',
|
40472 | partClass: 'timepart-part',
|
40473 | partStartClass: 'timepart-startTime',
|
40474 | partEndClass: 'timepart-endTime',
|
40475 |
|
40476 | colCount: 6,
|
40477 | partMinute: 30,
|
40478 | startTime: '7:00',
|
40479 | endTime: '22:00',
|
40480 |
|
40481 | colAttr: 'data-col',
|
40482 |
|
40483 | isEnableActive: true
|
40484 |
|
40485 | |
40486 |
|
40487 |
|
40488 |
|
40489 |
|
40490 |
|
40491 |
|
40492 |
|
40493 | };
|
40494 | params = params || {};
|
40495 | for (var def in defaults) {
|
40496 | if (params[def] === undefined) {
|
40497 | params[def] = defaults[def];
|
40498 | }
|
40499 | }
|
40500 | var s = this;
|
40501 |
|
40502 | s.params = params;
|
40503 |
|
40504 | s.container = typeof container === 'string' ? document.querySelector(container) : container;
|
40505 |
|
40506 | s.container.setAttribute(s.params.colAttr, s.params.colCount);
|
40507 |
|
40508 | if (!s.container) {
|
40509 | console.log('SeedsUI Error:未找到Timepart的DOM对象,请检查传入参数是否正确');
|
40510 | return;
|
40511 | }
|
40512 |
|
40513 | s.clickCount = 0;
|
40514 |
|
40515 | var partMilliSecond = s.params.partMinute * 60 * 1000;
|
40516 |
|
40517 | s.rows = [];
|
40518 | s.rowsCount = 0;
|
40519 | var rowMilliSecond = partMilliSecond * s.params.colCount;
|
40520 |
|
40521 |
|
40522 | s.parseDate = function (timeStr) {
|
40523 | var date = new Date();
|
40524 | var hour = timeStr.split(':')[0];
|
40525 | var minute = timeStr.split(':')[1];
|
40526 | date.setYear(0);
|
40527 | date.setMonth(0, 0);
|
40528 | date.setHours(hour);
|
40529 | date.setMinutes(minute);
|
40530 | date.setSeconds(0, 0);
|
40531 | return date;
|
40532 | };
|
40533 |
|
40534 |
|
40535 | s.partsCount = 0;
|
40536 | s.updateParsCount = function () {
|
40537 | var startTime = s.parseDate(s.params.startTime);
|
40538 | var endTime = s.parseDate(s.params.endTime);
|
40539 | s.partsCount = (endTime.getTime() - startTime.getTime()) / partMilliSecond;
|
40540 | if (Math.ceil(s.partsCount) !== s.partsCount) {
|
40541 |
|
40542 | s.partsCount = 0;
|
40543 | console.log('SeedsUI Error:时间区间参数partMinute不正确,不能整除');
|
40544 | return;
|
40545 | }
|
40546 | return s.partsCount;
|
40547 | };
|
40548 |
|
40549 | s.updateRowsCount = function () {
|
40550 | if (s.partsCount === 0) s.updateParsCount();
|
40551 | s.rowsCount = Math.ceil(s.partsCount / s.params.colCount);
|
40552 | return s.rowsCount;
|
40553 | };
|
40554 |
|
40555 | s.createParts = function () {
|
40556 |
|
40557 | s.updateRowsCount();
|
40558 |
|
40559 | var allStartTime = s.parseDate(s.params.startTime);
|
40560 | var allEndTime = s.parseDate(s.params.endTime);
|
40561 |
|
40562 | s.parts = [];
|
40563 |
|
40564 | s.rows = [];
|
40565 |
|
40566 | for (var i = 0; i < s.rowsCount; i++) {
|
40567 | var rowStartTime = allStartTime.getTime() + rowMilliSecond * i;
|
40568 | var rowEndTime = rowStartTime + rowMilliSecond;
|
40569 | if (rowEndTime > allEndTime.getTime()) rowEndTime = allEndTime.getTime();
|
40570 |
|
40571 | var row = document.createElement('div');
|
40572 | row.setAttribute('class', s.params.rowClass);
|
40573 | row.startTime = new Date(rowStartTime);
|
40574 | row.endTime = new Date(rowEndTime);
|
40575 |
|
40576 | s.rows.push(row);
|
40577 | s.container.appendChild(row);
|
40578 |
|
40579 |
|
40580 | for (var j = 0; j < s.params.colCount; j++) {
|
40581 | var partStartTime = rowStartTime + partMilliSecond * j;
|
40582 | var partEndTime = partStartTime + partMilliSecond;
|
40583 | if (partStartTime > allEndTime.getTime() || partEndTime > allEndTime.getTime()) return;
|
40584 |
|
40585 | var part = document.createElement('label');
|
40586 | part.setAttribute('class', s.params.partClass);
|
40587 | part.startTime = new Date(partStartTime);
|
40588 | part.endTime = new Date(partEndTime);
|
40589 |
|
40590 | var startHour = part.startTime.getHours() < 10 ? '0' + part.startTime.getHours() : part.startTime.getHours();
|
40591 | var startMinute = part.startTime.getMinutes() < 10 ? '0' + part.startTime.getMinutes() : part.startTime.getMinutes();
|
40592 | var endHour = part.endTime.getHours() < 10 ? '0' + part.endTime.getHours() : part.endTime.getHours();
|
40593 | var endMinute = part.endTime.getMinutes() < 10 ? '0' + part.endTime.getMinutes() : part.endTime.getMinutes();
|
40594 | part.innerHTML = '<span class=' + s.params.partStartClass + '>' + startHour + ':' + startMinute + '</span>' + '<span class=' + s.params.partEndClass + '>' + endHour + ':' + endMinute + '</span>';
|
40595 | s.parts.push(part);
|
40596 | row.appendChild(part);
|
40597 | }
|
40598 | }
|
40599 | };
|
40600 | s.createParts();
|
40601 |
|
40602 | |
40603 |
|
40604 |
|
40605 | s.update = function () {
|
40606 |
|
40607 | s.container.innerHTML = '';
|
40608 |
|
40609 | s.createParts();
|
40610 | };
|
40611 |
|
40612 | s.getTimes = function () {
|
40613 | var progress = s.container.querySelectorAll('.' + s.params.progressLegendClass);
|
40614 | var times = [];
|
40615 | for (var i = 0, el; el = progress[i++];) {
|
40616 |
|
40617 | times.push({
|
40618 | className: el.className.replace(' ' + s.params.progressLegendClass, '').replace(s.params.progressClass + ' ', ''),
|
40619 | startTime: el.startTime,
|
40620 | endTime: el.endTime,
|
40621 | data: el.getAttribute(s.params.dataProgressAttr) || ''
|
40622 | });
|
40623 | }
|
40624 | return times;
|
40625 | };
|
40626 |
|
40627 | s.getTimesRange = function (startTime, endTime) {
|
40628 | var allStartTime = s.parseDate(s.params.startTime);
|
40629 |
|
40630 | var startRatio = ((startTime.getTime() - allStartTime.getTime()) / rowMilliSecond).toString();
|
40631 | var endRatio = ((endTime.getTime() - allStartTime.getTime()) / rowMilliSecond).toString();
|
40632 | |
40633 |
|
40634 |
|
40635 | var startRow = Math.floor(startRatio);
|
40636 | var endRow = Math.floor(endRatio);
|
40637 | |
40638 |
|
40639 |
|
40640 | var left = Math.round(startRatio.replace(/\d+\./, '0.') * 100);
|
40641 | var right = Math.round(100 - endRatio.replace(/\d+\./, '0.') * 100);
|
40642 |
|
40643 | |
40644 |
|
40645 |
|
40646 | var startNum = Math.floor(startRatio * s.params.colCount);
|
40647 | var endNum = Math.floor(endRatio * s.params.colCount) - 1;
|
40648 | |
40649 |
|
40650 |
|
40651 |
|
40652 | if (endRatio % 1 === 0) {
|
40653 | endRow--;
|
40654 | right = 0;
|
40655 | }
|
40656 |
|
40657 | |
40658 |
|
40659 |
|
40660 |
|
40661 |
|
40662 |
|
40663 | if (startRatio % 1 === 0) {
|
40664 | left = 0;
|
40665 | }
|
40666 |
|
40667 | return {
|
40668 | startRatio: startRatio,
|
40669 | endRatio: endRatio,
|
40670 |
|
40671 | startRow: startRow,
|
40672 | endRow: endRow,
|
40673 |
|
40674 | left: left,
|
40675 | right: right,
|
40676 |
|
40677 | startNum: startNum,
|
40678 | endNum: endNum
|
40679 | };
|
40680 | };
|
40681 | s.hasProgress = function (startTime, endTime) {
|
40682 | var progress = s.container.querySelectorAll('.' + s.params.progressClass);
|
40683 | for (var i = 0, pro; pro = progress[i++];) {
|
40684 |
|
40685 |
|
40686 | if (startTime > pro.startTime && startTime < pro.endTime || endTime > pro.startTime && endTime < pro.endTime) {
|
40687 | s.target = pro;
|
40688 | if (s.params.onCross) s.params.onCross(s);
|
40689 | return true;
|
40690 | }
|
40691 |
|
40692 | if (pro.startTime > startTime && pro.startTime < endTime || pro.endTime > startTime && pro.endTime < endTime) {
|
40693 | s.target = pro;
|
40694 | if (s.params.onContain) s.params.onContain(s);
|
40695 | return true;
|
40696 | }
|
40697 | }
|
40698 | return false;
|
40699 | };
|
40700 |
|
40701 | var progressId = 0;
|
40702 |
|
40703 | s.addProgress = function (argStartTime, argEndTime, className, data, cover) {
|
40704 | var allStartTime = s.parseDate(s.params.startTime);
|
40705 | var allEndTime = s.parseDate(s.params.endTime);
|
40706 | var startTime = Object.prototype.toString.call(argStartTime) === '[object Date]' ? argStartTime : s.parseDate(argStartTime || s.params.startTime);
|
40707 | var endTime = Object.prototype.toString.call(argEndTime) === '[object Date]' ? argEndTime : s.parseDate(argEndTime || s.params.endTime);
|
40708 | startTime.setYear(0);
|
40709 | startTime.setMonth(0, 0);
|
40710 | startTime.setSeconds(0, 0);
|
40711 |
|
40712 | endTime.setYear(0);
|
40713 | endTime.setMonth(0, 0);
|
40714 | endTime.setSeconds(0, 0);
|
40715 |
|
40716 |
|
40717 | if (startTime.getTime() < allStartTime.getTime()) {
|
40718 | startTime = allStartTime;
|
40719 | } else if (startTime.getTime() > allEndTime.getTime()) {
|
40720 | startTime = allEndTime;
|
40721 | }
|
40722 | if (endTime.getTime() < allStartTime.getTime()) {
|
40723 | endTime = allStartTime;
|
40724 | } else if (endTime.getTime() > allEndTime.getTime()) {
|
40725 | endTime = allEndTime;
|
40726 | }
|
40727 |
|
40728 | if (!cover && s.hasProgress(startTime, endTime)) return false;
|
40729 |
|
40730 | var range = s.getTimesRange(startTime, endTime);
|
40731 |
|
40732 |
|
40733 | |
40734 |
|
40735 |
|
40736 |
|
40737 |
|
40738 |
|
40739 |
|
40740 | progressId++;
|
40741 | for (var j = range.startRow; j <= range.endRow; j++) {
|
40742 | var progress = document.createElement('div');
|
40743 |
|
40744 | progress.setAttribute('class', s.params.progressClass + ' ' + className);
|
40745 |
|
40746 |
|
40747 | progress.style.display = 'block';
|
40748 | progress.style.left = 0;
|
40749 | progress.style.right = 0;
|
40750 |
|
40751 |
|
40752 | if (data) progress.setAttribute(s.params.dataProgressAttr, data);
|
40753 |
|
40754 |
|
40755 | progress.setAttribute('data-id', progressId);
|
40756 |
|
40757 |
|
40758 | progress.startTime = startTime;
|
40759 | progress.endTime = endTime;
|
40760 |
|
40761 | if (j === range.startRow) {
|
40762 | progress.style.left = range.left + '%';
|
40763 | progress.classList.add(s.params.progressLegendClass);
|
40764 |
|
40765 |
|
40766 | }
|
40767 | if (j === range.endRow) {
|
40768 | progress.style.right = range.right + '%';
|
40769 | }
|
40770 |
|
40771 | s.rows[j].appendChild(progress);
|
40772 | }
|
40773 | return true;
|
40774 | };
|
40775 |
|
40776 |
|
40777 | s.removeProgress = function (className) {
|
40778 |
|
40779 | for (var i = 0, part; part = s.parts[i++];) {
|
40780 |
|
40781 | part.classList.remove(className);
|
40782 | }
|
40783 |
|
40784 | var activeProgress = s.container.querySelectorAll('.' + s.params.progressClass + '.' + className);
|
40785 | Array.prototype.slice.call(activeProgress).forEach(function (n, i) {
|
40786 | n.parentNode.removeChild(n);
|
40787 | });
|
40788 | };
|
40789 |
|
40790 | s.sortTimes = function () {
|
40791 | var args = [].slice.call(arguments);
|
40792 | return args.sort(function (x, y) {
|
40793 | if (x < y) return -1;
|
40794 | if (x > y) return 1;
|
40795 | return 0;
|
40796 | });
|
40797 | };
|
40798 |
|
40799 | s.getTimesByParts = function (part1, part2) {
|
40800 | var times = s.sortTimes(part1.startTime, part1.endTime, part2.startTime, part2.endTime);
|
40801 | return {
|
40802 | startTime: times[0],
|
40803 | endTime: times[times.length - 1]
|
40804 | };
|
40805 | };
|
40806 | |
40807 |
|
40808 |
|
40809 | s.events = function (detach) {
|
40810 | var target = s.container;
|
40811 | var action = detach ? 'removeEventListener' : 'addEventListener';
|
40812 | target[action]('click', s.onClickContainer, false);
|
40813 | };
|
40814 |
|
40815 | s.attach = function (event) {
|
40816 | s.events();
|
40817 | };
|
40818 | s.detach = function (event) {
|
40819 | s.events(true);
|
40820 | };
|
40821 | |
40822 |
|
40823 |
|
40824 | s.onClickContainer = function (e) {
|
40825 | s.target = e.target;
|
40826 |
|
40827 | if (s.params.onClick) s.params.onClick(s);
|
40828 |
|
40829 | if (e.target.classList.contains(s.params.partClass)) {
|
40830 | if (s.params.onClickPart) s.params.onClickPart(s);
|
40831 | }
|
40832 |
|
40833 | if (e.target.classList.contains(s.params.progressClass)) {
|
40834 | if (s.params.onClickProgress) s.params.onClickProgress(s);
|
40835 | }
|
40836 | };
|
40837 | |
40838 |
|
40839 |
|
40840 | s.init = function () {
|
40841 | s.attach();
|
40842 | };
|
40843 | s.init();
|
40844 | };
|
40845 |
|
40846 | var Timepart_instance = (instance_Timepart);
|
40847 |
|
40848 | var Timepart_class, Timepart_temp;
|
40849 |
|
40850 | function Timepart_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
40851 |
|
40852 | function Timepart_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
40853 |
|
40854 | function Timepart_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
40855 |
|
40856 |
|
40857 |
|
40858 |
|
40859 |
|
40860 | var Timepart_Timepart = (Timepart_temp = Timepart_class = function (_Component) {
|
40861 | Timepart_inherits(Timepart, _Component);
|
40862 |
|
40863 | function Timepart(props) {
|
40864 | Timepart_classCallCheck(this, Timepart);
|
40865 |
|
40866 | var _this = Timepart_possibleConstructorReturn(this, _Component.call(this, props));
|
40867 |
|
40868 | _this.update = function () {
|
40869 | if (!_this.props.times) return;
|
40870 | for (var i = 0, time; time = _this.props.times[i++];) {
|
40871 |
|
40872 | if (time.className && time.startTime && time.endTime) {
|
40873 | _this.instance.addProgress(time.startTime, time.endTime, time.className, time.data || null, time.cover || false);
|
40874 | }
|
40875 | }
|
40876 |
|
40877 | _this.onChange();
|
40878 | };
|
40879 |
|
40880 | _this.onChange = function () {
|
40881 | var times = _this.instance.getTimes();
|
40882 | var part = _this.instance.container.querySelector('.timepart-part.active');
|
40883 | if (part) {
|
40884 | times.push({
|
40885 | className: part.className.replace('timepart-part ', ''),
|
40886 | startTime: part.startTime,
|
40887 | endTime: part.endTime,
|
40888 | data: part.getAttribute('data') || ''
|
40889 | });
|
40890 | }
|
40891 | if (_this.props.onChange) _this.props.onChange(times);
|
40892 | };
|
40893 |
|
40894 | return _this;
|
40895 | }
|
40896 |
|
40897 | Timepart.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
|
40898 | if (this.props.times && prevProps.times.length !== this.props.times.length) {
|
40899 | this.update();
|
40900 | }
|
40901 | };
|
40902 |
|
40903 | Timepart.prototype.componentDidMount = function componentDidMount() {
|
40904 | var _this2 = this;
|
40905 |
|
40906 | var clickCount = 0;
|
40907 | var instance = new Timepart_instance(this.$el, {
|
40908 | startTime: this.props.startTime,
|
40909 | endTime: this.props.endTime,
|
40910 | onClickPart: function onClickPart(s) {
|
40911 | if (s.target.classList.contains('active')) {
|
40912 | s.target.classList.remove('active');
|
40913 | clickCount = 0;
|
40914 |
|
40915 | _this2.onChange();
|
40916 | return;
|
40917 | }
|
40918 |
|
40919 | if (!_this2.props.multiple) {
|
40920 | if (s.container.querySelectorAll('.progress-legend.active').length) {
|
40921 | s.removeProgress('active');
|
40922 | clickCount = 0;
|
40923 |
|
40924 | _this2.onChange();
|
40925 | return;
|
40926 | }
|
40927 | }
|
40928 |
|
40929 | clickCount++;
|
40930 | if (clickCount === 1) {
|
40931 |
|
40932 | _this2.part1 = s.target;
|
40933 | _this2.part1.classList.add('active');
|
40934 |
|
40935 | _this2.onChange();
|
40936 | } else if (clickCount === 2) {
|
40937 |
|
40938 | _this2.part1.classList.remove('active');
|
40939 | _this2.part2 = s.target;
|
40940 | var times = s.getTimesByParts(_this2.part1, _this2.part2);
|
40941 | s.addProgress(times.startTime, times.endTime, 'active');
|
40942 | clickCount = 0;
|
40943 |
|
40944 | _this2.onChange();
|
40945 | }
|
40946 | },
|
40947 | onContain: function onContain(e) {
|
40948 | clickCount = 0;
|
40949 | if (_this2.props.onError) _this2.props.onError({ msg: '已包含其它时间段' });
|
40950 | },
|
40951 | onCross: function onCross(e) {
|
40952 | if (_this2.props.onError) _this2.props.onError({ msg: '与其它时间段相交' });
|
40953 | },
|
40954 | onClickProgress: function onClickProgress(s) {
|
40955 | if (s.target.classList.contains('active')) {
|
40956 |
|
40957 | var id = s.target.getAttribute('data-id');
|
40958 | [].slice.call(s.container.querySelectorAll('.timepart-progress[data-id="' + id + '"]')).forEach(function (el) {
|
40959 | el.parentNode.removeChild(el);
|
40960 | });
|
40961 |
|
40962 | _this2.onChange();
|
40963 | }
|
40964 | },
|
40965 | onClickWhite: function onClickWhite(s) {}
|
40966 | });
|
40967 | this.instance = instance;
|
40968 | this.update();
|
40969 | };
|
40970 |
|
40971 | Timepart.prototype.render = function render() {
|
40972 | var _this3 = this;
|
40973 |
|
40974 | var _props = this.props,
|
40975 | className = _props.className,
|
40976 | style = _props.style;
|
40977 |
|
40978 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { ref: function ref(el) {
|
40979 | _this3.$el = el;
|
40980 | }, className: 'timepart' + (className ? ' ' + className : ''), style: style });
|
40981 | };
|
40982 |
|
40983 | return Timepart;
|
40984 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Timepart_class.propTypes = {
|
40985 | multiple: prop_types_default.a.bool,
|
40986 | className: prop_types_default.a.string,
|
40987 | style: prop_types_default.a.object,
|
40988 |
|
40989 | startTime: prop_types_default.a.string,
|
40990 | endTime: prop_types_default.a.string,
|
40991 | times: prop_types_default.a.array,
|
40992 |
|
40993 | onChange: prop_types_default.a.func,
|
40994 | onError: prop_types_default.a.func
|
40995 | }, Timepart_class.defaultProps = {
|
40996 | startTime: '07:00',
|
40997 | endTime: '22:00'
|
40998 | }, Timepart_temp);
|
40999 |
|
41000 |
|
41001 |
|
41002 |
|
41003 | var src_Timepart = (Timepart_Timepart);
|
41004 |
|
41005 | var Titlebar_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; };
|
41006 |
|
41007 | var Titlebar_class, Titlebar_temp;
|
41008 |
|
41009 | function Titlebar_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
41010 |
|
41011 | function Titlebar_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
41012 |
|
41013 | function Titlebar_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
41014 |
|
41015 | function Titlebar_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
41016 |
|
41017 |
|
41018 |
|
41019 |
|
41020 |
|
41021 |
|
41022 | var Titlebar_Titlebar = (Titlebar_temp = Titlebar_class = function (_Component) {
|
41023 | Titlebar_inherits(Titlebar, _Component);
|
41024 |
|
41025 | function Titlebar(props) {
|
41026 | Titlebar_classCallCheck(this, Titlebar);
|
41027 |
|
41028 | var _this = Titlebar_possibleConstructorReturn(this, _Component.call(this, props));
|
41029 |
|
41030 | _this.onClickBack = function () {
|
41031 | var onClickBack = _this.props.onClickBack;
|
41032 |
|
41033 |
|
41034 | if (onClickBack) {
|
41035 | onClickBack();
|
41036 | return;
|
41037 | }
|
41038 |
|
41039 | src_Bridge.back();
|
41040 | };
|
41041 |
|
41042 | _this.getButtonsDOM = function (arr) {
|
41043 | return arr.map(function (item, index) {
|
41044 | if (item === '$back') {
|
41045 | item = {
|
41046 | className: _this.props.backClassName || null,
|
41047 | style: _this.props.backStyle || null,
|
41048 | icon: _this.props.backIcon || null,
|
41049 | iconClassName: _this.props.backIconClassName || null,
|
41050 | iconStyle: _this.props.backIconStyle || {},
|
41051 | caption: _this.props.backCaption || null,
|
41052 | onClick: _this.onClickBack
|
41053 | };
|
41054 | }
|
41055 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
41056 | 'a',
|
41057 | { key: index, disabled: item.disabled, onClick: function onClick(e) {
|
41058 | if (item.onClick) item.onClick(Object.getArgs(e, item.args));
|
41059 | }, className: 'titlebar-button button' + (item.className ? ' ' + item.className : ' bar'), style: item.style },
|
41060 | (item.iconSrc || item.iconClassName) && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('span', { className: 'icon' + (item.iconClassName ? ' ' + item.iconClassName : ''), style: Object.assign(item.iconSrc ? { backgroundImage: 'url(' + item.iconSrc + ')' } : {}, item.iconStyle) }),
|
41061 | item.icon && item.icon,
|
41062 | item.caption && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
41063 | 'span',
|
41064 | null,
|
41065 | item.caption
|
41066 | )
|
41067 | );
|
41068 | });
|
41069 | };
|
41070 |
|
41071 | _this.state = {};
|
41072 | return _this;
|
41073 | }
|
41074 |
|
41075 | Titlebar.prototype.render = function render() {
|
41076 | var _props = this.props,
|
41077 | className = _props.className,
|
41078 | showUrlTitle = _props.showUrlTitle,
|
41079 | caption = _props.caption,
|
41080 | captionClassName = _props.captionClassName,
|
41081 | captionStyle = _props.captionStyle,
|
41082 | children = _props.children,
|
41083 | onClickCaption = _props.onClickCaption,
|
41084 | lButtons = _props.lButtons,
|
41085 | rButtons = _props.rButtons,
|
41086 | backIconClassName = _props.backIconClassName,
|
41087 | backIconStyle = _props.backIconStyle,
|
41088 | backClassName = _props.backClassName,
|
41089 | backStyle = _props.backStyle,
|
41090 | backCaption = _props.backCaption,
|
41091 | onClickBack = _props.onClickBack,
|
41092 | others = Titlebar_objectWithoutProperties(_props, ['className', 'showUrlTitle', 'caption', 'captionClassName', 'captionStyle', 'children', 'onClickCaption', 'lButtons', 'rButtons', 'backIconClassName', 'backIconStyle', 'backClassName', 'backStyle', 'backCaption', 'onClickBack']);
|
41093 |
|
41094 | var lButtonsDOM = null;
|
41095 | if (Array.isArray(lButtons)) {
|
41096 | lButtonsDOM = this.getButtonsDOM(lButtons);
|
41097 | }
|
41098 | var rButtonsDOM = null;
|
41099 | if (Array.isArray(rButtons)) {
|
41100 | rButtonsDOM = this.getButtonsDOM(rButtons);
|
41101 | }
|
41102 |
|
41103 | var title = src_Device.getUrlParameter('titlebar', location.search);
|
41104 | if (showUrlTitle && title) {
|
41105 | caption = external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
41106 | 'h1',
|
41107 | { className: 'titlebar-caption nowrap text-center' + (captionClassName ? ' ' + captionClassName : ''), style: captionStyle, onClick: onClickCaption },
|
41108 | decodeURIComponent(decodeURIComponent(title))
|
41109 | );
|
41110 | } else if (typeof caption === 'string') {
|
41111 | caption = external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
41112 | 'h1',
|
41113 | { className: 'titlebar-caption nowrap text-center' + (captionClassName ? ' ' + captionClassName : ''), style: captionStyle, onClick: onClickCaption },
|
41114 | caption
|
41115 | );
|
41116 | }
|
41117 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
41118 | 'div',
|
41119 | Titlebar_extends({ className: 'titlebar' + (className ? ' ' + className : '') }, others),
|
41120 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
41121 | 'div',
|
41122 | { className: 'titlebar-left' },
|
41123 | lButtonsDOM
|
41124 | ),
|
41125 | caption,
|
41126 | children,
|
41127 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
41128 | 'div',
|
41129 | { className: 'titlebar-right' },
|
41130 | rButtonsDOM
|
41131 | )
|
41132 | );
|
41133 | };
|
41134 |
|
41135 | return Titlebar;
|
41136 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Titlebar_class.propTypes = {
|
41137 | className: prop_types_default.a.string,
|
41138 |
|
41139 | showUrlTitle: prop_types_default.a.bool,
|
41140 | caption: prop_types_default.a.node,
|
41141 |
|
41142 | captionClassName: prop_types_default.a.string,
|
41143 | captionStyle: prop_types_default.a.object,
|
41144 | onClickCaption: prop_types_default.a.func,
|
41145 |
|
41146 | lButtons: prop_types_default.a.array,
|
41147 | rButtons: prop_types_default.a.array,
|
41148 | backClassName: prop_types_default.a.string,
|
41149 | backStyle: prop_types_default.a.object,
|
41150 | backIcon: prop_types_default.a.node,
|
41151 | backIconClassName: prop_types_default.a.string,
|
41152 | backIconStyle: prop_types_default.a.object,
|
41153 | backCaption: prop_types_default.a.string,
|
41154 | onClickBack: prop_types_default.a.func,
|
41155 | children: prop_types_default.a.node
|
41156 | }, Titlebar_class.defaultProps = {
|
41157 | showUrlTitle: true,
|
41158 | lButtons: ['$back'],
|
41159 | className: 'border-b',
|
41160 | backIconClassName: 'shape-arrow-left'
|
41161 | }, Titlebar_temp);
|
41162 |
|
41163 |
|
41164 |
|
41165 |
|
41166 | var src_Titlebar = (Titlebar_Titlebar);
|
41167 |
|
41168 | var Toast_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; };
|
41169 |
|
41170 | var Toast_class, Toast_temp;
|
41171 |
|
41172 | function Toast_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
41173 |
|
41174 | function Toast_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
41175 |
|
41176 | function Toast_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
41177 |
|
41178 | function Toast_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
41179 |
|
41180 |
|
41181 |
|
41182 |
|
41183 |
|
41184 | var Toast_Toast = (Toast_temp = Toast_class = function (_Component) {
|
41185 | Toast_inherits(Toast, _Component);
|
41186 |
|
41187 | function Toast(props) {
|
41188 | Toast_classCallCheck(this, Toast);
|
41189 |
|
41190 | var _this = Toast_possibleConstructorReturn(this, _Component.call(this, props));
|
41191 |
|
41192 | _this.componentDidMount = function () {};
|
41193 |
|
41194 | return _this;
|
41195 | }
|
41196 |
|
41197 | Toast.prototype.render = function render() {
|
41198 | var _this2 = this;
|
41199 |
|
41200 | var _props = this.props,
|
41201 | portal = _props.portal,
|
41202 | show = _props.show,
|
41203 | duration = _props.duration,
|
41204 | maskClassName = _props.maskClassName,
|
41205 | maskStyle = _props.maskStyle,
|
41206 | className = _props.className,
|
41207 | style = _props.style,
|
41208 | icon = _props.icon,
|
41209 | caption = _props.caption,
|
41210 | captionStyle = _props.captionStyle,
|
41211 | captionClassName = _props.captionClassName,
|
41212 | others = Toast_objectWithoutProperties(_props, ['portal', 'show', 'duration', 'maskClassName', 'maskStyle', 'className', 'style', 'icon', 'caption', 'captionStyle', 'captionClassName']);
|
41213 |
|
41214 | return Object(react_dom["createPortal"])(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
41215 | 'div',
|
41216 | Toast_extends({ ref: function ref(el) {
|
41217 | _this2.$el = el;
|
41218 | }, className: 'mask toast-mask' + (maskClassName ? ' ' + maskClassName : '') + (show ? ' active' : ''), style: Object.assign(duration !== undefined ? { WebkitTransitionDuration: duration + 'ms' } : {}, maskStyle) }, others),
|
41219 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
41220 | 'div',
|
41221 | { className: 'toast' + (className ? ' ' + className : '') + (show ? ' active' : ''), style: Object.assign(duration !== undefined ? { WebkitTransitionDuration: duration + 'ms' } : {}, style) },
|
41222 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
41223 | 'div',
|
41224 | { className: 'toast-wrapper' },
|
41225 | icon,
|
41226 | caption && external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
41227 | 'span',
|
41228 | { className: 'toast-caption' + (captionClassName ? ' ' + captionClassName : ''), style: captionStyle },
|
41229 | caption
|
41230 | )
|
41231 | )
|
41232 | )
|
41233 | ), this.props.portal || document.getElementById('root'));
|
41234 | };
|
41235 |
|
41236 | return Toast;
|
41237 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Toast_class.propTypes = {
|
41238 | portal: prop_types_default.a.object,
|
41239 |
|
41240 | show: prop_types_default.a.bool,
|
41241 |
|
41242 | duration: prop_types_default.a.number,
|
41243 |
|
41244 | maskClassName: prop_types_default.a.string,
|
41245 | maskStyle: prop_types_default.a.object,
|
41246 |
|
41247 | className: prop_types_default.a.string,
|
41248 | style: prop_types_default.a.object,
|
41249 |
|
41250 | caption: prop_types_default.a.node,
|
41251 | captionStyle: prop_types_default.a.object,
|
41252 | captionClassName: prop_types_default.a.string,
|
41253 |
|
41254 | icon: prop_types_default.a.node
|
41255 | }, Toast_class.defaultProps = {}, Toast_temp);
|
41256 |
|
41257 |
|
41258 |
|
41259 |
|
41260 | var src_Toast = (Toast_Toast);
|
41261 |
|
41262 |
|
41263 | var instance_Tree = function Tree(container, params) {
|
41264 | function getElementByParent(parent, selector) {
|
41265 | return typeof selector === 'string' && selector !== '' ? parent.querySelector(selector) : selector;
|
41266 | }
|
41267 | |
41268 |
|
41269 |
|
41270 | var defaults = {
|
41271 |
|
41272 | data: null,
|
41273 |
|
41274 | multiple: true,
|
41275 | checkbox: false,
|
41276 | bar: null,
|
41277 | barOptionClass: 'tree-bar-button',
|
41278 | barButtonDelClass: 'tree-bar-button-del',
|
41279 |
|
41280 | extendClass: 'extend',
|
41281 | activeClass: 'active',
|
41282 |
|
41283 | treeClass: 'tree',
|
41284 | lineClass: 'tree-line',
|
41285 | titleClass: 'tree-title',
|
41286 | arrowClass: 'tree-icon-arrow',
|
41287 | iconClass: 'tree-icon',
|
41288 |
|
41289 | buttonAddHTML: '',
|
41290 | buttonAddClass: 'tree-button-add',
|
41291 | buttonAddSrc: '',
|
41292 | buttonDelHTML: '',
|
41293 | buttonDelClass: 'tree-button-del',
|
41294 | buttonDelSrc: '',
|
41295 |
|
41296 | idAttr: 'data-id',
|
41297 | parentidAttr: 'data-parentid',
|
41298 | nameAttr: 'data-name'
|
41299 |
|
41300 | |
41301 |
|
41302 |
|
41303 |
|
41304 |
|
41305 |
|
41306 |
|
41307 |
|
41308 | };
|
41309 | params = params || {};
|
41310 | for (var def in defaults) {
|
41311 | if (params[def] === undefined) {
|
41312 | params[def] = defaults[def];
|
41313 | }
|
41314 | }
|
41315 |
|
41316 | var s = this;
|
41317 |
|
41318 |
|
41319 | s.params = params;
|
41320 |
|
41321 |
|
41322 | s.container = getElementByParent(document, container);
|
41323 | if (!s.container) {
|
41324 | console.log('SeedsUI Error:未找到Tree的DOM对象,请检查传入参数是否正确');
|
41325 | return;
|
41326 | }
|
41327 |
|
41328 |
|
41329 | s.updateBar = function () {
|
41330 | if (s.params.bar) {
|
41331 | s.bar = getElementByParent(document, s.params.bar);
|
41332 | if (!s.bar) {
|
41333 | console.log('SeedsUI Error:未找到Bar的DOM对象,请检查传入参数是否正确');
|
41334 | return;
|
41335 | }
|
41336 | }
|
41337 | };
|
41338 | s.updateBar();
|
41339 | s.setBar = function (bar) {
|
41340 | s.params.bar = bar;
|
41341 | };
|
41342 |
|
41343 |
|
41344 | s.selected = {};
|
41345 | var _data = s.params.data;
|
41346 | s.buildOption = function (option) {
|
41347 |
|
41348 | var copyOption = Object.create(option);
|
41349 |
|
41350 | var lineDataHTML = '';
|
41351 | for (var n in option) {
|
41352 | lineDataHTML += 'data-' + n + '="' + option[n] + '" ';
|
41353 | }
|
41354 |
|
41355 |
|
41356 | copyOption.html = '<div class="' + s.params.iconClass + '">' + '<i class="' + s.params.arrowClass + '"></i>' + '</div>' + '<div class="' + s.params.titleClass + '">' + option.name + '</div>';
|
41357 |
|
41358 | if (s.params.onData) s.params.onData(copyOption);
|
41359 |
|
41360 | var li = document.createElement('li');
|
41361 |
|
41362 |
|
41363 | var btnHTML = '';
|
41364 | var addBtnHTML = '';
|
41365 | var delBtnHTML = '';
|
41366 | if (s.params.checkbox) {
|
41367 |
|
41368 |
|
41369 | if (s.params.buttonAddHTML) {
|
41370 | addBtnHTML = s.params.buttonAddHTML;
|
41371 | } else if (s.params.buttonAddSrc) {
|
41372 | addBtnHTML = '<span class="' + s.params.buttonAddClass + '" style="background-image:url(' + s.params.buttonAddSrc + ')"></span>';
|
41373 | } else {
|
41374 | addBtnHTML = '<span class="' + s.params.buttonAddClass + '"></span>';
|
41375 | }
|
41376 |
|
41377 | if (s.params.buttonDelHTML) {
|
41378 | delBtnHTML = s.params.buttonDelHTML;
|
41379 | } else if (s.params.buttonDelSrc) {
|
41380 | delBtnHTML = '<span class="' + s.params.buttonDelClass + '" style="background-image:url(' + s.params.buttonDelSrc + ')"></span>';
|
41381 | } else {
|
41382 | delBtnHTML = '<span class="' + s.params.buttonDelClass + '"></span>';
|
41383 | }
|
41384 |
|
41385 | if (addBtnHTML && !addBtnHTML.hasClass(s.params.buttonAddClass)) addBtnHTML.addClass(s.params.buttonAddClass);
|
41386 | if (delBtnHTML && !delBtnHTML.hasClass(s.params.buttonDelClass)) delBtnHTML.addClass(s.params.buttonDelClass);
|
41387 |
|
41388 | btnHTML = addBtnHTML + delBtnHTML;
|
41389 |
|
41390 | }
|
41391 |
|
41392 |
|
41393 | if (s.isSelected(option.id, option.parentid) === 2) {
|
41394 | s.removeSelected(option.id);
|
41395 | }
|
41396 |
|
41397 |
|
41398 | var html = '<div class="' + s.params.lineClass + '" ' + lineDataHTML + '>' + copyOption.html + btnHTML + '</div>';
|
41399 | if (s.selected[option.id]) {
|
41400 | html = '<div class="' + s.params.lineClass + ' ' + s.params.activeClass + '" ' + lineDataHTML + '>' + copyOption.html + btnHTML + '</div>';
|
41401 | }
|
41402 | li.innerHTML = html;
|
41403 |
|
41404 | return li;
|
41405 | };
|
41406 | s.initData = function (id, ulContainer) {
|
41407 |
|
41408 | var children = _data.getFlattenTreeChildren(id);
|
41409 | if (children && children.length) {
|
41410 |
|
41411 | for (var i = 0, option; option = children[i++];) {
|
41412 |
|
41413 | var li = s.buildOption(option);
|
41414 |
|
41415 | var ul = document.createElement('ul');
|
41416 | li.appendChild(ul);
|
41417 |
|
41418 | ulContainer.appendChild(li);
|
41419 | s.initData(option.id, ul);
|
41420 | }
|
41421 | }
|
41422 | };
|
41423 | s.update = function () {
|
41424 | s.container.innerHTML = '';
|
41425 | if (!s.params.data || !s.params.data.length) {
|
41426 | console.log('SeedsUI Warn:未找到Tree的Data数据,可在初始化时传入data参数,或者通过setData方法设置数据');
|
41427 | return;
|
41428 | }
|
41429 | if (!s.params.data[0].id || !s.params.data[0].parentid || !s.params.data[0].name) {
|
41430 | console.log('SeedsUI Error:Tree的Data数据格式不正确,请检查data参数是否有id、name、parentid属性');
|
41431 | return;
|
41432 | }
|
41433 | s.updateBar();
|
41434 | s.initData(-1, s.container);
|
41435 |
|
41436 |
|
41437 |
|
41438 |
|
41439 |
|
41440 | };
|
41441 |
|
41442 | |
41443 |
|
41444 |
|
41445 | s.setData = function (data) {
|
41446 | _data = s.params.data = data;
|
41447 | };
|
41448 |
|
41449 | s.addData = function (data, id, childNode) {
|
41450 | _data = data;
|
41451 | s.initData(id, childNode);
|
41452 | };
|
41453 |
|
41454 | s.getDataByTarget = function (target) {
|
41455 | var opts = {};
|
41456 | for (var i = 0, att; att = target.attributes[i++];) {
|
41457 |
|
41458 | if (att.nodeName.indexOf('data-') !== -1) {
|
41459 | opts[att.nodeName.substring(5)] = att.nodeValue;
|
41460 | }
|
41461 | }
|
41462 | return opts;
|
41463 | };
|
41464 |
|
41465 | s.getParentOptions = function (parentid) {
|
41466 | var parentOptions = [];
|
41467 | var currentId = parentid;
|
41468 | while (currentId !== '-1') {
|
41469 |
|
41470 | for (var i = 0, opt; opt = s.params.data[i++];) {
|
41471 |
|
41472 | if (opt.id === currentId) {
|
41473 | parentOptions.push(opt);
|
41474 | currentId = opt.parentid;
|
41475 | break;
|
41476 | }
|
41477 | }
|
41478 | }
|
41479 | return parentOptions;
|
41480 | };
|
41481 |
|
41482 | s.isSelected = function (id, parentid) {
|
41483 | var currentFlag = false;
|
41484 | var parentFlag = false;
|
41485 |
|
41486 | if (s.selected[id]) {
|
41487 | currentFlag = true;
|
41488 | }
|
41489 | if (s.selected[parentid]) {
|
41490 | parentFlag = true;
|
41491 | }
|
41492 |
|
41493 |
|
41494 | var hasNode = false;
|
41495 | if (!s.params.data || !s.params.data.length) return 0;
|
41496 | for (var i = 0, opt; opt = s.params.data[i++];) {
|
41497 |
|
41498 | if (opt.id === id && opt.parentid === parentid) {
|
41499 | hasNode = true;
|
41500 | break;
|
41501 | }
|
41502 | }
|
41503 | if (!hasNode) return 0;
|
41504 |
|
41505 |
|
41506 | var parentNodes = s.getParentOptions(parentid);
|
41507 | for (var i = 0, opt; opt = parentNodes[i++];) {
|
41508 |
|
41509 | if (s.selected[opt.id]) {
|
41510 | parentFlag = true;
|
41511 | break;
|
41512 | }
|
41513 | }
|
41514 |
|
41515 | if (currentFlag && parentFlag) return 2;
|
41516 | if (currentFlag) return 1;
|
41517 | if (parentFlag) return -1;
|
41518 | return 0;
|
41519 | };
|
41520 |
|
41521 |
|
41522 | s.isEmptyJson = function (json) {
|
41523 | var temp = '';
|
41524 | for (var j in json) {
|
41525 | temp += j;
|
41526 | }
|
41527 | if (temp === '') return true;
|
41528 | return false;
|
41529 | };
|
41530 |
|
41531 | s.createBarOption = function (id, name, parentid) {
|
41532 | var div = document.createElement('span');
|
41533 | div.setAttribute('class', s.params.barOptionClass);
|
41534 | div.setAttribute(s.params.idAttr, id);
|
41535 | if (parentid) div.setAttribute(s.params.parentidAttr, parentid);
|
41536 | div.setAttribute(s.params.nameAttr, name);
|
41537 |
|
41538 | var label = document.createElement('label');
|
41539 | label.innerHTML = name;
|
41540 |
|
41541 | var del = document.createElement('a');
|
41542 | del.classList.add(s.params.barButtonDelClass);
|
41543 |
|
41544 | div.appendChild(label);
|
41545 | div.appendChild(del);
|
41546 | return div;
|
41547 | };
|
41548 |
|
41549 | s.removeSelected = function (id) {
|
41550 | if (s.selected[id]) {
|
41551 |
|
41552 | delete s.selected[id];
|
41553 |
|
41554 | if (s.bar) s.bar.removeChild(s.bar.querySelector('[' + s.params.idAttr + '="' + id + '"]'));
|
41555 |
|
41556 | var node = s.container.querySelector('[' + s.params.idAttr + '="' + id + '"]');
|
41557 | if (node) node.classList.remove(s.params.activeClass);
|
41558 | }
|
41559 | };
|
41560 | s.removeAllSelected = function () {
|
41561 | for (var id in s.selected) {
|
41562 | s.removeSelected(id);
|
41563 | }
|
41564 | if (s.bar) s.hideBar();
|
41565 | };
|
41566 | s.collapseAll = function () {
|
41567 | var elements = s.container.querySelectorAll('.' + s.params.extendClass);
|
41568 | for (var i = 0, el; el = elements[i++];) {
|
41569 |
|
41570 | el.classList.remove(s.params.extendClass);
|
41571 | }
|
41572 | };
|
41573 | s.extendAll = function () {
|
41574 | var elements = s.container.querySelectorAll('.' + s.params.lineClass);
|
41575 | for (var i = 0, el; el = elements[i++];) {
|
41576 |
|
41577 | el.classList.add(s.params.extendClass);
|
41578 | }
|
41579 | };
|
41580 | s.addSelected = function (opts) {
|
41581 | if (!opts.id || !opts.name || !opts.parentid) {
|
41582 | console.log('SeedsUI Error:id、name、parentid三个参数不正确');
|
41583 | return;
|
41584 | }
|
41585 | if (s.selected[opts.id]) {
|
41586 | console.log('SeedsUI Info:您要选中的节点已经选中');
|
41587 | return;
|
41588 | }
|
41589 |
|
41590 | if (s.isSelected(opts.id, opts.parentid)) {
|
41591 | console.log('SeedsUI Info:您要选中的节点已经选中');
|
41592 | return;
|
41593 | }
|
41594 |
|
41595 |
|
41596 | if (!s.params.multiple) s.removeAllSelected();
|
41597 |
|
41598 |
|
41599 | if (s.bar) {
|
41600 | var barOption = s.createBarOption(opts.id, opts.name, opts.parentid);
|
41601 | s.bar.appendChild(barOption);
|
41602 | s.showBar();
|
41603 | }
|
41604 |
|
41605 |
|
41606 | var treeOption = s.container.querySelector('[' + s.params.idAttr + '="' + opts.id + '"]');
|
41607 | if (treeOption) treeOption.classList.add(s.params.activeClass);
|
41608 |
|
41609 |
|
41610 | s.selected[opts.id] = opts;
|
41611 | };
|
41612 |
|
41613 | s.showBar = function () {
|
41614 | s.bar.classList.add(s.params.activeClass);
|
41615 | };
|
41616 |
|
41617 | s.hideBar = function () {
|
41618 | s.bar.classList.remove(s.params.activeClass);
|
41619 | };
|
41620 |
|
41621 | s.reset = function () {
|
41622 | s.removeAllSelected();
|
41623 | s.collapseAll();
|
41624 | };
|
41625 | |
41626 |
|
41627 |
|
41628 |
|
41629 | s.isSupportTouch = 'ontouchstart' in window;
|
41630 | s.events = function (detach) {
|
41631 | var action = detach ? 'removeEventListener' : 'addEventListener';
|
41632 |
|
41633 | if (s.isSupportTouch) {
|
41634 | s.container[action]('touchstart', s.onTouchStart, false);
|
41635 | s.container[action]('touchend', s.onTouchEnd, false);
|
41636 | } else {
|
41637 | s.container[action]('click', s.onClickTree, false);
|
41638 | }
|
41639 |
|
41640 |
|
41641 | if (s.bar) {
|
41642 | s.bar[action]('click', s.onClickBar, false);
|
41643 | }
|
41644 | };
|
41645 |
|
41646 | s.attach = function (event) {
|
41647 | s.events();
|
41648 | };
|
41649 | s.detach = function (event) {
|
41650 | s.events(true);
|
41651 | };
|
41652 | |
41653 |
|
41654 |
|
41655 |
|
41656 | s.touches = {
|
41657 | startX: 0,
|
41658 | startY: 0,
|
41659 | endX: 0,
|
41660 | endY: 0,
|
41661 | diffX: 0,
|
41662 | diffY: 0
|
41663 | };
|
41664 | s.onTouchStart = function (e) {
|
41665 | s.touches.startX = e.touches[0].clientX;
|
41666 | s.touches.startY = e.touches[0].clientY;
|
41667 | };
|
41668 | s.onTouchEnd = function (e) {
|
41669 | s.touches.endX = e.changedTouches[0].clientX;
|
41670 | s.touches.endY = e.changedTouches[0].clientY;
|
41671 | s.touches.diffX = s.touches.startX - s.touches.endX;
|
41672 | s.touches.diffY = s.touches.startY - s.touches.endY;
|
41673 |
|
41674 | if (Math.abs(s.touches.diffX) < 6 && Math.abs(s.touches.diffY) < 6) {
|
41675 | s.onClickTree(e);
|
41676 | }
|
41677 | };
|
41678 |
|
41679 | s.onClickTree = function (e) {
|
41680 |
|
41681 | s.targetLi = null;
|
41682 | s.targetLine = null;
|
41683 | s.target = e.target;
|
41684 |
|
41685 | if (s.target.classList.contains(s.params.lineClass)) {
|
41686 |
|
41687 | s.targetLine = s.target;
|
41688 | s.targetLi = s.target.parentNode;
|
41689 | } else if (s.target.classList.contains(s.params.iconClass) || s.target.classList.contains(s.params.titleClass)) {
|
41690 |
|
41691 | s.targetLine = s.target.parentNode;
|
41692 | s.targetLi = s.target.parentNode.parentNode;
|
41693 | }
|
41694 | if (s.target.classList.contains(s.params.buttonAddClass)) {
|
41695 |
|
41696 | s.onClickBtnAdd(e);
|
41697 | } else if (s.target.classList.contains(s.params.buttonDelClass)) {
|
41698 |
|
41699 | s.onClickBtnDel(e);
|
41700 | } else if (s.targetLine) {
|
41701 |
|
41702 |
|
41703 | s.targetLine.classList.toggle(s.params.extendClass);
|
41704 | var lines = s.targetLine.nextElementSibling.querySelectorAll('li > .' + s.params.lineClass);
|
41705 |
|
41706 | for (var i = 0, line; line = lines[i++];) {
|
41707 | if (s.selected[line.getAttribute(s.params.idAttr)]) {
|
41708 | line.classList.add(s.params.activeClass);
|
41709 | }
|
41710 | }
|
41711 |
|
41712 |
|
41713 |
|
41714 | if ((!s.targetLine.nextElementSibling || !s.targetLine.nextElementSibling.hasChildNodes()) && s.params.onClickLastChild) s.params.onClickLastChild(s);
|
41715 |
|
41716 | if (s.params.onClick) s.params.onClick(s);
|
41717 | } else {
|
41718 |
|
41719 | if (s.params.onClick) s.params.onClick(s);
|
41720 | }
|
41721 | e.stopPropagation();
|
41722 | };
|
41723 |
|
41724 | s.onClickBtnAdd = function (e) {
|
41725 | var elLine = e.target.parentNode;
|
41726 |
|
41727 | var elLines = elLine.parentNode.querySelectorAll('.' + s.params.lineClass);
|
41728 |
|
41729 | for (var i = 0, el; el = elLines[i++];) {
|
41730 | var elId = el.getAttribute(s.params.idAttr);
|
41731 | s.removeSelected(elId);
|
41732 | }
|
41733 |
|
41734 |
|
41735 | elLine.classList.add(s.params.activeClass);
|
41736 | |
41737 |
|
41738 |
|
41739 |
|
41740 |
|
41741 | var opts = s.getDataByTarget(elLine);
|
41742 |
|
41743 | s.addSelected(opts);
|
41744 |
|
41745 | if (s.params.onClickAdd) s.params.onClickAdd(opts, s);
|
41746 | };
|
41747 |
|
41748 | s.onClickBar = function (e) {
|
41749 | if (e.target.classList.contains(s.params.barButtonDelClass)) {
|
41750 | s.onClickBtnDel(e);
|
41751 | }
|
41752 | };
|
41753 |
|
41754 | s.onClickBtnDel = function (e) {
|
41755 | s.option = e.target.parentNode;
|
41756 | s.target = e.target;
|
41757 |
|
41758 | var id = s.option.getAttribute(s.params.idAttr);
|
41759 | var opts = s.selected[id];
|
41760 | s.removeSelected(id);
|
41761 |
|
41762 | if (s.isEmptyJson(s.selected)) {
|
41763 | if (s.bar) s.hideBar();
|
41764 | }
|
41765 |
|
41766 | if (s.params.onClickDel) s.params.onClickDel(opts, s);
|
41767 | };
|
41768 |
|
41769 |
|
41770 | s.init = function () {
|
41771 | s.attach();
|
41772 | };
|
41773 | s.init();
|
41774 | };
|
41775 |
|
41776 | var Tree_instance = (instance_Tree);
|
41777 |
|
41778 | var Tree_class, Tree_temp;
|
41779 |
|
41780 | function Tree_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
41781 |
|
41782 | function Tree_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
41783 |
|
41784 | function Tree_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
41785 |
|
41786 |
|
41787 |
|
41788 |
|
41789 |
|
41790 |
|
41791 | var Tree_Tree = (Tree_temp = Tree_class = function (_Component) {
|
41792 | Tree_inherits(Tree, _Component);
|
41793 |
|
41794 | function Tree(props) {
|
41795 | Tree_classCallCheck(this, Tree);
|
41796 |
|
41797 | var _this = Tree_possibleConstructorReturn(this, _Component.call(this, props));
|
41798 |
|
41799 | _this.componentDidUpdate = function (prevProps) {
|
41800 | if (JSON.stringify(prevProps.list) !== JSON.stringify(_this.props.list)) {
|
41801 | if (_this.props.list && _this.props.list.length) {
|
41802 | var selected = _this.props.selected;
|
41803 |
|
41804 | var list = Object.clone(_this.props.list);
|
41805 | if (JSON.stringify(list).indexOf('"children"') !== -1) {
|
41806 | list = list.flattenTree();
|
41807 | }
|
41808 |
|
41809 | if (Array.isArray(selected) && selected.length) {
|
41810 | for (var _iterator = selected, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
|
41811 | var _ref;
|
41812 |
|
41813 | if (_isArray) {
|
41814 | if (_i >= _iterator.length) break;
|
41815 | _ref = _iterator[_i++];
|
41816 | } else {
|
41817 | _i = _iterator.next();
|
41818 | if (_i.done) break;
|
41819 | _ref = _i.value;
|
41820 | }
|
41821 |
|
41822 | var opt = _ref;
|
41823 |
|
41824 | _this.instance.addSelected(opt);
|
41825 | }
|
41826 | }
|
41827 |
|
41828 | _this.instance.setData(list);
|
41829 | _this.instance.update();
|
41830 | } else {
|
41831 | _this.instance.setData([]);
|
41832 | _this.instance.update();
|
41833 | }
|
41834 | }
|
41835 | };
|
41836 |
|
41837 | _this.componentDidMount = function () {
|
41838 | if (_this.instance) return;
|
41839 | var _this$props = _this.props,
|
41840 | multiple = _this$props.multiple,
|
41841 | checkbox = _this$props.checkbox,
|
41842 | bar = _this$props.bar,
|
41843 | buttonAddHTML = _this$props.buttonAddHTML,
|
41844 | buttonAddClassName = _this$props.buttonAddClassName,
|
41845 | buttonAddSrc = _this$props.buttonAddSrc,
|
41846 | onClickAdd = _this$props.onClickAdd,
|
41847 | buttonDelHTML = _this$props.buttonDelHTML,
|
41848 | buttonDelClassName = _this$props.buttonDelClassName,
|
41849 | buttonDelSrc = _this$props.buttonDelSrc,
|
41850 | onClickDel = _this$props.onClickDel,
|
41851 | onClickLastChild = _this$props.onClickLastChild,
|
41852 | onData = _this$props.onData;
|
41853 |
|
41854 |
|
41855 | var list = Object.clone(_this.props.list);
|
41856 | if (JSON.stringify(list).indexOf('"children"') !== -1) {
|
41857 | list = list.flattenTree();
|
41858 | }
|
41859 | var instance = new Tree_instance(_this.$tree, {
|
41860 | data: list,
|
41861 | multiple: multiple,
|
41862 | checkbox: checkbox,
|
41863 | bar: bar,
|
41864 | buttonAddHTML: buttonAddHTML,
|
41865 | buttonAddClassName: buttonAddClassName,
|
41866 | buttonAddSrc: buttonAddSrc,
|
41867 | onClickAdd: onClickAdd,
|
41868 | buttonDelHTML: buttonDelHTML,
|
41869 | buttonDelClassName: buttonDelClassName,
|
41870 | buttonDelSrc: buttonDelSrc,
|
41871 | onClickDel: onClickDel,
|
41872 | onClickLastChild: onClickLastChild,
|
41873 | onClick: _this.onClick,
|
41874 | onData: onData
|
41875 | });
|
41876 | _this.instance = instance;
|
41877 |
|
41878 | var selected = _this.props.selected;
|
41879 |
|
41880 | if (Array.isArray(selected) && selected.length) {
|
41881 | for (var _iterator2 = selected, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
|
41882 | var _ref2;
|
41883 |
|
41884 | if (_isArray2) {
|
41885 | if (_i2 >= _iterator2.length) break;
|
41886 | _ref2 = _iterator2[_i2++];
|
41887 | } else {
|
41888 | _i2 = _iterator2.next();
|
41889 | if (_i2.done) break;
|
41890 | _ref2 = _i2.value;
|
41891 | }
|
41892 |
|
41893 | var opt = _ref2;
|
41894 |
|
41895 | _this.instance.addSelected(opt);
|
41896 | }
|
41897 | }
|
41898 | _this.instance.update();
|
41899 | };
|
41900 |
|
41901 | _this.onClick = function (s) {
|
41902 | var selected = _this.props.selected;
|
41903 |
|
41904 | var list = Object.clone(_this.props.list);
|
41905 | if (JSON.stringify(list).indexOf('"children"') !== -1) {
|
41906 | list = list.flattenTree();
|
41907 | }
|
41908 |
|
41909 | var id = s.targetLine.getAttribute('data-id');
|
41910 | var item = list.getFlattenTreeNode(id);
|
41911 |
|
41912 | var isActived = selected ? selected.filter(function (option) {
|
41913 | if (option.id === id) return true;
|
41914 | return false;
|
41915 | }) : null;
|
41916 | if (isActived && isActived.length > 0) {
|
41917 | isActived = true;
|
41918 | } else {
|
41919 | isActived = false;
|
41920 | }
|
41921 |
|
41922 | var childrenCount = 0;
|
41923 | var ul = s.targetLine.nextElementSibling;
|
41924 | if (ul && ul.tagName === 'UL') {
|
41925 | childrenCount = ul.children.length;
|
41926 | }
|
41927 |
|
41928 | var isExtend = s.targetLine.classList.contains('extend');
|
41929 |
|
41930 | if (_this.props.onClick) _this.props.onClick(s, item, isActived, isExtend, childrenCount);
|
41931 | };
|
41932 |
|
41933 | return _this;
|
41934 | }
|
41935 |
|
41936 | Tree.prototype.render = function render() {
|
41937 | var _this2 = this;
|
41938 |
|
41939 | var _props = this.props,
|
41940 | style = _props.style,
|
41941 | className = _props.className,
|
41942 | treeStyle = _props.treeStyle,
|
41943 | treeClassName = _props.treeClassName;
|
41944 |
|
41945 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
41946 | 'div',
|
41947 | { ref: function ref(el) {
|
41948 | _this2.$el = el;
|
41949 | }, className: 'tree-box' + (className ? ' ' + className : ''), style: style },
|
41950 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('ul', { ref: function ref(el) {
|
41951 | _this2.$tree = el;
|
41952 | }, className: 'tree' + (treeClassName ? ' ' + treeClassName : ''), style: treeStyle })
|
41953 | );
|
41954 | };
|
41955 |
|
41956 | return Tree;
|
41957 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Tree_class.propTypes = {
|
41958 | style: prop_types_default.a.object,
|
41959 | className: prop_types_default.a.string,
|
41960 | treeStyle: prop_types_default.a.object,
|
41961 | treeClassName: prop_types_default.a.string,
|
41962 |
|
41963 | multiple: prop_types_default.a.bool,
|
41964 | checkbox: prop_types_default.a.bool,
|
41965 | bar: prop_types_default.a.oneOfType([
|
41966 | prop_types_default.a.string, prop_types_default.a.node]),
|
41967 | selected: prop_types_default.a.array,
|
41968 | list: prop_types_default.a.array,
|
41969 |
|
41970 | buttonAddHTML: prop_types_default.a.string,
|
41971 | buttonAddClassName: prop_types_default.a.string,
|
41972 | buttonAddSrc: prop_types_default.a.string,
|
41973 | onClickAdd: prop_types_default.a.func,
|
41974 |
|
41975 | buttonDelHTML: prop_types_default.a.string,
|
41976 | buttonDelClassName: prop_types_default.a.string,
|
41977 | buttonDelSrc: prop_types_default.a.string,
|
41978 | onClickDel: prop_types_default.a.func,
|
41979 |
|
41980 | onClickLastChild: prop_types_default.a.func,
|
41981 |
|
41982 | onClick: prop_types_default.a.func,
|
41983 | onData: prop_types_default.a.func
|
41984 | }, Tree_class.defaultProps = {
|
41985 | multiple: true,
|
41986 | list: []
|
41987 | }, Tree_temp);
|
41988 |
|
41989 |
|
41990 |
|
41991 |
|
41992 | var src_Tree = (Tree_Tree);
|
41993 |
|
41994 |
|
41995 | var Ajax = {
|
41996 | xhr: function xhr(config) {
|
41997 | var xhr = new window.XMLHttpRequest();
|
41998 | var url = config.url;
|
41999 | var data = config.data || {};
|
42000 | var success = config.success;
|
42001 | var error = config.error;
|
42002 | var params = Object.params(data);
|
42003 | var type = config.type || 'GET';
|
42004 | var contentType = config.contentType;
|
42005 | var token = config.token;
|
42006 | var extra = config.extra;
|
42007 |
|
42008 | xhr.onreadystatechange = function () {
|
42009 | if (xhr.readyState === 4) {
|
42010 | if (xhr.status === 200) {
|
42011 | var res = JSON.parse(xhr.responseText);
|
42012 | success(res, extra);
|
42013 | } else {
|
42014 | error && error();
|
42015 | }
|
42016 | }
|
42017 | };
|
42018 |
|
42019 | if (token) xhr.setRequestHeader('Authorization', token);
|
42020 |
|
42021 | if (type === 'POST') {
|
42022 | xhr.open(type, url, true);
|
42023 | xhr.setRequestHeader('Content-type', contentType || 'application/json');
|
42024 | if (contentType === 'application/x-www-form-urlencoded; charset=UTF-8') {
|
42025 | xhr.send(params);
|
42026 | } else {
|
42027 | xhr.send(JSON.stringify(data));
|
42028 | }
|
42029 | } else {
|
42030 | if (url.indexOf('?') === -1) {
|
42031 | url += '?' + params;
|
42032 | } else {
|
42033 | url += '&' + params;
|
42034 | }
|
42035 | xhr.open(type, url, true);
|
42036 | xhr.send(null);
|
42037 | }
|
42038 | },
|
42039 | fetchData: function fetchData(url, config) {
|
42040 |
|
42041 |
|
42042 |
|
42043 | return new Promise(function (resolve, reject) {
|
42044 | Ajax.xhr({
|
42045 | url: url,
|
42046 | data: config.req || {},
|
42047 | type: config.type || null,
|
42048 | contentType: config.contentType || null,
|
42049 | token: config.token || null,
|
42050 | success: function success(data) {
|
42051 | if (data.code === '1') {
|
42052 | resolve(data);
|
42053 | } else {
|
42054 | reject(data);
|
42055 | }
|
42056 |
|
42057 |
|
42058 | },
|
42059 | error: function error(err) {
|
42060 | reject(err);
|
42061 |
|
42062 |
|
42063 | }
|
42064 | });
|
42065 | });
|
42066 | }
|
42067 | };
|
42068 |
|
42069 | var Ajax_Ajax = (Ajax);
|
42070 |
|
42071 |
|
42072 |
|
42073 | var src_Ajax = (Ajax_Ajax);
|
42074 |
|
42075 |
|
42076 | var Animate = {
|
42077 |
|
42078 | requestAF: window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (handler) {
|
42079 | return window.setTimeout(handler, 1000 / 60);
|
42080 | },
|
42081 |
|
42082 | cancelAF: window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || window.msCancelAnimationFrame || function (handler) {
|
42083 | return window.clearTimeout(handler);
|
42084 | },
|
42085 |
|
42086 | one: function one(el, aniname) {
|
42087 | var animExpr = new RegExp('\\s{0,}' + aniname, 'g');
|
42088 | if (el.className.match(animExpr)) {
|
42089 | el.className = el.className.replace(animExpr, '');
|
42090 | }
|
42091 | el.className += ' ' + aniname;
|
42092 | if (!el.hasEndEvent) {
|
42093 | el.addEventListener('webkitAnimationEnd', function (e) {
|
42094 | el.className = el.className.replace(animExpr, '');
|
42095 | }, false);
|
42096 | el.hasEndEvent = true;
|
42097 | }
|
42098 | },
|
42099 | fps: function fps(callback, duration) {
|
42100 | var fps = 0;
|
42101 | var interval = setInterval(function () {
|
42102 | fps++;
|
42103 | }, 1);
|
42104 | setTimeout(function () {
|
42105 | if (callback) {
|
42106 | callback(fps);
|
42107 | }
|
42108 | clearInterval(interval);
|
42109 | }, duration || 1000);
|
42110 | }
|
42111 |
|
42112 | |
42113 |
|
42114 |
|
42115 |
|
42116 |
|
42117 |
|
42118 |
|
42119 |
|
42120 |
|
42121 |
|
42122 |
|
42123 |
|
42124 |
|
42125 |
|
42126 |
|
42127 | };
|
42128 |
|
42129 | var Animate_Animate = (Animate);
|
42130 |
|
42131 |
|
42132 |
|
42133 | var src_Animate = (Animate_Animate);
|
42134 |
|
42135 | var axios = __webpack_require__(4);
|
42136 | var axios_default = __webpack_require__.n(axios);
|
42137 |
|
42138 |
|
42139 | var ApiAxios_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; };
|
42140 |
|
42141 |
|
42142 |
|
42143 |
|
42144 |
|
42145 |
|
42146 | axios_default.a.defaults.headers.post['Content-Type'] = 'application/jsoncharset=UTF-8';
|
42147 |
|
42148 |
|
42149 | function buildGetUrl(url, params) {
|
42150 | if (!params || Object.isEmptyObject(params)) {
|
42151 | return url;
|
42152 | }
|
42153 | if (typeof params === 'string') {
|
42154 | return url + '?' + params;
|
42155 | }
|
42156 | if (Object.type(params) === 'json') {
|
42157 | return url + '?' + Object.params(params);
|
42158 | }
|
42159 | return url;
|
42160 | }
|
42161 |
|
42162 |
|
42163 | var Api = {
|
42164 | onError: function onError(error) {
|
42165 | console.warn(error);
|
42166 | },
|
42167 | setBaseURL: function setBaseURL(baseURL) {
|
42168 | axios_default.a.defaults.baseURL = baseURL;
|
42169 | },
|
42170 | request: function request(url) {
|
42171 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
42172 |
|
42173 |
|
42174 | var method = params.method === 'get' ? 'get' : 'post';
|
42175 |
|
42176 | var head = params.head || {};
|
42177 |
|
42178 | var options = params.options || {};
|
42179 |
|
42180 | var data = params.data || {};
|
42181 | return axios_default()(ApiAxios_extends({
|
42182 | url: method === 'get' ? buildGetUrl(url, data) : url,
|
42183 | method: method,
|
42184 | headers: ApiAxios_extends({}, head),
|
42185 | data: method === 'get' ? null : data
|
42186 | }, options));
|
42187 | },
|
42188 | post: function post(url) {
|
42189 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
42190 |
|
42191 | return this.request(url, Object.assign({}, params, { method: 'post' }));
|
42192 | },
|
42193 | get: function get(url, params) {
|
42194 | return this.request(url, Object.assign({}, params, { method: 'get' }));
|
42195 | },
|
42196 | all: function all(requests) {
|
42197 | var _this = this;
|
42198 |
|
42199 |
|
42200 | var methods = requests.map(function (request) {
|
42201 | return _this.request(request.url, request.params);
|
42202 | });
|
42203 | return axios_default.a.all(methods);
|
42204 | }
|
42205 |
|
42206 |
|
42207 | };axios_default.a.interceptors.response.use(function (response) {
|
42208 | var result = response.data || response;
|
42209 | if (typeof result === 'string') {
|
42210 | try {
|
42211 | return JSON.parse(result);
|
42212 | } catch (error) {
|
42213 | console.log('result转换JSON失败' + error);
|
42214 | return result;
|
42215 | }
|
42216 | }
|
42217 | return result;
|
42218 | }, function (error) {
|
42219 | if (Api.onError) Api.onError(error);
|
42220 | return Promise.reject(error);
|
42221 | });
|
42222 |
|
42223 | var ApiAxios = (Api);
|
42224 |
|
42225 |
|
42226 |
|
42227 | var src_ApiAxios = (ApiAxios);
|
42228 |
|
42229 |
|
42230 |
|
42231 |
|
42232 |
|
42233 |
|
42234 |
|
42235 |
|
42236 |
|
42237 |
|
42238 |
|
42239 |
|
42240 |
|
42241 |
|
42242 |
|
42243 |
|
42244 |
|
42245 |
|
42246 |
|
42247 |
|
42248 |
|
42249 |
|
42250 |
|
42251 |
|
42252 | (function (root) {
|
42253 |
|
42254 | var Route = root.BackboneRoute = {
|
42255 | init: function init(map) {
|
42256 | var defaultAction = map['*'];
|
42257 | if (defaultAction) {
|
42258 | Route.defaultAction = defaultAction;
|
42259 | delete map['*'];
|
42260 | }
|
42261 | Route.routes = map;
|
42262 | _init();
|
42263 | onchange();
|
42264 | },
|
42265 | routes: {},
|
42266 | defaultAction: null
|
42267 | };
|
42268 |
|
42269 | function onchange(onChangeEvent) {
|
42270 | var newURL = onChangeEvent && onChangeEvent.newURL || window.location.hash;
|
42271 | var url = newURL.replace(/.*#/, '');
|
42272 | var found = false;
|
42273 | for (var path in Route.routes) {
|
42274 | var reg = getRegExp(path);
|
42275 | var result = reg.exec(url);
|
42276 | if (result && result[0] && result[0] != '') {
|
42277 | var handler = Route.routes[path];
|
42278 | handler && handler.apply(null, result.slice(1));
|
42279 | found = true;
|
42280 | }
|
42281 | }
|
42282 | if (!found && Route.defaultAction) {
|
42283 | Route.defaultAction();
|
42284 | }
|
42285 | }
|
42286 |
|
42287 | |
42288 |
|
42289 |
|
42290 |
|
42291 |
|
42292 | function getRegExp(route) {
|
42293 | var optionalParam = /\((.*?)\)/g;
|
42294 | var namedParam = /(\(\?)?:\w+/g;
|
42295 | var splatParam = /\*\w+/g;
|
42296 | var escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g;
|
42297 | route = route.replace(escapeRegExp, '\\$&').replace(optionalParam, '(?:$1)?').replace(namedParam, function (match, optional) {
|
42298 | return optional ? match : '([^/?]+)';
|
42299 | }).replace(splatParam, '([^?]*?)');
|
42300 | return new RegExp('^' + route + '(?:\\?([\\s\\S]*))?$');
|
42301 | }
|
42302 |
|
42303 | |
42304 |
|
42305 |
|
42306 | function _init() {
|
42307 | if ('onhashchange' in window && (document.documentMode === undefined || document.documentMode > 7)) {
|
42308 |
|
42309 | if (window.history === true) {
|
42310 |
|
42311 |
|
42312 |
|
42313 |
|
42314 |
|
42315 | setTimeout(function () {
|
42316 | window.onpopstate = onchange;
|
42317 | }, 500);
|
42318 | } else {
|
42319 | window.onhashchange = onchange;
|
42320 | }
|
42321 | window.mode = 'modern';
|
42322 | } else {
|
42323 | throw new Error('sorry, your browser doesn\'t support route');
|
42324 | }
|
42325 | }
|
42326 | })(window);
|
42327 |
|
42328 | var BackboneRoute = (window.BackboneRoute);
|
42329 |
|
42330 |
|
42331 |
|
42332 | var src_BackboneRoute = (BackboneRoute);
|
42333 |
|
42334 |
|
42335 |
|
42336 | if (!window._seeds_lang) window._seeds_lang = {};
|
42337 |
|
42338 | var CanvasUtil = {
|
42339 | cropImg: function cropImg() {
|
42340 | var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
42341 |
|
42342 |
|
42343 | var errMsg = '';
|
42344 | if (isNaN(opts.x)) {
|
42345 | errMsg = 'SeedsUI Error:CanvasUtil.cropImg裁切方法x参数不正确';
|
42346 | console.warn(errMsg);
|
42347 | return errMsg;
|
42348 | }
|
42349 | if (isNaN(opts.y)) {
|
42350 | errMsg = 'SeedsUI Error:CanvasUtil.cropImg,' + (window._seeds_lang['method'] || '方法') + 'y' + (window._seeds_lang['wrong_parameter'] || '参数不正确');
|
42351 | console.warn(errMsg);
|
42352 | return errMsg;
|
42353 | }
|
42354 | if (isNaN(opts.width)) {
|
42355 | errMsg = 'SeedsUI Error:CanvasUtil.cropImg,' + (window._seeds_lang['method'] || '方法') + 'width' + (window._seeds_lang['wrong_parameter'] || '参数不正确');
|
42356 | console.warn(errMsg);
|
42357 | return errMsg;
|
42358 | }
|
42359 | if (isNaN(opts.height)) {
|
42360 | errMsg = 'SeedsUI Error:CanvasUtil.cropImg,' + (window._seeds_lang['method'] || '方法') + 'width' + (window._seeds_lang['wrong_parameter'] || '参数不正确');
|
42361 | console.warn(errMsg);
|
42362 | return errMsg;
|
42363 | }
|
42364 | var suffix = opts.suffix || 'image/png';
|
42365 | var quality = opts.quality || 0.92;
|
42366 |
|
42367 | var canvas = document.getElementById('imgcrop_canvas');
|
42368 | if (!canvas) {
|
42369 | canvas = document.createElement('canvas');
|
42370 | canvas.setAttribute('id', 'imgcrop_canvas');
|
42371 | document.body.appendChild(canvas);
|
42372 | }
|
42373 | var ctx = canvas.getContext('2d');
|
42374 | canvas.width = opts.width;
|
42375 | canvas.height = opts.height;
|
42376 | var img = new Image();
|
42377 | img.src = opts.src;
|
42378 | img.crossOrigin = 'Anonymous';
|
42379 | img.addEventListener('load', function () {
|
42380 | ctx.drawImage(img, opts.x, opts.y, opts.width, opts.height, 0, 0, opts.width, opts.height);
|
42381 |
|
42382 | try {
|
42383 | if (opts.onSuccess) opts.onSuccess(canvas.toDataURL(suffix, quality));
|
42384 | } catch (error) {
|
42385 | if (opts.onError) opts.onError(error);
|
42386 | }
|
42387 | }, false);
|
42388 | }
|
42389 | };
|
42390 |
|
42391 | var CanvasUtil_CanvasUtil = (CanvasUtil);
|
42392 |
|
42393 |
|
42394 |
|
42395 | var src_CanvasUtil = (CanvasUtil_CanvasUtil);
|
42396 |
|
42397 |
|
42398 |
|
42399 | if (!window._seeds_lang) window._seeds_lang = {};
|
42400 |
|
42401 | var Clipboard = {
|
42402 |
|
42403 | selectContent: function selectContent(element) {
|
42404 |
|
42405 | var rangeToSelect = document.createRange();
|
42406 | rangeToSelect.selectNodeContents(element);
|
42407 |
|
42408 |
|
42409 | var selection = window.getSelection();
|
42410 | selection.removeAllRanges();
|
42411 | selection.addRange(rangeToSelect);
|
42412 | },
|
42413 |
|
42414 | createElementForExecCommand: function createElementForExecCommand(textToClipboard) {
|
42415 | var forExecElement = document.createElement('div');
|
42416 |
|
42417 | forExecElement.style.position = 'absolute';
|
42418 | forExecElement.style.left = '-10000px';
|
42419 | forExecElement.style.top = '-10000px';
|
42420 |
|
42421 | forExecElement.textContent = textToClipboard;
|
42422 | document.body.appendChild(forExecElement);
|
42423 |
|
42424 | forExecElement.contentEditable = true;
|
42425 |
|
42426 | return forExecElement;
|
42427 | },
|
42428 |
|
42429 | copy: function copy(input) {
|
42430 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
42431 |
|
42432 | var textToClipboard = input;
|
42433 |
|
42434 | var success = true;
|
42435 | if (window.clipboardData) {
|
42436 |
|
42437 | window.clipboardData.setData('Text', textToClipboard);
|
42438 | } else {
|
42439 |
|
42440 | var forExecElement = this.createElementForExecCommand(textToClipboard);
|
42441 |
|
42442 |
|
42443 | this.selectContent(forExecElement);
|
42444 |
|
42445 |
|
42446 | try {
|
42447 | if (window.netscape && window.netscape.security) {
|
42448 | window.netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
42449 | }
|
42450 |
|
42451 |
|
42452 | success = document.execCommand('copy', false, null);
|
42453 | } catch (e) {
|
42454 | success = false;
|
42455 | }
|
42456 |
|
42457 |
|
42458 | document.body.removeChild(forExecElement);
|
42459 | }
|
42460 |
|
42461 | if (success) {
|
42462 | if (params && params.onSuccess) params.onSuccess(params.successMsg || window._seeds_lang['copied_to_the_clipboard'] || '复制到剪贴板成功');
|
42463 | } else {
|
42464 | if (params && params.onError) params.onError(params.errorMsg || window._seeds_lang['unable_to_access_clipboard'] || '当前设备不允许访问剪贴板');
|
42465 | }
|
42466 | }
|
42467 | };
|
42468 |
|
42469 | var Clipboard_Clipboard = (Clipboard);
|
42470 |
|
42471 |
|
42472 |
|
42473 | var src_Clipboard = (Clipboard_Clipboard);
|
42474 |
|
42475 |
|
42476 |
|
42477 |
|
42478 |
|
42479 |
|
42480 |
|
42481 |
|
42482 |
|
42483 | var GeoUtil = {};
|
42484 | (function () {
|
42485 | |
42486 |
|
42487 |
|
42488 |
|
42489 |
|
42490 |
|
42491 | GeoUtil.polygonToLines = function (polygon, isRegular) {
|
42492 | var lines = [];
|
42493 |
|
42494 | for (var i = 0; i < polygon.length - 1; i++) {
|
42495 | lines.push([polygon[i][0], polygon[i][1], polygon[i + 1][0], polygon[i + 1][1]]);
|
42496 | }
|
42497 |
|
42498 | if (isRegular) {
|
42499 | lines.push([polygon[polygon.length - 1][0], polygon[polygon.length - 1][1], polygon[0][0], polygon[0][1]]);
|
42500 | }
|
42501 | return lines;
|
42502 | };
|
42503 |
|
42504 | |
42505 |
|
42506 |
|
42507 |
|
42508 |
|
42509 |
|
42510 | GeoUtil.pointInsidePolygon = function (point, polygon) {
|
42511 | var x = point[0],
|
42512 | y = point[1];
|
42513 |
|
42514 | var inside = false;
|
42515 | for (var i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
|
42516 | var xi = polygon[i][0],
|
42517 | yi = polygon[i][1];
|
42518 | var xj = polygon[j][0],
|
42519 | yj = polygon[j][1];
|
42520 |
|
42521 | var intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
|
42522 | if (intersect) inside = !inside;
|
42523 | }
|
42524 |
|
42525 | return inside;
|
42526 | };
|
42527 | |
42528 |
|
42529 |
|
42530 |
|
42531 |
|
42532 |
|
42533 | GeoUtil.lineIntersectLine = function (line0, line1) {
|
42534 | var a = line0[0],
|
42535 | b = line0[1],
|
42536 | c = line0[2],
|
42537 | d = line0[3];
|
42538 | var p = line1[0],
|
42539 | q = line1[1],
|
42540 | r = line1[2],
|
42541 | s = line1[3];
|
42542 |
|
42543 | var det, gamma, lambda;
|
42544 | det = (c - a) * (s - q) - (r - p) * (d - b);
|
42545 | if (det === 0) {
|
42546 | return false;
|
42547 | } else {
|
42548 | lambda = ((s - q) * (r - a) + (p - r) * (s - b)) / det;
|
42549 | gamma = ((b - d) * (r - a) + (c - a) * (s - b)) / det;
|
42550 | return 0 < lambda && lambda < 1 && 0 < gamma && gamma < 1;
|
42551 | }
|
42552 | };
|
42553 | |
42554 |
|
42555 |
|
42556 |
|
42557 |
|
42558 |
|
42559 | GeoUtil.polygonInsidePolygon = function (py0, py1) {
|
42560 |
|
42561 | var i;
|
42562 | var inside = 0;
|
42563 | for (i = 0; i < py0.length; i += 1) {
|
42564 | if (GeoUtil.pointInsidePolygon(py0[i], py1)) {
|
42565 | inside++;
|
42566 | }
|
42567 | }
|
42568 | if (inside === py0.length) return true;
|
42569 |
|
42570 | inside = 0;
|
42571 | for (i = 0; i < py1.length; i += 1) {
|
42572 | if (GeoUtil.pointInsidePolygon(py1[i], py0)) {
|
42573 | inside++;
|
42574 | }
|
42575 | }
|
42576 | if (inside === py0.length) return true;
|
42577 |
|
42578 | return false;
|
42579 | };
|
42580 |
|
42581 | |
42582 |
|
42583 |
|
42584 |
|
42585 |
|
42586 | GeoUtil.isPoint = function (point) {
|
42587 | var precision = 2e-10;
|
42588 | if (Math.abs(point[0]) < precision && Math.abs(point[1]) < precision) {
|
42589 | return false;
|
42590 | } else {
|
42591 | return true;
|
42592 | }
|
42593 | };
|
42594 |
|
42595 | |
42596 |
|
42597 |
|
42598 |
|
42599 |
|
42600 |
|
42601 | GeoUtil.equalPoint = function (p0, p1) {
|
42602 | var precision = 2e-8;
|
42603 | if (Math.abs(p0[0] - p1[0]) < precision && Math.abs(p0[1] - p1[1]) < precision) {
|
42604 | return true;
|
42605 | } else {
|
42606 | return false;
|
42607 | }
|
42608 | };
|
42609 |
|
42610 | |
42611 |
|
42612 |
|
42613 |
|
42614 |
|
42615 |
|
42616 | GeoUtil.getMiddlePoint = function (p0, p1) {
|
42617 | return [(p0[0] + p0[1]) / 2, (p1[0] + p1[1]) / 2];
|
42618 | };
|
42619 |
|
42620 | |
42621 |
|
42622 |
|
42623 |
|
42624 |
|
42625 | GeoUtil.isPolygon = function (polygon) {
|
42626 | var lines = GeoUtil.polygonToLines(polygon, true);
|
42627 | for (var i = 0; i < lines.length; i++) {
|
42628 | for (var j = i + 1; j < lines.length; j++) {
|
42629 | if (GeoUtil.lineIntersectLine(lines[i], lines[j])) return true;
|
42630 | }
|
42631 | }
|
42632 | return false;
|
42633 | };
|
42634 |
|
42635 | |
42636 |
|
42637 |
|
42638 |
|
42639 |
|
42640 |
|
42641 | GeoUtil.pointOnLine = function (point, line) {
|
42642 |
|
42643 | if (point[1] >= Math.min(line[1], line[3]) && point[1] <= Math.max(line[1], line[3]) && point[0] >= Math.min(line[0], line[2]) && point[0] <= Math.max(line[0], line[2])) {
|
42644 |
|
42645 | var precision = (line[1] - point[1]) * (line[2] - point[0]) - (line[3] - point[1]) * (line[0] - point[0]);
|
42646 | if (precision < 2e-10 && precision > -2e-10) {
|
42647 |
|
42648 | return true;
|
42649 | }
|
42650 | }
|
42651 | return false;
|
42652 | };
|
42653 | |
42654 |
|
42655 |
|
42656 |
|
42657 |
|
42658 |
|
42659 | GeoUtil.getDistance = function (p0, p1) {
|
42660 | if (!p0[0] || !p0[1] || !p1[0] || !p1[1]) {
|
42661 | return -1;
|
42662 | }
|
42663 | var lat1 = p0[0];
|
42664 | var lng1 = p0[1];
|
42665 | var lat2 = p1[0];
|
42666 | var lng2 = p1[1];
|
42667 | var radLat1 = lat1 * Math.PI / 180.0;
|
42668 | var radLat2 = lat2 * Math.PI / 180.0;
|
42669 | var a = radLat1 - radLat2;
|
42670 | var b = lng1 * Math.PI / 180.0 - lng2 * Math.PI / 180.0;
|
42671 | var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));
|
42672 | s = s * 6378.137;
|
42673 | s = Math.round(s * 10000) / 10000;
|
42674 | return s;
|
42675 | };
|
42676 | |
42677 |
|
42678 |
|
42679 |
|
42680 |
|
42681 |
|
42682 | GeoUtil.sortPoints = function (points) {
|
42683 | points = points.splice(0);
|
42684 | var p0 = {};
|
42685 | p0[1] = Math.min.apply(null, points.map(function (p) {
|
42686 | return p[1];
|
42687 | }));
|
42688 | p0[0] = Math.max.apply(null, points.filter(function (p) {
|
42689 | return p[1] == p0[1];
|
42690 | }).map(function (p) {
|
42691 | return p[0];
|
42692 | }));
|
42693 | points.sort(function (a, b) {
|
42694 | return angleCompare(p0, a, b);
|
42695 | });
|
42696 | return points;
|
42697 | };
|
42698 | function angleCompare(p0, a, b) {
|
42699 | var left = isLeft(p0, a, b);
|
42700 | if (left == 0) return distCompare(p0, a, b);
|
42701 | return left;
|
42702 | }
|
42703 |
|
42704 | function isLeft(p0, a, b) {
|
42705 | return (a[0] - p0[0]) * (b[1] - p0[1]) - (b[0] - p0[0]) * (a[1] - p0[1]);
|
42706 | }
|
42707 |
|
42708 | function distCompare(p0, a, b) {
|
42709 | var distA = (p0[0] - a[0]) * (p0[0] - a[0]) + (p0[1] - a[1]) * (p0[1] - a[1]);
|
42710 | var distB = (p0[0] - b[0]) * (p0[0] - b[0]) + (p0[1] - b[1]) * (p0[1] - b[1]);
|
42711 | return distA - distB;
|
42712 | }
|
42713 | })();
|
42714 |
|
42715 | var GeoUtil_GeoUtil = (GeoUtil);
|
42716 |
|
42717 |
|
42718 |
|
42719 | var src_GeoUtil = (GeoUtil_GeoUtil);
|
42720 |
|
42721 | var instance_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; };
|
42722 |
|
42723 | function instance_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
42724 |
|
42725 |
|
42726 |
|
42727 |
|
42728 | var instance_Vott = function Vott(container, params) {
|
42729 | |
42730 |
|
42731 |
|
42732 | var defaults = {
|
42733 | readOnly: false,
|
42734 | data: null,
|
42735 | src: '',
|
42736 |
|
42737 | loadingClass: 'vott-loading',
|
42738 | errorClass: 'vott-error',
|
42739 | activeClass: 'active',
|
42740 |
|
42741 | containerClass: 'vott-container',
|
42742 |
|
42743 | svgClass: 'vott-svg',
|
42744 |
|
42745 | shapeClass: 'vott-shape',
|
42746 | shapeActiveClass: 'active',
|
42747 | shapeAttributes: {},
|
42748 |
|
42749 | bulletClass: 'vott-shape-bullet',
|
42750 | bulletActiveClass: 'active',
|
42751 |
|
42752 | xMinYMinClass: 'xMinYMin',
|
42753 | xMinYMidClass: 'xMinYMid',
|
42754 | xMinYMaxClass: 'xMinYMax',
|
42755 |
|
42756 | xMidYMinClass: 'xMidYMin',
|
42757 | xMidYMaxClass: 'xMidYMax',
|
42758 |
|
42759 | xMaxYMinClass: 'xMaxYMin',
|
42760 | xMaxYMidClass: 'xMaxYMid',
|
42761 | xMaxYMaxClass: 'xMaxYMax',
|
42762 |
|
42763 | isScale: true
|
42764 | |
42765 |
|
42766 |
|
42767 |
|
42768 |
|
42769 |
|
42770 | };
|
42771 | params = params || {};
|
42772 | for (var def in defaults) {
|
42773 | if (params[def] === undefined) {
|
42774 | params[def] = defaults[def];
|
42775 | }
|
42776 | }
|
42777 |
|
42778 | var s = this;
|
42779 |
|
42780 |
|
42781 | s.params = params;
|
42782 |
|
42783 | s.setParams = function (params) {
|
42784 | for (var n in params) {
|
42785 | s.params[n] = params[n];
|
42786 | }
|
42787 | };
|
42788 |
|
42789 | s.setReadOnly = function (readOnly) {
|
42790 | s.params.readOnly = readOnly;
|
42791 | if (readOnly) {
|
42792 | s.detach();
|
42793 | } else {
|
42794 | s.attach();
|
42795 | }
|
42796 | };
|
42797 |
|
42798 | s.container = typeof container === 'string' && container !== '' ? document.querySelector(container) : container;
|
42799 | if (!s.container) {
|
42800 | console.warn('SeedsUI Error:未找到Container,请检查传入参数是否正确');
|
42801 | return;
|
42802 | }
|
42803 |
|
42804 |
|
42805 | s.updateSvg = function (svg, attr) {
|
42806 | if (!attr) return;
|
42807 | for (var key in attr) {
|
42808 | switch (key) {
|
42809 | case 'xlink:href':
|
42810 |
|
42811 | svg.setAttributeNS('http://www.w3.org/1999/xlink', key, attr[key]);
|
42812 | break;
|
42813 | default:
|
42814 | svg.setAttribute(key, attr[key]);
|
42815 | }
|
42816 | }
|
42817 | return svg;
|
42818 | };
|
42819 |
|
42820 | s.createSvg = function (tag, attr) {
|
42821 | if (!document.createElementNS) return;
|
42822 | var svg = document.createElementNS('http://www.w3.org/2000/svg', tag);
|
42823 | s.updateSvg(svg, attr);
|
42824 | return svg;
|
42825 | };
|
42826 |
|
42827 |
|
42828 | s.svg = s.container.querySelector('.' + s.params.svgClass) || s.createSvg('svg', {
|
42829 | 'class': s.params.svgClass,
|
42830 |
|
42831 | preserveAspectRatio: 'none'
|
42832 | });
|
42833 |
|
42834 |
|
42835 | s.loadingContainer = s.container.querySelector('.' + s.params.loadingClass) || null;
|
42836 |
|
42837 |
|
42838 | s.errorContainer = s.container.querySelector('.' + s.params.errorClass) || null;
|
42839 |
|
42840 |
|
42841 | s.bullets = null;
|
42842 |
|
42843 | |
42844 |
|
42845 |
|
42846 |
|
42847 | s.draw = function (data) {
|
42848 | if (!data || !data.length) return;
|
42849 | for (var _iterator = data, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
|
42850 | var _ref;
|
42851 |
|
42852 | if (_isArray) {
|
42853 | if (_i >= _iterator.length) break;
|
42854 | _ref = _iterator[_i++];
|
42855 | } else {
|
42856 | _i = _iterator.next();
|
42857 | if (_i.done) break;
|
42858 | _ref = _i.value;
|
42859 | }
|
42860 |
|
42861 | var item = _ref;
|
42862 |
|
42863 | var polygon = item.polygon,
|
42864 | id = item.id,
|
42865 | className = item.className,
|
42866 | style = item.style,
|
42867 | others = instance_objectWithoutProperties(item, ['polygon', 'id', 'className', 'style']);
|
42868 |
|
42869 | if (polygon.length !== 4) continue;
|
42870 |
|
42871 | polygon = polygon.map(function (points) {
|
42872 | return points.map(function (point) {
|
42873 | return point * s.scale;
|
42874 | });
|
42875 | });
|
42876 | s.createShape(s.svg, 'polygon', {
|
42877 | 'points': polygon.join(','),
|
42878 | 'data-scale-type': s.params.isScale ? '1' : '0',
|
42879 | 'id': id || '',
|
42880 | 'class': s.params.shapeClass + (className ? ' ' + className : ''),
|
42881 | 'style': style || '',
|
42882 | 'data-params': JSON.stringify(instance_extends({}, others))
|
42883 | });
|
42884 | }
|
42885 | };
|
42886 |
|
42887 | s.onLoad = function (e) {
|
42888 | var target = e.target;
|
42889 |
|
42890 | if (s.loadingContainer) s.loadingContainer.classList.remove(s.params.activeClass);
|
42891 | if (s.errorContainer) s.errorContainer.classList.remove(s.params.activeClass);
|
42892 | s.svg.classList.add(s.params.activeClass);
|
42893 |
|
42894 | s.scale = 1;
|
42895 | if (target.width > target.height) {
|
42896 |
|
42897 | s.scale = s.container.clientWidth / target.width;
|
42898 | } else {
|
42899 |
|
42900 | s.scale = s.container.clientHeight / target.height;
|
42901 | }
|
42902 | var width = target.width * s.scale;
|
42903 | var height = target.height * s.scale;
|
42904 | s.svg.setAttribute('style', 'width:' + width + ';height:' + height);
|
42905 |
|
42906 | s.svg.style.backgroundImage = 'url(' + s.params.src + ')';
|
42907 |
|
42908 | s.draw(s.params.data);
|
42909 |
|
42910 | if (s.params.onSuccess) s.params.onSuccess(s);
|
42911 |
|
42912 | if (!s.params.readOnly) {
|
42913 | s.detach();
|
42914 | s.attach();
|
42915 | }
|
42916 | };
|
42917 | s.onError = function () {
|
42918 |
|
42919 | if (s.loadingContainer) s.loadingContainer.classList.remove(s.params.activeClass);
|
42920 | if (s.errorContainer) s.errorContainer.classList.add(s.params.activeClass);
|
42921 | s.svg.classList.remove(s.params.activeClass);
|
42922 |
|
42923 | if (s.params.onError) s.params.onError(s);
|
42924 | };
|
42925 |
|
42926 | s.update = function () {
|
42927 | if (!s.params.src || !s.container) return;
|
42928 |
|
42929 | s.svg.innerHTML = '';
|
42930 |
|
42931 | var xMinYMin = s.svg.querySelector('.' + s.params.xMinYMinClass);
|
42932 | var xMinYMid = s.svg.querySelector('.' + s.params.xMinYMidClass);
|
42933 | var xMinYMax = s.svg.querySelector('.' + s.params.xMinYMaxClass);
|
42934 |
|
42935 | var xMidYMin = s.svg.querySelector('.' + s.params.xMidYMinClass);
|
42936 | var xMidYMax = s.svg.querySelector('.' + s.params.xMidYMaxClass);
|
42937 |
|
42938 | var xMaxYMin = s.svg.querySelector('.' + s.params.xMaxYMinClass);
|
42939 | var xMaxYMid = s.svg.querySelector('.' + s.params.xMaxYMidClass);
|
42940 | var xMaxYMax = s.svg.querySelector('.' + s.params.xMaxYMaxClass);
|
42941 |
|
42942 | if (xMinYMin && xMinYMid && xMinYMax && xMidYMin && xMidYMax && xMaxYMin && xMaxYMid && xMaxYMax) {
|
42943 | s.bullets = {
|
42944 | xMinYMin: xMinYMin,
|
42945 | xMinYMid: xMinYMid,
|
42946 | xMinYMax: xMinYMax,
|
42947 |
|
42948 | xMidYMin: xMidYMin,
|
42949 | xMidYMax: xMidYMax,
|
42950 |
|
42951 | xMaxYMin: xMaxYMin,
|
42952 | xMaxYMid: xMaxYMid,
|
42953 | xMaxYMax: xMaxYMax
|
42954 | };
|
42955 | }
|
42956 |
|
42957 |
|
42958 | var img = new Image();
|
42959 | img.src = s.params.src;
|
42960 | img.addEventListener('load', s.onLoad, false);
|
42961 | img.addEventListener('error', s.onError, false);
|
42962 | };
|
42963 |
|
42964 |
|
42965 | s.createShape = function (svg, shapeName, attr) {
|
42966 | if (!attr || !svg) return;
|
42967 |
|
42968 | var shape = s.createSvg(shapeName || 'polygon', attr);
|
42969 | svg.shape = shape;
|
42970 | svg.appendChild(shape);
|
42971 |
|
42972 | return svg;
|
42973 | };
|
42974 |
|
42975 | s.activeShape = function (target, isActive) {
|
42976 | if (isActive === false) {
|
42977 | target.classList.remove(s.params.shapeActiveClass);
|
42978 | s.touches.target = null;
|
42979 | s.hideBullets();
|
42980 | } else {
|
42981 | target.classList.add(s.params.shapeActiveClass);
|
42982 | }
|
42983 | };
|
42984 |
|
42985 | s.removeShape = function (target) {
|
42986 | target.parentNode.removeChild(target);
|
42987 | s.touches.target = null;
|
42988 | s.hideBullets();
|
42989 | };
|
42990 |
|
42991 | s.createCircle = function (svg, attr) {
|
42992 | var shape = s.createSvg('circle', attr);
|
42993 | svg.shape = shape;
|
42994 | svg.appendChild(shape);
|
42995 |
|
42996 | return svg;
|
42997 | };
|
42998 |
|
42999 | s.scaleShape = function (target, currentX, currentY, type) {
|
43000 | if (target.getAttribute('data-scale-type') === '0') {
|
43001 | console.log('自由缩放');
|
43002 | return;
|
43003 | }
|
43004 |
|
43005 | if (type === 'new') {
|
43006 | type = 'xMaxYMax';
|
43007 | }
|
43008 |
|
43009 | var polygon = s.sortPoints(target.getAttribute('points'));
|
43010 |
|
43011 | var points = '';
|
43012 |
|
43013 |
|
43014 | if (type === 'xMinYMin') {
|
43015 |
|
43016 | var fixedX = polygon[3][0];
|
43017 | var fixedY = polygon[3][1];
|
43018 | points = fixedX + ',' + currentY + ',' + currentX + ',' + currentY + ',' + currentX + ',' + fixedY + ',' + fixedX + ',' + fixedY;
|
43019 | } else if (type === 'xMinYMid') {
|
43020 |
|
43021 | var fixedX1 = polygon[0][0];
|
43022 | var fixedY1 = polygon[0][1];
|
43023 | var fixedX2 = polygon[3][0];
|
43024 | var fixedY2 = polygon[3][1];
|
43025 | points = fixedX1 + ',' + fixedY1 + ',' + currentX + ',' + fixedY1 + ',' + currentX + ',' + fixedY2 + ',' + fixedX2 + ',' + fixedY2;
|
43026 | } else if (type === 'xMinYMax') {
|
43027 |
|
43028 | var _fixedX = polygon[0][0];
|
43029 | var _fixedY = polygon[0][1];
|
43030 | points = _fixedX + ',' + _fixedY + ',' + currentX + ',' + _fixedY + ',' + currentX + ',' + currentY + ',' + _fixedX + ',' + currentY;
|
43031 | } else if (type === 'xMidYMin') {
|
43032 |
|
43033 | var _fixedX2 = polygon[2][0];
|
43034 | var _fixedY2 = polygon[2][1];
|
43035 | var _fixedX3 = polygon[3][0];
|
43036 | var _fixedY3 = polygon[3][1];
|
43037 | points = _fixedX3 + ',' + currentY + ',' + _fixedX2 + ',' + currentY + ',' + _fixedX2 + ',' + _fixedY2 + ',' + _fixedX3 + ',' + _fixedY3;
|
43038 | } else if (type === 'xMidYMax') {
|
43039 |
|
43040 | var _fixedX4 = polygon[0][0];
|
43041 | var _fixedY4 = polygon[0][1];
|
43042 | var _fixedX5 = polygon[1][0];
|
43043 | var _fixedY5 = polygon[1][1];
|
43044 | points = _fixedX4 + ',' + _fixedY4 + ',' + _fixedX5 + ',' + _fixedY5 + ',' + _fixedX5 + ',' + currentY + ',' + _fixedX4 + ',' + currentY;
|
43045 | } else if (type === 'xMaxYMin') {
|
43046 |
|
43047 | var _fixedX6 = polygon[2][0];
|
43048 | var _fixedY6 = polygon[2][1];
|
43049 | points = currentX + ',' + currentY + ',' + _fixedX6 + ',' + currentY + ',' + _fixedX6 + ',' + _fixedY6 + ',' + currentX + ',' + _fixedY6;
|
43050 | } else if (type === 'xMaxYMid') {
|
43051 |
|
43052 | var _fixedX7 = polygon[1][0];
|
43053 | var _fixedY7 = polygon[1][1];
|
43054 | var _fixedX8 = polygon[2][0];
|
43055 | var _fixedY8 = polygon[2][1];
|
43056 | points = currentX + ',' + _fixedY7 + ',' + _fixedX7 + ',' + _fixedY7 + ',' + _fixedX8 + ',' + _fixedY8 + ',' + currentX + ',' + _fixedY8;
|
43057 | } else if (type === 'xMaxYMax') {
|
43058 |
|
43059 | var _fixedX9 = polygon[1][0];
|
43060 | var _fixedY9 = polygon[1][1];
|
43061 | points = currentX + ',' + _fixedY9 + ',' + _fixedX9 + ',' + _fixedY9 + ',' + _fixedX9 + ',' + currentY + ',' + currentX + ',' + currentY;
|
43062 | }
|
43063 |
|
43064 | s.updateSvg(target, {
|
43065 | 'points': points
|
43066 | });
|
43067 | };
|
43068 |
|
43069 | s.showBullets = function () {
|
43070 | if (!s.bullets) return;
|
43071 | for (var bulletName in s.bullets) {
|
43072 | s.bullets[bulletName].classList.add(s.params.bulletActiveClass);
|
43073 | }
|
43074 | s.bulletsShow = true;
|
43075 | };
|
43076 |
|
43077 | s.hideBullets = function () {
|
43078 | if (!s.bullets) return;
|
43079 | for (var bulletName in s.bullets) {
|
43080 | s.bullets[bulletName].classList.remove(s.params.bulletActiveClass);
|
43081 | }
|
43082 | s.bulletsShow = false;
|
43083 | };
|
43084 |
|
43085 | s.moveShape = function (target, x, y, diffX, diffY) {
|
43086 |
|
43087 | var points = target.getAttribute('points').split(',');
|
43088 |
|
43089 | var startX = Number(points[2] || 0);
|
43090 | var startY = Number(points[3] || 0);
|
43091 |
|
43092 | var endX = Number(points[6] || 0);
|
43093 | var endY = Number(points[7] || 0);
|
43094 |
|
43095 | var width = Math.abs(endX - startX || 0);
|
43096 | var height = Math.abs(endY - startY || 0);
|
43097 |
|
43098 |
|
43099 | points = [x + width + diffX, y + diffY,
|
43100 | x + diffX, y + diffY,
|
43101 | x + diffX, y + height + diffY,
|
43102 | x + width + diffX, y + height + diffY];
|
43103 |
|
43104 | s.updateSvg(target, {
|
43105 | 'points': points.join(',')
|
43106 | });
|
43107 | };
|
43108 |
|
43109 | s.editShape = function (target) {
|
43110 | if (target.getAttribute('data-scale-type') === '0') {
|
43111 | console.log('自由缩放');
|
43112 | return;
|
43113 | }
|
43114 |
|
43115 | var points = target.getAttribute('points').split(',');
|
43116 |
|
43117 |
|
43118 | var startX = Number(points[2] || 0);
|
43119 | var startY = Number(points[3] || 0);
|
43120 |
|
43121 | var endX = Number(points[6] || 0);
|
43122 | var endY = Number(points[7] || 0);
|
43123 |
|
43124 | var width = Math.abs(endX - startX || 0);
|
43125 | var height = Math.abs(endY - startY || 0);
|
43126 |
|
43127 |
|
43128 | points = {
|
43129 | xMinYMin: [startX, startY],
|
43130 | xMinYMid: [startX, startY + height / 2],
|
43131 | xMinYMax: [startX, startY + height],
|
43132 |
|
43133 | xMidYMin: [startX + width / 2, startY],
|
43134 | xMidYMax: [startX + width / 2, startY + height],
|
43135 |
|
43136 | xMaxYMin: [startX + width, startY],
|
43137 | xMaxYMid: [startX + width, startY + height / 2],
|
43138 | xMaxYMax: [startX + width, startY + height]
|
43139 | };
|
43140 |
|
43141 | var hasBullets = !!s.bullets;
|
43142 | for (var pointName in points) {
|
43143 | var point = points[pointName];
|
43144 | if (!hasBullets) {
|
43145 |
|
43146 | var svg = s.createCircle(s.svg, {
|
43147 | 'cx': point[0],
|
43148 | 'cy': point[1],
|
43149 | 'r': 5,
|
43150 | 'class': s.params.bulletClass + ' ' + s.params[pointName + 'Class']
|
43151 | });
|
43152 | if (!s.bullets) s.bullets = {};
|
43153 | s.bullets[pointName] = svg.shape;
|
43154 | } else {
|
43155 |
|
43156 | s.updateSvg(s.bullets[pointName], {
|
43157 | 'cx': point[0],
|
43158 | 'cy': point[1]
|
43159 | });
|
43160 |
|
43161 | s.svg.appendChild(s.bullets[pointName]);
|
43162 | }
|
43163 | }
|
43164 | s.showBullets();
|
43165 | };
|
43166 |
|
43167 | s.toPolygon = function (points) {
|
43168 | if (!points) return;
|
43169 | var polygon = [];
|
43170 | var page = 0;
|
43171 | points.split(',').forEach(function (point, i) {
|
43172 |
|
43173 | if (i !== 0 && i % 2 === 0) {
|
43174 | page++;
|
43175 | }
|
43176 | if (!polygon[page]) polygon[page] = [];
|
43177 | polygon[page].push(point);
|
43178 | });
|
43179 | return polygon;
|
43180 | };
|
43181 |
|
43182 | s.sortPoints = function (points) {
|
43183 | var polygon = s.toPolygon(points);
|
43184 | var sorts = src_GeoUtil.sortPoints(polygon);
|
43185 | return sorts;
|
43186 | };
|
43187 |
|
43188 | s.getSelected = function () {
|
43189 | var shapes = s.svg.querySelectorAll('.' + s.params.shapeClass);
|
43190 | var selected = [];
|
43191 | for (var _iterator2 = shapes, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
|
43192 | var _ref2;
|
43193 |
|
43194 | if (_isArray2) {
|
43195 | if (_i2 >= _iterator2.length) break;
|
43196 | _ref2 = _iterator2[_i2++];
|
43197 | } else {
|
43198 | _i2 = _iterator2.next();
|
43199 | if (_i2.done) break;
|
43200 | _ref2 = _i2.value;
|
43201 | }
|
43202 |
|
43203 | var shape = _ref2;
|
43204 |
|
43205 |
|
43206 | var polygon = s.toPolygon(shape.getAttribute('points')).map(function (points) {
|
43207 | return points.map(function (point) {
|
43208 | return point / s.scale;
|
43209 | });
|
43210 | });
|
43211 | var params = shape.getAttribute('data-params') ? JSON.parse(shape.getAttribute('data-params')) : {};
|
43212 | selected.push(instance_extends({
|
43213 | polygon: polygon,
|
43214 | className: shape.getAttribute('style') || '',
|
43215 | class: shape.getAttribute('class') || '',
|
43216 | id: shape.id || ''
|
43217 | }, params));
|
43218 | }
|
43219 | return selected;
|
43220 | };
|
43221 | |
43222 |
|
43223 |
|
43224 |
|
43225 | s.isSupportTouch = 'ontouchstart' in window;
|
43226 | s.events = function (detach) {
|
43227 | var touchTarget = s.svg;
|
43228 | var action = detach ? 'removeEventListener' : 'addEventListener';
|
43229 |
|
43230 | if (s.isSupportTouch) {
|
43231 | touchTarget[action]('touchstart', s.onTouchStart, false);
|
43232 | touchTarget[action]('touchmove', s.onTouchMove, false);
|
43233 | touchTarget[action]('touchend', s.onTouchEnd, false);
|
43234 | touchTarget[action]('touchcancel', s.onTouchEnd, false);
|
43235 | } else {
|
43236 | touchTarget[action]('mousedown', s.onTouchStart, false);
|
43237 | touchTarget[action]('mousemove', s.onTouchMove, false);
|
43238 | touchTarget[action]('mouseup', s.onTouchEnd, false);
|
43239 | }
|
43240 |
|
43241 | document[action]('keydown', s.onKeyDown, false);
|
43242 |
|
43243 | touchTarget[action]('dblclick', s.onDblClick, false);
|
43244 |
|
43245 | s.stageInfo = touchTarget.getBoundingClientRect();
|
43246 | };
|
43247 |
|
43248 | s.attach = function (event) {
|
43249 | s.events();
|
43250 | };
|
43251 | s.detach = function (event) {
|
43252 | s.events(true);
|
43253 | };
|
43254 | function preventDefault(e) {
|
43255 | e.preventDefault();
|
43256 | }
|
43257 |
|
43258 | s.touches = {
|
43259 | target: null,
|
43260 | type: 'new',
|
43261 | startX: 0,
|
43262 | startY: 0,
|
43263 | currentX: 0,
|
43264 | currentY: 0,
|
43265 | endX: 0,
|
43266 | endY: 0,
|
43267 | diffX: 0,
|
43268 | diffY: 0
|
43269 | };
|
43270 | s.onTouchStart = function (e) {
|
43271 | s.container.addEventListener('touchmove', preventDefault, false);
|
43272 | s.touches.startX = s.isSupportTouch ? e.touches[0].clientX - s.stageInfo.left : e.offsetX;
|
43273 | s.touches.startY = s.isSupportTouch ? e.touches[0].clientY - s.stageInfo.top : e.offsetY;
|
43274 |
|
43275 |
|
43276 | s.moveEnd = false;
|
43277 |
|
43278 |
|
43279 | if (e.target.classList.contains(s.params.bulletClass)) {
|
43280 |
|
43281 | if (e.target.classList.contains(s.params.xMinYMinClass)) s.touches.type = 'xMinYMin';
|
43282 | else if (e.target.classList.contains(s.params.xMinYMidClass)) s.touches.type = 'xMinYMid';
|
43283 | else if (e.target.classList.contains(s.params.xMinYMaxClass)) s.touches.type = 'xMinYMax';
|
43284 | else if (e.target.classList.contains(s.params.xMidYMinClass)) s.touches.type = 'xMidYMin';
|
43285 | else if (e.target.classList.contains(s.params.xMidYMaxClass)) s.touches.type = 'xMidYMax';
|
43286 | else if (e.target.classList.contains(s.params.xMaxYMinClass)) s.touches.type = 'xMaxYMin';
|
43287 | else if (e.target.classList.contains(s.params.xMaxYMidClass)) s.touches.type = 'xMaxYMid';
|
43288 | else if (e.target.classList.contains(s.params.xMaxYMaxClass)) s.touches.type = 'xMaxYMax';
|
43289 | else s.touches.type = 'xMaxYMax';
|
43290 |
|
43291 |
|
43292 | var points = s.toPolygon(s.touches.target.getAttribute('points'));
|
43293 | s.touches.startX = points[1][0];
|
43294 | s.touches.startY = points[1][1];
|
43295 | } else if (e.target.classList.contains(s.params.shapeClass)) {
|
43296 |
|
43297 |
|
43298 | if (s.touches.target) s.activeShape(s.touches.target, false);
|
43299 |
|
43300 | s.touches.target = e.target;
|
43301 | s.activeShape(s.touches.target);
|
43302 |
|
43303 | s.touches.type = 'move';
|
43304 | } else if (e.target.classList.contains(s.params.svgClass)) {
|
43305 |
|
43306 |
|
43307 | if (s.touches.target) s.activeShape(s.touches.target, false);
|
43308 |
|
43309 |
|
43310 | var _s$params$shapeAttrib = s.params.shapeAttributes,
|
43311 | polygon = _s$params$shapeAttrib.polygon,
|
43312 | id = _s$params$shapeAttrib.id,
|
43313 | className = _s$params$shapeAttrib.className,
|
43314 | style = _s$params$shapeAttrib.style,
|
43315 | others = instance_objectWithoutProperties(_s$params$shapeAttrib, ['polygon', 'id', 'className', 'style']);
|
43316 |
|
43317 | s.svg = s.createShape(s.svg, 'polygon', {
|
43318 | 'points': s.touches.startX + ',' + s.touches.startY + ',' + (s.touches.startX + 1) + ',' + s.touches.startY + ',' + (s.touches.startX + 1) + ',' + (s.touches.startY + 1) + ',' + s.touches.startX + ',' + (s.touches.startY + 1),
|
43319 | 'data-scale-type': s.params.isScale ? '1' : '0',
|
43320 | 'id': id || '',
|
43321 | 'class': s.params.shapeClass + (className ? ' ' + className : ''),
|
43322 | 'style': style || '',
|
43323 | 'data-params': JSON.stringify(instance_extends({}, others))
|
43324 | });
|
43325 | s.touches.target = s.svg.shape;
|
43326 | s.container.appendChild(s.svg);
|
43327 | s.activeShape(s.touches.target);
|
43328 |
|
43329 | s.touches.type = 'new';
|
43330 | } else {
|
43331 |
|
43332 | if (s.touches.target) s.activeShape(s.touches.target, false);
|
43333 | }
|
43334 | };
|
43335 | s.onTouchMove = function (e) {
|
43336 | if (s.moveEnd || !s.touches.target) return;
|
43337 | s.touches.currentX = s.isSupportTouch ? e.touches[0].clientX - s.stageInfo.left : e.offsetX;
|
43338 | s.touches.currentY = s.isSupportTouch ? e.touches[0].clientY - s.stageInfo.top : e.offsetY;
|
43339 | s.touches.diffX = s.touches.startX - s.touches.currentX;
|
43340 | s.touches.diffY = s.touches.startY - s.touches.currentY;
|
43341 |
|
43342 | if (s.bulletsShow) s.hideBullets();
|
43343 | if (s.touches.type === 'move') {
|
43344 |
|
43345 |
|
43346 | if (!s.touches.moveDiffX || !s.touches.moveDiffY) {
|
43347 | var points = s.touches.target.getAttribute('points').split(',');
|
43348 | s.touches.moveDiffX = Number(points[2] || 0) - s.touches.currentX;
|
43349 | s.touches.moveDiffY = Number(points[3] || 0) - s.touches.currentY;
|
43350 | }
|
43351 | s.moveShape(s.touches.target, s.touches.currentX, s.touches.currentY, s.touches.moveDiffX, s.touches.moveDiffY);
|
43352 | } else {
|
43353 |
|
43354 | s.scaleShape(s.touches.target, s.touches.currentX, s.touches.currentY, s.touches.type);
|
43355 | }
|
43356 | };
|
43357 | s.onTouchEnd = function (e) {
|
43358 | if (s.params.stopPropagation) e.stopPropagation();
|
43359 | s.touches.endX = s.isSupportTouch ? e.changedTouches[0].clientX - s.stageInfo.left : e.offsetX;
|
43360 | s.touches.endY = s.isSupportTouch ? e.changedTouches[0].clientY - s.stageInfo.top : e.offsetY;
|
43361 |
|
43362 |
|
43363 | if (s.touches.moveDiffX) s.touches.moveDiffX = null;
|
43364 | if (s.touches.moveDiffY) s.touches.moveDiffY = null;
|
43365 |
|
43366 |
|
43367 | if (s.touches.target) {
|
43368 | var points = s.sortPoints(s.touches.target.getAttribute('points')).join(',');
|
43369 | s.touches.target.setAttribute('points', points);
|
43370 | }
|
43371 |
|
43372 |
|
43373 | var bbox = s.touches.target.getBBox();
|
43374 | if (s.touches.type === 'new' && (bbox.height < 10 || bbox.width < 10)) {
|
43375 | s.touches.target.parentNode.removeChild(s.touches.target);
|
43376 | s.touches.target = null;
|
43377 |
|
43378 | if (Math.abs(s.touches.startX - s.touches.endX) < 6 && Math.abs(s.touches.startY - s.touches.endY) < 6) {
|
43379 | s.event = e;
|
43380 | if (s.params.onClick) s.params.onClick(s);
|
43381 | }
|
43382 | } else {
|
43383 |
|
43384 | s.editShape(s.touches.target);
|
43385 | }
|
43386 |
|
43387 | s.moveEnd = true;
|
43388 | };
|
43389 |
|
43390 | s.onDblClick = function (e) {
|
43391 | if (e.target.classList.contains(s.params.shapeClass) && e.target.classList.contains(s.params.shapeActiveClass)) {
|
43392 | s.removeShape(e.target);
|
43393 | }
|
43394 | };
|
43395 |
|
43396 | s.onKeyDown = function (e) {
|
43397 | if (!s.touches.target) return;
|
43398 | if (e.keyCode === 8) {
|
43399 | s.removeShape(s.touches.target);
|
43400 | }
|
43401 | };
|
43402 | |
43403 |
|
43404 |
|
43405 |
|
43406 | s.init = function () {
|
43407 | s.update();
|
43408 | };
|
43409 |
|
43410 | s.init();
|
43411 | return s;
|
43412 | };
|
43413 |
|
43414 | var Vott_instance = (instance_Vott);
|
43415 |
|
43416 | var Vott_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; };
|
43417 |
|
43418 | var Vott_class, Vott_temp;
|
43419 |
|
43420 | function Vott_objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
43421 |
|
43422 | function Vott_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
43423 |
|
43424 | function Vott_possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
43425 |
|
43426 | function Vott_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
43427 |
|
43428 |
|
43429 |
|
43430 |
|
43431 |
|
43432 |
|
43433 | var Vott_Vott = (Vott_temp = Vott_class = function (_Component) {
|
43434 | Vott_inherits(Vott, _Component);
|
43435 |
|
43436 | function Vott(props) {
|
43437 | Vott_classCallCheck(this, Vott);
|
43438 |
|
43439 | var _this = Vott_possibleConstructorReturn(this, _Component.call(this, props));
|
43440 |
|
43441 | _this.instance = function () {
|
43442 | var _this$props = _this.props,
|
43443 | data = _this$props.data,
|
43444 | readOnly = _this$props.readOnly,
|
43445 | src = _this$props.src,
|
43446 | params = _this$props.params,
|
43447 | preview = _this$props.preview,
|
43448 | others = Vott_objectWithoutProperties(_this$props, ['data', 'readOnly', 'src', 'params', 'preview']);
|
43449 |
|
43450 | var instance = new Vott_instance(_this.$el, Vott_extends({
|
43451 | readOnly: readOnly,
|
43452 | data: data,
|
43453 | src: src,
|
43454 | onSuccess: _this.onLoad
|
43455 | }, params));
|
43456 | _this.instance = instance;
|
43457 | };
|
43458 |
|
43459 | _this.onLoad = function () {
|
43460 | _this.load = 1;
|
43461 | };
|
43462 |
|
43463 | _this.onClick = function () {
|
43464 | _this.preview();
|
43465 | };
|
43466 |
|
43467 | _this.preview = function () {
|
43468 | if (!_this.props.readOnly || !_this.props.preview || !_this.load) return;
|
43469 | var svg = _this.instance.svg;
|
43470 | var previewHTML = '<div class="preview-layer">' + svg.outerHTML + '</div>';
|
43471 | bridgeBrowser.previewImage({ urls: [_this.props.src], layerHTML: previewHTML, onSuccess: function onSuccess(s) {
|
43472 | var layer = s.container.querySelector('.preview-layer');
|
43473 | svg = s.container.querySelector('.vott-svg');
|
43474 | svg.style.backgroundImage = 'initial';
|
43475 | var width = svg.style.width.replace('px', '');
|
43476 | var height = svg.style.height.replace('px', '');
|
43477 |
|
43478 | var scale = 1;
|
43479 | if (width > height) {
|
43480 |
|
43481 | scale = layer.clientWidth / width;
|
43482 | } else {
|
43483 |
|
43484 | scale = layer.clientHeight / height;
|
43485 | }
|
43486 | svg.style.WebkitTransform = 'scale(' + scale + ') translate(-50%,-50%)';
|
43487 | svg.style.WebkitTransformOrigin = '0 0';
|
43488 | } });
|
43489 | };
|
43490 |
|
43491 | return _this;
|
43492 | }
|
43493 |
|
43494 |
|
43495 |
|
43496 |
|
43497 |
|
43498 |
|
43499 |
|
43500 |
|
43501 |
|
43502 |
|
43503 |
|
43504 |
|
43505 |
|
43506 |
|
43507 |
|
43508 |
|
43509 |
|
43510 | Vott.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
|
43511 | if (this.instance) {
|
43512 | if (prevProps.params !== this.props.params) {
|
43513 | this.instance.setParams(this.props.params);
|
43514 | }
|
43515 | if (prevProps.readOnly !== this.props.readOnly) {
|
43516 | this.instance.setReadOnly(this.props.readOnly);
|
43517 | }
|
43518 | if (prevProps.src !== this.props.src) {
|
43519 | this.instance.setParams({ src: this.props.src });
|
43520 | this.load = 0;
|
43521 | this.instance.update();
|
43522 | }
|
43523 | if (prevProps.data !== this.props.data) {
|
43524 | this.instance.setParams({ data: this.props.data });
|
43525 | this.load = 0;
|
43526 | this.instance.update();
|
43527 | }
|
43528 | }
|
43529 | };
|
43530 |
|
43531 | Vott.prototype.componentDidMount = function componentDidMount() {
|
43532 | this.instance();
|
43533 | };
|
43534 |
|
43535 | Vott.prototype.render = function render() {
|
43536 | var _this2 = this;
|
43537 |
|
43538 | var _props = this.props,
|
43539 | data = _props.data,
|
43540 | readOnly = _props.readOnly,
|
43541 | src = _props.src,
|
43542 | params = _props.params,
|
43543 | preview = _props.preview,
|
43544 | others = Vott_objectWithoutProperties(_props, ['data', 'readOnly', 'src', 'params', 'preview']);
|
43545 |
|
43546 | return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
43547 | 'div',
|
43548 | Vott_extends({ className: 'vott-container' }, others, { ref: function ref(el) {
|
43549 | _this2.$el = el;
|
43550 | } }),
|
43551 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('svg', { className: 'vott-svg', preserveAspectRatio: 'none', onClick: this.onClick }),
|
43552 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
43553 | 'div',
|
43554 | { className: 'vott-loading active' },
|
43555 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'vott-loading-icon' })
|
43556 | ),
|
43557 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
43558 | 'div',
|
43559 | { className: 'vott-error' },
|
43560 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement('div', { className: 'vott-error-icon' }),
|
43561 | external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
43562 | 'div',
|
43563 | { className: 'vott-error-caption' },
|
43564 | window._seeds_lang['hint_image_failed_to_load'] || '图片加载失败'
|
43565 | )
|
43566 | )
|
43567 | );
|
43568 | };
|
43569 |
|
43570 | return Vott;
|
43571 | }(external_root_React_commonjs2_react_commonjs_react_amd_react_["Component"]), Vott_class.propTypes = {
|
43572 | data: prop_types_default.a.array,
|
43573 | readOnly: prop_types_default.a.bool,
|
43574 | src: prop_types_default.a.string,
|
43575 | params: prop_types_default.a.object,
|
43576 | preview: prop_types_default.a.bool
|
43577 | }, Vott_class.defaultProps = {}, Vott_temp);
|
43578 |
|
43579 |
|
43580 |
|
43581 |
|
43582 | var src_Vott = (Vott_Vott);
|
43583 |
|
43584 |
|
43585 | var EditUtil = {
|
43586 |
|
43587 | selection: function selection() {
|
43588 | return document.getSelection();
|
43589 | },
|
43590 |
|
43591 | getTxtCusorPos: function getTxtCusorPos(txt) {
|
43592 | var cusorPos = -1;
|
43593 |
|
43594 | if (txt.selectionStart) {
|
43595 |
|
43596 | cusorPos = txt.selectionStart;
|
43597 | return cusorPos;
|
43598 | }
|
43599 |
|
43600 | if (document.selection && document.selection.createRange) {
|
43601 | var range = document.selection.createRange();
|
43602 | range.moveStart('character', -txt.value.length);
|
43603 | cusorPos = range.text.length;
|
43604 | return cusorPos;
|
43605 | }
|
43606 | },
|
43607 |
|
43608 | getDivCusorPos: function getDivCusorPos() {
|
43609 | var cusorPos = 0;
|
43610 |
|
43611 | if (window.getSelection) {
|
43612 | var selection = window.getSelection();
|
43613 |
|
43614 |
|
43615 |
|
43616 |
|
43617 |
|
43618 |
|
43619 |
|
43620 | cusorPos = selection.anchorOffset;
|
43621 | return cusorPos;
|
43622 | }
|
43623 |
|
43624 | if (document.selection && document.selection.createRange) {
|
43625 | var range = document.selection.createRange();
|
43626 | var srcele = range.parentElement();
|
43627 | var copy = document.body.createTextRange();
|
43628 | copy.moveToElementText(srcele);
|
43629 | for (cusorPos = 0; copy.compareEndPoints('StartToStart', range) < 0; cusorPos++) {
|
43630 | copy.moveStart('character', 1);
|
43631 | }
|
43632 | return cusorPos;
|
43633 | }
|
43634 | },
|
43635 |
|
43636 | selectionPos: function selectionPos(classname) {
|
43637 | var selection = window.getSelection();
|
43638 | var cursorOffset = 0;
|
43639 | document.onselectionchange = function (e) {
|
43640 | if (e.target.activeElement.className === classname) {
|
43641 | cursorOffset = selection.anchorOffset;
|
43642 | }
|
43643 | };
|
43644 | return cursorOffset;
|
43645 | },
|
43646 | |
43647 |
|
43648 |
|
43649 |
|
43650 |
|
43651 |
|
43652 | isenable: function isenable(commandName) {
|
43653 | return document.queryCommandEnabled(commandName);
|
43654 | },
|
43655 | backgroundcolor: function backgroundcolor(color) {
|
43656 | document.execCommand('backcolor', false, color);
|
43657 | },
|
43658 | bold: function bold() {
|
43659 | document.execCommand('bold', false, null);
|
43660 | },
|
43661 | italic: function italic() {
|
43662 | document.execCommand('italic', false, null);
|
43663 | },
|
43664 | underline: function underline() {
|
43665 | document.execCommand('underline', false, null);
|
43666 | },
|
43667 | copy: function copy() {
|
43668 | document.execCommand('copy', false, null);
|
43669 | },
|
43670 | selectall: function selectall() {
|
43671 | document.execCommand('selectall', false, null);
|
43672 | },
|
43673 | cut: function cut() {
|
43674 | document.execCommand('cut', false, null);
|
43675 | },
|
43676 | paste: function paste() {
|
43677 | document.execCommand('paste', false, null);
|
43678 | },
|
43679 | del: function del() {
|
43680 | document.execCommand('delete', false, null);
|
43681 | },
|
43682 | link: function link(url) {
|
43683 | document.execCommand('createlink', false, url);
|
43684 | },
|
43685 | unlink: function unlink() {
|
43686 | document.execCommand('unlink', false, null);
|
43687 | },
|
43688 | fontname: function fontname(fontName) {
|
43689 | document.execCommand('fontname', false, fontName);
|
43690 | },
|
43691 | fontsize: function fontsize(fontSize) {
|
43692 | if (fontSize) {
|
43693 | document.execCommand('fontsize', false, fontSize);
|
43694 | return;
|
43695 | }
|
43696 | return document.queryCommandValue('fontsize');
|
43697 | },
|
43698 | fontcolor: function fontcolor(fontColor) {
|
43699 | document.execCommand('forecolor', false, fontColor);
|
43700 | },
|
43701 | format: function format(tag) {
|
43702 | document.execCommand('formatblock', false, tag);
|
43703 | },
|
43704 | unformat: function unformat() {
|
43705 | document.execCommand('removeformat', false, null);
|
43706 | },
|
43707 | indent: function indent() {
|
43708 | document.execCommand('indent', false, null);
|
43709 | },
|
43710 | outdent: function outdent() {
|
43711 | document.execCommand('outdent', false, null);
|
43712 | },
|
43713 | hr: function hr() {
|
43714 | document.execCommand('inserthorzizontalrule', false, null);
|
43715 | },
|
43716 | img: function img(url) {
|
43717 | document.execCommand('insertimage', false, url);
|
43718 | },
|
43719 | ol: function ol() {
|
43720 | document.execCommand('insertorderedlist', false, null);
|
43721 | },
|
43722 | ul: function ul() {
|
43723 | document.execCommand('insertunorderedlist', false, null);
|
43724 | },
|
43725 | p: function p() {
|
43726 | document.execCommand('insertparagraph', false, null);
|
43727 | },
|
43728 | center: function center() {
|
43729 | document.execCommand('justifycenter', false, null);
|
43730 | },
|
43731 | left: function left() {
|
43732 | document.execCommand('justifyleft', false, null);
|
43733 | },
|
43734 | right: function right() {
|
43735 | document.execCommand('justifyright', false, null);
|
43736 | },
|
43737 |
|
43738 | setCaretPosition: function setCaretPosition(elem, caretPos) {
|
43739 | if (elem !== null) {
|
43740 | if (elem.createTextRange) {
|
43741 | var range = elem.createTextRange();
|
43742 | range.move('character', caretPos);
|
43743 | range.select();
|
43744 | } else {
|
43745 | if (elem.selectionStart) {
|
43746 | elem.focus();
|
43747 | elem.setSelectionRange(caretPos, caretPos);
|
43748 | } else {
|
43749 | elem.focus();
|
43750 | }
|
43751 | }
|
43752 | }
|
43753 | },
|
43754 | isEnter: function isEnter() {
|
43755 |
|
43756 | window.addEventListener('keydown', function (e) {
|
43757 | var keynum = e.which || e.keyCode;
|
43758 | if (keynum === '13') {
|
43759 | return true;
|
43760 | }
|
43761 | return false;
|
43762 | }, false);
|
43763 | }
|
43764 | };
|
43765 |
|
43766 | var EditUtil_EditUtil = (EditUtil);
|
43767 |
|
43768 |
|
43769 |
|
43770 | var src_EditUtil = (EditUtil_EditUtil);
|
43771 |
|
43772 |
|
43773 | var EventUtil = function () {
|
43774 | |
43775 |
|
43776 |
|
43777 |
|
43778 |
|
43779 |
|
43780 |
|
43781 |
|
43782 | var _countClickEventHandler = function _countClickEventHandler(e) {
|
43783 |
|
43784 | var target = e.currentTarget;
|
43785 |
|
43786 | target.prevCount += 1;
|
43787 | e.count = target.prevCount;
|
43788 | e.code = '0';
|
43789 |
|
43790 |
|
43791 | if (target.prevCount === 1) {
|
43792 | target.prevTime = new Date().getTime();
|
43793 | }
|
43794 |
|
43795 |
|
43796 | if (target.prevCount >= target.count) {
|
43797 |
|
43798 | if (new Date().getTime() - target.prevTime <= target.timeout) {
|
43799 | e.code = '1';
|
43800 | }
|
43801 | target.prevCount = 0;
|
43802 | }
|
43803 |
|
43804 | target.handler(e);
|
43805 | };
|
43806 | var _countClickEvent = function _countClickEvent(element, type, handler, isDetach, params) {
|
43807 |
|
43808 | element.prevCount = 0;
|
43809 | element.prevTime = new Date().getTime();
|
43810 | element.count = params && params.count ? params.count : 10;
|
43811 | element.timeout = params && params.timeout ? params.timeout : 5000;
|
43812 | element.handler = handler;
|
43813 |
|
43814 | function attach() {
|
43815 | element.addEventListener('click', _countClickEventHandler, false);
|
43816 | }
|
43817 | function detach() {
|
43818 | element.removeEventListener('click', _countClickEventHandler, false);
|
43819 | }
|
43820 | if (isDetach) {
|
43821 | detach();
|
43822 | } else {
|
43823 | attach();
|
43824 | }
|
43825 | };
|
43826 | |
43827 |
|
43828 |
|
43829 |
|
43830 |
|
43831 |
|
43832 |
|
43833 | var _touchEvent = function _touchEvent(element, type, handler, isDetach) {
|
43834 | var params = {
|
43835 | threshold: 0
|
43836 | |
43837 |
|
43838 |
|
43839 | };var touches = {
|
43840 | direction: 0,
|
43841 | vertical: 0,
|
43842 | horizontal: 0,
|
43843 | startX: 0,
|
43844 | startY: 0,
|
43845 | endX: 0,
|
43846 | endY: 0,
|
43847 | diffX: 0,
|
43848 | diffY: 0
|
43849 | |
43850 |
|
43851 |
|
43852 | };var onTouchStart = function onTouchStart(e) {
|
43853 | touches.startX = e.touches[0].clientX;
|
43854 | touches.startY = e.touches[0].clientY;
|
43855 | };
|
43856 | var onTouchEnd = function onTouchEnd(e) {
|
43857 | var eventName = '';
|
43858 | touches.endX = e.changedTouches[0].clientX;
|
43859 | touches.endY = e.changedTouches[0].clientY;
|
43860 | touches.diffX = touches.startX - touches.endX;
|
43861 | touches.diffY = touches.startY - touches.endY;
|
43862 |
|
43863 | if (Math.abs(touches.diffX) < 6 && Math.abs(touches.diffY) < 6) {
|
43864 | eventName = 'tap';
|
43865 | }
|
43866 |
|
43867 |
|
43868 | if (touches.direction === 0) {
|
43869 |
|
43870 | touches.direction = Math.abs(touches.diffX) > Math.abs(touches.diffY) ? 1 : -1;
|
43871 | }
|
43872 | if (touches.direction === -1) {
|
43873 |
|
43874 | touches.vertical = touches.diffY < 0 ? 1 : -1;
|
43875 | }
|
43876 | if (touches.direction === 1) {
|
43877 |
|
43878 | touches.horizontal = touches.diffX < 0 ? 1 : -1;
|
43879 | }
|
43880 |
|
43881 |
|
43882 | if (touches.vertical === -1) {
|
43883 |
|
43884 | if (Math.abs(touches.diffY) > params.threshold) {
|
43885 | eventName = 'swipeup';
|
43886 | }
|
43887 | } else if (touches.vertical === 1) {
|
43888 |
|
43889 | if (Math.abs(touches.diffY) > params.threshold) {
|
43890 | eventName = 'swipedown';
|
43891 | }
|
43892 | } else if (touches.horizontal === -1) {
|
43893 |
|
43894 | if (Math.abs(touches.diffY) > params.threshold) {
|
43895 | eventName = 'swipeleft';
|
43896 | }
|
43897 | } else if (touches.horizontal === 1) {
|
43898 |
|
43899 | if (Math.abs(touches.diffY) > params.threshold) {
|
43900 | eventName = 'swiperight';
|
43901 | }
|
43902 | }
|
43903 |
|
43904 | touches.direction = 0;
|
43905 | touches.vertical = 0;
|
43906 | touches.horizontal = 0;
|
43907 |
|
43908 | for (var n in element.touchEvents) {
|
43909 | if (eventName === n) element.touchEvents[n](e);
|
43910 | }
|
43911 | };
|
43912 | |
43913 |
|
43914 |
|
43915 |
|
43916 | var attach = function attach() {
|
43917 | if (Object.keys(element.touchEvents || {}).length === 0) {
|
43918 | element.touchEvents = {};
|
43919 | element['addEventListener']('touchstart', onTouchStart, false);
|
43920 | element['addEventListener']('touchend', onTouchEnd, false);
|
43921 | }
|
43922 | element.touchEvents[type] = handler;
|
43923 | };
|
43924 |
|
43925 | var detach = function detach() {
|
43926 | if (element.touchEvents) delete element.touchEvents[type];
|
43927 | if (Object.keys(element.touchEvents || {}).length === 0) {
|
43928 | element['removeEventListener']('touchstart', onTouchStart, false);
|
43929 | element['removeEventListener']('touchend', onTouchEnd, false);
|
43930 | }
|
43931 | };
|
43932 |
|
43933 | if (isDetach) {
|
43934 | detach();
|
43935 | } else {
|
43936 | attach();
|
43937 | }
|
43938 | };
|
43939 | |
43940 |
|
43941 |
|
43942 |
|
43943 |
|
43944 |
|
43945 |
|
43946 | var _shake_handler = null;
|
43947 | var _shake_threshold = 3000;
|
43948 | var _shake_lastUpdate = 0;
|
43949 | var _shake_curShakeX = 0;
|
43950 | var _shake_curShakeY = 0;
|
43951 | var _shake_curShakeZ = 0;
|
43952 | var _shake_lastShakeX = 0;
|
43953 | var _shake_lastShakeY = 0;
|
43954 | var _shake_lastShakeZ = 0;
|
43955 | var _shakeEventHandler = function _shakeEventHandler(e) {
|
43956 | var acceleration = e.accelerationIncludingGravity;
|
43957 | var curTime = new Date().getTime();
|
43958 | if (curTime - _shake_lastUpdate > 100) {
|
43959 | var diffTime = curTime - _shake_lastUpdate;
|
43960 | _shake_lastUpdate = curTime;
|
43961 | _shake_curShakeX = acceleration.x;
|
43962 | _shake_curShakeY = acceleration.y;
|
43963 | _shake_curShakeZ = acceleration.z;
|
43964 | var speed = Math.abs(_shake_curShakeX + _shake_curShakeY + _shake_curShakeZ - _shake_lastShakeX - _shake_lastShakeY - _shake_lastShakeZ) / diffTime * 10000;
|
43965 | if (speed > _shake_threshold) {
|
43966 | e.speed = speed;
|
43967 | if (_shake_handler) _shake_handler(e);
|
43968 | }
|
43969 | _shake_lastShakeX = _shake_curShakeX;
|
43970 | _shake_lastShakeY = _shake_curShakeY;
|
43971 | _shake_lastShakeZ = _shake_curShakeZ;
|
43972 | }
|
43973 | };
|
43974 | var _shakeEvent = function _shakeEvent(element, type, handler, isDetach) {
|
43975 | _shake_handler = handler;
|
43976 | function attach() {
|
43977 | window.addEventListener('devicemotion', _shakeEventHandler, false);
|
43978 | }
|
43979 | function detach() {
|
43980 | window.removeEventListener('devicemotion', _shakeEventHandler, false);
|
43981 | }
|
43982 |
|
43983 | if (isDetach) {
|
43984 | detach();
|
43985 | } else {
|
43986 | attach();
|
43987 | }
|
43988 | };
|
43989 | |
43990 |
|
43991 |
|
43992 | return {
|
43993 | addHandler: function addHandler(element, type, handler, params) {
|
43994 |
|
43995 |
|
43996 | if (type === 'countclick') {
|
43997 | _countClickEvent(element, 'countclick', handler, false, params);
|
43998 | return;
|
43999 | }
|
44000 |
|
44001 | var isSupportTouch = 'ontouchstart' in window;
|
44002 | if (!isSupportTouch) {
|
44003 | if (type === 'touchstart') type = 'mousedown';
|
44004 | if (type === 'touchmove') type = 'mousemove';
|
44005 | if (type === 'touchend') type = 'mouseup';
|
44006 | if (type === 'touchcancel') type = 'mouseup';
|
44007 | if (type === 'tap') type = 'click';
|
44008 | } else {
|
44009 |
|
44010 | if (type === 'tap' || type === 'swipeleft' || type === 'swiperight' || type === 'swipedown' || type === 'swipeup') {
|
44011 | _touchEvent(element, type, handler);
|
44012 | return;
|
44013 | }
|
44014 | }
|
44015 |
|
44016 | if (type === 'shake') {
|
44017 | if (window.DeviceMotionEvent) {
|
44018 | _shakeEvent(element, 'shake', handler);
|
44019 | } else {
|
44020 | console.warn('此设备不支持重力感应');
|
44021 | }
|
44022 | return;
|
44023 | }
|
44024 |
|
44025 | if (element.addEventListener) {
|
44026 | element.addEventListener(type, handler, false);
|
44027 | } else if (element.attachEvent) {
|
44028 | element.attachEvent('on' + type, handler);
|
44029 | } else {
|
44030 | element['on' + type] = handler;
|
44031 | }
|
44032 | },
|
44033 | removeHandler: function removeHandler(element, type, handler) {
|
44034 |
|
44035 | if (type === 'countclick') {
|
44036 | _countClickEvent(element, 'countclick', null, true);
|
44037 | return;
|
44038 | }
|
44039 |
|
44040 | var isSupportTouch = 'ontouchstart' in window;
|
44041 | if (!isSupportTouch) {
|
44042 | if (type === 'touchstart') type = 'mousedown';
|
44043 | if (type === 'touchmove') type = 'mousemove';
|
44044 | if (type === 'touchend') type = 'mouseup';
|
44045 | if (type === 'touchcancel') type = 'mouseup';
|
44046 | if (type === 'tap') type = 'click';
|
44047 | } else {
|
44048 |
|
44049 | if (type === 'tap' || type === 'swipeleft' || type === 'swiperight' || type === 'swipedown' || type === 'swipeup') {
|
44050 | _touchEvent(element, type, handler, true);
|
44051 | return;
|
44052 | }
|
44053 | }
|
44054 |
|
44055 | if (type === 'shake') {
|
44056 | if (window.DeviceMotionEvent) {
|
44057 | _shakeEvent(element, 'shake', handler, true);
|
44058 | } else {
|
44059 | console.warn('此设备不支持重力感应');
|
44060 | }
|
44061 | return;
|
44062 | }
|
44063 |
|
44064 | if (element.removeEventListener) {
|
44065 | element.removeEventListener(type, handler, false);
|
44066 | } else if (element.detachEvent) {
|
44067 | element.detachEvent('on' + type, handler);
|
44068 | } else {
|
44069 | element['on' + type] = null;
|
44070 | }
|
44071 | },
|
44072 | preventDefault: function preventDefault(e) {
|
44073 | if (e.preventDefault) {
|
44074 | e.preventDefault();
|
44075 | } else {
|
44076 | e.returnValue = false;
|
44077 | }
|
44078 | },
|
44079 | stopPropagation: function stopPropagation(e) {
|
44080 | if (e.stopPropagation) {
|
44081 | e.stopPropagation();
|
44082 | } else {
|
44083 | e.cancelBubble = true;
|
44084 | }
|
44085 | },
|
44086 | event: function event(e) {
|
44087 | return e || window.e;
|
44088 | },
|
44089 | type: function type(e) {
|
44090 | return e.type;
|
44091 | },
|
44092 | target: function target(e) {
|
44093 | return e.target || e.srcElement;
|
44094 | }
|
44095 | };
|
44096 | }();
|
44097 |
|
44098 | var EventUtil_EventUtil = (EventUtil);
|
44099 |
|
44100 |
|
44101 |
|
44102 | var src_EventUtil = (EventUtil_EventUtil);
|
44103 |
|
44104 | var FastClick = __webpack_require__(14);
|
44105 |
|
44106 |
|
44107 |
|
44108 |
|
44109 | var src_FastClick = (FastClick["a" ]);
|
44110 |
|
44111 |
|
44112 | var Form = function Form(container, params) {
|
44113 | |
44114 |
|
44115 |
|
44116 | var defaults = {
|
44117 | ignoreClass: null
|
44118 | |
44119 |
|
44120 |
|
44121 | };
|
44122 | params = params || {};
|
44123 | for (var def in defaults) {
|
44124 | if (params[def] === undefined) {
|
44125 | params[def] = defaults[def];
|
44126 | }
|
44127 | }
|
44128 |
|
44129 | var s = this;
|
44130 |
|
44131 | s.params = params;
|
44132 |
|
44133 | s.container = typeof container === 'string' ? document.querySelector(container) : container;
|
44134 | if (!s.container) {
|
44135 | console.log('SeedsUI Error:未找到Form表单的DOM对象,请检查传入参数是否正确');
|
44136 | return;
|
44137 | }
|
44138 |
|
44139 | s.fields = [];
|
44140 | s.update = function () {
|
44141 | s.fields = [];
|
44142 |
|
44143 | for (var i = 0; i < s.container.elements.length; i++) {
|
44144 | var field = s.container.elements[i];
|
44145 |
|
44146 | if (!field.type || !field.name) {
|
44147 | continue;
|
44148 | }
|
44149 |
|
44150 | if (field.type === 'button' || field.type === 'reset' || field.type === 'submit') {
|
44151 | continue;
|
44152 | }
|
44153 |
|
44154 | if (field.type === 'radio' || field.type === 'checkbox') {
|
44155 | if (!field.checked) {
|
44156 | continue;
|
44157 | }
|
44158 | }
|
44159 | if (s.params.ignoreClass && field.classList.contains(s.params.ignoreClass)) {
|
44160 | continue;
|
44161 | }
|
44162 |
|
44163 | s.fields.push(field);
|
44164 | }
|
44165 | };
|
44166 | s.update();
|
44167 |
|
44168 | |
44169 |
|
44170 |
|
44171 |
|
44172 | s.setFields = function (fields) {
|
44173 | s.fields = fields;
|
44174 | };
|
44175 |
|
44176 | s.pushField = function (field) {
|
44177 | s.fields.push(field);
|
44178 | };
|
44179 |
|
44180 | s.selected = {};
|
44181 | s.selectedString = [];
|
44182 |
|
44183 | s.addSelected = function (field) {
|
44184 |
|
44185 | s.selectedString.push(field.name + '=' + field.value);
|
44186 |
|
44187 | if (s.selected[field.name]) {
|
44188 | s.selected[field.name].push(field.value);
|
44189 | } else {
|
44190 | s.selected[field.name] = [];
|
44191 | s.selected[field.name].push(field.value);
|
44192 | }
|
44193 | };
|
44194 |
|
44195 | s.serializeJson = function () {
|
44196 | var field = null;
|
44197 | for (var i = 0; i < s.fields.length; i++) {
|
44198 | field = s.fields[i];
|
44199 |
|
44200 | if (field.type === 'select-one' || field.type === 'select-multiple') {
|
44201 | for (var j = 0; j < field.options.length; j++) {
|
44202 | var option = field.options[j];
|
44203 | if (option.selected) {
|
44204 | s.addSelected(field);
|
44205 | }
|
44206 | }
|
44207 | } else {
|
44208 | s.addSelected(field);
|
44209 | }
|
44210 | }
|
44211 | return s.selected;
|
44212 | };
|
44213 |
|
44214 | s.serialize = function () {
|
44215 |
|
44216 | return s.selectedString.join('&');
|
44217 | };
|
44218 |
|
44219 | if (s.params.onSubmit) {
|
44220 | this.container.addEventListener('submit', function (e) {
|
44221 | s.params.onSubmit(e, s.selected);
|
44222 | }, false);
|
44223 | }
|
44224 | };
|
44225 |
|
44226 | var Form_Form = (Form);
|
44227 |
|
44228 |
|
44229 |
|
44230 | var src_Form = (Form_Form);
|
44231 |
|
44232 |
|
44233 | var History = function History(params) {
|
44234 | |
44235 |
|
44236 |
|
44237 | var defaults = {
|
44238 | enableStorage: true,
|
44239 | historyKey: 'my_history',
|
44240 | useHash: true
|
44241 | |
44242 |
|
44243 |
|
44244 |
|
44245 |
|
44246 | };
|
44247 |
|
44248 | params = params || {};
|
44249 | for (var def in defaults) {
|
44250 | if (params[def] === undefined) {
|
44251 | params[def] = defaults[def];
|
44252 | }
|
44253 | }
|
44254 | var s = this;
|
44255 | s.params = params;
|
44256 |
|
44257 | s.list = [];
|
44258 | s.discardList = [];
|
44259 | s.currentHash = '';
|
44260 | s.prevHash = '';
|
44261 |
|
44262 |
|
44263 | var storage = window.sessionStorage;
|
44264 | var storageHistory = storage.getItem(s.params.historyKey);
|
44265 | if (s.params.enableStorage && storageHistory) s.list = storageHistory.split(',');
|
44266 |
|
44267 | |
44268 |
|
44269 |
|
44270 | s.saveList = function () {
|
44271 | if (s.params.enableStorage) storage.setItem(s.params.historyKey, s.list);
|
44272 | };
|
44273 | s.clearList = function () {
|
44274 | s.list = [];
|
44275 | storage.removeItem(s.params.historyKey);
|
44276 | };
|
44277 |
|
44278 | s.add = function (hash, enableHistory) {
|
44279 | s.list.push(hash);
|
44280 |
|
44281 | s.saveList();
|
44282 |
|
44283 | if (enableHistory) {
|
44284 | try {
|
44285 | window.history.pushState({
|
44286 | href: hash
|
44287 | }, document.title, hash);
|
44288 | } catch (err) {
|
44289 | console.log('SeedsUI Error:添加history失败');
|
44290 | }
|
44291 | }
|
44292 | };
|
44293 | s.replace = function (hash, enableHistory) {
|
44294 | s.prevHash = s.list.pop();
|
44295 | s.list.push(hash);
|
44296 |
|
44297 | s.saveList();
|
44298 |
|
44299 | if (enableHistory) {
|
44300 | try {
|
44301 | window.history.replaceState({
|
44302 | href: hash
|
44303 | }, document.title, hash);
|
44304 | } catch (err) {
|
44305 | console.log('SeedsUI Error:替换history失败');
|
44306 | }
|
44307 | }
|
44308 | };
|
44309 |
|
44310 | s.remove = function (hash) {
|
44311 | s.list = s.list.filter(function (n) {
|
44312 | return n !== hash;
|
44313 | });
|
44314 |
|
44315 | s.saveList();
|
44316 | };
|
44317 |
|
44318 | |
44319 |
|
44320 |
|
44321 | s.events = function (detach) {
|
44322 | var action = detach ? 'removeEventListener' : 'addEventListener';
|
44323 |
|
44324 | window[action]('popstate', s.onPopstate, false);
|
44325 |
|
44326 | };
|
44327 | s.attach = function (event) {
|
44328 | s.events();
|
44329 | };
|
44330 | s.detach = function (event) {
|
44331 | s.events(true);
|
44332 | };
|
44333 | s.onPopstate = function (e) {
|
44334 |
|
44335 | s.currentHash = s.params.useHash ? location.hash : location.href;
|
44336 |
|
44337 | if (s.params.useHash && location.hash === '') {
|
44338 | s.onBack();
|
44339 |
|
44340 | return;
|
44341 | }
|
44342 |
|
44343 |
|
44344 | if (s.list.indexOf(s.currentHash) >= 0 && s.list[s.list.length - 1] === s.currentHash) {
|
44345 | return;
|
44346 | }
|
44347 |
|
44348 |
|
44349 | if (s.list.indexOf(s.currentHash) === -1) {
|
44350 |
|
44351 | s.onForward();
|
44352 |
|
44353 | if (s.params.onForward) s.params.onForward(s);
|
44354 |
|
44355 |
|
44356 | } else {
|
44357 |
|
44358 | s.onBack();
|
44359 |
|
44360 | }
|
44361 | };
|
44362 | s.onBack = function () {
|
44363 | s.prevHash = s.list.pop();
|
44364 |
|
44365 | if (s.currentHash !== s.list[s.list.length - 1]) {
|
44366 | s.discardList = [];
|
44367 | var discardLen = s.list.length - 1 - s.list.indexOf(s.currentHash);
|
44368 | for (var i = 0; i < discardLen; i++) {
|
44369 | s.discardList.push(s.list.pop());
|
44370 | }
|
44371 | } else {
|
44372 | s.discardList = [];
|
44373 | }
|
44374 |
|
44375 | if (s.params.onBack) s.params.onBack(s);
|
44376 |
|
44377 | s.saveList();
|
44378 | };
|
44379 | s.onForward = function () {
|
44380 | s.prevHash = s.list[s.list.length - 1] || '';
|
44381 | s.list.push(s.currentHash);
|
44382 |
|
44383 | s.saveList();
|
44384 | };
|
44385 | s.onInit = function () {
|
44386 |
|
44387 | if (s.params.onInit) s.params.onInit(s);
|
44388 |
|
44389 | s.attach();
|
44390 | };
|
44391 | s.init = function () {
|
44392 | s.onInit();
|
44393 | };
|
44394 | s.init();
|
44395 | };
|
44396 |
|
44397 | var History_History = (History);
|
44398 |
|
44399 |
|
44400 |
|
44401 | var src_History = (History_History);
|
44402 |
|
44403 |
|
44404 | var PubSub = function () {
|
44405 | var _listen;
|
44406 | var _trigger;
|
44407 | var _remove;
|
44408 | var _default = 'default';
|
44409 | var namespaceCache = {};
|
44410 | var _create;
|
44411 | var each = function each(arr, fn) {
|
44412 | var ret;
|
44413 | for (var i = 0; i < arr.length; i++) {
|
44414 | var n = arr[i];
|
44415 | ret = fn.call(n, i, n);
|
44416 | }
|
44417 | return ret;
|
44418 | };
|
44419 |
|
44420 | _listen = function _listen(key, fn, cache) {
|
44421 | if (!cache[key]) {
|
44422 | cache[key] = [];
|
44423 | }
|
44424 | cache[key].push(fn);
|
44425 | };
|
44426 | _remove = function _remove(key, cache, fn) {
|
44427 | if (!cache[key]) {
|
44428 | return;
|
44429 | }
|
44430 | if (fn) {
|
44431 | for (var i = cache[key].length; i >= 0; i--) {
|
44432 | if (cache[key] === fn) {
|
44433 | cache[key].splice(i, 1);
|
44434 | } else {
|
44435 | cache[key] = [];
|
44436 | }
|
44437 | }
|
44438 | } else {
|
44439 | cache[key] = [];
|
44440 | }
|
44441 | };
|
44442 | _trigger = function _trigger() {
|
44443 | var cache = [].shift.call(arguments);
|
44444 | var key = [].shift.call(arguments);
|
44445 | var args = arguments;
|
44446 | var stack = cache[key];
|
44447 | if (!stack || !stack.length) {
|
44448 | return;
|
44449 | }
|
44450 | return each(stack, function () {
|
44451 | return this.apply(this, args);
|
44452 | });
|
44453 | };
|
44454 | _create = function _create(ns) {
|
44455 | var namespace = ns || _default;
|
44456 | var cache = {};
|
44457 | var offlineStack = [];
|
44458 | var ret = {
|
44459 | listen: function listen(key, fn, last) {
|
44460 | _listen(key, fn, cache);
|
44461 | if (offlineStack === null) {
|
44462 | return;
|
44463 | }
|
44464 | if (last === 'last') {
|
44465 | offlineStack.length && offlineStack.pop()();
|
44466 | } else {
|
44467 | each(offlineStack, function () {
|
44468 | this();
|
44469 | });
|
44470 | }
|
44471 | offlineStack = null;
|
44472 | },
|
44473 | one: function one(key, fn, last) {
|
44474 | _remove(key, cache);
|
44475 | this.listen(key, fn, last);
|
44476 | },
|
44477 | remove: function remove(key, fn) {
|
44478 | _remove(key, cache, fn);
|
44479 | },
|
44480 | trigger: function trigger() {
|
44481 | var _self = this;
|
44482 | [].unshift.call(arguments, cache);
|
44483 | var args = arguments;
|
44484 | var fn = function fn() {
|
44485 | return _trigger.apply(_self, args);
|
44486 | };
|
44487 | if (offlineStack) {
|
44488 | return offlineStack.push(fn);
|
44489 | }
|
44490 | return fn();
|
44491 | }
|
44492 | };
|
44493 | if (Object.prototype.toString.call(namespace).indexOf('object HTML') === 1 && namespace.getAttribute('id')) {
|
44494 | namespace = namespace.getAttribute('id');
|
44495 | }
|
44496 | var result = namespace ? namespaceCache[namespace] ? namespaceCache[namespace] : namespaceCache[namespace] = ret : ret;
|
44497 | return result;
|
44498 | };
|
44499 | return {
|
44500 | create: _create,
|
44501 | one: function one(key, fn, last) {
|
44502 | var event = this.create();
|
44503 | event.one(key, fn, last);
|
44504 | },
|
44505 | remove: function remove(key, fn) {
|
44506 | var event = this.create();
|
44507 | event.remove(key, fn);
|
44508 | },
|
44509 | listen: function listen(key, fn, last) {
|
44510 | var event = this.create();
|
44511 | event.listen(key, fn, last);
|
44512 | },
|
44513 | trigger: function trigger() {
|
44514 | var event = this.create();
|
44515 | event.trigger.apply(this, arguments);
|
44516 | }
|
44517 | };
|
44518 | }();
|
44519 |
|
44520 | var PubSub_PubSub = (PubSub);
|
44521 |
|
44522 |
|
44523 |
|
44524 |
|
44525 |
|
44526 |
|
44527 |
|
44528 |
|
44529 |
|
44530 |
|
44531 |
|
44532 |
|
44533 |
|
44534 |
|
44535 |
|
44536 |
|
44537 |
|
44538 |
|
44539 |
|
44540 |
|
44541 |
|
44542 |
|
44543 |
|
44544 |
|
44545 |
|
44546 |
|
44547 |
|
44548 | var src_PubSub = (PubSub_PubSub);
|
44549 |
|
44550 | 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; };
|
44551 |
|
44552 |
|
44553 | var ValidateID = function () {
|
44554 | var GB2260 = { '110000': '北京市', '110100': '北京市市辖区', '110101': '北京市东城区', '110102': '北京市西城区', '110103': '北京市崇文区', '110104': '北京市宣武区', '110105': '北京市朝阳区', '110106': '北京市丰台区', '110107': '北京市石景山区', '110108': '北京市海淀区', '110109': '北京市门头沟区', '110111': '北京市房山区', '110112': '北京市通州区', '110113': '北京市顺义区', '110200': '北京市县', '110221': '北京市昌平县', '110224': '北京市大兴县', '110226': '北京市平谷县', '110227': '北京市怀柔县', '110228': '北京市密云县', '110229': '北京市延庆县', '120000': '天津市', '120100': '天津市市辖区', '120101': '天津市和平区', '120102': '天津市河东区', '120103': '天津市河西区', '120104': '天津市南开区', '120105': '天津市河北区', '120106': '天津市红桥区', '120107': '天津市塘沽区', '120108': '天津市汉沽区', '120109': '天津市大港区', '120110': '天津市东丽区', '120111': '天津市西青区', '120112': '天津市津南区', '120113': '天津市北辰区', '120200': '天津市县', '120221': '天津市宁河县', '120222': '天津市武清县', '120223': '天津市静海县', '120224': '天津市宝坻县', '120225': '天津市蓟县', '130000': '河北省', '130100': '河北省石家庄市', '130101': '河北省石家庄市市辖区', '130102': '河北省石家庄市长安区', '130103': '河北省石家庄市桥东区', '130104': '河北省石家庄市桥西区', '130105': '河北省石家庄市新华区', '130106': '河北省石家庄市郊区', '130107': '河北省石家庄市井陉矿区', '130121': '河北省石家庄市井陉县', '130123': '河北省石家庄市正定县', '130124': '河北省石家庄市栾城县', '130125': '河北省石家庄市行唐县', '130126': '河北省石家庄市灵寿县', '130127': '河北省石家庄市高邑县', '130128': '河北省石家庄市深泽县', '130129': '河北省石家庄市赞皇县', '130130': '河北省石家庄市无极县', '130131': '河北省石家庄市平山县', '130132': '河北省石家庄市元氏县', '130133': '河北省石家庄市赵县', '130181': '河北省石家庄市辛集市', '130182': '河北省石家庄市藁城市', '130183': '河北省石家庄市晋州市', '130184': '河北省石家庄市新乐市', '130185': '河北省石家庄市鹿泉市', '130200': '河北省唐山市', '130201': '河北省唐山市市辖区', '130202': '河北省唐山市路南区', '130203': '河北省唐山市路北区', '130204': '河北省唐山市古冶区', '130205': '河北省唐山市开平区', '130206': '河北省唐山市新区', '130221': '河北省唐山市丰润县', '130223': '河北省唐山市滦县', '130224': '河北省唐山市滦南县', '130225': '河北省唐山市乐亭县', '130227': '河北省唐山市迁西县', '130229': '河北省唐山市玉田县', '130230': '河北省唐山市唐海县', '130281': '河北省唐山市遵化市', '130282': '河北省唐山市丰南市', '130283': '河北省唐山市迁安市', '130300': '河北省秦皇岛市秦皇岛市', '130301': '河北省秦皇岛市市辖区', '130302': '河北省秦皇岛市海港区', '130303': '河北省秦皇岛市山海关区', '130304': '河北省秦皇岛市北戴河区', '130321': '河北省秦皇岛市青龙满族自治县', '130322': '河北省秦皇岛市昌黎县', '130323': '河北省秦皇岛市抚宁县', '130324': '河北省秦皇岛市卢龙县', '130400': '河北省邯郸市邯郸市', '130401': '河北省邯郸市市辖区', '130402': '河北省邯郸市邯山区', '130403': '河北省邯郸市丛台区', '130404': '河北省邯郸市复兴区', '130406': '河北省邯郸市峰峰矿区', '130421': '河北省邯郸市邯郸县', '130423': '河北省邯郸市临漳县', '130424': '河北省邯郸市成安县', '130425': '河北省邯郸市大名县', '130426': '河北省邯郸市涉县', '130427': '河北省邯郸市磁县', '130428': '河北省邯郸市肥乡县', '130429': '河北省邯郸市永年县', '130430': '河北省邯郸市邱县', '130431': '河北省邯郸市鸡泽县', '130432': '河北省邯郸市广平县', '130433': '河北省邯郸市馆陶县', '130434': '河北省邯郸市魏县', '130435': '河北省邯郸市曲周县', '130481': '河北省邯郸市武安市', '130500': '河北省邢台市', '130501': '河北省邢台市市辖区', '130502': '河北省邢台市桥东区', '130503': '河北省邢台市桥西区', '130521': '河北省邢台市邢台县', '130522': '河北省邢台市临城县', '130523': '河北省邢台市内丘县', '130524': '河北省邢台市柏乡县', '130525': '河北省邢台市隆尧县', '130526': '河北省邢台市任县', '130527': '河北省邢台市南和县', '130528': '河北省邢台市宁晋县', '130529': '河北省邢台市巨鹿县', '130530': '河北省邢台市新河县', '130531': '河北省邢台市广宗县', '130532': '河北省邢台市平乡县', '130533': '河北省邢台市威县', '130534': '河北省邢台市清河县', '130535': '河北省邢台市临西县', '130581': '河北省邢台市南宫市', '130582': '河北省邢台市沙河市', '130600': '河北省保定市', '130601': '河北省保定市市辖区', '130602': '河北省保定市新市区', '130603': '河北省保定市北市区', '130604': '河北省保定市南市区', '130621': '河北省保定市满城县', '130622': '河北省保定市清苑县', '130623': '河北省保定市涞水县', '130624': '河北省保定市阜平县', '130625': '河北省保定市徐水县', '130626': '河北省保定市定兴县', '130627': '河北省保定市唐县', '130628': '河北省保定市高阳县', '130629': '河北省保定市容城县', '130630': '河北省保定市涞源县', '130631': '河北省保定市望都县', '130632': '河北省保定市安新县', '130633': '河北省保定市易县', '130634': '河北省保定市曲阳县', '130635': '河北省保定市蠡县', '130636': '河北省保定市顺平县', '130637': '河北省保定市博野县', '130638': '河北省保定市雄县', '130681': '河北省保定市涿州市', '130682': '河北省保定市定州市', '130683': '河北省保定市安国市', '130684': '河北省保定市高碑店市', '130700': '河北省张家口市', '130701': '河北省张家口市市辖区', '130702': '河北省张家口市桥东区', '130703': '河北省张家口市桥西区', '130705': '河北省张家口市宣化区', '130706': '河北省张家口市下花园区', '130721': '河北省张家口市宣化县', '130722': '河北省张家口市张北县', '130723': '河北省张家口市康保县', '130724': '河北省张家口市沽源县', '130725': '河北省张家口市尚义县', '130726': '河北省张家口市蔚县', '130727': '河北省张家口市阳原县', '130728': '河北省张家口市怀安县', '130729': '河北省张家口市万全县', '130730': '河北省张家口市怀来县', '130731': '河北省张家口市涿鹿县', '130732': '河北省张家口市赤城县', '130733': '河北省张家口市崇礼县', '130800': '河北省承德市', '130801': '河北省承德市市辖区', '130802': '河北省承德市双桥区', '130803': '河北省承德市双滦区', '130804': '河北省承德市鹰手营子矿区', '130821': '河北省承德市承德县', '130822': '河北省承德市兴隆县', '130823': '河北省承德市平泉县', '130824': '河北省承德市滦平县', '130825': '河北省承德市隆化县', '130826': '河北省承德市丰宁满族自治县', '130827': '河北省承德市宽城满族自治县', '130828': '河北省承德市围场满族蒙古族自治县', '130900': '河北省沧州市', '130901': '河北省沧州市市辖区', '130902': '河北省沧州市新华区', '130903': '河北省沧州市运河区', '130921': '河北省沧州市沧县', '130922': '河北省沧州市青县', '130923': '河北省沧州市东光县', '130924': '河北省沧州市海兴县', '130925': '河北省沧州市盐山县', '130926': '河北省沧州市肃宁县', '130927': '河北省沧州市南皮县', '130928': '河北省沧州市吴桥县', '130929': '河北省沧州市献县', '130930': '河北省沧州市孟村回族自治县', '130981': '河北省沧州市泊头市', '130982': '河北省沧州市任丘市', '130983': '河北省沧州市黄骅市', '130984': '河北省沧州市河间市', '131000': '河北省廊坊市', '131001': '河北省廊坊市市辖区', '131002': '河北省廊坊市安次区', '131022': '河北省廊坊市固安县', '131023': '河北省廊坊市永清县', '131024': '河北省廊坊市香河县', '131025': '河北省廊坊市大城县', '131026': '河北省廊坊市文安县', '131028': '河北省廊坊市大厂回族自治县', '131081': '河北省廊坊市霸州市', '131082': '河北省廊坊市三河市', '131100': '河北省衡水市', '131101': '河北省衡水市市辖区', '131102': '河北省衡水市桃城区', '131121': '河北省衡水市枣强县', '131122': '河北省衡水市武邑县', '131123': '河北省衡水市武强县', '131124': '河北省衡水市饶阳县', '131125': '河北省衡水市安平县', '131126': '河北省衡水市故城县', '131127': '河北省衡水市景县', '131128': '河北省衡水市阜城县', '131181': '河北省衡水市冀州市', '131182': '河北省衡水市深州市', '140000': '山西省', '140100': '山西省太原市', '140101': '山西省太原市市辖区', '140105': '山西省太原市小店区', '140106': '山西省太原市迎泽区', '140107': '山西省太原市杏花岭区', '140108': '山西省太原市尖草坪区', '140109': '山西省太原市万柏林区', '140110': '山西省太原市晋源区', '140121': '山西省太原市清徐县', '140122': '山西省太原市阳曲县', '140123': '山西省太原市娄烦县', '140181': '山西省太原市古交市', '140200': '山西省大同市', '140201': '山西省大同市市辖区', '140202': '山西省大同市城区', '140203': '山西省大同市矿区', '140211': '山西省大同市南郊区', '140212': '山西省大同市新荣区', '140221': '山西省大同市阳高县', '140222': '山西省大同市天镇县', '140223': '山西省大同市广灵县', '140224': '山西省大同市灵丘县', '140225': '山西省大同市浑源县', '140226': '山西省大同市左云县', '140227': '山西省大同市大同县', '140300': '山西省阳泉市', '140301': '山西省阳泉市市辖区', '140302': '山西省阳泉市城区', '140303': '山西省阳泉市矿区', '140311': '山西省阳泉市郊区', '140321': '山西省阳泉市平定县', '140322': '山西省阳泉市盂县', '140400': '山西省长治市', '140401': '山西省长治市市辖区', '140402': '山西省长治市城区', '140411': '山西省长治市郊区', '140421': '山西省长治市长治县', '140423': '山西省长治市襄垣县', '140424': '山西省长治市屯留县', '140425': '山西省长治市平顺县', '140426': '山西省长治市黎城县', '140427': '山西省长治市壶关县', '140428': '山西省长治市长子县', '140429': '山西省长治市武乡县', '140430': '山西省长治市沁县', '140431': '山西省长治市沁源县', '140481': '山西省长治市潞城市', '140500': '山西省晋城市', '140501': '山西省晋城市市辖区', '140502': '山西省晋城市城区', '140521': '山西省晋城市沁水县', '140522': '山西省晋城市阳城县', '140524': '山西省晋城市陵川县', '140525': '山西省晋城市泽州县', '140581': '山西省晋城市高平市', '140600': '山西省晋城市朔州市', '140601': '山西省晋城市市辖区', '140602': '山西省晋城市朔城区', '140603': '山西省晋城市平鲁区', '140621': '山西省晋城市山阴县', '140622': '山西省晋城市应县', '140623': '山西省晋城市右玉县', '140624': '山西省晋城市怀仁县', '142200': '山西省忻州地区', '142201': '山西省忻州地区忻州市', '142202': '山西省忻州地区原平市', '142222': '山西省忻州地区定襄县', '142223': '山西省忻州地区五台县', '142225': '山西省忻州地区代县', '142226': '山西省忻州地区繁峙县', '142227': '山西省忻州地区宁武县', '142228': '山西省忻州地区静乐县', '142229': '山西省忻州地区神池县', '142230': '山西省忻州地区五寨县', '142231': '山西省忻州地区岢岚县', '142232': '山西省忻州地区河曲县', '142233': '山西省忻州地区保德县', '142234': '山西省忻州地区偏关县', '142300': '山西省忻州地区吕梁地区', '142301': '山西省忻州地区孝义市', '142302': '山西省忻州地区离石市', '142303': '山西省忻州地区汾阳市', '142322': '山西省忻州地区文水县', '142323': '山西省忻州地区交城县', '142325': '山西省忻州地区兴县', '142326': '山西省忻州地区临县', '142327': '山西省忻州地区柳林县', '142328': '山西省忻州地区石楼县', '142329': '山西省忻州地区岚县', '142330': '山西省忻州地区方山县', '142332': '山西省忻州地区中阳县', '142333': '山西省忻州地区交口县', '142400': '山西省晋中地区', '142401': '山西省晋中地区榆次市', '142402': '山西省晋中地区介休市', '142421': '山西省晋中地区榆社县', '142422': '山西省晋中地区左权县', '142423': '山西省晋中地区和顺县', '142424': '山西省晋中地区昔阳县', '142427': '山西省晋中地区寿阳县', '142429': '山西省晋中地区太谷县', '142430': '山西省晋中地区祁县', '142431': '山西省晋中地区平遥县', '142433': '山西省晋中地区灵石县', '142600': '山西省临汾地区', '142601': '山西省临汾地区临汾市', '142602': '山西省临汾地区侯马市', '142603': '山西省临汾地区霍州市', '142621': '山西省临汾地区曲沃县', '142622': '山西省临汾地区翼城县', '142623': '山西省临汾地区襄汾县', '142625': '山西省临汾地区洪洞县', '142627': '山西省临汾地区古县', '142628': '山西省临汾地区安泽县', '142629': '山西省临汾地区浮山县', '142630': '山西省临汾地区吉县', '142631': '山西省临汾地区乡宁县', '142632': '山西省临汾地区蒲县', '142633': '山西省临汾地区大宁县', '142634': '山西省临汾地区永和县', '142635': '山西省临汾地区隰县', '142636': '山西省临汾地区汾西县', '142700': '山西省运城地区', '142701': '山西省运城地区运城市', '142702': '山西省运城地区永济市', '142703': '山西省运城地区河津市', '142723': '山西省运城地区芮城县', '142724': '山西省运城地区临猗县', '142725': '山西省运城地区万荣县', '142726': '山西省运城地区新绛县', '142727': '山西省运城地区稷山县', '142729': '山西省运城地区闻喜县', '142730': '山西省运城地区夏县', '142731': '山西省运城地区绛县', '142732': '山西省运城地区平陆县', '142733': '山西省运城地区垣曲县', '150000': '内蒙古自治区', '150100': '内蒙古自治区呼和浩特市', '150101': '内蒙古自治区呼和浩特市市辖区', '150102': '内蒙古自治区呼和浩特市新城区', '150103': '内蒙古自治区呼和浩特市回民区', '150104': '内蒙古自治区呼和浩特市玉泉区', '150105': '内蒙古自治区呼和浩特市郊区', '150121': '内蒙古自治区呼和浩特市土默特左旗', '150122': '内蒙古自治区呼和浩特市托克托县', '150123': '内蒙古自治区呼和浩特市和林格尔县', '150124': '内蒙古自治区呼和浩特市清水河县', '150125': '内蒙古自治区呼和浩特市武川县', '150200': '内蒙古自治区包头市', '150201': '内蒙古自治区包头市市辖区', '150202': '内蒙古自治区包头市东河区', '150203': '内蒙古自治区包头市昆都伦区', '150204': '内蒙古自治区包头市青山区', '150205': '内蒙古自治区包头市石拐矿区', '150206': '内蒙古自治区包头市白云矿区', '150207': '内蒙古自治区包头市郊区', '150221': '内蒙古自治区包头市土默特右旗', '150222': '内蒙古自治区包头市固阳县', '150223': '内蒙古自治区包头市达尔罕茂明安联合旗', '150300': '内蒙古自治区乌海市', '150301': '内蒙古自治区乌海市市辖区', '150302': '内蒙古自治区乌海市海勃湾区', '150303': '内蒙古自治区乌海市海南区', '150304': '内蒙古自治区乌海市乌达区', '150400': '内蒙古自治区赤峰市', '150401': '内蒙古自治区赤峰市市辖区', '150402': '内蒙古自治区赤峰市红山区', '150403': '内蒙古自治区赤峰市元宝山区', '150404': '内蒙古自治区赤峰市松山区', '150421': '内蒙古自治区赤峰市阿鲁科尔沁旗', '150422': '内蒙古自治区赤峰市巴林左旗', '150423': '内蒙古自治区赤峰市巴林右旗', '150424': '内蒙古自治区赤峰市林西县', '150425': '内蒙古自治区赤峰市克什克腾旗', '150426': '内蒙古自治区赤峰市翁牛特旗', '150428': '内蒙古自治区赤峰市喀喇沁旗', '150429': '内蒙古自治区赤峰市宁城县', '150430': '内蒙古自治区赤峰市敖汉旗', '152100': '内蒙古自治区呼伦贝尔盟', '152101': '内蒙古自治区呼伦贝尔盟海拉尔市', '152102': '内蒙古自治区呼伦贝尔盟满洲里市', '152103': '内蒙古自治区呼伦贝尔盟扎兰屯市', '152104': '内蒙古自治区呼伦贝尔盟牙克石市', '152105': '内蒙古自治区呼伦贝尔盟根河市', '152106': '内蒙古自治区呼伦贝尔盟额尔古纳市', '152122': '内蒙古自治区呼伦贝尔盟阿荣旗', '152123': '内蒙古自治区呼伦贝尔盟莫力达瓦达斡尔族自治旗', '152127': '内蒙古自治区呼伦贝尔盟鄂伦春自治旗', '152128': '内蒙古自治区呼伦贝尔盟鄂温克族自治旗', '152129': '内蒙古自治区呼伦贝尔盟新巴尔虎右旗', '152130': '内蒙古自治区呼伦贝尔盟新巴尔虎左旗', '152131': '内蒙古自治区呼伦贝尔盟陈巴尔虎旗', '152200': '内蒙古自治区兴安盟', '152201': '内蒙古自治区兴安盟乌兰浩特市', '152202': '内蒙古自治区兴安盟阿尔山市', '152221': '内蒙古自治区兴安盟科尔沁右翼前旗', '152222': '内蒙古自治区兴安盟科尔沁右翼中旗', '152223': '内蒙古自治区兴安盟扎赉特旗', '152224': '内蒙古自治区兴安盟突泉县', '152300': '内蒙古自治区哲里木盟', '152301': '内蒙古自治区哲里木盟通辽市', '152302': '内蒙古自治区哲里木盟霍林郭勒市', '152322': '内蒙古自治区哲里木盟科尔沁左翼中旗', '152323': '内蒙古自治区哲里木盟科尔沁左翼后旗', '152324': '内蒙古自治区哲里木盟开鲁县', '152325': '内蒙古自治区哲里木盟库伦旗', '152326': '内蒙古自治区哲里木盟奈曼旗', '152327': '内蒙古自治区哲里木盟扎鲁特旗', '152500': '内蒙古自治区锡林郭勒盟', '152501': '内蒙古自治区锡林郭勒盟二连浩特市', '152502': '内蒙古自治区锡林郭勒盟锡林浩特市', '152522': '内蒙古自治区锡林郭勒盟阿巴嘎旗', '152523': '内蒙古自治区锡林郭勒盟苏尼特左旗', '152524': '内蒙古自治区锡林郭勒盟苏尼特右旗', '152525': '内蒙古自治区锡林郭勒盟东乌珠穆沁旗', '152526': '内蒙古自治区锡林郭勒盟西乌珠穆沁旗', '152527': '内蒙古自治区锡林郭勒盟太仆寺旗', '152528': '内蒙古自治区锡林郭勒盟镶黄旗', '152529': '内蒙古自治区锡林郭勒盟正镶白旗', '152530': '内蒙古自治区锡林郭勒盟正蓝旗', '152531': '内蒙古自治区锡林郭勒盟多伦县', '152600': '内蒙古自治区乌兰察布盟', '152601': '内蒙古自治区乌兰察布盟集宁市', '152602': '内蒙古自治区乌兰察布盟丰镇市', '152624': '内蒙古自治区乌兰察布盟卓资县', '152625': '内蒙古自治区乌兰察布盟化德县', '152626': '内蒙古自治区乌兰察布盟商都县', '152627': '内蒙古自治区乌兰察布盟兴和县', '152629': '内蒙古自治区乌兰察布盟凉城县', '152630': '内蒙古自治区乌兰察布盟察哈尔右翼前旗', '152631': '内蒙古自治区乌兰察布盟察哈尔右翼中旗', '152632': '内蒙古自治区乌兰察布盟察哈尔右翼后旗', '152634': '内蒙古自治区乌兰察布盟四子王旗', '152700': '内蒙古自治区伊克昭盟', '152701': '内蒙古自治区伊克昭盟东胜市', '152722': '内蒙古自治区伊克昭盟达拉特旗', '152723': '内蒙古自治区伊克昭盟准格尔旗', '152724': '内蒙古自治区伊克昭盟鄂托克前旗', '152725': '内蒙古自治区伊克昭盟鄂托克旗', '152726': '内蒙古自治区伊克昭盟杭锦旗', '152727': '内蒙古自治区伊克昭盟乌审旗', '152728': '内蒙古自治区伊克昭盟伊金霍洛旗', '152800': '内蒙古自治区巴彦淖尔盟', '152801': '内蒙古自治区巴彦淖尔盟临河市', '152822': '内蒙古自治区巴彦淖尔盟五原县', '152823': '内蒙古自治区巴彦淖尔盟磴口县', '152824': '内蒙古自治区巴彦淖尔盟乌拉特前旗', '152825': '内蒙古自治区巴彦淖尔盟乌拉特中旗', '152826': '内蒙古自治区巴彦淖尔盟乌拉特后旗', '152827': '内蒙古自治区巴彦淖尔盟杭锦后旗', '152900': '内蒙古自治区阿拉善盟', '152921': '内蒙古自治区阿拉善盟阿拉善左旗', '152922': '内蒙古自治区阿拉善盟阿拉善右旗', '152923': '内蒙古自治区阿拉善盟额济纳旗', '210000': '辽宁省', '210100': '辽宁省沈阳市', '210101': '辽宁省沈阳市市辖区', '210102': '辽宁省沈阳市和平区', '210103': '辽宁省沈阳市沈河区', '210104': '辽宁省沈阳市大东区', '210105': '辽宁省沈阳市皇姑区', '210106': '辽宁省沈阳市铁西区', '210111': '辽宁省沈阳市苏家屯区', '210112': '辽宁省沈阳市东陵区', '210113': '辽宁省沈阳市新城子区', '210114': '辽宁省沈阳市于洪区', '210122': '辽宁省沈阳市辽中县', '210123': '辽宁省沈阳市康平县', '210124': '辽宁省沈阳市法库县', '210181': '辽宁省沈阳市新民市', '210200': '辽宁省大连市', '210201': '辽宁省大连市市辖区', '210202': '辽宁省大连市中山区', '210203': '辽宁省大连市西岗区', '210204': '辽宁省大连市沙河口区', '210211': '辽宁省大连市甘井子区', '210212': '辽宁省大连市旅顺口区', '210213': '辽宁省大连市金州区', '210224': '辽宁省大连市长海县', '210281': '辽宁省大连市瓦房店市', '210282': '辽宁省大连市普兰店市', '210283': '辽宁省大连市庄河市', '210300': '辽宁省鞍山市', '210301': '辽宁省鞍山市市辖区', '210302': '辽宁省鞍山市铁东区', '210303': '辽宁省鞍山市铁西区', '210304': '辽宁省鞍山市立山区', '210311': '辽宁省鞍山市千山区', '210321': '辽宁省鞍山市台安县', '210323': '辽宁省鞍山市岫岩满族自治县', '210381': '辽宁省鞍山市海城市', '210400': '辽宁省抚顺市', '210401': '辽宁省抚顺市市辖区', '210402': '辽宁省抚顺市新抚区', '210403': '辽宁省抚顺市露天区', '210404': '辽宁省抚顺市望花区', '210411': '辽宁省抚顺市顺城区', '210421': '辽宁省抚顺市抚顺县', '210422': '辽宁省抚顺市新宾满族自治县', '210423': '辽宁省抚顺市清原满族自治县', '210500': '辽宁省本溪市', '210501': '辽宁省本溪市市辖区', '210502': '辽宁省本溪市平山区', '210503': '辽宁省本溪市溪湖区', '210504': '辽宁省本溪市明山区', '210505': '辽宁省本溪市南芬区', '210521': '辽宁省本溪市本溪满族自治县', '210522': '辽宁省本溪市桓仁满族自治县', '210600': '辽宁省丹东市', '210601': '辽宁省丹东市市辖区', '210602': '辽宁省丹东市元宝区', '210603': '辽宁省丹东市振兴区', '210604': '辽宁省丹东市振安区', '210624': '辽宁省丹东市宽甸满族自治县', '210681': '辽宁省丹东市东港市', '210682': '辽宁省丹东市凤城市', '210700': '辽宁省锦州市', '210701': '辽宁省锦州市市辖区', '210702': '辽宁省锦州市古塔区', '210703': '辽宁省锦州市凌河区', '210711': '辽宁省锦州市太和区', '210726': '辽宁省锦州市黑山县', '210727': '辽宁省锦州市义县', '210781': '辽宁省锦州市凌海市', '210782': '辽宁省锦州市北宁市', '210800': '辽宁省营口市', '210801': '辽宁省营口市市辖区', '210802': '辽宁省营口市站前区', '210803': '辽宁省营口市西市区', '210804': '辽宁省营口市鲅鱼圈区', '210811': '辽宁省营口市老边区', '210881': '辽宁省营口市盖州市', '210882': '辽宁省营口市大石桥市', '210900': '辽宁省阜新市', '210901': '辽宁省阜新市市辖区', '210902': '辽宁省阜新市海州区', '210903': '辽宁省阜新市新邱区', '210904': '辽宁省阜新市太平区', '210905': '辽宁省阜新市清河门区', '210911': '辽宁省阜新市细河区', '210921': '辽宁省阜新市阜新蒙古族自治县', '210922': '辽宁省阜新市彰武县', '211000': '辽宁省辽阳市', '211001': '辽宁省辽阳市市辖区', '211002': '辽宁省辽阳市白塔区', '211003': '辽宁省辽阳市文圣区', '211004': '辽宁省辽阳市宏伟区', '211005': '辽宁省辽阳市弓长岭区', '211011': '辽宁省辽阳市太子河区', '211021': '辽宁省辽阳市辽阳县', '211081': '辽宁省辽阳市灯塔市', '211100': '辽宁省盘锦市', '211101': '辽宁省盘锦市市辖区', '211102': '辽宁省盘锦市双台子区', '211103': '辽宁省盘锦市兴隆台区', '211121': '辽宁省盘锦市大洼县', '211122': '辽宁省盘锦市盘山县', '211200': '辽宁省铁岭市', '211201': '辽宁省铁岭市市辖区', '211202': '辽宁省铁岭市银州区', '211204': '辽宁省铁岭市清河区', '211221': '辽宁省铁岭市铁岭县', '211223': '辽宁省铁岭市西丰县', '211224': '辽宁省铁岭市昌图县', '211281': '辽宁省铁岭市铁法市', '211282': '辽宁省铁岭市开原市', '211300': '辽宁省朝阳市', '211301': '辽宁省朝阳市市辖区', '211302': '辽宁省朝阳市双塔区', '211303': '辽宁省朝阳市龙城区', '211321': '辽宁省朝阳市朝阳县', '211322': '辽宁省朝阳市建平县', '211324': '辽宁省朝阳市喀喇沁左翼蒙古族自治县', '211381': '辽宁省朝阳市北票市', '211382': '辽宁省朝阳市凌源市', '211400': '辽宁省葫芦岛市', '211401': '辽宁省葫芦岛市市辖区', '211402': '辽宁省葫芦岛市连山区', '211403': '辽宁省葫芦岛市龙港区', '211404': '辽宁省葫芦岛市南票区', '211421': '辽宁省葫芦岛市绥中县', '211422': '辽宁省葫芦岛市建昌县', '211481': '辽宁省葫芦岛市兴城市', '220000': '吉林省', '220100': '吉林省长春市', '220101': '吉林省长春市市辖区', '220102': '吉林省长春市南关区', '220103': '吉林省长春市宽城区', '220104': '吉林省长春市朝阳区', '220105': '吉林省长春市二道区', '220106': '吉林省长春市绿园区', '220112': '吉林省长春市双阳区', '220122': '吉林省长春市农安县', '220181': '吉林省长春市九台市', '220182': '吉林省长春市榆树市', '220183': '吉林省长春市德惠市', '220200': '吉林省吉林市', '220201': '吉林省吉林市市辖区', '220202': '吉林省吉林市昌邑区', '220203': '吉林省吉林市龙潭区', '220204': '吉林省吉林市船营区', '220211': '吉林省吉林市丰满区', '220221': '吉林省吉林市永吉县', '220281': '吉林省吉林市蛟河市', '220282': '吉林省吉林市桦甸市', '220283': '吉林省吉林市舒兰市', '220284': '吉林省吉林市磐石市', '220300': '吉林省四平市', '220301': '吉林省四平市市辖区', '220302': '吉林省四平市铁西区', '220303': '吉林省四平市铁东区', '220322': '吉林省四平市梨树县', '220323': '吉林省四平市伊通满族自治县', '220381': '吉林省四平市公主岭市', '220382': '吉林省四平市双辽市', '220400': '吉林省辽源市', '220401': '吉林省辽源市市辖区', '220402': '吉林省辽源市龙山区', '220403': '吉林省辽源市西安区', '220421': '吉林省辽源市东丰县', '220422': '吉林省辽源市东辽县', '220500': '吉林省通化市', '220501': '吉林省通化市市辖区', '220502': '吉林省通化市东昌区', '220503': '吉林省通化市二道江区', '220521': '吉林省通化市通化县', '220523': '吉林省通化市辉南县', '220524': '吉林省通化市柳河县', '220581': '吉林省通化市梅河口市', '220582': '吉林省通化市集安市', '220600': '吉林省白山市', '220601': '吉林省白山市市辖区', '220602': '吉林省白山市八道江区', '220621': '吉林省白山市抚松县', '220622': '吉林省白山市靖宇县', '220623': '吉林省白山市长白朝鲜族自治县', '220625': '吉林省白山市江源县', '220681': '吉林省白山市临江市', '220700': '吉林省松原市', '220701': '吉林省松原市市辖区', '220702': '吉林省松原市宁江区', '220721': '吉林省松原市前郭尔罗斯蒙古族自治县', '220722': '吉林省松原市长岭县', '220723': '吉林省松原市乾安县', '220724': '吉林省松原市扶余县', '220800': '吉林省白城市', '220801': '吉林省白城市市辖区', '220802': '吉林省白城市洮北区', '220821': '吉林省白城市镇赉县', '220822': '吉林省白城市通榆县', '220881': '吉林省白城市洮南市', '220882': '吉林省白城市大安市', '222400': '吉林省延边朝鲜族自治州', '222401': '吉林省延边朝鲜族自治州延吉市', '222402': '吉林省延边朝鲜族自治州图们市', '222403': '吉林省延边朝鲜族自治州敦化市', '222404': '吉林省延边朝鲜族自治州珲春市', '222405': '吉林省延边朝鲜族自治州龙井市', '222406': '吉林省延边朝鲜族自治州和龙市', '222424': '吉林省延边朝鲜族自治州汪清县', '222426': '吉林省延边朝鲜族自治州安图县', '230000': '黑龙江省', '230100': '黑龙江省哈尔滨市', '230101': '黑龙江省哈尔滨市市辖区', '230102': '黑龙江省哈尔滨市道里区', '230103': '黑龙江省哈尔滨市南岗区', '230104': '黑龙江省哈尔滨市道外区', '230105': '黑龙江省哈尔滨市太平区', '230106': '黑龙江省哈尔滨市香坊区', '230107': '黑龙江省哈尔滨市动力区', '230108': '黑龙江省哈尔滨市平房区', '230121': '黑龙江省哈尔滨市呼兰县', '230123': '黑龙江省哈尔滨市依兰县', '230124': '黑龙江省哈尔滨市方正县', '230125': '黑龙江省哈尔滨市宾县', '230126': '黑龙江省哈尔滨市巴彦县', '230127': '黑龙江省哈尔滨市木兰县', '230128': '黑龙江省哈尔滨市通河县', '230129': '黑龙江省哈尔滨市延寿县', '230181': '黑龙江省哈尔滨市阿城市', '230182': '黑龙江省哈尔滨市双城市', '230183': '黑龙江省哈尔滨市尚志市', '230184': '黑龙江省哈尔滨市五常市', '230200': '黑龙江省齐齐哈尔市', '230201': '黑龙江省齐齐哈尔市市辖区', '230202': '黑龙江省齐齐哈尔市龙沙区', '230203': '黑龙江省齐齐哈尔市建华区', '230204': '黑龙江省齐齐哈尔市铁锋区', '230205': '黑龙江省齐齐哈尔市昂昂溪区', '230206': '黑龙江省齐齐哈尔市富拉尔基区', '230207': '黑龙江省齐齐哈尔市碾子山区', '230208': '黑龙江省齐齐哈尔市梅里斯达斡尔族区', '230221': '黑龙江省齐齐哈尔市龙江县', '230223': '黑龙江省齐齐哈尔市依安县', '230224': '黑龙江省齐齐哈尔市泰来县', '230225': '黑龙江省齐齐哈尔市甘南县', '230227': '黑龙江省齐齐哈尔市富裕县', '230229': '黑龙江省齐齐哈尔市克山县', '230230': '黑龙江省齐齐哈尔市克东县', '230231': '黑龙江省齐齐哈尔市拜泉县', '230281': '黑龙江省齐齐哈尔市讷河市', '230300': '黑龙江省鸡西市', '230301': '黑龙江省鸡西市市辖区', '230302': '黑龙江省鸡西市鸡冠区', '230303': '黑龙江省鸡西市恒山区', '230304': '黑龙江省鸡西市滴道区', '230305': '黑龙江省鸡西市梨树区', '230306': '黑龙江省鸡西市城子河区', '230307': '黑龙江省鸡西市麻山区', '230321': '黑龙江省鸡西市鸡东县', '230381': '黑龙江省鸡西市虎林市', '230382': '黑龙江省鸡西市密山市', '230400': '黑龙江省鹤岗市', '230401': '黑龙江省鹤岗市市辖区', '230402': '黑龙江省鹤岗市向阳区', '230403': '黑龙江省鹤岗市工农区', '230404': '黑龙江省鹤岗市南山区', '230405': '黑龙江省鹤岗市兴安区', '230406': '黑龙江省鹤岗市东山区', '230407': '黑龙江省鹤岗市兴山区', '230421': '黑龙江省鹤岗市萝北县', '230422': '黑龙江省鹤岗市绥滨县', '230500': '黑龙江省双鸭山市', '230501': '黑龙江省双鸭山市市辖区', '230502': '黑龙江省双鸭山市尖山区', '230503': '黑龙江省双鸭山市岭东区', '230505': '黑龙江省双鸭山市四方台区', '230506': '黑龙江省双鸭山市宝山区', '230521': '黑龙江省双鸭山市集贤县', '230522': '黑龙江省双鸭山市友谊县', '230523': '黑龙江省双鸭山市宝清县', '230524': '黑龙江省双鸭山市饶河县', '230600': '黑龙江省大庆市', '230601': '黑龙江省大庆市市辖区', '230602': '黑龙江省大庆市萨尔图区', '230603': '黑龙江省大庆市龙凤区', '230604': '黑龙江省大庆市让胡路区', '230605': '黑龙江省大庆市红岗区', '230606': '黑龙江省大庆市大同区', '230621': '黑龙江省大庆市肇州县', '230622': '黑龙江省大庆市肇源县', '230623': '黑龙江省大庆市林甸县', '230624': '黑龙江省大庆市杜尔伯特蒙古族自治县', '230700': '黑龙江省伊春市', '230701': '黑龙江省伊春市市辖区', '230702': '黑龙江省伊春市伊春区', '230703': '黑龙江省伊春市南岔区', '230704': '黑龙江省伊春市友好区', '230705': '黑龙江省伊春市西林区', '230706': '黑龙江省伊春市翠峦区', '230707': '黑龙江省伊春市新青区', '230708': '黑龙江省伊春市美溪区', '230709': '黑龙江省伊春市金山屯区', '230710': '黑龙江省伊春市五营区', '230711': '黑龙江省伊春市乌马河区', '230712': '黑龙江省伊春市汤旺河区', '230713': '黑龙江省伊春市带岭区', '230714': '黑龙江省伊春市乌伊岭区', '230715': '黑龙江省伊春市红星区', '230716': '黑龙江省伊春市上甘岭区', '230722': '黑龙江省伊春市嘉荫县', '230781': '黑龙江省伊春市铁力市', '230800': '黑龙江省佳木斯市', '230801': '黑龙江省佳木斯市市辖区', '230802': '黑龙江省佳木斯市永红区', '230803': '黑龙江省佳木斯市向阳区', '230804': '黑龙江省佳木斯市前进区', '230805': '黑龙江省佳木斯市东风区', '230811': '黑龙江省佳木斯市郊区', '230822': '黑龙江省佳木斯市桦南县', '230826': '黑龙江省佳木斯市桦川县', '230828': '黑龙江省佳木斯市汤原县', '230833': '黑龙江省佳木斯市抚远县', '230881': '黑龙江省佳木斯市同江市', '230882': '黑龙江省佳木斯市富锦市', '230900': '黑龙江省七台河市', '230901': '黑龙江省七台河市市辖区', '230902': '黑龙江省七台河市新兴区', '230903': '黑龙江省七台河市桃山区', '230904': '黑龙江省七台河市茄子河区', '230921': '黑龙江省七台河市勃利县', '231000': '黑龙江省牡丹江市', '231001': '黑龙江省牡丹江市市辖区', '231002': '黑龙江省牡丹江市东安区', '231003': '黑龙江省牡丹江市阳明区', '231004': '黑龙江省牡丹江市爱民区', '231005': '黑龙江省牡丹江市西安区', '231024': '黑龙江省牡丹江市东宁县', '231025': '黑龙江省牡丹江市林口县', '231081': '黑龙江省牡丹江市绥芬河市', '231083': '黑龙江省牡丹江市海林市', '231084': '黑龙江省牡丹江市宁安市', '231085': '黑龙江省牡丹江市穆棱市', '231100': '黑龙江省黑河市', '231101': '黑龙江省黑河市市辖区', '231102': '黑龙江省黑河市爱辉区', '231121': '黑龙江省黑河市嫩江县', '231123': '黑龙江省黑河市逊克县', '231124': '黑龙江省黑河市孙吴县', '231181': '黑龙江省黑河市北安市', '231182': '黑龙江省黑河市五大连池市', '232300': '黑龙江省绥化地区', '232301': '黑龙江省绥化地区绥化市', '232302': '黑龙江省绥化地区安达市', '232303': '黑龙江省绥化地区肇东市', '232304': '黑龙江省绥化地区海伦市', '232324': '黑龙江省绥化地区望奎县', '232325': '黑龙江省绥化地区兰西县', '232326': '黑龙江省绥化地区青冈县', '232330': '黑龙江省绥化地区庆安县', '232331': '黑龙江省绥化地区明水县', '232332': '黑龙江省绥化地区绥棱县', '232700': '黑龙江省大兴安岭地区', '232721': '黑龙江省大兴安岭地区呼玛县', '232722': '黑龙江省大兴安岭地区塔河县', '232723': '黑龙江省大兴安岭地区漠河县', '310000': '上海市', '310100': '上海市市辖区', '310101': '上海市黄浦区', '310102': '上海市南市区', '310103': '上海市卢湾区', '310104': '上海市徐汇区', '310105': '上海市长宁区', '310106': '上海市静安区', '310107': '上海市普陀区', '310108': '上海市闸北区', '310109': '上海市虹口区', '310110': '上海市杨浦区', '310112': '上海市闵行区', '310113': '上海市宝山区', '310114': '上海市嘉定区', '310115': '上海市浦东新区', '310116': '上海市金山区', '310117': '上海市松江区', '310200': '上海市县', '310225': '上海市南汇县', '310226': '上海市奉贤县', '310229': '上海市青浦县', '310230': '上海市崇明县', '320000': '江苏省', '320100': '江苏省南京市', '320101': '江苏省南京市市辖区', '320102': '江苏省南京市玄武区', '320103': '江苏省南京市白下区', '320104': '江苏省南京市秦淮区', '320105': '江苏省南京市建邺区', '320106': '江苏省南京市鼓楼区', '320107': '江苏省南京市下关区', '320111': '江苏省南京市浦口区', '320112': '江苏省南京市大厂区', '320113': '江苏省南京市栖霞区', '320114': '江苏省南京市雨花台区', '320121': '江苏省南京市江宁县', '320122': '江苏省南京市江浦县', '320123': '江苏省南京市六合县', '320124': '江苏省南京市溧水县', '320125': '江苏省南京市高淳县', '320200': '江苏省无锡市', '320201': '江苏省无锡市市辖区', '320202': '江苏省无锡市崇安区', '320203': '江苏省无锡市南长区', '320204': '江苏省无锡市北塘区', '320211': '江苏省无锡市郊区', '320281': '江苏省无锡市江阴市', '320282': '江苏省无锡市宜兴市', '320283': '江苏省无锡市锡山市', '320300': '江苏省徐州市', '320301': '江苏省徐州市市辖区', '320302': '江苏省徐州市鼓楼区', '320303': '江苏省徐州市云龙区', '320304': '江苏省徐州市九里区', '320305': '江苏省徐州市贾汪区', '320311': '江苏省徐州市泉山区', '320321': '江苏省徐州市丰县', '320322': '江苏省徐州市沛县', '320323': '江苏省徐州市铜山县', '320324': '江苏省徐州市睢宁县', '320381': '江苏省徐州市新沂市', '320382': '江苏省徐州市邳州市', '320400': '江苏省常州市', '320401': '江苏省常州市市辖区', '320402': '江苏省常州市天宁区', '320404': '江苏省常州市钟楼区', '320405': '江苏省常州市戚墅堰区', '320411': '江苏省常州市郊区', '320481': '江苏省常州市溧阳市', '320482': '江苏省常州市金坛市', '320483': '江苏省常州市武进市', '320500': '江苏省苏州市', '320501': '江苏省苏州市市辖区', '320502': '江苏省苏州市沧浪区', '320503': '江苏省苏州市平江区', '320504': '江苏省苏州市金阊区', '320511': '江苏省苏州市郊区', '320581': '江苏省苏州市常熟市', '320582': '江苏省苏州市张家港市', '320583': '江苏省苏州市昆山市', '320584': '江苏省苏州市吴江市', '320585': '江苏省苏州市太仓市', '320586': '江苏省苏州市吴县市', '320600': '江苏省南通市', '320601': '江苏省南通市市辖区', '320602': '江苏省南通市崇川区', '320611': '江苏省南通市港闸区', '320621': '江苏省南通市海安县', '320623': '江苏省南通市如东县', '320681': '江苏省南通市启东市', '320682': '江苏省南通市如皋市', '320683': '江苏省南通市通州市', '320684': '江苏省南通市海门市', '320700': '江苏省连云港市', '320701': '江苏省连云港市市辖区', '320703': '江苏省连云港市连云区', '320704': '江苏省连云港市云台区', '320705': '江苏省连云港市新浦区', '320706': '江苏省连云港市海州区', '320721': '江苏省连云港市赣榆县', '320722': '江苏省连云港市东海县', '320723': '江苏省连云港市灌云县', '320724': '江苏省连云港市灌南县', '320800': '江苏省淮阴市', '320801': '江苏省淮阴市市辖区', '320802': '江苏省淮阴市清河区', '320811': '江苏省淮阴市清浦区', '320821': '江苏省淮阴市淮阴县', '320826': '江苏省淮阴市涟水县', '320829': '江苏省淮阴市洪泽县', '320830': '江苏省淮阴市盱眙县', '320831': '江苏省淮阴市金湖县', '320882': '江苏省淮阴市淮安市', '320900': '江苏省盐城市', '320901': '江苏省盐城市市辖区', '320902': '江苏省盐城市城区', '320921': '江苏省盐城市响水县', '320922': '江苏省盐城市滨海县', '320923': '江苏省盐城市阜宁县', '320924': '江苏省盐城市射阳县', '320925': '江苏省盐城市建湖县', '320928': '江苏省盐城市盐都县', '320981': '江苏省盐城市东台市', '320982': '江苏省盐城市大丰市', '321000': '江苏省扬州市', '321001': '江苏省扬州市市辖区', '321002': '江苏省扬州市广陵区', '321011': '江苏省扬州市郊区', '321023': '江苏省扬州市宝应县', '321027': '江苏省扬州市邗江县', '321081': '江苏省扬州市仪征市', '321084': '江苏省扬州市高邮市', '321088': '江苏省扬州市江都市', '321100': '江苏省镇江市', '321101': '江苏省镇江市市辖区', '321102': '江苏省镇江市京口区', '321111': '江苏省镇江市润州区', '321121': '江苏省镇江市丹徒县', '321181': '江苏省镇江市丹阳市', '321182': '江苏省镇江市扬中市', '321183': '江苏省镇江市句容市', '321200': '江苏省泰州市', '321201': '江苏省泰州市市辖区', '321202': '江苏省泰州市海陵区', '321203': '江苏省泰州市高港区', '321281': '江苏省泰州市兴化市', '321282': '江苏省泰州市靖江市', '321283': '江苏省泰州市泰兴市', '321284': '江苏省泰州市姜堰市', '321300': '江苏省宿迁市', '321301': '江苏省宿迁市市辖区', '321302': '江苏省宿迁市宿城区', '321321': '江苏省宿迁市宿豫县', '321322': '江苏省宿迁市沭阳县', '321323': '江苏省宿迁市泗阳县', '321324': '江苏省宿迁市泗洪县', '330000': '浙江省', '330100': '浙江省杭州市', '330101': '浙江省杭州市市辖区', '330102': '浙江省杭州市上城区', '330103': '浙江省杭州市下城区', '330104': '浙江省杭州市江干区', '330105': '浙江省杭州市拱墅区', '330106': '浙江省杭州市西湖区', '330108': '浙江省杭州市滨江区', '330122': '浙江省杭州市桐庐县', '330127': '浙江省杭州市淳安县', '330181': '浙江省杭州市萧山市', '330182': '浙江省杭州市建德市', '330183': '浙江省杭州市富阳市', '330184': '浙江省杭州市余杭市', '330185': '浙江省杭州市临安市', '330200': '浙江省宁波市', '330201': '浙江省宁波市市辖区', '330203': '浙江省宁波市海曙区', '330204': '浙江省宁波市江东区', '330205': '浙江省宁波市江北区', '330206': '浙江省宁波市北仑区', '330211': '浙江省宁波市镇海区', '330225': '浙江省宁波市象山县', '330226': '浙江省宁波市宁海县', '330227': '浙江省宁波市鄞县', '330281': '浙江省宁波市余姚市', '330282': '浙江省宁波市慈溪市', '330283': '浙江省宁波市奉化市', '330300': '浙江省温州市', '330301': '浙江省温州市市辖区', '330302': '浙江省温州市鹿城区', '330303': '浙江省温州市龙湾区', '330304': '浙江省温州市瓯海区', '330322': '浙江省温州市洞头县', '330324': '浙江省温州市永嘉县', '330326': '浙江省温州市平阳县', '330327': '浙江省温州市苍南县', '330328': '浙江省温州市文成县', '330329': '浙江省温州市泰顺县', '330381': '浙江省温州市瑞安市', '330382': '浙江省温州市乐清市', '330400': '浙江省嘉兴市', '330401': '浙江省嘉兴市市辖区', '330402': '浙江省嘉兴市秀城区', '330411': '浙江省嘉兴市郊区', '330421': '浙江省嘉兴市嘉善县', '330424': '浙江省嘉兴市海盐县', '330481': '浙江省嘉兴市海宁市', '330482': '浙江省嘉兴市平湖市', '330483': '浙江省嘉兴市桐乡市', '330500': '浙江省湖州市', '330501': '浙江省湖州市市辖区', '330521': '浙江省湖州市德清县', '330522': '浙江省湖州市长兴县', '330523': '浙江省湖州市安吉县', '330600': '浙江省绍兴市', '330601': '浙江省绍兴市市辖区', '330602': '浙江省绍兴市越城区', '330621': '浙江省绍兴市绍兴县', '330624': '浙江省绍兴市新昌县', '330681': '浙江省绍兴市诸暨市', '330682': '浙江省绍兴市上虞市', '330683': '浙江省绍兴市嵊州市', '330700': '浙江省金华市', '330701': '浙江省金华市市辖区', '330702': '浙江省金华市婺城区', '330721': '浙江省金华市金华县', '330723': '浙江省金华市武义县', '330726': '浙江省金华市浦江县', '330727': '浙江省金华市磐安县', '330781': '浙江省金华市兰溪市', '330782': '浙江省金华市义乌市', '330783': '浙江省金华市东阳市', '330784': '浙江省金华市永康市', '330800': '浙江省衢州市', '330801': '浙江省衢州市市辖区', '330802': '浙江省衢州市柯城区', '330821': '浙江省衢州市衢县', '330822': '浙江省衢州市常山县', '330824': '浙江省衢州市开化县', '330825': '浙江省衢州市龙游县', '330881': '浙江省衢州市江山市', '330900': '浙江省舟山市', '330901': '浙江省舟山市市辖区', '330902': '浙江省舟山市定海区', '330903': '浙江省舟山市普陀区', '330921': '浙江省舟山市岱山县', '330922': '浙江省舟山市嵊泗县', '331000': '浙江省台州市', '331001': '浙江省台州市市辖区', '331002': '浙江省台州市椒江区', '331003': '浙江省台州市黄岩区', '331004': '浙江省台州市路桥区', '331021': '浙江省台州市玉环县', '331022': '浙江省台州市三门县', '331023': '浙江省台州市天台县', '331024': '浙江省台州市仙居县', '331081': '浙江省台州市温岭市', '331082': '浙江省台州市临海市', '332500': '浙江省丽水地区', '332501': '浙江省丽水地区丽水市', '332502': '浙江省丽水地区龙泉市', '332522': '浙江省丽水地区青田县', '332523': '浙江省丽水地区云和县', '332525': '浙江省丽水地区庆元县', '332526': '浙江省丽水地区缙云县', '332527': '浙江省丽水地区遂昌县', '332528': '浙江省丽水地区松阳县', '332529': '浙江省丽水地区景宁畲族自治县', '340000': '安徽省', '340100': '安徽省合肥市', '340101': '安徽省合肥市市辖区', '340102': '安徽省合肥市东市区', '340103': '安徽省合肥市中市区', '340104': '安徽省合肥市西市区', '340111': '安徽省合肥市郊区', '340121': '安徽省合肥市长丰县', '340122': '安徽省合肥市肥东县', '340123': '安徽省合肥市肥西县', '340200': '安徽省芜湖市', '340201': '安徽省芜湖市市辖区', '340202': '安徽省芜湖市镜湖区', '340203': '安徽省芜湖市马塘区', '340204': '安徽省芜湖市新芜区', '340207': '安徽省芜湖市鸠江区', '340221': '安徽省芜湖市芜湖县', '340222': '安徽省芜湖市繁昌县', '340223': '安徽省芜湖市南陵县', '340300': '安徽省蚌埠市', '340301': '安徽省蚌埠市市辖区', '340302': '安徽省蚌埠市东市区', '340303': '安徽省蚌埠市中市区', '340304': '安徽省蚌埠市西市区', '340311': '安徽省蚌埠市郊区', '340321': '安徽省蚌埠市怀远县', '340322': '安徽省蚌埠市五河县', '340323': '安徽省蚌埠市固镇县', '340400': '安徽省淮南市', '340401': '安徽省淮南市市辖区', '340402': '安徽省淮南市大通区', '340403': '安徽省淮南市田家庵区', '340404': '安徽省淮南市谢家集区', '340405': '安徽省淮南市八公山区', '340406': '安徽省淮南市潘集区', '340421': '安徽省淮南市凤台县', '340500': '安徽省马鞍山市', '340501': '安徽省马鞍山市市辖区', '340502': '安徽省马鞍山市金家庄区', '340503': '安徽省马鞍山市花山区', '340504': '安徽省马鞍山市雨山区', '340505': '安徽省马鞍山市向山区', '340521': '安徽省马鞍山市当涂县', '340600': '安徽省淮北市', '340601': '安徽省淮北市市辖区', '340602': '安徽省淮北市杜集区', '340603': '安徽省淮北市相山区', '340604': '安徽省淮北市烈山区', '340621': '安徽省淮北市濉溪县', '340700': '安徽省铜陵市', '340701': '安徽省铜陵市市辖区', '340702': '安徽省铜陵市铜官山区', '340703': '安徽省铜陵市狮子山区', '340711': '安徽省铜陵市郊区', '340721': '安徽省铜陵市铜陵县', '340800': '安徽省安庆市', '340801': '安徽省安庆市市辖区', '340802': '安徽省安庆市迎江区', '340803': '安徽省安庆市大观区', '340811': '安徽省安庆市郊区', '340822': '安徽省安庆市怀宁县', '340823': '安徽省安庆市枞阳县', '340824': '安徽省安庆市潜山县', '340825': '安徽省安庆市太湖县', '340826': '安徽省安庆市宿松县', '340827': '安徽省安庆市望江县', '340828': '安徽省安庆市岳西县', '340881': '安徽省安庆市桐城市', '341000': '安徽省黄山市', '341001': '安徽省黄山市市辖区', '341002': '安徽省黄山市屯溪区', '341003': '安徽省黄山市黄山区', '341004': '安徽省黄山市徽州区', '341021': '安徽省黄山市歙县', '341022': '安徽省黄山市休宁县', '341023': '安徽省黄山市黟县', '341024': '安徽省黄山市祁门县', '341100': '安徽省滁州市', '341101': '安徽省滁州市市辖区', '341102': '安徽省滁州市琅琊区', '341103': '安徽省滁州市南谯区', '341122': '安徽省滁州市来安县', '341124': '安徽省滁州市全椒县', '341125': '安徽省滁州市定远县', '341126': '安徽省滁州市凤阳县', '341181': '安徽省滁州市天长市', '341182': '安徽省滁州市明光市', '341200': '安徽省阜阳市', '341201': '安徽省阜阳市市辖区', '341202': '安徽省阜阳市颍州区', '341203': '安徽省阜阳市颍东区', '341204': '安徽省阜阳市颍泉区', '341221': '安徽省阜阳市临泉县', '341222': '安徽省阜阳市太和县', '341223': '安徽省阜阳市涡阳县', '341224': '安徽省阜阳市蒙城县', '341225': '安徽省阜阳市阜南县', '341226': '安徽省阜阳市颍上县', '341227': '安徽省阜阳市利辛县', '341281': '安徽省阜阳市亳州市', '341282': '安徽省阜阳市界首市', '341300': '安徽省宿州市', '341301': '安徽省宿州市市辖区', '341302': '安徽省宿州市甬桥区', '341321': '安徽省宿州市砀山县', '341322': '安徽省宿州市萧县', '341323': '安徽省宿州市灵璧县', '341324': '安徽省宿州市泗县', '342400': '安徽省六安地区', '342401': '安徽省六安地区六安市', '342422': '安徽省六安地区寿县', '342423': '安徽省六安地区霍邱县', '342425': '安徽省六安地区舒城县', '342426': '安徽省六安地区金寨县', '342427': '安徽省六安地区霍山县', '342500': '安徽省宣城地区', '342501': '安徽省宣城地区宣州市', '342502': '安徽省宣城地区宁国市', '342522': '安徽省宣城地区郎溪县', '342523': '安徽省宣城地区广德县', '342529': '安徽省宣城地区泾县', '342530': '安徽省宣城地区旌德县', '342531': '安徽省宣城地区绩溪县', '342600': '安徽省巢湖地区', '342601': '安徽省巢湖地区巢湖市', '342622': '安徽省巢湖地区庐江县', '342623': '安徽省巢湖地区无为县', '342625': '安徽省巢湖地区含山县', '342626': '安徽省巢湖地区和县', '342900': '安徽省池州地区', '342901': '安徽省池州地区贵池市', '342921': '安徽省池州地区东至县', '342922': '安徽省池州地区石台县', '342923': '安徽省池州地区青阳县', '350000': '福建省', '350100': '福建省福州市', '350101': '福建省福州市市辖区', '350102': '福建省福州市鼓楼区', '350103': '福建省福州市台江区', '350104': '福建省福州市仓山区', '350105': '福建省福州市马尾区', '350111': '福建省福州市晋安区', '350121': '福建省福州市闽侯县', '350122': '福建省福州市连江县', '350123': '福建省福州市罗源县', '350124': '福建省福州市闽清县', '350125': '福建省福州市永泰县', '350128': '福建省福州市平潭县', '350181': '福建省福州市福清市', '350182': '福建省福州市长乐市', '350200': '福建省厦门市', '350201': '福建省厦门市市辖区', '350202': '福建省厦门市鼓浪屿区', '350203': '福建省厦门市思明区', '350204': '福建省厦门市开元区', '350205': '福建省厦门市杏林区', '350206': '福建省厦门市湖里区', '350211': '福建省厦门市集美区', '350212': '福建省厦门市同安区', '350300': '福建省莆田市', '350301': '福建省莆田市市辖区', '350302': '福建省莆田市城厢区', '350303': '福建省莆田市涵江区', '350321': '福建省莆田市莆田县', '350322': '福建省莆田市仙游县', '350400': '福建省三明市', '350401': '福建省三明市市辖区', '350402': '福建省三明市梅列区', '350403': '福建省三明市三元区', '350421': '福建省三明市明溪县', '350423': '福建省三明市清流县', '350424': '福建省三明市宁化县', '350425': '福建省三明市大田县', '350426': '福建省三明市尤溪县', '350427': '福建省三明市沙县', '350428': '福建省三明市将乐县', '350429': '福建省三明市泰宁县', '350430': '福建省三明市建宁县', '350481': '福建省三明市永安市', '350500': '福建省泉州市', '350501': '福建省泉州市市辖区', '350502': '福建省泉州市鲤城区', '350503': '福建省泉州市丰泽区', '350504': '福建省泉州市洛江区', '350521': '福建省泉州市惠安县', '350524': '福建省泉州市安溪县', '350525': '福建省泉州市永春县', '350526': '福建省泉州市德化县', '350527': '福建省泉州市金门县', '350581': '福建省泉州市石狮市', '350582': '福建省泉州市晋江市', '350583': '福建省泉州市南安市', '350600': '福建省漳州市', '350601': '福建省漳州市市辖区', '350602': '福建省漳州市芗城区', '350603': '福建省漳州市龙文区', '350622': '福建省漳州市云霄县', '350623': '福建省漳州市漳浦县', '350624': '福建省漳州市诏安县', '350625': '福建省漳州市长泰县', '350626': '福建省漳州市东山县', '350627': '福建省漳州市南靖县', '350628': '福建省漳州市平和县', '350629': '福建省漳州市华安县', '350681': '福建省漳州市龙海市', '350700': '福建省南平市', '350701': '福建省南平市市辖区', '350702': '福建省南平市延平区', '350721': '福建省南平市顺昌县', '350722': '福建省南平市浦城县', '350723': '福建省南平市光泽县', '350724': '福建省南平市松溪县', '350725': '福建省南平市政和县', '350781': '福建省南平市邵武市', '350782': '福建省南平市武夷山市', '350783': '福建省南平市建瓯市', '350784': '福建省南平市建阳市', '350800': '福建省龙岩市', '350801': '福建省龙岩市市辖区', '350802': '福建省龙岩市新罗区', '350821': '福建省龙岩市长汀县', '350822': '福建省龙岩市永定县', '350823': '福建省龙岩市上杭县', '350824': '福建省龙岩市武平县', '350825': '福建省龙岩市连城县', '350881': '福建省龙岩市漳平市', '352200': '福建省宁德地区', '352201': '福建省宁德地区宁德市', '352202': '福建省宁德地区福安市', '352203': '福建省宁德地区福鼎市', '352225': '福建省宁德地区霞浦县', '352227': '福建省宁德地区古田县', '352228': '福建省宁德地区屏南县', '352229': '福建省宁德地区寿宁县', '352230': '福建省宁德地区周宁县', '352231': '福建省宁德地区柘荣县', '360000': '江西省', '360100': '江西省南昌市', '360101': '江西省南昌市市辖区', '360102': '江西省南昌市东湖区', '360103': '江西省南昌市西湖区', '360104': '江西省南昌市青云谱区', '360105': '江西省南昌市湾里区', '360111': '江西省南昌市郊区', '360121': '江西省南昌市南昌县', '360122': '江西省南昌市新建县', '360123': '江西省南昌市安义县', '360124': '江西省南昌市进贤县', '360200': '江西省景德镇市', '360201': '江西省景德镇市市辖区', '360202': '江西省景德镇市昌江区', '360203': '江西省景德镇市珠山区', '360222': '江西省景德镇市浮梁县', '360281': '江西省景德镇市乐平市', '360300': '江西省萍乡市', '360301': '江西省萍乡市市辖区', '360302': '江西省萍乡市安源区', '360313': '江西省萍乡市湘东区', '360321': '江西省萍乡市莲花县', '360322': '江西省萍乡市上栗县', '360323': '江西省萍乡市芦溪县', '360400': '江西省九江市', '360401': '江西省九江市市辖区', '360402': '江西省九江市庐山区', '360403': '江西省九江市浔阳区', '360421': '江西省九江市九江县', '360423': '江西省九江市武宁县', '360424': '江西省九江市修水县', '360425': '江西省九江市永修县', '360426': '江西省九江市德安县', '360427': '江西省九江市星子县', '360428': '江西省九江市都昌县', '360429': '江西省九江市湖口县', '360430': '江西省九江市彭泽县', '360481': '江西省九江市瑞昌市', '360500': '江西省新余市', '360501': '江西省新余市市辖区', '360502': '江西省新余市渝水区', '360521': '江西省新余市分宜县', '360600': '江西省鹰潭市', '360601': '江西省鹰潭市市辖区', '360602': '江西省鹰潭市月湖区', '360622': '江西省鹰潭市余江县', '360681': '江西省鹰潭市贵溪市', '360700': '江西省赣州市', '360701': '江西省赣州市市辖区', '360702': '江西省赣州市章贡区', '360721': '江西省赣州市赣县', '360722': '江西省赣州市信丰县', '360723': '江西省赣州市大余县', '360724': '江西省赣州市上犹县', '360725': '江西省赣州市崇义县', '360726': '江西省赣州市安远县', '360727': '江西省赣州市龙南县', '360728': '江西省赣州市定南县', '360729': '江西省赣州市全南县', '360730': '江西省赣州市宁都县', '360731': '江西省赣州市于都县', '360732': '江西省赣州市兴国县', '360733': '江西省赣州市会昌县', '360734': '江西省赣州市寻乌县', '360735': '江西省赣州市石城县', '360781': '江西省赣州市瑞金市', '360782': '江西省赣州市南康市', '362200': '江西省宜春地区', '362201': '江西省宜春地区宜春市', '362202': '江西省宜春地区丰城市', '362203': '江西省宜春地区樟树市', '362204': '江西省宜春地区高安市', '362226': '江西省宜春地区奉新县', '362227': '江西省宜春地区万载县', '362228': '江西省宜春地区上高县', '362229': '江西省宜春地区宜丰县', '362232': '江西省宜春地区靖安县', '362233': '江西省宜春地区铜鼓县', '362300': '江西省上饶地区', '362301': '江西省上饶地区上饶市', '362302': '江西省上饶地区德兴市', '362321': '江西省上饶地区上饶县', '362322': '江西省上饶地区广丰县', '362323': '江西省上饶地区玉山县', '362324': '江西省上饶地区铅山县', '362325': '江西省上饶地区横峰县', '362326': '江西省上饶地区弋阳县', '362329': '江西省上饶地区余干县', '362330': '江西省上饶地区波阳县', '362331': '江西省上饶地区万年县', '362334': '江西省上饶地区婺源县', '362400': '江西省吉安地区', '362401': '江西省吉安地区吉安市', '362402': '江西省吉安地区井冈山市', '362421': '江西省吉安地区吉安县', '362422': '江西省吉安地区吉水县', '362423': '江西省吉安地区峡江县', '362424': '江西省吉安地区新干县', '362425': '江西省吉安地区永丰县', '362426': '江西省吉安地区泰和县', '362427': '江西省吉安地区遂川县', '362428': '江西省吉安地区万安县', '362429': '江西省吉安地区安福县', '362430': '江西省吉安地区永新县', '362432': '江西省吉安地区宁冈县', '362500': '江西省抚州地区', '362502': '江西省抚州地区临川市', '362522': '江西省抚州地区南城县', '362523': '江西省抚州地区黎川县', '362524': '江西省抚州地区南丰县', '362525': '江西省抚州地区崇仁县', '362526': '江西省抚州地区乐安县', '362527': '江西省抚州地区宜黄县', '362528': '江西省抚州地区金溪县', '362529': '江西省抚州地区资溪县', '362531': '江西省抚州地区东乡县', '362532': '江西省抚州地区广昌县', '370000': '山东省', '370100': '山东省济南市', '370101': '山东省济南市市辖区', '370102': '山东省济南市历下区', '370103': '山东省济南市市中区', '370104': '山东省济南市槐荫区', '370105': '山东省济南市天桥区', '370112': '山东省济南市历城区', '370123': '山东省济南市长清县', '370124': '山东省济南市平阴县', '370125': '山东省济南市济阳县', '370126': '山东省济南市商河县', '370181': '山东省济南市章丘市', '370200': '山东省青岛市', '370201': '山东省青岛市市辖区', '370202': '山东省青岛市市南区', '370203': '山东省青岛市市北区', '370205': '山东省青岛市四方区', '370211': '山东省青岛市黄岛区', '370212': '山东省青岛市崂山区', '370213': '山东省青岛市李沧区', '370214': '山东省青岛市城阳区', '370281': '山东省青岛市胶州市', '370282': '山东省青岛市即墨市', '370283': '山东省青岛市平度市', '370284': '山东省青岛市胶南市', '370285': '山东省青岛市莱西市', '370300': '山东省淄博市', '370301': '山东省淄博市市辖区', '370302': '山东省淄博市淄川区', '370303': '山东省淄博市张店区', '370304': '山东省淄博市博山区', '370305': '山东省淄博市临淄区', '370306': '山东省淄博市周村区', '370321': '山东省淄博市桓台县', '370322': '山东省淄博市高青县', '370323': '山东省淄博市沂源县', '370400': '山东省枣庄市', '370401': '山东省枣庄市市辖区', '370402': '山东省枣庄市市中区', '370403': '山东省枣庄市薛城区', '370404': '山东省枣庄市峄城区', '370405': '山东省枣庄市台儿庄区', '370406': '山东省枣庄市山亭区', '370481': '山东省枣庄市滕州市', '370500': '山东省东营市', '370501': '山东省东营市市辖区', '370502': '山东省东营市东营区', '370503': '山东省东营市河口区', '370521': '山东省东营市垦利县', '370522': '山东省东营市利津县', '370523': '山东省东营市广饶县', '370600': '山东省烟台市', '370601': '山东省烟台市市辖区', '370602': '山东省烟台市芝罘区', '370611': '山东省烟台市福山区', '370612': '山东省烟台市牟平区', '370613': '山东省烟台市莱山区', '370634': '山东省烟台市长岛县', '370681': '山东省烟台市龙口市', '370682': '山东省烟台市莱阳市', '370683': '山东省烟台市莱州市', '370684': '山东省烟台市蓬莱市', '370685': '山东省烟台市招远市', '370686': '山东省烟台市栖霞市', '370687': '山东省烟台市海阳市', '370700': '山东省潍坊市', '370701': '山东省潍坊市市辖区', '370702': '山东省潍坊市潍城区', '370703': '山东省潍坊市寒亭区', '370704': '山东省潍坊市坊子区', '370705': '山东省潍坊市奎文区', '370724': '山东省潍坊市临朐县', '370725': '山东省潍坊市昌乐县', '370781': '山东省潍坊市青州市', '370782': '山东省潍坊市诸城市', '370783': '山东省潍坊市寿光市', '370784': '山东省潍坊市安丘市', '370785': '山东省潍坊市高密市', '370786': '山东省潍坊市昌邑市', '370800': '山东省济宁市', '370801': '山东省济宁市市辖区', '370802': '山东省济宁市市中区', '370811': '山东省济宁市任城区', '370826': '山东省济宁市微山县', '370827': '山东省济宁市鱼台县', '370828': '山东省济宁市金乡县', '370829': '山东省济宁市嘉祥县', '370830': '山东省济宁市汶上县', '370831': '山东省济宁市泗水县', '370832': '山东省济宁市梁山县', '370881': '山东省济宁市曲阜市', '370882': '山东省济宁市兖州市', '370883': '山东省济宁市邹城市', '370900': '山东省泰安市', '370901': '山东省泰安市市辖区', '370902': '山东省泰安市泰山区', '370911': '山东省泰安市郊区', '370921': '山东省泰安市宁阳县', '370923': '山东省泰安市东平县', '370982': '山东省泰安市新泰市', '370983': '山东省泰安市肥城市', '371000': '山东省威海市', '371001': '山东省威海市市辖区', '371002': '山东省威海市环翠区', '371081': '山东省威海市文登市', '371082': '山东省威海市荣成市', '371083': '山东省威海市乳山市', '371100': '山东省日照市', '371101': '山东省日照市市辖区', '371102': '山东省日照市东港区', '371121': '山东省日照市五莲县', '371122': '山东省日照市莒县', '371200': '山东省莱芜市', '371201': '山东省莱芜市市辖区', '371202': '山东省莱芜市莱城区', '371203': '山东省莱芜市钢城区', '371300': '山东省临沂市', '371301': '山东省临沂市市辖区', '371302': '山东省临沂市兰山区', '371311': '山东省临沂市罗庄区', '371312': '山东省临沂市河东区', '371321': '山东省临沂市沂南县', '371322': '山东省临沂市郯城县', '371323': '山东省临沂市沂水县', '371324': '山东省临沂市苍山县', '371325': '山东省临沂市费县', '371326': '山东省临沂市平邑县', '371327': '山东省临沂市莒南县', '371328': '山东省临沂市蒙阴县', '371329': '山东省临沂市临沭县', '371400': '山东省德州市', '371401': '山东省德州市市辖区', '371402': '山东省德州市德城区', '371421': '山东省德州市陵县', '371422': '山东省德州市宁津县', '371423': '山东省德州市庆云县', '371424': '山东省德州市临邑县', '371425': '山东省德州市齐河县', '371426': '山东省德州市平原县', '371427': '山东省德州市夏津县', '371428': '山东省德州市武城县', '371481': '山东省德州市乐陵市', '371482': '山东省德州市禹城市', '371500': '山东省聊城市', '371501': '山东省聊城市市辖区', '371502': '山东省聊城市东昌府区', '371521': '山东省聊城市阳谷县', '371522': '山东省聊城市莘县', '371523': '山东省聊城市茌平县', '371524': '山东省聊城市东阿县', '371525': '山东省聊城市冠县', '371526': '山东省聊城市高唐县', '371581': '山东省聊城市临清市', '372300': '山东省滨州地区', '372301': '山东省滨州地区滨州市', '372321': '山东省滨州地区惠民县', '372323': '山东省滨州地区阳信县', '372324': '山东省滨州地区无棣县', '372325': '山东省滨州地区沾化县', '372328': '山东省滨州地区博兴县', '372330': '山东省滨州地区邹平县', '372900': '山东省菏泽地区', '372901': '山东省菏泽地区菏泽市', '372922': '山东省菏泽地区曹县', '372923': '山东省菏泽地区定陶县', '372924': '山东省菏泽地区成武县', '372925': '山东省菏泽地区单县', '372926': '山东省菏泽地区巨野县', '372928': '山东省菏泽地区郓城县', '372929': '山东省菏泽地区鄄城县', '372930': '山东省菏泽地区东明县', '410000': '河南省', '410100': '河南省郑州市', '410101': '河南省郑州市市辖区', '410102': '河南省郑州市中原区', '410103': '河南省郑州市二七区', '410104': '河南省郑州市管城回族区', '410105': '河南省郑州市金水区', '410106': '河南省郑州市上街区', '410108': '河南省郑州市邙山区', '410122': '河南省郑州市中牟县', '410181': '河南省郑州市巩义市', '410182': '河南省郑州市荥阳市', '410183': '河南省郑州市新密市', '410184': '河南省郑州市新郑市', '410185': '河南省郑州市登封市', '410200': '河南省开封市', '410201': '河南省开封市市辖区', '410202': '河南省开封市龙亭区', '410203': '河南省开封市顺河回族区', '410204': '河南省开封市鼓楼区', '410205': '河南省开封市南关区', '410211': '河南省开封市郊区', '410221': '河南省开封市杞县', '410222': '河南省开封市通许县', '410223': '河南省开封市尉氏县', '410224': '河南省开封市开封县', '410225': '河南省开封市兰考县', '410300': '河南省洛阳市', '410301': '河南省洛阳市市辖区', '410302': '河南省洛阳市老城区', '410303': '河南省洛阳市西工区', '410304': '河南省洛阳市廛河回族区', '410305': '河南省洛阳市涧西区', '410306': '河南省洛阳市吉利区', '410311': '河南省洛阳市郊区', '410322': '河南省洛阳市孟津县', '410323': '河南省洛阳市新安县', '410324': '河南省洛阳市栾川县', '410325': '河南省洛阳市嵩县', '410326': '河南省洛阳市汝阳县', '410327': '河南省洛阳市宜阳县', '410328': '河南省洛阳市洛宁县', '410329': '河南省洛阳市伊川县', '410381': '河南省洛阳市偃师市', '410400': '河南省平顶山市', '410401': '河南省平顶山市市辖区', '410402': '河南省平顶山市新华区', '410403': '河南省平顶山市卫东区', '410404': '河南省平顶山市石龙区', '410411': '河南省平顶山市湛河区', '410421': '河南省平顶山市宝丰县', '410422': '河南省平顶山市叶县', '410423': '河南省平顶山市鲁山县', '410425': '河南省平顶山市郏县', '410481': '河南省平顶山市舞钢市', '410482': '河南省平顶山市汝州市', '410500': '河南省安阳市', '410501': '河南省安阳市市辖区', '410502': '河南省安阳市文峰区', '410503': '河南省安阳市北关区', '410504': '河南省安阳市铁西区', '410511': '河南省安阳市郊区', '410522': '河南省安阳市安阳县', '410523': '河南省安阳市汤阴县', '410526': '河南省安阳市滑县', '410527': '河南省安阳市内黄县', '410581': '河南省安阳市林州市', '410600': '河南省鹤壁市', '410601': '河南省鹤壁市市辖区', '410602': '河南省鹤壁市鹤山区', '410603': '河南省鹤壁市山城区', '410611': '河南省鹤壁市郊区', '410621': '河南省鹤壁市浚县', '410622': '河南省鹤壁市淇县', '410700': '河南省新乡市', '410701': '河南省新乡市市辖区', '410702': '河南省新乡市红旗区', '410703': '河南省新乡市新华区', '410704': '河南省新乡市北站区', '410711': '河南省新乡市郊区', '410721': '河南省新乡市新乡县', '410724': '河南省新乡市获嘉县', '410725': '河南省新乡市原阳县', '410726': '河南省新乡市延津县', '410727': '河南省新乡市封丘县', '410728': '河南省新乡市长垣县', '410781': '河南省新乡市卫辉市', '410782': '河南省新乡市辉县市', '410800': '河南省焦作市', '410801': '河南省焦作市市辖区', '410802': '河南省焦作市解放区', '410803': '河南省焦作市中站区', '410804': '河南省焦作市马村区', '410811': '河南省焦作市山阳区', '410821': '河南省焦作市修武县', '410822': '河南省焦作市博爱县', '410823': '河南省焦作市武陟县', '410825': '河南省焦作市温县', '410881': '河南省焦作市济源市', '410882': '河南省焦作市沁阳市', '410883': '河南省焦作市孟州市', '410900': '河南省濮阳市', '410901': '河南省濮阳市市辖区', '410902': '河南省濮阳市市区', '410922': '河南省濮阳市清丰县', '410923': '河南省濮阳市南乐县', '410926': '河南省濮阳市范县', '410927': '河南省濮阳市台前县', '410928': '河南省濮阳市濮阳县', '411000': '河南省许昌市', '411001': '河南省许昌市市辖区', '411002': '河南省许昌市魏都区', '411023': '河南省许昌市许昌县', '411024': '河南省许昌市鄢陵县', '411025': '河南省许昌市襄城县', '411081': '河南省许昌市禹州市', '411082': '河南省许昌市长葛市', '411100': '河南省漯河市', '411101': '河南省漯河市市辖区', '411102': '河南省漯河市源汇区', '411121': '河南省漯河市舞阳县', '411122': '河南省漯河市临颍县', '411123': '河南省漯河市郾城县', '411200': '河南省三门峡市', '411201': '河南省三门峡市市辖区', '411202': '河南省三门峡市湖滨区', '411221': '河南省三门峡市渑池县', '411222': '河南省三门峡市陕县', '411224': '河南省三门峡市卢氏县', '411281': '河南省三门峡市义马市', '411282': '河南省三门峡市灵宝市', '411300': '河南省南阳市', '411301': '河南省南阳市市辖区', '411302': '河南省南阳市宛城区', '411303': '河南省南阳市卧龙区', '411321': '河南省南阳市南召县', '411322': '河南省南阳市方城县', '411323': '河南省南阳市西峡县', '411324': '河南省南阳市镇平县', '411325': '河南省南阳市内乡县', '411326': '河南省南阳市淅川县', '411327': '河南省南阳市社旗县', '411328': '河南省南阳市唐河县', '411329': '河南省南阳市新野县', '411330': '河南省南阳市桐柏县', '411381': '河南省南阳市邓州市', '411400': '河南省商丘市', '411401': '河南省商丘市市辖区', '411402': '河南省商丘市梁园区', '411403': '河南省商丘市睢阳区', '411421': '河南省商丘市民权县', '411422': '河南省商丘市睢县', '411423': '河南省商丘市宁陵县', '411424': '河南省商丘市柘城县', '411425': '河南省商丘市虞城县', '411426': '河南省商丘市夏邑县', '411481': '河南省商丘市永城市', '411500': '河南省信阳市', '411501': '河南省信阳市市辖区', '411502': '河南省信阳市师河区', '411503': '河南省信阳市平桥区', '411521': '河南省信阳市罗山县', '411522': '河南省信阳市光山县', '411523': '河南省信阳市新县', '411524': '河南省信阳市商城县', '411525': '河南省信阳市固始县', '411526': '河南省信阳市潢川县', '411527': '河南省信阳市淮滨县', '411528': '河南省信阳市息县', '412700': '河南省周口地区', '412701': '河南省周口地区周口市', '412702': '河南省周口地区项城市', '412721': '河南省周口地区扶沟县', '412722': '河南省周口地区西华县', '412723': '河南省周口地区商水县', '412724': '河南省周口地区太康县', '412725': '河南省周口地区鹿邑县', '412726': '河南省周口地区郸城县', '412727': '河南省周口地区淮阳县', '412728': '河南省周口地区沈丘县', '412800': '河南省驻马店地区', '412801': '河南省驻马店地区驻马店市', '412821': '河南省驻马店地区确山县', '412822': '河南省驻马店地区泌阳县', '412823': '河南省驻马店地区遂平县', '412824': '河南省驻马店地区西平县', '412825': '河南省驻马店地区上蔡县', '412826': '河南省驻马店地区汝南县', '412827': '河南省驻马店地区平舆县', '412828': '河南省驻马店地区新蔡县', '412829': '河南省驻马店地区正阳县', '420000': '湖北省', '420100': '湖北省武汉市', '420101': '湖北省武汉市市辖区', '420102': '湖北省武汉市江岸区', '420103': '湖北省武汉市江汉区', '420104': '湖北省武汉市乔口区', '420105': '湖北省武汉市汉阳区', '420106': '湖北省武汉市武昌区', '420107': '湖北省武汉市青山区', '420111': '湖北省武汉市洪山区', '420112': '湖北省武汉市东西湖区', '420113': '湖北省武汉市汉南区', '420114': '湖北省武汉市蔡甸区', '420115': '湖北省武汉市江夏区', '420116': '湖北省武汉市黄陂区', '420117': '湖北省武汉市新洲区', '420200': '湖北省黄石市', '420201': '湖北省黄石市市辖区', '420202': '湖北省黄石市黄石港区', '420203': '湖北省黄石市石灰窑区', '420204': '湖北省黄石市下陆区', '420205': '湖北省黄石市铁山区', '420222': '湖北省黄石市阳新县', '420281': '湖北省黄石市大冶市', '420300': '湖北省十堰市', '420301': '湖北省十堰市市辖区', '420302': '湖北省十堰市茅箭区', '420303': '湖北省十堰市张湾区', '420321': '湖北省十堰市郧县', '420322': '湖北省十堰市郧西县', '420323': '湖北省十堰市竹山县', '420324': '湖北省十堰市竹溪县', '420325': '湖北省十堰市房县', '420381': '湖北省十堰市丹江口市', '420500': '湖北省宜昌市', '420501': '湖北省宜昌市市辖区', '420502': '湖北省宜昌市西陵区', '420503': '湖北省宜昌市伍家岗区', '420504': '湖北省宜昌市点军区', '420505': '湖北省宜昌市虎亭区', '420521': '湖北省宜昌市宜昌县', '420525': '湖北省宜昌市远安县', '420526': '湖北省宜昌市兴山县', '420527': '湖北省宜昌市秭归县', '420528': '湖北省宜昌市长阳土家族自治县', '420529': '湖北省宜昌市五峰土家族自治县', '420581': '湖北省宜昌市宜都市', '420582': '湖北省宜昌市当阳市', '420583': '湖北省宜昌市枝江市', '420600': '湖北省襄樊市', '420601': '湖北省襄樊市市辖区', '420602': '湖北省襄樊市襄城区', '420606': '湖北省襄樊市樊城区', '420621': '湖北省襄樊市襄阳县', '420624': '湖北省襄樊市南漳县', '420625': '湖北省襄樊市谷城县', '420626': '湖北省襄樊市保康县', '420682': '湖北省襄樊市老河口市', '420683': '湖北省襄樊市枣阳市', '420684': '湖北省襄樊市宜城市', '420700': '湖北省鄂州市', '420701': '湖北省鄂州市市辖区', '420702': '湖北省鄂州市梁子湖区', '420703': '湖北省鄂州市华容区', '420704': '湖北省鄂州市鄂城区', '420800': '湖北省荆门市', '420801': '湖北省荆门市市辖区', '420802': '湖北省荆门市东宝区', '420821': '湖北省荆门市京山县', '420822': '湖北省荆门市沙洋县', '420881': '湖北省荆门市钟祥市', '420900': '湖北省孝感市', '420901': '湖北省孝感市市辖区', '420902': '湖北省孝感市孝南区', '420921': '湖北省孝感市孝昌县', '420922': '湖北省孝感市大悟县', '420923': '湖北省孝感市云梦县', '420981': '湖北省孝感市应城市', '420982': '湖北省孝感市安陆市', '420983': '湖北省孝感市广水市', '420984': '湖北省孝感市汉川市', '421000': '湖北省荆州市', '421001': '湖北省荆州市市辖区', '421002': '湖北省荆州市沙市区', '421003': '湖北省荆州市荆州区', '421022': '湖北省荆州市公安县', '421023': '湖北省荆州市监利县', '421024': '湖北省荆州市江陵县', '421081': '湖北省荆州市石首市', '421083': '湖北省荆州市洪湖市', '421087': '湖北省荆州市松滋市', '421100': '湖北省黄冈市', '421101': '湖北省黄冈市市辖区', '421102': '湖北省黄冈市黄州区', '421121': '湖北省黄冈市团风县', '421122': '湖北省黄冈市红安县', '421123': '湖北省黄冈市罗田县', '421124': '湖北省黄冈市英山县', '421125': '湖北省黄冈市浠水县', '421126': '湖北省黄冈市蕲春县', '421127': '湖北省黄冈市黄梅县', '421181': '湖北省黄冈市麻城市', '421182': '湖北省黄冈市武穴市', '421200': '湖北省咸宁市', '421201': '湖北省咸宁市市辖区', '421202': '湖北省咸宁市咸安区', '421221': '湖北省咸宁市嘉鱼县', '421222': '湖北省咸宁市通城县', '421223': '湖北省咸宁市崇阳县', '421224': '湖北省咸宁市通山县', '422800': '湖北省施土家族苗族自治州', '422801': '湖北省恩施土家族苗族自治州恩施县', '422802': '湖北省恩施土家族苗族自治州利川市', '422822': '湖北省恩施土家族苗族自治州建始县', '422823': '湖北省恩施土家族苗族自治州巴东县', '422825': '湖北省恩施土家族苗族自治州宣恩县', '422826': '湖北省恩施土家族苗族自治州咸丰县', '422827': '湖北省恩施土家族苗族自治州来凤县', '422828': '湖北省恩施土家族苗族自治州鹤峰县', '429000': '湖北省省直辖县级行政单位', '429001': '湖北省随州市', '429004': '湖北省仙桃市', '429005': '湖北省潜江市', '429006': '湖北省天门市', '429021': '湖北省神农架林区', '430000': '湖南省', '430100': '湖南省长沙市', '430101': '湖南省长沙市市辖区', '430102': '湖南省长沙市芙蓉区', '430103': '湖南省长沙市天心区', '430104': '湖南省长沙市岳麓区', '430105': '湖南省长沙市开福区', '430111': '湖南省长沙市雨花区', '430121': '湖南省长沙市长沙县', '430122': '湖南省长沙市望城县', '430124': '湖南省长沙市宁乡县', '430181': '湖南省长沙市浏阳市', '430200': '湖南省株洲市', '430201': '湖南省株洲市市辖区', '430202': '湖南省株洲市荷塘区', '430203': '湖南省株洲市芦淞区', '430204': '湖南省株洲市石峰区', '430211': '湖南省株洲市天元区', '430221': '湖南省株洲市株洲县', '430223': '湖南省株洲市攸县', '430224': '湖南省株洲市茶陵县', '430225': '湖南省株洲市炎陵县', '430281': '湖南省株洲市醴陵市', '430300': '湖南省湘潭市', '430301': '湖南省湘潭市市辖区', '430302': '湖南省湘潭市雨湖区', '430304': '湖南省湘潭市岳塘区', '430321': '湖南省湘潭市湘潭县', '430381': '湖南省湘潭市湘乡市', '430382': '湖南省湘潭市韶山市', '430400': '湖南省衡阳市', '430401': '湖南省衡阳市市辖区', '430402': '湖南省衡阳市江东区', '430403': '湖南省衡阳市城南区', '430404': '湖南省衡阳市城北区', '430411': '湖南省衡阳市郊区', '430412': '湖南省衡阳市南岳区', '430421': '湖南省衡阳市衡阳县', '430422': '湖南省衡阳市衡南县', '430423': '湖南省衡阳市衡山县', '430424': '湖南省衡阳市衡东县', '430426': '湖南省衡阳市祁东县', '430481': '湖南省衡阳市耒阳市', '430482': '湖南省衡阳市常宁市', '430500': '湖南省邵阳市', '430501': '湖南省邵阳市市辖区', '430502': '湖南省邵阳市双清区', '430503': '湖南省邵阳市大祥区', '430511': '湖南省邵阳市北塔区', '430521': '湖南省邵阳市邵东县', '430522': '湖南省邵阳市新邵县', '430523': '湖南省邵阳市邵阳县', '430524': '湖南省邵阳市隆回县', '430525': '湖南省邵阳市洞口县', '430527': '湖南省邵阳市绥宁县', '430528': '湖南省邵阳市新宁县', '430529': '湖南省邵阳市城步苗族自治县', '430581': '湖南省邵阳市武冈市', '430600': '湖南省岳阳市', '430601': '湖南省岳阳市市辖区', '430602': '湖南省岳阳市岳阳楼区', '430603': '湖南省岳阳市云溪区', '430611': '湖南省岳阳市君山区', '430621': '湖南省岳阳市岳阳县', '430623': '湖南省岳阳市华容县', '430624': '湖南省岳阳市湘阴县', '430626': '湖南省岳阳市平江县', '430681': '湖南省岳阳市汨罗市', '430682': '湖南省岳阳市临湘市', '430700': '湖南省常德市', '430701': '湖南省常德市市辖区', '430702': '湖南省常德市武陵区', '430703': '湖南省常德市鼎城区', '430721': '湖南省常德市安乡县', '430722': '湖南省常德市汉寿县', '430723': '湖南省常德市澧县', '430724': '湖南省常德市临澧县', '430725': '湖南省常德市桃源县', '430726': '湖南省常德市石门县', '430781': '湖南省常德市津市市', '430800': '湖南省张家界市', '430801': '湖南省张家界市市辖区', '430802': '湖南省张家界市永定区', '430811': '湖南省张家界市武陵源区', '430821': '湖南省张家界市慈利县', '430822': '湖南省张家界市桑植县', '430900': '湖南省益阳市', '430901': '湖南省益阳市市辖区', '430902': '湖南省益阳市资阳区', '430903': '湖南省益阳市赫山区', '430921': '湖南省益阳市南县', '430922': '湖南省益阳市桃江县', '430923': '湖南省益阳市安化县', '430981': '湖南省益阳市沅江市', '431000': '湖南省郴州市', '431001': '湖南省郴州市市辖区', '431002': '湖南省郴州市北湖区', '431003': '湖南省郴州市苏仙区', '431021': '湖南省郴州市桂阳县', '431022': '湖南省郴州市宜章县', '431023': '湖南省郴州市永兴县', '431024': '湖南省郴州市嘉禾县', '431025': '湖南省郴州市临武县', '431026': '湖南省郴州市汝城县', '431027': '湖南省郴州市桂东县', '431028': '湖南省郴州市安仁县', '431081': '湖南省郴州市资兴市', '431100': '湖南省永州市', '431101': '湖南省永州市市辖区', '431102': '湖南省永州市芝山区', '431103': '湖南省永州市冷水滩区', '431121': '湖南省永州市祁阳县', '431122': '湖南省永州市东安县', '431123': '湖南省永州市双牌县', '431124': '湖南省永州市道县', '431125': '湖南省永州市江永县', '431126': '湖南省永州市宁远县', '431127': '湖南省永州市蓝山县', '431128': '湖南省永州市新田县', '431129': '湖南省永州市江华瑶族自治县', '431200': '湖南省怀化市', '431201': '湖南省怀化市市辖区', '431202': '湖南省怀化市鹤城区', '431221': '湖南省怀化市中方县', '431222': '湖南省怀化市沅陵县', '431223': '湖南省怀化市辰溪县', '431224': '湖南省怀化市溆浦县', '431225': '湖南省怀化市会同县', '431226': '湖南省怀化市麻阳苗族自治县', '431227': '湖南省怀化市新晃侗族自治县', '431228': '湖南省怀化市芷江侗族自治县', '431229': '湖南省怀化市靖州苗族侗族自治县', '431230': '湖南省怀化市通道侗族自治县', '431281': '湖南省怀化市洪江市', '432500': '湖南省娄底地区', '432501': '湖南省娄底地区娄底市', '432502': '湖南省娄底地区冷水江市', '432503': '湖南省娄底地区涟源市', '432522': '湖南省娄底地区双峰县', '432524': '湖南省娄底地区新化县', '433000': '湖南省怀化市', '433001': '湖南省怀化市', '433100': '湖南省湘西土家族苗族自治州', '433101': '湖南省湘西土家族苗族自治州吉首市', '433122': '湖南省湘西土家族苗族自治州泸溪县', '433123': '湖南省湘西土家族苗族自治州凤凰县', '433124': '湖南省湘西土家族苗族自治州花垣县', '433125': '湖南省湘西土家族苗族自治州保靖县', '433126': '湖南省湘西土家族苗族自治州古丈县', '433127': '湖南省湘西土家族苗族自治州永顺县', '433130': '湖南省湘西土家族苗族自治州龙山县', '440000': '广东省', '440100': '广东省广州市', '440101': '广东省广州市市辖区', '440102': '广东省广州市东山区', '440103': '广东省广州市荔湾区', '440104': '广东省广州市越秀区', '440105': '广东省广州市海珠区', '440106': '广东省广州市天河区', '440107': '广东省广州市芳村区', '440111': '广东省广州市白云区', '440112': '广东省广州市黄埔区', '440181': '广东省广州市番禺市', '440182': '广东省广州市花都市', '440183': '广东省广州市增城市', '440184': '广东省广州市从化市', '440200': '广东省韶关市', '440201': '广东省韶关市市辖区', '440202': '广东省韶关市北江区', '440203': '广东省韶关市武江区', '440204': '广东省韶关市浈江区', '440221': '广东省韶关市曲江县', '440222': '广东省韶关市始兴县', '440224': '广东省韶关市仁化县', '440229': '广东省韶关市翁源县', '440232': '广东省韶关市乳源瑶族自治县', '440233': '广东省韶关市新丰县', '440281': '广东省韶关市乐昌市', '440282': '广东省韶关市南雄市', '440300': '广东省深圳市', '440301': '广东省深圳市市辖区', '440303': '广东省深圳市罗湖区', '440304': '广东省深圳市福田区', '440305': '广东省深圳市南山区', '440306': '广东省深圳市宝安区', '440307': '广东省深圳市龙岗区', '440308': '广东省深圳市盐田区', '440400': '广东省珠海市', '440401': '广东省珠海市市辖区', '440402': '广东省珠海市香洲区', '440421': '广东省珠海市斗门县', '440500': '广东省汕头市', '440501': '广东省汕头市市辖区', '440506': '广东省汕头市达濠区', '440507': '广东省汕头市龙湖区', '440508': '广东省汕头市金园区', '440509': '广东省汕头市升平区', '440510': '广东省汕头市河浦区', '440523': '广东省汕头市南澳县', '440582': '广东省汕头市潮阳市', '440583': '广东省汕头市澄海市', '440600': '广东省佛山市', '440601': '广东省佛山市市辖区', '440602': '广东省佛山市城区', '440603': '广东省佛山市石湾区', '440681': '广东省佛山市顺德市', '440682': '广东省佛山市南海市', '440683': '广东省佛山市三水市', '440684': '广东省佛山市高明市', '440700': '广东省江门市', '440701': '广东省江门市市辖区', '440703': '广东省江门市蓬江区', '440704': '广东省江门市江海区', '440781': '广东省江门市台山市', '440782': '广东省江门市新会市', '440783': '广东省江门市开平市', '440784': '广东省江门市鹤山市', '440785': '广东省江门市恩平市', '440800': '广东省湛江市', '440801': '广东省湛江市市辖区', '440802': '广东省湛江市赤坎区', '440803': '广东省湛江市霞山区', '440804': '广东省湛江市坡头区', '440811': '广东省湛江市麻章区', '440823': '广东省湛江市遂溪县', '440825': '广东省湛江市徐闻县', '440881': '广东省湛江市廉江市', '440882': '广东省湛江市雷州市', '440883': '广东省湛江市吴川市', '440900': '广东省茂名市', '440901': '广东省茂名市市辖区', '440902': '广东省茂名市茂南区', '440923': '广东省茂名市电白县', '440981': '广东省茂名市高州市', '440982': '广东省茂名市化州市', '440983': '广东省茂名市信宜市', '441200': '广东省肇庆市', '441201': '广东省肇庆市市辖区', '441202': '广东省肇庆市端州区', '441203': '广东省肇庆市鼎湖区', '441223': '广东省肇庆市广宁县', '441224': '广东省肇庆市怀集县', '441225': '广东省肇庆市封开县', '441226': '广东省肇庆市德庆县', '441283': '广东省肇庆市高要市', '441284': '广东省肇庆市四会市', '441300': '广东省惠州市', '441301': '广东省惠州市市辖区', '441302': '广东省惠州市惠城区', '441322': '广东省惠州市博罗县', '441323': '广东省惠州市惠东县', '441324': '广东省惠州市龙门县', '441381': '广东省惠州市惠阳市', '441400': '广东省梅州市', '441401': '广东省梅州市市辖区', '441402': '广东省梅州市梅江区', '441421': '广东省梅州市梅县', '441422': '广东省梅州市大埔县', '441423': '广东省梅州市丰顺县', '441424': '广东省梅州市五华县', '441426': '广东省梅州市平远县', '441427': '广东省梅州市蕉岭县', '441481': '广东省梅州市兴宁市', '441500': '广东省汕尾市', '441501': '广东省汕尾市市辖区', '441502': '广东省汕尾市城区', '441521': '广东省汕尾市海丰县', '441523': '广东省汕尾市陆河县', '441581': '广东省汕尾市陆丰市', '441600': '广东省河源市', '441601': '广东省河源市市辖区', '441602': '广东省河源市源城区', '441621': '广东省河源市紫金县', '441622': '广东省河源市龙川县', '441623': '广东省河源市连平县', '441624': '广东省河源市和平县', '441625': '广东省河源市东源县', '441700': '广东省阳江市', '441701': '广东省阳江市市辖区', '441702': '广东省阳江市江城区', '441721': '广东省阳江市阳西县', '441723': '广东省阳江市阳东县', '441781': '广东省阳江市阳春市', '441800': '广东省清远市', '441801': '广东省清远市市辖区', '441802': '广东省清远市清城区', '441821': '广东省清远市佛冈县', '441823': '广东省清远市阳山县', '441825': '广东省清远市连山壮族瑶族自治县', '441826': '广东省清远市连南瑶族自治县', '441827': '广东省清远市清新县', '441881': '广东省清远市英德市', '441882': '广东省清远市连州市', '441900': '广东省东莞市', '441901': '广东省东莞市市辖区', '442000': '广东省中山市', '442001': '广东省中山市市辖区', '445100': '广东省潮州市', '445101': '广东省潮州市市辖区', '445102': '广东省潮州市湘桥区', '445121': '广东省潮州市潮安县', '445122': '广东省潮州市饶平县', '445200': '广东省揭阳市', '445201': '广东省揭阳市市辖区', '445202': '广东省揭阳市榕城区', '445221': '广东省揭阳市揭东县', '445222': '广东省揭阳市揭西县', '445224': '广东省揭阳市惠来县', '445281': '广东省揭阳市普宁市', '445300': '广东省云浮市', '445301': '广东省云浮市市辖区', '445302': '广东省云浮市云城区', '445321': '广东省云浮市新兴县', '445322': '广东省云浮市郁南县', '445323': '广东省云浮市云安县', '445381': '广东省云浮市罗定市', '450000': '广西壮族自治区', '450100': '广西壮族自治区南宁市', '450101': '广西壮族自治区南宁市市辖区', '450102': '广西壮族自治区南宁市兴宁区', '450103': '广西壮族自治区南宁市新城区', '450104': '广西壮族自治区南宁市城北区', '450105': '广西壮族自治区南宁市江南区', '450106': '广西壮族自治区南宁市永新区', '450111': '广西壮族自治区南宁市市郊区', '450121': '广西壮族自治区南宁市邕宁县', '450122': '广西壮族自治区南宁市武鸣县', '450200': '广西壮族自治区柳州市', '450201': '广西壮族自治区柳州市市辖区', '450202': '广西壮族自治区柳州市城中区', '450203': '广西壮族自治区柳州市鱼峰区', '450204': '广西壮族自治区柳州市柳南区', '450205': '广西壮族自治区柳州市柳北区', '450211': '广西壮族自治区柳州市市郊区', '450221': '广西壮族自治区柳州市柳江县', '450222': '广西壮族自治区柳州市柳城县', '450300': '广西壮族自治区桂林市', '450301': '广西壮族自治区桂林市市辖区', '450302': '广西壮族自治区桂林市秀峰区', '450303': '广西壮族自治区桂林市叠彩区', '450304': '广西壮族自治区桂林市象山区', '450305': '广西壮族自治区桂林市七星区', '450311': '广西壮族自治区桂林市雁山区', '450321': '广西壮族自治区桂林市阳朔县', '450322': '广西壮族自治区桂林市临桂县', '450323': '广西壮族自治区桂林市灵川县', '450324': '广西壮族自治区桂林市全州县', '450325': '广西壮族自治区桂林市兴安县', '450326': '广西壮族自治区桂林市永福县', '450327': '广西壮族自治区桂林市灌阳县', '450328': '广西壮族自治区桂林市龙胜各族自治县', '450329': '广西壮族自治区桂林市资源县', '450330': '广西壮族自治区桂林市平乐县', '450331': '广西壮族自治区桂林市荔浦县', '450332': '广西壮族自治区桂林市恭城瑶族自治县', '450400': '广西壮族自治区梧州市', '450401': '广西壮族自治区梧州市市辖区', '450403': '广西壮族自治区梧州市万秀区', '450404': '广西壮族自治区梧州市蝶山区', '450411': '广西壮族自治区梧州市市郊区', '450421': '广西壮族自治区梧州市苍梧县', '450422': '广西壮族自治区梧州市藤县', '450423': '广西壮族自治区梧州市蒙山县', '450481': '广西壮族自治区梧州市岑溪市', '450500': '广西壮族自治区北海市', '450501': '广西壮族自治区北海市市辖区', '450502': '广西壮族自治区北海市海城区', '450503': '广西壮族自治区北海市银海区', '450512': '广西壮族自治区北海市铁山港区', '450521': '广西壮族自治区北海市合浦县', '450600': '广西壮族自治区防城港市', '450601': '广西壮族自治区防城港市市辖区', '450602': '广西壮族自治区防城港市港口区', '450603': '广西壮族自治区防城港市防城区', '450621': '广西壮族自治区防城港市上思县', '450681': '广西壮族自治区防城港市东兴市', '450700': '广西壮族自治区钦州市', '450701': '广西壮族自治区钦州市市辖区', '450702': '广西壮族自治区钦州市钦南区', '450703': '广西壮族自治区钦州市钦北区', '450721': '广西壮族自治区钦州市灵山县', '450722': '广西壮族自治区钦州市浦北县', '450800': '广西壮族自治区贵港市', '450801': '广西壮族自治区贵港市市辖区', '450802': '广西壮族自治区贵港市港北区', '450803': '广西壮族自治区贵港市港南区', '450821': '广西壮族自治区贵港市平南县', '450881': '广西壮族自治区贵港市桂平市', '450900': '广西壮族自治区玉林市', '450901': '广西壮族自治区玉林市市辖区', '450902': '广西壮族自治区玉林市玉州区', '450921': '广西壮族自治区玉林市容县', '450922': '广西壮族自治区玉林市陆川县', '450923': '广西壮族自治区玉林市博白县', '450924': '广西壮族自治区玉林市兴业县', '450981': '广西壮族自治区玉林市北流市', '452100': '广西壮族自治区南宁地区', '452101': '广西壮族自治区南宁地区凭祥市', '452122': '广西壮族自治区南宁地区横县', '452123': '广西壮族自治区南宁地区宾阳县', '452124': '广西壮族自治区南宁地区上林县', '452126': '广西壮族自治区南宁地区隆安县', '452127': '广西壮族自治区南宁地区马山县', '452128': '广西壮族自治区南宁地区扶绥县', '452129': '广西壮族自治区南宁地区崇左县', '452130': '广西壮族自治区南宁地区大新县', '452131': '广西壮族自治区南宁地区天等县', '452132': '广西壮族自治区南宁地区宁明县', '452133': '广西壮族自治区南宁地区龙州县', '452200': '广西壮族自治区柳州地区', '452201': '广西壮族自治区柳州地区合山市', '452223': '广西壮族自治区柳州地区鹿寨县', '452224': '广西壮族自治区柳州地区象州县', '452225': '广西壮族自治区柳州地区武宣县', '452226': '广西壮族自治区柳州地区来宾县', '452227': '广西壮族自治区柳州地区融安县', '452228': '广西壮族自治区柳州地区三江侗族自治县', '452229': '广西壮族自治区柳州地区融水苗族自治县', '452230': '广西壮族自治区柳州地区金秀瑶族自治县', '452231': '广西壮族自治区柳州地区忻城县', '452400': '广西壮族自治区贺州地区', '452402': '广西壮族自治区贺州地区贺州市', '452424': '广西壮族自治区贺州地区昭平县', '452427': '广西壮族自治区贺州地区钟山县', '452428': '广西壮族自治区贺州地区富川瑶族自治县', '452600': '广西壮族自治区百色地区', '452601': '广西壮族自治区百色地区百色市', '452622': '广西壮族自治区百色地区田阳县', '452623': '广西壮族自治区百色地区田东县', '452624': '广西壮族自治区百色地区平果县', '452625': '广西壮族自治区百色地区德保县', '452626': '广西壮族自治区百色地区靖西县', '452627': '广西壮族自治区百色地区那坡县', '452628': '广西壮族自治区百色地区凌云县', '452629': '广西壮族自治区百色地区乐业县', '452630': '广西壮族自治区百色地区田林县', '452631': '广西壮族自治区百色地区隆林各族自治县', '452632': '广西壮族自治区百色地区西林县', '452700': '广西壮族自治区河池地区', '452701': '广西壮族自治区河池地区河池市', '452702': '广西壮族自治区河池地区宜州市', '452723': '广西壮族自治区河池地区罗城仫佬族自治县', '452724': '广西壮族自治区河池地区环江毛南族自治县', '452725': '广西壮族自治区河池地区南丹县', '452726': '广西壮族自治区河池地区天峨县', '452727': '广西壮族自治区河池地区凤山县', '452728': '广西壮族自治区河池地区东兰县', '452729': '广西壮族自治区河池地区巴马瑶族自治县', '452730': '广西壮族自治区河池地区都安瑶族自治县', '452731': '广西壮族自治区河池地区大化瑶族自治县', '460000': '海南省', '460001': '海南省三亚市通什市', '460002': '海南省三亚市琼海市', '460003': '海南省三亚市儋州市', '460004': '海南省三亚市琼山市', '460005': '海南省三亚市文昌市', '460006': '海南省三亚市万宁市', '460007': '海南省三亚市东方市', '460025': '海南省三亚市定安县', '460026': '海南省三亚市屯昌县', '460027': '海南省三亚市澄迈县', '460028': '海南省三亚市临高县', '460030': '海南省三亚市白沙黎族自治县', '460031': '海南省三亚市昌江黎族自治县', '460033': '海南省三亚市乐东黎族自治县', '460034': '海南省三亚市陵水黎族自治县', '460035': '海南省三亚市保亭黎族苗族自治县', '460036': '海南省三亚市琼中黎族苗族自治县', '460037': '海南省西沙群岛', '460038': '海南省南沙群岛', '460039': '海南省中沙群岛的岛礁及其海域', '460100': '海南省海口市', '460101': '海南省海口市市辖区', '460102': '海南省海口市振东区', '460103': '海南省海口市新华区', '460104': '海南省海口市秀英区', '460200': '海南省三亚市', '460201': '海南省三亚市市辖区', '500000': '重庆市', '500100': '重庆市市辖区', '500101': '重庆市万州区', '500102': '重庆市涪陵区', '500103': '重庆市渝中区', '500104': '重庆市大渡口区', '500105': '重庆市江北区', '500106': '重庆市沙坪坝区', '500107': '重庆市九龙坡区', '500108': '重庆市南岸区', '500109': '重庆市北碚区', '500110': '重庆市万盛区', '500111': '重庆市双桥区', '500112': '重庆市渝北区', '500113': '重庆市巴南区', '500200': '重庆市县', '500221': '重庆市长寿县', '500222': '重庆市綦江县', '500223': '重庆市潼南县', '500224': '重庆市铜梁县', '500225': '重庆市大足县', '500226': '重庆市荣昌县', '500227': '重庆市璧山县', '500228': '重庆市梁平县', '500229': '重庆市城口县', '500230': '重庆市丰都县', '500231': '重庆市垫江县', '500232': '重庆市武隆县', '500233': '重庆市忠县', '500234': '重庆市开县', '500235': '重庆市云阳县', '500236': '重庆市奉节县', '500237': '重庆市巫山县', '500238': '重庆市巫溪县', '500239': '重庆市黔江土家族苗族自治县', '500240': '重庆市石柱土家族自治县', '500241': '重庆市秀山土家族苗族自治县', '500242': '重庆市酉阳土家族苗族自治县', '500243': '重庆市彭水苗族土家族自治县', '500300': '重庆市(市)', '500381': '重庆市江津市', '500382': '重庆市合川市', '500383': '重庆市永川市', '500384': '重庆市南川市', '510000': '四川省', '510100': '四川省成都市', '510101': '四川省成都市市辖区', '510104': '四川省成都市锦江区', '510105': '四川省成都市青羊区', '510106': '四川省成都市金牛区', '510107': '四川省成都市武侯区', '510108': '四川省成都市成华区', '510112': '四川省成都市龙泉驿区', '510113': '四川省成都市青白江区', '510121': '四川省成都市金堂县', '510122': '四川省成都市双流县', '510123': '四川省成都市温江县', '510124': '四川省成都市郫县', '510125': '四川省成都市新都县', '510129': '四川省成都市大邑县', '510131': '四川省成都市蒲江县', '510132': '四川省成都市新津县', '510181': '四川省成都市都江堰市', '510182': '四川省成都市彭州市', '510183': '四川省成都市邛崃市', '510184': '四川省成都市崇州市', '510300': '四川省自贡市', '510301': '四川省自贡市市辖区', '510302': '四川省自贡市自流井区', '510303': '四川省自贡市贡井区', '510304': '四川省自贡市大安区', '510311': '四川省自贡市沿滩区', '510321': '四川省自贡市荣县', '510322': '四川省自贡市富顺县', '510400': '四川省攀枝花市', '510401': '四川省攀枝花市市辖区', '510402': '四川省攀枝花市东区', '510403': '四川省攀枝花市西区', '510411': '四川省攀枝花市仁和区', '510421': '四川省攀枝花市米易县', '510422': '四川省攀枝花市盐边县', '510500': '四川省泸州市', '510501': '四川省泸州市市辖区', '510502': '四川省泸州市江阳区', '510503': '四川省泸州市纳溪区', '510504': '四川省泸州市龙马潭区', '510521': '四川省泸州市泸县', '510522': '四川省泸州市合江县', '510524': '四川省泸州市叙永县', '510525': '四川省泸州市古蔺县', '510600': '四川省德阳市', '510601': '四川省德阳市市辖区', '510603': '四川省德阳市旌阳区', '510623': '四川省德阳市中江县', '510626': '四川省德阳市罗江县', '510681': '四川省德阳市广汉市', '510682': '四川省德阳市什邡市', '510683': '四川省德阳市绵竹市', '510700': '四川省绵阳市', '510701': '四川省绵阳市市辖区', '510703': '四川省绵阳市涪城区', '510704': '四川省绵阳市游仙区', '510722': '四川省绵阳市三台县', '510723': '四川省绵阳市盐亭县', '510724': '四川省绵阳市安县', '510725': '四川省绵阳市梓潼县', '510726': '四川省绵阳市北川县', '510727': '四川省绵阳市平武县', '510781': '四川省绵阳市江油市', '510800': '四川省广元市', '510801': '四川省广元市市辖区', '510802': '四川省广元市市中区', '510811': '四川省广元市元坝区', '510812': '四川省广元市朝天区', '510821': '四川省广元市旺苍县', '510822': '四川省广元市青川县', '510823': '四川省广元市剑阁县', '510824': '四川省广元市苍溪县', '510900': '四川省遂宁市', '510901': '四川省遂宁市市辖区', '510902': '四川省遂宁市市中区', '510921': '四川省遂宁市蓬溪县', '510922': '四川省遂宁市射洪县', '510923': '四川省遂宁市大英县', '511000': '四川省内江市', '511001': '四川省内江市市辖区', '511002': '四川省内江市市中区', '511011': '四川省内江市东兴区', '511024': '四川省内江市威远县', '511025': '四川省内江市资中县', '511028': '四川省内江市隆昌县', '511100': '四川省乐山市', '511101': '四川省乐山市市辖区', '511102': '四川省乐山市市中区', '511111': '四川省乐山市沙湾区', '511112': '四川省乐山市五通桥区', '511113': '四川省乐山市金口河区', '511123': '四川省乐山市犍为县', '511124': '四川省乐山市井研县', '511126': '四川省乐山市夹江县', '511129': '四川省乐山市沐川县', '511132': '四川省乐山市峨边彝族自治县', '511133': '四川省乐山市马边彝族自治县', '511181': '四川省乐山市峨眉山市', '511300': '四川省南充市', '511301': '四川省南充市市辖区', '511302': '四川省南充市顺庆区', '511303': '四川省南充市高坪区', '511304': '四川省南充市嘉陵区', '511321': '四川省南充市南部县', '511322': '四川省南充市营山县', '511323': '四川省南充市蓬安县', '511324': '四川省南充市仪陇县', '511325': '四川省南充市西充县', '511381': '四川省南充市阆中市', '511500': '四川省宜宾市', '511501': '四川省宜宾市市辖区', '511502': '四川省宜宾市翠屏区', '511521': '四川省宜宾市宜宾县', '511522': '四川省宜宾市南溪县', '511523': '四川省宜宾市江安县', '511524': '四川省宜宾市长宁县', '511525': '四川省宜宾市高县', '511526': '四川省宜宾市珙县', '511527': '四川省宜宾市筠连县', '511528': '四川省宜宾市兴文县', '511529': '四川省宜宾市屏山县', '511600': '四川省广安市', '511601': '四川省广安市市辖区', '511602': '四川省广安市广安区', '511621': '四川省广安市岳池县', '511622': '四川省广安市武胜县', '511623': '四川省广安市邻水县', '511681': '四川省广安市华蓥市', '513000': '四川省达川地区', '513001': '四川省达川地区达川市', '513002': '四川省达川地区万源市', '513021': '四川省达川地区达县', '513022': '四川省达川地区宣汉县', '513023': '四川省达川地区开江县', '513029': '四川省达川地区大竹县', '513030': '四川省达川地区渠县', '513100': '四川省雅安地区', '513101': '四川省雅安地区雅安市', '513122': '四川省雅安地区名山县', '513123': '四川省雅安地区荥经县', '513124': '四川省雅安地区汉源县', '513125': '四川省雅安地区石棉县', '513126': '四川省雅安地区天全县', '513127': '四川省雅安地区芦山县', '513128': '四川省雅安地区宝兴县', '513200': '四川省阿坝藏族羌族自治州', '513221': '四川省阿坝藏族羌族自治州汶川县', '513222': '四川省阿坝藏族羌族自治州理县', '513223': '四川省阿坝藏族羌族自治州茂县', '513224': '四川省阿坝藏族羌族自治州松潘县', '513225': '四川省阿坝藏族羌族自治州九寨沟县', '513226': '四川省阿坝藏族羌族自治州金川县', '513227': '四川省阿坝藏族羌族自治州小金县', '513228': '四川省阿坝藏族羌族自治州黑水县', '513229': '四川省阿坝藏族羌族自治州马尔康县', '513230': '四川省阿坝藏族羌族自治州壤塘县', '513231': '四川省阿坝藏族羌族自治州阿坝县', '513232': '四川省阿坝藏族羌族自治州若尔盖县', '513233': '四川省阿坝藏族羌族自治州红原县', '513300': '四川省甘孜藏族自治州', '513321': '四川省甘孜藏族自治州康定县', '513322': '四川省甘孜藏族自治州泸定县', '513323': '四川省甘孜藏族自治州丹巴县', '513324': '四川省甘孜藏族自治州九龙县', '513325': '四川省甘孜藏族自治州雅江县', '513326': '四川省甘孜藏族自治州道孚县', '513327': '四川省甘孜藏族自治州炉霍县', '513328': '四川省甘孜藏族自治州甘孜县', '513329': '四川省甘孜藏族自治州新龙县', '513330': '四川省甘孜藏族自治州德格县', '513331': '四川省甘孜藏族自治州白玉县', '513332': '四川省甘孜藏族自治州石渠县', '513333': '四川省甘孜藏族自治州色达县', '513334': '四川省甘孜藏族自治州理塘县', '513335': '四川省甘孜藏族自治州巴塘县', '513336': '四川省甘孜藏族自治州乡城县', '513337': '四川省甘孜藏族自治州稻城县', '513338': '四川省甘孜藏族自治州得荣县', '513400': '四川省凉山彝族自治州', '513401': '四川省凉山彝族自治州西昌市', '513422': '四川省凉山彝族自治州木里藏族自治县', '513423': '四川省凉山彝族自治州盐源县', '513424': '四川省凉山彝族自治州德昌县', '513425': '四川省凉山彝族自治州会理县', '513426': '四川省凉山彝族自治州会东县', '513427': '四川省凉山彝族自治州宁南县', '513428': '四川省凉山彝族自治州普格县', '513429': '四川省凉山彝族自治州布拖县', '513430': '四川省凉山彝族自治州金阳县', '513431': '四川省凉山彝族自治州昭觉县', '513432': '四川省凉山彝族自治州喜德县', '513433': '四川省凉山彝族自治州冕宁县', '513434': '四川省凉山彝族自治州越西县', '513435': '四川省凉山彝族自治州甘洛县', '513436': '四川省凉山彝族自治州美姑县', '513437': '四川省凉山彝族自治州雷波县', '513700': '四川省巴中地区', '513701': '四川省巴中地区巴中市', '513721': '四川省巴中地区通江县', '513722': '四川省巴中地区南江县', '513723': '四川省巴中地区平昌县', '513800': '四川省眉山地区', '513821': '四川省眉山地区眉山县', '513822': '四川省眉山地区仁寿县', '513823': '四川省眉山地区彭山县', '513824': '四川省眉山地区洪雅县', '513825': '四川省眉山地区丹棱县', '513826': '四川省眉山地区青神县', '513900': '四川省眉山地区资阳地区', '513901': '四川省眉山地区资阳市', '513902': '四川省眉山地区简阳市', '513921': '四川省眉山地区安岳县', '513922': '四川省眉山地区乐至县', '520000': '贵州省', '520100': '贵州省贵阳市', '520101': '贵州省贵阳市市辖区', '520102': '贵州省贵阳市南明区', '520103': '贵州省贵阳市云岩区', '520111': '贵州省贵阳市花溪区', '520112': '贵州省贵阳市乌当区', '520113': '贵州省贵阳市白云区', '520121': '贵州省贵阳市开阳县', '520122': '贵州省贵阳市息烽县', '520123': '贵州省贵阳市修文县', '520181': '贵州省贵阳市清镇市', '520200': '贵州省六盘水市', '520201': '贵州省六盘水市钟山区', '520202': '贵州省六盘水市盘县特区', '520203': '贵州省六盘水市六枝特区', '520221': '贵州省六盘水市水城县', '520300': '贵州省遵义市', '520301': '贵州省遵义市市辖区', '520302': '贵州省遵义市红花岗区', '520321': '贵州省遵义市遵义县', '520322': '贵州省遵义市桐梓县', '520323': '贵州省遵义市绥阳县', '520324': '贵州省遵义市正安县', '520325': '贵州省遵义市道真仡佬族苗族自治县', '520326': '贵州省遵义市务川仡佬族苗族自治县', '520327': '贵州省遵义市凤冈县', '520328': '贵州省遵义市湄潭县', '520329': '贵州省遵义市余庆县', '520330': '贵州省遵义市习水县', '520381': '贵州省遵义市赤水市', '520382': '贵州省遵义市仁怀市', '522200': '贵州省铜仁地区', '522201': '贵州省铜仁地区铜仁市', '522222': '贵州省铜仁地区江口县', '522223': '贵州省铜仁地区玉屏侗族自治县', '522224': '贵州省铜仁地区石阡县', '522225': '贵州省铜仁地区思南县', '522226': '贵州省铜仁地区印江土家族苗族自治县', '522227': '贵州省铜仁地区德江县', '522228': '贵州省铜仁地区沿河土家族自治县', '522229': '贵州省铜仁地区松桃苗族自治县', '522230': '贵州省铜仁地区万山特区', '522300': '贵州省黔西南布依族苗族自治州', '522301': '贵州省黔西南布依族苗族自治州兴义市', '522322': '贵州省黔西南布依族苗族自治州兴仁县', '522323': '贵州省黔西南布依族苗族自治州普安县', '522324': '贵州省黔西南布依族苗族自治州晴隆县', '522325': '贵州省黔西南布依族苗族自治州贞丰县', '522326': '贵州省黔西南布依族苗族自治州望谟县', '522327': '贵州省黔西南布依族苗族自治州册亨县', '522328': '贵州省黔西南布依族苗族自治州安龙县', '522400': '贵州省毕节地区', '522401': '贵州省毕节地区毕节市', '522422': '贵州省毕节地区大方县', '522423': '贵州省毕节地区黔西县', '522424': '贵州省毕节地区金沙县', '522425': '贵州省毕节地区织金县', '522426': '贵州省毕节地区纳雍县', '522427': '贵州省毕节地区威宁彝族回族苗族自治县', '522428': '贵州省毕节地区赫章县', '522500': '贵州省安顺地区', '522501': '贵州省安顺地区安顺市', '522526': '贵州省安顺地区平坝县', '522527': '贵州省安顺地区普定县', '522528': '贵州省安顺地区关岭布依族苗族自治县', '522529': '贵州省安顺地区镇宁布依族苗族自治县', '522530': '贵州省安顺地区紫云苗族布依族自治县', '522600': '贵州省黔东南苗族侗族自治州', '522601': '贵州省黔东南苗族侗族自治州凯里市', '522622': '贵州省黔东南苗族侗族自治州黄平县', '522623': '贵州省黔东南苗族侗族自治州施秉县', '522624': '贵州省黔东南苗族侗族自治州三穗县', '522625': '贵州省黔东南苗族侗族自治州镇远县', '522626': '贵州省黔东南苗族侗族自治州岑巩县', '522627': '贵州省黔东南苗族侗族自治州天柱县', '522628': '贵州省黔东南苗族侗族自治州锦屏县', '522629': '贵州省黔东南苗族侗族自治州剑河县', '522630': '贵州省黔东南苗族侗族自治州台江县', '522631': '贵州省黔东南苗族侗族自治州黎平县', '522632': '贵州省黔东南苗族侗族自治州榕江县', '522633': '贵州省黔东南苗族侗族自治州从江县', '522634': '贵州省黔东南苗族侗族自治州雷山县', '522635': '贵州省黔东南苗族侗族自治州麻江县', '522636': '贵州省黔东南苗族侗族自治州丹寨县', '522700': '贵州省黔南布依族苗族自治州', '522701': '贵州省黔南布依族苗族自治州都匀市', '522702': '贵州省黔南布依族苗族自治州福泉市', '522722': '贵州省黔南布依族苗族自治州荔波县', '522723': '贵州省黔南布依族苗族自治州贵定县', '522725': '贵州省黔南布依族苗族自治州瓮安县', '522726': '贵州省黔南布依族苗族自治州独山县', '522727': '贵州省黔南布依族苗族自治州平塘县', '522728': '贵州省黔南布依族苗族自治州罗甸县', '522729': '贵州省黔南布依族苗族自治州长顺县', '522730': '贵州省黔南布依族苗族自治州龙里县', '522731': '贵州省黔南布依族苗族自治州惠水县', '522732': '贵州省黔南布依族苗族自治州三都水族自治县', '530000': '云南省', '530100': '云南省昆明市', '530101': '云南省昆明市市辖区', '530102': '云南省昆明市五华区', '530103': '云南省昆明市盘龙区', '530111': '云南省昆明市官渡区', '530112': '云南省昆明市西山区', '530113': '云南省昆明市东川区', '530121': '云南省昆明市呈贡县', '530122': '云南省昆明市晋宁县', '530124': '云南省昆明市富民县', '530125': '云南省昆明市宜良县', '530126': '云南省昆明市石林彝族自治县', '530127': '云南省昆明市嵩明县', '530128': '云南省昆明市禄劝彝族苗族自治县', '530129': '云南省昆明市寻甸回族彝族自治县', '530181': '云南省昆明市安宁市', '530300': '云南省曲靖市', '530301': '云南省曲靖市市辖区', '530302': '云南省曲靖市麒麟区', '530321': '云南省曲靖市马龙县', '530322': '云南省曲靖市陆良县', '530323': '云南省曲靖市师宗县', '530324': '云南省曲靖市罗平县', '530325': '云南省曲靖市富源县', '530326': '云南省曲靖市会泽县', '530328': '云南省曲靖市沾益县', '530381': '云南省曲靖市宣威市', '530400': '云南省玉溪市', '530401': '云南省玉溪市市辖区', '530402': '云南省玉溪市红塔区', '530421': '云南省玉溪市江川县', '530422': '云南省玉溪市澄江县', '530423': '云南省玉溪市通海县', '530424': '云南省玉溪市华宁县', '530425': '云南省玉溪市易门县', '530426': '云南省玉溪市峨山彝族自治县', '530427': '云南省玉溪市新平彝族傣族自治县', '530428': '云南省玉溪市元江哈尼族彝族傣族自治县', '532100': '云南省昭通地区', '532101': '云南省昭通地区昭通市', '532122': '云南省昭通地区鲁甸县', '532123': '云南省昭通地区巧家县', '532124': '云南省昭通地区盐津县', '532125': '云南省昭通地区大关县', '532126': '云南省昭通地区永善县', '532127': '云南省昭通地区绥江县', '532128': '云南省昭通地区镇雄县', '532129': '云南省昭通地区彝良县', '532130': '云南省昭通地区威信县', '532131': '云南省昭通地区水富县', '532300': '云南省楚雄彝族自治州', '532301': '云南省楚雄彝族自治州楚雄市', '532322': '云南省楚雄彝族自治州双柏县', '532323': '云南省楚雄彝族自治州牟定县', '532324': '云南省楚雄彝族自治州南华县', '532325': '云南省楚雄彝族自治州姚安县', '532326': '云南省楚雄彝族自治州大姚县', '532327': '云南省楚雄彝族自治州永仁县', '532328': '云南省楚雄彝族自治州元谋县', '532329': '云南省楚雄彝族自治州武定县', '532331': '云南省楚雄彝族自治州禄丰县', '532500': '云南省红河哈尼族彝族自治州', '532501': '云南省红河哈尼族彝族自治州个旧市', '532502': '云南省红河哈尼族彝族自治州开远市', '532522': '云南省红河哈尼族彝族自治州蒙自县', '532523': '云南省红河哈尼族彝族自治州屏边苗族自治县', '532524': '云南省红河哈尼族彝族自治州建水县', '532525': '云南省红河哈尼族彝族自治州石屏县', '532526': '云南省红河哈尼族彝族自治州弥勒县', '532527': '云南省红河哈尼族彝族自治州泸西县', '532528': '云南省红河哈尼族彝族自治州元阳县', '532529': '云南省红河哈尼族彝族自治州红河县', '532530': '云南省红河哈尼族彝族自治州金平苗族瑶族傣族自治县', '532531': '云南省红河哈尼族彝族自治州绿春县', '532532': '云南省红河哈尼族彝族自治州河口瑶族自治县', '532600': '云南省文山壮族苗族自治州', '532621': '云南省文山壮族苗族自治州文山县', '532622': '云南省文山壮族苗族自治州砚山县', '532623': '云南省文山壮族苗族自治州西畴县', '532624': '云南省文山壮族苗族自治州麻栗坡县', '532625': '云南省文山壮族苗族自治州马关县', '532626': '云南省文山壮族苗族自治州丘北县', '532627': '云南省文山壮族苗族自治州广南县', '532628': '云南省文山壮族苗族自治州富宁县', '532700': '云南省思茅地区', '532701': '云南省思茅地区思茅市', '532722': '云南省思茅地区普洱哈尼族彝族自治县', '532723': '云南省思茅地区墨江哈尼族自治县', '532724': '云南省思茅地区景东彝族自治县', '532725': '云南省思茅地区景谷傣族彝族自治县', '532726': '云南省思茅地区镇沅彝族哈尼族拉祜族自治县', '532727': '云南省思茅地区江城哈尼族彝族自治县', '532728': '云南省思茅地区孟连傣族拉祜族佤族自治县', '532729': '云南省思茅地区澜沧拉祜族自治县', '532730': '云南省思茅地区西盟佤族自治县', '532800': '云南省西双版纳傣族自治州', '532801': '云南省西双版纳傣族自治州景洪市', '532822': '云南省西双版纳傣族自治州勐海县', '532823': '云南省西双版纳傣族自治州勐腊县', '532900': '云南省大理白族自治州', '532901': '云南省大理白族自治州大理市', '532922': '云南省大理白族自治州漾濞彝族自治县', '532923': '云南省大理白族自治州祥云县', '532924': '云南省大理白族自治州宾川县', '532925': '云南省大理白族自治州弥渡县', '532926': '云南省大理白族自治州南涧彝族自治县', '532927': '云南省大理白族自治州巍山彝族回族自治县', '532928': '云南省大理白族自治州永平县', '532929': '云南省大理白族自治州云龙县', '532930': '云南省大理白族自治州洱源县', '532931': '云南省大理白族自治州剑川县', '532932': '云南省大理白族自治州鹤庆县', '533000': '云南省保山地区', '533001': '云南省保山地区保山市', '533022': '云南省保山地区施甸县', '533023': '云南省保山地区腾冲县', '533024': '云南省保山地区龙陵县', '533025': '云南省保山地区昌宁县', '533100': '云南省德宏傣族景颇族自治州', '533101': '云南省德宏傣族景颇族自治州畹町市', '533102': '云南省德宏傣族景颇族自治州瑞丽市', '533103': '云南省德宏傣族景颇族自治州潞西市', '533122': '云南省德宏傣族景颇族自治州梁河县', '533123': '云南省德宏傣族景颇族自治州盈江县', '533124': '云南省德宏傣族景颇族自治州陇川县', '533200': '云南省丽江地区', '533221': '云南省丽江地区丽江纳西族自治县', '533222': '云南省丽江地区永胜县', '533223': '云南省丽江地区华坪县', '533224': '云南省丽江地区宁蒗彝族自治县', '533300': '云南省怒江傈僳族自治州', '533321': '云南省怒江傈僳族自治州泸水县', '533323': '云南省怒江傈僳族自治州福贡县', '533324': '云南省怒江傈僳族自治州贡山独龙族怒族自治县', '533325': '云南省怒江傈僳族自治州兰坪白族普米族自治县', '533400': '云南省迪庆藏族自治州', '533421': '云南省迪庆藏族自治州中甸县', '533422': '云南省迪庆藏族自治州德钦县', '533423': '云南省迪庆藏族自治州维西傈僳族自治县', '533500': '云南省临沧地区', '533521': '云南省临沧地区临沧县', '533522': '云南省临沧地区凤庆县', '533523': '云南省临沧地区云县', '533524': '云南省临沧地区永德县', '533525': '云南省临沧地区镇康县', '533526': '云南省临沧地区双江拉祜族佤族布朗族傣族自治县', '533527': '云南省临沧地区耿马傣族佤族自治县', '533528': '云南省临沧地区沧源佤族自治县', '540000': '西藏自治区', '540100': '西藏自治区拉萨市', '540101': '西藏自治区拉萨市市辖区', '540102': '西藏自治区拉萨市城关区', '540121': '西藏自治区拉萨市林周县', '540122': '西藏自治区拉萨市当雄县', '540123': '西藏自治区拉萨市尼木县', '540124': '西藏自治区拉萨市曲水县', '540125': '西藏自治区拉萨市堆龙德庆县', '540126': '西藏自治区拉萨市达孜县', '540127': '西藏自治区拉萨市墨竹工卡县', '542100': '西藏自治区昌都地区', '542121': '西藏自治区昌都地区昌都县', '542122': '西藏自治区昌都地区江达县', '542123': '西藏自治区昌都地区贡觉县', '542124': '西藏自治区昌都地区类乌齐县', '542125': '西藏自治区昌都地区丁青县', '542126': '西藏自治区昌都地区察雅县', '542127': '西藏自治区昌都地区八宿县', '542128': '西藏自治区昌都地区左贡县', '542129': '西藏自治区昌都地区芒康县', '542132': '西藏自治区昌都地区洛隆县', '542133': '西藏自治区昌都地区边坝县', '542134': '西藏自治区昌都地区盐井县', '542135': '西藏自治区昌都地区碧土县', '542136': '西藏自治区昌都地区妥坝县', '542137': '西藏自治区昌都地区生达县', '542200': '西藏自治区山南地区', '542221': '西藏自治区山南地区乃东县', '542222': '西藏自治区山南地区扎囊县', '542223': '西藏自治区山南地区贡嘎县', '542224': '西藏自治区山南地区桑日县', '542225': '西藏自治区山南地区琼结县', '542226': '西藏自治区山南地区曲松县', '542227': '西藏自治区山南地区措美县', '542228': '西藏自治区山南地区洛扎县', '542229': '西藏自治区山南地区加查县', '542231': '西藏自治区山南地区隆子县', '542232': '西藏自治区山南地区错那县', '542233': '西藏自治区山南地区浪卡子县', '542300': '西藏自治区日喀则地区', '542301': '西藏自治区日喀则地区日喀则市', '542322': '西藏自治区日喀则地区南木林县', '542323': '西藏自治区日喀则地区江孜县', '542324': '西藏自治区日喀则地区定日县', '542325': '西藏自治区日喀则地区萨迦县', '542326': '西藏自治区日喀则地区拉孜县', '542327': '西藏自治区日喀则地区昂仁县', '542328': '西藏自治区日喀则地区谢通门县', '542329': '西藏自治区日喀则地区白朗县', '542330': '西藏自治区日喀则地区仁布县', '542331': '西藏自治区日喀则地区康马县', '542332': '西藏自治区日喀则地区定结县', '542333': '西藏自治区日喀则地区仲巴县', '542334': '西藏自治区日喀则地区亚东县', '542335': '西藏自治区日喀则地区吉隆县', '542336': '西藏自治区日喀则地区聂拉木县', '542337': '西藏自治区日喀则地区萨嘎县', '542338': '西藏自治区日喀则地区岗巴县', '542400': '西藏自治区那曲地区', '542421': '西藏自治区那曲地区那曲县', '542422': '西藏自治区那曲地区嘉黎县', '542423': '西藏自治区那曲地区比如县', '542424': '西藏自治区那曲地区聂荣县', '542425': '西藏自治区那曲地区安多县', '542426': '西藏自治区那曲地区申扎县', '542427': '西藏自治区那曲地区索县', '542428': '西藏自治区那曲地区班戈县', '542429': '西藏自治区那曲地区巴青县', '542430': '西藏自治区那曲地区尼玛县', '542500': '西藏自治区阿里地区', '542521': '西藏自治区阿里地区普兰县', '542522': '西藏自治区阿里地区札达县', '542523': '西藏自治区阿里地区噶尔县', '542524': '西藏自治区阿里地区日土县', '542525': '西藏自治区阿里地区革吉县', '542526': '西藏自治区阿里地区改则县', '542527': '西藏自治区阿里地区措勤县', '542528': '西藏自治区阿里地区隆格尔县', '542600': '西藏自治区林芝地区', '542621': '西藏自治区林芝地区林芝县', '542622': '西藏自治区林芝地区工布江达县', '542623': '西藏自治区林芝地区米林县', '542624': '西藏自治区林芝地区墨脱县', '542625': '西藏自治区林芝地区波密县', '542626': '西藏自治区林芝地区察隅县', '542627': '西藏自治区林芝地区朗县', '610000': '陕西省', '610100': '陕西省西安市', '610101': '陕西省西安市市辖区', '610102': '陕西省西安市新城区', '610103': '陕西省西安市碑林区', '610104': '陕西省西安市莲湖区', '610111': '陕西省西安市灞桥区', '610112': '陕西省西安市未央区', '610113': '陕西省西安市雁塔区', '610114': '陕西省西安市阎良区', '610115': '陕西省西安市临潼区', '610121': '陕西省西安市长安县', '610122': '陕西省西安市蓝田县', '610124': '陕西省西安市周至县', '610125': '陕西省西安市户县', '610126': '陕西省西安市高陵县', '610200': '陕西省铜川市', '610201': '陕西省铜川市市辖区', '610202': '陕西省铜川市城区', '610203': '陕西省铜川市郊区', '610221': '陕西省铜川市耀县', '610222': '陕西省铜川市宜君县', '610300': '陕西省宝鸡市', '610301': '陕西省宝鸡市市辖区', '610302': '陕西省宝鸡市渭滨区', '610303': '陕西省宝鸡市金台区', '610321': '陕西省宝鸡市宝鸡县', '610322': '陕西省宝鸡市凤翔县', '610323': '陕西省宝鸡市岐山县', '610324': '陕西省宝鸡市扶风县', '610326': '陕西省宝鸡市眉县', '610327': '陕西省宝鸡市陇县', '610328': '陕西省宝鸡市千阳县', '610329': '陕西省宝鸡市麟游县', '610330': '陕西省宝鸡市凤县', '610331': '陕西省宝鸡市太白县', '610400': '陕西省咸阳市', '610401': '陕西省咸阳市市辖区', '610402': '陕西省咸阳市秦都区', '610403': '陕西省咸阳市杨陵区', '610404': '陕西省咸阳市渭城区', '610422': '陕西省咸阳市三原县', '610423': '陕西省咸阳市泾阳县', '610424': '陕西省咸阳市乾县', '610425': '陕西省咸阳市礼泉县', '610426': '陕西省咸阳市永寿县', '610427': '陕西省咸阳市彬县', '610428': '陕西省咸阳市长武县', '610429': '陕西省咸阳市旬邑县', '610430': '陕西省咸阳市淳化县', '610431': '陕西省咸阳市武功县', '610481': '陕西省咸阳市兴平市', '610500': '陕西省渭南市', '610501': '陕西省渭南市市辖区', '610502': '陕西省渭南市临渭区', '610521': '陕西省渭南市华县', '610522': '陕西省渭南市潼关县', '610523': '陕西省渭南市大荔县', '610524': '陕西省渭南市合阳县', '610525': '陕西省渭南市澄城县', '610526': '陕西省渭南市蒲城县', '610527': '陕西省渭南市白水县', '610528': '陕西省渭南市富平县', '610581': '陕西省渭南市韩城市', '610582': '陕西省渭南市华阴市', '610600': '陕西省延安市', '610601': '陕西省延安市市辖区', '610602': '陕西省延安市宝塔区', '610621': '陕西省延安市延长县', '610622': '陕西省延安市延川县', '610623': '陕西省延安市子长县', '610624': '陕西省延安市安塞县', '610625': '陕西省延安市志丹县', '610626': '陕西省延安市吴旗县', '610627': '陕西省延安市甘泉县', '610628': '陕西省延安市富县', '610629': '陕西省延安市洛川县', '610630': '陕西省延安市宜川县', '610631': '陕西省延安市黄龙县', '610632': '陕西省延安市黄陵县', '610700': '陕西省汉中市', '610701': '陕西省汉中市市辖区', '610702': '陕西省汉中市汉台区', '610721': '陕西省汉中市南郑县', '610722': '陕西省汉中市城固县', '610723': '陕西省汉中市洋县', '610724': '陕西省汉中市西乡县', '610725': '陕西省汉中市勉县', '610726': '陕西省汉中市宁强县', '610727': '陕西省汉中市略阳县', '610728': '陕西省汉中市镇巴县', '610729': '陕西省汉中市留坝县', '610730': '陕西省汉中市佛坪县', '612400': '陕西省安康地区', '612401': '陕西省安康地区安康市', '612422': '陕西省安康地区汉阴县', '612423': '陕西省安康地区石泉县', '612424': '陕西省安康地区宁陕县', '612425': '陕西省安康地区紫阳县', '612426': '陕西省安康地区岚皋县', '612427': '陕西省安康地区平利县', '612428': '陕西省安康地区镇坪县', '612429': '陕西省安康地区旬阳县', '612430': '陕西省安康地区白河县', '612500': '陕西省商洛地区', '612501': '陕西省商洛地区商州市', '612522': '陕西省商洛地区洛南县', '612523': '陕西省商洛地区丹凤县', '612524': '陕西省商洛地区商南县', '612525': '陕西省商洛地区山阳县', '612526': '陕西省商洛地区镇安县', '612527': '陕西省商洛地区柞水县', '612700': '陕西省榆林地区', '612701': '陕西省榆林地区榆林市', '612722': '陕西省榆林地区神木县', '612723': '陕西省榆林地区府谷县', '612724': '陕西省榆林地区横山县', '612725': '陕西省榆林地区靖边县', '612726': '陕西省榆林地区定边县', '612727': '陕西省榆林地区绥德县', '612728': '陕西省榆林地区米脂县', '612729': '陕西省榆林地区佳县', '612730': '陕西省榆林地区吴堡县', '612731': '陕西省榆林地区清涧县', '612732': '陕西省榆林地区子洲县', '620000': '甘肃省', '620100': '甘肃省兰州市', '620101': '甘肃省兰州市市辖区', '620102': '甘肃省兰州市城关区', '620103': '甘肃省兰州市七里河区', '620104': '甘肃省兰州市西固区', '620105': '甘肃省兰州市安宁区', '620111': '甘肃省兰州市红古区', '620121': '甘肃省兰州市永登县', '620122': '甘肃省兰州市皋兰县', '620123': '甘肃省兰州市榆中县', '620200': '甘肃省嘉峪关市', '620201': '甘肃省嘉峪关市市辖区', '620300': '甘肃省嘉峪关市金昌市', '620301': '甘肃省嘉峪关市市辖区', '620302': '甘肃省嘉峪关市金川区', '620321': '甘肃省嘉峪关市永昌县', '620400': '甘肃省白银市', '620401': '甘肃省白银市市辖区', '620402': '甘肃省白银市白银区', '620403': '甘肃省白银市平川区', '620421': '甘肃省白银市靖远县', '620422': '甘肃省白银市会宁县', '620423': '甘肃省白银市景泰县', '620500': '甘肃省天水市', '620501': '甘肃省天水市市辖区', '620502': '甘肃省天水市秦城区', '620503': '甘肃省天水市北道区', '620521': '甘肃省天水市清水县', '620522': '甘肃省天水市秦安县', '620523': '甘肃省天水市甘谷县', '620524': '甘肃省天水市武山县', '620525': '甘肃省天水市张家川回族自治县', '622100': '甘肃省酒泉地区', '622101': '甘肃省酒泉地区玉门市', '622102': '甘肃省酒泉地区酒泉市', '622103': '甘肃省酒泉地区敦煌市', '622123': '甘肃省酒泉地区金塔县', '622124': '甘肃省酒泉地区肃北蒙古族自治县', '622125': '甘肃省酒泉地区阿克塞哈萨克族自治县', '622126': '甘肃省酒泉地区安西县', '622200': '甘肃省张掖地区', '622201': '甘肃省张掖地区张掖市', '622222': '甘肃省张掖地区肃南裕固族自治县', '622223': '甘肃省张掖地区民乐县', '622224': '甘肃省张掖地区临泽县', '622225': '甘肃省张掖地区高台县', '622226': '甘肃省张掖地区山丹县', '622300': '甘肃省武威地区', '622301': '甘肃省武威地区武威市', '622322': '甘肃省武威地区民勤县', '622323': '甘肃省武威地区古浪县', '622326': '甘肃省武威地区天祝藏族自治县', '622400': '甘肃省定西地区', '622421': '甘肃省定西地区定西县', '622424': '甘肃省定西地区通渭县', '622425': '甘肃省定西地区陇西县', '622426': '甘肃省定西地区渭源县', '622427': '甘肃省定西地区临洮县', '622428': '甘肃省定西地区漳县', '622429': '甘肃省定西地区岷县', '622600': '甘肃省陇南地区', '622621': '甘肃省陇南地区武都县', '622623': '甘肃省陇南地区宕昌县', '622624': '甘肃省陇南地区成县', '622625': '甘肃省陇南地区康县', '622626': '甘肃省陇南地区文县', '622627': '甘肃省陇南地区西和县', '622628': '甘肃省陇南地区礼县', '622629': '甘肃省陇南地区两当县', '622630': '甘肃省陇南地区徽县', '622700': '甘肃省平凉地区', '622701': '甘肃省平凉地区平凉市', '622722': '甘肃省平凉地区泾川县', '622723': '甘肃省平凉地区灵台县', '622724': '甘肃省平凉地区崇信县', '622725': '甘肃省平凉地区华亭县', '622726': '甘肃省平凉地区庄浪县', '622727': '甘肃省平凉地区静宁县', '622800': '甘肃省庆阳地区', '622801': '甘肃省庆阳地区西峰市', '622821': '甘肃省庆阳地区庆阳县', '622822': '甘肃省庆阳地区环县', '622823': '甘肃省庆阳地区华池县', '622824': '甘肃省庆阳地区合水县', '622825': '甘肃省庆阳地区正宁县', '622826': '甘肃省庆阳地区宁县', '622827': '甘肃省庆阳地区镇原县', '622900': '甘肃省临夏回族自治州', '622901': '甘肃省临夏回族自治州临夏市', '622921': '甘肃省临夏回族自治州临夏县', '622922': '甘肃省临夏回族自治州康乐县', '622923': '甘肃省临夏回族自治州永靖县', '622924': '甘肃省临夏回族自治州广河县', '622925': '甘肃省临夏回族自治州和政县', '622926': '甘肃省临夏回族自治州东乡族自治县', '622927': '甘肃省临夏回族自治州积石山保安族东乡族撒拉族自治县', '623000': '甘肃省甘南藏族自治州', '623001': '甘肃省甘南藏族自治州合作市', '623021': '甘肃省甘南藏族自治州临潭县', '623022': '甘肃省甘南藏族自治州卓尼县', '623023': '甘肃省甘南藏族自治州舟曲县', '623024': '甘肃省甘南藏族自治州迭部县', '623025': '甘肃省甘南藏族自治州玛曲县', '623026': '甘肃省甘南藏族自治州碌曲县', '623027': '甘肃省甘南藏族自治州夏河县', '630000': '青海省', '630100': '青海省西宁市', '630101': '青海省西宁市市辖区', '630102': '青海省西宁市城东区', '630103': '青海省西宁市城中区', '630104': '青海省西宁市城西区', '630105': '青海省西宁市城北区', '630121': '青海省西宁市大通回族土族自治县', '632100': '青海省海东地区', '632121': '青海省海东地区平安县', '632122': '青海省海东地区民和回族土族自治县', '632123': '青海省海东地区乐都县', '632124': '青海省海东地区湟中县', '632125': '青海省海东地区湟源县', '632126': '青海省海东地区互助土族自治县', '632127': '青海省海东地区化隆回族自治县', '632128': '青海省海东地区循化撒拉族自治县', '632200': '青海省海北藏族自治州', '632221': '青海省海北藏族自治州门源回族自治县', '632222': '青海省海北藏族自治州祁连县', '632223': '青海省海北藏族自治州海晏县', '632224': '青海省海北藏族自治州刚察县', '632300': '青海省黄南藏族自治州', '632321': '青海省黄南藏族自治州同仁县', '632322': '青海省黄南藏族自治州尖扎县', '632323': '青海省黄南藏族自治州泽库县', '632324': '青海省黄南藏族自治州河南蒙古族自治县', '632500': '青海省海南藏族自治州', '632521': '青海省海南藏族自治州共和县', '632522': '青海省海南藏族自治州同德县', '632523': '青海省海南藏族自治州贵德县', '632524': '青海省海南藏族自治州兴海县', '632525': '青海省海南藏族自治州贵南县', '632600': '青海省果洛藏族自治州', '632621': '青海省果洛藏族自治州玛沁县', '632622': '青海省果洛藏族自治州班玛县', '632623': '青海省果洛藏族自治州甘德县', '632624': '青海省果洛藏族自治州达日县', '632625': '青海省果洛藏族自治州久治县', '632626': '青海省果洛藏族自治州玛多县', '632700': '青海省玉树藏族自治州', '632721': '青海省玉树藏族自治州玉树县', '632722': '青海省玉树藏族自治州杂多县', '632723': '青海省玉树藏族自治州称多县', '632724': '青海省玉树藏族自治州治多县', '632725': '青海省玉树藏族自治州囊谦县', '632726': '青海省玉树藏族自治州曲麻莱县', '632800': '青海省海西蒙古族藏族自治州', '632801': '青海省海西蒙古族藏族自治州格尔木市', '632802': '青海省海西蒙古族藏族自治州德令哈市', '632821': '青海省海西蒙古族藏族自治州乌兰县', '632822': '青海省海西蒙古族藏族自治州都兰县', '632823': '青海省海西蒙古族藏族自治州天峻县', '640000': '宁夏回族自治区', '640100': '宁夏回族自治区银川市', '640101': '宁夏回族自治区银川市市辖区', '640102': '宁夏回族自治区银川市城区', '640103': '宁夏回族自治区银川市新城区', '640111': '宁夏回族自治区银川市郊区', '640121': '宁夏回族自治区银川市永宁县', '640122': '宁夏回族自治区银川市贺兰县', '640200': '宁夏回族自治区石嘴山市', '640201': '宁夏回族自治区石嘴山市市辖区', '640202': '宁夏回族自治区石嘴山市大武口区', '640203': '宁夏回族自治区石嘴山市石嘴山区', '640204': '宁夏回族自治区石嘴山市石炭井区', '640221': '宁夏回族自治区石嘴山市平罗县', '640222': '宁夏回族自治区石嘴山市陶乐县', '640223': '宁夏回族自治区石嘴山市惠农县', '640300': '宁夏回族自治区吴忠市', '640301': '宁夏回族自治区吴忠市市辖区', '640302': '宁夏回族自治区吴忠市利通区', '640321': '宁夏回族自治区吴忠市中卫县', '640322': '宁夏回族自治区吴忠市中宁县', '640323': '宁夏回族自治区吴忠市盐池县', '640324': '宁夏回族自治区吴忠市同心县', '640381': '宁夏回族自治区吴忠市青铜峡市', '640382': '宁夏回族自治区吴忠市灵武市', '642200': '宁夏回族自治区固原地区', '642221': '宁夏回族自治区固原地区固原县', '642222': '宁夏回族自治区固原地区海原县', '642223': '宁夏回族自治区固原地区西吉县', '642224': '宁夏回族自治区固原地区隆德县', '642225': '宁夏回族自治区固原地区泾源县', '642226': '宁夏回族自治区固原地区彭阳县', '650000': '新疆维吾尔自治区', '650100': '新疆维吾尔族自治区乌鲁木齐市', '650101': '新疆维吾尔族自治区乌鲁木齐市市辖区', '650102': '新疆维吾尔族自治区乌鲁木齐市天山区', '650103': '新疆维吾尔族自治区乌鲁木齐市沙依巴克区', '650104': '新疆维吾尔族自治区乌鲁木齐市新市区', '650105': '新疆维吾尔族自治区乌鲁木齐市水磨沟区', '650106': '新疆维吾尔族自治区乌鲁木齐市头屯河区', '650107': '新疆维吾尔族自治区乌鲁木齐市南山矿区', '650108': '新疆维吾尔族自治区乌鲁木齐市东山区', '650121': '新疆维吾尔族自治区乌鲁木齐市乌鲁木齐县', '650200': '新疆维吾尔族自治区克拉玛依市', '650201': '新疆维吾尔族自治区克拉玛依市市辖区', '650202': '新疆维吾尔族自治区克拉玛依市独山子区', '650203': '新疆维吾尔族自治区克拉玛依市克拉玛依区', '650204': '新疆维吾尔族自治区克拉玛依市白碱滩区', '650205': '新疆维吾尔族自治区克拉玛依市乌尔禾区', '652100': '新疆维吾尔族自治区吐鲁番地区', '652101': '新疆维吾尔族自治区吐鲁番地区吐鲁番市', '652122': '新疆维吾尔族自治区吐鲁番地区鄯善县', '652123': '新疆维吾尔族自治区吐鲁番地区托克逊县', '652200': '新疆维吾尔族自治区哈密地区', '652201': '新疆维吾尔族自治区哈密地区哈密市', '652222': '新疆维吾尔族自治区哈密地区巴里坤哈萨克自治县', '652223': '新疆维吾尔族自治区哈密地区伊吾县', '652300': '新疆维吾尔族自治区昌吉回族自治州', '652301': '新疆维吾尔族自治区昌吉回族自治州昌吉市', '652302': '新疆维吾尔族自治区昌吉回族自治州阜康市', '652303': '新疆维吾尔族自治区昌吉回族自治州米泉市', '652323': '新疆维吾尔族自治区昌吉回族自治州呼图壁县', '652324': '新疆维吾尔族自治区昌吉回族自治州玛纳斯县', '652325': '新疆维吾尔族自治区昌吉回族自治州奇台县', '652327': '新疆维吾尔族自治区昌吉回族自治州吉木萨尔县', '652328': '新疆维吾尔族自治区昌吉回族自治州木垒哈萨克自治县', '652700': '新疆维吾尔族自治区博尔塔拉蒙古自治州', '652701': '新疆维吾尔族自治区博尔塔拉蒙古自治州博乐市', '652722': '新疆维吾尔族自治区博尔塔拉蒙古自治州精河县', '652723': '新疆维吾尔族自治区博尔塔拉蒙古自治州温泉县', '652800': '新疆维吾尔族自治区巴音郭楞蒙古自治州', '652801': '新疆维吾尔族自治区巴音郭楞蒙古自治州库尔勒市', '652822': '新疆维吾尔族自治区巴音郭楞蒙古自治州轮台县', '652823': '新疆维吾尔族自治区巴音郭楞蒙古自治州尉犁县', '652824': '新疆维吾尔族自治区巴音郭楞蒙古自治州若羌县', '652825': '新疆维吾尔族自治区巴音郭楞蒙古自治州且末县', '652826': '新疆维吾尔族自治区巴音郭楞蒙古自治州焉耆回族自治县', '652827': '新疆维吾尔族自治区巴音郭楞蒙古自治州和静县', '652828': '新疆维吾尔族自治区巴音郭楞蒙古自治州和硕县', '652829': '新疆维吾尔族自治区巴音郭楞蒙古自治州博湖县', '652900': '新疆维吾尔族自治区阿克苏地区', '652901': '新疆维吾尔族自治区阿克苏地区阿克苏市', '652922': '新疆维吾尔族自治区阿克苏地区温宿县', '652923': '新疆维吾尔族自治区阿克苏地区库车县', '652924': '新疆维吾尔族自治区阿克苏地区沙雅县', '652925': '新疆维吾尔族自治区阿克苏地区新和县', '652926': '新疆维吾尔族自治区阿克苏地区拜城县', '652927': '新疆维吾尔族自治区阿克苏地区乌什县', '652928': '新疆维吾尔族自治区阿克苏地区阿瓦提县', '652929': '新疆维吾尔族自治区阿克苏地区柯坪县', '653000': '新疆维吾尔族自治区克孜勒苏柯尔克孜自治州', '653001': '新疆维吾尔族自治区克孜勒苏柯尔克孜自治州阿图什市', '653022': '新疆维吾尔族自治区克孜勒苏柯尔克孜自治州阿克陶县', '653023': '新疆维吾尔族自治区克孜勒苏柯尔克孜自治州阿合奇县', '653024': '新疆维吾尔族自治区克孜勒苏柯尔克孜自治州乌恰县', '653100': '新疆维吾尔族自治区喀什地区', '653101': '新疆维吾尔族自治区喀什地区喀什市', '653121': '新疆维吾尔族自治区喀什地区疏附县', '653122': '新疆维吾尔族自治区喀什地区疏勒县', '653123': '新疆维吾尔族自治区喀什地区英吉沙县', '653124': '新疆维吾尔族自治区喀什地区泽普县', '653125': '新疆维吾尔族自治区喀什地区莎车县', '653126': '新疆维吾尔族自治区喀什地区叶城县', '653127': '新疆维吾尔族自治区喀什地区麦盖提县', '653128': '新疆维吾尔族自治区喀什地区岳普湖县', '653129': '新疆维吾尔族自治区喀什地区伽师县', '653130': '新疆维吾尔族自治区喀什地区巴楚县', '653131': '新疆维吾尔族自治区喀什地区塔什库尔干塔吉克自治县', '653200': '新疆维吾尔族自治区和田地区', '653201': '新疆维吾尔族自治区和田地区和田市', '653221': '新疆维吾尔族自治区和田地区和田县', '653222': '新疆维吾尔族自治区和田地区墨玉县', '653223': '新疆维吾尔族自治区和田地区皮山县', '653224': '新疆维吾尔族自治区和田地区洛浦县', '653225': '新疆维吾尔族自治区和田地区策勒县', '653226': '新疆维吾尔族自治区和田地区于田县', '653227': '新疆维吾尔族自治区和田地区民丰县', '654000': '新疆维吾尔族自治区伊犁哈萨克自治州', '654001': '新疆维吾尔族自治区伊犁哈萨克自治州奎屯市', '654100': '新疆维吾尔族自治区伊犁哈萨克自治州伊犁地区', '654101': '新疆维吾尔族自治区伊犁哈萨克自治州伊宁市', '654121': '新疆维吾尔族自治区伊犁哈萨克自治州伊宁县', '654122': '新疆自治区伊犁哈萨克自治州察布查尔锡伯自治县', '654123': '新疆维吾尔族自治区伊犁哈萨克自治州霍城县', '654124': '新疆维吾尔族自治区伊犁哈萨克自治州巩留县', '654125': '新疆维吾尔族自治区伊犁哈萨克自治州新源县', '654126': '新疆维吾尔族自治区伊犁哈萨克自治州昭苏县', '654127': '新疆维吾尔族自治区伊犁哈萨克自治州特克斯县', '654128': '新疆维吾尔族自治区伊犁哈萨克自治州尼勒克县', '654200': '新疆维吾尔族自治区塔城地区', '654201': '新疆维吾尔族自治区塔城地区塔城市', '654202': '新疆维吾尔族自治区塔城地区乌苏市', '654221': '新疆维吾尔族自治区塔城地区额敏县', '654223': '新疆维吾尔族自治区塔城地区沙湾县', '654224': '新疆维吾尔族自治区塔城地区托里县', '654225': '新疆维吾尔族自治区塔城地区裕民县', '654226': '新疆维吾尔族自治区塔城地区和布克赛尔蒙古自治县', '654300': '新疆维吾尔族自治区阿勒泰地区', '654301': '新疆维吾尔族自治区阿勒泰地区阿勒泰市', '654321': '新疆维吾尔族自治区阿勒泰地区布尔津县', '654322': '新疆维吾尔族自治区阿勒泰地区富蕴县', '654323': '新疆维吾尔族自治区阿勒泰地区福海县', '654324': '新疆维吾尔族自治区阿勒泰地区哈巴河县', '654325': '新疆维吾尔族自治区阿勒泰地区青河县', '654326': '新疆维吾尔族自治区阿勒泰地区吉木乃县', '659000': '新疆维吾尔族自治区直辖县级行政单位', '659001': '新疆维吾尔族自治区石河子市'
|
44555 | |
44556 |
|
44557 |
|
44558 | };var ValidateIDUtil = {
|
44559 | checkArg: function checkArg(id) {
|
44560 | var argType = typeof id === 'undefined' ? 'undefined' : _typeof(id);
|
44561 | switch (argType) {
|
44562 | case 'number':
|
44563 |
|
44564 | id = id.toString();
|
44565 | if (id.length > 15) {
|
44566 | this.error('长数字存在精度问题,请使用字符串传值!');
|
44567 | return false;
|
44568 | }
|
44569 | break;
|
44570 | case 'string':
|
44571 | break;
|
44572 | default:
|
44573 | return false;
|
44574 | }
|
44575 | id = id.toUpperCase();
|
44576 | var code = null;
|
44577 | if (id.length === 18) {
|
44578 |
|
44579 | code = {
|
44580 | body: id.slice(0, 17),
|
44581 | checkBit: id.slice(-1),
|
44582 | type: 18
|
44583 | };
|
44584 | } else if (id.length === 15) {
|
44585 |
|
44586 | code = {
|
44587 | body: id,
|
44588 | type: 15
|
44589 | };
|
44590 | } else {
|
44591 | return false;
|
44592 | }
|
44593 | return code;
|
44594 | },
|
44595 |
|
44596 | checkAddr: function checkAddr(addr, GB2260) {
|
44597 | var addrInfo = this.getAddrInfo(addr, GB2260);
|
44598 | return addrInfo === false ? 0 : true;
|
44599 | },
|
44600 |
|
44601 | getAddrInfo: function getAddrInfo(addr, GB2260) {
|
44602 | GB2260 = GB2260 || null;
|
44603 |
|
44604 | if (GB2260 === null) {
|
44605 | return addr;
|
44606 | }
|
44607 | if (!GB2260.hasOwnProperty(addr)) {
|
44608 |
|
44609 | var tmpAddr;
|
44610 | tmpAddr = addr.slice(0, 4) + '00';
|
44611 | if (!GB2260.hasOwnProperty(tmpAddr)) {
|
44612 | tmpAddr = addr.slice(0, 2) + '0000';
|
44613 | if (!GB2260.hasOwnProperty(tmpAddr)) {
|
44614 | return false;
|
44615 | } else {
|
44616 | return GB2260[tmpAddr] + '未知地区';
|
44617 | }
|
44618 | } else {
|
44619 | return GB2260[tmpAddr] + '未知地区';
|
44620 | }
|
44621 | } else {
|
44622 | return GB2260[addr];
|
44623 | }
|
44624 | },
|
44625 |
|
44626 | checkBirth: function checkBirth(birth) {
|
44627 |
|
44628 | var year;
|
44629 |
|
44630 | var month;
|
44631 | var day;
|
44632 | if (birth.length === 8) {
|
44633 | year = parseInt(birth.slice(0, 4), 10);
|
44634 | month = parseInt(birth.slice(4, 6), 10);
|
44635 | day = parseInt(birth.slice(-2), 10);
|
44636 | } else if (birth.length === 6) {
|
44637 | year = parseInt('19' + birth.slice(0, 2), 10);
|
44638 | month = parseInt(birth.slice(2, 4), 10);
|
44639 | day = parseInt(birth.slice(-2), 10);
|
44640 | } else {
|
44641 | return false;
|
44642 | }
|
44643 |
|
44644 | |
44645 |
|
44646 |
|
44647 |
|
44648 | if (month > 12 || month === 0 || day > 31 || day === 0) {
|
44649 | return false;
|
44650 | }
|
44651 | return true;
|
44652 | },
|
44653 |
|
44654 | checkOrder: function checkOrder(order) {
|
44655 |
|
44656 |
|
44657 | return true;
|
44658 | },
|
44659 |
|
44660 | weight: function weight(t) {
|
44661 | return Math.pow(2, t - 1) % 11;
|
44662 | },
|
44663 |
|
44664 | rand: function rand(max, min) {
|
44665 | min = min || 1;
|
44666 | return Math.round(Math.random() * (max - min)) + min;
|
44667 | },
|
44668 |
|
44669 | str_pad: function str_pad(str, len, chr, right) {
|
44670 | str = str.toString();
|
44671 | len = len || 2;
|
44672 | chr = chr || '0';
|
44673 | right = right || false;
|
44674 | if (str.length >= len) {
|
44675 | return str;
|
44676 | } else {
|
44677 | for (var i = 0, j = len - str.length; i < j; i++) {
|
44678 | if (right) {
|
44679 | str = str + chr;
|
44680 | } else {
|
44681 | str = chr + str;
|
44682 | }
|
44683 | }
|
44684 | return str;
|
44685 | }
|
44686 | },
|
44687 |
|
44688 | error: function error(msg) {
|
44689 | var e = new Error();
|
44690 | e.message = 'ValidateID: ' + msg;
|
44691 | throw e;
|
44692 | }
|
44693 | |
44694 |
|
44695 |
|
44696 | };var validator = function validator() {
|
44697 | var s = this;
|
44698 | this.cache = {};
|
44699 |
|
44700 | s.isValid = function (id) {
|
44701 | var code = ValidateIDUtil.checkArg(id);
|
44702 | if (code === false) {
|
44703 | return false;
|
44704 | }
|
44705 |
|
44706 | if (this.cache.hasOwnProperty(id) && typeof this.cache[id].valid !== 'undefined') {
|
44707 | return this.cache[id].valid;
|
44708 | } else {
|
44709 | if (!this.cache.hasOwnProperty(id)) {
|
44710 | this.cache[id] = {};
|
44711 | }
|
44712 | }
|
44713 |
|
44714 | var addr = code.body.slice(0, 6);
|
44715 | var birth = code.type === 18 ? code.body.slice(6, 14) : code.body.slice(6, 12);
|
44716 | var order = code.body.slice(-3);
|
44717 |
|
44718 | if (!(ValidateIDUtil.checkAddr(addr, GB2260) && ValidateIDUtil.checkBirth(birth) && ValidateIDUtil.checkOrder(order))) {
|
44719 | this.cache[id].valid = false;
|
44720 | return false;
|
44721 | }
|
44722 |
|
44723 |
|
44724 | if (code.type === 15) {
|
44725 | this.cache[id].valid = true;
|
44726 | return true;
|
44727 | }
|
44728 |
|
44729 |
|
44730 |
|
44731 |
|
44732 | var posWeight = [];
|
44733 | for (var i = 18; i > 1; i--) {
|
44734 | var wei = ValidateIDUtil.weight(i);
|
44735 | posWeight[i] = wei;
|
44736 | }
|
44737 |
|
44738 |
|
44739 | var bodySum = 0;
|
44740 | var bodyArr = code.body.split('');
|
44741 | for (var j = 0; j < bodyArr.length; j++) {
|
44742 | bodySum += parseInt(bodyArr[j], 10) * posWeight[18 - j];
|
44743 | }
|
44744 |
|
44745 |
|
44746 | var checkBit = 12 - bodySum % 11;
|
44747 | if (checkBit === 10) {
|
44748 | checkBit = 'X';
|
44749 | } else if (checkBit > 10) {
|
44750 | checkBit = checkBit % 11;
|
44751 | }
|
44752 | checkBit = typeof checkBit === 'number' ? checkBit.toString() : checkBit;
|
44753 |
|
44754 |
|
44755 | if (checkBit !== code.checkBit) {
|
44756 | this.cache[id].valid = false;
|
44757 | return false;
|
44758 | } else {
|
44759 | this.cache[id].valid = true;
|
44760 | return true;
|
44761 | }
|
44762 | };
|
44763 |
|
44764 |
|
44765 | s.getInfo = function (id) {
|
44766 |
|
44767 | if (this.isValid(id) === false) {
|
44768 | return false;
|
44769 | }
|
44770 |
|
44771 | var code = ValidateIDUtil.checkArg(id);
|
44772 |
|
44773 |
|
44774 |
|
44775 | if (typeof this.cache[id].info !== 'undefined') {
|
44776 | return this.cache[id].info;
|
44777 | }
|
44778 |
|
44779 | var addr = code.body.slice(0, 6);
|
44780 | var birth = code.type === 18 ? code.body.slice(6, 14) : code.body.slice(6, 12);
|
44781 | var order = code.body.slice(-3);
|
44782 |
|
44783 | var info = {};
|
44784 | info.addrCode = addr;
|
44785 | if (GB2260 !== null) {
|
44786 | info.addr = ValidateIDUtil.getAddrInfo(addr, GB2260);
|
44787 | }
|
44788 | info.birth = code.type === 18 ? [birth.slice(0, 4), birth.slice(4, 6), birth.slice(-2)].join('-') : ['19' + birth.slice(0, 2), birth.slice(2, 4), birth.slice(-2)].join('-');
|
44789 | info.sex = order % 2 === 0 ? 0 : 1;
|
44790 | info.length = code.type;
|
44791 | if (code.type === 18) {
|
44792 | info.checkBit = code.checkBit;
|
44793 | }
|
44794 |
|
44795 | this.cache[id].info = info;
|
44796 | return info;
|
44797 | };
|
44798 |
|
44799 | s.makeID = function (isFifteen) {
|
44800 |
|
44801 | var addr = null;
|
44802 | if (GB2260 !== null) {
|
44803 | var loopCnt = 0;
|
44804 | while (addr === null) {
|
44805 |
|
44806 | if (loopCnt > 10) {
|
44807 | addr = 110101;
|
44808 | break;
|
44809 | }
|
44810 | var prov = ValidateIDUtil.str_pad(ValidateIDUtil.rand(50), 2, '0');
|
44811 | var city = ValidateIDUtil.str_pad(ValidateIDUtil.rand(20), 2, '0');
|
44812 | var area = ValidateIDUtil.str_pad(ValidateIDUtil.rand(20), 2, '0');
|
44813 | var addrTest = [prov, city, area].join('');
|
44814 | if (GB2260[addrTest]) {
|
44815 | addr = addrTest;
|
44816 | break;
|
44817 | }
|
44818 | }
|
44819 | } else {
|
44820 | addr = 110101;
|
44821 | }
|
44822 |
|
44823 |
|
44824 | var yr = ValidateIDUtil.str_pad(ValidateIDUtil.rand(99, 50), 2, '0');
|
44825 | var mo = ValidateIDUtil.str_pad(ValidateIDUtil.rand(12, 1), 2, '0');
|
44826 | var da = ValidateIDUtil.str_pad(ValidateIDUtil.rand(28, 1), 2, '0');
|
44827 | if (isFifteen) {
|
44828 | return addr + yr + mo + da + ValidateIDUtil.str_pad(ValidateIDUtil.rand(999, 1), 3, '1');
|
44829 | }
|
44830 |
|
44831 | yr = '19' + yr;
|
44832 | var body = addr + yr + mo + da + ValidateIDUtil.str_pad(ValidateIDUtil.rand(999, 1), 3, '1');
|
44833 |
|
44834 |
|
44835 | var posWeight = [];
|
44836 | for (var i = 18; i > 1; i--) {
|
44837 | var wei = ValidateIDUtil.weight(i);
|
44838 | posWeight[i] = wei;
|
44839 | }
|
44840 |
|
44841 |
|
44842 | var bodySum = 0;
|
44843 | var bodyArr = body.split('');
|
44844 | for (var j = 0; j < bodyArr.length; j++) {
|
44845 | bodySum += parseInt(bodyArr[j], 10) * posWeight[18 - j];
|
44846 | }
|
44847 |
|
44848 |
|
44849 | var checkBit = 12 - bodySum % 11;
|
44850 | if (checkBit === 10) {
|
44851 | checkBit = 'X';
|
44852 | } else if (checkBit > 10) {
|
44853 | checkBit = checkBit % 11;
|
44854 | }
|
44855 | checkBit = typeof checkBit === 'number' ? checkBit.toString() : checkBit;
|
44856 | return body + checkBit;
|
44857 | };
|
44858 | };
|
44859 | return validator;
|
44860 | }();
|
44861 |
|
44862 | var ValidateID_ValidateID = (ValidateID);
|
44863 |
|
44864 |
|
44865 |
|
44866 | var src_ValidateID = (ValidateID_ValidateID);
|
44867 |
|
44868 |
|
44869 | var Validator = function Validator() {
|
44870 | |
44871 |
|
44872 |
|
44873 | var Patts = {
|
44874 | required: /.+/,
|
44875 | number: /^[+-]?(0|([1-9][0-9]*))(\.[0-9]+)?$/,
|
44876 | decimal: /^[+-]?(0|([1-9][0-9]*))(\.[0-9]+)$/,
|
44877 | digits: /\.[0-9]*/,
|
44878 | integer: /^(0|([+-]?[1-9][0-9]*))$/,
|
44879 | positive: /^(0|([1-9][0-9]*))(\.[0-9]+)?$/,
|
44880 | negative: /^-(0|([1-9][0-9]*))(\.[0-9]+)?$/,
|
44881 | positiveInteger: /^[1-9][0-9]*$/,
|
44882 | negativeInteger: /^-[1-9][0-9]*$/,
|
44883 | username: /^[\w]+$/,
|
44884 | password: /^[0-9_a-zA-Z-~!@#$]*$/,
|
44885 | mail: /^(\w+@\w+\.[\.\w]+)$/,
|
44886 | phone: /^([0-9]{11})$/,
|
44887 | chinese: /^[\u4E00-\u9FA5]*$/,
|
44888 | specialchar: /^[。~!@#$%\^\+\*&\\\/\?\|:\.<>{}()';="]*$/
|
44889 |
|
44890 | |
44891 |
|
44892 |
|
44893 | };var Rules = {
|
44894 |
|
44895 | required: function required(value, errorMsg) {
|
44896 | if (!Patts.required.test(value)) {
|
44897 | return errorMsg;
|
44898 | }
|
44899 | },
|
44900 |
|
44901 | number: function number(value, errorMsg) {
|
44902 | if (value.length !== 0 && !Patts.number.test(value)) {
|
44903 | return errorMsg;
|
44904 | }
|
44905 | },
|
44906 |
|
44907 | decimal: function decimal(value, errorMsg) {
|
44908 | if (value.length !== 0 && !Patts.decimal.test(value)) {
|
44909 | return errorMsg;
|
44910 | }
|
44911 | },
|
44912 |
|
44913 | maxDigits: function maxDigits(value, max, errorMsg) {
|
44914 | var match = value.match(Patts.digits);
|
44915 | if (match && match[0] && match[0].length - 1 > max) {
|
44916 | return errorMsg;
|
44917 | }
|
44918 | },
|
44919 |
|
44920 | integer: function integer(value, errorMsg) {
|
44921 | if (value.length !== 0 && !Patts.integer.test(value)) {
|
44922 | return errorMsg;
|
44923 | }
|
44924 | },
|
44925 |
|
44926 | positive: function positive(value, errorMsg) {
|
44927 | if (value.length !== 0 && !Patts.positive.test(value)) {
|
44928 | return errorMsg;
|
44929 | }
|
44930 | },
|
44931 |
|
44932 | negative: function negative(value, errorMsg) {
|
44933 | if (value.length !== 0 && !Patts.negative.test(value)) {
|
44934 | return errorMsg;
|
44935 | }
|
44936 | },
|
44937 |
|
44938 | positiveInteger: function positiveInteger(value, errorMsg) {
|
44939 | if (value.length !== 0 && !Patts.positiveInteger.test(value)) {
|
44940 | return errorMsg;
|
44941 | }
|
44942 | },
|
44943 |
|
44944 | negativeInteger: function negativeInteger(value, errorMsg) {
|
44945 | if (value.length !== 0 && !Patts.negativeInteger.test(value)) {
|
44946 | return errorMsg;
|
44947 | }
|
44948 | },
|
44949 | username: function username(value, errorMsg) {
|
44950 | if (value.length !== 0 && !Patts.username.test(value)) {
|
44951 | return errorMsg;
|
44952 | }
|
44953 | },
|
44954 | password: function password(value, errorMsg) {
|
44955 | if (value.length !== 0 && !Patts.password.test(value)) {
|
44956 | return errorMsg;
|
44957 | }
|
44958 | },
|
44959 | mail: function mail(value, errorMsg) {
|
44960 | if (value.length !== 0 && !Patts.mail.test(value)) {
|
44961 | return errorMsg;
|
44962 | }
|
44963 | },
|
44964 | phone: function phone(value, errorMsg) {
|
44965 | if (value.length !== 0 && !Patts.phone.test(value)) {
|
44966 | return errorMsg;
|
44967 | }
|
44968 | },
|
44969 | chinese: function chinese(value, errorMsg) {
|
44970 | if (value.length !== 0 && !Patts.chinese.test(value)) {
|
44971 | return errorMsg;
|
44972 | }
|
44973 | },
|
44974 |
|
44975 | specialchar: function specialchar(value, errorMsg) {
|
44976 | if (value.length !== 0 && !Patts.specialchar.test(value)) {
|
44977 | return errorMsg;
|
44978 | }
|
44979 | },
|
44980 | minNumber: function minNumber(value, min, errorMsg) {
|
44981 | if (value.length !== 0 && value * 1 < min * 1) {
|
44982 | return errorMsg;
|
44983 | }
|
44984 | },
|
44985 | maxNumber: function maxNumber(value, max, errorMsg) {
|
44986 | if (value.length !== 0 && value * 1 > max * 1) {
|
44987 | return errorMsg;
|
44988 | }
|
44989 | },
|
44990 | minLength: function minLength(value, length, errorMsg) {
|
44991 | if (value.length !== 0 && value.length < length) {
|
44992 | return errorMsg;
|
44993 | }
|
44994 | },
|
44995 | maxLength: function maxLength(value, length, errorMsg) {
|
44996 | if (value.length !== 0 && value.length > length) {
|
44997 | return errorMsg;
|
44998 | }
|
44999 | },
|
45000 | compare: function compare(value1, value2, errorMsg) {
|
45001 | if (value1 !== value2) {
|
45002 | return errorMsg;
|
45003 | }
|
45004 | },
|
45005 |
|
45006 | safeLvl: function safeLvl(value, lvl, errorMsg) {
|
45007 | var valLvl = Object.passwordLvl(value);
|
45008 | if (value.length !== 0 && valLvl < lvl) {
|
45009 | return errorMsg;
|
45010 | }
|
45011 | }
|
45012 | |
45013 |
|
45014 |
|
45015 | };var s = this;
|
45016 | s.caches = [];
|
45017 | s.add = function (field, strategies) {
|
45018 |
|
45019 | for (var i = 0, strategy; strategy = strategies[i++];) {
|
45020 | (function (strategy) {
|
45021 | var ruleArray = strategy.rule.split(":");
|
45022 | var errorMsg = strategy.errorMsg;
|
45023 |
|
45024 | s.caches.push(function () {
|
45025 | var ruleName = ruleArray.shift();
|
45026 | ruleArray.unshift(field instanceof Object ? field.value : field);
|
45027 | ruleArray.push(errorMsg);
|
45028 | var ruleErrorMsg = Rules[ruleName].apply(null, ruleArray);
|
45029 | if (ruleErrorMsg) return { field: field, msg: ruleErrorMsg };
|
45030 | });
|
45031 | })(strategy);
|
45032 | }
|
45033 |
|
45034 | };
|
45035 | s.start = function () {
|
45036 |
|
45037 | for (var i = 0, valiFn; valiFn = s.caches[i++];) {
|
45038 | var error = valiFn();
|
45039 | if (error) return error;
|
45040 | }
|
45041 |
|
45042 | };
|
45043 | };
|
45044 |
|
45045 | var Validator_Validator = (Validator);
|
45046 |
|
45047 |
|
45048 |
|
45049 | var src_Validator = (Validator_Validator);
|
45050 |
|
45051 | __webpack_require__.d(__webpack_exports__, "Actionsheet", function() { return src_Actionsheet; });
|
45052 | __webpack_require__.d(__webpack_exports__, "Alert", function() { return src_Alert; });
|
45053 | __webpack_require__.d(__webpack_exports__, "Badge", function() { return src_Badge; });
|
45054 | __webpack_require__.d(__webpack_exports__, "BiClock", function() { return src_BiClock; });
|
45055 | __webpack_require__.d(__webpack_exports__, "BiDoughnut", function() { return src_BiDoughnut; });
|
45056 | __webpack_require__.d(__webpack_exports__, "BiGauge", function() { return src_BiGauge; });
|
45057 | __webpack_require__.d(__webpack_exports__, "Bridge", function() { return src_Bridge; });
|
45058 | __webpack_require__.d(__webpack_exports__, "Button", function() { return src_Button; });
|
45059 | __webpack_require__.d(__webpack_exports__, "Calendar", function() { return src_Calendar; });
|
45060 | __webpack_require__.d(__webpack_exports__, "Card", function() { return src_Card; });
|
45061 | __webpack_require__.d(__webpack_exports__, "Carrousel", function() { return src_Carrousel; });
|
45062 | __webpack_require__.d(__webpack_exports__, "Chat", function() { return src_Chat; });
|
45063 | __webpack_require__.d(__webpack_exports__, "Checkbox", function() { return src_Checkbox; });
|
45064 | __webpack_require__.d(__webpack_exports__, "Container", function() { return src_Container; });
|
45065 | __webpack_require__.d(__webpack_exports__, "Counter", function() { return src_Counter; });
|
45066 | __webpack_require__.d(__webpack_exports__, "Dialog", function() { return src_Dialog; });
|
45067 | __webpack_require__.d(__webpack_exports__, "Dot", function() { return src_Dot; });
|
45068 | __webpack_require__.d(__webpack_exports__, "Dragrefresh", function() { return src_Dragrefresh; });
|
45069 | __webpack_require__.d(__webpack_exports__, "Dropdown", function() { return src_Dropdown; });
|
45070 | __webpack_require__.d(__webpack_exports__, "Emoji", function() { return src_Emoji; });
|
45071 | __webpack_require__.d(__webpack_exports__, "Footer", function() { return src_Footer; });
|
45072 | __webpack_require__.d(__webpack_exports__, "Group", function() { return src_Group; });
|
45073 | __webpack_require__.d(__webpack_exports__, "Handsign", function() { return src_Handsign; });
|
45074 | __webpack_require__.d(__webpack_exports__, "Header", function() { return src_Header; });
|
45075 | __webpack_require__.d(__webpack_exports__, "ImgMark", function() { return src_ImgMark; });
|
45076 | __webpack_require__.d(__webpack_exports__, "IndexBar", function() { return src_IndexBar; });
|
45077 | __webpack_require__.d(__webpack_exports__, "InputArea", function() { return src_InputArea; });
|
45078 | __webpack_require__.d(__webpack_exports__, "InputCity", function() { return src_InputCity; });
|
45079 | __webpack_require__.d(__webpack_exports__, "InputColor", function() { return src_InputColor; });
|
45080 | __webpack_require__.d(__webpack_exports__, "InputDate", function() { return src_InputDate; });
|
45081 | __webpack_require__.d(__webpack_exports__, "InputLocation", function() { return src_InputLocation; });
|
45082 | __webpack_require__.d(__webpack_exports__, "InputNumber", function() { return src_InputNumber; });
|
45083 | __webpack_require__.d(__webpack_exports__, "InputPassword", function() { return src_InputPassword; });
|
45084 | __webpack_require__.d(__webpack_exports__, "InputTel", function() { return src_InputTel; });
|
45085 | __webpack_require__.d(__webpack_exports__, "InputPicker", function() { return src_InputPicker; });
|
45086 | __webpack_require__.d(__webpack_exports__, "InputPre", function() { return src_InputPre; });
|
45087 | __webpack_require__.d(__webpack_exports__, "InputRange", function() { return src_InputRange; });
|
45088 | __webpack_require__.d(__webpack_exports__, "InputSafe", function() { return src_InputSafe; });
|
45089 | __webpack_require__.d(__webpack_exports__, "InputSelect", function() { return src_InputSelect; });
|
45090 | __webpack_require__.d(__webpack_exports__, "InputStar", function() { return src_InputStar; });
|
45091 | __webpack_require__.d(__webpack_exports__, "InputText", function() { return src_InputText; });
|
45092 | __webpack_require__.d(__webpack_exports__, "Legend", function() { return src_Legend; });
|
45093 | __webpack_require__.d(__webpack_exports__, "ListPull", function() { return src_ListPull; });
|
45094 | __webpack_require__.d(__webpack_exports__, "Loading", function() { return src_Loading; });
|
45095 | __webpack_require__.d(__webpack_exports__, "LotteryWheel", function() { return src_LotteryWheel; });
|
45096 | __webpack_require__.d(__webpack_exports__, "MapUtil", function() { return src_MapUtil; });
|
45097 | __webpack_require__.d(__webpack_exports__, "Mark", function() { return src_Mark; });
|
45098 | __webpack_require__.d(__webpack_exports__, "Marquee", function() { return src_Marquee; });
|
45099 | __webpack_require__.d(__webpack_exports__, "MenuTiled", function() { return src_MenuTiled; });
|
45100 | __webpack_require__.d(__webpack_exports__, "MenuTree", function() { return src_MenuTree; });
|
45101 | __webpack_require__.d(__webpack_exports__, "Notice", function() { return src_Notice; });
|
45102 | __webpack_require__.d(__webpack_exports__, "NumBox", function() { return src_NumBox; });
|
45103 | __webpack_require__.d(__webpack_exports__, "NumBoxPop", function() { return src_NumBoxPop; });
|
45104 | __webpack_require__.d(__webpack_exports__, "NumBoxPopPointer", function() { return src_NumBoxPopPointer; });
|
45105 | __webpack_require__.d(__webpack_exports__, "OnOff", function() { return src_OnOff; });
|
45106 | __webpack_require__.d(__webpack_exports__, "Page", function() { return src_Page; });
|
45107 | __webpack_require__.d(__webpack_exports__, "PagePull", function() { return src_PagePull; });
|
45108 | __webpack_require__.d(__webpack_exports__, "PDFView", function() { return src_PDFView; });
|
45109 | __webpack_require__.d(__webpack_exports__, "Peg", function() { return src_Peg; });
|
45110 | __webpack_require__.d(__webpack_exports__, "Picker", function() { return src_Picker; });
|
45111 | __webpack_require__.d(__webpack_exports__, "PickerCity", function() { return src_PickerCity; });
|
45112 | __webpack_require__.d(__webpack_exports__, "PickerDate", function() { return src_PickerDate; });
|
45113 | __webpack_require__.d(__webpack_exports__, "Player", function() { return src_Player; });
|
45114 | __webpack_require__.d(__webpack_exports__, "Popover", function() { return src_Popover; });
|
45115 | __webpack_require__.d(__webpack_exports__, "Preview", function() { return src_Preview; });
|
45116 | __webpack_require__.d(__webpack_exports__, "Progress", function() { return src_Progress; });
|
45117 | __webpack_require__.d(__webpack_exports__, "Radio", function() { return src_Radio; });
|
45118 | __webpack_require__.d(__webpack_exports__, "SearchBoard", function() { return src_SearchBoard; });
|
45119 | __webpack_require__.d(__webpack_exports__, "SelectPicker", function() { return src_SelectPicker; });
|
45120 | __webpack_require__.d(__webpack_exports__, "Star", function() { return src_Star; });
|
45121 | __webpack_require__.d(__webpack_exports__, "Stencil", function() { return src_Stencil; });
|
45122 | __webpack_require__.d(__webpack_exports__, "Sticker", function() { return Sticker; });
|
45123 | __webpack_require__.d(__webpack_exports__, "Tabbar", function() { return src_Tabbar; });
|
45124 | __webpack_require__.d(__webpack_exports__, "Ticket", function() { return src_Ticket; });
|
45125 | __webpack_require__.d(__webpack_exports__, "Timeline", function() { return src_Timeline; });
|
45126 | __webpack_require__.d(__webpack_exports__, "Timepart", function() { return src_Timepart; });
|
45127 | __webpack_require__.d(__webpack_exports__, "Titlebar", function() { return src_Titlebar; });
|
45128 | __webpack_require__.d(__webpack_exports__, "Toast", function() { return src_Toast; });
|
45129 | __webpack_require__.d(__webpack_exports__, "Tree", function() { return src_Tree; });
|
45130 | __webpack_require__.d(__webpack_exports__, "Ajax", function() { return src_Ajax; });
|
45131 | __webpack_require__.d(__webpack_exports__, "Animate", function() { return src_Animate; });
|
45132 | __webpack_require__.d(__webpack_exports__, "ApiAxios", function() { return src_ApiAxios; });
|
45133 | __webpack_require__.d(__webpack_exports__, "BackboneRoute", function() { return src_BackboneRoute; });
|
45134 | __webpack_require__.d(__webpack_exports__, "CanvasUtil", function() { return src_CanvasUtil; });
|
45135 | __webpack_require__.d(__webpack_exports__, "Clipboard", function() { return src_Clipboard; });
|
45136 | __webpack_require__.d(__webpack_exports__, "Vott", function() { return src_Vott; });
|
45137 | __webpack_require__.d(__webpack_exports__, "DB", function() { return src_DB; });
|
45138 | __webpack_require__.d(__webpack_exports__, "Device", function() { return src_Device; });
|
45139 | __webpack_require__.d(__webpack_exports__, "EditUtil", function() { return src_EditUtil; });
|
45140 | __webpack_require__.d(__webpack_exports__, "EventUtil", function() { return src_EventUtil; });
|
45141 | __webpack_require__.d(__webpack_exports__, "FastClick", function() { return src_FastClick; });
|
45142 | __webpack_require__.d(__webpack_exports__, "Form", function() { return src_Form; });
|
45143 | __webpack_require__.d(__webpack_exports__, "FullScreen", function() { return src_FullScreen; });
|
45144 | __webpack_require__.d(__webpack_exports__, "GeoUtil", function() { return src_GeoUtil; });
|
45145 | __webpack_require__.d(__webpack_exports__, "History", function() { return src_History; });
|
45146 | __webpack_require__.d(__webpack_exports__, "ImgLazy", function() { return src_ImgLazy; });
|
45147 | __webpack_require__.d(__webpack_exports__, "jsonp", function() { return src_jsonp; });
|
45148 | __webpack_require__.d(__webpack_exports__, "MediaUtil", function() { return src_MediaUtil; });
|
45149 | __webpack_require__.d(__webpack_exports__, "PubSub", function() { return src_PubSub; });
|
45150 | __webpack_require__.d(__webpack_exports__, "ValidateID", function() { return src_ValidateID; });
|
45151 | __webpack_require__.d(__webpack_exports__, "Validator", function() { return src_Validator; });
|
45152 |
|
45153 |
|
45154 |
|
45155 |
|
45156 |
|
45157 |
|
45158 |
|
45159 |
|
45160 |
|
45161 |
|
45162 |
|
45163 |
|
45164 |
|
45165 |
|
45166 |
|
45167 |
|
45168 |
|
45169 |
|
45170 |
|
45171 |
|
45172 |
|
45173 |
|
45174 |
|
45175 |
|
45176 |
|
45177 |
|
45178 |
|
45179 |
|
45180 |
|
45181 |
|
45182 |
|
45183 |
|
45184 |
|
45185 |
|
45186 |
|
45187 |
|
45188 |
|
45189 |
|
45190 |
|
45191 |
|
45192 |
|
45193 |
|
45194 |
|
45195 |
|
45196 |
|
45197 |
|
45198 |
|
45199 |
|
45200 |
|
45201 |
|
45202 |
|
45203 |
|
45204 |
|
45205 |
|
45206 |
|
45207 |
|
45208 |
|
45209 |
|
45210 |
|
45211 |
|
45212 |
|
45213 |
|
45214 |
|
45215 |
|
45216 |
|
45217 |
|
45218 |
|
45219 |
|
45220 |
|
45221 |
|
45222 |
|
45223 |
|
45224 |
|
45225 |
|
45226 |
|
45227 |
|
45228 |
|
45229 |
|
45230 |
|
45231 |
|
45232 |
|
45233 |
|
45234 |
|
45235 |
|
45236 |
|
45237 |
|
45238 |
|
45239 |
|
45240 |
|
45241 |
|
45242 |
|
45243 |
|
45244 |
|
45245 |
|
45246 |
|
45247 |
|
45248 |
|
45249 |
|
45250 |
|
45251 |
|
45252 |
|
45253 |
|
45254 |
|
45255 |
|
45256 |
|
45257 |
|
45258 |
|
45259 |
|
45260 |
|
45261 |
|
45262 |
|
45263 |
|
45264 |
|
45265 |
|
45266 |
|
45267 |
|
45268 | })
|
45269 | ])["default"];
|
45270 | }); |
\ | No newline at end of file |