| | |
| | | this.props.updateConfig({...config, fstMenuId: value, parentId: _id}) |
| | | }) |
| | | } else { |
| | | if (key === 'cacheTime' || key === 'minWidth') { |
| | | if (key === 'cacheTime' || key === 'minWidth' || key === 'localCacheTime') { |
| | | if (typeof(value) !== 'number') { |
| | | value = '' |
| | | } |
| | |
| | | <Form.Item label="打开方式"> |
| | | {getFieldDecorator('OpenType', { |
| | | initialValue: config.OpenType || 'newtab', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请选择打开方式!' |
| | | } |
| | | ] |
| | | rules: [{ required: true, message: '请选择打开方式!' }] |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.selectChange('OpenType', e.target.value)}}> |
| | | <Radio value="newtab">标签页</Radio> |
| | | <Radio value="newpage">新页面</Radio> |
| | | </Radio.Group> |
| | | <Select onChange={(value) => {this.selectChange('OpenType', value)}}> |
| | | <Select.Option value="newtab">标签页</Select.Option> |
| | | <Select.Option value="newpage">新页面(标签页)</Select.Option> |
| | | <Select.Option value="view">新页面(全屏)</Select.Option> |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {config.cacheLocal === 'true' ? <Col span={24}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="设置本地缓存时长后,在缓存期限内不向后台请求数据,时长最大为5天(即7200分钟)。注:时长为空时缓存数据只用于页面快速呈现,不影响接口请求。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 时长(分) |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('localCacheTime', { |
| | | initialValue: config.localCacheTime |
| | | })( |
| | | <InputNumber min={1} max={7200} precision={0} onChange={(val) => {this.selectChange('localCacheTime', val)}}/> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={24}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="对于不经常性变动的信息,缓存数据有助于提高查询效率。"> |
| | |
| | | {getFieldDecorator('timeUnit', { |
| | | initialValue: config.timeUnit || 'day' |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.selectChange('timeUnit', e.target.value)}}> |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}} onChange={(e) => {this.selectChange('timeUnit', e.target.value)}}> |
| | | <Radio value="day">天</Radio> |
| | | <Radio value="hour">小时</Radio> |
| | | <Radio value="minute">分钟</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <InputNumber min={1} max={config.timeUnit !== 'hour' ? 7 : 23} precision={0} onChange={(val) => {this.selectChange('cacheTime', val)}}/> |
| | | <InputNumber min={1} max={config.timeUnit === 'day' ? 7 : (config.timeUnit === 'hour' ? 23 : 59)} precision={0} onChange={(val) => {this.selectChange('cacheTime', val)}}/> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |