@riil-frontend/component-topology 8.0.6 → 8.0.8
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.
- package/build/index.js +1 -1
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/services/index.js +33 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +187 -139
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/services/index.js +34 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +187 -139
- package/package.json +2 -2
@@ -23,7 +23,7 @@ import topoFactory from "./topoFactory";
|
|
23
23
|
import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
|
24
24
|
import SelectionModel from "./SelectionModel"; // eslint-disable-next-line no-undef
|
25
25
|
|
26
|
-
var version = typeof "8.0.
|
26
|
+
var version = typeof "8.0.8" === 'string' ? "8.0.8" : null;
|
27
27
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
28
28
|
/**
|
29
29
|
* 拓扑显示和编辑
|
@@ -60,4 +60,37 @@ function _queryModelAsset() {
|
|
60
60
|
}, _callee2);
|
61
61
|
}));
|
62
62
|
return _queryModelAsset.apply(this, arguments);
|
63
|
+
}
|
64
|
+
|
65
|
+
export function commonQueryCiData(_x3) {
|
66
|
+
return _commonQueryCiData.apply(this, arguments);
|
67
|
+
}
|
68
|
+
|
69
|
+
function _commonQueryCiData() {
|
70
|
+
_commonQueryCiData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id) {
|
71
|
+
var result;
|
72
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
73
|
+
while (1) {
|
74
|
+
switch (_context3.prev = _context3.next) {
|
75
|
+
case 0:
|
76
|
+
_context3.next = 2;
|
77
|
+
return request.post('/mdc/v1/api/cmdb/authority/commonQueryCiData', {
|
78
|
+
condition: "type('machine_room') && id('" + id + "')",
|
79
|
+
orders: [],
|
80
|
+
pageIndex: 1,
|
81
|
+
pageSize: 20
|
82
|
+
});
|
83
|
+
|
84
|
+
case 2:
|
85
|
+
result = _context3.sent;
|
86
|
+
return _context3.abrupt("return", result);
|
87
|
+
|
88
|
+
case 4:
|
89
|
+
case "end":
|
90
|
+
return _context3.stop();
|
91
|
+
}
|
92
|
+
}
|
93
|
+
}, _callee3);
|
94
|
+
}));
|
95
|
+
return _commonQueryCiData.apply(this, arguments);
|
63
96
|
}
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import _Message from "@alifd/next/es/message";
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
3
2
|
import _Button from "@alifd/next/es/button";
|
4
3
|
import _Icon from "@alifd/next/es/icon";
|
4
|
+
import _Message from "@alifd/next/es/message";
|
5
5
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
6
6
|
|
7
7
|
function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
@@ -16,7 +16,7 @@ import React, { useEffect, useMemo, useState } from 'react';
|
|
16
16
|
import { rlog } from '@riil-frontend/component-topology-utils/lib/rlog'; // import { Link } from 'react-router-dom';
|
17
17
|
|
18
18
|
import Link from "../../../../../../../components/Link";
|
19
|
-
import { queryCisByIds } from "../../../../../../services";
|
19
|
+
import { queryCisByIds, commonQueryCiData } from "../../../../../../services";
|
20
20
|
import alarmService from "../../../../../../services/alarm";
|
21
21
|
import service from "../../../../../../services/overview";
|
22
22
|
import BaseInfoBlock from "./BaseInfoBlock";
|
@@ -157,10 +157,39 @@ export default function ResourceOverview(props) {
|
|
157
157
|
isAppTopo && resourceOverviewProps.onClose && resourceOverviewProps.onClose();
|
158
158
|
}
|
159
159
|
|
160
|
-
var jump = function
|
161
|
-
|
162
|
-
|
163
|
-
|
160
|
+
var jump = /*#__PURE__*/function () {
|
161
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(roomLink, id) {
|
162
|
+
var power;
|
163
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
164
|
+
while (1) {
|
165
|
+
switch (_context.prev = _context.next) {
|
166
|
+
case 0:
|
167
|
+
onClose();
|
168
|
+
_context.next = 3;
|
169
|
+
return commonQueryCiData(id);
|
170
|
+
|
171
|
+
case 3:
|
172
|
+
power = _context.sent;
|
173
|
+
console.log(power);
|
174
|
+
|
175
|
+
if (power.data.length) {
|
176
|
+
window.open("" + window.location.origin + roomLink);
|
177
|
+
} else {
|
178
|
+
_Message.error('无访问权限,请联系管理员');
|
179
|
+
}
|
180
|
+
|
181
|
+
case 6:
|
182
|
+
case "end":
|
183
|
+
return _context.stop();
|
184
|
+
}
|
185
|
+
}
|
186
|
+
}, _callee);
|
187
|
+
}));
|
188
|
+
|
189
|
+
return function jump(_x, _x2) {
|
190
|
+
return _ref.apply(this, arguments);
|
191
|
+
};
|
192
|
+
}(); // 基本信息可选项
|
164
193
|
|
165
194
|
|
166
195
|
var baseInfoCol = useMemo(function () {
|
@@ -220,27 +249,27 @@ export default function ResourceOverview(props) {
|
|
220
249
|
}
|
221
250
|
|
222
251
|
function _getDevice() {
|
223
|
-
_getDevice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
252
|
+
_getDevice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
224
253
|
var list;
|
225
|
-
return _regeneratorRuntime.wrap(function
|
254
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
226
255
|
while (1) {
|
227
|
-
switch (
|
256
|
+
switch (_context2.prev = _context2.next) {
|
228
257
|
case 0:
|
229
|
-
|
258
|
+
_context2.next = 2;
|
230
259
|
return service.getDeviceTypeList();
|
231
260
|
|
232
261
|
case 2:
|
233
|
-
list =
|
262
|
+
list = _context2.sent;
|
234
263
|
setIsDevice(list.some(function (item) {
|
235
264
|
return item.code === ciType;
|
236
265
|
})); // console.log('getDevice', ciType, list);
|
237
266
|
|
238
267
|
case 4:
|
239
268
|
case "end":
|
240
|
-
return
|
269
|
+
return _context2.stop();
|
241
270
|
}
|
242
271
|
}
|
243
|
-
},
|
272
|
+
}, _callee2);
|
244
273
|
}));
|
245
274
|
return _getDevice.apply(this, arguments);
|
246
275
|
}
|
@@ -248,32 +277,32 @@ export default function ResourceOverview(props) {
|
|
248
277
|
getDevice();
|
249
278
|
}, [ciType]); // 获取地址信息:机房 机柜 起始U-结束U
|
250
279
|
|
251
|
-
function getAddressFormat(
|
280
|
+
function getAddressFormat(_x3) {
|
252
281
|
return _getAddressFormat.apply(this, arguments);
|
253
282
|
} // 告警table列配置
|
254
283
|
|
255
284
|
|
256
285
|
function _getAddressFormat() {
|
257
|
-
_getAddressFormat = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
286
|
+
_getAddressFormat = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref2) {
|
258
287
|
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;
|
259
288
|
|
260
|
-
return _regeneratorRuntime.wrap(function
|
289
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
261
290
|
while (1) {
|
262
|
-
switch (
|
291
|
+
switch (_context3.prev = _context3.next) {
|
263
292
|
case 0:
|
264
|
-
owned_computer_room =
|
293
|
+
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;
|
265
294
|
address = '';
|
266
295
|
|
267
296
|
if (!(owned_computer_room && owned_cabinet)) {
|
268
|
-
|
297
|
+
_context3.next = 7;
|
269
298
|
break;
|
270
299
|
}
|
271
300
|
|
272
|
-
|
301
|
+
_context3.next = 5;
|
273
302
|
return queryCisByIds([owned_computer_room, owned_cabinet]);
|
274
303
|
|
275
304
|
case 5:
|
276
|
-
res =
|
305
|
+
res = _context3.sent;
|
277
306
|
address = (((_res$find = res.find(function (item) {
|
278
307
|
return item.id === owned_computer_room;
|
279
308
|
})) === 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) {
|
@@ -287,14 +316,14 @@ export default function ResourceOverview(props) {
|
|
287
316
|
u = (start_u_location || '') + "-" + (end_u_location || '');
|
288
317
|
}
|
289
318
|
|
290
|
-
return
|
319
|
+
return _context3.abrupt("return", address || u ? "" + (address || '') + (u ? " " + u : '') : '');
|
291
320
|
|
292
321
|
case 10:
|
293
322
|
case "end":
|
294
|
-
return
|
323
|
+
return _context3.stop();
|
295
324
|
}
|
296
325
|
}
|
297
|
-
},
|
326
|
+
}, _callee3);
|
298
327
|
}));
|
299
328
|
return _getAddressFormat.apply(this, arguments);
|
300
329
|
}
|
@@ -352,27 +381,27 @@ export default function ResourceOverview(props) {
|
|
352
381
|
}
|
353
382
|
}]; // 告警/风险 操作 (受理)
|
354
383
|
|
355
|
-
function alarmRiskOperation(
|
384
|
+
function alarmRiskOperation(_x4, _x5) {
|
356
385
|
return _alarmRiskOperation.apply(this, arguments);
|
357
386
|
}
|
358
387
|
|
359
388
|
function _alarmRiskOperation() {
|
360
|
-
_alarmRiskOperation = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
389
|
+
_alarmRiskOperation = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(type, params) {
|
361
390
|
var res;
|
362
|
-
return _regeneratorRuntime.wrap(function
|
391
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
363
392
|
while (1) {
|
364
|
-
switch (
|
393
|
+
switch (_context4.prev = _context4.next) {
|
365
394
|
case 0:
|
366
395
|
if (!(type === 'alarm')) {
|
367
|
-
|
396
|
+
_context4.next = 6;
|
368
397
|
break;
|
369
398
|
}
|
370
399
|
|
371
|
-
|
400
|
+
_context4.next = 3;
|
372
401
|
return service.handleAlarm(params);
|
373
402
|
|
374
403
|
case 3:
|
375
|
-
res =
|
404
|
+
res = _context4.sent;
|
376
405
|
|
377
406
|
_Message.success('受理成功');
|
378
407
|
|
@@ -389,10 +418,10 @@ export default function ResourceOverview(props) {
|
|
389
418
|
|
390
419
|
case 6:
|
391
420
|
case "end":
|
392
|
-
return
|
421
|
+
return _context4.stop();
|
393
422
|
}
|
394
423
|
}
|
395
|
-
},
|
424
|
+
}, _callee4);
|
396
425
|
}));
|
397
426
|
return _alarmRiskOperation.apply(this, arguments);
|
398
427
|
}
|
@@ -405,37 +434,37 @@ export default function ResourceOverview(props) {
|
|
405
434
|
name: props.name ? props.name : props.resourceData.attributes.name
|
406
435
|
}; // 基本信息设置改变
|
407
436
|
|
408
|
-
function baseInfoColChange(
|
437
|
+
function baseInfoColChange(_x6) {
|
409
438
|
return _baseInfoColChange.apply(this, arguments);
|
410
439
|
} // 获取属性信息
|
411
440
|
|
412
441
|
|
413
442
|
function _baseInfoColChange() {
|
414
|
-
_baseInfoColChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
443
|
+
_baseInfoColChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(col) {
|
415
444
|
var _col;
|
416
445
|
|
417
|
-
var infoData, attributeMap, _iterator, _step, item, value, contentTitle,
|
446
|
+
var infoData, attributeMap, _iterator, _step, item, value, contentTitle, _data, _ref3, _ref3$, _item, _attributeMap, object, _object, displayName, attr;
|
418
447
|
|
419
|
-
return _regeneratorRuntime.wrap(function
|
448
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
420
449
|
while (1) {
|
421
|
-
switch (
|
450
|
+
switch (_context6.prev = _context6.next) {
|
422
451
|
case 0:
|
423
452
|
if ((_col = col) !== null && _col !== void 0 && _col.length) {
|
424
|
-
|
453
|
+
_context6.next = 3;
|
425
454
|
break;
|
426
455
|
}
|
427
456
|
|
428
457
|
setBaseInfo([]);
|
429
|
-
return
|
458
|
+
return _context6.abrupt("return");
|
430
459
|
|
431
460
|
case 3:
|
432
461
|
settBaseInfoInitLoading(true);
|
433
462
|
infoData = [];
|
434
|
-
|
463
|
+
_context6.next = 7;
|
435
464
|
return getAttribute(id);
|
436
465
|
|
437
466
|
case 7:
|
438
|
-
attributeMap =
|
467
|
+
attributeMap = _context6.sent;
|
439
468
|
// console.log('getAttribute', attributeMap);
|
440
469
|
col = col.filter(function (item) {
|
441
470
|
return !item.hidden;
|
@@ -444,73 +473,92 @@ export default function ResourceOverview(props) {
|
|
444
473
|
|
445
474
|
case 10:
|
446
475
|
if ((_step = _iterator()).done) {
|
447
|
-
|
476
|
+
_context6.next = 26;
|
448
477
|
break;
|
449
478
|
}
|
450
479
|
|
451
480
|
item = _step.value;
|
452
481
|
value = formatMetric(attributeMap[item.dataIndex], ciTypeMeta.attributeMap[item.dataIndex]);
|
453
482
|
contentTitle = value;
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
483
|
+
return _context6.delegateYield( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
484
|
+
var link, address, owned_computer_room, owned_cabinet, roomLink, node;
|
485
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
486
|
+
while (1) {
|
487
|
+
switch (_context5.prev = _context5.next) {
|
488
|
+
case 0:
|
489
|
+
_context5.t0 = item.dataIndex;
|
490
|
+
_context5.next = _context5.t0 === 'display_name' ? 3 : _context5.t0 === 'ciName' ? 6 : _context5.t0 === 'res_address' ? 9 : _context5.t0 === 'imageName' ? 16 : 20;
|
491
|
+
break;
|
492
|
+
|
493
|
+
case 3:
|
494
|
+
// 无监控模板不能跳转详情。跳转前需判定资源实例数据属性中是否包含support_templates属性。若不包含,则不能跳转
|
495
|
+
if (attributeMap.support_templates) {
|
496
|
+
link = "/default/pagecenter/resDetail/view/" + id + "?resId=" + id + "&domainCode=" + ciTypeMeta.domain + "&title=" + attributeMap.display_name + "&ciCode=" + ciType; // 资源跳转链接
|
497
|
+
|
498
|
+
value = /*#__PURE__*/React.createElement("span", {
|
499
|
+
onClick: onClose
|
500
|
+
}, /*#__PURE__*/React.createElement(Link, {
|
501
|
+
className: styles.link,
|
502
|
+
disabled: true,
|
503
|
+
title: attributeMap.display_name || '',
|
504
|
+
to: formatUrl(link)
|
505
|
+
}, attributeMap.display_name || '-'));
|
506
|
+
} else {
|
507
|
+
value = attributeMap.display_name || '-';
|
508
|
+
}
|
509
|
+
|
510
|
+
contentTitle = attributeMap.display_name || '-';
|
511
|
+
return _context5.abrupt("break", 21);
|
512
|
+
|
513
|
+
case 6:
|
514
|
+
value = ciTypeMeta.displayName;
|
515
|
+
contentTitle = value;
|
516
|
+
return _context5.abrupt("break", 21);
|
517
|
+
|
518
|
+
case 9:
|
519
|
+
_context5.next = 11;
|
520
|
+
return getAddressFormat(attributeMap);
|
521
|
+
|
522
|
+
case 11:
|
523
|
+
address = _context5.sent;
|
524
|
+
owned_computer_room = attributeMap.owned_computer_room, owned_cabinet = attributeMap.owned_cabinet; // 跳转3D机房定位设备
|
525
|
+
|
526
|
+
if (owned_computer_room && owned_cabinet) {
|
527
|
+
// /visual/room/index_runtime.html?type=preview&room_id=00000000383e3381&rack_id=11&device_id=122
|
528
|
+
roomLink = "/visual/room/index_runtime.html?type=preview&room_id=" + owned_computer_room + "&rack_id=" + owned_cabinet + "&device_id=" + id;
|
529
|
+
value = /*#__PURE__*/React.createElement("span", {
|
530
|
+
onClick: function onClick() {
|
531
|
+
jump(roomLink, owned_computer_room);
|
532
|
+
}
|
533
|
+
}, /*#__PURE__*/React.createElement("span", {
|
534
|
+
className: styles.link,
|
535
|
+
title: address
|
536
|
+
}, address));
|
537
|
+
} else {
|
538
|
+
value = address;
|
539
|
+
}
|
540
|
+
|
541
|
+
contentTitle = address;
|
542
|
+
return _context5.abrupt("break", 21);
|
543
|
+
|
544
|
+
case 16:
|
545
|
+
node = topo.getDataModel().getDataByTag(id);
|
546
|
+
value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
|
547
|
+
contentTitle = value;
|
548
|
+
return _context5.abrupt("break", 21);
|
549
|
+
|
550
|
+
case 20:
|
551
|
+
return _context5.abrupt("break", 21);
|
552
|
+
|
553
|
+
case 21:
|
554
|
+
case "end":
|
555
|
+
return _context5.stop();
|
491
556
|
}
|
492
|
-
}
|
493
|
-
|
494
|
-
|
495
|
-
}, address));
|
496
|
-
})();
|
497
|
-
} else {
|
498
|
-
value = address;
|
499
|
-
}
|
557
|
+
}
|
558
|
+
}, _callee5);
|
559
|
+
})(), "t0", 15);
|
500
560
|
|
501
|
-
|
502
|
-
return _context4.abrupt("break", 36);
|
503
|
-
|
504
|
-
case 31:
|
505
|
-
node = topo.getDataModel().getDataByTag(id);
|
506
|
-
value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
|
507
|
-
contentTitle = value;
|
508
|
-
return _context4.abrupt("break", 36);
|
509
|
-
|
510
|
-
case 35:
|
511
|
-
return _context4.abrupt("break", 36);
|
512
|
-
|
513
|
-
case 36:
|
561
|
+
case 15:
|
514
562
|
// 拿翻译字段属性数据
|
515
563
|
if (attributeMap[item.dataIndex] && attributeMap[item.dataIndex + ".name"]) {
|
516
564
|
value = attributeMap[item.dataIndex + ".name"];
|
@@ -518,9 +566,9 @@ export default function ResourceOverview(props) {
|
|
518
566
|
}
|
519
567
|
|
520
568
|
_data = topo.attributeMetricDisplay.getData() || [];
|
521
|
-
|
569
|
+
_ref3 = [].concat(_data.filter(function (m) {
|
522
570
|
return m.id === id;
|
523
|
-
})),
|
571
|
+
})), _ref3$ = _ref3[0], _item = _ref3$ === void 0 ? {} : _ref3$;
|
524
572
|
_attributeMap = _item.attributeMap || {};
|
525
573
|
object = _attributeMap[item.dataIndex + "_object"] || {};
|
526
574
|
|
@@ -546,68 +594,68 @@ export default function ResourceOverview(props) {
|
|
546
594
|
contentTitle: contentTitle
|
547
595
|
}));
|
548
596
|
|
549
|
-
case
|
550
|
-
|
597
|
+
case 24:
|
598
|
+
_context6.next = 10;
|
551
599
|
break;
|
552
600
|
|
553
|
-
case
|
601
|
+
case 26:
|
554
602
|
settBaseInfoInitLoading(false);
|
555
603
|
setBaseInfo(infoData);
|
556
604
|
|
557
|
-
case
|
605
|
+
case 28:
|
558
606
|
case "end":
|
559
|
-
return
|
607
|
+
return _context6.stop();
|
560
608
|
}
|
561
609
|
}
|
562
|
-
},
|
610
|
+
}, _callee6);
|
563
611
|
}));
|
564
612
|
return _baseInfoColChange.apply(this, arguments);
|
565
613
|
}
|
566
614
|
|
567
|
-
function getAttribute(
|
615
|
+
function getAttribute(_x7) {
|
568
616
|
return _getAttribute.apply(this, arguments);
|
569
617
|
} // 指标设置改变
|
570
618
|
|
571
619
|
|
572
620
|
function _getAttribute() {
|
573
|
-
_getAttribute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
574
|
-
var _yield$resourceOvervi, baseInfos, res,
|
621
|
+
_getAttribute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(id) {
|
622
|
+
var _yield$resourceOvervi, baseInfos, res, _ref4, attributes;
|
575
623
|
|
576
|
-
return _regeneratorRuntime.wrap(function
|
624
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
577
625
|
while (1) {
|
578
|
-
switch (
|
626
|
+
switch (_context7.prev = _context7.next) {
|
579
627
|
case 0:
|
580
628
|
if (id) {
|
581
|
-
|
629
|
+
_context7.next = 2;
|
582
630
|
break;
|
583
631
|
}
|
584
632
|
|
585
|
-
return
|
633
|
+
return _context7.abrupt("return");
|
586
634
|
|
587
635
|
case 2:
|
588
636
|
if (!(resourceOverviewProps !== null && resourceOverviewProps !== void 0 && resourceOverviewProps.getData)) {
|
589
|
-
|
637
|
+
_context7.next = 9;
|
590
638
|
break;
|
591
639
|
}
|
592
640
|
|
593
|
-
|
641
|
+
_context7.next = 5;
|
594
642
|
return resourceOverviewProps === null || resourceOverviewProps === void 0 ? void 0 : resourceOverviewProps.getData({
|
595
643
|
id: id
|
596
644
|
});
|
597
645
|
|
598
646
|
case 5:
|
599
|
-
_yield$resourceOvervi =
|
647
|
+
_yield$resourceOvervi = _context7.sent;
|
600
648
|
baseInfos = _yield$resourceOvervi.baseInfos;
|
601
649
|
|
602
650
|
if (!baseInfos) {
|
603
|
-
|
651
|
+
_context7.next = 9;
|
604
652
|
break;
|
605
653
|
}
|
606
654
|
|
607
|
-
return
|
655
|
+
return _context7.abrupt("return", baseInfos);
|
608
656
|
|
609
657
|
case 9:
|
610
|
-
|
658
|
+
_context7.next = 11;
|
611
659
|
return service.commonQueryCiData({
|
612
660
|
condition: "id('" + id + "')",
|
613
661
|
refAttribute: true,
|
@@ -620,33 +668,33 @@ export default function ResourceOverview(props) {
|
|
620
668
|
});
|
621
669
|
|
622
670
|
case 11:
|
623
|
-
res =
|
624
|
-
|
625
|
-
return
|
671
|
+
res = _context7.sent;
|
672
|
+
_ref4 = (res === null || res === void 0 ? void 0 : res.data[0]) || {}, attributes = _ref4.attributes;
|
673
|
+
return _context7.abrupt("return", attributes || {});
|
626
674
|
|
627
675
|
case 14:
|
628
676
|
case "end":
|
629
|
-
return
|
677
|
+
return _context7.stop();
|
630
678
|
}
|
631
679
|
}
|
632
|
-
},
|
680
|
+
}, _callee7);
|
633
681
|
}));
|
634
682
|
return _getAttribute.apply(this, arguments);
|
635
683
|
}
|
636
684
|
|
637
|
-
function metricColChange(
|
685
|
+
function metricColChange(_x8) {
|
638
686
|
return _metricColChange.apply(this, arguments);
|
639
687
|
}
|
640
688
|
|
641
689
|
function _metricColChange() {
|
642
|
-
_metricColChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
690
|
+
_metricColChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(col) {
|
643
691
|
var _col2, _col3;
|
644
692
|
|
645
|
-
var codes, endTime, params,
|
693
|
+
var codes, endTime, params, _ref5, times, metricList;
|
646
694
|
|
647
|
-
return _regeneratorRuntime.wrap(function
|
695
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
648
696
|
while (1) {
|
649
|
-
switch (
|
697
|
+
switch (_context8.prev = _context8.next) {
|
650
698
|
case 0:
|
651
699
|
// console.log('metricColChange col', col);
|
652
700
|
col = (_col2 = col) === null || _col2 === void 0 ? void 0 : _col2.filter(function (item) {
|
@@ -654,13 +702,13 @@ export default function ResourceOverview(props) {
|
|
654
702
|
});
|
655
703
|
|
656
704
|
if ((_col3 = col) !== null && _col3 !== void 0 && _col3.length) {
|
657
|
-
|
705
|
+
_context8.next = 4;
|
658
706
|
break;
|
659
707
|
}
|
660
708
|
|
661
709
|
setMetric([]); // Message.error('指标未设置')
|
662
710
|
|
663
|
-
return
|
711
|
+
return _context8.abrupt("return");
|
664
712
|
|
665
713
|
case 4:
|
666
714
|
codes = col.map(function (item) {
|
@@ -676,7 +724,7 @@ export default function ResourceOverview(props) {
|
|
676
724
|
};
|
677
725
|
|
678
726
|
if (isAppTopo) {
|
679
|
-
|
727
|
+
_ref5 = resourceOverviewProps.metricProps || {}, times = _ref5.times;
|
680
728
|
|
681
729
|
if (times !== null && times !== void 0 && times.length) {
|
682
730
|
params.startTime = times[0];
|
@@ -685,11 +733,11 @@ export default function ResourceOverview(props) {
|
|
685
733
|
}
|
686
734
|
|
687
735
|
setMetricInitLoading(true);
|
688
|
-
|
736
|
+
_context8.next = 11;
|
689
737
|
return service.getMetricList(params);
|
690
738
|
|
691
739
|
case 11:
|
692
|
-
metricList =
|
740
|
+
metricList = _context8.sent;
|
693
741
|
rlog.debug('metricColChange', metricList, monitorMetricModels);
|
694
742
|
setMetric(col.map(function (item, key) {
|
695
743
|
return {
|
@@ -717,10 +765,10 @@ export default function ResourceOverview(props) {
|
|
717
765
|
|
718
766
|
case 16:
|
719
767
|
case "end":
|
720
|
-
return
|
768
|
+
return _context8.stop();
|
721
769
|
}
|
722
770
|
}
|
723
|
-
},
|
771
|
+
}, _callee8);
|
724
772
|
}));
|
725
773
|
return _metricColChange.apply(this, arguments);
|
726
774
|
}
|
@@ -54,7 +54,7 @@ var _ElementTagTipConfig = _interopRequireDefault(require("./tagstips/ElementTag
|
|
54
54
|
var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
|
55
55
|
|
56
56
|
// eslint-disable-next-line no-undef
|
57
|
-
var version = typeof "8.0.
|
57
|
+
var version = typeof "8.0.8" === 'string' ? "8.0.8" : null;
|
58
58
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
59
59
|
/**
|
60
60
|
* 拓扑显示和编辑
|