|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="navbar-menu">
|
|
|
- <div class="nbm-wraper" :class="{'nbmw-open':menuOpen}">
|
|
|
+ <div class="nbm-wraper" ref="nbm-wraper" :class="{'nbmw-open':menuOpen}">
|
|
|
<div class="nbm-item" :class="{'on':item.on}" v-for="(item,index) in menuList" :key="index" @click="gotoPage(item)">
|
|
|
<i class="smp-nav-icon" :class="[item.icon,{'on':item.on}]"></i>
|
|
|
<span>{{item.name}}</span>
|
|
@@ -23,77 +23,66 @@
|
|
|
export default {
|
|
|
data () {
|
|
|
return {
|
|
|
+ lineWrapIndex: '',
|
|
|
menuOpen: false,
|
|
|
menuList: [
|
|
|
{
|
|
|
name: '首页',
|
|
|
- url: '/monitorwarn-index',
|
|
|
+ url: '/home',
|
|
|
on: false,
|
|
|
icon: 'smp-ni-nav_sy_n'
|
|
|
},
|
|
|
{
|
|
|
- name: '列表页',
|
|
|
- url: '/monitorwarn/clue-list',
|
|
|
- on: false,
|
|
|
- icon: 'smp-ni-nav_fxyp_n'
|
|
|
- },
|
|
|
- {
|
|
|
- name: '表单页',
|
|
|
- url: '/modules/all-form-type',
|
|
|
- on: false,
|
|
|
- icon: 'smp-ni-nav_fzsgzt_n'
|
|
|
- },
|
|
|
- {
|
|
|
name: '监测预警',
|
|
|
- url: '/monitorwarn-index',
|
|
|
+ url: '/home',
|
|
|
on: false,
|
|
|
icon: 'smp-ni-nav_jcyj_n'
|
|
|
},
|
|
|
{
|
|
|
name: '分析研判',
|
|
|
- url: '/monitorwarn-index',
|
|
|
+ url: '/home',
|
|
|
on: false,
|
|
|
icon: 'smp-ni-nav_fxyp_n'
|
|
|
},
|
|
|
{
|
|
|
name: '指挥调度',
|
|
|
- url: '/monitorwarn-index',
|
|
|
+ url: '/home',
|
|
|
on: false,
|
|
|
icon: 'smp-ni-nav_zhdd_n'
|
|
|
},
|
|
|
{
|
|
|
name: '效能评估',
|
|
|
- url: '/monitorwarn-index',
|
|
|
+ url: '/home',
|
|
|
on: false,
|
|
|
icon: 'smp-ni-nav_xnpg_n'
|
|
|
},
|
|
|
{
|
|
|
name: '基础数据',
|
|
|
- url: '/monitorwarn-index',
|
|
|
+ url: '/home',
|
|
|
on: false,
|
|
|
icon: 'smp-ni-nav_jcsj_n'
|
|
|
},
|
|
|
{
|
|
|
name: '基础组件',
|
|
|
- url: '/monitorwarn-index',
|
|
|
+ url: '/home',
|
|
|
on: false,
|
|
|
icon: 'smp-ni-nav_jczj_n'
|
|
|
},
|
|
|
{
|
|
|
name: '反走私工作台',
|
|
|
- url: '/monitorwarn-index',
|
|
|
+ url: '/home',
|
|
|
on: false,
|
|
|
icon: 'smp-ni-nav_fzsgzt_n'
|
|
|
},
|
|
|
{
|
|
|
name: '系统管理',
|
|
|
- url: '/monitorwarn-index',
|
|
|
+ url: '/home',
|
|
|
on: false,
|
|
|
icon: 'smp-ni-nav_xtgl_n'
|
|
|
},
|
|
|
{
|
|
|
name: '智能运维',
|
|
|
- url: '/monitorwarn-index',
|
|
|
+ url: '/home',
|
|
|
on: false,
|
|
|
icon: 'smp-ni-nav_znyw_n'
|
|
|
}
|
|
@@ -105,19 +94,30 @@ export default {
|
|
|
this.menuOpen = !this.menuOpen
|
|
|
},
|
|
|
gotoPage (item) {
|
|
|
- let spliceItem = ''
|
|
|
+ this.upMenuItem(item)
|
|
|
this.menuList.forEach((e, i) => {
|
|
|
e.on = false
|
|
|
- if (i === 0 || i === 1) {
|
|
|
+ })
|
|
|
+ item.on = true
|
|
|
+ this.$router.push({ path: item.url })
|
|
|
+ },
|
|
|
+ upMenuItem (item) {
|
|
|
+ let wraper = this.$refs['nbm-wraper']
|
|
|
+ let wraperW = wraper.getBoundingClientRect().width
|
|
|
+ let itemW = 120
|
|
|
+ this.lineWrapIndex = Math.floor(wraperW / itemW) - 1
|
|
|
+ let spliceItemIndex = ''
|
|
|
+ this.menuList.forEach((e, i) => {
|
|
|
+ if (i <= this.lineWrapIndex) {
|
|
|
return
|
|
|
}
|
|
|
if (e.name === item.name) {
|
|
|
- spliceItem = this.menuList.splice(i, 1)[0]
|
|
|
- this.menuList.splice(1, 0, spliceItem)
|
|
|
+ spliceItemIndex = i
|
|
|
}
|
|
|
})
|
|
|
- item.on = true
|
|
|
- this.$router.push({ path: item.url })
|
|
|
+ if (spliceItemIndex !== '') {
|
|
|
+ this.menuList[spliceItemIndex] = this.menuList.splice(this.lineWrapIndex, 1, item)[0]
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|