优化FormItemsRenderer和Map
parent
9451463d3b
commit
06198af1c0
|
|
@ -263,8 +263,8 @@ const FormItemsRenderer = ({
|
||||||
{options.map((option, index) => {
|
{options.map((option, index) => {
|
||||||
// 列数
|
// 列数
|
||||||
const itemSpan = option.render === FORM_ITEM_RENDER_ENUM.DIVIDER ? 24 : option.span ?? span;
|
const itemSpan = option.render === FORM_ITEM_RENDER_ENUM.DIVIDER ? 24 : option.span ?? span;
|
||||||
const itemLabelCol = option.labelCol ? option.labelCol : (itemSpan === 24 ? { span: labelCol.span / 2 } : labelCol);
|
const itemLabelCol = option.labelCol ?? (itemSpan === 24 ? { span: labelCol.span / 2 } : labelCol);
|
||||||
const itemWrapperCol = option.wrapperCol ? option.wrapperCol : { span: 24 - itemLabelCol.span };
|
const itemWrapperCol = option.wrapperCol ?? { span: 24 - itemLabelCol.span };
|
||||||
|
|
||||||
// 使用 style 控制显示/隐藏
|
// 使用 style 控制显示/隐藏
|
||||||
const style = collapse && index >= 3 ? { display: "none" } : undefined;
|
const style = collapse && index >= 3 ? { display: "none" } : undefined;
|
||||||
|
|
|
||||||
|
|
@ -35,16 +35,14 @@ const Map = (props) => {
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<div style={{ display: "flex" }}>
|
<Form.Item label="纬度" name={latitudeProps} style={{ flex: 1 }} rules={[{ required, message: "请选择纬度" }]}>
|
||||||
<Form.Item label="纬度" name={latitudeProps} style={{ flex: 1 }} rules={[{ required, message: "请选择纬度" }]}>
|
<div style={{ display: "flex", gap: 10 }}>
|
||||||
<Input disabled />
|
<Input disabled />
|
||||||
</Form.Item>
|
|
||||||
<Form.Item label=" " colon={false}>
|
|
||||||
<Button type="primary" onClick={() => setMapVisible(true)}>
|
<Button type="primary" onClick={() => setMapVisible(true)}>
|
||||||
点击定位
|
点击定位
|
||||||
</Button>
|
</Button>
|
||||||
</Form.Item>
|
</div>
|
||||||
</div>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
<MapSelector
|
<MapSelector
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue