@riil-frontend/component-topology 11.0.27 → 11.0.29
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 +2 -1
- package/build/1.js +2 -2
- package/build/2.js +1 -1
- package/build/index.css +1 -1
- package/build/index.js +20 -20
- package/es/components/BatchAttrMetric/index.js +9 -19
- package/es/components/BatchAttrMetric/setting.js +64 -30
- package/es/components/BatchAttrMetric/utils.js +14 -199
- package/es/components/ModelAttrSelectDrawer/components/ModelAttrSelectDrawer.js +1 -1
- package/es/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +6 -7
- package/es/core/components/ResourceViewAttributeSetting/Setting.js +30 -58
- package/es/core/components/TopoView/topoView.js +0 -1
- package/es/core/components/titlebar/TitleBar.module.scss +0 -9
- package/es/core/components/titlebar/widgets/TitleWidget.js +2 -5
- package/es/core/editor/components/BottomFloatTool/HelpIcon.js +1 -4
- package/es/core/editor/components/BottomFloatTool/HelpIcon.module.scss +10 -8
- package/es/core/editor/components/Sidebar/views/BackgroundPanel/BackgroundPanel.js +1 -2
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +1 -4
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +1 -4
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +3 -6
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +2 -5
- package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +1 -4
- package/es/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +1 -4
- package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +1 -4
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/box.js +0 -1
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +2 -2
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +1 -2
- package/es/core/hooks/usePolling.js +8 -8
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/topoData.js +2 -2
- package/es/core/store/models/topoConfig.js +3 -4
- package/es/core/test/Test.js +4 -5
- package/es/utils/topoData.js +0 -142
- package/lib/components/BatchAttrMetric/index.js +9 -19
- package/lib/components/BatchAttrMetric/setting.js +58 -24
- package/lib/components/BatchAttrMetric/utils.js +16 -206
- package/lib/components/ModelAttrSelectDrawer/components/ModelAttrSelectDrawer.js +1 -1
- package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +5 -6
- package/lib/core/components/ResourceViewAttributeSetting/Setting.js +28 -56
- package/lib/core/components/TopoView/topoView.js +0 -1
- package/lib/core/components/titlebar/TitleBar.module.scss +0 -9
- package/lib/core/components/titlebar/widgets/TitleWidget.js +2 -7
- package/lib/core/editor/components/BottomFloatTool/HelpIcon.js +1 -4
- package/lib/core/editor/components/BottomFloatTool/HelpIcon.module.scss +10 -8
- package/lib/core/editor/components/Sidebar/views/BackgroundPanel/BackgroundPanel.js +1 -2
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +1 -4
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +1 -4
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +3 -6
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +1 -4
- package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +1 -4
- package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +1 -4
- package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +3 -4
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/box.js +0 -1
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +2 -2
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +1 -2
- package/lib/core/hooks/usePolling.js +8 -8
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/topoData.js +2 -2
- package/lib/core/store/models/topoConfig.js +3 -6
- package/lib/core/test/Test.js +4 -5
- package/lib/utils/topoData.js +0 -145
- package/package.json +2 -2
- package/es/components/BatchAttrMetric2/SelectTable.js +0 -21
- package/es/components/BatchAttrMetric2/constant.js +0 -30
- package/es/components/BatchAttrMetric2/index.js +0 -68
- package/es/components/BatchAttrMetric2/index.module.scss +0 -76
- package/es/components/BatchAttrMetric2/setting.js +0 -181
- package/es/components/BatchAttrMetric2/utils.js +0 -42
- package/es/components/IndexSettingDrawer/CiList.js +0 -26
- package/es/components/IndexSettingDrawer/CiListItem.js +0 -37
- package/es/components/IndexSettingDrawer/IndexList.js +0 -62
- package/es/components/IndexSettingDrawer/index.js +0 -60
- package/es/components/IndexSettingDrawer/index.module.scss +0 -44
- package/es/components/ModelAttrSelectDrawer/components/ModelAttrSelect.js +0 -5
- package/es/core/components/TopoApp.js +0 -7
- package/es/core/components/TopoAppView.js +0 -24
- package/es/core/editor/components/Toolbar/widgets/Dropdown.js +0 -12
- package/es/core/editor/components/settings/propertyViews/view/GlobalTootipSetting.js +0 -28
- package/es/networkTopo/components/Link/index copy.js +0 -213
- package/es/networkTopo/store/linkDynamicStyle.js +0 -259
- package/es/networkTopo/store/linkDynamicStyleConfig.js +0 -180
- package/es/networkTopo/store/linkManager.js +0 -38
- package/lib/components/BatchAttrMetric2/SelectTable.js +0 -26
- package/lib/components/BatchAttrMetric2/constant.js +0 -36
- package/lib/components/BatchAttrMetric2/index.js +0 -75
- package/lib/components/BatchAttrMetric2/index.module.scss +0 -76
- package/lib/components/BatchAttrMetric2/setting.js +0 -189
- package/lib/components/BatchAttrMetric2/utils.js +0 -48
- package/lib/components/IndexSettingDrawer/CiList.js +0 -32
- package/lib/components/IndexSettingDrawer/CiListItem.js +0 -43
- package/lib/components/IndexSettingDrawer/IndexList.js +0 -70
- package/lib/components/IndexSettingDrawer/index.js +0 -68
- package/lib/components/IndexSettingDrawer/index.module.scss +0 -44
- package/lib/components/ModelAttrSelectDrawer/components/ModelAttrSelect.js +0 -11
- package/lib/core/components/TopoApp.js +0 -13
- package/lib/core/components/TopoAppView.js +0 -32
- package/lib/core/editor/components/Toolbar/widgets/Dropdown.js +0 -18
- package/lib/core/editor/components/settings/propertyViews/view/GlobalTootipSetting.js +0 -34
- package/lib/networkTopo/components/Link/index copy.js +0 -220
- package/lib/networkTopo/store/linkDynamicStyle.js +0 -263
- package/lib/networkTopo/store/linkDynamicStyleConfig.js +0 -186
- package/lib/networkTopo/store/linkManager.js +0 -42
@@ -1,3 +1,5 @@
|
|
1
|
+
@import '@alifd/next/variables.scss';
|
2
|
+
|
1
3
|
.topoHelpIconBtn{
|
2
4
|
width: '100%';
|
3
5
|
height: '100%';
|
@@ -16,25 +18,25 @@
|
|
16
18
|
}
|
17
19
|
|
18
20
|
:global{
|
19
|
-
.white
|
21
|
+
.white.#{$css-prefix}overlay-inner{
|
20
22
|
padding: 10px;
|
21
|
-
|
23
|
+
.#{$css-prefix}balloon-close{
|
22
24
|
right: 10px;
|
23
25
|
top:8px
|
24
26
|
}
|
25
27
|
}
|
26
|
-
.dark
|
28
|
+
.dark.#{$css-prefix}overlay-inner{
|
27
29
|
padding: 10px;
|
28
30
|
background-color: #063658;
|
29
31
|
border-color: #08A5F4;
|
30
|
-
|
32
|
+
.#{$css-prefix}balloon-close{
|
31
33
|
right: 10px;
|
32
34
|
/* color:$color-text1-5; */
|
33
35
|
color:#fff;
|
34
36
|
top:8px
|
35
37
|
}
|
36
38
|
}
|
37
|
-
.dark
|
39
|
+
.dark.#{$css-prefix}overlay-inner:after{
|
38
40
|
border-color: #08A5F4;
|
39
41
|
background: #063658;
|
40
42
|
}
|
@@ -61,10 +63,10 @@
|
|
61
63
|
line-height: 20px;
|
62
64
|
margin-top: 8px;
|
63
65
|
:global{
|
64
|
-
|
66
|
+
.#{$css-prefix}row{
|
65
67
|
margin: 4px 0;
|
66
68
|
}
|
67
|
-
|
69
|
+
.#{$css-prefix}col-8{
|
68
70
|
text-align: right;
|
69
71
|
color:$color-text1-4;
|
70
72
|
}
|
@@ -78,7 +80,7 @@
|
|
78
80
|
.conten{
|
79
81
|
color:$color-text1-5;
|
80
82
|
:global{
|
81
|
-
|
83
|
+
.#{$css-prefix}col-8{
|
82
84
|
color:$color-text1-5;
|
83
85
|
}
|
84
86
|
}
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import BackgroundView from "../../../BackgroundView";
|
3
3
|
export default function BackgroundPanel(props) {
|
4
|
-
var topo = props.topo
|
5
|
-
editorProps = props.editorProps;
|
4
|
+
var topo = props.topo;
|
6
5
|
return /*#__PURE__*/React.createElement(BackgroundView, {
|
7
6
|
topo: topo
|
8
7
|
});
|
package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
2
|
-
var _excluded = ["topo", "showLabel"];
|
3
1
|
import React, { useEffect, useState, useMemo } from 'react';
|
4
2
|
import DropdownButton from "../components/DropdownButton";
|
5
3
|
import WidgetBox from "../WidgetBox";
|
@@ -12,8 +10,7 @@ import { getHtSelection, getGroupsStyle, setGroupsStyle } from "./BoxBackgroundU
|
|
12
10
|
*/
|
13
11
|
function BoxBackgroundButton(props) {
|
14
12
|
var topo = props.topo,
|
15
|
-
showLabel = props.showLabel
|
16
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
13
|
+
showLabel = props.showLabel;
|
17
14
|
var _useState = useState(true),
|
18
15
|
disabled = _useState[0],
|
19
16
|
setDisabled = _useState[1];
|
@@ -1,6 +1,4 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
3
|
-
var _excluded = ["topo", "showLabel"];
|
4
2
|
import React, { useEffect, useState } from 'react';
|
5
3
|
import { getEdgesBySelection } from "../../../../utils/edgeTypeStyleUtil";
|
6
4
|
import DropdownButton from "../components/DropdownButton";
|
@@ -14,8 +12,7 @@ import Content from "./Content";
|
|
14
12
|
*/
|
15
13
|
function EdgeColorButton(props) {
|
16
14
|
var topo = props.topo,
|
17
|
-
showLabel = props.showLabel
|
18
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
15
|
+
showLabel = props.showLabel;
|
19
16
|
var _useState = useState(true),
|
20
17
|
disabled = _useState[0],
|
21
18
|
setDisabled = _useState[1];
|
@@ -76,18 +76,15 @@ function getValuesByEdges(topo) {
|
|
76
76
|
})[0] || 'nil';
|
77
77
|
}
|
78
78
|
function getEdgesValues(edges) {
|
79
|
-
|
80
|
-
|
81
|
-
edgeValues.push({
|
79
|
+
return edges.map(function (edge) {
|
80
|
+
return {
|
82
81
|
baseAgreement: false,
|
83
|
-
//,
|
84
82
|
lineButton: edge.a('edge.type.name') || edge.s('edge.type'),
|
85
83
|
startPoint: getStartPoint(edge),
|
86
84
|
endPoint: getEndPoint(edge),
|
87
85
|
lineMold: edge.a('lineMode') || 'solidLine'
|
88
|
-
}
|
86
|
+
};
|
89
87
|
});
|
90
|
-
return edgeValues;
|
91
88
|
}
|
92
89
|
var selectionEdges = getEdgesBySelection(topo);
|
93
90
|
var edgeValues = getEdgesValues(selectionEdges);
|
@@ -1,7 +1,5 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
|
-
import
|
3
|
-
var _excluded = ["topo", "showLabel", "editorProps"];
|
4
|
-
import React, { useEffect, useMemo, useState } from 'react';
|
2
|
+
import React, { useEffect, useState } from 'react';
|
5
3
|
import { getEdgesBySelection, setEdgesAndChildren, setEdgesType } from "../../../../utils/edgeTypeStyleUtil";
|
6
4
|
import DropdownButton from "../components/DropdownButton";
|
7
5
|
import WidgetBox from "../WidgetBox";
|
@@ -16,8 +14,7 @@ import EdgeType from "./EdgeType";
|
|
16
14
|
function EdgeTypeButton(props) {
|
17
15
|
var topo = props.topo,
|
18
16
|
showLabel = props.showLabel,
|
19
|
-
editorProps = props.editorProps
|
20
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
17
|
+
editorProps = props.editorProps;
|
21
18
|
var _useState = useState(true),
|
22
19
|
disabled = _useState[0],
|
23
20
|
setDisabled = _useState[1];
|
@@ -1,7 +1,5 @@
|
|
1
1
|
import _Balloon from "@alifd/next/es/balloon";
|
2
2
|
import _NumberPicker from "@alifd/next/es/number-picker";
|
3
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
4
|
-
var _excluded = ["topo", "showLabel"];
|
5
3
|
import React, { useState, useEffect } from 'react';
|
6
4
|
import WidgetBox from "./WidgetBox";
|
7
5
|
import DropdownButton from "./components/DropdownButton";
|
@@ -10,8 +8,7 @@ import { isEdge, isLayer } from "../../../../../utils/htElementUtils";
|
|
10
8
|
import styles from "./NodeAlignWidget.module.scss";
|
11
9
|
function NodeAlignWidget(props) {
|
12
10
|
var topo = props.topo,
|
13
|
-
showLabel = props.showLabel
|
14
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
11
|
+
showLabel = props.showLabel;
|
15
12
|
var _useState = useState(true),
|
16
13
|
disabled = _useState[0],
|
17
14
|
setDisabled = _useState[1];
|
@@ -1,5 +1,3 @@
|
|
1
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
2
|
-
var _excluded = ["topo", "showLabel"];
|
3
1
|
import React, { useEffect, useState } from "react";
|
4
2
|
import { isGroup, isNode, isText } from "../../../../../../utils/htElementUtils";
|
5
3
|
import DropdownButton from "../components/DropdownButton";
|
@@ -19,8 +17,7 @@ function isElementSetImageEnabled(element) {
|
|
19
17
|
*/
|
20
18
|
function NodeImageButton(props) {
|
21
19
|
var topo = props.topo,
|
22
|
-
showLabel = props.showLabel
|
23
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
20
|
+
showLabel = props.showLabel;
|
24
21
|
var _useState = useState(true),
|
25
22
|
disabled = _useState[0],
|
26
23
|
setDisabled = _useState[1];
|
@@ -1,5 +1,3 @@
|
|
1
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
2
|
-
var _excluded = ["topo", "showLabel"];
|
3
1
|
import React, { useEffect, useState } from 'react';
|
4
2
|
// import BatchSetNodeSize from "../../../settings/propertyViews/view/BatchSetNodeSize";
|
5
3
|
import BatchSetNodeSize from "../../../settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize";
|
@@ -16,8 +14,7 @@ import { isGroup, isNode } from "../../../../../../utils/htElementUtils";
|
|
16
14
|
*/
|
17
15
|
function NodeSizeButton(props) {
|
18
16
|
var topo = props.topo,
|
19
|
-
showLabel = props.showLabel
|
20
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
17
|
+
showLabel = props.showLabel;
|
21
18
|
var _useState = useState(true),
|
22
19
|
disabled = _useState[0],
|
23
20
|
setDisabled = _useState[1];
|
@@ -9,7 +9,6 @@ export function getTextStyle(element) {
|
|
9
9
|
}, fontStyleUtil.toMap(element.a('rectFont')), parseBackground(element.a('topLeftColor')));
|
10
10
|
}
|
11
11
|
export function setTextStyle(element, style, topo) {
|
12
|
-
if ('underline' in style) {}
|
13
12
|
if ('color' in style) {
|
14
13
|
element.a('topLeftTextColor', style.color.hex);
|
15
14
|
}
|
@@ -66,8 +66,8 @@ export function getTextStyle(htSelection, styleNames) {
|
|
66
66
|
// 查询该字段多元素的值列表,排除元素禁用的字段值
|
67
67
|
var fieldValueList = elementValues.reduce(function (result, item) {
|
68
68
|
// 元素字段是否禁用
|
69
|
-
var
|
70
|
-
if (!item.values ||
|
69
|
+
var fieldDisabled = !elementEnabledFieldsMap[item.id].includes(styleName);
|
70
|
+
if (!item.values || fieldDisabled) {
|
71
71
|
return result;
|
72
72
|
}
|
73
73
|
return [].concat(result, [item.values[styleName]]);
|
@@ -10,8 +10,7 @@ var defaultStyle = {
|
|
10
10
|
};
|
11
11
|
export function useValues(topo) {
|
12
12
|
var displayConfigState = topo.store.useModelState('displayConfig');
|
13
|
-
var nodeLabelStyle = displayConfigState.nodeLabelStyle
|
14
|
-
defaultEdgeLabelStyle = displayConfigState.defaultEdgeLabelStyle;
|
13
|
+
var nodeLabelStyle = displayConfigState.nodeLabelStyle;
|
15
14
|
return _extends({
|
16
15
|
color: (nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.color) || defaultStyle.color,
|
17
16
|
fontFamily: (nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.fontFamily) || defaultStyle.fontFamily,
|
@@ -41,7 +41,7 @@ var usePolling = function usePolling(props) {
|
|
41
41
|
*/
|
42
42
|
function _fetchData() {
|
43
43
|
_fetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
44
|
-
var _topo$store$getModelS, resIdsList, nodeIdsList, codes, param, _yield$Promise$all,
|
44
|
+
var _topo$store$getModelS, resIdsList, nodeIdsList, codes, param, _yield$Promise$all, ciMetricsResult, mergeData, transformLinkData, adapterIpv6;
|
45
45
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
46
46
|
while (1) switch (_context.prev = _context.next) {
|
47
47
|
case 0:
|
@@ -70,7 +70,7 @@ var usePolling = function usePolling(props) {
|
|
70
70
|
attributeMap: link.attributes || {}
|
71
71
|
});
|
72
72
|
};
|
73
|
-
mergeData = function _mergeData(
|
73
|
+
mergeData = function _mergeData(ciMetricsResult) {
|
74
74
|
// 合并属性、指标
|
75
75
|
var _topo$dataModel$getDa = topo.dataModel.getData(),
|
76
76
|
nodes = _topo$dataModel$getDa.nodes,
|
@@ -85,11 +85,11 @@ var usePolling = function usePolling(props) {
|
|
85
85
|
resultData = adapterIpv6(resultData);
|
86
86
|
return resultData;
|
87
87
|
}).map(function (ciData) {
|
88
|
-
var
|
88
|
+
var ciMetricResult = ciMetricsResult.find(function (item) {
|
89
|
+
return item.id === (ciData.ciId || ciData.id);
|
90
|
+
});
|
89
91
|
return _extends({}, ciData, {
|
90
|
-
metrics: (
|
91
|
-
return item.id === ciData.ciId || ciData.id;
|
92
|
-
})) === null || _metricResult$find === void 0 ? void 0 : _metricResult$find.metrics) || {}
|
92
|
+
metrics: (ciMetricResult === null || ciMetricResult === void 0 ? void 0 : ciMetricResult.metrics) || {}
|
93
93
|
});
|
94
94
|
});
|
95
95
|
};
|
@@ -127,8 +127,8 @@ var usePolling = function usePolling(props) {
|
|
127
127
|
return _context.t0.all.call(_context.t0, _context.t3);
|
128
128
|
case 16:
|
129
129
|
_yield$Promise$all = _context.sent;
|
130
|
-
|
131
|
-
return _context.abrupt("return", mergeData(
|
130
|
+
ciMetricsResult = _yield$Promise$all[0];
|
131
|
+
return _context.abrupt("return", mergeData(ciMetricsResult));
|
132
132
|
case 19:
|
133
133
|
case "end":
|
134
134
|
return _context.stop();
|
@@ -25,7 +25,7 @@ import SelectionModel from "./SelectionModel";
|
|
25
25
|
import CiCache from "./cache/CiCache";
|
26
26
|
|
27
27
|
// eslint-disable-next-line no-undef
|
28
|
-
var version = typeof "11.0.
|
28
|
+
var version = typeof "11.0.29" === 'string' ? "11.0.29" : null;
|
29
29
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
30
30
|
|
31
31
|
/**
|
@@ -36,11 +36,11 @@ export function saveTopo(_x) {
|
|
36
36
|
}
|
37
37
|
function _saveTopo() {
|
38
38
|
_saveTopo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
|
39
|
-
var topoService, topoId, template, layout, backgroundId, globalConfig, serialize, resources, groups,
|
39
|
+
var topoService, topoId, template, layout, backgroundId, globalConfig, serialize, resources, groups, relateTopoIdList, viewGroupId, groupInfo, viewResources, linkIps;
|
40
40
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
41
41
|
while (1) switch (_context.prev = _context.next) {
|
42
42
|
case 0:
|
43
|
-
topoService = data.topoService, topoId = data.id, template = data.template, layout = data.layout, backgroundId = data.backgroundId, globalConfig = data.globalConfig, serialize = data.serialize, resources = data.resources, groups = data.groups,
|
43
|
+
topoService = data.topoService, topoId = data.id, template = data.template, layout = data.layout, backgroundId = data.backgroundId, globalConfig = data.globalConfig, serialize = data.serialize, resources = data.resources, groups = data.groups, relateTopoIdList = data.relateTopoIdList, viewGroupId = data.viewGroupId;
|
44
44
|
rlog.debug("saveTopo", data);
|
45
45
|
|
46
46
|
// 保存布局
|
@@ -6,7 +6,7 @@ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyri
|
|
6
6
|
*/
|
7
7
|
import { getUUID, isAvailableArray } from "@riil-frontend/utils";
|
8
8
|
import { transformTopoElements } from "@riil-frontend/component-topology-graph/es/utils";
|
9
|
-
import
|
9
|
+
import { TOPO_PARENT_ID } from "@riil-frontend/component-topology-common/es/services/topo";
|
10
10
|
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
11
11
|
import { removeFromArray } from "../../../utils/format";
|
12
12
|
import { DEFAULT_GROUP } from "../../../utils/template";
|
@@ -220,17 +220,16 @@ export default function (topoApp) {
|
|
220
220
|
fetchDataByConfig: function fetchDataByConfig(params, rootState) {
|
221
221
|
var _this2 = this;
|
222
222
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
223
|
-
var editState, resources, _editState$groups, groups, _editState$
|
223
|
+
var editState, resources, _editState$groups, groups, _editState$ipNodes, ipNodes, query, data;
|
224
224
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
225
225
|
while (1) switch (_context2.prev = _context2.next) {
|
226
226
|
case 0:
|
227
227
|
editState = rootState.topoConfig;
|
228
|
-
resources = editState.resources, _editState$groups = editState.groups, groups = _editState$groups === void 0 ? [] : _editState$groups, _editState$
|
228
|
+
resources = editState.resources, _editState$groups = editState.groups, groups = _editState$groups === void 0 ? [] : _editState$groups, _editState$ipNodes = editState.ipNodes, ipNodes = _editState$ipNodes === void 0 ? [] : _editState$ipNodes;
|
229
229
|
query = {
|
230
230
|
id: rootState.topoMod.topoId,
|
231
231
|
resources: resources,
|
232
232
|
groups: groups,
|
233
|
-
// exportLinkIdList,
|
234
233
|
ipNodes: ipNodes
|
235
234
|
};
|
236
235
|
_context2.next = 5;
|
package/es/core/test/Test.js
CHANGED
@@ -14,13 +14,12 @@ var Test = /*#__PURE__*/function () {
|
|
14
14
|
});
|
15
15
|
}
|
16
16
|
};
|
17
|
-
};
|
18
|
-
_proto.onReady = function onReady() {
|
19
|
-
// TODO 待移除测试代码
|
20
|
-
// this.iconManage.openUpload()
|
21
|
-
// this.topo.store.getModelDispatchers('linkDynamicStyleConfig').open({type: 'networkLink'});
|
22
17
|
}
|
23
18
|
|
19
|
+
// eslint-disable-next-line class-methods-use-this
|
20
|
+
;
|
21
|
+
_proto.onReady = function onReady() {}
|
22
|
+
|
24
23
|
/**
|
25
24
|
* 关联IP示例代码
|
26
25
|
*/;
|
package/es/utils/topoData.js
CHANGED
@@ -339,148 +339,6 @@ export function getLinksBetweenTwoNodes(links, id1, id2) {
|
|
339
339
|
});
|
340
340
|
}
|
341
341
|
|
342
|
-
// 批量更新指标状态
|
343
|
-
export var updateAllCiDoc = function updateAllCiDoc(dataType, doc, ciDoc, allCiSet) {
|
344
|
-
rlog.debug("updateAllCiDoc", dataType, doc, ciDoc);
|
345
|
-
var cidoc = _.cloneDeep(ciDoc);
|
346
|
-
var allciset = _.cloneDeep(allCiSet);
|
347
|
-
var ciArr = Object.keys(cidoc);
|
348
|
-
ciArr.map(function (key) {
|
349
|
-
rlog.debug("Object.keys", allciset, cidoc, key);
|
350
|
-
var arr = [];
|
351
|
-
var list = cidoc[key].list.map(function (d) {
|
352
|
-
var ciType = cidoc[key].code;
|
353
|
-
|
354
|
-
// rlog.debug('Object.keys---list-item', cidoc[key], ciType, d);
|
355
|
-
var item = findItem(doc[ciType], "code", d.code);
|
356
|
-
// rlog.debug('Object.keys---list-findItem', doc[ciType], item);
|
357
|
-
var r = _extends({}, d);
|
358
|
-
var name = cidoc[key].name;
|
359
|
-
// rlog.debug('Object.keys---r', r);
|
360
|
-
if (item) {
|
361
|
-
r[dataType] = true;
|
362
|
-
var num = 0;
|
363
|
-
var nameArr = [];
|
364
|
-
ciArr.map(function (ci) {
|
365
|
-
var ciItem = cidoc[ci];
|
366
|
-
if (ciItem.code === ciType) {
|
367
|
-
num += 1;
|
368
|
-
nameArr.push(ciItem.name);
|
369
|
-
}
|
370
|
-
return "";
|
371
|
-
});
|
372
|
-
rlog.debug("Object.keys---nameArr", num, nameArr);
|
373
|
-
if (dataType === "tip") {
|
374
|
-
r.ciTipNum = num;
|
375
|
-
r.ciTipArr = nameArr;
|
376
|
-
} else if (dataType === "tag") {
|
377
|
-
r.ciTagNum = num;
|
378
|
-
r.ciTagArr = nameArr;
|
379
|
-
}
|
380
|
-
arr.push(item);
|
381
|
-
} else {
|
382
|
-
r[dataType] = false;
|
383
|
-
if (dataType === "tip") {
|
384
|
-
r.ciTipNum = 0;
|
385
|
-
r.ciTipArr = [];
|
386
|
-
} else if (dataType === "tag") {
|
387
|
-
r.ciTagNum = 0;
|
388
|
-
r.ciTagArr = [];
|
389
|
-
}
|
390
|
-
}
|
391
|
-
return r;
|
392
|
-
});
|
393
|
-
var uniqArr = _.uniqWith(arr, _.isEqual);
|
394
|
-
rlog.debug("Object.keys---list-result-arr,list", arr, uniqArr, list);
|
395
|
-
allciset[cidoc[key].code].list = list;
|
396
|
-
cidoc[key][dataType] = uniqArr;
|
397
|
-
cidoc[key].list = list;
|
398
|
-
return "";
|
399
|
-
});
|
400
|
-
rlog.debug("updateAllCiDoc-result", cidoc);
|
401
|
-
return {
|
402
|
-
cidoc: cidoc,
|
403
|
-
allciset: allciset
|
404
|
-
};
|
405
|
-
};
|
406
|
-
// 更新指标状态
|
407
|
-
export var updateCiDoc = function updateCiDoc(dataType, doc, ciDoc, allCiSet) {
|
408
|
-
rlog.debug("updateCiDoc", dataType, doc, ciDoc, allCiSet);
|
409
|
-
var dt = {
|
410
|
-
attribute: "attributes",
|
411
|
-
metric: "metrics"
|
412
|
-
};
|
413
|
-
var cidoc = _.cloneDeep(ciDoc);
|
414
|
-
var allciset = _.cloneDeep(allCiSet);
|
415
|
-
Object.keys(doc).map(function (key) {
|
416
|
-
var arr = doc[key].map(function (item) {
|
417
|
-
return item;
|
418
|
-
});
|
419
|
-
var list = cidoc[key].list.map(function (d) {
|
420
|
-
var r = _extends({}, d);
|
421
|
-
var ciname = cidoc[key].name;
|
422
|
-
if (findItemIndex(arr, "code", d.code) < 0) {
|
423
|
-
r[dataType] = false;
|
424
|
-
if (dataType === "tip") {
|
425
|
-
r.ciTipNum = r.ciTipNum > 1 ? r.ciTipNum - 1 : 0;
|
426
|
-
r.ciTipArr = r.ciTipArr.length > 1 ? r.ciTipArr.splice(r.ciTipArr.indexOf(ciname), 1) : [];
|
427
|
-
} else if (dataType === "tag") {
|
428
|
-
r.ciTagNum = r.ciTagNum > 1 ? r.ciTagNum - 1 : 0;
|
429
|
-
r.ciTagArr = r.ciTagArr.length > 1 ? r.ciTagArr.splice(r.ciTagArr.indexOf(ciname), 1) : [];
|
430
|
-
}
|
431
|
-
} else {
|
432
|
-
r[dataType] = true;
|
433
|
-
if (dataType === "tip") {
|
434
|
-
if (r.ciTipArr.indexOf(ciname) < 0) {
|
435
|
-
r.ciTipNum += 1;
|
436
|
-
r.ciTipArr.push(ciname);
|
437
|
-
}
|
438
|
-
} else if (dataType === "tag") {
|
439
|
-
if (r.ciTagArr.indexOf(ciname) < 0) {
|
440
|
-
r.ciTagNum += 1;
|
441
|
-
r.ciTagArr.push(ciname);
|
442
|
-
}
|
443
|
-
}
|
444
|
-
}
|
445
|
-
return r;
|
446
|
-
});
|
447
|
-
var list2 = cidoc[key].list.map(function (d) {
|
448
|
-
var r = _extends({}, d);
|
449
|
-
var ciname = cidoc[key].name;
|
450
|
-
if (findItemIndex(arr, "code", d.code) < 0) {
|
451
|
-
if (dataType === "tip") {
|
452
|
-
r.ciTipNum = r.ciTipNum > 1 ? r.ciTipNum - 1 : 0;
|
453
|
-
r.ciTipArr = r.ciTipArr.length > 1 ? r.ciTipArr.splice(r.ciTipArr.indexOf(ciname), 1) : [];
|
454
|
-
} else if (dataType === "tag") {
|
455
|
-
r.ciTagNum = r.ciTagNum > 1 ? r.ciTagNum - 1 : 0;
|
456
|
-
r.ciTagArr = r.ciTagArr.length > 1 ? r.ciTagArr.splice(r.ciTagArr.indexOf(ciname), 1) : [];
|
457
|
-
}
|
458
|
-
} else if (dataType === "tip") {
|
459
|
-
if (r.ciTipArr.indexOf(ciname) < 0) {
|
460
|
-
r.ciTipNum += 1;
|
461
|
-
r.ciTipArr.push(ciname);
|
462
|
-
}
|
463
|
-
} else if (dataType === "tag") {
|
464
|
-
if (r.ciTagArr.indexOf(ciname) < 0) {
|
465
|
-
r.ciTagNum += 1;
|
466
|
-
r.ciTagArr.push(ciname);
|
467
|
-
}
|
468
|
-
}
|
469
|
-
return r;
|
470
|
-
});
|
471
|
-
rlog.debug("updateCiDoc-result-----list", list, list2);
|
472
|
-
allciset[cidoc[key].code].list = list2;
|
473
|
-
cidoc[key][dataType] = arr;
|
474
|
-
cidoc[key].list = list;
|
475
|
-
return "";
|
476
|
-
});
|
477
|
-
// rlog.debug('updateCiDoc-result', cidoc);
|
478
|
-
return {
|
479
|
-
cidoc: cidoc,
|
480
|
-
allciset: allciset
|
481
|
-
};
|
482
|
-
};
|
483
|
-
|
484
342
|
/**
|
485
343
|
* 将从topo组件返回的数据(global)转化为后端接收的数据
|
486
344
|
* 具体格式内容参考
|
@@ -12,41 +12,32 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _indexModule = _interopRequireDefault(require("./index.module.scss"));
|
13
13
|
var _setting = _interopRequireDefault(require("./setting"));
|
14
14
|
var _constant = require("./constant");
|
15
|
-
var _excluded = ["saveCb"],
|
15
|
+
var _excluded = ["saveCb", "showType"],
|
16
16
|
_excluded2 = ["drawerTitle", "drawerWidth"];
|
17
17
|
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); }
|
18
18
|
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; }
|
19
19
|
/**
|
20
20
|
* 属性指标配置抽屉
|
21
21
|
*/
|
22
|
-
var BatchAttrMetricDrawer = /*#__PURE__*/(0, _react.forwardRef)(function (
|
23
|
-
var _saveCb =
|
24
|
-
|
22
|
+
var BatchAttrMetricDrawer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
23
|
+
var _saveCb = props.saveCb,
|
24
|
+
showType = props.showType,
|
25
|
+
settingProps = (0, _objectWithoutPropertiesLoose2["default"])(props, _excluded);
|
25
26
|
var _useBoolean = (0, _ahooks.useBoolean)(false),
|
26
27
|
visible = _useBoolean[0],
|
27
28
|
_useBoolean$ = _useBoolean[1],
|
28
29
|
setTrue = _useBoolean$.setTrue,
|
29
30
|
setFalse = _useBoolean$.setFalse;
|
30
|
-
// 选择类型,single/batch
|
31
31
|
var selectType = 'batch';
|
32
|
-
// 数据类型,tip/tag
|
33
|
-
var _useState = (0, _react.useState)(),
|
34
|
-
showType = _useState[0],
|
35
|
-
setShowType = _useState[1];
|
36
32
|
(0, _react.useImperativeHandle)(ref, function () {
|
37
33
|
return {
|
38
34
|
/**
|
39
35
|
* 展开抽屉
|
40
|
-
* @param {*} entryConfig 入口配置对象,必须
|
41
|
-
* @param {*} entryConfig.selectType 选择类型(single/batch),必须
|
42
|
-
* @param {*} entryConfig.dataType 数据类型(tip/tag),必须
|
43
36
|
*/
|
44
37
|
show: function show(entryConfig) {
|
45
38
|
if (entryConfig === void 0) {
|
46
39
|
entryConfig = {};
|
47
40
|
}
|
48
|
-
// setSelectType(entryConfig.selectType);
|
49
|
-
setShowType(entryConfig.showType);
|
50
41
|
setTrue();
|
51
42
|
}
|
52
43
|
};
|
@@ -62,19 +53,18 @@ var BatchAttrMetricDrawer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref,
|
|
62
53
|
title: drawerTitle,
|
63
54
|
className: _indexModule["default"].drawer,
|
64
55
|
width: drawerWidth
|
65
|
-
}, visible && /*#__PURE__*/_react["default"].createElement(_setting["default"], (0, _extends2["default"])({}, pageConfig,
|
66
|
-
showType: showType,
|
56
|
+
}, visible && /*#__PURE__*/_react["default"].createElement(_setting["default"], (0, _extends2["default"])({}, pageConfig, settingProps, {
|
67
57
|
cancelCb: setFalse,
|
68
58
|
saveCb: function saveCb(values) {
|
69
59
|
setFalse();
|
70
|
-
_saveCb(showType, values
|
60
|
+
_saveCb(showType, values);
|
71
61
|
}
|
72
62
|
})));
|
73
63
|
});
|
74
|
-
BatchAttrMetricDrawer.displayName = '
|
64
|
+
BatchAttrMetricDrawer.displayName = 'BatchAttrMetricDrawerV2';
|
75
65
|
BatchAttrMetricDrawer.propTypes = {
|
76
66
|
// 数据项
|
77
|
-
|
67
|
+
dataSource: _propTypes["default"].array.isRequired,
|
78
68
|
// 保存回调
|
79
69
|
saveCb: _propTypes["default"].func
|
80
70
|
};
|