Files
foton-laws-system-front/src/components/navMenu/index.vue
T

792 lines
25 KiB
Vue

<!--左侧导航菜单 liuyan -->
<template>
<div class="nav-menu v-class" :class="{'is-collapse': isCollapse}">
<!-- <div class="nav-menu-header" style="height: 65px; background-color: #4788c0;">
<div class="header-left">
<div class="logo">
<img :src="logo" height="58" width="149" />
</div>
</div>
</div>-->
<!-- <div class="toggle-btn el-icon-s-fold" v-if="isCollapse === false" style="margin: 10px 0; display: flex;justify-content: center; font-size: 30px; color: #333333;" @click="handleToggleSideBar">-->
<!-- <div style="font-size: 14px; line-height: 30px;">{{ this.isCollapse ? '' : '' }}</div><i class=""></i></div>-->
<!-- <div class="toggle-btn el-icon-s-unfold" v-else style="margin: 10px 0; display: flex;justify-content: center; font-size: 30px; color: #333333;" @click="handleToggleSideBar">-->
<!-- <div style="font-size: 14px; line-height: 30px;">{{ this.isCollapse ? '' : '' }}</div></div>-->
<div class="left-tree">
<el-menu
unique-opened
:default-active="defaultActive"
background-color="#8fb0cc"
text-color="#fff"
active-text-color="#000"
router
:collapse="isCollapse"
@select="handleSelect"
>
<template v-for="(item, index) in navMenuList">
<el-submenu
:key="index"
:index="item.path"
popper-class="nav-menu-popper"
v-if="!item.isChildren && (!item.menuId || $hasPermission(item.menuId))"
>
<template slot="title">
<i class="shangqi-icon" :class="item['icon-class']"></i>
<span>{{ item.title }}</span>
<el-badge is-dot class="has-no-read" v-if="item.title === '个人中心' && getDynamicTotal.allCount">
</el-badge>
</template>
<el-menu-item
v-for="(children, childrenIndex) in item.children"
:key="childrenIndex"
:index="children.path"
style="text-align: center;"
v-if="!children.menuId || $hasPermission(children.menuId)"itemSplitInfo
>
<el-badge :value="getDynamicTotal.msgCount" class="item" v-if="children.title === '我的消息' && getDynamicTotal.msgCount !== 0">
{{ children.title }}
</el-badge>
<el-badge :value="getDynamicTotal.shareCount" class="item" v-else-if="children.title === '我的推送' && getDynamicTotal.shareCount !== 0">
{{ children.title }}
</el-badge>
<el-badge :value="getDynamicTotal.myStandCount" class="item" v-else-if="children.title === '我的企标' && getDynamicTotal.myStandCount !== 0">
{{ children.title }}
</el-badge>
<div v-else>
{{ children.title }}
</div>
</el-menu-item>
</el-submenu>
<el-menu-item
:key="index"
:index="item.path"
v-if="item.isChildren && (!item.menuId || $hasPermission(item.menuId))"
>
<i class="shangqi-icon" :class="item['icon-class']"></i>
<span slot="title">{{ item.title }}</span>
</el-menu-item>
</template>
</el-menu>
</div>
<div class="tree-collapse" @click="handleToggleSideBar" :class="{ 'tree-close': isCollapse }">
<!--切换折叠样式-->
<i class="el-icon-arrow-left" style="font-weight: 600; font-size: 16px;margin-top: 300px;" v-if="isCollapse === false"></i>
<i class="el-icon-arrow-right" style="font-weight: 600; font-size: 16px;margin-top: 300px;" v-if="isCollapse === true"></i>
</div>
</div>
</template>
<script>
import { mapGetters, mapMutations } from 'vuex'
export default {
name: 'NavMenu',
data () {
return {
defaultActive: null, // 当前激活菜单的 index
navMenuList: [
// {
// title: '首页',
// path: '/home1',
// isChildren: true, // 判断没有子菜单
// 'icon-class': 'home'
// },
{
title: '首页',
path: '/home2',
isChildren: true, // 判断没有子菜单
'icon-class': 'el-icon-s-home'
},
{
title: '标准法规库',
path: '/regulatoryRepository',
'icon-class': 'el-icon-s-management',
menuId: '2ewfwfa',
children: [
// {
// title: '动态&资料',
// path: '/dynamicInformation',
// menuId: 'RAFQ4N4ARF'
// },
{
title: '国内标准',
path: '/domesticStandardsAndRegulations',
menuId: '3e3657498664beaa0dc1de1ecb3ae0da'
},
{
title: '海外标准',
path: '/foreignStandardsAndRegulations',
menuId: '18c1e5134ea0cf865e8960b26b81fd8c'
},
{
title: '企业标准',
path: '/enterpriseStandardDatabase',
menuId: '01ed8f752748227777b3572d56ee9ab5'
},
{
title: '企标计划',
path: '/enterpriseStandardPlan',
menuId: 'b07296765085f06eb3c158147f3a7312'
},
{
title: '法规清单',
path: '/accessStandardsAndRegulations',
menuId: '08dbd417864b08426034ca56d1fa3d02'
},
{
title: '未符合项',
path: '/nonConfomity',
menuId: '0119abd677e0204e061eb0f0b8cafda0'
},
{
title: '工作组',
path: '/workingGroup',
menuId: 'b64240325f0e01ec4a318ee0cfedd82e'
},
{
title: '征求意见',
path: '/standardForComments',
menuId: '2b25c67f10abbbadf37d60daaaec54d3'
},
{
title: '合规评估', // 把 标准涉及项目 这几个字 改成 标准合规评估结果
path: '/standInvolveProject',
menuId: '8a9c87fe06244fb9d55e78fb281f625b'
},
{
title: '问答库', // 把 标准涉及项目 这几个字 改成 标准合规评估结果
path: '/standQA',
menuId: ''
},
// {
// title: '零部件编号申请',
// path: '/partCodeApply',
// menuId: 'ad9db496772c075f78495382b7581fe9'
// },
// {
// title: '工作组统计',
// path: '/dataStatisComments',
// menuId: ''
// },
// {
// title: '国内外政策',
// path: '/foreignRegulationsDatabase',
// menuId: 'ef02a3b0af9a4b3ede460456a9591ebc'
// },
// // // {
// // // title: '标准制修订管理',
// // // path: '/demo2One'
// // // },
// // {
// // title: '标准法规清单详情',
// // path: '/details'
// // }
// // // {
// // // title: '试验项目库',
// // // path: '/demo2One'
// // // },
// // // {
// // // title: '本地产品/项目库',
// // // path: '/localProductsOrProjectLibrary'
// // // },
// {
// title: '企标制修订计划',
// path: '/enterBSysRevPlanManaLib',
// menuId: 'WW7YDHQ9Z679TGMDZMUS'
// },
// // {
// // title: '子公司标准库',
// // path: '/subsidiaryStandardLibrary'
// // }
/* {
title: '车型/项目库',
path: '/localProductsOrProjectLibrary',
menuId: '42ce39c9f953be65a3e5643a4a2c786f'
},*/
// {
// title: '备案产品标准库',
// path: '/enterpriseStandardFiling',
// menuId: 'MQBAGJQMSRZDRX3X5AVR'
// },
// {
// title: '动态信息',
// path: '/information',
// menuId: 'ULUBXHYQB8M3XQ9HS9QG'
// }
]
},
// {
// title: '政策法规库',
// path: '/policyRegulation',
// 'icon-class': 'el-icon-s-management',
// menuId: 'asdzcfgk',
// children: [
// {
// title: '问题项管控',
// path: '/problemControl',
// menuId: '50d7a0c0af4740c486100c257ae6068e'
// },
// {
// title: '国内外政策',
// path: '/nationalPolicy',
// menuId: '6557e9c4ce672af71be5807052da126b'
// },
// {
// title: '标准跟踪清单',
// path: '/standardTrackingList',
// menuId: 'a26b92e156f68dbfe0d73b0dc068ebe4'
// },
// {
// title: '政策工作组',
// path: '/policyWorkGroup',
// menuId: 'f1a4b33a498e58a8a87c954ce5ce6ad6'
// }
// ]
// },
{
title: '工作中心',
path: '/processCenter',
'icon-class': 'el-icon-s-platform',
menuId: '3fadf',
isChildren: true // 判断没有子菜单
},
// {
// title: '我的工作',
// path: '/processCenter',
// 'icon-class': 'el-icon-s-platform',
// menuId: '3fadf',
// children: [
// {
// title: '流程中心',
// path: '/processCenter',
// menuId: '7455dc97eac2933341e18be659f07e89'
// },
// {
// title: '新建流程',
// path: '/createProcessNew',
// menuId: 'b53e6722b33a37c0fa2d87a9b06cca40'
// }
// ]
// },
{
title: '本地工具',
path: '/localTool',
'icon-class': 'el-icon-s-tools',
menuId: 'afsd12',
children: [
// {
// title: '标准预警',
// path: '/standardWarning'
// },
{
title: 'OCR识别',
path: '/standardRecognition',
menuId: '3db80f62af9d96d6dfc6d429eea4b29b'
},
{
title: '标准拆分',
path: '/standAutoSplit',
menuId: '0062e261bc65e27e0a968dac67e16a3c'
},
{
title: '标准比对',
path: '/standContrast',
menuId: '1d83a6278f781419f628e9f5560f5c86'
},
// {
// title: '标准化活动日历',
// path: '/standCalendar',
// menuId: '5e834b3fca90619e593ad0ee83263885'
// },
// {
// title: '标准比对库',
// path: '/standardComparisonLibrary',
// menuId: 'AH56UDHHBVF5V7WZFWJQ'
// }
// {
// title: '预警管理',
// path: '/warningManage'
// },
// {
// title: '动态&通知管理',
// path: '/dynamicInformationManage'
// },
// {
// title: '标准编号申领',
// path: '/applicationStandardNumber'
// },
]
},
{
title: '标准预警',
path: '/standardWarning',
'icon-class': 'el-icon-warning',
menuId: 'asfdew33',
isChildren: true // 判断没有子菜单
},
{
title: '资料中心',
path: '/dataCenter',
'icon-class': 'el-icon-s-order',
menuId: '',
isChildren: true // 判断没有子菜单
},
// {
// title: '技术要求清单',
// path: '/skillReq',
// children: [
// {
// title: '技术要求清单查看',
// path: '/SkillReqSee'
// },
// {
// title: '技术要求清单管理',
// path: '/SkillReqAdd'
// }
// ]
// },
{
title: '配置管理',
path: '/config',
'icon-class': 'el-icon-s-operation',
menuId: 'adff323',
children: [
{
title: '属性字典',
path: '/standLawsAttrManage',
menuId: '72a24657972d286b8b5d80735cf4eee2'
},
{
title: '属性配置',
path: '/attributeCustom',
menuId: '9cdb9b40157dd967b664b9af462b960b'
},
{
title: '操作日志',
path: '/OperationLog',
menuId: 'eb1565c40ca7506f89655f79f7a1ca65'
},
// {
// title: '资料中心管理',
// path: '/dynamicInformationManage',
// menuId: '6V2QZ9STRZ'
// },
{
title: '机构管理',
path: '/MechanismManage',
menuId: '5a09164da97760846509c5c9dd86b80c'
},
{
title: '角色管理',
path: '/roleManage',
menuId: 'd73d0e230eafdb2ddefe1c97daf657ea'
},
{
title: '岗位管理',
path: '/postManage',
menuId: 'd2954be3abaaf2de3dc79add4c8ab8cd'
},
// {
// title: '用户管理',
// path: '/userManage',
// menuId: 'YRJUEVJVUJ'
// },
// {
// title: '系统配置管理',
// path: '/warningTimeSetting',
// menuId: 'H2KC6P3PPM'
// },
// {
// title: '文档转换监控',
// path: '/convertDocView',
// menuId: '3F52K25546'
// },
// {
// title: '菜单管理',
// path: '/menuManage',
// menuId: '87b8b4f5817a7829696e63185c744d52'
// },
{
title: '链接管理',
path: '/linkManage',
menuId: 'd3ff92078c53a4d9d1f1a94450fee91e'
},
// // {
// // title: '保密管理',
// // path: '/convertDocView'
// // },
// {
// title: '动态信息管理',
// path: '/DynamicInformations',
// menuId: '3C87BSHJUF'
// },
// // {
// // title: '流程分类管理',
// // path: '/processClassificationManage',
// // menuId: 'N323F2UB9FTUV5SD3GTD'
// // },
// // {
// // title: '流程管理',
// // path: '/processManage',
// // menuId: 'K5KXSS3X9CF7CS8AMFJ5'
// // },
// {
// title: 'SVPPS',
// path: '/svpps',
// menuId: 'AR52RX586LQHVZSVV83K'
// },
// {
// title: '企标编号管理体系',
// path: '/enterpriseStandardNumberManagement',
// menuId: '9YSFG39S3CBFUJCEU3QX'
// }
]
},
{
title: '个人中心',
path: '/personal',
'icon-class': 'el-icon-s-check',
menuId: '32143ffasdf',
children: [
// {
// title: '我的消息',
// path: '/dynamics',
// menuId: 'JCEV4AEV32'
// },
// {
// title: '我的企标',
// path: '/MyEnterpriseStandard',
// menuId: 'LKU3W23UMEHDM9VLDHGK'
// },
{
title: '我的收藏',
path: '/collection',
menuId: '63e999c65b1f2b1339119a00eb1d50cf'
},
// {
// title: '我的浏览',
// path: '/browsing',
// menuId: 'HAEY2A4LMX'
// },
// {
// title: '已收分享',
// path: '/push',
// menuId: '9F8T7DPYHE'
// },
// {
// title: '已发分享',
// path: '/forward',
// menuId: 'K45Y9TGKZV2K4XP4CETD'
// },
{
title: '我的问答',
path: '/questions',
menuId: ''
},
{
title: '我的板块',
path: '/plate',
menuId: 'e4a94f03223df6f4ad70732b96f07221'
}
// {
// title: '个人信息',
// path: '/info',
// menuId: '8K7FDHG89G'
// }
]
},
// {
// title: '搜索中心',
// path: '/advancedSearch',
// 'icon-class': 'search',
// menuId: '1332FSFAD',
// isChildren: true // 判断没有子菜单
// },
// {
// title: '标准比对库',
// path: '/standardComparisonLibrary',
// 'icon-class': 'search',
// menuId: 'Q32VBYVGCAE4XXN3XZ8T',
// isChildren: true // 判断没有子菜单
// }
// {
// title: '自定义报表',
// path: '/customReport',
// 'icon-class': 'baobiao',
// isChildren: true // 判断没有子菜单
// }
]
}
},
created () {
// 获取当前页的path,赋值没左侧菜单,并展开
if (this.$route.meta.parentPath) {
this.defaultActive = this.$route.meta.parentPath
} else {
this.defaultActive = this.$route.path
}
},
mounted () {
},
methods: {
handleSelect (key, keyPath) {
if (this.$route.path === key) {
this.$router.go(0)
}
},
handleToggleSideBar () {
this.toggleSideBar(!this.isCollapse)
},
// 收展按钮
collapseIcon() {
return this.sideClose ? 'el-icon-arrow-left' : 'el-icon-arrow-right'
// return 'el-icon-arrow-left'
},
...mapMutations(['toggleSideBar'])
},
computed: {
logo () {
// background: url("~@/assets/images/shangqi/home/logo2.png") no-repeat;
// return this.isCollapse ? require('assets/images/shangqi/img/logo4.png') : require('assets/images/shangqi/img/logo5.png')
return this.isCollapse ? require('assets/images/shangqi/img/logo4.png') : require('assets/images/shangqi/img/logo2.png')
},
...mapGetters(['getDynamicTotal', 'isCollapse'])
},
watch: {
// 监听路由 重新渲染面包屑
$route () {
// 获取当前页的path,赋值没左侧菜单,并展开
if (this.$route.meta.parentPath) {
this.defaultActive = this.$route.meta.parentPath
} else {
this.defaultActive = this.$route.path
}
}
}
}
</script>
<style lang="less" scoped>
@import '~@/assets/styles/mixins';
/deep/.el-menu--popup > div {
border-radius: 5px;
}
.el-menu--collapse {
.is-active {
background-color: rgb(49, 112, 167) !important;
.shangqi-icon {
color: #fff !important;
}
color: rgb(49, 112, 167) !important;
}
}
.nav-menu {
width: 58px;
height: 100%;
overflow-y: auto;
user-select: none;
box-sizing: border-box;
position: absolute;
background: rgb(49, 112, 167);
background-size: 100% 100%;
/deep/.el-tooltip {
padding: 0px 16px !important;
}
.left-tree::-webkit-scrollbar {
display: none;
}
&:not(.is-collapse) {
width: 200px;
background: rgb(49, 112, 167);
background-size: 100% 100%;
.logo {
padding: 10px;
text-align: left;
img {
width: 150px;
height: 61px;
margin-top: -7px;
}
}
}
.tree-collapse{
display: inline-block;
position: absolute;
right: 0;
top: 0px;
align-items: center;
justify-content: center;
width: 15px;
min-height: 140%;
background: #EEE;
cursor: pointer;
&:hover{
background-color: #f0f2f5;
}
}
.logo{
text-align: center;
padding: 15px 0;
img {
width: 36px;
height: 35px;
}
}
.nav-menu-header{
/*background:url("../../assets/images/shangqi/home/logo3.png");*/
}
/deep/:not(.is-collapse) .el-menu-item.is-active{
background: #8fb0cc !important;
color: #fff !important;
}
}
.has-no-read{
position: relative;
top:-15px;
left:10px
}
/*.el-menu--collapse {*/
/* .shangqi-icon {*/
/* color: #4091FF !important;*/
/* }*/
/* .is-active /deep/.shangqi-icon {*/
/* color: #4091FF !important;*/
/* }*/
/* /deep/.el-submenu__title i {*/
/* color: #fff;*/
/* }*/
/* /deep/.el-submenu__title i {*/
/* color: #fff;*/
/* }*/
/*}*/
.is-active /deep/.shangqi-icon {
color: #fff;
}
/deep/.el-submenu__title i {
color: #fff;
}
.nav-menu /deep/.el-submenu__title i {
font-size: 16px;
color: #fff;
}
.nav-menu{
background-color: rgb(49, 112, 167);
scrollbar-width: none;
-ms-overflow-style: none; /* IE 10+ */
}
.nav-menu::-webkit-scrollbar {
display: none; /* Chrome Safari */
}
.nav-menu-popper .el-menu .el-menu-item {
color: #fff !important;
}
.nav-menu-popper .el-menu .el-menu-item.is-active {
background-color: #fff !important;
color: #8fb0cc !important;
font-weight: bold;
}
.nav-menu-popper .el-menu .el-menu-item:hover {
background-color: rgb(49, 112, 167) !important;
color: #fff !important;
font-weight: bold;
}
.el-menu-item {
font-size: 16px;
span {
margin-left: 5px;
font-weight: normal;
}
.shangqi-icon {
display: inline-block;
width: 18px;
height: 18px;
background-repeat: no-repeat;
background-size: 85% 85%;
background-position: center center;
&.home {
background-image: url("~assets/images/shangqi/sideBar/home.png");
}
&.baobiao {
background-image: url("~assets/images/shangqi/sideBar/baobiao.png");
}
&.ucenter {
background-image: url("~assets/images/shangqi/sideBar/ucenter.png");
}
&.search {
background-image: url("~assets/images/shangqi/sideBar/search.png");
}
&.warning {
background-image: url("~assets/images/shangqi/sideBar/warning.png");
}
&.liucheng {
background-image: url("~assets/images/shangqi/sideBar/liucheng.png");
}
}
}
.el-submenu {
.is-opened {
background-color: red;
}
/deep/.el-submenu__title {
font-size: 16px;
padding: 0 16px !important;
span {
font-weight: normal;
margin-left: 5px;
}
.shangqi-icon {
display: inline-block;
width: 18px;
height: 18px;
background-repeat: no-repeat;
background-size: 85% 85%;
background-position: center center;
&.fagui {
background-image: url("~assets/images/shangqi/sideBar/fagui.png");
}
&.tools {
background-image: url("~assets/images/shangqi/sideBar/tools.png");
}
&.ucenter {
background-image: url("~assets/images/shangqi/sideBar/ucenter.png");
}
&.search {
background-image: url("~assets/images/shangqi/sideBar/search.png");
}
&.conf {
background-image: url("~assets/images/shangqi/sideBar/conf.png");
}
&.liucheng {
background-image: url("~assets/images/shangqi/sideBar/liucheng.png");
}
}
}
.el-menu-item {
padding-left: 0 !important;
font-size: 16px;
font-weight: normal;
height: 40px;
line-height: 40px;
div {
}
}
/deep/.el-menu {
/*padding-left: 18px;*/
}
}
.el-menu--collapse{
width: 100%;
.shangqi-icon{
width: 24px;
height: 24px;
}
.el-submenu{
/deep/.el-submenu__title{
.shangqi-icon{
width: 24px;
height: 24px;
}
}
}
}
</style>