king
2021-06-26 bfadd84fbc2b23c59695e5a94778ab7ac40fea03
src/templates/modalconfig/settingform/index.jsx
@@ -14,6 +14,7 @@
  state = {
    fields: null,
    display: this.props.config.setting.display,
    appType: sessionStorage.getItem('appType')
  }
@@ -56,7 +57,7 @@
  render() {
    const { config, dict } = this.props
    const { fields, appType } = this.state
    const { fields, appType, display } = this.state
    const { getFieldDecorator } = this.props.form
    const formItemLayout = {
@@ -87,7 +88,7 @@
            </Form.Item>
          </Col>
          <Col span={12}>
            <Form.Item label="宽度">
            <Form.Item label="宽度(%)">
              {getFieldDecorator('width', {
                initialValue: config.setting.width
              })(<InputNumber min={10} max={90} precision={0} />)}
@@ -150,7 +151,20 @@
              )}
            </Form.Item>
          </Col>
          {!this.props.isSubTab && appType !== 'pc' ? <Col span={12}>
          <Col span={12}>
            <Form.Item label="显示方式">
              {getFieldDecorator('display', {
                initialValue: config.setting.display || 'modal'
              })(
                <Radio.Group style={{whiteSpace: 'nowrap'}} onChange={(e) => this.setState({display: e.target.value})}>
                  <Radio value="modal">模态框</Radio>
                  <Radio value="prompt">是否框</Radio>
                  <Radio value="drawer">抽屉</Radio>
                </Radio.Group>
              )}
            </Form.Item>
          </Col>
          {!this.props.isSubTab && appType !== 'pc' && display === 'modal' ? <Col span={12}>
            <Form.Item label="挂载对象">
              {getFieldDecorator('container', {
                initialValue: config.setting.container || 'tab'
@@ -162,18 +176,20 @@
              )}
            </Form.Item>
          </Col> : null}
          <Col span={12}>
            <Form.Item label="显示方式">
              {getFieldDecorator('display', {
                initialValue: config.setting.display || 'modal'
          {display === 'drawer' ? <Col span={12}>
            <Form.Item label="抽屉方向">
              {getFieldDecorator('placement', {
                initialValue: config.setting.placement || 'right'
              })(
                <Radio.Group>
                  <Radio value="modal">模态框</Radio>
                  <Radio value="prompt">是否框</Radio>
                <Radio.Group style={{whiteSpace: 'nowrap'}}>
                  <Radio value="right">右侧</Radio>
                  <Radio value="left">左侧</Radio>
                  <Radio value="top">上侧</Radio>
                  <Radio value="bottom">下侧</Radio>
                </Radio.Group>
              )}
            </Form.Item>
          </Col>
          </Col> : null}
        </Row>
      </Form>
    )