king
2022-01-21 46f79b491173d284a4900d19e7aecf7509481438
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}>