@riil-frontend/component-topology 2.7.1 → 2.7.2
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.
|
@@ -7,10 +7,11 @@ import React, { useEffect } from 'react';
|
|
|
7
7
|
import TextStyle from "../common/text/TextStyle";
|
|
8
8
|
import fontStyleUtil from "../common/text/fontStyleUtil";
|
|
9
9
|
var CollapsePanel = _Collapse.Panel;
|
|
10
|
+
var DEFAULT_TEXT_VALUE = '文本输入';
|
|
10
11
|
|
|
11
12
|
function parseValues(values) {
|
|
12
13
|
return _extends({}, values, {
|
|
13
|
-
'styleMap.text': values['styleMap.text'] ===
|
|
14
|
+
'styleMap.text': values['styleMap.text'] === DEFAULT_TEXT_VALUE ? '' : values['styleMap.text'],
|
|
14
15
|
'styleMap.textObj': {
|
|
15
16
|
color: values.styleMap['text.color'],
|
|
16
17
|
underline: values.styleMap['text.decoration'] === 'underline',
|
|
@@ -47,7 +48,7 @@ export default function TextPropertyView(props) {
|
|
|
47
48
|
|
|
48
49
|
if (values[name] !== value) {
|
|
49
50
|
if (name === 'styleMap.text' && !value) {
|
|
50
|
-
_onChange(name,
|
|
51
|
+
_onChange(name, DEFAULT_TEXT_VALUE, newValues);
|
|
51
52
|
|
|
52
53
|
return;
|
|
53
54
|
}
|
|
@@ -264,68 +264,27 @@ export default function (topoApp) {
|
|
|
264
264
|
},
|
|
265
265
|
effects: function effects(dispatch) {
|
|
266
266
|
return {
|
|
267
|
-
|
|
267
|
+
getConditions: function getConditions() {
|
|
268
268
|
var _this = this;
|
|
269
269
|
|
|
270
270
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
271
|
-
var
|
|
272
|
-
|
|
271
|
+
var data, groupTopo, resources, groups;
|
|
273
272
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
274
273
|
while (1) {
|
|
275
274
|
switch (_context.prev = _context.next) {
|
|
276
275
|
case 0:
|
|
277
|
-
|
|
278
|
-
conditions = resToConditions(resources) || {};
|
|
279
|
-
|
|
280
|
-
if (!(conditions.dynamic || conditions["static"])) {
|
|
281
|
-
_context.next = 7;
|
|
282
|
-
break;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
_context.next = 5;
|
|
286
|
-
return topoService.getResourceList(conditions);
|
|
287
|
-
|
|
288
|
-
case 5:
|
|
289
|
-
data = _context.sent;
|
|
290
|
-
|
|
291
|
-
if (index < 0) {
|
|
292
|
-
_this.updateResList(data);
|
|
293
|
-
} else {
|
|
294
|
-
_this.updateGroupResList({
|
|
295
|
-
index: index,
|
|
296
|
-
data: data
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
case 7:
|
|
301
|
-
case "end":
|
|
302
|
-
return _context.stop();
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
}, _callee);
|
|
306
|
-
}))();
|
|
307
|
-
},
|
|
308
|
-
getConditions: function getConditions() {
|
|
309
|
-
var _this2 = this;
|
|
310
|
-
|
|
311
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
312
|
-
var data, groupTopo, resources, groups;
|
|
313
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
314
|
-
while (1) {
|
|
315
|
-
switch (_context2.prev = _context2.next) {
|
|
316
|
-
case 0:
|
|
317
|
-
_context2.next = 2;
|
|
276
|
+
_context.next = 2;
|
|
318
277
|
return topoService.getConditions(topoApp.id);
|
|
319
278
|
|
|
320
279
|
case 2:
|
|
321
|
-
data =
|
|
280
|
+
data = _context.sent;
|
|
322
281
|
|
|
323
282
|
if (isAvailableArray(data)) {
|
|
324
|
-
|
|
283
|
+
_context.next = 5;
|
|
325
284
|
break;
|
|
326
285
|
}
|
|
327
286
|
|
|
328
|
-
return
|
|
287
|
+
return _context.abrupt("return");
|
|
329
288
|
|
|
330
289
|
case 5:
|
|
331
290
|
// 视图
|
|
@@ -358,28 +317,28 @@ export default function (topoApp) {
|
|
|
358
317
|
};
|
|
359
318
|
});
|
|
360
319
|
|
|
361
|
-
|
|
320
|
+
_this.update({
|
|
362
321
|
resources: resources,
|
|
363
322
|
groups: groups
|
|
364
323
|
});
|
|
365
324
|
|
|
366
325
|
case 9:
|
|
367
326
|
case "end":
|
|
368
|
-
return
|
|
327
|
+
return _context.stop();
|
|
369
328
|
}
|
|
370
329
|
}
|
|
371
|
-
},
|
|
330
|
+
}, _callee);
|
|
372
331
|
}))();
|
|
373
332
|
},
|
|
374
333
|
fetchData: function fetchData(params, rootState) {
|
|
375
|
-
var
|
|
334
|
+
var _this2 = this;
|
|
376
335
|
|
|
377
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
336
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
378
337
|
var editState, resources, _editState$groups, groups, query, data;
|
|
379
338
|
|
|
380
|
-
return _regeneratorRuntime.wrap(function
|
|
339
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
381
340
|
while (1) {
|
|
382
|
-
switch (
|
|
341
|
+
switch (_context2.prev = _context2.next) {
|
|
383
342
|
case 0:
|
|
384
343
|
editState = rootState.topoCreateMod;
|
|
385
344
|
resources = editState.resources, _editState$groups = editState.groups, groups = _editState$groups === void 0 ? [] : _editState$groups;
|
|
@@ -388,30 +347,30 @@ export default function (topoApp) {
|
|
|
388
347
|
resources: resources,
|
|
389
348
|
groups: groups
|
|
390
349
|
};
|
|
391
|
-
|
|
392
|
-
return
|
|
350
|
+
_context2.next = 5;
|
|
351
|
+
return _this2.getTopoByConditions(query);
|
|
393
352
|
|
|
394
353
|
case 5:
|
|
395
|
-
data =
|
|
396
|
-
return
|
|
354
|
+
data = _context2.sent;
|
|
355
|
+
return _context2.abrupt("return", data);
|
|
397
356
|
|
|
398
357
|
case 7:
|
|
399
358
|
case "end":
|
|
400
|
-
return
|
|
359
|
+
return _context2.stop();
|
|
401
360
|
}
|
|
402
361
|
}
|
|
403
|
-
},
|
|
362
|
+
}, _callee2);
|
|
404
363
|
}))();
|
|
405
364
|
},
|
|
406
365
|
getTopoByConditions: function getTopoByConditions(params, state) {
|
|
407
|
-
var
|
|
366
|
+
var _this3 = this;
|
|
408
367
|
|
|
409
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
368
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
410
369
|
var topoId, resources, groups, conditions, groupInfo, data, _yield$Promise$all, ciTypeMap, links, _combTopoData, topoData, resAndMetrics, topoDataTrans;
|
|
411
370
|
|
|
412
|
-
return _regeneratorRuntime.wrap(function
|
|
371
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
413
372
|
while (1) {
|
|
414
|
-
switch (
|
|
373
|
+
switch (_context3.prev = _context3.next) {
|
|
415
374
|
case 0:
|
|
416
375
|
rlog.debug('getTopoByConditions--------', params);
|
|
417
376
|
topoId = params.id, resources = params.resources, groups = params.groups;
|
|
@@ -422,17 +381,17 @@ export default function (topoApp) {
|
|
|
422
381
|
resources: resToConditions(group.resources)
|
|
423
382
|
});
|
|
424
383
|
});
|
|
425
|
-
|
|
384
|
+
_context3.next = 6;
|
|
426
385
|
return topoService.getTopoDataByResource(topoId, conditions, groupInfo);
|
|
427
386
|
|
|
428
387
|
case 6:
|
|
429
|
-
data =
|
|
388
|
+
data = _context3.sent;
|
|
430
389
|
rlog.debug('getTopoByConditions--------', data, groupInfo);
|
|
431
|
-
|
|
390
|
+
_context3.next = 10;
|
|
432
391
|
return Promise.all([topoApp.ciTyeCache.getCiTypeMap(getCiTypes(data)), getLinksDetail(data.links), dispatch.iconManage.getIcons()]);
|
|
433
392
|
|
|
434
393
|
case 10:
|
|
435
|
-
_yield$Promise$all =
|
|
394
|
+
_yield$Promise$all = _context3.sent;
|
|
436
395
|
ciTypeMap = _yield$Promise$all[0];
|
|
437
396
|
links = _yield$Promise$all[1];
|
|
438
397
|
_combTopoData = combTopoData({
|
|
@@ -445,13 +404,13 @@ export default function (topoApp) {
|
|
|
445
404
|
ciTypeMap: ciTypeMap
|
|
446
405
|
}), topoData = _combTopoData.topoData, resAndMetrics = _combTopoData.resAndMetrics;
|
|
447
406
|
|
|
448
|
-
|
|
407
|
+
_this3.update({
|
|
449
408
|
elements: topoData
|
|
450
409
|
});
|
|
451
410
|
|
|
452
411
|
topoDataTrans = transformTopoElements(topoData);
|
|
453
412
|
|
|
454
|
-
|
|
413
|
+
_this3.updateTopo(topoDataTrans); // const allCiSet = state.topoBizMod.allCiSet;
|
|
455
414
|
// rlog.debug(
|
|
456
415
|
// '新添加资源什么情况-topoData-resAndMetrics-allCiSet',
|
|
457
416
|
// topoData,
|
|
@@ -466,41 +425,41 @@ export default function (topoApp) {
|
|
|
466
425
|
// });
|
|
467
426
|
// 返回查询后的数据,便于外部获取到数据后像HT通知更新
|
|
468
427
|
|
|
469
|
-
return
|
|
428
|
+
return _context3.abrupt("return", topoDataTrans);
|
|
470
429
|
|
|
471
430
|
case 19:
|
|
472
431
|
case "end":
|
|
473
|
-
return
|
|
432
|
+
return _context3.stop();
|
|
474
433
|
}
|
|
475
434
|
}
|
|
476
|
-
},
|
|
435
|
+
}, _callee3);
|
|
477
436
|
}))();
|
|
478
437
|
},
|
|
479
438
|
saveTopo: function saveTopo(data, state) {
|
|
480
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
439
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
481
440
|
var topoId, template, layout, global, resources, groups, serialize, layoutId, conditions, groupInfo;
|
|
482
|
-
return _regeneratorRuntime.wrap(function
|
|
441
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
483
442
|
while (1) {
|
|
484
|
-
switch (
|
|
443
|
+
switch (_context4.prev = _context4.next) {
|
|
485
444
|
case 0:
|
|
486
445
|
topoId = data.id, template = data.template, layout = data.layout, global = data.global, resources = data.resources, groups = data.groups, serialize = data.serialize; // 保存布局
|
|
487
446
|
|
|
488
447
|
if (!(template && layout)) {
|
|
489
|
-
|
|
448
|
+
_context4.next = 5;
|
|
490
449
|
break;
|
|
491
450
|
}
|
|
492
451
|
|
|
493
452
|
layoutId = getLayoutId(layout);
|
|
494
|
-
|
|
453
|
+
_context4.next = 5;
|
|
495
454
|
return topoService.changeLayout(topoId, template, layoutId);
|
|
496
455
|
|
|
497
456
|
case 5:
|
|
498
457
|
if (!global) {
|
|
499
|
-
|
|
458
|
+
_context4.next = 8;
|
|
500
459
|
break;
|
|
501
460
|
}
|
|
502
461
|
|
|
503
|
-
|
|
462
|
+
_context4.next = 8;
|
|
504
463
|
return topoService.saveTopoSettings(topoId, combSaveTopoData({
|
|
505
464
|
global: global,
|
|
506
465
|
ciSetDoc: state.topoBizMod.ciSetDoc,
|
|
@@ -509,16 +468,16 @@ export default function (topoApp) {
|
|
|
509
468
|
|
|
510
469
|
case 8:
|
|
511
470
|
if (!serialize) {
|
|
512
|
-
|
|
471
|
+
_context4.next = 11;
|
|
513
472
|
break;
|
|
514
473
|
}
|
|
515
474
|
|
|
516
|
-
|
|
475
|
+
_context4.next = 11;
|
|
517
476
|
return topoService.saveSerializeData(topoId, serialize);
|
|
518
477
|
|
|
519
478
|
case 11:
|
|
520
479
|
if (!(resources || groups)) {
|
|
521
|
-
|
|
480
|
+
_context4.next = 16;
|
|
522
481
|
break;
|
|
523
482
|
}
|
|
524
483
|
|
|
@@ -529,34 +488,34 @@ export default function (topoApp) {
|
|
|
529
488
|
resources: resToConditions(group.resources, true)
|
|
530
489
|
});
|
|
531
490
|
});
|
|
532
|
-
|
|
491
|
+
_context4.next = 16;
|
|
533
492
|
return topoService.bindResourceToTopo(topoId, conditions, groupInfo);
|
|
534
493
|
|
|
535
494
|
case 16:
|
|
536
495
|
case "end":
|
|
537
|
-
return
|
|
496
|
+
return _context4.stop();
|
|
538
497
|
}
|
|
539
498
|
}
|
|
540
|
-
},
|
|
499
|
+
}, _callee4);
|
|
541
500
|
}))();
|
|
542
501
|
},
|
|
543
502
|
addToBlockList: function addToBlockList(data) {
|
|
544
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
503
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
545
504
|
var topoId, ciIdList;
|
|
546
|
-
return _regeneratorRuntime.wrap(function
|
|
505
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
547
506
|
while (1) {
|
|
548
|
-
switch (
|
|
507
|
+
switch (_context5.prev = _context5.next) {
|
|
549
508
|
case 0:
|
|
550
509
|
topoId = data.id, ciIdList = data.ciIdList;
|
|
551
|
-
|
|
510
|
+
_context5.next = 3;
|
|
552
511
|
return topoService.addToBlocklist(topoId, ciIdList);
|
|
553
512
|
|
|
554
513
|
case 3:
|
|
555
514
|
case "end":
|
|
556
|
-
return
|
|
515
|
+
return _context5.stop();
|
|
557
516
|
}
|
|
558
517
|
}
|
|
559
|
-
},
|
|
518
|
+
}, _callee5);
|
|
560
519
|
}))();
|
|
561
520
|
},
|
|
562
521
|
switchToEditMode: function switchToEditMode() {},
|
|
@@ -24,10 +24,11 @@ var _TextStyle = _interopRequireDefault(require("../common/text/TextStyle"));
|
|
|
24
24
|
var _fontStyleUtil = _interopRequireDefault(require("../common/text/fontStyleUtil"));
|
|
25
25
|
|
|
26
26
|
var CollapsePanel = _collapse["default"].Panel;
|
|
27
|
+
var DEFAULT_TEXT_VALUE = '文本输入';
|
|
27
28
|
|
|
28
29
|
function parseValues(values) {
|
|
29
30
|
return (0, _extends2["default"])({}, values, {
|
|
30
|
-
'styleMap.text': values['styleMap.text'] ===
|
|
31
|
+
'styleMap.text': values['styleMap.text'] === DEFAULT_TEXT_VALUE ? '' : values['styleMap.text'],
|
|
31
32
|
'styleMap.textObj': {
|
|
32
33
|
color: values.styleMap['text.color'],
|
|
33
34
|
underline: values.styleMap['text.decoration'] === 'underline',
|
|
@@ -64,7 +65,7 @@ function TextPropertyView(props) {
|
|
|
64
65
|
|
|
65
66
|
if (values[name] !== value) {
|
|
66
67
|
if (name === 'styleMap.text' && !value) {
|
|
67
|
-
_onChange(name,
|
|
68
|
+
_onChange(name, DEFAULT_TEXT_VALUE, newValues);
|
|
68
69
|
|
|
69
70
|
return;
|
|
70
71
|
}
|
|
@@ -278,68 +278,27 @@ function _default(topoApp) {
|
|
|
278
278
|
},
|
|
279
279
|
effects: function effects(dispatch) {
|
|
280
280
|
return {
|
|
281
|
-
|
|
281
|
+
getConditions: function getConditions() {
|
|
282
282
|
var _this = this;
|
|
283
283
|
|
|
284
284
|
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
285
|
-
var
|
|
286
|
-
|
|
285
|
+
var data, groupTopo, resources, groups;
|
|
287
286
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
288
287
|
while (1) {
|
|
289
288
|
switch (_context.prev = _context.next) {
|
|
290
289
|
case 0:
|
|
291
|
-
|
|
292
|
-
conditions = resToConditions(resources) || {};
|
|
293
|
-
|
|
294
|
-
if (!(conditions.dynamic || conditions["static"])) {
|
|
295
|
-
_context.next = 7;
|
|
296
|
-
break;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
_context.next = 5;
|
|
300
|
-
return _topo["default"].getResourceList(conditions);
|
|
301
|
-
|
|
302
|
-
case 5:
|
|
303
|
-
data = _context.sent;
|
|
304
|
-
|
|
305
|
-
if (index < 0) {
|
|
306
|
-
_this.updateResList(data);
|
|
307
|
-
} else {
|
|
308
|
-
_this.updateGroupResList({
|
|
309
|
-
index: index,
|
|
310
|
-
data: data
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
case 7:
|
|
315
|
-
case "end":
|
|
316
|
-
return _context.stop();
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
}, _callee);
|
|
320
|
-
}))();
|
|
321
|
-
},
|
|
322
|
-
getConditions: function getConditions() {
|
|
323
|
-
var _this2 = this;
|
|
324
|
-
|
|
325
|
-
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
326
|
-
var data, groupTopo, resources, groups;
|
|
327
|
-
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
328
|
-
while (1) {
|
|
329
|
-
switch (_context2.prev = _context2.next) {
|
|
330
|
-
case 0:
|
|
331
|
-
_context2.next = 2;
|
|
290
|
+
_context.next = 2;
|
|
332
291
|
return _topo["default"].getConditions(topoApp.id);
|
|
333
292
|
|
|
334
293
|
case 2:
|
|
335
|
-
data =
|
|
294
|
+
data = _context.sent;
|
|
336
295
|
|
|
337
296
|
if ((0, _utils.isAvailableArray)(data)) {
|
|
338
|
-
|
|
297
|
+
_context.next = 5;
|
|
339
298
|
break;
|
|
340
299
|
}
|
|
341
300
|
|
|
342
|
-
return
|
|
301
|
+
return _context.abrupt("return");
|
|
343
302
|
|
|
344
303
|
case 5:
|
|
345
304
|
// 视图
|
|
@@ -372,28 +331,28 @@ function _default(topoApp) {
|
|
|
372
331
|
};
|
|
373
332
|
});
|
|
374
333
|
|
|
375
|
-
|
|
334
|
+
_this.update({
|
|
376
335
|
resources: resources,
|
|
377
336
|
groups: groups
|
|
378
337
|
});
|
|
379
338
|
|
|
380
339
|
case 9:
|
|
381
340
|
case "end":
|
|
382
|
-
return
|
|
341
|
+
return _context.stop();
|
|
383
342
|
}
|
|
384
343
|
}
|
|
385
|
-
},
|
|
344
|
+
}, _callee);
|
|
386
345
|
}))();
|
|
387
346
|
},
|
|
388
347
|
fetchData: function fetchData(params, rootState) {
|
|
389
|
-
var
|
|
348
|
+
var _this2 = this;
|
|
390
349
|
|
|
391
|
-
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
350
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
392
351
|
var editState, resources, _editState$groups, groups, query, data;
|
|
393
352
|
|
|
394
|
-
return _regenerator["default"].wrap(function
|
|
353
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
395
354
|
while (1) {
|
|
396
|
-
switch (
|
|
355
|
+
switch (_context2.prev = _context2.next) {
|
|
397
356
|
case 0:
|
|
398
357
|
editState = rootState.topoCreateMod;
|
|
399
358
|
resources = editState.resources, _editState$groups = editState.groups, groups = _editState$groups === void 0 ? [] : _editState$groups;
|
|
@@ -402,30 +361,30 @@ function _default(topoApp) {
|
|
|
402
361
|
resources: resources,
|
|
403
362
|
groups: groups
|
|
404
363
|
};
|
|
405
|
-
|
|
406
|
-
return
|
|
364
|
+
_context2.next = 5;
|
|
365
|
+
return _this2.getTopoByConditions(query);
|
|
407
366
|
|
|
408
367
|
case 5:
|
|
409
|
-
data =
|
|
410
|
-
return
|
|
368
|
+
data = _context2.sent;
|
|
369
|
+
return _context2.abrupt("return", data);
|
|
411
370
|
|
|
412
371
|
case 7:
|
|
413
372
|
case "end":
|
|
414
|
-
return
|
|
373
|
+
return _context2.stop();
|
|
415
374
|
}
|
|
416
375
|
}
|
|
417
|
-
},
|
|
376
|
+
}, _callee2);
|
|
418
377
|
}))();
|
|
419
378
|
},
|
|
420
379
|
getTopoByConditions: function getTopoByConditions(params, state) {
|
|
421
|
-
var
|
|
380
|
+
var _this3 = this;
|
|
422
381
|
|
|
423
|
-
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
382
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
424
383
|
var topoId, resources, groups, conditions, groupInfo, data, _yield$Promise$all, ciTypeMap, links, _combTopoData, topoData, resAndMetrics, topoDataTrans;
|
|
425
384
|
|
|
426
|
-
return _regenerator["default"].wrap(function
|
|
385
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
427
386
|
while (1) {
|
|
428
|
-
switch (
|
|
387
|
+
switch (_context3.prev = _context3.next) {
|
|
429
388
|
case 0:
|
|
430
389
|
_rlog["default"].debug('getTopoByConditions--------', params);
|
|
431
390
|
|
|
@@ -437,19 +396,19 @@ function _default(topoApp) {
|
|
|
437
396
|
resources: resToConditions(group.resources)
|
|
438
397
|
});
|
|
439
398
|
});
|
|
440
|
-
|
|
399
|
+
_context3.next = 6;
|
|
441
400
|
return _topo["default"].getTopoDataByResource(topoId, conditions, groupInfo);
|
|
442
401
|
|
|
443
402
|
case 6:
|
|
444
|
-
data =
|
|
403
|
+
data = _context3.sent;
|
|
445
404
|
|
|
446
405
|
_rlog["default"].debug('getTopoByConditions--------', data, groupInfo);
|
|
447
406
|
|
|
448
|
-
|
|
407
|
+
_context3.next = 10;
|
|
449
408
|
return Promise.all([topoApp.ciTyeCache.getCiTypeMap((0, _topoData.getCiTypes)(data)), (0, _linkUtils.getLinksDetail)(data.links), dispatch.iconManage.getIcons()]);
|
|
450
409
|
|
|
451
410
|
case 10:
|
|
452
|
-
_yield$Promise$all =
|
|
411
|
+
_yield$Promise$all = _context3.sent;
|
|
453
412
|
ciTypeMap = _yield$Promise$all[0];
|
|
454
413
|
links = _yield$Promise$all[1];
|
|
455
414
|
_combTopoData = (0, _topoData.combTopoData)({
|
|
@@ -462,13 +421,13 @@ function _default(topoApp) {
|
|
|
462
421
|
ciTypeMap: ciTypeMap
|
|
463
422
|
}), topoData = _combTopoData.topoData, resAndMetrics = _combTopoData.resAndMetrics;
|
|
464
423
|
|
|
465
|
-
|
|
424
|
+
_this3.update({
|
|
466
425
|
elements: topoData
|
|
467
426
|
});
|
|
468
427
|
|
|
469
428
|
topoDataTrans = (0, _utils2.transformTopoElements)(topoData);
|
|
470
429
|
|
|
471
|
-
|
|
430
|
+
_this3.updateTopo(topoDataTrans); // const allCiSet = state.topoBizMod.allCiSet;
|
|
472
431
|
// rlog.debug(
|
|
473
432
|
// '新添加资源什么情况-topoData-resAndMetrics-allCiSet',
|
|
474
433
|
// topoData,
|
|
@@ -483,41 +442,41 @@ function _default(topoApp) {
|
|
|
483
442
|
// });
|
|
484
443
|
// 返回查询后的数据,便于外部获取到数据后像HT通知更新
|
|
485
444
|
|
|
486
|
-
return
|
|
445
|
+
return _context3.abrupt("return", topoDataTrans);
|
|
487
446
|
|
|
488
447
|
case 19:
|
|
489
448
|
case "end":
|
|
490
|
-
return
|
|
449
|
+
return _context3.stop();
|
|
491
450
|
}
|
|
492
451
|
}
|
|
493
|
-
},
|
|
452
|
+
}, _callee3);
|
|
494
453
|
}))();
|
|
495
454
|
},
|
|
496
455
|
saveTopo: function saveTopo(data, state) {
|
|
497
|
-
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
456
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
|
498
457
|
var topoId, template, layout, global, resources, groups, serialize, layoutId, conditions, groupInfo;
|
|
499
|
-
return _regenerator["default"].wrap(function
|
|
458
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
500
459
|
while (1) {
|
|
501
|
-
switch (
|
|
460
|
+
switch (_context4.prev = _context4.next) {
|
|
502
461
|
case 0:
|
|
503
462
|
topoId = data.id, template = data.template, layout = data.layout, global = data.global, resources = data.resources, groups = data.groups, serialize = data.serialize; // 保存布局
|
|
504
463
|
|
|
505
464
|
if (!(template && layout)) {
|
|
506
|
-
|
|
465
|
+
_context4.next = 5;
|
|
507
466
|
break;
|
|
508
467
|
}
|
|
509
468
|
|
|
510
469
|
layoutId = getLayoutId(layout);
|
|
511
|
-
|
|
470
|
+
_context4.next = 5;
|
|
512
471
|
return _topo["default"].changeLayout(topoId, template, layoutId);
|
|
513
472
|
|
|
514
473
|
case 5:
|
|
515
474
|
if (!global) {
|
|
516
|
-
|
|
475
|
+
_context4.next = 8;
|
|
517
476
|
break;
|
|
518
477
|
}
|
|
519
478
|
|
|
520
|
-
|
|
479
|
+
_context4.next = 8;
|
|
521
480
|
return _topo["default"].saveTopoSettings(topoId, (0, _topoData.combSaveTopoData)({
|
|
522
481
|
global: global,
|
|
523
482
|
ciSetDoc: state.topoBizMod.ciSetDoc,
|
|
@@ -526,16 +485,16 @@ function _default(topoApp) {
|
|
|
526
485
|
|
|
527
486
|
case 8:
|
|
528
487
|
if (!serialize) {
|
|
529
|
-
|
|
488
|
+
_context4.next = 11;
|
|
530
489
|
break;
|
|
531
490
|
}
|
|
532
491
|
|
|
533
|
-
|
|
492
|
+
_context4.next = 11;
|
|
534
493
|
return _topo["default"].saveSerializeData(topoId, serialize);
|
|
535
494
|
|
|
536
495
|
case 11:
|
|
537
496
|
if (!(resources || groups)) {
|
|
538
|
-
|
|
497
|
+
_context4.next = 16;
|
|
539
498
|
break;
|
|
540
499
|
}
|
|
541
500
|
|
|
@@ -546,34 +505,34 @@ function _default(topoApp) {
|
|
|
546
505
|
resources: resToConditions(group.resources, true)
|
|
547
506
|
});
|
|
548
507
|
});
|
|
549
|
-
|
|
508
|
+
_context4.next = 16;
|
|
550
509
|
return _topo["default"].bindResourceToTopo(topoId, conditions, groupInfo);
|
|
551
510
|
|
|
552
511
|
case 16:
|
|
553
512
|
case "end":
|
|
554
|
-
return
|
|
513
|
+
return _context4.stop();
|
|
555
514
|
}
|
|
556
515
|
}
|
|
557
|
-
},
|
|
516
|
+
}, _callee4);
|
|
558
517
|
}))();
|
|
559
518
|
},
|
|
560
519
|
addToBlockList: function addToBlockList(data) {
|
|
561
|
-
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
520
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
|
562
521
|
var topoId, ciIdList;
|
|
563
|
-
return _regenerator["default"].wrap(function
|
|
522
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
564
523
|
while (1) {
|
|
565
|
-
switch (
|
|
524
|
+
switch (_context5.prev = _context5.next) {
|
|
566
525
|
case 0:
|
|
567
526
|
topoId = data.id, ciIdList = data.ciIdList;
|
|
568
|
-
|
|
527
|
+
_context5.next = 3;
|
|
569
528
|
return _topo["default"].addToBlocklist(topoId, ciIdList);
|
|
570
529
|
|
|
571
530
|
case 3:
|
|
572
531
|
case "end":
|
|
573
|
-
return
|
|
532
|
+
return _context5.stop();
|
|
574
533
|
}
|
|
575
534
|
}
|
|
576
|
-
},
|
|
535
|
+
}, _callee5);
|
|
577
536
|
}))();
|
|
578
537
|
},
|
|
579
538
|
switchToEditMode: function switchToEditMode() {},
|