import{Form as e,Row as r,Col as i,Input as l,Button as a}from"antd";import{useState as t}from"react";import d from"./MapSelector.js";import{jsxs as n,Fragment as s,jsx as o}from"react/jsx-runtime";const m=m=>{const{longitudeProps:u="longitude",latitudeProps:p="latitude",onConfirm:c,required:h=!0,area:g="",showArea:b=!1,disable:f=!1,type:y="baidu"}=m,q=e.useFormInstance(),[C,F]=t(!1),[I,x]=t(""),[V,j]=t("");return n(s,{children:[n(r,{gutter:24,children:[o(i,{span:12,children:o(e.Item,{label:"经度",name:u,rules:[{required:h,message:"请选择经度"}],children:o(l,{disabled:!0})})}),o(i,{span:12,children:o(e.Item,{label:"纬度",required:h,children:n("div",{style:{display:"flex",gap:10},children:[o(e.Item,{name:p,noStyle:!0,rules:[{required:h,message:"请选择纬度"}],children:o(l,{disabled:!0})}),o(a,{type:"primary",onClick:()=>{F(!0),x(q.getFieldValue(u)),j(q.getFieldValue(p))},children:"地图定位"})]})})})]}),o(d,{visible:C,onClose:()=>F(!1),longitude:I,latitude:V,area:g,type:y,showArea:b,disable:f,onConfirm:(e,r,i)=>{x(e),j(r),q.setFieldsValue({[u]:e,[p]:r}),c?.(e,r,i),F(!1)}})]})};m.displayName="Map";export{m as default};
