@riil-frontend/component-topology 0.2.2 → 0.2.3
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/README.md +5 -1
- package/build/1.js +2 -2
- package/build/2.js +1 -1
- package/build/index.js +37 -37
- package/demo/{usage.md → 1/345/237/272/346/234/254/usage.md} +0 -0
- package/demo/{usage1.md → 1/345/237/272/346/234/254/usage1.md} +0 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/TopoCenterViewer.jsx +75 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/createMockRequest.js +38 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/api/v1/model/getAllDict +1029 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/alarm +0 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/alarm.json +0 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/attributes/once +2596 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/attributes/once.json +2596 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/attributes/polling +2293 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/attributes/polling.json +2293 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/auth/permission/2 +1 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/auth/permission/2.json +1 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/menu +48 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/menu.json +48 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/shape +1 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/shape.json +1 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/structure/both/2 +618 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/structure/both/2.json +618 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/structure/relationList +192 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/structure/relationList.json +192 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/webUrl/list +1 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/topo/v1/webUrl/list.json +1 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/v1/api/authFunc/checkFuncAuthentication +14 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/mock/appserver/v1/api/authFunc/checkFuncAuthentication.json +14 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203/js/request.js +7 -0
- package/demo/2/346/213/223/346/211/221/344/270/255/345/277/203//345/261/225/347/244/272/346/250/241/345/274/217.md +10 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/AppInstallTopo.jsx +90 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/api/v1/model/getAllDict +1029 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/alarm +0 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/alarm.json +0 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/attributes/once +2596 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/attributes/once.json +2596 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/attributes/polling +2293 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/attributes/polling.json +2293 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/auth/permission/2 +1 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/auth/permission/2.json +1 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/menu +48 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/menu.json +48 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/shape +1 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/shape.json +1 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/structure/both/1 +3 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/structure/both/2 +618 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/structure/both/2.json +618 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/webUrl/list +1 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/topo/v1/webUrl/list.json +1 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/v1/api/authFunc/checkFuncAuthentication +14 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/appserver/v1/api/authFunc/checkFuncAuthentication.json +14 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/mock/data/simple.json +190 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221/src/request.js +7 -0
- package/demo/3/345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221//345/272/224/347/224/250/351/203/250/347/275/262/346/213/223/346/211/221.md +10 -0
- package/demo/{/346/213/223/346/211/221/344/270/255/345/277/203.md → 4/345/210/206/345/261/202/351/205/215/347/275/256/347/273/204/344/273/266/js/a.js} +15 -25
- package/demo/4/345/210/206/345/261/202/351/205/215/347/275/256/347/273/204/344/273/266//345/261/225/347/244/272/347/273/204/344/273/266.md +10 -0
- package/demo/{API.md → API/API.md} +0 -0
- package/es/components/BatchAttrMetric/index.js +2 -2
- package/es/components/BatchAttrMetric/setting.js +12 -9
- package/es/components/BatchAttrMetric/utils.js +4 -3
- package/es/components/Drawer/index.js +5 -4
- package/es/components/FormTable/index.js +7 -5
- package/es/components/IndexSettingDrawer/CiList.js +2 -2
- package/es/components/IndexSettingDrawer/CiListItem.js +2 -2
- package/es/components/IndexSettingDrawer/IndexList.js +3 -3
- package/es/components/IndexSettingDrawer/index.js +2 -2
- package/es/components/Link/form.js +19 -13
- package/es/components/Link/index.js +4 -3
- package/es/components/Link/setting.js +12 -9
- package/es/components/MultiResourceDrawer/Content.js +5 -3
- package/es/components/MultiResourceDrawer/ResourceCard/index.js +5 -4
- package/es/components/SingleResourceDrawer/index.js +3 -2
- package/es/components/TopoView/Topo.js +2 -2
- package/es/components/TopoView/plugins/ResourceDetail/topoDrawer.js +6 -4
- package/es/components/TopoView/plugins/ResourceWebControllUrlSettingDialog.js +13 -7
- package/es/components/TopoView/settings/LayerSettingsForm.js +35 -26
- package/es/components/TopoView/settings/ResourceList.js +4 -3
- package/es/components/TopoView/settings/SelectResource/index.js +18 -12
- package/es/components/TopoView/settings/Settings.js +0 -1
- package/es/components/TopoView/settings/SettingsForm.js +4 -3
- package/es/components/TopoView/settings/Style.js +22 -14
- package/es/components/TopoView/toolbar/TopoEditorTitleBar.js +3 -3
- package/es/components/TopoView/toolbar/TopoViewerTitleBar.js +2 -2
- package/es/components/TopoView/toolbar/ViewTools.js +8 -6
- package/es/components/TopoView/toolbar/widgets/SearchWidget.js +2 -2
- package/es/components/TopoView/topoView.js +9 -23
- package/es/components/edit/EditPlugin.js +2 -2
- package/es/components/edit/LinkDynamicStyleSettingDrawer/RuleSetting.js +4 -3
- package/es/components/edit/LinkDynamicStyleSettingDrawer/rule/ColorPicker.js +2 -2
- package/es/components/edit/LinkDynamicStyleSettingDrawer/rule/Rule.js +2 -2
- package/es/components/edit/LinkDynamicStyleSettingDrawer/rule/RuleCondition.js +18 -17
- package/es/components/edit/LinkDynamicStyleSettingDrawer/rule/RuleStyle.js +16 -11
- package/es/components/edit/iconManage/RenameDialog.js +11 -6
- package/es/components/edit/iconManage/UploadIconDialog.js +11 -7
- package/es/core/models/TopoApp.js +73 -107
- package/es/core/models/cache/DictCache.js +79 -0
- package/es/core/models/plugins/resourceWebControllUrl.js +8 -4
- package/es/core/utils/showMessage.js +2 -2
- package/es/createTopo.js +2 -31
- package/es/hooks/usePolling.js +9 -5
- package/es/hooks/useTopoEdit.js +14 -8
- package/es/models/iconManage.js +9 -5
- package/es/models/linkDynamicStyleConfig.js +3 -2
- package/es/models/linkManager.js +0 -1
- package/es/models/resourceWebControllUrlSetting.js +0 -1
- package/es/models/topoAlarm.js +0 -1
- package/es/models/topoBizMod.js +11 -8
- package/es/models/topoEdit.js +0 -1
- package/es/models/topoGraphView.js +0 -1
- package/es/models/topoMod.js +54 -30
- package/es/models/topoView.js +0 -1
- package/es/models/topocenter/functionAuth.js +0 -1
- package/es/models/topocenter/topoCenter.js +0 -1
- package/es/style.js +25 -1
- package/es/topoCenter/getTopoData.js +41 -0
- package/es/topoCenter/models/Topo.js +0 -0
- package/es/topoCenter/models/TopoCenter.js +104 -0
- package/es/topoCenter/viewer/TitleBar.js +10 -0
- package/es/topoCenter/viewer/components/TopologyViewer.js +27 -0
- package/es/topoCenter/viewer/createTopoViewer.js +2 -34
- package/es/topoCenter/viewer/index.js +2 -2
- package/es/utils/topoData.js +8 -5
- package/lib/components/BatchAttrMetric/index.js +3 -3
- package/lib/components/BatchAttrMetric/setting.js +16 -10
- package/lib/components/BatchAttrMetric/utils.js +6 -4
- package/lib/components/Drawer/index.js +7 -5
- package/lib/components/FormTable/index.js +13 -9
- package/lib/components/IndexSettingDrawer/CiList.js +3 -3
- package/lib/components/IndexSettingDrawer/CiListItem.js +3 -3
- package/lib/components/IndexSettingDrawer/IndexList.js +7 -7
- package/lib/components/IndexSettingDrawer/index.js +3 -3
- package/lib/components/Link/form.js +24 -14
- package/lib/components/Link/index.js +6 -4
- package/lib/components/Link/setting.js +16 -10
- package/lib/components/MultiResourceDrawer/Content.js +4 -4
- package/lib/components/MultiResourceDrawer/ResourceCard/index.js +7 -5
- package/lib/components/SingleResourceDrawer/index.js +3 -3
- package/lib/components/TopoView/Topo.js +3 -3
- package/lib/components/TopoView/plugins/ResourceDetail/topoDrawer.js +9 -5
- package/lib/components/TopoView/plugins/ResourceWebControllUrlSettingDialog.js +16 -8
- package/lib/components/TopoView/settings/LayerSettingsForm.js +41 -27
- package/lib/components/TopoView/settings/ResourceList.js +6 -4
- package/lib/components/TopoView/settings/SelectResource/index.js +25 -13
- package/lib/components/TopoView/settings/Settings.js +0 -2
- package/lib/components/TopoView/settings/SettingsForm.js +6 -4
- package/lib/components/TopoView/settings/Style.js +27 -15
- package/lib/components/TopoView/toolbar/TopoEditorTitleBar.js +4 -4
- package/lib/components/TopoView/toolbar/TopoViewerTitleBar.js +3 -3
- package/lib/components/TopoView/toolbar/ViewTools.js +11 -7
- package/lib/components/TopoView/toolbar/widgets/SearchWidget.js +5 -3
- package/lib/components/TopoView/topoView.js +11 -26
- package/lib/components/edit/EditPlugin.js +3 -3
- package/lib/components/edit/LinkDynamicStyleSettingDrawer/RuleSetting.js +6 -4
- package/lib/components/edit/LinkDynamicStyleSettingDrawer/rule/ColorPicker.js +3 -3
- package/lib/components/edit/LinkDynamicStyleSettingDrawer/rule/Rule.js +3 -3
- package/lib/components/edit/LinkDynamicStyleSettingDrawer/rule/RuleCondition.js +20 -18
- package/lib/components/edit/LinkDynamicStyleSettingDrawer/rule/RuleStyle.js +18 -12
- package/lib/components/edit/iconManage/RenameDialog.js +13 -7
- package/lib/components/edit/iconManage/UploadIconDialog.js +14 -8
- package/lib/core/models/TopoApp.js +73 -107
- package/lib/core/models/cache/DictCache.js +95 -0
- package/lib/core/models/plugins/resourceWebControllUrl.js +5 -5
- package/lib/core/utils/showMessage.js +3 -3
- package/lib/createTopo.js +3 -34
- package/lib/hooks/usePolling.js +10 -5
- package/lib/hooks/useTopoEdit.js +11 -9
- package/lib/models/iconManage.js +8 -6
- package/lib/models/linkDynamicStyleConfig.js +3 -3
- package/lib/models/linkManager.js +0 -2
- package/lib/models/resourceWebControllUrlSetting.js +0 -2
- package/lib/models/topoAlarm.js +0 -2
- package/lib/models/topoBizMod.js +11 -8
- package/lib/models/topoEdit.js +0 -2
- package/lib/models/topoGraphView.js +0 -2
- package/lib/models/topoMod.js +54 -30
- package/lib/models/topoView.js +0 -2
- package/lib/models/topocenter/functionAuth.js +0 -2
- package/lib/models/topocenter/topoCenter.js +0 -2
- package/lib/style.js +25 -1
- package/lib/topoCenter/getTopoData.js +53 -0
- package/lib/topoCenter/models/Topo.js +1 -0
- package/lib/topoCenter/models/TopoCenter.js +118 -0
- package/lib/topoCenter/viewer/TitleBar.js +21 -0
- package/lib/topoCenter/viewer/components/TopologyViewer.js +43 -0
- package/lib/topoCenter/viewer/createTopoViewer.js +3 -36
- package/lib/topoCenter/viewer/index.js +4 -4
- package/lib/utils/topoData.js +7 -5
- package/package.json +7 -5
|
@@ -37,12 +37,12 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
37
37
|
setRequest(options.request);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
this.
|
|
40
|
+
this.initialize(options);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
var _proto = TopoApp.prototype;
|
|
44
44
|
|
|
45
|
-
_proto.
|
|
45
|
+
_proto.initialize = function initialize(options) {
|
|
46
46
|
// 初始化store ============================
|
|
47
47
|
this.initStore(); // 初始化核心 ============================
|
|
48
48
|
|
|
@@ -56,23 +56,21 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* TODO 移除
|
|
59
|
-
* @param params
|
|
60
|
-
* @return {Promise<void>}
|
|
61
59
|
*/
|
|
62
60
|
;
|
|
63
61
|
|
|
64
|
-
_proto.
|
|
62
|
+
_proto.exit =
|
|
65
63
|
/*#__PURE__*/
|
|
66
64
|
function () {
|
|
67
|
-
var
|
|
65
|
+
var _exit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
68
66
|
var topoDispatchers;
|
|
69
67
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
70
68
|
while (1) {
|
|
71
69
|
switch (_context.prev = _context.next) {
|
|
72
70
|
case 0:
|
|
73
|
-
topoDispatchers = this.store.getModelDispatchers('
|
|
71
|
+
topoDispatchers = this.store.getModelDispatchers('topoMod');
|
|
74
72
|
_context.next = 3;
|
|
75
|
-
return topoDispatchers.
|
|
73
|
+
return topoDispatchers.exit();
|
|
76
74
|
|
|
77
75
|
case 3:
|
|
78
76
|
case "end":
|
|
@@ -82,38 +80,6 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
82
80
|
}, _callee, this);
|
|
83
81
|
}));
|
|
84
82
|
|
|
85
|
-
function initData(_x) {
|
|
86
|
-
return _initData.apply(this, arguments);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return initData;
|
|
90
|
-
}()
|
|
91
|
-
/**
|
|
92
|
-
* TODO 移除
|
|
93
|
-
*/
|
|
94
|
-
;
|
|
95
|
-
|
|
96
|
-
_proto.exit =
|
|
97
|
-
/*#__PURE__*/
|
|
98
|
-
function () {
|
|
99
|
-
var _exit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
100
|
-
var topoDispatchers;
|
|
101
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
102
|
-
while (1) {
|
|
103
|
-
switch (_context2.prev = _context2.next) {
|
|
104
|
-
case 0:
|
|
105
|
-
topoDispatchers = this.store.getModelDispatchers('topoMod');
|
|
106
|
-
_context2.next = 3;
|
|
107
|
-
return topoDispatchers.exit();
|
|
108
|
-
|
|
109
|
-
case 3:
|
|
110
|
-
case "end":
|
|
111
|
-
return _context2.stop();
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}, _callee2, this);
|
|
115
|
-
}));
|
|
116
|
-
|
|
117
83
|
function exit() {
|
|
118
84
|
return _exit.apply(this, arguments);
|
|
119
85
|
}
|
|
@@ -122,27 +88,27 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
122
88
|
}();
|
|
123
89
|
|
|
124
90
|
_proto.load = /*#__PURE__*/function () {
|
|
125
|
-
var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
91
|
+
var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(data) {
|
|
126
92
|
var topoDispatchers;
|
|
127
|
-
return _regeneratorRuntime.wrap(function
|
|
93
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
128
94
|
while (1) {
|
|
129
|
-
switch (
|
|
95
|
+
switch (_context2.prev = _context2.next) {
|
|
130
96
|
case 0:
|
|
131
97
|
topoDispatchers = this.store.getModelDispatchers('topoMod');
|
|
132
|
-
|
|
98
|
+
_context2.next = 3;
|
|
133
99
|
return topoDispatchers.openTopoPage({
|
|
134
|
-
|
|
100
|
+
data: data
|
|
135
101
|
});
|
|
136
102
|
|
|
137
103
|
case 3:
|
|
138
104
|
case "end":
|
|
139
|
-
return
|
|
105
|
+
return _context2.stop();
|
|
140
106
|
}
|
|
141
107
|
}
|
|
142
|
-
},
|
|
108
|
+
}, _callee2, this);
|
|
143
109
|
}));
|
|
144
110
|
|
|
145
|
-
function load(
|
|
111
|
+
function load(_x) {
|
|
146
112
|
return _load.apply(this, arguments);
|
|
147
113
|
}
|
|
148
114
|
|
|
@@ -150,16 +116,16 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
150
116
|
}();
|
|
151
117
|
|
|
152
118
|
_proto.clear = /*#__PURE__*/function () {
|
|
153
|
-
var _clear = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
154
|
-
return _regeneratorRuntime.wrap(function
|
|
119
|
+
var _clear = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
120
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
155
121
|
while (1) {
|
|
156
|
-
switch (
|
|
122
|
+
switch (_context3.prev = _context3.next) {
|
|
157
123
|
case 0:
|
|
158
124
|
case "end":
|
|
159
|
-
return
|
|
125
|
+
return _context3.stop();
|
|
160
126
|
}
|
|
161
127
|
}
|
|
162
|
-
},
|
|
128
|
+
}, _callee3);
|
|
163
129
|
}));
|
|
164
130
|
|
|
165
131
|
function clear() {
|
|
@@ -170,11 +136,11 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
170
136
|
}();
|
|
171
137
|
|
|
172
138
|
_proto.open = /*#__PURE__*/function () {
|
|
173
|
-
var _open = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
139
|
+
var _open = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(id, mode) {
|
|
174
140
|
var lastId;
|
|
175
|
-
return _regeneratorRuntime.wrap(function
|
|
141
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
176
142
|
while (1) {
|
|
177
|
-
switch (
|
|
143
|
+
switch (_context4.prev = _context4.next) {
|
|
178
144
|
case 0:
|
|
179
145
|
rlog.info('TopoApp.open 打开拓扑图', id); // 如果是切换拓扑图,注销原拓扑图
|
|
180
146
|
|
|
@@ -188,13 +154,13 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
188
154
|
|
|
189
155
|
case 4:
|
|
190
156
|
case "end":
|
|
191
|
-
return
|
|
157
|
+
return _context4.stop();
|
|
192
158
|
}
|
|
193
159
|
}
|
|
194
|
-
},
|
|
160
|
+
}, _callee4, this);
|
|
195
161
|
}));
|
|
196
162
|
|
|
197
|
-
function open(
|
|
163
|
+
function open(_x2, _x3) {
|
|
198
164
|
return _open.apply(this, arguments);
|
|
199
165
|
}
|
|
200
166
|
|
|
@@ -202,19 +168,19 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
202
168
|
}();
|
|
203
169
|
|
|
204
170
|
_proto.close = /*#__PURE__*/function () {
|
|
205
|
-
var _close = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
206
|
-
return _regeneratorRuntime.wrap(function
|
|
171
|
+
var _close = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
172
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
207
173
|
while (1) {
|
|
208
|
-
switch (
|
|
174
|
+
switch (_context5.prev = _context5.next) {
|
|
209
175
|
case 0:
|
|
210
176
|
rlog.info('关闭拓扑图', this.id);
|
|
211
177
|
|
|
212
178
|
if (this.id) {
|
|
213
|
-
|
|
179
|
+
_context5.next = 3;
|
|
214
180
|
break;
|
|
215
181
|
}
|
|
216
182
|
|
|
217
|
-
return
|
|
183
|
+
return _context5.abrupt("return");
|
|
218
184
|
|
|
219
185
|
case 3:
|
|
220
186
|
this.alarm.close();
|
|
@@ -222,10 +188,10 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
222
188
|
|
|
223
189
|
case 5:
|
|
224
190
|
case "end":
|
|
225
|
-
return
|
|
191
|
+
return _context5.stop();
|
|
226
192
|
}
|
|
227
193
|
}
|
|
228
|
-
},
|
|
194
|
+
}, _callee5, this);
|
|
229
195
|
}));
|
|
230
196
|
|
|
231
197
|
function close() {
|
|
@@ -236,16 +202,16 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
236
202
|
}();
|
|
237
203
|
|
|
238
204
|
_proto.refresh = /*#__PURE__*/function () {
|
|
239
|
-
var _refresh = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
240
|
-
return _regeneratorRuntime.wrap(function
|
|
205
|
+
var _refresh = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
206
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
241
207
|
while (1) {
|
|
242
|
-
switch (
|
|
208
|
+
switch (_context6.prev = _context6.next) {
|
|
243
209
|
case 0:
|
|
244
210
|
case "end":
|
|
245
|
-
return
|
|
211
|
+
return _context6.stop();
|
|
246
212
|
}
|
|
247
213
|
}
|
|
248
|
-
},
|
|
214
|
+
}, _callee6);
|
|
249
215
|
}));
|
|
250
216
|
|
|
251
217
|
function refresh() {
|
|
@@ -277,19 +243,19 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
277
243
|
};
|
|
278
244
|
|
|
279
245
|
_proto.openViewMode = /*#__PURE__*/function () {
|
|
280
|
-
var _openViewMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
281
|
-
return _regeneratorRuntime.wrap(function
|
|
246
|
+
var _openViewMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(id) {
|
|
247
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
282
248
|
while (1) {
|
|
283
|
-
switch (
|
|
249
|
+
switch (_context7.prev = _context7.next) {
|
|
284
250
|
case 0:
|
|
285
251
|
case "end":
|
|
286
|
-
return
|
|
252
|
+
return _context7.stop();
|
|
287
253
|
}
|
|
288
254
|
}
|
|
289
|
-
},
|
|
255
|
+
}, _callee7);
|
|
290
256
|
}));
|
|
291
257
|
|
|
292
|
-
function openViewMode(
|
|
258
|
+
function openViewMode(_x4) {
|
|
293
259
|
return _openViewMode.apply(this, arguments);
|
|
294
260
|
}
|
|
295
261
|
|
|
@@ -303,11 +269,11 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
303
269
|
_proto.enterEditMode =
|
|
304
270
|
/*#__PURE__*/
|
|
305
271
|
function () {
|
|
306
|
-
var _enterEditMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
272
|
+
var _enterEditMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
307
273
|
var editDispatchers, ciSetDoc, linkDynamicStyleDispatcher, iconManageDispatchers, topoTreeData;
|
|
308
|
-
return _regeneratorRuntime.wrap(function
|
|
274
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
309
275
|
while (1) {
|
|
310
|
-
switch (
|
|
276
|
+
switch (_context8.prev = _context8.next) {
|
|
311
277
|
case 0:
|
|
312
278
|
this.view.topoClient.enterEditMode();
|
|
313
279
|
editDispatchers = this.store.getModelDispatchers('topoCreateMod');
|
|
@@ -329,10 +295,10 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
329
295
|
|
|
330
296
|
case 11:
|
|
331
297
|
case "end":
|
|
332
|
-
return
|
|
298
|
+
return _context8.stop();
|
|
333
299
|
}
|
|
334
300
|
}
|
|
335
|
-
},
|
|
301
|
+
}, _callee8, this);
|
|
336
302
|
}));
|
|
337
303
|
|
|
338
304
|
function enterEditMode() {
|
|
@@ -343,19 +309,19 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
343
309
|
}();
|
|
344
310
|
|
|
345
311
|
_proto.exitEditMode = /*#__PURE__*/function () {
|
|
346
|
-
var _exitEditMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
347
|
-
return _regeneratorRuntime.wrap(function
|
|
312
|
+
var _exitEditMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
|
|
313
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
348
314
|
while (1) {
|
|
349
|
-
switch (
|
|
315
|
+
switch (_context9.prev = _context9.next) {
|
|
350
316
|
case 0:
|
|
351
317
|
this.view.topoClient.exitEditMode();
|
|
352
318
|
|
|
353
319
|
case 1:
|
|
354
320
|
case "end":
|
|
355
|
-
return
|
|
321
|
+
return _context9.stop();
|
|
356
322
|
}
|
|
357
323
|
}
|
|
358
|
-
},
|
|
324
|
+
}, _callee9, this);
|
|
359
325
|
}));
|
|
360
326
|
|
|
361
327
|
function exitEditMode() {
|
|
@@ -366,19 +332,19 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
366
332
|
}();
|
|
367
333
|
|
|
368
334
|
_proto.save = /*#__PURE__*/function () {
|
|
369
|
-
var _save = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
370
|
-
return _regeneratorRuntime.wrap(function
|
|
335
|
+
var _save = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
|
|
336
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
371
337
|
while (1) {
|
|
372
|
-
switch (
|
|
338
|
+
switch (_context10.prev = _context10.next) {
|
|
373
339
|
case 0:
|
|
374
340
|
this.view.topoClient.saveExternal();
|
|
375
341
|
|
|
376
342
|
case 1:
|
|
377
343
|
case "end":
|
|
378
|
-
return
|
|
344
|
+
return _context10.stop();
|
|
379
345
|
}
|
|
380
346
|
}
|
|
381
|
-
},
|
|
347
|
+
}, _callee10, this);
|
|
382
348
|
}));
|
|
383
349
|
|
|
384
350
|
function save() {
|
|
@@ -389,19 +355,19 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
389
355
|
}();
|
|
390
356
|
|
|
391
357
|
_proto.exportImage = /*#__PURE__*/function () {
|
|
392
|
-
var _exportImage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
393
|
-
return _regeneratorRuntime.wrap(function
|
|
358
|
+
var _exportImage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
|
|
359
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
394
360
|
while (1) {
|
|
395
|
-
switch (
|
|
361
|
+
switch (_context11.prev = _context11.next) {
|
|
396
362
|
case 0:
|
|
397
363
|
this.view.topoClient.exportImage();
|
|
398
364
|
|
|
399
365
|
case 1:
|
|
400
366
|
case "end":
|
|
401
|
-
return
|
|
367
|
+
return _context11.stop();
|
|
402
368
|
}
|
|
403
369
|
}
|
|
404
|
-
},
|
|
370
|
+
}, _callee11, this);
|
|
405
371
|
}));
|
|
406
372
|
|
|
407
373
|
function exportImage() {
|
|
@@ -412,16 +378,16 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
412
378
|
}();
|
|
413
379
|
|
|
414
380
|
_proto.switchToViewMode = /*#__PURE__*/function () {
|
|
415
|
-
var _switchToViewMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
416
|
-
return _regeneratorRuntime.wrap(function
|
|
381
|
+
var _switchToViewMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
|
|
382
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
417
383
|
while (1) {
|
|
418
|
-
switch (
|
|
384
|
+
switch (_context12.prev = _context12.next) {
|
|
419
385
|
case 0:
|
|
420
386
|
case "end":
|
|
421
|
-
return
|
|
387
|
+
return _context12.stop();
|
|
422
388
|
}
|
|
423
389
|
}
|
|
424
|
-
},
|
|
390
|
+
}, _callee12);
|
|
425
391
|
}));
|
|
426
392
|
|
|
427
393
|
function switchToViewMode() {
|
|
@@ -432,16 +398,16 @@ var TopoApp = /*#__PURE__*/function () {
|
|
|
432
398
|
}();
|
|
433
399
|
|
|
434
400
|
_proto.switchToEditMode = /*#__PURE__*/function () {
|
|
435
|
-
var _switchToEditMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
436
|
-
return _regeneratorRuntime.wrap(function
|
|
401
|
+
var _switchToEditMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
|
|
402
|
+
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
437
403
|
while (1) {
|
|
438
|
-
switch (
|
|
404
|
+
switch (_context13.prev = _context13.next) {
|
|
439
405
|
case 0:
|
|
440
406
|
case "end":
|
|
441
|
-
return
|
|
407
|
+
return _context13.stop();
|
|
442
408
|
}
|
|
443
409
|
}
|
|
444
|
-
},
|
|
410
|
+
}, _callee13);
|
|
445
411
|
}));
|
|
446
412
|
|
|
447
413
|
function switchToEditMode() {
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
+
import { dictFormat } from '@riil-frontend/utils';
|
|
4
|
+
import * as modelService from '@riil-frontend/component-topology-utils/es/services/model';
|
|
5
|
+
/**
|
|
6
|
+
* 数据字典缓存
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
var DictCache = /*#__PURE__*/function () {
|
|
10
|
+
function DictCache() {
|
|
11
|
+
this.dists = void 0;
|
|
12
|
+
this.dictObject = void 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
var _proto = DictCache.prototype;
|
|
16
|
+
|
|
17
|
+
_proto.init = /*#__PURE__*/function () {
|
|
18
|
+
var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
19
|
+
var distsStr, dicts;
|
|
20
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
21
|
+
while (1) {
|
|
22
|
+
switch (_context.prev = _context.next) {
|
|
23
|
+
case 0:
|
|
24
|
+
if (!this.dists) {
|
|
25
|
+
_context.next = 2;
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return _context.abrupt("return");
|
|
30
|
+
|
|
31
|
+
case 2:
|
|
32
|
+
distsStr = sessionStorage.getItem('dists');
|
|
33
|
+
|
|
34
|
+
if (!distsStr) {
|
|
35
|
+
_context.next = 7;
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
dicts = JSON.parse(distsStr);
|
|
40
|
+
_context.next = 10;
|
|
41
|
+
break;
|
|
42
|
+
|
|
43
|
+
case 7:
|
|
44
|
+
_context.next = 9;
|
|
45
|
+
return modelService.queryDicts()["catch"](function (e) {
|
|
46
|
+
console.error('初始化数据字典异常', e);
|
|
47
|
+
return [];
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
case 9:
|
|
51
|
+
dicts = _context.sent;
|
|
52
|
+
|
|
53
|
+
case 10:
|
|
54
|
+
this.dists = dicts;
|
|
55
|
+
this.dictObject = dictFormat(dicts);
|
|
56
|
+
|
|
57
|
+
case 12:
|
|
58
|
+
case "end":
|
|
59
|
+
return _context.stop();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}, _callee, this);
|
|
63
|
+
}));
|
|
64
|
+
|
|
65
|
+
function init() {
|
|
66
|
+
return _init.apply(this, arguments);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return init;
|
|
70
|
+
}();
|
|
71
|
+
|
|
72
|
+
_proto.getDictObject = function getDictObject() {
|
|
73
|
+
return this.dictObject;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
return DictCache;
|
|
77
|
+
}();
|
|
78
|
+
|
|
79
|
+
export default new DictCache();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import _Message from "@alifd/next/es/message";
|
|
1
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
4
|
import topoService from '@riil-frontend/component-topology-utils/es/services/topo';
|
|
4
|
-
import { Message } from '@alifd/next';
|
|
5
5
|
import rlog from '@riil-frontend/component-topology-utils/es/utils/rlog';
|
|
6
6
|
export default function (topo) {
|
|
7
7
|
var resourceUrlMap = {};
|
|
@@ -142,7 +142,8 @@ export default function (topo) {
|
|
|
142
142
|
break;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
|
|
145
|
+
_Message.success('链接设置成功');
|
|
146
|
+
|
|
146
147
|
closeSettingDialog();
|
|
147
148
|
return _context3.abrupt("return");
|
|
148
149
|
|
|
@@ -155,7 +156,8 @@ export default function (topo) {
|
|
|
155
156
|
return topoService.resourceWebUrl.save(id, url || null);
|
|
156
157
|
|
|
157
158
|
case 8:
|
|
158
|
-
|
|
159
|
+
_Message.success('链接设置成功');
|
|
160
|
+
|
|
159
161
|
resourceUrlMap[id] = url;
|
|
160
162
|
closeSettingDialog();
|
|
161
163
|
_context3.next = 17;
|
|
@@ -164,7 +166,9 @@ export default function (topo) {
|
|
|
164
166
|
case 13:
|
|
165
167
|
_context3.prev = 13;
|
|
166
168
|
_context3.t0 = _context3["catch"](5);
|
|
167
|
-
|
|
169
|
+
|
|
170
|
+
_Message.error('链接设置失败');
|
|
171
|
+
|
|
168
172
|
updateStore({
|
|
169
173
|
saving: false
|
|
170
174
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import _Message from "@alifd/next/es/message";
|
|
1
2
|
import rlog from '@riil-frontend/component-topology-utils/es/utils/rlog';
|
|
2
|
-
import { Message } from '@alifd/next';
|
|
3
3
|
var MSG_TYPES = {
|
|
4
4
|
info: 'notice',
|
|
5
5
|
success: 'success',
|
|
@@ -13,7 +13,7 @@ export default function showMessage(type, title, content) {
|
|
|
13
13
|
msgType = MSG_TYPES.info;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
_Message.show({
|
|
17
17
|
type: msgType,
|
|
18
18
|
title: title,
|
|
19
19
|
content: content
|
package/es/createTopo.js
CHANGED
|
@@ -1,39 +1,10 @@
|
|
|
1
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
|
-
import topoService from '@riil-frontend/component-topology-utils/es/services/topo';
|
|
5
2
|
import { createTopoApp } from './core/models/createTopoApp';
|
|
6
3
|
import createMenuCommands from './contextmenu/createMenuCommands';
|
|
4
|
+
import getTopoData from "./topoCenter/getTopoData";
|
|
7
5
|
export function createTopo(options) {
|
|
8
6
|
var topoApp = createTopoApp(_extends({
|
|
9
|
-
loadData:
|
|
10
|
-
var _loadData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(id) {
|
|
11
|
-
var data;
|
|
12
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
13
|
-
while (1) {
|
|
14
|
-
switch (_context.prev = _context.next) {
|
|
15
|
-
case 0:
|
|
16
|
-
_context.next = 2;
|
|
17
|
-
return topoService.getTopoData(id);
|
|
18
|
-
|
|
19
|
-
case 2:
|
|
20
|
-
data = _context.sent;
|
|
21
|
-
return _context.abrupt("return", data);
|
|
22
|
-
|
|
23
|
-
case 4:
|
|
24
|
-
case "end":
|
|
25
|
-
return _context.stop();
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}, _callee);
|
|
29
|
-
}));
|
|
30
|
-
|
|
31
|
-
function loadData(_x) {
|
|
32
|
-
return _loadData.apply(this, arguments);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return loadData;
|
|
36
|
-
}()
|
|
7
|
+
loadData: getTopoData
|
|
37
8
|
}, options));
|
|
38
9
|
var menuCommands = createMenuCommands(topoApp);
|
|
39
10
|
topoApp.view.contextMenu.registerCommands(menuCommands);
|
package/es/hooks/usePolling.js
CHANGED
|
@@ -7,14 +7,14 @@ import rlog from '@riil-frontend/component-topology-utils/es/utils/rlog';
|
|
|
7
7
|
import { TopoEvent } from '@riil-frontend/component-topology-graph';
|
|
8
8
|
import { metricValueFormat } from '@riil-frontend/utils';
|
|
9
9
|
import { findItem } from '../utils/topoData';
|
|
10
|
+
import DictCache from "../core/models/cache/DictCache";
|
|
10
11
|
/**
|
|
11
12
|
* 轮询获取指标hooks
|
|
12
13
|
* @param {*} props
|
|
13
14
|
*/
|
|
14
15
|
|
|
15
16
|
var usePolling = function usePolling(props) {
|
|
16
|
-
var topoApp = props.topoApp
|
|
17
|
-
dictObj = props.dictObj;
|
|
17
|
+
var topoApp = props.topoApp;
|
|
18
18
|
var store = topoApp.store;
|
|
19
19
|
|
|
20
20
|
var _store$useModel = store.useModel('topoBizMod'),
|
|
@@ -71,12 +71,16 @@ var usePolling = function usePolling(props) {
|
|
|
71
71
|
|
|
72
72
|
case 2:
|
|
73
73
|
_context.next = 4;
|
|
74
|
-
return
|
|
74
|
+
return DictCache.init();
|
|
75
75
|
|
|
76
76
|
case 4:
|
|
77
|
+
_context.next = 6;
|
|
78
|
+
return bizDispatchers.getMetricsByIds();
|
|
79
|
+
|
|
80
|
+
case 6:
|
|
77
81
|
return _context.abrupt("return", _context.sent);
|
|
78
82
|
|
|
79
|
-
case
|
|
83
|
+
case 7:
|
|
80
84
|
case "end":
|
|
81
85
|
return _context.stop();
|
|
82
86
|
}
|
|
@@ -179,7 +183,7 @@ var usePolling = function usePolling(props) {
|
|
|
179
183
|
var result = metricValueFormat({
|
|
180
184
|
value: item.val,
|
|
181
185
|
dataType: metricInfo.dataType,
|
|
182
|
-
dict:
|
|
186
|
+
dict: DictCache.getDictObject(),
|
|
183
187
|
unit: metricInfo.unit,
|
|
184
188
|
code: metricInfo.code
|
|
185
189
|
});
|