@riil-frontend/component-topology 6.0.4 → 6.0.5
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/core/hooks/useResourceConfig.js +6 -7
- package/es/core/models/TopoApp.js +17 -8
- package/es/networkTopo/models/TopoCenter.js +47 -22
- package/lib/core/hooks/useResourceConfig.js +6 -9
- package/lib/core/models/TopoApp.js +17 -8
- package/lib/networkTopo/models/TopoCenter.js +47 -22
- package/package.json +2 -2
@@ -1,12 +1,10 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
|
-
import { useMemo, useState, useEffect } from 'react';
|
5
|
-
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
6
|
-
import { DEFAULT_GROUP } from "../../utils/template";
|
7
|
-
import ResourceConfigUtil from "../../utils/ResourceConfigUtil";
|
8
|
-
import { getEdges, getElements, getNodes } from "../../utils/htElementUtils";
|
9
4
|
import { getAllEdgeResourceIds as _getAllEdgeResourceIds, isResourceNodeElement } from "../../utils/htElementDataUtil";
|
5
|
+
import { getElements } from "../../utils/htElementUtils";
|
6
|
+
import ResourceConfigUtil from "../../utils/ResourceConfigUtil";
|
7
|
+
import { DEFAULT_GROUP } from "../../utils/template";
|
10
8
|
export default function (props) {
|
11
9
|
var topo = props.topo;
|
12
10
|
var store = topo.store;
|
@@ -18,9 +16,10 @@ export default function (props) {
|
|
18
16
|
while (1) {
|
19
17
|
switch (_context.prev = _context.next) {
|
20
18
|
case 0:
|
21
|
-
|
19
|
+
_context.next = 2;
|
20
|
+
return editDispatchers.getConditions();
|
22
21
|
|
23
|
-
case
|
22
|
+
case 2:
|
24
23
|
case "end":
|
25
24
|
return _context.stop();
|
26
25
|
}
|
@@ -23,7 +23,7 @@ import topoFactory from "./topoFactory";
|
|
23
23
|
import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
|
24
24
|
import SelectionModel from "./SelectionModel"; // eslint-disable-next-line no-undef
|
25
25
|
|
26
|
-
var version = typeof "6.0.
|
26
|
+
var version = typeof "6.0.5" === 'string' ? "6.0.5" : null;
|
27
27
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
28
28
|
/**
|
29
29
|
* 拓扑显示和编辑
|
@@ -557,15 +557,20 @@ var Topo = /*#__PURE__*/function () {
|
|
557
557
|
case 8:
|
558
558
|
updateEdgeExpanded(this);
|
559
559
|
|
560
|
-
if (this.options.onSwitchToEditMode) {
|
561
|
-
|
562
|
-
|
560
|
+
if (!this.options.onSwitchToEditMode) {
|
561
|
+
_context12.next = 12;
|
562
|
+
break;
|
563
|
+
}
|
563
564
|
|
565
|
+
_context12.next = 12;
|
566
|
+
return this.options.onSwitchToEditMode(this);
|
564
567
|
|
568
|
+
case 12:
|
569
|
+
// 加载自定义上传的图标
|
565
570
|
iconManageDispatchers = this.store.getModelDispatchers('customIcon');
|
566
571
|
iconManageDispatchers.loadEditorIcons();
|
567
572
|
|
568
|
-
case
|
573
|
+
case 14:
|
569
574
|
case "end":
|
570
575
|
return _context12.stop();
|
571
576
|
}
|
@@ -594,11 +599,15 @@ var Topo = /*#__PURE__*/function () {
|
|
594
599
|
editDispatchers = this.store.getModelDispatchers('topoConfig');
|
595
600
|
editDispatchers.switchToViewMode(this.id);
|
596
601
|
|
597
|
-
if (this.options.onSwitchToViewMode) {
|
598
|
-
|
602
|
+
if (!this.options.onSwitchToViewMode) {
|
603
|
+
_context13.next = 7;
|
604
|
+
break;
|
599
605
|
}
|
600
606
|
|
601
|
-
|
607
|
+
_context13.next = 7;
|
608
|
+
return this.options.onSwitchToViewMode(this);
|
609
|
+
|
610
|
+
case 7:
|
602
611
|
case "end":
|
603
612
|
return _context13.stop();
|
604
613
|
}
|
@@ -63,9 +63,10 @@ var TopoCenter = /*#__PURE__*/function (_TopoApp) {
|
|
63
63
|
while (1) {
|
64
64
|
switch (_context2.prev = _context2.next) {
|
65
65
|
case 0:
|
66
|
-
|
66
|
+
_context2.next = 2;
|
67
|
+
return topo.resourceConfig.loadConfig();
|
67
68
|
|
68
|
-
case
|
69
|
+
case 2:
|
69
70
|
case "end":
|
70
71
|
return _context2.stop();
|
71
72
|
}
|
@@ -79,13 +80,37 @@ var TopoCenter = /*#__PURE__*/function (_TopoApp) {
|
|
79
80
|
|
80
81
|
return onSwitchToEditMode;
|
81
82
|
}(),
|
82
|
-
onSwitchToViewMode: function
|
83
|
-
var
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
83
|
+
onSwitchToViewMode: function () {
|
84
|
+
var _onSwitchToViewMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(topo) {
|
85
|
+
var topoModDispatchers;
|
86
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
87
|
+
while (1) {
|
88
|
+
switch (_context3.prev = _context3.next) {
|
89
|
+
case 0:
|
90
|
+
topoModDispatchers = topo.store.getModelDispatchers('topoMod');
|
91
|
+
_context3.next = 3;
|
92
|
+
return topoModDispatchers.openTopoPage({
|
93
|
+
id: topo.id
|
94
|
+
});
|
95
|
+
|
96
|
+
case 3:
|
97
|
+
_context3.next = 5;
|
98
|
+
return topoModDispatchers.refreshTopoTree();
|
99
|
+
|
100
|
+
case 5:
|
101
|
+
case "end":
|
102
|
+
return _context3.stop();
|
103
|
+
}
|
104
|
+
}
|
105
|
+
}, _callee3);
|
106
|
+
}));
|
107
|
+
|
108
|
+
function onSwitchToViewMode(_x3) {
|
109
|
+
return _onSwitchToViewMode.apply(this, arguments);
|
110
|
+
}
|
111
|
+
|
112
|
+
return onSwitchToViewMode;
|
113
|
+
}()
|
89
114
|
})) || this;
|
90
115
|
_this.resourceConfig = null;
|
91
116
|
var menuCommands = createMenuCommands(_assertThisInitialized(_this));
|
@@ -106,25 +131,25 @@ var TopoCenter = /*#__PURE__*/function (_TopoApp) {
|
|
106
131
|
_proto.initData =
|
107
132
|
/*#__PURE__*/
|
108
133
|
function () {
|
109
|
-
var _initData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
134
|
+
var _initData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(params) {
|
110
135
|
var topoDispatchers;
|
111
|
-
return _regeneratorRuntime.wrap(function
|
136
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
112
137
|
while (1) {
|
113
|
-
switch (
|
138
|
+
switch (_context4.prev = _context4.next) {
|
114
139
|
case 0:
|
115
140
|
topoDispatchers = this.store.getModelDispatchers('topoCenter');
|
116
|
-
|
141
|
+
_context4.next = 3;
|
117
142
|
return topoDispatchers.initData(params);
|
118
143
|
|
119
144
|
case 3:
|
120
145
|
case "end":
|
121
|
-
return
|
146
|
+
return _context4.stop();
|
122
147
|
}
|
123
148
|
}
|
124
|
-
},
|
149
|
+
}, _callee4, this);
|
125
150
|
}));
|
126
151
|
|
127
|
-
function initData(
|
152
|
+
function initData(_x4) {
|
128
153
|
return _initData.apply(this, arguments);
|
129
154
|
}
|
130
155
|
|
@@ -143,22 +168,22 @@ var TopoCenter = /*#__PURE__*/function (_TopoApp) {
|
|
143
168
|
_proto.exit =
|
144
169
|
/*#__PURE__*/
|
145
170
|
function () {
|
146
|
-
var _exit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
171
|
+
var _exit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
147
172
|
var topoDispatchers;
|
148
|
-
return _regeneratorRuntime.wrap(function
|
173
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
149
174
|
while (1) {
|
150
|
-
switch (
|
175
|
+
switch (_context5.prev = _context5.next) {
|
151
176
|
case 0:
|
152
177
|
topoDispatchers = this.store.getModelDispatchers('topoCenter');
|
153
|
-
|
178
|
+
_context5.next = 3;
|
154
179
|
return topoDispatchers.exit();
|
155
180
|
|
156
181
|
case 3:
|
157
182
|
case "end":
|
158
|
-
return
|
183
|
+
return _context5.stop();
|
159
184
|
}
|
160
185
|
}
|
161
|
-
},
|
186
|
+
}, _callee5, this);
|
162
187
|
}));
|
163
188
|
|
164
189
|
function exit() {
|
@@ -11,17 +11,13 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
11
11
|
|
12
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
13
13
|
|
14
|
-
var
|
15
|
-
|
16
|
-
var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
|
14
|
+
var _htElementDataUtil = require("../../utils/htElementDataUtil");
|
17
15
|
|
18
|
-
var
|
16
|
+
var _htElementUtils = require("../../utils/htElementUtils");
|
19
17
|
|
20
18
|
var _ResourceConfigUtil = _interopRequireDefault(require("../../utils/ResourceConfigUtil"));
|
21
19
|
|
22
|
-
var
|
23
|
-
|
24
|
-
var _htElementDataUtil = require("../../utils/htElementDataUtil");
|
20
|
+
var _template = require("../../utils/template");
|
25
21
|
|
26
22
|
function _default(props) {
|
27
23
|
var topo = props.topo;
|
@@ -34,9 +30,10 @@ function _default(props) {
|
|
34
30
|
while (1) {
|
35
31
|
switch (_context.prev = _context.next) {
|
36
32
|
case 0:
|
37
|
-
|
33
|
+
_context.next = 2;
|
34
|
+
return editDispatchers.getConditions();
|
38
35
|
|
39
|
-
case
|
36
|
+
case 2:
|
40
37
|
case "end":
|
41
38
|
return _context.stop();
|
42
39
|
}
|
@@ -54,7 +54,7 @@ var _ElementTagTipConfig = _interopRequireDefault(require("./tagstips/ElementTag
|
|
54
54
|
var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
|
55
55
|
|
56
56
|
// eslint-disable-next-line no-undef
|
57
|
-
var version = typeof "6.0.
|
57
|
+
var version = typeof "6.0.5" === 'string' ? "6.0.5" : null;
|
58
58
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
59
59
|
/**
|
60
60
|
* 拓扑显示和编辑
|
@@ -588,15 +588,20 @@ var Topo = /*#__PURE__*/function () {
|
|
588
588
|
case 8:
|
589
589
|
(0, _edgeUtil.updateEdgeExpanded)(this);
|
590
590
|
|
591
|
-
if (this.options.onSwitchToEditMode) {
|
592
|
-
|
593
|
-
|
591
|
+
if (!this.options.onSwitchToEditMode) {
|
592
|
+
_context12.next = 12;
|
593
|
+
break;
|
594
|
+
}
|
594
595
|
|
596
|
+
_context12.next = 12;
|
597
|
+
return this.options.onSwitchToEditMode(this);
|
595
598
|
|
599
|
+
case 12:
|
600
|
+
// 加载自定义上传的图标
|
596
601
|
iconManageDispatchers = this.store.getModelDispatchers('customIcon');
|
597
602
|
iconManageDispatchers.loadEditorIcons();
|
598
603
|
|
599
|
-
case
|
604
|
+
case 14:
|
600
605
|
case "end":
|
601
606
|
return _context12.stop();
|
602
607
|
}
|
@@ -625,11 +630,15 @@ var Topo = /*#__PURE__*/function () {
|
|
625
630
|
editDispatchers = this.store.getModelDispatchers('topoConfig');
|
626
631
|
editDispatchers.switchToViewMode(this.id);
|
627
632
|
|
628
|
-
if (this.options.onSwitchToViewMode) {
|
629
|
-
|
633
|
+
if (!this.options.onSwitchToViewMode) {
|
634
|
+
_context13.next = 7;
|
635
|
+
break;
|
630
636
|
}
|
631
637
|
|
632
|
-
|
638
|
+
_context13.next = 7;
|
639
|
+
return this.options.onSwitchToViewMode(this);
|
640
|
+
|
641
|
+
case 7:
|
633
642
|
case "end":
|
634
643
|
return _context13.stop();
|
635
644
|
}
|
@@ -81,9 +81,10 @@ var TopoCenter = /*#__PURE__*/function (_TopoApp) {
|
|
81
81
|
while (1) {
|
82
82
|
switch (_context2.prev = _context2.next) {
|
83
83
|
case 0:
|
84
|
-
|
84
|
+
_context2.next = 2;
|
85
|
+
return topo.resourceConfig.loadConfig();
|
85
86
|
|
86
|
-
case
|
87
|
+
case 2:
|
87
88
|
case "end":
|
88
89
|
return _context2.stop();
|
89
90
|
}
|
@@ -97,13 +98,37 @@ var TopoCenter = /*#__PURE__*/function (_TopoApp) {
|
|
97
98
|
|
98
99
|
return onSwitchToEditMode;
|
99
100
|
}(),
|
100
|
-
onSwitchToViewMode: function
|
101
|
-
var
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
101
|
+
onSwitchToViewMode: function () {
|
102
|
+
var _onSwitchToViewMode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(topo) {
|
103
|
+
var topoModDispatchers;
|
104
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
105
|
+
while (1) {
|
106
|
+
switch (_context3.prev = _context3.next) {
|
107
|
+
case 0:
|
108
|
+
topoModDispatchers = topo.store.getModelDispatchers('topoMod');
|
109
|
+
_context3.next = 3;
|
110
|
+
return topoModDispatchers.openTopoPage({
|
111
|
+
id: topo.id
|
112
|
+
});
|
113
|
+
|
114
|
+
case 3:
|
115
|
+
_context3.next = 5;
|
116
|
+
return topoModDispatchers.refreshTopoTree();
|
117
|
+
|
118
|
+
case 5:
|
119
|
+
case "end":
|
120
|
+
return _context3.stop();
|
121
|
+
}
|
122
|
+
}
|
123
|
+
}, _callee3);
|
124
|
+
}));
|
125
|
+
|
126
|
+
function onSwitchToViewMode(_x3) {
|
127
|
+
return _onSwitchToViewMode.apply(this, arguments);
|
128
|
+
}
|
129
|
+
|
130
|
+
return onSwitchToViewMode;
|
131
|
+
}()
|
107
132
|
})) || this;
|
108
133
|
_this.resourceConfig = null;
|
109
134
|
var menuCommands = (0, _createMenuCommands["default"])((0, _assertThisInitialized2["default"])(_this));
|
@@ -124,25 +149,25 @@ var TopoCenter = /*#__PURE__*/function (_TopoApp) {
|
|
124
149
|
_proto.initData =
|
125
150
|
/*#__PURE__*/
|
126
151
|
function () {
|
127
|
-
var _initData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
152
|
+
var _initData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(params) {
|
128
153
|
var topoDispatchers;
|
129
|
-
return _regenerator["default"].wrap(function
|
154
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
130
155
|
while (1) {
|
131
|
-
switch (
|
156
|
+
switch (_context4.prev = _context4.next) {
|
132
157
|
case 0:
|
133
158
|
topoDispatchers = this.store.getModelDispatchers('topoCenter');
|
134
|
-
|
159
|
+
_context4.next = 3;
|
135
160
|
return topoDispatchers.initData(params);
|
136
161
|
|
137
162
|
case 3:
|
138
163
|
case "end":
|
139
|
-
return
|
164
|
+
return _context4.stop();
|
140
165
|
}
|
141
166
|
}
|
142
|
-
},
|
167
|
+
}, _callee4, this);
|
143
168
|
}));
|
144
169
|
|
145
|
-
function initData(
|
170
|
+
function initData(_x4) {
|
146
171
|
return _initData.apply(this, arguments);
|
147
172
|
}
|
148
173
|
|
@@ -161,22 +186,22 @@ var TopoCenter = /*#__PURE__*/function (_TopoApp) {
|
|
161
186
|
_proto.exit =
|
162
187
|
/*#__PURE__*/
|
163
188
|
function () {
|
164
|
-
var _exit = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
189
|
+
var _exit = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
165
190
|
var topoDispatchers;
|
166
|
-
return _regenerator["default"].wrap(function
|
191
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
167
192
|
while (1) {
|
168
|
-
switch (
|
193
|
+
switch (_context5.prev = _context5.next) {
|
169
194
|
case 0:
|
170
195
|
topoDispatchers = this.store.getModelDispatchers('topoCenter');
|
171
|
-
|
196
|
+
_context5.next = 3;
|
172
197
|
return topoDispatchers.exit();
|
173
198
|
|
174
199
|
case 3:
|
175
200
|
case "end":
|
176
|
-
return
|
201
|
+
return _context5.stop();
|
177
202
|
}
|
178
203
|
}
|
179
|
-
},
|
204
|
+
}, _callee5, this);
|
180
205
|
}));
|
181
206
|
|
182
207
|
function exit() {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@riil-frontend/component-topology",
|
3
|
-
"version": "6.0.
|
3
|
+
"version": "6.0.5",
|
4
4
|
"description": "拓扑",
|
5
5
|
"scripts": {
|
6
6
|
"start": "build-scripts start",
|
@@ -116,6 +116,6 @@
|
|
116
116
|
"access": "public"
|
117
117
|
},
|
118
118
|
"license": "MIT",
|
119
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@6.0.
|
119
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@6.0.5/build/index.html",
|
120
120
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
121
121
|
}
|