Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
smart
Project
Project
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
wangqinghua
smart
Commits
0a769e8f
Commit
0a769e8f
authored
Dec 12, 2018
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
0df53618
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
114 additions
and
12 deletions
+114
-12
app.main.module.ts
src/main/webapp/app/app.main.module.ts
+3
-1
select-role.component.html
...n/webapp/app/modal/select-role/select-role.component.html
+34
-0
select-role.component.ts
...ain/webapp/app/modal/select-role/select-role.component.ts
+26
-0
basic-detail.component.html
...pp/overAll/basic/basic-detail/basic-detail.component.html
+3
-3
basic-detail.component.ts
.../app/overAll/basic/basic-detail/basic-detail.component.ts
+1
-0
group.component.html
src/main/webapp/app/system/group/group.component.html
+5
-1
group.component.ts
src/main/webapp/app/system/group/group.component.ts
+7
-1
power.component.html
src/main/webapp/app/system/power/power.component.html
+3
-2
power.component.ts
src/main/webapp/app/system/power/power.component.ts
+27
-4
system.service.ts
src/main/webapp/app/system/system.service.ts
+5
-0
No files found.
src/main/webapp/app/app.main.module.ts
View file @
0a769e8f
...
...
@@ -73,6 +73,7 @@ import {JhiTranslateComponent} from 'ng-jhipster';
import
{
LookPlanComponent
}
from
'./work/modal/look-plan/look-plan.component'
;
import
{
PlanModalComponent
}
from
'./work/modal/plan-modal/plan-modal.component'
;
import
{
SelectPersonComponent
}
from
'./modal/select-person/select-person.component'
;
import
{
SelectRoleComponent
}
from
'./modal/select-role/select-role.component'
;
@
NgModule
({
imports
:
[
...
...
@@ -145,7 +146,8 @@ import {SelectPersonComponent} from './modal/select-person/select-person.compone
ToUtilPipe
,
LookPlanComponent
,
PlanModalComponent
,
SelectPersonComponent
SelectPersonComponent
,
SelectRoleComponent
],
providers
:[
OverAllService
,
...
...
src/main/webapp/app/modal/select-role/select-role.component.html
0 → 100644
View file @
0a769e8f
<!--添加资源-->
<nz-modal
[
nzWidth
]="
1080
"
[(
nzVisible
)]="
isVisible
"
[
nzTitle
]="
title
"
(
nzOnCancel
)="
handleEditCancel
()"
(
nzOnOk
)="
handEditleOk
()"
>
<nz-table
#
basicTable
[
nzData
]="
dataSet
"
>
<thead>
<tr>
<th>
角色名称
</th>
<th>
说明
</th>
<th>
权限模块
</th>
<th>
资源权限
</th>
<th>
有效
</th>
<th>
操作
</th>
</tr>
</thead>
<tbody>
<tr
*
ngFor=
"let data of basicTable.data"
>
<td>
{{data.name}}
</td>
<td>
{{data.comments}}
</td>
<td>
{{data.key3}}
</td>
<td>
{{data.key4}}
</td>
<td>
<ng-container
*
ngIf=
"data.status == 0"
>
<i
class=
"anticon anticon-check"
></i>
</ng-container>
</td>
<td
class=
"handle"
>
<span
(
click
)="
grantUser
(
data
)"
>
授予用户
</span>
<span>
查看
</span>
<span
(
click
)="
showEditModal
(
data
.
id
)"
>
编辑
</span>
<span
(
click
)="
deleteRole
(
data
)"
>
删除
</span>
</td>
</tr>
</tbody>
</nz-table>
</nz-modal>
src/main/webapp/app/modal/select-role/select-role.component.ts
0 → 100644
View file @
0a769e8f
import
{
Component
,
OnInit
}
from
'@angular/core'
;
@
Component
({
selector
:
'smart-select-role'
,
templateUrl
:
'./select-role.component.html'
,
styles
:
[]
})
export
class
SelectRoleComponent
implements
OnInit
{
title
;
isVisible
=
false
;
constructor
()
{
}
ngOnInit
()
{
}
showModal
(
title
){
this
.
title
=
title
;
this
.
isVisible
=
true
;
}
getRoleList
(){
}
}
src/main/webapp/app/overAll/basic/basic-detail/basic-detail.component.html
View file @
0a769e8f
...
...
@@ -29,9 +29,9 @@
</div>
<div
class=
"releative"
#
checkEle
>
<div
#
colorEle
class=
"checkTags tag-form"
>
<span
(
click
)="
getCheckList
(
0
)"
>
<nz-tag
[
nzColor
]="
color
.
green
"
></nz-tag>
<i
*
ngIf=
"!checkStatus.normal && checkStatus.normal !=0"
class=
"anticon anticon-spin anticon-loading"
style=
"font-size: 15px;"
></i
>
{{checkStatus.normal}}
<span
(
click
)="
getCheckList
(
0
)"
>
<nz-tag
[
nzColor
]="
color
.
green
"
></nz-tag
>
<i
*
ngIf=
"!checkStatus.normal && checkStatus.normal !=0"
class=
"anticon anticon-spin anticon-loading"
style=
"font-size: 15px;"
></i>
{{checkStatus.normal}}
</span>
<span
(
click
)="
getCheckList
(
1
)"
>
<nz-tag
[
nzColor
]="
color
.
yellow
"
></nz-tag>
<i
*
ngIf=
"!checkStatus.warning && checkStatus.warning !=0"
class=
"anticon anticon-spin anticon-loading"
style=
"font-size: 15px;"
></i>
...
...
src/main/webapp/app/overAll/basic/basic-detail/basic-detail.component.ts
View file @
0a769e8f
...
...
@@ -18,6 +18,7 @@ import {DatePipe} from '@angular/common';
position: absolute;
top: 12px;
left: 233px;
z-index: 9999999;
}
.time-select{
position: absolute;
...
...
src/main/webapp/app/system/group/group.component.html
View file @
0a769e8f
...
...
@@ -68,6 +68,7 @@
<td>
{{data.mobile}}
</td>
<td>
{{data.key4}}
</td>
<td
class=
"handle"
>
<span
(
click
)="
grantRole
(
data
)"
>
授权
</span>
<span>
查看
</span>
<span>
编辑
</span>
<span
(
click
)="
deleteUser
(
data
)"
>
删除
</span>
...
...
@@ -77,7 +78,10 @@
</nz-table>
</div>
</div>
<!--新增用户-->
<smart-user
#
smartUser
></smart-user>
<!--新增部门-->
<smart-group-modal
#
smartGroupModal
></smart-group-modal>
<!--授予角色-->
<smart-select-role
#
smartSelectRole
></smart-select-role>
src/main/webapp/app/system/group/group.component.ts
View file @
0a769e8f
...
...
@@ -4,6 +4,7 @@ import {SystemService} from '../system.service';
import
{
UserComponent
}
from
'../modal/user/user.component'
;
import
{
GroupModalComponent
}
from
'../modal/group-modal/group-modal.component'
;
import
{
ToTree
}
from
'../../shared/common/toTree'
;
import
{
SelectRoleComponent
}
from
'../../modal/select-role/select-role.component'
;
@
Component
({
selector
:
'jhi-group'
,
...
...
@@ -11,7 +12,7 @@ import {ToTree} from '../../shared/common/toTree';
styles
:
[]
})
export
class
GroupComponent
implements
OnInit
{
@
ViewChild
(
"smartSelectRole"
)
smartSelectRole
:
SelectRoleComponent
;
@
ViewChild
(
'power'
)
power
;
@
ViewChild
(
'smartUser'
)
smartUser
:
UserComponent
;
@
ViewChild
(
'smartGroupModal'
)
smartGroupModal
:
GroupModalComponent
;
...
...
@@ -142,4 +143,9 @@ export class GroupComponent implements OnInit {
this
.
smartGroupModal
.
showModal
(
this
.
groupList
);
}
//授予角色
grantRole
(
data
){
this
.
smartSelectRole
.
showModal
(
"选择角色"
);
}
}
src/main/webapp/app/system/power/power.component.html
View file @
0a769e8f
...
...
@@ -63,4 +63,5 @@
<!--新增角色-->
<smart-role
#
smartRole
(
add
)="
getRole
()"
></smart-role>
<smart-select-person
#
smartSelectPerson
></smart-select-person>
\ No newline at end of file
<smart-select-person
#
smartSelectPerson
(
done
)="
batchAdduserToRole
($
event
)"
></smart-select-person>
\ No newline at end of file
src/main/webapp/app/system/power/power.component.ts
View file @
0a769e8f
...
...
@@ -16,6 +16,8 @@ export class PowerComponent implements OnInit {
dataSet
:
any
[];
isVisible
=
false
;
roleId
;
//角色id
constructor
(
private
systemSer
:
SystemService
,
private
message
:
NzMessageService
,
private
modalSer
:
NzModalService
)
{
}
...
...
@@ -43,10 +45,34 @@ export class PowerComponent implements OnInit {
}
//授予用户
grantUser
(){
grantUser
(
data
){
this
.
roleId
=
data
.
id
;
this
.
smartSelectPerson
.
showModal
(
"授予用户"
);
}
//但一角色批量添加用户
batchAdduserToRole
(
e
){
console
.
log
(
e
);
let
str
=
""
;
e
.
forEach
(
res
=>
{
str
+=
res
.
id
+
","
;
});
str
=
str
.
substring
(
0
,
str
.
length
-
1
);
const
data
=
{
roleId
:
this
.
roleId
,
users
:
str
}
this
.
systemSer
.
batchGrantUserToRole
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
){
this
.
message
.
success
(
"授予成功"
)
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
}
)
}
//删除角色
deleteRole
(
data
)
{
this
.
modalSer
.
confirm
({
...
...
@@ -76,7 +102,4 @@ export class PowerComponent implements OnInit {
e
.
preventDefault
();
}
hello
()
{
}
}
src/main/webapp/app/system/system.service.ts
View file @
0a769e8f
...
...
@@ -69,4 +69,9 @@ export class SystemService {
logList
(
data
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/log?'
+
this
.
toTree
.
toQuery
(
data
));
}
//对单一角色批量添加用户
batchGrantUserToRole
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/role/batchGrantUserToRole'
,
data
);
}
}
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