UNPKG

tree-picker

Version:
2,111 lines (2,024 loc) 521 kB
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else { var a = factory(); for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; } })(typeof self !== 'undefined' ? self : this, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "/dist/"; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 1); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__data_js__ = __webpack_require__(9); // // // // // // // // // // // // // // // // // // // // //不管是一次性加载所有的数据还是分块加载,都需要对数据进行处理。 //如果一次性加载所有的数据,需要用户定义二级名称 /* harmony default export */ __webpack_exports__["a"] = ({ name: 'TreePicker', props: { value: { type: String, default: '' }, initShowList: { type: Array, default: () => [] }, level: { type: Number, default: 3 }, //省市县层级,省;省市;省市县 clue: { type: String, default: "id" }, pid: { type: String, default: "parent_id" }, initlist: { type: Array, default: () => [] }, label: { type: String, default: "area_name" }, mode: { type: String, default: "0" }, child: { type: String, default: "child" }, prop: String }, data() { return { showPanel: false, list: {}, showList: [], currentIndex: 0, // 1,2,3 finishArr: [], current: [{ name: "请选择" }], finish: "" }; }, created() { //触发用户定义的promise事件; //this.showList = await this.getProvince(); // 初始化回显 this.getInitList(); console.log(this.initlist); if (Array.isArray(this.initShowList) && this.initShowList.length > 0) { this.current = [].concat(this.initShowList); this.finish = this.current.map(item => item[this.label] ? item[this.label] : "").join(" "); } if (this.mode === "0") { this.list = __WEBPACK_IMPORTED_MODULE_0__data_js__["a" /* default */]; this.showList = this.list; this.handlerRecover(); return; } else if (this.mode === "1" || this.mode === "2") { this.showCurrent(this.current[0], 0); } }, watch: { finish(val) { this.$emit("input", val); }, showPanel(val) { if (val) { this.$emit('onshow'); } else { this.$emit('onhide'); } }, initlist: function () { this.showList = this.initlist; //once load data if (this.mode === "1") { this.list = this.orgData(this.initlist, 0); //存在原始值,读区值 this.handlerRecover(); return; } let { currentIndex } = this; switch (currentIndex) { case 0: this.list = this.convert(this.initlist); this.showList = this.list; break; case 1: let opts = this.current[0]; let city = this.initlist; this.list[String(opts[this.clue]).trim()][this.child] = this.convert(city); this.showList = city; break; case 2: let _city = Object.assign({}, this.current[1]); let county = this.initlist; const province = this.current[0][this.clue]; this.list[province][this.child][_city[this.clue]][this.child] = this.convert(county); this.showList = county; } } }, methods: { getInitList() { let address = this.value.split(';'); for (let i in __WEBPACK_IMPORTED_MODULE_0__data_js__["a" /* default */]) { if (__WEBPACK_IMPORTED_MODULE_0__data_js__["a" /* default */][i].area_name === address[0]) { this.initShowList.push({ id: i, area_name: address[0] }); } if (__WEBPACK_IMPORTED_MODULE_0__data_js__["a" /* default */][i].child && address[1]) { for (let j in __WEBPACK_IMPORTED_MODULE_0__data_js__["a" /* default */][i].child) { if (__WEBPACK_IMPORTED_MODULE_0__data_js__["a" /* default */][i].child[j].area_name === address[1]) { this.initShowList.push({ id: j, area_name: address[1] }); } let county = __WEBPACK_IMPORTED_MODULE_0__data_js__["a" /* default */][i].child[j].child; if (county && address[2]) { for (let k in county) { if (county[k].area_name === address[2]) { this.initShowList.push({ id: k, area_name: address[2] }); } } } } } } }, handlerRecover() { const ctl = this.current.length; switch (ctl) { case 2: this.getCity(this.current[0]); this.currentIndex = 1; break; case 3: this.getCounty(this.current[1]); this.currentIndex = 2; break; } return; }, closeDropdown() { this.showPanel = false; }, toggleDropdown() { this.showPanel = !this.showPanel; }, //重组数据, orgData(data, parent_id) { var tree = {}; var temp; for (var i = 0; i < data.length; i++) { if (data[i][this.pid] === parent_id) { var obj = data[i]; temp = this.orgData(data, data[i][this.clue]); if (JSON.stringify(temp) != "{}") { obj[this.child] = temp; } tree[data[i][this.clue]] = obj; } } return tree; }, showCurrent(item, index) { this.currentIndex = index; switch (index) { case 0: { this.getProvince(); break; } case 1: { this.getCity(this.current[0]); break; } case 2: { this.getCounty(this.current[1]); break; } default: { console.error("传入参数错误"); } } }, getNext(opts) { const index = this.currentIndex; switch (index) { case 0: { const current = [].concat(this.current); current[0] = Object.assign(opts); if (opts[this.clue] !== this.current[0][this.clue]) { this.current = current.slice(0, 2); } else { this.current = current; } if (this.level == 1) { this.getValue(); return false; } this.getCity(opts); current[1] = Object.assign({ name: "请选择" }); this.current = current; this.currentIndex = 1; break; } case 1: { this.current[1] = Object.assign({}, opts); if (this.level == 2) { this.getValue(); return false; } this.current[2] = Object.assign({ name: "请选择" }); this.current = [].concat(this.current); this.currentIndex = 2; this.getCounty(opts); break; } case 2: { this.current[2] = Object.assign({}, opts); this.current = [].concat(this.current); this.getValue(); break; } default: { console.error("传入参数错误"); } } }, getValue() { this.showPanel = false; this.finishArr = []; this.finish = this.current.map(item => item[this.label] ? item[this.label] : "").join(" "); this.current.map((item, index) => { this.finishArr.push({ [this.clue]: item[this.clue], [this.label]: item[this.label] }); }); this.$emit("onchange", this.finishArr); }, convert(list) { const data = {}; if (Array.isArray(list)) { list.forEach(item => { data[String(item[this.clue]).trim()] = item; }); } return data; }, reconvert(obj) { const data = []; for (const i in obj) { data.push(obj[i]); } return data; }, getAllData() { this.getAddress(opts); }, getProvince() { if (this.list && JSON.stringify(this.list) != "{}") { this.showList = this.list; return; } let opts = { level: 1 }; if (this.level == 1) { this.showPanel = false; return false; } this.getAddress(opts); }, getCity(opts) { if (this.list && this.list[String(opts[this.clue]).trim()][this.child]) { const data = this.list[String(opts[this.clue]).trim()][this.child]; this.showList = data; return; } let _opts = { level: 2, level_code: opts[this.clue] }; if (this.level == 2) { this.showPanel = false; return false; } this.getAddress(_opts); }, getCounty(opts) { const city = Object.assign({}, opts); const province = this.current[0][this.clue]; if (this.list && this.list[province][this.child] && this.list[province][this.child][city[this.clue]] && this.list[province][this.child][city[this.clue]][this.child]) { const data = this.list[province][this.child][city[this.clue]][this.child]; this.showList = data; return this.reconvert(data); } let _opts = { level: 3, level_code: city[this.clue] }; this.getAddress(_opts); }, getAddress(opts) { this.$emit("onload", opts); return; } } }); /***/ }), /* 1 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__app_vue__ = __webpack_require__(2); /* harmony default export */ __webpack_exports__["default"] = (__WEBPACK_IMPORTED_MODULE_0__app_vue__["a" /* default */]); /***/ }), /* 2 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_app_vue__ = __webpack_require__(0); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_59402af2_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_app_vue__ = __webpack_require__(10); function injectStyle (ssrContext) { __webpack_require__(3) } var normalizeComponent = __webpack_require__(8) /* script */ /* template */ /* template functional */ var __vue_template_functional__ = false /* styles */ var __vue_styles__ = injectStyle /* scopeId */ var __vue_scopeId__ = null /* moduleIdentifier (server only) */ var __vue_module_identifier__ = null var Component = normalizeComponent( __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_app_vue__["a" /* default */], __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_59402af2_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_app_vue__["a" /* default */], __vue_template_functional__, __vue_styles__, __vue_scopeId__, __vue_module_identifier__ ) /* harmony default export */ __webpack_exports__["a"] = (Component.exports); /***/ }), /* 3 */ /***/ (function(module, exports, __webpack_require__) { // style-loader: Adds some css to the DOM by adding a <style> tag // load the styles var content = __webpack_require__(4); if(typeof content === 'string') content = [[module.i, content, '']]; if(content.locals) module.exports = content.locals; // add the styles to the DOM var update = __webpack_require__(6)("1269853c", content, true, {}); /***/ }), /* 4 */ /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__(5)(false); // imports // module exports.push([module.i, ".picker{position:relative;display:flex;margin:10px;font-size:12px}.picker_label{height:28px;line-height:28px}.picker__text{width:auto;padding-left:8px;cursor:pointer;overflow:hidden}.picker__input{border:1px solid #ccc;line-height:28px;height:28px;border-radius:2px;padding-left:5px;outline:none;min-width:150px}.picker__masklayer{position:fixed;background:#ccc;left:0;top:0;right:0;bottom:0;opacity:.4}.picker__select{position:absolute;left:0;top:0;margin-top:32px;width:630px;background-color:#fff;z-index:10;border:1px solid #d1d1d1}.picker__select-header{display:flex;border-bottom:1px solid #d1d1d1;margin:0;padding:0}.picker__select-header li{padding:10px;list-style:none;border-right:1px solid #d1d1d1;cursor:pointer}.picker__select-header .actived{color:#fff;background-color:#49a9ee}.picker__select-content{width:100%;display:flex;padding:10px;flex-flow:wrap}.picker__select-content li{width:150px;line-height:28px;list-style:none;cursor:pointer}.picker__select-content .actived,.picker__select-content li:hover{color:#49a9ee;font-weight:700}", ""]); // exports /***/ }), /* 5 */ /***/ (function(module, exports) { /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ // css base code, injected by the css-loader module.exports = function(useSourceMap) { var list = []; // return the list of modules as css string list.toString = function toString() { return this.map(function (item) { var content = cssWithMappingToString(item, useSourceMap); if(item[2]) { return "@media " + item[2] + "{" + content + "}"; } else { return content; } }).join(""); }; // import a list of modules into the list list.i = function(modules, mediaQuery) { if(typeof modules === "string") modules = [[null, modules, ""]]; var alreadyImportedModules = {}; for(var i = 0; i < this.length; i++) { var id = this[i][0]; if(typeof id === "number") alreadyImportedModules[id] = true; } for(i = 0; i < modules.length; i++) { var item = modules[i]; // skip already imported module // this implementation is not 100% perfect for weird media query combinations // when a module is imported multiple times with different media queries. // I hope this will never occur (Hey this way we have smaller bundles) if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { if(mediaQuery && !item[2]) { item[2] = mediaQuery; } else if(mediaQuery) { item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; } list.push(item); } } }; return list; }; function cssWithMappingToString(item, useSourceMap) { var content = item[1] || ''; var cssMapping = item[3]; if (!cssMapping) { return content; } if (useSourceMap && typeof btoa === 'function') { var sourceMapping = toComment(cssMapping); var sourceURLs = cssMapping.sources.map(function (source) { return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */' }); return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); } return [content].join('\n'); } // Adapted from convert-source-map (MIT) function toComment(sourceMap) { // eslint-disable-next-line no-undef var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; return '/*# ' + data + ' */'; } /***/ }), /* 6 */ /***/ (function(module, exports, __webpack_require__) { /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra Modified by Evan You @yyx990803 */ var hasDocument = typeof document !== 'undefined' if (typeof DEBUG !== 'undefined' && DEBUG) { if (!hasDocument) { throw new Error( 'vue-style-loader cannot be used in a non-browser environment. ' + "Use { target: 'node' } in your Webpack config to indicate a server-rendering environment." ) } } var listToStyles = __webpack_require__(7) /* type StyleObject = { id: number; parts: Array<StyleObjectPart> } type StyleObjectPart = { css: string; media: string; sourceMap: ?string } */ var stylesInDom = {/* [id: number]: { id: number, refs: number, parts: Array<(obj?: StyleObjectPart) => void> } */} var head = hasDocument && (document.head || document.getElementsByTagName('head')[0]) var singletonElement = null var singletonCounter = 0 var isProduction = false var noop = function () {} var options = null var ssrIdKey = 'data-vue-ssr-id' // Force single-tag solution on IE6-9, which has a hard limit on the # of <style> // tags it will allow on a page var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\b/.test(navigator.userAgent.toLowerCase()) module.exports = function (parentId, list, _isProduction, _options) { isProduction = _isProduction options = _options || {} var styles = listToStyles(parentId, list) addStylesToDom(styles) return function update (newList) { var mayRemove = [] for (var i = 0; i < styles.length; i++) { var item = styles[i] var domStyle = stylesInDom[item.id] domStyle.refs-- mayRemove.push(domStyle) } if (newList) { styles = listToStyles(parentId, newList) addStylesToDom(styles) } else { styles = [] } for (var i = 0; i < mayRemove.length; i++) { var domStyle = mayRemove[i] if (domStyle.refs === 0) { for (var j = 0; j < domStyle.parts.length; j++) { domStyle.parts[j]() } delete stylesInDom[domStyle.id] } } } } function addStylesToDom (styles /* Array<StyleObject> */) { for (var i = 0; i < styles.length; i++) { var item = styles[i] var domStyle = stylesInDom[item.id] if (domStyle) { domStyle.refs++ for (var j = 0; j < domStyle.parts.length; j++) { domStyle.parts[j](item.parts[j]) } for (; j < item.parts.length; j++) { domStyle.parts.push(addStyle(item.parts[j])) } if (domStyle.parts.length > item.parts.length) { domStyle.parts.length = item.parts.length } } else { var parts = [] for (var j = 0; j < item.parts.length; j++) { parts.push(addStyle(item.parts[j])) } stylesInDom[item.id] = { id: item.id, refs: 1, parts: parts } } } } function createStyleElement () { var styleElement = document.createElement('style') styleElement.type = 'text/css' head.appendChild(styleElement) return styleElement } function addStyle (obj /* StyleObjectPart */) { var update, remove var styleElement = document.querySelector('style[' + ssrIdKey + '~="' + obj.id + '"]') if (styleElement) { if (isProduction) { // has SSR styles and in production mode. // simply do nothing. return noop } else { // has SSR styles but in dev mode. // for some reason Chrome can't handle source map in server-rendered // style tags - source maps in <style> only works if the style tag is // created and inserted dynamically. So we remove the server rendered // styles and inject new ones. styleElement.parentNode.removeChild(styleElement) } } if (isOldIE) { // use singleton mode for IE9. var styleIndex = singletonCounter++ styleElement = singletonElement || (singletonElement = createStyleElement()) update = applyToSingletonTag.bind(null, styleElement, styleIndex, false) remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true) } else { // use multi-style-tag mode in all other cases styleElement = createStyleElement() update = applyToTag.bind(null, styleElement) remove = function () { styleElement.parentNode.removeChild(styleElement) } } update(obj) return function updateStyle (newObj /* StyleObjectPart */) { if (newObj) { if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) { return } update(obj = newObj) } else { remove() } } } var replaceText = (function () { var textStore = [] return function (index, replacement) { textStore[index] = replacement return textStore.filter(Boolean).join('\n') } })() function applyToSingletonTag (styleElement, index, remove, obj) { var css = remove ? '' : obj.css if (styleElement.styleSheet) { styleElement.styleSheet.cssText = replaceText(index, css) } else { var cssNode = document.createTextNode(css) var childNodes = styleElement.childNodes if (childNodes[index]) styleElement.removeChild(childNodes[index]) if (childNodes.length) { styleElement.insertBefore(cssNode, childNodes[index]) } else { styleElement.appendChild(cssNode) } } } function applyToTag (styleElement, obj) { var css = obj.css var media = obj.media var sourceMap = obj.sourceMap if (media) { styleElement.setAttribute('media', media) } if (options.ssrId) { styleElement.setAttribute(ssrIdKey, obj.id) } if (sourceMap) { // https://developer.chrome.com/devtools/docs/javascript-debugging // this makes source maps inside style tags work properly in Chrome css += '\n/*# sourceURL=' + sourceMap.sources[0] + ' */' // http://stackoverflow.com/a/26603875 css += '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */' } if (styleElement.styleSheet) { styleElement.styleSheet.cssText = css } else { while (styleElement.firstChild) { styleElement.removeChild(styleElement.firstChild) } styleElement.appendChild(document.createTextNode(css)) } } /***/ }), /* 7 */ /***/ (function(module, exports) { /** * Translates the list format produced by css-loader into something * easier to manipulate. */ module.exports = function listToStyles (parentId, list) { var styles = [] var newStyles = {} for (var i = 0; i < list.length; i++) { var item = list[i] var id = item[0] var css = item[1] var media = item[2] var sourceMap = item[3] var part = { id: parentId + ':' + i, css: css, media: media, sourceMap: sourceMap } if (!newStyles[id]) { styles.push(newStyles[id] = { id: id, parts: [part] }) } else { newStyles[id].parts.push(part) } } return styles } /***/ }), /* 8 */ /***/ (function(module, exports) { /* globals __VUE_SSR_CONTEXT__ */ // IMPORTANT: Do NOT use ES2015 features in this file. // This module is a runtime utility for cleaner component module output and will // be included in the final webpack user bundle. module.exports = function normalizeComponent ( rawScriptExports, compiledTemplate, functionalTemplate, injectStyles, scopeId, moduleIdentifier /* server only */ ) { var esModule var scriptExports = rawScriptExports = rawScriptExports || {} // ES6 modules interop var type = typeof rawScriptExports.default if (type === 'object' || type === 'function') { esModule = rawScriptExports scriptExports = rawScriptExports.default } // Vue.extend constructor export interop var options = typeof scriptExports === 'function' ? scriptExports.options : scriptExports // render functions if (compiledTemplate) { options.render = compiledTemplate.render options.staticRenderFns = compiledTemplate.staticRenderFns options._compiled = true } // functional template if (functionalTemplate) { options.functional = true } // scopedId if (scopeId) { options._scopeId = scopeId } var hook if (moduleIdentifier) { // server build hook = function (context) { // 2.3 injection context = context || // cached call (this.$vnode && this.$vnode.ssrContext) || // stateful (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional // 2.2 with runInNewContext: true if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { context = __VUE_SSR_CONTEXT__ } // inject component styles if (injectStyles) { injectStyles.call(this, context) } // register component module identifier for async chunk inferrence if (context && context._registeredComponents) { context._registeredComponents.add(moduleIdentifier) } } // used by ssr in case component is cached and beforeCreate // never gets called options._ssrRegister = hook } else if (injectStyles) { hook = injectStyles } if (hook) { var functional = options.functional var existing = functional ? options.render : options.beforeCreate if (!functional) { // inject component registration as beforeCreate hook options.beforeCreate = existing ? [].concat(existing, hook) : [hook] } else { // for template-only hot-reload because in that case the render fn doesn't // go through the normalizer options._injectStyles = hook // register for functioal component in vue file options.render = function renderWithStyleInjection (h, context) { hook.call(context) return existing(h, context) } } } return { esModule: esModule, exports: scriptExports, options: options } } /***/ }), /* 9 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony default export */ __webpack_exports__["a"] = ({ "110000": { id: 110000, area_name: "北京", area_code: "Beijing", area_parent_id: 0, child: { "110100": { id: 110100, area_name: "北京市", area_code: "Beijing", area_parent_id: 110000, child: { "110101": { id: 110101, area_name: "东城区", area_code: "Dongcheng", area_parent_id: 110100 }, "110102": { id: 110102, area_name: "西城区", area_code: "Xicheng", area_parent_id: 110100 }, "110105": { id: 110105, area_name: "朝阳区", area_code: "Chaoyang", area_parent_id: 110100 }, "110106": { id: 110106, area_name: "丰台区", area_code: "Fengtai", area_parent_id: 110100 }, "110107": { id: 110107, area_name: "石景山区", area_code: "Shijingshan", area_parent_id: 110100 }, "110108": { id: 110108, area_name: "海淀区", area_code: "Haidian", area_parent_id: 110100 }, "110109": { id: 110109, area_name: "门头沟区", area_code: "Mentougou", area_parent_id: 110100 }, "110111": { id: 110111, area_name: "房山区", area_code: "Fangshan", area_parent_id: 110100 }, "110112": { id: 110112, area_name: "通州区", area_code: "Tongzhou", area_parent_id: 110100 }, "110113": { id: 110113, area_name: "顺义区", area_code: "Shunyi", area_parent_id: 110100 }, "110114": { id: 110114, area_name: "昌平区", area_code: "Changping", area_parent_id: 110100 }, "110115": { id: 110115, area_name: "大兴区", area_code: "Daxing", area_parent_id: 110100 }, "110116": { id: 110116, area_name: "怀柔区", area_code: "Huairou", area_parent_id: 110100 }, "110117": { id: 110117, area_name: "平谷区", area_code: "Pinggu", area_parent_id: 110100 }, "110228": { id: 110228, area_name: "密云县", area_code: "Miyun", area_parent_id: 110100 }, "110229": { id: 110229, area_name: "延庆县", area_code: "Yanqing", area_parent_id: 110100 } } } } }, "120000": { id: 120000, area_name: "天津", area_code: "Tianjin", area_parent_id: 0, child: { "120100": { id: 120100, area_name: "天津市", area_code: "Tianjin", area_parent_id: 120000, child: { "120101": { id: 120101, area_name: "和平区", area_code: "Heping", area_parent_id: 120100 }, "120102": { id: 120102, area_name: "河东区", area_code: "Hedong", area_parent_id: 120100 }, "120103": { id: 120103, area_name: "河西区", area_code: "Hexi", area_parent_id: 120100 }, "120104": { id: 120104, area_name: "南开区", area_code: "Nankai", area_parent_id: 120100 }, "120105": { id: 120105, area_name: "河北区", area_code: "Hebei", area_parent_id: 120100 }, "120106": { id: 120106, area_name: "红桥区", area_code: "Hongqiao", area_parent_id: 120100 }, "120110": { id: 120110, area_name: "东丽区", area_code: "Dongli", area_parent_id: 120100 }, "120111": { id: 120111, area_name: "西青区", area_code: "Xiqing", area_parent_id: 120100 }, "120112": { id: 120112, area_name: "津南区", area_code: "Jinnan", area_parent_id: 120100 }, "120113": { id: 120113, area_name: "北辰区", area_code: "Beichen", area_parent_id: 120100 }, "120114": { id: 120114, area_name: "武清区", area_code: "Wuqing", area_parent_id: 120100 }, "120115": { id: 120115, area_name: "宝坻区", area_code: "Baodi", area_parent_id: 120100 }, "120116": { id: 120116, area_name: "滨海新区", area_code: "Binhaixinqu", area_parent_id: 120100 }, "120221": { id: 120221, area_name: "宁河县", area_code: "Ninghe", area_parent_id: 120100 }, "120223": { id: 120223, area_name: "静海县", area_code: "Jinghai", area_parent_id: 120100 }, "120225": { id: 120225, area_name: "蓟县", area_code: "Jixian", area_parent_id: 120100 } } } } }, "130000": { id: 130000, area_name: "河北省", area_code: "Hebei", area_parent_id: 0, child: { "130100": { id: 130100, area_name: "石家庄市", area_code: "Shijiazhuang", area_parent_id: 130000, child: { "130102": { id: 130102, area_name: "长安区", area_code: "Chang'an", area_parent_id: 130100 }, "130104": { id: 130104, area_name: "桥西区", area_code: "Qiaoxi", area_parent_id: 130100 }, "130105": { id: 130105, area_name: "新华区", area_code: "Xinhua", area_parent_id: 130100 }, "130107": { id: 130107, area_name: "井陉矿区", area_code: "Jingxingkuangqu", area_parent_id: 130100 }, "130108": { id: 130108, area_name: "裕华区", area_code: "Yuhua", area_parent_id: 130100 }, "130109": { id: 130109, area_name: "藁城区", area_code: "Gaocheng", area_parent_id: 130100 }, "130110": { id: 130110, area_name: "鹿泉区", area_code: "Luquan", area_parent_id: 130100 }, "130111": { id: 130111, area_name: "栾城区", area_code: "Luancheng", area_parent_id: 130100 }, "130121": { id: 130121, area_name: "井陉县", area_code: "Jingxing", area_parent_id: 130100 }, "130123": { id: 130123, area_name: "正定县", area_code: "Zhengding", area_parent_id: 130100 }, "130125": { id: 130125, area_name: "行唐县", area_code: "Xingtang", area_parent_id: 130100 }, "130126": { id: 130126, area_name: "灵寿县", area_code: "Lingshou", area_parent_id: 130100 }, "130127": { id: 130127, area_name: "高邑县", area_code: "Gaoyi", area_parent_id: 130100 }, "130128": { id: 130128, area_name: "深泽县", area_code: "Shenze", area_parent_id: 130100 }, "130129": { id: 130129, area_name: "赞皇县", area_code: "Zanhuang", area_parent_id: 130100 }, "130130": { id: 130130, area_name: "无极县", area_code: "Wuji", area_parent_id: 130100 }, "130131": { id: 130131, area_name: "平山县", area_code: "Pingshan", area_parent_id: 130100 }, "130132": { id: 130132, area_name: "元氏县", area_code: "Yuanshi", area_parent_id: 130100 }, "130133": { id: 130133, area_name: "赵县", area_code: "Zhaoxian", area_parent_id: 130100 }, "130181": { id: 130181, area_name: "辛集市", area_code: "Xinji", area_parent_id: 130100 }, "130183": { id: 130183, area_name: "晋州市", area_code: "Jinzhou", area_parent_id: 130100 }, "130184": { id: 130184, area_name: "新乐市", area_code: "Xinle", area_parent_id: 130100 } } }, "130200": { id: 130200, area_name: "唐山市", area_code: "Tangshan", area_parent_id: 130000, child: { "130202": { id: 130202, area_name: "路南区", area_code: "Lunan", area_parent_id: 130200 }, "130203": { id: 130203, area_name: "路北区", area_code: "Lubei", area_parent_id: 130200 }, "130204": { id: 130204, area_name: "古冶区", area_code: "Guye", area_parent_id: 130200 }, "130205": { id: 130205, area_name: "开平区", area_code: "Kaiping", area_parent_id: 130200 }, "130207": { id: 130207, area_name: "丰南区", area_code: "Fengnan", area_parent_id: 130200 }, "130208": { id: 130208, area_name: "丰润区", area_code: "Fengrun", area_parent_id: 130200 }, "130209": { id: 130209, area_name: "曹妃甸区", area_code: "Caofeidian", area_parent_id: 130200 }, "130223": { id: 130223, area_name: "滦县", area_code: "Luanxian", area_parent_id: 130200 }, "130224": { id: 130224, area_name: "滦南县", area_code: "Luannan", area_parent_id: 130200 }, "130225": { id: 130225, area_name: "乐亭县", area_code: "Laoting", area_parent_id: 130200 }, "130227": { id: 130227, area_name: "迁西县", area_code: "Qianxi", area_parent_id: 130200 }, "130229": { id: 130229, area_name: "玉田县", area_code: "Yutian", area_parent_id: 130200 }, "130281": { id: 130281, area_name: "遵化市", area_code: "Zunhua", area_parent_id: 130200 }, "130283": { id: 130283, area_name: "迁安市", area_code: "Qian'an", area_parent_id: 130200 } } }, "130300": { id: 130300, area_name: "秦皇岛市", area_code: "Qinhuangdao", area_parent_id: 130000, child: { "130302": { id: 130302, area_name: "海港区", area_code: "Haigang", area_parent_id: 130300 }, "130303": { id: 130303, area_name: "山海关区", area_code: "Shanhaiguan", area_parent_id: 130300 }, "130304": { id: 130304, area_name: "北戴河区", area_code: "Beidaihe", area_parent_id: 130300 }, "130321": { id: 130321, area_name: "青龙满族自治县", area_code: "Qinglong", area_parent_id: 130300 }, "130322": { id: 130322, area_name: "昌黎县", area_code: "Changli", area_parent_id: 130300 }, "130323": { id: 130323, area_name: "抚宁县", area_code: "Funing", area_parent_id: 130300 }, "130324": { id: 130324, area_name: "卢龙县", area_code: "Lulong", area_parent_id: 130300 } } }, "130400": { id: 130400, area_name: "邯郸市", area_code: "Handan", area_parent_id: 130000, child: { "130402": { id: 130402, area_name: "邯山区", area_code: "Hanshan", area_parent_id: 130400 }, "130403": { id: 130403, area_name: "丛台区", area_code: "Congtai", area_parent_id: 130400 }, "130404": { id: 130404, area_name: "复兴区", area_code: "Fuxing", area_parent_id: 130400 }, "130406": { id: 130406, area_name: "峰峰矿区", area_code: "Fengfengkuangqu", area_parent_id: 130400 }, "130421": { id: 130421, area_name: "邯郸县", area_code: "Handan", area_parent_id: 130400 }, "130423": { id: 130423, area_name: "临漳县", area_code: "Linzhang", area_parent_id: 130400 }, "130424": { id: 130424, area_name: "成安县", area_code: "Cheng'an", area_parent_id: 130400 }, "130425": { id: 130425, area_name: "大名县", area_code: "Daming", area_parent_id: 130400 }, "130426": { id: 130426, area_name: "涉县", area_code: "Shexian", area_parent_id: 130400 }, "130427": { id: 130427, area_name: "磁县", area_code: "Cixian", area_parent_id: 130400 }, "130428": { id: 130428, area_name: "肥乡县", area_code: "Feixiang", area_parent_id: 130400 }, "130429": { id: 130429, area_name: "永年县", area_code: "Yongnian", area_parent_id: 130400 }, "130430": { id: 130430, area_name: "邱县", area_code: "Qiuxian", area_parent_id: 130400 }, "130431": { id: 130431, area_name: "鸡泽县", area_code: "Jize", area_parent_id: 130400 }, "130432": { id: 130432, area_name: "广平县", area_code: "Guangping", area_parent_id: 130400 }, "130433": { id: 130433, area_name: "馆陶县", area_code: "Guantao", area_parent_id: 130400 }, "130434": { id: 130434, area_name: "魏县", area_code: "Weixian", area_parent_id: 130400 }, "130435": { id: 130435, area_name: "曲周县", area_code: "Quzhou", area_parent_id: 130400 }, "130481": { id: 130481, area_name: "武安市", area_code: "Wu'an", area_parent_id: 130400 } } }, "130500": { id: 130500, area_name: "邢台市", area_code: "Xingtai", area_parent_id: 130000, child: { "130502": { id: 130502, area_name: "桥东区", area_code: "Qiaodong", area_parent_id: 130500 }, "130503": { id: 130503, area_name: "桥西区", area_code: "Qiaoxi", area_parent_id: 130500 }, "130521": { id: 130521, area_name: "邢台县", area_code: "Xingtai", area_parent_id: 130500 }, "130522": { id: 130522, area_name: "临城县", area_code: "Lincheng", area_parent_id: 130500 }, "130523": { id: 130523, area_name: "内丘县", area_code: "Neiqiu", area_parent_id: 130500 }, "130524": { id: 130524, area_name: "柏乡县", area_code: "Baixiang", area_parent_id: 130500 }, "130525": { id: 130525, area_name: "隆尧县", area_code: "Longyao", area_parent_id: 130500 }, "130526": { id: 130526, area_name: "任县", area_code: "Renxian", area_parent_id: 130500 }, "130527": { id: 130527, area_name: "南和县", area_code: "Nanhe", area_parent_id: 130500 }, "130528": { id: 130528, area_name: "宁晋县", area_code: "Ningjin", area_parent_id: 130500 }, "130529": { id: 130529, area_name: "巨鹿县", area_code: "Julu", area_parent_id: 130500 }, "130530": { id: 130530, area_name: "新河县", area_code: "Xinhe", area_parent_id: 130500 }, "130531": { id: 130531, area_name: "广宗县", area_code: "Guangzong", area_parent_id: 130500 }, "130532": { id: 130532, area_name: "平乡县", area_code: "Pingxiang", area_parent_id: 130500 }, "130533": { id: 130533, area_name: "威县", area_code: "Weixian", area_parent_id: 130500 }, "130534": { id: 130534, area_name: "清河县", area_code: "Qinghe", area_parent_id: 130500 }, "130535": { id: 130535, area_name: "临西县", area_code: "Linxi", area_parent_id: 130500 }, "130581": { id: 130581, area_name: "南宫市", area_code: "Nangong", area_parent_id: 130500 }, "130582": { id: 130582, area_name: "沙河市", area_code: "Shahe", area_parent_id: 130500 } } }, "130600": { id: 130600, area_name: "保定市", area_code: "Baoding", area_parent_id: 130000, child: { "130602": { id: 130602, area_name: "新市区", area_code: "Xinshi", area_parent_id: 130600 }, "130603": { id: 130603, area_name: "北市区", area_code: "Beishi", area_parent_id: 130600 }, "130604": { id: 130604, area_name: "南市区", area_code: "Nanshi", area_parent_id: 130600 }, "130621": { id: 130621, area_name: "满城县", area_code: "Mancheng", area_parent_id: 130600 }, "130622": { id: 130622, area_name: "清苑县", area_code: "Qingyuan", area_parent_id: 130600 }, "130623": { id: 130623, area_name: "涞水县", area_code: "Laishui", area_parent_id: 130600 }, "130624": { id: 130624, area_name: "阜平县", area_code: "Fuping", area_parent_id: 130600 }, "130625": { id: 130625, area_name: "徐水县", area_code: "Xushui", area_parent_id: 130600 }, "130626": { id: 130626, area_name: "定兴县", area_code: "Dingxing", area_parent_id: 130600 }, "130627": { id: 130627, area_name: "唐县", area_code: "Tangxian", area_parent_id: 130600 }, "130628": { id: 130628, area_name: "高阳县", area_code: "Gaoyang", area_parent_id: 130600 }, "130629": { id: 130629, area_name: "容城县", area_code: "Rongcheng", area_parent_id: 130600 }, "130630": { id: 130630, area_name: "涞源县", area_code: "Laiyuan", area_parent_id: 130600 }, "130631": { id: 130631, area_name: "望都县", area_code: "Wangdu", area_parent_id: 130600 }, "130632": { id: 130632, area_name: "安新县", area_code: "Anxin", area_parent_id: 130600 }, "130633": { id: 130633, area_name: "易县", area_code: "Yixian", area_parent_id: 130600 }, "130634": { id: 130634, area_name: "曲阳县", area_code: "Quyang", area_parent_id: 130600 }, "130635": { id: 130635, area_name: "蠡县", area_code: "Lixian", area_parent_id: 130600 }, "130636": { id: 130636, area_name: "顺平县", area_code: "Shunping", area_parent_id: 130600 }, "130637": { id: 130637, area_name: "博野县", area_code: "Boye", area_parent_id: 130600 }, "130638": { id: 130638, area_name: "雄县", area_code: "Xiongxian", area_parent_id: 130600 }, "130681": { id: 130681, area_name: "涿州市", area_code: "Zhuozhou", area_parent_id: 130600 }, "130682": { id: 130682, area_name: "定州市", area_code: "Dingzhou", area_parent_id: 130600 }, "130683": { id: 130683, area_name: "安国市", area_code: "Anguo", area_parent_id: 130600 }, "130684": { id: 130684, area_name: "高碑店市", area_code: "Gaobeidian", area_parent_id: 130600 } } }, "130700": { id: 130700, area_name: "张家口市", area_code: "Zhangjiakou", area_parent_id: 130000, child: { "130702": { id: 130702, area_name: "桥东区", area_code: "Qiaodong", area_parent_id: 130700 }, "130703": { id: 130703, area_name: "桥西区", area_code: "Qiaoxi", area_parent_id: 130700 }, "130705": { id: 130705, area_name: "宣化区", area_code: "Xuanhua", area_parent_id: 130700 }, "130706": { id: 130706, area_name: "下花园区", area_code: "Xiahuayuan", area_parent_id: 130700 }, "130721": { id: 130721, area_name: "宣化县", area_code: "Xuanhua", area_parent_id: 130700 }, "130722": { id: 130722, area_name: "张北县", area_code: "Zhangbei", area_parent_id: 130700 }, "130723": { id: 130723, area_name: "康保县", area_code: "Kangbao", area_parent_id: 130700 }, "130724": { id: 130724, area_name: "沽源县", area_code: "Guyuan", area_parent_id: 130700 }, "130725": { id: 130725, area_name: "尚义县", area_code: "Shangyi", area_parent_id: 130700 }, "130726": { id: 130726, area_name: "蔚县", area_code: "Yuxian", area_parent_id: 130700 }, "130727": { id: 130727, area_name: "阳原县", area_code: "Yangyuan", area_parent_id: 130700 }, "130728": { id: 130728, area_name: "怀安县", area_code: "Huai'an", area_parent_id: 130700 }, "130729": { id: 130729, area_name: "万全县", area_code: "Wanquan", area_parent_id: 130700 }, "130730": { id: 130730, area_name: "怀来县", area_code: "Huailai", area_parent_id: 130700 }, "130731": { id: 130731, area_name: "涿鹿县", area_code: "Zhuolu", area_parent_id: 130700 }, "130732": { id: 130732, area_name: "赤城县", area_code: "Chicheng", area_parent_id: 130700 }, "130733": { id: 130733, area_name: "崇礼县", area_code: "Chongli", area_parent_id: 130700 } } }, "130800": { id: 130800, area_name: "承德市", area_code: "Chengde", area_parent_id: 130000, child: { "130802": { id: 130802, area_name: "双桥区", area_code: "Shuangqiao", area_parent_id: 130800 }, "130803": { id: 130803, area_name: "双滦区", area_code: "Shuangluan", area_parent_id: 130800 }, "130804": { id: 130804, area_name: "鹰手营子矿区", area_code: "Yingshouyingzikuangqu", area_parent_id: 130800 }, "130821": { id: 130821, area_name: "承德县", area_code: "Chengde", area_parent_id: 130800 }, "130822": { id: 130822, area_name: "兴隆县", area_code: "Xinglong", area_parent_id: 130800 }, "130823": { id: 130823, area_name: "平泉县", area_code: "Pingquan", area_parent_id: 130800 }, "130824": { id: 130824, area_name: "滦平县", area_code: "Luanping", area_parent_id: 130800 }, "130825": { id: 130825, area_name: "隆化县", area_code: "Longhua", area_parent_id: 130800 }, "130826": { id: 130826, area_name: "丰宁满族自治县", area_code: "Fengning", area_parent_id: 130800 }, "130827": { id: 130827, area_name: "宽城满族自治县", area_code: "Kuancheng", area_parent_id: 130800 }, "130828": { id: 130828, area_name: "围场满族蒙古族自治县", area_code: "Weichang", area_parent_id: 130800 } } }, "130900": { id: 130900, area_name: "沧州市", area_code: "Cangzhou", area_parent_id: 130000, child: { "130902": { id: 130902, area_name: "新华区", area_code: "Xinhua", area_parent_id: 130900 }, "130903": { id: 130903, area_name: "运河区", area_code: "Yunhe", area_parent_id: 130900 }, "130921": { id: 130921, area_name: "沧县", area_code: "Cangxian", area_parent_id: 130900 }, "130922": { id: 130922, area_name: "青县", area_code: "Qingxian", area_parent_id: 130900 }, "130923": { id: 130923, area_name: "东光县", area_code: "Dongguang", area_parent_id: 130900 }, "130924": { id: 130924, area_name: "海兴县", area_code: "Haixing", area_parent_id: 130900 }, "130925": { id: 130925, area_name: "盐山县", area_code: "Yanshan", area_parent_id: 13