diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 93b3ccd..c715dbd 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -3,7 +3,14 @@ - +
+
+ +
+
+ 查询 +
+
@@ -48,6 +55,11 @@ 'avatar' ]) }, + data() { + return { + searchword: '' + } + }, methods: { toggleSideBar() { this.$store.dispatch('app/toggleSideBar') @@ -55,6 +67,15 @@ async logout() { await this.$store.dispatch('user/logout') this.$router.push(`/login?redirect=${this.$route.fullPath}`) + }, + goRecord() { + if (!this.searchword) { + this.$Message.warning("请输入关键词") + return + } else { + + this.$router.push('/record/index?searchTitle='+this.searchword) + } } } } @@ -85,6 +106,19 @@ float: left; } + .search-top { + float: left; + display: flex; + align-items: center; + height: 100%; + line-height: 50px; + margin-left: 20px; + + &>div { + margin-right: 10px; + } + } + .right-menu { float: right; height: 100%; diff --git a/src/router/index.js b/src/router/index.js index 5e39379..cf0b2f5 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -58,6 +58,19 @@ export const constantRoutes = [{ } }], hidden: true + }, + { + path: '/record/index', + component: Layout, + children: [{ + path: '/record/index', + component: () => import('@/views/record/index'), + name: '搜索', + meta: { + title: '搜索' + } + }], + hidden: true }, { @@ -72,7 +85,7 @@ export const constantRoutes = [{ title: '系统首页', icon: 'dashboard' } - }, ] + }] } ] diff --git a/src/views/record/index.vue b/src/views/record/index.vue index 121bbd3..fb2e8db 100644 --- a/src/views/record/index.vue +++ b/src/views/record/index.vue @@ -36,7 +36,7 @@