From 46f79b491173d284a4900d19e7aecf7509481438 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 21 一月 2022 17:21:25 +0800 Subject: [PATCH] 2022-01-21 --- src/templates/sharecomponent/tabscomponent/tabform/index.jsx | 30 ++++++++++++++++++++++++++++-- 1 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/templates/sharecomponent/tabscomponent/tabform/index.jsx b/src/templates/sharecomponent/tabscomponent/tabform/index.jsx index 267c67c..efd6bec 100644 --- a/src/templates/sharecomponent/tabscomponent/tabform/index.jsx +++ b/src/templates/sharecomponent/tabscomponent/tabform/index.jsx @@ -1,11 +1,14 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Form, Row, Col, Input, Select, Icon, Tooltip, Radio, InputNumber, notification } from 'antd' +import { Form, Row, Col, Input, Select, Tooltip, Radio, InputNumber, notification } from 'antd' import { QuestionCircleOutlined } from '@ant-design/icons' import { formRule } from '@/utils/option.js' import Utils from '@/utils/utils.js' +import asyncComponent from '@/utils/asyncComponent' // import './index.scss' + +const MkEditIcon = asyncComponent(() => import('@/components/mkIcon')) class MainTab extends Component { static propTpyes = { @@ -189,7 +192,7 @@ > {item.options.map((option, i) => <Select.Option id={'mk' + i} title={option.text} key={'mk' + i} value={option.value}> - {item.key === 'icon' && i !== 0 ? <Icon type={option.text} /> : option.text} + {option.text} </Select.Option> )} </Select> @@ -197,6 +200,29 @@ </Form.Item> </Col> ) + } else if (item.type === 'icon') { // 涓嬫媺鎼滅储 + fields.push( + <Col span={12} 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.required, + message: this.props.dict['form.required.select'] + item.label + '!' + } + ] + })( + <MkEditIcon options={['data', 'normal', 'edit', 'direction', 'hint']} allowClear/> + )} + </Form.Item> + </Col> + ) } else if (item.type === 'mutilselect') { fields.push( <Col span={12} key={index}> -- Gitblit v1.8.0