You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
3.9 KiB
11 lines
3.9 KiB
3 years ago
|
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/pick-regions/pick-regions"],{"15b3":function(t,r,i){"use strict";function n(t,r){return c(t)||l(t,r)||a(t,r)||e()}function e(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(t,r){if(t){if("string"===typeof t)return u(t,r);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?u(t,r):void 0}}function u(t,r){(null==r||r>t.length)&&(r=t.length);for(var i=0,n=new Array(r);i<r;i++)n[i]=t[i];return n}function l(t,r){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t)){var i=[],n=!0,e=!1,a=void 0;try{for(var u,l=t[Symbol.iterator]();!(n=(u=l.next()).done);n=!0)if(i.push(u.value),r&&i.length===r)break}catch(c){e=!0,a=c}finally{try{n||null==l["return"]||l["return"]()}finally{if(e)throw a}}return i}}function c(t){if(Array.isArray(t))return t}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=i("0529"),s={props:{defaultRegions:{type:Array,default:function(){return[]}},defaultRegionCode:{type:String},defaultRegion:[String,Array]},data:function(){return{cityArr:o[0].childs,districtArr:o[0].childs[0].childs,multiIndex:[0,0,0],isInitMultiArray:!0}},watch:{defaultRegion:{handler:function(t,r){Array.isArray(t)?(r=r||[],t.join("")!==r.join("")&&this.handleDefaultRegion(t)):t&&6==t.length?this.handleDefaultRegion(t):console.warn("defaultRegion非有效格式")},immediate:!0}},computed:{multiArray:function(){return this.pickedArr.map((function(t){return t.map((function(t){return t.name}))}))},pickedArr:function(){return this.isInitMultiArray?[o,o[0].childs,o[0].childs[0].childs]:[o,this.cityArr,this.districtArr]}},methods:{handleColumnChange:function(t){this.isInitMultiArray=!1;var r=this,i=t.detail.column,n=t.detail.value;r.multiIndex[i]=n;try{switch(i){case 0:if(0==o[r.multiIndex[0]].childs.length){r.cityArr=r.districtArr=[o[r.multiIndex[0]]];break}r.cityArr=o[r.multiIndex[0]].childs,r.districtArr=o[r.multiIndex[0]].childs[r.multiIndex[1]].childs;break;case 1:r.districtArr=o[r.multiIndex[0]].childs[r.multiIndex[1]].childs;break;case 2:break}}catch(t){r.districtArr=o[r.multiIndex[0]].childs[0].childs}},handleValueChange:function(t){var r=n(t.detail.value,3),i=r[0],e=r[1],a=r[2],u=n(this.pickedArr,3),l=u[0],c=u[1],o=u[2],s=[l[i],c[e],o[a]];this.$emit("getRegion",s)},handleDefaultRegion:function(t){var r=!Array.isArray(t);this.isInitMultiArray=!1;for(var i=o,n=0;n<3;n++)for(var e=0;e<i.length;e++){var a=r?i[e].code==t.slice(0,2*(n+1)):i[e].name.includes(t[n]);if(a){i=i[e].childs,0==n?this.cityArr=i:1==n&&(this.districtArr=i),this.$set(this.multiIndex,n,e);break}0==n&&e==i.length-1&&(this.isInitMultiArray=!0)}}}};r.default=s},5905:function(t,r,i){"use strict";var n;i.d(r,"b",(function(){return e})),i.d(r,"c",(function(){return a})),i.d(r,"a",(function(){return n}));var e=function(){var t=this,r=t.$createElement;t._self._c},a=[]},c403:function(t,r,i){"use strict";i.r(r);var n=i("15b3"),e=i.n(n);for(var a in n)"default"!==a&&function(t){i.d(r,t,(function(){return n[t]}))}(a);r["default"]=e.a},d93e:function(t,r,i){"use strict";i.r(r);var n=i("5905"),e=i("c403");for(var a in e)"default"!==a&&function(t){i.d(r,t,(function(){return e[t]}))}(a);var u,l=i("f0c5"),c=Object(l["a"])(e["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],u);r["default"]=c.exports}}]);
|
||
|
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
|
||
|
'components/pick-regions/pick-regions-create-component',
|
||
|
{
|
||
|
'components/pick-regions/pick-regions-create-component':(function(module, exports, __webpack_require__){
|
||
|
__webpack_require__('543d')['createComponent'](__webpack_require__("d93e"))
|
||
|
})
|
||
|
},
|
||
|
[['components/pick-regions/pick-regions-create-component']]
|
||
|
]);
|