Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
L
luna
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
ops
luna
Commits
6cd72440
Unverified
Commit
6cd72440
authored
Apr 26, 2018
by
liuzheng712
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: update
parent
32277220
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
23 deletions
+41
-23
asset-tree.component.ts
src/app/elements/asset-tree/asset-tree.component.ts
+40
-22
cleftbar.component.html
src/app/pages/control/cleftbar/cleftbar.component.html
+1
-1
No files found.
src/app/elements/asset-tree/asset-tree.component.ts
View file @
6cd72440
import
{
Component
,
Input
,
OnInit
,
AfterViewInit
,
Inject
}
from
'@angular/core'
;
import
{
Component
,
Input
,
OnInit
,
Inject
,
SimpleChanges
,
OnChanges
}
from
'@angular/core'
;
import
{
NavList
,
View
}
from
'../../pages/control/control/control.component'
;
import
{
AppService
,
LogService
}
from
'../../app.service'
;
import
{
MAT_DIALOG_DATA
,
MatDialog
,
MatDialogRef
}
from
'@angular/material'
;
...
...
@@ -14,7 +14,7 @@ declare var $: any;
templateUrl
:
'./asset-tree.component.html'
,
styleUrls
:
[
'./asset-tree.component.scss'
]
})
export
class
ElementAssetTreeComponent
implements
OnInit
{
export
class
ElementAssetTreeComponent
implements
OnInit
,
OnChanges
{
@
Input
()
Data
:
any
;
nodes
=
[];
setting
=
{
...
...
@@ -31,36 +31,42 @@ export class ElementAssetTreeComponent implements OnInit {
onClick
:
this
.
onCzTreeOnClick
.
bind
(
this
)
},
};
timer
:
any
;
zTreeObj
:
any
;
// hiddenNodes: [];
onCzTreeOnClick
(
event
,
treeId
,
treeNode
,
clickFlag
)
{
this
.
Connect
(
treeNode
);
// this.Connect(treeNode);
}
constructor
(
private
_appService
:
AppService
,
private
_menu
:
ElementServerMenuComponent
,
public
_dialog
:
MatDialog
,
p
rivate
_layer
:
Dial
ogService
)
{
p
ublic
_logger
:
L
ogService
)
{
}
ngOnInit
()
{
if
(
this
.
Data
)
{
this
.
draw
();
}
clearInterval
(
this
.
timer
);
// clearInterval(this.timer);
//
// this.timer = setInterval(() => {
// if (this.Data) {
// this.draw();
// clearInterval(this.timer);
// }
// }, 100);
}
this
.
timer
=
setInterval
(()
=>
{
if
(
this
.
Data
)
{
this
.
draw
();
clearInterval
(
this
.
timer
);
}
},
100
);
ngOnChanges
(
changes
:
SimpleChanges
)
{
if
(
this
.
Data
)
{
this
.
draw
();
}
}
draw
()
{
le
t
nodes
=
{};
le
t
assets
=
{};
cons
t
nodes
=
{};
cons
t
assets
=
{};
this
.
Data
.
forEach
((
v
,
i
)
=>
{
if
(
!
nodes
[
v
[
'id'
]])
{
nodes
[
v
[
'id'
]]
=
true
;
...
...
@@ -109,8 +115,7 @@ export class ElementAssetTreeComponent implements OnInit {
});
});
});
$
.
fn
.
zTree
.
init
(
$
(
'#ztree'
),
this
.
setting
,
this
.
nodes
);
this
.
zTreeObj
=
$
.
fn
.
zTree
.
init
(
$
(
'#ztree'
),
this
.
setting
,
this
.
nodes
);
}
Connect
(
host
)
{
...
...
@@ -129,7 +134,7 @@ export class ElementAssetTreeComponent implements OnInit {
dialogRef
.
afterClosed
().
subscribe
(
result
=>
{
if
(
result
)
{
for
(
le
t
i
of
host
.
system_users_granted
)
{
for
(
cons
t
i
of
host
.
system_users_granted
)
{
if
(
i
.
id
.
toString
()
===
result
.
toString
())
{
user
=
i
;
break
;
...
...
@@ -180,8 +185,8 @@ export class ElementAssetTreeComponent implements OnInit {
login
(
host
,
user
)
{
const
id
=
NavList
.
List
.
length
-
1
;
console
.
lo
g
(
NavList
);
console
.
lo
g
(
host
);
this
.
_logger
.
debu
g
(
NavList
);
this
.
_logger
.
debu
g
(
host
);
if
(
user
)
{
NavList
.
List
[
id
].
nick
=
host
.
name
;
NavList
.
List
[
id
].
connected
=
true
;
...
...
@@ -197,7 +202,7 @@ export class ElementAssetTreeComponent implements OnInit {
NavList
.
List
.
push
(
new
View
());
NavList
.
Active
=
id
;
}
console
.
lo
g
(
NavList
);
this
.
_logger
.
debu
g
(
NavList
);
}
checkPriority
(
sysUsers
)
{
...
...
@@ -213,11 +218,24 @@ export class ElementAssetTreeComponent implements OnInit {
}
return
user
;
}
// filter() {
// this.zTreeObj.showNodes(this.hiddenNodes);
//
// function filterFunc(node) {
// const _keywords = $('#keyword').val();
// return !(node.isParent || node.name.indexOf(_keywords) !== -1);
// }
//
// this.hiddenNodes = this.zTreeObj.getNodesByFilter(filterFunc);
//
// this.zTreeObj.hideNodes(this.hiddenNodes);
// }
}
@
Component
({
selector
:
'asset-tree-dialog'
,
selector
:
'
elements-
asset-tree-dialog'
,
templateUrl
:
'dialog.html'
,
})
export
class
AssetTreeDialogComponent
implements
OnInit
{
...
...
src/app/pages/control/cleftbar/cleftbar.component.html
View file @
6cd72440
<div
class=
"sidebar"
fxLayout=
"column"
ngxSplit=
"column"
>
<div
fxflex=
"0 0 50px"
class=
"search"
>
<input
class=
"left-search"
placeholder=
" {{'Search'| trans }} ..."
maxlength=
"2048"
name=
"q"
autocomplete=
"off"
<input
id=
"keyword"
class=
"left-search"
placeholder=
" {{'Search'| trans }} ..."
maxlength=
"2048"
name=
"q"
autocomplete=
"off"
title=
"Search"
type=
"text"
tabindex=
"1"
spellcheck=
"false"
autofocus
[(
ngModel
)]="
q
"
(
keyup
.
enter
)="
Search
(
q
)"
>
</div>
...
...
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