@riil-frontend/component-topology 10.0.9 → 10.0.11
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/ColorPanel/index.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +41 -4
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +242 -3
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundUtil.js +187 -0
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxbackgroundSettings.module.scss +83 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +1 -1
- package/es/core/editor/utils/edgeTypeStyleUtil.js +1 -0
- package/es/core/models/TopoApp.js +1 -1
- package/lib/components/ColorPanel/index.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +41 -3
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +252 -3
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundUtil.js +205 -0
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxbackgroundSettings.module.scss +83 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +1 -1
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +1 -0
- package/lib/core/models/TopoApp.js +1 -1
- package/package.json +2 -2
@@ -75,7 +75,7 @@ function ColorPanel(props) {
|
|
75
75
|
};
|
76
76
|
|
77
77
|
useEffect(function () {
|
78
|
-
if (value
|
78
|
+
if (value === undefined) return;
|
79
79
|
if (!value) return setActive('-1');
|
80
80
|
var activeColor = value.hex ? Color(value.hex).rgb() : Color(value).rgb(); // eslint-disable-next-line no-unused-vars, array-callback-return
|
81
81
|
|
package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
2
2
|
var _excluded = ["topo", "showLabel"];
|
3
|
-
import React, { useEffect, useState } from 'react';
|
3
|
+
import React, { useEffect, useState, useMemo } from 'react';
|
4
4
|
import DropdownButton from "../components/DropdownButton";
|
5
5
|
import WidgetBox from "../WidgetBox";
|
6
6
|
import BoxBackgroundSetting from "./BoxBackgroundSetting";
|
7
|
+
import { getHtSelection, getGroupsStyle, setGroupsStyle } from "./BoxBackgroundUtil";
|
7
8
|
/**
|
8
9
|
* 框背景设置
|
9
10
|
* @param {*} props
|
@@ -20,8 +21,41 @@ function BoxBackgroundButton(props) {
|
|
20
21
|
setDisabled = _useState[1]; // 选中的元素
|
21
22
|
|
22
23
|
|
23
|
-
var selection = topo.selectionModel.useSelection();
|
24
|
-
|
24
|
+
var selection = topo.selectionModel.useSelection(); // 拓扑图是否加载
|
25
|
+
|
26
|
+
var _topo$store$useModelS = topo.store.useModelState('topoMod'),
|
27
|
+
graphLoaded = _topo$store$useModelS.graphLoaded;
|
28
|
+
|
29
|
+
var htSelection = useMemo(function () {
|
30
|
+
if (!selection.length) {
|
31
|
+
return [];
|
32
|
+
}
|
33
|
+
|
34
|
+
var elements = topo.getHtTopo().getGraphView().getSelectionModel().getSelection().toArray();
|
35
|
+
return getHtSelection(elements);
|
36
|
+
}, [selection, topo]);
|
37
|
+
var fieldProps = useMemo(function () {
|
38
|
+
if (!graphLoaded) {
|
39
|
+
return {
|
40
|
+
value: {}
|
41
|
+
};
|
42
|
+
}
|
43
|
+
|
44
|
+
return getGroupsStyle(htSelection, topo);
|
45
|
+
}, [graphLoaded, htSelection, topo]);
|
46
|
+
var setStyle = useMemo(function () {
|
47
|
+
return function (style) {
|
48
|
+
htSelection.forEach(function (element) {
|
49
|
+
setGroupsStyle(element, style);
|
50
|
+
});
|
51
|
+
};
|
52
|
+
}, [htSelection]);
|
53
|
+
useEffect(function () {
|
54
|
+
if (htSelection.length && graphLoaded) {
|
55
|
+
setDisabled(false);
|
56
|
+
} else {
|
57
|
+
setDisabled(true);
|
58
|
+
}
|
25
59
|
}, [selection]);
|
26
60
|
var icon = disabled ? /*#__PURE__*/React.createElement("img", {
|
27
61
|
src: "/img/topo/editor/toolbar/\u80CC\u666F\u586B\u5145\u53CA\u8FB9\u6846/Disable.svg",
|
@@ -39,7 +73,10 @@ function BoxBackgroundButton(props) {
|
|
39
73
|
disabled: disabled,
|
40
74
|
trigger: icon
|
41
75
|
}, /*#__PURE__*/React.createElement(BoxBackgroundSetting, {
|
42
|
-
topo: topo
|
76
|
+
topo: topo,
|
77
|
+
fieldProps: fieldProps,
|
78
|
+
setStyle: setStyle,
|
79
|
+
htSelection: htSelection
|
43
80
|
})));
|
44
81
|
}
|
45
82
|
|
package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js
CHANGED
@@ -1,8 +1,247 @@
|
|
1
|
-
import
|
1
|
+
import _NumberPicker from "@alifd/next/es/number-picker";
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
3
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
|
+
import React, { useState } from 'react';
|
5
|
+
import styles from "./BoxbackgroundSettings.module.scss";
|
6
|
+
import ColorPanel from "../../../../../../components/ColorPanel";
|
7
|
+
import FontColorRange from "../../../../../../components/ColorPanel/components/FontColorRange";
|
2
8
|
|
3
9
|
function BoxBackgroundSetting(props) {
|
4
|
-
|
5
|
-
|
10
|
+
var topo = props.topo,
|
11
|
+
fieldProps = props.fieldProps,
|
12
|
+
setStyle = props.setStyle,
|
13
|
+
htSelection = props.htSelection;
|
14
|
+
var borderColor = fieldProps.borderColor,
|
15
|
+
borderOpacity = fieldProps.borderOpacity,
|
16
|
+
backgroundColor = fieldProps.backgroundColor,
|
17
|
+
backgroundOpacity = fieldProps.backgroundOpacity,
|
18
|
+
width = fieldProps.width,
|
19
|
+
pattern = fieldProps.pattern;
|
20
|
+
|
21
|
+
var _useState = useState(pattern && pattern.length > 0 ? pattern[0] : 0),
|
22
|
+
leftInputVal = _useState[0],
|
23
|
+
setLeftInputVal = _useState[1];
|
24
|
+
|
25
|
+
var _useState2 = useState(pattern && pattern.length == 2 ? pattern[1] : 0),
|
26
|
+
rightInputVal = _useState2[0],
|
27
|
+
setRightInputVal = _useState2[1];
|
28
|
+
|
29
|
+
var backOpacityChange = function backOpacityChange(value) {
|
30
|
+
topo.historyManager.beginTransaction();
|
31
|
+
setStyle({
|
32
|
+
backgroundOpacity: (value / 100).toFixed(2) * 1
|
33
|
+
});
|
34
|
+
topo.historyManager.endTransaction();
|
35
|
+
};
|
36
|
+
|
37
|
+
var backgroundChang = /*#__PURE__*/function () {
|
38
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(value, type) {
|
39
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
40
|
+
while (1) {
|
41
|
+
switch (_context.prev = _context.next) {
|
42
|
+
case 0:
|
43
|
+
if (!(type === 'select')) {
|
44
|
+
_context.next = 7;
|
45
|
+
break;
|
46
|
+
}
|
47
|
+
|
48
|
+
topo.historyManager.beginTransaction();
|
49
|
+
_context.next = 4;
|
50
|
+
return setStyle({
|
51
|
+
backgroundColor: value
|
52
|
+
});
|
53
|
+
|
54
|
+
case 4:
|
55
|
+
topo.historyManager.endTransaction();
|
56
|
+
_context.next = 8;
|
57
|
+
break;
|
58
|
+
|
59
|
+
case 7:
|
60
|
+
setStyle({
|
61
|
+
backgroundColor: value
|
62
|
+
});
|
63
|
+
|
64
|
+
case 8:
|
65
|
+
case "end":
|
66
|
+
return _context.stop();
|
67
|
+
}
|
68
|
+
}
|
69
|
+
}, _callee);
|
70
|
+
}));
|
71
|
+
|
72
|
+
return function backgroundChang(_x, _x2) {
|
73
|
+
return _ref.apply(this, arguments);
|
74
|
+
};
|
75
|
+
}();
|
76
|
+
|
77
|
+
var borderOpacityChange = function borderOpacityChange(value) {
|
78
|
+
topo.historyManager.beginTransaction();
|
79
|
+
setStyle({
|
80
|
+
borderOpacity: (value / 100).toFixed(2) * 1
|
81
|
+
});
|
82
|
+
topo.historyManager.endTransaction();
|
83
|
+
};
|
84
|
+
|
85
|
+
var borderWidthChange = function borderWidthChange(value) {
|
86
|
+
topo.historyManager.beginTransaction();
|
87
|
+
setStyle({
|
88
|
+
width: value
|
89
|
+
});
|
90
|
+
topo.historyManager.endTransaction();
|
91
|
+
};
|
92
|
+
|
93
|
+
var borderColorChang = /*#__PURE__*/function () {
|
94
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(value, type) {
|
95
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
96
|
+
while (1) {
|
97
|
+
switch (_context2.prev = _context2.next) {
|
98
|
+
case 0:
|
99
|
+
if (!(type === 'select')) {
|
100
|
+
_context2.next = 7;
|
101
|
+
break;
|
102
|
+
}
|
103
|
+
|
104
|
+
topo.historyManager.beginTransaction();
|
105
|
+
_context2.next = 4;
|
106
|
+
return setStyle({
|
107
|
+
borderColor: value
|
108
|
+
});
|
109
|
+
|
110
|
+
case 4:
|
111
|
+
topo.historyManager.endTransaction();
|
112
|
+
_context2.next = 8;
|
113
|
+
break;
|
114
|
+
|
115
|
+
case 7:
|
116
|
+
setStyle({
|
117
|
+
borderColor: value
|
118
|
+
});
|
119
|
+
|
120
|
+
case 8:
|
121
|
+
case "end":
|
122
|
+
return _context2.stop();
|
123
|
+
}
|
124
|
+
}
|
125
|
+
}, _callee2);
|
126
|
+
}));
|
127
|
+
|
128
|
+
return function borderColorChang(_x3, _x4) {
|
129
|
+
return _ref2.apply(this, arguments);
|
130
|
+
};
|
131
|
+
}();
|
132
|
+
|
133
|
+
var leftInputChange = function leftInputChange(val) {
|
134
|
+
setLeftInputVal(val);
|
135
|
+
topo.historyManager.beginTransaction();
|
136
|
+
setStyle({
|
137
|
+
pattern: [val, rightInputVal]
|
138
|
+
});
|
139
|
+
topo.historyManager.endTransaction();
|
140
|
+
};
|
141
|
+
|
142
|
+
var rightInputChange = function rightInputChange(val) {
|
143
|
+
setRightInputVal(val);
|
144
|
+
topo.historyManager.beginTransaction();
|
145
|
+
setStyle({
|
146
|
+
pattern: [leftInputVal, val]
|
147
|
+
});
|
148
|
+
topo.historyManager.endTransaction();
|
149
|
+
};
|
150
|
+
|
151
|
+
var onFocus = function onFocus() {};
|
152
|
+
|
153
|
+
var onBlur = function onBlur() {};
|
154
|
+
|
155
|
+
return /*#__PURE__*/React.createElement("div", {
|
156
|
+
className: styles.content
|
157
|
+
}, /*#__PURE__*/React.createElement("div", {
|
158
|
+
className: styles.backgroundColor
|
159
|
+
}, /*#__PURE__*/React.createElement("span", null, "\u80CC\u666F\u586B\u5145"), /*#__PURE__*/React.createElement("div", {
|
160
|
+
className: styles.backOpacity
|
161
|
+
}, /*#__PURE__*/React.createElement("img", {
|
162
|
+
src: "/img/topo/editor/toolbar/\u80CC\u666F\u586B\u5145\u53CA\u8FB9\u6846/\u80CC\u666F\u586B\u5145.svg"
|
163
|
+
}), /*#__PURE__*/React.createElement(FontColorRange, {
|
164
|
+
max: 100,
|
165
|
+
min: 0,
|
166
|
+
unit: "%",
|
167
|
+
list: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
|
168
|
+
onChange: backOpacityChange,
|
169
|
+
defaultValue: backgroundOpacity === undefined ? backgroundOpacity : Math.round(backgroundOpacity * 100)
|
170
|
+
})), /*#__PURE__*/React.createElement("div", {
|
171
|
+
style: {
|
172
|
+
marginTop: '10px',
|
173
|
+
marginLeft: '-4px',
|
174
|
+
marginBottom: '3px'
|
175
|
+
}
|
176
|
+
}, /*#__PURE__*/React.createElement(ColorPanel, {
|
177
|
+
showClear: true,
|
178
|
+
value: backgroundColor,
|
179
|
+
onChange: backgroundChang,
|
180
|
+
onPickerFocus: onFocus,
|
181
|
+
onPickerBlur: onBlur
|
182
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
183
|
+
className: styles.borderColor
|
184
|
+
}, /*#__PURE__*/React.createElement("span", null, "\u8FB9\u6846"), /*#__PURE__*/React.createElement("div", {
|
185
|
+
className: styles.borderWidth
|
186
|
+
}, /*#__PURE__*/React.createElement("img", {
|
187
|
+
src: "/img/topo/editor/toolbar/\u80CC\u666F\u586B\u5145\u53CA\u8FB9\u6846/\u80CC\u666F\u586B\u5145.svg"
|
188
|
+
}), /*#__PURE__*/React.createElement(FontColorRange, {
|
189
|
+
max: 10,
|
190
|
+
min: 1,
|
191
|
+
unit: "px",
|
192
|
+
list: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
|
193
|
+
onChange: borderWidthChange,
|
194
|
+
defaultValue: width ? width : 0
|
195
|
+
})), /*#__PURE__*/React.createElement("div", {
|
196
|
+
className: styles.backOpacity
|
197
|
+
}, /*#__PURE__*/React.createElement("img", {
|
198
|
+
src: "/img/topo/editor/toolbar/\u80CC\u666F\u586B\u5145\u53CA\u8FB9\u6846/\u8FB9\u6846.svg"
|
199
|
+
}), /*#__PURE__*/React.createElement(FontColorRange, {
|
200
|
+
max: 100,
|
201
|
+
min: 0,
|
202
|
+
unit: "%",
|
203
|
+
list: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
|
204
|
+
onChange: borderOpacityChange,
|
205
|
+
defaultValue: borderOpacity === undefined ? borderOpacity : Math.round(borderOpacity * 100)
|
206
|
+
})), /*#__PURE__*/React.createElement("div", {
|
207
|
+
className: styles.backOpacity
|
208
|
+
}, /*#__PURE__*/React.createElement("img", {
|
209
|
+
src: "/img/topo/editor/toolbar/\u80CC\u666F\u586B\u5145\u53CA\u8FB9\u6846/\u5B9E\u7EBF\u865A\u7EBF.svg"
|
210
|
+
}), /*#__PURE__*/React.createElement("span", {
|
211
|
+
className: styles.backOpacityLable
|
212
|
+
}, "\u865A\u7EBF"), /*#__PURE__*/React.createElement(_NumberPicker, {
|
213
|
+
size: "small",
|
214
|
+
hasTrigger: false,
|
215
|
+
placeholder: '0',
|
216
|
+
className: styles.leftInput,
|
217
|
+
value: leftInputVal,
|
218
|
+
min: 0,
|
219
|
+
max: 10,
|
220
|
+
onChange: leftInputChange
|
221
|
+
}), /*#__PURE__*/React.createElement("span", {
|
222
|
+
className: styles.backOpacityLable
|
223
|
+
}, "\u95F4\u9694"), /*#__PURE__*/React.createElement(_NumberPicker, {
|
224
|
+
size: "small",
|
225
|
+
hasTrigger: false // eslint-disable-next-line no-nested-ternary
|
226
|
+
,
|
227
|
+
placeholder: '0',
|
228
|
+
className: styles.rightInput,
|
229
|
+
value: rightInputVal,
|
230
|
+
min: 0,
|
231
|
+
max: 10,
|
232
|
+
onChange: rightInputChange
|
233
|
+
})), /*#__PURE__*/React.createElement("div", {
|
234
|
+
style: {
|
235
|
+
marginTop: '10px',
|
236
|
+
marginLeft: '-4px',
|
237
|
+
marginBottom: '3px'
|
238
|
+
}
|
239
|
+
}, /*#__PURE__*/React.createElement(ColorPanel, {
|
240
|
+
value: borderColor,
|
241
|
+
onChange: borderColorChang,
|
242
|
+
onPickerFocus: onFocus,
|
243
|
+
onPickerBlur: onBlur
|
244
|
+
}))));
|
6
245
|
}
|
7
246
|
|
8
247
|
export default BoxBackgroundSetting;
|
@@ -0,0 +1,187 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
3
|
+
var _excluded = ["borderColor", "borderOpacity", "backgroundColor", "backgroundOpacity", "width", "pattern"];
|
4
|
+
import { parseColor, parseBackground, formatBackgroundRgbaColor } from "../components/textStyleSetting/ElementTextStyleSetting/colorUtil";
|
5
|
+
/**
|
6
|
+
* @name getHtSelection 获取选中的框和区域(不包含集群)
|
7
|
+
* @param {*} elements 选中元素列表
|
8
|
+
* @returns Array
|
9
|
+
*/
|
10
|
+
|
11
|
+
export function getHtSelection(elements) {
|
12
|
+
//rectangle
|
13
|
+
return elements.filter(function (i) {
|
14
|
+
return i._layer == 'rectangle' || i instanceof ht.Group && i.a('elementTemplate') !== 'cluster';
|
15
|
+
});
|
16
|
+
}
|
17
|
+
/**
|
18
|
+
* @name getGroupsStyle 获取区域(不包含集群)/框的样式(['backgroundColor','backgtoundOpacity','width','pattern','widthOpacity','widthColor'])
|
19
|
+
* @param {*} htSelection 选中的区域/框元素列表
|
20
|
+
*/
|
21
|
+
|
22
|
+
export function getGroupsStyle(htSelection) {
|
23
|
+
var elementValues = [];
|
24
|
+
var elementEnabledFieldsMap = {};
|
25
|
+
var enabledFields = [];
|
26
|
+
htSelection.forEach(function (element) {
|
27
|
+
var id = element.getId();
|
28
|
+
var elementTextStyle = getElementTextStyle(element);
|
29
|
+
elementValues.push({
|
30
|
+
id: id,
|
31
|
+
values: elementTextStyle
|
32
|
+
});
|
33
|
+
});
|
34
|
+
var value = {};
|
35
|
+
var styleNames = ['borderColor', 'borderOpacity', 'backgroundColor', 'backgroundOpacity', 'width', 'pattern'];
|
36
|
+
styleNames.forEach(function (styleName) {
|
37
|
+
// 查询该字段多元素的值列表,排除元素禁用的字段值
|
38
|
+
var fieldValueList = elementValues.reduce(function (result, item) {
|
39
|
+
// 元素字段是否禁用
|
40
|
+
if (!item.values) {
|
41
|
+
return result;
|
42
|
+
}
|
43
|
+
|
44
|
+
return [].concat(result, [item.values[styleName]]);
|
45
|
+
}, []); // 对比是否一样,如果一样则使用
|
46
|
+
|
47
|
+
var val = fieldValueList[0];
|
48
|
+
var different = fieldValueList.filter(function (item) {
|
49
|
+
// 如果是颜色,特殊处理
|
50
|
+
if (item && val && item.rgb) {
|
51
|
+
return item.rgb.r + "," + item.rgb.g + "," + item.rgb.b + "," + item.rgb.a !== val.rgb.r + "," + val.rgb.g + "," + val.rgb.b + "," + val.rgb.a;
|
52
|
+
}
|
53
|
+
|
54
|
+
return item !== val;
|
55
|
+
});
|
56
|
+
|
57
|
+
if (!different.length) {
|
58
|
+
value[styleName] = val;
|
59
|
+
}
|
60
|
+
});
|
61
|
+
return value;
|
62
|
+
}
|
63
|
+
/**
|
64
|
+
* @name getElementTextStyle 获取单个元素的指定样式
|
65
|
+
* @param {*} element
|
66
|
+
*/
|
67
|
+
|
68
|
+
export function getElementTextStyle(element) {
|
69
|
+
if (element._layer != 'rectangle') {
|
70
|
+
return {
|
71
|
+
borderColor: parseBackground(element.s('group.border.color')).background,
|
72
|
+
borderOpacity: parseBackground(element.s('group.border.color')).opacity,
|
73
|
+
backgroundColor: parseBackground(element.s('group.background')).background,
|
74
|
+
backgroundOpacity: parseBackground(element.s('group.background')).opacity,
|
75
|
+
width: element.s('group.border.width'),
|
76
|
+
pattern: element.s('group.border.pattern') ? getBorderPattern(element.s('group.border.pattern')) : [0, 0]
|
77
|
+
};
|
78
|
+
} else {
|
79
|
+
return {
|
80
|
+
borderColor: parseBackground(element.s('shape.border.color')).background,
|
81
|
+
borderOpacity: parseBackground(element.s('shape.border.color')).opacity,
|
82
|
+
backgroundColor: parseBackground(element.s('shape.background')).background,
|
83
|
+
backgroundOpacity: parseBackground(element.s('shape.background')).opacity,
|
84
|
+
width: element.s('shape.border.width'),
|
85
|
+
pattern: element.s('shape.border.pattern') ? getBorderPattern(element.s('shape.border.pattern')) : [0, 0]
|
86
|
+
};
|
87
|
+
}
|
88
|
+
}
|
89
|
+
export function getBorderPattern(data) {
|
90
|
+
if (data.length == 1) {
|
91
|
+
return [data[0], data[0]];
|
92
|
+
}
|
93
|
+
|
94
|
+
return data;
|
95
|
+
}
|
96
|
+
export function setGroupsStyle(elements, style) {
|
97
|
+
var borderColor = style.borderColor,
|
98
|
+
borderOpacity = style.borderOpacity,
|
99
|
+
backgroundColor = style.backgroundColor,
|
100
|
+
backgroundOpacity = style.backgroundOpacity,
|
101
|
+
width = style.width,
|
102
|
+
pattern = style.pattern,
|
103
|
+
otherStyle = _objectWithoutPropertiesLoose(style, _excluded);
|
104
|
+
|
105
|
+
var tagStyle = _extends({}, otherStyle);
|
106
|
+
|
107
|
+
setGroupStyle(elements, style, tagStyle);
|
108
|
+
}
|
109
|
+
export function setGroupStyle(element, style, tagStyle) {
|
110
|
+
var elementStyles = getElementTextStyle(element);
|
111
|
+
|
112
|
+
if ('borderColor' in style || 'borderOpacity' in style) {
|
113
|
+
var prevStyle = {
|
114
|
+
background: elementStyles.borderColor ? elementStyles.borderColor : 'rgba(255,255,255,1)',
|
115
|
+
opacity: elementStyles.borderOpacity ? elementStyles.borderOpacity : 1
|
116
|
+
};
|
117
|
+
var borderCurrentColor = {};
|
118
|
+
|
119
|
+
if ('borderColor' in style) {
|
120
|
+
borderCurrentColor = {
|
121
|
+
background: style.borderColor,
|
122
|
+
opacity: prevStyle.opacity === undefined ? 1 : prevStyle.opacity
|
123
|
+
};
|
124
|
+
} else {
|
125
|
+
borderCurrentColor = {
|
126
|
+
background: prevStyle.background,
|
127
|
+
opacity: style.backgroundOpacity === undefined ? 1 : style.backgroundOpacity
|
128
|
+
};
|
129
|
+
}
|
130
|
+
|
131
|
+
tagStyle.borderColor = formatBackgroundRgbaColor(prevStyle, borderCurrentColor);
|
132
|
+
|
133
|
+
if (element._layer != 'rectangle') {
|
134
|
+
element.s('group.border.color', tagStyle.borderColor);
|
135
|
+
} else {
|
136
|
+
element.s('shape.border.color', tagStyle.borderColor);
|
137
|
+
}
|
138
|
+
}
|
139
|
+
|
140
|
+
if ('backgroundColor' in style || 'backgroundOpacity' in style) {
|
141
|
+
var backStyle = {
|
142
|
+
backgroundColor: elementStyles.backgroundColor ? elementStyles.backgroundColor : 'rgba(255,255,255,1)',
|
143
|
+
backgroundOpacity: elementStyles.backgroundOpacity ? elementStyles.backgroundOpacity : 1
|
144
|
+
};
|
145
|
+
var backCurrentColor = {};
|
146
|
+
|
147
|
+
if ('backgroundColor' in style) {
|
148
|
+
backCurrentColor = {
|
149
|
+
background: style.backgroundColor,
|
150
|
+
opacity: backStyle.backgroundOpacity === undefined ? 1 : backStyle.backgroundOpacity
|
151
|
+
};
|
152
|
+
} else {
|
153
|
+
backCurrentColor = {
|
154
|
+
background: backStyle.backgroundColor,
|
155
|
+
opacity: style.backgroundOpacity === undefined ? 1 : style.backgroundOpacity
|
156
|
+
};
|
157
|
+
}
|
158
|
+
|
159
|
+
tagStyle.background = formatBackgroundRgbaColor(backStyle, backCurrentColor);
|
160
|
+
|
161
|
+
if (element._layer != 'rectangle') {
|
162
|
+
element.s('group.background', tagStyle.background);
|
163
|
+
} else {
|
164
|
+
element.s('shape.background', tagStyle.background);
|
165
|
+
}
|
166
|
+
}
|
167
|
+
|
168
|
+
if ('width' in style) {
|
169
|
+
tagStyle.width = style.width;
|
170
|
+
|
171
|
+
if (element._layer != 'rectangle') {
|
172
|
+
element.s('group.border.width', tagStyle.width);
|
173
|
+
} else {
|
174
|
+
element.s('shape.border.width', tagStyle.width);
|
175
|
+
}
|
176
|
+
}
|
177
|
+
|
178
|
+
if ('pattern' in style) {
|
179
|
+
tagStyle.pattern = style.pattern;
|
180
|
+
|
181
|
+
if (element._layer != 'rectangle') {
|
182
|
+
element.s('group.border.pattern', tagStyle.pattern);
|
183
|
+
} else {
|
184
|
+
element.s('shape.border.pattern', tagStyle.pattern);
|
185
|
+
}
|
186
|
+
}
|
187
|
+
}
|
@@ -0,0 +1,83 @@
|
|
1
|
+
.content {
|
2
|
+
margin: 4px 0px 0px 6px;
|
3
|
+
.fontColor{
|
4
|
+
width: 100%;
|
5
|
+
margin-bottom: 16px;
|
6
|
+
.colorPanelBox{
|
7
|
+
padding: 9px;
|
8
|
+
padding-top: 8px;
|
9
|
+
}
|
10
|
+
&>span{
|
11
|
+
font-size: 12px;
|
12
|
+
font-family: PingFangSC-Regular, PingFang SC;
|
13
|
+
font-weight: 400;
|
14
|
+
color: #4D6277;
|
15
|
+
line-height: 17px;
|
16
|
+
}
|
17
|
+
|
18
|
+
}
|
19
|
+
.backgroundColor{
|
20
|
+
width: 100%;
|
21
|
+
height: 159px;
|
22
|
+
.colorPanelBox{
|
23
|
+
padding: 9px;
|
24
|
+
padding-top: 0px;
|
25
|
+
}
|
26
|
+
&>span{
|
27
|
+
font-size: 12px;
|
28
|
+
color: black;
|
29
|
+
font-family: PingFangSC-Regular, PingFang SC;
|
30
|
+
font-weight: 400;
|
31
|
+
color: #4D6277;
|
32
|
+
line-height: 17px;
|
33
|
+
}
|
34
|
+
.backOpacity{
|
35
|
+
margin-top: 5px;
|
36
|
+
margin-bottom: 5px;
|
37
|
+
line-height: 8px;
|
38
|
+
display: flex;
|
39
|
+
flex-direction: row;
|
40
|
+
|
41
|
+
}
|
42
|
+
}
|
43
|
+
.borderColor{
|
44
|
+
width: 100%;
|
45
|
+
height: 210px;
|
46
|
+
.colorPanelBox{
|
47
|
+
padding: 9px;
|
48
|
+
padding-top: 0px;
|
49
|
+
}
|
50
|
+
&>span{
|
51
|
+
font-size: 12px;
|
52
|
+
color: black;
|
53
|
+
font-family: PingFangSC-Regular, PingFang SC;
|
54
|
+
font-weight: 400;
|
55
|
+
color: #4D6277;
|
56
|
+
line-height: 17px;
|
57
|
+
}
|
58
|
+
.borderWidth{
|
59
|
+
margin-top: 5px;
|
60
|
+
margin-bottom: 5px;
|
61
|
+
line-height: 8px;
|
62
|
+
display: flex;
|
63
|
+
flex-direction: row;
|
64
|
+
}
|
65
|
+
.backOpacity{
|
66
|
+
margin-top: 8px;
|
67
|
+
margin-bottom: 5px;
|
68
|
+
line-height: 8px;
|
69
|
+
display: flex;
|
70
|
+
flex-direction: row;
|
71
|
+
.backOpacityLable{
|
72
|
+
margin-left: 16px;
|
73
|
+
line-height: 22px;
|
74
|
+
margin-right: 5px;
|
75
|
+
}
|
76
|
+
:global{
|
77
|
+
.next-number-picker-normal.next-small{
|
78
|
+
width: 45px;
|
79
|
+
}
|
80
|
+
}
|
81
|
+
}
|
82
|
+
}
|
83
|
+
}
|
@@ -82,7 +82,7 @@ function getValuesByEdges(topo) {
|
|
82
82
|
edgeValues.push({
|
83
83
|
baseAgreement: false,
|
84
84
|
//,
|
85
|
-
lineButton: edge.s('edge.type'),
|
85
|
+
lineButton: edge.a('edge.type.name') || edge.s('edge.type'),
|
86
86
|
startPoint: getStartPoint(edge),
|
87
87
|
endPoint: getEndPoint(edge),
|
88
88
|
lineMold: edge.a('lineMode') || 'solidLine'
|
@@ -24,7 +24,7 @@ import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
|
|
24
24
|
import SelectionModel from "./SelectionModel";
|
25
25
|
import CiCache from "./cache/CiCache"; // eslint-disable-next-line no-undef
|
26
26
|
|
27
|
-
var version = typeof "10.0.
|
27
|
+
var version = typeof "10.0.11" === 'string' ? "10.0.11" : null;
|
28
28
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
29
29
|
/**
|
30
30
|
* 拓扑显示和编辑
|
@@ -92,7 +92,7 @@ function ColorPanel(props) {
|
|
92
92
|
};
|
93
93
|
|
94
94
|
(0, _react.useEffect)(function () {
|
95
|
-
if (value
|
95
|
+
if (value === undefined) return;
|
96
96
|
if (!value) return setActive('-1');
|
97
97
|
var activeColor = value.hex ? (0, _color["default"])(value.hex).rgb() : (0, _color["default"])(value).rgb(); // eslint-disable-next-line no-unused-vars, array-callback-return
|
98
98
|
|