@riil-frontend/component-topology 2.15.44 → 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/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.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/models/TopoApp.js +9 -5
- 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/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.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/models/TopoApp.js +9 -5
- 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
|
@@ -11,12 +11,15 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
|
|
12
12
|
var _button = _interopRequireDefault(require("@alifd/next/lib/button"));
|
|
13
13
|
|
|
14
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
15
|
+
|
|
14
16
|
var _react = _interopRequireDefault(require("react"));
|
|
15
17
|
|
|
16
18
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
19
|
|
|
18
20
|
var _indexModule = _interopRequireDefault(require("./index.module.scss"));
|
|
19
21
|
|
|
22
|
+
var _excluded = ["bodyClassName"];
|
|
20
23
|
var headerStyle = {
|
|
21
24
|
zIndex: 1000
|
|
22
25
|
};
|
|
@@ -37,6 +40,8 @@ var Drawer = function Drawer(props) {
|
|
|
37
40
|
onSave = props.onSave,
|
|
38
41
|
drawerProps = props.drawerProps,
|
|
39
42
|
children = props.children;
|
|
43
|
+
var bodyClassName = drawerProps.bodyClassName,
|
|
44
|
+
otherDrawerProps = (0, _objectWithoutPropertiesLoose2["default"])(drawerProps, _excluded);
|
|
40
45
|
return /*#__PURE__*/_react["default"].createElement(_drawer["default"], (0, _extends2["default"])({
|
|
41
46
|
title: title,
|
|
42
47
|
placement: "right",
|
|
@@ -44,12 +49,12 @@ var Drawer = function Drawer(props) {
|
|
|
44
49
|
headerStyle: headerStyle,
|
|
45
50
|
bodyStyle: bodyStyle,
|
|
46
51
|
closeMode: ['close', 'esc']
|
|
47
|
-
},
|
|
52
|
+
}, otherDrawerProps, {
|
|
48
53
|
className: (0, _classnames["default"])(_indexModule["default"].drawer, drawerProps.className),
|
|
49
54
|
visible: visible,
|
|
50
55
|
onClose: onClose
|
|
51
56
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
52
|
-
className: (0, _classnames["default"])(_indexModule["default"].content,
|
|
57
|
+
className: (0, _classnames["default"])(_indexModule["default"].content, bodyClassName)
|
|
53
58
|
}, children), footer && /*#__PURE__*/_react["default"].createElement("div", {
|
|
54
59
|
className: _indexModule["default"].footer
|
|
55
60
|
}, /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
|
@@ -6,13 +6,22 @@ exports["default"] = void 0;
|
|
|
6
6
|
var _react = require("react");
|
|
7
7
|
|
|
8
8
|
var _default = function _default(topo, fn) {
|
|
9
|
+
var topoModState = topo.store.useModelState('topoMod');
|
|
10
|
+
var graphLoaded = topoModState.graphLoaded;
|
|
9
11
|
(0, _react.useEffect)(function () {
|
|
10
|
-
var dataModel
|
|
11
|
-
|
|
12
|
+
var dataModel;
|
|
13
|
+
|
|
14
|
+
if (graphLoaded) {
|
|
15
|
+
dataModel = topo.getDataModel();
|
|
16
|
+
dataModel.addDataPropertyChangeListener(fn);
|
|
17
|
+
}
|
|
18
|
+
|
|
12
19
|
return function () {
|
|
13
|
-
dataModel
|
|
20
|
+
if (dataModel) {
|
|
21
|
+
dataModel.removeDataPropertyChangeListener(fn);
|
|
22
|
+
}
|
|
14
23
|
};
|
|
15
|
-
}, [fn]);
|
|
24
|
+
}, [topo, graphLoaded, fn]);
|
|
16
25
|
};
|
|
17
26
|
|
|
18
27
|
exports["default"] = _default;
|
|
@@ -93,7 +93,7 @@ function transformCustomIcons2HtIcons(icons) {
|
|
|
93
93
|
|
|
94
94
|
|
|
95
95
|
function getUserCustomIcons(topo) {
|
|
96
|
-
var uploadIcons = topo.store.getModelState('
|
|
96
|
+
var uploadIcons = topo.store.getModelState('customIcon').icons;
|
|
97
97
|
return [].concat(transformCustomIcons2HtIcons(uploadIcons.node));
|
|
98
98
|
} // 获得节点图标列表
|
|
99
99
|
|
|
@@ -7,7 +7,7 @@ exports.useNodeIcons = useNodeIcons;
|
|
|
7
7
|
var _icon = require("./icon");
|
|
8
8
|
|
|
9
9
|
function useCustomIcons(topo) {
|
|
10
|
-
var _topo$store$useModelS = topo.store.useModelState('
|
|
10
|
+
var _topo$store$useModelS = topo.store.useModelState('customIcon'),
|
|
11
11
|
icons = _topo$store$useModelS.icons;
|
|
12
12
|
|
|
13
13
|
var customIcons = icons.node.map(_icon.transformCustomIcon2HtIcon);
|
|
@@ -23,8 +23,6 @@ var _useTopoEdit = _interopRequireDefault(require("../../../hooks/useTopoEdit"))
|
|
|
23
23
|
|
|
24
24
|
var _useSelection2 = _interopRequireDefault(require("../../../hooks/useSelection"));
|
|
25
25
|
|
|
26
|
-
var _useRelateTopo = _interopRequireDefault(require("../../../hooks/useRelateTopo"));
|
|
27
|
-
|
|
28
26
|
var _showMessage = _interopRequireDefault(require("../../utils/showMessage"));
|
|
29
27
|
|
|
30
28
|
var _EditorPlugin = _interopRequireDefault(require("../../editor/components/EditorPlugin"));
|
|
@@ -39,15 +37,15 @@ var _PropertyView = _interopRequireDefault(require("../../editor/components/sett
|
|
|
39
37
|
|
|
40
38
|
var _BackgroundView = _interopRequireDefault(require("../../editor/components/BackgroundView"));
|
|
41
39
|
|
|
42
|
-
var _TopoViewModule = _interopRequireDefault(require("./TopoView.module.scss"));
|
|
43
|
-
|
|
44
40
|
var _edgeUtil = require("../../utils/edgeUtil");
|
|
45
41
|
|
|
42
|
+
var _TopoViewModule = _interopRequireDefault(require("./TopoView.module.scss"));
|
|
43
|
+
|
|
46
44
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
47
45
|
|
|
48
46
|
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; }
|
|
49
47
|
|
|
50
|
-
var
|
|
48
|
+
var Topology = function Topology(props) {
|
|
51
49
|
var _classnames, _graphViewProps$creat;
|
|
52
50
|
|
|
53
51
|
var topo = props.topo,
|
|
@@ -63,6 +61,7 @@ var TopoView = function TopoView(props) {
|
|
|
63
61
|
nodeDeleteable = props.nodeDeleteable,
|
|
64
62
|
onNodeDelete = props.onNodeDelete,
|
|
65
63
|
onLineDelete = props.onLineDelete,
|
|
64
|
+
onEvent = props.onEvent,
|
|
66
65
|
_props$graphViewProps = props.graphViewProps,
|
|
67
66
|
graphViewProps = _props$graphViewProps === void 0 ? {} : _props$graphViewProps,
|
|
68
67
|
viewerProps = props.viewerProps,
|
|
@@ -109,10 +108,7 @@ var TopoView = function TopoView(props) {
|
|
|
109
108
|
var onExitEdit = topoEdit.onExitEdit,
|
|
110
109
|
onBindData = topoEdit.onBindData,
|
|
111
110
|
onDeleteElement = topoEdit.onDeleteElement,
|
|
112
|
-
onSaveTopo = topoEdit.onSaveTopo;
|
|
113
|
-
var relateTopo = (0, _useRelateTopo["default"])({
|
|
114
|
-
topo: topo
|
|
115
|
-
}); // useAlarm({
|
|
111
|
+
onSaveTopo = topoEdit.onSaveTopo; // useAlarm({
|
|
116
112
|
// topo,
|
|
117
113
|
// });
|
|
118
114
|
|
|
@@ -141,13 +137,6 @@ var TopoView = function TopoView(props) {
|
|
|
141
137
|
(0, _react.useEffect)(function () {
|
|
142
138
|
// rlog.debug("TopoView.useEffect topoData", topoData);
|
|
143
139
|
setTData(buildLoadOptions ? buildLoadOptions(topoData) : topoData);
|
|
144
|
-
|
|
145
|
-
if (topoData) {
|
|
146
|
-
// TODO 移到模型中
|
|
147
|
-
topoDispatchers.update({
|
|
148
|
-
currentTopo: topoData.config
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
140
|
}, [topoData]);
|
|
152
141
|
(0, _react.useEffect)(function () {
|
|
153
142
|
return function () {
|
|
@@ -207,7 +196,7 @@ var TopoView = function TopoView(props) {
|
|
|
207
196
|
var handleEvent = function handleEvent(event) {
|
|
208
197
|
_rlog["default"].debug("TopoView:onEvent", event);
|
|
209
198
|
|
|
210
|
-
|
|
199
|
+
onEvent(event);
|
|
211
200
|
topoEdit.onEvent(event);
|
|
212
201
|
|
|
213
202
|
switch (event.name) {
|
|
@@ -310,7 +299,7 @@ var TopoView = function TopoView(props) {
|
|
|
310
299
|
}));
|
|
311
300
|
};
|
|
312
301
|
|
|
313
|
-
|
|
302
|
+
Topology.propTypes = {
|
|
314
303
|
// 拓扑模型
|
|
315
304
|
topo: _propTypes["default"].any.isRequired,
|
|
316
305
|
defaultEnterEditMode: _propTypes["default"].bool,
|
|
@@ -330,11 +319,11 @@ TopoView.propTypes = {
|
|
|
330
319
|
*/
|
|
331
320
|
titleBar: _propTypes["default"].oneOf([_react["default"].ReactNode, false])
|
|
332
321
|
};
|
|
333
|
-
|
|
322
|
+
Topology.defaultProps = {
|
|
334
323
|
defaultEnterEditMode: false,
|
|
335
324
|
viewerProps: {},
|
|
336
325
|
editorProps: {} // titleBar: false,
|
|
337
326
|
|
|
338
327
|
};
|
|
339
|
-
var _default =
|
|
328
|
+
var _default = Topology;
|
|
340
329
|
exports["default"] = _default;
|
|
@@ -8,7 +8,7 @@ exports.createTopology = void 0;
|
|
|
8
8
|
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
|
|
11
|
-
var _TopoApp = _interopRequireDefault(require("./TopoApp"));
|
|
11
|
+
var _TopoApp = _interopRequireDefault(require("./models/TopoApp"));
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
*
|
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) {
|
|
@@ -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
|
}
|