From f6626b05f1275cc2f8ca77f773d4f6a6af1b0a89 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 21 十一月 2022 16:11:55 +0800 Subject: [PATCH] 2022-11-21 --- src/templates/comtableconfig/index.jsx | 27 +++++++++++++++++---------- 1 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/templates/comtableconfig/index.jsx b/src/templates/comtableconfig/index.jsx index 6717638..09683e2 100644 --- a/src/templates/comtableconfig/index.jsx +++ b/src/templates/comtableconfig/index.jsx @@ -28,6 +28,7 @@ const Versions = asyncComponent(() => import('@/menu/versions')) const UrlFieldComponent = asyncComponent(() => import('@/menu/urlfieldcomponent')) const ReplaceField = asyncComponent(() => import('@/menu/replaceField')) +const UpdateTable = asyncComponent(() => import('./updatetable')) const Unattended = asyncComponent(() => import('@/templates/zshare/unattended')) const EditComponent = asyncComponent(() => import('@/templates/zshare/editcomponent')) const SettingComponent = asyncComponent(() => import('@/templates/sharecomponent/settingcomponent')) @@ -61,7 +62,6 @@ activeKey: '0', // 榛樿灞曞紑鍩烘湰淇℃伅 chartview: null, // 褰撳墠瑙嗗浘 openEdition: '', // 缂栬緫鐗堟湰鏍囪锛岄槻姝㈠浜烘搷浣� - modalStatus: false // 寮圭獥鏄惁寮�鍚紝鍒ゆ柇ctrl+s鏄惁鍙敤 } /** @@ -163,10 +163,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 @@ -179,8 +192,6 @@ return false } } - - MKEmitter.addListener('modalStatus', this.modalStatus) } /** @@ -191,11 +202,6 @@ return } document.onkeydown = () => {} - MKEmitter.removeListener('modalStatus', this.modalStatus) - } - - modalStatus = (val) => { - this.setState({modalStatus: val}) } /** @@ -1262,6 +1268,7 @@ <Versions MenuId={menu.MenuID} open_edition={openEdition} updateConfig={this.refreshConfig}/> <ReplaceField type="table" config={config} updateConfig={this.updateconfig}/> <EditComponent type="table" options={['search', 'form', 'action', 'columns']} config={this.state.config} MenuID={this.props.menu.MenuID} thawButtons={this.state.thawButtons} refresh={this.editConfig}/> + <UpdateTable config={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}>淇濆瓨</Button> <Button onClick={this.cancelConfig}>鍏抽棴</Button> -- Gitblit v1.8.0