| | |
| | | formlist |
| | | }, () => { |
| | | if (action.setting && action.setting.focus) { |
| | | this.selectInput(action.setting.focus, 'init') |
| | | this.selectInput(action.setting.focus) |
| | | } |
| | | // 用来更新state,防止受控表单初始时不显示 |
| | | this.setState({ |
| | |
| | | }) |
| | | } |
| | | |
| | | selectInput = (selectId, type) => { |
| | | selectInput = (selectId) => { |
| | | try { |
| | | let _form = document.getElementById('main-form-box') |
| | | let _inputs = _form.getElementsByTagName('input') |
| | |
| | | _inputs.forEach(input => { |
| | | if (!input || input.id !== selectId) return |
| | | |
| | | if (input.className === 'ant-select-search__field' && type !== 'init') { |
| | | if (input.className === 'ant-select-search__field') { |
| | | let div = input.parentNode |
| | | while (div && div.parentNode) { |
| | | div = div.parentNode |
| | |
| | | if (item.type === 'split') { |
| | | fields.push( |
| | | <Col span={24} key={index}> |
| | | <p>{item.label}</p> |
| | | <p className="mk-form-split-line">{item.label}</p> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'hint') { |