From 15acad2194d616b37d85dd6192bc5656403f1a83 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 19 五月 2022 17:19:40 +0800
Subject: [PATCH] 2022-05-19

---
 src/templates/treepageconfig/index.jsx |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/templates/treepageconfig/index.jsx b/src/templates/treepageconfig/index.jsx
index cb5a505..4828bde 100644
--- a/src/templates/treepageconfig/index.jsx
+++ b/src/templates/treepageconfig/index.jsx
@@ -13,8 +13,8 @@
 import zhCN from '@/locales/zh-CN/model.js'
 import enUS from '@/locales/en-US/model.js'
 
+import MKEmitter from '@/utils/events.js'
 import asyncComponent from '@/utils/asyncComponent'
-
 import MenuForm from '@/templates/comtableconfig/menuform'
 import SourceElement from '@/templates/zshare/dragsource'
 import Source from './source'
@@ -46,7 +46,8 @@
     delTabs: [],             // 鍒犻櫎鏍囩鍒楄〃
     tabviews: [],            // 鎵�鏈夋爣绛鹃〉
     activeKey: '0',          // 榛樿灞曞紑鍩烘湰淇℃伅
-    openEdition: ''          // 缂栬緫鐗堟湰鏍囪锛岄槻姝㈠浜烘搷浣�
+    openEdition: '',         // 缂栬緫鐗堟湰鏍囪锛岄槻姝㈠浜烘搷浣�
+    modalStatus: false       // 寮圭獥鏄惁寮�鍚紝鍒ゆ柇ctrl+s鏄惁鍙敤
   }
 
   /**
@@ -130,6 +131,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()
@@ -137,6 +147,7 @@
         return false
       }
     }
+    MKEmitter.addListener('modalStatus', this.modalStatus)
   }
 
   /**
@@ -147,6 +158,11 @@
       return
     }
     document.onkeydown = () => {}
+    MKEmitter.removeListener('modalStatus', this.modalStatus)
+  }
+
+  modalStatus = (val) => {
+    this.setState({modalStatus: val})
   }
 
   /**

--
Gitblit v1.8.0