@riil-frontend/component-topology 12.0.0-dev.13 → 12.0.0-dev.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.
@@ -1,3 +1,5 @@
1
+ import _Balloon from "@alifd/next/es/balloon";
2
+ import _extends from "@babel/runtime/helpers/extends";
1
3
  import _List from "@alifd/next/es/list";
2
4
  import _Icon from "@alifd/next/es/icon";
3
5
  import React, { useState, useEffect } from 'react';
@@ -31,6 +33,7 @@ function AlarmListItem(props) {
31
33
  var topo = props.topo,
32
34
  alarmInfo = props.alarmInfo,
33
35
  onClick = props.onClick;
36
+ console.log("AlarmListPanel", topo, alarmInfo);
34
37
  return /*#__PURE__*/React.createElement(_List.Item, {
35
38
  className: styles.AlarmListItem,
36
39
  media: /*#__PURE__*/React.createElement(_Icon, {
@@ -85,10 +88,60 @@ function RiskListItem(props) {
85
88
  }, "\u67E5\u770B\u8BE6\u60C5"))));
86
89
  }
87
90
 
91
+ function SubListItem(props) {
92
+ // 传入参数
93
+ var topo = props.topo,
94
+ alarmInfo = props.alarmInfo,
95
+ onClick = props.onClick;
96
+ var creatAlarmTips = topo.viewProps.creatAlarmTips;
97
+ var subNode = topo.getData().nodes.find(function (node) {
98
+ return node.ciId === alarmInfo.mainCiId;
99
+ });
100
+ var plarm = alarmInfo.cmpCode ? "\u3010" + subNode.sourceName + "\u3011" : "【本级平台】";
101
+ return /*#__PURE__*/React.createElement(_List.Item, {
102
+ className: styles.AlarmListItem,
103
+ media: /*#__PURE__*/React.createElement(_Icon, {
104
+ type: "gaojing-3",
105
+ size: "xs",
106
+ className: styles["alarm-color-icon"] + " alarm-color-icon-lv" + alarmInfo.alertLevel
107
+ })
108
+ }, /*#__PURE__*/React.createElement("span", {
109
+ className: styles.content
110
+ }, /*#__PURE__*/React.createElement("div", {
111
+ className: styles.list,
112
+ onClick: function onClick() {
113
+ getNode(topo, alarmInfo);
114
+ }
115
+ }, "" + plarm + alarmInfo.alertObject + alarmInfo.alertTitle), alarmInfo.cmpCode ? /*#__PURE__*/React.createElement(_Balloon, {
116
+ trigger: /*#__PURE__*/React.createElement("span", {
117
+ className: styles.listLink
118
+ }, "\u67E5\u770B\u8BE6\u60C5"),
119
+ closable: true,
120
+ triggerType: "click",
121
+ align: "bl",
122
+ popupClassName: styles["enjoydata-alarm-table-balloon"],
123
+ popupStyle: {
124
+ maxWidth: "700px",
125
+ width: 530
126
+ }
127
+ }, creatAlarmTips(_extends({}, alarmInfo))) : /*#__PURE__*/React.createElement("div", {
128
+ className: styles.listLink
129
+ }, /*#__PURE__*/React.createElement(Link, {
130
+ onClick: onClick,
131
+ to: alarmLink(alarmInfo)
132
+ }, "\u67E5\u770B\u8BE6\u60C5"))));
133
+ }
134
+
88
135
  function ListItem(props) {
89
- var alarmInfo = props.alarmInfo;
90
- var ListItemWidget = alarmInfo.eventType === 'risk' ? RiskListItem : AlarmListItem;
91
- return /*#__PURE__*/React.createElement(ListItemWidget, props);
136
+ var topo = props.topo,
137
+ alarmInfo = props.alarmInfo;
138
+
139
+ if (topo.isCMPTopo) {
140
+ return /*#__PURE__*/React.createElement(SubListItem, props);
141
+ } else {
142
+ var ListItemWidget = alarmInfo.eventType === "risk" ? RiskListItem : AlarmListItem;
143
+ return /*#__PURE__*/React.createElement(ListItemWidget, props);
144
+ }
92
145
  }
93
146
 
94
147
  export default ListItem;
@@ -956,10 +956,11 @@ var useTopoEdit = function useTopoEdit(params) {
956
956
  break;
957
957
  }
958
958
 
959
+ topo.historyManager.endTransaction();
960
+
959
961
  _Message.error("关联资源失败");
960
962
 
961
- rlog.warn("关联资源失败");
962
- topo.historyManager.endTransaction();
963
+ rlog.error("关联资源失败");
963
964
  return _context9.abrupt("return", false);
964
965
 
965
966
  case 23:
@@ -533,25 +533,34 @@ var Alarm = /*#__PURE__*/function () {
533
533
  resAndMetrics = this.topo.store.getState().topoMod.resAndMetrics;
534
534
  resIdsList = resAndMetrics.resIdsList, nodeIdsList = resAndMetrics.nodeIdsList, linkIdsList = resAndMetrics.linkIdsList;
535
535
  alarmDispatchers = this.topo.store.getModelDispatchers('topoAlarm'); // 添加事件
536
- // console.log("handleAlarmEvent-接收到推送的原始告警信息", alertData);
536
+
537
+ console.log("handleAlarmEvent-接收到推送的原始告警信息", alertData);
537
538
 
538
539
  if (!(isAvailableArray(alertData) && isAvailableArray(resIdsList))) {
539
- _context9.next = 24;
540
+ _context9.next = 27;
540
541
  break;
541
542
  }
542
543
 
543
544
  sendAl = [];
544
545
  idsList = [].concat(nodeIdsList, linkIdsList);
545
546
  operations = [];
547
+ console.log('idsList---------', idsList);
546
548
  idsList.forEach(function (idItem) {
547
549
  if (idItem.operation === null) {
548
550
  operations.push(idItem.ciId);
549
551
  }
550
552
  });
551
553
  alertData.forEach(function (item, index) {
552
- var _item$resourceId;
554
+ var _item$resourceId, _item$alertCode;
553
555
 
554
556
  var ciId = (_item$resourceId = item.resourceId) !== null && _item$resourceId !== void 0 ? _item$resourceId : item.ciId;
557
+ var isSub = false;
558
+
559
+ if ((_item$alertCode = item.alertCode) !== null && _item$alertCode !== void 0 && _item$alertCode.startsWith("cmp")) {
560
+ ciId = "sub:" + item.mainCiId;
561
+ isSub = true;
562
+ }
563
+
555
564
  var obj = {
556
565
  id: ciId,
557
566
  level: item.alertLevel,
@@ -560,27 +569,30 @@ var Alarm = /*#__PURE__*/function () {
560
569
  obj: item,
561
570
  info: item.alertType,
562
571
  ciCode: item === null || item === void 0 ? void 0 : item.ciCode,
563
- ruleId: item === null || item === void 0 ? void 0 : item.ruleId
572
+ ruleId: item === null || item === void 0 ? void 0 : item.ruleId,
573
+ isSub: isSub
564
574
  };
565
575
 
566
576
  if (resIdsList.indexOf(ciId) >= 0 && operations.indexOf(ciId) < 0) {
567
577
  sendAl.push(obj);
568
- }
569
- }); // console.log("before-combAlarmData", sendAl, idsList);
578
+ } // const ciId = `${isSub}+${item.resourceId ?? item.ciId}`;
579
+
580
+ });
581
+ console.log("before-combAlarmData", sendAl, idsList);
570
582
 
571
583
  if (!(sendAl.length > 0)) {
572
- _context9.next = 24;
584
+ _context9.next = 27;
573
585
  break;
574
586
  }
575
587
 
576
588
  rlog.debug('过滤掉非本拓扑的告警信息 告警开关-推送告警到ht-alarmIsOpened-sendAl', alarmIsOpened, sendAl);
577
- _context9.prev = 12;
578
- _context9.next = 15;
589
+ _context9.prev = 15;
590
+ _context9.next = 18;
579
591
  return alarmDispatchers.combAlarmData({
580
592
  alarmdata: sendAl
581
593
  });
582
594
 
583
- case 15:
595
+ case 18:
584
596
  _yield$alarmDispatche2 = _context9.sent;
585
597
  eqFlag = _yield$alarmDispatche2.eqFlag;
586
598
  alarmlist = _yield$alarmDispatche2.alarmlist;
@@ -601,19 +613,19 @@ var Alarm = /*#__PURE__*/function () {
601
613
  }
602
614
  }
603
615
 
604
- _context9.next = 24;
616
+ _context9.next = 27;
605
617
  break;
606
618
 
607
- case 21:
608
- _context9.prev = 21;
609
- _context9.t0 = _context9["catch"](12);
619
+ case 24:
620
+ _context9.prev = 24;
621
+ _context9.t0 = _context9["catch"](15);
610
622
  rlog.error('告警发送异常', _context9.t0);
611
623
 
612
- case 24:
624
+ case 27:
613
625
  case "end":
614
626
  return _context9.stop();
615
627
  }
616
- }, _callee9, this, [[12, 21]]);
628
+ }, _callee9, this, [[15, 24]]);
617
629
  }));
618
630
 
619
631
  function handleAlarmEvent(_x7) {
@@ -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 "12.0.0-dev.13" === 'string' ? "12.0.0-dev.13" : null;
27
+ var version = typeof "12.0.0-dev.16" === 'string' ? "12.0.0-dev.16" : null;
28
28
  console.info("\u62D3\u6251\u7248\u672C: " + version);
29
29
  /**
30
30
  * 拓扑显示和编辑
@@ -208,76 +208,23 @@ export default function (topoApp) {
208
208
  enterEditMode: function enterEditMode(playload, rootState) {
209
209
  topoApp.enterEditMode();
210
210
  },
211
- openDefaultTopoPage: function openDefaultTopoPage(conditions, rootState) {
212
- var _this3 = this;
213
-
211
+ refreshPermission: function refreshPermission() {
214
212
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
215
- var topoId, treeData;
216
213
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
217
214
  while (1) switch (_context3.prev = _context3.next) {
218
215
  case 0:
219
- if (conditions === void 0) {
220
- conditions = {};
221
- }
222
-
223
- topoId = rootState.topoTreeMod.defId;
224
-
225
- if (!topoId) {
226
- // 查找第一个
227
- treeData = rootState.topoTreeMod.treeData;
228
- loopTreeByKey(treeData, 'type', 1, function (item, index, arr) {
229
- if (!topoId) {
230
- topoId = item.id;
231
- }
232
- });
233
- } // 右侧切换拓扑图
234
-
235
-
236
- _this3.openTopoPage({
237
- id: topoId
238
- });
239
-
240
- case 4:
241
- case "end":
242
- return _context3.stop();
243
- }
244
- }, _callee3);
245
- }))();
246
- },
247
- refreshPermission: function refreshPermission() {
248
- var _this4 = this;
249
-
250
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
251
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
252
- while (1) switch (_context4.prev = _context4.next) {
253
- case 0:
254
- _context4.next = 2;
216
+ _context3.next = 2;
255
217
  return dispatch.functionAuth.refresh();
256
218
 
257
219
  case 2:
258
- _context4.next = 4;
259
- return _this4.refreshTopoTree();
260
-
261
- case 4:
262
- case "end":
263
- return _context4.stop();
264
- }
265
- }, _callee4);
266
- }))();
267
- },
268
- refreshTopoTree: function refreshTopoTree() {
269
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
270
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
271
- while (1) switch (_context5.prev = _context5.next) {
272
- case 0:
273
- _context5.next = 2;
220
+ _context3.next = 4;
274
221
  return dispatch.topoTreeMod.refreshTree();
275
222
 
276
- case 2:
223
+ case 4:
277
224
  case "end":
278
- return _context5.stop();
225
+ return _context3.stop();
279
226
  }
280
- }, _callee5);
227
+ }, _callee3);
281
228
  }))();
282
229
  },
283
230
 
@@ -292,19 +239,19 @@ export default function (topoApp) {
292
239
  * @return {Promise<void>}
293
240
  */
294
241
  initTopoData: function initTopoData(props, state) {
295
- var _this5 = this;
242
+ var _this3 = this;
296
243
 
297
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
244
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
298
245
  var _result$config;
299
246
 
300
247
  var startTime, topoId, data, linkToData, refresh, clear, linkTo, startState, permission, result, graphConfig, topoConfig, extraConfig, _combTopoData, topoData, resAndMetrics, _yield$Promise$all, newData, endTime;
301
248
 
302
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
303
- while (1) switch (_context6.prev = _context6.next) {
249
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
250
+ while (1) switch (_context4.prev = _context4.next) {
304
251
  case 0:
305
252
  startTime = moment();
306
253
  topoId = props.topoId, data = props.data, linkToData = props.linkTo, refresh = props.refresh, clear = props.clear;
307
- _context6.next = 4;
254
+ _context4.next = 4;
308
255
  return topoApp.open(topoId);
309
256
 
310
257
  case 4:
@@ -327,7 +274,7 @@ export default function (topoApp) {
327
274
  });
328
275
  }
329
276
 
330
- _this5.update(startState);
277
+ _this3.update(startState);
331
278
 
332
279
  dispatch.topoBizMod.update({
333
280
  pollingSwitch: false
@@ -337,24 +284,24 @@ export default function (topoApp) {
337
284
  permission = 'write';
338
285
 
339
286
  if (!topoApp.options.usePermission) {
340
- _context6.next = 19;
287
+ _context4.next = 19;
341
288
  break;
342
289
  }
343
290
 
344
- _context6.next = 14;
345
- return _this5.getTopoPermission({
291
+ _context4.next = 14;
292
+ return _this3.getTopoPermission({
346
293
  id: topoId
347
294
  });
348
295
 
349
296
  case 14:
350
- permission = _context6.sent;
297
+ permission = _context4.sent;
351
298
 
352
299
  if (topoPermissonUtil.isReadable(permission)) {
353
- _context6.next = 19;
300
+ _context4.next = 19;
354
301
  break;
355
302
  }
356
303
 
357
- _this5.update({
304
+ _this3.update({
358
305
  loading: false,
359
306
  topoData: null,
360
307
  data: null,
@@ -363,26 +310,26 @@ export default function (topoApp) {
363
310
  });
364
311
 
365
312
  topoApp.options.onLoad();
366
- return _context6.abrupt("return");
313
+ return _context4.abrupt("return");
367
314
 
368
315
  case 19:
369
316
  if (!data) {
370
- _context6.next = 30;
317
+ _context4.next = 30;
371
318
  break;
372
319
  }
373
320
 
374
321
  graphConfig = {};
375
322
 
376
323
  if (!topoId) {
377
- _context6.next = 27;
324
+ _context4.next = 27;
378
325
  break;
379
326
  }
380
327
 
381
- _context6.next = 24;
328
+ _context4.next = 24;
382
329
  return topoService.getTopoData(topoId);
383
330
 
384
331
  case 24:
385
- topoConfig = _context6.sent;
332
+ topoConfig = _context4.sent;
386
333
  if (!topoConfig) rlog.error("\u672A\u67E5\u8BE2\u5230\u62D3\u6251id " + topoId + " \u7684\u6570\u636E\uFF0C\u8BF7\u68C0\u67E5");
387
334
  graphConfig = {
388
335
  global: topoConfig === null || topoConfig === void 0 ? void 0 : topoConfig.global,
@@ -392,23 +339,23 @@ export default function (topoApp) {
392
339
 
393
340
  case 27:
394
341
  result = _extends({}, data, graphConfig);
395
- _context6.next = 33;
342
+ _context4.next = 33;
396
343
  break;
397
344
 
398
345
  case 30:
399
- _context6.next = 32;
346
+ _context4.next = 32;
400
347
  return topoApp.options.loadData(topoId, topoApp.serverApi);
401
348
 
402
349
  case 32:
403
- result = _context6.sent;
350
+ result = _context4.sent;
404
351
 
405
352
  case 33:
406
353
  if (result) {
407
- _context6.next = 37;
354
+ _context4.next = 37;
408
355
  break;
409
356
  }
410
357
 
411
- _this5.update({
358
+ _this3.update({
412
359
  loading: false,
413
360
  data: null,
414
361
  globalConfig: null,
@@ -417,17 +364,17 @@ export default function (topoApp) {
417
364
  });
418
365
 
419
366
  topoApp.options.onLoad();
420
- return _context6.abrupt("return");
367
+ return _context4.abrupt("return");
421
368
 
422
369
  case 37:
423
370
  result = parseTopoData(result);
424
371
  rlog.debug('topoMod.initTopoData 查询数据完成', topoId, linkTo, result);
425
- _context6.next = 41;
372
+ _context4.next = 41;
426
373
  return dispatch.customIcon.loadCustomIcons();
427
374
 
428
375
  case 41:
429
376
  extraConfig = result.global.extraConfig;
430
- _context6.next = 44;
377
+ _context4.next = 44;
431
378
  return dispatch.displayConfig.setConfig(_extends({}, extraConfig, {
432
379
  alarmSwitch: result.global.alarmSwitch,
433
380
  alarmListDefaultOpen: result.global.alarmListDefaultOpen
@@ -441,8 +388,8 @@ export default function (topoApp) {
441
388
  globalConfig: extraConfig
442
389
  }), topoData = _combTopoData.topoData, resAndMetrics = _combTopoData.resAndMetrics; // rlog.debug("topoMod.initTopoData combTopoData", { topoData, resAndMetrics, });
443
390
 
444
- _context6.next = 47;
445
- return _this5.update({
391
+ _context4.next = 47;
392
+ return _this3.update({
446
393
  currentTopo: topoData.config,
447
394
  data: result,
448
395
  globalConfig: extraConfig,
@@ -457,15 +404,15 @@ export default function (topoApp) {
457
404
 
458
405
  topoApp.alarm.open(); // 加载标注悬浮框数据
459
406
 
460
- _context6.next = 52;
407
+ _context4.next = 52;
461
408
  return Promise.all([addLinkData(result), topoApp.ciTyeCache.load(getCiTypes(result)), topoApp.elementTagTipConfig.init(result) // 暂停新配置开发
462
409
  ]);
463
410
 
464
411
  case 52:
465
- _yield$Promise$all = _context6.sent;
412
+ _yield$Promise$all = _context4.sent;
466
413
  newData = _yield$Promise$all[0];
467
- _context6.next = 56;
468
- return _this5.update({
414
+ _context4.next = 56;
415
+ return _this3.update({
469
416
  data: newData
470
417
  });
471
418
 
@@ -478,15 +425,15 @@ export default function (topoApp) {
478
425
  rlog.info('topoMod.initTopoData 初始化拓扑图数据完成. 耗时: ', endTime.diff(startTime, 'seconds', true));
479
426
  topoApp.options.onLoad();
480
427
 
481
- _this5.update({
428
+ _this3.update({
482
429
  loading: false
483
430
  });
484
431
 
485
432
  case 62:
486
433
  case "end":
487
- return _context6.stop();
434
+ return _context4.stop();
488
435
  }
489
- }, _callee6);
436
+ }, _callee4);
490
437
  }))();
491
438
  },
492
439
 
@@ -494,21 +441,21 @@ export default function (topoApp) {
494
441
  * 刷新拓扑图
495
442
  */
496
443
  refreshTopo: function refreshTopo(payload, rootState) {
497
- var _this6 = this;
444
+ var _this4 = this;
498
445
 
499
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
446
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
500
447
  var _payload, clear;
501
448
 
502
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
503
- while (1) switch (_context7.prev = _context7.next) {
449
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
450
+ while (1) switch (_context5.prev = _context5.next) {
504
451
  case 0:
505
452
  if (payload === void 0) {
506
453
  payload = {};
507
454
  }
508
455
 
509
456
  _payload = payload, clear = _payload.clear;
510
- _context7.next = 4;
511
- return _this6.initTopoData({
457
+ _context5.next = 4;
458
+ return _this4.initTopoData({
512
459
  topoId: rootState.topoMod.topoId,
513
460
  refresh: true,
514
461
  clear: clear
@@ -516,18 +463,18 @@ export default function (topoApp) {
516
463
 
517
464
  case 4:
518
465
  case "end":
519
- return _context7.stop();
466
+ return _context5.stop();
520
467
  }
521
- }, _callee7);
468
+ }, _callee5);
522
469
  }))();
523
470
  },
524
471
  operationTopoPage: function operationTopoPage(conditions, state) {
525
- var _this7 = this;
472
+ var _this5 = this;
526
473
 
527
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
474
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
528
475
  var td;
529
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
530
- while (1) switch (_context8.prev = _context8.next) {
476
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
477
+ while (1) switch (_context6.prev = _context6.next) {
531
478
  case 0:
532
479
  if (conditions === void 0) {
533
480
  conditions = {};
@@ -535,7 +482,7 @@ export default function (topoApp) {
535
482
 
536
483
  if (conditions.id === state.topoMod.topoId) {
537
484
  if (conditions.type === 'delete') {
538
- _this7.update({
485
+ _this5.update({
539
486
  topoId: conditions.defId
540
487
  });
541
488
  }
@@ -547,7 +494,7 @@ export default function (topoApp) {
547
494
  })
548
495
  });
549
496
 
550
- _this7.update({
497
+ _this5.update({
551
498
  topoData: td
552
499
  });
553
500
  }
@@ -555,29 +502,29 @@ export default function (topoApp) {
555
502
 
556
503
  case 2:
557
504
  case "end":
558
- return _context8.stop();
505
+ return _context6.stop();
559
506
  }
560
- }, _callee8);
507
+ }, _callee6);
561
508
  }))();
562
509
  },
563
510
  openPermissionSetting: function openPermissionSetting(payload, rootState) {
564
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
565
- return _regeneratorRuntime.wrap(function _callee9$(_context9) {
566
- while (1) switch (_context9.prev = _context9.next) {
511
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
512
+ return _regeneratorRuntime.wrap(function _callee7$(_context7) {
513
+ while (1) switch (_context7.prev = _context7.next) {
567
514
  case 0:
568
515
  dispatch.permissionSetting.open();
569
516
 
570
517
  case 1:
571
518
  case "end":
572
- return _context9.stop();
519
+ return _context7.stop();
573
520
  }
574
- }, _callee9);
521
+ }, _callee7);
575
522
  }))();
576
523
  },
577
524
  updateDelId: function updateDelId(conditions, state) {
578
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
579
- return _regeneratorRuntime.wrap(function _callee10$(_context10) {
580
- while (1) switch (_context10.prev = _context10.next) {
525
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
526
+ return _regeneratorRuntime.wrap(function _callee8$(_context8) {
527
+ while (1) switch (_context8.prev = _context8.next) {
581
528
  case 0:
582
529
  if (conditions === void 0) {
583
530
  conditions = '';
@@ -587,49 +534,49 @@ export default function (topoApp) {
587
534
 
588
535
  case 2:
589
536
  case "end":
590
- return _context10.stop();
537
+ return _context8.stop();
591
538
  }
592
- }, _callee10);
539
+ }, _callee8);
593
540
  }))();
594
541
  },
595
542
  getTopoPermission: function getTopoPermission(playload, rootState) {
596
- var _this8 = this;
543
+ var _this6 = this;
597
544
 
598
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
545
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
599
546
  var id, update, topoPermission;
600
- return _regeneratorRuntime.wrap(function _callee11$(_context11) {
601
- while (1) switch (_context11.prev = _context11.next) {
547
+ return _regeneratorRuntime.wrap(function _callee9$(_context9) {
548
+ while (1) switch (_context9.prev = _context9.next) {
602
549
  case 0:
603
550
  id = playload.id, update = playload.update;
604
- _context11.prev = 1;
605
- _context11.next = 4;
551
+ _context9.prev = 1;
552
+ _context9.next = 4;
606
553
  return topoApp.serverApi.auth.getTopoPermission(id);
607
554
 
608
555
  case 4:
609
- topoPermission = _context11.sent;
556
+ topoPermission = _context9.sent;
610
557
  rlog.debug('查询拓扑权限', topoPermission);
611
- _context11.next = 11;
558
+ _context9.next = 11;
612
559
  break;
613
560
 
614
561
  case 8:
615
- _context11.prev = 8;
616
- _context11.t0 = _context11["catch"](1);
617
- rlog.error("\u67E5\u8BE2\u62D3\u6251" + id + "\u7684\u6743\u9650\u5931\u8D25", _context11.t0); // 尚未区分拓扑图不存在还是接口请求报错
562
+ _context9.prev = 8;
563
+ _context9.t0 = _context9["catch"](1);
564
+ rlog.error("\u67E5\u8BE2\u62D3\u6251" + id + "\u7684\u6743\u9650\u5931\u8D25", _context9.t0); // 尚未区分拓扑图不存在还是接口请求报错
618
565
 
619
566
  case 11:
620
567
  if (update !== false) {
621
- _this8.update({
568
+ _this6.update({
622
569
  topoPermission: topoPermission
623
570
  });
624
571
  }
625
572
 
626
- return _context11.abrupt("return", topoPermission);
573
+ return _context9.abrupt("return", topoPermission);
627
574
 
628
575
  case 13:
629
576
  case "end":
630
- return _context11.stop();
577
+ return _context9.stop();
631
578
  }
632
- }, _callee11, null, [[1, 8]]);
579
+ }, _callee9, null, [[1, 8]]);
633
580
  }))();
634
581
  }
635
582
  };
@@ -8,8 +8,10 @@ export default function ViewerPlugin(props) {
8
8
  var topo = props.topo,
9
9
  viewerProps = props.viewerProps;
10
10
  var store = topo.store;
11
+ var alarmInfoDoc = viewerProps.alarmInfoDoc;
11
12
  useAlarm({
12
- topo: topo
13
+ topo: topo,
14
+ alarmInfoDoc: alarmInfoDoc
13
15
  });
14
16
  useManageStatus({
15
17
  topo: topo