@riil-frontend/component-topology 2.14.2-alpha.2 → 2.14.2-alpha.6

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.
Files changed (84) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.css +1 -1
  4. package/build/index.js +22 -22
  5. package/demo/1/345/237/272/346/234/254//350/207/252/345/256/232/344/271/211/345/261/236/346/200/247/345/222/214/346/214/207/346/240/207.md +1 -1
  6. package/demo/API//346/250/241/345/236/213.md +29 -0
  7. package/es/components/BatchAttrMetric/constant.js +4 -0
  8. package/es/components/BatchAttrMetric/index.js +8 -10
  9. package/es/components/BatchAttrMetric/setting.js +6 -4
  10. package/es/components/BatchAttrMetric/utils.js +39 -32
  11. package/es/constants/ResourceTypeLimit.js +1 -1
  12. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +6 -5
  13. package/es/core/components/DisplaySettingDrawer/LinkTag.js +8 -6
  14. package/es/core/components/DisplaySettingDrawer/LinkTip.js +9 -7
  15. package/es/core/components/DisplaySettingDrawer/NodeTag.js +2 -0
  16. package/es/core/components/DisplaySettingDrawer/NodeTip.js +2 -0
  17. package/es/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +30 -9
  18. package/es/core/components/ResourceViewAttributeSetting/Setting.js +123 -0
  19. package/es/core/editor/components/EditorPlugin.js +4 -3
  20. package/es/core/editor/components/settings/propertyViews/view/GlobalTootipSetting.js +3 -1
  21. package/es/core/editor/components/settings/propertyViews/view/ViewPropertyView.js +0 -5
  22. package/es/core/models/AttributeMetricDisplay.js +181 -66
  23. package/es/core/models/TopoApp.js +18 -16
  24. package/es/core/models/attributeFormatter/index.js +33 -8
  25. package/es/core/models/common/Alarm.js +45 -31
  26. package/es/core/models/utils/linkUtils.js +14 -2
  27. package/es/core/utils/exportData.js +33 -0
  28. package/es/core/utils/linkPollingAttributesAdapter.js +3 -0
  29. package/es/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/index.js +264 -0
  30. package/es/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/index.module.scss +73 -0
  31. package/es/core/viewer/components/plugins/BaseInfo/index.js +127 -0
  32. package/es/core/viewer/components/plugins/BaseInfo/index.module.scss +24 -0
  33. package/es/core/viewer/components/plugins/ViewerPlugin.js +2 -1
  34. package/es/core/viewer/components/titlebar/widgets/MoreButtonMenu.js +5 -0
  35. package/es/getStoreModels.js +3 -1
  36. package/es/hooks/useAlarm.js +1 -1
  37. package/es/hooks/usePolling.js +2 -1
  38. package/es/models/topoAlarm.js +43 -17
  39. package/es/models/topoBaseInfoOverview.js +43 -0
  40. package/es/models/topoBizMod.js +0 -70
  41. package/es/style.js +8 -7
  42. package/es/utils/topoData.js +266 -155
  43. package/lib/components/BatchAttrMetric/constant.js +4 -0
  44. package/lib/components/BatchAttrMetric/index.js +8 -10
  45. package/lib/components/BatchAttrMetric/setting.js +8 -5
  46. package/lib/components/BatchAttrMetric/utils.js +39 -35
  47. package/lib/constants/ResourceTypeLimit.js +1 -1
  48. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +6 -5
  49. package/lib/core/components/DisplaySettingDrawer/LinkTag.js +8 -6
  50. package/lib/core/components/DisplaySettingDrawer/LinkTip.js +9 -7
  51. package/lib/core/components/DisplaySettingDrawer/NodeTag.js +2 -0
  52. package/lib/core/components/DisplaySettingDrawer/NodeTip.js +2 -0
  53. package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +32 -8
  54. package/lib/core/{editor/components → components}/ResourceViewAttributeSetting/Setting.js +77 -71
  55. package/lib/core/editor/components/EditorPlugin.js +3 -3
  56. package/lib/core/editor/components/settings/propertyViews/view/GlobalTootipSetting.js +3 -1
  57. package/lib/core/editor/components/settings/propertyViews/view/ViewPropertyView.js +0 -5
  58. package/lib/core/models/AttributeMetricDisplay.js +181 -66
  59. package/lib/core/models/TopoApp.js +18 -17
  60. package/lib/core/models/attributeFormatter/index.js +34 -8
  61. package/lib/core/models/common/Alarm.js +46 -33
  62. package/lib/core/models/utils/linkUtils.js +12 -2
  63. package/lib/core/utils/exportData.js +44 -0
  64. package/lib/core/utils/linkPollingAttributesAdapter.js +10 -0
  65. package/lib/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/index.js +284 -0
  66. package/lib/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/index.module.scss +73 -0
  67. package/lib/core/viewer/components/plugins/BaseInfo/index.js +146 -0
  68. package/lib/core/viewer/components/plugins/BaseInfo/index.module.scss +24 -0
  69. package/lib/core/viewer/components/plugins/ViewerPlugin.js +3 -1
  70. package/lib/core/viewer/components/titlebar/widgets/MoreButtonMenu.js +6 -0
  71. package/lib/getStoreModels.js +4 -1
  72. package/lib/hooks/useAlarm.js +1 -1
  73. package/lib/hooks/usePolling.js +2 -1
  74. package/lib/models/topoAlarm.js +43 -17
  75. package/lib/models/topoBaseInfoOverview.js +55 -0
  76. package/lib/models/topoBizMod.js +0 -70
  77. package/lib/style.js +8 -7
  78. package/lib/utils/topoData.js +267 -151
  79. package/package.json +2 -2
  80. package/es/core/editor/components/ResourceViewAttributeSetting/ResourceViewAttributeSettingPlugin.js +0 -57
  81. package/es/core/editor/components/ResourceViewAttributeSetting/Setting.js +0 -114
  82. package/es/core/models/attrAndMetric.js +0 -131
  83. package/lib/core/editor/components/ResourceViewAttributeSetting/ResourceViewAttributeSettingPlugin.js +0 -73
  84. package/lib/core/models/attrAndMetric.js +0 -148
@@ -119,7 +119,7 @@ var Alarm = /*#__PURE__*/function () {
119
119
 
120
120
  _proto.hmGetTopoAlarm = /*#__PURE__*/function () {
121
121
  var _hmGetTopoAlarm = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id) {
122
- var _this$topoApp$store$g, data, resAndMetrics, topoData, _this$getState, alarmIsOpened, alarmOpening, linkDynamicStyleDispatcher, nodes, links, alarmCiDoc, cids, componentIds, ids, idsx, endTime, startTime, parms, result;
122
+ var _this$topoApp$store$g, data, resAndMetrics, topoData, _this$getState, alarmIsOpened, alarmOpening, linkDynamicStyleDispatcher, alarmCiDoc, cids, componentIds, ids, idsx, endTime, startTime, parms, result;
123
123
 
124
124
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
125
125
  while (1) {
@@ -127,20 +127,20 @@ var Alarm = /*#__PURE__*/function () {
127
127
  case 0:
128
128
  _this$topoApp$store$g = this.topoApp.store.getState().topoMod, data = _this$topoApp$store$g.data, resAndMetrics = _this$topoApp$store$g.resAndMetrics, topoData = _this$topoApp$store$g.topoData;
129
129
  _this$getState = this.getState(), alarmIsOpened = _this$getState.alarmIsOpened, alarmOpening = _this$getState.alarmOpening;
130
- linkDynamicStyleDispatcher = this.topoApp.store.getModel("linkDynamicStyle")[1];
131
- nodes = data.nodes, links = data.links;
130
+ linkDynamicStyleDispatcher = this.topoApp.store.getModel("linkDynamicStyle")[1]; // const { nodes, links } = data;
131
+
132
132
  alarmCiDoc = resAndMetrics.alarmCiDoc;
133
133
  rlog.debug("获取告警列表--resAndMetrics,topoData,data", this.topoApp, resAndMetrics, topoData, data);
134
134
  cids = Object.keys(alarmCiDoc);
135
- _context2.next = 9;
135
+ _context2.next = 8;
136
136
  return topoService.getCisComponentIds(cids);
137
137
 
138
- case 9:
138
+ case 8:
139
139
  componentIds = _context2.sent;
140
140
  ids = [].concat(cids);
141
141
  idsx = Object.keys(componentIds).map(function (k) {
142
142
  ids = [].concat(ids, componentIds[k]);
143
- return '';
143
+ return "";
144
144
  });
145
145
  rlog.debug("获取告警列表", componentIds, alarmCiDoc, ids);
146
146
  endTime = null; //new Date().valueOf();
@@ -163,7 +163,7 @@ var Alarm = /*#__PURE__*/function () {
163
163
  };
164
164
 
165
165
  if (!(ids.length === 0)) {
166
- _context2.next = 19;
166
+ _context2.next = 18;
167
167
  break;
168
168
  }
169
169
 
@@ -173,11 +173,11 @@ var Alarm = /*#__PURE__*/function () {
173
173
  });
174
174
  return _context2.abrupt("return");
175
175
 
176
- case 19:
177
- _context2.next = 21;
176
+ case 18:
177
+ _context2.next = 20;
178
178
  return topoService.getAlarmByIds(parms);
179
179
 
180
- case 21:
180
+ case 20:
181
181
  result = _context2.sent;
182
182
  rlog.debug("getAlarmById-result", result); // if (alarmIsOpened) {
183
183
  // //this.topoApp.loadAlarm(result.datas);
@@ -189,7 +189,7 @@ var Alarm = /*#__PURE__*/function () {
189
189
  alarmPanelIsOpen: result.datas.length > 0
190
190
  });
191
191
 
192
- case 24:
192
+ case 23:
193
193
  case "end":
194
194
  return _context2.stop();
195
195
  }
@@ -216,7 +216,7 @@ var Alarm = /*#__PURE__*/function () {
216
216
  var _openTopoAlarm = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id) {
217
217
  var _this = this;
218
218
 
219
- var _this$getState2, alarmOpening, topoAlarmIsOpen;
219
+ var _this$getState2, alarmOpening, topoAlarmIsOpen, alarmDispatchers;
220
220
 
221
221
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
222
222
  while (1) {
@@ -237,10 +237,15 @@ var Alarm = /*#__PURE__*/function () {
237
237
  this.updateState({
238
238
  alarmOpening: true
239
239
  });
240
- _context3.next = 7;
240
+ alarmDispatchers = this.topoApp.store.getModelDispatchers("topoAlarm");
241
+ _context3.next = 8;
242
+ return alarmDispatchers.resetAlarmDoc();
243
+
244
+ case 8:
245
+ _context3.next = 10;
241
246
  return topoService.openTopoAlarm(id);
242
247
 
243
- case 7:
248
+ case 10:
244
249
  // rlog.debug("openTopoAlarm 获取初始化告警-------------------开始");
245
250
  EE.on("topo", "topo", function (data, other) {
246
251
  rlog.debug("openTopoAlarm 获取初始化告警------收到信息", data);
@@ -252,7 +257,7 @@ var Alarm = /*#__PURE__*/function () {
252
257
  alarmIsOpened: true
253
258
  });
254
259
 
255
- case 9:
260
+ case 12:
256
261
  case "end":
257
262
  return _context3.stop();
258
263
  }
@@ -394,33 +399,31 @@ var Alarm = /*#__PURE__*/function () {
394
399
  /*#__PURE__*/
395
400
  function () {
396
401
  var _getAlarmByEE = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(alertData) {
397
- var _this$getState4, alarmIsOpened, alarmOpening, bizState, bizDispatchers, alarmDispatchers, linkDynamicStyleDispatcher, al, alarmList;
402
+ var _this$getState4, alarmIsOpened, resAndMetrics, resIdsList, alarmCiDoc, alarmDispatchers, linkDynamicStyleDispatcher, sendAl, alarmList;
398
403
 
399
404
  return _regeneratorRuntime.wrap(function _callee7$(_context7) {
400
405
  while (1) {
401
406
  switch (_context7.prev = _context7.next) {
402
407
  case 0:
403
- _this$getState4 = this.getState(), alarmIsOpened = _this$getState4.alarmIsOpened, alarmOpening = _this$getState4.alarmOpening; // const { viewState } = this.topoApp.store.getState().topoMod;
404
-
405
- bizState = this.topoApp.store.getState().topoBizMod;
406
- bizDispatchers = this.topoApp.store.getModelDispatchers("topoBizMod");
408
+ _this$getState4 = this.getState(), alarmIsOpened = _this$getState4.alarmIsOpened;
409
+ resAndMetrics = this.topoApp.store.getState().topoMod.resAndMetrics;
410
+ resIdsList = resAndMetrics.resIdsList, alarmCiDoc = resAndMetrics.alarmCiDoc;
407
411
  alarmDispatchers = this.topoApp.store.getModelDispatchers("topoAlarm");
408
412
  linkDynamicStyleDispatcher = this.topoApp.store.getModelDispatchers("linkDynamicStyle"); // 添加事件
409
- // const { type, data: alertData } = data;
410
413
 
411
- console.log("getAlarmByEE", alertData, this.topoApp.store);
414
+ console.log("getAlarmByEE-接收到推送的原始告警信息", alertData);
412
415
 
413
416
  if (!isAvailableArray(alertData)) {
414
- _context7.next = 14;
417
+ _context7.next = 15;
415
418
  break;
416
419
  }
417
420
 
418
- rlog.debug("useAlarm.getAlarmByEE 告警原始数据", alertData);
419
- al = alertData.map(function (item, index) {
421
+ sendAl = [];
422
+ alertData.map(function (item, index) {
420
423
  var _item$resourceId;
421
424
 
422
425
  var ciId = (_item$resourceId = item.resourceId) !== null && _item$resourceId !== void 0 ? _item$resourceId : item.ciId;
423
- return {
426
+ var obj = {
424
427
  id: ciId,
425
428
  level: item.alertLevel,
426
429
  alertId: item.alertId,
@@ -428,16 +431,27 @@ var Alarm = /*#__PURE__*/function () {
428
431
  obj: item,
429
432
  info: item.alertType
430
433
  };
434
+
435
+ if (resIdsList.indexOf(ciId) >= 0) {
436
+ sendAl.push(obj);
437
+ }
438
+
439
+ return obj;
431
440
  }); // rlog.debug("before-combAlarmData", al, bizState);
432
441
 
433
- _context7.next = 11;
442
+ if (!(sendAl.length > 0)) {
443
+ _context7.next = 15;
444
+ break;
445
+ }
446
+
447
+ rlog.debug("过滤掉非本拓扑的告警信息 告警开关-推送告警到ht-alarmIsOpened-sendAl", alarmIsOpened, sendAl);
448
+ _context7.next = 13;
434
449
  return alarmDispatchers.combAlarmData({
435
- alarmdata: al
450
+ alarmdata: sendAl
436
451
  });
437
452
 
438
- case 11:
453
+ case 13:
439
454
  alarmList = _context7.sent;
440
- rlog.debug("useAlarm.getAlarmByEE 推送告警到ht", alarmIsOpened, alarmList, bizState);
441
455
 
442
456
  if (alarmIsOpened) {
443
457
  this.topoApp.loadAlarm(alarmList);
@@ -446,7 +460,7 @@ var Alarm = /*#__PURE__*/function () {
446
460
  linkDynamicStyleDispatcher.execute();
447
461
  }
448
462
 
449
- case 14:
463
+ case 15:
450
464
  case "end":
451
465
  return _context7.stop();
452
466
  }
@@ -2,7 +2,11 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  import topoService from '@riil-frontend/component-topology-common/es/services/topo';
5
- import { findItem } from "../../../utils/topoData";
5
+ var interfaceTypeMap = {
6
+ 'network.interface': {
7
+ displayName: '网络接口'
8
+ }
9
+ };
6
10
  export function mergeLinksData(links, relationDetails) {
7
11
  var relationDoc = {};
8
12
  relationDetails.map(function (item, index) {
@@ -12,10 +16,18 @@ export function mergeLinksData(links, relationDetails) {
12
16
  });
13
17
  return links.map(function (link) {
14
18
  var relation = relationDoc[link.id];
19
+
20
+ var attributes = _extends({}, relation === null || relation === void 0 ? void 0 : relation.attributes); // 接口翻译
21
+
22
+
15
23
  return _extends({}, link, {
16
24
  ciType: relation === null || relation === void 0 ? void 0 : relation.typeCode,
17
- ciId: relation.id,
18
25
  name: relation === null || relation === void 0 ? void 0 : relation.attributes.name,
26
+ attributes: _extends({}, attributes, {
27
+ source_type_object: interfaceTypeMap[attributes.source_type],
28
+ destination_type_object: interfaceTypeMap[attributes.destination_type]
29
+ }),
30
+ ciId: relation.id,
19
31
  detail: relation
20
32
  });
21
33
  });
@@ -0,0 +1,33 @@
1
+ import { getRequest } from '@riil-frontend/component-topology-common/es/utils/request';
2
+ import rlog from '@riil-frontend/component-topology-utils/es/rlog';
3
+ export default function (topo) {
4
+ var _topo$store$getModelS = topo.store.getModelState('topoMod').data,
5
+ nodes = _topo$store$getModelS.nodes,
6
+ links = _topo$store$getModelS.links;
7
+ var params = {
8
+ id: topo.id,
9
+ 'nodes': nodes.map(function (node) {
10
+ var element = topo.getDataModel().getDataByTag(node.id);
11
+ return {
12
+ 'id': node.id,
13
+ 'imageName': element.a('customName') || element.a('name') || element.getName()
14
+ };
15
+ }),
16
+ 'linkes': links.map(function (link) {
17
+ var id = link.id,
18
+ source = link.source,
19
+ target = link.target,
20
+ interfaceSource = link.interfaceSource,
21
+ interfaceTarget = link.interfaceTarget;
22
+ return {
23
+ id: id,
24
+ source: source,
25
+ target: target,
26
+ interfaceSource: interfaceSource,
27
+ interfaceTarget: interfaceTarget
28
+ };
29
+ })
30
+ };
31
+ rlog.error('导出数据', params);
32
+ getRequest().post('/topo/v1/api/structure/excel', params);
33
+ }
@@ -0,0 +1,3 @@
1
+ export default (function (first) {
2
+ ;
3
+ });
@@ -0,0 +1,264 @@
1
+ import _Table from "@alifd/next/es/table";
2
+ import _Divider from "@alifd/next/es/divider";
3
+ import _extends from "@babel/runtime/helpers/extends";
4
+ import React, { useState, useEffect, useRef, useCallback } from 'react';
5
+ import { TopoEvent } from '@riil-frontend/component-topology-graph';
6
+ import { findItem } from "../../../../../../../utils/topoData";
7
+ import NoDataPage from '@riil-frontend/component-topology-common/es/components/NoDataPage'; // import ResourceDiplayInfoSetting from './Setting';
8
+ // bimport '@riil-frontend/css/lib/index.scss';
9
+
10
+ import styles from "./index.module.scss"; // 关键指标
11
+
12
+ function indicatorRander(data) {
13
+ console.log('indicatorRander', data);
14
+ return /*#__PURE__*/React.createElement("div", {
15
+ className: styles.indicator
16
+ }, /*#__PURE__*/React.createElement("div", {
17
+ className: styles.row
18
+ }, data.slice(0, 3).map(function (item) {
19
+ return /*#__PURE__*/React.createElement("div", {
20
+ className: styles.item,
21
+ key: item.code
22
+ }, /*#__PURE__*/React.createElement("span", {
23
+ className: styles.content
24
+ }, item.value ? item.value + item.unit : '暂无数据'), /*#__PURE__*/React.createElement("span", {
25
+ className: styles.label
26
+ }, item.name));
27
+ })), /*#__PURE__*/React.createElement("div", {
28
+ className: styles.row
29
+ }, data.slice(3, 6).map(function (item) {
30
+ return /*#__PURE__*/React.createElement("div", {
31
+ className: styles.item,
32
+ key: item.code
33
+ }, /*#__PURE__*/React.createElement("span", {
34
+ className: styles.content
35
+ }, item.value ? item.value + item.unit : '暂无数据'), /*#__PURE__*/React.createElement("span", {
36
+ className: styles.label
37
+ }, item.name));
38
+ })));
39
+ }
40
+ /**
41
+ * 资源概览
42
+ */
43
+
44
+
45
+ export default function ResourceOverview(props) {
46
+ var topo = props.topo,
47
+ id = props.id,
48
+ ciType = props.ciType;
49
+
50
+ var _topo$store$useModelS = topo.store.useModelState('topoBizMod'),
51
+ attrsAndMetrics = _topo$store$useModelS.attrsAndMetrics;
52
+
53
+ var _useState = useState({
54
+ display_name: '',
55
+ // 资源名称/显示名称
56
+ ipv4_address: '',
57
+ // IP地址
58
+ asset_number: '',
59
+ // 资产编号
60
+ type: '',
61
+ // 资源类型
62
+ b: '',
63
+ // 资源位置
64
+ c: '' // 责任人
65
+
66
+ }),
67
+ baseInfo = _useState[0],
68
+ setBaseInfo = _useState[1];
69
+
70
+ var _useState2 = useState([]),
71
+ indicator = _useState2[0],
72
+ setIndicator = _useState2[1];
73
+
74
+ useEffect(function () {
75
+ init();
76
+ }, [attrsAndMetrics]);
77
+
78
+ function init() {
79
+ var _findItem2, _findItem3, _findItem4, _findItem5;
80
+
81
+ // 资源-基本信息
82
+ console.log('资源-基本信息------------------------', id, attrsAndMetrics);
83
+
84
+ var _findItem = findItem(attrsAndMetrics, 'id', id),
85
+ attributes = _findItem.attributes,
86
+ metrics = _findItem.metrics;
87
+
88
+ console.log('000', findItem(attrsAndMetrics, 'id', id));
89
+ console.log('111', attributes, findItem(attributes, 'code', 'display_name'));
90
+ setBaseInfo({
91
+ display_name: (_findItem2 = findItem(attributes, 'code', 'display_name')) === null || _findItem2 === void 0 ? void 0 : _findItem2.value,
92
+ ipv4_address: (_findItem3 = findItem(attributes, 'code', 'ipv4_address')) === null || _findItem3 === void 0 ? void 0 : _findItem3.value,
93
+ asset_number: (_findItem4 = findItem(attributes, 'code', 'asset_number')) === null || _findItem4 === void 0 ? void 0 : _findItem4.value,
94
+ type: (_findItem5 = findItem(attributes, 'code', 'type')) === null || _findItem5 === void 0 ? void 0 : _findItem5.value
95
+ }); // 链路-基本信息
96
+ // 资源/链路-关键指标 数据 metrics,模型 topo.ciTyeCache.getCiType(ciType)
97
+
98
+ console.log('资源/链路-关键指标------------------------', id, metrics);
99
+
100
+ var _topo$ciTyeCache$getC = topo.ciTyeCache.getCiType(ciType),
101
+ modelMetrics = _topo$ciTyeCache$getC.metrics;
102
+
103
+ setIndicator(modelMetrics.slice(0, 6).map(function (item) {
104
+ var _findItem6;
105
+
106
+ return _extends({}, item, {
107
+ value: (_findItem6 = findItem(metrics, 'code', item.code)) === null || _findItem6 === void 0 ? void 0 : _findItem6.value
108
+ });
109
+ }));
110
+ }
111
+
112
+ var topoBizMod = topo.store.useModelState('topoBizMod');
113
+ useEffect(function () {
114
+ console.log('topoBizMod', topoBizMod);
115
+ }, [topoBizMod]);
116
+ var columns = [{
117
+ title: '事件',
118
+ dataIndex: 'a',
119
+ key: 'a' // width: 144,
120
+ // cell: (alertTitle, index, record) => (
121
+ // <Link
122
+ // to={`/default/pagecenter/${PAGE_TYPE.ALERT_DETAIL}/view/${record.alertId}?alertId=${record.alertId}&resId=${record.ciId}&title=${record.alertObject}`}
123
+ // >
124
+ // <div title={alertTitle}>{alertTitle}</div>
125
+ // </Link>
126
+ // ),
127
+
128
+ }, {
129
+ title: '时间',
130
+ dataIndex: 'createTime',
131
+ key: 'createTime',
132
+ width: 128 // cell: (createTime, index, record) => (
133
+ // <div title={moment(createTime).format('YYYY-MM-DD HH:mm')}>
134
+ // {moment(createTime).format('YYYY-MM-DD HH:mm')}
135
+ // </div>
136
+ // ),
137
+
138
+ }, {
139
+ title: '操作',
140
+ dataIndex: 'alertType',
141
+ key: 'alertType',
142
+ width: 64 // cell: (alertType, index, record) => (
143
+ // <div title={alertType}>{alertType}</div>
144
+ // ),
145
+
146
+ }];
147
+ var dataSource = [{
148
+ id: 1,
149
+ a: 12312
150
+ }, {
151
+ id: 2,
152
+ a: 12312
153
+ }, {
154
+ id: 3,
155
+ a: 12312
156
+ }, {
157
+ id: 4,
158
+ a: 12312
159
+ }, {
160
+ id: 5,
161
+ a: 12312
162
+ }, {
163
+ id: 6,
164
+ a: 12312
165
+ }, {
166
+ id: 7,
167
+ a: 12312
168
+ }, {
169
+ id: 8,
170
+ a: 12312
171
+ }, {
172
+ id: 9,
173
+ a: 12312
174
+ }, {
175
+ id: 10,
176
+ a: 12312
177
+ }];
178
+
179
+ function BaseInfo(type, data) {}
180
+
181
+ return /*#__PURE__*/React.createElement("div", {
182
+ className: styles['resource-overview']
183
+ }, /*#__PURE__*/React.createElement("div", {
184
+ className: styles['block-box']
185
+ }, /*#__PURE__*/React.createElement("div", {
186
+ className: styles.title
187
+ }, /*#__PURE__*/React.createElement(_Divider, {
188
+ direction: "ver"
189
+ }), "\u57FA\u672C\u4FE1\u606F"), /*#__PURE__*/React.createElement("div", {
190
+ className: styles.body
191
+ }, /*#__PURE__*/React.createElement("div", {
192
+ className: styles['base-info']
193
+ }, /*#__PURE__*/React.createElement("div", {
194
+ className: styles.row
195
+ }, /*#__PURE__*/React.createElement("div", {
196
+ className: styles.item
197
+ }, /*#__PURE__*/React.createElement("span", {
198
+ className: styles.label
199
+ }, "\u8D44\u6E90\u540D\u79F0\uFF1A"), /*#__PURE__*/React.createElement("span", {
200
+ className: styles.content
201
+ }, baseInfo.display_name)), /*#__PURE__*/React.createElement("div", {
202
+ className: styles.item
203
+ }, /*#__PURE__*/React.createElement("span", {
204
+ className: styles.label
205
+ }, "IP\u5730\u5740\uFF1A"), /*#__PURE__*/React.createElement("span", {
206
+ className: styles.content
207
+ }, baseInfo.ipv4_address))), /*#__PURE__*/React.createElement("div", {
208
+ className: styles.row
209
+ }, /*#__PURE__*/React.createElement("div", {
210
+ className: styles.item
211
+ }, /*#__PURE__*/React.createElement("span", {
212
+ className: styles.label
213
+ }, "\u8D44\u4EA7\u7F16\u53F7\uFF1A"), /*#__PURE__*/React.createElement("span", {
214
+ className: styles.content
215
+ }, baseInfo.asset_number)), /*#__PURE__*/React.createElement("div", {
216
+ className: styles.item
217
+ }, /*#__PURE__*/React.createElement("span", {
218
+ className: styles.label
219
+ }, "\u8D44\u6E90\u7C7B\u578B\uFF1A"), /*#__PURE__*/React.createElement("span", {
220
+ className: styles.content
221
+ }, baseInfo.type))), /*#__PURE__*/React.createElement("div", {
222
+ className: styles.row
223
+ }, /*#__PURE__*/React.createElement("div", {
224
+ className: styles.item
225
+ }, /*#__PURE__*/React.createElement("span", {
226
+ className: styles.label
227
+ }, "\u8D44\u6E90\u4F4D\u7F6E\uFF1A"), /*#__PURE__*/React.createElement("span", {
228
+ className: styles.content
229
+ }, baseInfo.b)), /*#__PURE__*/React.createElement("div", {
230
+ className: styles.item
231
+ }, /*#__PURE__*/React.createElement("span", {
232
+ className: styles.label
233
+ }, "\u8D23\u4EFB\u4EBA\uFF1A"), /*#__PURE__*/React.createElement("span", {
234
+ className: styles.content
235
+ }, baseInfo.c)))))), /*#__PURE__*/React.createElement("div", {
236
+ className: styles['block-box']
237
+ }, /*#__PURE__*/React.createElement("div", {
238
+ className: styles.title
239
+ }, /*#__PURE__*/React.createElement(_Divider, {
240
+ direction: "ver"
241
+ }), "\u5173\u952E\u6307\u6807"), /*#__PURE__*/React.createElement("div", {
242
+ className: styles.body
243
+ }, /*#__PURE__*/React.createElement("div", {
244
+ className: styles.indicator
245
+ }, indicatorRander(indicator)))), /*#__PURE__*/React.createElement("div", {
246
+ className: styles['block-box']
247
+ }, /*#__PURE__*/React.createElement("div", {
248
+ className: styles.title
249
+ }, /*#__PURE__*/React.createElement(_Divider, {
250
+ direction: "ver"
251
+ }), "\u6700\u8FD1\u7684\u544A\u8B66\u548C\u98CE\u9669"), /*#__PURE__*/React.createElement("div", {
252
+ className: styles.body
253
+ }, /*#__PURE__*/React.createElement("div", {
254
+ className: styles.alarm
255
+ }, /*#__PURE__*/React.createElement(_Table, {
256
+ hasBorder: false,
257
+ columns: columns,
258
+ dataSource: dataSource,
259
+ emptyContent: /*#__PURE__*/React.createElement(NoDataPage, {
260
+ type: "table"
261
+ })
262
+ })))));
263
+ }
264
+ ;
@@ -0,0 +1,73 @@
1
+ @import "~@alifd/next/variables.scss";
2
+
3
+ .resource-overview {
4
+ .block-box {
5
+ color: #78849c;
6
+ overflow: hidden;
7
+ .title {
8
+ height: 20px;
9
+ line-height: 20px;
10
+ font-size: 14px;
11
+ font-weight: 600;
12
+ color: #4d6277;
13
+ margin-top: 16px;
14
+ :global {
15
+ .#{$css-prefix}divider-ver {
16
+ height: 1em;
17
+ }
18
+ }
19
+ }
20
+ }
21
+ .base-info {
22
+ margin-top: 16px;
23
+ .row {
24
+ display: flex;
25
+ margin-bottom: 8px;
26
+ .item {
27
+ width: 220px;
28
+ margin-right: 25px;
29
+ }
30
+ }
31
+ }
32
+ .indicator {
33
+ width: 525px;
34
+ margin: 12px 0 8px;
35
+ .row {
36
+ display: flex;
37
+ border-bottom: 1px solid #f2f5fa;
38
+ &:last-child {
39
+ border: none;
40
+ }
41
+ .item {
42
+ width: 175px;
43
+ height: 100px;
44
+ box-sizing: border-box;
45
+ display: flex;
46
+ flex-direction: column;
47
+ text-align: center;
48
+ border-right: 1px solid #f2f5fa;
49
+ &:last-child {
50
+ border: none;
51
+ }
52
+ .content {
53
+ margin-top: 19px;
54
+ height: 32px;
55
+ line-height: 32px;
56
+ font-size: 32px;
57
+ color: #4d6277;
58
+ }
59
+ .label {
60
+ margin-top: 12px;
61
+ height: 20px;
62
+ font-size: 14px;
63
+ font-weight: 400;
64
+ color: #78849c;
65
+ line-height: 20px;
66
+ }
67
+ }
68
+ }
69
+ }
70
+ .alarm{
71
+ margin-top: 12px;
72
+ }
73
+ }