From c39ea1f23d21b070188abcf5f4dd5bdd7b47c1f9 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 10 三月 2020 10:32:13 +0800 Subject: [PATCH] 2020-03-10 --- src/templates/tableshare/searchform/index.jsx | 29 +++++++++++++++++++++++++---- 1 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/templates/tableshare/searchform/index.jsx b/src/templates/tableshare/searchform/index.jsx index 51a0c5b..adba3f1 100644 --- a/src/templates/tableshare/searchform/index.jsx +++ b/src/templates/tableshare/searchform/index.jsx @@ -1,6 +1,6 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Form, Row, Col, Input, Select, Icon, Radio, notification, Tooltip } from 'antd' +import { Form, Row, Col, Input, Select, Icon, Radio, notification, Tooltip, InputNumber } from 'antd' import { dateOptions, matchReg, formRule } from '@/utils/option.js' import EditTable from '../editable' import './index.scss' @@ -32,7 +32,7 @@ let type = formlist.filter(cell => cell.key === 'type')[0].initVal let resourceType = formlist.filter(cell => cell.key === 'resourceType')[0].initVal - let _options = ['label', 'field', 'initval', 'type', 'match'] // 榛樿鏄剧ず椤� + let _options = ['label', 'field', 'initval', 'type', 'match', 'ratio'] // 榛樿鏄剧ず椤� if ((type === 'multiselect' || type === 'select' || type === 'link') && resourceType === '0') { // 涓嬫媺閫夋嫨绫诲瀷銆侀�夐」涓鸿嚜瀹氫箟璧勬簮 _options = [..._options, 'resourceType', 'options', 'display', 'quick'] @@ -104,7 +104,7 @@ const { resourceType } = this.state if (key === 'type') { - let _options = ['label', 'field', 'initval', 'type', 'match'] + let _options = ['label', 'field', 'initval', 'type', 'match', 'ratio'] if ((value === 'multiselect' || value === 'select' || value === 'link') && resourceType === '0') { // 涓嬫媺閫夋嫨绫诲瀷銆侀�夐」涓鸿嚜瀹氫箟璧勬簮 _options = [..._options, 'resourceType', 'options', 'display', 'quick'] @@ -189,7 +189,7 @@ let value = e.target.value if (key === 'resourceType') { - let _options = ['label', 'field', 'initval', 'type', 'match', 'resourceType', 'display'] + let _options = ['label', 'field', 'initval', 'type', 'match', 'resourceType', 'display', 'ratio'] if (value === '0') { _options = [..._options, 'options', 'quick'] @@ -267,6 +267,27 @@ </Form.Item> </Col> ) + } else if (item.type === 'number') { + fields.push( + <Col span={12} key={index}> + <Form.Item label={item.tooltip ? + <Tooltip placement="topLeft" title={item.tooltip}> + <Icon type="question-circle" /> + {item.label} + </Tooltip> : item.label + }> + {getFieldDecorator(item.key, { + initialValue: item.initVal || 6, + rules: [ + { + required: item.required, + message: this.props.dict['form.required.input'] + item.label + '!' + } + ] + })(<InputNumber min={item.min} max={item.max} precision={0} />)} + </Form.Item> + </Col> + ) } else if (item.type === 'select') { // 涓嬫媺鎼滅储 fields.push( <Col span={12} key={index}> -- Gitblit v1.8.0