text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3a895f28","chunk-41ed17e8"],{"274d":function(e,t,n){"use strict";n.d(t,"d",(function(){return i})),n.d(t,"e",(function(){return l})),n.d(t,"a",(function(){return s})),n.d(t,"c",(function(){return c})),n.d(t,"b",(function(){return u}));var r=n("2ef0"),o=n("c98b"),a=n("1f47");function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o["a"].onAny("/region/list").reply((function(e){return a["c"](Object(r["assign"])({}))})),Object(o["c"])({url:"/region/list",method:"get",params:e})}function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o["a"].onAny("/region/view").reply((function(e){return a["c"](Object(r["assign"])({}))})),Object(o["c"])({url:"/region/view",method:"get",params:e})}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o["a"].onAny("/region/add").reply((function(e){return a["c"](Object(r["assign"])({}))})),Object(o["c"])({url:"/region/add",method:"post",data:e})}function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o["a"].onAny("/region/edit").reply((function(e){return a["c"](Object(r["assign"])({}))})),Object(o["c"])({url:"/region/edit",method:"post",params:e,data:t})}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o["a"].onAny("/region/delete").reply((function(e){return a["c"](Object(r["assign"])({}))})),Object(o["c"])({url:"/region/delete",method:"post",params:e})}},"3b37":function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("d2-drawer",{on:{open:e.onLoad},model:{value:e.currentValue,callback:function(t){e.currentValue=t},expression:"currentValue"}},[n("div",{attrs:{slot:"header"},slot:"header"},[e._v("添加区域")]),n("template",{slot:"footer"},[n("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v("确认提交")])],1),n("el-form",{ref:"form",attrs:{model:e.form,rules:e.formRules,"label-width":"120px"}},[n("view-page",{attrs:{title:"基础信息"}},[n("el-form-item",{attrs:{label:"区域名称",prop:"name"}},[n("el-input",{attrs:{placeholder:"请输入区域名称"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),n("el-form-item",{attrs:{label:"区域短名称",prop:"shortname"}},[n("el-input",{attrs:{placeholder:"请输入区域短名称"},on:{input:e.onShortnameInput},model:{value:e.form.shortname,callback:function(t){e.$set(e.form,"shortname",t)},expression:"form.shortname"}})],1),n("el-form-item",{attrs:{label:"拼音",prop:"pinyin"}},[n("el-input",{attrs:{readonly:""},model:{value:e.form.pinyin,callback:function(t){e.$set(e.form,"pinyin",t)},expression:"form.pinyin"}})],1),n("el-form-item",{attrs:{label:"上一级别",prop:"parent_name"}},[n("el-input",{attrs:{placeholder:"请选择上一级别"},model:{value:e.form.parent_name,callback:function(t){e.$set(e.form,"parent_name",t)},expression:"form.parent_name"}},[n("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:function(t){e.showRegionList=!0}},slot:"append"})],1)],1),n("el-form-item",{attrs:{label:"区域全称",prop:"merger_name"}},[n("el-input",{attrs:{readonly:""},model:{value:e.form.merger_name,callback:function(t){e.$set(e.form,"merger_name",t)},expression:"form.merger_name"}})],1),n("el-form-item",{attrs:{label:"区域编码",prop:"code"}},[n("el-input",{attrs:{placeholder:"请输入区域编码"},model:{value:e.form.code,callback:function(t){e.$set(e.form,"code",t)},expression:"form.code"}})],1),n("el-form-item",{attrs:{label:"区域邮编",prop:"zip_code"}},[n("el-input",{attrs:{placeholder:"请输入区域邮编"},model:{value:e.form.zip_code,callback:function(t){e.$set(e.form,"zip_code",t)},expression:"form.zip_code"}})],1),n("el-form-item",{attrs:{label:"经度",prop:"lng"}},[n("el-input",{attrs:{placeholder:"请输入经度"},model:{value:e.form.lng,callback:function(t){e.$set(e.form,"lng",t)},expression:"form.lng"}})],1),n("el-form-item",{attrs:{label:"纬度",prop:"lat"}},[n("el-input",{attrs:{placeholder:"请输入纬度"},model:{value:e.form.lat,callback:function(t){e.$set(e.form,"lat",t)},expression:"form.lat"}})],1)],1)],1),n("region-list",{attrs:{bringback:""},on:{"on-success":e.onRegionSelected},model:{value:e.showRegionList,callback:function(t){e.showRegionList=t},expression:"showRegionList"}})],2)},o=[],a=(n("a15b"),n("d3b7"),n("ac1f"),n("5319"),n("96cf"),n("1da1")),i=n("ad0b"),l=n("54c2"),s=n("a3f8"),c=n("274d"),u=n("c276"),m=n("d958"),f=n.n(m),d={mixins:[i["a"]],components:{ViewPage:l["a"],D2Drawer:s["a"],RegionList:function(){return n.e("chunk-2d0ac96c").then(n.bind(null,"19d2"))}},data:function(){return{showRegionList:!1,form:{name:"",shortname:"",parent_name:"",pid:0,merger_name:"",level:"",pinyin:"",code:"",zip_code:"",first:"",lng:"",lat:""},formRules:{name:[{required:!0,message:"请输入区域名称",trigger:"blur"}],shortname:[{required:!0,message:"请输入区域短名称",trigger:"blur"}],parent_name:[{required:!0,message:"请选择上一级别",trigger:"change"}],code:[{pattern:/^\d{3}$/,message:"请输入正确的区域编码",trigger:"blur"}],zip_code:[{pattern:/^\d{6}$/,message:"请输入正确的区域邮编",trigger:"blur"}],lng:[{pattern:u["a"].pattern.decimal1,message:"请输入正确的经度",trigger:"blur"}],lat:[{pattern:u["a"].pattern.decimal1,message:"请输入正确的纬度",trigger:"blur"}]}}},created:function(){this._reset()},methods:{onLoad:function(){this._reset()},onRegionSelected:function(e){this.form.parent_name=e.merger_name,this.form.pid=e.id;var t=e.merger_name+","+this.form.shortname;this.form.merger_name=t.replace(/^,+|,+$/gm,t),this.form.level=e.level+1},onShortnameInput:function(){var e=this.form.parent_name+","+this.form.shortname;this.form.merger_name=e.replace(/^,+|,+$/gm,""),this.form.pinyin=f()(this.form.shortname,{style:f.a.STYLE_NORMAL}).join(""),this.form.first=this.form.pinyin.charAt(0).toUpperCase()},onSubmit:function(){var e=this;this.$refs.form.validate(function(){var t=Object(a["a"])(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!n){t.next=5;break}return t.next=3,c["a"](e.form);case 3:e.currentValue=!1,e.$emit("on-success");case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}}},p=d,h=n("2877"),g=Object(h["a"])(p,r,o,!1,null,null,null);t["default"]=g.exports},"54c2":function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"view-page"},[n("div",{staticClass:"view-page__title"},[n("h3",[e._v(e._s(e.title))])]),n("div",{staticClass:"view-page__content"},[e._t("default")],2)])},o=[],a={props:{title:{type:String,default:""}}},i=a,l=n("2877"),s=Object(l["a"])(i,r,o,!1,null,null,null);t["a"]=s.exports},6899:function(e,t,n){"use strict";n("9c04")},"9c04":function(e,t,n){},a3f8:function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-drawer",{attrs:{visible:e.currentValue,"append-to-body":!0,"before-close":e.onBeforeClose,"custom-class":e.customClass,direction:e.direction,size:e.size,"with-header":!1,"show-close":!1,"destroy-on-close":!1},on:{"update:visible":function(t){e.currentValue=t},open:e.onOpen,close:e.onClose}},[n("div",{staticClass:"drawer_full"},[n("div",{staticClass:"drawer_full__header"},[e._t("header")],2),n("div",{staticClass:"drawer_full__body"},[e._t("default")],2),n("div",{staticClass:"drawer_full__footer"},[e._t("footer"),n("el-button",{on:{click:function(t){return e.onBeforeClose(!0)}}},[e._v("关闭")])],2)])])},o=[],a=(n("a9e3"),n("ad0b")),i={mixins:[a["a"]],props:{customClass:{Type:String,default:""},direction:{Type:String,default:"rtl"},size:{Type:String|Number,default:"80%"}},data:function(){return{}},methods:{onBeforeClose:function(e){var t=this;if(e)return this.currentValue=!1,this.$emit("on-close");this.$confirm("确定要关闭当前弹窗吗？").then((function(e){t.currentValue=!1,t.$emit("on-close")})).catch((function(e){}))},onOpen:function(){this.$emit("open")},onClose:function(){this.$emit("close")}}},l=i,s=(n("6899"),n("2877")),c=Object(s["a"])(l,r,o,!1,null,"63ae5274",null);t["a"]=c.exports},ad0b:function(e,t,n){"use strict";var r=n("2ef0");t["a"]={props:{value:{type:Boolean,default:!1},bringback:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1}},data:function(){return{currentValue:!1,currentSelected:[]}},watch:{value:function(e){this.currentValue=e},currentValue:function(e){this.$emit("input",e)},currentSelected:function(e){this.$emit("on-selected",e)}},methods:{_reset:function(e){Object(r["assign"])(this.$data,this.$options.data(),{currentValue:this.value},e||{})},_resetOnly:function(e){Object(r["merge"])(this.$data,{currentSelected:[]},e||{})},_onSelected:function(e){this.multiple,this.currentSelected=e},_onBringback:function(e){if(null===e&&0===this.currentSelected.length)return this.$message.error("请至少选择一项");this.$emit("on-success",null===e?this.currentSelected:e),this.currentValue=!1}}}}}]);