| | |
| | | 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' |
| | |
| | | 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 => { |
| | |
| | | try { |
| | | let _form = document.getElementById('label') |
| | | _form.select() |
| | | } catch { |
| | | } catch (e) { |
| | | console.warn('表单focus失败!') |
| | | } |
| | | } |
| | |
| | | } |
| | | 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) |