@riil-frontend/component-topology 2.15.20 → 2.15.21
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.js +1 -1
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +2 -0
- package/es/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +1 -3
- package/es/core/editor/components/settings/propertyViews/edge/edgeGroup/EdgeGroupSetting.js +1 -3
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +3 -4
- package/es/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +4 -4
- package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +1 -3
- package/es/core/editor/components/settings/propertyViews/node/NodePropertyView.js +1 -3
- package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +5 -0
- package/es/core/editor/components/settings/propertyViews/text/TextPropertyView.js +5 -7
- package/es/core/models/TopoApp.js +1 -1
- package/es/hooks/useTopoEdit.js +16 -5
- package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Setting/index.js +1 -3
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +2 -0
- package/lib/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +1 -3
- package/lib/core/editor/components/settings/propertyViews/edge/edgeGroup/EdgeGroupSetting.js +1 -3
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +3 -4
- package/lib/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +4 -4
- package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +1 -3
- package/lib/core/editor/components/settings/propertyViews/node/NodePropertyView.js +1 -3
- package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +5 -0
- package/lib/core/editor/components/settings/propertyViews/text/TextPropertyView.js +5 -7
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/hooks/useTopoEdit.js +16 -5
- package/lib/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Setting/index.js +1 -3
- package/package.json +2 -2
|
@@ -28,9 +28,7 @@ export default function CommonEdgePropertyView(props) {
|
|
|
28
28
|
onChange: function onChange(name, value) {
|
|
29
29
|
var newValues = field.getValues();
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
_onChange(name, value, newValues);
|
|
33
|
-
}
|
|
31
|
+
_onChange(name, value, newValues);
|
|
34
32
|
}
|
|
35
33
|
});
|
|
36
34
|
|
|
@@ -22,9 +22,7 @@ export default function EdgeGroupSetting(props) {
|
|
|
22
22
|
onChange: function onChange(name, value) {
|
|
23
23
|
var newValues = field.getValues();
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
_onChange(name, value, newValues);
|
|
27
|
-
}
|
|
25
|
+
_onChange(name, value, newValues);
|
|
28
26
|
}
|
|
29
27
|
});
|
|
30
28
|
|
|
@@ -30,9 +30,7 @@ export default function GroupSetting(props) {
|
|
|
30
30
|
|
|
31
31
|
var newValues = field.getValues();
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
_onChange(name, value, newValues);
|
|
35
|
-
}
|
|
33
|
+
_onChange(name, value, newValues);
|
|
36
34
|
}
|
|
37
35
|
});
|
|
38
36
|
|
|
@@ -92,7 +90,8 @@ export default function GroupSetting(props) {
|
|
|
92
90
|
}
|
|
93
91
|
}), /*#__PURE__*/React.createElement(_Input, {
|
|
94
92
|
name: "attrObject.name",
|
|
95
|
-
maxLength: 30
|
|
93
|
+
maxLength: 30,
|
|
94
|
+
placeholder: "\u8BF7\u8F93\u5165"
|
|
96
95
|
})), expanded ? /*#__PURE__*/React.createElement(GroupExpandSetting, {
|
|
97
96
|
group: group,
|
|
98
97
|
expanded: expanded,
|
|
@@ -23,11 +23,10 @@ export default function LayerSettingTab(props) {
|
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
console.error(values[name], value);
|
|
26
27
|
var newValues = field.getValues();
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
_onChange(name, value, newValues);
|
|
30
|
-
}
|
|
29
|
+
_onChange(name, value, newValues);
|
|
31
30
|
}
|
|
32
31
|
});
|
|
33
32
|
|
|
@@ -56,7 +55,8 @@ export default function LayerSettingTab(props) {
|
|
|
56
55
|
}
|
|
57
56
|
}), /*#__PURE__*/React.createElement(_Input, {
|
|
58
57
|
name: "styleMap.label",
|
|
59
|
-
maxLength: 30
|
|
58
|
+
maxLength: 30,
|
|
59
|
+
placeholder: "\u8BF7\u8F93\u5165"
|
|
60
60
|
})), /*#__PURE__*/React.createElement(_Form.Item, null, /*#__PURE__*/React.createElement(_Collapse, {
|
|
61
61
|
defaultExpandedKeys: ['图片', '对齐方式', '线形'],
|
|
62
62
|
style: {
|
|
@@ -27,9 +27,7 @@ export default function MultipleElementPropertyView(props) {
|
|
|
27
27
|
onChange: function onChange(name, value) {
|
|
28
28
|
var newValues = field.getValues();
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
_onChange(name, value, newValues);
|
|
32
|
-
}
|
|
30
|
+
_onChange(name, value, newValues);
|
|
33
31
|
}
|
|
34
32
|
});
|
|
35
33
|
|
|
@@ -57,9 +57,7 @@ export default function NodePropertyView(props) {
|
|
|
57
57
|
onChange: function onChange(name, value) {
|
|
58
58
|
var newValues = field.getValues();
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
_onChange(name, value, newValues);
|
|
62
|
-
}
|
|
60
|
+
_onChange(name, value, newValues);
|
|
63
61
|
}
|
|
64
62
|
});
|
|
65
63
|
|
|
@@ -19,6 +19,7 @@ var BindResourceDrawer = function BindResourceDrawer(props) {
|
|
|
19
19
|
|
|
20
20
|
var handleSave = /*#__PURE__*/function () {
|
|
21
21
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(selected) {
|
|
22
|
+
var result;
|
|
22
23
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
23
24
|
while (1) {
|
|
24
25
|
switch (_context.prev = _context.next) {
|
|
@@ -41,6 +42,10 @@ var BindResourceDrawer = function BindResourceDrawer(props) {
|
|
|
41
42
|
});
|
|
42
43
|
|
|
43
44
|
case 5:
|
|
45
|
+
result = _context.sent;
|
|
46
|
+
return _context.abrupt("return", result);
|
|
47
|
+
|
|
48
|
+
case 7:
|
|
44
49
|
case "end":
|
|
45
50
|
return _context.stop();
|
|
46
51
|
}
|
|
@@ -46,15 +46,13 @@ export default function TextPropertyView(props) {
|
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
if (
|
|
50
|
-
|
|
51
|
-
_onChange(name, DEFAULT_TEXT_VALUE, newValues);
|
|
49
|
+
if (name === 'styleMap.text' && !value) {
|
|
50
|
+
_onChange(name, DEFAULT_TEXT_VALUE, newValues);
|
|
52
51
|
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
_onChange(name, value, newValues);
|
|
52
|
+
return;
|
|
57
53
|
}
|
|
54
|
+
|
|
55
|
+
_onChange(name, value, newValues);
|
|
58
56
|
}
|
|
59
57
|
});
|
|
60
58
|
|
|
@@ -20,7 +20,7 @@ import { updateEdgeExpanded } from "../utils/edgeUtil";
|
|
|
20
20
|
import PluginManager from "./PluginManager";
|
|
21
21
|
import topoFactory from "./topoFactory"; // eslint-disable-next-line no-undef
|
|
22
22
|
|
|
23
|
-
var version = typeof "2.15.
|
|
23
|
+
var version = typeof "2.15.21" === 'string' ? "2.15.21" : null;
|
|
24
24
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
|
25
25
|
/**
|
|
26
26
|
* 拓扑显示和编辑
|
package/es/hooks/useTopoEdit.js
CHANGED
|
@@ -818,7 +818,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
818
818
|
|
|
819
819
|
var bindNodeResource = /*#__PURE__*/function () {
|
|
820
820
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(params) {
|
|
821
|
-
var id, oldResId, newResId, node, groupElement, config, groupId, groupTag, _yield$editDispatcher, elements,
|
|
821
|
+
var id, oldResId, newResId, node, groupElement, config, groupId, groupTag, _yield$editDispatcher, elements, nodeRelatedDatas, replaceOrAddRes;
|
|
822
822
|
|
|
823
823
|
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
824
824
|
while (1) {
|
|
@@ -845,7 +845,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
845
845
|
|
|
846
846
|
groupTag = groupElement.a('tag'); // 容器临时id
|
|
847
847
|
|
|
848
|
-
config.groups = groups.map(function (g) {
|
|
848
|
+
config.groups = config.groups.map(function (g) {
|
|
849
849
|
// 匹配到容器,替换资源或增加
|
|
850
850
|
if (g.id === groupId || g.tag === groupTag) {
|
|
851
851
|
return _extends({}, g, {
|
|
@@ -872,15 +872,26 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
872
872
|
_yield$editDispatcher = _context7.sent;
|
|
873
873
|
elements = _yield$editDispatcher.topoDataTrans;
|
|
874
874
|
// 过滤出关联的节点和连线,通知ht更新
|
|
875
|
-
|
|
876
|
-
|
|
875
|
+
nodeRelatedDatas = filterElementsByNodeId(elements, newResId);
|
|
876
|
+
|
|
877
|
+
if (nodeRelatedDatas.length) {
|
|
878
|
+
_context7.next = 17;
|
|
879
|
+
break;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
_Message.error('关联资源失败');
|
|
883
|
+
|
|
884
|
+
return _context7.abrupt("return", false);
|
|
885
|
+
|
|
886
|
+
case 17:
|
|
887
|
+
saveBind(TopoEvent.DATA_TYPE_RESOURCE_SINGLE, nodeRelatedDatas);
|
|
877
888
|
node.a('customName', null); // 临时放这里,仅拓扑中心有
|
|
878
889
|
|
|
879
890
|
if (topo.linkDynamicStyleExecutor) {
|
|
880
891
|
topo.linkDynamicStyleExecutor.execute();
|
|
881
892
|
}
|
|
882
893
|
|
|
883
|
-
case
|
|
894
|
+
case 20:
|
|
884
895
|
case "end":
|
|
885
896
|
return _context7.stop();
|
|
886
897
|
}
|
package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Setting/index.js
CHANGED
|
@@ -22,9 +22,7 @@ export default function LinkSetting(props) {
|
|
|
22
22
|
onChange: function onChange(name, value) {
|
|
23
23
|
var newValues = field.getValues();
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
_onChange(name, value, newValues);
|
|
27
|
-
}
|
|
25
|
+
_onChange(name, value, newValues);
|
|
28
26
|
}
|
|
29
27
|
});
|
|
30
28
|
|
|
@@ -47,9 +47,7 @@ function CommonEdgePropertyView(props) {
|
|
|
47
47
|
onChange: function onChange(name, value) {
|
|
48
48
|
var newValues = field.getValues();
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
_onChange(name, value, newValues);
|
|
52
|
-
}
|
|
50
|
+
_onChange(name, value, newValues);
|
|
53
51
|
}
|
|
54
52
|
});
|
|
55
53
|
|
|
@@ -53,9 +53,7 @@ function GroupSetting(props) {
|
|
|
53
53
|
|
|
54
54
|
var newValues = field.getValues();
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
_onChange(name, value, newValues);
|
|
58
|
-
}
|
|
56
|
+
_onChange(name, value, newValues);
|
|
59
57
|
}
|
|
60
58
|
});
|
|
61
59
|
|
|
@@ -115,7 +113,8 @@ function GroupSetting(props) {
|
|
|
115
113
|
}
|
|
116
114
|
}), /*#__PURE__*/_react["default"].createElement(_input["default"], {
|
|
117
115
|
name: "attrObject.name",
|
|
118
|
-
maxLength: 30
|
|
116
|
+
maxLength: 30,
|
|
117
|
+
placeholder: "\u8BF7\u8F93\u5165"
|
|
119
118
|
})), expanded ? /*#__PURE__*/_react["default"].createElement(_GroupExpandSetting["default"], {
|
|
120
119
|
group: group,
|
|
121
120
|
expanded: expanded,
|
|
@@ -43,11 +43,10 @@ function LayerSettingTab(props) {
|
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
console.error(values[name], value);
|
|
46
47
|
var newValues = field.getValues();
|
|
47
48
|
|
|
48
|
-
|
|
49
|
-
_onChange(name, value, newValues);
|
|
50
|
-
}
|
|
49
|
+
_onChange(name, value, newValues);
|
|
51
50
|
}
|
|
52
51
|
});
|
|
53
52
|
|
|
@@ -76,7 +75,8 @@ function LayerSettingTab(props) {
|
|
|
76
75
|
}
|
|
77
76
|
}), /*#__PURE__*/_react["default"].createElement(_input["default"], {
|
|
78
77
|
name: "styleMap.label",
|
|
79
|
-
maxLength: 30
|
|
78
|
+
maxLength: 30,
|
|
79
|
+
placeholder: "\u8BF7\u8F93\u5165"
|
|
80
80
|
})), /*#__PURE__*/_react["default"].createElement(_form["default"].Item, null, /*#__PURE__*/_react["default"].createElement(_collapse["default"], {
|
|
81
81
|
defaultExpandedKeys: ['图片', '对齐方式', '线形'],
|
|
82
82
|
style: {
|
|
@@ -47,9 +47,7 @@ function MultipleElementPropertyView(props) {
|
|
|
47
47
|
onChange: function onChange(name, value) {
|
|
48
48
|
var newValues = field.getValues();
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
_onChange(name, value, newValues);
|
|
52
|
-
}
|
|
50
|
+
_onChange(name, value, newValues);
|
|
53
51
|
}
|
|
54
52
|
});
|
|
55
53
|
|
|
@@ -34,6 +34,7 @@ var BindResourceDrawer = function BindResourceDrawer(props) {
|
|
|
34
34
|
|
|
35
35
|
var handleSave = /*#__PURE__*/function () {
|
|
36
36
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(selected) {
|
|
37
|
+
var result;
|
|
37
38
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
38
39
|
while (1) {
|
|
39
40
|
switch (_context.prev = _context.next) {
|
|
@@ -56,6 +57,10 @@ var BindResourceDrawer = function BindResourceDrawer(props) {
|
|
|
56
57
|
});
|
|
57
58
|
|
|
58
59
|
case 5:
|
|
60
|
+
result = _context.sent;
|
|
61
|
+
return _context.abrupt("return", result);
|
|
62
|
+
|
|
63
|
+
case 7:
|
|
59
64
|
case "end":
|
|
60
65
|
return _context.stop();
|
|
61
66
|
}
|
|
@@ -65,15 +65,13 @@ function TextPropertyView(props) {
|
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
if (
|
|
69
|
-
|
|
70
|
-
_onChange(name, DEFAULT_TEXT_VALUE, newValues);
|
|
68
|
+
if (name === 'styleMap.text' && !value) {
|
|
69
|
+
_onChange(name, DEFAULT_TEXT_VALUE, newValues);
|
|
71
70
|
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
_onChange(name, value, newValues);
|
|
71
|
+
return;
|
|
76
72
|
}
|
|
73
|
+
|
|
74
|
+
_onChange(name, value, newValues);
|
|
77
75
|
}
|
|
78
76
|
});
|
|
79
77
|
|
|
@@ -48,7 +48,7 @@ var _PluginManager = _interopRequireDefault(require("./PluginManager"));
|
|
|
48
48
|
var _topoFactory = _interopRequireDefault(require("./topoFactory"));
|
|
49
49
|
|
|
50
50
|
// eslint-disable-next-line no-undef
|
|
51
|
-
var version = typeof "2.15.
|
|
51
|
+
var version = typeof "2.15.21" === 'string' ? "2.15.21" : null;
|
|
52
52
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
|
53
53
|
/**
|
|
54
54
|
* 拓扑显示和编辑
|
package/lib/hooks/useTopoEdit.js
CHANGED
|
@@ -852,7 +852,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
852
852
|
|
|
853
853
|
var bindNodeResource = /*#__PURE__*/function () {
|
|
854
854
|
var _ref6 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(params) {
|
|
855
|
-
var id, oldResId, newResId, node, groupElement, config, groupId, groupTag, _yield$editDispatcher, elements,
|
|
855
|
+
var id, oldResId, newResId, node, groupElement, config, groupId, groupTag, _yield$editDispatcher, elements, nodeRelatedDatas, replaceOrAddRes;
|
|
856
856
|
|
|
857
857
|
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
|
858
858
|
while (1) {
|
|
@@ -881,7 +881,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
881
881
|
|
|
882
882
|
groupTag = groupElement.a('tag'); // 容器临时id
|
|
883
883
|
|
|
884
|
-
config.groups = groups.map(function (g) {
|
|
884
|
+
config.groups = config.groups.map(function (g) {
|
|
885
885
|
// 匹配到容器,替换资源或增加
|
|
886
886
|
if (g.id === groupId || g.tag === groupTag) {
|
|
887
887
|
return (0, _extends2["default"])({}, g, {
|
|
@@ -908,15 +908,26 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
|
908
908
|
_yield$editDispatcher = _context7.sent;
|
|
909
909
|
elements = _yield$editDispatcher.topoDataTrans;
|
|
910
910
|
// 过滤出关联的节点和连线,通知ht更新
|
|
911
|
-
|
|
912
|
-
|
|
911
|
+
nodeRelatedDatas = (0, _format.filterElementsByNodeId)(elements, newResId);
|
|
912
|
+
|
|
913
|
+
if (nodeRelatedDatas.length) {
|
|
914
|
+
_context7.next = 17;
|
|
915
|
+
break;
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
_message["default"].error('关联资源失败');
|
|
919
|
+
|
|
920
|
+
return _context7.abrupt("return", false);
|
|
921
|
+
|
|
922
|
+
case 17:
|
|
923
|
+
saveBind(_componentTopologyGraph.TopoEvent.DATA_TYPE_RESOURCE_SINGLE, nodeRelatedDatas);
|
|
913
924
|
node.a('customName', null); // 临时放这里,仅拓扑中心有
|
|
914
925
|
|
|
915
926
|
if (topo.linkDynamicStyleExecutor) {
|
|
916
927
|
topo.linkDynamicStyleExecutor.execute();
|
|
917
928
|
}
|
|
918
929
|
|
|
919
|
-
case
|
|
930
|
+
case 20:
|
|
920
931
|
case "end":
|
|
921
932
|
return _context7.stop();
|
|
922
933
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riil-frontend/component-topology",
|
|
3
|
-
"version": "2.15.
|
|
3
|
+
"version": "2.15.21",
|
|
4
4
|
"description": "拓扑",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "build-scripts start",
|
|
@@ -110,6 +110,6 @@
|
|
|
110
110
|
"access": "public"
|
|
111
111
|
},
|
|
112
112
|
"license": "MIT",
|
|
113
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@2.15.
|
|
113
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@2.15.21/build/index.html",
|
|
114
114
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
|
115
115
|
}
|