king
2023-02-24 5d8eb51419d2c1b7dc88dd0cbde5c8341cceda2f
src/menu/stylecontroller/index.jsx
@@ -167,12 +167,16 @@
    this.callback = null
  }
  updateStyle = (style) => {
  updateStyle = (style, prop) => {
    const { card } = this.state
    let _style = {
      ...card,
      ...style
    }
    if (prop && !_style[prop]) {
      delete _style[prop]
    }
    this.setState({
@@ -278,7 +282,7 @@
   * @description 修改背景颜色 ,颜色控件
   */
  changeBackgroundColor = (val) => {
    this.updateStyle({backgroundColor: val})
    this.updateStyle({backgroundColor: val}, 'backgroundColor')
  }
  changeBackground = (val) => {
@@ -438,29 +442,11 @@
  }
  changeWidth = (val) => {
    const { card } = this.state
    let _style = {...card}
    if (val === '0px') {
      delete _style.width
    } else {
      _style.width = val
    }
    this.setState({
      card: _style
    })
    this.callback && this.callback(_style)
    this.updateStyle({width: val === '0px' ? '' : val}, 'width')
  }
  changeHeight = (val) => {
    let _val = val
    if (_val === '0px') {
      _val = 'auto'
    }
    this.updateStyle({height: _val})
    this.updateStyle({height: val === '0px' ? '' : val}, 'height')
  }
  changeNormalStyle = (val, type) => {
@@ -633,7 +619,7 @@
                    label={<BgColorsOutlined title="背景颜色"/>}
                    labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} }
                  >
                    <ColorSketch value={card.backgroundColor || '#ffffff'} onChange={this.changeBackgroundColor} />
                    <ColorSketch allowClear={true} value={card.backgroundColor || ''} onChange={this.changeBackgroundColor} />
                  </Form.Item>
                  <Form.Item
                    colon={false}