| | |
| | | style.paddingRight = setting.paddingRight |
| | | } |
| | | |
| | | if (setting.display === 'drawer' && (setting.placement === 'top' || setting.placement === 'bottom') && setting.width !== 100) { |
| | | style.minHeight = 'auto' |
| | | } |
| | | |
| | | return ( |
| | | <div ref={drop} className="ant-row modal-fields-row mob-form" style={style}> |
| | | {cards.map(card => { |
| | |
| | | }) |
| | | } else if (item.regular === 'letter&number') { |
| | | _rules.push({ |
| | | pattern: /^[a-zA-Z0-9]*$/ig, |
| | | message: formRule.input.letternummsg |
| | | pattern: /^[a-zA-Z0-9_]*$/ig, |
| | | message: '请输入数字、字母以及_' |
| | | }) |
| | | } else if (item.regular === 'phone') { |
| | | _rules.push({ |
| | |
| | | state = { |
| | | fields: null, |
| | | display: this.props.config.setting.display || 'modal', |
| | | placement: this.props.config.setting.placement || 'right', |
| | | appType: sessionStorage.getItem('appType'), |
| | | dialogInput: false |
| | | } |
| | |
| | | |
| | | render() { |
| | | const { config } = this.props |
| | | const { fields, appType, display } = this.state |
| | | const { fields, appType, display, placement } = this.state |
| | | const { getFieldDecorator } = this.props.form |
| | | |
| | | const formItemLayout = { |
| | |
| | | </Col> |
| | | {display === 'drawer' || display === 'modal' ? <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="宽度小于100时为百分率,大于100时为绝对值。"> |
| | | <Tooltip placement="topLeft" title="小于100时为百分率,大于100时为绝对值。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 宽度 |
| | | {display === 'drawer' && (placement === 'top' || placement === 'bottom') ? '高度' : '宽度'} |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('width', { |
| | |
| | | {display === 'drawer' ? <Col span={12}> |
| | | <Form.Item label="抽屉方向"> |
| | | {getFieldDecorator('placement', { |
| | | initialValue: config.setting.placement || 'right' |
| | | initialValue: placement |
| | | })( |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}}> |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}} onChange={(e) => this.setState({placement: e.target.value})}> |
| | | <Radio value="right">右侧</Radio> |
| | | <Radio value="left">左侧</Radio> |
| | | <Radio value="top">上侧</Radio> |
| | |
| | | |
| | | complete = (key, option) => { |
| | | let label = option.props.label |
| | | |
| | | |
| | | this.props.form.setFieldsValue({label: label}) |
| | | } |
| | | |
| | |
| | | |
| | | if (item.key === 'field' && item.options && item.options.length > 0) { |
| | | content = <AutoComplete |
| | | dataSource={item.options.map((cell) => <AutoComplete.Option label={cell.label} key={cell.key}> |
| | | dataSource={item.options.map((cell) => <AutoComplete.Option label={cell.label} value={cell.value} key={cell.key}> |
| | | {cell.text} |
| | | </AutoComplete.Option>)} |
| | | filterOption={(input, option) => option.props.children.indexOf(input) > -1} |
| | |
| | | initVal: card.regular || '', |
| | | options: [{ |
| | | value: '', |
| | | text: Formdict['model.empty'] |
| | | text: '空' |
| | | }, { |
| | | value: 'number', |
| | | text: Formdict['model.form.number'] |
| | | text: '数字' |
| | | }, { |
| | | value: 'letter', |
| | | text: Formdict['header.form.letter'] |
| | | text: '字母' |
| | | }, { |
| | | value: 'letter&number', |
| | | text: '字母+数字' |
| | | text: '数字、字母以及_' |
| | | }, { |
| | | value: 'phone', |
| | | text: '手机号' |
| | |
| | | import { Form, Row, Col, Select, Button, InputNumber, Input, Tooltip } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | |
| | | import { formRule } from '@/utils/option.js' |
| | | import './index.scss' |
| | | |
| | | |
| | |
| | | }, |
| | | { |
| | | pattern: /^[a-zA-Z0-9]*$/ig, |
| | | message: formRule.input.letternummsg |
| | | message: '请输入数字、字母以及_' |
| | | } |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" />)} |
| | |
| | | formMessage: '最多@max个字符。', // 文本表单最大提示 |
| | | numbermsg: '请输入数字!', |
| | | lettermsg: '请输入字母!', |
| | | letternummsg: '请输入数字或字母!', |
| | | quotemsg: '不可使用英文状态的单引号!', |
| | | funcname: '请输入数字、字母、汉字以及_' |
| | | }, |