king
2021-10-21 1da6506bf58270bacc2a4345002c6b082835580e
src/views/mobdesign/menuform/index.jsx
@@ -2,7 +2,11 @@
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 { TextArea } = Input
const SourceComponent = asyncComponent(() => import('@/menu/components/share/sourcecomponent'))
class CustomMenuForm extends Component {
  static propTpyes = {
@@ -22,6 +26,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})
    }
  }
@@ -33,6 +41,10 @@
  // 菜单参数
  changeNo = (e) => {
    this.props.updateConfig({...this.props.config, MenuNo: e.target.value})
  }
  changeRemark = (e) => {
    this.props.updateConfig({...this.props.config, Remark: e.target.value})
  }
  changeCacheDay = (val) => {
@@ -102,6 +114,40 @@
              )}
            </Form.Item>
          </Col>
          <Col span={24}>
            <Form.Item label={
              <Tooltip placement="topLeft" title="跳过权限验证时,页面中组件及按钮不在进行权限控制。">
                <Icon type="question-circle" />
                权限验证
              </Tooltip>
            }>
              {getFieldDecorator('permission', {
                initialValue: config.permission || 'true'
              })(
                <Radio.Group onChange={(e) => {this.selectChange('permission', e.target.value)}}>
                  <Radio value="true">使用</Radio>
                  <Radio value="false">不使用</Radio>
                </Radio.Group>
              )}
            </Form.Item>
          </Col>
          <Col span={24}>
            <Form.Item label={
              <Tooltip placement="topLeft" title="使用登录验证后,用户必须登录系统后才可以访问,注:含有登录组件的页面中无效。">
                <Icon type="question-circle" />
                登录验证
              </Tooltip>
            }>
              {getFieldDecorator('logincheck', {
                initialValue: config.logincheck || 'false'
              })(
                <Radio.Group onChange={(e) => {this.selectChange('logincheck', 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="单位">
              {getFieldDecorator('timeUnit', {
@@ -129,6 +175,48 @@
              )}
            </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}
          <Col span={24}>
            <Form.Item label="备注">
              {getFieldDecorator('Remark', {
                initialValue: config.Remark || '',
                rules: [
                  {
                    max: 512,
                    message: '备注最多512个字符!'
                  }
                ]
              })(<TextArea rows={2} placeholder={''} onChange={this.changeRemark} />)}
            </Form.Item>
          </Col>
        </Row>
      </Form>
    )