king
2021-09-14 051eb785a36ec3b6cd3b4305fdb65f6940415e9b
src/views/mobdesign/menuform/index.jsx
@@ -2,7 +2,10 @@
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Radio, Icon, Tooltip, InputNumber } from 'antd'
import asyncComponent from '@/utils/asyncComponent'
import './index.scss'
const SourceComponent = asyncComponent(() => import('@/menu/components/share/sourcecomponent'))
class CustomMenuForm extends Component {
  static propTpyes = {
@@ -22,6 +25,10 @@
      this.props.updateConfig({...config, cacheUseful: value})
    } else if (key === 'timeUnit') {
      this.props.updateConfig({...config, timeUnit: value})
    } else if (key === 'advertUrl') {
      this.props.updateConfig({...config, advertUrl: value})
    } else if (key === 'advertTime') {
      this.props.updateConfig({...config, advertTime: value})
    }
  }
@@ -146,6 +153,35 @@
              )}
            </Form.Item>
          </Col> : null}
          <Col span={24}>
            <Form.Item label={
              <Tooltip placement="topLeft" title="在明科云APP中有效。">
                <Icon type="question-circle" />
                广告页
              </Tooltip>
            }>
              {getFieldDecorator('advertUrl', {
                initialValue: config.advertUrl || ''
              })(
                <SourceComponent type="picture" placement="right" onChange={(val) => {this.selectChange('advertUrl', val)}}/>
              )}
            </Form.Item>
          </Col>
          {config.advertUrl ? <Col span={24}>
            <Form.Item label="停留(s)">
              {getFieldDecorator('advertTime', {
                initialValue: config.advertTime || 3,
                rules: [
                  {
                    required: true,
                    message: dict['mob.required.input'] + '停留时间!'
                  }
                ]
              })(
                <InputNumber min={1} max={10} precision={0} onChange={(val) => {this.selectChange('advertTime', val)}}/>
              )}
            </Form.Item>
          </Col> : null}
        </Row>
      </Form>
    )