king
2021-12-22 120a1ca7042212630dbe9a0cb6aa208ebf1b1e3d
2021-12-22
7个文件已修改
144 ■■■■■ 已修改文件
src/components/mk-icon/index.jsx 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/menuconfig/editsecmenu/index.jsx 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/menuconfig/menuform/index.jsx 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/actionform/index.jsx 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/tabscomponent/tabform/index.jsx 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/formconfig.jsx 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/option.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/mk-icon/index.jsx
@@ -225,7 +225,8 @@
  UserDeleteOutlined,
  UserSwitchOutlined,
  VideoCameraOutlined,
  WifiOutlined
  WifiOutlined,
  TableOutlined
} from '@ant-design/icons'
const MkIcons = {
@@ -460,6 +461,7 @@
  'user-switch': (props) => <UserSwitchOutlined {...props} />,
  'video-camera': (props) => <VideoCameraOutlined {...props} />,
  'wifi': (props) => <WifiOutlined {...props} />,
  'table': (props) => <TableOutlined {...props} />,
}
class MkIcon extends Component {
src/templates/menuconfig/editsecmenu/index.jsx
@@ -110,18 +110,11 @@
            readonly: false
          },
          { // 菜单图标
            type: 'select',
            type: 'icon',
            key: 'icon',
            label: dict['model.icon'],
            initVal: menu.card.PageParam.Icon,
            required: true,
            options: [{
              MenuID: 'folder',
              text: 'folder'
            }, {
              MenuID: 'api',
              text: 'api'
            }]
            initVal: menu.card.PageParam.Icon || 'folder',
            required: true
          }
        ]
      })
@@ -155,18 +148,11 @@
            readonly: false
          },
          { // 菜单图标
            type: 'select',
            type: 'icon',
            key: 'icon',
            label: dict['model.icon'],
            initVal: 'folder',
            required: true,
            options: [{
              MenuID: 'folder',
              text: 'folder'
            }, {
              MenuID: 'api',
              text: 'api'
            }]
            required: true
          }
        ]
      })
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
src/templates/sharecomponent/actioncomponent/actionform/index.jsx
@@ -4,10 +4,12 @@
import { Form, Row, Col, Input, Select, Radio, notification, Tooltip, InputNumber, Cascader } from 'antd'
import { QuestionCircleOutlined } from '@ant-design/icons'
import { btnIcons, btnClasses, formRule } from '@/utils/option.js'
import MkIcon from '@/components/mk-icon'
import { btnClasses, formRule } from '@/utils/option.js'
import asyncComponent from '@/utils/asyncComponent'
import Utils from '@/utils/utils.js'
import './index.scss'
const MkEditIcon = asyncComponent(() => import('@/components/mkIcon'))
const { TextArea } = Input
const actionTypeOptions = {
@@ -125,8 +127,6 @@
          item.options = btnClasses
        } else if (item.key === 'innerFunc' && _procMode === 'inner') {
          item.required = true
        } else if (item.key === 'icon') {
          item.options = btnIcons
        } else if (item.key === 'intertype') {
          let iscustom = ['pop', 'prompt', 'exec'].includes(_opentype)
          item.options = this.state.interTypeOptions.filter(op => (iscustom || op.value !== 'custom'))
@@ -605,12 +605,11 @@
                  showSearch
                  filterOption={(input, option) => option.props.children[2].toLowerCase().indexOf(input.toLowerCase()) >= 0}
                  onChange={(value) => {this.optionChange(item.key, value)}}
                  allowClear={item.key === 'icon'}
                  getPopupContainer={() => document.getElementById('winter')}
                >
                  {item.options.map((option, index) =>
                    <Select.Option id={`${index}`} title={option.text} key={`${index}`} value={option.value || option.field}>
                      {item.key === 'icon' && option.value ? <MkIcon type={option.value} /> : null} {option.text || option.label}
                      {option.text || option.label}
                    </Select.Option>
                  )}
                </Select>
@@ -618,6 +617,29 @@
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'icon') { // 下拉搜索
        fields.push(
          <Col span={12} key={index}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} 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={['edit', 'direction', 'normal', 'data', 'hint']} allowClear/>
              )}
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'radio') {
        fields.push(
          <Col span={12} key={index}>
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}>
src/templates/zshare/formconfig.jsx
@@ -1234,12 +1234,11 @@
      }]
    },
    {
      type: 'select',
      type: 'icon',
      key: 'icon',
      label: Formdict['model.icon'],
      initVal: card.icon,
      required: false,
      options: []
      required: false
    },
    {
      type: 'select',
@@ -3323,27 +3322,11 @@
      options: []
    },
    {
      type: 'select',
      type: 'icon',
      key: 'icon',
      label: Formdict['model.icon'],
      initVal: card.icon || '',
      required: false,
      options: [{
        value: '',
        text: Formdict['model.empty']
      }, {
        value: 'table',
        text: 'table'
      }, {
        value: 'bar-chart',
        text: 'bar-chart'
      }, {
        value: 'pie-chart',
        text: 'pie-chart'
      }, {
        value: 'line-chart',
        text: 'line-chart'
      }],
      forbid: type === 'CalendarPage'
    },
    {
src/utils/option.js
@@ -898,7 +898,7 @@
    'user-switch',
    'video-camera',
    'wifi',
    'table',
    'apple',
    'dingding',
    'weibo',