File tree Expand file tree Collapse file tree 1 file changed +24
-5
lines changed Expand file tree Collapse file tree 1 file changed +24
-5
lines changed Original file line number Diff line number Diff line change 25
25
</li >
26
26
<li class =" list-group-item" >
27
27
<svg-icon icon-class =" tree" />所属部门
28
- <div v-if = " user.dept " class =" pull-right" >{{ user.dept. deptName }} / {{ postGroup }}</div >
28
+ <div class =" pull-right" >{{ deptName }}</div >
29
29
</li >
30
30
<li class =" list-group-item" >
31
31
<svg-icon icon-class =" peoples" />所属角色
32
- <div class =" pull-right" >{{ roleGroup }}</div >
32
+ <div class =" pull-right" >{{ roleName }}</div >
33
33
</li >
34
34
<li class =" list-group-item" >
35
35
<svg-icon icon-class =" date" />创建日期
@@ -72,7 +72,14 @@ export default {
72
72
user: {},
73
73
roleGroup: {},
74
74
postGroup: {},
75
- activeTab: ' userinfo'
75
+ deptGroup: {},
76
+ activeTab: ' userinfo' ,
77
+ roleIds: undefined ,
78
+ postIds: undefined ,
79
+ roleName: undefined ,
80
+ postName: undefined ,
81
+ dept: {},
82
+ deptName: undefined
76
83
}
77
84
},
78
85
created () {
@@ -82,8 +89,20 @@ export default {
82
89
getUser () {
83
90
getUserProfile ().then (response => {
84
91
this .user = response .data
85
- this .roleGroup = response .roleGroup
86
- this .postGroup = response .postGroup
92
+ this .roleIds = response .roleIds
93
+ this .roleGroup = response .roles
94
+
95
+ if (this .roleIds [0 ]) {
96
+ for (const key in this .roleGroup ) {
97
+ if (this .roleIds [0 ] === this .roleGroup [key].roleId ) {
98
+ this .roleName = this .roleGroup [key].roleName
99
+ }
100
+ }
101
+ } else {
102
+ this .roleName = ' 暂无'
103
+ }
104
+ this .dept = response .dept
105
+ this .deptName = this .dept .deptName
87
106
})
88
107
}
89
108
}
You can’t perform that action at this time.
0 commit comments