Commit d85fb029 by Tang

feat: 条码查询页面

parent 3eceb338
...@@ -65,12 +65,12 @@ export default { ...@@ -65,12 +65,12 @@ export default {
return (<div class="gs-dropdown-rect"> return (<div class="gs-dropdown-rect">
<div class="rect-title" <div class="rect-title"
vOn:click_stop_prevent={() => { vOn:click_stop_prevent={() => {
this.$emit('itemClick', {...nav}) this.$emit('itemClick', {...nav, root: {...this.nav}})
}} }}
> >
<span class="pointer">{nav.nameInHeaderNav ? nav.nameInHeaderNav : nav.name}</span> <span class="pointer">{nav.nameInHeaderNav ? nav.nameInHeaderNav : nav.name}</span>
</div> </div>
<div className="rect-body"> <div class="rect-body">
{children} {children}
</div> </div>
</div>) </div>)
...@@ -83,7 +83,7 @@ export default { ...@@ -83,7 +83,7 @@ export default {
{items.map(item => { {items.map(item => {
return (<div class="gs-dropdown-item"> return (<div class="gs-dropdown-item">
<span vOn:click_stop_prevent={() => { <span vOn:click_stop_prevent={() => {
this.$emit('itemClick', {...item}) this.$emit('itemClick', {...item, root: {...this.nav}})
}} }}
class="pointer gs-hover" class="pointer gs-hover"
>{item.name} >{item.name}
...@@ -150,7 +150,6 @@ export default { ...@@ -150,7 +150,6 @@ export default {
.rect-body { .rect-body {
display: flex; display: flex;
flex-direction: column;
} }
} }
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
aria-expanded="false">{{ nav.name }}</a> aria-expanded="false">{{ nav.name }}</a>
<!-- Dropdown Menu --> <!-- Dropdown Menu -->
<HeaderDropdown :nav="nav" @itemClick="handleItemClick"/> <HeaderDropdown v-if="nav.children.length>0" :nav="nav" @itemClick="handleItemClick"/>
<!-- End Dropdown Menu --> <!-- End Dropdown Menu -->
</li> </li>
<!-- Nav items End--> <!-- Nav items End-->
...@@ -62,19 +62,29 @@ export default { ...@@ -62,19 +62,29 @@ export default {
}, },
methods: { methods: {
handleNavClick(nav) { handleNavClick(nav) {
this.currentNav = nav.id; if (!!nav.children || nav.children.length === 0){
this.currentNav = nav.id;
}
}, },
handleItemClick(item){ handleItemClick(item) {
console.log(item); console.log(item);
if (item.link.startsWith('http')) {
window.open(item.link);
} else {
this.currentNav = item.root.id;
item.breadcrumb && this.$store.commit('system/SET_BREADCRUMB', item.breadcrumb)
this.$router.push({path: item.link})
}
}, },
}, },
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
.navbar{ .navbar {
background: #fff; background: #fff;
} }
.gs-header-nav { .gs-header-nav {
.navbar-nav-wrap { .navbar-nav-wrap {
...@@ -106,7 +116,6 @@ export default { ...@@ -106,7 +116,6 @@ export default {
} }
.navbar-toggler { .navbar-toggler {
padding: .5rem .5rem padding: .5rem .5rem
} }
......
...@@ -23,32 +23,57 @@ export const nav = [ ...@@ -23,32 +23,57 @@ export const nav = [
id: '3', id: '3',
name: '条码查询', name: '条码查询',
index: 3, index: 3,
link: '/code', link: '/search',
breadcrumb: [
{name: '服务中心', path: '/service'},
{name: '查询服务', path: '/search'},
{name: '条码信息查询'},
],
children: [ children: [
{ {
id: uuid('gs_nav'), id: uuid('gs_nav'),
name: '条码信息查询', name: '条码信息查询',
nameInHeaderNav: '条码查询', nameInHeaderNav: '条码查询',
index: 0, index: 0,
link: '/tool', link: '/search',
breadcrumb: [
{name: '服务中心', path: '/service'},
{name: '查询服务', path: '/search'},
{name: '条码信息查询'},
],
children: [ children: [
{ {
id: uuid('gs_nav'), id: uuid('gs_nav'),
name: '内条码信息查询', name: '内条码信息查询',
index: 0, index: 0,
link: '/tool/internal', link: '/search/internal',
breadcrumb: [
{name: '服务中心', path: '/service'},
{name: '查询服务', path: '/search'},
{name: '境内条码信息查询'},
],
}, },
{ {
id: uuid('gs_nav'), id: uuid('gs_nav'),
name: '外条码信息查询', name: '外条码信息查询',
index: 1, index: 1,
link: '/tool/external', link: '/search/external',
breadcrumb: [
{name: '服务中心', path: '/service'},
{name: '查询服务', path: '/search'},
{name: '境外条码信息查询'},
],
}, },
{ {
id: uuid('gs_nav'), id: uuid('gs_nav'),
name: '缩短码查询', name: '缩短码查询',
index: 2, index: 2,
link: '/tool/shortcode', link: '/search/shortcode',
breadcrumb: [
{name: '服务中心', path: '/service'},
{name: '查询服务', path: '/search'},
{name: '缩短码查询'},
],
}, },
{ {
id: uuid('gs_nav'), id: uuid('gs_nav'),
...@@ -62,33 +87,32 @@ export const nav = [ ...@@ -62,33 +87,32 @@ export const nav = [
id: uuid('gs_nav'), id: uuid('gs_nav'),
name: 'GLN查询', name: 'GLN查询',
index: 1, index: 1,
link: '/tool/gln', link: '/search/gln',
}, },
{ {
id: uuid('gs_nav'), id: uuid('gs_nav'),
name: '自行车企业代码公告查询', name: '自行车企业代码公告查询',
index: 2, index: 2,
link: '/tool/bike', link: '/search/bike',
}, },
{ {
id: uuid('gs_nav'), id: uuid('gs_nav'),
name: '条码术语查询', name: '条码术语查询',
index: 3, index: 3,
link: '/tool/glossary', link: '/search/glossary',
}, },
{ {
id: uuid('gs_nav'), id: uuid('gs_nav'),
name: '校验码计算工具', name: '校验码计算工具',
index: 4, index: 4,
link: '/tool/check', link: '/search/check',
}, },
{ {
id: uuid('gs_nav'), id: uuid('gs_nav'),
name: '国家及地区前缀码查询', name: '国家及地区前缀码查询',
index: 5, index: 5,
link: '/tool/country', link: '/search/country',
}, },
] ]
}, { }, {
id: '4', id: '4',
......
...@@ -82,6 +82,21 @@ const routes = [ ...@@ -82,6 +82,21 @@ const routes = [
] ]
}, },
{ {
// 查询中心
path: "/search",
name: "search",
component: main,
meta: {
name: "首页"
},
children: [
{
path: "/",
component: () => import("@/views/Search/index")
},
]
},
{
path: "/login", path: "/login",
name: "login", name: "login",
component: () => import("@/views/User/index"), component: () => import("@/views/User/index"),
......
<template> <template>
<div class="org container"> <div class="org container">
<breadcrumb :value="bread"/> <breadcrumb/>
<div class="row"> <div class="row">
<div class="col-lg-3"> <div class="col-lg-3">
<left2/> <left2/>
......
<template> <template>
<div class="container"> <div class="container">
<breadcrumb :value="bread"/> <breadcrumb/>
<div class="row"> <div class="row">
<div class="col-lg-3"> <div class="col-lg-3">
<left2/> <left2/>
...@@ -9,13 +9,22 @@ ...@@ -9,13 +9,22 @@
<router-view class="marginTopLg20"></router-view> <router-view class="marginTopLg20"></router-view>
</div> </div>
</div> </div>
<div class="marginTop20">
<zxcxgj/>
</div>
</div> </div>
</template> </template>
<script> <script>
import left2 from '../comps/left2.vue'
import breadcrumb from '../comps/breadcrumb.vue'
export default {
components:{
left2,
breadcrumb,
},
data() {
return {
}
},
}
</script> </script>
<style lang="scss"> <style lang="scss">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment