From 8d66ff34fae5b048a6b7923cc75d34f13a08be9d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 02 八月 2022 11:42:43 +0800
Subject: [PATCH] Merge branch 'develop'

---
 src/templates/calendarconfig/index.jsx |   31 ++++++++++++++++++-------------
 1 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/src/templates/calendarconfig/index.jsx b/src/templates/calendarconfig/index.jsx
index 8f8f352..fdceaff 100644
--- a/src/templates/calendarconfig/index.jsx
+++ b/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

--
Gitblit v1.8.0