king
2021-09-01 31ec63f0419895876cbaba99637a884a32d33d0d
src/templates/sharecomponent/tabscomponent/tabform/index.jsx
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Select, Icon, Tooltip, Radio, InputNumber } from 'antd'
import { Form, Row, Col, Input, Select, Icon, Tooltip, Radio, InputNumber, notification } from 'antd'
import { formRule } from '@/utils/option.js'
import Utils from '@/utils/utils.js'
import './index.scss'
@@ -26,9 +26,9 @@
  UNSAFE_componentWillMount () {
    const { formlist } = this.props
    let type = formlist.filter(cell => cell.key === 'type')[0].initVal
    // let type = formlist.filter(cell => cell.key === 'type')[0].initVal
    let _tabs = this.props.tabs.filter(tab => tab.type === type)
    let _tabs = this.props.tabs.filter(tab => tab.type === 'SubTable')
    this.setState({
      formlist: formlist.map(item => {
@@ -54,7 +54,7 @@
      try {
        let _form = document.getElementById('label')
        _form.select()
      } catch {
      } catch (e) {
        console.warn('表单focus失败!')
      }
    }
@@ -272,8 +272,17 @@
          }
          if (values.level === undefined) {
            values.level = ''
          } else if (values.supMenu && values.supMenu === 'mainTable' && values.level === 0) {
            notification.warning({
              top: 92,
              message: '显示级别为0时,上级标签不可关联主表!',
              duration: 5
            })
            return
          }
          values.type = 'SubTable' // 类型为子表
          resolve(values)
        } else {
          reject(err)