TeachingSet.63bb6b5b.js 12 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["TeachingSet"],{3908:function(t,e,r){"use strict";r.d(e,"a",function(){return a});r("433b");var n=r("d399");function a(t){t?n["a"].loading({duration:0,forbidClick:!0,message:"加载中..."}):n["a"].clear()}},"4ca33":function(t,e,r){"use strict";r.r(e);var n=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"teachingset"},[r("m-header"),r("van-search",{attrs:{shape:"round",placeholder:"搜小区、学校",background:"transparent","show-action":""},on:{search:t.onSearch},model:{value:t.search_value,callback:function(e){t.search_value=e},expression:"search_value"}},[r("div",{attrs:{slot:"action"},on:{click:t.onSearch},slot:"action"},[t._v("搜索")])]),r("el-amap",{attrs:{zoom:t.zoom,events:t.amapEvents(),plugin:t.plugin,center:t.center}},t._l(t.markers,function(t,e){return r("el-amap-marker",{key:e,attrs:{clickable:!0,events:t.events,position:t.position}})}),1),r("van-cell-group",[r("van-field",{attrs:{type:"textarea",rows:"1",autosize:"",readonly:"",label:"教学地址",placeholder:"详情地址"},model:{value:t.addressDetail,callback:function(e){t.addressDetail=e},expression:"addressDetail"}}),r("van-field",{attrs:{type:"text",label:"教学点名称",placeholder:"请输入名称"},model:{value:t.teachingSchool,callback:function(e){t.teachingSchool=e},expression:"teachingSchool"}})],1),r("div",{staticClass:"button-group"},[r("van-button",{attrs:{type:"primary",round:"",size:"large"},on:{click:t.onSubmit}},[t._v("确认")])],1)],1)},a=[],o=r("a34a"),i=r.n(o),c=r("6e6e"),s=r("9afb"),u=r("3908");function l(t,e,r,n,a,o,i){try{var c=t[o](i),s=c.value}catch(u){return void r(u)}c.done?e(s):Promise.resolve(s).then(n,a)}function h(t){return function(){var e=this,r=arguments;return new Promise(function(n,a){var o=t.apply(e,r);function i(t){l(o,n,a,i,c,"next",t)}function c(t){l(o,n,a,i,c,"throw",t)}i(void 0)})}}var f={name:"teachingset",components:{MHeader:c["a"]},data:function(){var t=this;return{type:this.$route.query.type,search_value:"",zoom:12,center:[114.34371,30.55939],markers:[],searchResult:[],plugin:[{pName:"Geolocation",events:{init:function(e){"create"==t.type&&e.getCurrentPosition(function(e,r){r&&r.position&&(t.lng=r.position.lng,t.lat=r.position.lat,t.center=[t.lng,t.lat],t.loaded=!0,t.$nextTick())})}}},{pName:"ToolBar",events:{init:function(){}}}],searchOption:{pageSize:1,pageIndex:1,autoFitView:!0},addressDetail:null,teachingSchool:null,lnglat:null}},mounted:function(){document.title="教学点设置";var t=this.$route.query;if(t.Authorization&&(localStorage.setItem("Authorization",decodeURI(t.Authorization)),localStorage.setItem("userInfo",decodeURI(t.Authorization))),"update"==t.type){this.addressDetail=t.address,this.teachingSchool=t.name,this.lnglat=t.longitudeLatitude;var e=t.longitudeLatitude.split(",");this.center=[e[0],e[1]],this.markers.push({position:[e[0],e[1]],events:this.markerEvents()})}},methods:{amapEvents:function(){return{complete:function(){}}},onSubmit:function(){var t=h(i.a.mark(function t(){var e=this;return i.a.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(this.addressDetail){t.next=3;break}return this.$toast("请选择教学地点"),t.abrupt("return");case 3:if(this.teachingSchool){t.next=6;break}return this.$toast("请输入教学点名称"),t.abrupt("return");case 6:if("create"!=this.type){t.next=12;break}return Object(u["a"])(!0),t.next=10,Object(s["J"])({name:this.teachingSchool,address:this.addressDetail,longitudeLatitude:this.lnglat}).then(function(t){Object(u["a"])(!1);var r=t.data;200==r.code?(e.$toast("添加成功"),e.$router.push("/teachingSchool")):e.$toast(r.msg)}).catch(function(){Object(u["a"])(!1)});case 10:t.next=16;break;case 12:if("update"!=this.type){t.next=16;break}return Object(u["a"])(!0),t.next=16,Object(s["L"])({id:this.$route.query.id,name:this.teachingSchool,address:this.addressDetail,longitudeLatitude:this.lnglat}).then(function(t){Object(u["a"])(!1);var r=t.data;200==r.code?(e.$toast("修改成功"),e.$router.push("/teachingSchool")):e.$toast(r.msg)}).catch(function(){Object(u["a"])(!1)});case 16:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}(),onSearch:function(){var t=this;if(this.search_value){this.markers=[];var e=new AMap.PlaceSearch(this.searchOption);e.search(this.search_value,function(e,r){if(r&&r.poiList&&r.poiList.count){var n=r.poiList.pois[0];t.searchResult.push(n),t.markers.push({position:[n.location.lng,n.location.lat],events:t.markerEvents(n)}),t.center=[n.location.lng,n.location.lat]}else{if(void 0===r.poiList)throw new Error(r);r.poiList&&r.poiList.pois.length<=0&&t.$toast("请输入详细地址")}})}},markerEvents:function(){var t=this;return{click:function(e){var r=new AMap.Geocoder;r.getAddress(e.lnglat,function(r,n){"complete"===r&&n.regeocode?(t.lnglat=e.lnglat.lng+","+e.lnglat.lat,t.addressDetail=n.regeocode.formattedAddress):t.$toast("请重新选择地址")})}}}}},p=f,d=(r("fb65"),r("2877")),v=Object(d["a"])(p,n,a,!1,null,"d49a7e10",null);e["default"]=v.exports},"6e6e":function(t,e,r){"use strict";var n=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"mheader"},[r("header",{staticClass:"m-nav-header",class:[t.isFixed?"fixed":""]},[r("div",{directives:[{name:"show",rawName:"v-show",value:t.isBack,expression:"isBack"}],staticClass:"m-nav-bar__left",on:{click:t.goBack}},[r("van-icon",{staticClass:"arrow-left",attrs:{name:"arrow-left"}})],1),r("div",{staticClass:"m-nav-bar__title"},[t._t("default",[t._v(t._s(t.name?t.name:this.$route.meta.descrition))])],2),r("div",{staticClass:"m-nav-bar__right"},[t._t("right")],2)])])},a=[],o={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 t=this.backUrl;"function"==typeof t.callBack?t.callBack():t.path?this.$router.push({path:t.path,query:t.params}):history.go(-1)}}},i=o,c=(r("d133"),r("2877")),s=Object(c["a"])(i,n,a,!1,null,"0e835508",null);e["a"]=s.exports},9468:function(t,e,r){},"96cf":function(t,e,r){var n=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,a="function"===typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function s(t,e,r,n){var a=e&&e.prototype instanceof v?e:v,o=Object.create(a.prototype),i=new j(n||[]);return o._invoke=_(t,r,i),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(n){return{type:"throw",arg:n}}}t.wrap=s;var l="suspendedStart",h="suspendedYield",f="executing",p="completed",d={};function v(){}function g(){}function m(){}var y={};y[o]=function(){return this};var w=Object.getPrototypeOf,b=w&&w(w($([])));b&&b!==r&&n.call(b,o)&&(y=b);var x=m.prototype=v.prototype=Object.create(y);function k(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function L(t){function e(r,a,o,i){var c=u(t[r],t,a);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"===typeof l&&n.call(l,"__await")?Promise.resolve(l.__await).then(function(t){e("next",t,o,i)},function(t){e("throw",t,o,i)}):Promise.resolve(l).then(function(t){s.value=t,o(s)},function(t){return e("throw",t,o,i)})}i(c.arg)}var r;function a(t,n){function a(){return new Promise(function(r,a){e(t,n,r,a)})}return r=r?r.then(a,a):a()}this._invoke=a}function _(t,e,r){var n=l;return function(a,o){if(n===f)throw new Error("Generator is already running");if(n===p){if("throw"===a)throw o;return B()}r.method=a,r.arg=o;while(1){var i=r.delegate;if(i){var c=E(i,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=f;var s=u(t,e,r);if("normal"===s.type){if(n=r.done?p:h,s.arg===d)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=p,r.method="throw",r.arg=s.arg)}}}function E(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator["return"]&&(r.method="return",r.arg=e,E(t,r),"throw"===r.method))return d;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var a=u(n,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,d;var o=a.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function $(t){if(t){var r=t[o];if(r)return r.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){while(++a<t.length)if(n.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}return{next:B}}function B(){return{value:e,done:!0}}return g.prototype=x.constructor=m,m.constructor=g,m[c]=g.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,c in t||(t[c]="GeneratorFunction")),t.prototype=Object.create(x),t},t.awrap=function(t){return{__await:t}},k(L.prototype),L.prototype[i]=function(){return this},t.AsyncIterator=L,t.async=function(e,r,n,a){var o=new L(s(e,r,n,a));return t.isGeneratorFunction(r)?o:o.next().then(function(t){return t.done?t.value:o.next()})},k(x),x[c]="Generator",x[o]=function(){return this},x.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){while(e.length){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=$,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function a(n,a){return c.type="throw",c.arg=t,r.next=n,a&&(r.method="next",r.arg=e),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;O(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:$(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),d}},t}(t.exports);try{regeneratorRuntime=n}catch(a){Function("r","regeneratorRuntime = r")(n)}},a34a:function(t,e,r){t.exports=r("96cf")},bb2c:function(t,e,r){},d133:function(t,e,r){"use strict";var n=r("bb2c"),a=r.n(n);a.a},fb65:function(t,e,r){"use strict";var n=r("9468"),a=r.n(n);a.a}}]);