@riil-frontend/component-topology 9.0.0-a.2 → 9.0.0-a.4

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.
@@ -24,7 +24,7 @@ import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
24
24
  import SelectionModel from "./SelectionModel";
25
25
  import CiCache from "./cache/CiCache"; // eslint-disable-next-line no-undef
26
26
 
27
- var version = typeof "9.0.0-a.2" === 'string' ? "9.0.0-a.2" : null;
27
+ var version = typeof "9.0.0-a.4" === 'string' ? "9.0.0-a.4" : null;
28
28
  console.info("\u62D3\u6251\u7248\u672C: " + version);
29
29
  /**
30
30
  * 拓扑显示和编辑
@@ -21,6 +21,13 @@ export default {
21
21
  visible: false,
22
22
  id: null // 资源id
23
23
 
24
+ };
25
+ },
26
+ close: function close() {
27
+ return {
28
+ visible: false,
29
+ id: null // 资源id
30
+
24
31
  };
25
32
  }
26
33
  },
@@ -76,9 +76,7 @@ function ResourceDetailDrawer(props) {
76
76
  }, []); // 解决切换拓扑图隐藏概览
77
77
 
78
78
  useEffect(function () {
79
- resourceDetailDispatchers.update({
80
- visible: false
81
- }); // TODO 其他数据重置
79
+ close(); // TODO 其他数据重置
82
80
  }, [topoId]);
83
81
 
84
82
  function getUser() {
@@ -154,6 +152,12 @@ function ResourceDetailDrawer(props) {
154
152
  }
155
153
  }
156
154
 
155
+ function close() {
156
+ resourceDetailDispatchers.update({
157
+ visible: false
158
+ });
159
+ }
160
+
157
161
  function init(data, targetType) {
158
162
  // console.log('初始化基本信息', data, targetType);
159
163
  var id = data.id,
@@ -214,7 +218,8 @@ function ResourceDetailDrawer(props) {
214
218
  topo: topo,
215
219
  userId: userId,
216
220
  activeData: activeData,
217
- resourceData: resourceData
221
+ resourceData: resourceData,
222
+ onClose: close
218
223
  }));
219
224
  };
220
225
 
@@ -228,11 +233,7 @@ function ResourceDetailDrawer(props) {
228
233
  })),
229
234
  width: 580,
230
235
  hasMask: false,
231
- onClose: function onClose() {
232
- return resourceDetailDispatchers.update({
233
- visible: false
234
- });
235
- }
236
+ onClose: close
236
237
  }, visible && resourceData && renderContent()));
237
238
  }
238
239
 
@@ -30,7 +30,7 @@ import Configurator from "./components/Configurator";
30
30
  import { formatMetric } from "../../../../../../models/attributeFormatter";
31
31
  import LinkTopoCard from "./components/LinkTopo/LinkTopoCard";
32
32
  import EventsCard from "./EventsCard";
33
- import { queryLastestValue } from "./components/LinkTopo/services"; // url 处理,UICBB 的地址需截取前缀
33
+ import { checkMenu, isOpenFlow, queryLastestValue } from "./components/LinkTopo/services"; // url 处理,UICBB 的地址需截取前缀
34
34
 
35
35
  function formatUrl(url) {
36
36
  var _window, _window$location;
@@ -285,26 +285,26 @@ export default function ResourceOverview(props) {
285
285
 
286
286
 
287
287
  function _getAddressFormat() {
288
- _getAddressFormat = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref2) {
288
+ _getAddressFormat = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref2) {
289
289
  var owned_computer_room, owned_cabinet, start_u_location, end_u_location, address, _res$find, _res$find$attributes, _res$find2, _res$find2$attributes, res, u;
290
290
 
291
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
291
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
292
292
  while (1) {
293
- switch (_context3.prev = _context3.next) {
293
+ switch (_context4.prev = _context4.next) {
294
294
  case 0:
295
295
  owned_computer_room = _ref2.owned_computer_room, owned_cabinet = _ref2.owned_cabinet, start_u_location = _ref2.start_u_location, end_u_location = _ref2.end_u_location;
296
296
  address = '';
297
297
 
298
298
  if (!(owned_computer_room && owned_cabinet)) {
299
- _context3.next = 7;
299
+ _context4.next = 7;
300
300
  break;
301
301
  }
302
302
 
303
- _context3.next = 5;
303
+ _context4.next = 5;
304
304
  return queryCisByIds([owned_computer_room, owned_cabinet]);
305
305
 
306
306
  case 5:
307
- res = _context3.sent;
307
+ res = _context4.sent;
308
308
  address = (((_res$find = res.find(function (item) {
309
309
  return item.id === owned_computer_room;
310
310
  })) === null || _res$find === void 0 ? void 0 : (_res$find$attributes = _res$find.attributes) === null || _res$find$attributes === void 0 ? void 0 : _res$find$attributes.display_name) || '') + " " + (((_res$find2 = res.find(function (item) {
@@ -318,14 +318,14 @@ export default function ResourceOverview(props) {
318
318
  u = (start_u_location || '') + "-" + (end_u_location || '');
319
319
  }
320
320
 
321
- return _context3.abrupt("return", address || u ? "" + (address || '') + (u ? " " + u : '') : '');
321
+ return _context4.abrupt("return", address || u ? "" + (address || '') + (u ? " " + u : '') : '');
322
322
 
323
323
  case 10:
324
324
  case "end":
325
- return _context3.stop();
325
+ return _context4.stop();
326
326
  }
327
327
  }
328
- }, _callee3);
328
+ }, _callee4);
329
329
  }));
330
330
  return _getAddressFormat.apply(this, arguments);
331
331
  }
@@ -388,22 +388,22 @@ export default function ResourceOverview(props) {
388
388
  }
389
389
 
390
390
  function _alarmRiskOperation() {
391
- _alarmRiskOperation = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(type, params) {
391
+ _alarmRiskOperation = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(type, params) {
392
392
  var res;
393
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
393
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
394
394
  while (1) {
395
- switch (_context4.prev = _context4.next) {
395
+ switch (_context5.prev = _context5.next) {
396
396
  case 0:
397
397
  if (!(type === 'alarm')) {
398
- _context4.next = 6;
398
+ _context5.next = 6;
399
399
  break;
400
400
  }
401
401
 
402
- _context4.next = 3;
402
+ _context5.next = 3;
403
403
  return service.handleAlarm(params);
404
404
 
405
405
  case 3:
406
- res = _context4.sent;
406
+ res = _context5.sent;
407
407
 
408
408
  _Message.success('受理成功');
409
409
 
@@ -420,10 +420,10 @@ export default function ResourceOverview(props) {
420
420
 
421
421
  case 6:
422
422
  case "end":
423
- return _context4.stop();
423
+ return _context5.stop();
424
424
  }
425
425
  }
426
- }, _callee4);
426
+ }, _callee5);
427
427
  }));
428
428
  return _alarmRiskOperation.apply(this, arguments);
429
429
  }
@@ -442,31 +442,31 @@ export default function ResourceOverview(props) {
442
442
 
443
443
 
444
444
  function _baseInfoColChange() {
445
- _baseInfoColChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(col) {
445
+ _baseInfoColChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(col) {
446
446
  var _col;
447
447
 
448
- var infoData, attributeMap, _iterator, _step, item, value, contentTitle, _data, _ref3, _ref3$, _item, _attributeMap, object, _object, displayName, attr;
448
+ var infoData, attributeMap, _iterator, _step, item, value, contentTitle, _data, _ref4, _ref4$, _item, _attributeMap, object, _object, displayName, attr;
449
449
 
450
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
450
+ return _regeneratorRuntime.wrap(function _callee7$(_context7) {
451
451
  while (1) {
452
- switch (_context6.prev = _context6.next) {
452
+ switch (_context7.prev = _context7.next) {
453
453
  case 0:
454
454
  if ((_col = col) !== null && _col !== void 0 && _col.length) {
455
- _context6.next = 3;
455
+ _context7.next = 3;
456
456
  break;
457
457
  }
458
458
 
459
459
  setBaseInfo([]);
460
- return _context6.abrupt("return");
460
+ return _context7.abrupt("return");
461
461
 
462
462
  case 3:
463
463
  settBaseInfoInitLoading(true);
464
464
  infoData = [];
465
- _context6.next = 7;
465
+ _context7.next = 7;
466
466
  return getAttribute(id);
467
467
 
468
468
  case 7:
469
- attributeMap = _context6.sent;
469
+ attributeMap = _context7.sent;
470
470
  // console.log('getAttribute', attributeMap);
471
471
  col = col.filter(function (item) {
472
472
  return !item.hidden;
@@ -475,21 +475,21 @@ export default function ResourceOverview(props) {
475
475
 
476
476
  case 10:
477
477
  if ((_step = _iterator()).done) {
478
- _context6.next = 26;
478
+ _context7.next = 26;
479
479
  break;
480
480
  }
481
481
 
482
482
  item = _step.value;
483
483
  value = formatMetric(attributeMap[item.dataIndex], ciTypeMeta.attributeMap[item.dataIndex]);
484
484
  contentTitle = value;
485
- return _context6.delegateYield( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
485
+ return _context7.delegateYield( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
486
486
  var link, address, owned_computer_room, owned_cabinet, roomLink, node;
487
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
487
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
488
488
  while (1) {
489
- switch (_context5.prev = _context5.next) {
489
+ switch (_context6.prev = _context6.next) {
490
490
  case 0:
491
- _context5.t0 = item.dataIndex;
492
- _context5.next = _context5.t0 === 'display_name' ? 3 : _context5.t0 === 'ciName' ? 6 : _context5.t0 === 'res_address' ? 9 : _context5.t0 === 'imageName' ? 16 : 20;
491
+ _context6.t0 = item.dataIndex;
492
+ _context6.next = _context6.t0 === 'display_name' ? 3 : _context6.t0 === 'ciName' ? 6 : _context6.t0 === 'res_address' ? 9 : _context6.t0 === 'imageName' ? 16 : 20;
493
493
  break;
494
494
 
495
495
  case 3:
@@ -510,19 +510,19 @@ export default function ResourceOverview(props) {
510
510
  }
511
511
 
512
512
  contentTitle = attributeMap.display_name || '-';
513
- return _context5.abrupt("break", 21);
513
+ return _context6.abrupt("break", 21);
514
514
 
515
515
  case 6:
516
516
  value = ciTypeMeta.displayName;
517
517
  contentTitle = value;
518
- return _context5.abrupt("break", 21);
518
+ return _context6.abrupt("break", 21);
519
519
 
520
520
  case 9:
521
- _context5.next = 11;
521
+ _context6.next = 11;
522
522
  return getAddressFormat(attributeMap);
523
523
 
524
524
  case 11:
525
- address = _context5.sent;
525
+ address = _context6.sent;
526
526
  owned_computer_room = attributeMap.owned_computer_room, owned_cabinet = attributeMap.owned_cabinet; // 跳转3D机房定位设备
527
527
 
528
528
  if (owned_computer_room && owned_cabinet) {
@@ -541,23 +541,23 @@ export default function ResourceOverview(props) {
541
541
  }
542
542
 
543
543
  contentTitle = address;
544
- return _context5.abrupt("break", 21);
544
+ return _context6.abrupt("break", 21);
545
545
 
546
546
  case 16:
547
547
  node = topo.getDataModel().getDataByTag(id);
548
548
  value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
549
549
  contentTitle = value;
550
- return _context5.abrupt("break", 21);
550
+ return _context6.abrupt("break", 21);
551
551
 
552
552
  case 20:
553
- return _context5.abrupt("break", 21);
553
+ return _context6.abrupt("break", 21);
554
554
 
555
555
  case 21:
556
556
  case "end":
557
- return _context5.stop();
557
+ return _context6.stop();
558
558
  }
559
559
  }
560
- }, _callee5);
560
+ }, _callee6);
561
561
  })(), "t0", 15);
562
562
 
563
563
  case 15:
@@ -568,9 +568,9 @@ export default function ResourceOverview(props) {
568
568
  }
569
569
 
570
570
  _data = topo.attributeMetricDisplay.getData() || [];
571
- _ref3 = [].concat(_data.filter(function (m) {
571
+ _ref4 = [].concat(_data.filter(function (m) {
572
572
  return m.id === id;
573
- })), _ref3$ = _ref3[0], _item = _ref3$ === void 0 ? {} : _ref3$;
573
+ })), _ref4$ = _ref4[0], _item = _ref4$ === void 0 ? {} : _ref4$;
574
574
  _attributeMap = _item.attributeMap || {};
575
575
  object = _attributeMap[item.dataIndex + "_object"] || {};
576
576
 
@@ -597,7 +597,7 @@ export default function ResourceOverview(props) {
597
597
  }));
598
598
 
599
599
  case 24:
600
- _context6.next = 10;
600
+ _context7.next = 10;
601
601
  break;
602
602
 
603
603
  case 26:
@@ -606,10 +606,10 @@ export default function ResourceOverview(props) {
606
606
 
607
607
  case 28:
608
608
  case "end":
609
- return _context6.stop();
609
+ return _context7.stop();
610
610
  }
611
611
  }
612
- }, _callee6);
612
+ }, _callee7);
613
613
  }));
614
614
  return _baseInfoColChange.apply(this, arguments);
615
615
  }
@@ -620,44 +620,44 @@ export default function ResourceOverview(props) {
620
620
 
621
621
 
622
622
  function _getAttribute() {
623
- _getAttribute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(id) {
624
- var _yield$resourceOvervi, baseInfos, res, _ref4, attributes;
623
+ _getAttribute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(id) {
624
+ var _yield$resourceOvervi, baseInfos, res, _ref5, attributes;
625
625
 
626
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
626
+ return _regeneratorRuntime.wrap(function _callee8$(_context8) {
627
627
  while (1) {
628
- switch (_context7.prev = _context7.next) {
628
+ switch (_context8.prev = _context8.next) {
629
629
  case 0:
630
630
  if (id) {
631
- _context7.next = 2;
631
+ _context8.next = 2;
632
632
  break;
633
633
  }
634
634
 
635
- return _context7.abrupt("return");
635
+ return _context8.abrupt("return");
636
636
 
637
637
  case 2:
638
638
  if (!(resourceOverviewProps !== null && resourceOverviewProps !== void 0 && resourceOverviewProps.getData)) {
639
- _context7.next = 9;
639
+ _context8.next = 9;
640
640
  break;
641
641
  }
642
642
 
643
- _context7.next = 5;
643
+ _context8.next = 5;
644
644
  return resourceOverviewProps === null || resourceOverviewProps === void 0 ? void 0 : resourceOverviewProps.getData({
645
645
  id: id
646
646
  });
647
647
 
648
648
  case 5:
649
- _yield$resourceOvervi = _context7.sent;
649
+ _yield$resourceOvervi = _context8.sent;
650
650
  baseInfos = _yield$resourceOvervi.baseInfos;
651
651
 
652
652
  if (!baseInfos) {
653
- _context7.next = 9;
653
+ _context8.next = 9;
654
654
  break;
655
655
  }
656
656
 
657
- return _context7.abrupt("return", baseInfos);
657
+ return _context8.abrupt("return", baseInfos);
658
658
 
659
659
  case 9:
660
- _context7.next = 11;
660
+ _context8.next = 11;
661
661
  return service.commonQueryCiData({
662
662
  condition: "id('" + id + "')",
663
663
  refAttribute: true,
@@ -670,16 +670,16 @@ export default function ResourceOverview(props) {
670
670
  });
671
671
 
672
672
  case 11:
673
- res = _context7.sent;
674
- _ref4 = (res === null || res === void 0 ? void 0 : res.data[0]) || {}, attributes = _ref4.attributes;
675
- return _context7.abrupt("return", attributes || {});
673
+ res = _context8.sent;
674
+ _ref5 = (res === null || res === void 0 ? void 0 : res.data[0]) || {}, attributes = _ref5.attributes;
675
+ return _context8.abrupt("return", attributes || {});
676
676
 
677
677
  case 14:
678
678
  case "end":
679
- return _context7.stop();
679
+ return _context8.stop();
680
680
  }
681
681
  }
682
- }, _callee7);
682
+ }, _callee8);
683
683
  }));
684
684
  return _getAttribute.apply(this, arguments);
685
685
  }
@@ -689,14 +689,14 @@ export default function ResourceOverview(props) {
689
689
  }
690
690
 
691
691
  function _metricColChange() {
692
- _metricColChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(col) {
692
+ _metricColChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(col) {
693
693
  var _col2, _col3;
694
694
 
695
- var codes, endTime, params, _ref5, times, metricList, newMetricList, metricLists;
695
+ var codes, endTime, params, _ref6, times, metricList, newMetricList, metricLists;
696
696
 
697
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
697
+ return _regeneratorRuntime.wrap(function _callee9$(_context9) {
698
698
  while (1) {
699
- switch (_context8.prev = _context8.next) {
699
+ switch (_context9.prev = _context9.next) {
700
700
  case 0:
701
701
  // console.log('metricColChange col', col);
702
702
  col = (_col2 = col) === null || _col2 === void 0 ? void 0 : _col2.filter(function (item) {
@@ -704,13 +704,13 @@ export default function ResourceOverview(props) {
704
704
  });
705
705
 
706
706
  if ((_col3 = col) !== null && _col3 !== void 0 && _col3.length) {
707
- _context8.next = 4;
707
+ _context9.next = 4;
708
708
  break;
709
709
  }
710
710
 
711
711
  setMetric([]); // Message.error('指标未设置')
712
712
 
713
- return _context8.abrupt("return");
713
+ return _context9.abrupt("return");
714
714
 
715
715
  case 4:
716
716
  codes = col.map(function (item) {
@@ -726,7 +726,7 @@ export default function ResourceOverview(props) {
726
726
  };
727
727
 
728
728
  if (isAppTopo) {
729
- _ref5 = resourceOverviewProps.metricProps || {}, times = _ref5.times;
729
+ _ref6 = resourceOverviewProps.metricProps || {}, times = _ref6.times;
730
730
 
731
731
  if (times !== null && times !== void 0 && times.length) {
732
732
  params.startTime = times[0];
@@ -735,18 +735,16 @@ export default function ResourceOverview(props) {
735
735
  }
736
736
 
737
737
  setMetricInitLoading(true);
738
- _context8.next = 11;
738
+ _context9.next = 11;
739
739
  return service.getMetricList(params);
740
740
 
741
741
  case 11:
742
- metricList = _context8.sent;
743
- _context8.next = 14;
744
- return queryLastestValue({
742
+ metricList = _context9.sent;
743
+ newMetricList = queryMetricList({
744
+ 'name': data.attributes.display_name
745
+ }, {
745
746
  'id': data.attributes.name
746
747
  });
747
-
748
- case 14:
749
- newMetricList = _context8.sent;
750
748
  metricLists = metricList.concat(getNewMetricList(newMetricList));
751
749
  rlog.debug('metricColChange', metricLists, monitorMetricModels);
752
750
  setMetric(col.map(function (item, key) {
@@ -773,16 +771,75 @@ export default function ResourceOverview(props) {
773
771
  }, 60000);
774
772
  }
775
773
 
776
- case 20:
774
+ case 18:
777
775
  case "end":
778
- return _context8.stop();
776
+ return _context9.stop();
779
777
  }
780
778
  }
781
- }, _callee8);
779
+ }, _callee9);
782
780
  }));
783
781
  return _metricColChange.apply(this, arguments);
784
782
  }
785
783
 
784
+ var queryMetricList = /*#__PURE__*/function () {
785
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(data, param) {
786
+ var checkMenus, isOpen;
787
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
788
+ while (1) {
789
+ switch (_context3.prev = _context3.next) {
790
+ case 0:
791
+ if (!(ciType !== 'network_link')) {
792
+ _context3.next = 2;
793
+ break;
794
+ }
795
+
796
+ return _context3.abrupt("return", []);
797
+
798
+ case 2:
799
+ _context3.next = 4;
800
+ return checkMenu();
801
+
802
+ case 4:
803
+ checkMenus = _context3.sent;
804
+
805
+ if (!(checkMenus[0].passed == 'PASS')) {
806
+ _context3.next = 13;
807
+ break;
808
+ }
809
+
810
+ _context3.next = 8;
811
+ return isOpenFlow(data);
812
+
813
+ case 8:
814
+ isOpen = _context3.sent;
815
+
816
+ if (!isOpen) {
817
+ _context3.next = 13;
818
+ break;
819
+ }
820
+
821
+ _context3.next = 12;
822
+ return queryLastestValue(param);
823
+
824
+ case 12:
825
+ return _context3.abrupt("return", _context3.sent);
826
+
827
+ case 13:
828
+ return _context3.abrupt("return", []);
829
+
830
+ case 14:
831
+ case "end":
832
+ return _context3.stop();
833
+ }
834
+ }
835
+ }, _callee3);
836
+ }));
837
+
838
+ return function queryMetricList(_x9, _x10) {
839
+ return _ref3.apply(this, arguments);
840
+ };
841
+ }();
842
+
786
843
  var getNewMetricList = function getNewMetricList(data) {
787
844
  return [{
788
845
  errorMsg: null,
@@ -56,7 +56,7 @@ var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
56
56
  var _CiCache = _interopRequireDefault(require("./cache/CiCache"));
57
57
 
58
58
  // eslint-disable-next-line no-undef
59
- var version = typeof "9.0.0-a.2" === 'string' ? "9.0.0-a.2" : null;
59
+ var version = typeof "9.0.0-a.4" === 'string' ? "9.0.0-a.4" : null;
60
60
  console.info("\u62D3\u6251\u7248\u672C: " + version);
61
61
  /**
62
62
  * 拓扑显示和编辑
@@ -29,6 +29,13 @@ var _default = {
29
29
  visible: false,
30
30
  id: null // 资源id
31
31
 
32
+ };
33
+ },
34
+ close: function close() {
35
+ return {
36
+ visible: false,
37
+ id: null // 资源id
38
+
32
39
  };
33
40
  }
34
41
  },
@@ -98,9 +98,7 @@ function ResourceDetailDrawer(props) {
98
98
  }, []); // 解决切换拓扑图隐藏概览
99
99
 
100
100
  (0, _react.useEffect)(function () {
101
- resourceDetailDispatchers.update({
102
- visible: false
103
- }); // TODO 其他数据重置
101
+ close(); // TODO 其他数据重置
104
102
  }, [topoId]);
105
103
 
106
104
  function getUser() {
@@ -176,6 +174,12 @@ function ResourceDetailDrawer(props) {
176
174
  }
177
175
  }
178
176
 
177
+ function close() {
178
+ resourceDetailDispatchers.update({
179
+ visible: false
180
+ });
181
+ }
182
+
179
183
  function init(data, targetType) {
180
184
  // console.log('初始化基本信息', data, targetType);
181
185
  var id = data.id,
@@ -236,7 +240,8 @@ function ResourceDetailDrawer(props) {
236
240
  topo: topo,
237
241
  userId: userId,
238
242
  activeData: activeData,
239
- resourceData: resourceData
243
+ resourceData: resourceData,
244
+ onClose: close
240
245
  }));
241
246
  };
242
247
 
@@ -250,11 +255,7 @@ function ResourceDetailDrawer(props) {
250
255
  })),
251
256
  width: 580,
252
257
  hasMask: false,
253
- onClose: function onClose() {
254
- return resourceDetailDispatchers.update({
255
- visible: false
256
- });
257
- }
258
+ onClose: close
258
259
  }, visible && resourceData && renderContent()));
259
260
  }
260
261