gantt-source_management 3.37.7 → 3.37.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -544,7 +544,8 @@ class a {
|
|
|
544
544
|
(this.data.selectionAreaLocal = this.getSelectionAreaLocal(i)),
|
|
545
545
|
(this.data.currentPosition = i.currentPosition),
|
|
546
546
|
(this.data.initialPosition = i.initialPosition),
|
|
547
|
-
!this.data.items
|
|
547
|
+
!this.data.items || i.type !== 'down'
|
|
548
|
+
)
|
|
548
549
|
)
|
|
549
550
|
return;
|
|
550
551
|
if (!this.canSelect()) return;
|
|
@@ -565,7 +566,33 @@ class a {
|
|
|
565
566
|
`Item with id"${s.id}"does not exists in"$data.chart.items".TIP:For performance reasons,state is mutable,so try not to modify items from the"state.get"method before you copy them(with"gstc.api.clone(items)"for example).`,
|
|
566
567
|
))
|
|
567
568
|
);
|
|
568
|
-
if (this.data.selected[e].includes(s.id))
|
|
569
|
+
if (this.data.selected[e].includes(s.id)){
|
|
570
|
+
|
|
571
|
+
if (this.isMulti()) {
|
|
572
|
+
// 多选模式下,从已选择列表中移除该项目
|
|
573
|
+
this.data.selected[e] = this.data.selected[e].filter((itemId) => itemId !== s.id);
|
|
574
|
+
this.data.automaticallySelected[e] = this.data.automaticallySelected[e].filter((itemId) => itemId !== s.id);
|
|
575
|
+
} else {
|
|
576
|
+
// 单选模式下,清空已选择列表
|
|
577
|
+
this.data.selected[e] = [];
|
|
578
|
+
this.data.selected[t] = [];
|
|
579
|
+
this.data.automaticallySelected[e] = [];
|
|
580
|
+
}
|
|
581
|
+
// 记录最后一次选择的状态
|
|
582
|
+
this.data.lastSelecting = {
|
|
583
|
+
[e]: [...this.data.selected[e]],
|
|
584
|
+
[t]: [...this.data.selected[t]],
|
|
585
|
+
};
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
// 更新状态
|
|
589
|
+
let c = this.state.multi(true);
|
|
590
|
+
c = this.updateCells(c);
|
|
591
|
+
c = this.updateItems(c);
|
|
592
|
+
c.done();
|
|
593
|
+
|
|
594
|
+
return;
|
|
595
|
+
}
|
|
569
596
|
let { selected: l, automaticallySelected: n } = this.getSelectedItem(s);
|
|
570
597
|
l.length > 1 && !this.data.multipleSelection && ((l = [s.id]), (n = [])),
|
|
571
598
|
this.isMulti()
|
|
@@ -577,13 +604,19 @@ class a {
|
|
|
577
604
|
: ((this.data.selected[e] = l), (this.data.selected[t].length = 0)),
|
|
578
605
|
(this.data.automaticallySelected[e] = n),
|
|
579
606
|
(this.data.lastSelecting = {
|
|
580
|
-
[e]: [
|
|
581
|
-
[t]: [
|
|
607
|
+
[e]: [],
|
|
608
|
+
[t]: [],
|
|
582
609
|
}),
|
|
583
610
|
(this.data.selected = this.onSelected(
|
|
584
611
|
this.api.mergeDeep({}, this.data.selected),
|
|
585
612
|
this.api.mergeDeep({}, this.data.lastSelected),
|
|
586
|
-
)
|
|
613
|
+
)
|
|
614
|
+
);
|
|
615
|
+
//
|
|
616
|
+
this.data.selected[e] = [];
|
|
617
|
+
this.data.selected[t] = [];
|
|
618
|
+
this.data.automaticallySelected[e] = [];
|
|
619
|
+
////////
|
|
587
620
|
let c = this.state.multi(!0);
|
|
588
621
|
(c = this.updateCells(c)), (c = this.updateItems(c)), c.done();
|
|
589
622
|
}
|