| | |
| | | if (item.hidden) return |
| | | |
| | | if (item.type === 'text') { // 文本搜索 |
| | | let _rules = [] |
| | | if (item.key === 'innerFunc') { |
| | | let str = '^(' + item.fields.join('|') + ')' |
| | | let _patten = new RegExp(str + '[0-9a-zA-Z_]*', 'ig') |
| | | _rules = [{ |
| | | pattern: _patten, |
| | | message: '名称只允许包含数字、字母和下划线,且以指定字符开始。' |
| | | }, { |
| | | min: 6, |
| | | message: '内部函数名称不小于6个字符。' |
| | | }, { |
| | | max: 100, |
| | | message: '内部函数名称不超过100个字符。' |
| | | }] |
| | | } |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | |
| | | { |
| | | required: item.readonly ? false : !!item.required, |
| | | message: this.props.dict['form.required.input'] + item.label + '!' |
| | | } |
| | | }, |
| | | ..._rules |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" disabled={item.readonly} />)} |
| | | </Form.Item> |
| | |
| | | values.position = 'toolbar' |
| | | values.Ot = 'notRequired' |
| | | } |
| | | |
| | | console.log(values) |
| | | if (values.innerFunc === '' && values.sql === '') { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: this.props.dict['header.form.actionhelp.datasource'], |
| | | duration: 10 |
| | | }) |
| | | } else if (values.innerFunc === '' && values.sql !== '' && values.sqlType === '') { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: this.props.dict['header.form.actionhelp.sqlType'], |
| | | duration: 10 |
| | | }) |
| | | } else { |
| | | resolve({ |
| | | type: 'action', |