king
2021-07-20 6055fa01416fc57ee33b291a8103ccc1a8edce44
src/pc/bgcontroller/index.jsx
@@ -25,6 +25,7 @@
    backgroundImage: '',
    backgroundSize: '',
    backgroundRepeat: '',
    backgroundPositon: '',
    opacity: '',
  }
@@ -42,7 +43,8 @@
      backgroundColor: config.style.backgroundColor,
      backgroundImage: bgImg,
      backgroundSize: config.style.backgroundSize || '100%',
      backgroundRepeat: config.style.backgroundRepeat || 'repeat'
      backgroundRepeat: config.style.backgroundRepeat || 'repeat',
      backgroundPositon: config.style.backgroundPositon || 'center'
    })
  }
@@ -112,9 +114,20 @@
    this.props.updateConfig(config)
  }
  backgroundPositonChange = (val) => {
    this.setState({
      backgroundPositon: val
    })
    let config = fromJS(this.props.config).toJS()
    config.style.backgroundPositon = val
    this.props.updateConfig(config)
  }
  render () {
    const { config } = this.props
    const { backgroundColor, backgroundImage, backgroundSize, backgroundRepeat } = this.state
    const { backgroundColor, backgroundImage, backgroundSize, backgroundRepeat, backgroundPositon } = this.state
    const formItemLayout = {
      labelCol: {
        xs: { span: 24 },
@@ -158,6 +171,13 @@
              <Option value="repeat-y">repeat-y</Option>
            </Select>
          </Form.Item>
          <Form.Item colon={false} label="位置">
            <Select defaultValue={backgroundPositon} onChange={this.backgroundPositonChange}>
              <Option value="center">center</Option>
              <Option value="top">top</Option>
              <Option value="bottom">bottom</Option>
            </Select>
          </Form.Item>
          <p style={{borderBottom: '1px solid #eaeaea', color: '#40a9ff'}}>内边距</p>
          <Form.Item
            colon={false}