@riil-frontend/component-topology 11.0.25 → 11.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/1.js +1 -1
- package/build/index.css +1 -1
- package/build/index.js +11 -11
- package/es/common/components/ResourceTable/ResourceTable.module.scss +0 -4
- package/es/components/BatchAttrMetric/index.js +4 -6
- package/es/components/BatchAttrMetric/utils.js +20 -21
- package/es/components/BatchAttrMetric2/setting.js +2 -4
- package/es/components/BatchAttrMetric2/utils.js +5 -57
- package/es/components/Drawer/index.module.scss +0 -2
- package/es/components/ModelAttrSelectDrawer/components/MultipleTypeAttributeSelectDrawer.js +2 -2
- package/es/components/MultiResourceDrawer/ResourceSelect.js +2 -3
- package/es/components/ResourceList/ResourceSelect.module.scss +0 -4
- package/es/components/TagSelect/index.js +0 -1
- package/es/components/TagSelect/index.scss +0 -2
- package/es/components/VerticalIconTab/VerticalIconTab.js +2 -2
- package/es/core/components/AlarmListPanel/index.module.scss +0 -13
- package/es/core/components/DisplaySettingDrawer/DisplaySetting.js +2 -5
- package/es/core/editor/components/BottomFloatTool/HelpIcon.js +5 -3
- package/es/core/editor/components/BottomFloatTool/HelpIcon.module.scss +7 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +1 -1
- package/es/core/hooks/useCanvasThemeConfig.js +8 -4
- package/es/core/hooks/useTopoEdit.js +161 -140
- package/es/core/models/Alarm.js +2 -3
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/topoData.js +1 -1
- package/es/core/models/utils/linkUtils.js +1 -1
- package/es/core/store/models/topoConfig.js +1 -1
- package/lib/common/components/ResourceTable/ResourceTable.module.scss +0 -4
- package/lib/components/BatchAttrMetric/index.js +4 -6
- package/lib/components/BatchAttrMetric/utils.js +18 -19
- package/lib/components/BatchAttrMetric2/setting.js +2 -4
- package/lib/components/BatchAttrMetric2/utils.js +5 -60
- package/lib/components/Drawer/index.module.scss +0 -2
- package/lib/components/ModelAttrSelectDrawer/components/MultipleTypeAttributeSelectDrawer.js +2 -2
- package/lib/components/MultiResourceDrawer/ResourceSelect.js +1 -2
- package/lib/components/ResourceList/ResourceSelect.module.scss +0 -4
- package/lib/components/TagSelect/index.js +0 -1
- package/lib/components/TagSelect/index.scss +0 -2
- package/lib/components/VerticalIconTab/VerticalIconTab.js +2 -2
- package/lib/core/components/AlarmListPanel/index.module.scss +0 -13
- package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +2 -5
- package/lib/core/editor/components/BottomFloatTool/HelpIcon.js +5 -3
- package/lib/core/editor/components/BottomFloatTool/HelpIcon.module.scss +7 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +1 -1
- package/lib/core/hooks/useCanvasThemeConfig.js +8 -4
- package/lib/core/hooks/useTopoEdit.js +162 -139
- package/lib/core/models/Alarm.js +2 -3
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/topoData.js +1 -1
- package/lib/core/models/utils/linkUtils.js +1 -1
- package/lib/core/store/models/topoConfig.js +1 -1
- package/package.json +3 -6
- package/es/core/components/DisplaySettingDrawer/ResourceDisplay/useElementTagTipConfig.js +0 -127
- package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/useElementTagTipConfig.js +0 -132
@@ -22,13 +22,11 @@ var BatchAttrMetricDrawer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
22
22
|
setTrue = _useBoolean$.setTrue,
|
23
23
|
setFalse = _useBoolean$.setFalse;
|
24
24
|
// 选择类型,single/batch
|
25
|
-
var
|
26
|
-
selectType = _useState[0],
|
27
|
-
setSelectType = _useState[1];
|
25
|
+
var selectType = 'batch';
|
28
26
|
// 数据类型,tip/tag
|
29
|
-
var
|
30
|
-
showType =
|
31
|
-
setShowType =
|
27
|
+
var _useState = useState(),
|
28
|
+
showType = _useState[0],
|
29
|
+
setShowType = _useState[1];
|
32
30
|
useImperativeHandle(ref, function () {
|
33
31
|
return {
|
34
32
|
/**
|
@@ -1,9 +1,8 @@
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
3
3
|
var _excluded = ["list"];
|
4
|
-
import React from
|
5
|
-
import
|
6
|
-
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
4
|
+
import React from 'react';
|
5
|
+
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
7
6
|
|
8
7
|
/**
|
9
8
|
* 获取树结构数据源
|
@@ -30,7 +29,7 @@ var toId = function toId(_ref) {
|
|
30
29
|
|
31
30
|
// id反解析回对象
|
32
31
|
var reverseToId = function reverseToId(id) {
|
33
|
-
var _id$split = id.split(
|
32
|
+
var _id$split = id.split('-'),
|
34
33
|
code = _id$split[0],
|
35
34
|
type = _id$split[1];
|
36
35
|
return {
|
@@ -84,20 +83,20 @@ export var saveTransform = function saveTransform(submit) {
|
|
84
83
|
* @returns
|
85
84
|
*/
|
86
85
|
export var initSelected = function initSelected(allCiSet, showType) {
|
87
|
-
rlog.debug(
|
86
|
+
rlog.debug('initSelected-allCiSet, dataType', allCiSet, showType);
|
88
87
|
var values = {};
|
89
|
-
Object.keys(allCiSet).
|
88
|
+
Object.keys(allCiSet).forEach(function (key) {
|
90
89
|
var _value$list;
|
91
90
|
var value = allCiSet[key];
|
92
91
|
var result = [];
|
93
|
-
(_value$list = value.list) === null || _value$list === void 0 ? void 0 : _value$list.
|
92
|
+
(_value$list = value.list) === null || _value$list === void 0 ? void 0 : _value$list.forEach(function (item) {
|
94
93
|
if (item[showType]) {
|
95
94
|
result.push(item.id);
|
96
95
|
}
|
97
96
|
});
|
98
97
|
values[key] = result;
|
99
98
|
});
|
100
|
-
rlog.debug(
|
99
|
+
rlog.debug('initSelected-allCiSet-result, dataType', values);
|
101
100
|
return values;
|
102
101
|
};
|
103
102
|
|
@@ -109,7 +108,7 @@ export var initSelected = function initSelected(allCiSet, showType) {
|
|
109
108
|
*/
|
110
109
|
export var updateCiSetSeleted = function updateCiSetSeleted(selected, allCiSet, showType) {
|
111
110
|
var newCiSet = _extends({}, allCiSet);
|
112
|
-
Object.keys(selected).
|
111
|
+
Object.keys(selected).forEach(function (key) {
|
113
112
|
var selectedArr = selected[key];
|
114
113
|
var list = allCiSet[key].list.map(function (item) {
|
115
114
|
var obj = showType === 'tag' ? _extends({}, item, {
|
@@ -123,7 +122,7 @@ export var updateCiSetSeleted = function updateCiSetSeleted(selected, allCiSet,
|
|
123
122
|
list: list
|
124
123
|
});
|
125
124
|
});
|
126
|
-
rlog.debug(
|
125
|
+
rlog.debug('updateCiSetSeleted-selected,newCiSet', selected, newCiSet);
|
127
126
|
return newCiSet;
|
128
127
|
};
|
129
128
|
|
@@ -158,12 +157,12 @@ export var defaultSelected = function defaultSelected(allCiSet, defaultSet, data
|
|
158
157
|
return values;
|
159
158
|
};
|
160
159
|
var typeCell = function typeCell(text) {
|
161
|
-
if (text ===
|
162
|
-
return
|
163
|
-
} else if (text ===
|
164
|
-
return
|
160
|
+
if (text === 'attribute') {
|
161
|
+
return '属性';
|
162
|
+
} else if (text === 'metric') {
|
163
|
+
return '指标';
|
165
164
|
}
|
166
|
-
return
|
165
|
+
return '-';
|
167
166
|
};
|
168
167
|
|
169
168
|
/**
|
@@ -177,9 +176,9 @@ export var columns = function columns(dataType, showCiNum) {
|
|
177
176
|
// const ciNumKey = `ci${dataTypeUp}Num`;
|
178
177
|
// const ciArrKey = `ci${dataTypeUp}Arr`;
|
179
178
|
var values = [{
|
180
|
-
width:
|
181
|
-
dataIndex:
|
182
|
-
title:
|
179
|
+
width: '100%',
|
180
|
+
dataIndex: 'name',
|
181
|
+
title: '数据',
|
183
182
|
cellOption: {
|
184
183
|
nowrap: true
|
185
184
|
}
|
@@ -211,9 +210,9 @@ export var columns = function columns(dataType, showCiNum) {
|
|
211
210
|
// },
|
212
211
|
// },
|
213
212
|
{
|
214
|
-
width:
|
215
|
-
dataIndex:
|
216
|
-
title:
|
213
|
+
width: '70px',
|
214
|
+
dataIndex: 'type',
|
215
|
+
title: '类型',
|
217
216
|
cellOption: {
|
218
217
|
nowrap: {
|
219
218
|
nowrapCell: typeCell,
|
@@ -86,7 +86,6 @@ var Setting = function Setting(_ref) {
|
|
86
86
|
};
|
87
87
|
var tableData = useMemo(function () {
|
88
88
|
var _allCiSet$ciType;
|
89
|
-
// console.log('allCiSet,ciType,search', allCiSet, ciType, search);
|
90
89
|
var list = ((_allCiSet$ciType = allCiSet[ciType]) === null || _allCiSet$ciType === void 0 ? void 0 : _allCiSet$ciType.list) || [];
|
91
90
|
if (search) {
|
92
91
|
list = list.filter(function (item) {
|
@@ -96,9 +95,8 @@ var Setting = function Setting(_ref) {
|
|
96
95
|
}
|
97
96
|
return list;
|
98
97
|
}, [allCiSet, ciType, search]);
|
99
|
-
function onSearch(
|
100
|
-
|
101
|
-
setSearch(value);
|
98
|
+
function onSearch(searchValue) {
|
99
|
+
setSearch(searchValue);
|
102
100
|
}
|
103
101
|
return /*#__PURE__*/React.createElement("div", {
|
104
102
|
className: styles.layout
|
@@ -1,6 +1,3 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import styles from "./index.module.scss";
|
3
|
-
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
4
1
|
import { loopTreeNode } from "../../utils/treeUtil";
|
5
2
|
|
6
3
|
/**
|
@@ -18,62 +15,13 @@ export var treeDs = function treeDs(allCiSet) {
|
|
18
15
|
};
|
19
16
|
});
|
20
17
|
};
|
21
|
-
|
22
|
-
// 由于属性和指标code存在重复,拼接code与类型作为id
|
23
|
-
var toId = function toId(_ref) {
|
24
|
-
var code = _ref.code,
|
25
|
-
type = _ref.type;
|
26
|
-
return type ? code + "-" + type : code;
|
27
|
-
};
|
28
|
-
|
29
|
-
// id反解析回对象
|
30
|
-
var reverseToId = function reverseToId(id) {
|
31
|
-
var _id$split = id.split("-"),
|
32
|
-
code = _id$split[0],
|
33
|
-
type = _id$split[1];
|
34
|
-
return {
|
35
|
-
code: code,
|
36
|
-
type: type
|
37
|
-
};
|
38
|
-
};
|
39
|
-
|
40
|
-
/**
|
41
|
-
* 获取默认选择项,用于重置
|
42
|
-
* @param {*} allCiSet 数据源
|
43
|
-
* @param {*} defaultSet 默认选择项数据源
|
44
|
-
* @param {*} dataType 数据类型
|
45
|
-
* @returns
|
46
|
-
*/
|
47
|
-
export var defaultSelected = function defaultSelected(allCiSet, defaultSet, dataType) {
|
48
|
-
if (defaultSet === void 0) {
|
49
|
-
defaultSet = {};
|
50
|
-
}
|
51
|
-
var values = {};
|
52
|
-
Object.keys(allCiSet).forEach(function (key) {
|
53
|
-
var ciTypeSelected = defaultSet[key] || defaultSet[allCiSet[key].code];
|
54
|
-
// 没有ci类型对应的默认配置 -> 使用通用的配置项
|
55
|
-
// const selected = (ciTypeSelected || defaultSet['common'])[dataType] || [];
|
56
|
-
var selected = [];
|
57
|
-
var selectedIds = selected.map(function (item) {
|
58
|
-
return toId(item);
|
59
|
-
});
|
60
|
-
var data = allCiSet[key].list;
|
61
|
-
var selectedData = data === null || data === void 0 ? void 0 : data.filter(function (item) {
|
62
|
-
return selectedIds.includes(item.id);
|
63
|
-
});
|
64
|
-
values[key] = selectedData.map(function (item) {
|
65
|
-
return item.id;
|
66
|
-
}) || [];
|
67
|
-
});
|
68
|
-
return values;
|
69
|
-
};
|
70
18
|
export var typeCell = function typeCell(text) {
|
71
|
-
if (text ===
|
72
|
-
return
|
73
|
-
} else if (text ===
|
74
|
-
return
|
19
|
+
if (text === 'attribute') {
|
20
|
+
return '属性';
|
21
|
+
} else if (text === 'metric') {
|
22
|
+
return '指标';
|
75
23
|
}
|
76
|
-
return
|
24
|
+
return '-';
|
77
25
|
};
|
78
26
|
|
79
27
|
/**
|
@@ -45,8 +45,8 @@ var MultipleTypeAttributeSelectDrawer = /*#__PURE__*/forwardRef(function (props,
|
|
45
45
|
});
|
46
46
|
|
47
47
|
// 保存指标设置
|
48
|
-
var save = function save(
|
49
|
-
rlog.debug('saveMarkSetting',
|
48
|
+
var save = function save(xx, parm) {
|
49
|
+
rlog.debug('saveMarkSetting', parm);
|
50
50
|
var newSelected = {};
|
51
51
|
Object.keys(parm).forEach(function (ciType) {
|
52
52
|
newSelected[ciType] = parm[ciType].map(function (id) {
|
@@ -1,11 +1,10 @@
|
|
1
|
-
import React, {
|
1
|
+
import React, { useRef, useImperativeHandle } from 'react';
|
2
2
|
import Static from "./Static";
|
3
3
|
function ResourceSelect(props, ref) {
|
4
4
|
var store = props.store,
|
5
5
|
initialData = props.initialData,
|
6
6
|
totalSelection = props.totalSelection;
|
7
|
-
var
|
8
|
-
staticRes = initialData["static"];
|
7
|
+
var staticRes = initialData["static"];
|
9
8
|
var staticRef = useRef();
|
10
9
|
useImperativeHandle(ref, function () {
|
11
10
|
return {
|
@@ -10,7 +10,6 @@ var TagSelect = function TagSelect(props) {
|
|
10
10
|
value = props.value,
|
11
11
|
defaultValue = props.defaultValue,
|
12
12
|
dataSource = props.dataSource,
|
13
|
-
size = props.size,
|
14
13
|
boxProps = props.boxProps,
|
15
14
|
tagProps = props.tagProps;
|
16
15
|
var _useState = useState(value || defaultValue),
|
@@ -50,10 +50,10 @@ function VerticalIconTab(props) {
|
|
50
50
|
return /*#__PURE__*/React.createElement(_Tab, _extends({
|
51
51
|
shape: "wrapped",
|
52
52
|
tabPosition: "left",
|
53
|
-
tabRender: function tabRender(key,
|
53
|
+
tabRender: function tabRender(key, tabProps) {
|
54
54
|
return /*#__PURE__*/React.createElement(CustomTabItem, _extends({
|
55
55
|
key: key
|
56
|
-
},
|
56
|
+
}, tabProps));
|
57
57
|
}
|
58
58
|
}, props, {
|
59
59
|
className: styles.tabs,
|
@@ -64,21 +64,8 @@
|
|
64
64
|
box-shadow: 0px 1px 0px 0px #E4E9EE;
|
65
65
|
}
|
66
66
|
|
67
|
-
.#{$css-prefix}list-header {
|
68
|
-
padding: 8px 16px 12px 16px !important;
|
69
|
-
border-bottom: none;
|
70
|
-
height: 44px;
|
71
|
-
box-shadow: 0px 1px 0px 0px #E4E9EE;
|
72
|
-
}
|
73
|
-
|
74
67
|
.#{$css-prefix}list-empty {
|
75
68
|
padding: 1px;
|
76
|
-
|
77
|
-
}
|
78
|
-
|
79
|
-
.#{$css-prefix}list-items {
|
80
|
-
// max-height: 230px;
|
81
|
-
// overflow-y: auto;
|
82
69
|
}
|
83
70
|
|
84
71
|
.#{$css-prefix}list-item {
|
@@ -19,18 +19,15 @@ import BooleanRadio from "../../../components/BooleanRadio";
|
|
19
19
|
*/
|
20
20
|
function DisplaySetting(props, ref) {
|
21
21
|
var topo = props.topo,
|
22
|
-
displaySettingProps = props.displaySettingProps
|
23
|
-
isEditor = props.isEditor;
|
22
|
+
displaySettingProps = props.displaySettingProps;
|
24
23
|
var displayConfig = topo.store.getModelState('displayConfig');
|
25
24
|
var _ref = displaySettingProps || {},
|
26
25
|
linkTagConfig = _ref.linkTagConfig,
|
27
26
|
linkTipConfig = _ref.linkTipConfig,
|
28
|
-
showEdgeExpandConfig = _ref.showEdgeExpandConfig,
|
29
27
|
extraConfig = _ref.extraConfig,
|
30
28
|
showLinkConfig = _ref.showLinkConfig,
|
31
29
|
nodeTagProps = _ref.nodeTagProps,
|
32
|
-
nodeTipProps = _ref.nodeTipProps
|
33
|
-
isNetworkTopo = _ref.isNetworkTopo;
|
30
|
+
nodeTipProps = _ref.nodeTipProps;
|
34
31
|
var field = _Field.useField({
|
35
32
|
autoUnmount: false,
|
36
33
|
values: {
|
@@ -3,6 +3,7 @@ import _Grid from "@alifd/next/es/grid";
|
|
3
3
|
import React, { useState, useEffect, useRef } from 'react';
|
4
4
|
import styles from "./HelpIcon.module.scss";
|
5
5
|
import useCanvasThemeConfig from "../../../hooks/useCanvasThemeConfig";
|
6
|
+
import classNames from 'classnames';
|
6
7
|
var Row = _Grid.Row,
|
7
8
|
Col = _Grid.Col;
|
8
9
|
function HelpIcon(props) {
|
@@ -17,6 +18,7 @@ function HelpIcon(props) {
|
|
17
18
|
}),
|
18
19
|
themeConfig = _useCanvasThemeConfig.themeConfig;
|
19
20
|
var helpIconNames = themeConfig.editor.helpIcon;
|
21
|
+
var helpIconName = themeConfig.editor.helpIconName;
|
20
22
|
var onChange = function onChange(visible, type) {
|
21
23
|
if (type != 'docClick') {
|
22
24
|
setHelpBoxIsShow(visible);
|
@@ -46,12 +48,12 @@ function HelpIcon(props) {
|
|
46
48
|
align: "t",
|
47
49
|
trigger: /*#__PURE__*/React.createElement("div", {
|
48
50
|
ref: topoViewerRef,
|
49
|
-
className: styles.topoHelpIconBtn,
|
51
|
+
className: classNames(styles.topoHelpIconBtn, styles["topoHelpIconBtn-" + helpIconNames]),
|
50
52
|
onClick: function onClick() {
|
51
53
|
open;
|
52
54
|
}
|
53
55
|
}, /*#__PURE__*/React.createElement("img", {
|
54
|
-
src: "/img/topo/editor/
|
56
|
+
src: "/img/topo/editor/bottomTool/help_icon_" + helpIconName + ".svg",
|
55
57
|
alt: ""
|
56
58
|
})),
|
57
59
|
closable: true,
|
@@ -62,7 +64,7 @@ function HelpIcon(props) {
|
|
62
64
|
}, /*#__PURE__*/React.createElement("div", {
|
63
65
|
className: styles.topoHelpIcon
|
64
66
|
}, /*#__PURE__*/React.createElement("div", {
|
65
|
-
className: styles[helpIconNames +
|
67
|
+
className: styles[helpIconNames + "Box"]
|
66
68
|
}, /*#__PURE__*/React.createElement("span", {
|
67
69
|
className: styles.title
|
68
70
|
}, "\u5FEB\u6377\u952E"), /*#__PURE__*/React.createElement("div", {
|
@@ -90,7 +90,7 @@ function getValuesByEdges(topo) {
|
|
90
90
|
return edgeValues;
|
91
91
|
}
|
92
92
|
var selectionEdges = getEdgesBySelection(topo);
|
93
|
-
var edgeValues = getEdgesValues(selectionEdges
|
93
|
+
var edgeValues = getEdgesValues(selectionEdges);
|
94
94
|
var values = {
|
95
95
|
baseAgreement: false,
|
96
96
|
lineButton: undefined,
|
@@ -6,7 +6,8 @@ var themeMap = [{
|
|
6
6
|
color: '#FFFFFF',
|
7
7
|
editor: {
|
8
8
|
// 快捷帮助
|
9
|
-
helpIcon: 'white'
|
9
|
+
helpIcon: 'white',
|
10
|
+
helpIconName: 'dark'
|
10
11
|
}
|
11
12
|
}, {
|
12
13
|
name: 'lightblue',
|
@@ -14,7 +15,8 @@ var themeMap = [{
|
|
14
15
|
color: '#F9FBFF',
|
15
16
|
editor: {
|
16
17
|
// 快捷帮助
|
17
|
-
helpIcon: 'white'
|
18
|
+
helpIcon: 'white',
|
19
|
+
helpIconName: 'dark'
|
18
20
|
}
|
19
21
|
},
|
20
22
|
// {
|
@@ -33,7 +35,8 @@ var themeMap = [{
|
|
33
35
|
color: '#031425',
|
34
36
|
editor: {
|
35
37
|
// 快捷帮助
|
36
|
-
helpIcon: 'dark'
|
38
|
+
helpIcon: 'dark',
|
39
|
+
helpIconName: 'light'
|
37
40
|
}
|
38
41
|
}, {
|
39
42
|
name: 'poly',
|
@@ -41,7 +44,8 @@ var themeMap = [{
|
|
41
44
|
backgroundImage: '/img/topo/themes/poly.png',
|
42
45
|
editor: {
|
43
46
|
// 快捷帮助
|
44
|
-
helpIcon: 'dark'
|
47
|
+
helpIcon: 'dark',
|
48
|
+
helpIconName: 'light'
|
45
49
|
}
|
46
50
|
}].reduce(function (map, item) {
|
47
51
|
var _extends2;
|