Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
founder_vue
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
常超
founder_vue
Commits
0d8a0f98
Commit
0d8a0f98
authored
Nov 23, 2021
by
liyuhang19990520
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户用户组适配
parent
fae106a3
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
363 additions
and
89 deletions
+363
-89
src/views/SystemManage/GroupManage.vue
+1
-1
src/views/SystemManage/PermissionManage.vue
+147
-25
src/views/SystemManage/UserManage.vue
+91
-18
src/views/SystemManage/scss/group.scss
+6
-3
src/views/SystemManage/scss/permission.scss
+95
-42
src/views/SystemManage/scss/user.scss
+23
-0
No files found.
src/views/SystemManage/GroupManage.vue
View file @
0d8a0f98
...
...
@@ -173,7 +173,7 @@
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"active"
label=
"操作"
:width=
"width4
"
>
<el-table-column
prop=
"active"
label=
"操作"
width=
"auto
"
>
<
template
slot-scope=
"scope"
>
<div
@
click=
"offMultiple()"
>
<Confirmation
content=
"编辑用户"
>
...
...
src/views/SystemManage/PermissionManage.vue
View file @
0d8a0f98
...
...
@@ -90,34 +90,57 @@
<el-table-column
prop=
"policeNumber"
label=
"警号"
show-overflow-tooltip
:width=
"userWidths.width2"
>
</el-table-column>
<el-table-column
prop=
"userGroupNames"
label=
"用户组"
show-overflow-tooltip
:width=
"userWidths.width3"
>
</el-table-column>
<el-table-column
prop=
"unitName"
label=
"所属单位"
:width=
"userWidths.width5"
show-overflow-tooltip
:width=
"userWidths.width3"
>
</el-table-column>
<el-table-column
prop=
"roleNames"
label=
"角色"
:width=
"
userWidths.width4
"
:width=
"
newWidth
"
show-overflow-tooltip
>
<template
slot-scope=
"scope"
>
<div
class=
"tags"
v-for=
"item in scope.row.roleNames &&
scope.row.roleNames.split(',')"
>
{{
item
}}
<div
class=
"tagsBox"
>
<div
class=
"tags"
v-for=
"item in strArr(scope.row.roleNames).arr"
:key=
"item"
>
{{
item
}}
</div>
<el-tooltip
class=
"item"
effect=
"dark"
placement=
"right"
style=
"width: auto !important"
v-if=
"strArr(scope.row.roleNames).length > 3"
>
<span
style=
"margin-left: 5px"
>
...
</span>
<div
slot=
"content"
class=
"tooTipBtn"
>
<div
v-for=
"item in scope.row.roleNames &&
scope.row.roleNames.split(',')"
:key=
"item"
>
{{
item
}}
</div>
</div>
</el-tooltip>
</div>
</
template
>
</el-table-column>
...
...
@@ -131,13 +154,19 @@
<div
v-for=
"(item, index) in scope.row.permissionNames &&
scope.row.permissionNames.split(',')"
:key=
"index"
>
{{
index
>
0
?
"/"
:
""
}}
{{
item
}}
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
"status"
label=
"启用状态"
width=
"110"
>
<el-table-column
prop=
"status"
label=
"启用状态"
width=
"auto"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
v-if=
"scope.row.status === 0"
class=
"circle-red"
></div>
<div
v-if=
"scope.row.status === 1"
class=
"circle-blue"
></div>
...
...
@@ -150,7 +179,11 @@
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"active"
label=
"操作"
>
<el-table-column
prop=
"active"
label=
"操作"
:width=
"userWidths.width1"
>
<
template
slot-scope=
"scope"
>
<img
style=
"
...
...
@@ -257,21 +290,46 @@
align=
"center"
>
</el-table-column>
<el-table-column
prop=
"roleNames"
label=
"角色"
:width=
"groupWidths.width2"
show-overflow-tooltip
>
<el-table-column
prop=
"roleNames"
label=
"组角色"
:width=
"newWidth2"
>
<
template
slot-scope=
"scope"
>
<div
class=
"tagsBox"
>
<div
class=
"tags"
v-for=
"item in strArr(scope.row.roleNames).arr"
:key=
"item"
>
{{
item
}}
</div>
<el-tooltip
class=
"item"
effect=
"dark"
placement=
"right"
style=
"width: auto !important"
v-if=
"strArr(scope.row.roleNames).length > 3"
>
<span
style=
"margin-left: 5px"
>
...
</span>
<div
slot=
"content"
class=
"tooTipBtn"
>
<div
v-for=
"item in scope.row.roleNames &&
scope.row.roleNames.split(',')"
:key=
"item"
>
{{
item
}}
</div>
</div>
</el-tooltip>
</div>
</
template
>
<!-- <template slot-scope="scope">
<div
class="tags"
v-for="item in scope.row.roleNames &&
scope.row.roleNames.split(',')"
:key="item"
>
{{ item }}
</div>
</
template
>
</template>
-->
</el-table-column>
<el-table-column
prop=
"userCount"
...
...
@@ -300,7 +358,6 @@
<div
class=
"set-btn"
:width=
"groupWidths.btnwidth"
>
用户列表
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
"permissionNames"
label=
"权限"
...
...
@@ -311,6 +368,7 @@
<div
v-for=
"(item, index) in scope.row.permissionNames &&
scope.row.permissionNames.split(',')"
:key=
"index"
>
{{
index
>
0
?
"/"
:
""
}}
{{
item
}}
...
...
@@ -318,11 +376,7 @@
</
template
>
</el-table-column>
<el-table-column
prop=
"status"
label=
"启用状态"
align=
"center"
>
<el-table-column
prop=
"status"
label=
"启用状态"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
v-if=
"scope.row.status === 0"
class=
"circle-red"
></div>
<div
v-if=
"scope.row.status === 1"
class=
"circle-blue"
></div>
...
...
@@ -335,7 +389,11 @@
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"active"
label=
"操作"
width=
"70"
>
<el-table-column
prop=
"active"
label=
"操作"
:width=
"userWidths.width1"
>
<
template
slot-scope=
"scope"
>
<img
style=
"
...
...
@@ -413,7 +471,7 @@ export default {
// 用户列表的表格宽度
userWidths
:
{
width4
:
350
,
width3
:
20
0
,
width3
:
13
0
,
width2
:
100
,
width5
:
220
,
width1
:
120
,
...
...
@@ -469,6 +527,56 @@ export default {
)
+
1
);
},
newWidth
()
{
let
w1
=
1920
;
let
w2
=
window
.
innerWidth
;
let
map
=
this
.
userTableData
.
map
((
i
)
=>
i
.
roleNames
.
split
(
","
));
let
num
=
0
;
let
width
;
map
.
forEach
((
i
)
=>
{
if
(
i
.
length
>
num
)
num
=
i
.
length
;
});
if
(
num
<=
3
)
{
width
=
num
*
150
;
if
(
num
==
1
)
{
width
+=
100
;
}
else
if
(
num
==
2
)
{
width
+=
50
;
}
else
if
(
num
==
3
)
{
width
=
480
;
}
}
else
if
(
num
>
3
)
{
width
=
500
;
}
width
=
(
width
*
w2
)
/
w1
;
return
width
;
},
newWidth2
()
{
let
w1
=
1920
;
let
w2
=
window
.
innerWidth
;
let
map
=
this
.
groupTableData
.
map
((
i
)
=>
i
.
roleNames
.
split
(
","
));
let
num
=
0
;
let
width
;
map
.
forEach
((
i
)
=>
{
if
(
i
.
length
>
num
)
num
=
i
.
length
;
});
if
(
num
<=
3
)
{
width
=
num
*
150
;
if
(
num
==
1
)
{
width
+=
100
;
}
else
if
(
num
==
2
)
{
width
+=
50
;
}
else
if
(
num
==
3
)
{
width
=
480
;
}
}
else
if
(
num
>
3
)
{
width
=
500
;
}
width
=
(
width
*
w2
)
/
w1
;
return
width
;
},
// 计算总页数
groupTpage
()
{
return
(
...
...
@@ -486,6 +594,20 @@ export default {
this
.
searchUser
();
this
.
key1
+=
1
;
},
strArr
(
str
)
{
let
arr
=
str
.
split
(
","
);
let
newArr
=
[];
if
(
arr
.
length
>
3
)
{
newArr
=
arr
.
slice
(
0
,
3
);
}
else
{
newArr
=
arr
;
}
let
obj
=
{
arr
:
newArr
,
length
:
arr
.
length
,
};
return
obj
;
},
getGroup
()
{
this
.
isUser
=
false
;
this
.
isGroup
=
true
;
...
...
src/views/SystemManage/UserManage.vue
View file @
0d8a0f98
...
...
@@ -107,11 +107,26 @@
>
<el-table-column
type=
"selection"
height
width=
"auto"
>
</el-table-column>
<el-table-column
prop=
"username"
label=
"用户名"
:width=
"width1"
>
<el-table-column
prop=
"username"
label=
"用户名"
:width=
"width1"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
prop=
"name"
label=
"姓名"
:width=
"width1"
>
<el-table-column
prop=
"name"
label=
"姓名"
:width=
"width1"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
prop=
"policeNumber"
label=
"警号"
:width=
"width2"
>
<el-table-column
prop=
"policeNumber"
label=
"警号"
:width=
"width2"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
prop=
"userGroupNames"
...
...
@@ -120,22 +135,41 @@
:width=
"width3"
>
</el-table-column>
<el-table-column
prop=
"unitName"
label=
"所属单位"
:width=
"width5"
>
</el-table-column>
<el-table-column
prop=
"
roleNames
"
label=
"
角色
"
:width=
"width
4
"
prop=
"
unitName
"
label=
"
所属单位
"
:width=
"width
3
"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
prop=
"roleNames"
label=
"角色"
:width=
"newWidth"
>
<template
slot-scope=
"scope"
>
<div
class=
"tags"
v-for=
"item in scope.row.roleNames &&
scope.row.roleNames.split(',')"
:key=
"item"
>
{{
item
}}
<div
class=
"tagsBox"
>
<div
class=
"tags"
v-for=
"item in strArr(scope.row.roleNames).arr"
:key=
"item"
>
{{
item
}}
</div>
<el-tooltip
class=
"item"
effect=
"dark"
placement=
"right"
style=
"width: auto !important"
v-if=
"strArr(scope.row.roleNames).length > 3"
>
<span
style=
"margin-left: 5px"
>
...
</span>
<div
slot=
"content"
class=
"tooTipBtn"
>
<div
v-for=
"item in scope.row.roleNames &&
scope.row.roleNames.split(',')"
:key=
"item"
>
{{
item
}}
</div>
</div>
</el-tooltip>
</div>
</
template
>
</el-table-column>
...
...
@@ -156,7 +190,7 @@
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
"status"
label=
"启用状态"
:width=
"width1
"
>
<el-table-column
prop=
"status"
label=
"启用状态"
align=
"center
"
>
<
template
slot-scope=
"scope"
>
<div
v-if=
"scope.row.status === 0"
class=
"circle-red"
></div>
<div
v-if=
"scope.row.status === 1"
class=
"circle-blue"
></div>
...
...
@@ -169,7 +203,7 @@
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"active"
label=
"操作"
>
<el-table-column
prop=
"active"
label=
"操作"
:width=
"width2"
>
<
template
slot-scope=
"scope"
>
<div
@
click=
"offMultiple()"
>
<Confirmation
content=
"编辑用户"
>
...
...
@@ -539,7 +573,7 @@ export default {
};
return
{
width4
:
350
,
width3
:
20
0
,
width3
:
13
0
,
width2
:
100
,
width5
:
220
,
width1
:
100
,
...
...
@@ -666,6 +700,31 @@ export default {
};
},
computed
:
{
newWidth
()
{
let
w1
=
1920
;
let
w2
=
window
.
innerWidth
;
let
map
=
this
.
tableData
.
map
((
i
)
=>
i
.
roleNames
.
split
(
","
));
let
num
=
0
;
let
width
;
map
.
forEach
((
i
)
=>
{
if
(
i
.
length
>
num
)
num
=
i
.
length
;
});
if
(
num
<=
3
)
{
width
=
num
*
150
;
if
(
num
==
1
)
{
width
+=
100
;
}
else
if
(
num
==
2
)
{
width
+=
50
;
}
else
if
(
num
==
3
)
{
width
=
480
;
}
}
else
if
(
num
>
3
)
{
width
=
500
;
}
width
=
(
width
*
w2
)
/
w1
;
return
width
;
},
// 计算总页数
Tpage
()
{
return
(
...
...
@@ -714,6 +773,20 @@ export default {
}
});
},
strArr
(
str
)
{
let
arr
=
str
.
split
(
","
);
let
newArr
=
[];
if
(
arr
.
length
>
3
)
{
newArr
=
arr
.
slice
(
0
,
3
);
}
else
{
newArr
=
arr
;
}
let
obj
=
{
arr
:
newArr
,
length
:
arr
.
length
,
};
return
obj
;
},
// 编辑
submitEditForm
(
formName
)
{
this
.
$refs
.
editFormParams
.
validate
((
valid
)
=>
{
...
...
src/views/SystemManage/scss/group.scss
View file @
0d8a0f98
.tooTipBtn
{
padding
:
10px
;
>
div
{
>
div
{
width
:
100px
;
height
:
24px
;
background
:
#5
E5E5E
;
background
:
#5
e5e5e
;
border-radius
:
4px
;
text-align
:
center
;
margin-bottom
:
15px
;
line-height
:
24px
;
&
:last-of-type
{
&
:last-of-type
{
margin-bottom
:
0
;
}
}
...
...
@@ -160,6 +160,9 @@
border-radius
:
4px
;
text-align
:
center
;
margin-right
:
3px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
}
.circle-red
{
width
:
8px
;
...
...
src/views/SystemManage/scss/permission.scss
View file @
0d8a0f98
.tooTipBtn
{
padding
:
10px
;
>
div
{
width
:
100px
;
height
:
24px
;
background
:
#5e5e5e
;
border-radius
:
4px
;
text-align
:
center
;
margin-bottom
:
15px
;
line-height
:
24px
;
&
:last-of-type
{
margin-bottom
:
0
;
}
}
}
.manage-page
{
width
:
100%
;
padding
:
24px
;
...
...
@@ -7,30 +21,30 @@
display
:
inline-block
;
}
//用户和用户组切换按钮
.header
{
width
:
100%
;
.btns
{
.header
{
width
:
100%
;
.btns
{
width
:
260px
;
height
:
40px
;
.btn
{
.btn
{
text-align
:
center
;
width
:
129px
;
height
:
32px
;
font-size
:
14px
;
color
:
#282
F3C
;
background
:
#
F6F8FA
;
color
:
#282
f3c
;
background
:
#
f6f8fa
;
border-radius
:
2px
;
line-height
:
32px
;
cursor
:
pointer
;
&
.active
{
background
:
#055
FE
7
;
color
:
#
FFFFFF
;
&
.active
{
background
:
#055
fe
7
;
color
:
#
ffffff
;
}
}
}
}
}
// 用户
.user
{
.user
{
width
:
100%
;
height
:
870px
;
.search
{
...
...
@@ -59,7 +73,7 @@
}
}
.btn
{
position
:absolute
;
position
:
absolute
;
top
:
125px
;
right
:
24px
;
width
:
95px
;
...
...
@@ -73,24 +87,44 @@
cursor
:
pointer
;
}
}
.table
{
.table
{
height
:
750px
;
width
:
100%
;
margin-top
:
10px
;
border-top
:
1px
solid
#EEEEEE
;
.tags
{
width
:
100px
;
border-top
:
1px
solid
#eeeeee
;
.tagsBox
{
display
:
flex
;
.el-tooltip
{
width
:
auto
!
important
;
}
}
.tags
{
flex-shrink
:
0
;
width
:
140px
;
height
:
24px
;
background
:
#
F0F3F
6
;
background
:
#
f0f3f
6
;
border-radius
:
4px
;
text-align
:
center
;
margin-right
:
3px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
}
.circle-red
{
width
:
8px
;
height
:
8px
;
background-color
:
#FE0000
;
border-radius
:
50%
;
-moz-border-radius
:
50%
;
-webkit-border-radius
:
50%
;
.circle-red
{
width
:
8px
;
height
:
8px
;
background-color
:
#fe0000
;
border-radius
:
50%
;
-moz-border-radius
:
50%
;
-webkit-border-radius
:
50%
;
}
.circle-blue
{
width
:
8px
;
height
:
8px
;
background-color
:
#055FE7
;
border-radius
:
50%
;
-moz-border-radius
:
50%
;
-webkit-border-radius
:
50%
;
.circle-blue
{
width
:
8px
;
height
:
8px
;
background-color
:
#055fe7
;
border-radius
:
50%
;
-moz-border-radius
:
50%
;
-webkit-border-radius
:
50%
;
}
}
.footer
{
...
...
@@ -138,7 +172,7 @@
}
}
// 用户组
.group
{
.group
{
width
:
100%
;
height
:
870px
;
.search
{
...
...
@@ -166,7 +200,7 @@
//margin-top: 8px;
}
}
.clear
{
.clear
{
width
:
38px
;
border
:
none
;
height
:
22px
;
...
...
@@ -176,7 +210,7 @@
font-weight
:
350
;
color
:
#333333
;
text-align
:
center
;
position
:absolute
;
position
:
absolute
;
top
:
130px
;
right
:
124px
;
cursor
:
pointer
;
...
...
@@ -188,7 +222,7 @@
}
}
.btn
{
position
:absolute
;
position
:
absolute
;
top
:
125px
;
right
:
24px
;
width
:
95px
;
...
...
@@ -202,43 +236,63 @@
cursor
:
pointer
;
}
}
.table
{
.table
{
height
:
750px
;
width
:
100%
;
margin-top
:
10px
;
border-top
:
1px
solid
#EEEEEE
;
.tags
{
width
:
100px
;
border-top
:
1px
solid
#eeeeee
;
.tagsBox
{
display
:
flex
;
.el-tooltip
{
width
:
auto
!
important
;
}
}
.tags
{
flex-shrink
:
0
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
width
:
140px
;
height
:
24px
;
background
:
#
F0F3F
6
;
background
:
#
f0f3f
6
;
border-radius
:
4px
;
text-align
:
center
;
margin-right
:
3px
;
}
.circle-red
{
width
:
8px
;
height
:
8px
;
background-color
:
#FE0000
;
border-radius
:
50%
;
-moz-border-radius
:
50%
;
-webkit-border-radius
:
50%
;
.circle-red
{
width
:
8px
;
height
:
8px
;
background-color
:
#fe0000
;
border-radius
:
50%
;
-moz-border-radius
:
50%
;
-webkit-border-radius
:
50%
;
}
.circle-blue
{
width
:
8px
;
height
:
8px
;
background-color
:
#055FE7
;
border-radius
:
50%
;
-moz-border-radius
:
50%
;
-webkit-border-radius
:
50%
;
.circle-blue
{
width
:
8px
;
height
:
8px
;
background-color
:
#055fe7
;
border-radius
:
50%
;
-moz-border-radius
:
50%
;
-webkit-border-radius
:
50%
;
}
.group-item
{
.group-item
{
width
:
70px
;
height
:
24px
;
background
:
#
F0F3F
6
;
background
:
#
f0f3f
6
;
border-radius
:
12px
;
font-size
:
16px
;
font-weight
:
bold
;
color
:
#282
F3C
;
color
:
#282
f3c
;
line-height
:
24px
;
text-align
:
center
;
margin-right
:
12px
;
}
.set-btn
{
.set-btn
{
width
:
56px
;
height
:
22px
;
font-size
:
14px
;
font-family
:
MicrosoftYaHei
;
color
:
#055
FE
7
;
color
:
#055
fe
7
;
line-height
:
22px
;
cursor
:
pointer
;
//position: absolute;
...
...
@@ -308,4 +362,4 @@
padding
:
0
;
font-weight
:
400
;
}
}
\ No newline at end of file
}
src/views/SystemManage/scss/user.scss
View file @
0d8a0f98
.tooTipBtn
{
padding
:
10px
;
>
div
{
width
:
100px
;
height
:
24px
;
background
:
#5e5e5e
;
border-radius
:
4px
;
text-align
:
center
;
margin-bottom
:
15px
;
line-height
:
24px
;
&
:last-of-type
{
margin-bottom
:
0
;
}
}
}
.manage-page
{
width
:
100%
;
padding
:
24px
;
...
...
@@ -135,7 +150,14 @@
.table-data
{
height
:
580px
;
width
:
100%
;
.tagsBox
{
display
:
flex
;
.el-tooltip
{
width
:
auto
!
important
;
}
}
.tags
{
flex-shrink
:
0
;
width
:
140px
;
height
:
24px
;
overflow
:
hidden
;
...
...
@@ -163,6 +185,7 @@
-webkit-border-radius
:
50%
;
}
}
.footer
{
width
:
1544px
;
//width: calc(100vw - 367px);
...
...
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