king
2021-12-22 120a1ca7042212630dbe9a0cb6aa208ebf1b1e3d
src/templates/menuconfig/menuform/index.jsx
@@ -2,8 +2,10 @@
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Select } from 'antd'
import MkIcon from '@/components/mk-icon'
import asyncComponent from '@/utils/asyncComponent'
import './index.scss'
const MkEditIcon = asyncComponent(() => import('@/components/mkIcon'))
class MainSearch extends Component {
  static propTpyes = {
@@ -37,7 +39,7 @@
    const { getFieldDecorator } = this.props.form
    const fields = []
    this.props.formlist.forEach((item, index) => {
      if (item.type === 'text') { // 文本搜索
      if (item.type === 'text') {
        fields.push(
          <Col span={24} key={index}>
            <Form.Item label={item.label}>
@@ -53,7 +55,7 @@
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'select') { // 下拉搜索
      } else if (item.type === 'select') {
        fields.push(
          <Col span={24} key={index}>
            <Form.Item label={item.label}>
@@ -74,7 +76,7 @@
                >
                  {item.options.map(option =>
                    <Select.Option id={option.MenuID} key={option.MenuID} value={option.MenuID}>
                      {item.key === 'icon' && <MkIcon type={option.text} />} {option.text || option.MenuName}
                      {option.text || option.MenuName}
                    </Select.Option>
                  )}
                </Select>
@@ -82,6 +84,24 @@
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'icon') {
        fields.push(
          <Col span={24} key={index}>
            <Form.Item label={item.label}>
              {getFieldDecorator(item.key, {
                initialValue: item.initVal || '',
                rules: [
                  {
                    required: !!item.required,
                    message: this.props.dict['form.required.select'] + item.label + '!'
                  }
                ]
              })(
                <MkEditIcon options={['normal', 'data', 'direction', 'edit', 'hint']} />
              )}
            </Form.Item>
          </Col>
        )
      }
    })
    return fields