From 120a1ca7042212630dbe9a0cb6aa208ebf1b1e3d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 22 十二月 2021 16:15:17 +0800 Subject: [PATCH] 2021-12-22 --- src/templates/sharecomponent/tabscomponent/tabform/index.jsx | 29 +++++++++++++++++++++++++++-- 1 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/templates/sharecomponent/tabscomponent/tabform/index.jsx b/src/templates/sharecomponent/tabscomponent/tabform/index.jsx index edfd410..efd6bec 100644 --- a/src/templates/sharecomponent/tabscomponent/tabform/index.jsx +++ b/src/templates/sharecomponent/tabscomponent/tabform/index.jsx @@ -4,9 +4,11 @@ import { QuestionCircleOutlined } from '@ant-design/icons' import { formRule } from '@/utils/option.js' -import MkIcon from '@/components/mk-icon' 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 = { @@ -190,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 ? <MkIcon type={option.text} /> : option.text} + {option.text} </Select.Option> )} </Select> @@ -198,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