From 5891206952e2ff63e87aed2f47df5324b019d32e Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 25 十月 2022 00:39:38 +0800 Subject: [PATCH] 2022-10-25 --- src/templates/calendarconfig/index.jsx | 24 +++++++++++++++--------- 1 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/templates/calendarconfig/index.jsx b/src/templates/calendarconfig/index.jsx index 72e72cb..2284223 100644 --- a/src/templates/calendarconfig/index.jsx +++ b/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}) } // 椤甸潰杩斿洖 -- Gitblit v1.8.0