From 6b680ace26dc95031a1b7a3e33f8785c112f787d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 20 四月 2020 18:32:01 +0800 Subject: [PATCH] 2020-04-20 --- src/templates/zshare/tabform/index.jsx | 33 ++++++++++++++++++++++++++++++++- 1 files changed, 32 insertions(+), 1 deletions(-) diff --git a/src/templates/zshare/tabform/index.jsx b/src/templates/zshare/tabform/index.jsx index 98d21c0..0f8cf4d 100644 --- a/src/templates/zshare/tabform/index.jsx +++ b/src/templates/zshare/tabform/index.jsx @@ -1,6 +1,6 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Form, Row, Col, Input, Select, Icon, Tooltip } from 'antd' +import { Form, Row, Col, Input, Select, Icon, Tooltip, Radio } from 'antd' import { formRule } from '@/utils/option.js' import Utils from '@/utils/utils.js' import './index.scss' @@ -201,6 +201,37 @@ </Form.Item> </Col> ) + } else if (item.type === 'radio') { + fields.push( + <Col span={12} key={index}> + <Form.Item label={item.tooltip ? + <Tooltip placement="topLeft" title={item.tooltip}> + <Icon type="question-circle" /> + {item.label} + </Tooltip> : item.label + }> + {getFieldDecorator(item.key, { + initialValue: item.initVal, + rules: [ + { + required: !!item.required, + message: this.props.dict['form.required.select'] + item.label + '!' + } + ] + })( + <Radio.Group> + { + item.options.map(option => { + return ( + <Radio key={option.value} value={option.value}>{option.text}</Radio> + ) + }) + } + </Radio.Group> + )} + </Form.Item> + </Col> + ) } }) -- Gitblit v1.8.0