(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[50636],{96278:function(A){A.exports={root:"root___7VXfh",colorWeak:"colorWeak___2fQ5G","ant-layout":"ant-layout___2lk2i",globalSpin:"globalSpin___3wjkL","ant-table":"ant-table___3MoMQ","ant-table-thead":"ant-table-thead___2F4eD","ant-table-tbody":"ant-table-tbody___1iFAX",formBox:"formBox___1MR6m",hrefModal:"hrefModal___GOUPi",shop:"shop___3KrmS"}},50636:function(A,O,t){"use strict";t.r(O),t.d(O,{default:function(){return N}});var S=t(71194),T=t(50146),j=t(57663),D=t(71577),K=t(34792),m=t(48086),U=t(43358),y=t(34041),Z=t(47673),C=t(4107),w=t(67294),R=t(28216),I=t(96278),W=t.n(I),G=t(41273),o=t(85893),P,B,b=C.Z.TextArea,L=y.Z.Option,N=(P=(0,R.$j)(x=>{var a=x.commondesign;return{commondesign:a}}),P(B=class extends w.PureComponent{constructor(){super(...arguments);this.state={visible:!1,mapType:"baidu",city:"\u676D\u5DDE\u5E02",address:"\u8363\u5B89\u5927\u53A6",textAddress:"\u6D59\u6C5F\u65E0\u6781\u6559\u80B2\u4E91"},this.updataDomCallBack=a=>{var e=this,r=this.props.commondesign,n=r.Maps,d=n.element,_=n.callback,v=n.callClose,E=d.find(".box");if(window.BMap){var l=window,M=a,s=d.attr("data-mid");window["myGeo"+s]?window["myGeo"+s].getPoint(a.address,function(c){if(c){window["map"+s].centerAndZoom(c,16);var h=new BMap.Marker(c);window["map"+s].addOverlay(h);var u="

"+a.textAddress+"

",p=new BMap.InfoWindow(u);h.openInfoWindow(p)}else m.ZP.info("\u60A8\u9009\u62E9\u5730\u5740\u6CA1\u6709\u89E3\u6790\u5230\u7ED3\u679C!")},a.city):(d.html('
'),setTimeout(function(){l["map"+s]=new BMap.Map(s),l["myGeo"+s]=new BMap.Geocoder,l["map"+s].enableScrollWheelZoom(!0);var c=new BMap.ScaleControl({anchor:BMAP_ANCHOR_TOP_LEFT}),h=new BMap.NavigationControl,u=new BMap.NavigationControl({anchor:BMAP_ANCHOR_TOP_RIGHT,type:BMAP_NAVIGATION_CONTROL_SMALL});l["map"+s].addControl(c),l["map"+s].addControl(h),l["map"+s].addControl(u),l["myGeo"+s].getPoint(M.address,function(p){if(p){l["map"+s].centerAndZoom(p,16);var f=new BMap.Marker(p);l["map"+s].addOverlay(f);var i="

"+M.textAddress+"

",g=new BMap.InfoWindow(i);f.openInfoWindow(g)}else m.ZP.info("\u60A8\u9009\u62E9\u5730\u5740\u6CA1\u6709\u627E\u5230\u7ED3\u679C!")},M.city)},0)),d.attr("data-map",JSON.stringify(a))}else m.ZP.info("\u767E\u5EA6\u5730\u56FE\u9519\u8BEF")},this.updateMap=()=>{var a=this,e=this.state,r=e.city,n=e.address,d=e.textAddress;a.myGeo.getPoint(n,function(_){if(_){a.map.centerAndZoom(_,16),a.marker=new BMap.Marker(_),a.map.addOverlay(a.marker);var v="

"+d+"

";a.infoWindow=new BMap.InfoWindow(v),a.marker.openInfoWindow(a.infoWindow)}else m.ZP.info("\u60A8\u9009\u62E9\u5730\u5740\u6CA1\u6709\u627E\u5230\u7ED3\u679C!")},r)},this.show=a=>{if(!window.BMap)return m.ZP.info("\u767E\u5EA6\u5730\u56FE\u6682\u4E0D\u53EF\u7528"),!1;var e=this;a?(a=JSON.parse(a),this.setState({mapType:a.mapType,city:a.city,address:a.address,textAddress:a.textAddress})):this.setState({visible:!0,mapType:"baidu",city:"\u676D\u5DDE\u5E02",address:"\u8363\u5B89\u5927\u53A6",textAddress:"\u6D59\u6C5F\u65E0\u6781\u6559\u80B2\u4E91"}),setTimeout(function(){e.map=new BMap.Map("baiduMap"),e.myGeo=new BMap.Geocoder,e.map.enableScrollWheelZoom(!0);var r=new BMap.ScaleControl({anchor:BMAP_ANCHOR_TOP_LEFT}),n=new BMap.NavigationControl,d=new BMap.NavigationControl({anchor:BMAP_ANCHOR_TOP_RIGHT,type:BMAP_NAVIGATION_CONTROL_SMALL});e.map.addControl(r),e.map.addControl(n),e.map.addControl(d),e.updateMap()},0)},this.cancelEvent=()=>{var a=this,e=this.props.dispatch;e({type:"commondesign/setState",payload:{Maps:{visible:!1,callback:()=>{},callClose:()=>{}}}})}}componentDidMount(){var a=this.props.commondesign,e=a.Maps,r=e.visible,n=e.element,d=e.callback,_=e.callClose;this.setState({visible:r});var v=n.attr("data-map");this.show(v)}render(){var a=this,e=this.props.commondesign,r=e.Maps.callback,n=this.state,d=n.visible,_=n.mapType,v=n.city,E=n.address,l=n.textAddress,M=i=>{a.cancelEvent()},s=i=>{var g={mapType:_,city:v,address:E,textAddress:l};a.updataDomCallBack(g),r&&r(g),a.cancelEvent()},c=i=>{this.setState({mapType:i})},h=i=>{this.setState({city:i.target.value})},u=i=>{this.setState({address:i.target.value})},p=i=>{this.updateMap()},f=i=>{this.setState({textAddress:i.target.value},function(){this.updateMap()})};return(0,o.jsx)(T.Z,{title:"\u6DFB\u52A0\u5730\u56FE",visible:d,onOk:s,width:1e3,onCancel:M,maskClosable:!1,className:W().hrefModal,children:(0,o.jsxs)("div",{className:"divRow",children:[(0,o.jsx)("div",{className:"label",children:"\u5730\u56FE\u5730\u5740\uFF1A"}),(0,o.jsxs)("div",{className:"content",style:{marginBottom:20},children:[(0,o.jsx)(y.Z,{value:_,onChange:c,style:{width:120,marginRight:10},children:(0,o.jsx)(L,{value:"baidu",children:"\u767E\u5EA6\u5730\u56FE"})}),(0,o.jsx)(C.Z,{value:v,onChange:h,style:{width:120,marginRight:10}}),(0,o.jsx)(C.Z,{value:E,onChange:u,style:{width:240,marginRight:10}}),(0,o.jsx)(D.Z,{onClick:p,children:"\u641C\u7D22\u5730\u5740"})]}),(0,o.jsxs)("div",{className:"content",style:{marginBottom:20},children:[(0,o.jsx)("div",{id:"baiduMap",style:{width:600,height:300,float:"left"}}),(0,o.jsx)("div",{className:"bjtitle",children:"\u6807\u8BB0\u5730\u5740\uFF1A"}),(0,o.jsx)(b,{className:"biaojiBox",value:l,onChange:f})]})]})})}})||B)}}]);