| | |
| | | text: this.props.dict['header.form.requiredOnce'] |
| | | }], |
| | | insertUpdateOptions: [{ |
| | | value: '', |
| | | text: this.props.dict['model.empty'] |
| | | }, { |
| | | value: 'insert', |
| | | text: this.props.dict['header.form.action.insert'] |
| | | }, { |
| | |
| | | UNSAFE_componentWillMount () { |
| | | const { card, type } = this.props |
| | | |
| | | let _menulist = this.props.formlist.filter(form => form.key === 'linkmenu')[0] || '' |
| | | let _opentype = card.OpenType // 打开方式 |
| | | let _intertype = card.intertype || 'system' // 接口类型 |
| | | let _funcType = card.funcType || 'print' // 功能按钮默认类型 |
| | |
| | | |
| | | this.setState({ |
| | | openType: _opentype, |
| | | menulist: _menulist.options || [], |
| | | interType: _intertype, |
| | | funcType: _funcType, |
| | | formlist: this.props.formlist.map(item => { |
| | |
| | | _options.push('execMode', 'intertype', 'innerFunc', 'Ot', 'execSuccess', 'execError') |
| | | } |
| | | } |
| | | } else if (_opentype === 'popview' && _opentype === 'tab') { |
| | | } else if (_opentype !== 'popview' && _opentype !== 'tab') { |
| | | if (_intertype === 'outer') { |
| | | _options.push('innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc') |
| | | } else if (_intertype === 'inner') { |
| | |
| | | if (card.focus) { |
| | | try { |
| | | let _form = document.getElementById('label') |
| | | _form.select() |
| | | _form && _form.select() |
| | | } catch { |
| | | console.warn('表单focus失败!') |
| | | } |
| | |
| | | _fieldval.label = '删除' |
| | | _fieldval.class = 'danger' |
| | | _fieldval.Ot = 'requiredSgl' |
| | | } |
| | | |
| | | if (card.$type === 'tableButton') { // 表格按钮 |
| | | delete _fieldval.Ot |
| | | } |
| | | |
| | | this.props.form.setFieldsValue(_fieldval) |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <Cascader |
| | | options={this.state.menulist} |
| | | placeholder="" |
| | | /> |
| | | <Cascader options={item.options || []} placeholder=""/> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | |
| | | handleConfirm = () => { |
| | | const { setting } = this.props |
| | | const { menulist } = this.state |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | |
| | | values.OpenType = values.execMode |
| | | } |
| | | } else if (['pop', 'prompt', 'exec'].includes(values.OpenType) && values.verify) { |
| | | if (values.Ot === 'requiredOnce' && ['notRequired', 'requiredSgl', 'required'].includes(this.props.card.Ot)) { |
| | | values.verify.uniques = [] |
| | | } else if (this.props.card.Ot === 'requiredOnce' && ['notRequired', 'requiredSgl', 'required'].includes(values.Ot)) { |
| | | if ((values.Ot === 'requiredOnce' || this.props.card.Ot === 'requiredOnce') && this.props.card.Ot !== values.Ot) { |
| | | values.verify.uniques = [] |
| | | } |
| | | } |
| | | |
| | | // 关联三级菜单 |
| | | if (values.OpenType === 'tab' && values.linkmenu && values.linkmenu.length > 0) { |
| | | let linkThdMenu = '' |
| | | menulist.forEach(menu => { |
| | | if (menu.value === values.linkmenu[0]) { |
| | | menu.children.forEach(item => { |
| | | if (item.value === values.linkmenu[1]) { |
| | | item.children.forEach(cell => { |
| | | if (cell.value === values.linkmenu[2]) { |
| | | linkThdMenu = cell |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | values.linkThdMenu = linkThdMenu |
| | | } |
| | | |
| | | resolve(values) |