12 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["TeachingSet"],{"28a5":function(e,t,a){"use strict";var n=a("aae3"),i=a("cb7c"),r=a("ebd6"),s=a("0390"),o=a("9def"),c=a("5f1b"),l=a("520a"),u=a("79e5"),d=Math.min,h=[].push,p="split",v="length",f="lastIndex",g=4294967295,m=!u(function(){RegExp(g,"y")});a("214f")("split",2,function(e,t,a,u){var b;return b="c"=="abbc"[p](/(b)*/)[1]||4!="test"[p](/(?:)/,-1)[v]||2!="ab"[p](/(?:ab)*/)[v]||4!="."[p](/(.?)(.?)/)[v]||"."[p](/()()/)[v]>1||""[p](/.?/)[v]?function(e,t){var i=String(this);if(void 0===e&&0===t)return[];if(!n(e))return a.call(i,e,t);var r,s,o,c=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),d=0,p=void 0===t?g:t>>>0,m=new RegExp(e.source,u+"g");while(r=l.call(m,i)){if(s=m[f],s>d&&(c.push(i.slice(d,r.index)),r[v]>1&&r.index<i[v]&&h.apply(c,r.slice(1)),o=r[0][v],d=s,c[v]>=p))break;m[f]===r.index&&m[f]++}return d===i[v]?!o&&m.test("")||c.push(""):c.push(i.slice(d)),c[v]>p?c.slice(0,p):c}:"0"[p](void 0,0)[v]?function(e,t){return void 0===e&&0===t?[]:a.call(this,e,t)}:a,[function(a,n){var i=e(this),r=void 0==a?void 0:a[t];return void 0!==r?r.call(a,i,n):b.call(String(i),a,n)},function(e,t){var n=u(b,e,this,t,b!==a);if(n.done)return n.value;var l=i(e),h=String(this),p=r(l,RegExp),v=l.unicode,f=(l.ignoreCase?"i":"")+(l.multiline?"m":"")+(l.unicode?"u":"")+(m?"y":"g"),k=new p(m?l:"^(?:"+l.source+")",f),x=void 0===t?g:t>>>0;if(0===x)return[];if(0===h.length)return null===c(k,h)?[h]:[];var y=0,S=0,w=[];while(S<h.length){k.lastIndex=m?S:0;var _,$=c(k,m?h:h.slice(S));if(null===$||(_=d(o(k.lastIndex+(m?0:S)),h.length))===y)S=s(h,S,v);else{if(w.push(h.slice(y,S)),w.length===x)return w;for(var E=1;E<=$.length-1;E++)if(w.push($[E]),w.length===x)return w;S=y=_}}return w.push(h.slice(y)),w}]})},3354:function(e,t,a){},"386d":function(e,t,a){"use strict";var n=a("cb7c"),i=a("83a1"),r=a("5f1b");a("214f")("search",1,function(e,t,a,s){return[function(a){var n=e(this),i=void 0==a?void 0:a[t];return void 0!==i?i.call(a,n):new RegExp(a)[t](String(n))},function(e){var t=s(a,e,this);if(t.done)return t.value;var o=n(e),c=String(this),l=o.lastIndex;i(l,0)||(o.lastIndex=0);var u=r(o,c);return i(o.lastIndex,l)||(o.lastIndex=l),null===u?-1:u.index}]})},"4ca3":function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"teachingset"},[a("m-header"),a("van-search",{attrs:{shape:"round",placeholder:"搜小区、学校",background:"transparent"},on:{search:e.onSearch},model:{value:e.search_value,callback:function(t){e.search_value=t},expression:"search_value"}}),a("el-amap",{attrs:{zoom:e.zoom,events:e.amapEvents(),plugin:e.plugin,center:e.center}},e._l(e.markers,function(e,t){return a("el-amap-marker",{key:t,attrs:{clickable:!0,events:e.events,position:e.position}})}),1),a("van-cell-group",[a("van-field",{attrs:{type:"textarea",rows:"1",autosize:"",disabled:!0,label:"教学地址",placeholder:"详情地址"},model:{value:e.addressDetail,callback:function(t){e.addressDetail=t},expression:"addressDetail"}}),a("van-field",{attrs:{type:"text",label:"教学点名称",placeholder:"请输入名称"},model:{value:e.teachingSchool,callback:function(t){e.teachingSchool=t},expression:"teachingSchool"}})],1),a("div",{staticClass:"button-group"},[a("van-button",{attrs:{type:"primary",round:"",size:"large"},on:{click:e.onSubmit}},[e._v("确认")])],1)],1)},i=[],r=(a("386d"),a("28a5"),a("7f7f"),a("8f9b")),s=a.n(r),o=a("6e6e"),c=a("9afb");s.a.initAMapApiLoader({key:"c7856e7c812d299cff150e74d60ea608",plugin:["AMap.Geolocation","AMap.PlaceSearch","AMap.Geocoder","AMap.ToolBar"],v:"1.4.4"});var l={name:"teachingset",components:{MHeader:o["a"]},data:function(){var e=this;return{type:this.$route.query.type,search_value:"",zoom:12,center:[114.34371,30.55939],markers:[],searchResult:[],plugin:[{pName:"Geolocation",events:{init:function(t){"create"==e.type&&t.getCurrentPosition(function(t,a){a&&a.position&&(e.lng=a.position.lng,e.lat=a.position.lat,e.center=[e.lng,e.lat],e.loaded=!0,e.$nextTick())})}}},{pName:"ToolBar",events:{init:function(){}}}],searchOption:{pageSize:1,pageIndex:1,autoFitView:!0},addressDetail:null,teachingSchool:null,lnglat:null}},mounted:function(){document.title="教学点设置";var e=this.$route.query;if("update"==e.type){this.addressDetail=e.address,this.teachingSchool=e.name,this.lnglat=e.longitudeLatitude;var t=e.longitudeLatitude.split(",");this.center=[t[0],t[1]],this.markers.push({position:[t[0],t[1]],events:this.markerEvents()})}},methods:{amapEvents:function(){return{complete:function(){}}},onSubmit:function(){var e=this;this.addressDetail?this.teachingSchool?"create"==this.type?Object(c["q"])({name:this.teachingSchool,address:this.addressDetail,longitudeLatitude:this.lnglat}).then(function(t){var a=t.data;200==a.code?(e.$toast("添加成功"),e.$router.push("/teachingSchool")):e.$toast(a.msg)}):"update"==this.type&&Object(c["s"])({id:this.$route.query.id,name:this.teachingSchool,address:this.addressDetail,longitudeLatitude:this.lnglat}).then(function(t){var a=t.data;200==a.code?(e.$toast("修改成功"),e.$router.push("/teachingSchool")):e.$toast(a.msg)}):this.$toast("请输入教学点名称"):this.$toast("请选择教学地点")},onSearch:function(){var e=this;if(this.search_value){this.markers=[];var t=new s.a.PlaceSearch(this.searchOption);t.search(this.search_value,function(t,a){if(a&&a.poiList&&a.poiList.count){var n=a.poiList.pois[0];e.searchResult.push(n),e.markers.push({position:[n.location.lng,n.location.lat],events:e.markerEvents(n)}),e.center=[n.location.lng,n.location.lat]}else if(void 0===a.poiList)throw new Error(a)})}},markerEvents:function(){var e=this;return{click:function(t){var a=new s.a.Geocoder;a.getAddress(t.lnglat,function(a,n){"complete"===a&&n.regeocode?(e.lnglat=t.lnglat.lng+","+t.lnglat.lat,e.addressDetail=n.regeocode.formattedAddress):e.$toast("请重新选择地址")})}}}}},u=l,d=(a("6e2e"),a("2877")),h=Object(d["a"])(u,n,i,!1,null,"bd7e77a2",null);t["default"]=h.exports},5020:function(e,t,a){},5115:function(e,t,a){"use strict";var n=a("3354"),i=a.n(n);i.a},"6e2e":function(e,t,a){"use strict";var n=a("5020"),i=a.n(n);i.a},"6e6e":function(e,t,a){"use strict";var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"mheader"},[a("header",{staticClass:"m-nav-header",class:[e.isFixed?"fixed":""]},[a("div",{directives:[{name:"show",rawName:"v-show",value:e.isBack,expression:"isBack"}],staticClass:"m-nav-bar__left",on:{click:e.goBack}},[a("van-icon",{staticClass:"arrow-left",attrs:{name:"arrow-left"}})],1),a("div",{staticClass:"m-nav-bar__title"},[e._t("default",[e._v(e._s(e.name?e.name:this.$route.meta.descrition))])],2),a("div",{staticClass:"m-nav-bar__right"},[e._t("right")],2)])])},i=[],r={name:"mheader",props:{name:String,isBack:{type:Boolean,default:!0},isFixed:{type:Boolean,default:!0},backUrl:{type:Object,default:function(){return{callBack:null,path:"",params:{}}}}},methods:{goBack:function(){var e=this.backUrl;"function"==typeof e.callBack?e.callBack():e.path?this.$router.push({path:e.path,query:e.params}):history.go(-1)}}},s=r,o=(a("5115"),a("2877")),c=Object(o["a"])(s,n,i,!1,null,"61d0e2e4",null);t["a"]=c.exports},"7f7f":function(e,t,a){var n=a("86cc").f,i=Function.prototype,r=/^\s*function ([^ (]*)/,s="name";s in i||a("9e1e")&&n(i,s,{configurable:!0,get:function(){try{return(""+this).match(r)[1]}catch(e){return""}}})},"83a1":function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e===1/t:e!=e&&t!=t}},aae3:function(e,t,a){var n=a("d3f4"),i=a("2d95"),r=a("2b4c")("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[r])?!!t:"RegExp"==i(e))}}}]);
- //# sourceMappingURL=TeachingSet.69041a22.js.map
|