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.
1 lines
19 KiB
1 lines
19 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7adbdcbc"],{"129f":function(e,o){e.exports=Object.is||function(e,o){return e===o?0!==e||1/e===1/o:e!=e&&o!=o}},5420:function(e,o,i){"use strict";i.r(o);var t=function(){var e=this,o=e.$createElement,i=e._self._c||o;return i("div",{staticClass:"ele-body"},[i("ele-map-picker",{attrs:{show:e.showMapPicker,"need-city":!0,"lock-scroll":!1},on:{"update:show":function(o){e.showMapPicker=o},done:e.onChoose}}),i("ele-map-picker",{attrs:{show:e.showMapPicker2,"need-city":!0,"search-type":1,"lock-scroll":!1},on:{"update:show":function(o){e.showMapPicker2=o},done:e.onChoose}}),i("el-card",{attrs:{shadow:"never",header:"弹窗选择位置"}},[i("el-tooltip",{attrs:{content:"POI检索模式",placement:"top"}},[i("el-button",{staticClass:"ele-btn-icon",attrs:{size:"small",icon:"el-icon-location-information"},on:{click:function(o){e.showMapPicker=!0}}},[i("span",[e._v("地图选择位置 ")]),i("i",{staticClass:"el-icon-right"})])],1),i("el-button",{staticClass:"ele-btn-icon",attrs:{size:"small",icon:"el-icon-location-information"},on:{click:function(o){e.showMapPicker2=!0}}},[i("span",[e._v("关键字检索模式 ")]),i("i",{staticClass:"el-icon-right"})]),i("div",{staticStyle:{"margin-top":"10px"}},[e._v("收货地址: "+e._s(e.form.location))]),i("div",{staticStyle:{"margin-top":"10px"}},[e._v("详细地址: "+e._s(e.form.address))]),i("div",{staticStyle:{"margin-top":"10px"}},[e._v("经 纬 度 : "+e._s(e.form.jinweidu))])],1),i("el-card",{attrs:{shadow:"never",header:"官网底部地图"}},[i("div",{ref:"locationMap",staticStyle:{"max-width":"800px",height:"300px"}})]),i("el-card",{attrs:{shadow:"never",header:"轨迹展示及轨迹回放"}},[i("div",{ref:"trackMap",staticStyle:{"max-width":"800px",height:"300px"}}),i("div",{staticStyle:{"margin-top":"15px"}},[i("el-button",{attrs:{size:"small"},on:{click:e.startTrackAnim}},[e._v("开始动画 ")]),i("el-button",{attrs:{size:"small"},on:{click:e.pauseTrackAnim}},[e._v("暂停动画 ")]),i("el-button",{attrs:{size:"small"},on:{click:e.resumeTrackAnim}},[e._v("继续动画 ")])],1)])],1)},a=[],n=(i("b0c0"),i("a15b"),i("862d3")),s=i.n(n),r=function(){var e=this,o=e.$createElement,i=e._self._c||o;return i("el-dialog",{attrs:{visible:e.show,title:e.title,width:e.width,"custom-class":e.dialogClass,"show-close":e.showClose,"close-on-click-modal":e.closeOnClickModal,"close-on-press-escape":e.closeOnPressEscape,"destroy-on-close":e.destroyOnClose,"lock-scroll":e.lockScroll,"append-to-body":e.appendToBody,"modal-append-to-body":e.modalAppendToBody,modal:e.modal,top:e.top},on:{"update:visible":e.updateVisible,open:e.onOpen,closed:e.onClosed}},[e.showMap?i("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}]},[i("div",{staticClass:"ele-map-picker-header"},[i("div",{staticClass:"ele-map-picker-header-search"},[i("el-autocomplete",{attrs:{"fetch-suggestions":e.searchSuggestions,placeholder:e.searchPlaceholder,"popper-class":e.searchPopClass},on:{blur:e.onSuggestionBlur,select:e.onSuggestionChoose},scopedSlots:e._u([{key:"default",fn:function(o){var t=o.item;return[i("div",{staticClass:"ele-map-picker-poi-item ele-map-picker-suggestion-item"},[i("i",{staticClass:"ele-map-picker-poi-item-icon el-icon-search"}),i("div",{staticClass:"ele-map-picker-poi-item-title"},[e._v(e._s(t.name))]),t.address?i("div",{staticClass:"ele-map-picker-poi-item-address"},[e._v(e._s(t.address))]):e._e()])]}}],null,!1,1928007785),model:{value:e.suggestionKeyWord,callback:function(o){e.suggestionKeyWord=o},expression:"suggestionKeyWord"}},[i("i",{staticClass:"el-icon-search el-input__icon",attrs:{slot:"suffix"},slot:"suffix"})])],1),i("el-button",{staticClass:"ele-btn-icon",attrs:{loading:e.doneLoading,type:"primary",icon:"el-icon-check"},on:{click:e.done}},[e._v("确定 ")])],1),i("div",{staticClass:"ele-map-picker-body"},[i("div",{staticClass:"ele-map-picker-main"},[i("div",{ref:"eleMapPickerMap",style:e.mapStyle}),i("i",{class:["ele-map-picker-main-plus el-icon-plus",{"ele-map-picker-hide":0!==e.searchType}]}),i("img",{class:e.iconClass,attrs:{src:e.markerSrc,alt:""}})]),i("div",{directives:[{name:"loading",rawName:"v-loading",value:e.poiLoading,expression:"poiLoading"}],staticClass:"ele-map-picker-poi-list",style:e.mapStyle},e._l(e.poiData,(function(o,t){return i("div",{key:t,class:["ele-map-picker-poi-item",{"ele-map-picker-poi-item-active":t===e.chooseIndex}],on:{click:function(o){return e.choose(t)}}},[i("i",{staticClass:"ele-map-picker-poi-item-icon el-icon-location-outline"}),i("div",{staticClass:"ele-map-picker-poi-item-title"},[e._v(e._s(o.name))]),o.address?i("div",{staticClass:"ele-map-picker-poi-item-address"},[e._v(e._s(o.address))]):e._e(),i("i",{staticClass:"el-icon-circle-check ele-map-picker-poi-item-check"})])})),0)])]):e._e()])},c=[],l=(i("a9e3"),i("d81d"),i("4de4"),i("841c"),i("ac1f"),i("159b"),{name:"EleMapPicker",emits:["done","open","closed","update:show"],props:{height:{type:String,default:"450px"},center:Array,zoom:{type:Number,default:11},chooseZoom:{type:Number,default:17},poiSize:{type:Number,default:30},poiType:{type:String,default:""},poiKeywords:{type:String,default:""},poiRadius:{type:Number,default:1e3},needCity:Boolean,forceChoose:{type:Boolean,default:!0},suggestionCity:{type:String,default:"全国"},searchType:{type:Number,default:0},searchPlaceholder:{type:String,default:"输入关键字搜索"},markerSrc:{type:String,default:"https://3gimg.qq.com/lightmap/components/locationPicker2/image/marker.png"},mapKey:{type:String,default:"006d995d433058322319fa797f2876f5"},mapVersion:{type:String,default:"2.0"},title:{type:String,default:"选择位置"},width:{type:String,default:"780px"},customClass:String,closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},appendToBody:Boolean,modalAppendToBody:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},top:String,destroyOnClose:{type:Boolean,default:!1},show:Boolean},data:function(){return{showMap:!1,map:null,centerMarker:null,placeSearch:null,autoComplete:null,poiData:[],chooseIndex:null,isSelMove:!1,showIconAnim:!1,suggestionKeyWord:"",lastSuggestion:"",suggestionData:[],chooseSuggestion:null,loading:!0,poiLoading:!1,doneLoading:!1}},computed:{mapStyle:function(){return{height:this.height}},dialogClass:function(){return["ele-map-picker-dialog",this.customClass||""].join(" ")},iconClass:function(){return["ele-map-picker-main-icon",{"ele-map-picker-anim-bounce":this.showIconAnim},{"ele-map-picker-hide":0!==this.searchType}]},searchPopClass:function(){return["ele-map-picker-search-pop",0!==this.searchType?"ele-map-picker-hide":""].join(" ")},darkMode:function(){try{return this.$store.state.theme.darkMode}catch(e){return null}}},methods:{render:function(){var e=this;s.a.load({key:this.mapKey,version:this.mapVersion,plugins:["AMap.PlaceSearch","AMap.AutoComplete"]}).then((function(o){e.loading=!1,e.poiLoading=!0;var i={resizeEnable:!0,zoom:e.zoom,center:e.center};e.darkMode&&(i.mapStyle="amap://styles/dark"),e.map=new o.Map(e.$refs.eleMapPickerMap,i),e.placeSearch=new o.PlaceSearch({type:e.poiType,pageSize:e.poiSize,pageIndex:1}),e.autoComplete=new o.AutoComplete({city:e.suggestionCity}),e.map.on("complete",(function(){e.chooseIndex=null;var o=e.map.getCenter();e.searchNearBy(o.lat,o.lng,!0)})),e.map.on("moveend",(function(){if(e.isSelMove)e.isSelMove=!1;else{e.showIconAnim=!1,e.$nextTick((function(){setTimeout((function(){e.showIconAnim=!0}),0)}));var o=e.map.getCenter();e.searchNearBy(o.lat,o.lng)}})),e.centerMarker=new o.Marker({icon:new o.Icon({image:e.markerSrc,size:new o.Size(26,36.5),imageSize:new o.Size(26,36.5)}),offset:new o.Pixel(-13,-36.5)})})).catch((function(o){e.loading=!1,console.error(o)}))},searchNearBy:function(e,o,i){var t=this;i||0===this.searchType?this.placeSearch&&(this.poiLoading=!0,this.placeSearch.searchNearBy(this.poiKeywords,[o,e],this.poiRadius,(function(e,o){if(t.poiLoading=!1,"complete"===e){var i=o.poiList.pois.filter((function(e){return void 0!==e.location}));t.chooseSuggestion?(0!==i.length&&i[0].name===t.chooseSuggestion.name||i.unshift(Object.assign({},t.chooseSuggestion)),t.chooseSuggestion=null):t.chooseIndex=null,t.poiData=i}}))):this.poiLoading=!1},choose:function(e){var o=this;this.chooseIndex=e,this.isSelMove=!0,this.showIconAnim=!1,this.$nextTick((function(){setTimeout((function(){o.showIconAnim=!0}),0)}));var i=this.poiData[e].location;this.map.setZoomAndCenter(this.chooseZoom,[i.lng,i.lat]),0!==this.searchType&&(this.centerMarker.setPosition([i.lng,i.lat]),this.map.add(this.centerMarker))},searchSuggestions:function(e,o){var i=this;if(!this.autoComplete||!e||this.lastSuggestion===e)return o(this.suggestionData);0!==this.searchType&&(this.poiLoading=!0),this.lastSuggestion=e,this.autoComplete.search(e,(function(e,t){0===i.searchType?(t.tips?(t.tips.forEach((function(e){e.value="",Array.isArray(e.address)&&(e.address=e.address[0])})),i.suggestionData=t.tips):i.suggestionData=[],o(i.suggestionData)):(t.tips?(t.tips.forEach((function(e){e.value="",Array.isArray(e.address)&&(e.address=e.address[0])})),i.poiData=t.tips):i.poiData=[],i.chooseIndex=null,i.map.remove(i.centerMarker),i.poiLoading=!1,o([]))}))},onSuggestionChoose:function(e){this.chooseSuggestion=e,this.chooseIndex=0,0!==this.poiData.length&&this.poiData[0].name===this.chooseSuggestion.name||this.poiData.unshift(Object.assign({},this.chooseSuggestion));var o=e.location;o&&this.map.setZoomAndCenter(this.chooseZoom,[o.lng,o.lat])},onSuggestionBlur:function(){0===this.searchType&&(this.suggestionKeyWord="")},done:function(){var e=this;if(this.map){var o;if(null===this.chooseIndex){if(this.forceChoose)return this.$message.error("请点击列表选中位置");o=Object.assign({},this.map.getCenter())}else o=Object.assign({name:this.poiData[this.chooseIndex].name,address:this.poiData[this.chooseIndex].address||""},this.poiData[this.chooseIndex].location);this.needCity?(this.doneLoading=!0,this.map.setCenter([o.lng,o.lat]),this.map.getCity((function(i){e.doneLoading=!1,o.city=i,e.$emit("done",o)}))):this.$emit("done",o)}},onOpen:function(){this.showMap=!0,(this.destroyOnClose||null===this.map)&&(this.render(),this.$emit("open"))},onClosed:function(){this.$emit("closed"),this.destroyOnClose&&(this.showMap=!1,this.suggestionKeyWord="",this.lastSuggestion="",this.poiData=[],this.chooseIndex=null,this.suggestionData=[],this.chooseSuggestion=null)},updateVisible:function(e){this.$emit("update:show",e)}},watch:{darkMode:function(){this.map&&(this.darkMode?this.map.setMapStyle("amap://styles/dark"):this.map.setMapStyle("amap://styles/normal"))}}}),p=l,d=(i("e85d"),i("2877")),u=Object(d["a"])(p,r,c,!1,null,null,null),h=u.exports;h.install=function(e){e.component(h.name,h)};var m=h,f={name:"ExtensionMap",components:{EleMapPicker:m},data:function(){return{form:{},showMapPicker:!1,showMapPicker2:!1,carMarker:null,lineData:[[116.478935,39.997761],[116.478939,39.997825],[116.478912,39.998549],[116.478912,39.998549],[116.478998,39.998555],[116.478998,39.998555],[116.479282,39.99856],[116.479658,39.998528],[116.480151,39.998453],[116.480784,39.998302],[116.480784,39.998302],[116.481149,39.998184],[116.481573,39.997997],[116.481863,39.997846],[116.482072,39.997718],[116.482362,39.997718],[116.483633,39.998935],[116.48367,39.998968],[116.484648,39.999861]]}},mounted:function(){this.renderLocationMap(),this.renderTrackMap()},methods:{onChoose:function(e){this.showMapPicker=!1,this.showMapPicker2=!1,this.form.address=e.name+" "+e.address,this.form.jinweidu=[e.lng,e.lat].join(","),this.form.location=e.city.province+"/"+e.city.city+"/"+e.city.district,console.log(e)},renderLocationMap:function(){var e=this;s.a.load({key:"006d995d433058322319fa797f2876f5",version:"2.0",plugins:["AMap.InfoWindow","AMap.Marker"]}).then((function(o){var i=new o.Map(e.$refs.locationMap,{zoom:13,center:[114.346084,30.516215]}),t=new o.InfoWindow({content:'\n <div style="color: #333;">\n <div style="padding: 5px;font-size: 16px;">武汉易云智科技有限公司</div>\n <div style="padding: 0 5px;">地址:湖北省武汉市洪山区雄楚大道222号</div>\n <div style="padding: 0 5px;">电话:020-123456789</div>\n <a style="padding: 8px 5px 0;text-decoration: none;display: inline-block;"\n class="ele-text-primary"\n href="//uri.amap.com/marker?position=114.346084,30.511215&name=武汉易云智科技有限公司"\n target="_blank">到这里去<i class="el-icon-right"></i>\n </a>\n </div>\n '});t.open(i,[114.346084,30.511215]);var a=new o.Icon({size:new o.Size(25,34),image:"//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-red.png",imageSize:new o.Size(25,34)}),n=new o.Marker({icon:a,position:[114.346084,30.511215],offset:new o.Pixel(-12,-28)});n.setMap(i),n.on("click",(function(){t.open(i)}))})).catch((function(e){console.error(e)}))},renderTrackMap:function(){var e=this;s.a.load({key:"006d995d433058322319fa797f2876f5",version:"2.0",plugins:["AMap.MoveAnimation","AMap.Marker","AMap.Polyline"]}).then((function(o){var i=new o.Map(e.$refs.trackMap,{zoom:17,center:[116.478935,39.997761]});e.carMarker=new o.Marker({map:i,position:[116.478935,39.997761],icon:"https://a.amap.com/jsapi_demos/static/demo-center-v2/car.png",offset:new o.Pixel(-13,-26)}),new o.Polyline({map:i,path:e.lineData,showDir:!0,strokeColor:"#28F",strokeOpacity:1,strokeWeight:6});var t=new o.Polyline({map:i,showDir:!0,strokeColor:"#4B5",strokeOpacity:1,strokeWeight:6});e.carMarker.on("moving",(function(e){t.setPath(e.passedPath)})),i.setFitView()})).catch((function(e){console.error(e)}))},startTrackAnim:function(){this.carMarker.stopMove(),this.carMarker.moveAlong(this.lineData,{duration:200,autoRotation:!0})},pauseTrackAnim:function(){this.carMarker.pauseMove()},resumeTrackAnim:function(){this.carMarker.resumeMove()}}},g=f,v=Object(d["a"])(g,t,a,!1,null,"01ef9cb6",null);o["default"]=v.exports},"841c":function(e,o,i){"use strict";var t=i("d784"),a=i("825a"),n=i("1d80"),s=i("129f"),r=i("14c3");t("search",1,(function(e,o,i){return[function(o){var i=n(this),t=void 0==o?void 0:o[e];return void 0!==t?t.call(o,i):new RegExp(o)[e](String(i))},function(e){var t=i(o,e,this);if(t.done)return t.value;var n=a(e),c=String(this),l=n.lastIndex;s(l,0)||(n.lastIndex=0);var p=r(n,c);return s(n.lastIndex,l)||(n.lastIndex=l),null===p?-1:p.index}]}))},"862d3":function(e,o,i){"use strict";(function(o,i){e.exports=i()})(0,(function(){function e(e){var t=[];return e.AMapUI&&t.push(o(e.AMapUI)),e.Loca&&t.push(i(e.Loca)),Promise.all(t)}function o(e){return new Promise((function(o,i){var r=[];if(e.plugins)for(var c=0;c<e.plugins.length;c+=1)-1==a.AMapUI.plugins.indexOf(e.plugins[c])&&r.push(e.plugins[c]);if(n.AMapUI===t.failed)i("前次请求 AMapUI 失败");else if(n.AMapUI===t.notload){n.AMapUI=t.loading,a.AMapUI.version=e.version||a.AMapUI.version,c=a.AMapUI.version;var l=document.body||document.head,p=document.createElement("script");p.type="text/javascript",p.src="https://webapi.amap.com/ui/"+c+"/main.js",p.onerror=function(e){n.AMapUI=t.failed,i("请求 AMapUI 失败")},p.onload=function(){if(n.AMapUI=t.loaded,r.length)window.AMapUI.loadUI(r,(function(){for(var e=0,i=r.length;e<i;e++){var t=r[e].split("/").slice(-1)[0];window.AMapUI[t]=arguments[e]}for(o();s.AMapUI.length;)s.AMapUI.splice(0,1)[0]()}));else for(o();s.AMapUI.length;)s.AMapUI.splice(0,1)[0]()},l.appendChild(p)}else n.AMapUI===t.loaded?e.version&&e.version!==a.AMapUI.version?i("不允许多个版本 AMapUI 混用"):r.length?window.AMapUI.loadUI(r,(function(){for(var e=0,i=r.length;e<i;e++){var t=r[e].split("/").slice(-1)[0];window.AMapUI[t]=arguments[e]}o()})):o():e.version&&e.version!==a.AMapUI.version?i("不允许多个版本 AMapUI 混用"):s.AMapUI.push((function(e){e?i(e):r.length?window.AMapUI.loadUI(r,(function(){for(var e=0,i=r.length;e<i;e++){var t=r[e].split("/").slice(-1)[0];window.AMapUI[t]=arguments[e]}o()})):o()}))}))}function i(e){return new Promise((function(o,i){if(a.AMap.version.startsWith("2.0"))i("Loca 暂不适配 JSAPI 2.0,请使用 1.4.15");else if(n.Loca===t.failed)i("前次请求 Loca 失败");else if(n.Loca===t.notload){n.Loca=t.loading,a.Loca.version=e.version||a.Loca.version;var r=a.Loca.version,c=a.key,l=document.body||document.head,p=document.createElement("script");p.type="text/javascript",p.src="https://webapi.amap.com/loca?v="+r+"&key="+c,p.onerror=function(e){n.Loca=t.failed,i("请求 AMapUI 失败")},p.onload=function(){for(n.Loca=t.loaded,o();s.Loca.length;)s.Loca.splice(0,1)[0]()},l.appendChild(p)}else n.Loca===t.loaded?e.version&&e.version!==a.Loca.version?i("不允许多个版本 Loca 混用"):o():e.version&&e.version!==a.Loca.version?i("不允许多个版本 Loca 混用"):s.Loca.push((function(e){e?i(e):i()}))}))}if(!window)throw Error("AMap JSAPI can only be used in Browser.");var t;(function(e){e.notload="notload",e.loading="loading",e.loaded="loaded",e.failed="failed"})(t||(t={}));var a={key:"",AMap:{version:"1.4.15",plugins:[]},AMapUI:{version:"1.1",plugins:[]},Loca:{version:"1.3.2"}},n={AMap:t.notload,AMapUI:t.notload,Loca:t.notload},s={AMap:[],AMapUI:[],Loca:[]},r=[],c=function(e){"function"==typeof e&&(n.AMap===t.loaded?e(window.AMap):r.push(e))};return{load:function(o){return new Promise((function(i,s){if(n.AMap==t.failed)s("");else if(n.AMap==t.notload){var l=o.key,p=o.version,d=o.plugins;l?(window.AMap&&"lbs.amap.com"!==location.host&&s("禁止多种API加载方式混用"),a.key=l,a.AMap.version=p||a.AMap.version,a.AMap.plugins=d||a.AMap.plugins,n.AMap=t.loading,p=document.body||document.head,window.___onAPILoaded=function(a){if(delete window.___onAPILoaded,a)n.AMap=t.failed,s(a);else for(n.AMap=t.loaded,e(o).then((function(){i(window.AMap)}))["catch"](s);r.length;)r.splice(0,1)[0]()},d=document.createElement("script"),d.type="text/javascript",d.src="https://webapi.amap.com/maps?callback=___onAPILoaded&v="+a.AMap.version+"&key="+l+"&plugin="+a.AMap.plugins.join(","),d.onerror=function(e){n.AMap=t.failed,s(e)},p.appendChild(d)):s("请填写key")}else if(n.AMap==t.loaded)if(o.key&&o.key!==a.key)s("多个不一致的 key");else if(o.version&&o.version!==a.AMap.version)s("不允许多个版本 JSAPI 混用");else{if(l=[],o.plugins)for(p=0;p<o.plugins.length;p+=1)-1==a.AMap.plugins.indexOf(o.plugins[p])&&l.push(o.plugins[p]);l.length?window.AMap.plugin(l,(function(){e(o).then((function(){i(window.AMap)}))["catch"](s)})):e(o).then((function(){i(window.AMap)}))["catch"](s)}else if(o.key&&o.key!==a.key)s("多个不一致的 key");else if(o.version&&o.version!==a.AMap.version)s("不允许多个版本 JSAPI 混用");else{var u=[];if(o.plugins)for(p=0;p<o.plugins.length;p+=1)-1==a.AMap.plugins.indexOf(o.plugins[p])&&u.push(o.plugins[p]);c((function(){u.length?window.AMap.plugin(u,(function(){e(o).then((function(){i(window.AMap)}))["catch"](s)})):e(o).then((function(){i(window.AMap)}))["catch"](s)}))}}))},reset:function(){delete window.AMap,delete window.AMapUI,delete window.Loca,a={key:"",AMap:{version:"1.4.15",plugins:[]},AMapUI:{version:"1.1",plugins:[]},Loca:{version:"1.3.2"}},n={AMap:t.notload,AMapUI:t.notload,Loca:t.notload},s={AMap:[],AMapUI:[],Loca:[]}}}}))},c683:function(e,o,i){},e85d:function(e,o,i){"use strict";i("c683")}}]);
|