king
2021-01-07 0da0262bc236cfce928429fc4c48e1666eab3402
src/menu/components/group/normal-group/index.jsx
@@ -80,17 +80,22 @@
    MKEmitter.removeListener('submitComponentStyle', this.updateComponentStyle)
  }
  updateComponentStyle = (item) => {
  updateComponentStyle = (parentId, keys, style) => {
    const { group } = this.state
    if (group.uuid !== item.uuid) return
    if (group.uuid !== parentId) return
    let components = group.components.map(item => {
      if (keys.includes(item.uuid)) {
        item.style = {...item.style, ...style}
      }
      return item
    })
    this.setState({
      group: {...group, components: []}
    }, () => {
      this.setState({
        group: {...group, components: item.components}
      })
      this.updateComponent({...group, components: components})
    })
  }
@@ -125,8 +130,8 @@
  updateComponent = (component) => {
    const { group } = this.state
    if (!is(fromJS(group.setting), fromJS(component.setting))) {
      // 注册事件-标签变化,通知标签内元素
    if (!is(fromJS(group.setting), fromJS(component.setting)) || !is(fromJS(group.style), fromJS(component.style))) {
      // 注册事件-标签变化,通知组内元素
      MKEmitter.emit('tabsChange', group.uuid)
    }
@@ -149,7 +154,7 @@
  }
  clickComponent = (e) => {
    if (sessionStorage.getItem('style-control') === 'true') {
    if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') {
      e.stopPropagation()
      MKEmitter.emit('clickComponent', this.state.group)
    }