| | |
| | | |
| | | const { TextArea } = Input |
| | | const ColorSketch = asyncComponent(() => import('@/mob/colorsketch')) |
| | | const CodeMirror = asyncComponent(() => import('@/templates/zshare/codemirror')) |
| | | const SourceComponent = asyncComponent(() => import('@/menu/components/share/sourcecomponent')) |
| | | const MkEditIcon = asyncComponent(() => import('@/components/mkIcon')) |
| | | |
| | |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'textarea') { |
| | | if (item.key === 'formula') { |
| | | fields.push( |
| | | <Col span={24} className="textarea" key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [ |
| | | { |
| | | required: item.readonly ? false : !!item.required, |
| | | message: '请输入' + item.label + '!' |
| | | } |
| | | ] |
| | | })(<TextArea autoSize={{minRows: 2}} disabled={item.readonly} placeholder={item.placeholder || ''} />)} |
| | | </Form.Item> |
| | | <Popover overlayClassName="formula-fields" placement="topLeft" title="" content={<div>{item.fields}</div>} trigger="click"> |
| | | <span className="formula-icon">字段集</span> |
| | | </Popover> |
| | | </Col> |
| | | ) |
| | | } else { |
| | | fields.push( |
| | | <Col span={24} className="textarea" key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [ |
| | | { |
| | | required: item.readonly ? false : !!item.required, |
| | | message: '请输入' + item.label + '!' |
| | | } |
| | | ] |
| | | })(<TextArea autoSize={{minRows: 2}} disabled={item.readonly} placeholder={item.placeholder || ''} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } |
| | | fields.push( |
| | | <Col span={24} className="textarea" key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [ |
| | | { |
| | | required: item.readonly ? false : !!item.required, |
| | | message: '请输入' + item.label + '!' |
| | | } |
| | | ] |
| | | })(<TextArea autoSize={{minRows: 2}} disabled={item.readonly} placeholder={item.placeholder || ''} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'number') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'codemirror') { |
| | | fields.push( |
| | | <Col span={24} key={index} className="textarea"> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" overlayStyle={{width: 500, maxWidth: 500}} title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [ |
| | | { |
| | | required: !!item.required, |
| | | message: '请输入' + item.label + '!' |
| | | } |
| | | ] |
| | | })( |
| | | <CodeMirror mode="text/javascript"/> |
| | | )} |
| | | </Form.Item> |
| | | <Popover overlayClassName="formula-fields" placement="topLeft" title="" content={<div>{item.fields}</div>} trigger="click"> |
| | | <span className="formula-icon">字段集</span> |
| | | </Popover> |
| | | </Col> |
| | | ) |
| | | } |
| | | }) |
| | | return fields |