@riil-frontend/component-topology 7.0.0-dev.3 → 7.0.0-dev.5

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.
@@ -74,33 +74,10 @@ var useTopoEdit = function useTopoEdit(params) {
74
74
  comboResData = _useState2[0],
75
75
  setComboResData = _useState2[1];
76
76
 
77
- var onEnterEdit = /*#__PURE__*/function () {
78
- var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
79
- return _regenerator["default"].wrap(function _callee$(_context) {
80
- while (1) {
81
- switch (_context.prev = _context.next) {
82
- case 0:
83
- case "end":
84
- return _context.stop();
85
- }
86
- }
87
- }, _callee);
88
- }));
89
-
90
- return function onEnterEdit() {
91
- return _ref.apply(this, arguments);
92
- };
93
- }();
94
-
95
- var onExitEdit = function onExitEdit() {// editDispatchers.switchToViewMode(topoId);
96
- };
97
-
98
77
  var reset = function reset() {
99
78
  topoEditDispatchers.reset();
100
79
  topo.historyManager.destroy();
101
80
  };
102
-
103
- var onBindData = function onBindData(eventData) {};
104
81
  /**
105
82
  * 增加资源到视图
106
83
  */
@@ -114,13 +91,13 @@ var useTopoEdit = function useTopoEdit(params) {
114
91
  };
115
92
 
116
93
  var onLayerAdded = /*#__PURE__*/function () {
117
- var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(_ref2) {
94
+ var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(_ref) {
118
95
  var target, direction, config;
119
- return _regenerator["default"].wrap(function _callee2$(_context2) {
96
+ return _regenerator["default"].wrap(function _callee$(_context) {
120
97
  while (1) {
121
- switch (_context2.prev = _context2.next) {
98
+ switch (_context.prev = _context.next) {
122
99
  case 0:
123
- target = _ref2.target, direction = _ref2.direction;
100
+ target = _ref.target, direction = _ref.direction;
124
101
  topo.historyManager.beginTransaction(); // 从拓扑图获取分层和资源配置
125
102
 
126
103
  config = resourceConfig.getConfigFromHt(topo.getDataModel());
@@ -131,11 +108,11 @@ var useTopoEdit = function useTopoEdit(params) {
131
108
 
132
109
 
133
110
  if (!(!isLayerTopo && config.layers.length)) {
134
- _context2.next = 7;
111
+ _context.next = 7;
135
112
  break;
136
113
  }
137
114
 
138
- _context2.next = 7;
115
+ _context.next = 7;
139
116
  return topoDispatchers.setTopoType(_template.TPL_TREE);
140
117
 
141
118
  case 7:
@@ -147,23 +124,23 @@ var useTopoEdit = function useTopoEdit(params) {
147
124
 
148
125
  case 8:
149
126
  case "end":
150
- return _context2.stop();
127
+ return _context.stop();
151
128
  }
152
129
  }
153
- }, _callee2);
130
+ }, _callee);
154
131
  }));
155
132
 
156
133
  return function onLayerAdded(_x) {
157
- return _ref3.apply(this, arguments);
134
+ return _ref2.apply(this, arguments);
158
135
  };
159
136
  }();
160
137
 
161
138
  var deleteLayer = /*#__PURE__*/function () {
162
- var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(layerElement) {
139
+ var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(layerElement) {
163
140
  var config;
164
- return _regenerator["default"].wrap(function _callee3$(_context3) {
141
+ return _regenerator["default"].wrap(function _callee2$(_context2) {
165
142
  while (1) {
166
- switch (_context3.prev = _context3.next) {
143
+ switch (_context2.prev = _context2.next) {
167
144
  case 0:
168
145
  topo.historyManager.beginTransaction();
169
146
  emitEvent(_componentTopologyGraph.TopoEvent.EVENT_TRIGGER_DELETE, layerElement); // 获取资源配置
@@ -176,19 +153,19 @@ var useTopoEdit = function useTopoEdit(params) {
176
153
 
177
154
 
178
155
  if (config.layers.length) {
179
- _context3.next = 7;
156
+ _context2.next = 7;
180
157
  break;
181
158
  }
182
159
 
183
- _context3.next = 7;
160
+ _context2.next = 7;
184
161
  return topoDispatchers.setTopoType(_template.TPL_BLANK);
185
162
 
186
163
  case 7:
187
- _context3.next = 9;
164
+ _context2.next = 9;
188
165
  return resourceConfig.updateConfig(config);
189
166
 
190
167
  case 9:
191
- _context3.next = 11;
168
+ _context2.next = 11;
192
169
  return editDispatchers.fetchDataByConfig();
193
170
 
194
171
  case 11:
@@ -196,14 +173,14 @@ var useTopoEdit = function useTopoEdit(params) {
196
173
 
197
174
  case 12:
198
175
  case "end":
199
- return _context3.stop();
176
+ return _context2.stop();
200
177
  }
201
178
  }
202
- }, _callee3);
179
+ }, _callee2);
203
180
  }));
204
181
 
205
182
  return function deleteLayer(_x2) {
206
- return _ref4.apply(this, arguments);
183
+ return _ref3.apply(this, arguments);
207
184
  };
208
185
  }();
209
186
 
@@ -226,19 +203,19 @@ var useTopoEdit = function useTopoEdit(params) {
226
203
  type: "warning"
227
204
  },
228
205
  onOk: function () {
229
- var _onOk = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
230
- return _regenerator["default"].wrap(function _callee4$(_context4) {
206
+ var _onOk = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
207
+ return _regenerator["default"].wrap(function _callee3$(_context3) {
231
208
  while (1) {
232
- switch (_context4.prev = _context4.next) {
209
+ switch (_context3.prev = _context3.next) {
233
210
  case 0:
234
211
  deleteLayer(layerElement);
235
212
 
236
213
  case 1:
237
214
  case "end":
238
- return _context4.stop();
215
+ return _context3.stop();
239
216
  }
240
217
  }
241
- }, _callee4);
218
+ }, _callee3);
242
219
  }));
243
220
 
244
221
  function onOk() {
@@ -284,19 +261,19 @@ var useTopoEdit = function useTopoEdit(params) {
284
261
  type: "warning"
285
262
  },
286
263
  onOk: function () {
287
- var _onOk2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
288
- return _regenerator["default"].wrap(function _callee5$(_context5) {
264
+ var _onOk2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
265
+ return _regenerator["default"].wrap(function _callee4$(_context4) {
289
266
  while (1) {
290
- switch (_context5.prev = _context5.next) {
267
+ switch (_context4.prev = _context4.next) {
291
268
  case 0:
292
269
  doDelete();
293
270
 
294
271
  case 1:
295
272
  case "end":
296
- return _context5.stop();
273
+ return _context4.stop();
297
274
  }
298
275
  }
299
- }, _callee5);
276
+ }, _callee4);
300
277
  }));
301
278
 
302
279
  function onOk() {
@@ -342,20 +319,20 @@ var useTopoEdit = function useTopoEdit(params) {
342
319
 
343
320
 
344
321
  var deleteExLink = /*#__PURE__*/function () {
345
- var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(node) {
322
+ var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(node) {
346
323
  var _node$getEdges$toArra, _node$getEdges;
347
324
 
348
325
  var config, edges, exportLinkIdList;
349
- return _regenerator["default"].wrap(function _callee6$(_context6) {
326
+ return _regenerator["default"].wrap(function _callee5$(_context5) {
350
327
  while (1) {
351
- switch (_context6.prev = _context6.next) {
328
+ switch (_context5.prev = _context5.next) {
352
329
  case 0:
353
330
  config = resourceConfig.getConfig(); // console.log("删除关联在节点上的出口链路- node, config", node, config);
354
331
 
355
332
  edges = (_node$getEdges$toArra = (_node$getEdges = node.getEdges()) === null || _node$getEdges === void 0 ? void 0 : _node$getEdges.toArray()) !== null && _node$getEdges$toArra !== void 0 ? _node$getEdges$toArra : []; // const exLink = [];
356
333
 
357
334
  if (!(edges.length > 0)) {
358
- _context6.next = 8;
335
+ _context5.next = 8;
359
336
  break;
360
337
  }
361
338
 
@@ -369,19 +346,19 @@ var useTopoEdit = function useTopoEdit(params) {
369
346
  }
370
347
  });
371
348
  config.exportLinkIdList = exportLinkIdList;
372
- _context6.next = 8;
349
+ _context5.next = 8;
373
350
  return resourceConfig.updateConfig(config);
374
351
 
375
352
  case 8:
376
353
  case "end":
377
- return _context6.stop();
354
+ return _context5.stop();
378
355
  }
379
356
  }
380
- }, _callee6);
357
+ }, _callee5);
381
358
  }));
382
359
 
383
360
  return function deleteExLink(_x3) {
384
- return _ref5.apply(this, arguments);
361
+ return _ref4.apply(this, arguments);
385
362
  };
386
363
  }();
387
364
 
@@ -463,27 +440,27 @@ var useTopoEdit = function useTopoEdit(params) {
463
440
  }
464
441
 
465
442
  function _bindGroupResources() {
466
- _bindGroupResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12(group, resources) {
443
+ _bindGroupResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11(group, resources) {
467
444
  var id, tag, _yield$editDispatcher2, elements, nodeElements, newLinkElements, updateElements;
468
445
 
469
- return _regenerator["default"].wrap(function _callee12$(_context12) {
446
+ return _regenerator["default"].wrap(function _callee11$(_context11) {
470
447
  while (1) {
471
- switch (_context12.prev = _context12.next) {
448
+ switch (_context11.prev = _context11.next) {
472
449
  case 0:
473
450
  id = group.id, tag = group.tag;
474
451
 
475
452
  _rlog["default"].debug("bindGroupResources--id, tag", id, tag);
476
453
 
477
454
  topo.historyManager.beginTransaction();
478
- _context12.next = 5;
455
+ _context11.next = 5;
479
456
  return resourceConfig.updateGroupResources(group, resources);
480
457
 
481
458
  case 5:
482
- _context12.next = 7;
459
+ _context11.next = 7;
483
460
  return editDispatchers.fetchDataByConfig();
484
461
 
485
462
  case 7:
486
- _yield$editDispatcher2 = _context12.sent;
463
+ _yield$editDispatcher2 = _context11.sent;
487
464
  elements = _yield$editDispatcher2.elements;
488
465
  // 区域里的子区域及子区域的节点、新增的链路
489
466
  nodeElements = (0, _topoData.findGroupChildren)(elements, group);
@@ -502,10 +479,10 @@ var useTopoEdit = function useTopoEdit(params) {
502
479
 
503
480
  case 14:
504
481
  case "end":
505
- return _context12.stop();
482
+ return _context11.stop();
506
483
  }
507
484
  }
508
- }, _callee12);
485
+ }, _callee11);
509
486
  }));
510
487
  return _bindGroupResources.apply(this, arguments);
511
488
  }
@@ -519,11 +496,11 @@ var useTopoEdit = function useTopoEdit(params) {
519
496
 
520
497
 
521
498
  function _addGroupResources() {
522
- _addGroupResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee13(group, newResourceIds) {
499
+ _addGroupResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12(group, newResourceIds) {
523
500
  var groupConfig, resources, groupData;
524
- return _regenerator["default"].wrap(function _callee13$(_context13) {
501
+ return _regenerator["default"].wrap(function _callee12$(_context12) {
525
502
  while (1) {
526
- switch (_context13.prev = _context13.next) {
503
+ switch (_context12.prev = _context12.next) {
527
504
  case 0:
528
505
  groupConfig = resourceConfig.getGroupConfigByElement(group);
529
506
  resources = {
@@ -533,15 +510,15 @@ var useTopoEdit = function useTopoEdit(params) {
533
510
  id: group.getTag(),
534
511
  tag: group.a("tag")
535
512
  };
536
- _context13.next = 5;
513
+ _context12.next = 5;
537
514
  return bindGroupResources(groupData, resources, newResourceIds);
538
515
 
539
516
  case 5:
540
517
  case "end":
541
- return _context13.stop();
518
+ return _context12.stop();
542
519
  }
543
520
  }
544
- }, _callee13);
521
+ }, _callee12);
545
522
  }));
546
523
  return _addGroupResources.apply(this, arguments);
547
524
  }
@@ -558,25 +535,25 @@ var useTopoEdit = function useTopoEdit(params) {
558
535
 
559
536
 
560
537
  function _bindViewResources() {
561
- _bindViewResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee14(data) {
538
+ _bindViewResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee13(data) {
562
539
  var config, _yield$editDispatcher3, elements;
563
540
 
564
- return _regenerator["default"].wrap(function _callee14$(_context14) {
541
+ return _regenerator["default"].wrap(function _callee13$(_context13) {
565
542
  while (1) {
566
- switch (_context14.prev = _context14.next) {
543
+ switch (_context13.prev = _context13.next) {
567
544
  case 0:
568
545
  // console.log("关联视图的资源", data);
569
546
  config = resourceConfig.getConfig();
570
547
  config.resources = data;
571
- _context14.next = 4;
548
+ _context13.next = 4;
572
549
  return resourceConfig.updateConfig(config);
573
550
 
574
551
  case 4:
575
- _context14.next = 6;
552
+ _context13.next = 6;
576
553
  return editDispatchers.fetchDataByConfig();
577
554
 
578
555
  case 6:
579
- _yield$editDispatcher3 = _context14.sent;
556
+ _yield$editDispatcher3 = _context13.sent;
580
557
  elements = _yield$editDispatcher3.elements;
581
558
  saveBind(_componentTopologyGraph.TopoEvent.DATA_TYPE_RESOURCE_COMBO, elements); // 临时放这里,仅拓扑中心有
582
559
 
@@ -586,10 +563,10 @@ var useTopoEdit = function useTopoEdit(params) {
586
563
 
587
564
  case 10:
588
565
  case "end":
589
- return _context14.stop();
566
+ return _context13.stop();
590
567
  }
591
568
  }
592
- }, _callee14);
569
+ }, _callee13);
593
570
  }));
594
571
  return _bindViewResources.apply(this, arguments);
595
572
  }
@@ -599,24 +576,24 @@ var useTopoEdit = function useTopoEdit(params) {
599
576
  }
600
577
 
601
578
  function _addLayerResources() {
602
- _addLayerResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee15(group, newResourceIds) {
579
+ _addLayerResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee14(group, newResourceIds) {
603
580
  var _yield$editDispatcher4, elements, newElements;
604
581
 
605
- return _regenerator["default"].wrap(function _callee15$(_context15) {
582
+ return _regenerator["default"].wrap(function _callee14$(_context14) {
606
583
  while (1) {
607
- switch (_context15.prev = _context15.next) {
584
+ switch (_context14.prev = _context14.next) {
608
585
  case 0:
609
586
  topo.historyManager.beginTransaction(); // 构造新的配置
610
587
 
611
- _context15.next = 3;
588
+ _context14.next = 3;
612
589
  return resourceConfig.addLayerStaticResources(group, newResourceIds);
613
590
 
614
591
  case 3:
615
- _context15.next = 5;
592
+ _context14.next = 5;
616
593
  return editDispatchers.fetchDataByConfig();
617
594
 
618
595
  case 5:
619
- _yield$editDispatcher4 = _context15.sent;
596
+ _yield$editDispatcher4 = _context14.sent;
620
597
  elements = _yield$editDispatcher4.elements;
621
598
  // 2022-11-10 修复 添加资源后分层重新布局问题,仅布局新增资源。替换api topo.updateElements(data)
622
599
  newElements = findUNExistedElements(elements);
@@ -641,10 +618,10 @@ var useTopoEdit = function useTopoEdit(params) {
641
618
 
642
619
  case 14:
643
620
  case "end":
644
- return _context15.stop();
621
+ return _context14.stop();
645
622
  }
646
623
  }
647
- }, _callee15);
624
+ }, _callee14);
648
625
  }));
649
626
  return _addLayerResources.apply(this, arguments);
650
627
  }
@@ -654,22 +631,22 @@ var useTopoEdit = function useTopoEdit(params) {
654
631
  }
655
632
 
656
633
  function _addResourceToFirstLayer() {
657
- _addResourceToFirstLayer = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee16(data) {
634
+ _addResourceToFirstLayer = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee15(data) {
658
635
  var group;
659
- return _regenerator["default"].wrap(function _callee16$(_context16) {
636
+ return _regenerator["default"].wrap(function _callee15$(_context15) {
660
637
  while (1) {
661
- switch (_context16.prev = _context16.next) {
638
+ switch (_context15.prev = _context15.next) {
662
639
  case 0:
663
640
  group = resourceConfig.getGroups()[0];
664
- _context16.next = 3;
641
+ _context15.next = 3;
665
642
  return addLayerResources(group, data);
666
643
 
667
644
  case 3:
668
645
  case "end":
669
- return _context16.stop();
646
+ return _context15.stop();
670
647
  }
671
648
  }
672
- }, _callee16);
649
+ }, _callee15);
673
650
  }));
674
651
  return _addResourceToFirstLayer.apply(this, arguments);
675
652
  }
@@ -701,29 +678,29 @@ var useTopoEdit = function useTopoEdit(params) {
701
678
 
702
679
 
703
680
  var onSaveComboRes = /*#__PURE__*/function () {
704
- var _ref6 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(data) {
705
- return _regenerator["default"].wrap(function _callee7$(_context7) {
681
+ var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(data) {
682
+ return _regenerator["default"].wrap(function _callee6$(_context6) {
706
683
  while (1) {
707
- switch (_context7.prev = _context7.next) {
684
+ switch (_context6.prev = _context6.next) {
708
685
  case 0:
709
686
  _rlog["default"].debug("关联资源-----onSaveComboRes", data);
710
687
 
711
688
  topo.historyManager.beginTransaction();
712
689
 
713
690
  if (!(getAddResourceType() === "addToFirstLayer")) {
714
- _context7.next = 7;
691
+ _context6.next = 7;
715
692
  break;
716
693
  }
717
694
 
718
- _context7.next = 5;
695
+ _context6.next = 5;
719
696
  return addResourceToFirstLayer(data);
720
697
 
721
698
  case 5:
722
- _context7.next = 9;
699
+ _context6.next = 9;
723
700
  break;
724
701
 
725
702
  case 7:
726
- _context7.next = 9;
703
+ _context6.next = 9;
727
704
  return bindViewResources(data);
728
705
 
729
706
  case 9:
@@ -735,14 +712,14 @@ var useTopoEdit = function useTopoEdit(params) {
735
712
 
736
713
  case 12:
737
714
  case "end":
738
- return _context7.stop();
715
+ return _context6.stop();
739
716
  }
740
717
  }
741
- }, _callee7);
718
+ }, _callee6);
742
719
  }));
743
720
 
744
721
  return function onSaveComboRes(_x12) {
745
- return _ref6.apply(this, arguments);
722
+ return _ref5.apply(this, arguments);
746
723
  };
747
724
  }();
748
725
 
@@ -751,27 +728,27 @@ var useTopoEdit = function useTopoEdit(params) {
751
728
  }
752
729
 
753
730
  function _checkSavePermission() {
754
- _checkSavePermission = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee17(id) {
731
+ _checkSavePermission = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee16(id) {
755
732
  var permission;
756
- return _regenerator["default"].wrap(function _callee17$(_context17) {
733
+ return _regenerator["default"].wrap(function _callee16$(_context16) {
757
734
  while (1) {
758
- switch (_context17.prev = _context17.next) {
735
+ switch (_context16.prev = _context16.next) {
759
736
  case 0:
760
- _context17.next = 2;
737
+ _context16.next = 2;
761
738
  return topoDispatchers.getTopoPermission({
762
739
  id: id,
763
740
  update: false
764
741
  });
765
742
 
766
743
  case 2:
767
- permission = _context17.sent;
744
+ permission = _context16.sent;
768
745
 
769
746
  if (!_topoPermissionUtil["default"].isEditable(permission)) {
770
- _context17.next = 5;
747
+ _context16.next = 5;
771
748
  break;
772
749
  }
773
750
 
774
- return _context17.abrupt("return", true);
751
+ return _context16.abrupt("return", true);
775
752
 
776
753
  case 5:
777
754
  _dialog["default"].alert({
@@ -783,42 +760,42 @@ var useTopoEdit = function useTopoEdit(params) {
783
760
  onOk: function onOk() {}
784
761
  });
785
762
 
786
- return _context17.abrupt("return", false);
763
+ return _context16.abrupt("return", false);
787
764
 
788
765
  case 7:
789
766
  case "end":
790
- return _context17.stop();
767
+ return _context16.stop();
791
768
  }
792
769
  }
793
- }, _callee17);
770
+ }, _callee16);
794
771
  }));
795
772
  return _checkSavePermission.apply(this, arguments);
796
773
  }
797
774
 
798
775
  var onSaveTopo = /*#__PURE__*/function () {
799
- var _ref7 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(data) {
776
+ var _ref6 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(data) {
800
777
  var id, config, serialize, _config$layout, template, layout, saveConfig, valid, saveData;
801
778
 
802
- return _regenerator["default"].wrap(function _callee9$(_context9) {
779
+ return _regenerator["default"].wrap(function _callee8$(_context8) {
803
780
  while (1) {
804
- switch (_context9.prev = _context9.next) {
781
+ switch (_context8.prev = _context8.next) {
805
782
  case 0:
806
783
  id = data.id, config = data.config, serialize = data.serialize;
807
784
  _config$layout = config === null || config === void 0 ? void 0 : config.layout, template = _config$layout.type, layout = _config$layout.layout;
808
785
 
809
786
  if (!onSave) {
810
- _context9.next = 6;
787
+ _context8.next = 6;
811
788
  break;
812
789
  }
813
790
 
814
791
  // 自定义保存
815
792
  saveConfig = /*#__PURE__*/function () {
816
- var _ref8 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
817
- return _regenerator["default"].wrap(function _callee8$(_context8) {
793
+ var _ref7 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
794
+ return _regenerator["default"].wrap(function _callee7$(_context7) {
818
795
  while (1) {
819
- switch (_context8.prev = _context8.next) {
796
+ switch (_context7.prev = _context7.next) {
820
797
  case 0:
821
- _context8.next = 2;
798
+ _context7.next = 2;
822
799
  return editDispatchers.saveTopo({
823
800
  id: id,
824
801
  layout: layout,
@@ -827,14 +804,14 @@ var useTopoEdit = function useTopoEdit(params) {
827
804
 
828
805
  case 2:
829
806
  case "end":
830
- return _context8.stop();
807
+ return _context7.stop();
831
808
  }
832
809
  }
833
- }, _callee8);
810
+ }, _callee7);
834
811
  }));
835
812
 
836
813
  return function saveConfig() {
837
- return _ref8.apply(this, arguments);
814
+ return _ref7.apply(this, arguments);
838
815
  };
839
816
  }();
840
817
 
@@ -842,7 +819,7 @@ var useTopoEdit = function useTopoEdit(params) {
842
819
  data: data,
843
820
  saveConfig: saveConfig
844
821
  });
845
- return _context9.abrupt("return");
822
+ return _context8.abrupt("return");
846
823
 
847
824
  case 6:
848
825
  // TODO 以下逻辑移到拓扑中心
@@ -850,21 +827,21 @@ var useTopoEdit = function useTopoEdit(params) {
850
827
  saving: true
851
828
  }); // 检查权限
852
829
 
853
- _context9.next = 9;
830
+ _context8.next = 9;
854
831
  return checkSavePermission(id);
855
832
 
856
833
  case 9:
857
- valid = _context9.sent;
834
+ valid = _context8.sent;
858
835
 
859
836
  if (valid) {
860
- _context9.next = 13;
837
+ _context8.next = 13;
861
838
  break;
862
839
  }
863
840
 
864
841
  topoEditDispatchers.update({
865
842
  saving: false
866
843
  });
867
- return _context9.abrupt("return");
844
+ return _context8.abrupt("return");
868
845
 
869
846
  case 13:
870
847
  // 保存
@@ -876,7 +853,7 @@ var useTopoEdit = function useTopoEdit(params) {
876
853
 
877
854
  _rlog["default"].info("保存", saveData);
878
855
 
879
- _context9.next = 17;
856
+ _context8.next = 17;
880
857
  return editDispatchers.saveTopo(saveData);
881
858
 
882
859
  case 17:
@@ -888,14 +865,14 @@ var useTopoEdit = function useTopoEdit(params) {
888
865
 
889
866
  case 19:
890
867
  case "end":
891
- return _context9.stop();
868
+ return _context8.stop();
892
869
  }
893
870
  }
894
- }, _callee9);
871
+ }, _callee8);
895
872
  }));
896
873
 
897
874
  return function onSaveTopo(_x14) {
898
- return _ref7.apply(this, arguments);
875
+ return _ref6.apply(this, arguments);
899
876
  };
900
877
  }();
901
878
 
@@ -923,12 +900,12 @@ var useTopoEdit = function useTopoEdit(params) {
923
900
 
924
901
 
925
902
  var bindNodeResource = /*#__PURE__*/function () {
926
- var _ref9 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11(params) {
903
+ var _ref8 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(params) {
927
904
  var id, oldResId, newResId, node, parentGroupElement, htTopo, config, groupId, groupTag, _yield$editDispatcher, elements, newData, doBind, _doBind, replaceOrAddRes;
928
905
 
929
- return _regenerator["default"].wrap(function _callee11$(_context11) {
906
+ return _regenerator["default"].wrap(function _callee10$(_context10) {
930
907
  while (1) {
931
- switch (_context11.prev = _context11.next) {
908
+ switch (_context10.prev = _context10.next) {
932
909
  case 0:
933
910
  replaceOrAddRes = function _replaceOrAddRes(resources, oldResId, newResId) {
934
911
  return (0, _extends2["default"])({}, resources, {
@@ -939,11 +916,11 @@ var useTopoEdit = function useTopoEdit(params) {
939
916
  };
940
917
 
941
918
  _doBind = function _doBind3() {
942
- _doBind = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10() {
919
+ _doBind = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9() {
943
920
  var dm, newLinkElements, createElementsData, groupChildren, newGroupChildren, existedGroupChildren, groupElement, newElement, sm;
944
- return _regenerator["default"].wrap(function _callee10$(_context10) {
921
+ return _regenerator["default"].wrap(function _callee9$(_context9) {
945
922
  while (1) {
946
- switch (_context10.prev = _context10.next) {
923
+ switch (_context9.prev = _context9.next) {
947
924
  case 0:
948
925
  dm = htTopo.getGraphView().dm(); // 创建
949
926
 
@@ -1013,7 +990,7 @@ var useTopoEdit = function useTopoEdit(params) {
1013
990
  // node.a("customName", null);
1014
991
  // 删除关联在节点上的出口链路
1015
992
 
1016
- _context10.next = 12;
993
+ _context9.next = 12;
1017
994
  return deleteExLink(node);
1018
995
 
1019
996
  case 12:
@@ -1024,10 +1001,10 @@ var useTopoEdit = function useTopoEdit(params) {
1024
1001
 
1025
1002
  case 13:
1026
1003
  case "end":
1027
- return _context10.stop();
1004
+ return _context9.stop();
1028
1005
  }
1029
1006
  }
1030
- }, _callee10);
1007
+ }, _callee9);
1031
1008
  }));
1032
1009
  return _doBind.apply(this, arguments);
1033
1010
  };
@@ -1069,22 +1046,22 @@ var useTopoEdit = function useTopoEdit(params) {
1069
1046
  config.resources = replaceOrAddRes(config.resources, oldResId, newResId);
1070
1047
  }
1071
1048
 
1072
- _context11.next = 13;
1049
+ _context10.next = 13;
1073
1050
  return resourceConfig.updateConfig(config);
1074
1051
 
1075
1052
  case 13:
1076
- _context11.next = 15;
1053
+ _context10.next = 15;
1077
1054
  return editDispatchers.fetchDataByConfig();
1078
1055
 
1079
1056
  case 15:
1080
- _yield$editDispatcher = _context11.sent;
1057
+ _yield$editDispatcher = _context10.sent;
1081
1058
  elements = _yield$editDispatcher.elements;
1082
1059
  newData = elements.find(function (item) {
1083
1060
  return item.id === newResId;
1084
1061
  });
1085
1062
 
1086
1063
  if (newData) {
1087
- _context11.next = 23;
1064
+ _context10.next = 23;
1088
1065
  break;
1089
1066
  }
1090
1067
 
@@ -1093,10 +1070,10 @@ var useTopoEdit = function useTopoEdit(params) {
1093
1070
  _rlog["default"].warn("关联资源失败");
1094
1071
 
1095
1072
  topo.historyManager.endTransaction();
1096
- return _context11.abrupt("return", false);
1073
+ return _context10.abrupt("return", false);
1097
1074
 
1098
1075
  case 23:
1099
- _context11.next = 25;
1076
+ _context10.next = 25;
1100
1077
  return doBind();
1101
1078
 
1102
1079
  case 25:
@@ -1104,14 +1081,14 @@ var useTopoEdit = function useTopoEdit(params) {
1104
1081
 
1105
1082
  case 26:
1106
1083
  case "end":
1107
- return _context11.stop();
1084
+ return _context10.stop();
1108
1085
  }
1109
1086
  }
1110
- }, _callee11);
1087
+ }, _callee10);
1111
1088
  }));
1112
1089
 
1113
1090
  return function bindNodeResource(_x15) {
1114
- return _ref9.apply(this, arguments);
1091
+ return _ref8.apply(this, arguments);
1115
1092
  };
1116
1093
  }();
1117
1094
 
@@ -1168,24 +1145,9 @@ var useTopoEdit = function useTopoEdit(params) {
1168
1145
  */
1169
1146
  getAllNodeResourceIds: resourceConfig.getAllNodeResourceIds,
1170
1147
  onEvent: onEvent,
1171
-
1172
- /**
1173
- * 进入编辑模式回调
1174
- */
1175
- onEnterEdit: onEnterEdit,
1176
-
1177
- /**
1178
- * 退出编辑模式回调
1179
- */
1180
- onExitEdit: onExitEdit,
1181
1148
  reset: reset,
1182
1149
  addLayerResources: addLayerResources,
1183
1150
 
1184
- /**
1185
- * 发起业务数据(资源、链路)绑定回调
1186
- */
1187
- onBindData: onBindData,
1188
-
1189
1151
  /**
1190
1152
  * 显示全局添加资源抽屉
1191
1153
  */