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
f998bbbe
Commit
f998bbbe
authored
Dec 24, 2018
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
71308a89
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
112 additions
and
41 deletions
+112
-41
alarm-set.component.ts
src/main/webapp/app/alarm/alarm-set/alarm-set.component.ts
+1
-1
media-type.component.ts
...webapp/app/alarm/modal/media-type/media-type.component.ts
+1
-0
navbar.component.html
src/main/webapp/app/layouts/navbar/navbar.component.html
+8
-3
navbar.component.ts
src/main/webapp/app/layouts/navbar/navbar.component.ts
+15
-0
basic-edit.component.ts
src/main/webapp/app/modal/basic-edit/basic-edit.component.ts
+1
-2
pause.component.ts
src/main/webapp/app/modal/pause/pause.component.ts
+1
-1
topology-img.component.html
.../app/netTopology/topology-img/topology-img.component.html
+4
-4
topology-img.component.ts
...pp/app/netTopology/topology-img/topology-img.component.ts
+1
-1
basic.component.html
src/main/webapp/app/overAll/basic/basic.component.html
+6
-12
basic.component.ts
src/main/webapp/app/overAll/basic/basic.component.ts
+3
-3
login.component.html
src/main/webapp/app/shared/login/login.component.html
+1
-1
group.component.html
src/main/webapp/app/system/group/group.component.html
+3
-5
group.component.ts
src/main/webapp/app/system/group/group.component.ts
+16
-3
group-modal.component.ts
...app/app/system/modal/group-modal/group-modal.component.ts
+40
-3
system.service.ts
src/main/webapp/app/system/system.service.ts
+7
-2
documentation.css
src/main/webapp/content/css/documentation.css
+4
-0
No files found.
src/main/webapp/app/alarm/alarm-set/alarm-set.component.ts
View file @
f998bbbe
...
...
@@ -117,7 +117,7 @@ export class AlarmSetComponent implements OnInit {
changeStatus
(
title
,
status
,
item
)
{
this
.
modalService
.
confirm
({
nzTitle
:
title
,
nzContent
:
'<b style="color: red;">确定要'
+
title
+
'当前告警
组
吗</b>'
,
nzContent
:
'<b style="color: red;">确定要'
+
title
+
'当前告警吗</b>'
,
nzOkText
:
'确定'
,
nzOkType
:
'danger'
,
nzOnOk
:
()
=>
{
...
...
src/main/webapp/app/alarm/modal/media-type/media-type.component.ts
View file @
f998bbbe
...
...
@@ -116,6 +116,7 @@ export class MediaTypeComponent implements OnInit {
handleCancel
()
{
this
.
isVisible
=
false
;
this
.
initForm
();
}
handleOk
()
{
...
...
src/main/webapp/app/layouts/navbar/navbar.component.html
View file @
f998bbbe
...
...
@@ -5,9 +5,9 @@
<span
style=
"color: #666666"
(
click
)="
transition
()"
>
快捷添加 +
</span>
<span
#
parent
class=
"span-hov"
>
<span
#
children
class=
"addBtn"
>
<span>
添加设备分组
</span>
<span>
添加资源
</span>
<
span>
添加业务
</span
>
<span
(
click
)="
showGroupModal
()"
>
添加设备分组
</span>
<span
(
click
)="
showBasicEditModal
(
item
)"
>
添加资源
</span>
<
!--<span>添加业务</span>--
>
</span>
</span>
</div>
...
...
@@ -27,3 +27,7 @@
<!--三员分立-->
<smart-separation
#
smartSeparation
></smart-separation>
<!-- 添加资源-->
<smart-basic-edit
#
basicEdit
(
done
)="
handleOk
($
event
)"
></smart-basic-edit>
<!--添加分组-->
<smart-create-group
#
smartCreateGroup
(
add
)="
handleOk
($
event
)"
></smart-create-group>
\ No newline at end of file
src/main/webapp/app/layouts/navbar/navbar.component.ts
View file @
f998bbbe
...
...
@@ -8,6 +8,8 @@ import { Principal, LoginService } from '../../shared';
import
{
VERSION
}
from
'../../app.constants'
;
import
{
LocalStorageService
}
from
'ngx-webstorage'
;
import
{
SeparationComponent
}
from
'../../system/modal/separation/separation.component'
;
import
{
BasicEditComponent
}
from
'../../modal/basic-edit/basic-edit.component'
;
import
{
CreateGroupComponent
}
from
'../../modal/create-group/create-group.component'
;
@
Component
({
selector
:
'jhi-navbar'
,
...
...
@@ -20,6 +22,9 @@ export class NavbarComponent implements OnInit ,AfterViewChecked{
@
ViewChild
(
'parent'
)
parent
:
ElementRef
;
@
ViewChild
(
'children'
)
children
:
ElementRef
;
@
ViewChild
(
"smartSeparation"
)
smartSeparation
:
SeparationComponent
;
@
ViewChild
(
'basicEdit'
)
basicEdit
:
BasicEditComponent
;
@
ViewChild
(
'smartCreateGroup'
)
smartCreateGroup
:
CreateGroupComponent
;
inProduction
:
boolean
;
isNavbarCollapsed
:
boolean
;
languages
:
any
[];
...
...
@@ -89,4 +94,14 @@ export class NavbarComponent implements OnInit ,AfterViewChecked{
showSeparationModal
(){
this
.
smartSeparation
.
showModal
(
"三员分立"
);
}
//添加资源 ,name-分组名称,id-分组id
showBasicEditModal
()
{
this
.
basicEdit
.
showModal
();
}
//添加分组
showGroupModal
()
{
this
.
smartCreateGroup
.
showModal
(
'添加分组'
);
}
}
src/main/webapp/app/modal/basic-edit/basic-edit.component.ts
View file @
f998bbbe
...
...
@@ -78,10 +78,9 @@ export class BasicEditComponent implements OnInit {
}
//新增
showModal
(
hostId
,
name
,
gId
):
void
{
showModal
():
void
{
this
.
isBasicEdit
=
true
;
this
.
modalTitle
=
'添加资源'
;
this
.
hostId
=
hostId
;
this
.
getGroup
();
this
.
getParentType
();
}
...
...
src/main/webapp/app/modal/pause/pause.component.ts
View file @
f998bbbe
...
...
@@ -63,6 +63,7 @@ export class PauseComponent implements OnInit {
if
(
res
.
errCode
==
10000
){
this
.
isShow
=
false
;
this
.
initForm
();
this
.
done
.
emit
();
this
.
message
.
success
(
"临时暂停成功"
);
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
...
...
@@ -81,7 +82,6 @@ export class PauseComponent implements OnInit {
(
res
)
=>
{
if
(
res
.
errCode
==
10000
){
this
.
isShow
=
false
;
this
.
done
.
emit
()
this
.
done
.
emit
();
}
this
.
message
.
info
(
res
.
errMsg
);
...
...
src/main/webapp/app/netTopology/topology-img/topology-img.component.html
View file @
f998bbbe
...
...
@@ -20,10 +20,10 @@
</div>
<div
nz-row
class=
"search-form"
>
<div
nz-col
nzSpan=
"12"
>
<nz-select
style=
"width: 200px;"
nzShowSearch
nzAllowClear
nzPlaceHolder=
"选择类型"
(
ngModelChange
)="
getList
()"
>
<
!--<ng-container *ngFor="let item of groupList;let i = index;">--
>
<
!--<nz-option nzLabel="选择类型"></nz-option>--
>
<
!--</ng-container>--
>
<nz-select
style=
"width: 200px;"
nzPlaceHolder=
"选择类型"
(
ngModelChange
)="
getList
()"
>
<
ng-container
*
ngFor=
"let item of groupList;let i = index;"
>
<
nz-option
nzLabel=
"选择类型"
></nz-option
>
<
/ng-container
>
</nz-select>
</div>
<div
nz-col
nzSpan=
"12"
class=
"text-right"
>
...
...
src/main/webapp/app/netTopology/topology-img/topology-img.component.ts
View file @
f998bbbe
...
...
@@ -71,7 +71,7 @@ export class TopologyImgComponent implements OnInit {
//设为默认
setDefault
(
item
){
this
.
modalSer
.
confirm
({
nzTitle
:
'
删除
'
,
nzTitle
:
'
默认
'
,
nzContent
:
'<b style="color: red;">确认将该图标设为默认图标吗?</b>'
,
nzOkText
:
'确定'
,
nzOkType
:
'danger'
,
...
...
src/main/webapp/app/overAll/basic/basic.component.html
View file @
f998bbbe
...
...
@@ -105,7 +105,7 @@
</td>
</ng-container>
<td
class=
"round-tag tag-form"
>
<td
class=
"round-tag tag-form
default
"
>
<ng-container
*
ngIf=
"item.status == 1"
>
<nz-tag
[
nzColor
]="
color
.
gray
"
></nz-tag>
</ng-container>
...
...
@@ -123,7 +123,7 @@
<!--<nz-tag *ngIf="item.status == 0" [nzColor]="color.green"></nz-tag>-->
<!--<nz-tag *ngIf="item.status == 1" [nzColor]="color.gray"></nz-tag>-->
<!--</td>-->
<td>
<td
class=
"default"
>
<ng-container
*
ngIf=
"item.level"
>
<ng-container
*
ngIf=
"item.available == 0"
>
<nz-tag>
AGENT
</nz-tag>
...
...
@@ -169,7 +169,7 @@
<td
class=
"handle"
>
<ng-container
*
ngIf=
"!item.level"
>
<span
(
click
)="
showBasicEditModal
(
item
)"
>
添加资源
</span>
<span
(
click
)="
showBasicEditModal
()"
>
添加资源
</span>
</ng-container>
<ng-container
*
ngIf=
"item.level"
>
<span
(
click
)="
showBasicCheckModal
(
item
.
hostid
,
item
.
host
)"
>
添加监测点
</span>
...
...
@@ -226,11 +226,9 @@
</td>
<td>
{{item?.inventory?.name}}
</td>
<!--<td class="round-tag tag-form">-->
<!--<nz-tag *ngIf="item.status == 0" [nzColor]="color.green"></nz-tag>-->
<!--<nz-tag *ngIf="item.status == 1" [nzColor]="color.gray"></nz-tag>-->
<!--</td>-->
<td>
<td
class=
"default"
>
<ng-container
*
ngIf=
"item.level"
>
<ng-container
*
ngIf=
"item.available == 0"
>
<nz-tag>
AGENT
</nz-tag>
...
...
@@ -311,7 +309,7 @@
<td
class=
"cursor"
>
<span
(
click
)="
goDetail
(
item
)"
>
{{item.name}}
</span>
</td>
<td
class=
"round-tag tag-form"
>
<td
class=
"round-tag tag-form
default
"
>
<ng-container
*
ngIf=
"item.status == 1"
>
<nz-tag
[
nzColor
]="
color
.
gray
"
></nz-tag>
</ng-container>
...
...
@@ -323,12 +321,8 @@
</td>
<td>
{{item?.inventory?.name}}
</td>
<!--<td class="round-tag tag-form">-->
<!--<nz-tag *ngIf="item.status == 0" [nzColor]="color.green"></nz-tag>-->
<!--<nz-tag *ngIf="item.status == 1" [nzColor]="color.gray"></nz-tag>-->
<!--</td>-->
<td>
<td
class=
"default"
>
<ng-container
*
ngIf=
"item.available == 0"
>
<nz-tag>
AGENT
</nz-tag>
</ng-container>
...
...
src/main/webapp/app/overAll/basic/basic.component.ts
View file @
f998bbbe
...
...
@@ -196,9 +196,9 @@ export class BasicComponent implements OnInit {
)
}
//添加资源
,name-分组名称,id-分组id
showBasicEditModal
(
item
)
{
this
.
basicEdit
.
showModal
(
item
.
hostId
,
item
.
name
,
item
.
id
);
//添加资源
showBasicEditModal
()
{
this
.
basicEdit
.
showModal
();
}
//编辑资源 name--分组名称,gId-当前分组的id
...
...
src/main/webapp/app/shared/login/login.component.html
View file @
f998bbbe
...
...
@@ -26,7 +26,7 @@
</nz-form-control>
</nz-form-item>
<nz-form-item
style=
"text-align: center;margin-top: -24px"
>
<nz-spin
[
nzSpinning
]="
isSpinning
"
nzTip=
'登
陆
中...'
></nz-spin>
<nz-spin
[
nzSpinning
]="
isSpinning
"
nzTip=
'登
录
中...'
></nz-spin>
</nz-form-item>
</form>
</div>
...
...
src/main/webapp/app/system/group/group.component.html
View file @
f998bbbe
...
...
@@ -32,14 +32,12 @@
<div
class=
"padding-15-0"
>
<button
(
click
)="
showGroupModal
()"
nz-button
nzType=
"primary"
>
新增组织
</button>
</div>
<nz-tree
[(
ngModel
)]="
nodes
"
(
nzClick
)="
getOrg
($
event
)"
>
<nz-tree
[(
ngModel
)]="
nodes
"
>
<ng-template
#
nzTreeTemplate
let-node
>
<span
class=
"custom-node"
draggable=
"true"
aria-grabbed=
"true"
[
class
.
active
]="
node
.
isSelected
"
>
<span>
{{node.title}}
<i
(
click
)="
editGroup
(
node
)"
style=
"margin:0 10px 0 20px;"
class=
"anticon anticon-form"
></i>
<span
(
click
)="
getOrg
(
node
)"
>
{{node.title}}
</span>
<i
(
click
)="
showEditGroupModal
(
node
)"
style=
"margin:0 10px 0 20px;"
class=
"anticon anticon-form"
></i>
<i
(
click
)="
deleteGroup
(
node
)"
class=
"anticon anticon-close-circle-o"
></i>
</span>
</span>
...
...
src/main/webapp/app/system/group/group.component.ts
View file @
f998bbbe
...
...
@@ -106,7 +106,7 @@ export class GroupComponent implements OnInit {
getOrg
(
e
)
{
console
.
log
(
e
);
this
.
organizationId
=
e
.
node
.
key
;
this
.
organizationId
=
e
.
key
;
this
.
getUser
();
}
...
...
@@ -211,15 +211,28 @@ export class GroupComponent implements OnInit {
//新增部门
showGroupModal
()
{
this
.
smartGroupModal
.
show
Modal
(
this
.
groupList
);
this
.
smartGroupModal
.
show
AddModal
(
this
.
groupList
,
"新增部门"
);
}
//编辑部门
editGroup
(
item
)
{
showEditGroupModal
(
item
)
{
this
.
smartGroupModal
.
showEditModal
(
this
.
groupList
,
"编辑部门"
,
item
.
key
);
}
//删除部门
deleteGroup
(
item
)
{
this
.
commonSer
.
confirmThing
(
"删除"
,
"确认删除该组织"
,()
=>
{
this
.
systemSer
.
deleteOrg
(
item
.
key
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
){
this
.
message
.
success
(
"删除成功"
);
this
.
getGroup
();
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
}
)
})
}
//授予角色
...
...
src/main/webapp/app/system/modal/group-modal/group-modal.component.ts
View file @
f998bbbe
import
{
Component
,
EventEmitter
,
OnInit
,
Output
}
from
'@angular/core'
;
import
{
FormBuilder
,
FormGroup
,
Validators
}
from
'@angular/forms'
;
import
{
FormBuilder
,
Form
Control
,
Form
Group
,
Validators
}
from
'@angular/forms'
;
import
{
SystemService
}
from
'../../system.service'
;
import
{
NzMessageService
}
from
'ng-zorro-antd'
;
...
...
@@ -11,10 +11,11 @@ import {NzMessageService} from 'ng-zorro-antd';
export
class
GroupModalComponent
implements
OnInit
{
@
Output
()
done
=
new
EventEmitter
<
any
>
();
title
=
'新增部门'
;
title
;
isVisible
=
false
;
validateForm
:
FormGroup
;
groupList
:
any
[];
orgId
;
constructor
(
private
fb
:
FormBuilder
,
private
message
:
NzMessageService
,
private
systemSer
:
SystemService
)
{
...
...
@@ -31,9 +32,17 @@ export class GroupModalComponent implements OnInit {
});
}
show
Modal
(
list
){
show
AddModal
(
list
,
title
){
this
.
groupList
=
list
;
this
.
isVisible
=
true
;
this
.
title
=
title
;
}
showEditModal
(
list
,
title
,
id
){
this
.
orgId
=
id
;
this
.
groupList
=
list
;
this
.
isVisible
=
true
;
this
.
title
=
title
;
}
handleCancel
(){
...
...
@@ -45,6 +54,18 @@ export class GroupModalComponent implements OnInit {
this
.
validateForm
.
controls
[
i
].
markAsDirty
();
this
.
validateForm
.
controls
[
i
].
updateValueAndValidity
();
}
if
(
this
.
validateForm
.
invalid
){
return
false
;
}
if
(
this
.
title
==
"新增部门"
){
this
.
create
();
}
if
(
this
.
title
==
"编辑部门"
){
this
.
update
();
}
}
create
(){
this
.
systemSer
.
createOrg
(
this
.
validateForm
.
value
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
){
...
...
@@ -59,4 +80,20 @@ export class GroupModalComponent implements OnInit {
)
}
update
(){
this
.
validateForm
.
addControl
(
"id"
,
new
FormControl
(
this
.
orgId
));
this
.
systemSer
.
updateOrganization
(
this
.
validateForm
.
value
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
){
this
.
initForm
();
this
.
isVisible
=
false
;
this
.
done
.
emit
();
this
.
message
.
success
(
"新增部门成功"
);
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
}
)
}
}
src/main/webapp/app/system/system.service.ts
View file @
f998bbbe
...
...
@@ -80,9 +80,14 @@ export class SystemService {
return
this
.
http
.
get
(
SERVER_API_URL_COMS
+
'/organization/getAll'
,);
}
//删除单个组织机构
deleteOrg
(
params
):
Observable
<
any
>
{
return
this
.
http
.
delete
(
SERVER_API_URL_COMS
+
'/organization/'
+
params
);
}
//编辑组织
updateOrganization
():
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL_COMS
+
'/organization/updateOrganization'
,
);
updateOrganization
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL_COMS
+
'/organization/updateOrganization'
,
data
);
}
//创建组织结构
...
...
src/main/webapp/content/css/documentation.css
View file @
f998bbbe
...
...
@@ -79,6 +79,10 @@
}
.round-tag
.ant-tag
{
border-radius
:
50%
;
}
.default
.ant-tag
{
cursor
:
default
;
}
...
...
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