优化FormItemsRenderer和Map
parent
9451463d3b
commit
06198af1c0
|
|
@ -263,8 +263,8 @@ const FormItemsRenderer = ({
|
|||
{options.map((option, index) => {
|
||||
// 列数
|
||||
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 itemWrapperCol = option.wrapperCol ? option.wrapperCol : { span: 24 - itemLabelCol.span };
|
||||
const itemLabelCol = option.labelCol ?? (itemSpan === 24 ? { span: labelCol.span / 2 } : labelCol);
|
||||
const itemWrapperCol = option.wrapperCol ?? { span: 24 - itemLabelCol.span };
|
||||
|
||||
// 使用 style 控制显示/隐藏
|
||||
const style = collapse && index >= 3 ? { display: "none" } : undefined;
|
||||
|
|
|
|||
|
|
@ -35,16 +35,14 @@ const Map = (props) => {
|
|||
</Form.Item>
|
||||
</Col>
|
||||
<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 />
|
||||
</Form.Item>
|
||||
<Form.Item label=" " colon={false}>
|
||||
<Button type="primary" onClick={() => setMapVisible(true)}>
|
||||
点击定位
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</div>
|
||||
</div>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
<MapSelector
|
||||
|
|
|
|||
Loading…
Reference in New Issue