zhgdyun/src/components/centerChange.vue

159 lines
3.7 KiB
Vue
Raw Normal View History

2024-03-21 19:30:54 +08:00
<template>
<div class="header-btn">
<el-popover
placement="bottom"
2024-04-11 19:15:19 +08:00
trigger="hover"
2024-03-21 19:30:54 +08:00
width="450"
class="popover"
2024-04-10 16:18:11 +08:00
:visible-arrow="false"
2024-03-21 19:30:54 +08:00
v-model="visible"
>
<div class="changeBox">
<div class="center-classify">
<span>个人中心</span>
<div class="row-line"></div>
<div class="classify-item">
2024-06-05 15:16:25 +08:00
<div
@click="jumpRouter(item.modulePath)"
:class="isActive(item.modulePath) ? 'active-item' : ''"
v-for="(item,index) in moduleList"
:key="index"
>
{{item.moduleName}}
</div>
</div>
<!-- <div class="classify-item">
2024-04-22 20:00:32 +08:00
<div
@click="jumpRouter('/workSpace')"
:class="isActive('/workSpace') ? 'active-item' : ''"
>
工作台
</div>
<div
@click="jumpRouter('/userCenter/userConfig')"
:class="isActive('/userCenter/userConfig') ? 'active-item' : ''"
>
用户中心
</div>
2024-05-07 19:16:21 +08:00
<div
2024-04-22 20:00:32 +08:00
@click="jumpRouter('/infoCenter/allInfo')"
:class="isActive('/infoCenter/allInfo') ? 'active-item' : ''"
>
消息中心
2024-05-07 19:16:21 +08:00
</div>
2024-06-05 15:16:25 +08:00
</div> -->
2024-03-21 19:30:54 +08:00
</div>
</div>
<!-- 点击内容 -->
<div slot="reference" class="click-content">
2024-04-10 16:18:11 +08:00
<!-- <i class="el-icon-trophy-1"></i> -->
<img src="@/assets/images/headerImg/icon2.png" />
2024-03-21 19:30:54 +08:00
<span>工作台</span>
<i class="el-icon-arrow-down"></i>
</div>
</el-popover>
</div>
</template>
<script>
2024-06-05 15:16:25 +08:00
import {
getNewUserAllModulePageApi,
} from "@/assets/js/api/jxjadmin.js";
2024-03-21 19:30:54 +08:00
export default {
data() {
return {
2024-04-22 20:00:32 +08:00
visible: false,
2024-06-05 15:16:25 +08:00
moduleList: []
2024-04-22 20:00:32 +08:00
};
2024-03-21 19:30:54 +08:00
},
2024-06-05 15:16:25 +08:00
created() {
this.getModuleList();},
2024-04-22 20:00:32 +08:00
mounted() {},
2024-03-21 19:30:54 +08:00
methods: {
2024-06-05 15:16:25 +08:00
// 查询全部模块(拿到工作流的模块菜单)
getModuleList() {
getNewUserAllModulePageApi({
projectSn: this.$store.state.projectSn,
moduleType: 7,
userId: this.$store.state.userInfo.userId,
}).then((res) => {
if(res.result && res.result.moduleList){
this.moduleList = res.result.moduleList;
console.log(this.moduleList,123321)
} else {
this.moduleList = [];
}
});
},
2024-04-22 20:00:32 +08:00
isActive(val) {
return this.$route.path.indexOf(val) != -1 ? true : false;
2024-04-11 19:15:19 +08:00
},
2024-04-22 20:00:32 +08:00
jumpRouter(routeName) {
// 判断当前页面是不是设备中台
if (window.location.href.indexOf("equipmentCenter.html") != -1) {
window.open("/#" + routeName, "_self");
} else {
this.$router.push(routeName);
}
},
},
};
2024-03-21 19:30:54 +08:00
</script>
<style lang="less" scoped>
2024-04-22 20:00:32 +08:00
.flexStyle() {
display: flex;
align-items: center;
2024-03-21 19:30:54 +08:00
}
2024-04-22 20:00:32 +08:00
.activeStyle() {
2024-04-11 19:15:19 +08:00
color: white;
2024-04-22 20:00:32 +08:00
background-color: #478cf7;
2024-04-11 19:15:19 +08:00
}
2024-03-21 19:30:54 +08:00
.changeBox {
2024-04-22 20:00:32 +08:00
.center-classify {
2024-03-21 19:30:54 +08:00
width: 180px;
2024-04-22 20:00:32 +08:00
> span:nth-child(1) {
2024-03-21 19:30:54 +08:00
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #000000;
}
2024-04-22 20:00:32 +08:00
.row-line {
2024-03-21 19:30:54 +08:00
width: 100%;
height: 2px;
2024-04-22 20:00:32 +08:00
background-color: #e1e1e1;
2024-03-21 19:30:54 +08:00
margin-top: 5px;
}
2024-04-22 20:00:32 +08:00
.classify-item {
2024-03-21 19:30:54 +08:00
margin-top: 10px;
2024-04-22 20:00:32 +08:00
div {
2024-03-21 19:30:54 +08:00
padding: 6px 0px;
text-indent: 0.5em;
border-radius: 3px;
cursor: pointer;
}
2024-04-22 20:00:32 +08:00
div:hover,
.active-item {
2024-04-11 19:15:19 +08:00
.activeStyle();
2024-03-21 19:30:54 +08:00
}
2024-04-22 20:00:32 +08:00
div:not(:last-child) {
2024-03-21 19:30:54 +08:00
margin-bottom: 7px;
}
}
}
}
2024-04-22 20:00:32 +08:00
.click-content {
2024-03-21 19:30:54 +08:00
cursor: pointer;
.flexStyle();
2024-04-22 20:00:32 +08:00
img {
2024-04-10 16:18:11 +08:00
width: 20px;
height: 20px;
}
2024-04-22 20:00:32 +08:00
> span {
2024-03-21 19:30:54 +08:00
margin: 0px 10px;
}
}
</style>
<style>
.el-popover {
box-sizing: content-box !important;
}
2024-04-22 20:00:32 +08:00
</style>