@@ -13,15 +13,15 @@ class SelectionSelect {
13
13
y : number ,
14
14
} ;
15
15
__disabled = false ;
16
- isDefalutStopMoveGraph = false ;
16
+ isDefaultStopMoveGraph = false ;
17
17
isWholeNode = true ;
18
18
isWholeEdge = true ;
19
19
static pluginName = 'selectionSelect' ;
20
20
constructor ( { lf } ) {
21
21
this . lf = lf ;
22
- // 初始化isDefalutStopMoveGraph取值
22
+ // 初始化isDefaultStopMoveGraph取值
23
23
const { stopMoveGraph } = lf . getEditConfig ( ) ;
24
- this . isDefalutStopMoveGraph = stopMoveGraph ;
24
+ this . isDefaultStopMoveGraph = stopMoveGraph ;
25
25
lf . openSelectionSelect = ( ) => {
26
26
this . openSelectionSelect ( ) ;
27
27
} ;
@@ -70,7 +70,7 @@ class SelectionSelect {
70
70
openSelectionSelect ( ) {
71
71
const { stopMoveGraph } = this . lf . getEditConfig ( ) ;
72
72
if ( ! stopMoveGraph ) {
73
- this . isDefalutStopMoveGraph = false ;
73
+ this . isDefaultStopMoveGraph = false ;
74
74
this . lf . updateEditConfig ( {
75
75
stopMoveGraph : true ,
76
76
} ) ;
@@ -81,7 +81,7 @@ class SelectionSelect {
81
81
* 关闭选区
82
82
*/
83
83
closeSelectionSelect ( ) {
84
- if ( ! this . isDefalutStopMoveGraph ) {
84
+ if ( ! this . isDefaultStopMoveGraph ) {
85
85
this . lf . updateEditConfig ( {
86
86
stopMoveGraph : false ,
87
87
} ) ;
@@ -125,9 +125,15 @@ class SelectionSelect {
125
125
}
126
126
const lt : PointTuple = [ Math . min ( x , x1 ) , Math . min ( y , y1 ) ] ;
127
127
const rt : PointTuple = [ Math . max ( x , x1 ) , Math . max ( y , y1 ) ] ;
128
- const elements = this . lf . getAreaElement ( lt , rt , this . isWholeEdge , this . isWholeNode ) ;
128
+ const elements = this . lf . graphModel . getAreaElement (
129
+ lt , rt , this . isWholeEdge , this . isWholeNode , true ,
130
+ ) ;
131
+ const { group } = this . lf . graphModel ;
129
132
elements . forEach ( ( element ) => {
130
- this . lf . selectElementById ( element . id , true ) ;
133
+ // 如果节点属于分组,则不不选中节点
134
+ if ( ! group || ! group . getNodeGroup ( element . id ) ) {
135
+ this . lf . selectElementById ( element . id , true ) ;
136
+ }
131
137
} ) ;
132
138
this . lf . emit ( 'selection:selected' , elements ) ;
133
139
} ;
0 commit comments