优化Map
parent
d013270875
commit
8a15d0f86a
|
|
@ -17,8 +17,8 @@ const Map = (props) => {
|
|||
|
||||
const form = Form.useFormInstance();
|
||||
const [mapVisible, setMapVisible] = useState(false);
|
||||
const [currentLongitude, setCurrentLongitude] = useState(form.getFieldValue(longitudeProps) || "");
|
||||
const [currentLatitude, setCurrentLatitude] = useState(form.getFieldValue(latitudeProps) || "");
|
||||
const [currentLongitude, setCurrentLongitude] = useState("");
|
||||
const [currentLatitude, setCurrentLatitude] = useState("");
|
||||
|
||||
const handleMapConfirm = (longitudeValue, latitudeValue, extra) => {
|
||||
setCurrentLongitude(longitudeValue);
|
||||
|
|
@ -45,7 +45,11 @@ const Map = (props) => {
|
|||
<Form.Item name={latitudeProps} noStyle rules={[{ required, message: "请选择纬度" }]}>
|
||||
<Input disabled />
|
||||
</Form.Item>
|
||||
<Button type="primary" onClick={() => setMapVisible(true)}>
|
||||
<Button type="primary" onClick={() => {
|
||||
setMapVisible(true);
|
||||
setCurrentLongitude(form.getFieldValue(longitudeProps));
|
||||
setCurrentLatitude(form.getFieldValue(latitudeProps));
|
||||
}}>
|
||||
地图定位
|
||||
</Button>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue