Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
apaas-ui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gzga-jzapi
apaas-ui
Commits
10a908b0
Commit
10a908b0
authored
Jun 12, 2020
by
徐一鸣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工作台服务管理和应用管理跳转
parent
d152b930
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
533 additions
and
450 deletions
+533
-450
src/App.vue
src/App.vue
+19
-3
src/components/menu.vue
src/components/menu.vue
+78
-43
src/pages/workbench/workPlace.vue
src/pages/workbench/workPlace.vue
+414
-401
src/store/index.js
src/store/index.js
+22
-3
No files found.
src/App.vue
View file @
10a908b0
...
...
@@ -12,8 +12,24 @@ export default {
components
:
{
bdMenu
,
},
methods
:
{},
created
()
{},
methods
:
{
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
>
...
...
@@ -28,4 +44,4 @@ export default {
background-color
:
#f6f7fb
;
font-size
:
14px
;
}
</
style
>
\ No newline at end of file
</
style
>
src/components/menu.vue
View file @
10a908b0
<
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"
>
<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
class=
"user_menu"
>
...
...
@@ -9,11 +12,16 @@
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"
>
...
...
@@ -25,23 +33,40 @@
>
<img
:src=
"item.service.cover"
class=
"shop_img"
/>
<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
}}
</p>
<p
class=
"shop_cell_msg bover_one"
>
{{
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>
<p
@
click=
"getDetail(item.id)"
class=
"shop_cell_name over_one"
>
{{
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
}}
</p>
<p
class=
"shop_cell_msg over_one"
>
{{
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>
...
...
@@ -56,14 +81,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>
...
...
@@ -81,21 +116,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
:
"
服务超市
"
,
...
...
@@ -103,34 +138,34 @@ 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
:
[
...
...
@@ -138,9 +173,9 @@ export default {
{
name
:
"
消息通知
"
,
path
:
"
/user/message
"
},
{
name
:
"
收银中心
"
,
path
:
"
/authority
"
},
{
name
:
"
关于BD-aPaaS
"
,
path
:
"
/data_analysis
"
},
{
name
:
"
退出登录
"
,
path
:
""
}
{
name
:
"
退出登录
"
,
path
:
""
}
,
],
shopping_list
:
[]
shopping_list
:
[]
,
};
},
mounted
()
{
...
...
@@ -149,12 +184,12 @@ export default {
computed
:
{
getMenuCartState
()
{
return
this
.
$store
.
state
.
menuCartState
;
}
}
,
},
watch
:
{
getMenuCartState
(
newVal
)
{
this
.
getList
();
}
}
,
},
methods
:
{
gotopage
(
n
)
{
...
...
@@ -165,7 +200,7 @@ export default {
},
deleteItem
(
id
)
{
let
query
=
[
id
];
this
.
$api
.
serviceShop
.
delShoppingCart
(
query
).
then
(
response
=>
{
this
.
$api
.
serviceShop
.
delShoppingCart
(
query
).
then
(
(
response
)
=>
{
this
.
getList
();
});
},
...
...
@@ -181,7 +216,7 @@ export default {
gotoChildPage
(
v
,
parent
)
{
if
(
v
.
path
)
{
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
)
{
this
.
$router
.
push
(
v
.
path
);
this
.
$store
.
commit
(
"
serviceShopMenuAct
"
,
v
.
path
);
...
...
@@ -192,7 +227,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
...
...
@@ -202,8 +237,8 @@ export default {
console
.
log
(
response
.
data
.
message
);
}
});
}
}
}
,
}
,
};
</
script
>
...
...
src/pages/workbench/workPlace.vue
View file @
10a908b0
This diff is collapsed.
Click to expand it.
src/store/index.js
View file @
10a908b0
...
...
@@ -4,7 +4,8 @@ Vue.use(Vuex);
const
store
=
new
Vuex
.
Store
({
state
:
{
role
:
2
,
// 0:普通用户,1:组织管理员,2:超级管理员
role
:
0
,
// 0:普通用户,1:组织管理员,2:超级管理员
userInfo
:
null
,
// 用户信息
serviceShopMenu
:
"
/shop/data_service_list
"
,
// 服务超市侧边栏
fwglNav
:
[
[
"
注册发布的服务
"
,
"
申请的服务
"
/* , "云资源服务" */
],
// 普通用户
...
...
@@ -19,8 +20,26 @@ const store = new Vuex.Store({
shoppingCart
:
[],
//购物车
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
:
{
userInfofun
(
state
,
newValue
)
{
state
.
userInfo
=
newValue
;
},
rolefun
(
state
,
newValue
)
{
state
.
role
=
newValue
;
},
...
...
@@ -32,7 +51,7 @@ const store = new Vuex.Store({
},
setMenuCartState
(
state
)
{
state
.
menuCartState
++
;
}
}
,
},
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment