@riil-frontend/component-topology 6.0.0-alpha.40 → 6.0.0-alpha.41
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 +1 -1
- package/es/components/ColorPanel/components/FontColorRange/index.module.scss +3 -0
- package/es/core/editor/components/Sidebar/views/CanvasPanel/themes.js +14 -23
- package/es/core/editor/components/Toolbar/buttons.js +2 -3
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +2 -2
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +2 -1
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +5 -15
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/colorUtil.js +2 -4
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +19 -12
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/layerTitle.js +2 -0
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +16 -5
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +23 -9
- package/es/core/hooks/useCanvasTheme.js +13 -1
- package/es/core/models/HistoryManager.js +1 -0
- package/es/core/models/SelectionManager.js +15 -11
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/selection/ignoreList.js +1 -0
- package/es/core/models/utils/linkUtils.js +4 -5
- package/es/core/store/models/topoConfig.js +10 -12
- package/es/core/utils/edgeUtil.js +6 -0
- package/lib/components/ColorPanel/components/FontColorRange/index.module.scss +3 -0
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/themes.js +18 -23
- package/lib/core/editor/components/Toolbar/buttons.js +2 -3
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +2 -2
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +2 -1
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +5 -15
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/colorUtil.js +2 -4
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +24 -12
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/layerTitle.js +2 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +17 -5
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +23 -7
- package/lib/core/hooks/useCanvasTheme.js +13 -1
- package/lib/core/models/HistoryManager.js +1 -0
- package/lib/core/models/SelectionManager.js +16 -11
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/selection/ignoreList.js +6 -0
- package/lib/core/models/utils/linkUtils.js +4 -5
- package/lib/core/store/models/topoConfig.js +9 -18
- package/lib/core/utils/edgeUtil.js +6 -0
- package/package.json +2 -2
@@ -1,8 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
label: '白色',
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
var baseLightTheme = {
|
4
3
|
color: '#FFFFFF',
|
5
|
-
toolsTheme: 'lightgrayblue',
|
6
4
|
globalNodeLabelColor: '#4d6277',
|
7
5
|
globalEdgeTagColor: '#4d6277',
|
8
6
|
text: {
|
@@ -14,31 +12,23 @@ var THEMES = [{
|
|
14
12
|
// 标题背景颜色
|
15
13
|
'group.title.color': '#4D6277',
|
16
14
|
// 标题文字颜色
|
15
|
+
'group.background': 'rgba(76, 137, 255, 0.1)',
|
17
16
|
'group.border.color': '#E4E9EE' // 边框颜色
|
18
17
|
|
19
18
|
}
|
20
19
|
}
|
21
|
-
}
|
20
|
+
};
|
21
|
+
var THEMES = [_extends({}, baseLightTheme, {
|
22
|
+
name: 'white',
|
23
|
+
label: '白色',
|
24
|
+
color: '#FFFFFF',
|
25
|
+
toolsTheme: 'lightgrayblue'
|
26
|
+
}), _extends({}, baseLightTheme, {
|
22
27
|
name: 'lightblue',
|
23
28
|
label: '蓝色',
|
24
29
|
color: '#F9FBFF',
|
25
|
-
toolsTheme: 'white'
|
26
|
-
|
27
|
-
globalEdgeTagColor: '#4d6277',
|
28
|
-
text: {
|
29
|
-
color: '#4d6277'
|
30
|
-
},
|
31
|
-
group: {
|
32
|
-
style: {
|
33
|
-
'group.title.background': '#E4E9EE',
|
34
|
-
// 标题背景颜色
|
35
|
-
'group.title.color': '#4D6277',
|
36
|
-
// 标题文字颜色
|
37
|
-
'group.border.color': '#E4E9EE' // 边框颜色
|
38
|
-
|
39
|
-
}
|
40
|
-
}
|
41
|
-
}, // {
|
30
|
+
toolsTheme: 'white'
|
31
|
+
}), // {
|
42
32
|
// name: 'yellow',
|
43
33
|
// label: '黄色',
|
44
34
|
// color: '#FFFDE6',
|
@@ -64,7 +54,8 @@ var THEMES = [{
|
|
64
54
|
// 标题背景颜色
|
65
55
|
'group.title.color': '#FFFFFF',
|
66
56
|
// 标题文字颜色
|
67
|
-
'group.
|
57
|
+
'group.background': 'rgba(29,55,113,0.6)',
|
58
|
+
'group.border.color': 'rgba(8,165,244,0.8)' // 边框颜色
|
68
59
|
|
69
60
|
}
|
70
61
|
}
|
@@ -26,9 +26,8 @@ export default function getButtons(isNetworkTopo) {
|
|
26
26
|
FontSizeWidget, // 字号
|
27
27
|
FontStyleButton, // 文字样式
|
28
28
|
FontColorButton, // 文字颜色
|
29
|
-
Divider,
|
30
|
-
//
|
31
|
-
EdgeColorButton, // 线条颜色
|
29
|
+
Divider, BoxBackgroundButton, // 框背景
|
30
|
+
Divider, EdgeColorButton, // 线条颜色
|
32
31
|
EdgeTypeButton, // 线形
|
33
32
|
Divider, NodeImageButton, // 替换图片
|
34
33
|
NodeSizeButton, // 图片尺寸
|
package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js
CHANGED
@@ -21,8 +21,7 @@ function BoxBackgroundButton(props) {
|
|
21
21
|
|
22
22
|
|
23
23
|
var selection = topo.selectionManager.useSelection();
|
24
|
-
useEffect(function () {
|
25
|
-
setDisabled(false);
|
24
|
+
useEffect(function () {// setDisabled(false)
|
26
25
|
}, [selection]);
|
27
26
|
var icon = disabled ? /*#__PURE__*/React.createElement("img", {
|
28
27
|
src: "/img/topo/editor/toolbar/\u80CC\u666F\u586B\u5145\u53CA\u8FB9\u6846/Disable.svg",
|
@@ -34,6 +33,7 @@ function BoxBackgroundButton(props) {
|
|
34
33
|
return /*#__PURE__*/React.createElement(WidgetBox, {
|
35
34
|
label: "\u6846\u80CC\u666F",
|
36
35
|
tooltip: "\u6846\u80CC\u666F",
|
36
|
+
disabled: disabled,
|
37
37
|
showLabel: showLabel
|
38
38
|
}, /*#__PURE__*/React.createElement(DropdownButton, {
|
39
39
|
disabled: disabled,
|
@@ -120,7 +120,8 @@ function EdgeColorButton(props) {
|
|
120
120
|
return /*#__PURE__*/React.createElement(WidgetBox, {
|
121
121
|
label: "\u7EBF\u6761\u989C\u8272",
|
122
122
|
tooltip: "\u7EBF\u6761\u989C\u8272",
|
123
|
-
showLabel: showLabel
|
123
|
+
showLabel: showLabel,
|
124
|
+
disabled: disabled
|
124
125
|
}, /*#__PURE__*/React.createElement(DropdownButton, {
|
125
126
|
disabled: disabled,
|
126
127
|
trigger: icon
|
@@ -7,7 +7,7 @@ import FontColorRange from "../../../../../components/ColorPanel/components/Font
|
|
7
7
|
import styles from "./FontColorButton.module.scss";
|
8
8
|
import textStyleSettingRouter from "./components/textStyleSetting/textStyleSettingRouter.js";
|
9
9
|
|
10
|
-
function
|
10
|
+
function FontColorDropdown(props) {
|
11
11
|
var onChange = props.onChange,
|
12
12
|
topo = props.topo,
|
13
13
|
color = props.color,
|
@@ -20,25 +20,19 @@ function FontFamilySelect(props) {
|
|
20
20
|
|
21
21
|
var backOpacityChange = function backOpacityChange(value) {
|
22
22
|
onChange({
|
23
|
-
color: color,
|
24
|
-
background: background,
|
25
23
|
opacity: value / 100
|
26
24
|
});
|
27
25
|
};
|
28
26
|
|
29
27
|
var colorChang = function colorChang(value) {
|
30
28
|
onChange({
|
31
|
-
color: value
|
32
|
-
background: background,
|
33
|
-
opacity: opacity
|
29
|
+
color: value
|
34
30
|
});
|
35
31
|
};
|
36
32
|
|
37
33
|
var backgroundChang = function backgroundChang(value) {
|
38
34
|
onChange({
|
39
|
-
|
40
|
-
background: value.hex,
|
41
|
-
opacity: opacity
|
35
|
+
background: value
|
42
36
|
});
|
43
37
|
};
|
44
38
|
|
@@ -86,17 +80,13 @@ function FontColorButton(props) {
|
|
86
80
|
label: "\u6587\u5B57\u989C\u8272",
|
87
81
|
tooltip: "\u6587\u5B57\u989C\u8272",
|
88
82
|
showLabel: showLabel
|
89
|
-
}, /*#__PURE__*/React.createElement(
|
83
|
+
}, /*#__PURE__*/React.createElement(FontColorDropdown, {
|
90
84
|
color: style.color,
|
91
85
|
background: style.background,
|
92
86
|
opacity: style.opacity,
|
93
87
|
onChange: function onChange(val) {
|
94
88
|
topo.historyManager.beginTransaction();
|
95
|
-
setStyle(
|
96
|
-
color: val.color,
|
97
|
-
background: val.background,
|
98
|
-
opacity: val.opacity
|
99
|
-
});
|
89
|
+
setStyle(val);
|
100
90
|
topo.historyManager.endTransaction();
|
101
91
|
},
|
102
92
|
topo: topo
|
@@ -24,13 +24,11 @@ export function parseColor(colorStr) {
|
|
24
24
|
};
|
25
25
|
}
|
26
26
|
export function parseBackground(colorStr) {
|
27
|
-
var _background$rgb;
|
28
|
-
|
29
27
|
var background = parseColor(colorStr);
|
30
28
|
return {
|
31
29
|
background: background,
|
32
30
|
// 背景颜色,格式: {rgba: {}, hex: ''} | null
|
33
|
-
opacity: background
|
31
|
+
opacity: background ? background.rgb.a : 1 // 背景透明度。值范围 0-1, null,null表示无
|
34
32
|
|
35
33
|
};
|
36
34
|
}
|
@@ -57,5 +55,5 @@ export function formatBackgroundRgbaColor(prevColor, currentColor) {
|
|
57
55
|
}
|
58
56
|
|
59
57
|
var rgb = background.rgb;
|
60
|
-
return "rgba(" + rgb.r + ", " + rgb.g + ", " + rgb.b + ", " + opacity + ")";
|
58
|
+
return "rgba(" + rgb.r + ", " + rgb.g + ", " + rgb.b + ", " + (opacity === null ? 1 : opacity) + ")";
|
61
59
|
}
|
@@ -1,17 +1,24 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import fontStyleUtil from "../../../../../../settings/common/text/fontStyleUtil";
|
3
|
+
import { formatBackgroundRgbaColor, parseBackground, parseColor } from "../colorUtil";
|
1
4
|
export function getTextStyle(element) {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
//
|
11
|
-
|
12
|
-
|
5
|
+
var underline = null;
|
6
|
+
return _extends({
|
7
|
+
color: parseColor(element.a('link_ind_left_color')),
|
8
|
+
underline: underline
|
9
|
+
}, fontStyleUtil.toMap(element.a('link_ind_left_font')), parseBackground(element.a('link_ind_background')));
|
10
|
+
}
|
11
|
+
export function setTextStyle(element, style, topo) {
|
12
|
+
if ('background' in style || 'opacity' in style) {
|
13
|
+
// 背景颜色
|
14
|
+
var prevStyle = getTextStyle(element);
|
15
|
+
topo.getHtTopo().setEdgeLabelStyle(element, {
|
16
|
+
background: formatBackgroundRgbaColor(prevStyle, style)
|
17
|
+
});
|
18
|
+
} else {
|
19
|
+
topo.getHtTopo().setEdgeLabelStyle(element, style);
|
20
|
+
}
|
13
21
|
}
|
14
|
-
export function setTextStyle(element, style) {}
|
15
22
|
export default {
|
16
23
|
getTextStyle: getTextStyle,
|
17
24
|
setTextStyle: setTextStyle
|
@@ -11,6 +11,8 @@ function setLabelStyle(element, style) {
|
|
11
11
|
element.a('labelStyle', _extends({}, element.a('labelStyle'), style)); // eslint-disable-next-line no-underscore-dangle
|
12
12
|
|
13
13
|
element.__labelNode.a(style);
|
14
|
+
|
15
|
+
console.error(element.__labelNode.getAttrObject());
|
14
16
|
} // 分层标题文字样式
|
15
17
|
|
16
18
|
|
@@ -1,4 +1,6 @@
|
|
1
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
3
|
+
var _excluded = ["color", "background", "opacity"];
|
2
4
|
import fontStyleUtil from "../../../../../../settings/common/text/fontStyleUtil";
|
3
5
|
import { formatBackgroundRgbaColor, parseBackground, parseColor } from "../colorUtil";
|
4
6
|
export function getTextStyle(element) {
|
@@ -9,15 +11,24 @@ export function getTextStyle(element) {
|
|
9
11
|
}, fontStyleUtil.toMap(element.a('ht.font')), parseBackground(element.a('ht.background')));
|
10
12
|
}
|
11
13
|
export function setTextStyle(element, style, topo) {
|
14
|
+
var color = style.color,
|
15
|
+
background = style.background,
|
16
|
+
opacity = style.opacity,
|
17
|
+
otherStyle = _objectWithoutPropertiesLoose(style, _excluded);
|
18
|
+
|
19
|
+
var tagStyle = _extends({}, otherStyle);
|
20
|
+
|
21
|
+
if ('color' in style) {
|
22
|
+
tagStyle.color = color.hex;
|
23
|
+
}
|
24
|
+
|
12
25
|
if ('background' in style || 'opacity' in style) {
|
13
26
|
// 背景颜色
|
14
27
|
var prevStyle = getTextStyle(element);
|
15
|
-
|
16
|
-
background: formatBackgroundRgbaColor(prevStyle, style)
|
17
|
-
});
|
18
|
-
} else {
|
19
|
-
topo.getHtTopo().setNodeLabelStyle(element, style);
|
28
|
+
tagStyle.background = formatBackgroundRgbaColor(prevStyle, style);
|
20
29
|
}
|
30
|
+
|
31
|
+
topo.getHtTopo().setNodeLabelStyle(element, tagStyle);
|
21
32
|
}
|
22
33
|
export default {
|
23
34
|
getTextStyle: getTextStyle,
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import { formatBackgroundRgbaColor, parseBackground } from "../ElementTextStyleSetting/colorUtil";
|
2
3
|
var defaultStyle = {
|
3
4
|
color: '#AFB9C2',
|
4
5
|
fontFamily: '微软雅黑'
|
@@ -7,13 +8,11 @@ export function useValues(topo) {
|
|
7
8
|
var displayConfigState = topo.store.useModelState('displayConfig');
|
8
9
|
var nodeLabelStyle = displayConfigState.nodeLabelStyle,
|
9
10
|
defaultEdgeLabelStyle = displayConfigState.defaultEdgeLabelStyle;
|
10
|
-
return {
|
11
|
+
return _extends({
|
11
12
|
color: (nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.color) || defaultStyle.color,
|
12
13
|
fontFamily: (nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.fontFamily) || defaultStyle.fontFamily,
|
13
|
-
fontSize: nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.fontSize
|
14
|
-
|
15
|
-
opacity: nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.opacity
|
16
|
-
};
|
14
|
+
fontSize: nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.fontSize
|
15
|
+
}, parseBackground(nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.background));
|
17
16
|
}
|
18
17
|
export var setGlobalTagStyle = function setGlobalTagStyle(topo, styleData) {
|
19
18
|
var _topo$store$getModel = topo.store.getModel('displayConfig'),
|
@@ -22,17 +21,32 @@ export var setGlobalTagStyle = function setGlobalTagStyle(topo, styleData) {
|
|
22
21
|
|
23
22
|
var nodeLabelStyle = displayConfigState.nodeLabelStyle,
|
24
23
|
defaultEdgeLabelStyle = displayConfigState.defaultEdgeLabelStyle;
|
24
|
+
var style = buildStyle(styleData, nodeLabelStyle);
|
25
25
|
|
26
|
-
var globalNodeLabelStyle = _extends({}, nodeLabelStyle,
|
26
|
+
var globalNodeLabelStyle = _extends({}, nodeLabelStyle, style);
|
27
27
|
|
28
28
|
topo.getHtTopo().setGlobalNodeLabelStyle(globalNodeLabelStyle);
|
29
|
-
|
30
|
-
var globalEdgeTagStyle = _extends({}, defaultEdgeLabelStyle, styleData);
|
31
|
-
|
29
|
+
var globalEdgeTagStyle = globalNodeLabelStyle;
|
32
30
|
topo.getHtTopo().setGlobalEdgeTagStyle(globalEdgeTagStyle);
|
33
31
|
displayConfigDispatchers.update({
|
34
32
|
nodeLabelStyle: globalNodeLabelStyle,
|
35
33
|
defaultEdgeLabelStyle: globalEdgeTagStyle
|
36
34
|
});
|
37
35
|
};
|
36
|
+
|
37
|
+
function buildStyle(styleData, prevTagStyle) {
|
38
|
+
var style = {};
|
39
|
+
|
40
|
+
if ('color' in styleData) {
|
41
|
+
style.color = styleData.color.hex;
|
42
|
+
}
|
43
|
+
|
44
|
+
if ('background' in styleData || 'opacity' in styleData) {
|
45
|
+
var prevBackgroundStyle = parseBackground(prevTagStyle === null || prevTagStyle === void 0 ? void 0 : prevTagStyle.background);
|
46
|
+
style.background = formatBackgroundRgbaColor(prevBackgroundStyle, styleData);
|
47
|
+
}
|
48
|
+
|
49
|
+
return style;
|
50
|
+
}
|
51
|
+
|
38
52
|
export function setStyle() {}
|
@@ -40,7 +40,19 @@ export default function useCanvasTheme(props) {
|
|
40
40
|
var themeConfig = themeMap[canvasTheme];
|
41
41
|
|
42
42
|
if (graphLoaded && themeConfig) {
|
43
|
-
|
43
|
+
var _topo$historyManager2;
|
44
|
+
|
45
|
+
try {
|
46
|
+
var _topo$historyManager;
|
47
|
+
|
48
|
+
(_topo$historyManager = topo.historyManager) === null || _topo$historyManager === void 0 ? void 0 : _topo$historyManager.setDisabled(true, '切换主题');
|
49
|
+
topo.getHtTopo().setToolsTheme(themeConfig.toolsTheme);
|
50
|
+
topo.getHtTopo().setTheme(canvasTheme);
|
51
|
+
} catch (error) {
|
52
|
+
console.error('切换主题失败', error);
|
53
|
+
}
|
54
|
+
|
55
|
+
(_topo$historyManager2 = topo.historyManager) === null || _topo$historyManager2 === void 0 ? void 0 : _topo$historyManager2.setDisabled(false, '切换主题');
|
44
56
|
}
|
45
57
|
}, [canvasTheme, graphLoaded]);
|
46
58
|
return {
|
@@ -9,6 +9,7 @@ var HistoryManager = /*#__PURE__*/function () {
|
|
9
9
|
this.storeHistory = [];
|
10
10
|
this.topo = topo;
|
11
11
|
this.htHistoryManager = htHistoryManager;
|
12
|
+
htHistoryManager.clear();
|
12
13
|
rlog.info('HistoryManager 初始化', htHistoryManager);
|
13
14
|
this.updateStore = this.updateStore.bind(this);
|
14
15
|
this.init();
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
2
|
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
3
3
|
import useHtElements from "../common/hooks/useHtElements";
|
4
|
+
import ignoreList from "./selection/ignoreList";
|
4
5
|
|
5
6
|
var SelectionManager = /*#__PURE__*/function () {
|
6
7
|
function SelectionManager(topo) {
|
@@ -12,11 +13,12 @@ var SelectionManager = /*#__PURE__*/function () {
|
|
12
13
|
this.setSelection = function (selection) {
|
13
14
|
var selectionDispatchers = _this.topo.store.getModelDispatchers('selection');
|
14
15
|
|
16
|
+
_this.selectionIds = selection.map(function (item) {
|
17
|
+
return item.id;
|
18
|
+
});
|
15
19
|
selectionDispatchers.update({
|
16
20
|
selection: selection,
|
17
|
-
selectionIds:
|
18
|
-
return item.id;
|
19
|
-
})
|
21
|
+
selectionIds: _this.selectionIds
|
20
22
|
});
|
21
23
|
};
|
22
24
|
|
@@ -82,19 +84,21 @@ var SelectionManager = /*#__PURE__*/function () {
|
|
82
84
|
var property = e.property,
|
83
85
|
data = e.data;
|
84
86
|
|
85
|
-
if (
|
87
|
+
if (!this.selectionIds.includes(data.getId())) {
|
86
88
|
return;
|
87
89
|
}
|
88
90
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
});
|
91
|
+
if (ignoreList.indexOf(property) !== -1) {
|
92
|
+
return;
|
93
|
+
}
|
93
94
|
|
94
|
-
if (
|
95
|
-
|
96
|
-
this.updateSelection();
|
95
|
+
if (!window.aa) {
|
96
|
+
window.aa = [];
|
97
97
|
}
|
98
|
+
|
99
|
+
window.aa.push(e); // console.info('PropertyChangeListener', e);
|
100
|
+
|
101
|
+
this.updateSelection();
|
98
102
|
};
|
99
103
|
|
100
104
|
_proto.initListener = function initListener() {
|
@@ -22,7 +22,7 @@ import topoFactory from "./topoFactory";
|
|
22
22
|
import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
|
23
23
|
import SelectionManager from "./SelectionManager"; // eslint-disable-next-line no-undef
|
24
24
|
|
25
|
-
var version = typeof "6.0.0-alpha.
|
25
|
+
var version = typeof "6.0.0-alpha.41" === 'string' ? "6.0.0-alpha.41" : null;
|
26
26
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
27
27
|
/**
|
28
28
|
* 拓扑显示和编辑
|
@@ -0,0 +1 @@
|
|
1
|
+
export default ['position', 'childChange', 'a:scale', 'icons', 'a:dataSource', 'a:dataTipSource', 'agentChange', 'a:runtimeStyles', 'a:linkArrow', '*', 'a:link_ind_left_arrow', 'a:link_ind_right_arrow', 'a:link_ind_area', 'a:middle_area', 'a:areaRect', 'a:outAreaRect', 'a:link_ind_area_right'];
|
@@ -176,7 +176,7 @@ function _getLinksDetail() {
|
|
176
176
|
|
177
177
|
export function buildTopoLinkData() {}
|
178
178
|
export var compatibleWith = function compatibleWith(value) {
|
179
|
-
console.log("compatibleWith",
|
179
|
+
// console.log("compatibleWith",value);
|
180
180
|
var pluralType = value !== null && value !== void 0 ? value : 2;
|
181
181
|
|
182
182
|
if (value === false) {
|
@@ -200,8 +200,8 @@ export var showLinkByConfig = function showLinkByConfig(props) {
|
|
200
200
|
var _plurals$compatibleWi;
|
201
201
|
|
202
202
|
var topo = props.topo,
|
203
|
-
showType = props.showType;
|
204
|
-
|
203
|
+
showType = props.showType; // console.log("showLinkByConfig-----------------------------", props, showType);
|
204
|
+
//const displayConfig = topo.store.getModelState("displayConfig");
|
205
205
|
|
206
206
|
var types = (_plurals$compatibleWi = plurals[compatibleWith(showType)]) !== null && _plurals$compatibleWi !== void 0 ? _plurals$compatibleWi : []; // 查询所有连线
|
207
207
|
|
@@ -210,8 +210,7 @@ export var showLinkByConfig = function showLinkByConfig(props) {
|
|
210
210
|
var edges = getEdges(dm); // console.log("edges", edges);
|
211
211
|
|
212
212
|
var showPhy = types.indexOf("phy") >= 0;
|
213
|
-
var showAgg = types.indexOf("agg") >= 0;
|
214
|
-
console.log("edges----types", showType, types, showPhy, showAgg);
|
213
|
+
var showAgg = types.indexOf("agg") >= 0; // console.log("edges----types",showType, types,showPhy, showAgg);
|
215
214
|
|
216
215
|
if (Array.isArray(edges) && edges.length > 0) {
|
217
216
|
edges.map(function (edge) {
|
@@ -314,7 +314,7 @@ export default function (topoApp) {
|
|
314
314
|
while (1) {
|
315
315
|
switch (_context4.prev = _context4.next) {
|
316
316
|
case 0:
|
317
|
-
rlog.debug("getTopoByConditions--------", params);
|
317
|
+
// rlog.debug("getTopoByConditions--------", params);
|
318
318
|
topoId = params.id, resources = params.resources, groups = params.groups, exportLinkIdList = params.exportLinkIdList;
|
319
319
|
viewConditions = resToConditions(resources);
|
320
320
|
groupInfo = isAvailableArray(groups) && groups.map(function (group) {
|
@@ -322,24 +322,22 @@ export default function (topoApp) {
|
|
322
322
|
layout: getLayoutId(group.layout),
|
323
323
|
resources: resToConditions(group.resources)
|
324
324
|
});
|
325
|
-
});
|
326
|
-
|
327
|
-
_context4.next =
|
325
|
+
}); // rlog.debug("getTopoByConditions--------", viewConditions, groupInfo);
|
326
|
+
|
327
|
+
_context4.next = 5;
|
328
328
|
return topoService.getTopoDataByResource(topoId, viewConditions, groupInfo, exportLinkIdList);
|
329
329
|
|
330
|
-
case
|
330
|
+
case 5:
|
331
331
|
data = _context4.sent;
|
332
|
-
|
333
|
-
_context4.next = 11;
|
332
|
+
_context4.next = 8;
|
334
333
|
return buildTopoData(data);
|
335
334
|
|
336
|
-
case
|
335
|
+
case 8:
|
337
336
|
data = _context4.sent;
|
338
|
-
|
339
|
-
_context4.next = 15;
|
337
|
+
_context4.next = 11;
|
340
338
|
return Promise.all([topoApp.ciTyeCache.getCiTypeMap(getCiTypes(data)), dispatch.customIcon.loadCustomIcons()]);
|
341
339
|
|
342
|
-
case
|
340
|
+
case 11:
|
343
341
|
_yield$Promise$all = _context4.sent;
|
344
342
|
ciTypeMap = _yield$Promise$all[0];
|
345
343
|
_combTopoData = combTopoData({
|
@@ -367,7 +365,7 @@ export default function (topoApp) {
|
|
367
365
|
topoDataTrans: topoDataTrans
|
368
366
|
});
|
369
367
|
|
370
|
-
case
|
368
|
+
case 19:
|
371
369
|
case "end":
|
372
370
|
return _context4.stop();
|
373
371
|
}
|
@@ -7,6 +7,8 @@ import { showLinkByConfig } from "../models/utils/linkUtils";
|
|
7
7
|
*/
|
8
8
|
|
9
9
|
export var updateEdgeExpanded = function updateEdgeExpanded(topo) {
|
10
|
+
var _topo$historyManager, _topo$historyManager2;
|
11
|
+
|
10
12
|
var _topo$store$getModelS = topo.store.getModelState("topoMod"),
|
11
13
|
viewState = _topo$store$getModelS.viewState;
|
12
14
|
|
@@ -21,6 +23,8 @@ export var updateEdgeExpanded = function updateEdgeExpanded(topo) {
|
|
21
23
|
expandAllEdges = _topo$store$getModelS2.expandAllEdges; // console.log("expandAllEdges----------", expandAllEdges);
|
22
24
|
|
23
25
|
|
26
|
+
(_topo$historyManager = topo.historyManager) === null || _topo$historyManager === void 0 ? void 0 : _topo$historyManager.setDisabled(true, '连线展开控制');
|
27
|
+
|
24
28
|
if (expandAllEdges === 1) {
|
25
29
|
showLinkByConfig({
|
26
30
|
topo: topo,
|
@@ -37,6 +41,8 @@ export var updateEdgeExpanded = function updateEdgeExpanded(topo) {
|
|
37
41
|
rlog.debug("updateEdgeExpanded 展开-isEditMode", isEditMode);
|
38
42
|
}
|
39
43
|
|
44
|
+
(_topo$historyManager2 = topo.historyManager) === null || _topo$historyManager2 === void 0 ? void 0 : _topo$historyManager2.setDisabled(false, '连线展开控制');
|
45
|
+
|
40
46
|
if (topo.linkDynamicStyleExecutor) {
|
41
47
|
topo.linkDynamicStyleExecutor.execute();
|
42
48
|
}
|
@@ -1,12 +1,14 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
3
5
|
exports.__esModule = true;
|
4
6
|
exports["default"] = void 0;
|
5
|
-
|
6
|
-
|
7
|
-
|
7
|
+
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
9
|
+
|
10
|
+
var baseLightTheme = {
|
8
11
|
color: '#FFFFFF',
|
9
|
-
toolsTheme: 'lightgrayblue',
|
10
12
|
globalNodeLabelColor: '#4d6277',
|
11
13
|
globalEdgeTagColor: '#4d6277',
|
12
14
|
text: {
|
@@ -18,31 +20,23 @@ var THEMES = [{
|
|
18
20
|
// 标题背景颜色
|
19
21
|
'group.title.color': '#4D6277',
|
20
22
|
// 标题文字颜色
|
23
|
+
'group.background': 'rgba(76, 137, 255, 0.1)',
|
21
24
|
'group.border.color': '#E4E9EE' // 边框颜色
|
22
25
|
|
23
26
|
}
|
24
27
|
}
|
25
|
-
}
|
28
|
+
};
|
29
|
+
var THEMES = [(0, _extends2["default"])({}, baseLightTheme, {
|
30
|
+
name: 'white',
|
31
|
+
label: '白色',
|
32
|
+
color: '#FFFFFF',
|
33
|
+
toolsTheme: 'lightgrayblue'
|
34
|
+
}), (0, _extends2["default"])({}, baseLightTheme, {
|
26
35
|
name: 'lightblue',
|
27
36
|
label: '蓝色',
|
28
37
|
color: '#F9FBFF',
|
29
|
-
toolsTheme: 'white'
|
30
|
-
|
31
|
-
globalEdgeTagColor: '#4d6277',
|
32
|
-
text: {
|
33
|
-
color: '#4d6277'
|
34
|
-
},
|
35
|
-
group: {
|
36
|
-
style: {
|
37
|
-
'group.title.background': '#E4E9EE',
|
38
|
-
// 标题背景颜色
|
39
|
-
'group.title.color': '#4D6277',
|
40
|
-
// 标题文字颜色
|
41
|
-
'group.border.color': '#E4E9EE' // 边框颜色
|
42
|
-
|
43
|
-
}
|
44
|
-
}
|
45
|
-
}, // {
|
38
|
+
toolsTheme: 'white'
|
39
|
+
}), // {
|
46
40
|
// name: 'yellow',
|
47
41
|
// label: '黄色',
|
48
42
|
// color: '#FFFDE6',
|
@@ -68,7 +62,8 @@ var THEMES = [{
|
|
68
62
|
// 标题背景颜色
|
69
63
|
'group.title.color': '#FFFFFF',
|
70
64
|
// 标题文字颜色
|
71
|
-
'group.
|
65
|
+
'group.background': 'rgba(29,55,113,0.6)',
|
66
|
+
'group.border.color': 'rgba(8,165,244,0.8)' // 边框颜色
|
72
67
|
|
73
68
|
}
|
74
69
|
}
|
@@ -51,9 +51,8 @@ function getButtons(isNetworkTopo) {
|
|
51
51
|
_FontSizeWidget["default"], // 字号
|
52
52
|
_FontStyleButton["default"], // 文字样式
|
53
53
|
_FontColorButton["default"], // 文字颜色
|
54
|
-
_Divider["default"],
|
55
|
-
//
|
56
|
-
_EdgeColorButton["default"], // 线条颜色
|
54
|
+
_Divider["default"], _BoxBackgroundButton["default"], // 框背景
|
55
|
+
_Divider["default"], _EdgeColorButton["default"], // 线条颜色
|
57
56
|
_EdgeTypeButton["default"], // 线形
|
58
57
|
_Divider["default"], _NodeImageButton["default"], // 替换图片
|
59
58
|
_NodeSizeButton["default"], // 图片尺寸
|