king
2022-08-02 8d66ff34fae5b048a6b7923cc75d34f13a08be9d
src/templates/calendarconfig/index.jsx
@@ -1,6 +1,5 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import {connect} from 'react-redux'
import { is, fromJS } from 'immutable'
import { DndProvider } from 'react-dnd'
import HTML5Backend from 'react-dnd-html5-backend'
@@ -56,6 +55,7 @@
    activeKey: '0',          // 默认展开基本信息
    openEdition: '',         // 编辑版本标记,防止多人操作
    mockdata: [],            // 测试数据
    modalStatus: false       // 弹窗是否开启,判断ctrl+s是否可用
  }
  /**
@@ -129,6 +129,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-config')
        if (node && node.click) {
          node.click()
@@ -136,6 +145,7 @@
        return false
      }
    }
    MKEmitter.addListener('modalStatus', this.modalStatus)
  }
  getMockData = (year) => {
@@ -238,6 +248,11 @@
      return
    }
    document.onkeydown = () => {}
    MKEmitter.removeListener('modalStatus', this.modalStatus)
  }
  modalStatus = (val) => {
    this.setState({modalStatus: val})
  }
  // 页面返回
@@ -800,7 +815,7 @@
                <EditComponent dict={this.state.dict} type="table" options={['search', 'form']} config={this.state.config}/>
                <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={this.state.config.enabled} onChange={this.onEnabledChange} />
                <Button type="primary" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>{this.state.dict['model.save']}</Button>
                <Button onClick={this.cancelConfig}>{this.state.dict['model.back']}</Button>
                <Button onClick={this.cancelConfig}>关闭</Button>
              </div>
            } style={{ width: '100%' }}>
              <SettingComponent
@@ -844,14 +859,4 @@
  }
}
const mapStateToProps = (state) => {
  return {
    memberLevel: state.memberLevel
  }
}
const mapDispatchToProps = () => {
  return {}
}
export default connect(mapStateToProps, mapDispatchToProps)(SubTableConfig)
export default SubTableConfig