Commit d206ffbb authored by 徐一鸣's avatar 徐一鸣

用户权限

parent 18199f81
<template>
<div class="menu">
<img src="../assets/imgs/home_img_logo.png" alt class="logo" />
<div style="float:right;cursor: pointer;position:relative;" class="user_hover">
<span class="user">用户</span>
<img src="../assets/imgs/home_ic_user.png" alt class="user_pic" />
<div
style="float:right;cursor: pointer;position:relative;"
class="user_hover"
>
<span class="user">{{ userInfo.user_name }}</span>
<img
class="user_pic"
:src="
userInfo.picture_path || require('../assets/imgs/home_ic_user.png')
"
/>
<div class="user_menu">
<div
v-for="(item, index) in user_arr"
:key="index + 700"
@click="gotopage(item.path)"
>{{ item.name }}</div>
>
{{ item.name }}
</div>
</div>
<div class="sj"></div>
</div>
<div style="float:right;cursor: pointer;position:relative;" class="shop_hover">
<div
style="float:right;cursor: pointer;position:relative;"
class="shop_hover"
>
<div class="number">99+</div>
<img src="../assets/imgs/home_ic_shop.png" alt class="car" />
<div class="shop_menu">
......@@ -27,32 +40,38 @@
<div class="shop_cell_msgs">
<p @click="getDetail(item.id)" class="shop_cell_name over_one">
{{
item.service_id == 0
? item.application.app_name
: item.service.name
item.service_id == 0
? item.application.app_name
: item.service.name
}}
</p>
<p class="shop_cell_msg bover_one">
{{
item.service_id == 0
? item.application.ywly
: item.service.sectors_name
item.service_id == 0
? item.application.ywly
: item.service.sectors_name
}}
</p>
<p class="shop_cell_msg over_one">
{{
item.service_id == 0
? item.application.org
: item.service.organization_name
item.service_id == 0
? item.application.org
: item.service.organization_name
}}
</p>
</div>
<div>
<img @click.stop="deleteItem(item.id)" src="../assets/imgs/ic_delete.png" alt />
<img
@click.stop="deleteItem(item.id)"
src="../assets/imgs/ic_delete.png"
alt
/>
</div>
</div>
<div class="shop_footer">
<el-button @click="settlement" size="small" class="shop_settlement">去购物车申请结算</el-button>
<el-button @click="settlement" size="small" class="shop_settlement"
>去购物车申请结算</el-button
>
</div>
</div>
<div class="shop_sj"></div>
......@@ -67,14 +86,24 @@
:style="{ color: now_menu == index ? '#fff' : '' }"
>
{{ item.name }}
<div class="user_menu" v-if="item.children && item.children.length" style="left: 30px;">
<div
class="user_menu"
v-if="item.children && item.children.length"
style="left: 30px;"
>
<div
v-for="(v, indexs) in item.children"
:key="indexs + 700"
@click.stop="gotoChildPage(v, index)"
>{{ v.name }}</div>
>
{{ v.name }}
</div>
</div>
<div class="sj" v-if="item.children && item.children.length" style="left: 60px;"></div>
<div
class="sj"
v-if="item.children && item.children.length"
style="left: 60px;"
></div>
<div class="bottom_show" v-if="now_menu == index"></div>
</div>
</div>
......@@ -92,21 +121,21 @@ export default {
children: [
{
name: "服务注册",
path: "/fwzc/fwcs"
path: "/fwzc/fwcs",
},
{
name: "服务管理",
path: "/fwgl/"
path: "/fwgl/",
},
{
name: "应用管理",
path: "/yygl/"
}
]
path: "/yygl/",
},
],
},
{
name: "技术支持",
path: "/xxx"
path: "/xxx",
},
{
name: "服务超市",
......@@ -114,59 +143,71 @@ export default {
children: [
{
name: "数据服务",
path: "/shop/data_service_list/5"
path: "/shop/data_service_list/5",
},
{
name: "时空服务",
path: "/shop/space_time_service_list/6"
path: "/shop/space_time_service_list/6",
},
{
name: "视频服务",
path: "/shop/video_service_list/7"
path: "/shop/video_service_list/7",
},
{
name: "感知服务",
path: "/shop/perception_service_list/10"
path: "/shop/perception_service_list/10",
},
{
name: "综合应用",
path: "/shop/comprehensive_app_list/11"
path: "/shop/comprehensive_app_list/11",
},
{
name: "云资源服务",
path: "/shop/cloud"
path: "/shop/cloud",
},
{
name: "应用商店",
path: "/shop/app_store_list/12"
}
]
}
path: "/shop/app_store_list/12",
},
],
},
],
now_menu: 2,
user_arr: [
{ name: "个人档案", path: "/user/user_info" },
{ name: "消息通知", path: "/user/message" },
{ name: "收银中心", path: "/authority" },
{ name: "关于BD-aPaaS", path: "/data_analysis" },
{ name: "退出登录", path: "logout" }
{ name: "退出登录", path: "logout" },
],
shopping_list: []
shopping_list: [],
};
},
mounted() {
if (this.$store.level == 2) {
this.user_arr = [
{ name: "个人档案", path: "/user/user_info" },
{ name: "消息通知", path: "/user/message" },
{ name: "收银中心", path: "/authority" },
{ name: "关于BD-aPaaS", path: "/data_analysis" },
{ name: "退出登录", path: "logout" },
];
}
this.getMenuIndex();
this.getList();
},
computed: {
getMenuCartState() {
return this.$store.state.menuCartState;
}
},
userInfo() {
return this.$store.state.userInfo || {};
},
},
watch: {
getMenuCartState(newVal) {
this.getList();
}
},
},
methods: {
gotopage(n) {
......@@ -182,7 +223,7 @@ export default {
},
deleteItem(id) {
let query = [id];
this.$api.serviceShop.delShoppingCart(query).then(response => {
this.$api.serviceShop.delShoppingCart(query).then((response) => {
this.getList();
});
},
......@@ -211,7 +252,7 @@ export default {
}
},
getList() {
this.$api.serviceShop.getShoppingCart().then(response => {
this.$api.serviceShop.getShoppingCart().then((response) => {
if (response.data.success == "1") {
console.log(response.data.data);
this.shopping_list = response.data.data.valid
......@@ -226,8 +267,8 @@ export default {
let index = window.sessionStorage.getItem("menuIndex");
console.log(index);
this.now_menu = index ? index : 2;
}
}
},
},
};
</script>
......
<template>
<div class="fwgl_container">
<side-nav-bar title="权限管理" :title-icon="require('@/assets/imgs/tool_quanxian.png')" :nav-list="navList" :title-path="navList[0] && navList[0].path"></side-nav-bar>
<side-nav-bar
title="权限管理"
:title-icon="require('@/assets/imgs/tool_quanxian.png')"
:nav-list="navList"
:title-path="navList[0] && navList[0].path"
></side-nav-bar>
<div class="main_container">
<router-view :key="'type_' + $route.params.type"></router-view>
</div>
......@@ -12,42 +17,60 @@ import sideNavBar from "@/components/side-nav-bar";
export default {
components: {
sideNavBar
sideNavBar,
},
data: () => ({
userNav: [
{
name: "组织管理",
path: `/authority/organization`
path: `/authority/organization`,
},
{
name: "用户管理",
path: `/authority/users`
path: `/authority/users`,
},
{
name: "菜单管理",
path: `/authority/menu`
path: `/authority/menu`,
},
{
name: "角色管理",
path: `/authority/roles`
}
path: `/authority/roles`,
},
],
navList: []
navList: [],
}),
watch: {
"$route.fullPath"(path) {
this.initNavList();
}
},
},
methods: {
initNavList() {
this.navList = this.userNav;
}
},
},
mounted() {
this.initNavList();
}
this.$api.user.getNowUser().then(({ data }) => {
if (data.success == 1) {
this.$store.commit("userInfofun", data.data);
const userLevel = this.$store.getters.level;
if (userLevel === 2) {
this.initNavList();
} else {
this.$message({
message: `您没有权限管理模块的权限.`,
type: "warning",
});
this.$router.push(`/index`);
}
} else {
console.log(data.errMsg);
}
});
},
};
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment