Commit 10a908b0 authored by 徐一鸣's avatar 徐一鸣

工作台服务管理和应用管理跳转

parent d152b930
...@@ -12,8 +12,24 @@ export default { ...@@ -12,8 +12,24 @@ export default {
components: { components: {
bdMenu, bdMenu,
}, },
methods: {}, methods: {
created() {}, getCurrentUser() {
this.$api.user.getNowUser().then(({ data }) => {
if (data.success == 1) {
console.log("--- user info ---");
console.log(data.data);
console.log("--- user info ---");
this.$store.commit("userInfofun", data.data);
} else {
console.log(data.errMsg);
}
});
},
},
created() {
this.getCurrentUser();
},
}; };
</script> </script>
...@@ -28,4 +44,4 @@ export default { ...@@ -28,4 +44,4 @@ export default {
background-color: #f6f7fb; background-color: #f6f7fb;
font-size: 14px; font-size: 14px;
} }
</style> </style>
\ No newline at end of file
<template> <template>
<div class="menu"> <div class="menu">
<img src="../assets/imgs/home_img_logo.png" alt class="logo" /> <img src="../assets/imgs/home_img_logo.png" alt class="logo" />
<div style="float:right;cursor: pointer;position:relative;" class="user_hover"> <div
style="float:right;cursor: pointer;position:relative;"
class="user_hover"
>
<span class="user">用户</span> <span class="user">用户</span>
<img src="../assets/imgs/home_ic_user.png" alt class="user_pic" /> <img src="../assets/imgs/home_ic_user.png" alt class="user_pic" />
<div class="user_menu"> <div class="user_menu">
...@@ -9,11 +12,16 @@ ...@@ -9,11 +12,16 @@
v-for="(item, index) in user_arr" v-for="(item, index) in user_arr"
:key="index + 700" :key="index + 700"
@click="gotopage(item.path)" @click="gotopage(item.path)"
>{{ item.name }}</div> >
{{ item.name }}
</div>
</div> </div>
<div class="sj"></div> <div class="sj"></div>
</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> <div class="number">99+</div>
<img src="../assets/imgs/home_ic_shop.png" alt class="car" /> <img src="../assets/imgs/home_ic_shop.png" alt class="car" />
<div class="shop_menu"> <div class="shop_menu">
...@@ -25,23 +33,40 @@ ...@@ -25,23 +33,40 @@
> >
<img :src="item.service.cover" class="shop_img" /> <img :src="item.service.cover" class="shop_img" />
<div class="shop_cell_msgs"> <div class="shop_cell_msgs">
<p <p @click="getDetail(item.id)" class="shop_cell_name over_one">
@click="getDetail(item.id)" {{
class="shop_cell_name over_one" item.service_id == 0
>{{ item.service_id == 0 ? item.application.app_name : item.service.name }}</p> ? item.application.app_name
<p : item.service.name
class="shop_cell_msg bover_one" }}
>{{ item.service_id == 0 ? item.application.ywly : item.service.sectors_name }}</p> </p>
<p <p class="shop_cell_msg bover_one">
class="shop_cell_msg over_one" {{
>{{ item.service_id == 0 ? item.application.org : item.service.organization_name }}</p> 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
}}
</p>
</div> </div>
<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> </div>
<div class="shop_footer"> <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> </div>
<div class="shop_sj"></div> <div class="shop_sj"></div>
...@@ -56,14 +81,24 @@ ...@@ -56,14 +81,24 @@
:style="{ color: now_menu == index ? '#fff' : '' }" :style="{ color: now_menu == index ? '#fff' : '' }"
> >
{{ item.name }} {{ 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 <div
v-for="(v, indexs) in item.children" v-for="(v, indexs) in item.children"
:key="indexs + 700" :key="indexs + 700"
@click.stop="gotoChildPage(v, index)" @click.stop="gotoChildPage(v, index)"
>{{ v.name }}</div> >
{{ v.name }}
</div>
</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 class="bottom_show" v-if="now_menu == index"></div>
</div> </div>
</div> </div>
...@@ -81,21 +116,21 @@ export default { ...@@ -81,21 +116,21 @@ export default {
children: [ children: [
{ {
name: "服务注册", name: "服务注册",
path: "/fwzc/fwcs" path: "/fwzc/fwcs",
}, },
{ {
name: "服务管理", name: "服务管理",
path: "/fwgl/" path: "/fwgl/",
}, },
{ {
name: "应用管理", name: "应用管理",
path: "/yygl/" path: "/yygl/",
} },
] ],
}, },
{ {
name: "技术支持", name: "技术支持",
path: "/xxx" path: "/xxx",
}, },
{ {
name: "服务超市", name: "服务超市",
...@@ -103,34 +138,34 @@ export default { ...@@ -103,34 +138,34 @@ export default {
children: [ children: [
{ {
name: "数据服务", name: "数据服务",
path: "/shop/data_service_list/5" path: "/shop/data_service_list/5",
}, },
{ {
name: "时空服务", name: "时空服务",
path: "/shop/space_time_service_list/6" path: "/shop/space_time_service_list/6",
}, },
{ {
name: "视频服务", name: "视频服务",
path: "/shop/video_service_list/7" path: "/shop/video_service_list/7",
}, },
{ {
name: "感知服务", name: "感知服务",
path: "/shop/perception_service_list/10" path: "/shop/perception_service_list/10",
}, },
{ {
name: "综合应用", name: "综合应用",
path: "/shop/comprehensive_app_list/11" path: "/shop/comprehensive_app_list/11",
}, },
{ {
name: "云资源服务", name: "云资源服务",
path: "/shop/cloud" path: "/shop/cloud",
}, },
{ {
name: "应用商店", name: "应用商店",
path: "/shop/app_store_list/12" path: "/shop/app_store_list/12",
} },
] ],
} },
], ],
now_menu: 2, now_menu: 2,
user_arr: [ user_arr: [
...@@ -138,9 +173,9 @@ export default { ...@@ -138,9 +173,9 @@ export default {
{ name: "消息通知", path: "/user/message" }, { name: "消息通知", path: "/user/message" },
{ name: "收银中心", path: "/authority" }, { name: "收银中心", path: "/authority" },
{ name: "关于BD-aPaaS", path: "/data_analysis" }, { name: "关于BD-aPaaS", path: "/data_analysis" },
{ name: "退出登录", path: "" } { name: "退出登录", path: "" },
], ],
shopping_list: [] shopping_list: [],
}; };
}, },
mounted() { mounted() {
...@@ -149,12 +184,12 @@ export default { ...@@ -149,12 +184,12 @@ export default {
computed: { computed: {
getMenuCartState() { getMenuCartState() {
return this.$store.state.menuCartState; return this.$store.state.menuCartState;
} },
}, },
watch: { watch: {
getMenuCartState(newVal) { getMenuCartState(newVal) {
this.getList(); this.getList();
} },
}, },
methods: { methods: {
gotopage(n) { gotopage(n) {
...@@ -165,7 +200,7 @@ export default { ...@@ -165,7 +200,7 @@ export default {
}, },
deleteItem(id) { deleteItem(id) {
let query = [id]; let query = [id];
this.$api.serviceShop.delShoppingCart(query).then(response => { this.$api.serviceShop.delShoppingCart(query).then((response) => {
this.getList(); this.getList();
}); });
}, },
...@@ -181,7 +216,7 @@ export default { ...@@ -181,7 +216,7 @@ export default {
gotoChildPage(v, parent) { gotoChildPage(v, parent) {
if (v.path) { if (v.path) {
if (v.path == "/fwgl/" || v.path == "/yygl/") { if (v.path == "/fwgl/" || v.path == "/yygl/") {
this.$router.push(v.path + this.$store.state.role); this.$router.push(v.path + this.$store.getters.level);
} else if (parent == 2) { } else if (parent == 2) {
this.$router.push(v.path); this.$router.push(v.path);
this.$store.commit("serviceShopMenuAct", v.path); this.$store.commit("serviceShopMenuAct", v.path);
...@@ -192,7 +227,7 @@ export default { ...@@ -192,7 +227,7 @@ export default {
} }
}, },
getList() { getList() {
this.$api.serviceShop.getShoppingCart().then(response => { this.$api.serviceShop.getShoppingCart().then((response) => {
if (response.data.success == "1") { if (response.data.success == "1") {
console.log(response.data.data); console.log(response.data.data);
this.shopping_list = response.data.data.valid this.shopping_list = response.data.data.valid
...@@ -202,8 +237,8 @@ export default { ...@@ -202,8 +237,8 @@ export default {
console.log(response.data.message); console.log(response.data.message);
} }
}); });
} },
} },
}; };
</script> </script>
......
This diff is collapsed.
...@@ -4,7 +4,8 @@ Vue.use(Vuex); ...@@ -4,7 +4,8 @@ Vue.use(Vuex);
const store = new Vuex.Store({ const store = new Vuex.Store({
state: { state: {
role: 2, // 0:普通用户,1:组织管理员,2:超级管理员 role: 0, // 0:普通用户,1:组织管理员,2:超级管理员
userInfo: null, // 用户信息
serviceShopMenu: "/shop/data_service_list", // 服务超市侧边栏 serviceShopMenu: "/shop/data_service_list", // 服务超市侧边栏
fwglNav: [ fwglNav: [
["注册发布的服务", "申请的服务" /* , "云资源服务" */], // 普通用户 ["注册发布的服务", "申请的服务" /* , "云资源服务" */], // 普通用户
...@@ -19,8 +20,26 @@ const store = new Vuex.Store({ ...@@ -19,8 +20,26 @@ const store = new Vuex.Store({
shoppingCart: [], //购物车 shoppingCart: [], //购物车
menuCartState: 0, //购物车操作都要修改这个值,menu监听这个值的变化实时获取购物车列表 menuCartState: 0, //购物车操作都要修改这个值,menu监听这个值的变化实时获取购物车列表
}, },
modules: {}, getters: {
// 1:超管 2:组织管理员 3:普通用户 4:开发者
is_admin: (state) => {
return (state.userInfo && state.userInfo.is_admin) || 3;
},
// 0:普通用户,1:组织管理员,2:超级管理员
level: (state, getters) => {
if (getters.is_admin == 1) {
return 2;
} else if (getters.is_admin == 2) {
return 1;
} else {
return 0;
}
},
},
mutations: { mutations: {
userInfofun(state, newValue) {
state.userInfo = newValue;
},
rolefun(state, newValue) { rolefun(state, newValue) {
state.role = newValue; state.role = newValue;
}, },
...@@ -32,7 +51,7 @@ const store = new Vuex.Store({ ...@@ -32,7 +51,7 @@ const store = new Vuex.Store({
}, },
setMenuCartState(state) { setMenuCartState(state) {
state.menuCartState++; state.menuCartState++;
} },
}, },
}); });
......
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