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
8f89c614
Commit
8f89c614
authored
Dec 19, 2018
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
2b1ed70b
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
173 additions
and
106 deletions
+173
-106
home.component.html
src/main/webapp/app/home/home.component.html
+27
-34
home.component.ts
src/main/webapp/app/home/home.component.ts
+5
-30
group.component.html
src/main/webapp/app/system/group/group.component.html
+8
-6
group.component.ts
src/main/webapp/app/system/group/group.component.ts
+50
-13
user.component.html
src/main/webapp/app/system/modal/user/user.component.html
+9
-9
user.component.ts
src/main/webapp/app/system/modal/user/user.component.ts
+57
-12
system.service.ts
src/main/webapp/app/system/system.service.ts
+17
-2
No files found.
src/main/webapp/app/home/home.component.html
View file @
8f89c614
<p-table
[
value
]="
sales
"
>
<!--资源可用性统计-->
<ng-template
pTemplate=
"header"
>
<div
nz-row
class=
"breadcrumbs"
>
<tr>
<div
nz-col
nzSpan=
"16"
>
<th
rowspan=
"3"
>
Brand
</th>
<nz-breadcrumb
class=
"padding-8-0"
>
<th
colspan=
"4"
>
Sale Rate
</th>
<nz-breadcrumb-item>
</tr>
当前位置:首页
<tr>
</nz-breadcrumb-item>
<th
colspan=
"2"
>
Sales
</th>
</nz-breadcrumb>
<th
colspan=
"2"
>
Profits
</th>
</div>
</tr>
<div
nz-col
nzSpan=
"8"
class=
"text-right"
>
<tr>
<button
(
click
)="
search
()"
nz-button
nzType=
"primary"
><i
class=
"anticon anticon-search"
></i></button>
<th>
Last Year
</th>
<button
nz-button
nzType=
"primary"
><i
class=
"anticon anticon-sync"
></i></button>
<th>
This Year
</th>
<button
nz-button
nzType=
"primary"
><i
class=
"anticon anticon-arrows-alt"
></i></button>
<th>
Last Year
</th>
</div>
<th>
This Year
</th>
</div>
</tr>
<div
nz-row
nzGutter=
"4"
>
</ng-template>
<div
nz-col
nzSpan=
"16"
>
<ng-template
pTemplate=
"body"
let-sale
>
<nz-spin
[
nzSpinning
]="
isTopLoading
"
>
<tr>
<div
echarts
[
options
]="
chartTopOption
"
style=
"height: 400px;width: 100%"
></div>
<td>
{{sale.brand}}
</td>
</nz-spin>
<td>
{{sale.lastYearSale}}
</td>
</div>
<td>
{{sale.thisYearSale}}
</td>
<div
nz-col
nzSpan=
"12"
>
<td>
{{sale.lastYearProfit}}
</td>
<nz-spin
[
nzSpinning
]="
isLastLoading
"
>
<td>
{{sale.thisYearProfit}}
</td>
<div
echarts
[
options
]="
chartLastOption
"
style=
"height: 400px;width: 100%"
></div>
</tr>
</nz-spin>
</ng-template>
</div>
<ng-template
pTemplate=
"footer"
>
</div>
<tr>
<td
colspan=
"3"
>
Totals
</td>
<td>
$506,202
</td>
<td>
$531,020
</td>
</tr>
</ng-template>
</p-table>
src/main/webapp/app/home/home.component.ts
View file @
8f89c614
...
@@ -12,9 +12,11 @@ import { Account, Principal } from '../shared';
...
@@ -12,9 +12,11 @@ import { Account, Principal } from '../shared';
})
})
export
class
HomeComponent
implements
OnInit
{
export
class
HomeComponent
implements
OnInit
{
account
:
Account
;
modalRef
:
NgbModalRef
;
leftOneChart
;
sales
:
any
[];
leftTwoChart
;
rightOneChart
;
rightTwoChart
;
constructor
(
constructor
(
private
principal
:
Principal
,
private
principal
:
Principal
,
...
@@ -23,34 +25,7 @@ export class HomeComponent implements OnInit {
...
@@ -23,34 +25,7 @@ export class HomeComponent implements OnInit {
}
}
ngOnInit
()
{
ngOnInit
()
{
this
.
sales
=
[
{
brand
:
'Apple'
,
lastYearSale
:
'51%'
,
thisYearSale
:
'40%'
,
lastYearProfit
:
'$54,406.00'
,
thisYearProfit
:
'$43,342'
},
{
brand
:
'Samsung'
,
lastYearSale
:
'83%'
,
thisYearSale
:
'96%'
,
lastYearProfit
:
'$423,132'
,
thisYearProfit
:
'$312,122'
},
{
brand
:
'Microsoft'
,
lastYearSale
:
'38%'
,
thisYearSale
:
'5%'
,
lastYearProfit
:
'$12,321'
,
thisYearProfit
:
'$8,500'
},
{
brand
:
'Philips'
,
lastYearSale
:
'49%'
,
thisYearSale
:
'22%'
,
lastYearProfit
:
'$745,232'
,
thisYearProfit
:
'$650,323,'
},
{
brand
:
'Song'
,
lastYearSale
:
'17%'
,
thisYearSale
:
'79%'
,
lastYearProfit
:
'$643,242'
,
thisYearProfit
:
'500,332'
},
{
brand
:
'LG'
,
lastYearSale
:
'52%'
,
thisYearSale
:
' 65%'
,
lastYearProfit
:
'$421,132'
,
thisYearProfit
:
'$150,005'
},
{
brand
:
'Sharp'
,
lastYearSale
:
'82%'
,
thisYearSale
:
'12%'
,
lastYearProfit
:
'$131,211'
,
thisYearProfit
:
'$100,214'
},
{
brand
:
'Panasonic'
,
lastYearSale
:
'44%'
,
thisYearSale
:
'45%'
,
lastYearProfit
:
'$66,442'
,
thisYearProfit
:
'$53,322'
},
{
brand
:
'HTC'
,
lastYearSale
:
'90%'
,
thisYearSale
:
'56%'
,
lastYearProfit
:
'$765,442'
,
thisYearProfit
:
'$296,232'
},
{
brand
:
'Toshiba'
,
lastYearSale
:
'75%'
,
thisYearSale
:
'54%'
,
lastYearProfit
:
'$21,212'
,
thisYearProfit
:
'$12,533'
}
];
// this.principal.identity().then((account) => {
// this.account = account;
// });
// this.registerAuthenticationSuccess();
}
registerAuthenticationSuccess
()
{
this
.
eventManager
.
subscribe
(
'authenticationSuccess'
,
(
message
)
=>
{
this
.
principal
.
identity
().
then
((
account
)
=>
{
this
.
account
=
account
;
});
});
}
isAuthenticated
()
{
return
this
.
principal
.
isAuthenticated
();
}
}
login
()
{
login
()
{
...
...
src/main/webapp/app/system/group/group.component.html
View file @
8f89c614
...
@@ -49,8 +49,8 @@
...
@@ -49,8 +49,8 @@
<div
nz-col
nzSpan=
"18"
>
<div
nz-col
nzSpan=
"18"
>
<div
class=
"padding-15-0"
>
<div
class=
"padding-15-0"
>
<button
(
click
)="
showUserModal
()"
nz-button
nzType=
"primary"
>
新增用户
</button>
<button
(
click
)="
showUserModal
()"
nz-button
nzType=
"primary"
>
新增用户
</button>
<button
nz-button
nzType=
"default"
>
批量删除
</button>
<button
(
click
)="
batchDelete
()"
nz-button
nzType=
"default"
>
批量删除
</button>
<
button
nz-button
nzType=
"default"
>
批量修改
</button
>
<
!--<button nz-button nzType="default">批量修改</button>--
>
<button
nz-button
nzType=
"default"
>
导出模版
</button>
<button
nz-button
nzType=
"default"
>
导出模版
</button>
<button
nz-button
nzType=
"default"
>
导入组织
</button>
<button
nz-button
nzType=
"default"
>
导入组织
</button>
<button
nz-button
nzType=
"default"
>
导入用户
</button>
<button
nz-button
nzType=
"default"
>
导入用户
</button>
...
@@ -72,14 +72,16 @@
...
@@ -72,14 +72,16 @@
<tbody>
<tbody>
<tr
*
ngFor=
"let data of basicTable.data"
>
<tr
*
ngFor=
"let data of basicTable.data"
>
<td
nzShowCheckbox
[(
nzChecked
)]="
data
.
checked
"
(
nzCheckedChange
)="
refreshStatus
($
event
)"
></td>
<td
nzShowCheckbox
[(
nzChecked
)]="
data
.
checked
"
(
nzCheckedChange
)="
refreshStatus
($
event
)"
></td>
<td>
{{data.name}}
</td>
<td>
{{data.
user.
name}}
</td>
<td>
{{data.loginName}}
</td>
<td>
{{data.loginName}}
</td>
<td>
{{data.mobile}}
</td>
<td>
{{data.user.phoneNumber}}
</td>
<td>
{{data.key4}}
</td>
<td>
<span
*
ngFor=
"let item of data.roles"
>
{{item.name}}
</span>
</td>
<td
class=
"handle"
>
<td
class=
"handle"
>
<span
(
click
)="
grantRole
(
data
)"
>
授权
</span>
<span
(
click
)="
grantRole
(
data
)"
>
授权
</span>
<span>
查看
</span>
<span>
查看
</span>
<span>
编辑
</span>
<span
(
click
)="
showEditModal
(
data
)"
>
编辑
</span>
<span
(
click
)="
deleteUser
(
data
)"
>
删除
</span>
<span
(
click
)="
deleteUser
(
data
)"
>
删除
</span>
</td>
</td>
</tr>
</tr>
...
...
src/main/webapp/app/system/group/group.component.ts
View file @
8f89c614
...
@@ -26,24 +26,24 @@ export class GroupComponent implements OnInit {
...
@@ -26,24 +26,24 @@ export class GroupComponent implements OnInit {
nodes
:
any
[];
nodes
:
any
[];
isVisible
=
true
;
isVisible
=
true
;
userId
;
userId
;
displayData
:
Array
<
{
key1
:
string
;
key2
:
number
;
key3
:
string
;
key4
:
string
;
checked
:
boolean
}
>
=
[];
//
displayData: Array<{ key1: string; key2: number; key3: string; key4: string; checked: boolean }> = [];
constructor
(
private
systemSer
:
SystemService
,
private
message
:
NzMessageService
,
constructor
(
private
systemSer
:
SystemService
,
private
message
:
NzMessageService
,
private
modalSer
:
NzModalService
,
private
commonSer
:
CommonService
)
{
private
modalSer
:
NzModalService
,
private
commonSer
:
CommonService
)
{
}
}
checkAll
(
value
:
boolean
):
void
{
checkAll
(
value
:
boolean
):
void
{
this
.
d
isplayData
.
forEach
(
data
=>
data
.
checked
=
value
);
this
.
d
ataSet
.
forEach
(
data
=>
data
.
checked
=
value
);
this
.
refreshStatus
();
this
.
refreshStatus
();
}
}
currentPageDataChange
(
$event
:
Array
<
{
key1
:
string
;
key2
:
number
;
key3
:
string
;
key4
:
string
;
checked
:
boolean
}
>
):
void
{
currentPageDataChange
(
$event
:
Array
<
{
checked
:
boolean
}
>
):
void
{
this
.
d
isplayData
=
$event
;
this
.
d
ataSet
=
$event
;
}
}
refreshStatus
():
void
{
refreshStatus
():
void
{
const
allChecked
=
this
.
d
isplayData
.
every
(
value
=>
value
.
checked
===
true
);
const
allChecked
=
this
.
d
ataSet
.
every
(
value
=>
value
.
checked
===
true
);
const
allUnChecked
=
this
.
d
isplayData
.
every
(
value
=>
!
value
.
checked
);
const
allUnChecked
=
this
.
d
ataSet
.
every
(
value
=>
!
value
.
checked
);
this
.
allChecked
=
allChecked
;
this
.
allChecked
=
allChecked
;
this
.
indeterminate
=
(
!
allChecked
)
&&
(
!
allUnChecked
);
this
.
indeterminate
=
(
!
allChecked
)
&&
(
!
allUnChecked
);
this
.
disabledButton
=
!
this
.
dataSet
.
some
(
value
=>
value
.
checked
);
this
.
disabledButton
=
!
this
.
dataSet
.
some
(
value
=>
value
.
checked
);
...
@@ -117,22 +117,30 @@ export class GroupComponent implements OnInit {
...
@@ -117,22 +117,30 @@ export class GroupComponent implements OnInit {
//新增用户
//新增用户
showUserModal
()
{
showUserModal
()
{
this
.
smartUser
.
show
Modal
(
this
.
groupList
);
this
.
smartUser
.
show
AddModal
(
this
.
groupList
,
"新增用户"
);
}
}
//删除用户
//编辑用户
deleteUser
(
data
)
{
showEditModal
(
item
){
this
.
smartUser
.
showEditModal
(
this
.
groupList
,
"编辑用户"
,
item
.
user
.
id
);
}
//删除用户--单个
deleteUser
(
item
)
{
this
.
modalSer
.
confirm
({
this
.
modalSer
.
confirm
({
nzTitle
:
'删除'
,
nzTitle
:
'删除'
,
nzContent
:
'<b style="color: red">确定删除该用户吗</b>'
,
nzContent
:
'<b style="color: red">确定删除该用户吗</b>'
,
nzOkText
:
'确定'
,
nzOkText
:
'确定'
,
nzCancelText
:
'取消'
,
nzCancelText
:
'取消'
,
nzOnOk
:
()
=>
{
nzOnOk
:
()
=>
{
this
.
systemSer
.
deleteUser
(
data
.
id
).
subscribe
(
const
data
=
{
id
:
item
.
user
.
id
};
this
.
systemSer
.
deleteUser
(
data
).
subscribe
(
(
res
)
=>
{
(
res
)
=>
{
// if(res.errCode == 10000
){
if
(
res
.
data
==
1
){
this
.
getUser
();
//
}
}
}
}
);
);
},
},
...
@@ -141,6 +149,35 @@ export class GroupComponent implements OnInit {
...
@@ -141,6 +149,35 @@ export class GroupComponent implements OnInit {
});
});
}
}
//删除用户-- 批量
batchDelete
(){
let
bool
=
false
;
this
.
dataSet
.
forEach
(
e
=>
{
if
(
e
.
checked
){
bool
=
true
;
}
});
if
(
!
bool
){
this
.
message
.
warning
(
"请选择需要删除的用户"
);
return
false
;
}
let
arr
=
[];
this
.
dataSet
.
forEach
(
e
=>
{
if
(
e
.
checked
){
arr
.
push
(
e
.
user
.
id
);
}
});
this
.
commonSer
.
deleteThing
(
"确定删除选择的用户"
,()
=>
{
this
.
systemSer
.
batchDeleteUser
(
arr
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
){
this
.
getUser
();
}
}
);
})
}
//新增部门
//新增部门
showGroupModal
()
{
showGroupModal
()
{
this
.
smartGroupModal
.
showModal
(
this
.
groupList
);
this
.
smartGroupModal
.
showModal
(
this
.
groupList
);
...
...
src/main/webapp/app/system/modal/user/user.component.html
View file @
8f89c614
...
@@ -15,10 +15,10 @@
...
@@ -15,10 +15,10 @@
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSm
]="
6
"
[
nzXs
]="
24
"
nzFor=
"
mobile
"
nzRequired
>
手机号码
</nz-form-label>
<nz-form-label
[
nzSm
]="
6
"
[
nzXs
]="
24
"
nzFor=
"
phoneNumber
"
nzRequired
>
手机号码
</nz-form-label>
<nz-form-control
[
nzSm
]="
14
"
[
nzXs
]="
24
"
>
<nz-form-control
[
nzSm
]="
14
"
[
nzXs
]="
24
"
>
<input
nz-input
formControlName=
"
mobile"
id=
"mobile
"
>
<input
nz-input
formControlName=
"
phoneNumber"
id=
"phoneNumber
"
>
<nz-form-explain
*
ngIf=
"validateForm.get('
mobile').dirty && validateForm.get('mobile
').errors"
>
手机号码错误!
</nz-form-explain>
<nz-form-explain
*
ngIf=
"validateForm.get('
phoneNumber').dirty && validateForm.get('phoneNumber
').errors"
>
手机号码错误!
</nz-form-explain>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item>
<nz-form-item>
...
@@ -39,24 +39,24 @@
...
@@ -39,24 +39,24 @@
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSm
]="
6
"
[
nzXs
]="
24
"
nzFor=
"organiz
e
Id"
>
所属部门
</nz-form-label>
<nz-form-label
[
nzSm
]="
6
"
[
nzXs
]="
24
"
nzFor=
"organiz
ation
Id"
>
所属部门
</nz-form-label>
<nz-form-control
[
nzSm
]="
14
"
[
nzXs
]="
24
"
>
<nz-form-control
[
nzSm
]="
14
"
[
nzXs
]="
24
"
>
<nz-select
id=
"org
Id"
formControlName=
"organize
Id"
nzPlaceHolder=
"选择部门"
>
<nz-select
id=
"org
anizationId"
formControlName=
"organization
Id"
nzPlaceHolder=
"选择部门"
>
<ng-container
*
ngFor=
"let item of groupList"
>
<ng-container
*
ngFor=
"let item of groupList"
>
<nz-option
nzValue=
"{{item.id}}"
nzLabel=
"{{item.name}}"
></nz-option>
<nz-option
nzValue=
"{{item.id}}"
nzLabel=
"{{item.name}}"
></nz-option>
</ng-container>
</ng-container>
</nz-select>
</nz-select>
<nz-form-explain
*
ngIf=
"validateForm.get('organiz
eId').dirty && validateForm.get('organize
Id').errors"
>
请选择所属部门!
</nz-form-explain>
<nz-form-explain
*
ngIf=
"validateForm.get('organiz
ationId').dirty && validateForm.get('organization
Id').errors"
>
请选择所属部门!
</nz-form-explain>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSm
]="
6
"
[
nzXs
]="
24
"
nzFor=
"
comments
"
>
职位
</nz-form-label>
<nz-form-label
[
nzSm
]="
6
"
[
nzXs
]="
24
"
nzFor=
"
position
"
>
职位
</nz-form-label>
<nz-form-control
[
nzSm
]="
14
"
[
nzXs
]="
24
"
>
<nz-form-control
[
nzSm
]="
14
"
[
nzXs
]="
24
"
>
<nz-select
id=
"
comments"
formControlName=
"comments
"
nzPlaceHolder=
"选择职位"
>
<nz-select
id=
"
position"
formControlName=
"position
"
nzPlaceHolder=
"选择职位"
>
<nz-option
nzValue=
"1"
nzLabel=
"组长"
></nz-option>
<nz-option
nzValue=
"1"
nzLabel=
"组长"
></nz-option>
<nz-option
nzValue=
"2"
nzLabel=
"组员"
></nz-option>
<nz-option
nzValue=
"2"
nzLabel=
"组员"
></nz-option>
</nz-select>
</nz-select>
<nz-form-explain
*
ngIf=
"validateForm.get('
comments').dirty && validateForm.get('comments
').errors"
>
请选择职位!
</nz-form-explain>
<nz-form-explain
*
ngIf=
"validateForm.get('
position').dirty && validateForm.get('position
').errors"
>
请选择职位!
</nz-form-explain>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item>
<nz-form-item>
...
...
src/main/webapp/app/system/modal/user/user.component.ts
View file @
8f89c614
...
@@ -17,10 +17,11 @@ import {NzMessageService} from 'ng-zorro-antd';
...
@@ -17,10 +17,11 @@ import {NzMessageService} from 'ng-zorro-antd';
export
class
UserComponent
implements
OnInit
{
export
class
UserComponent
implements
OnInit
{
@
Output
()
done
=
new
EventEmitter
<
any
>
();
@
Output
()
done
=
new
EventEmitter
<
any
>
();
title
=
'新增用户'
;
title
;
isVisible
=
false
;
isVisible
=
false
;
groupList
:
any
[];
groupList
:
any
[];
validateForm
:
FormGroup
;
validateForm
:
FormGroup
;
userId
;
constructor
(
private
fb
:
FormBuilder
,
private
systemSer
:
SystemService
,
constructor
(
private
fb
:
FormBuilder
,
private
systemSer
:
SystemService
,
private
message
:
NzMessageService
)
{
private
message
:
NzMessageService
)
{
...
@@ -34,22 +35,42 @@ export class UserComponent implements OnInit {
...
@@ -34,22 +35,42 @@ export class UserComponent implements OnInit {
this
.
validateForm
=
this
.
fb
.
group
({
this
.
validateForm
=
this
.
fb
.
group
({
name
:[
null
,[
Validators
.
required
,
Validators
.
maxLength
(
10
)]],
name
:[
null
,[
Validators
.
required
,
Validators
.
maxLength
(
10
)]],
loginName
:[
null
,[
Validators
.
required
,
Validators
.
maxLength
(
10
)]],
loginName
:[
null
,[
Validators
.
required
,
Validators
.
maxLength
(
10
)]],
mobile
:[
null
,[
Validators
.
required
,
Validators
.
min
(
11
),
Validators
.
maxLength
(
11
)]],
phoneNumber
:[
null
,[
Validators
.
required
,
Validators
.
min
(
11
),
Validators
.
maxLength
(
11
)]],
gender
:[
null
,[
Validators
.
required
]],
gender
:[
null
,[
Validators
.
required
]],
email
:[
null
,[
Validators
.
email
]],
email
:[
null
,[
Validators
.
email
]],
organiz
e
Id
:[
null
,[
Validators
.
required
]],
organiz
ation
Id
:[
null
,[
Validators
.
required
]],
comments
:[
null
,[
Validators
.
required
]],
position
:[
null
,[
Validators
.
required
]],
status
:[
null
,[
Validators
.
required
]],
status
:[
null
,[
Validators
.
required
]],
})
})
}
}
show
Modal
(
data
){
show
AddModal
(
data
,
title
){
this
.
groupList
=
data
;
this
.
groupList
=
data
;
this
.
isVisible
=
true
;
this
.
isVisible
=
true
;
this
.
title
=
title
;
}
showEditModal
(
data
,
title
,
id
){
this
.
userId
=
id
;
this
.
groupList
=
data
;
this
.
isVisible
=
true
;
this
.
title
=
title
;
this
.
systemSer
.
getUser
(
this
.
userId
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
){
res
.
data
.
gender
+=
""
;
res
.
data
.
position
+=
""
;
res
.
data
.
status
+=
""
;
res
.
data
.
organizationId
+=
""
;
this
.
validateForm
.
patchValue
(
res
.
data
);
}
}
)
}
}
handleCancel
(){
handleCancel
(){
this
.
isVisible
=
false
;
this
.
isVisible
=
false
;
this
.
initForm
();
}
}
handleOk
(){
handleOk
(){
...
@@ -62,15 +83,39 @@ export class UserComponent implements OnInit {
...
@@ -62,15 +83,39 @@ export class UserComponent implements OnInit {
if
(
this
.
validateForm
.
invalid
){
if
(
this
.
validateForm
.
invalid
){
return
false
;
return
false
;
}
}
if
(
this
.
title
==
"新增用户"
){
this
.
create
();
}
if
(
this
.
title
==
"编辑用户"
){
this
.
update
();
}
}
create
(){
this
.
systemSer
.
adduser
(
this
.
validateForm
.
value
).
subscribe
(
this
.
systemSer
.
adduser
(
this
.
validateForm
.
value
).
subscribe
(
(
res
)
=>
{
(
res
)
=>
{
if
(
res
.
errCode
==
10000
){
if
(
res
.
errCode
==
10000
){
this
.
isVisible
=
false
;
this
.
isVisible
=
false
;
this
.
initForm
();
this
.
initForm
();
this
.
done
.
emit
();
this
.
done
.
emit
();
}
else
{
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
this
.
message
.
error
(
res
.
errMsg
);
}
}
}
)
}
update
(){
this
.
validateForm
.
addControl
(
'id'
,
new
FormControl
(
this
.
userId
));
this
.
systemSer
.
updateUser
(
this
.
validateForm
.
value
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
){
this
.
isVisible
=
false
;
this
.
initForm
();
this
.
done
.
emit
();
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
}
}
)
)
}
}
...
...
src/main/webapp/app/system/system.service.ts
View file @
8f89c614
...
@@ -45,9 +45,24 @@ export class SystemService {
...
@@ -45,9 +45,24 @@ export class SystemService {
return
this
.
http
.
post
(
SERVER_API_URL_coms
+
'/user/createUser'
,
data
);
return
this
.
http
.
post
(
SERVER_API_URL_coms
+
'/user/createUser'
,
data
);
}
}
//编辑用户
updateUser
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL_coms
+
'/user/updateUser'
,
data
);
}
//查找用户
getUser
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL_coms
+
'/user/getUserById/'
+
params
);
}
//删除用户
deleteUser
(
data
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL_coms
+
'/user/deleteUser?'
+
this
.
commonSer
.
toQuery
(
data
)
);
}
//删除用户
//删除用户
deleteUser
(
params
)
{
batchDeleteUser
(
data
):
Observable
<
any
>
{
return
this
.
http
.
delete
(
SERVER_API_URL_coms
+
'/user/'
+
params
);
return
this
.
http
.
post
(
SERVER_API_URL_coms
+
'/user/batchDeleteUser'
,
data
);
}
}
//组织结构列表 /organization/updateOrganization
//组织结构列表 /organization/updateOrganization
...
...
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