@riil-frontend/component-topology 2.15.42 → 2.15.45
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 +2 -2
- package/es/common/components/ColorPicker/ColorPicker.js +5 -2
- package/es/components/Drawer/index.js +8 -2
- package/es/components/TemplateButton/index.module.scss +1 -0
- package/es/core/common/hooks/ht/useDataModelDataPropertyChange.js +13 -4
- package/es/core/common/icons/icon.js +1 -1
- package/es/core/common/icons/useIcons.js +1 -1
- package/es/core/components/TopoView/topoView.js +8 -18
- package/es/core/{models/createTopoApp.js → createTopoApp.js} +1 -1
- package/es/core/editor/components/BackgroundView/index.js +80 -44
- package/es/core/editor/components/BackgroundView/index.module.scss +1 -0
- package/es/core/editor/components/{iconManage/IconManage.js → CustomIconPlugin/CustomIconPlugin.js} +3 -3
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/RenameDialog.js +1 -1
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.js +16 -2
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.module.scss +0 -0
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.scss +0 -0
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialogWrapper.js +1 -1
- package/es/core/editor/components/CustomIconPlugin/index.js +2 -0
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/utils/svgToShape.js +0 -0
- package/es/core/editor/components/EditorPlugin.js +2 -2
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +2 -0
- package/es/core/editor/components/settings/propertyViews/node/NodePropertyView.js +2 -2
- package/es/core/models/TopoApp.js +9 -5
- package/es/core/services/background.js +26 -1
- package/es/core/store/coreModels.js +32 -26
- package/es/core/store/createStore.js +1 -1
- package/es/core/test/Test.js +3 -1
- package/es/core/viewer/contextmenu/buildNodeContextmenu.js +65 -64
- package/es/createTopo.js +1 -1
- package/es/hooks/useAlarm.js +3 -6
- package/es/hooks/useResourceConfig.js +1 -1
- package/es/hooks/useTopoEdit.js +4 -8
- package/es/models/{iconManage.js → customIcon.js} +1 -1
- package/es/models/topoBizMod.js +22 -52
- package/es/models/{topoCreateMod.js → topoConfig.js} +8 -4
- package/es/models/topoMod.js +32 -69
- package/es/{components → topoCenter/components}/Link/form.js +0 -0
- package/es/{components → topoCenter/components}/Link/hook.js +0 -0
- package/es/{components → topoCenter/components}/Link/index copy.js +1 -1
- package/es/{components → topoCenter/components}/Link/index.js +1 -1
- package/es/{components → topoCenter/components}/Link/index.module.scss +0 -0
- package/es/{components → topoCenter/components}/Link/setting.js +0 -0
- package/es/topoCenter/components/TopoView.js +16 -3
- package/es/topoCenter/components/Topology.js +0 -5
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.js +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.module.scss +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/index.js +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.js +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.module.scss +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.js +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.module.scss +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.scss +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.js +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.module.scss +0 -0
- package/es/topoCenter/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +1 -1
- package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +3 -3
- package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +1 -1
- package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +1 -1
- package/es/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.js → LinkInfoPreview.js} +1 -1
- package/es/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.module.scss → LinkInfoPreview.module.scss} +0 -0
- package/es/{hooks → topoCenter/hooks/viewer}/useRelateTopo.js +2 -2
- package/es/{models → topoCenter/store}/linkDynamicStyle.js +3 -3
- package/es/{models → topoCenter/store}/linkDynamicStyleConfig.js +2 -1
- package/es/{models → topoCenter/store}/linkManager.js +0 -0
- package/lib/common/components/ColorPicker/ColorPicker.js +5 -2
- package/lib/components/Drawer/index.js +7 -2
- package/lib/components/TemplateButton/index.module.scss +1 -0
- package/lib/core/common/hooks/ht/useDataModelDataPropertyChange.js +13 -4
- package/lib/core/common/icons/icon.js +1 -1
- package/lib/core/common/icons/useIcons.js +1 -1
- package/lib/core/components/TopoView/topoView.js +9 -20
- package/lib/core/{models/createTopoApp.js → createTopoApp.js} +1 -1
- package/lib/core/editor/components/BackgroundView/index.js +80 -44
- package/lib/core/editor/components/BackgroundView/index.module.scss +1 -0
- package/lib/core/editor/components/{iconManage/IconManage.js → CustomIconPlugin/CustomIconPlugin.js} +3 -3
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/RenameDialog.js +1 -1
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.js +17 -2
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.module.scss +0 -0
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.scss +0 -0
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialogWrapper.js +1 -1
- package/lib/core/editor/components/CustomIconPlugin/index.js +11 -0
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/utils/svgToShape.js +0 -0
- package/lib/core/editor/components/EditorPlugin.js +2 -2
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +2 -0
- package/lib/core/editor/components/settings/propertyViews/node/NodePropertyView.js +1 -1
- package/lib/core/models/TopoApp.js +9 -5
- package/lib/core/services/background.js +26 -1
- package/lib/core/store/coreModels.js +35 -26
- package/lib/core/store/createStore.js +2 -2
- package/lib/core/test/Test.js +3 -1
- package/lib/core/viewer/contextmenu/buildNodeContextmenu.js +65 -64
- package/lib/createTopo.js +1 -1
- package/lib/hooks/useAlarm.js +3 -6
- package/lib/hooks/useResourceConfig.js +1 -1
- package/lib/hooks/useTopoEdit.js +4 -8
- package/lib/models/{iconManage.js → customIcon.js} +1 -1
- package/lib/models/topoBizMod.js +22 -52
- package/lib/models/{topoCreateMod.js → topoConfig.js} +7 -4
- package/lib/models/topoMod.js +32 -69
- package/lib/{components → topoCenter/components}/Link/form.js +0 -0
- package/lib/{components → topoCenter/components}/Link/hook.js +0 -0
- package/lib/{components → topoCenter/components}/Link/index copy.js +1 -1
- package/lib/{components → topoCenter/components}/Link/index.js +1 -1
- package/lib/{components → topoCenter/components}/Link/index.module.scss +0 -0
- package/lib/{components → topoCenter/components}/Link/setting.js +0 -0
- package/lib/topoCenter/components/TopoView.js +19 -3
- package/lib/topoCenter/components/Topology.js +0 -7
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.js +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.module.scss +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/index.js +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.js +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.module.scss +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.js +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.module.scss +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.scss +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.js +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.module.scss +0 -0
- package/lib/topoCenter/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +2 -2
- package/lib/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +8 -8
- package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +1 -1
- package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +1 -1
- package/lib/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.js → LinkInfoPreview.js} +4 -4
- package/lib/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.module.scss → LinkInfoPreview.module.scss} +0 -0
- package/lib/{hooks → topoCenter/hooks/viewer}/useRelateTopo.js +2 -2
- package/lib/{models → topoCenter/store}/linkDynamicStyle.js +3 -3
- package/lib/{models → topoCenter/store}/linkDynamicStyleConfig.js +2 -1
- package/lib/{models → topoCenter/store}/linkManager.js +0 -0
- package/package.json +2 -2
- package/es/core/editor/LinkDynamicStyleConfig.js +0 -16
- package/es/core/store/getStoreModels.js +0 -40
- package/lib/core/editor/LinkDynamicStyleConfig.js +0 -21
- package/lib/core/store/getStoreModels.js +0 -67
|
@@ -13,7 +13,7 @@ var _loading = _interopRequireDefault(require("@alifd/next/lib/loading"));
|
|
|
13
13
|
|
|
14
14
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _dialog = _interopRequireDefault(require("@alifd/next/lib/dialog"));
|
|
17
17
|
|
|
18
18
|
var _tag = _interopRequireDefault(require("@alifd/next/lib/tag"));
|
|
19
19
|
|
|
@@ -21,7 +21,7 @@ var _button = _interopRequireDefault(require("@alifd/next/lib/button"));
|
|
|
21
21
|
|
|
22
22
|
var _icon = _interopRequireDefault(require("@alifd/next/lib/icon"));
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
25
25
|
|
|
26
26
|
var _react = _interopRequireWildcard(require("react"));
|
|
27
27
|
|
|
@@ -47,20 +47,56 @@ function List(props) {
|
|
|
47
47
|
dataSource = props.dataSource,
|
|
48
48
|
onRemove = props.onRemove;
|
|
49
49
|
|
|
50
|
-
function remove(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
50
|
+
function remove(_x, _x2) {
|
|
51
|
+
return _remove.apply(this, arguments);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function _remove() {
|
|
55
|
+
_remove = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(e, id) {
|
|
56
|
+
var canDelete;
|
|
57
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
58
|
+
while (1) {
|
|
59
|
+
switch (_context.prev = _context.next) {
|
|
60
|
+
case 0:
|
|
61
|
+
e.stopPropagation();
|
|
62
|
+
_context.next = 3;
|
|
63
|
+
return _background["default"].canDeleteBackground(id);
|
|
64
|
+
|
|
65
|
+
case 3:
|
|
66
|
+
canDelete = _context.sent;
|
|
67
|
+
console.log('canDelete', canDelete);
|
|
68
|
+
|
|
69
|
+
if (canDelete) {
|
|
70
|
+
_dialog["default"].confirm({
|
|
71
|
+
title: '删除',
|
|
72
|
+
messageProps: {
|
|
73
|
+
type: 'warning'
|
|
74
|
+
},
|
|
75
|
+
content: '若执行相关操作,此背景将会从背景库删除,确定删除吗?',
|
|
76
|
+
onOk: function onOk() {
|
|
77
|
+
return onRemove(id);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
} else {
|
|
81
|
+
_dialog["default"].confirm({
|
|
82
|
+
title: '提示',
|
|
83
|
+
messageProps: {
|
|
84
|
+
type: 'warning'
|
|
85
|
+
},
|
|
86
|
+
content: '此背景被占用,不能删除。',
|
|
87
|
+
footerActions: ['ok'],
|
|
88
|
+
onOk: function onOk() {}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
case 6:
|
|
93
|
+
case "end":
|
|
94
|
+
return _context.stop();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}, _callee);
|
|
98
|
+
}));
|
|
99
|
+
return _remove.apply(this, arguments);
|
|
64
100
|
}
|
|
65
101
|
|
|
66
102
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -121,46 +157,46 @@ function BackgroundView(props) {
|
|
|
121
157
|
}
|
|
122
158
|
|
|
123
159
|
function _getBackground() {
|
|
124
|
-
_getBackground = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
160
|
+
_getBackground = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
125
161
|
var res;
|
|
126
|
-
return _regenerator["default"].wrap(function
|
|
162
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
127
163
|
while (1) {
|
|
128
|
-
switch (
|
|
164
|
+
switch (_context3.prev = _context3.next) {
|
|
129
165
|
case 0:
|
|
130
|
-
|
|
166
|
+
_context3.next = 2;
|
|
131
167
|
return _background["default"].getBackgroundList();
|
|
132
168
|
|
|
133
169
|
case 2:
|
|
134
|
-
res =
|
|
170
|
+
res = _context3.sent;
|
|
135
171
|
setBgList(res);
|
|
136
172
|
|
|
137
173
|
case 4:
|
|
138
174
|
case "end":
|
|
139
|
-
return
|
|
175
|
+
return _context3.stop();
|
|
140
176
|
}
|
|
141
177
|
}
|
|
142
|
-
},
|
|
178
|
+
}, _callee3);
|
|
143
179
|
}));
|
|
144
180
|
return _getBackground.apply(this, arguments);
|
|
145
181
|
}
|
|
146
182
|
|
|
147
|
-
function removeBg(
|
|
183
|
+
function removeBg(_x3) {
|
|
148
184
|
return _removeBg.apply(this, arguments);
|
|
149
185
|
} // 同步拓扑图展示
|
|
150
186
|
|
|
151
187
|
|
|
152
188
|
function _removeBg() {
|
|
153
|
-
_removeBg = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
189
|
+
_removeBg = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(id) {
|
|
154
190
|
var res;
|
|
155
|
-
return _regenerator["default"].wrap(function
|
|
191
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
156
192
|
while (1) {
|
|
157
|
-
switch (
|
|
193
|
+
switch (_context4.prev = _context4.next) {
|
|
158
194
|
case 0:
|
|
159
|
-
|
|
195
|
+
_context4.next = 2;
|
|
160
196
|
return _background["default"].deleteBackground(id);
|
|
161
197
|
|
|
162
198
|
case 2:
|
|
163
|
-
res =
|
|
199
|
+
res = _context4.sent;
|
|
164
200
|
|
|
165
201
|
// 删除当前选中
|
|
166
202
|
if (id === (current === null || current === void 0 ? void 0 : current.id)) {
|
|
@@ -174,10 +210,10 @@ function BackgroundView(props) {
|
|
|
174
210
|
|
|
175
211
|
case 6:
|
|
176
212
|
case "end":
|
|
177
|
-
return
|
|
213
|
+
return _context4.stop();
|
|
178
214
|
}
|
|
179
215
|
}
|
|
180
|
-
},
|
|
216
|
+
}, _callee4);
|
|
181
217
|
}));
|
|
182
218
|
return _removeBg.apply(this, arguments);
|
|
183
219
|
}
|
|
@@ -187,48 +223,48 @@ function BackgroundView(props) {
|
|
|
187
223
|
}
|
|
188
224
|
|
|
189
225
|
var handleSelect = /*#__PURE__*/function () {
|
|
190
|
-
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
226
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(currentBg) {
|
|
191
227
|
var imgUrl, size;
|
|
192
|
-
return _regenerator["default"].wrap(function
|
|
228
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
193
229
|
while (1) {
|
|
194
|
-
switch (
|
|
230
|
+
switch (_context2.prev = _context2.next) {
|
|
195
231
|
case 0:
|
|
196
232
|
if (!(currentBg !== null && currentBg !== void 0 && currentBg.id && currentBg.id !== (current === null || current === void 0 ? void 0 : current.id))) {
|
|
197
|
-
|
|
233
|
+
_context2.next = 16;
|
|
198
234
|
break;
|
|
199
235
|
}
|
|
200
236
|
|
|
201
237
|
setLoadingBackground(true);
|
|
202
238
|
imgUrl = (0, _backgroundUtil.getBackgroundImageUrl)(currentBg);
|
|
203
|
-
|
|
204
|
-
|
|
239
|
+
_context2.prev = 3;
|
|
240
|
+
_context2.next = 6;
|
|
205
241
|
return (0, _imageUtil.getImageSize)(imgUrl);
|
|
206
242
|
|
|
207
243
|
case 6:
|
|
208
|
-
size =
|
|
244
|
+
size = _context2.sent;
|
|
209
245
|
|
|
210
246
|
_rlog["default"].debug('获取图片大小', size);
|
|
211
247
|
|
|
212
248
|
setBackground((0, _extends2["default"])({}, currentBg, size));
|
|
213
249
|
topo.getHtTopo().setBackgroundImgUrl(imgUrl, size.width, size.height);
|
|
214
250
|
setLoadingBackground(false);
|
|
215
|
-
|
|
251
|
+
_context2.next = 16;
|
|
216
252
|
break;
|
|
217
253
|
|
|
218
254
|
case 13:
|
|
219
|
-
|
|
220
|
-
|
|
255
|
+
_context2.prev = 13;
|
|
256
|
+
_context2.t0 = _context2["catch"](3);
|
|
221
257
|
setLoadingBackground(false);
|
|
222
258
|
|
|
223
259
|
case 16:
|
|
224
260
|
case "end":
|
|
225
|
-
return
|
|
261
|
+
return _context2.stop();
|
|
226
262
|
}
|
|
227
263
|
}
|
|
228
|
-
},
|
|
264
|
+
}, _callee2, null, [[3, 13]]);
|
|
229
265
|
}));
|
|
230
266
|
|
|
231
|
-
return function handleSelect(
|
|
267
|
+
return function handleSelect(_x4) {
|
|
232
268
|
return _ref.apply(this, arguments);
|
|
233
269
|
};
|
|
234
270
|
}();
|
package/lib/core/editor/components/{iconManage/IconManage.js → CustomIconPlugin/CustomIconPlugin.js}
RENAMED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
|
-
exports["default"] =
|
|
6
|
+
exports["default"] = CustomIconPlugin;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
@@ -15,10 +15,10 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
15
15
|
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
17
|
|
|
18
|
-
function
|
|
18
|
+
function CustomIconPlugin(props) {
|
|
19
19
|
var topo = props.topo;
|
|
20
20
|
var store = topo.store;
|
|
21
|
-
var dispatchers = store.getModelDispatchers('
|
|
21
|
+
var dispatchers = store.getModelDispatchers('customIcon'); // 初始化时注册事件
|
|
22
22
|
|
|
23
23
|
(0, _react.useEffect)(function () {
|
|
24
24
|
var notifier = topo.view.topoClient.notifier; // 测试代码
|
|
@@ -31,7 +31,7 @@ function RenameDialog(props) {
|
|
|
31
31
|
var topo = props.topo;
|
|
32
32
|
var store = topo.store;
|
|
33
33
|
|
|
34
|
-
var _store$useModel = store.useModel('
|
|
34
|
+
var _store$useModel = store.useModel('customIcon'),
|
|
35
35
|
state = _store$useModel[0],
|
|
36
36
|
dispatchers = _store$useModel[1];
|
|
37
37
|
|
|
@@ -35,6 +35,8 @@ var _UploadIconDialogModule = _interopRequireDefault(require("./UploadIconDialog
|
|
|
35
35
|
|
|
36
36
|
require("./UploadIconDialog.scss");
|
|
37
37
|
|
|
38
|
+
var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
|
|
39
|
+
|
|
38
40
|
var config = _configProvider["default"].config;
|
|
39
41
|
|
|
40
42
|
function getFileName(file) {
|
|
@@ -120,7 +122,18 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
|
|
|
120
122
|
|
|
121
123
|
_this.setState({
|
|
122
124
|
files: validFiles
|
|
123
|
-
});
|
|
125
|
+
}); // 上传接口报错后只会通知该回调,移除上传loading
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
if (_this.state.uploading && files.filter(function (file) {
|
|
129
|
+
return file.state === 'error';
|
|
130
|
+
}).length && !files.filter(function (file) {
|
|
131
|
+
return file.state === 'uploading';
|
|
132
|
+
}).length) {
|
|
133
|
+
_this.setState({
|
|
134
|
+
uploading: false
|
|
135
|
+
});
|
|
136
|
+
}
|
|
124
137
|
};
|
|
125
138
|
|
|
126
139
|
_this.submit = function () {
|
|
@@ -220,7 +233,9 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
|
|
|
220
233
|
});
|
|
221
234
|
};
|
|
222
235
|
|
|
223
|
-
_this.handleUploadError = function () {
|
|
236
|
+
_this.handleUploadError = function () {
|
|
237
|
+
_rlog["default"].error('上传失败');
|
|
238
|
+
};
|
|
224
239
|
|
|
225
240
|
_this.onClose = function () {
|
|
226
241
|
var dispatchers = _this.props.dispatchers;
|
package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.module.scss
RENAMED
|
File without changes
|
|
File without changes
|
package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialogWrapper.js
RENAMED
|
@@ -17,7 +17,7 @@ function UploadIconDialogWrapper(props) {
|
|
|
17
17
|
var topo = props.topo;
|
|
18
18
|
var store = topo.store;
|
|
19
19
|
|
|
20
|
-
var _store$useModel = store.useModel('
|
|
20
|
+
var _store$useModel = store.useModel('customIcon'),
|
|
21
21
|
state = _store$useModel[0],
|
|
22
22
|
dispatchers = _store$useModel[1];
|
|
23
23
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _CustomIconPlugin = _interopRequireDefault(require("./CustomIconPlugin"));
|
|
9
|
+
|
|
10
|
+
var _default = _CustomIconPlugin["default"];
|
|
11
|
+
exports["default"] = _default;
|
|
File without changes
|
|
@@ -9,7 +9,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _CustomIconPlugin = _interopRequireDefault(require("./CustomIconPlugin"));
|
|
13
13
|
|
|
14
14
|
var _SaveLoading = _interopRequireDefault(require("./plugins/SaveLoading"));
|
|
15
15
|
|
|
@@ -23,7 +23,7 @@ function TopoEditorPlugin(props) {
|
|
|
23
23
|
topoEdit = props.topoEdit,
|
|
24
24
|
editorProps = props.editorProps;
|
|
25
25
|
var store = topo.store;
|
|
26
|
-
var plugins = [_SaveLoading["default"], _GroupAddResourceDrawerPlugin["default"], _MultipleResourceSelectPlugin["default"],
|
|
26
|
+
var plugins = [_SaveLoading["default"], _GroupAddResourceDrawerPlugin["default"], _MultipleResourceSelectPlugin["default"], _CustomIconPlugin["default"]].concat((editorProps === null || editorProps === void 0 ? void 0 : editorProps.plugins) || []);
|
|
27
27
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, plugins.map(function (Plugin, index) {
|
|
28
28
|
return /*#__PURE__*/_react["default"].createElement(Plugin, (0, _extends2["default"])({
|
|
29
29
|
key: index,
|
|
@@ -42,6 +42,7 @@ function GroupSetting(props) {
|
|
|
42
42
|
editorProps = props.editorProps,
|
|
43
43
|
group = props.group;
|
|
44
44
|
var expanded = values.expanded;
|
|
45
|
+
var id = values.id;
|
|
45
46
|
|
|
46
47
|
var field = _field["default"].useField({
|
|
47
48
|
autoUnmount: false,
|
|
@@ -116,6 +117,7 @@ function GroupSetting(props) {
|
|
|
116
117
|
maxLength: 30,
|
|
117
118
|
placeholder: "\u8BF7\u8F93\u5165"
|
|
118
119
|
})), expanded ? /*#__PURE__*/_react["default"].createElement(_GroupExpandSetting["default"], {
|
|
120
|
+
id: id,
|
|
119
121
|
group: group,
|
|
120
122
|
expanded: expanded,
|
|
121
123
|
topo: topo,
|
|
@@ -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.45" === 'string' ? "2.15.45" : null;
|
|
52
52
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
|
53
53
|
/**
|
|
54
54
|
* 拓扑显示和编辑
|
|
@@ -103,6 +103,10 @@ var Topo = /*#__PURE__*/function () {
|
|
|
103
103
|
|
|
104
104
|
this.test = new _Test["default"](this);
|
|
105
105
|
this.uid = _topoFactory["default"].add(options.name, this);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
_proto.destroy = function destroy() {
|
|
109
|
+
_topoFactory["default"].remove(this.uid);
|
|
106
110
|
}
|
|
107
111
|
/**
|
|
108
112
|
* TODO 移除
|
|
@@ -123,7 +127,7 @@ var Topo = /*#__PURE__*/function () {
|
|
|
123
127
|
return topoDispatchers.exit();
|
|
124
128
|
|
|
125
129
|
case 3:
|
|
126
|
-
|
|
130
|
+
this.destroy();
|
|
127
131
|
|
|
128
132
|
case 4:
|
|
129
133
|
case "end":
|
|
@@ -572,7 +576,7 @@ var Topo = /*#__PURE__*/function () {
|
|
|
572
576
|
|
|
573
577
|
case 7:
|
|
574
578
|
(0, _edgeUtil.updateEdgeExpanded)(this);
|
|
575
|
-
editDispatchers = this.store.getModelDispatchers('
|
|
579
|
+
editDispatchers = this.store.getModelDispatchers('topoConfig');
|
|
576
580
|
editDispatchers.switchToEditMode();
|
|
577
581
|
|
|
578
582
|
if (this.options.onSwitchToEditMode) {
|
|
@@ -580,7 +584,7 @@ var Topo = /*#__PURE__*/function () {
|
|
|
580
584
|
} // 加载自定义上传的图标
|
|
581
585
|
|
|
582
586
|
|
|
583
|
-
iconManageDispatchers = this.store.getModelDispatchers('
|
|
587
|
+
iconManageDispatchers = this.store.getModelDispatchers('customIcon');
|
|
584
588
|
iconManageDispatchers.loadEditorIcons();
|
|
585
589
|
|
|
586
590
|
case 13:
|
|
@@ -609,7 +613,7 @@ var Topo = /*#__PURE__*/function () {
|
|
|
609
613
|
return this.view.switchToViewMode();
|
|
610
614
|
|
|
611
615
|
case 2:
|
|
612
|
-
editDispatchers = this.store.getModelDispatchers('
|
|
616
|
+
editDispatchers = this.store.getModelDispatchers('topoConfig');
|
|
613
617
|
editDispatchers.switchToViewMode(this.id);
|
|
614
618
|
|
|
615
619
|
if (this.options.onSwitchToViewMode) {
|
|
@@ -117,6 +117,31 @@ var _default = {
|
|
|
117
117
|
/**
|
|
118
118
|
* 背景图导出
|
|
119
119
|
*/
|
|
120
|
-
EXPORT_BG_ZIP: EXPORT_BG_ZIP
|
|
120
|
+
EXPORT_BG_ZIP: EXPORT_BG_ZIP,
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* 校验背景图是否被占用
|
|
124
|
+
* @param {*} params id
|
|
125
|
+
*/
|
|
126
|
+
canDeleteBackground: function canDeleteBackground(id) {
|
|
127
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
|
128
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
129
|
+
while (1) {
|
|
130
|
+
switch (_context4.prev = _context4.next) {
|
|
131
|
+
case 0:
|
|
132
|
+
_context4.next = 2;
|
|
133
|
+
return (0, _request.getRequest)()("/topo/v1/api/background/" + id);
|
|
134
|
+
|
|
135
|
+
case 2:
|
|
136
|
+
return _context4.abrupt("return", _context4.sent);
|
|
137
|
+
|
|
138
|
+
case 3:
|
|
139
|
+
case "end":
|
|
140
|
+
return _context4.stop();
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}, _callee4);
|
|
144
|
+
}))();
|
|
145
|
+
}
|
|
121
146
|
};
|
|
122
147
|
exports["default"] = _default;
|
|
@@ -5,51 +5,60 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
|
|
8
|
-
var _topoMod = _interopRequireDefault(require("
|
|
8
|
+
var _topoMod = _interopRequireDefault(require("../../models/topoMod"));
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _customIcon = _interopRequireDefault(require("../../models/customIcon"));
|
|
11
11
|
|
|
12
|
-
var _ciModel = _interopRequireDefault(require("
|
|
12
|
+
var _ciModel = _interopRequireDefault(require("../../models/ciModel"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _selection = _interopRequireDefault(require("../../models/selection"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _topoBizMod = _interopRequireDefault(require("../../models/topoBizMod"));
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _topoConfig = _interopRequireDefault(require("../../models/topoConfig"));
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _topoEdit = _interopRequireDefault(require("../../models/topoEdit"));
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _topoView = _interopRequireDefault(require("../../models/topoView"));
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _topoAlarm = _interopRequireDefault(require("../../models/topoAlarm"));
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _topoGraphView = _interopRequireDefault(require("../../models/topoGraphView"));
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _background = _interopRequireDefault(require("../../models/background"));
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _displayConfig = _interopRequireDefault(require("../../models/displayConfig"));
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _resourceWebControllUrlSetting = _interopRequireDefault(require("../../models/resourceWebControllUrlSetting"));
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _topoBaseInfoOverview = _interopRequireDefault(require("../../models/topoBaseInfoOverview"));
|
|
35
35
|
|
|
36
|
-
var
|
|
36
|
+
var _topoCenter = _interopRequireDefault(require("../../topoCenter/store/topoCenter"));
|
|
37
|
+
|
|
38
|
+
var _functionAuth = _interopRequireDefault(require("../../topoCenter/store/functionAuth"));
|
|
39
|
+
|
|
40
|
+
var _topoLinkMod = _interopRequireDefault(require("../../topoCenter/store/topoLinkMod"));
|
|
41
|
+
|
|
42
|
+
var _topoTreeMod = _interopRequireDefault(require("../../topoCenter/store/topoTreeMod"));
|
|
37
43
|
|
|
38
44
|
var _default = {
|
|
39
45
|
topoMod: _topoMod["default"],
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
functionAuth: _functionAuth["default"],
|
|
43
|
-
linkDynamicStyle: _linkDynamicStyle["default"],
|
|
44
|
-
linkDynamicStyleConfig: _linkDynamicStyleConfig["default"],
|
|
45
|
-
permissionSetting: _permissionSetting["default"],
|
|
46
|
+
customIcon: _customIcon["default"],
|
|
47
|
+
selection: _selection["default"],
|
|
46
48
|
resourceWebControllUrlSetting: _resourceWebControllUrlSetting["default"],
|
|
47
49
|
topoBizMod: _topoBizMod["default"],
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
topoConfig: _topoConfig["default"],
|
|
51
|
+
topoLinkMod: _topoLinkMod["default"],
|
|
52
|
+
topoView: _topoView["default"],
|
|
53
|
+
background: _background["default"],
|
|
54
|
+
topoGraphView: _topoGraphView["default"],
|
|
55
|
+
topoAlarm: _topoAlarm["default"],
|
|
56
|
+
displayConfig: _displayConfig["default"],
|
|
57
|
+
topoBaseInfoOverview: _topoBaseInfoOverview["default"],
|
|
58
|
+
ciModel: _ciModel["default"],
|
|
59
|
+
functionAuth: _functionAuth["default"],
|
|
51
60
|
topoEdit: _topoEdit["default"],
|
|
52
|
-
|
|
53
|
-
|
|
61
|
+
topoCenter: _topoCenter["default"],
|
|
62
|
+
topoTreeMod: _topoTreeMod["default"]
|
|
54
63
|
};
|
|
55
64
|
exports["default"] = _default;
|
|
@@ -9,14 +9,14 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
9
9
|
|
|
10
10
|
var _store = require("@ice/store");
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _coreModels = _interopRequireDefault(require("./coreModels"));
|
|
13
13
|
|
|
14
14
|
function _default(engine, extModels) {
|
|
15
15
|
if (extModels === void 0) {
|
|
16
16
|
extModels = {};
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
var models = (0, _extends2["default"])({},
|
|
19
|
+
var models = (0, _extends2["default"])({}, _coreModels["default"], extModels);
|
|
20
20
|
Object.keys(models).forEach(function (name) {
|
|
21
21
|
var model = models[name];
|
|
22
22
|
|
package/lib/core/test/Test.js
CHANGED
|
@@ -13,9 +13,11 @@ var Test = /*#__PURE__*/function () {
|
|
|
13
13
|
var _proto = Test.prototype;
|
|
14
14
|
|
|
15
15
|
_proto.init = function init() {
|
|
16
|
+
var _this = this;
|
|
17
|
+
|
|
16
18
|
this.iconManage = {
|
|
17
19
|
openUpload: function openUpload(type) {
|
|
18
|
-
topo.store.getModelDispatchers('
|
|
20
|
+
_this.topo.store.getModelDispatchers('customIcon').open({
|
|
19
21
|
type: type || 'node'
|
|
20
22
|
});
|
|
21
23
|
}
|