@riil-frontend/component-topology 6.0.6 → 6.0.8

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.
@@ -9,14 +9,15 @@ export default function GraphViewPanel(props) {
9
9
 
10
10
  var _useCanvasTheme = useCanvasTheme({
11
11
  topo: topo,
12
- themeName: themeName
12
+ themeName: themeName,
13
+ hideBackgroundColor: hideBackgroundColor
13
14
  }),
14
15
  canvasColor = _useCanvasTheme.canvasColor;
15
16
 
16
17
  return /*#__PURE__*/React.createElement("div", {
17
18
  className: styles.viewPanel,
18
19
  style: {
19
- background: hideBackgroundColor ? null : canvasColor
20
+ background: canvasColor
20
21
  }
21
22
  }, props.children);
22
23
  }
@@ -6,9 +6,10 @@ import { formatBackgroundRgbaColor, parseBackground, parseColor } from "../color
6
6
  export function getTextStyle(element) {
7
7
  var underline = null;
8
8
  return _extends({
9
- color: parseColor(element.a('link_ind_left_color')),
9
+ color: parseColor(element.a('edge.tag.color')),
10
+ fontFamily: element.a('edge.tag.fontFamily') || '微软雅黑',
10
11
  underline: underline
11
- }, fontStyleUtil.toMap(element.a('link_ind_left_font')), parseBackground(element.a('link_ind_background')));
12
+ }, parseBackground(element.a('edge.tag.background')));
12
13
  }
13
14
  export function setTextStyle(element, style, topo) {
14
15
  var _fontStyleUtil$remove = fontStyleUtil.removeBoldItalic(style),
@@ -64,7 +64,7 @@ export function setTextStyle(element, style) {
64
64
  */
65
65
 
66
66
  export function getEnabledFields(element) {
67
- return ['fontFamily', 'fontSize', 'bold', 'italic', 'color', 'background', 'opacity'];
67
+ return ['fontFamily', 'fontSize', 'color', 'background', 'opacity'];
68
68
  }
69
69
  export default {
70
70
  getTextStyle: getTextStyle,
@@ -7,9 +7,9 @@ var baseLightTheme = {
7
7
  },
8
8
  globalEdgeTagStyle: {
9
9
  color: '#777B9A',
10
- background: '#FFFFFF',
10
+ background: 'rgba(255, 255, 255, 1)',
11
11
  // 背景色,不传使用默认内置 @V1.2
12
- borderColor: '#CBCBCB' // 边框颜色,不传使用默认内置。用于主题切换 @V1.2
12
+ borderColor: '#B5BDC7' // 边框颜色,不传使用默认内置。用于主题切换 @V1.2
13
13
 
14
14
  },
15
15
  text: {
@@ -17,8 +17,8 @@ var baseLightTheme = {
17
17
  },
18
18
  group: {
19
19
  style: {
20
- 'group.title.background': '#E4E9EE',
21
- // 标题背景颜色
20
+ 'group.title.background': 'rgba(228, 233, 238, 1)',
21
+ // 标题背景颜色 #E4E9EE
22
22
  'group.title.color': '#4D6277',
23
23
  // 标题文字颜色
24
24
  'group.background': 'rgba(255, 255, 255, 0.9)',
@@ -69,8 +69,8 @@ var THEMES = [_extends({}, baseLightTheme, {
69
69
  },
70
70
  globalEdgeTagStyle: {
71
71
  color: '#E4E9EE',
72
- background: '#063658',
73
- // 背景色,不传使用默认内置 @V1.2
72
+ background: 'rgba(6, 54, 88, 1)',
73
+ // 背景色,不传使用默认内置 @V1.2 index.js:1 #063658
74
74
  borderColor: '#08A5F4' // 边框颜色,不传使用默认内置。用于主题切换 @V1.2
75
75
 
76
76
  },
@@ -30,15 +30,16 @@ var themeMap = [{
30
30
  }, {});
31
31
  export default function useCanvasTheme(props) {
32
32
  var topo = props.topo,
33
- themeName = props.themeName; // 拓扑图是否加载
33
+ themeName = props.themeName,
34
+ hideBackgroundColor = props.hideBackgroundColor; // 拓扑图是否加载
34
35
 
35
36
  var _topo$store$useModelS = topo.store.useModelState('topoMod'),
36
37
  graphLoaded = _topo$store$useModelS.graphLoaded;
37
38
 
39
+ var themeConfig = themeMap[themeName || 'white'];
40
+ var canvasColor = hideBackgroundColor ? null : themeConfig.color;
38
41
  useEffect(function () {
39
42
  // 设置
40
- var themeConfig = themeMap[themeName || 'white'];
41
-
42
43
  if (graphLoaded && themeConfig) {
43
44
  try {
44
45
  topo.getHtTopo().setTheme(themeName);
@@ -47,8 +48,18 @@ export default function useCanvasTheme(props) {
47
48
  console.error('切换主题失败', error);
48
49
  }
49
50
  }
50
- }, [themeName, graphLoaded]);
51
+ }, [graphLoaded, themeName]);
52
+ useEffect(function () {
53
+ // 设置
54
+ if (graphLoaded) {
55
+ try {
56
+ topo.getHtTopo().getGraphView().dm().setBackground(canvasColor);
57
+ } catch (error) {
58
+ console.error('切换主题失败', error);
59
+ }
60
+ }
61
+ }, [graphLoaded, canvasColor]);
51
62
  return {
52
- canvasColor: themeMap[themeName].color
63
+ canvasColor: canvasColor
53
64
  };
54
65
  }
@@ -76,7 +76,7 @@ export default function useGraphAlarmDisplay(options) {
76
76
  });
77
77
 
78
78
  function showAlarm() {
79
- if (!graphLoaded || isEditMode) {
79
+ if (!graphLoaded) {
80
80
  return;
81
81
  }
82
82
 
@@ -129,5 +129,5 @@ export default function useGraphAlarmDisplay(options) {
129
129
  resources: resources
130
130
  });
131
131
  };
132
- }, [isEditMode, graphLoaded, resources, alarmSwitch, alarmList, risks, relateTopoAlarm]);
132
+ }, [graphLoaded, resources, alarmSwitch, alarmList, risks, relateTopoAlarm]);
133
133
  }
@@ -23,7 +23,7 @@ import topoFactory from "./topoFactory";
23
23
  import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
24
24
  import SelectionModel from "./SelectionModel"; // eslint-disable-next-line no-undef
25
25
 
26
- var version = typeof "6.0.6" === 'string' ? "6.0.6" : null;
26
+ var version = typeof "6.0.8" === 'string' ? "6.0.8" : null;
27
27
  console.info("\u62D3\u6251\u7248\u672C: " + version);
28
28
  /**
29
29
  * 拓扑显示和编辑
@@ -3,7 +3,6 @@ import { setElementRuntimeStyle } from "../../utils/htElementUtils";
3
3
  export function showManageStatus(options) {
4
4
  var topo = options.topo,
5
5
  resources = options.resources,
6
- isEditMode = options.isEditMode,
7
6
  graphLoaded = options.graphLoaded,
8
7
  cisEventLevel = options.cisEventLevel;
9
8
 
@@ -14,7 +13,7 @@ export function showManageStatus(options) {
14
13
  }; // 首次加载和监控状态变化后,更新节点和连线置灰状态
15
14
 
16
15
 
17
- if (!isEditMode && graphLoaded) {
16
+ if (graphLoaded) {
18
17
  resources.forEach(function (resource) {
19
18
  var type = resource.type,
20
19
  id = resource.id,
@@ -19,14 +19,15 @@ function GraphViewPanel(props) {
19
19
 
20
20
  var _useCanvasTheme = (0, _useCanvasTheme2["default"])({
21
21
  topo: topo,
22
- themeName: themeName
22
+ themeName: themeName,
23
+ hideBackgroundColor: hideBackgroundColor
23
24
  }),
24
25
  canvasColor = _useCanvasTheme.canvasColor;
25
26
 
26
27
  return /*#__PURE__*/_react["default"].createElement("div", {
27
28
  className: _TopoViewModule["default"].viewPanel,
28
29
  style: {
29
- background: hideBackgroundColor ? null : canvasColor
30
+ background: canvasColor
30
31
  }
31
32
  }, props.children);
32
33
  }
@@ -22,9 +22,10 @@ var _excluded = ["color", "background", "opacity", "bold", "italic"];
22
22
  function getTextStyle(element) {
23
23
  var underline = null;
24
24
  return (0, _extends2["default"])({
25
- color: (0, _colorUtil.parseColor)(element.a('link_ind_left_color')),
25
+ color: (0, _colorUtil.parseColor)(element.a('edge.tag.color')),
26
+ fontFamily: element.a('edge.tag.fontFamily') || '微软雅黑',
26
27
  underline: underline
27
- }, _fontStyleUtil["default"].toMap(element.a('link_ind_left_font')), (0, _colorUtil.parseBackground)(element.a('link_ind_background')));
28
+ }, (0, _colorUtil.parseBackground)(element.a('edge.tag.background')));
28
29
  }
29
30
 
30
31
  function setTextStyle(element, style, topo) {
@@ -79,7 +79,7 @@ function setTextStyle(element, style) {
79
79
 
80
80
 
81
81
  function getEnabledFields(element) {
82
- return ['fontFamily', 'fontSize', 'bold', 'italic', 'color', 'background', 'opacity'];
82
+ return ['fontFamily', 'fontSize', 'color', 'background', 'opacity'];
83
83
  }
84
84
 
85
85
  var _default = {
@@ -15,9 +15,9 @@ var baseLightTheme = {
15
15
  },
16
16
  globalEdgeTagStyle: {
17
17
  color: '#777B9A',
18
- background: '#FFFFFF',
18
+ background: 'rgba(255, 255, 255, 1)',
19
19
  // 背景色,不传使用默认内置 @V1.2
20
- borderColor: '#CBCBCB' // 边框颜色,不传使用默认内置。用于主题切换 @V1.2
20
+ borderColor: '#B5BDC7' // 边框颜色,不传使用默认内置。用于主题切换 @V1.2
21
21
 
22
22
  },
23
23
  text: {
@@ -25,8 +25,8 @@ var baseLightTheme = {
25
25
  },
26
26
  group: {
27
27
  style: {
28
- 'group.title.background': '#E4E9EE',
29
- // 标题背景颜色
28
+ 'group.title.background': 'rgba(228, 233, 238, 1)',
29
+ // 标题背景颜色 #E4E9EE
30
30
  'group.title.color': '#4D6277',
31
31
  // 标题文字颜色
32
32
  'group.background': 'rgba(255, 255, 255, 0.9)',
@@ -77,8 +77,8 @@ var THEMES = [(0, _extends2["default"])({}, baseLightTheme, {
77
77
  },
78
78
  globalEdgeTagStyle: {
79
79
  color: '#E4E9EE',
80
- background: '#063658',
81
- // 背景色,不传使用默认内置 @V1.2
80
+ background: 'rgba(6, 54, 88, 1)',
81
+ // 背景色,不传使用默认内置 @V1.2 index.js:1 #063658
82
82
  borderColor: '#08A5F4' // 边框颜色,不传使用默认内置。用于主题切换 @V1.2
83
83
 
84
84
  },
@@ -44,15 +44,16 @@ var themeMap = [{
44
44
 
45
45
  function useCanvasTheme(props) {
46
46
  var topo = props.topo,
47
- themeName = props.themeName; // 拓扑图是否加载
47
+ themeName = props.themeName,
48
+ hideBackgroundColor = props.hideBackgroundColor; // 拓扑图是否加载
48
49
 
49
50
  var _topo$store$useModelS = topo.store.useModelState('topoMod'),
50
51
  graphLoaded = _topo$store$useModelS.graphLoaded;
51
52
 
53
+ var themeConfig = themeMap[themeName || 'white'];
54
+ var canvasColor = hideBackgroundColor ? null : themeConfig.color;
52
55
  (0, _react.useEffect)(function () {
53
56
  // 设置
54
- var themeConfig = themeMap[themeName || 'white'];
55
-
56
57
  if (graphLoaded && themeConfig) {
57
58
  try {
58
59
  topo.getHtTopo().setTheme(themeName);
@@ -61,8 +62,18 @@ function useCanvasTheme(props) {
61
62
  console.error('切换主题失败', error);
62
63
  }
63
64
  }
64
- }, [themeName, graphLoaded]);
65
+ }, [graphLoaded, themeName]);
66
+ (0, _react.useEffect)(function () {
67
+ // 设置
68
+ if (graphLoaded) {
69
+ try {
70
+ topo.getHtTopo().getGraphView().dm().setBackground(canvasColor);
71
+ } catch (error) {
72
+ console.error('切换主题失败', error);
73
+ }
74
+ }
75
+ }, [graphLoaded, canvasColor]);
65
76
  return {
66
- canvasColor: themeMap[themeName].color
77
+ canvasColor: canvasColor
67
78
  };
68
79
  }
@@ -86,7 +86,7 @@ function useGraphAlarmDisplay(options) {
86
86
  });
87
87
 
88
88
  function showAlarm() {
89
- if (!graphLoaded || isEditMode) {
89
+ if (!graphLoaded) {
90
90
  return;
91
91
  }
92
92
 
@@ -141,5 +141,5 @@ function useGraphAlarmDisplay(options) {
141
141
  resources: resources
142
142
  });
143
143
  };
144
- }, [isEditMode, graphLoaded, resources, alarmSwitch, alarmList, risks, relateTopoAlarm]);
144
+ }, [graphLoaded, resources, alarmSwitch, alarmList, risks, relateTopoAlarm]);
145
145
  }
@@ -54,7 +54,7 @@ var _ElementTagTipConfig = _interopRequireDefault(require("./tagstips/ElementTag
54
54
  var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
55
55
 
56
56
  // eslint-disable-next-line no-undef
57
- var version = typeof "6.0.6" === 'string' ? "6.0.6" : null;
57
+ var version = typeof "6.0.8" === 'string' ? "6.0.8" : null;
58
58
  console.info("\u62D3\u6251\u7248\u672C: " + version);
59
59
  /**
60
60
  * 拓扑显示和编辑
@@ -13,7 +13,6 @@ var _htElementUtils = require("../../utils/htElementUtils");
13
13
  function showManageStatus(options) {
14
14
  var topo = options.topo,
15
15
  resources = options.resources,
16
- isEditMode = options.isEditMode,
17
16
  graphLoaded = options.graphLoaded,
18
17
  cisEventLevel = options.cisEventLevel;
19
18
 
@@ -24,7 +23,7 @@ function showManageStatus(options) {
24
23
  }; // 首次加载和监控状态变化后,更新节点和连线置灰状态
25
24
 
26
25
 
27
- if (!isEditMode && graphLoaded) {
26
+ if (graphLoaded) {
28
27
  resources.forEach(function (resource) {
29
28
  var type = resource.type,
30
29
  id = resource.id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riil-frontend/component-topology",
3
- "version": "6.0.6",
3
+ "version": "6.0.8",
4
4
  "description": "拓扑",
5
5
  "scripts": {
6
6
  "start": "build-scripts start",
@@ -116,6 +116,6 @@
116
116
  "access": "public"
117
117
  },
118
118
  "license": "MIT",
119
- "homepage": "https://unpkg.com/@riil-frontend/component-topology@6.0.6/build/index.html",
119
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@6.0.8/build/index.html",
120
120
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
121
121
  }