@riil-frontend/component-topology 2.11.0 → 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 +22 -22
- package/demo/5/345/205/266/344/273/226/347/273/204/344/273/266//346/240/221/345/270/203/345/261/200/346/226/271/345/220/221.md +12 -0
- package/es/components/LayoutDirectionSelect/LayoutDirectionSelect.js +2 -2
- 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 +18 -11
- 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/useRelateTopo.js +1 -0
- package/es/hooks/useRelateTopoConfig.js +0 -0
- package/es/hooks/useTopoEdit.js +137 -100
- package/es/style.js +2 -2
- package/es/topoCenter/components/TopoTreeSelect.js +5 -0
- package/es/topoCenter/viewer/createTopoViewer.js +0 -1
- package/es/utils/htElementUtils.js +16 -7
- package/lib/components/LayoutDirectionSelect/LayoutDirectionSelect.js +2 -2
- 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 +18 -11
- 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/useRelateTopo.js +6 -0
- package/lib/hooks/useRelateTopoConfig.js +1 -0
- package/lib/hooks/useTopoEdit.js +138 -100
- package/lib/style.js +2 -2
- package/lib/topoCenter/components/TopoTreeSelect.js +14 -0
- package/lib/topoCenter/viewer/createTopoViewer.js +0 -2
- package/lib/utils/htElementUtils.js +22 -7
- package/package.json +9 -9
- package/CHANGELOG.md +0 -26
|
@@ -9,8 +9,8 @@ import _Grid from "@alifd/next/lib/grid";
|
|
|
9
9
|
import _Form from "@alifd/next/lib/form";
|
|
10
10
|
import React, { useState, useEffect } from 'react';
|
|
11
11
|
import ColorPicker from "../../LinkDynamicStyleSettingDrawer/rule/ColorPicker";
|
|
12
|
-
import GroupNodeList from "
|
|
13
|
-
import ResourceSelectButton from "../
|
|
12
|
+
import GroupNodeList from "./NodeList";
|
|
13
|
+
import ResourceSelectButton from "../common/GroupNodeList/ResourceSelectButton";
|
|
14
14
|
var FormItem = _Form.Item;
|
|
15
15
|
var Row = _Grid.Row,
|
|
16
16
|
Col = _Grid.Col;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
|
2
|
-
import ResourceList from "
|
|
3
|
-
import { getGroupNodes } from "
|
|
4
|
-
import { getIconById } from "
|
|
2
|
+
import ResourceList from "../common/GroupNodeList/ResourceList";
|
|
3
|
+
import { getGroupNodes } from "../../../../../utils/htElementUtils";
|
|
4
|
+
import { getIconById } from "../common/GroupNodeList/icon";
|
|
5
5
|
export default function GroupNodeList(props) {
|
|
6
6
|
var topo = props.topo,
|
|
7
7
|
group = props.group;
|
|
@@ -9,9 +9,9 @@ import _Grid from "@alifd/next/lib/grid";
|
|
|
9
9
|
import _Form from "@alifd/next/lib/form";
|
|
10
10
|
import React, { useState, useEffect } from 'react';
|
|
11
11
|
import ColorPicker from "../../LinkDynamicStyleSettingDrawer/rule/ColorPicker";
|
|
12
|
-
import GroupNodeList from "../group/
|
|
13
|
-
import ResourceSelectButton from "../
|
|
14
|
-
import { getIconMap } from "../
|
|
12
|
+
import GroupNodeList from "../group/DataTab/GroupNodeList";
|
|
13
|
+
import ResourceSelectButton from "../common/GroupNodeList/ResourceSelectButton";
|
|
14
|
+
import { getIconMap } from "../common/GroupNodeList/icon";
|
|
15
15
|
import LineType from "../common/LineType";
|
|
16
16
|
var FormItem = _Form.Item;
|
|
17
17
|
var Row = _Grid.Row,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { getIconGroups } from "../
|
|
2
|
+
import { getIconGroups } from "../common/GroupNodeList/icon";
|
|
3
3
|
import IconSelect from '@riil-frontend/component-topo-icon-select';
|
|
4
4
|
export default function NodeIconSelect(props) {
|
|
5
5
|
var value = props.value,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import SettingsForm from "./SettingsForm";
|
|
2
|
+
import NodePropertyView from "./node/NodePropertyView";
|
|
3
|
+
import LayerSettingsForm from "./layer/LayerSettingsForm";
|
|
4
|
+
import TextPropertyView from "./text/TextPropertyView";
|
|
5
|
+
import LinkPropertyView from "./link/LinkPropertyView";
|
|
6
|
+
import ViewPropertyView from "./view/ViewPropertyView";
|
|
7
|
+
import GroupPropertyView from "./group/GroupPropertyView";
|
|
8
|
+
var propertyPanelMap = {
|
|
9
|
+
// view: SettingsForm,
|
|
10
|
+
node: NodePropertyView,
|
|
11
|
+
layer: LayerSettingsForm,
|
|
12
|
+
text: TextPropertyView,
|
|
13
|
+
group: GroupPropertyView
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
if (localStorage.getItem('topo.debug') === 'true') {
|
|
17
|
+
Object.assign(propertyPanelMap, {
|
|
18
|
+
line: LinkPropertyView,
|
|
19
|
+
view: ViewPropertyView
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default propertyPanelMap;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function useRelateTopo(props) {}
|
|
File without changes
|
package/es/hooks/useTopoEdit.js
CHANGED
|
@@ -12,6 +12,7 @@ import { TopoEvent } from '@riil-frontend/component-topology-graph';
|
|
|
12
12
|
import { filterNode, filterGroupById, filterGroupByTag, formatTreeDataSelect } from "../utils/format";
|
|
13
13
|
import { DEFAULT_GROUP } from "../utils/template";
|
|
14
14
|
import topoPermissonUtil from "../utils/topoPermissionUtil";
|
|
15
|
+
import { getGroupElementByTag } from "../utils/htElementUtils";
|
|
15
16
|
|
|
16
17
|
var useTopoEdit = function useTopoEdit(params) {
|
|
17
18
|
var topoApp = params.topoApp,
|
|
@@ -69,6 +70,10 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
69
70
|
deletedNodes = _useDynamicList.list,
|
|
70
71
|
addDeletedNode = _useDynamicList.push,
|
|
71
72
|
clearDeletedNodes = _useDynamicList.resetList;
|
|
73
|
+
/**
|
|
74
|
+
* 拓扑图全局已选固定资源
|
|
75
|
+
*/
|
|
76
|
+
|
|
72
77
|
|
|
73
78
|
var resSelections = useMemo(function () {
|
|
74
79
|
var sel = staticRes.selected && staticRes.data || [];
|
|
@@ -190,9 +195,9 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
190
195
|
id = _ref4.id;
|
|
191
196
|
|
|
192
197
|
if (!isNull(id)) {
|
|
193
|
-
setSingleResKey(
|
|
198
|
+
setSingleResKey(id);
|
|
194
199
|
} else {
|
|
195
|
-
setSingleResKey(
|
|
200
|
+
setSingleResKey(null);
|
|
196
201
|
}
|
|
197
202
|
|
|
198
203
|
setShowSingleResDrawer(true);
|
|
@@ -315,9 +320,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
315
320
|
var id = data.id,
|
|
316
321
|
tag = data.tag; // 新加的容器 tag 格式为 group_${id}
|
|
317
322
|
|
|
318
|
-
var group = topoApp.getDataModel().getDataById(tag) || topoApp.getDataModel().getDataByTag(id) || topoApp.getDataModel()
|
|
319
|
-
return item.a('tag') === tag;
|
|
320
|
-
})[0];
|
|
323
|
+
var group = topoApp.getDataModel().getDataById(tag) || topoApp.getDataModel().getDataByTag(id) || getGroupElementByTag(topoApp.getDataModel(), tag);
|
|
321
324
|
|
|
322
325
|
if (!group) {
|
|
323
326
|
return;
|
|
@@ -467,11 +470,11 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
467
470
|
|
|
468
471
|
|
|
469
472
|
function _bindGroupResourcesConfig() {
|
|
470
|
-
_bindGroupResourcesConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
473
|
+
_bindGroupResourcesConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(group, data) {
|
|
471
474
|
var id, tag, name, index, newGroup;
|
|
472
|
-
return _regeneratorRuntime.wrap(function
|
|
475
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
473
476
|
while (1) {
|
|
474
|
-
switch (
|
|
477
|
+
switch (_context6.prev = _context6.next) {
|
|
475
478
|
case 0:
|
|
476
479
|
id = group.id, tag = group.tag, name = group.name;
|
|
477
480
|
index = findGroupIndex(groups, {
|
|
@@ -480,18 +483,18 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
480
483
|
});
|
|
481
484
|
|
|
482
485
|
if (!(index > -1)) {
|
|
483
|
-
|
|
486
|
+
_context6.next = 7;
|
|
484
487
|
break;
|
|
485
488
|
}
|
|
486
489
|
|
|
487
|
-
|
|
490
|
+
_context6.next = 5;
|
|
488
491
|
return editDispatchers.updateGroupResourcesByIndex({
|
|
489
492
|
index: index,
|
|
490
493
|
resources: data
|
|
491
494
|
});
|
|
492
495
|
|
|
493
496
|
case 5:
|
|
494
|
-
|
|
497
|
+
_context6.next = 8;
|
|
495
498
|
break;
|
|
496
499
|
|
|
497
500
|
case 7:
|
|
@@ -507,10 +510,10 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
507
510
|
|
|
508
511
|
case 8:
|
|
509
512
|
case "end":
|
|
510
|
-
return
|
|
513
|
+
return _context6.stop();
|
|
511
514
|
}
|
|
512
515
|
}
|
|
513
|
-
},
|
|
516
|
+
}, _callee6);
|
|
514
517
|
}));
|
|
515
518
|
return _bindGroupResourcesConfig.apply(this, arguments);
|
|
516
519
|
}
|
|
@@ -524,25 +527,25 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
524
527
|
|
|
525
528
|
|
|
526
529
|
function _bindGroupResources() {
|
|
527
|
-
_bindGroupResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
530
|
+
_bindGroupResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(group, data) {
|
|
528
531
|
var id, tag, _yield$editDispatcher, elements, groupElement;
|
|
529
532
|
|
|
530
|
-
return _regeneratorRuntime.wrap(function
|
|
533
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
531
534
|
while (1) {
|
|
532
|
-
switch (
|
|
535
|
+
switch (_context7.prev = _context7.next) {
|
|
533
536
|
case 0:
|
|
534
537
|
id = group.id, tag = group.tag;
|
|
535
|
-
|
|
538
|
+
_context7.next = 3;
|
|
536
539
|
return bindGroupResourcesConfig(group, data);
|
|
537
540
|
|
|
538
541
|
case 3:
|
|
539
|
-
|
|
542
|
+
_context7.next = 5;
|
|
540
543
|
return editDispatchers.refreshDataByConfig();
|
|
541
544
|
|
|
542
545
|
case 5:
|
|
543
|
-
_yield$editDispatcher =
|
|
546
|
+
_yield$editDispatcher = _context7.sent;
|
|
544
547
|
elements = _yield$editDispatcher.topoDataTrans;
|
|
545
|
-
rlog.debug('
|
|
548
|
+
rlog.debug('bindGroupResources--id, tag', id, tag);
|
|
546
549
|
|
|
547
550
|
if (id) {
|
|
548
551
|
groupElement = filterGroupById(elements, id);
|
|
@@ -558,10 +561,10 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
558
561
|
|
|
559
562
|
case 11:
|
|
560
563
|
case "end":
|
|
561
|
-
return
|
|
564
|
+
return _context7.stop();
|
|
562
565
|
}
|
|
563
566
|
}
|
|
564
|
-
},
|
|
567
|
+
}, _callee7);
|
|
565
568
|
}));
|
|
566
569
|
return _bindGroupResources.apply(this, arguments);
|
|
567
570
|
}
|
|
@@ -571,31 +574,31 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
571
574
|
}
|
|
572
575
|
|
|
573
576
|
function _bindViewResources() {
|
|
574
|
-
_bindViewResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
577
|
+
_bindViewResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(data) {
|
|
575
578
|
var _yield$editDispatcher2, elements;
|
|
576
579
|
|
|
577
|
-
return _regeneratorRuntime.wrap(function
|
|
580
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
578
581
|
while (1) {
|
|
579
|
-
switch (
|
|
582
|
+
switch (_context8.prev = _context8.next) {
|
|
580
583
|
case 0:
|
|
581
|
-
|
|
584
|
+
_context8.next = 2;
|
|
582
585
|
return editDispatchers.updateViewResources(data);
|
|
583
586
|
|
|
584
587
|
case 2:
|
|
585
|
-
|
|
588
|
+
_context8.next = 4;
|
|
586
589
|
return editDispatchers.refreshDataByConfig();
|
|
587
590
|
|
|
588
591
|
case 4:
|
|
589
|
-
_yield$editDispatcher2 =
|
|
592
|
+
_yield$editDispatcher2 = _context8.sent;
|
|
590
593
|
elements = _yield$editDispatcher2.topoDataTrans;
|
|
591
594
|
saveBind(TopoEvent.DATA_TYPE_RESOURCE_COMBO, elements);
|
|
592
595
|
|
|
593
596
|
case 7:
|
|
594
597
|
case "end":
|
|
595
|
-
return
|
|
598
|
+
return _context8.stop();
|
|
596
599
|
}
|
|
597
600
|
}
|
|
598
|
-
},
|
|
601
|
+
}, _callee8);
|
|
599
602
|
}));
|
|
600
603
|
return _bindViewResources.apply(this, arguments);
|
|
601
604
|
}
|
|
@@ -605,12 +608,12 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
605
608
|
}
|
|
606
609
|
|
|
607
610
|
function _addResourceToFirstLayer() {
|
|
608
|
-
_addResourceToFirstLayer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
611
|
+
_addResourceToFirstLayer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(data) {
|
|
609
612
|
var group, config, _yield$editDispatcher3, topoData;
|
|
610
613
|
|
|
611
|
-
return _regeneratorRuntime.wrap(function
|
|
614
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
612
615
|
while (1) {
|
|
613
|
-
switch (
|
|
616
|
+
switch (_context9.prev = _context9.next) {
|
|
614
617
|
case 0:
|
|
615
618
|
group = groups[0];
|
|
616
619
|
config = {
|
|
@@ -624,49 +627,83 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
624
627
|
data: [].concat(group.resources["static"].data, data)
|
|
625
628
|
}
|
|
626
629
|
};
|
|
627
|
-
|
|
630
|
+
_context9.next = 4;
|
|
628
631
|
return bindGroupResourcesConfig(group, config);
|
|
629
632
|
|
|
630
633
|
case 4:
|
|
631
|
-
|
|
634
|
+
_context9.next = 6;
|
|
632
635
|
return editDispatchers.refreshDataByConfig();
|
|
633
636
|
|
|
634
637
|
case 6:
|
|
635
|
-
_yield$editDispatcher3 =
|
|
638
|
+
_yield$editDispatcher3 = _context9.sent;
|
|
636
639
|
topoData = _yield$editDispatcher3.topoData;
|
|
637
640
|
topoApp.updateElements(topoData);
|
|
638
641
|
|
|
639
642
|
case 9:
|
|
640
643
|
case "end":
|
|
641
|
-
return
|
|
644
|
+
return _context9.stop();
|
|
642
645
|
}
|
|
643
646
|
}
|
|
644
|
-
},
|
|
647
|
+
}, _callee9);
|
|
645
648
|
}));
|
|
646
649
|
return _addResourceToFirstLayer.apply(this, arguments);
|
|
647
650
|
}
|
|
648
651
|
|
|
649
|
-
var onSaveComboRes = function
|
|
650
|
-
|
|
652
|
+
var onSaveComboRes = /*#__PURE__*/function () {
|
|
653
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(data) {
|
|
654
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
655
|
+
while (1) {
|
|
656
|
+
switch (_context3.prev = _context3.next) {
|
|
657
|
+
case 0:
|
|
658
|
+
rlog.debug('关联资源-----onSaveComboRes', data, focusedGroup);
|
|
651
659
|
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
660
|
+
if (!(topoShowType === 'layers')) {
|
|
661
|
+
_context3.next = 6;
|
|
662
|
+
break;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
_context3.next = 4;
|
|
666
|
+
return addResourceToFirstLayer(data);
|
|
667
|
+
|
|
668
|
+
case 4:
|
|
669
|
+
_context3.next = 13;
|
|
670
|
+
break;
|
|
671
|
+
|
|
672
|
+
case 6:
|
|
673
|
+
if (!focusedGroup) {
|
|
674
|
+
_context3.next = 11;
|
|
675
|
+
break;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
_context3.next = 9;
|
|
679
|
+
return bindGroupResources(focusedGroup, data);
|
|
680
|
+
|
|
681
|
+
case 9:
|
|
682
|
+
_context3.next = 13;
|
|
683
|
+
break;
|
|
684
|
+
|
|
685
|
+
case 11:
|
|
686
|
+
_context3.next = 13;
|
|
687
|
+
return bindViewResources(data);
|
|
688
|
+
|
|
689
|
+
case 13:
|
|
690
|
+
case "end":
|
|
691
|
+
return _context3.stop();
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
}, _callee3);
|
|
695
|
+
}));
|
|
663
696
|
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
697
|
+
return function onSaveComboRes(_x7) {
|
|
698
|
+
return _ref5.apply(this, arguments);
|
|
699
|
+
};
|
|
700
|
+
}();
|
|
701
|
+
|
|
702
|
+
var onSaveSingleRes = function onSaveSingleRes(selectedResKey) {
|
|
703
|
+
rlog.debug('onSaveSingleRes', selectedResKey);
|
|
667
704
|
var selected = staticRes.selected,
|
|
668
705
|
data = staticRes.data;
|
|
669
|
-
var exist = data.indexOf(
|
|
706
|
+
var exist = data.indexOf(selectedResKey) !== -1;
|
|
670
707
|
|
|
671
708
|
if (selected && exist) {
|
|
672
709
|
// 资源已被选
|
|
@@ -678,15 +715,15 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
678
715
|
|
|
679
716
|
if (singleResKey) {
|
|
680
717
|
list = list.filter(function (item) {
|
|
681
|
-
return item !== singleResKey
|
|
718
|
+
return item !== singleResKey;
|
|
682
719
|
});
|
|
683
720
|
}
|
|
684
721
|
|
|
685
722
|
if (!exist) {
|
|
686
|
-
list =
|
|
723
|
+
list = [].concat(list, [selectedResKey]);
|
|
687
724
|
}
|
|
688
725
|
|
|
689
|
-
setSingleResKey(
|
|
726
|
+
setSingleResKey(selectedResKey);
|
|
690
727
|
editDispatchers.updateResources({
|
|
691
728
|
"static": {
|
|
692
729
|
selected: true,
|
|
@@ -697,32 +734,32 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
697
734
|
}
|
|
698
735
|
};
|
|
699
736
|
|
|
700
|
-
function checkSavePermission(
|
|
737
|
+
function checkSavePermission(_x8) {
|
|
701
738
|
return _checkSavePermission.apply(this, arguments);
|
|
702
739
|
}
|
|
703
740
|
|
|
704
741
|
function _checkSavePermission() {
|
|
705
|
-
_checkSavePermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
742
|
+
_checkSavePermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(id) {
|
|
706
743
|
var permission;
|
|
707
|
-
return _regeneratorRuntime.wrap(function
|
|
744
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
708
745
|
while (1) {
|
|
709
|
-
switch (
|
|
746
|
+
switch (_context10.prev = _context10.next) {
|
|
710
747
|
case 0:
|
|
711
|
-
|
|
748
|
+
_context10.next = 2;
|
|
712
749
|
return topoDispatchers.getTopoPermission({
|
|
713
750
|
id: id,
|
|
714
751
|
update: false
|
|
715
752
|
});
|
|
716
753
|
|
|
717
754
|
case 2:
|
|
718
|
-
permission =
|
|
755
|
+
permission = _context10.sent;
|
|
719
756
|
|
|
720
757
|
if (!topoPermissonUtil.isEditable(permission)) {
|
|
721
|
-
|
|
758
|
+
_context10.next = 5;
|
|
722
759
|
break;
|
|
723
760
|
}
|
|
724
761
|
|
|
725
|
-
return
|
|
762
|
+
return _context10.abrupt("return", true);
|
|
726
763
|
|
|
727
764
|
case 5:
|
|
728
765
|
_Dialog.alert({
|
|
@@ -734,43 +771,43 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
734
771
|
onOk: function onOk() {}
|
|
735
772
|
});
|
|
736
773
|
|
|
737
|
-
return
|
|
774
|
+
return _context10.abrupt("return", false);
|
|
738
775
|
|
|
739
776
|
case 7:
|
|
740
777
|
case "end":
|
|
741
|
-
return
|
|
778
|
+
return _context10.stop();
|
|
742
779
|
}
|
|
743
780
|
}
|
|
744
|
-
},
|
|
781
|
+
}, _callee10);
|
|
745
782
|
}));
|
|
746
783
|
return _checkSavePermission.apply(this, arguments);
|
|
747
784
|
}
|
|
748
785
|
|
|
749
786
|
var onSaveTopo = /*#__PURE__*/function () {
|
|
750
|
-
var
|
|
787
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(data) {
|
|
751
788
|
var id, config, global, serialize, saveConfig, valid, _config$layout2, template, layout;
|
|
752
789
|
|
|
753
|
-
return _regeneratorRuntime.wrap(function
|
|
790
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
754
791
|
while (1) {
|
|
755
|
-
switch (
|
|
792
|
+
switch (_context5.prev = _context5.next) {
|
|
756
793
|
case 0:
|
|
757
794
|
id = data.id, config = data.config, global = data.global, serialize = data.serialize;
|
|
758
795
|
|
|
759
796
|
if (!onSave) {
|
|
760
|
-
|
|
797
|
+
_context5.next = 5;
|
|
761
798
|
break;
|
|
762
799
|
}
|
|
763
800
|
|
|
764
801
|
saveConfig = /*#__PURE__*/function () {
|
|
765
|
-
var
|
|
802
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
766
803
|
var _config$layout, template, layout;
|
|
767
804
|
|
|
768
|
-
return _regeneratorRuntime.wrap(function
|
|
805
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
769
806
|
while (1) {
|
|
770
|
-
switch (
|
|
807
|
+
switch (_context4.prev = _context4.next) {
|
|
771
808
|
case 0:
|
|
772
809
|
_config$layout = config === null || config === void 0 ? void 0 : config.layout, template = _config$layout.type, layout = _config$layout.layout;
|
|
773
|
-
|
|
810
|
+
_context4.next = 3;
|
|
774
811
|
return editDispatchers.saveTopo({
|
|
775
812
|
id: id,
|
|
776
813
|
template: template,
|
|
@@ -781,14 +818,14 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
781
818
|
|
|
782
819
|
case 3:
|
|
783
820
|
case "end":
|
|
784
|
-
return
|
|
821
|
+
return _context4.stop();
|
|
785
822
|
}
|
|
786
823
|
}
|
|
787
|
-
},
|
|
824
|
+
}, _callee4);
|
|
788
825
|
}));
|
|
789
826
|
|
|
790
827
|
return function saveConfig() {
|
|
791
|
-
return
|
|
828
|
+
return _ref7.apply(this, arguments);
|
|
792
829
|
};
|
|
793
830
|
}();
|
|
794
831
|
|
|
@@ -796,7 +833,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
796
833
|
data: data,
|
|
797
834
|
saveConfig: saveConfig
|
|
798
835
|
});
|
|
799
|
-
return
|
|
836
|
+
return _context5.abrupt("return");
|
|
800
837
|
|
|
801
838
|
case 5:
|
|
802
839
|
// TODO 以下逻辑移到拓扑中心
|
|
@@ -804,26 +841,26 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
804
841
|
saving: true
|
|
805
842
|
}); // 检查权限
|
|
806
843
|
|
|
807
|
-
|
|
844
|
+
_context5.next = 8;
|
|
808
845
|
return checkSavePermission(id);
|
|
809
846
|
|
|
810
847
|
case 8:
|
|
811
|
-
valid =
|
|
848
|
+
valid = _context5.sent;
|
|
812
849
|
|
|
813
850
|
if (valid) {
|
|
814
|
-
|
|
851
|
+
_context5.next = 12;
|
|
815
852
|
break;
|
|
816
853
|
}
|
|
817
854
|
|
|
818
855
|
topoEditDispatchers.update({
|
|
819
856
|
saving: false
|
|
820
857
|
});
|
|
821
|
-
return
|
|
858
|
+
return _context5.abrupt("return");
|
|
822
859
|
|
|
823
860
|
case 12:
|
|
824
861
|
// 保存
|
|
825
862
|
_config$layout2 = config === null || config === void 0 ? void 0 : config.layout, template = _config$layout2.type, layout = _config$layout2.layout;
|
|
826
|
-
|
|
863
|
+
_context5.next = 15;
|
|
827
864
|
return editDispatchers.saveTopo({
|
|
828
865
|
id: id,
|
|
829
866
|
template: template,
|
|
@@ -835,7 +872,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
835
872
|
});
|
|
836
873
|
|
|
837
874
|
case 15:
|
|
838
|
-
|
|
875
|
+
_context5.next = 17;
|
|
839
876
|
return editDispatchers.addToBlockList({
|
|
840
877
|
id: topoId,
|
|
841
878
|
ciIdList: deletedNodes
|
|
@@ -852,14 +889,14 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
852
889
|
|
|
853
890
|
case 20:
|
|
854
891
|
case "end":
|
|
855
|
-
return
|
|
892
|
+
return _context5.stop();
|
|
856
893
|
}
|
|
857
894
|
}
|
|
858
|
-
},
|
|
895
|
+
}, _callee5);
|
|
859
896
|
}));
|
|
860
897
|
|
|
861
|
-
return function onSaveTopo(
|
|
862
|
-
return
|
|
898
|
+
return function onSaveTopo(_x9) {
|
|
899
|
+
return _ref6.apply(this, arguments);
|
|
863
900
|
};
|
|
864
901
|
}();
|
|
865
902
|
|
|
@@ -925,22 +962,22 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
925
962
|
* @return {Promise<void>}
|
|
926
963
|
*/
|
|
927
964
|
|
|
928
|
-
function refreshDataByConfig(
|
|
965
|
+
function refreshDataByConfig(_x10) {
|
|
929
966
|
return _refreshDataByConfig.apply(this, arguments);
|
|
930
967
|
}
|
|
931
968
|
|
|
932
969
|
function _refreshDataByConfig() {
|
|
933
|
-
_refreshDataByConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
970
|
+
_refreshDataByConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(config) {
|
|
934
971
|
var resources, groups, dRes, sRes, query;
|
|
935
|
-
return _regeneratorRuntime.wrap(function
|
|
972
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
936
973
|
while (1) {
|
|
937
|
-
switch (
|
|
974
|
+
switch (_context11.prev = _context11.next) {
|
|
938
975
|
case 0:
|
|
939
976
|
resources = config.resources, groups = config.groups;
|
|
940
977
|
dRes = resources.dynamic, sRes = resources["static"];
|
|
941
978
|
|
|
942
979
|
if (!(dRes.selected && dRes.condition || sRes.selected && isAvailableArray(sRes.data) || isAvailableArray(groups))) {
|
|
943
|
-
|
|
980
|
+
_context11.next = 7;
|
|
944
981
|
break;
|
|
945
982
|
}
|
|
946
983
|
|
|
@@ -951,15 +988,15 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
951
988
|
};
|
|
952
989
|
rlog.debug('useEffect', editState, isEditing, topoId, resources, groups); // editDispatchers.update({ resources, groups });
|
|
953
990
|
|
|
954
|
-
|
|
991
|
+
_context11.next = 7;
|
|
955
992
|
return editDispatchers.getTopoByConditions(query);
|
|
956
993
|
|
|
957
994
|
case 7:
|
|
958
995
|
case "end":
|
|
959
|
-
return
|
|
996
|
+
return _context11.stop();
|
|
960
997
|
}
|
|
961
998
|
}
|
|
962
|
-
},
|
|
999
|
+
}, _callee11);
|
|
963
1000
|
}));
|
|
964
1001
|
return _refreshDataByConfig.apply(this, arguments);
|
|
965
1002
|
}
|
|
@@ -980,7 +1017,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
980
1017
|
if (showSingleResDrawer) {
|
|
981
1018
|
if (isAvailableArray(topo)) {
|
|
982
1019
|
// 需要过滤出单选的节点及其相关连线
|
|
983
|
-
var nodeId = singleResKey
|
|
1020
|
+
var nodeId = singleResKey;
|
|
984
1021
|
var data = filterNode(topo, nodeId);
|
|
985
1022
|
saveBind(TopoEvent.DATA_TYPE_RESOURCE_SINGLE, data);
|
|
986
1023
|
}
|
package/es/style.js
CHANGED
|
@@ -20,11 +20,11 @@ import '@alifd/next/lib/box/style';
|
|
|
20
20
|
import '@alifd/next/lib/dropdown/style';
|
|
21
21
|
import '@alifd/next/lib/menu/style';
|
|
22
22
|
import '@alifd/next/lib/tab/style';
|
|
23
|
-
import '@alifd/next/lib/radio/style';
|
|
24
23
|
import '@alifd/next/lib/collapse/style';
|
|
25
|
-
import '@alifd/next/lib/list/style';
|
|
26
24
|
import '@alifd/next/lib/tree-select/style';
|
|
27
25
|
|
|
26
|
+
import '@alifd/next/lib/radio/style';
|
|
27
|
+
import '@alifd/next/lib/list/style';
|
|
28
28
|
import '@alifd/next/lib/tag/style';
|
|
29
29
|
|
|
30
30
|
import './index.scss';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import createMenuCommands from "../../contextmenu/createMenuCommands";
|
|
3
2
|
import TopoCenter from "../models/TopoCenter";
|
|
4
3
|
export function createTopoViewer(options) {
|
|
5
4
|
var topoApp = new TopoCenter(_extends({}, options));
|