21.30110165.chunk.js
10.7 KB
webpackJsonp([21],{1613:function(e,a,t){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(a,"__esModule",{value:!0});var o=t(8),i=n(o),r=t(4),s=n(r),p=t(1),A=n(p),m=t(5),d=n(m),c=t(2),l=n(c),f=t(3),C=n(f),h=t(0),w=n(h);t(1614);var u=t(56),b=n(u),B=t(9),g=n(B),x=t(388),k=t(7),v=t(19),y=n(v),E=g.default.getLabel,D=function(e){function a(e){(0,A.default)(this,a);var t=(0,l.default)(this,(a.__proto__||(0,s.default)(a)).call(this,e));return t.regeo=function(e){b.default.ajax({url:"https://restapi.amap.com/v3/geocode/regeo",dataType:"jsonp",data:{key:"deee9801361e46e9340bd492ae45b90d",location:e,radius:"1000",extensions:"all",roadlevel:"0"},success:function(e){"1"===e.status&&e.regeocode&&t.setState({citycode:e.regeocode.addressComponent.citycode||""})},error:function(e){}})},t.getSearchList=function(e){b.default.ajax({url:"https://restapi.amap.com/v3/place/text",dataType:"jsonp",data:{key:"deee9801361e46e9340bd492ae45b90d",keywords:e,city:t.state.citycode,children:1,offset:20,page:1,extensions:"all"},success:function(e){t.setState({searchList:e.pois||[]})},error:function(e){}})},t.onSearchChange=function(e){var a=t.props.onSearchChange,n=e.target.value||"";t.setState({searchValue:n,searchList:[]}),"function"===typeof a&&a(n),t.state.searchDelay&&clearTimeout(t.state.searchDelay),t.setState({searchDelay:setTimeout(function(){return t.getSearchList(n)},1e3)})},t.doSelect=function(e){var a=t.state.citycode;e.citycode!==a&&t.setState({citycode:e.citycode}),t.setState({center:e.location.split(","),searchValue:"",searchList:"",info:e});var n=t.props.onSelect;"function"===typeof n&&n(e)},t.getHashId=function(e){return e+"_"+Math.random().toString(16).slice(2,6)},t.getMarks=function(){return t.props.mulPosition.map(function(e){var a="<div class='wea-map-marker'><img src='http://webapi.amap.com/theme/v1.3/markers/n/mark_b.png' align='absmiddle'><span class='wea-map-marker-span'>"+(e.title||"")+"</span></div>";return w.default.createElement(x.Marker,(0,i.default)({content:a},e,{key:t.getHashId("markers")}))})},t.getCurrentInfo=function(){var e=t.state;return{position:e.center,info:e.info}},t.state={searchList:[],searchValue:"",searchDelay:null,center:e.center||e.position,citycode:"",info:{},showInfoWin:!1},t}return(0,C.default)(a,e),(0,d.default)(a,[{key:"componentDidMount",value:function(){var e=this.state.center;this.props.showSearchBar&&this.regeo(e[0]+","+e[1])}},{key:"render",value:function(){var e=this,a=this.props,t=a.title,n=a.mulPosition,o=void 0===n?[]:n,r=a.showInfoWindow,s=a.showSearchBar,p=a.className,A=void 0===p?"":p,m=a.style,d=this.state,c=d.center,l=d.searchList,f=d.searchValue,C=d.info,h=d.showInfoWin,u=o&&o.length>0?this.getMarks():null,b="<div class='wea-map-marker'><img src='http://webapi.amap.com/theme/v1.3/markers/n/mark_b.png' align='absmiddle'><span class='wea-map-marker-span'>"+t+"</span></div>";return w.default.createElement("div",{ref:"map",className:"wea-map "+A,style:m},w.default.createElement(x.Map,(0,i.default)({amapkey:"53a92850ca00d7f77aef3297effd8d59",resizeEnable:!0,center:c,events:{created:this.created}},this.props),this.props.children||u||(t?w.default.createElement(x.Marker,(0,i.default)({content:b},this.props,this.props.markerConfig)):w.default.createElement(x.Marker,(0,i.default)({position:c,events:{click:function(){e.setState({showInfoWin:!h})}}},this.props.markerConfig))),r&&C.name&&w.default.createElement(x.InfoWindow,(0,i.default)({position:{longitude:c[0],latitude:c[1]},offset:[0,-36],visible:h,closeWhenClickMap:!0,content:'\n <div class="wea-map-infoWindow">\n <div class="infoWindow-name">'+C.name+'</div>\n <div class="infoWindow-address">'+E(83578,"地址")+":"+C.address+"</div>\n </div>",events:{close:function(){return e.setState({showInfoWin:!1})}}},this.props.infoWindowConfig))),s&&w.default.createElement("div",{className:"wea-map-editable wea-map-searchBar"},w.default.createElement("div",{className:"wea-map-searchBar-title"},E("389196","请输入地址"),":"),w.default.createElement(k.Input,{value:f,onChange:this.onSearchChange})),s&&l.length>0&&w.default.createElement("div",{className:"wea-map-editable wea-map-searchList"},l.map(function(a){return w.default.createElement("div",{className:"wea-map-searchList-item",key:a.id,onClick:function(){return e.doSelect(a)}},w.default.createElement("div",{className:"item-icon"},w.default.createElement("span",{className:"icon-coms02-Positioning"})),w.default.createElement("div",{className:"item-content"},w.default.createElement("div",{className:"item-content-name"},a.name),w.default.createElement("div",{className:"item-content-address"},a.address)))})))}}]),a}(w.default.Component);D.propTypes={position:w.default.PropTypes.any,mulPosition:w.default.PropTypes.Array,title:w.default.PropTypes.string,zoom:w.default.PropTypes.number},D.defaultProps={zoom:14};var W=(0,y.default)(D,"WeaMap");a.default=W},1614:function(e,a,t){var n=t(1615);"string"===typeof n&&(n=[[e.i,n,""]]);var o={hmr:!1};o.transform=void 0;t(1351)(n,o);n.locals&&(e.exports=n.locals)},1615:function(e,a,t){a=e.exports=t(1350)(!0),a.push([e.i,".wea-map{position:relative;height:100%;width:100%;font-size:12px;color:#333}.wea-map .wea-map-marker{width:360px}.wea-map .wea-map-marker .wea-map-marker-span{border:1px solid #008ef7;background:#008ef7;color:#fff;padding:3px;border-radius:5px}.wea-map .wea-map-editable{position:absolute;right:14px;top:12px;background:#fff;-webkit-box-shadow:0 0 4px 0 rgba(0,0,0,.5);box-shadow:0 0 4px 0 rgba(0,0,0,.5);border-radius:4px;z-index:1000;width:342px}.wea-map .wea-map-searchBar{height:91px;padding:15px}.wea-map .wea-map-searchBar-title{font-size:14px;padding-bottom:5px}.wea-map .wea-map-searchBar input{height:30px;border-radius:0;outline:none;border-color:#dadada!important;-webkit-box-shadow:none;box-shadow:none}.wea-map .wea-map-searchList{top:110px;padding:0 15px;max-height:336px;overflow-y:scroll;overflow-x:hidden}.wea-map .wea-map-searchList-item{width:100%;padding:10px 0;border-bottom:1px solid #ebebeb}.wea-map .wea-map-searchList-item:last-child{border-bottom:none}.wea-map .wea-map-searchList-item .item-icon{margin-right:14px;float:left;margin-top:2px}.wea-map .wea-map-searchList-item .item-icon .icon-coms02-Positioning{font-size:20px;color:#8b8b8b}.wea-map .wea-map-searchList-item .item-content{max-width:260px;line-height:18px;display:inline-block;white-space:normal}.wea-map .wea-map-searchList-item .item-content-name{color:#00a9ff}.wea-map .wea-map-infoWindow{line-height:20px;font-size:14px;white-space:normal}.wea-map .wea-map-infoWindow .infoWindow-name{font-family:PingFangSC-Semibold;color:#000;border-bottom:1px solid #ebebeb;padding-bottom:8px}.wea-map .wea-map-infoWindow .infoWindow-address{padding-top:8px}.wea-map .amap-info-content{width:269px;-webkit-box-shadow:0 0 4px 0 rgba(0,0,0,.5)!important;box-shadow:0 0 4px 0 rgba(0,0,0,.5)!important;border-radius:4px}.wea-map .amap-info-content .amap-info-close{font-weight:400;color:#979797}.wea-map .amap-info-contentContainer.bottom-center,.wea-map .amap-info-contentContainer.bottom-left,.wea-map .amap-info-contentContainer.bottom-right{outline:none}","",{version:3,sources:["E:/git/WEAVER_CloudStore_e9/components/ecology9/wea-map/index.less"],names:[],mappings:"AAAA,SACE,kBAAmB,AACnB,YAAa,AACb,WAAY,AACZ,eAAgB,AAChB,UAAe,CAChB,AACD,yBACE,WAAa,CACd,AACD,8CACE,yBAA0B,AAC1B,mBAAoB,AACpB,WAAY,AACZ,YAAa,AACb,iBAAmB,CACpB,AACD,2BACE,kBAAmB,AACnB,WAAY,AACZ,SAAU,AACV,gBAAoB,AACpB,4CAAiD,AACzC,oCAAyC,AACjD,kBAAmB,AACnB,aAAc,AACd,WAAa,CACd,AACD,4BACE,YAAa,AACb,YAAc,CACf,AACD,kCACE,eAAgB,AAChB,kBAAoB,CACrB,AACD,kCACE,YAAa,AACb,gBAAiB,AACjB,aAAc,AACd,+BAAiC,AACjC,wBAAyB,AACjB,eAAiB,CAC1B,AACD,6BACE,UAAW,AACX,eAAgB,AAChB,iBAAkB,AAClB,kBAAmB,AACnB,iBAAmB,CACpB,AACD,kCACE,WAAY,AACZ,eAAuB,AACvB,+BAAiC,CAClC,AACD,6CACE,kBAAoB,CACrB,AACD,6CACE,kBAAmB,AACnB,WAAY,AACZ,cAAgB,CACjB,AACD,sEACE,eAAgB,AAChB,aAAe,CAChB,AACD,gDACE,gBAAiB,AACjB,iBAAkB,AAClB,qBAAsB,AACtB,kBAAoB,CACrB,AACD,qDACE,aAAe,CAChB,AACD,6BACE,iBAAkB,AAClB,eAAgB,AAChB,kBAAoB,CACrB,AACD,8CACE,gCAAiC,AACjC,WAAe,AACf,gCAAiC,AACjC,kBAAoB,CACrB,AACD,iDACE,eAAiB,CAClB,AACD,4BACE,YAAa,AACb,sDAA4D,AACpD,8CAAoD,AAC5D,iBAAmB,CACpB,AACD,6CACE,gBAAoB,AACpB,aAAe,CAChB,AACD,sJAGE,YAAc,CACf",file:"index.less",sourcesContent:[".wea-map {\n position: relative;\n height: 100%;\n width: 100%;\n font-size: 12px;\n color: #333333;\n}\n.wea-map .wea-map-marker {\n width: 360px;\n}\n.wea-map .wea-map-marker .wea-map-marker-span {\n border: 1px solid #008ef7;\n background: #008ef7;\n color: #fff;\n padding: 3px;\n border-radius: 5px;\n}\n.wea-map .wea-map-editable {\n position: absolute;\n right: 14px;\n top: 12px;\n background: #ffffff;\n -webkit-box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.5);\n box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.5);\n border-radius: 4px;\n z-index: 1000;\n width: 342px;\n}\n.wea-map .wea-map-searchBar {\n height: 91px;\n padding: 15px;\n}\n.wea-map .wea-map-searchBar-title {\n font-size: 14px;\n padding-bottom: 5px;\n}\n.wea-map .wea-map-searchBar input {\n height: 30px;\n border-radius: 0;\n outline: none;\n border-color: #dadada !important;\n -webkit-box-shadow: none;\n box-shadow: none;\n}\n.wea-map .wea-map-searchList {\n top: 110px;\n padding: 0 15px;\n max-height: 336px;\n overflow-y: scroll;\n overflow-x: hidden;\n}\n.wea-map .wea-map-searchList-item {\n width: 100%;\n padding: 10px 0 10px 0;\n border-bottom: 1px solid #ebebeb;\n}\n.wea-map .wea-map-searchList-item:last-child {\n border-bottom: none;\n}\n.wea-map .wea-map-searchList-item .item-icon {\n margin-right: 14px;\n float: left;\n margin-top: 2px;\n}\n.wea-map .wea-map-searchList-item .item-icon .icon-coms02-Positioning {\n font-size: 20px;\n color: #8b8b8b;\n}\n.wea-map .wea-map-searchList-item .item-content {\n max-width: 260px;\n line-height: 18px;\n display: inline-block;\n white-space: normal;\n}\n.wea-map .wea-map-searchList-item .item-content-name {\n color: #00a9ff;\n}\n.wea-map .wea-map-infoWindow {\n line-height: 20px;\n font-size: 14px;\n white-space: normal;\n}\n.wea-map .wea-map-infoWindow .infoWindow-name {\n font-family: PingFangSC-Semibold;\n color: #000000;\n border-bottom: 1px solid #ebebeb;\n padding-bottom: 8px;\n}\n.wea-map .wea-map-infoWindow .infoWindow-address {\n padding-top: 8px;\n}\n.wea-map .amap-info-content {\n width: 269px;\n -webkit-box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.5) !important;\n box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.5) !important;\n border-radius: 4px;\n}\n.wea-map .amap-info-content .amap-info-close {\n font-weight: normal;\n color: #979797;\n}\n.wea-map .amap-info-contentContainer.bottom-left,\n.wea-map .amap-info-contentContainer.bottom-center,\n.wea-map .amap-info-contentContainer.bottom-right {\n outline: none;\n}\n"],sourceRoot:""}])}});
//# sourceMappingURL=21.30110165.chunk.js.map