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
ead7ded1
Commit
ead7ded1
authored
Oct 09, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 添加树形加载中
parent
946f4110
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
asset-tree.component.html
src/app/elements/asset-tree/asset-tree.component.html
+1
-1
asset-tree.component.ts
src/app/elements/asset-tree/asset-tree.component.ts
+9
-5
No files found.
src/app/elements/asset-tree/asset-tree.component.html
View file @
ead7ded1
<div>
<div>
<p
*
ngIf=
"loading"
style=
"padding: 3px"
>
{{ "Loading"|trans }} ...
</p>
<ul
id=
"assetsTree"
class=
"ztree"
>
<ul
id=
"assetsTree"
class=
"ztree"
>
{{ "Loading"|trans }} ...
</ul>
</ul>
<ul
id=
"remoteAppsTree"
class=
"ztree"
>
<ul
id=
"remoteAppsTree"
class=
"ztree"
>
...
...
src/app/elements/asset-tree/asset-tree.component.ts
View file @
ead7ded1
...
@@ -46,6 +46,7 @@ export class ElementAssetTreeComponent implements OnInit, OnDestroy {
...
@@ -46,6 +46,7 @@ export class ElementAssetTreeComponent implements OnInit, OnDestroy {
treeFilterSubscription
:
any
;
treeFilterSubscription
:
any
;
isLoadTreeAsync
:
boolean
;
isLoadTreeAsync
:
boolean
;
filterAssetCancel
$
:
Subject
<
boolean
>
=
new
Subject
();
filterAssetCancel
$
:
Subject
<
boolean
>
=
new
Subject
();
loading
=
true
;
constructor
(
private
_appSvc
:
AppService
,
constructor
(
private
_appSvc
:
AppService
,
private
_treeFilterSvc
:
TreeFilterService
,
private
_treeFilterSvc
:
TreeFilterService
,
...
@@ -103,7 +104,9 @@ export class ElementAssetTreeComponent implements OnInit, OnDestroy {
...
@@ -103,7 +104,9 @@ export class ElementAssetTreeComponent implements OnInit, OnDestroy {
};
};
}
}
this
.
loading
=
true
;
this
.
_http
.
getMyGrantedNodes
(
this
.
isLoadTreeAsync
,
refresh
).
subscribe
(
resp
=>
{
this
.
_http
.
getMyGrantedNodes
(
this
.
isLoadTreeAsync
,
refresh
).
subscribe
(
resp
=>
{
this
.
loading
=
false
;
const
assetsTree
=
$
.
fn
.
zTree
.
init
(
$
(
'#assetsTree'
),
setting
,
resp
);
const
assetsTree
=
$
.
fn
.
zTree
.
init
(
$
(
'#assetsTree'
),
setting
,
resp
);
this
.
assetsTree
=
assetsTree
;
this
.
assetsTree
=
assetsTree
;
this
.
rootNodeAddDom
(
assetsTree
,
()
=>
{
this
.
rootNodeAddDom
(
assetsTree
,
()
=>
{
...
@@ -325,21 +328,22 @@ export class ElementAssetTreeComponent implements OnInit, OnDestroy {
...
@@ -325,21 +328,22 @@ export class ElementAssetTreeComponent implements OnInit, OnDestroy {
this
.
assetsTree
.
removeChildNodes
(
searchNode
[
0
]);
this
.
assetsTree
.
removeChildNodes
(
searchNode
[
0
]);
this
.
assetsTree
.
removeNode
(
searchNode
[
0
]);
this
.
assetsTree
.
removeNode
(
searchNode
[
0
]);
}
}
if
(
!
keyword
)
{
const
treeNodes
=
this
.
assetsTree
.
getNodes
();
const
treeNodes
=
this
.
assetsTree
.
getNodes
();
if
(
!
keyword
)
{
if
(
treeNodes
.
length
!==
0
)
{
if
(
treeNodes
.
length
!==
0
)
{
this
.
assetsTree
.
showNode
(
treeNodes
[
0
]);
this
.
assetsTree
.
showNode
(
treeNodes
[
0
]);
}
}
return
;
return
;
}
}
this
.
filterAssetCancel$
.
next
(
true
);
this
.
filterAssetCancel$
.
next
(
true
);
this
.
_http
.
getMyGrantedAssets
(
keyword
)
.
pipe
(
takeUntil
(
this
.
filterAssetCancel$
))
.
subscribe
(
nodes
=>
{
const
treeNodes
=
this
.
assetsTree
.
getNodes
();
if
(
treeNodes
.
length
!==
0
)
{
if
(
treeNodes
.
length
!==
0
)
{
this
.
assetsTree
.
hideNode
(
treeNodes
[
0
]);
this
.
assetsTree
.
hideNode
(
treeNodes
[
0
]);
}
}
this
.
loading
=
true
;
this
.
_http
.
getMyGrantedAssets
(
keyword
)
.
pipe
(
takeUntil
(
this
.
filterAssetCancel$
))
.
subscribe
(
nodes
=>
{
this
.
loading
=
false
;
let
name
=
translate
(
'Search'
);
let
name
=
translate
(
'Search'
);
const
assetsAmount
=
nodes
.
length
;
const
assetsAmount
=
nodes
.
length
;
name
=
`
${
name
}
(
${
assetsAmount
}
)`
;
name
=
`
${
name
}
(
${
assetsAmount
}
)`
;
...
...
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