From 3ca91a731665962918a026f521c556f4745ebf35 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 16 十一月 2020 19:20:19 +0800 Subject: [PATCH] 2020-11-16 --- src/views/menudesign/menuform/index.jsx | 78 ++++++++++++++++++++++++++++++++++++++- 1 files changed, 76 insertions(+), 2 deletions(-) diff --git a/src/views/menudesign/menuform/index.jsx b/src/views/menudesign/menuform/index.jsx index 8c4594c..a52cd68 100644 --- a/src/views/menudesign/menuform/index.jsx +++ b/src/views/menudesign/menuform/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { fromJS } from 'immutable' -import { Form, Row, Col, Input, Select, notification } from 'antd' +import { Form, Row, Col, Input, Select, notification, Radio, Icon, Tooltip, InputNumber } from 'antd' import Api from '@/api' import './index.scss' @@ -108,6 +108,12 @@ }) } else if (key === 'parentId') { this.props.updateConfig({...config, parentId: value}) + } else if (key === 'cacheUseful') { + this.props.updateConfig({...config, cacheUseful: value}) + } else if (key === 'diffUser') { + this.props.updateConfig({...config, diffUser: value}) + } else if (key === 'timeUnit') { + this.props.updateConfig({...config, timeUnit: value}) } } @@ -126,6 +132,13 @@ this.props.updateConfig({...this.props.config, easyCode: e.target.value}) } + changeCacheDay = (val) => { + if (typeof(val) !== 'number') { + val = '' + } + this.props.updateConfig({...this.props.config, cacheTime: val}) + } + render() { const { dict, MenuName, MenuNo, config } = this.props const { menulist, smenulist } = this.state @@ -142,7 +155,7 @@ } return ( - <Form {...formItemLayout} className="ant-advanced-search-form"> + <Form {...formItemLayout} className="custom-menu-form"> <Row> <Col span={24}> <Form.Item label={dict['mob.menu.first'] + dict['mob.menu']}> @@ -213,6 +226,67 @@ </Form.Item> </Col> <Col span={24}> + <Form.Item label={ + <Tooltip placement="topLeft" title="瀵逛簬涓嶇粡甯告�у彉鍔ㄧ殑淇℃伅锛岀紦瀛樻暟鎹湁鍔╀簬鎻愰珮鏌ヨ鏁堢巼銆�"> + <Icon type="question-circle" /> + 缂撳瓨鏁版嵁 + </Tooltip> + }> + {getFieldDecorator('cacheUseful', { + initialValue: config.cacheUseful || 'false' + })( + <Radio.Group onChange={(e) => {this.selectChange('cacheUseful', e.target.value)}}> + <Radio value="true">浣跨敤</Radio> + <Radio value="false">涓嶄娇鐢�</Radio> + </Radio.Group> + )} + </Form.Item> + </Col> + {config.cacheUseful === 'true' ? <Col span={24}> + <Form.Item label={ + <Tooltip placement="topLeft" title="瀵逛簬涓嶅悓鐢ㄦ埛锛屾煡璇俊鎭槸鍚﹀瓨鍦ㄥ樊寮傘��"> + <Icon type="question-circle" /> + 鍖哄垎鐢ㄦ埛 + </Tooltip> + }> + {getFieldDecorator('diffUser', { + initialValue: config.diffUser || 'true' + })( + <Radio.Group onChange={(e) => {this.selectChange('diffUser', e.target.value)}}> + <Radio value="true">鏄�</Radio> + <Radio value="false">鍚�</Radio> + </Radio.Group> + )} + </Form.Item> + </Col> : null} + {config.cacheUseful === 'true' ? <Col span={24}> + <Form.Item label="鍗曚綅"> + {getFieldDecorator('timeUnit', { + initialValue: config.timeUnit || 'day' + })( + <Radio.Group onChange={(e) => {this.selectChange('timeUnit', e.target.value)}}> + <Radio value="day">澶�</Radio> + <Radio value="hour">灏忔椂</Radio> + </Radio.Group> + )} + </Form.Item> + </Col> : null} + {config.cacheUseful === 'true' ? <Col span={24}> + <Form.Item label="鏃堕暱"> + {getFieldDecorator('cacheTime', { + initialValue: config.cacheTime, + rules: [ + { + required: true, + message: dict['mob.required.input'] + '鏃堕暱!' + } + ] + })( + <InputNumber min={1} max={config.timeUnit !== 'hour' ? 7 : 23} precision={0} onChange={this.changeCacheDay}/> + )} + </Form.Item> + </Col> : null} + <Col span={24}> <Form.Item label={dict['mob.menu.easycode']}> {getFieldDecorator('easyCode', { initialValue: config.easyCode -- Gitblit v1.8.0