@riil-frontend/component-topology 2.15.16 → 2.15.19
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 +3 -3
- package/demo-mock/basic/topo/v1/api/background/all +1 -0
- package/es/core/components/TopoView/topoView.js +1 -3
- package/es/core/editor/components/settings/Settings.module.scss +4 -0
- package/es/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +7 -4
- package/es/core/models/AttributeMetricDisplay.js +13 -5
- package/es/core/models/TopoApp.js +8 -14
- package/es/core/models/topoFactory.js +25 -0
- package/es/topoCenter/components/Topology.js +4 -1
- package/lib/core/components/TopoView/topoView.js +1 -3
- package/lib/core/editor/components/settings/Settings.module.scss +4 -0
- package/lib/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +7 -4
- package/lib/core/models/AttributeMetricDisplay.js +13 -5
- package/lib/core/models/TopoApp.js +8 -13
- package/lib/core/models/topoFactory.js +30 -0
- package/lib/topoCenter/components/Topology.js +4 -1
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"id":10000,"isSystem":1,"fileCode":"chinamap_light"},{"id":10001,"isSystem":1,"fileCode":"chinamap_dark"},{"id":10002,"isSystem":1,"fileCode":"test"}]
|
|
@@ -240,9 +240,7 @@ var TopoView = function TopoView(props) {
|
|
|
240
240
|
className: classnames(styles.viewPanel, (_classnames = {}, _classnames[styles.viewPanelEditMode] = isEditMode, _classnames))
|
|
241
241
|
}, /*#__PURE__*/React.createElement(TopoGraph, _extends({}, graphViewProps, {
|
|
242
242
|
createHtTopoProps: _extends({}, graphViewProps.createHtTopoProps, {
|
|
243
|
-
editor: _extends({}, ((_graphViewProps$creat = graphViewProps.createHtTopoProps) === null || _graphViewProps$creat === void 0 ? void 0 : _graphViewProps$creat.editor) || {}
|
|
244
|
-
useNewElementsDeleteEvent: true
|
|
245
|
-
})
|
|
243
|
+
editor: _extends({}, ((_graphViewProps$creat = graphViewProps.createHtTopoProps) === null || _graphViewProps$creat === void 0 ? void 0 : _graphViewProps$creat.editor) || {})
|
|
246
244
|
}),
|
|
247
245
|
data: tData,
|
|
248
246
|
defaultEnterEditMode: defaultEnterEditMode,
|
|
@@ -8,8 +8,11 @@ import ColorPicker from "../../../../../../common/components/ColorPicker";
|
|
|
8
8
|
import LineType from "../../common/LineType";
|
|
9
9
|
var CollapsePanel = _Collapse.Panel;
|
|
10
10
|
|
|
11
|
-
function parseValues(values) {
|
|
12
|
-
return _extends({}, values
|
|
11
|
+
function parseValues(values, edge) {
|
|
12
|
+
return _extends({}, values, {
|
|
13
|
+
'styleMap.edge.width': edge.s('edge.width') // element.getStyleMap() 如果是默认值则不返回
|
|
14
|
+
|
|
15
|
+
});
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
export default function CommonEdgePropertyView(props) {
|
|
@@ -21,7 +24,7 @@ export default function CommonEdgePropertyView(props) {
|
|
|
21
24
|
|
|
22
25
|
var field = _Field.useField({
|
|
23
26
|
autoUnmount: false,
|
|
24
|
-
values: parseValues(values),
|
|
27
|
+
values: parseValues(values, edge),
|
|
25
28
|
onChange: function onChange(name, value) {
|
|
26
29
|
var newValues = field.getValues();
|
|
27
30
|
|
|
@@ -32,7 +35,7 @@ export default function CommonEdgePropertyView(props) {
|
|
|
32
35
|
});
|
|
33
36
|
|
|
34
37
|
useEffect(function () {
|
|
35
|
-
field.setValues(parseValues(values));
|
|
38
|
+
field.setValues(parseValues(values, edge));
|
|
36
39
|
}, [values]);
|
|
37
40
|
|
|
38
41
|
var setLineColor = function setLineColor(color) {
|
|
@@ -486,7 +486,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
486
486
|
}()
|
|
487
487
|
/**
|
|
488
488
|
* 临时由前端翻译引用属性名称
|
|
489
|
-
* @param {
|
|
489
|
+
* @param {array} ciDatas
|
|
490
490
|
* @returns
|
|
491
491
|
*/
|
|
492
492
|
;
|
|
@@ -526,12 +526,20 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
526
526
|
});
|
|
527
527
|
});
|
|
528
528
|
});
|
|
529
|
-
refIds = Object.keys(refIdMap);
|
|
529
|
+
refIds = Object.keys(refIdMap);
|
|
530
530
|
|
|
531
|
-
|
|
532
|
-
|
|
531
|
+
if (refIds.length) {
|
|
532
|
+
_context3.next = 6;
|
|
533
|
+
break;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
return _context3.abrupt("return", ciDatas);
|
|
533
537
|
|
|
534
538
|
case 6:
|
|
539
|
+
_context3.next = 8;
|
|
540
|
+
return queryCisByIds(refIds);
|
|
541
|
+
|
|
542
|
+
case 8:
|
|
535
543
|
refCis = _context3.sent;
|
|
536
544
|
refCiMap = keyBy(refCis, 'id');
|
|
537
545
|
rlog.debug('translateRefAttribute', {
|
|
@@ -559,7 +567,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
559
567
|
});
|
|
560
568
|
}));
|
|
561
569
|
|
|
562
|
-
case
|
|
570
|
+
case 12:
|
|
563
571
|
case "end":
|
|
564
572
|
return _context3.stop();
|
|
565
573
|
}
|
|
@@ -17,15 +17,11 @@ import AttributeMetricDisplay from "./AttributeMetricDisplay";
|
|
|
17
17
|
import DataModel from "./DataModel";
|
|
18
18
|
import GraphDataModel from "./GraphDataModel";
|
|
19
19
|
import { updateEdgeExpanded } from "../utils/edgeUtil";
|
|
20
|
-
import PluginManager from "./PluginManager";
|
|
20
|
+
import PluginManager from "./PluginManager";
|
|
21
|
+
import topoFactory from "./topoFactory"; // eslint-disable-next-line no-undef
|
|
21
22
|
|
|
22
|
-
var version = typeof "2.15.
|
|
23
|
+
var version = typeof "2.15.19" === 'string' ? "2.15.19" : null;
|
|
23
24
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
|
24
|
-
var topoDebug = {};
|
|
25
|
-
window.topoDebug = topoDebug;
|
|
26
|
-
var htTopo = {};
|
|
27
|
-
window.htTopo = htTopo;
|
|
28
|
-
var n = 0;
|
|
29
25
|
/**
|
|
30
26
|
* 拓扑显示和编辑
|
|
31
27
|
*/
|
|
@@ -35,7 +31,6 @@ var Topo = /*#__PURE__*/function () {
|
|
|
35
31
|
* @type TopoGraphView
|
|
36
32
|
*/
|
|
37
33
|
function Topo(options) {
|
|
38
|
-
this.version = version;
|
|
39
34
|
this.options = void 0;
|
|
40
35
|
this.id = void 0;
|
|
41
36
|
this.view = void 0;
|
|
@@ -46,6 +41,8 @@ var Topo = /*#__PURE__*/function () {
|
|
|
46
41
|
this.ciTyeCache = CiTyeCache;
|
|
47
42
|
this.dictCache = DictCache;
|
|
48
43
|
this.test = void 0;
|
|
44
|
+
this.uid = void 0;
|
|
45
|
+
this.version = version;
|
|
49
46
|
this.options = _extends({
|
|
50
47
|
enableDefaultAlarmLoader: true,
|
|
51
48
|
enableDefaultMetricLoader: true,
|
|
@@ -58,9 +55,6 @@ var Topo = /*#__PURE__*/function () {
|
|
|
58
55
|
}
|
|
59
56
|
|
|
60
57
|
this.initialize(options);
|
|
61
|
-
this.debugId = options.name || "t" + n++;
|
|
62
|
-
topoDebug[this.debugId] = this;
|
|
63
|
-
htTopo[this.debugId] = this.getHtTopo.bind(this);
|
|
64
58
|
}
|
|
65
59
|
|
|
66
60
|
var _proto = Topo.prototype;
|
|
@@ -80,6 +74,7 @@ var Topo = /*#__PURE__*/function () {
|
|
|
80
74
|
this.alarm.init(this); // 指标
|
|
81
75
|
|
|
82
76
|
this.test = new Test(this);
|
|
77
|
+
this.uid = topoFactory.add(options.name, this);
|
|
83
78
|
}
|
|
84
79
|
/**
|
|
85
80
|
* TODO 移除
|
|
@@ -100,10 +95,9 @@ var Topo = /*#__PURE__*/function () {
|
|
|
100
95
|
return topoDispatchers.exit();
|
|
101
96
|
|
|
102
97
|
case 3:
|
|
103
|
-
|
|
104
|
-
delete htTopo[this.debugId];
|
|
98
|
+
topoFactory.remove(this.uid);
|
|
105
99
|
|
|
106
|
-
case
|
|
100
|
+
case 4:
|
|
107
101
|
case "end":
|
|
108
102
|
return _context.stop();
|
|
109
103
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var n = 0;
|
|
2
|
+
|
|
3
|
+
var TopoFactory = /*#__PURE__*/function () {
|
|
4
|
+
function TopoFactory() {
|
|
5
|
+
this.map = {};
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
var _proto = TopoFactory.prototype;
|
|
9
|
+
|
|
10
|
+
_proto.add = function add(name, topo) {
|
|
11
|
+
var uid = name || "" + n++;
|
|
12
|
+
this.map[uid] = topo;
|
|
13
|
+
return uid;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
_proto.remove = function remove(name) {
|
|
17
|
+
delete this.map[name];
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return TopoFactory;
|
|
21
|
+
}();
|
|
22
|
+
|
|
23
|
+
var topoFactory = new TopoFactory();
|
|
24
|
+
window.topoFactory = topoFactory;
|
|
25
|
+
export default topoFactory;
|
|
@@ -43,7 +43,10 @@ export default function NetworkTopologyFull(props) {
|
|
|
43
43
|
graphViewProps: _extends({}, props.graphViewProps, {
|
|
44
44
|
onElementsDelete: topoEdit.onElementsDelete,
|
|
45
45
|
createHtTopoProps: {
|
|
46
|
-
elementChangeLayerByDrag: true
|
|
46
|
+
elementChangeLayerByDrag: true,
|
|
47
|
+
editor: {
|
|
48
|
+
useNewElementsDeleteEvent: true
|
|
49
|
+
}
|
|
47
50
|
}
|
|
48
51
|
})
|
|
49
52
|
}));
|
|
@@ -276,9 +276,7 @@ var TopoView = function TopoView(props) {
|
|
|
276
276
|
className: (0, _classnames2["default"])(_TopoViewModule["default"].viewPanel, (_classnames = {}, _classnames[_TopoViewModule["default"].viewPanelEditMode] = isEditMode, _classnames))
|
|
277
277
|
}, /*#__PURE__*/_react["default"].createElement(_componentTopologyGraph["default"], (0, _extends2["default"])({}, graphViewProps, {
|
|
278
278
|
createHtTopoProps: (0, _extends2["default"])({}, graphViewProps.createHtTopoProps, {
|
|
279
|
-
editor: (0, _extends2["default"])({}, ((_graphViewProps$creat = graphViewProps.createHtTopoProps) === null || _graphViewProps$creat === void 0 ? void 0 : _graphViewProps$creat.editor) || {}
|
|
280
|
-
useNewElementsDeleteEvent: true
|
|
281
|
-
})
|
|
279
|
+
editor: (0, _extends2["default"])({}, ((_graphViewProps$creat = graphViewProps.createHtTopoProps) === null || _graphViewProps$creat === void 0 ? void 0 : _graphViewProps$creat.editor) || {})
|
|
282
280
|
}),
|
|
283
281
|
data: tData,
|
|
284
282
|
defaultEnterEditMode: defaultEnterEditMode,
|
|
@@ -27,8 +27,11 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
27
27
|
|
|
28
28
|
var CollapsePanel = _collapse["default"].Panel;
|
|
29
29
|
|
|
30
|
-
function parseValues(values) {
|
|
31
|
-
return (0, _extends2["default"])({}, values
|
|
30
|
+
function parseValues(values, edge) {
|
|
31
|
+
return (0, _extends2["default"])({}, values, {
|
|
32
|
+
'styleMap.edge.width': edge.s('edge.width') // element.getStyleMap() 如果是默认值则不返回
|
|
33
|
+
|
|
34
|
+
});
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
function CommonEdgePropertyView(props) {
|
|
@@ -40,7 +43,7 @@ function CommonEdgePropertyView(props) {
|
|
|
40
43
|
|
|
41
44
|
var field = _field["default"].useField({
|
|
42
45
|
autoUnmount: false,
|
|
43
|
-
values: parseValues(values),
|
|
46
|
+
values: parseValues(values, edge),
|
|
44
47
|
onChange: function onChange(name, value) {
|
|
45
48
|
var newValues = field.getValues();
|
|
46
49
|
|
|
@@ -51,7 +54,7 @@ function CommonEdgePropertyView(props) {
|
|
|
51
54
|
});
|
|
52
55
|
|
|
53
56
|
(0, _react.useEffect)(function () {
|
|
54
|
-
field.setValues(parseValues(values));
|
|
57
|
+
field.setValues(parseValues(values, edge));
|
|
55
58
|
}, [values]);
|
|
56
59
|
|
|
57
60
|
var setLineColor = function setLineColor(color) {
|
|
@@ -505,7 +505,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
505
505
|
}()
|
|
506
506
|
/**
|
|
507
507
|
* 临时由前端翻译引用属性名称
|
|
508
|
-
* @param {
|
|
508
|
+
* @param {array} ciDatas
|
|
509
509
|
* @returns
|
|
510
510
|
*/
|
|
511
511
|
;
|
|
@@ -545,12 +545,20 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
545
545
|
});
|
|
546
546
|
});
|
|
547
547
|
});
|
|
548
|
-
refIds = Object.keys(refIdMap);
|
|
548
|
+
refIds = Object.keys(refIdMap);
|
|
549
549
|
|
|
550
|
-
|
|
551
|
-
|
|
550
|
+
if (refIds.length) {
|
|
551
|
+
_context3.next = 6;
|
|
552
|
+
break;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
return _context3.abrupt("return", ciDatas);
|
|
552
556
|
|
|
553
557
|
case 6:
|
|
558
|
+
_context3.next = 8;
|
|
559
|
+
return (0, _services.queryCisByIds)(refIds);
|
|
560
|
+
|
|
561
|
+
case 8:
|
|
554
562
|
refCis = _context3.sent;
|
|
555
563
|
refCiMap = (0, _lodash.keyBy)(refCis, 'id');
|
|
556
564
|
|
|
@@ -578,7 +586,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
578
586
|
});
|
|
579
587
|
}));
|
|
580
588
|
|
|
581
|
-
case
|
|
589
|
+
case 12:
|
|
582
590
|
case "end":
|
|
583
591
|
return _context3.stop();
|
|
584
592
|
}
|
|
@@ -45,14 +45,11 @@ var _edgeUtil = require("../utils/edgeUtil");
|
|
|
45
45
|
|
|
46
46
|
var _PluginManager = _interopRequireDefault(require("./PluginManager"));
|
|
47
47
|
|
|
48
|
+
var _topoFactory = _interopRequireDefault(require("./topoFactory"));
|
|
49
|
+
|
|
48
50
|
// eslint-disable-next-line no-undef
|
|
49
|
-
var version = typeof "2.15.
|
|
51
|
+
var version = typeof "2.15.19" === 'string' ? "2.15.19" : null;
|
|
50
52
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
|
51
|
-
var topoDebug = {};
|
|
52
|
-
window.topoDebug = topoDebug;
|
|
53
|
-
var htTopo = {};
|
|
54
|
-
window.htTopo = htTopo;
|
|
55
|
-
var n = 0;
|
|
56
53
|
/**
|
|
57
54
|
* 拓扑显示和编辑
|
|
58
55
|
*/
|
|
@@ -62,7 +59,6 @@ var Topo = /*#__PURE__*/function () {
|
|
|
62
59
|
* @type TopoGraphView
|
|
63
60
|
*/
|
|
64
61
|
function Topo(options) {
|
|
65
|
-
this.version = version;
|
|
66
62
|
this.options = void 0;
|
|
67
63
|
this.id = void 0;
|
|
68
64
|
this.view = void 0;
|
|
@@ -73,6 +69,8 @@ var Topo = /*#__PURE__*/function () {
|
|
|
73
69
|
this.ciTyeCache = _CiTyeCache["default"];
|
|
74
70
|
this.dictCache = _DictCache["default"];
|
|
75
71
|
this.test = void 0;
|
|
72
|
+
this.uid = void 0;
|
|
73
|
+
this.version = version;
|
|
76
74
|
this.options = (0, _extends2["default"])({
|
|
77
75
|
enableDefaultAlarmLoader: true,
|
|
78
76
|
enableDefaultMetricLoader: true,
|
|
@@ -85,9 +83,6 @@ var Topo = /*#__PURE__*/function () {
|
|
|
85
83
|
}
|
|
86
84
|
|
|
87
85
|
this.initialize(options);
|
|
88
|
-
this.debugId = options.name || "t" + n++;
|
|
89
|
-
topoDebug[this.debugId] = this;
|
|
90
|
-
htTopo[this.debugId] = this.getHtTopo.bind(this);
|
|
91
86
|
}
|
|
92
87
|
|
|
93
88
|
var _proto = Topo.prototype;
|
|
@@ -107,6 +102,7 @@ var Topo = /*#__PURE__*/function () {
|
|
|
107
102
|
this.alarm.init(this); // 指标
|
|
108
103
|
|
|
109
104
|
this.test = new _Test["default"](this);
|
|
105
|
+
this.uid = _topoFactory["default"].add(options.name, this);
|
|
110
106
|
}
|
|
111
107
|
/**
|
|
112
108
|
* TODO 移除
|
|
@@ -127,10 +123,9 @@ var Topo = /*#__PURE__*/function () {
|
|
|
127
123
|
return topoDispatchers.exit();
|
|
128
124
|
|
|
129
125
|
case 3:
|
|
130
|
-
|
|
131
|
-
delete htTopo[this.debugId];
|
|
126
|
+
_topoFactory["default"].remove(this.uid);
|
|
132
127
|
|
|
133
|
-
case
|
|
128
|
+
case 4:
|
|
134
129
|
case "end":
|
|
135
130
|
return _context.stop();
|
|
136
131
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports["default"] = void 0;
|
|
5
|
+
var n = 0;
|
|
6
|
+
|
|
7
|
+
var TopoFactory = /*#__PURE__*/function () {
|
|
8
|
+
function TopoFactory() {
|
|
9
|
+
this.map = {};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
var _proto = TopoFactory.prototype;
|
|
13
|
+
|
|
14
|
+
_proto.add = function add(name, topo) {
|
|
15
|
+
var uid = name || "" + n++;
|
|
16
|
+
this.map[uid] = topo;
|
|
17
|
+
return uid;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
_proto.remove = function remove(name) {
|
|
21
|
+
delete this.map[name];
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
return TopoFactory;
|
|
25
|
+
}();
|
|
26
|
+
|
|
27
|
+
var topoFactory = new TopoFactory();
|
|
28
|
+
window.topoFactory = topoFactory;
|
|
29
|
+
var _default = topoFactory;
|
|
30
|
+
exports["default"] = _default;
|
|
@@ -63,7 +63,10 @@ function NetworkTopologyFull(props) {
|
|
|
63
63
|
graphViewProps: (0, _extends2["default"])({}, props.graphViewProps, {
|
|
64
64
|
onElementsDelete: topoEdit.onElementsDelete,
|
|
65
65
|
createHtTopoProps: {
|
|
66
|
-
elementChangeLayerByDrag: true
|
|
66
|
+
elementChangeLayerByDrag: true,
|
|
67
|
+
editor: {
|
|
68
|
+
useNewElementsDeleteEvent: true
|
|
69
|
+
}
|
|
67
70
|
}
|
|
68
71
|
})
|
|
69
72
|
}));
|
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.19",
|
|
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.19/build/index.html",
|
|
114
114
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
|
115
115
|
}
|