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
340a5a58
authored
2020-10-21 15:21:54 +0800
by
zhaoqian
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
2 parents
decc474c
1665cd18
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
6 deletions
src/components/lineTree/lineItem.vue
src/components/lineTree/lineTree.vue
src/components/lineTree/lineItem.vue
View file @
340a5a5
...
...
@@ -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 @
340a5a5
...
...
@@ -79,7 +79,7 @@ export default {
visible
:
false
,
top
:
0
,
left
:
0
,
isZD
:
true
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