@riil-frontend/component-topology 6.0.0-alpha.41 → 6.0.0-alpha.43
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.css +1 -1
- package/build/index.js +20 -20
- package/demo/CHANGELOG/CHANGELOG.md +5 -0
- package/es/components/VerticalIconTab/VerticalIconTab.js +11 -1
- package/es/components/VerticalIconTab/VerticalIconTab.module.scss +1 -0
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +8 -3
- package/es/core/components/TopoView/topoView.js +3 -3
- package/es/core/editor/components/Sidebar/panes.js +6 -1
- package/es/core/editor/components/Toolbar/widgets/AddResourceButton.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +38 -12
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +4 -5
- package/es/core/editor/components/Toolbar/widgets/FontStyleButton.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/Layout/index.js +2 -2
- package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +8 -1
- package/es/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/ElementTextStyleSetting.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/textStyleSettingRouter.js +1 -1
- package/es/core/editor/components/settings/CloseablePanel.module.scss +12 -0
- package/es/core/editor/components/settings/PropertyView.js +21 -18
- package/es/core/editor/components/settings/Settings.js +39 -77
- package/es/core/editor/components/settings/Settings.module.scss +2 -10
- package/es/core/editor/components/settings/core/PropertyViewManager.js +61 -0
- package/es/core/editor/components/settings/core/getPropertyViewType.js +34 -0
- package/es/core/editor/components/settings/core/updateElementProperty.js +21 -0
- package/es/core/editor/components/settings/propertyViews/box/BoxPropertyView.js +3 -8
- package/es/core/editor/components/settings/propertyViews/box/BoxPropertyViewV1.js +58 -0
- package/es/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +5 -2
- package/es/core/editor/components/settings/propertyViews/edge/EdgeGroupPropertyView.js +7 -8
- package/es/core/editor/components/settings/propertyViews/edge/EdgePropertyView.js +9 -23
- package/es/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +10 -0
- package/es/core/editor/components/settings/propertyViews/edge/edgeGroup/EdgeGroupSetting.js +1 -6
- package/es/core/editor/components/settings/propertyViews/group/GroupPropertyView.js +13 -21
- package/es/core/editor/components/settings/propertyViews/group/GroupPropertyView.module.scss +8 -1
- package/es/core/editor/components/settings/propertyViews/group/GroupPropertyViewV1.js +28 -0
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupBasicSetting.js +74 -0
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +9 -7
- package/es/core/editor/components/settings/propertyViews/index.js +4 -2
- package/es/core/editor/components/settings/propertyViews/node/NodePropertyView.js +8 -32
- package/es/core/editor/components/settings/propertyViews/node/NodePropertyViewV1.js +53 -0
- package/es/core/editor/components/settings/propertyViews/node/Setting/BasicSetting.js +49 -0
- package/es/core/editor/components/settings/propertyViews/text/TextPropertyView.js +4 -19
- package/es/core/models/HistoryManager.js +11 -14
- package/es/core/models/{SelectionManager.js → SelectionModel.js} +27 -18
- package/es/core/models/TopoApp.js +3 -3
- package/es/networkTopo/components/editor/propertyViews/edge/EdgePropertyView.js +39 -6
- package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +10 -16
- package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyViewV1.js +37 -0
- package/es/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.module.scss +1 -1
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/es/style.js +1 -1
- package/lib/components/VerticalIconTab/VerticalIconTab.js +14 -1
- package/lib/components/VerticalIconTab/VerticalIconTab.module.scss +1 -0
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +8 -3
- package/lib/core/components/TopoView/topoView.js +3 -3
- package/lib/core/editor/components/Sidebar/panes.js +6 -1
- package/lib/core/editor/components/Toolbar/widgets/AddResourceButton.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +38 -12
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +4 -5
- package/lib/core/editor/components/Toolbar/widgets/FontStyleButton.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +2 -2
- package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +8 -1
- package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/ElementTextStyleSetting.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/textStyleSettingRouter.js +1 -1
- package/lib/core/editor/components/settings/CloseablePanel.module.scss +12 -0
- package/lib/core/editor/components/settings/PropertyView.js +26 -19
- package/lib/core/editor/components/settings/Settings.js +44 -79
- package/lib/core/editor/components/settings/Settings.module.scss +2 -10
- package/lib/core/editor/components/settings/core/PropertyViewManager.js +70 -0
- package/lib/core/editor/components/settings/core/getPropertyViewType.js +40 -0
- package/lib/core/editor/components/settings/core/updateElementProperty.js +27 -0
- package/lib/core/editor/components/settings/propertyViews/box/BoxPropertyView.js +3 -8
- package/lib/core/editor/components/settings/propertyViews/box/BoxPropertyViewV1.js +76 -0
- package/lib/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +8 -2
- package/lib/core/editor/components/settings/propertyViews/edge/EdgeGroupPropertyView.js +9 -12
- package/lib/core/editor/components/settings/propertyViews/edge/EdgePropertyView.js +7 -23
- package/lib/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +19 -0
- package/lib/core/editor/components/settings/propertyViews/edge/edgeGroup/EdgeGroupSetting.js +1 -6
- package/lib/core/editor/components/settings/propertyViews/group/GroupPropertyView.js +14 -25
- package/lib/core/editor/components/settings/propertyViews/group/GroupPropertyView.module.scss +8 -1
- package/lib/core/editor/components/settings/propertyViews/group/GroupPropertyViewV1.js +43 -0
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupBasicSetting.js +97 -0
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +8 -6
- package/lib/core/editor/components/settings/propertyViews/index.js +5 -2
- package/lib/core/editor/components/settings/propertyViews/node/NodePropertyView.js +8 -35
- package/lib/core/editor/components/settings/propertyViews/node/NodePropertyViewV1.js +68 -0
- package/lib/core/editor/components/settings/propertyViews/node/Setting/BasicSetting.js +64 -0
- package/lib/core/editor/components/settings/propertyViews/text/TextPropertyView.js +4 -19
- package/lib/core/models/HistoryManager.js +11 -14
- package/lib/core/models/{SelectionManager.js → SelectionModel.js} +27 -18
- package/lib/core/models/TopoApp.js +3 -3
- package/lib/networkTopo/components/editor/propertyViews/edge/EdgePropertyView.js +45 -7
- package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +10 -18
- package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyViewV1.js +50 -0
- package/lib/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.module.scss +1 -1
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/lib/style.js +1 -1
- package/package.json +2 -2
- package/es/core/editor/components/settings/OpenPropertyPanelListener.js +0 -33
- package/lib/core/editor/components/settings/OpenPropertyPanelListener.js +0 -43
@@ -0,0 +1,53 @@
|
|
1
|
+
import _Tab from "@alifd/next/es/tab";
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
3
|
+
import React from 'react';
|
4
|
+
import useHtElement from "../../../../../common/hooks/useHtElement";
|
5
|
+
import TabView from "../../common/tab/TabView";
|
6
|
+
import Data from "./data/Data";
|
7
|
+
import styles from "./NodePropertyView.module.scss";
|
8
|
+
import Setting from "./Setting";
|
9
|
+
export default function NodePropertyView(props) {
|
10
|
+
var _topo$options$editor;
|
11
|
+
|
12
|
+
var topo = props.topo,
|
13
|
+
topoEditApi = props.topoEditApi,
|
14
|
+
values = props.values,
|
15
|
+
onChange = props.onChange,
|
16
|
+
editorProps = props.editorProps,
|
17
|
+
settingRuntimeState = props.settingRuntimeState;
|
18
|
+
var node = useHtElement({
|
19
|
+
topo: topo,
|
20
|
+
id: values.id
|
21
|
+
});
|
22
|
+
|
23
|
+
var renderData = function renderData() {
|
24
|
+
return /*#__PURE__*/React.createElement(Data, _extends({}, props, {
|
25
|
+
node: node
|
26
|
+
}));
|
27
|
+
};
|
28
|
+
|
29
|
+
var renderSetting = function renderSetting() {
|
30
|
+
var nodeSettingViewProps = editorProps.nodeSettingViewProps;
|
31
|
+
return /*#__PURE__*/React.createElement(Setting, _extends({}, props, nodeSettingViewProps));
|
32
|
+
}; // 未绑定资源的节点,根据参数控制是否可关联资源
|
33
|
+
|
34
|
+
|
35
|
+
var showRelateResource = !!values.tag || !values.tag && ((_topo$options$editor = topo.options.editor) === null || _topo$options$editor === void 0 ? void 0 : _topo$options$editor.enableRelateResource) !== false;
|
36
|
+
var content;
|
37
|
+
|
38
|
+
if (showRelateResource) {
|
39
|
+
content = /*#__PURE__*/React.createElement(TabView, null, /*#__PURE__*/React.createElement(_Tab.Item, {
|
40
|
+
title: "\u6570\u636E",
|
41
|
+
key: "1"
|
42
|
+
}, renderData()), /*#__PURE__*/React.createElement(_Tab.Item, {
|
43
|
+
title: "\u8BBE\u7F6E",
|
44
|
+
key: "2"
|
45
|
+
}, renderSetting()));
|
46
|
+
} else {
|
47
|
+
content = renderSetting();
|
48
|
+
}
|
49
|
+
|
50
|
+
return /*#__PURE__*/React.createElement("div", {
|
51
|
+
className: styles.NodePropertyView
|
52
|
+
}, content);
|
53
|
+
}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import _Form from "@alifd/next/es/form";
|
2
|
+
import _Field from "@alifd/next/es/field";
|
3
|
+
import _extends from "@babel/runtime/helpers/extends";
|
4
|
+
import React, { useEffect } from 'react';
|
5
|
+
import NameInput from "./NameInput";
|
6
|
+
|
7
|
+
function parseValues(values) {
|
8
|
+
return _extends({}, values, {
|
9
|
+
'attrObject.customName': values['attrObject.customName'] || values['attrObject.name'],
|
10
|
+
'attrObject.bindTopo': values['attrObject.bindTopo'] || '' // 解决切换节点时关联拓扑选项未重置
|
11
|
+
|
12
|
+
});
|
13
|
+
}
|
14
|
+
|
15
|
+
export default function BasicSetting(props) {
|
16
|
+
var topo = props.topo,
|
17
|
+
values = props.values,
|
18
|
+
_onChange = props.onChange,
|
19
|
+
editorProps = props.editorProps,
|
20
|
+
settingRuntimeState = props.settingRuntimeState,
|
21
|
+
_props$showImageSetti = props.showImageSetting,
|
22
|
+
showImageSetting = _props$showImageSetti === void 0 ? true : _props$showImageSetti;
|
23
|
+
|
24
|
+
var field = _Field.useField({
|
25
|
+
autoUnmount: false,
|
26
|
+
values: parseValues(values),
|
27
|
+
onChange: function onChange(name, value) {
|
28
|
+
var newValues = field.getValues();
|
29
|
+
|
30
|
+
_onChange(name, value, newValues);
|
31
|
+
}
|
32
|
+
});
|
33
|
+
|
34
|
+
useEffect(function () {
|
35
|
+
field.setValues(parseValues(values));
|
36
|
+
}, [values]);
|
37
|
+
return /*#__PURE__*/React.createElement(_Form, {
|
38
|
+
field: field,
|
39
|
+
labelAlign: "top",
|
40
|
+
style: {
|
41
|
+
margin: '12px 0 0 32px'
|
42
|
+
}
|
43
|
+
}, /*#__PURE__*/React.createElement(_Form.Item, {
|
44
|
+
label: "\u56FE\u7247\u540D\u79F0"
|
45
|
+
}, /*#__PURE__*/React.createElement(NameInput, {
|
46
|
+
name: "attrObject.customName",
|
47
|
+
topo: topo
|
48
|
+
})));
|
49
|
+
}
|
@@ -59,23 +59,11 @@ export default function TextPropertyView(props) {
|
|
59
59
|
useEffect(function () {
|
60
60
|
field.setValues(parseValues(values));
|
61
61
|
}, [values]);
|
62
|
-
return /*#__PURE__*/React.createElement(
|
63
|
-
style: {
|
64
|
-
paddingTop: 4
|
65
|
-
}
|
66
|
-
}, /*#__PURE__*/React.createElement(_Form, {
|
62
|
+
return /*#__PURE__*/React.createElement(_Form, {
|
67
63
|
field: field,
|
68
|
-
labelAlign: "top"
|
69
|
-
}, /*#__PURE__*/React.createElement(_Form.Item, null, /*#__PURE__*/React.createElement(_Collapse, {
|
70
|
-
defaultExpandedKeys: ['显示设置'],
|
71
|
-
style: {
|
72
|
-
border: 'none'
|
73
|
-
}
|
74
|
-
}, /*#__PURE__*/React.createElement(CollapsePanel, {
|
75
|
-
key: "\u663E\u793A\u8BBE\u7F6E",
|
76
|
-
title: "\u663E\u793A\u8BBE\u7F6E",
|
64
|
+
labelAlign: "top",
|
77
65
|
style: {
|
78
|
-
|
66
|
+
margin: '12px 0 0 32px'
|
79
67
|
}
|
80
68
|
}, /*#__PURE__*/React.createElement(_Form.Item, {
|
81
69
|
label: "\u6587\u672C"
|
@@ -92,8 +80,5 @@ export default function TextPropertyView(props) {
|
|
92
80
|
onBlur: function onBlur() {
|
93
81
|
topo.historyManager.endTransaction();
|
94
82
|
}
|
95
|
-
}))
|
96
|
-
name: "styleMap.textObj",
|
97
|
-
topo: topo
|
98
|
-
})))))));
|
83
|
+
})));
|
99
84
|
}
|
@@ -65,6 +65,10 @@ var HistoryManager = /*#__PURE__*/function () {
|
|
65
65
|
var _this = this;
|
66
66
|
|
67
67
|
this.htHistoryManager.beginTransaction();
|
68
|
+
var displayConfigProperties = [// 单多链路
|
69
|
+
'expandAllEdges', // 节点标注
|
70
|
+
'nodeLabelStyle', // 画布主题
|
71
|
+
'canvasTheme', 'linkTag', 'linkTip', 'nodeTag', 'nodeTip'];
|
68
72
|
var items = [{
|
69
73
|
modelName: 'topoMod',
|
70
74
|
property: 'data'
|
@@ -72,23 +76,16 @@ var HistoryManager = /*#__PURE__*/function () {
|
|
72
76
|
{
|
73
77
|
modelName: 'topoMod',
|
74
78
|
property: 'type'
|
75
|
-
}
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
modelName: 'displayConfig',
|
82
|
-
property: 'nodeLabelStyle'
|
83
|
-
}, // 画布主题
|
84
|
-
{
|
85
|
-
modelName: 'displayConfig',
|
86
|
-
property: 'canvasTheme'
|
87
|
-
}, // 背景
|
79
|
+
}].concat(displayConfigProperties.map(function (property) {
|
80
|
+
return {
|
81
|
+
modelName: 'displayConfig',
|
82
|
+
property: property
|
83
|
+
};
|
84
|
+
}), [// 背景
|
88
85
|
{
|
89
86
|
modelName: 'background',
|
90
87
|
property: 'current'
|
91
|
-
}];
|
88
|
+
}]);
|
92
89
|
this.storeHistory = items.map(function (item) {
|
93
90
|
return _extends({}, item, {
|
94
91
|
oldValue: _this.topo.store.getModelState(item.modelName)[item.property]
|
@@ -3,25 +3,13 @@ import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
|
3
3
|
import useHtElements from "../common/hooks/useHtElements";
|
4
4
|
import ignoreList from "./selection/ignoreList";
|
5
5
|
|
6
|
-
var
|
7
|
-
function
|
6
|
+
var SelectionModel = /*#__PURE__*/function () {
|
7
|
+
function SelectionModel(topo) {
|
8
8
|
var _this = this;
|
9
9
|
|
10
10
|
this.topo = null;
|
11
11
|
this.inited = false;
|
12
12
|
|
13
|
-
this.setSelection = function (selection) {
|
14
|
-
var selectionDispatchers = _this.topo.store.getModelDispatchers('selection');
|
15
|
-
|
16
|
-
_this.selectionIds = selection.map(function (item) {
|
17
|
-
return item.id;
|
18
|
-
});
|
19
|
-
selectionDispatchers.update({
|
20
|
-
selection: selection,
|
21
|
-
selectionIds: _this.selectionIds
|
22
|
-
});
|
23
|
-
};
|
24
|
-
|
25
13
|
this.updateSelection = function () {
|
26
14
|
try {
|
27
15
|
var selectionModel = _this.topo.getSelectionModel();
|
@@ -30,18 +18,30 @@ var SelectionManager = /*#__PURE__*/function () {
|
|
30
18
|
|
31
19
|
var selectionArr = htSelection.map(getElementData); // rlog.info("updateSelection", selectionArr.map((element) => element.id));
|
32
20
|
|
33
|
-
_this.
|
21
|
+
_this.updateStoreSelection(selectionArr);
|
34
22
|
} catch (e) {
|
35
23
|
rlog.error('updateSelection error', e);
|
36
24
|
}
|
37
25
|
};
|
38
26
|
|
27
|
+
this.updateStoreSelection = function (selection) {
|
28
|
+
var selectionDispatchers = _this.topo.store.getModelDispatchers('selection');
|
29
|
+
|
30
|
+
_this.selectionIds = selection.map(function (item) {
|
31
|
+
return item.id;
|
32
|
+
});
|
33
|
+
selectionDispatchers.update({
|
34
|
+
selection: selection,
|
35
|
+
selectionIds: _this.selectionIds
|
36
|
+
});
|
37
|
+
};
|
38
|
+
|
39
39
|
this.topo = topo;
|
40
40
|
this.handleSelectionChange = this.handleSelectionChange.bind(this);
|
41
41
|
this.handleDataPropertyChange = this.handleDataPropertyChange.bind(this);
|
42
42
|
}
|
43
43
|
|
44
|
-
var _proto =
|
44
|
+
var _proto = SelectionModel.prototype;
|
45
45
|
|
46
46
|
_proto.init = function init() {
|
47
47
|
if (this.inited) {
|
@@ -75,6 +75,15 @@ var SelectionManager = /*#__PURE__*/function () {
|
|
75
75
|
return elements;
|
76
76
|
};
|
77
77
|
|
78
|
+
_proto.getSelection = function getSelection() {
|
79
|
+
var selectionModel = this.topo.getSelectionModel();
|
80
|
+
return selectionModel.getSelection().getArray();
|
81
|
+
}
|
82
|
+
/**
|
83
|
+
* 同步选中元素到store
|
84
|
+
*/
|
85
|
+
;
|
86
|
+
|
78
87
|
_proto.handleSelectionChange = function handleSelectionChange(e) {
|
79
88
|
rlog.info('Selection handleSelectionChange', e);
|
80
89
|
this.updateSelection();
|
@@ -121,10 +130,10 @@ var SelectionManager = /*#__PURE__*/function () {
|
|
121
130
|
dataModel.removeDataPropertyChangeListener(this.handleDataPropertyChange);
|
122
131
|
};
|
123
132
|
|
124
|
-
return
|
133
|
+
return SelectionModel;
|
125
134
|
}();
|
126
135
|
|
127
|
-
export {
|
136
|
+
export { SelectionModel as default };
|
128
137
|
; // 构造元素数据
|
129
138
|
|
130
139
|
var map = {
|
@@ -20,9 +20,9 @@ import { updateEdgeExpanded } from "../utils/edgeUtil";
|
|
20
20
|
import PluginManager from "./PluginManager";
|
21
21
|
import topoFactory from "./topoFactory";
|
22
22
|
import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
|
23
|
-
import
|
23
|
+
import SelectionModel from "./SelectionModel"; // eslint-disable-next-line no-undef
|
24
24
|
|
25
|
-
var version = typeof "6.0.0-alpha.
|
25
|
+
var version = typeof "6.0.0-alpha.43" === 'string' ? "6.0.0-alpha.43" : null;
|
26
26
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
27
27
|
/**
|
28
28
|
* 拓扑显示和编辑
|
@@ -78,7 +78,7 @@ var Topo = /*#__PURE__*/function () {
|
|
78
78
|
|
79
79
|
this.test = new Test(this);
|
80
80
|
this.uid = topoFactory.add(options.name, this);
|
81
|
-
this.
|
81
|
+
this.selectionModel = new SelectionModel(this);
|
82
82
|
};
|
83
83
|
|
84
84
|
_proto.destroy = function destroy() {
|
@@ -1,10 +1,43 @@
|
|
1
|
+
import _Form from "@alifd/next/es/form";
|
2
|
+
import _Field from "@alifd/next/es/field";
|
1
3
|
import _extends from "@babel/runtime/helpers/extends";
|
2
|
-
import
|
3
|
-
import
|
4
|
+
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
5
|
+
import React, { useEffect } from 'react';
|
4
6
|
import BindExitLinkSelect from "./link/BindExitLinkSelect";
|
7
|
+
|
8
|
+
function parseValues(values, edge) {
|
9
|
+
return _extends({}, values);
|
10
|
+
}
|
11
|
+
|
5
12
|
export default function EdgePropertyView(props) {
|
6
|
-
var
|
7
|
-
|
8
|
-
|
9
|
-
|
13
|
+
var topo = props.topo,
|
14
|
+
edge = props.edge,
|
15
|
+
values = props.values,
|
16
|
+
_onChange = props.onChange,
|
17
|
+
editorProps = props.editorProps,
|
18
|
+
extraDisplaySetting = props.extraDisplaySetting;
|
19
|
+
var store = topo.store;
|
20
|
+
|
21
|
+
var field = _Field.useField({
|
22
|
+
autoUnmount: false,
|
23
|
+
values: parseValues(values, edge),
|
24
|
+
onChange: function onChange(name, value) {
|
25
|
+
rlog.debug('CommonEdgePropertyView', name, value);
|
26
|
+
var newValues = field.getValues();
|
27
|
+
|
28
|
+
_onChange(name, value, newValues);
|
29
|
+
}
|
30
|
+
});
|
31
|
+
|
32
|
+
useEffect(function () {
|
33
|
+
field.setValues(parseValues(values, edge));
|
34
|
+
}, [values]);
|
35
|
+
return /*#__PURE__*/React.createElement("div", {
|
36
|
+
style: {
|
37
|
+
margin: '12px 0 0 32px'
|
38
|
+
}
|
39
|
+
}, /*#__PURE__*/React.createElement(_Form, {
|
40
|
+
field: field,
|
41
|
+
labelAlign: "top"
|
42
|
+
}, /*#__PURE__*/React.createElement(_Form.Item, null, /*#__PURE__*/React.createElement(BindExitLinkSelect, props))));
|
10
43
|
}
|
package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js
CHANGED
@@ -1,37 +1,31 @@
|
|
1
|
-
import _Tab from "@alifd/next/es/tab";
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
3
|
-
import
|
4
|
-
import
|
2
|
+
import NoDataPage from '@riil-frontend/component-no-data-page';
|
3
|
+
import React from 'react';
|
5
4
|
import Data from "./Data";
|
6
|
-
import Setting from "./Setting";
|
7
5
|
export default function LinkPropertyView(props) {
|
8
6
|
var edge = props.edge,
|
9
7
|
topo = props.topo; // 无权限不显示数据页签
|
10
8
|
|
11
|
-
var _topo$store$useModelS = topo.store.useModelState(
|
9
|
+
var _topo$store$useModelS = topo.store.useModelState('topoMod').data,
|
12
10
|
links = _topo$store$useModelS.links,
|
13
11
|
linkGroups = _topo$store$useModelS.linkGroups;
|
14
12
|
var link = [].concat(links, linkGroups).find(function (item) {
|
15
13
|
return item.id === edge.getTag();
|
16
|
-
});
|
14
|
+
});
|
17
15
|
|
18
16
|
if (link) {
|
19
17
|
var readable = link.permission.readable;
|
20
18
|
|
21
19
|
if (!readable) {
|
22
|
-
return /*#__PURE__*/React.createElement(
|
20
|
+
return /*#__PURE__*/React.createElement(NoDataPage, {
|
21
|
+
statusCode: "\u6CA1\u6709\u67E5\u770B\u6743\u9650"
|
22
|
+
});
|
23
23
|
}
|
24
24
|
} else {
|
25
|
-
return
|
25
|
+
return null;
|
26
26
|
}
|
27
27
|
|
28
|
-
return /*#__PURE__*/React.createElement(
|
29
|
-
title: "\u6570\u636E",
|
30
|
-
key: "1"
|
31
|
-
}, /*#__PURE__*/React.createElement(Data, _extends({}, props, {
|
28
|
+
return /*#__PURE__*/React.createElement(Data, _extends({}, props, {
|
32
29
|
link: link
|
33
|
-
}))
|
34
|
-
title: "\u8BBE\u7F6E",
|
35
|
-
key: "2"
|
36
|
-
}, /*#__PURE__*/React.createElement(Setting, props)));
|
30
|
+
}));
|
37
31
|
}
|
package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyViewV1.js
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
import _Tab from "@alifd/next/es/tab";
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
3
|
+
import React from 'react';
|
4
|
+
import TabView from "../../../../../../core/editor/components/settings/common/tab/TabView";
|
5
|
+
import Data from "./Data";
|
6
|
+
import Setting from "./Setting";
|
7
|
+
export default function LinkPropertyView(props) {
|
8
|
+
var edge = props.edge,
|
9
|
+
topo = props.topo; // 无权限不显示数据页签
|
10
|
+
|
11
|
+
var _topo$store$useModelS = topo.store.useModelState('topoMod').data,
|
12
|
+
links = _topo$store$useModelS.links,
|
13
|
+
linkGroups = _topo$store$useModelS.linkGroups;
|
14
|
+
var link = [].concat(links, linkGroups).find(function (item) {
|
15
|
+
return item.id === edge.getTag();
|
16
|
+
}); // console.log('LinkPropertyView',link)
|
17
|
+
|
18
|
+
if (link) {
|
19
|
+
var readable = link.permission.readable;
|
20
|
+
|
21
|
+
if (!readable) {
|
22
|
+
return /*#__PURE__*/React.createElement(Setting, props);
|
23
|
+
}
|
24
|
+
} else {
|
25
|
+
return /*#__PURE__*/React.createElement(Setting, props);
|
26
|
+
}
|
27
|
+
|
28
|
+
return /*#__PURE__*/React.createElement(TabView, null, /*#__PURE__*/React.createElement(_Tab.Item, {
|
29
|
+
title: "\u6570\u636E",
|
30
|
+
key: "1"
|
31
|
+
}, /*#__PURE__*/React.createElement(Data, _extends({}, props, {
|
32
|
+
link: link
|
33
|
+
}))), /*#__PURE__*/React.createElement(_Tab.Item, {
|
34
|
+
title: "\u8BBE\u7F6E",
|
35
|
+
key: "2"
|
36
|
+
}, /*#__PURE__*/React.createElement(Setting, props)));
|
37
|
+
}
|
@@ -54,13 +54,13 @@ var LinkDynamicStyleExecutor = /*#__PURE__*/function () {
|
|
54
54
|
var _this = this;
|
55
55
|
|
56
56
|
var topo = this.topo;
|
57
|
-
topo.historyManager && topo.historyManager.setDisabled(true, '链路动态样式');
|
58
57
|
|
59
58
|
var _topo$dataModel$getDa = topo.dataModel.getData(),
|
60
59
|
links = _topo$dataModel$getDa.links,
|
61
60
|
linkGroups = _topo$dataModel$getDa.linkGroups;
|
62
61
|
|
63
|
-
var dataModel = this.topo.getDataModel();
|
62
|
+
var dataModel = this.topo.getDataModel();
|
63
|
+
topo.historyManager && topo.historyManager.setDisabled(true, '链路动态样式'); // 1、如果连线可见,设置线宽
|
64
64
|
|
65
65
|
links.forEach(function (link) {
|
66
66
|
var edge = dataModel.getDataByTag(link.id);
|
package/es/style.js
CHANGED
@@ -38,8 +38,8 @@ import '@alifd/next/es/menu/style';
|
|
38
38
|
import '@alifd/next/es/collapse/style';
|
39
39
|
import '@alifd/next/es/select/style';
|
40
40
|
import '@alifd/next/es/number-picker/style';
|
41
|
-
|
42
41
|
import '@alifd/next/es/tag/style';
|
42
|
+
|
43
43
|
import '@riil-frontend/component-riil-event-emitter/es/style';
|
44
44
|
import '@alifd/next/es/range/style';
|
45
45
|
import './index.scss';
|
@@ -9,6 +9,8 @@ var _tab = _interopRequireDefault(require("@alifd/next/lib/tab"));
|
|
9
9
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
11
11
|
|
12
|
+
var _balloon = _interopRequireDefault(require("@alifd/next/lib/balloon"));
|
13
|
+
|
12
14
|
var _react = _interopRequireWildcard(require("react"));
|
13
15
|
|
14
16
|
var _classnames = _interopRequireDefault(require("classnames"));
|
@@ -26,8 +28,10 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
26
28
|
*/
|
27
29
|
function CustomTabItem(_ref) {
|
28
30
|
var title = _ref.title,
|
31
|
+
titleTootip = _ref.titleTootip,
|
29
32
|
icon = _ref.icon;
|
30
|
-
|
33
|
+
|
34
|
+
var tabItem = /*#__PURE__*/_react["default"].createElement("div", {
|
31
35
|
className: "v-icon-tab-item"
|
32
36
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
33
37
|
src: icon,
|
@@ -35,6 +39,15 @@ function CustomTabItem(_ref) {
|
|
35
39
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
36
40
|
className: "tab-title"
|
37
41
|
}, title));
|
42
|
+
|
43
|
+
return /*#__PURE__*/_react["default"].createElement(_balloon["default"].Tooltip, {
|
44
|
+
trigger: tabItem,
|
45
|
+
align: "r" // 解决遮挡下拉浮层问题
|
46
|
+
,
|
47
|
+
popupStyle: {
|
48
|
+
zIndex: 1000
|
49
|
+
}
|
50
|
+
}, titleTootip);
|
38
51
|
}
|
39
52
|
/**
|
40
53
|
* 竖向
|
@@ -87,13 +87,18 @@ var _default = function _default(props) {
|
|
87
87
|
case 7:
|
88
88
|
extraOnOk = displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onOk;
|
89
89
|
|
90
|
-
if (extraOnOk) {
|
91
|
-
|
90
|
+
if (!extraOnOk) {
|
91
|
+
_context2.next = 11;
|
92
|
+
break;
|
92
93
|
}
|
93
94
|
|
95
|
+
_context2.next = 11;
|
96
|
+
return extraOnOk(displayConfig);
|
97
|
+
|
98
|
+
case 11:
|
94
99
|
topo.historyManager.endTransaction();
|
95
100
|
|
96
|
-
case
|
101
|
+
case 12:
|
97
102
|
case "end":
|
98
103
|
return _context2.stop();
|
99
104
|
}
|
@@ -147,7 +147,7 @@ var Topology = function Topology(props) {
|
|
147
147
|
return function () {
|
148
148
|
_rlog["default"].info('TopoView 退出');
|
149
149
|
|
150
|
-
topo.
|
150
|
+
topo.selectionModel.destroy();
|
151
151
|
topoDispatchers.reset();
|
152
152
|
};
|
153
153
|
}, []);
|
@@ -177,7 +177,7 @@ var Topology = function Topology(props) {
|
|
177
177
|
topo.historyManager = new _HistoryManager["default"](topo, htHistoryManager);
|
178
178
|
}
|
179
179
|
|
180
|
-
topo.
|
180
|
+
topo.selectionModel.init();
|
181
181
|
topoDispatchers.update({
|
182
182
|
graphLoaded2: true
|
183
183
|
});
|
@@ -197,7 +197,7 @@ var Topology = function Topology(props) {
|
|
197
197
|
(0, _graphLinkUtil.fixLink)(topo);
|
198
198
|
(0, _clusterUtil.handleClusterNoPermission)(topo);
|
199
199
|
(0, _edgeUtil.updateEdgeExpanded)(topo);
|
200
|
-
topo.
|
200
|
+
topo.selectionModel.init();
|
201
201
|
topoDispatchers.update({
|
202
202
|
graphLoaded: true
|
203
203
|
});
|
@@ -16,28 +16,33 @@ var _ImagePanel = _interopRequireDefault(require("./views/ImagePanel"));
|
|
16
16
|
var _LinkPanel = _interopRequireDefault(require("./views/LinkPanel"));
|
17
17
|
|
18
18
|
var panes = [{
|
19
|
-
title: '链路',
|
20
19
|
key: '1',
|
20
|
+
title: '链路',
|
21
|
+
titleTootip: '在两个节点之间添加链路&线',
|
21
22
|
icon: '/img/topo/editor/sidebar/icon/链路.svg',
|
22
23
|
content: _LinkPanel["default"]
|
23
24
|
}, {
|
24
25
|
title: '组件',
|
25
26
|
key: '2',
|
27
|
+
titleTootip: '基础组件',
|
26
28
|
icon: '/img/topo/editor/sidebar/icon/组件.svg',
|
27
29
|
content: _ComponentPanel["default"]
|
28
30
|
}, {
|
29
31
|
title: '图片',
|
30
32
|
key: '3',
|
33
|
+
titleTootip: '图片素材',
|
31
34
|
icon: '/img/topo/editor/sidebar/icon/图片.svg',
|
32
35
|
content: _ImagePanel["default"]
|
33
36
|
}, {
|
34
37
|
title: '背景',
|
35
38
|
key: '4',
|
39
|
+
titleTootip: '背景素材',
|
36
40
|
icon: '/img/topo/editor/sidebar/icon/背景.svg',
|
37
41
|
content: _BackgroundPanel["default"]
|
38
42
|
}, {
|
39
43
|
title: '画布',
|
40
44
|
key: '5',
|
45
|
+
titleTootip: '拓扑图画布底图',
|
41
46
|
icon: '/img/topo/editor/sidebar/icon/画布.svg',
|
42
47
|
content: _CanvasPanel["default"]
|
43
48
|
}];
|
@@ -39,7 +39,7 @@ function AddResourceButton(props) {
|
|
39
39
|
topoEdit = props.topoEdit,
|
40
40
|
editorProps = props.editorProps; // 选中的元素
|
41
41
|
|
42
|
-
var selection = topo.
|
42
|
+
var selection = topo.selectionModel.useSelection();
|
43
43
|
|
44
44
|
var _useState = (0, _react.useState)(getAddType(selection)),
|
45
45
|
addType = _useState[0],
|
package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js
CHANGED
@@ -36,7 +36,7 @@ function BoxBackgroundButton(props) {
|
|
36
36
|
setDisabled = _useState[1]; // 选中的元素
|
37
37
|
|
38
38
|
|
39
|
-
var selection = topo.
|
39
|
+
var selection = topo.selectionModel.useSelection();
|
40
40
|
(0, _react.useEffect)(function () {// setDisabled(false)
|
41
41
|
}, [selection]);
|
42
42
|
var icon = disabled ? /*#__PURE__*/_react["default"].createElement("img", {
|
@@ -48,7 +48,7 @@ function EdgeColorButton(props) {
|
|
48
48
|
graphLoaded = _topo$store$useModelS.graphLoaded; // 选中的元素
|
49
49
|
|
50
50
|
|
51
|
-
var selection = topo.
|
51
|
+
var selection = topo.selectionModel.useHtSelection();
|
52
52
|
|
53
53
|
var loopEdges = function loopEdges(edges, operateEdgeFn) {
|
54
54
|
edges.forEach(function (edge) {
|
@@ -46,7 +46,7 @@ function EdgeTypeButton(props) {
|
|
46
46
|
graphLoaded = _topo$store$useModelS.graphLoaded; // 选中的元素
|
47
47
|
|
48
48
|
|
49
|
-
var selection = topo.
|
49
|
+
var selection = topo.selectionModel.useHtSelection();
|
50
50
|
(0, _react.useEffect)(function () {
|
51
51
|
if (graphLoaded) {
|
52
52
|
var edges = (0, _edgeTypeStyleUtil.getEdgesBySelection)(topo);
|