From cad24eb2a8b5496cc4e74248815fab235269d0ff Mon Sep 17 00:00:00 2001 From: xiaonuobase <1253070437@qq.com> Date: Sat, 9 Sep 2023 01:01:01 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=9B=B4=E6=96=B0=E3=80=91=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=89=8D=E7=AB=AF=E6=90=9C=E7=B4=A2=E7=BB=84=E6=BA=90?= =?UTF-8?q?=E7=A0=81=E5=8F=8A=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/layout/components/mixins/search.js | 58 --- .../layout/components/panel-search/index.vue | 448 ++++++++++-------- .../layout/components/panel-search/item.vue | 28 +- .../src/layout/components/updPassword.vue | 41 -- .../src/layout/components/userbar.vue | 229 ++++----- .../src/views/sys/user/userCenter.vue | 4 +- .../views/sys/user/userTab/accountBasic.vue | 7 +- 7 files changed, 367 insertions(+), 448 deletions(-) delete mode 100755 snowy-admin-web/src/layout/components/mixins/search.js delete mode 100644 snowy-admin-web/src/layout/components/updPassword.vue diff --git a/snowy-admin-web/src/layout/components/mixins/search.js b/snowy-admin-web/src/layout/components/mixins/search.js deleted file mode 100755 index f18fb956..00000000 --- a/snowy-admin-web/src/layout/components/mixins/search.js +++ /dev/null @@ -1,58 +0,0 @@ -import { mapState, mapActions } from 'pinia' -import hotkeys from 'hotkeys-js' -import { searchStore } from '@/store' - -export default { - mounted() { - // 绑定搜索功能快捷键 [ 打开 ] - hotkeys(this.searchHotkey.open, (event) => { - event.preventDefault() - this.searchPanelOpen() - }) - // 绑定搜索功能快捷键 [ 关闭 ] - hotkeys(this.searchHotkey.close, (event) => { - event.preventDefault() - this.searchPanelClose() - }) - }, - beforeDestroy() { - hotkeys.unbind(this.searchHotkey.open) - hotkeys.unbind(this.searchHotkey.close) - }, - computed: { - ...mapState(searchStore, { - searchActive: (state) => state.active, - searchHotkey: (state) => state.hotkey - }) - }, - methods: { - ...mapActions(searchStore, ['toggleActive', 'setActive']), - // 接收点击搜索按钮 - handleSearchClick() { - this.toggleActive() - if (this.searchActive) { - setTimeout(() => { - if (this.$refs.panelSearch) { - this.$refs.panelSearch.focus() - } - }, 300) - } - }, - searchPanelOpen() { - if (!this.searchActive) { - this.setActive(true) - setTimeout(() => { - if (this.$refs.panelSearch) { - this.$refs.panelSearch.focus() - } - }, 300) - } - }, - // 关闭搜索面板 - searchPanelClose() { - if (this.searchActive) { - this.setActive(false) - } - } - } -} diff --git a/snowy-admin-web/src/layout/components/panel-search/index.vue b/snowy-admin-web/src/layout/components/panel-search/index.vue index 9eb0eebb..aef2e6a2 100644 --- a/snowy-admin-web/src/layout/components/panel-search/index.vue +++ b/snowy-admin-web/src/layout/components/panel-search/index.vue @@ -1,210 +1,262 @@ -