king
2023-06-14 08cce3334a2dc81d690b518136b0aaea64e48b0b
src/pc/components/login/normal-login/index.jsx
@@ -36,9 +36,6 @@
      let _card = {
        uuid: card.uuid,
        type: card.type,
        tabId: card.tabId || '',
        parentId: card.parentId || '',
        dataName: card.dataName || '',
        width: card.width || 24,
        name: card.name,
        subtype: card.subtype,
@@ -74,15 +71,16 @@
      if (_card.wrap.classify === 'signin') {
        active = 'signin'
      }
      if (!_card.style.minHeight && _card.wrap.height) {
        _card.style.minHeight = _card.wrap.height
        delete _card.wrap.height
      }
      this.setState({
        active,
        card: _card
      })
    }
  }
  componentDidMount () {
    MKEmitter.addListener('submitStyle', this.getStyle)
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -96,7 +94,6 @@
    this.setState = () => {
      return
    }
    MKEmitter.removeListener('submitStyle', this.getStyle)
  }
  /**
@@ -122,15 +119,11 @@
  changeStyle = () => {
    const { card } = this.state
    MKEmitter.emit('changeStyle', [card.uuid], ['width', 'background', 'border', 'padding', 'margin'], card.style)
    MKEmitter.emit('changeStyle', ['width', 'background', 'border', 'padding', 'margin', 'clear', 'minHeight'], card.style, this.getStyle)
  }
  getStyle = (comIds, style) => {
    const { card } = this.state
    if (comIds.length !== 1 || comIds[0] !== card.uuid) return
    let _card = {...card, style}
  getStyle = (style) => {
    let _card = {...this.state.card, style}
    
    this.updateComponent(_card)
  }
@@ -138,7 +131,13 @@
  clickComponent = (e) => {
    if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') {
      e.stopPropagation()
      MKEmitter.emit('clickComponent', this.state.card)
      MKEmitter.emit('clickComponent', this.state.card.uuid, null, (style) => {
        let _card = {...this.state.card}
        _card.style = {..._card.style, ...style}
        this.setState({ card: _card })
        this.props.updateConfig(_card)
      })
    }
  }
@@ -196,7 +195,14 @@
        {card.wrap.signWays && active === 'signin' ? <SignForm wrap={card.wrap} changeway={() => this.setState({active: 'login'})}/> : null}
        <div className="component-name">
          <div className="center">
            <div className="title">{card.name}</div>
            <div className="title" onDoubleClick={() => {
              let oInput = document.createElement('input')
              oInput.value = 'anchor' + card.uuid
              document.body.appendChild(oInput)
              oInput.select()
              document.execCommand('Copy')
              document.body.removeChild(oInput)
            }}>{card.name}</div>
            <div className="content">
              {card.errors && card.errors.map((err, index) => {
                if (err.level === 0) {