@riil-frontend/component-topology 11.0.10 → 11.0.12
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 +2 -2
- package/build/2.js +1 -1
- package/build/index.css +1 -1
- package/build/index.js +30 -30
- package/es/components/ModelAttrSelectDrawer/components/MultipleTypeAttributeSelectDrawer.js +82 -0
- package/es/components/ModelAttrSelectDrawer/index.js +2 -2
- package/es/components/VerticalIconTab/VerticalIconTab.js +1 -1
- package/es/core/components/DisplaySettingDrawer/NodeTag.js +6 -3
- package/es/core/components/DisplaySettingDrawer/NodeTip.js +7 -4
- package/es/core/components/DisplaySettingDrawer/components/NodeAttrSettingDrawer.js +40 -0
- package/es/core/components/ResourceViewAttributeSetting/nodeCiTypeAttrUtil.js +96 -10
- package/es/core/components/TopoView/topoView.js +3 -0
- package/es/core/editor/components/BottomFloatTool/HelpIcon.js +92 -3
- package/es/core/editor/components/BottomFloatTool/HelpIcon.module.scss +77 -0
- package/es/core/editor/hooks/useNewElementTheme.js +5 -1
- package/es/core/hooks/useCanvasThemeConfig.js +16 -4
- package/es/core/hooks/useTopoEdit.js +12 -8
- package/es/core/models/AttributeMetricDisplay.js +11 -63
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/cache/CiTypeCache.js +50 -39
- package/es/core/models/tagstips/ElementTagTipConfig.js +234 -95
- package/es/core/models/utils/nodeNameVisibleUtil.js +116 -0
- package/es/utils/topoData.js +10 -2
- package/lib/components/ModelAttrSelectDrawer/components/MultipleTypeAttributeSelectDrawer.js +97 -0
- package/lib/components/ModelAttrSelectDrawer/index.js +2 -2
- package/lib/components/VerticalIconTab/VerticalIconTab.js +2 -2
- package/lib/core/components/DisplaySettingDrawer/NodeTag.js +7 -3
- package/lib/core/components/DisplaySettingDrawer/NodeTip.js +8 -4
- package/lib/core/components/DisplaySettingDrawer/components/NodeAttrSettingDrawer.js +60 -0
- package/lib/core/components/ResourceViewAttributeSetting/nodeCiTypeAttrUtil.js +97 -10
- package/lib/core/components/TopoView/topoView.js +4 -0
- package/lib/core/editor/components/BottomFloatTool/HelpIcon.js +100 -3
- package/lib/core/editor/components/BottomFloatTool/HelpIcon.module.scss +77 -0
- package/lib/core/editor/hooks/useNewElementTheme.js +6 -1
- package/lib/core/hooks/useCanvasThemeConfig.js +16 -4
- package/lib/core/hooks/useTopoEdit.js +12 -8
- package/lib/core/models/AttributeMetricDisplay.js +12 -66
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/cache/CiTypeCache.js +49 -39
- package/lib/core/models/tagstips/ElementTagTipConfig.js +235 -95
- package/lib/core/models/utils/nodeNameVisibleUtil.js +128 -0
- package/lib/utils/topoData.js +11 -2
- package/package.json +2 -2
@@ -0,0 +1,82 @@
|
|
1
|
+
import React, { useState, useEffect, useRef, useImperativeHandle, forwardRef } from 'react';
|
2
|
+
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
3
|
+
import ModelAttrSelectDrawer from "./ModelAttrSelectDrawer";
|
4
|
+
|
5
|
+
function parseValue(value) {
|
6
|
+
var selected = {};
|
7
|
+
Object.keys(value).forEach(function (ciType) {
|
8
|
+
selected[ciType] = value[ciType].map(function (_ref) {
|
9
|
+
var type = _ref.type,
|
10
|
+
code = _ref.code;
|
11
|
+
return type + ":" + code;
|
12
|
+
});
|
13
|
+
});
|
14
|
+
return selected;
|
15
|
+
}
|
16
|
+
/**
|
17
|
+
* 资源显示属性、指标配置
|
18
|
+
*/
|
19
|
+
|
20
|
+
|
21
|
+
var MultipleTypeAttributeSelectDrawer = /*#__PURE__*/forwardRef(function (props, ref) {
|
22
|
+
var value = props.value,
|
23
|
+
data = props.data,
|
24
|
+
showType = props.showType,
|
25
|
+
limit = props.limit,
|
26
|
+
onChange = props.onChange,
|
27
|
+
queryData = props.queryData;
|
28
|
+
var batchAttrMetric = useRef();
|
29
|
+
|
30
|
+
var _useState = useState(parseValue((value === null || value === void 0 ? void 0 : value.data) || {})),
|
31
|
+
selected = _useState[0],
|
32
|
+
setSelected = _useState[1];
|
33
|
+
|
34
|
+
useEffect(function () {
|
35
|
+
setSelected(parseValue((value === null || value === void 0 ? void 0 : value.data) || {}));
|
36
|
+
}, [value]); // 点击选择数据,显示抽屉
|
37
|
+
|
38
|
+
var show = function show() {
|
39
|
+
queryData();
|
40
|
+
batchAttrMetric.current.show({
|
41
|
+
showType: showType
|
42
|
+
});
|
43
|
+
};
|
44
|
+
|
45
|
+
useImperativeHandle(ref, function () {
|
46
|
+
return {
|
47
|
+
show: show
|
48
|
+
};
|
49
|
+
}); // 保存指标设置
|
50
|
+
|
51
|
+
var save = function save(showType, parm) {
|
52
|
+
rlog.debug('saveMarkSetting', showType, parm);
|
53
|
+
var newSelected = {};
|
54
|
+
Object.keys(parm).forEach(function (ciType) {
|
55
|
+
newSelected[ciType] = parm[ciType].map(function (id) {
|
56
|
+
var _id$split = id.split(':'),
|
57
|
+
type = _id$split[0],
|
58
|
+
code = _id$split[1];
|
59
|
+
|
60
|
+
return {
|
61
|
+
code: code,
|
62
|
+
type: type
|
63
|
+
};
|
64
|
+
});
|
65
|
+
});
|
66
|
+
onChange({
|
67
|
+
isCustom: true,
|
68
|
+
data: newSelected
|
69
|
+
});
|
70
|
+
};
|
71
|
+
|
72
|
+
return /*#__PURE__*/React.createElement(ModelAttrSelectDrawer, {
|
73
|
+
ref: batchAttrMetric,
|
74
|
+
value: selected,
|
75
|
+
dataSource: data,
|
76
|
+
limit: limit,
|
77
|
+
showType: showType,
|
78
|
+
onOk: save
|
79
|
+
});
|
80
|
+
});
|
81
|
+
MultipleTypeAttributeSelectDrawer.displayName = 'MultipleTypeAttributeSelectDrawer';
|
82
|
+
export default MultipleTypeAttributeSelectDrawer;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import
|
2
|
-
export default
|
1
|
+
import MultipleTypeAttributeSelectDrawer from "./components/MultipleTypeAttributeSelectDrawer";
|
2
|
+
export default MultipleTypeAttributeSelectDrawer;
|
@@ -3,8 +3,8 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _Balloon from "@alifd/next/es/balloon";
|
4
4
|
import React, { useState } from 'react';
|
5
5
|
import classNames from 'classnames';
|
6
|
-
import styles from "./VerticalIconTab.module.scss";
|
7
6
|
import variables from '@alifd/theme-19926/variables.js';
|
7
|
+
import styles from "./VerticalIconTab.module.scss";
|
8
8
|
/**
|
9
9
|
* 自定义标题
|
10
10
|
* @param {*} param0
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
4
4
|
import { DEFAULT_NODE_TAG_COMMON_CONFIG } from "../../../constants/ResourceInfoDisplay";
|
5
5
|
import BasicConfig from "./ResourceDisplay/BasicConfig";
|
6
|
+
import NodeAttrSettingDrawer from "./components/NodeAttrSettingDrawer";
|
6
7
|
var defaultCommonOptions = [{
|
7
8
|
value: 'graph:name',
|
8
9
|
label: '图片名称'
|
@@ -19,15 +20,17 @@ var defaultCommonOptions = [{
|
|
19
20
|
var NodeTag = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
20
21
|
var commonOptions = props.commonOptions;
|
21
22
|
return /*#__PURE__*/React.createElement(BasicConfig, _extends({
|
22
|
-
ref: ref
|
23
|
-
}, props, {
|
23
|
+
ref: ref,
|
24
24
|
limit: 3,
|
25
25
|
elementType: "node",
|
26
26
|
showType: "tag",
|
27
27
|
commonOptions: commonOptions || defaultCommonOptions,
|
28
28
|
defaultCommonConfig: DEFAULT_NODE_TAG_COMMON_CONFIG,
|
29
|
+
customSettingDrawer: function customSettingDrawer(params) {
|
30
|
+
return /*#__PURE__*/React.createElement(NodeAttrSettingDrawer, params);
|
31
|
+
},
|
29
32
|
type: "node"
|
30
|
-
}));
|
33
|
+
}, props));
|
31
34
|
});
|
32
35
|
NodeTag.displayName = 'NodeTag';
|
33
36
|
NodeTag.propTypes = {
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
4
4
|
import { DEFAULT_TIP_COMMON_CONFIG } from "../../../constants/ResourceInfoDisplay";
|
5
5
|
import BasicConfig from "./ResourceDisplay/BasicConfig";
|
6
|
+
import NodeAttrSettingDrawer from "./components/NodeAttrSettingDrawer";
|
6
7
|
var defaultCommonOptions = [{
|
7
8
|
value: 'attribute:display_name',
|
8
9
|
label: '显示名称'
|
@@ -19,14 +20,16 @@ var defaultCommonOptions = [{
|
|
19
20
|
var NodeTip = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
20
21
|
var commonOptions = props.commonOptions;
|
21
22
|
return /*#__PURE__*/React.createElement(BasicConfig, _extends({
|
22
|
-
ref: ref
|
23
|
-
}, props, {
|
23
|
+
ref: ref,
|
24
24
|
limit: 4,
|
25
25
|
elementType: "node",
|
26
26
|
showType: "tip",
|
27
27
|
commonOptions: commonOptions || defaultCommonOptions,
|
28
|
-
defaultCommonConfig: DEFAULT_TIP_COMMON_CONFIG
|
29
|
-
|
28
|
+
defaultCommonConfig: DEFAULT_TIP_COMMON_CONFIG,
|
29
|
+
customSettingDrawer: function customSettingDrawer(params) {
|
30
|
+
return /*#__PURE__*/React.createElement(NodeAttrSettingDrawer, params);
|
31
|
+
}
|
32
|
+
}, props));
|
30
33
|
});
|
31
34
|
NodeTip.propTypes = {
|
32
35
|
commonOptions: PropTypes.array
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
3
|
+
var _excluded = ["topo", "showType", "value"];
|
4
|
+
import React, { forwardRef, useEffect, useState } from 'react';
|
5
|
+
import PropTypes from 'prop-types';
|
6
|
+
import rlog from '@riil-frontend/component-topology-utils/lib/rlog';
|
7
|
+
import ModelAttrSelectDrawer from "../../../../components/ModelAttrSelectDrawer";
|
8
|
+
import { getNodeModels } from "../../ResourceViewAttributeSetting/nodeCiTypeAttrUtil";
|
9
|
+
/**
|
10
|
+
* 节点标注、悬浮框设置
|
11
|
+
*/
|
12
|
+
|
13
|
+
var NodeAttrSettingDrawer = /*#__PURE__*/forwardRef(function (props, ref) {
|
14
|
+
var topo = props.topo,
|
15
|
+
showType = props.showType,
|
16
|
+
value = props.value,
|
17
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
18
|
+
|
19
|
+
var _useState = useState([]),
|
20
|
+
data = _useState[0],
|
21
|
+
setData = _useState[1];
|
22
|
+
|
23
|
+
var queryData = function queryData() {
|
24
|
+
rlog.info('属性配置:加载数据');
|
25
|
+
var items = getNodeModels(topo);
|
26
|
+
setData(items);
|
27
|
+
};
|
28
|
+
|
29
|
+
return /*#__PURE__*/React.createElement(ModelAttrSelectDrawer, _extends({
|
30
|
+
ref: ref
|
31
|
+
}, otherProps, {
|
32
|
+
value: value,
|
33
|
+
data: data,
|
34
|
+
showType: showType,
|
35
|
+
queryData: queryData
|
36
|
+
}));
|
37
|
+
});
|
38
|
+
NodeAttrSettingDrawer.displayName = 'NodeAttrSettingDrawer';
|
39
|
+
NodeAttrSettingDrawer.propTypes = {};
|
40
|
+
export default NodeAttrSettingDrawer;
|
@@ -1,4 +1,97 @@
|
|
1
|
-
import { getCiTypesFromCiElements } from "../../../utils/topoData";
|
1
|
+
import { getCiTypesFromCiElements } from "../../../utils/topoData";
|
2
|
+
/**
|
3
|
+
* 获取节点标注、悬浮框配置
|
4
|
+
* @param {*} topo
|
5
|
+
* @returns
|
6
|
+
*/
|
7
|
+
|
8
|
+
export function getNodeModels(topo) {
|
9
|
+
return getNodeModSet();
|
10
|
+
|
11
|
+
function getNodeModSet() {
|
12
|
+
var data = topo.store.getModelState('topoMod').data;
|
13
|
+
var ciTypes = getCiTypesFromCiElements(data.nodes);
|
14
|
+
return getMods(ciTypes);
|
15
|
+
}
|
16
|
+
/**
|
17
|
+
*
|
18
|
+
* @param {array} ciTypeCodes
|
19
|
+
* @returns
|
20
|
+
*/
|
21
|
+
|
22
|
+
|
23
|
+
function getMods(ciTypeCodes) {
|
24
|
+
var ciTypeMap = topo.ciTyeCache.ciTypes;
|
25
|
+
return Object.keys(ciTypeMap).filter(function (item) {
|
26
|
+
return ciTypeCodes.includes(item);
|
27
|
+
}).map(function (key) {
|
28
|
+
var ciTypeObj = ciTypeMap[key];
|
29
|
+
return {
|
30
|
+
id: ciTypeObj.code,
|
31
|
+
label: ciTypeObj.displayName,
|
32
|
+
icon: "/img/model/" + ciTypeObj.icon + ".svg",
|
33
|
+
list: buildModelFields(ciTypeObj, 'node')
|
34
|
+
};
|
35
|
+
});
|
36
|
+
}
|
37
|
+
|
38
|
+
function buildModels(ciTypeObj) {
|
39
|
+
return {
|
40
|
+
id: ciTypeObj.code,
|
41
|
+
label: ciTypeObj.displayName,
|
42
|
+
icon: "/img/model/" + ciTypeObj.icon + ".svg",
|
43
|
+
list: buildModelFields(ciTypeObj, 'node')
|
44
|
+
};
|
45
|
+
}
|
46
|
+
/**
|
47
|
+
* 过滤ci元数据中的属性和指标,用于属性和指标显示设置
|
48
|
+
* @param {} ciTypeObj
|
49
|
+
* @returns
|
50
|
+
*/
|
51
|
+
|
52
|
+
|
53
|
+
function buildModelFields(ciTypeObj, type) {
|
54
|
+
var custom = [];
|
55
|
+
|
56
|
+
if (type === 'node') {
|
57
|
+
custom.push.apply(custom, [{
|
58
|
+
id: 'graph:name',
|
59
|
+
code: 'name',
|
60
|
+
name: '图片名称',
|
61
|
+
type: 'custom'
|
62
|
+
}, {
|
63
|
+
id: 'ciType:display_name',
|
64
|
+
code: 'ciType',
|
65
|
+
name: '资源类型',
|
66
|
+
type: 'custom'
|
67
|
+
}]);
|
68
|
+
}
|
69
|
+
|
70
|
+
var attributes = ciTypeObj.attributes.filter(function (attr) {
|
71
|
+
return !!attr.userVisible;
|
72
|
+
}).map(function (item) {
|
73
|
+
return {
|
74
|
+
type: 'attribute',
|
75
|
+
id: "attribute:" + item.code,
|
76
|
+
code: "attribute:" + item.code,
|
77
|
+
name: item.name,
|
78
|
+
typeName: '属性'
|
79
|
+
};
|
80
|
+
});
|
81
|
+
var metrics = ciTypeObj.metrics.map(function (item) {
|
82
|
+
return {
|
83
|
+
type: 'metric',
|
84
|
+
id: "metric:" + item.code,
|
85
|
+
code: "metric:" + item.code,
|
86
|
+
name: item.name,
|
87
|
+
typeName: '指标'
|
88
|
+
};
|
89
|
+
});
|
90
|
+
return [].concat(custom, attributes, metrics);
|
91
|
+
}
|
92
|
+
|
93
|
+
;
|
94
|
+
} // 资源类型含有属性和指标集合
|
2
95
|
|
3
96
|
export function getNodeCiModSet(params) {
|
4
97
|
var topo = params.topo;
|
@@ -29,8 +122,7 @@ export function getNodeCiModSet(params) {
|
|
29
122
|
icon: ciTypeObj.icon,
|
30
123
|
list: ciModfilter(ciTypeObj, globalConfig, 'node', ciTypeObj.code)
|
31
124
|
};
|
32
|
-
});
|
33
|
-
|
125
|
+
});
|
34
126
|
return modSet;
|
35
127
|
}
|
36
128
|
/**
|
@@ -60,13 +152,7 @@ export function getNodeCiModSet(params) {
|
|
60
152
|
(_tags$data$code = tags.data[code]) === null || _tags$data$code === void 0 ? void 0 : _tags$data$code.map(function (item) {
|
61
153
|
tagArr.push(item.code + "-" + item.type);
|
62
154
|
});
|
63
|
-
}
|
64
|
-
// "过滤ci元数据中的属性和指标,用于属性和指标显示设置",
|
65
|
-
// globalSetting,
|
66
|
-
// tipArr,
|
67
|
-
// tagArr
|
68
|
-
// );
|
69
|
-
|
155
|
+
}
|
70
156
|
|
71
157
|
var custom = [];
|
72
158
|
|
@@ -27,6 +27,7 @@ import HistoryManager from "../../models/HistoryManager";
|
|
27
27
|
import editorStyles from "./editor.module.scss";
|
28
28
|
import basicIcons from "../../common/icons/basicIcons";
|
29
29
|
import HelpIcon from "../../editor/components/BottomFloatTool/HelpIcon";
|
30
|
+
import { updateNodesNameVisible } from "../../models/utils/nodeNameVisibleUtil";
|
30
31
|
|
31
32
|
var Topology = function Topology(props) {
|
32
33
|
var _classnames;
|
@@ -120,6 +121,7 @@ var Topology = function Topology(props) {
|
|
120
121
|
topoData: topoData,
|
121
122
|
htElements: topo.getDataModel().getDatas().toArray()
|
122
123
|
});
|
124
|
+
updateNodesNameVisible(topo);
|
123
125
|
upgradeV103GraphClusterNode(topo, topoData);
|
124
126
|
fixLink(topo);
|
125
127
|
handleClusterNoPermission(topo);
|
@@ -145,6 +147,7 @@ var Topology = function Topology(props) {
|
|
145
147
|
topoData: topoData,
|
146
148
|
htElements: topo.getDataModel().getDatas().toArray()
|
147
149
|
});
|
150
|
+
updateNodesNameVisible(topo);
|
148
151
|
upgradeV103GraphClusterNode(topo, topoData);
|
149
152
|
fixLink(topo);
|
150
153
|
handleClusterNoPermission(topo);
|
@@ -1,8 +1,97 @@
|
|
1
|
-
import
|
1
|
+
import _Balloon from "@alifd/next/es/balloon";
|
2
|
+
import _Grid from "@alifd/next/es/grid";
|
3
|
+
import React, { useState, useEffect } from 'react';
|
4
|
+
import styles from "./HelpIcon.module.scss";
|
5
|
+
import useCanvasThemeConfig from "../../../hooks/useCanvasThemeConfig";
|
2
6
|
|
3
7
|
function HelpIcon(props) {
|
4
|
-
var topo = props.topo
|
5
|
-
|
8
|
+
var topo = props.topo,
|
9
|
+
topoType = props.topoType;
|
10
|
+
var localStorageVal = localStorage.getItem(topoType + 'helpBoxHidden');
|
11
|
+
|
12
|
+
var _useState = useState(),
|
13
|
+
helpBoxIsShow = _useState[0],
|
14
|
+
setHelpBoxIsShow = _useState[1]; //TODO:在主得style里面需要增加color与background属性,根据外部传值进行改变,默认值为$color-text1-4,#fff
|
15
|
+
|
16
|
+
|
17
|
+
var Row = _Grid.Row,
|
18
|
+
Col = _Grid.Col;
|
19
|
+
|
20
|
+
var _useCanvasThemeConfig = useCanvasThemeConfig({
|
21
|
+
topo: topo
|
22
|
+
}),
|
23
|
+
themeConfig = _useCanvasThemeConfig.themeConfig;
|
24
|
+
|
25
|
+
var helpIconNames = themeConfig.editor.helpIcon;
|
26
|
+
|
27
|
+
var onChange = function onChange(visible, type) {
|
28
|
+
if (type != 'docClick') {
|
29
|
+
setHelpBoxIsShow(visible);
|
30
|
+
localStorage.setItem(topoType + 'helpBoxHidden', !visible);
|
31
|
+
}
|
32
|
+
};
|
33
|
+
|
34
|
+
var topoModState = topo.store.useModelState('topoMod');
|
35
|
+
var graphLoaded = topoModState.graphLoaded;
|
36
|
+
useEffect(function () {
|
37
|
+
if (graphLoaded) {
|
38
|
+
setHelpBoxIsShow(localStorageVal == 'true' ? false : true);
|
39
|
+
}
|
40
|
+
}, [topo, graphLoaded]);
|
41
|
+
return /*#__PURE__*/React.createElement(_Balloon, {
|
42
|
+
triggerType: "click",
|
43
|
+
align: "t",
|
44
|
+
trigger: /*#__PURE__*/React.createElement("div", {
|
45
|
+
className: styles.topoHelpIconBtn,
|
46
|
+
onClick: function onClick() {
|
47
|
+
open;
|
48
|
+
}
|
49
|
+
}, /*#__PURE__*/React.createElement("img", {
|
50
|
+
src: "/img/topo/editor/bottomFloatTool/default.svg",
|
51
|
+
alt: ""
|
52
|
+
})),
|
53
|
+
closable: true,
|
54
|
+
visible: helpBoxIsShow,
|
55
|
+
onVisibleChange: onChange,
|
56
|
+
shouldUpdatePosition: true,
|
57
|
+
id: helpIconNames
|
58
|
+
}, /*#__PURE__*/React.createElement("div", {
|
59
|
+
className: styles.topoHelpIcon
|
60
|
+
}, /*#__PURE__*/React.createElement("div", {
|
61
|
+
className: styles[helpIconNames + 'Box']
|
62
|
+
}, /*#__PURE__*/React.createElement("span", {
|
63
|
+
className: styles.title
|
64
|
+
}, "\u5FEB\u6377\u952E"), /*#__PURE__*/React.createElement("div", {
|
65
|
+
className: styles.conten
|
66
|
+
}, /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(Col, {
|
67
|
+
span: "16"
|
68
|
+
}, "\u590D\u5236"), /*#__PURE__*/React.createElement(Col, {
|
69
|
+
span: "8"
|
70
|
+
}, "ctrl/\u2318+c")), /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(Col, {
|
71
|
+
span: "16"
|
72
|
+
}, "\u7C98\u8D34"), /*#__PURE__*/React.createElement(Col, {
|
73
|
+
span: "8"
|
74
|
+
}, "ctrl/\u2318+v")), /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(Col, {
|
75
|
+
span: "16"
|
76
|
+
}, "\u64A4\u9500"), /*#__PURE__*/React.createElement(Col, {
|
77
|
+
span: "8"
|
78
|
+
}, "ctrl/\u2318+z")), /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(Col, {
|
79
|
+
span: "16"
|
80
|
+
}, "\u6062\u590D"), /*#__PURE__*/React.createElement(Col, {
|
81
|
+
span: "8"
|
82
|
+
}, "ctrl/\u2318+y")), /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(Col, {
|
83
|
+
span: "16"
|
84
|
+
}, "\u6587\u5B57\u52A0\u7C97"), /*#__PURE__*/React.createElement(Col, {
|
85
|
+
span: "8"
|
86
|
+
}, "ctrl/\u2318+b")), /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(Col, {
|
87
|
+
span: "16"
|
88
|
+
}, "\u9009\u62E9-\u62D6\u52A8"), /*#__PURE__*/React.createElement(Col, {
|
89
|
+
span: "8"
|
90
|
+
}, "\u7A7A\u683C")), /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(Col, {
|
91
|
+
span: "16"
|
92
|
+
}, "\u9000\u51FA\u94FE\u8DEF/\u7EBF\u7ED8\u5236"), /*#__PURE__*/React.createElement(Col, {
|
93
|
+
span: "8"
|
94
|
+
}, "\u9F20\u6807\u53F3\u952E"))))));
|
6
95
|
}
|
7
96
|
|
8
97
|
export default HelpIcon;
|
@@ -0,0 +1,77 @@
|
|
1
|
+
.topoHelpIconBtn{
|
2
|
+
width: '100%';
|
3
|
+
height: '100%';
|
4
|
+
margin: 0;
|
5
|
+
padding: 0;
|
6
|
+
border: 0;
|
7
|
+
cursor: pointer;
|
8
|
+
margin-top: -1px;
|
9
|
+
margin-left: -1px;
|
10
|
+
}
|
11
|
+
:global{
|
12
|
+
#white.next-overlay-inner{
|
13
|
+
padding: 10px;
|
14
|
+
.next-balloon-close{
|
15
|
+
right: 10px;
|
16
|
+
top:8px
|
17
|
+
}
|
18
|
+
}
|
19
|
+
#dark.next-overlay-inner{
|
20
|
+
padding: 10px;
|
21
|
+
background-color: #063658;
|
22
|
+
border-color: #08A5F4;
|
23
|
+
.next-balloon-close{
|
24
|
+
right: 10px;
|
25
|
+
/* color:$color-text1-5; */
|
26
|
+
color:#fff;
|
27
|
+
top:8px
|
28
|
+
}
|
29
|
+
}
|
30
|
+
#dark.next-overlay-inner:after{
|
31
|
+
border-color: #08A5F4;
|
32
|
+
background: #063658;
|
33
|
+
}
|
34
|
+
}
|
35
|
+
.topoHelpIcon{
|
36
|
+
width: 187px;
|
37
|
+
.whiteBox,.darkBox{
|
38
|
+
color:$color-text1-4;
|
39
|
+
font-size: 12px;
|
40
|
+
font-family: PingFangSC-Medium, PingFang SC;
|
41
|
+
width: 187px;
|
42
|
+
background: #FFFFFF;
|
43
|
+
.title{
|
44
|
+
line-height: 15px;
|
45
|
+
font-weight: 500;
|
46
|
+
}
|
47
|
+
.colse{
|
48
|
+
float: right;
|
49
|
+
cursor: pointer;
|
50
|
+
}
|
51
|
+
.conten{
|
52
|
+
color:$color-text1-6;
|
53
|
+
font-weight: 400;
|
54
|
+
line-height: 20px;
|
55
|
+
margin-top: 8px;
|
56
|
+
:global{
|
57
|
+
.next-row{
|
58
|
+
margin: 4px 0;
|
59
|
+
}
|
60
|
+
.next-col-8{
|
61
|
+
text-align: right;
|
62
|
+
color:$color-text1-4;
|
63
|
+
}
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
}
|
68
|
+
.darkBox{
|
69
|
+
background: #063658;
|
70
|
+
color:$color-text1-5;
|
71
|
+
opacity: 0.85;
|
72
|
+
.conten{
|
73
|
+
color:$color-text1-5;
|
74
|
+
opacity: 0.85;
|
75
|
+
}
|
76
|
+
}
|
77
|
+
}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { useEffect } from 'react';
|
2
2
|
import THEMES from "../config/themes";
|
3
3
|
import ThemeUtil from "../utils/themeUtil";
|
4
|
+
import { setNewNodeNameVisible } from "../../models/utils/nodeNameVisibleUtil";
|
4
5
|
|
5
6
|
function useNewElementTheme(props) {
|
6
7
|
var topo = props.topo;
|
@@ -20,6 +21,7 @@ function useNewElementTheme(props) {
|
|
20
21
|
data = e.data;
|
21
22
|
|
22
23
|
if (kind === 'add') {
|
24
|
+
// 设置主题样式
|
23
25
|
var displayConfig = topo.store.getModelState('displayConfig');
|
24
26
|
var theme = displayConfig.canvasTheme || 'white';
|
25
27
|
var themeConfig = THEMES.find(function (item) {
|
@@ -31,7 +33,9 @@ function useNewElementTheme(props) {
|
|
31
33
|
}),
|
32
34
|
setElementTheme = _ThemeUtil.setElementTheme;
|
33
35
|
|
34
|
-
setElementTheme(data, themeConfig);
|
36
|
+
setElementTheme(data, themeConfig); // 临时放这里,新加入节点按配置显示隐藏名称
|
37
|
+
|
38
|
+
setNewNodeNameVisible(topo, data);
|
35
39
|
}
|
36
40
|
}
|
37
41
|
|
@@ -6,12 +6,16 @@ var themeMap = [{
|
|
6
6
|
color: '#FFFFFF',
|
7
7
|
editor: {
|
8
8
|
// 快捷帮助
|
9
|
-
helpIcon:
|
9
|
+
helpIcon: 'white'
|
10
10
|
}
|
11
11
|
}, {
|
12
12
|
name: 'lightblue',
|
13
13
|
label: '蓝色',
|
14
|
-
color: '#F9FBFF'
|
14
|
+
color: '#F9FBFF',
|
15
|
+
editor: {
|
16
|
+
// 快捷帮助
|
17
|
+
helpIcon: 'white'
|
18
|
+
}
|
15
19
|
}, // {
|
16
20
|
// name: 'yellow',
|
17
21
|
// label: '黄色',
|
@@ -25,11 +29,19 @@ var themeMap = [{
|
|
25
29
|
{
|
26
30
|
name: 'dark',
|
27
31
|
label: '深色',
|
28
|
-
color: '#031425'
|
32
|
+
color: '#031425',
|
33
|
+
editor: {
|
34
|
+
// 快捷帮助
|
35
|
+
helpIcon: 'dark'
|
36
|
+
}
|
29
37
|
}, {
|
30
38
|
name: 'poly',
|
31
39
|
label: 'Poly',
|
32
|
-
backgroundImage: '/img/topo/themes/poly.png'
|
40
|
+
backgroundImage: '/img/topo/themes/poly.png',
|
41
|
+
editor: {
|
42
|
+
// 快捷帮助
|
43
|
+
helpIcon: 'dark'
|
44
|
+
}
|
33
45
|
}].reduce(function (map, item) {
|
34
46
|
var _extends2;
|
35
47
|
|
@@ -234,7 +234,8 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
234
234
|
content: "是否仅删除区域或将区域包含的内容一同删除?",
|
235
235
|
//footer:()=>{return <><Button type="primary" onClick={doDeleteOnlyGroup}>仅删除区域</Button><Button type="primary" onClick={doDeleteOnlyGroup}>确定</Button></>},
|
236
236
|
okProps: {
|
237
|
-
children: "仅删除区域"
|
237
|
+
children: "仅删除区域",
|
238
|
+
type: "normal"
|
238
239
|
},
|
239
240
|
cancelProps: {
|
240
241
|
children: "全部删除"
|
@@ -289,27 +290,30 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
289
290
|
});
|
290
291
|
|
291
292
|
function doDeleteOnlyGroup() {
|
292
|
-
// console.log("仅删除区域", topo.view.topoClient, data);
|
293
|
+
topo.historyManager.beginTransaction(); // console.log("仅删除区域", topo.view.topoClient, data);
|
294
|
+
|
293
295
|
var children = getGroupChildren(group);
|
294
296
|
children.map(function (child) {
|
295
|
-
child.setParent(null);
|
296
|
-
var
|
297
|
-
|
298
|
-
|
297
|
+
child.setParent(null); // var viewRect = topo.getGraphView().getViewRect();
|
298
|
+
// var nodeRect = child.getRect();
|
299
|
+
// child.setPosition(
|
300
|
+
// viewRect.x + nodeRect.width + 2,
|
301
|
+
// viewRect.y + nodeRect.height + 4
|
302
|
+
// ); // 解决集群从区域内移出时,连线位置未更新的问题
|
299
303
|
|
300
304
|
setTimeout(function () {
|
301
305
|
child.iv();
|
302
306
|
topo.historyManager.endTransaction();
|
303
307
|
}, 50);
|
304
308
|
});
|
305
|
-
topo.view.topoClient.deleteGroup(data);
|
309
|
+
topo.view.topoClient.deleteGroup(data);
|
310
|
+
topo.historyManager.endTransaction(); // console.log("仅删除区域", children, group);
|
306
311
|
}
|
307
312
|
|
308
313
|
function doDelete() {
|
309
314
|
topo.historyManager.beginTransaction(); // FIXME 。如果命中其他的动态条件,则立即显示
|
310
315
|
|
311
316
|
topo.view.topoClient.deleteGroup(data);
|
312
|
-
topo.historyManager.endTransaction();
|
313
317
|
}
|
314
318
|
};
|
315
319
|
|