@riil-frontend/component-topology 2.12.2 → 2.12.3
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/1.js +2 -2
- package/build/2.js +1 -1
- package/build/index.css +1 -1
- package/build/index.js +20 -20
- package/es/components/MultiResourceDrawer/index.js +3 -2
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +1 -0
- package/es/components/ResourceSelectDrawer/ResourceSelectList.js +6 -1
- package/es/components/SingleResourceDrawer/SelectDrawer.js +54 -0
- package/es/components/SingleResourceDrawer/index.js +3 -3
- package/es/core/common/icons/defaultIcons.js +9 -2
- package/es/core/components/TopoView/topoView.js +1 -1
- package/es/core/editor/components/settings/Settings.js +5 -29
- package/es/core/editor/components/settings/{group → common}/GroupNodeList/ResourceList.js +0 -0
- package/es/core/editor/components/settings/{group → common}/GroupNodeList/ResourceList.module.scss +0 -0
- package/es/core/editor/components/settings/{group → common}/GroupNodeList/ResourceSelectButton.js +12 -14
- package/es/core/editor/components/settings/{group → common}/GroupNodeList/icon.js +0 -0
- package/es/core/editor/components/settings/group/DataTab/GroupNodeList.js +19 -0
- package/es/core/editor/components/settings/group/DataTab/RelateData.js +45 -0
- package/es/core/editor/components/settings/group/GroupPropertyView.js +44 -0
- package/es/core/editor/components/settings/group/GroupPropertyView.module.scss +3 -0
- package/es/core/editor/components/settings/group/SettingTab/GroupExpandSetting.js +27 -0
- package/es/core/editor/components/settings/group/SettingTab/NodeIconSelect.js +32 -0
- package/es/core/editor/components/settings/group/SettingTab/Setting.js +86 -0
- package/es/core/editor/components/settings/group/hooks/useGroup.js +9 -0
- package/es/core/editor/components/settings/group/hooks/useGroupExpand.js +20 -0
- package/es/core/editor/components/settings/layer/LayerSettingsForm.js +2 -2
- package/es/core/editor/components/settings/{group/GroupNodeList/GroupNodeList.js → layer/NodeList.js} +3 -3
- package/es/core/editor/components/settings/link/LinkPropertyView.js +3 -3
- package/es/core/editor/components/settings/node/NodeIconSelect.js +1 -1
- package/es/core/editor/components/settings/propertyViews.js +23 -0
- package/es/hooks/useTopoEdit.js +138 -102
- package/es/style.js +2 -2
- package/es/utils/htElementUtils.js +16 -7
- package/lib/components/MultiResourceDrawer/index.js +3 -2
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +1 -0
- package/lib/components/ResourceSelectDrawer/ResourceSelectList.js +6 -1
- package/lib/components/SingleResourceDrawer/SelectDrawer.js +68 -0
- package/lib/components/SingleResourceDrawer/index.js +3 -3
- package/lib/core/common/icons/defaultIcons.js +11 -2
- package/lib/core/components/TopoView/topoView.js +1 -1
- package/lib/core/editor/components/settings/Settings.js +5 -34
- package/lib/core/editor/components/settings/{group → common}/GroupNodeList/ResourceList.js +0 -0
- package/lib/core/editor/components/settings/{group → common}/GroupNodeList/ResourceList.module.scss +0 -0
- package/lib/core/editor/components/settings/{group → common}/GroupNodeList/ResourceSelectButton.js +13 -14
- package/lib/core/editor/components/settings/{group → common}/GroupNodeList/icon.js +0 -0
- package/lib/core/editor/components/settings/group/DataTab/GroupNodeList.js +33 -0
- package/lib/core/editor/components/settings/group/DataTab/RelateData.js +57 -0
- package/lib/core/editor/components/settings/group/GroupPropertyView.js +58 -0
- package/lib/core/editor/components/settings/group/GroupPropertyView.module.scss +3 -0
- package/lib/core/editor/components/settings/group/SettingTab/GroupExpandSetting.js +37 -0
- package/lib/core/editor/components/settings/group/SettingTab/NodeIconSelect.js +45 -0
- package/lib/core/editor/components/settings/group/SettingTab/Setting.js +106 -0
- package/lib/core/editor/components/settings/group/hooks/useGroup.js +15 -0
- package/lib/core/editor/components/settings/group/hooks/useGroupExpand.js +26 -0
- package/lib/core/editor/components/settings/layer/LayerSettingsForm.js +3 -3
- package/lib/core/editor/components/settings/{group/GroupNodeList/GroupNodeList.js → layer/NodeList.js} +3 -3
- package/lib/core/editor/components/settings/link/LinkPropertyView.js +3 -3
- package/lib/core/editor/components/settings/node/NodeIconSelect.js +1 -1
- package/lib/core/editor/components/settings/propertyViews.js +38 -0
- package/lib/hooks/useTopoEdit.js +139 -102
- package/lib/style.js +2 -2
- package/lib/utils/htElementUtils.js +22 -7
- package/package.json +9 -9
- package/CHANGELOG.md +0 -26
|
@@ -9,11 +9,11 @@ exports["default"] = GroupNodeList;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
|
-
var _ResourceList = _interopRequireDefault(require("
|
|
12
|
+
var _ResourceList = _interopRequireDefault(require("../common/GroupNodeList/ResourceList"));
|
|
13
13
|
|
|
14
|
-
var _htElementUtils = require("
|
|
14
|
+
var _htElementUtils = require("../../../../../utils/htElementUtils");
|
|
15
15
|
|
|
16
|
-
var _icon = require("
|
|
16
|
+
var _icon = require("../common/GroupNodeList/icon");
|
|
17
17
|
|
|
18
18
|
function GroupNodeList(props) {
|
|
19
19
|
var topo = props.topo,
|
|
@@ -29,11 +29,11 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
29
29
|
|
|
30
30
|
var _ColorPicker = _interopRequireDefault(require("../../LinkDynamicStyleSettingDrawer/rule/ColorPicker"));
|
|
31
31
|
|
|
32
|
-
var _GroupNodeList = _interopRequireDefault(require("../group/
|
|
32
|
+
var _GroupNodeList = _interopRequireDefault(require("../group/DataTab/GroupNodeList"));
|
|
33
33
|
|
|
34
|
-
var _ResourceSelectButton = _interopRequireDefault(require("../
|
|
34
|
+
var _ResourceSelectButton = _interopRequireDefault(require("../common/GroupNodeList/ResourceSelectButton"));
|
|
35
35
|
|
|
36
|
-
var _icon = require("../
|
|
36
|
+
var _icon = require("../common/GroupNodeList/icon");
|
|
37
37
|
|
|
38
38
|
var _LineType = _interopRequireDefault(require("../common/LineType"));
|
|
39
39
|
|
|
@@ -7,7 +7,7 @@ exports["default"] = NodeIconSelect;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var _icon = require("../
|
|
10
|
+
var _icon = require("../common/GroupNodeList/icon");
|
|
11
11
|
|
|
12
12
|
var _componentTopoIconSelect = _interopRequireDefault(require("@riil-frontend/component-topo-icon-select"));
|
|
13
13
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _SettingsForm = _interopRequireDefault(require("./SettingsForm"));
|
|
9
|
+
|
|
10
|
+
var _NodePropertyView = _interopRequireDefault(require("./node/NodePropertyView"));
|
|
11
|
+
|
|
12
|
+
var _LayerSettingsForm = _interopRequireDefault(require("./layer/LayerSettingsForm"));
|
|
13
|
+
|
|
14
|
+
var _TextPropertyView = _interopRequireDefault(require("./text/TextPropertyView"));
|
|
15
|
+
|
|
16
|
+
var _LinkPropertyView = _interopRequireDefault(require("./link/LinkPropertyView"));
|
|
17
|
+
|
|
18
|
+
var _ViewPropertyView = _interopRequireDefault(require("./view/ViewPropertyView"));
|
|
19
|
+
|
|
20
|
+
var _GroupPropertyView = _interopRequireDefault(require("./group/GroupPropertyView"));
|
|
21
|
+
|
|
22
|
+
var propertyPanelMap = {
|
|
23
|
+
// view: SettingsForm,
|
|
24
|
+
node: _NodePropertyView["default"],
|
|
25
|
+
layer: _LayerSettingsForm["default"],
|
|
26
|
+
text: _TextPropertyView["default"],
|
|
27
|
+
group: _GroupPropertyView["default"]
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
if (localStorage.getItem('topo.debug') === 'true') {
|
|
31
|
+
Object.assign(propertyPanelMap, {
|
|
32
|
+
line: _LinkPropertyView["default"],
|
|
33
|
+
view: _ViewPropertyView["default"]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
var _default = propertyPanelMap;
|
|
38
|
+
exports["default"] = _default;
|
package/lib/hooks/useTopoEdit.js
CHANGED
|
@@ -35,6 +35,8 @@ var _template = require("../utils/template");
|
|
|
35
35
|
|
|
36
36
|
var _topoPermissionUtil = _interopRequireDefault(require("../utils/topoPermissionUtil"));
|
|
37
37
|
|
|
38
|
+
var _htElementUtils = require("../utils/htElementUtils");
|
|
39
|
+
|
|
38
40
|
var useTopoEdit = function useTopoEdit(params) {
|
|
39
41
|
var topoApp = params.topoApp,
|
|
40
42
|
topoId = params.topoId,
|
|
@@ -91,6 +93,10 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
91
93
|
deletedNodes = _useDynamicList.list,
|
|
92
94
|
addDeletedNode = _useDynamicList.push,
|
|
93
95
|
clearDeletedNodes = _useDynamicList.resetList;
|
|
96
|
+
/**
|
|
97
|
+
* 拓扑图全局已选固定资源
|
|
98
|
+
*/
|
|
99
|
+
|
|
94
100
|
|
|
95
101
|
var resSelections = (0, _react.useMemo)(function () {
|
|
96
102
|
var sel = staticRes.selected && staticRes.data || [];
|
|
@@ -213,9 +219,9 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
213
219
|
id = _ref4.id;
|
|
214
220
|
|
|
215
221
|
if (!(0, _utils.isNull)(id)) {
|
|
216
|
-
setSingleResKey(
|
|
222
|
+
setSingleResKey(id);
|
|
217
223
|
} else {
|
|
218
|
-
setSingleResKey(
|
|
224
|
+
setSingleResKey(null);
|
|
219
225
|
}
|
|
220
226
|
|
|
221
227
|
setShowSingleResDrawer(true);
|
|
@@ -339,9 +345,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
339
345
|
var id = data.id,
|
|
340
346
|
tag = data.tag; // 新加的容器 tag 格式为 group_${id}
|
|
341
347
|
|
|
342
|
-
var group = topoApp.getDataModel().getDataById(tag) || topoApp.getDataModel().getDataByTag(id) ||
|
|
343
|
-
return item.a('tag') === tag;
|
|
344
|
-
})[0];
|
|
348
|
+
var group = topoApp.getDataModel().getDataById(tag) || topoApp.getDataModel().getDataByTag(id) || (0, _htElementUtils.getGroupElementByTag)(topoApp.getDataModel(), tag);
|
|
345
349
|
|
|
346
350
|
if (!group) {
|
|
347
351
|
return;
|
|
@@ -491,11 +495,11 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
491
495
|
|
|
492
496
|
|
|
493
497
|
function _bindGroupResourcesConfig() {
|
|
494
|
-
_bindGroupResourcesConfig = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
498
|
+
_bindGroupResourcesConfig = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(group, data) {
|
|
495
499
|
var id, tag, name, index, newGroup;
|
|
496
|
-
return _regenerator["default"].wrap(function
|
|
500
|
+
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
497
501
|
while (1) {
|
|
498
|
-
switch (
|
|
502
|
+
switch (_context6.prev = _context6.next) {
|
|
499
503
|
case 0:
|
|
500
504
|
id = group.id, tag = group.tag, name = group.name;
|
|
501
505
|
index = findGroupIndex(groups, {
|
|
@@ -504,18 +508,18 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
504
508
|
});
|
|
505
509
|
|
|
506
510
|
if (!(index > -1)) {
|
|
507
|
-
|
|
511
|
+
_context6.next = 7;
|
|
508
512
|
break;
|
|
509
513
|
}
|
|
510
514
|
|
|
511
|
-
|
|
515
|
+
_context6.next = 5;
|
|
512
516
|
return editDispatchers.updateGroupResourcesByIndex({
|
|
513
517
|
index: index,
|
|
514
518
|
resources: data
|
|
515
519
|
});
|
|
516
520
|
|
|
517
521
|
case 5:
|
|
518
|
-
|
|
522
|
+
_context6.next = 8;
|
|
519
523
|
break;
|
|
520
524
|
|
|
521
525
|
case 7:
|
|
@@ -531,10 +535,10 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
531
535
|
|
|
532
536
|
case 8:
|
|
533
537
|
case "end":
|
|
534
|
-
return
|
|
538
|
+
return _context6.stop();
|
|
535
539
|
}
|
|
536
540
|
}
|
|
537
|
-
},
|
|
541
|
+
}, _callee6);
|
|
538
542
|
}));
|
|
539
543
|
return _bindGroupResourcesConfig.apply(this, arguments);
|
|
540
544
|
}
|
|
@@ -548,27 +552,26 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
548
552
|
|
|
549
553
|
|
|
550
554
|
function _bindGroupResources() {
|
|
551
|
-
_bindGroupResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
555
|
+
_bindGroupResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(group, data) {
|
|
552
556
|
var id, tag, _yield$editDispatcher, elements, groupElement;
|
|
553
557
|
|
|
554
|
-
return _regenerator["default"].wrap(function
|
|
558
|
+
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
|
555
559
|
while (1) {
|
|
556
|
-
switch (
|
|
560
|
+
switch (_context7.prev = _context7.next) {
|
|
557
561
|
case 0:
|
|
558
562
|
id = group.id, tag = group.tag;
|
|
559
|
-
|
|
563
|
+
_context7.next = 3;
|
|
560
564
|
return bindGroupResourcesConfig(group, data);
|
|
561
565
|
|
|
562
566
|
case 3:
|
|
563
|
-
|
|
567
|
+
_context7.next = 5;
|
|
564
568
|
return editDispatchers.refreshDataByConfig();
|
|
565
569
|
|
|
566
570
|
case 5:
|
|
567
|
-
_yield$editDispatcher =
|
|
571
|
+
_yield$editDispatcher = _context7.sent;
|
|
568
572
|
elements = _yield$editDispatcher.topoDataTrans;
|
|
569
|
-
debugger;
|
|
570
573
|
|
|
571
|
-
_rlog["default"].debug('
|
|
574
|
+
_rlog["default"].debug('bindGroupResources--id, tag', id, tag);
|
|
572
575
|
|
|
573
576
|
if (id) {
|
|
574
577
|
groupElement = (0, _format.filterGroupById)(elements, id);
|
|
@@ -582,12 +585,12 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
582
585
|
|
|
583
586
|
setFocusedGroup(null);
|
|
584
587
|
|
|
585
|
-
case
|
|
588
|
+
case 11:
|
|
586
589
|
case "end":
|
|
587
|
-
return
|
|
590
|
+
return _context7.stop();
|
|
588
591
|
}
|
|
589
592
|
}
|
|
590
|
-
},
|
|
593
|
+
}, _callee7);
|
|
591
594
|
}));
|
|
592
595
|
return _bindGroupResources.apply(this, arguments);
|
|
593
596
|
}
|
|
@@ -597,31 +600,31 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
597
600
|
}
|
|
598
601
|
|
|
599
602
|
function _bindViewResources() {
|
|
600
|
-
_bindViewResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
603
|
+
_bindViewResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(data) {
|
|
601
604
|
var _yield$editDispatcher2, elements;
|
|
602
605
|
|
|
603
|
-
return _regenerator["default"].wrap(function
|
|
606
|
+
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
|
604
607
|
while (1) {
|
|
605
|
-
switch (
|
|
608
|
+
switch (_context8.prev = _context8.next) {
|
|
606
609
|
case 0:
|
|
607
|
-
|
|
610
|
+
_context8.next = 2;
|
|
608
611
|
return editDispatchers.updateViewResources(data);
|
|
609
612
|
|
|
610
613
|
case 2:
|
|
611
|
-
|
|
614
|
+
_context8.next = 4;
|
|
612
615
|
return editDispatchers.refreshDataByConfig();
|
|
613
616
|
|
|
614
617
|
case 4:
|
|
615
|
-
_yield$editDispatcher2 =
|
|
618
|
+
_yield$editDispatcher2 = _context8.sent;
|
|
616
619
|
elements = _yield$editDispatcher2.topoDataTrans;
|
|
617
620
|
saveBind(_componentTopologyGraph.TopoEvent.DATA_TYPE_RESOURCE_COMBO, elements);
|
|
618
621
|
|
|
619
622
|
case 7:
|
|
620
623
|
case "end":
|
|
621
|
-
return
|
|
624
|
+
return _context8.stop();
|
|
622
625
|
}
|
|
623
626
|
}
|
|
624
|
-
},
|
|
627
|
+
}, _callee8);
|
|
625
628
|
}));
|
|
626
629
|
return _bindViewResources.apply(this, arguments);
|
|
627
630
|
}
|
|
@@ -631,12 +634,12 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
631
634
|
}
|
|
632
635
|
|
|
633
636
|
function _addResourceToFirstLayer() {
|
|
634
|
-
_addResourceToFirstLayer = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
637
|
+
_addResourceToFirstLayer = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(data) {
|
|
635
638
|
var group, config, _yield$editDispatcher3, topoData;
|
|
636
639
|
|
|
637
|
-
return _regenerator["default"].wrap(function
|
|
640
|
+
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
|
638
641
|
while (1) {
|
|
639
|
-
switch (
|
|
642
|
+
switch (_context9.prev = _context9.next) {
|
|
640
643
|
case 0:
|
|
641
644
|
group = groups[0];
|
|
642
645
|
config = {
|
|
@@ -650,50 +653,84 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
650
653
|
data: [].concat(group.resources["static"].data, data)
|
|
651
654
|
}
|
|
652
655
|
};
|
|
653
|
-
|
|
656
|
+
_context9.next = 4;
|
|
654
657
|
return bindGroupResourcesConfig(group, config);
|
|
655
658
|
|
|
656
659
|
case 4:
|
|
657
|
-
|
|
660
|
+
_context9.next = 6;
|
|
658
661
|
return editDispatchers.refreshDataByConfig();
|
|
659
662
|
|
|
660
663
|
case 6:
|
|
661
|
-
_yield$editDispatcher3 =
|
|
664
|
+
_yield$editDispatcher3 = _context9.sent;
|
|
662
665
|
topoData = _yield$editDispatcher3.topoData;
|
|
663
666
|
topoApp.updateElements(topoData);
|
|
664
667
|
|
|
665
668
|
case 9:
|
|
666
669
|
case "end":
|
|
667
|
-
return
|
|
670
|
+
return _context9.stop();
|
|
668
671
|
}
|
|
669
672
|
}
|
|
670
|
-
},
|
|
673
|
+
}, _callee9);
|
|
671
674
|
}));
|
|
672
675
|
return _addResourceToFirstLayer.apply(this, arguments);
|
|
673
676
|
}
|
|
674
677
|
|
|
675
|
-
var onSaveComboRes = function
|
|
676
|
-
|
|
678
|
+
var onSaveComboRes = /*#__PURE__*/function () {
|
|
679
|
+
var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(data) {
|
|
680
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
681
|
+
while (1) {
|
|
682
|
+
switch (_context3.prev = _context3.next) {
|
|
683
|
+
case 0:
|
|
684
|
+
_rlog["default"].debug('关联资源-----onSaveComboRes', data, focusedGroup);
|
|
677
685
|
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
// 分层拓扑,添加到第一层
|
|
686
|
-
addResourceToFirstLayer(data);
|
|
687
|
-
}
|
|
688
|
-
};
|
|
686
|
+
if (!(topoShowType === 'layers')) {
|
|
687
|
+
_context3.next = 6;
|
|
688
|
+
break;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
_context3.next = 4;
|
|
692
|
+
return addResourceToFirstLayer(data);
|
|
689
693
|
|
|
690
|
-
|
|
691
|
-
|
|
694
|
+
case 4:
|
|
695
|
+
_context3.next = 13;
|
|
696
|
+
break;
|
|
697
|
+
|
|
698
|
+
case 6:
|
|
699
|
+
if (!focusedGroup) {
|
|
700
|
+
_context3.next = 11;
|
|
701
|
+
break;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
_context3.next = 9;
|
|
705
|
+
return bindGroupResources(focusedGroup, data);
|
|
706
|
+
|
|
707
|
+
case 9:
|
|
708
|
+
_context3.next = 13;
|
|
709
|
+
break;
|
|
710
|
+
|
|
711
|
+
case 11:
|
|
712
|
+
_context3.next = 13;
|
|
713
|
+
return bindViewResources(data);
|
|
714
|
+
|
|
715
|
+
case 13:
|
|
716
|
+
case "end":
|
|
717
|
+
return _context3.stop();
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
}, _callee3);
|
|
721
|
+
}));
|
|
722
|
+
|
|
723
|
+
return function onSaveComboRes(_x7) {
|
|
724
|
+
return _ref5.apply(this, arguments);
|
|
725
|
+
};
|
|
726
|
+
}();
|
|
727
|
+
|
|
728
|
+
var onSaveSingleRes = function onSaveSingleRes(selectedResKey) {
|
|
729
|
+
_rlog["default"].debug('onSaveSingleRes', selectedResKey);
|
|
692
730
|
|
|
693
|
-
var selectedRes = resource[0];
|
|
694
731
|
var selected = staticRes.selected,
|
|
695
732
|
data = staticRes.data;
|
|
696
|
-
var exist = data.indexOf(
|
|
733
|
+
var exist = data.indexOf(selectedResKey) !== -1;
|
|
697
734
|
|
|
698
735
|
if (selected && exist) {
|
|
699
736
|
// 资源已被选
|
|
@@ -705,15 +742,15 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
705
742
|
|
|
706
743
|
if (singleResKey) {
|
|
707
744
|
list = list.filter(function (item) {
|
|
708
|
-
return item !== singleResKey
|
|
745
|
+
return item !== singleResKey;
|
|
709
746
|
});
|
|
710
747
|
}
|
|
711
748
|
|
|
712
749
|
if (!exist) {
|
|
713
|
-
list =
|
|
750
|
+
list = [].concat(list, [selectedResKey]);
|
|
714
751
|
}
|
|
715
752
|
|
|
716
|
-
setSingleResKey(
|
|
753
|
+
setSingleResKey(selectedResKey);
|
|
717
754
|
editDispatchers.updateResources({
|
|
718
755
|
"static": {
|
|
719
756
|
selected: true,
|
|
@@ -724,32 +761,32 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
724
761
|
}
|
|
725
762
|
};
|
|
726
763
|
|
|
727
|
-
function checkSavePermission(
|
|
764
|
+
function checkSavePermission(_x8) {
|
|
728
765
|
return _checkSavePermission.apply(this, arguments);
|
|
729
766
|
}
|
|
730
767
|
|
|
731
768
|
function _checkSavePermission() {
|
|
732
|
-
_checkSavePermission = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
769
|
+
_checkSavePermission = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(id) {
|
|
733
770
|
var permission;
|
|
734
|
-
return _regenerator["default"].wrap(function
|
|
771
|
+
return _regenerator["default"].wrap(function _callee10$(_context10) {
|
|
735
772
|
while (1) {
|
|
736
|
-
switch (
|
|
773
|
+
switch (_context10.prev = _context10.next) {
|
|
737
774
|
case 0:
|
|
738
|
-
|
|
775
|
+
_context10.next = 2;
|
|
739
776
|
return topoDispatchers.getTopoPermission({
|
|
740
777
|
id: id,
|
|
741
778
|
update: false
|
|
742
779
|
});
|
|
743
780
|
|
|
744
781
|
case 2:
|
|
745
|
-
permission =
|
|
782
|
+
permission = _context10.sent;
|
|
746
783
|
|
|
747
784
|
if (!_topoPermissionUtil["default"].isEditable(permission)) {
|
|
748
|
-
|
|
785
|
+
_context10.next = 5;
|
|
749
786
|
break;
|
|
750
787
|
}
|
|
751
788
|
|
|
752
|
-
return
|
|
789
|
+
return _context10.abrupt("return", true);
|
|
753
790
|
|
|
754
791
|
case 5:
|
|
755
792
|
_dialog["default"].alert({
|
|
@@ -761,43 +798,43 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
761
798
|
onOk: function onOk() {}
|
|
762
799
|
});
|
|
763
800
|
|
|
764
|
-
return
|
|
801
|
+
return _context10.abrupt("return", false);
|
|
765
802
|
|
|
766
803
|
case 7:
|
|
767
804
|
case "end":
|
|
768
|
-
return
|
|
805
|
+
return _context10.stop();
|
|
769
806
|
}
|
|
770
807
|
}
|
|
771
|
-
},
|
|
808
|
+
}, _callee10);
|
|
772
809
|
}));
|
|
773
810
|
return _checkSavePermission.apply(this, arguments);
|
|
774
811
|
}
|
|
775
812
|
|
|
776
813
|
var onSaveTopo = /*#__PURE__*/function () {
|
|
777
|
-
var
|
|
814
|
+
var _ref6 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(data) {
|
|
778
815
|
var id, config, global, serialize, saveConfig, valid, _config$layout2, template, layout;
|
|
779
816
|
|
|
780
|
-
return _regenerator["default"].wrap(function
|
|
817
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
781
818
|
while (1) {
|
|
782
|
-
switch (
|
|
819
|
+
switch (_context5.prev = _context5.next) {
|
|
783
820
|
case 0:
|
|
784
821
|
id = data.id, config = data.config, global = data.global, serialize = data.serialize;
|
|
785
822
|
|
|
786
823
|
if (!onSave) {
|
|
787
|
-
|
|
824
|
+
_context5.next = 5;
|
|
788
825
|
break;
|
|
789
826
|
}
|
|
790
827
|
|
|
791
828
|
saveConfig = /*#__PURE__*/function () {
|
|
792
|
-
var
|
|
829
|
+
var _ref7 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
|
793
830
|
var _config$layout, template, layout;
|
|
794
831
|
|
|
795
|
-
return _regenerator["default"].wrap(function
|
|
832
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
796
833
|
while (1) {
|
|
797
|
-
switch (
|
|
834
|
+
switch (_context4.prev = _context4.next) {
|
|
798
835
|
case 0:
|
|
799
836
|
_config$layout = config === null || config === void 0 ? void 0 : config.layout, template = _config$layout.type, layout = _config$layout.layout;
|
|
800
|
-
|
|
837
|
+
_context4.next = 3;
|
|
801
838
|
return editDispatchers.saveTopo({
|
|
802
839
|
id: id,
|
|
803
840
|
template: template,
|
|
@@ -808,14 +845,14 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
808
845
|
|
|
809
846
|
case 3:
|
|
810
847
|
case "end":
|
|
811
|
-
return
|
|
848
|
+
return _context4.stop();
|
|
812
849
|
}
|
|
813
850
|
}
|
|
814
|
-
},
|
|
851
|
+
}, _callee4);
|
|
815
852
|
}));
|
|
816
853
|
|
|
817
854
|
return function saveConfig() {
|
|
818
|
-
return
|
|
855
|
+
return _ref7.apply(this, arguments);
|
|
819
856
|
};
|
|
820
857
|
}();
|
|
821
858
|
|
|
@@ -823,7 +860,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
823
860
|
data: data,
|
|
824
861
|
saveConfig: saveConfig
|
|
825
862
|
});
|
|
826
|
-
return
|
|
863
|
+
return _context5.abrupt("return");
|
|
827
864
|
|
|
828
865
|
case 5:
|
|
829
866
|
// TODO 以下逻辑移到拓扑中心
|
|
@@ -831,26 +868,26 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
831
868
|
saving: true
|
|
832
869
|
}); // 检查权限
|
|
833
870
|
|
|
834
|
-
|
|
871
|
+
_context5.next = 8;
|
|
835
872
|
return checkSavePermission(id);
|
|
836
873
|
|
|
837
874
|
case 8:
|
|
838
|
-
valid =
|
|
875
|
+
valid = _context5.sent;
|
|
839
876
|
|
|
840
877
|
if (valid) {
|
|
841
|
-
|
|
878
|
+
_context5.next = 12;
|
|
842
879
|
break;
|
|
843
880
|
}
|
|
844
881
|
|
|
845
882
|
topoEditDispatchers.update({
|
|
846
883
|
saving: false
|
|
847
884
|
});
|
|
848
|
-
return
|
|
885
|
+
return _context5.abrupt("return");
|
|
849
886
|
|
|
850
887
|
case 12:
|
|
851
888
|
// 保存
|
|
852
889
|
_config$layout2 = config === null || config === void 0 ? void 0 : config.layout, template = _config$layout2.type, layout = _config$layout2.layout;
|
|
853
|
-
|
|
890
|
+
_context5.next = 15;
|
|
854
891
|
return editDispatchers.saveTopo({
|
|
855
892
|
id: id,
|
|
856
893
|
template: template,
|
|
@@ -862,7 +899,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
862
899
|
});
|
|
863
900
|
|
|
864
901
|
case 15:
|
|
865
|
-
|
|
902
|
+
_context5.next = 17;
|
|
866
903
|
return editDispatchers.addToBlockList({
|
|
867
904
|
id: topoId,
|
|
868
905
|
ciIdList: deletedNodes
|
|
@@ -879,14 +916,14 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
879
916
|
|
|
880
917
|
case 20:
|
|
881
918
|
case "end":
|
|
882
|
-
return
|
|
919
|
+
return _context5.stop();
|
|
883
920
|
}
|
|
884
921
|
}
|
|
885
|
-
},
|
|
922
|
+
}, _callee5);
|
|
886
923
|
}));
|
|
887
924
|
|
|
888
|
-
return function onSaveTopo(
|
|
889
|
-
return
|
|
925
|
+
return function onSaveTopo(_x9) {
|
|
926
|
+
return _ref6.apply(this, arguments);
|
|
890
927
|
};
|
|
891
928
|
}();
|
|
892
929
|
|
|
@@ -954,22 +991,22 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
954
991
|
* @return {Promise<void>}
|
|
955
992
|
*/
|
|
956
993
|
|
|
957
|
-
function refreshDataByConfig(
|
|
994
|
+
function refreshDataByConfig(_x10) {
|
|
958
995
|
return _refreshDataByConfig.apply(this, arguments);
|
|
959
996
|
}
|
|
960
997
|
|
|
961
998
|
function _refreshDataByConfig() {
|
|
962
|
-
_refreshDataByConfig = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
999
|
+
_refreshDataByConfig = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11(config) {
|
|
963
1000
|
var resources, groups, dRes, sRes, query;
|
|
964
|
-
return _regenerator["default"].wrap(function
|
|
1001
|
+
return _regenerator["default"].wrap(function _callee11$(_context11) {
|
|
965
1002
|
while (1) {
|
|
966
|
-
switch (
|
|
1003
|
+
switch (_context11.prev = _context11.next) {
|
|
967
1004
|
case 0:
|
|
968
1005
|
resources = config.resources, groups = config.groups;
|
|
969
1006
|
dRes = resources.dynamic, sRes = resources["static"];
|
|
970
1007
|
|
|
971
1008
|
if (!(dRes.selected && dRes.condition || sRes.selected && (0, _utils.isAvailableArray)(sRes.data) || (0, _utils.isAvailableArray)(groups))) {
|
|
972
|
-
|
|
1009
|
+
_context11.next = 7;
|
|
973
1010
|
break;
|
|
974
1011
|
}
|
|
975
1012
|
|
|
@@ -982,15 +1019,15 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
982
1019
|
_rlog["default"].debug('useEffect', editState, isEditing, topoId, resources, groups); // editDispatchers.update({ resources, groups });
|
|
983
1020
|
|
|
984
1021
|
|
|
985
|
-
|
|
1022
|
+
_context11.next = 7;
|
|
986
1023
|
return editDispatchers.getTopoByConditions(query);
|
|
987
1024
|
|
|
988
1025
|
case 7:
|
|
989
1026
|
case "end":
|
|
990
|
-
return
|
|
1027
|
+
return _context11.stop();
|
|
991
1028
|
}
|
|
992
1029
|
}
|
|
993
|
-
},
|
|
1030
|
+
}, _callee11);
|
|
994
1031
|
}));
|
|
995
1032
|
return _refreshDataByConfig.apply(this, arguments);
|
|
996
1033
|
}
|
|
@@ -1013,7 +1050,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
1013
1050
|
if (showSingleResDrawer) {
|
|
1014
1051
|
if ((0, _utils.isAvailableArray)(topo)) {
|
|
1015
1052
|
// 需要过滤出单选的节点及其相关连线
|
|
1016
|
-
var nodeId = singleResKey
|
|
1053
|
+
var nodeId = singleResKey;
|
|
1017
1054
|
var data = (0, _format.filterNode)(topo, nodeId);
|
|
1018
1055
|
saveBind(_componentTopologyGraph.TopoEvent.DATA_TYPE_RESOURCE_SINGLE, data);
|
|
1019
1056
|
}
|
package/lib/style.js
CHANGED
|
@@ -20,11 +20,11 @@ require('@alifd/next/lib/box/style');
|
|
|
20
20
|
require('@alifd/next/lib/dropdown/style');
|
|
21
21
|
require('@alifd/next/lib/menu/style');
|
|
22
22
|
require('@alifd/next/lib/tab/style');
|
|
23
|
-
require('@alifd/next/lib/radio/style');
|
|
24
23
|
require('@alifd/next/lib/collapse/style');
|
|
25
|
-
require('@alifd/next/lib/list/style');
|
|
26
24
|
require('@alifd/next/lib/tree-select/style');
|
|
27
25
|
|
|
26
|
+
require('@alifd/next/lib/radio/style');
|
|
27
|
+
require('@alifd/next/lib/list/style');
|
|
28
28
|
require('@alifd/next/lib/tag/style');
|
|
29
29
|
|
|
30
30
|
require('./index.scss');
|