Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
任超
/
js.CadastralSystem
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
c0df0af6
authored
2020-10-21 15:06:48 +0800
by
杨威
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
默认展开到宗地节点
1 parent
9eaddfbb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
11 deletions
src/components/lineTree/lineItem.vue
src/components/lineTree/lineTree.vue
src/components/lineTree/lineItem.vue
View file @
c0df0af
...
...
@@ -79,13 +79,22 @@ export default {
}
},
openMenu
(
e
,
item
)
{
if
(
item
.
isZD
!=
undefined
)
{
if
(
item
.
zdbsm
)
{
var
x
=
e
.
pageX
;
var
y
=
e
.
pageY
;
this
.
$emit
(
"changeIsZD"
,
item
.
isZD
);
this
.
$emit
(
"changeIsZD"
,
true
);
this
.
$emit
(
"changeTop"
,
y
);
this
.
$emit
(
"changeLeft"
,
x
);
this
.
$emit
(
"changeVisible"
,
true
);
}
else
if
(
item
.
zrzbsm
)
{
var
x
=
e
.
pageX
;
var
y
=
e
.
pageY
;
this
.
$emit
(
"changeIsZD"
,
false
);
this
.
$emit
(
"changeTop"
,
y
);
this
.
$emit
(
"changeLeft"
,
x
);
this
.
$emit
(
"changeVisible"
,
true
);
}
else
{
return
;
}
// this.top = y;
// this.left = x;
...
...
src/components/lineTree/lineTree.vue
View file @
c0df0af
...
...
@@ -34,10 +34,10 @@
<lineItem
v-if=
"item.expand && item.children.length > 0"
v-on=
"$listeners"
@
changeTop=
"changeTop"
@
changeLeft=
"changeLeft"
@
changeVisible=
"changeVisible"
@
changeIsZD=
"changeIsZD"
@
changeTop=
"changeTop"
@
changeLeft=
"changeLeft"
@
changeVisible=
"changeVisible"
@
changeIsZD=
"changeIsZD"
:list=
"item.children"
:visible=
"visible"
:size=
"size"
...
...
@@ -78,8 +78,8 @@ export default {
formatData
:
[],
visible
:
false
,
top
:
0
,
left
:
0
,
isZD
:
true
left
:
0
,
isZD
:
true
,
};
},
watch
:
{
...
...
@@ -91,6 +91,7 @@ export default {
created
()
{
console
.
log
(
"lineTree create"
);
this
.
preDealData
(
this
.
pd
);
this
.
expandTreeItemById
([
"6b5af49d803f97baf06afb897de257f5"
]);
},
methods
:
{
...
...
@@ -109,17 +110,20 @@ export default {
},
preDealData
(
list
)
{
list
.
forEach
((
x
)
=>
{
if
(
!
x
.
expand
)
this
.
$set
(
x
,
"expand"
,
false
);
if
(
x
.
children
&&
x
.
children
.
length
>
0
)
this
.
preDealData
(
x
.
children
);
if
(
!
x
.
expand
)
this
.
$set
(
x
,
"expand"
,
true
);
if
(
x
.
children
&&
x
.
children
.
length
>
0
)
{
this
.
preDealData
(
x
.
children
);
}
});
return
list
;
},
// 根据id展开树的具体项
expandTreeItemById
(
idList
)
{
debugger
;
let
_this
=
this
;
function
loopTree
(
list
)
{
list
.
forEach
((
x
)
=>
{
if
(
idList
.
includes
(
x
.
id
))
{
if
(
idList
.
includes
(
x
.
zdbsm
))
{
_this
.
$set
(
x
,
"expand"
,
true
);
}
else
{
_this
.
$set
(
x
,
"expand"
,
false
);
...
...
@@ -129,6 +133,7 @@ export default {
return
list
;
}
this
.
formatData
=
loopTree
(
this
.
pd
);
console
.
log
(
this
.
formatData
,
"this.formatData"
);
},
itemClick
(
item
)
{
item
.
expand
=
!
item
.
expand
;
...
...
Please
register
or
sign in
to post a comment