@riil-frontend/component-topology 11.0.33 → 11.0.35

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.
Files changed (217) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.css +4 -2
  4. package/build/index.js +52 -45
  5. package/es/components/MultiResourceDrawer/index.js +22 -26
  6. package/es/components/ResourceList/ResourceSelect.js +55 -58
  7. package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +30 -34
  8. package/es/components/SingleResourceDrawer/SelectDrawer.js +24 -28
  9. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +29 -33
  10. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
  11. package/es/core/components/titlebar/widgets/TitleWidget.js +5 -3
  12. package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -18
  13. package/es/core/editor/components/BackgroundView/index.js +149 -178
  14. package/es/core/editor/components/BackgroundView/index.module.scss +2 -1
  15. package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +26 -30
  16. package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -34
  17. package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +20 -24
  18. package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +13 -17
  19. package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
  20. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
  21. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
  22. package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +17 -21
  23. package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +27 -31
  24. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
  25. package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +16 -20
  26. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +37 -55
  27. package/es/core/editor/hooks/useKeyboardShortcut.js +2 -2
  28. package/es/core/editor/hooks/useNewElementTheme.js +2 -2
  29. package/es/core/editor/store/background.js +8 -10
  30. package/es/core/editor/store/topoEdit.js +4 -6
  31. package/es/core/editor/utils/edgeTypeStyleUtil.js +2 -4
  32. package/es/core/hooks/usePolling.js +130 -142
  33. package/es/core/hooks/useResourceConfig.js +76 -100
  34. package/es/core/hooks/useTopoEdit.js +525 -623
  35. package/es/core/models/Alarm.js +319 -402
  36. package/es/core/models/AttributeMetricDisplay.js +115 -143
  37. package/es/core/models/PluginManager.js +4 -3
  38. package/es/core/models/SelectionModel.js +4 -5
  39. package/es/core/models/TopoApp.js +279 -436
  40. package/es/core/models/TopoGraphView.js +28 -41
  41. package/es/core/models/cache/CiCache.js +34 -39
  42. package/es/core/models/cache/CiTypeCache.js +47 -61
  43. package/es/core/models/cache/DictCache.js +36 -42
  44. package/es/core/models/graph/Background.js +21 -26
  45. package/es/core/models/plugins/resourceWebControllUrl.js +84 -103
  46. package/es/core/models/tagstips/ElementTagTipConfig.js +44 -58
  47. package/es/core/models/topoData.js +73 -77
  48. package/es/core/models/utils/linkUtils.js +46 -51
  49. package/es/core/models/utils/nodeNameVisibleUtil.js +4 -4
  50. package/es/core/services/alarm.js +14 -16
  51. package/es/core/services/background.js +59 -67
  52. package/es/core/services/cmdb/metric.js +14 -18
  53. package/es/core/services/cmdb.js +23 -27
  54. package/es/core/services/index.js +48 -68
  55. package/es/core/services/overview.js +131 -151
  56. package/es/core/services/topo/basic.js +37 -41
  57. package/es/core/services/topo/tagtip.js +15 -19
  58. package/es/core/store/models/ciModel.js +58 -62
  59. package/es/core/store/models/customIcon.js +126 -145
  60. package/es/core/store/models/displayConfig.js +15 -19
  61. package/es/core/store/models/selection.js +4 -6
  62. package/es/core/store/models/topoAlarm.js +162 -145
  63. package/es/core/store/models/topoBaseInfoOverview.js +4 -6
  64. package/es/core/store/models/topoBizMod.js +9 -11
  65. package/es/core/store/models/topoConfig.js +215 -231
  66. package/es/core/store/models/topoGraphView.js +4 -6
  67. package/es/core/store/models/topoMod.js +373 -395
  68. package/es/core/utils/imageUtil.js +23 -27
  69. package/es/core/utils/saveSerialize.js +14 -18
  70. package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
  71. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +20 -25
  72. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +363 -409
  73. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +112 -131
  74. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +40 -46
  75. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +219 -275
  76. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
  77. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
  78. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +45 -54
  79. package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +32 -44
  80. package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
  81. package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +23 -27
  82. package/es/networkTopo/components/Link/hook.js +85 -96
  83. package/es/networkTopo/components/Link/index.js +104 -126
  84. package/es/networkTopo/components/Link/setting.js +48 -52
  85. package/es/networkTopo/getTopoData.js +73 -92
  86. package/es/networkTopo/hooks/viewer/useRelateTopo.js +34 -39
  87. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  88. package/es/networkTopo/models/TopoCenter.js +28 -46
  89. package/es/networkTopo/services/alert.js +18 -22
  90. package/es/networkTopo/services/authorization.js +45 -55
  91. package/es/networkTopo/services/cmdb.js +548 -696
  92. package/es/networkTopo/services/funcAuth.js +22 -24
  93. package/es/networkTopo/services/link.js +107 -117
  94. package/es/networkTopo/services/mdc.js +33 -48
  95. package/es/networkTopo/services/metric.js +38 -47
  96. package/es/networkTopo/services/model.js +616 -809
  97. package/es/networkTopo/services/risk.js +9 -11
  98. package/es/networkTopo/services/topo/auth.js +27 -33
  99. package/es/networkTopo/services/topo/basic.js +251 -289
  100. package/es/networkTopo/services/topo/blacklist.js +20 -24
  101. package/es/networkTopo/services/topo/ciInfo.js +27 -31
  102. package/es/networkTopo/services/topo/icon.js +49 -59
  103. package/es/networkTopo/services/topo/networkLink.js +32 -36
  104. package/es/networkTopo/services/topo/relation.js +9 -11
  105. package/es/networkTopo/services/topo/resourceWebUrl.js +36 -42
  106. package/es/networkTopo/store/functionAuth.js +31 -37
  107. package/es/networkTopo/store/topoCenter.js +142 -152
  108. package/es/networkTopo/store/topoLinkMod.js +4 -6
  109. package/es/networkTopo/store/topoTreeMod.js +170 -182
  110. package/es/networkTopo/utils/exportData.js +57 -61
  111. package/lib/components/MultiResourceDrawer/index.js +22 -26
  112. package/lib/components/ResourceList/ResourceSelect.js +54 -58
  113. package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +33 -37
  114. package/lib/components/SingleResourceDrawer/SelectDrawer.js +24 -28
  115. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +36 -40
  116. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
  117. package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -3
  118. package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +18 -18
  119. package/lib/core/editor/components/BackgroundView/index.js +148 -177
  120. package/lib/core/editor/components/BackgroundView/index.module.scss +2 -1
  121. package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +28 -32
  122. package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +34 -34
  123. package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +23 -28
  124. package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +14 -18
  125. package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
  126. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
  127. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
  128. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +18 -22
  129. package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +32 -36
  130. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
  131. package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +18 -22
  132. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +41 -59
  133. package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -2
  134. package/lib/core/editor/hooks/useNewElementTheme.js +2 -2
  135. package/lib/core/editor/store/background.js +8 -10
  136. package/lib/core/editor/store/topoEdit.js +4 -6
  137. package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -4
  138. package/lib/core/hooks/usePolling.js +129 -141
  139. package/lib/core/hooks/useResourceConfig.js +76 -100
  140. package/lib/core/hooks/useTopoEdit.js +517 -615
  141. package/lib/core/models/Alarm.js +313 -396
  142. package/lib/core/models/AttributeMetricDisplay.js +118 -146
  143. package/lib/core/models/PluginManager.js +4 -3
  144. package/lib/core/models/SelectionModel.js +4 -5
  145. package/lib/core/models/TopoApp.js +279 -436
  146. package/lib/core/models/TopoGraphView.js +28 -41
  147. package/lib/core/models/cache/CiCache.js +39 -44
  148. package/lib/core/models/cache/CiTypeCache.js +48 -62
  149. package/lib/core/models/cache/DictCache.js +39 -45
  150. package/lib/core/models/graph/Background.js +22 -27
  151. package/lib/core/models/plugins/resourceWebControllUrl.js +82 -101
  152. package/lib/core/models/tagstips/ElementTagTipConfig.js +44 -58
  153. package/lib/core/models/topoData.js +73 -78
  154. package/lib/core/models/utils/linkUtils.js +45 -51
  155. package/lib/core/models/utils/nodeNameVisibleUtil.js +4 -4
  156. package/lib/core/services/alarm.js +18 -20
  157. package/lib/core/services/background.js +70 -78
  158. package/lib/core/services/cmdb/metric.js +14 -19
  159. package/lib/core/services/cmdb.js +24 -29
  160. package/lib/core/services/index.js +53 -72
  161. package/lib/core/services/overview.js +131 -151
  162. package/lib/core/services/topo/basic.js +37 -41
  163. package/lib/core/services/topo/tagtip.js +16 -21
  164. package/lib/core/store/models/ciModel.js +66 -70
  165. package/lib/core/store/models/customIcon.js +126 -145
  166. package/lib/core/store/models/displayConfig.js +15 -19
  167. package/lib/core/store/models/selection.js +4 -6
  168. package/lib/core/store/models/topoAlarm.js +163 -145
  169. package/lib/core/store/models/topoBaseInfoOverview.js +4 -6
  170. package/lib/core/store/models/topoBizMod.js +9 -11
  171. package/lib/core/store/models/topoConfig.js +222 -238
  172. package/lib/core/store/models/topoGraphView.js +4 -6
  173. package/lib/core/store/models/topoMod.js +375 -397
  174. package/lib/core/utils/imageUtil.js +26 -31
  175. package/lib/core/utils/saveSerialize.js +13 -18
  176. package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
  177. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +21 -26
  178. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +364 -410
  179. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +114 -133
  180. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +44 -50
  181. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +220 -274
  182. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
  183. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
  184. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +40 -50
  185. package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +35 -47
  186. package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
  187. package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +24 -28
  188. package/lib/networkTopo/components/Link/hook.js +86 -98
  189. package/lib/networkTopo/components/Link/index.js +105 -127
  190. package/lib/networkTopo/components/Link/setting.js +48 -52
  191. package/lib/networkTopo/getTopoData.js +73 -92
  192. package/lib/networkTopo/hooks/viewer/useRelateTopo.js +35 -40
  193. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  194. package/lib/networkTopo/models/TopoCenter.js +28 -46
  195. package/lib/networkTopo/services/alert.js +18 -22
  196. package/lib/networkTopo/services/authorization.js +55 -65
  197. package/lib/networkTopo/services/cmdb.js +551 -700
  198. package/lib/networkTopo/services/funcAuth.js +24 -26
  199. package/lib/networkTopo/services/link.js +108 -118
  200. package/lib/networkTopo/services/mdc.js +35 -51
  201. package/lib/networkTopo/services/metric.js +37 -47
  202. package/lib/networkTopo/services/model.js +615 -809
  203. package/lib/networkTopo/services/risk.js +11 -13
  204. package/lib/networkTopo/services/topo/auth.js +27 -33
  205. package/lib/networkTopo/services/topo/basic.js +252 -290
  206. package/lib/networkTopo/services/topo/blacklist.js +20 -24
  207. package/lib/networkTopo/services/topo/ciInfo.js +34 -38
  208. package/lib/networkTopo/services/topo/icon.js +59 -69
  209. package/lib/networkTopo/services/topo/networkLink.js +32 -36
  210. package/lib/networkTopo/services/topo/relation.js +11 -13
  211. package/lib/networkTopo/services/topo/resourceWebUrl.js +44 -50
  212. package/lib/networkTopo/store/functionAuth.js +31 -37
  213. package/lib/networkTopo/store/topoCenter.js +142 -152
  214. package/lib/networkTopo/store/topoLinkMod.js +4 -6
  215. package/lib/networkTopo/store/topoTreeMod.js +166 -178
  216. package/lib/networkTopo/utils/exportData.js +63 -68
  217. package/package.json +4 -3
@@ -19,11 +19,14 @@ var _Background = _interopRequireDefault(require("./graph/Background"));
19
19
  * 包含元素操作相关,不同类型拓扑图结构不同,后续支持多种实现
20
20
  */
21
21
  var TopoGraphView = /*#__PURE__*/function () {
22
- /**
23
- * @type TopoClient
24
- */
22
+ var _switchToViewMode, _switchToEditMode;
23
+
25
24
  function TopoGraphView() {
26
25
  this.store = void 0;
26
+
27
+ /**
28
+ * @type TopoClient
29
+ */
27
30
  this.topoClient = void 0;
28
31
  this.background = void 0;
29
32
  this.init();
@@ -59,51 +62,35 @@ var TopoGraphView = /*#__PURE__*/function () {
59
62
  this.topoClient.getGraphView().fitContent(anim, padding, notZoomIn);
60
63
  };
61
64
 
62
- _proto.switchToViewMode = /*#__PURE__*/function () {
63
- var _switchToViewMode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
65
+ _proto.switchToViewMode = function switchToViewMode() {
66
+ return (_switchToViewMode = _switchToViewMode || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
64
67
  return _regenerator["default"].wrap(function _callee$(_context) {
65
- while (1) {
66
- switch (_context.prev = _context.next) {
67
- case 0:
68
- this.topoClient.exitEditMode();
69
-
70
- case 1:
71
- case "end":
72
- return _context.stop();
73
- }
68
+ while (1) switch (_context.prev = _context.next) {
69
+ case 0:
70
+ this.topoClient.exitEditMode();
71
+
72
+ case 1:
73
+ case "end":
74
+ return _context.stop();
74
75
  }
75
76
  }, _callee, this);
76
- }));
77
-
78
- function switchToViewMode() {
79
- return _switchToViewMode.apply(this, arguments);
80
- }
81
-
82
- return switchToViewMode;
83
- }();
77
+ }))).apply(this, arguments);
78
+ };
84
79
 
85
- _proto.switchToEditMode = /*#__PURE__*/function () {
86
- var _switchToEditMode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
80
+ _proto.switchToEditMode = function switchToEditMode() {
81
+ return (_switchToEditMode = _switchToEditMode || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
87
82
  return _regenerator["default"].wrap(function _callee2$(_context2) {
88
- while (1) {
89
- switch (_context2.prev = _context2.next) {
90
- case 0:
91
- this.topoClient.enterEditMode();
92
-
93
- case 1:
94
- case "end":
95
- return _context2.stop();
96
- }
83
+ while (1) switch (_context2.prev = _context2.next) {
84
+ case 0:
85
+ this.topoClient.enterEditMode();
86
+
87
+ case 1:
88
+ case "end":
89
+ return _context2.stop();
97
90
  }
98
91
  }, _callee2, this);
99
- }));
100
-
101
- function switchToEditMode() {
102
- return _switchToEditMode.apply(this, arguments);
103
- }
104
-
105
- return switchToEditMode;
106
- }();
92
+ }))).apply(this, arguments);
93
+ };
107
94
 
108
95
  _proto.loadAlarm = function loadAlarm(alarms) {
109
96
  this.topoClient.loadAlarm(alarms);
@@ -15,7 +15,12 @@ var _services = require("../../services");
15
15
  * Ci缓存
16
16
  */
17
17
  var CiCache = /*#__PURE__*/function () {
18
+ var _load;
19
+
18
20
  function CiCache() {
21
+ /**
22
+ * @param {object<string, object>}
23
+ */
19
24
  this.ciMap = {};
20
25
  }
21
26
 
@@ -26,56 +31,46 @@ var CiCache = /*#__PURE__*/function () {
26
31
  * @param ids {string[]}
27
32
  * @returns {Promise<Object>}
28
33
  */
29
- _proto.load =
30
- /*#__PURE__*/
31
- function () {
32
- var _load = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(ids) {
34
+ _proto.load = function load(_x) {
35
+ return (_load = _load || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(ids) {
33
36
  var _this = this;
34
37
 
35
38
  var unloadCiIds, cis, map;
36
39
  return _regenerator["default"].wrap(function _callee$(_context) {
37
- while (1) {
38
- switch (_context.prev = _context.next) {
39
- case 0:
40
- unloadCiIds = ids.filter(function (id) {
41
- return !_this.ciMap[id];
42
- });
43
-
44
- if (!unloadCiIds.length) {
45
- _context.next = 6;
46
- break;
47
- }
48
-
49
- _context.next = 4;
50
- return (0, _services.queryCisByIds)(unloadCiIds);
51
-
52
- case 4:
53
- cis = _context.sent;
54
- cis.forEach(function (ci) {
55
- _this.ciMap[ci.id] = ci;
56
- });
57
-
58
- case 6:
59
- map = {};
60
- ids.forEach(function (id) {
61
- map[id] = _this.ciMap[id];
62
- });
63
- return _context.abrupt("return", this.ciMap);
64
-
65
- case 9:
66
- case "end":
67
- return _context.stop();
68
- }
40
+ while (1) switch (_context.prev = _context.next) {
41
+ case 0:
42
+ unloadCiIds = ids.filter(function (id) {
43
+ return !_this.ciMap[id];
44
+ });
45
+
46
+ if (!unloadCiIds.length) {
47
+ _context.next = 6;
48
+ break;
49
+ }
50
+
51
+ _context.next = 4;
52
+ return (0, _services.queryCisByIds)(unloadCiIds);
53
+
54
+ case 4:
55
+ cis = _context.sent;
56
+ cis.forEach(function (ci) {
57
+ _this.ciMap[ci.id] = ci;
58
+ });
59
+
60
+ case 6:
61
+ map = {};
62
+ ids.forEach(function (id) {
63
+ map[id] = _this.ciMap[id];
64
+ });
65
+ return _context.abrupt("return", this.ciMap);
66
+
67
+ case 9:
68
+ case "end":
69
+ return _context.stop();
69
70
  }
70
71
  }, _callee, this);
71
- }));
72
-
73
- function load(_x) {
74
- return _load.apply(this, arguments);
75
- }
76
-
77
- return load;
78
- }();
72
+ }))).apply(this, arguments);
73
+ };
79
74
 
80
75
  _proto.getCi = function getCi(id) {
81
76
  return this.ciMap[id];
@@ -23,84 +23,70 @@ var _keyBy = _interopRequireDefault(require("lodash/keyBy"));
23
23
  * Ci类型属性、指标缓存
24
24
  */
25
25
  var CiTypeCache = /*#__PURE__*/function () {
26
+ var _getCiTypeMap, _load;
27
+
26
28
  function CiTypeCache() {
27
29
  this.ciTypeMap = {};
28
30
  }
29
31
 
30
32
  var _proto = CiTypeCache.prototype;
31
33
 
32
- _proto.getCiTypeMap = /*#__PURE__*/function () {
33
- var _getCiTypeMap = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(ciTypeIds) {
34
+ _proto.getCiTypeMap = function getCiTypeMap(_x) {
35
+ return (_getCiTypeMap = _getCiTypeMap || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(ciTypeIds) {
34
36
  return _regenerator["default"].wrap(function _callee$(_context) {
35
- while (1) {
36
- switch (_context.prev = _context.next) {
37
- case 0:
38
- _context.prev = 0;
39
- _context.next = 3;
40
- return this.load(ciTypeIds);
41
-
42
- case 3:
43
- _context.next = 8;
44
- break;
45
-
46
- case 5:
47
- _context.prev = 5;
48
- _context.t0 = _context["catch"](0);
49
-
50
- _rlog["default"].error('查询Ci模型异常', _context.t0);
51
-
52
- case 8:
53
- return _context.abrupt("return", this.ciTypeMap);
54
-
55
- case 9:
56
- case "end":
57
- return _context.stop();
58
- }
59
- }
60
- }, _callee, this, [[0, 5]]);
61
- }));
37
+ while (1) switch (_context.prev = _context.next) {
38
+ case 0:
39
+ _context.prev = 0;
40
+ _context.next = 3;
41
+ return this.load(ciTypeIds);
62
42
 
63
- function getCiTypeMap(_x) {
64
- return _getCiTypeMap.apply(this, arguments);
65
- }
43
+ case 3:
44
+ _context.next = 8;
45
+ break;
46
+
47
+ case 5:
48
+ _context.prev = 5;
49
+ _context.t0 = _context["catch"](0);
50
+
51
+ _rlog["default"].error('查询Ci模型异常', _context.t0);
52
+
53
+ case 8:
54
+ return _context.abrupt("return", this.ciTypeMap);
66
55
 
67
- return getCiTypeMap;
68
- }();
56
+ case 9:
57
+ case "end":
58
+ return _context.stop();
59
+ }
60
+ }, _callee, this, [[0, 5]]);
61
+ }))).apply(this, arguments);
62
+ };
69
63
 
70
- _proto.load = /*#__PURE__*/function () {
71
- var _load = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(ciTypeIds) {
64
+ _proto.load = function load(_x2) {
65
+ return (_load = _load || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(ciTypeIds) {
72
66
  var _this = this;
73
67
 
74
68
  var unLoadCiTypeIds, ciTypeMetas;
75
69
  return _regenerator["default"].wrap(function _callee2$(_context2) {
76
- while (1) {
77
- switch (_context2.prev = _context2.next) {
78
- case 0:
79
- unLoadCiTypeIds = ciTypeIds.filter(function (id) {
80
- return !_this.ciTypeMap[id];
81
- });
82
- _context2.next = 3;
83
- return _topo["default"].ciInfo.batchQueryCiTypeInfo(unLoadCiTypeIds);
84
-
85
- case 3:
86
- ciTypeMetas = _context2.sent;
87
- this.addCiTypes(ciTypeMetas);
88
- return _context2.abrupt("return", this.ciTypeMap);
89
-
90
- case 6:
91
- case "end":
92
- return _context2.stop();
93
- }
70
+ while (1) switch (_context2.prev = _context2.next) {
71
+ case 0:
72
+ unLoadCiTypeIds = ciTypeIds.filter(function (id) {
73
+ return !_this.ciTypeMap[id];
74
+ });
75
+ _context2.next = 3;
76
+ return _topo["default"].ciInfo.batchQueryCiTypeInfo(unLoadCiTypeIds);
77
+
78
+ case 3:
79
+ ciTypeMetas = _context2.sent;
80
+ this.addCiTypes(ciTypeMetas);
81
+ return _context2.abrupt("return", this.ciTypeMap);
82
+
83
+ case 6:
84
+ case "end":
85
+ return _context2.stop();
94
86
  }
95
87
  }, _callee2, this);
96
- }));
97
-
98
- function load(_x2) {
99
- return _load.apply(this, arguments);
100
- }
101
-
102
- return load;
103
- }();
88
+ }))).apply(this, arguments);
89
+ };
104
90
 
105
91
  _proto.addCiTypes = function addCiTypes(ciTypeMetas) {
106
92
  var _this2 = this;
@@ -23,6 +23,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
23
23
  * 数据字典缓存
24
24
  */
25
25
  var DictCache = /*#__PURE__*/function () {
26
+ var _init;
27
+
26
28
  function DictCache() {
27
29
  this.dists = void 0;
28
30
  this.dictObject = void 0;
@@ -30,61 +32,53 @@ var DictCache = /*#__PURE__*/function () {
30
32
 
31
33
  var _proto = DictCache.prototype;
32
34
 
33
- _proto.init = /*#__PURE__*/function () {
34
- var _init = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
35
+ _proto.init = function init() {
36
+ return (_init = _init || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
35
37
  var distsStr, dicts;
36
38
  return _regenerator["default"].wrap(function _callee$(_context) {
37
- while (1) {
38
- switch (_context.prev = _context.next) {
39
- case 0:
40
- if (!this.dists) {
41
- _context.next = 2;
42
- break;
43
- }
44
-
45
- return _context.abrupt("return");
46
-
47
- case 2:
48
- distsStr = sessionStorage.getItem('dists');
49
-
50
- if (!distsStr) {
51
- _context.next = 7;
52
- break;
53
- }
54
-
55
- dicts = JSON.parse(distsStr);
56
- _context.next = 10;
39
+ while (1) switch (_context.prev = _context.next) {
40
+ case 0:
41
+ if (!this.dists) {
42
+ _context.next = 2;
57
43
  break;
44
+ }
58
45
 
59
- case 7:
60
- _context.next = 9;
61
- return modelService.queryDicts()["catch"](function (e) {
62
- _rlog["default"].error('初始化数据字典异常', e);
46
+ return _context.abrupt("return");
63
47
 
64
- return [];
65
- });
48
+ case 2:
49
+ distsStr = sessionStorage.getItem('dists');
66
50
 
67
- case 9:
68
- dicts = _context.sent;
51
+ if (!distsStr) {
52
+ _context.next = 7;
53
+ break;
54
+ }
69
55
 
70
- case 10:
71
- this.dists = dicts;
72
- this.dictObject = (0, _utils.dictFormat)(dicts);
56
+ dicts = JSON.parse(distsStr);
57
+ _context.next = 10;
58
+ break;
73
59
 
74
- case 12:
75
- case "end":
76
- return _context.stop();
77
- }
78
- }
79
- }, _callee, this);
80
- }));
60
+ case 7:
61
+ _context.next = 9;
62
+ return modelService.queryDicts()["catch"](function (e) {
63
+ _rlog["default"].error('初始化数据字典异常', e);
64
+
65
+ return [];
66
+ });
81
67
 
82
- function init() {
83
- return _init.apply(this, arguments);
84
- }
68
+ case 9:
69
+ dicts = _context.sent;
85
70
 
86
- return init;
87
- }();
71
+ case 10:
72
+ this.dists = dicts;
73
+ this.dictObject = (0, _utils.dictFormat)(dicts);
74
+
75
+ case 12:
76
+ case "end":
77
+ return _context.stop();
78
+ }
79
+ }, _callee, this);
80
+ }))).apply(this, arguments);
81
+ };
88
82
 
89
83
  _proto.getDictObject = function getDictObject() {
90
84
  return this.dictObject;
@@ -14,38 +14,33 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
14
14
  */
15
15
  var Background = /*#__PURE__*/function () {
16
16
  function Background(view) {
17
- var _this = this;
17
+ var _this = this,
18
+ _ref2;
18
19
 
19
- this.setSize = /*#__PURE__*/function () {
20
- var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(_ref) {
20
+ this.setSize = function (_x) {
21
+ return (_ref2 = _ref2 || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(_ref) {
21
22
  var width, height, backgroundNode, backgroundDispatchers;
22
23
  return _regenerator["default"].wrap(function _callee$(_context) {
23
- while (1) {
24
- switch (_context.prev = _context.next) {
25
- case 0:
26
- width = _ref.width, height = _ref.height;
27
- backgroundNode = _this.getBackgroundNode();
28
- backgroundNode.setWidth(width);
29
- backgroundNode.setHeight(height);
30
- backgroundDispatchers = _this.view.store.getModelDispatchers('background');
31
- _context.next = 7;
32
- return backgroundDispatchers.setSize({
33
- width: width,
34
- height: height
35
- });
36
-
37
- case 7:
38
- case "end":
39
- return _context.stop();
40
- }
24
+ while (1) switch (_context.prev = _context.next) {
25
+ case 0:
26
+ width = _ref.width, height = _ref.height;
27
+ backgroundNode = _this.getBackgroundNode();
28
+ backgroundNode.setWidth(width);
29
+ backgroundNode.setHeight(height);
30
+ backgroundDispatchers = _this.view.store.getModelDispatchers('background');
31
+ _context.next = 7;
32
+ return backgroundDispatchers.setSize({
33
+ width: width,
34
+ height: height
35
+ });
36
+
37
+ case 7:
38
+ case "end":
39
+ return _context.stop();
41
40
  }
42
41
  }, _callee);
43
- }));
44
-
45
- return function (_x) {
46
- return _ref2.apply(this, arguments);
47
- };
48
- }();
42
+ }))).apply(this, arguments);
43
+ };
49
44
 
50
45
  this.view = view;
51
46
  }