You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

609 lines
16 KiB
Vue

7 months ago
<template>
<div class="menu">
1 month ago
<div v-for="(i,k) in menuList" :class="`menuItem ${$route.path === i.path ? 'focus':''}`"
@mouseenter="getChildren(i)" @click="toLink((i.children||[]).length===0 ? i.path:'')">
1 month ago
<div :class="`name`">{{ i.name }}</div>
7 months ago
<div class="line"></div>
</div>
1 month ago
<div class="subMenu" v-show="(subMenuList||[]).length>0 && subMenuType === 1" @mouseleave="clearChildren">
1 month ago
<div :class="`topMenuItem${$route.fullPath === ii.path ? ' active':''}`" v-for="(ii,k) in subMenuList"
@click="toLink(ii.path)">
7 months ago
<div class="icon">
<img :src="ii.icon" alt="" style="width: 1.8vw;height: 1.8vw;object-fit: contain">
</div>
<div class="menuChildrenName">
<span>
{{ ii.name }}
</span>
</div>
</div>
</div>
1 month ago
<div class="subMenu1" v-show="(subMenuList||[]).length>0 && subMenuType === 2" @mouseleave="clearChildren">
<div class="subMenuList" :style="{width:100/subMenuList.length+'%'}" v-for="(ii,k) in subMenuList">
<div class="subMenuListTitle">
{{ ii.name }} >
</div>
<div class="subMenuListItem" v-for="(iii,kkk) in ii.children" @click="toLink(iii.path)">
<img :src="iii.icon" alt=""
style="width: 18px;height: 18px;line-height: 30px;object-fit: contain;margin-right: 6px">{{
iii.name
}}
<el-tag size="small" v-if="kkk <1"></el-tag>
</div>
</div>
</div>
7 months ago
</div>
</template>
<script>
import wlw from "@/assets/icon/wlw.png";
import znzz from "@/assets/icon/znzz.png";
import kdwl from "@/assets/icon/kdwl.png";
import znlt from "@/assets/icon/znlt.png";
6 months ago
import {getPortalConfigTypeList} from "@/api/menu";
7 months ago
export default {
name: 'Index',
data() {
return {
menuList: [
{
name: '首页',
7 months ago
path: '/index'
7 months ago
},
1 month ago
{
name: '关于海威',
1 month ago
path: '/productCenter/aboutHW',
type: 1,
children: [
{
name: '公司概况',
path: '/aboutUs/companyIntroduction',
icon: znzz
},
{
name: '媒体中心',
path: '/aboutUs/managementTeam',
icon: znlt
},
{
name: '荣誉资质',
path: '/aboutUs/developmentHistory',
icon: kdwl
},
{
name: '合作伙伴',
path: '/contactUs',
icon: wlw
},
{
name: '联系我们',
path: '/contactUs',
icon: wlw
},
]
1 month ago
},
7 months ago
{
name: '产品中心',
path: '/productCenter/industrialInternet',
1 month ago
type: 2,
children: [
{
name: '轮胎RFID',
path: '/productCenter/industrialInternet',
icon: znzz,
children: [
{
name: '产品1',
path: '/productCenter/industrialInternet',
icon: znzz
},
{
name: '产品2',
path: '/productCenter/industrialInternet',
icon: znzz
},
{
name: '产品3',
path: '/productCenter/industrialInternet',
icon: znzz
},
]
},
{
name: '超高频RFID',
path: '/productCenter/industrialInternet',
icon: znzz,
children: [
{
name: '产品1',
path: '/productCenter/industrialInternet',
icon: znzz
},
{
name: '产品2',
path: '/productCenter/industrialInternet',
icon: znzz
},
{
name: '产品3',
path: '/productCenter/industrialInternet',
icon: znzz
},
]
},
{
name: '高频RFID',
path: '/productCenter/industrialInternet',
icon: znzz,
children: [
{
name: '产品1',
path: '/productCenter/industrialInternet',
icon: znzz
},
{
name: '产品2',
path: '/productCenter/industrialInternet',
icon: znzz
},
{
name: '产品3',
path: '/productCenter/industrialInternet',
icon: znzz
},
]
},
{
name: '传感器',
path: '/productCenter/industrialInternet',
icon: znzz,
children: [
{
name: '产品1',
path: '/productCenter/industrialInternet',
icon: znzz
},
{
name: '产品2',
path: '/productCenter/industrialInternet',
icon: znzz
},
{
name: '产品3',
path: '/productCenter/industrialInternet',
icon: znzz
},
]
},
{
name: '物联终端',
path: '/productCenter/industrialInternet',
icon: znzz,
children: [
{
name: '产品1',
path: '/productCenter/industrialInternet',
icon: znzz
},
{
name: '产品2',
path: '/productCenter/industrialInternet',
icon: znzz
},
{
name: '产品3',
path: '/productCenter/industrialInternet',
icon: znzz
},
]
},
{
name: '工业软件',
path: '/productCenter/industrialInternet',
icon: znzz,
children: [
{
name: '产品1',
path: '/productCenter/industrialInternet',
icon: znzz
},
{
name: '产品2',
path: '/productCenter/industrialInternet',
icon: znzz
},
{
name: '产品3',
path: '/productCenter/industrialInternet',
icon: znzz
},
]
},
]
7 months ago
},
{
1 month ago
name: '行业方案',
path: '/casesAndClients/IOT',
1 month ago
type: 2,
children: [
{
name: '智能轮胎',
path: '/productCenter/industrialInternet',
icon: znzz,
children: [
{
name: '产品1',
path: '/productCenter/industrialInternet',
icon: znzz
},
{
name: '产品2',
path: '/productCenter/industrialInternet',
icon: znzz
},
{
name: '产品3',
path: '/productCenter/industrialInternet',
icon: znzz
},
]
},
{
name: '轮胎工厂',
path: '/productCenter/industrialInternet',
icon: znzz,
children: [
{
name: '产品1',
path: '/productCenter/industrialInternet',
icon: znzz
},
{
name: '产品2',
path: '/productCenter/industrialInternet',
icon: znzz
},
{
name: '产品3',
path: '/productCenter/industrialInternet',
icon: znzz
},
]
},
{
name: '快递物流',
path: '/productCenter/industrialInternet',
icon: znzz,
children: [
{
name: '产品1',
path: '/productCenter/industrialInternet',
icon: znzz
},
{
name: '产品2',
path: '/productCenter/industrialInternet',
icon: znzz
},
{
name: '产品3',
path: '/productCenter/industrialInternet',
icon: znzz
},
]
},
{
name: '新能源',
path: '/productCenter/industrialInternet',
icon: znzz,
children: [
{
name: '产品1',
path: '/productCenter/industrialInternet',
icon: znzz
},
{
name: '产品2',
path: '/productCenter/industrialInternet',
icon: znzz
},
{
name: '产品3',
path: '/productCenter/industrialInternet',
icon: znzz
},
]
},
{
name: '畜牧食品',
path: '/productCenter/industrialInternet',
icon: znzz,
children: [
{
name: '产品1',
path: '/productCenter/industrialInternet',
icon: znzz
},
{
name: '产品2',
path: '/productCenter/industrialInternet',
icon: znzz
},
{
name: '产品3',
path: '/productCenter/industrialInternet',
icon: znzz
},
]
},
{
name: '智能制造',
path: '/productCenter/industrialInternet',
icon: znzz,
children: [
{
name: '产品1',
path: '/productCenter/industrialInternet',
icon: znzz
},
{
name: '产品2',
path: '/productCenter/industrialInternet',
icon: znzz
},
{
name: '产品3',
path: '/productCenter/industrialInternet',
icon: znzz
},
]
},
{
name: '工业物联',
path: '/productCenter/industrialInternet',
icon: znzz,
children: [
{
name: '产品1',
path: '/productCenter/industrialInternet',
icon: znzz
},
{
name: '产品2',
path: '/productCenter/industrialInternet',
icon: znzz
},
{
name: '产品3',
path: '/productCenter/industrialInternet',
icon: znzz
},
]
},
]
7 months ago
},
{
1 month ago
name: '服务支持',
1 month ago
path: '/contactUs',
type: 1,
children: [
{
name: '售前服务',
path: '/aboutUs/developmentHistory',
icon: kdwl
},
{
name: '售后服务',
path: '/contactUs',
icon: wlw
},
{
name: '资料下载',
path: '/contactUs',
icon: wlw
}
]
7 months ago
},
],
7 months ago
subMenuList: [],
1 month ago
subMenuType: [],
7 months ago
firstMenu: '',
secondMenu: '',
7 months ago
}
},
mounted() {
1 month ago
// this.getMenu()
7 months ago
let query = this.$route.path
console.log(this.$route)
7 months ago
},
methods: {
toLink(e) {
6 months ago
if (!e) return
7 months ago
this.$router.push(e)
},
getChildren(e) {
if (e.children) {
this.subMenuList = e.children
1 month ago
this.subMenuType = e.type
7 months ago
} else {
this.subMenuList = []
1 month ago
this.subMenuType = 0
7 months ago
}
},
clearChildren() {
this.subMenuList = []
1 month ago
this.subMenuType = 0
6 months ago
},
getMenu() {
getPortalConfigTypeList({
configTypeClassfication: 1,
parentId: 0,
pageNum: 1,
pageSize: 111
}).then(e => {
console.log(e)
1 month ago
this.menuList[2].children = e.rows.map(v => {
return {
name: v.configTypeName,
icon: v.configTypeIcon,
1 month ago
path: '/productCenter/industrialInternet?portalConfigTypeId=' + v.configTypeId
}
})
})
getPortalConfigTypeList({
configTypeClassfication: 2,
parentId: 0,
pageNum: 1,
pageSize: 111
}).then(e => {
console.log(e)
1 month ago
this.menuList[3].children = e.rows.map(v => {
return {
name: v.configTypeName,
icon: v.configTypeIcon,
path: '/casesAndClients/IOT?portalConfigTypeId=' + v.configTypeId
}
})
})
7 months ago
}
}
}
</script>
<style lang="less" scoped>
@import "~@/style.less";
.menu {
position: relative;
.focus, .menuItem:hover {
font-weight: 700;
color: #3076f8;
background-color: #ebf1ff;
.line {
width: 100%;
height: 2px;
position: absolute;
bottom: 0;
left: 0;
background-color: #3076f8;
}
}
.menuItem {
//width: 120px;
padding: 0 2vw;
position: relative;
display: inline-block;
cursor: pointer;
transition: all 0.2s;
.name {
line-height: @top-height;
font-size: 1vw;
letter-spacing: 2px;
}
}
.subMenu {
position: absolute;
width: 100vw;
left: 50%;
transform: translateX(-50%);
height: @menuHeight;
display: flex;
justify-content: center;
background-color: #fff;
z-index: -1;
box-shadow: 0 8px 8px rgba(0, 0, 0, 0.04);
.topMenuItem.active, .topMenuItem:hover {
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
.menuChildrenName {
color: @standard-color;
}
}
.topMenuItem {
width: @menuHeight;
height: @menuHeight;
transition: all 0.2s;
.icon {
width: 100%;
height: 36%;
margin-top: 22%;
display: flex;
align-items: center;
justify-content: center;
}
.menuName {
height: 20%;
font-size: 0.9vw;
color: #111;
letter-spacing: 1px;
display: flex;
align-items: center;
justify-content: center;
}
}
1 month ago
.subMenuList {
position: absolute;
width: 80%;
height: @menuHeight;
}
}
.subMenu1 {
position: absolute;
width: 100vw;
left: 50%;
transform: translateX(-50%);
height: @menuHeight;
display: flex;
justify-content: center;
background-color: #fff;
z-index: -1;
box-shadow: 0 8px 8px rgba(0, 0, 0, 0.04);
.subMenuList {
max-width: @menuHeight;
display: inline-block;
text-align: left;
vertical-align: top;
.subMenuListTitle {
font-weight: 900;
line-height: 40px;
}
.subMenuListItem {
cursor: pointer;
font-size: 14px;
line-height: 40px;
&:hover {
color: @standard-color;
}
}
}
7 months ago
}
}
@menuHeight: 11vw;
</style>