@riil-frontend/component-topology 2.14.2-alpha.13 → 2.14.2-alpha.18

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 (25) hide show
  1. package/build/index.css +1 -1
  2. package/build/index.js +27 -27
  3. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +1 -1
  4. package/es/core/editor/components/iconManage/UploadIconDialog.js +11 -5
  5. package/es/core/models/common/Alarm.js +32 -32
  6. package/es/core/services/overview.js +29 -0
  7. package/es/core/utils/exportData.js +1 -1
  8. package/es/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/index.js +387 -136
  9. package/es/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/index.module.scss +12 -1
  10. package/es/core/viewer/components/plugins/BaseInfo/index.js +27 -6
  11. package/es/core/viewer/components/plugins/BaseInfo/index.module.scss +1 -1
  12. package/es/models/topoAlarm.js +50 -23
  13. package/es/style.js +1 -0
  14. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +1 -1
  15. package/lib/core/editor/components/iconManage/UploadIconDialog.js +16 -5
  16. package/lib/core/models/common/Alarm.js +27 -27
  17. package/lib/core/services/overview.js +40 -0
  18. package/lib/core/utils/exportData.js +1 -1
  19. package/lib/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/index.js +398 -136
  20. package/lib/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/index.module.scss +12 -1
  21. package/lib/core/viewer/components/plugins/BaseInfo/index.js +27 -6
  22. package/lib/core/viewer/components/plugins/BaseInfo/index.module.scss +1 -1
  23. package/lib/models/topoAlarm.js +49 -23
  24. package/lib/style.js +1 -0
  25. package/package.json +2 -2
@@ -1,16 +1,131 @@
1
1
  import _Table from "@alifd/next/es/table";
2
2
  import _Divider from "@alifd/next/es/divider";
3
+ import _Button from "@alifd/next/es/button";
4
+ import _Icon from "@alifd/next/es/icon";
5
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
6
  import _extends from "@babel/runtime/helpers/extends";
7
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
8
  import React, { useState, useEffect, useRef, useCallback } from 'react';
9
+ import { Link } from "react-router-dom";
10
+ import { metricValueFormat } from '@riil-frontend/utils';
11
+ import moment from "moment";
5
12
  import { TopoEvent } from '@riil-frontend/component-topology-graph';
6
13
  import { findItem } from "../../../../../../../utils/topoData";
14
+ import alertService from '@riil-frontend/component-topology-common/es/services/alert'; // import riskService from '@riil-frontend/component-topology-common/es/services/risk';
15
+
16
+ import topoService from '@riil-frontend/component-topology-common/es/services/topo';
17
+ import service from "../../../../../../services/overview";
7
18
  import NoDataPage from '@riil-frontend/component-topology-common/es/components/NoDataPage'; // import ResourceDiplayInfoSetting from './Setting';
8
19
  // bimport '@riil-frontend/css/lib/index.scss';
9
20
 
10
- import styles from "./index.module.scss"; // 关键指标
21
+ import DictCache from "../../../../../../models/cache/DictCache";
22
+ import styles from "./index.module.scss"; // 基本信息
11
23
 
12
- function indicatorRander(data) {
24
+ function BaseInfoRender(type, data) {
25
+ if (type === 'link') {
26
+ return /*#__PURE__*/React.createElement("div", {
27
+ className: styles['base-info']
28
+ }, /*#__PURE__*/React.createElement("div", {
29
+ className: styles.row
30
+ }, /*#__PURE__*/React.createElement("div", {
31
+ className: styles.item,
32
+ style: {
33
+ width: '100%'
34
+ }
35
+ }, /*#__PURE__*/React.createElement("span", {
36
+ className: styles.label
37
+ }, "\u94FE\u8DEF\u5E26\u5BBD\uFF1A"), /*#__PURE__*/React.createElement("span", {
38
+ className: styles.content
39
+ }, data.rated_bandwidth))), /*#__PURE__*/React.createElement("div", {
40
+ className: styles.row
41
+ }, /*#__PURE__*/React.createElement("div", {
42
+ className: styles.item
43
+ }, /*#__PURE__*/React.createElement("span", {
44
+ className: styles.label
45
+ }, "\u6E90IP\u5730\u5740\uFF1A"), /*#__PURE__*/React.createElement("span", {
46
+ className: styles.content
47
+ }, data.source_ipv4)), /*#__PURE__*/React.createElement("div", {
48
+ className: styles.item
49
+ }, /*#__PURE__*/React.createElement("span", {
50
+ className: styles.label
51
+ }, "\u76EE\u7684IP\u5730\u5740\uFF1A"), /*#__PURE__*/React.createElement("span", {
52
+ className: styles.content
53
+ }, data.destination_ipv4))), /*#__PURE__*/React.createElement("div", {
54
+ className: styles.row
55
+ }, /*#__PURE__*/React.createElement("div", {
56
+ className: styles.item
57
+ }, /*#__PURE__*/React.createElement("span", {
58
+ className: styles.label
59
+ }, "\u6E90\u63A5\u53E3\uFF1A"), /*#__PURE__*/React.createElement("span", {
60
+ className: styles.content
61
+ }, data.source_Interface)), /*#__PURE__*/React.createElement("div", {
62
+ className: styles.item
63
+ }, /*#__PURE__*/React.createElement("span", {
64
+ className: styles.label
65
+ }, "\u76EE\u7684\u63A5\u53E3\uFF1A"), /*#__PURE__*/React.createElement("span", {
66
+ className: styles.content
67
+ }, data.destination_Interface))));
68
+ } else {
69
+ return /*#__PURE__*/React.createElement("div", {
70
+ className: styles['base-info']
71
+ }, /*#__PURE__*/React.createElement("div", {
72
+ className: styles.row
73
+ }, /*#__PURE__*/React.createElement("div", {
74
+ className: styles.item
75
+ }, /*#__PURE__*/React.createElement("span", {
76
+ className: styles.label
77
+ }, "\u8D44\u6E90\u540D\u79F0\uFF1A"), /*#__PURE__*/React.createElement("span", {
78
+ className: styles.content
79
+ }, data.display_name)), /*#__PURE__*/React.createElement("div", {
80
+ className: styles.item
81
+ }, /*#__PURE__*/React.createElement("span", {
82
+ className: styles.label
83
+ }, "IP\u5730\u5740\uFF1A"), /*#__PURE__*/React.createElement("span", {
84
+ className: styles.content
85
+ }, data.ipv4_address))), /*#__PURE__*/React.createElement("div", {
86
+ className: styles.row
87
+ }, /*#__PURE__*/React.createElement("div", {
88
+ className: styles.item
89
+ }, /*#__PURE__*/React.createElement("span", {
90
+ className: styles.label
91
+ }, "\u8D44\u4EA7\u7F16\u53F7\uFF1A"), /*#__PURE__*/React.createElement("span", {
92
+ className: styles.content
93
+ }, data.asset_number)), /*#__PURE__*/React.createElement("div", {
94
+ className: styles.item
95
+ }, /*#__PURE__*/React.createElement("span", {
96
+ className: styles.label
97
+ }, "\u8D44\u6E90\u7C7B\u578B\uFF1A"), /*#__PURE__*/React.createElement("span", {
98
+ className: styles.content
99
+ }, data.ciName))), /*#__PURE__*/React.createElement("div", {
100
+ className: styles.row
101
+ }, /*#__PURE__*/React.createElement("div", {
102
+ className: styles.item,
103
+ style: {
104
+ width: '100%'
105
+ }
106
+ }, /*#__PURE__*/React.createElement("span", {
107
+ className: styles.label
108
+ }, "\u8D44\u6E90\u4F4D\u7F6E\uFF1A"), /*#__PURE__*/React.createElement("span", {
109
+ className: styles.content
110
+ }, data.res_address))));
111
+ }
112
+ } // 关键指标
113
+
114
+
115
+ function indicatorRander(type, data) {
13
116
  console.log('indicatorRander', data);
117
+
118
+ function formatValue(itemData) {
119
+ var format = metricValueFormat({
120
+ value: itemData.value,
121
+ dataType: itemData.dataType,
122
+ dict: DictCache.getDictObject(),
123
+ unit: itemData.unit,
124
+ code: itemData.code
125
+ });
126
+ return format.value;
127
+ }
128
+
14
129
  return /*#__PURE__*/React.createElement("div", {
15
130
  className: styles.indicator
16
131
  }, /*#__PURE__*/React.createElement("div", {
@@ -21,10 +136,10 @@ function indicatorRander(data) {
21
136
  key: item.code
22
137
  }, /*#__PURE__*/React.createElement("span", {
23
138
  className: styles.content
24
- }, item.value ? item.value + item.unit : '暂无数据'), /*#__PURE__*/React.createElement("span", {
139
+ }, formatValue(item)), /*#__PURE__*/React.createElement("span", {
25
140
  className: styles.label
26
141
  }, item.name));
27
- })), /*#__PURE__*/React.createElement("div", {
142
+ })), type === 'node' ? /*#__PURE__*/React.createElement("div", {
28
143
  className: styles.row
29
144
  }, data.slice(3, 6).map(function (item) {
30
145
  return /*#__PURE__*/React.createElement("div", {
@@ -32,10 +147,10 @@ function indicatorRander(data) {
32
147
  key: item.code
33
148
  }, /*#__PURE__*/React.createElement("span", {
34
149
  className: styles.content
35
- }, item.value ? item.value + item.unit : '暂无数据'), /*#__PURE__*/React.createElement("span", {
150
+ }, formatValue(item)), /*#__PURE__*/React.createElement("span", {
36
151
  className: styles.label
37
152
  }, item.name));
38
- })));
153
+ })) : '');
39
154
  }
40
155
  /**
41
156
  * 资源概览
@@ -45,23 +160,35 @@ function indicatorRander(data) {
45
160
  export default function ResourceOverview(props) {
46
161
  var topo = props.topo,
47
162
  id = props.id,
48
- ciType = props.ciType;
163
+ type = props.type,
164
+ ciType = props.ciType,
165
+ ciName = props.ciName;
49
166
 
50
167
  var _topo$store$useModelS = topo.store.useModelState('topoBizMod'),
51
168
  attrsAndMetrics = _topo$store$useModelS.attrsAndMetrics;
52
169
 
53
170
  var _useState = useState({
171
+ // 资源
54
172
  display_name: '',
55
173
  // 资源名称/显示名称
56
174
  ipv4_address: '',
57
175
  // IP地址
58
176
  asset_number: '',
59
177
  // 资产编号
60
- type: '',
178
+ ciName: '',
61
179
  // 资源类型
62
- b: '',
180
+ res_address: '',
63
181
  // 资源位置
64
- c: '' // 责任人
182
+ // 链路
183
+ rated_bandwidth: '',
184
+ // 链路带宽
185
+ source_ipv4: '',
186
+ // 源IP地址
187
+ destination_ipv4: '',
188
+ // 目的IP地址
189
+ source_Interface: '',
190
+ // 源接口
191
+ destination_Interface: '' // 目的接口
65
192
 
66
193
  }),
67
194
  baseInfo = _useState[0],
@@ -71,113 +198,281 @@ export default function ResourceOverview(props) {
71
198
  indicator = _useState2[0],
72
199
  setIndicator = _useState2[1];
73
200
 
201
+ var _useState3 = useState([]),
202
+ alarmRiskList = _useState3[0],
203
+ setAlarmRiskList = _useState3[1];
204
+
74
205
  useEffect(function () {
75
206
  init();
76
- }, [attrsAndMetrics]);
207
+ }, [attrsAndMetrics, id]);
77
208
 
78
209
  function init() {
79
- var _findItem2, _findItem3, _findItem4, _findItem5;
210
+ var _topo$options$resourc, _attributeMap$source_, _attributeMap$destina;
211
+
212
+ // 指标模型
213
+ var _topo$ciTyeCache$getC = topo.ciTyeCache.getCiType(ciType),
214
+ modelMetrics = _topo$ciTyeCache$getC.metrics;
215
+
216
+ var topModelMetrics = modelMetrics.slice(0, 6);
217
+ console.log('topModelMetrics', topModelMetrics); // 应用拓扑处理
218
+
219
+ if ((_topo$options$resourc = topo.options.resourceOverviewDrawer) !== null && _topo$options$resourc !== void 0 && _topo$options$resourc.getData) {
220
+ var _topo$options$resourc3;
221
+
222
+ topo.resourceOverviewDrawer && (topo.resourceOverviewDrawer['refreshData'] = init);
223
+
224
+ var _topo$options$resourc2 = (_topo$options$resourc3 = topo.options.resourceOverviewDrawer) === null || _topo$options$resourc3 === void 0 ? void 0 : _topo$options$resourc3.getData({
225
+ id: id,
226
+ metrics: topModelMetrics
227
+ }),
228
+ _metrics = _topo$options$resourc2.metrics,
229
+ alarms = _topo$options$resourc2.alarms;
230
+
231
+ console.log('应用拓扑 参数获取', _metrics, alarms);
232
+ getAttribute(id);
233
+ setIndicator(topModelMetrics.map(function (item) {
234
+ return _extends({}, item, {
235
+ value: _metrics[item.code] || ''
236
+ });
237
+ }));
238
+ setAlarmRiskList(alarms || []);
239
+ return;
240
+ } // 拓扑(默认) ---------------------------
241
+ // 基本信息
242
+
80
243
 
81
- // 资源-基本信息
82
244
  console.log('资源-基本信息------------------------', id, attrsAndMetrics);
83
245
 
84
246
  var _findItem = findItem(attrsAndMetrics, 'id', id),
85
- attributes = _findItem.attributes,
247
+ attributeMap = _findItem.attributeMap,
86
248
  metrics = _findItem.metrics;
87
249
 
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)
250
+ console.log('attributeMap', attributeMap);
251
+ var res_address = '-';
97
252
 
98
- console.log('资源/链路-关键指标------------------------', id, metrics);
253
+ if (attributeMap.owned_computer_room) {
254
+ res_address = attributeMap.owned_computer_room + " " + attributeMap.owned_cabinet + " " + attributeMap.start_u_location + "-" + attributeMap.end_u_location;
255
+ }
99
256
 
100
- var _topo$ciTyeCache$getC = topo.ciTyeCache.getCiType(ciType),
101
- modelMetrics = _topo$ciTyeCache$getC.metrics;
257
+ setBaseInfo({
258
+ // 资源
259
+ display_name: attributeMap.display_name || '-',
260
+ ipv4_address: attributeMap.ipv4_address || '-',
261
+ asset_number: attributeMap.asset_number || '-',
262
+ // type: findItem(attributes, 'code', 'type')?.value || '-',
263
+ ciName: ciName || '-',
264
+ res_address: res_address,
265
+ // 链路
266
+ rated_bandwidth: attributeMap.rated_bandwidth || '-',
267
+ // 额定带宽
268
+ // rated_bandwidth:[network_link.actual_bandwidth] || '-',// 实际带宽
269
+ source_ipv4: attributeMap.source_ipv4 || '-',
270
+ destination_ipv4: attributeMap.destination_ipv4 || '-',
271
+ source_Interface: ((_attributeMap$source_ = attributeMap.source_id_object) === null || _attributeMap$source_ === void 0 ? void 0 : _attributeMap$source_.displayName) || '-',
272
+ destination_Interface: ((_attributeMap$destina = attributeMap.destination_id_object) === null || _attributeMap$destina === void 0 ? void 0 : _attributeMap$destina.displayName) || '-'
273
+ }); // 资源/链路-关键指标 数据 metrics,模型 topo.ciTyeCache.getCiType(ciType)
102
274
 
103
- setIndicator(modelMetrics.slice(0, 6).map(function (item) {
104
- var _findItem6;
275
+ console.log('资源/链路-关键指标------------------------', id, metrics);
276
+ setIndicator(topModelMetrics.map(function (item) {
277
+ var _findItem2;
105
278
 
106
279
  return _extends({}, item, {
107
- value: (_findItem6 = findItem(metrics, 'code', item.code)) === null || _findItem6 === void 0 ? void 0 : _findItem6.value
280
+ value: ((_findItem2 = findItem(metrics, 'code', item.code)) === null || _findItem2 === void 0 ? void 0 : _findItem2.value) || ''
108
281
  });
282
+ })); // 资源-告警/风险
283
+
284
+ getAlarmRiskData(id);
285
+ } // 获取属性信息(应用拓扑)
286
+
287
+
288
+ function getAttribute(_x) {
289
+ return _getAttribute.apply(this, arguments);
290
+ } // 获取告警/风险信息
291
+
292
+
293
+ function _getAttribute() {
294
+ _getAttribute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(id) {
295
+ var res, _ref, attributes, attributeMap, res_address;
296
+
297
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
298
+ while (1) {
299
+ switch (_context.prev = _context.next) {
300
+ case 0:
301
+ _context.next = 2;
302
+ return topoService.ciInfo.batchQueryCiInfo({
303
+ ciId: [{
304
+ ciId: id,
305
+ operation: 'delete'
306
+ }],
307
+ codes: [],
308
+ relationId: []
309
+ });
310
+
311
+ case 2:
312
+ res = _context.sent;
313
+ console.log('应用拓扑 查询结果 res', res);
314
+ _ref = res[0] || {}, attributes = _ref.attributes;
315
+ attributeMap = {};
316
+ attributes.forEach(function (item) {
317
+ attributeMap[item.code] = item.value;
318
+ });
319
+ res_address = '-';
320
+
321
+ if (attributeMap.owned_computer_room) {
322
+ res_address = attributeMap.owned_computer_room + " " + attributeMap.owned_cabinet + " " + attributeMap.start_u_location + "-" + attributeMap.end_u_location;
323
+ }
324
+
325
+ setBaseInfo({
326
+ // 资源
327
+ display_name: attributeMap.display_name || '-',
328
+ ipv4_address: attributeMap.ipv4_address || '-',
329
+ asset_number: attributeMap.asset_number || '-',
330
+ ciName: ciName || '-',
331
+ res_address: res_address
332
+ });
333
+
334
+ case 10:
335
+ case "end":
336
+ return _context.stop();
337
+ }
338
+ }
339
+ }, _callee);
109
340
  }));
341
+ return _getAttribute.apply(this, arguments);
342
+ }
343
+
344
+ function getAlarmRiskData(_x2) {
345
+ return _getAlarmRiskData.apply(this, arguments);
346
+ }
347
+
348
+ function _getAlarmRiskData() {
349
+ _getAlarmRiskData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id) {
350
+ var _yield$alertService$g, alarmList, _yield$service$getRis, riskList;
351
+
352
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
353
+ while (1) {
354
+ switch (_context2.prev = _context2.next) {
355
+ case 0:
356
+ _context2.next = 2;
357
+ return alertService.getAlarmByIds({
358
+ ciIdList: [id],
359
+ alertStatusList: ['toDeal', 'dealing'],
360
+ // toDeal: 待处理, dealing:处理中
361
+ pageNum: 1,
362
+ pageSize: 10,
363
+ sortField: "alertLevel",
364
+ sortOrder: "asc"
365
+ });
366
+
367
+ case 2:
368
+ _yield$alertService$g = _context2.sent;
369
+ alarmList = _yield$alertService$g.datas;
370
+ alarmList = alarmList.map(function (item) {
371
+ return {
372
+ type: 'alarm',
373
+ icon: 'gaojing-3',
374
+ className: "alarm-color-icon-lv" + item.alertLevel,
375
+ title: "[" + item.alertObject + "] " + item.alertTitle,
376
+ link: "/default/pagecenter/alertDetail/view/" + record.alertId + "?alertId=" + record.alertId + "&resId=" + record.ciId + "&title=" + record.alertObject,
377
+ time: item.createTime,
378
+ status: item.status
379
+ };
380
+ });
381
+ _context2.next = 7;
382
+ return service.getRiskByIds({
383
+ ciIdList: [id],
384
+ statusList: ['toDeal', 'dealing'],
385
+ current: 1,
386
+ pageSize: 10
387
+ });
388
+
389
+ case 7:
390
+ _yield$service$getRis = _context2.sent;
391
+ riskList = _yield$service$getRis.content;
392
+ riskList = alarmList.map(function (item) {
393
+ return {
394
+ type: 'risk',
395
+ icon: 'Overall_risk_full',
396
+ className: 'risk-icon',
397
+ title: item.itemName,
398
+ link: '/default/inspectionTaskList/inspectionReport?title=tomcat(172.17.162.192:8888)&reportId=20&reportTime=1644768602413&reportType=0&reportName=tomcat(172.17.162.192:8888)',
399
+ time: ''
400
+ };
401
+ });
402
+ /* {
403
+ "id": "5815",
404
+ "executeId": "20",
405
+ "taskId": "5737",
406
+ "checkItemId": "5801",
407
+ "itemName": "tomcat(172.17.162.192:8888)存在运行风险",
408
+ "itemCode": "m.tomcat_metric_item",
409
+ "checkType": "速率类风险",
410
+ "ciId": "00000000aff84a9c",
411
+ "ciName": "tomcat(172.17.162.192:8888)",
412
+ "ciTypeCode": "tomcat",
413
+ "ipAddress": "172.17.162.192",
414
+ "firstFoundTime": 1644486885000,
415
+ "processTime": null,
416
+ "endTime": 1644894567198,
417
+ "state": 127,
418
+ "duration": 431239035,
419
+ "status": "closed",
420
+ "executeTime": 1644768602413,
421
+ "viewType": 0
422
+ } */
423
+
424
+ console.log('资源-告警/风险', alarmList, riskList);
425
+ setAlarmRiskList([].concat(alarmList, riskList));
426
+
427
+ case 12:
428
+ case "end":
429
+ return _context2.stop();
430
+ }
431
+ }
432
+ }, _callee2);
433
+ }));
434
+ return _getAlarmRiskData.apply(this, arguments);
110
435
  }
111
436
 
112
- var topoBizMod = topo.store.useModelState('topoBizMod');
113
- useEffect(function () {
114
- console.log('topoBizMod', topoBizMod);
115
- }, [topoBizMod]);
116
437
  var columns = [{
117
438
  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
-
439
+ dataIndex: 'alertTitle',
440
+ key: 'alertTitle',
441
+ cell: function cell(value, index, record) {
442
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Icon, {
443
+ type: "gaojing-3",
444
+ size: "xs",
445
+ className: styles["alarm-color-icon"] + " alarm-color-icon-lv" + record.alertLevel
446
+ }), /*#__PURE__*/React.createElement(Link, {
447
+ to: "/default/pagecenter/alertDetail/view/" + record.alertId + "?alertId=" + record.alertId + "&resId=" + record.ciId + "&title=" + record.alertObject
448
+ }, "[" + record.alertObject + "] " + value));
449
+ }
128
450
  }, {
129
451
  title: '时间',
130
452
  dataIndex: 'createTime',
131
453
  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
-
454
+ width: 128,
455
+ cell: function cell(createTime, index, record) {
456
+ return /*#__PURE__*/React.createElement("div", {
457
+ title: moment(createTime).format('YYYY-MM-DD HH:mm')
458
+ }, moment(createTime).format('YYYY-MM-DD HH:mm'));
459
+ }
138
460
  }, {
139
461
  title: '操作',
140
- dataIndex: 'alertType',
141
- key: 'alertType',
142
- width: 64 // cell: (alertType, index, record) => (
143
- // <div title={alertType}>{alertType}</div>
144
- // ),
145
-
462
+ dataIndex: 'status',
463
+ key: 'status',
464
+ width: 64,
465
+ cell: function cell(status, index, record) {
466
+ return status === 'toDeal' ? /*#__PURE__*/React.createElement(_Button, {
467
+ text: true,
468
+ type: "primary"
469
+ }, "\u53D7\u7406") : /*#__PURE__*/React.createElement(_Button, {
470
+ disabled: true,
471
+ text: true,
472
+ type: "primary"
473
+ }, "\u5DF2\u53D7\u7406");
474
+ }
146
475
  }];
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
476
  return /*#__PURE__*/React.createElement("div", {
182
477
  className: styles['resource-overview']
183
478
  }, /*#__PURE__*/React.createElement("div", {
@@ -188,51 +483,7 @@ export default function ResourceOverview(props) {
188
483
  direction: "ver"
189
484
  }), "\u57FA\u672C\u4FE1\u606F"), /*#__PURE__*/React.createElement("div", {
190
485
  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", {
486
+ }, BaseInfoRender(type, baseInfo))), /*#__PURE__*/React.createElement("div", {
236
487
  className: styles['block-box']
237
488
  }, /*#__PURE__*/React.createElement("div", {
238
489
  className: styles.title
@@ -242,7 +493,7 @@ export default function ResourceOverview(props) {
242
493
  className: styles.body
243
494
  }, /*#__PURE__*/React.createElement("div", {
244
495
  className: styles.indicator
245
- }, indicatorRander(indicator)))), /*#__PURE__*/React.createElement("div", {
496
+ }, indicatorRander(type, indicator)))), /*#__PURE__*/React.createElement("div", {
246
497
  className: styles['block-box']
247
498
  }, /*#__PURE__*/React.createElement("div", {
248
499
  className: styles.title
@@ -255,7 +506,7 @@ export default function ResourceOverview(props) {
255
506
  }, /*#__PURE__*/React.createElement(_Table, {
256
507
  hasBorder: false,
257
508
  columns: columns,
258
- dataSource: dataSource,
509
+ dataSource: alarmRiskList,
259
510
  emptyContent: /*#__PURE__*/React.createElement(NoDataPage, {
260
511
  type: "table"
261
512
  })
@@ -67,7 +67,18 @@
67
67
  }
68
68
  }
69
69
  }
70
- .alarm{
70
+ .alarm {
71
71
  margin-top: 12px;
72
+ .alarm-color-icon {
73
+ width: 12px;
74
+ height: 12px;
75
+ font-size: 12px;
76
+ margin-right: 4px;
77
+ }
78
+ :global {
79
+ .#{$css-prefix}btn-helper{
80
+ vertical-align: baseline;
81
+ }
82
+ }
72
83
  }
73
84
  }