@riil-frontend/component-topology 6.0.5 → 6.0.7

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.
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
3
- var _excluded = ["topo", "showLabel"];
3
+ var _excluded = ["topo", "showLabel", "editorProps"];
4
4
  import React, { useEffect, useMemo, useState } from 'react';
5
5
  import { getEdgesBySelection, setEdgesAndChildren, setEdgesType } from "../../../../utils/edgeTypeStyleUtil";
6
6
  import DropdownButton from "../components/DropdownButton";
@@ -16,24 +16,29 @@ import EdgeType from "./EdgeType";
16
16
  function EdgeTypeButton(props) {
17
17
  var topo = props.topo,
18
18
  showLabel = props.showLabel,
19
+ editorProps = props.editorProps,
19
20
  otherProps = _objectWithoutPropertiesLoose(props, _excluded);
20
21
 
21
22
  var _useState = useState(true),
22
23
  disabled = _useState[0],
23
- setDisabled = _useState[1]; // 拓扑图是否加载
24
+ setDisabled = _useState[1]; // FIXME 临时方案支持业务拓扑禁用连线设置
24
25
 
25
26
 
27
+ var linkDrawShapeEnabled = editorProps.linkDrawShapeEnabled; // 拓扑图是否加载
28
+
26
29
  var _topo$store$useModelS = topo.store.useModelState('topoMod'),
27
30
  graphLoaded = _topo$store$useModelS.graphLoaded; // 选中的元素
28
31
 
29
32
 
30
33
  var selection = topo.selectionModel.useHtSelection();
31
34
  useEffect(function () {
32
- if (graphLoaded) {
35
+ if (graphLoaded && linkDrawShapeEnabled !== false) {
33
36
  var edges = getEdgesBySelection(topo);
34
37
  setDisabled(!edges.length);
38
+ } else {
39
+ setDisabled(true);
35
40
  }
36
- }, [selection, graphLoaded]);
41
+ }, [selection, graphLoaded, linkDrawShapeEnabled]);
37
42
 
38
43
  var handleChange = function handleChange(name, value) {
39
44
  var edges = getEdgesBySelection(topo);
@@ -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
  },
@@ -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.5" === 'string' ? "6.0.5" : null;
26
+ var version = typeof "6.0.7" === 'string' ? "6.0.7" : 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,
@@ -21,7 +21,7 @@ var _constants = require("./constants");
21
21
 
22
22
  var _EdgeType = _interopRequireDefault(require("./EdgeType"));
23
23
 
24
- var _excluded = ["topo", "showLabel"];
24
+ var _excluded = ["topo", "showLabel", "editorProps"];
25
25
 
26
26
  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); }
27
27
 
@@ -35,24 +35,29 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
35
35
  function EdgeTypeButton(props) {
36
36
  var topo = props.topo,
37
37
  showLabel = props.showLabel,
38
+ editorProps = props.editorProps,
38
39
  otherProps = (0, _objectWithoutPropertiesLoose2["default"])(props, _excluded);
39
40
 
40
41
  var _useState = (0, _react.useState)(true),
41
42
  disabled = _useState[0],
42
- setDisabled = _useState[1]; // 拓扑图是否加载
43
+ setDisabled = _useState[1]; // FIXME 临时方案支持业务拓扑禁用连线设置
43
44
 
44
45
 
46
+ var linkDrawShapeEnabled = editorProps.linkDrawShapeEnabled; // 拓扑图是否加载
47
+
45
48
  var _topo$store$useModelS = topo.store.useModelState('topoMod'),
46
49
  graphLoaded = _topo$store$useModelS.graphLoaded; // 选中的元素
47
50
 
48
51
 
49
52
  var selection = topo.selectionModel.useHtSelection();
50
53
  (0, _react.useEffect)(function () {
51
- if (graphLoaded) {
54
+ if (graphLoaded && linkDrawShapeEnabled !== false) {
52
55
  var edges = (0, _edgeTypeStyleUtil.getEdgesBySelection)(topo);
53
56
  setDisabled(!edges.length);
57
+ } else {
58
+ setDisabled(true);
54
59
  }
55
- }, [selection, graphLoaded]);
60
+ }, [selection, graphLoaded, linkDrawShapeEnabled]);
56
61
 
57
62
  var handleChange = function handleChange(name, value) {
58
63
  var edges = (0, _edgeTypeStyleUtil.getEdgesBySelection)(topo);
@@ -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
  },
@@ -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.5" === 'string' ? "6.0.5" : null;
57
+ var version = typeof "6.0.7" === 'string' ? "6.0.7" : 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.5",
3
+ "version": "6.0.7",
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.5/build/index.html",
119
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@6.0.7/build/index.html",
120
120
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
121
121
  }