@riil-frontend/component-topology 6.0.14 → 6.0.16

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.
@@ -601,7 +601,7 @@ var useTopoEdit = function useTopoEdit(params) {
601
601
  }
602
602
 
603
603
  topo.historyManager.endTransaction();
604
- topo.getHtTopo().fitContent(); // 添加资源后隐藏资源面板
604
+ topo.getHtTopo().getGraphView().fitContent(undefined, undefined, true); // 添加资源后隐藏资源面板
605
605
 
606
606
  topoEditDispatchers.update({
607
607
  resourceTabActiveKey: null
@@ -54,12 +54,16 @@ var SelectionModel = /*#__PURE__*/function () {
54
54
  };
55
55
 
56
56
  _proto.destroy = function destroy() {
57
+ this.resetState();
58
+ this.removeListener();
59
+ };
60
+
61
+ _proto.resetState = function resetState() {
57
62
  var selectionDispatchers = this.topo.store.getModelDispatchers('selection');
58
63
  selectionDispatchers.update({
59
64
  selection: [],
60
65
  selectionIds: []
61
66
  });
62
- this.removeListener();
63
67
  };
64
68
 
65
69
  _proto.useSelection = function useSelection() {
@@ -23,7 +23,7 @@ import topoFactory from "./topoFactory";
23
23
  import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
24
24
  import SelectionModel from "./SelectionModel"; // eslint-disable-next-line no-undef
25
25
 
26
- var version = typeof "6.0.14" === 'string' ? "6.0.14" : null;
26
+ var version = typeof "6.0.16" === 'string' ? "6.0.16" : null;
27
27
  console.info("\u62D3\u6251\u7248\u672C: " + version);
28
28
  /**
29
29
  * 拓扑显示和编辑
@@ -535,21 +535,21 @@ var Topo = /*#__PURE__*/function () {
535
535
  while (1) {
536
536
  switch (_context12.prev = _context12.next) {
537
537
  case 0:
538
- topoDispatchers = this.store.getModelDispatchers('topoMod');
539
- _context12.next = 3;
540
- return topoDispatchers.update({
541
- viewState: 'edit'
542
- });
543
-
544
- case 3:
545
538
  if (!this.options.onSwitchToEditModeBegin) {
546
- _context12.next = 6;
539
+ _context12.next = 3;
547
540
  break;
548
541
  }
549
542
 
550
- _context12.next = 6;
543
+ _context12.next = 3;
551
544
  return this.options.onSwitchToEditModeBegin(this);
552
545
 
546
+ case 3:
547
+ topoDispatchers = this.store.getModelDispatchers('topoMod');
548
+ _context12.next = 6;
549
+ return topoDispatchers.update({
550
+ viewState: 'edit'
551
+ });
552
+
553
553
  case 6:
554
554
  _context12.next = 8;
555
555
  return this.view.switchToEditMode();
@@ -633,7 +633,7 @@ var useTopoEdit = function useTopoEdit(params) {
633
633
  }
634
634
 
635
635
  topo.historyManager.endTransaction();
636
- topo.getHtTopo().fitContent(); // 添加资源后隐藏资源面板
636
+ topo.getHtTopo().getGraphView().fitContent(undefined, undefined, true); // 添加资源后隐藏资源面板
637
637
 
638
638
  topoEditDispatchers.update({
639
639
  resourceTabActiveKey: null
@@ -64,12 +64,16 @@ var SelectionModel = /*#__PURE__*/function () {
64
64
  };
65
65
 
66
66
  _proto.destroy = function destroy() {
67
+ this.resetState();
68
+ this.removeListener();
69
+ };
70
+
71
+ _proto.resetState = function resetState() {
67
72
  var selectionDispatchers = this.topo.store.getModelDispatchers('selection');
68
73
  selectionDispatchers.update({
69
74
  selection: [],
70
75
  selectionIds: []
71
76
  });
72
- this.removeListener();
73
77
  };
74
78
 
75
79
  _proto.useSelection = function useSelection() {
@@ -54,7 +54,7 @@ var _ElementTagTipConfig = _interopRequireDefault(require("./tagstips/ElementTag
54
54
  var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
55
55
 
56
56
  // eslint-disable-next-line no-undef
57
- var version = typeof "6.0.14" === 'string' ? "6.0.14" : null;
57
+ var version = typeof "6.0.16" === 'string' ? "6.0.16" : null;
58
58
  console.info("\u62D3\u6251\u7248\u672C: " + version);
59
59
  /**
60
60
  * 拓扑显示和编辑
@@ -566,21 +566,21 @@ var Topo = /*#__PURE__*/function () {
566
566
  while (1) {
567
567
  switch (_context12.prev = _context12.next) {
568
568
  case 0:
569
- topoDispatchers = this.store.getModelDispatchers('topoMod');
570
- _context12.next = 3;
571
- return topoDispatchers.update({
572
- viewState: 'edit'
573
- });
574
-
575
- case 3:
576
569
  if (!this.options.onSwitchToEditModeBegin) {
577
- _context12.next = 6;
570
+ _context12.next = 3;
578
571
  break;
579
572
  }
580
573
 
581
- _context12.next = 6;
574
+ _context12.next = 3;
582
575
  return this.options.onSwitchToEditModeBegin(this);
583
576
 
577
+ case 3:
578
+ topoDispatchers = this.store.getModelDispatchers('topoMod');
579
+ _context12.next = 6;
580
+ return topoDispatchers.update({
581
+ viewState: 'edit'
582
+ });
583
+
584
584
  case 6:
585
585
  _context12.next = 8;
586
586
  return this.view.switchToEditMode();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riil-frontend/component-topology",
3
- "version": "6.0.14",
3
+ "version": "6.0.16",
4
4
  "description": "拓扑",
5
5
  "scripts": {
6
6
  "start": "build-scripts start",
@@ -116,6 +116,6 @@
116
116
  "access": "public"
117
117
  },
118
118
  "license": "MIT",
119
- "homepage": "https://unpkg.com/@riil-frontend/component-topology@6.0.14/build/index.html",
119
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@6.0.16/build/index.html",
120
120
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
121
121
  }