king
2022-11-21 f6626b05f1275cc2f8ca77f773d4f6a6af1b0a89
src/templates/calendarconfig/index.jsx
@@ -52,7 +52,6 @@
    activeKey: '0',          // 默认展开基本信息
    openEdition: '',         // 编辑版本标记,防止多人操作
    mockdata: [],            // 测试数据
    modalStatus: false       // 弹窗是否开启,判断ctrl+s是否可用
  }
  /**
@@ -126,10 +125,23 @@
      let _shortcut = `${preKey}+${keyCode}`
      if (_shortcut === 'ctrl+83') {
        if (this.state.modalStatus) {
        let modals = document.querySelectorAll('.mk-pop-modal')
        let msg = null
        for (let i = 0; i < modals.length; i++) {
          if (msg) {
            break
          }
          let node = modals[i].querySelector('.mk-com-name')
          if (node) {
            msg = node.innerText
          }
        }
        if (msg) {
          notification.warning({
            top: 92,
            message: '请保存' + this.state.modalStatus,
            message: '请保存' + msg,
            duration: 5
          })
          return false
@@ -142,7 +154,6 @@
        return false
      }
    }
    MKEmitter.addListener('modalStatus', this.modalStatus)
  }
  getMockData = (year) => {
@@ -245,11 +256,6 @@
      return
    }
    document.onkeydown = () => {}
    MKEmitter.removeListener('modalStatus', this.modalStatus)
  }
  modalStatus = (val) => {
    this.setState({modalStatus: val})
  }
  // 页面返回