|
@@ -1,25 +1,37 @@
|
|
<template>
|
|
<template>
|
|
<div id="bottomMenus">
|
|
<div id="bottomMenus">
|
|
|
|
+ <!-- 底部菜单动态SVG底座 -->
|
|
<BottomMenuSvg id="svgBox" @changeShowBottomMenusStatus="changeShowBottomMenusStatus()" />
|
|
<BottomMenuSvg id="svgBox" @changeShowBottomMenusStatus="changeShowBottomMenusStatus()" />
|
|
|
|
+ <!-- 底部菜单主体 -->
|
|
<div
|
|
<div
|
|
id="menusBox"
|
|
id="menusBox"
|
|
- :style="{ width: showBottomMenusStatus ? '981px' : '0px', height: showBottomMenusStatus ? '200px' : '0px' ,border: showBottomMenusStatus ? '1px solid #00aaff' : 'none'}"
|
|
|
|
|
|
+ :style="{
|
|
|
|
+ width: showBottomMenusStatus ? '981px' : '0px',
|
|
|
|
+ height: showBottomMenusStatus ? '200px' : '0px',
|
|
|
|
+ border: showBottomMenusStatus ? '1px solid #00aaff' : 'none'
|
|
|
|
+ }"
|
|
>
|
|
>
|
|
|
|
+ <!-- 模块遍历渲染也是menus对象的第一层数组 -->
|
|
<div
|
|
<div
|
|
class="bottomMenus_box"
|
|
class="bottomMenus_box"
|
|
v-for="(item, index) in menus"
|
|
v-for="(item, index) in menus"
|
|
:key="index"
|
|
:key="index"
|
|
:style="{ width: item.width ? item.width : 'auto' }"
|
|
:style="{ width: item.width ? item.width : 'auto' }"
|
|
>
|
|
>
|
|
|
|
+ <!-- 模块标题 -->
|
|
<div class="bottomMenus_box_title">{{ item.title }}</div>
|
|
<div class="bottomMenus_box_title">{{ item.title }}</div>
|
|
|
|
+ <!-- 模块下的菜单主体 -->
|
|
<div class="bottomMenus_box_main">
|
|
<div class="bottomMenus_box_main">
|
|
|
|
+ <!-- 遍历渲染每个模块下的子菜单,也是menus数组中subMenu数组 -->
|
|
<div
|
|
<div
|
|
class="colBtuMenu"
|
|
class="colBtuMenu"
|
|
@click="changeBottomMenu(item.index, subItem.index)"
|
|
@click="changeBottomMenu(item.index, subItem.index)"
|
|
- v-for="(subItem, subIndex) in item.submenu"
|
|
|
|
|
|
+ v-for="(subItem, subIndex) in item.subMenu"
|
|
:key="subIndex"
|
|
:key="subIndex"
|
|
>
|
|
>
|
|
|
|
+ <!-- 选中状态的背景高亮 -->
|
|
<div :class="ifMenuIndex(item.index, subItem.index) ? 'colBtuMenuShadow' : ''"></div>
|
|
<div :class="ifMenuIndex(item.index, subItem.index) ? 'colBtuMenuShadow' : ''"></div>
|
|
|
|
+ <!-- 子菜单图标的选择性渲染 -->
|
|
<el-image
|
|
<el-image
|
|
class="BtuMenu"
|
|
class="BtuMenu"
|
|
v-show="ifMenuIndex(item.index, subItem.index)"
|
|
v-show="ifMenuIndex(item.index, subItem.index)"
|
|
@@ -30,6 +42,7 @@
|
|
v-show="!ifMenuIndex(item.index, subItem.index)"
|
|
v-show="!ifMenuIndex(item.index, subItem.index)"
|
|
:src="returnBgImage(subItem.bgImage)"
|
|
:src="returnBgImage(subItem.bgImage)"
|
|
></el-image>
|
|
></el-image>
|
|
|
|
+ <!-- 子菜单标题 -->
|
|
<div class="BtuMenu_title" :style="{ color: ifMenuIndex(item.index, subItem.index) ? '#00f5ff' : '#FFFFFF' }">
|
|
<div class="BtuMenu_title" :style="{ color: ifMenuIndex(item.index, subItem.index) ? '#00f5ff' : '#FFFFFF' }">
|
|
{{ subItem.title }}
|
|
{{ subItem.title }}
|
|
</div>
|
|
</div>
|
|
@@ -41,19 +54,26 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+/**
|
|
|
|
+ * 底部菜单组件
|
|
|
|
+ * @author: LiuMengxiang
|
|
|
|
+ * @Date: 2022年11月14-18日
|
|
|
|
+ */
|
|
import BottomMenuSvg from "./BottomMenuSvg.vue";
|
|
import BottomMenuSvg from "./BottomMenuSvg.vue";
|
|
export default {
|
|
export default {
|
|
name: "BottomMenus",
|
|
name: "BottomMenus",
|
|
components: { BottomMenuSvg },
|
|
components: { BottomMenuSvg },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ // 菜单主体显示状态(默认false)
|
|
showBottomMenusStatus: false,
|
|
showBottomMenusStatus: false,
|
|
|
|
+ // 底部菜单对象
|
|
menus: [
|
|
menus: [
|
|
{
|
|
{
|
|
index: 0,
|
|
index: 0,
|
|
width: "164px",
|
|
width: "164px",
|
|
title: "任务申请",
|
|
title: "任务申请",
|
|
- submenu: [
|
|
|
|
|
|
+ subMenu: [
|
|
{ index: 0, title: "申请任务", bgImage: "sqrw" },
|
|
{ index: 0, title: "申请任务", bgImage: "sqrw" },
|
|
{ index: 1, title: "我的任务", bgImage: "wdrw" }
|
|
{ index: 1, title: "我的任务", bgImage: "wdrw" }
|
|
]
|
|
]
|
|
@@ -62,7 +82,7 @@ export default {
|
|
index: 1,
|
|
index: 1,
|
|
width: "509px",
|
|
width: "509px",
|
|
title: "疑点分析",
|
|
title: "疑点分析",
|
|
- submenu: [
|
|
|
|
|
|
+ subMenu: [
|
|
{ index: 0, title: "疑点审计", bgImage: "ydsj" },
|
|
{ index: 0, title: "疑点审计", bgImage: "ydsj" },
|
|
{ index: 1, title: "标记疑点", bgImage: "bjyd" },
|
|
{ index: 1, title: "标记疑点", bgImage: "bjyd" },
|
|
{ index: 2, title: "同屏对比", bgImage: "tpdb" },
|
|
{ index: 2, title: "同屏对比", bgImage: "tpdb" },
|
|
@@ -75,13 +95,13 @@ export default {
|
|
index: 2,
|
|
index: 2,
|
|
width: "94px",
|
|
width: "94px",
|
|
title: "疑点报告",
|
|
title: "疑点报告",
|
|
- submenu: [{ index: 0, title: "报告输出", bgImage: "bgsc" }]
|
|
|
|
|
|
+ subMenu: [{ index: 0, title: "报告输出", bgImage: "bgsc" }]
|
|
},
|
|
},
|
|
{
|
|
{
|
|
index: 3,
|
|
index: 3,
|
|
width: "94px",
|
|
width: "94px",
|
|
title: "现场勘查",
|
|
title: "现场勘查",
|
|
- submenu: [{ index: 0, title: "发到手机", bgImage: "fdsj" }]
|
|
|
|
|
|
+ subMenu: [{ index: 0, title: "发到手机", bgImage: "fdsj" }]
|
|
}
|
|
}
|
|
]
|
|
]
|
|
};
|
|
};
|
|
@@ -92,12 +112,15 @@ export default {
|
|
*/
|
|
*/
|
|
props: [],
|
|
props: [],
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 根据菜单父级index和子菜单index,判断全局变量已选中底部菜单的index对比,返回状态。
|
|
ifMenuIndex(index, subIndex) {
|
|
ifMenuIndex(index, subIndex) {
|
|
return this.$store.state.bottomMenuIndexs.index == index && this.$store.state.bottomMenuIndexs.subIndex == subIndex;
|
|
return this.$store.state.bottomMenuIndexs.index == index && this.$store.state.bottomMenuIndexs.subIndex == subIndex;
|
|
},
|
|
},
|
|
|
|
+ // 根据菜单父级index和子菜单index,更新全局变量。
|
|
changeBottomMenu(index, subIndex) {
|
|
changeBottomMenu(index, subIndex) {
|
|
this.$store.commit("changeBottomMenu", { index: index, subIndex: subIndex });
|
|
this.$store.commit("changeBottomMenu", { index: index, subIndex: subIndex });
|
|
},
|
|
},
|
|
|
|
+ // 根据菜单参数bgImage,菜单父级index和子菜单index,判断全局变量已选中底部菜单的index对比,返回不同状态下的icon图标地址。
|
|
returnBgImage(bgImage, index, subIndex) {
|
|
returnBgImage(bgImage, index, subIndex) {
|
|
if (this.$store.state.bottomMenuIndexs.index == index && this.$store.state.bottomMenuIndexs.subIndex == subIndex) {
|
|
if (this.$store.state.bottomMenuIndexs.index == index && this.$store.state.bottomMenuIndexs.subIndex == subIndex) {
|
|
return "/static/images/bottomMenuIcon/" + bgImage + "-a.png";
|
|
return "/static/images/bottomMenuIcon/" + bgImage + "-a.png";
|
|
@@ -105,6 +128,7 @@ export default {
|
|
return "/static/images/bottomMenuIcon/" + bgImage + ".png";
|
|
return "/static/images/bottomMenuIcon/" + bgImage + ".png";
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 当用户点击svg底座时,切换底部菜单显示隐藏状态。
|
|
changeShowBottomMenusStatus() {
|
|
changeShowBottomMenusStatus() {
|
|
this.showBottomMenusStatus = !this.showBottomMenusStatus;
|
|
this.showBottomMenusStatus = !this.showBottomMenusStatus;
|
|
}
|
|
}
|
|
@@ -200,7 +224,7 @@ export default {
|
|
font-size: 16px;
|
|
font-size: 16px;
|
|
font-family: pingfangSC;
|
|
font-family: pingfangSC;
|
|
font-weight: 300;
|
|
font-weight: 300;
|
|
- color: #FFFFFF;
|
|
|
|
|
|
+ color: #ffffff;
|
|
line-height: 60px;
|
|
line-height: 60px;
|
|
z-index: 99999;
|
|
z-index: 99999;
|
|
}
|
|
}
|