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
03decbd7
Commit
03decbd7
authored
Jan 04, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构 jtopo
parent
fd9e315f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
116 deletions
+37
-116
app.main.module.ts
src/main/webapp/app/app.main.module.ts
+2
-0
ne-topology.component.html
...pp/app/netTopology/ne-topology/ne-topology.component.html
+2
-116
common.service.ts
src/main/webapp/app/shared/common/common.service.ts
+33
-0
No files found.
src/main/webapp/app/app.main.module.ts
View file @
03decbd7
...
...
@@ -96,6 +96,7 @@ import {ModifyPasswordComponent} from './modal/modify-password/modify-password.c
import
{
FullScreenComponent
}
from
'./modal/full-screen/full-screen.component'
;
import
{
LookRoleComponent
}
from
'./look-role/look-role.component'
;
import
{
ThresholdComponent
}
from
'./modal/threshold/threshold.component'
;
import
{
JtopoComponent
}
from
'./jtopo/jtopo.component'
;
@
NgModule
({
imports
:
[
...
...
@@ -194,6 +195,7 @@ import {ThresholdComponent} from './modal/threshold/threshold.component';
LookPlanComponent
,
LookRoleComponent
,
ThresholdComponent
,
JtopoComponent
,
],
providers
:[
OverAllService
,
...
...
src/main/webapp/app/netTopology/ne-topology/ne-topology.component.html
View file @
03decbd7
...
...
@@ -34,118 +34,4 @@
</div>
<div
class=
"layui-layout layui-layout-admin"
>
<div
class=
"layui-header header-bar"
>
<span
(
click
)="
addDevice
()"
>
添加设备
</span>
<span
(
click
)="
addCheck
()"
>
添加监测点
</span>
<span
(
click
)="
showAddImg
()"
>
添加图片
</span>
<span
onClick=
"editor.utils.deleteSelectedNodes()"
>
移除
</span>
<!-- 顶部工具栏 -->
<div
class=
"layui-nav layui-layout-right"
style=
"color: #6097b7"
>
<span
aria-hidden=
"true"
title=
"全屏查看"
onClick=
"editor.utils.showInFullScreen(editor.stage.canvas,'RequestFullScreen')"
>
全屏查看
</span>
<span
aria-hidden=
"true"
title=
"居中显示"
onClick=
"editor.utils.showInCenter()"
>
居中显示
</span>
<span
aria-hidden=
"true"
title=
"保存"
(
click
)="
update
()"
>
保存
</span>
<span
aria-hidden=
"true"
title=
"清空"
onClick=
"editor.utils.clearTopology()"
>
清空
</span>
<span
aria-hidden=
"true"
title=
"放大"
onClick=
"editor.utils.scalingBig()"
>
放大
</span>
<span
caria-hidden=
"true"
title=
"缩小"
onClick=
"editor.utils.scalingSmall()"
>
缩小
</span>
</div>
</div>
<div
class=
"container"
>
<div
class=
"layui-row"
>
<div
class=
"layui-col-md12"
>
<div
id=
"topology-body"
class=
"topology-context"
>
<!-- 鼠标悬浮显示节点信息 -->
<div
class=
"node-infobox"
style=
"display: none;"
>
<span>
节点名称:
<label
name=
"node_name"
></label></span>
<span>
当前时间:
<label
name=
"current_time"
></label></span>
</div>
<canvas
class=
"topology-context"
id=
"topology-canvas"
#
topologyCanvas
style=
"height: 580px;"
>
您的浏览器不支持HTML5!
</canvas>
<div
class=
"checkList"
>
<p
*
ngFor=
"let item of checkJson;let i = index;"
>
<span
[
style
.
fontSize
]="
item
.
fontSize
+'
px
'"
>
{{item.name}}
</span><i
(
click
)="
deleteCheck
(
i
)"
class=
"minus anticon anticon-minus-circle-o"
></i>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- 设备编辑 -->
<div
id=
"node-dialog"
style=
"display: none;padding-top: 20px"
>
<form
id=
"node-form"
class=
"layui-form"
action=
""
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
设备名称
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"deviceName"
required
autocomplete=
"off"
class=
"layui-input"
>
</div>
</div>
</div>
<!--<div class="layui-form-item">-->
<!--<div class="layui-inline">-->
<!--<label class="layui-form-label">类型</label>-->
<!--<div class="layui-input-block">-->
<!--<select name="city">-->
<!--<option value=""></option>-->
<!--<option *ngFor="let item of options" value="{{item.id}}">{{item.name}}</option>-->
<!--</select>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
</form>
</div>
<!--连线编辑-->
<div
id=
"link-dialog"
style=
"display: none;padding-top: 20px;"
>
<form
id=
"link-form"
class=
"layui-form"
action=
""
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
名称
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"lineName"
required
autocomplete=
"off"
class=
"layui-input"
>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
线条颜色
</label>
<div
class=
"layui-input-block"
>
<input
style=
"width: 100px;"
type=
"color"
name=
"lineColor"
required
autocomplete=
"off"
class=
"layui-input"
>
</div>
</div>
</div>
</form>
</div>
<!--添加图片-->
<nz-modal
[(
nzVisible
)]="
isVisible
"
nzTitle=
"添加图片"
(
nzOnCancel
)="
handleCancel
()"
(
nzOnOk
)="
handleOk
()"
>
<form
nz-form
>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
7
"
nzRequired
nzFor=
"group"
>
选择图片
</nz-form-label>
<nz-form-control
[
nzSpan
]="
12
"
>
<nz-upload
[
nzBeforeUpload
]="
beforeUpload
"
[(
nzFileList
)]="
fileList
"
>
<button
nz-button
>
<i
class=
"anticon anticon-upload"
></i><span>
上传
</span>
</button>
</nz-upload>
</nz-form-control>
</nz-form-item>
</form>
</nz-modal>
<!--添加拓扑图-->
<smart-topology
#
smartTopology
(
done
)="
getList
()"
></smart-topology>
<!--添加监测点-->
<smart-check
#
smartCheck
(
done
)="
setCheckList
($
event
)"
></smart-check>
<!--选择资源-->
<smart-select-group
#
smartSelectGroup
(
done
)="
setImg
($
event
)"
></smart-select-group>
\ No newline at end of file
<smart-jtopo></smart-jtopo>
\ No newline at end of file
src/main/webapp/app/shared/common/common.service.ts
View file @
03decbd7
...
...
@@ -124,4 +124,37 @@ export class CommonService implements OnInit {
)
return
usablePrefixMethod
;
}
/**
* 计算程序执行时间
* @type {{startTime: {}, timeSpan: number, start: Timer.start, stop: Timer.stop, getTimeSpan: Timer.getTimeSpan}}
*/
Timer
=
{
startTime
:
{},
stoppedStatus
:
true
,
start
:
()
=>
{
if
(
this
.
stoppedStatus
)
{
this
.
startTime
=
new
Date
()
this
.
stoppedStatus
=
false
}
},
pause
:
()
=>
{
var
startTime
=
this
.
startTime
if
(
startTime
)
{
return
new
Date
()
-
startTime
}
else
{
return
-
1
}
},
stop
:
function
()
{
var
startTime
=
this
.
startTime
if
(
startTime
)
{
this
.
stoppedStatus
=
true
return
new
Date
()
-
startTime
}
else
{
this
.
stoppedStatus
=
true
return
-
1
}
}
}
}
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