From ac1b621667ef7c7fc9049a62e8f7d14e625366ec Mon Sep 17 00:00:00 2001
From: ClariS <1457715339@qq.com>
Date: Thu, 10 Aug 2023 14:48:22 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E8=8F=9C=E5=8D=95?=
=?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD=20(#96)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/SearchMenu/SearchFooter.vue | 59 ++++++
src/components/SearchMenu/SearchModal.vue | 168 ++++++++++++++++++
src/components/SearchMenu/SearchResult.vue | 119 +++++++++++++
src/components/SearchMenu/index.vue | 29 +++
src/config/layouts.ts | 3 +
src/icons/svg/keyboard-down.svg | 1 +
src/icons/svg/keyboard-enter.svg | 1 +
src/icons/svg/keyboard-esc.svg | 1 +
src/icons/svg/keyboard-up.svg | 1 +
src/icons/svg/search.svg | 1 +
.../components/NavigationBar/index.vue | 6 +-
src/layouts/components/Settings/index.vue | 2 +
12 files changed, 389 insertions(+), 2 deletions(-)
create mode 100644 src/components/SearchMenu/SearchFooter.vue
create mode 100644 src/components/SearchMenu/SearchModal.vue
create mode 100644 src/components/SearchMenu/SearchResult.vue
create mode 100644 src/components/SearchMenu/index.vue
create mode 100644 src/icons/svg/keyboard-down.svg
create mode 100644 src/icons/svg/keyboard-enter.svg
create mode 100644 src/icons/svg/keyboard-esc.svg
create mode 100644 src/icons/svg/keyboard-up.svg
create mode 100644 src/icons/svg/search.svg
diff --git a/src/components/SearchMenu/SearchFooter.vue b/src/components/SearchMenu/SearchFooter.vue
new file mode 100644
index 0000000..80031de
--- /dev/null
+++ b/src/components/SearchMenu/SearchFooter.vue
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
diff --git a/src/components/SearchMenu/SearchModal.vue b/src/components/SearchMenu/SearchModal.vue
new file mode 100644
index 0000000..562762a
--- /dev/null
+++ b/src/components/SearchMenu/SearchModal.vue
@@ -0,0 +1,168 @@
+
+
+
+
+
+
+
+
+
+
+
+ 搜索结果
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/SearchMenu/SearchResult.vue b/src/components/SearchMenu/SearchResult.vue
new file mode 100644
index 0000000..aa4cea6
--- /dev/null
+++ b/src/components/SearchMenu/SearchResult.vue
@@ -0,0 +1,119 @@
+
+
+
+
+
+
+
+
+
+ {{ item.meta?.title }}
+
+
+
+
+
+
+
diff --git a/src/components/SearchMenu/index.vue b/src/components/SearchMenu/index.vue
new file mode 100644
index 0000000..b9c4ee4
--- /dev/null
+++ b/src/components/SearchMenu/index.vue
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/config/layouts.ts b/src/config/layouts.ts
index ac5ab6e..8d95cdf 100644
--- a/src/config/layouts.ts
+++ b/src/config/layouts.ts
@@ -18,6 +18,8 @@ export interface LayoutSettings {
showThemeSwitch: boolean
/** 是否显示全屏按钮 */
showScreenfull: boolean
+ /** 是否显示搜索按钮 */
+ showSearchMenu: boolean
/** 是否缓存标签栏 */
cacheTagsView: boolean
/** 是否显示灰色模式 */
@@ -35,6 +37,7 @@ export const layoutSettings: LayoutSettings = getConfigLayout() ?? {
showNotify: true,
showThemeSwitch: true,
showScreenfull: true,
+ showSearchMenu: true,
cacheTagsView: false,
showGreyMode: false,
showColorWeakness: false
diff --git a/src/icons/svg/keyboard-down.svg b/src/icons/svg/keyboard-down.svg
new file mode 100644
index 0000000..de62543
--- /dev/null
+++ b/src/icons/svg/keyboard-down.svg
@@ -0,0 +1 @@
+
diff --git a/src/icons/svg/keyboard-enter.svg b/src/icons/svg/keyboard-enter.svg
new file mode 100644
index 0000000..819b87e
--- /dev/null
+++ b/src/icons/svg/keyboard-enter.svg
@@ -0,0 +1 @@
+
diff --git a/src/icons/svg/keyboard-esc.svg b/src/icons/svg/keyboard-esc.svg
new file mode 100644
index 0000000..33256bf
--- /dev/null
+++ b/src/icons/svg/keyboard-esc.svg
@@ -0,0 +1 @@
+
diff --git a/src/icons/svg/keyboard-up.svg b/src/icons/svg/keyboard-up.svg
new file mode 100644
index 0000000..e84519a
--- /dev/null
+++ b/src/icons/svg/keyboard-up.svg
@@ -0,0 +1 @@
+
diff --git a/src/icons/svg/search.svg b/src/icons/svg/search.svg
new file mode 100644
index 0000000..691a5f1
--- /dev/null
+++ b/src/icons/svg/search.svg
@@ -0,0 +1 @@
+
diff --git a/src/layouts/components/NavigationBar/index.vue b/src/layouts/components/NavigationBar/index.vue
index e5d96cf..024b26c 100644
--- a/src/layouts/components/NavigationBar/index.vue
+++ b/src/layouts/components/NavigationBar/index.vue
@@ -9,9 +9,10 @@ import { UserFilled } from "@element-plus/icons-vue"
import Hamburger from "../Hamburger/index.vue"
import Breadcrumb from "../Breadcrumb/index.vue"
import Sidebar from "../Sidebar/index.vue"
+import Notify from "@/components/Notify/index.vue"
import ThemeSwitch from "@/components/ThemeSwitch/index.vue"
import Screenfull from "@/components/Screenfull/index.vue"
-import Notify from "@/components/Notify/index.vue"
+import SearchMenu from "@/components/SearchMenu/index.vue"
import { DeviceEnum } from "@/constants/app-key"
const router = useRouter()
@@ -20,7 +21,7 @@ const settingsStore = useSettingsStore()
const userStore = useUserStore()
const { sidebar, device } = storeToRefs(appStore)
-const { layoutMode, showNotify, showThemeSwitch, showScreenfull } = storeToRefs(settingsStore)
+const { layoutMode, showNotify, showThemeSwitch, showScreenfull, showSearchMenu } = storeToRefs(settingsStore)
const isTop = computed(() => layoutMode.value === "top")
const isMobile = computed(() => device.value === DeviceEnum.Mobile)
@@ -43,6 +44,7 @@ const logout = () => {