king
2022-05-19 15acad2194d616b37d85dd6192bc5656403f1a83
src/views/pcdesign/index.jsx
@@ -77,7 +77,8 @@
    settingshow: sessionStorage.getItem('settingshow') !== 'false',
    controlshow: sessionStorage.getItem('controlshow') !== 'false',
    comloading: false,
    eyeopen: false
    eyeopen: false,
    modalStatus: false       // 弹窗是否开启,判断ctrl+s是否可用
  }
  UNSAFE_componentWillMount() {
@@ -130,6 +131,7 @@
      return
    }
    MKEmitter.addListener('delButtons', this.delButtons)
    MKEmitter.addListener('modalStatus', this.modalStatus)
    MKEmitter.addListener('thawButtons', this.thawButtons)
    MKEmitter.addListener('copyButtons', this.copyButtons)
    MKEmitter.addListener('changePopview', this.initPopview)
@@ -163,6 +165,15 @@
      let _shortcut = `${preKey}+${keyCode}`
      if (_shortcut === 'ctrl+83') {
        if (this.state.modalStatus) {
          notification.warning({
            top: 92,
            message: '请保存' + this.state.modalStatus,
            duration: 5
          })
          return false
        }
        let node = document.getElementById('save-modal-config')
        if (!node) {
          node = document.getElementById('save-pop-config')
@@ -187,6 +198,7 @@
      return
    }
    MKEmitter.removeListener('delButtons', this.delButtons)
    MKEmitter.removeListener('modalStatus', this.modalStatus)
    MKEmitter.removeListener('thawButtons', this.thawButtons)
    MKEmitter.removeListener('copyButtons', this.copyButtons)
    MKEmitter.removeListener('changePopview', this.initPopview)
@@ -196,6 +208,10 @@
    MKEmitter.removeListener('updateCustomComponent', this.updateCustomComponent)
  }
  modalStatus = (val) => {
    this.setState({modalStatus: val})
  }
  triggerMenuSave = () => {
    if (this.state.visible) return