king
2021-02-25 08929dbc66fb157307921026974c459f762209e2
src/views/menudesign/menuform/index.jsx
@@ -1,6 +1,5 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { fromJS } from 'immutable'
import { Form, Row, Col, Input, Select, notification, Radio, Icon, Tooltip, InputNumber } from 'antd'
import Api from '@/api'
@@ -15,7 +14,6 @@
    MenuName: PropTypes.string,
    MenuNo: PropTypes.string,
    parentId: PropTypes.string,
    initMenuList: PropTypes.func,
    updateConfig: PropTypes.func
  }
@@ -26,11 +24,8 @@
  }
  UNSAFE_componentWillMount () {
    const { MenuId } = this.props
    const { MenuId, config } = this.props
    let _param = {func: 's_get_pc_menus', systemType: options.sysType, debug: 'Y'}
    if (options.sysType !== 'cloud' && window.GLOB.systemType !== 'production') {
      _param.linkurl = window.GLOB.linkurl
    }
    _param.pro_sys = window.GLOB.systemType === 'production' ? 'Y' : ''
    Api.getSystemConfig(_param).then(result => {
@@ -40,6 +35,9 @@
          let fstItem = {
            MenuID: fst.MenuID,
            MenuName: fst.MenuName,
            value: fst.MenuID,
            label: fst.MenuName,
            isLeaf: false,
            children: []
          }
    
@@ -49,6 +47,8 @@
                ParentId: fst.MenuID,
                MenuID: snd.MenuID,
                MenuName: snd.MenuName,
                value: snd.MenuID,
                label: snd.MenuName,
                children: []
              }
    
@@ -60,7 +60,10 @@
                    MenuID: trd.MenuID,
                    MenuName: trd.MenuName,
                    MenuNo: trd.MenuNo,
                    EasyCode: trd.EasyCode
                    EasyCode: trd.EasyCode,
                    value: trd.MenuID,
                    label: trd.MenuName,
                    disabled: trd.MenuID === MenuId
                  }
                  if (MenuId === trd.MenuID) {
@@ -81,8 +84,8 @@
            smenulist = item.children
          }
        })
        this.props.initMenuList({fstMenuList: fromJS(menulist).toJS(), fstMenuId: thdMenu ? thdMenu.FstId : ''})
        sessionStorage.setItem('fstMenuList', JSON.stringify(menulist))
        this.props.updateConfig({...config, fstMenuId: thdMenu ? thdMenu.FstId : ''})
        this.setState({
          fstMenuId: thdMenu ? thdMenu.FstId : '',
@@ -137,6 +140,8 @@
      this.props.updateConfig({...config, cacheUseful: value})
    } else if (key === 'timeUnit') {
      this.props.updateConfig({...config, timeUnit: value})
    } else if (key === 'OpenType') {
      this.props.updateConfig({...config, OpenType: value})
    }
  }
@@ -249,6 +254,24 @@
            </Form.Item>
          </Col>
          <Col span={24}>
            <Form.Item label="打开方式">
              {getFieldDecorator('OpenType', {
                initialValue: config.OpenType || 'newtab',
                rules: [
                  {
                    required: true,
                    message: dict['form.required.select'] + dict['model.openway'] + '!'
                  }
                ]
              })(
                <Select onChange={(value) => {this.selectChange('OpenType', value)}}>
                  <Select.Option value="newtab">标签页</Select.Option>
                  <Select.Option value="newpage">新页面</Select.Option>
                </Select>
              )}
            </Form.Item>
          </Col>
          <Col span={24}>
            <Form.Item label={
              <Tooltip placement="topLeft" title="对于不经常性变动的信息,缓存数据有助于提高查询效率。">
                <Icon type="question-circle" />