|
|
|
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/region-picker/region-picker"],{"5f47":function(e,t,a){"use strict";a.r(t);var n=a("8c6d"),i=a.n(n);for(var s in n)"default"!==s&&function(e){a.d(t,e,(function(){return n[e]}))}(s);t["default"]=i.a},"8c6d":function(e,t,a){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=i(a("1f5e"));function i(e){return e&&e.__esModule?e:{default:e}}var s={name:"regionPicker",props:{value:{type:[Array,String,Number],default:[0,0,0]},disabled:{type:Boolean,default:!1},jsonPath:{type:String,default:null},jsonData:{type:Array,default:null}},data:function(){return{dataValue:[],dataDisabled:!1,range:[],zones_tree:[]}},mounted:function(t){var a=this;this.jsonData?(this.zones_tree=this.jsonData,this.dataDisabled=this.disabled,this.value_format(),this.range_set()):this.jsonPath?e.request({url:this.jsonPath,success:function(e){a.zones_tree=e.data,a.dataDisabled=a.disabled,a.value_format(),a.range_set()}}):(this.zones_tree=n.default.zones_tree,this.dataDisabled=this.disabled,this.value_format(),this.range_set())},watch:{jsonData:function(e,t){this.zones_tree=e,this.dataDisabled=this.disabled,this.value_format(),this.range_set()},value:function(e,t){JSON.stringify(e)!=JSON.stringify(t)&&"object"!=typeof e&&"object"==typeof t&&t[2]+""!=e+""&&(this.value=e,this.value_format(),this.range_set(),this.region_change({detail:{value:this.dataValue}}))}},methods:{value_format:function(){var e=this.value;"number"==typeof e&&(e+=""),"string"==typeof e&&e.indexOf(",")>0&&(e=e.split(","));var t=0,a=0,n=0;"string"==typeof e?(this.zones_tree.forEach((function(i,s){i.children.forEach((function(i,o){i.children.forEach((function(i,r){i.code==e&&(t=s,a=o,n=r)}))}))})),this.dataValue=[t,a,n]):"string"==typeof e[0]||e[0]>999?(this.zones_tree.forEach((function(i,s){i.code==e[0]&&(t=s,i.children.forEach((function(t,i){t.code==e[1]&&(a=i,t.children.forEach((function(t,a){t.code==e[2]&&(n=a)})))})))})),this.dataValue=[t,a,n]):this.dataValue=e},range_set:function(){var e=this,t=[[],[],[]];this.zones_tree.forEach((function(a,n){t[0].push(a.name),n==e.dataValue[0]&&a.children.forEach((function(a,n){t[1].push(a.name),n==e.dataValue[1]&&a.children.forEach((function(e,a){t[2].push(e.name)}))}))})),this.range=t},region_change:function(e){var t=e.detail.value,a=[],n=[],i=this.zones_tree[t[0]];a.push(i.name),n.push(i.code);var s=i.children[t[1]];a.push(s.name),n.push(s.code);var o=s.children[t[2]];a.push(o.name),n.push(o.code),e.detail={code:n,value:a,data:o},this.$emit("change",e)},region_change_col:function(e){0===e.detail.column&&(this.dataValue[1]=0,this.dataValue[2]=0),1===e.detail.column&&(this.dataValue[2]=0),this.dataValue[e.detail.column]=e.detail.value,this.range_set(),this.$emit("columnchange",e)},region_cancel:function(e){this.$emit("cancel",e)}}};t.default=s}).call(this,a("543d")["default"])},"97c7":function(e,t,a){"use strict";a.r(t);var n=a("b50f"),i=a("5f47");for(var s in i)"default"!==s&&function(e){a.d(t,e,(function(){return i[e]}))}(s);var o,r=a("f0c5"),u=Object(r["a"])(i["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],o);t["default"]=u.exports},b50f:function(e,t,a){"use strict";var n;a.d(t,"b",(function(){return i})),a.d(t,"c",(function(){return s})),a.d(t,"a",(function(){return n}));var i=function(){var e=this,t=e.$createElement;e._self._c},s=[]}}]);
|