strategy-panel 1.0.0
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/.eslintrc.js +9 -0
- package/.fatherrc.ts +26 -0
- package/.prettierrc.js +1 -0
- package/.umirc.ts +29 -0
- package/LICENSE +22 -0
- package/README.md +33 -0
- package/es/assets/AND.svg +11 -0
- package/es/assets/OR.svg +11 -0
- package/es/assets/XOR.svg +11 -0
- package/es/assets/add.svg +13 -0
- package/es/assets/alarm.svg +11 -0
- package/es/assets/application.svg +11 -0
- package/es/assets/cancel.svg +13 -0
- package/es/assets/check.svg +12 -0
- package/es/assets/condition.svg +12 -0
- package/es/assets/control.svg +11 -0
- package/es/assets/decive.svg +11 -0
- package/es/assets/delete.svg +11 -0
- package/es/assets/device.svg +11 -0
- package/es/assets/edit.svg +11 -0
- package/es/assets/hand.svg +11 -0
- package/es/assets/link.svg +11 -0
- package/es/assets/logical.svg +12 -0
- package/es/assets/notice.svg +11 -0
- package/es/assets/order.svg +11 -0
- package/es/assets/relation.svg +11 -0
- package/es/assets/rhombus.svg +3 -0
- package/es/assets/save.svg +13 -0
- package/es/assets/time.svg +11 -0
- package/es/assets/variate.svg +12 -0
- package/es/common/constants/global.d.ts +1 -0
- package/es/common/constants/global.js +1 -0
- package/es/common/constants/graph.d.ts +10 -0
- package/es/common/constants/graph.js +17 -0
- package/es/common/graph-common/category-type.d.ts +16 -0
- package/es/common/graph-common/category-type.js +72 -0
- package/es/common/graph-common/connector/index.d.ts +1 -0
- package/es/common/graph-common/connector/index.js +14 -0
- package/es/common/graph-common/node-element/common-element.less +117 -0
- package/es/common/graph-common/node-element/condition-element.d.ts +8 -0
- package/es/common/graph-common/node-element/condition-element.js +35 -0
- package/es/common/graph-common/node-element/condition-element.less +82 -0
- package/es/common/graph-common/node-element/logical-element.d.ts +8 -0
- package/es/common/graph-common/node-element/logical-element.js +34 -0
- package/es/common/graph-common/node-element/logical-element.less +54 -0
- package/es/common/graph-common/node-element/node-element.d.ts +8 -0
- package/es/common/graph-common/node-element/node-element.js +27 -0
- package/es/common/graph-common/node-element/node-element.less +48 -0
- package/es/common/graph-common/node-element/node-group.d.ts +8 -0
- package/es/common/graph-common/node-element/node-group.js +395 -0
- package/es/common/graph-common/node-element/node-group.less +53 -0
- package/es/common/graph-common/node-popover/index.d.ts +7 -0
- package/es/common/graph-common/node-popover/index.js +11 -0
- package/es/common/graph-common/node-popover/index.less +5 -0
- package/es/common/graph-common/node-types.d.ts +28 -0
- package/es/common/graph-common/node-types.js +60 -0
- package/es/common/graph-common/shape/edge.d.ts +10 -0
- package/es/common/graph-common/shape/edge.js +115 -0
- package/es/common/graph-common/shape/edge.less +8 -0
- package/es/common/graph-common/shape/node.d.ts +6 -0
- package/es/common/graph-common/shape/node.js +6 -0
- package/es/common/graph-common/shape/nodes/BaseNode.d.ts +4 -0
- package/es/common/graph-common/shape/nodes/BaseNode.js +46 -0
- package/es/common/graph-common/shape/nodes/CommonNode.d.ts +5 -0
- package/es/common/graph-common/shape/nodes/CommonNode.js +118 -0
- package/es/common/graph-common/shape/nodes/ConditionJudgment.d.ts +5 -0
- package/es/common/graph-common/shape/nodes/ConditionJudgment.js +130 -0
- package/es/common/graph-common/shape/nodes/GroupNode.d.ts +4 -0
- package/es/common/graph-common/shape/nodes/GroupNode.js +99 -0
- package/es/common/graph-common/shape/nodes/LogicalNode.d.ts +5 -0
- package/es/common/graph-common/shape/nodes/LogicalNode.js +130 -0
- package/es/common/graph-utils/graph.d.ts +83 -0
- package/es/common/graph-utils/graph.js +98 -0
- package/es/component/cut.d.ts +10 -0
- package/es/component/cut.js +34 -0
- package/es/component/cut.less +6 -0
- package/es/component/item-name.d.ts +6 -0
- package/es/component/item-name.js +30 -0
- package/es/component/keyword.d.ts +9 -0
- package/es/component/keyword.js +26 -0
- package/es/component/keyword.less +11 -0
- package/es/component/rx-component/rx-input.d.ts +8 -0
- package/es/component/rx-component/rx-input.js +47 -0
- package/es/hooks/useObservableState.d.ts +3 -0
- package/es/hooks/useObservableState.js +44 -0
- package/es/index.d.ts +8 -0
- package/es/index.js +9 -0
- package/es/pages/component-tree-panel/category-tree/index.d.ts +16 -0
- package/es/pages/component-tree-panel/category-tree/index.js +100 -0
- package/es/pages/component-tree-panel/category-tree/index.less +35 -0
- package/es/pages/component-tree-panel/category-tree/node-title.d.ts +12 -0
- package/es/pages/component-tree-panel/category-tree/node-title.js +57 -0
- package/es/pages/component-tree-panel/category-tree/node-title.less +113 -0
- package/es/pages/component-tree-panel/index.d.ts +17 -0
- package/es/pages/component-tree-panel/index.js +19 -0
- package/es/pages/component-tree-panel/index.less +51 -0
- package/es/pages/config-panel/components/condition-configuration/configure-modal/data-origin.d.ts +49 -0
- package/es/pages/config-panel/components/condition-configuration/configure-modal/data-origin.js +212 -0
- package/es/pages/config-panel/components/condition-configuration/configure-modal/index.d.ts +11 -0
- package/es/pages/config-panel/components/condition-configuration/configure-modal/index.js +178 -0
- package/es/pages/config-panel/components/condition-configuration/configure-modal/style.less +13 -0
- package/es/pages/config-panel/components/condition-configuration/cross-line.d.ts +8 -0
- package/es/pages/config-panel/components/condition-configuration/cross-line.js +47 -0
- package/es/pages/config-panel/components/condition-configuration/index.d.ts +9 -0
- package/es/pages/config-panel/components/condition-configuration/index.js +180 -0
- package/es/pages/config-panel/components/condition-configuration/style.less +70 -0
- package/es/pages/config-panel/components/time-trigger/components/cycle-time.d.ts +8 -0
- package/es/pages/config-panel/components/time-trigger/components/cycle-time.js +87 -0
- package/es/pages/config-panel/components/time-trigger/components/time-horizon.d.ts +9 -0
- package/es/pages/config-panel/components/time-trigger/components/time-horizon.js +73 -0
- package/es/pages/config-panel/components/time-trigger/delay-time.d.ts +8 -0
- package/es/pages/config-panel/components/time-trigger/delay-time.js +18 -0
- package/es/pages/config-panel/components/time-trigger/index.d.ts +8 -0
- package/es/pages/config-panel/components/time-trigger/index.js +84 -0
- package/es/pages/config-panel/components/time-trigger/interval-time.d.ts +8 -0
- package/es/pages/config-panel/components/time-trigger/interval-time.js +50 -0
- package/es/pages/config-panel/components/time-trigger/persistent-time.d.ts +8 -0
- package/es/pages/config-panel/components/time-trigger/persistent-time.js +18 -0
- package/es/pages/config-panel/components/time-trigger/timing-time.d.ts +8 -0
- package/es/pages/config-panel/components/time-trigger/timing-time.js +52 -0
- package/es/pages/config-panel/config-common.d.ts +37 -0
- package/es/pages/config-panel/config-common.js +135 -0
- package/es/pages/config-panel/index.d.ts +12 -0
- package/es/pages/config-panel/index.js +50 -0
- package/es/pages/config-panel/node-form.d.ts +21 -0
- package/es/pages/config-panel/node-form.js +97 -0
- package/es/pages/config-panel/style.less +62 -0
- package/es/pages/dag-canvas/canvas-content.d.ts +9 -0
- package/es/pages/dag-canvas/canvas-content.js +92 -0
- package/es/pages/dag-canvas/canvas-content.less +5 -0
- package/es/pages/dag-canvas/index.d.ts +13 -0
- package/es/pages/dag-canvas/index.js +28 -0
- package/es/pages/dag-canvas/index.less +11 -0
- package/es/pages/dag-canvas/preview.d.ts +9 -0
- package/es/pages/dag-canvas/preview.js +34 -0
- package/es/pages/index.d.ts +37 -0
- package/es/pages/index.js +73 -0
- package/es/pages/index.less +50 -0
- package/es/pages/rx-models/experiment-graph.d.ts +82 -0
- package/es/pages/rx-models/experiment-graph.js +1186 -0
- package/es/pages/rx-models/graph-core.d.ts +96 -0
- package/es/pages/rx-models/graph-core.js +755 -0
- package/es/pages/rx-models/graph-core.less +14 -0
- package/es/pages/rx-models/graph-util.d.ts +186 -0
- package/es/pages/rx-models/graph-util.js +358 -0
- package/es/pages/rx-models/typing.d.ts +126 -0
- package/es/pages/strategy-header/index.d.ts +56 -0
- package/es/pages/strategy-header/index.js +141 -0
- package/es/pages/strategy-header/style.less +22 -0
- package/es/pages/strategy-header/theme-switch/index.d.ts +4 -0
- package/es/pages/strategy-header/theme-switch/index.js +19 -0
- package/es/pages/strategy-header/theme-switch/style.less +11 -0
- package/es/style/basic.less +12 -0
- package/es/style/default.less +2 -0
- package/es/style/position.less +25 -0
- package/es/style/theme-light.less +7 -0
- package/es/style/variable.less +3 -0
- package/es/typings.d.ts +6 -0
- package/es/utils/utils.d.ts +1 -0
- package/es/utils/utils.js +1 -0
- package/package.json +70 -0
- package/tsconfig.json +18 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { COMPONENTS_TYPE, COMMONLY_USED, SCENE_DISPLAY, SIGN_OPERATION, MOTION_OPERATION } from "./node-types";
|
|
2
|
+
export var componentsData = [{
|
|
3
|
+
id: COMPONENTS_TYPE.COMMONLY_USED,
|
|
4
|
+
name: '通用组件',
|
|
5
|
+
isDir: true,
|
|
6
|
+
children: [{
|
|
7
|
+
id: COMMONLY_USED.VARIATE,
|
|
8
|
+
name: '变量',
|
|
9
|
+
imgUrl: require("../../assets/variate.svg")
|
|
10
|
+
}]
|
|
11
|
+
}, {
|
|
12
|
+
id: COMPONENTS_TYPE.SCENE_DISPLAY,
|
|
13
|
+
name: '场景触发',
|
|
14
|
+
isDir: true,
|
|
15
|
+
children: [{
|
|
16
|
+
id: SCENE_DISPLAY.EQUIPMENT,
|
|
17
|
+
name: '设备触发',
|
|
18
|
+
imgUrl: require("../../assets/decive.svg"),
|
|
19
|
+
number: 1
|
|
20
|
+
}, {
|
|
21
|
+
id: SCENE_DISPLAY.TIME,
|
|
22
|
+
name: '时间触发',
|
|
23
|
+
imgUrl: require("../../assets/time.svg")
|
|
24
|
+
}, {
|
|
25
|
+
id: SCENE_DISPLAY.MANUAL,
|
|
26
|
+
name: '手动按钮',
|
|
27
|
+
imgUrl: require("../../assets/hand.svg")
|
|
28
|
+
}]
|
|
29
|
+
}, {
|
|
30
|
+
id: COMPONENTS_TYPE.SIGN_OPERATION,
|
|
31
|
+
name: '运算符号',
|
|
32
|
+
isDir: true,
|
|
33
|
+
children: [{
|
|
34
|
+
id: SIGN_OPERATION.RELATION,
|
|
35
|
+
name: '关系运算',
|
|
36
|
+
imgUrl: require("../../assets/relation.svg")
|
|
37
|
+
}, {
|
|
38
|
+
id: SIGN_OPERATION.LOGICAL,
|
|
39
|
+
name: '逻辑运算',
|
|
40
|
+
imgUrl: require("../../assets/logical.svg")
|
|
41
|
+
}, {
|
|
42
|
+
id: SIGN_OPERATION.CONDITION,
|
|
43
|
+
name: '条件判断',
|
|
44
|
+
imgUrl: require("../../assets/condition.svg")
|
|
45
|
+
}]
|
|
46
|
+
}, {
|
|
47
|
+
id: COMPONENTS_TYPE.MOTION_OPERATION,
|
|
48
|
+
name: '运动符号',
|
|
49
|
+
isDir: true,
|
|
50
|
+
children: [{
|
|
51
|
+
id: MOTION_OPERATION.ALARM,
|
|
52
|
+
name: '报警',
|
|
53
|
+
imgUrl: require("../../assets/alarm.svg")
|
|
54
|
+
}, {
|
|
55
|
+
id: MOTION_OPERATION.NOTICE,
|
|
56
|
+
name: '通知',
|
|
57
|
+
imgUrl: require("../../assets/notice.svg")
|
|
58
|
+
}, {
|
|
59
|
+
id: MOTION_OPERATION.ORDER,
|
|
60
|
+
name: '派发工单',
|
|
61
|
+
imgUrl: require("../../assets/order.svg")
|
|
62
|
+
}, {
|
|
63
|
+
id: MOTION_OPERATION.CONTROL,
|
|
64
|
+
name: '远程控制',
|
|
65
|
+
imgUrl: require("../../assets/control.svg")
|
|
66
|
+
}]
|
|
67
|
+
}, {
|
|
68
|
+
id: COMPONENTS_TYPE.APPLICATION,
|
|
69
|
+
name: '应用组件',
|
|
70
|
+
isDir: true,
|
|
71
|
+
children: []
|
|
72
|
+
}];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Graph } from '@antv/x6';
|
|
2
|
+
Graph.registerConnector('pai', function (s, t) {
|
|
3
|
+
var offset = 4;
|
|
4
|
+
var control = 80;
|
|
5
|
+
var v1 = {
|
|
6
|
+
x: s.x,
|
|
7
|
+
y: s.y + offset + control
|
|
8
|
+
};
|
|
9
|
+
var v2 = {
|
|
10
|
+
x: t.x,
|
|
11
|
+
y: t.y - offset - control
|
|
12
|
+
};
|
|
13
|
+
return "M ".concat(s.x, " ").concat(s.y, "\n L ").concat(s.x, " ").concat(s.y + offset, "\n C ").concat(v1.x, " ").concat(v1.y, " ").concat(v2.x, " ").concat(v2.y, " ").concat(t.x, " ").concat(t.y - offset, "\n L ").concat(t.x, " ").concat(t.y, "\n ");
|
|
14
|
+
}, true);
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
@node-element-primary-color: #00A6FF;
|
|
2
|
+
|
|
3
|
+
.x6-node [magnet='true'] {
|
|
4
|
+
cursor: crosshair;
|
|
5
|
+
transition: none;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.x6-node [magnet='true']:hover {
|
|
9
|
+
opacity: 1;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.x6-node [magnet='true'][port-group='in'] {
|
|
13
|
+
cursor: move;
|
|
14
|
+
stroke: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.x6-port-body > span {
|
|
18
|
+
display: block;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.ais-port {
|
|
22
|
+
width: 100%;
|
|
23
|
+
height: 100%;
|
|
24
|
+
border: 1px solid #00A6FF;
|
|
25
|
+
border-radius: 100%;
|
|
26
|
+
background: #fff;
|
|
27
|
+
display: block;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ais-port.connected {
|
|
31
|
+
width: 0;
|
|
32
|
+
height: 0;
|
|
33
|
+
margin-top: 3px;
|
|
34
|
+
margin-left: -1px;
|
|
35
|
+
border-width: 5px 4px 0;
|
|
36
|
+
border-style: solid;
|
|
37
|
+
border-color: #00A6FF transparent transparent;
|
|
38
|
+
border-radius: 0;
|
|
39
|
+
background-color: transparent;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.x6-port-body.available {
|
|
43
|
+
overflow: visible;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.x6-port-body.available body {
|
|
47
|
+
overflow: visible;
|
|
48
|
+
}
|
|
49
|
+
.x6-port-body.available span {
|
|
50
|
+
overflow: visible;
|
|
51
|
+
display: block;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.x6-port-body.available body > span::before {
|
|
55
|
+
content: ' ';
|
|
56
|
+
float: left;
|
|
57
|
+
width: 20px;
|
|
58
|
+
height: 20px;
|
|
59
|
+
margin-top: -6px;
|
|
60
|
+
margin-left: -6px;
|
|
61
|
+
border-radius: 50%;
|
|
62
|
+
background-color: fade(@node-element-primary-color, 60%);
|
|
63
|
+
box-sizing: border-box;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.x6-port-body.available body > span::after {
|
|
67
|
+
content: ' ';
|
|
68
|
+
float: left;
|
|
69
|
+
clear: both;
|
|
70
|
+
width: 10px;
|
|
71
|
+
height: 10px;
|
|
72
|
+
margin-top: -15px;
|
|
73
|
+
margin-left: -1px;
|
|
74
|
+
border-radius: 50%;
|
|
75
|
+
background-color: #fff;
|
|
76
|
+
border: 1px solid @node-element-primary-color;
|
|
77
|
+
// position: relative;
|
|
78
|
+
z-index: 10;
|
|
79
|
+
box-sizing: border-box;
|
|
80
|
+
// transform: translateZ(0);
|
|
81
|
+
// position: relative
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.x6-port-body.adsorbed {
|
|
85
|
+
overflow: visible;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.x6-port-body.adsorbed body {
|
|
89
|
+
overflow: visible;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.x6-port-body.adsorbed body > span::before {
|
|
93
|
+
content: ' ';
|
|
94
|
+
float: left;
|
|
95
|
+
width: 28px;
|
|
96
|
+
height: 28px;
|
|
97
|
+
margin-top: -9px;
|
|
98
|
+
margin-left: -10px;
|
|
99
|
+
border-radius: 50%;
|
|
100
|
+
background-color: fade(@node-element-primary-color, 60%);
|
|
101
|
+
box-sizing: border-box;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.x6-port-body.adsorbed body > span::after {
|
|
105
|
+
content: ' ';
|
|
106
|
+
float: left;
|
|
107
|
+
clear: both;
|
|
108
|
+
width: 10px;
|
|
109
|
+
height: 10px;
|
|
110
|
+
margin-top: -19px;
|
|
111
|
+
border-radius: 50%;
|
|
112
|
+
background-color: #fff;
|
|
113
|
+
border: 1px solid @node-element-primary-color;
|
|
114
|
+
// position: relative;
|
|
115
|
+
z-index: 10;
|
|
116
|
+
box-sizing: border-box;
|
|
117
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import "antd/es/config-provider/style";
|
|
2
|
+
import _ConfigProvider from "antd/es/config-provider";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { ANT_PREFIX } from "../../constants/global";
|
|
6
|
+
import { NodePopover } from "../node-popover";
|
|
7
|
+
import { ReactSVG } from 'react-svg';
|
|
8
|
+
import "./condition-element.less";
|
|
9
|
+
|
|
10
|
+
var ConditionElement = function ConditionElement(props) {
|
|
11
|
+
var node = props.node;
|
|
12
|
+
var data = (node === null || node === void 0 ? void 0 : node.getData()) || {};
|
|
13
|
+
var name = data.name,
|
|
14
|
+
selected = data.selected,
|
|
15
|
+
imgUrl = data.imgUrl;
|
|
16
|
+
return /*#__PURE__*/React.createElement(_ConfigProvider, {
|
|
17
|
+
prefixCls: ANT_PREFIX
|
|
18
|
+
}, /*#__PURE__*/React.createElement(NodePopover, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
19
|
+
className: classNames('node-rhombus-element', {
|
|
20
|
+
selected: !!selected
|
|
21
|
+
})
|
|
22
|
+
}, /*#__PURE__*/React.createElement(ReactSVG, {
|
|
23
|
+
src: require("../../../assets/rhombus.svg"),
|
|
24
|
+
className: classNames('node-rhombus-element-bg')
|
|
25
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
26
|
+
className: "rhombus-inner"
|
|
27
|
+
}, /*#__PURE__*/React.createElement(ReactSVG, {
|
|
28
|
+
src: imgUrl,
|
|
29
|
+
className: "icon"
|
|
30
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
className: "name"
|
|
32
|
+
}, name))))));
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default ConditionElement;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
@import "./common-element.less";
|
|
2
|
+
|
|
3
|
+
@node-element-primary-color: #00A6FF;
|
|
4
|
+
@condition-element-width: 260px;
|
|
5
|
+
@condition-element-height: 107px;
|
|
6
|
+
@condition-element-name-max-width: 144px;
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
.node-rhombus-element {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: row;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
width: @condition-element-width;
|
|
15
|
+
height: @condition-element-height;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
//
|
|
18
|
+
//background-color: fade(@node-element-primary-color, 20%);
|
|
19
|
+
//border: 1px solid @node-element-primary-color;
|
|
20
|
+
|
|
21
|
+
& .node-rhombus-element-bg{
|
|
22
|
+
position: absolute;
|
|
23
|
+
z-index: -1;
|
|
24
|
+
div{
|
|
25
|
+
width: @condition-element-width;
|
|
26
|
+
height: @condition-element-height;
|
|
27
|
+
svg path {
|
|
28
|
+
width: @condition-element-width;
|
|
29
|
+
height: @condition-element-height;
|
|
30
|
+
fill: fade(@node-element-primary-color, 20%);
|
|
31
|
+
stroke: @node-element-primary-color
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
& .rhombus-inner{
|
|
38
|
+
display: flex;
|
|
39
|
+
flex: 1;
|
|
40
|
+
align-items: center;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&.selected,
|
|
45
|
+
&:hover {
|
|
46
|
+
.node-rhombus-element-bg{
|
|
47
|
+
svg path {
|
|
48
|
+
fill: @node-element-primary-color;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
.icon {
|
|
52
|
+
svg path {
|
|
53
|
+
fill: #fff;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
.name {
|
|
57
|
+
color: #ffffff;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
.icon {
|
|
61
|
+
width: 20px;
|
|
62
|
+
height: 20px;
|
|
63
|
+
margin-right: 12px;
|
|
64
|
+
svg {
|
|
65
|
+
width: 20px;
|
|
66
|
+
height: 20px;
|
|
67
|
+
path {
|
|
68
|
+
fill: @node-element-primary-color;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.name {
|
|
74
|
+
overflow-x: hidden;
|
|
75
|
+
color: @node-element-primary-color;
|
|
76
|
+
//font-size: 12px;
|
|
77
|
+
white-space: nowrap;
|
|
78
|
+
text-overflow: ellipsis;
|
|
79
|
+
vertical-align: middle;
|
|
80
|
+
max-width: @condition-element-name-max-width;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import "antd/es/config-provider/style";
|
|
2
|
+
import _ConfigProvider from "antd/es/config-provider";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { ANT_PREFIX } from "../../constants/global";
|
|
6
|
+
import { NodePopover } from "../node-popover";
|
|
7
|
+
import { ReactSVG } from 'react-svg';
|
|
8
|
+
import "./logical-element.less";
|
|
9
|
+
var operatorUrl = {
|
|
10
|
+
'|': require("../../../assets/OR.svg"),
|
|
11
|
+
'&': require("../../../assets/AND.svg"),
|
|
12
|
+
'^': require("../../../assets/XOR.svg")
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
var ConditionElement = function ConditionElement(props) {
|
|
16
|
+
var node = props.node;
|
|
17
|
+
var data = (node === null || node === void 0 ? void 0 : node.getData()) || {};
|
|
18
|
+
var selected = data.selected,
|
|
19
|
+
imgUrl = data.imgUrl,
|
|
20
|
+
nodeData = data.nodeData;
|
|
21
|
+
var operator = nodeData === null || nodeData === void 0 ? void 0 : nodeData.operator;
|
|
22
|
+
return /*#__PURE__*/React.createElement(_ConfigProvider, {
|
|
23
|
+
prefixCls: ANT_PREFIX
|
|
24
|
+
}, /*#__PURE__*/React.createElement(NodePopover, null, /*#__PURE__*/React.createElement("div", {
|
|
25
|
+
className: classNames('logical-element', {
|
|
26
|
+
selected: !!selected
|
|
27
|
+
})
|
|
28
|
+
}, /*#__PURE__*/React.createElement(ReactSVG, {
|
|
29
|
+
src: operator ? (operatorUrl === null || operatorUrl === void 0 ? void 0 : operatorUrl[operator]) || imgUrl : imgUrl,
|
|
30
|
+
className: "icon"
|
|
31
|
+
}))));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export default ConditionElement;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
@import "./common-element.less";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
@node-element-primary-color: #00A6FF;
|
|
5
|
+
@logical-bg-edg: 50px;
|
|
6
|
+
@logical-edg: 30px;
|
|
7
|
+
|
|
8
|
+
.logical-element {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
width: @logical-bg-edg;
|
|
14
|
+
height: @logical-bg-edg;
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
background-color: fade(@node-element-primary-color, 20%);
|
|
17
|
+
border: 1px solid @node-element-primary-color;
|
|
18
|
+
border-radius: 4px;
|
|
19
|
+
|
|
20
|
+
&.selected,
|
|
21
|
+
&:hover {
|
|
22
|
+
background-color: @node-element-primary-color;
|
|
23
|
+
.icon {
|
|
24
|
+
svg path {
|
|
25
|
+
fill: #fff;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
.name {
|
|
29
|
+
color: #ffffff;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
.icon {
|
|
33
|
+
width: @logical-edg;
|
|
34
|
+
height: @logical-edg;
|
|
35
|
+
svg {
|
|
36
|
+
width: @logical-edg;
|
|
37
|
+
height: @logical-edg;
|
|
38
|
+
path {
|
|
39
|
+
fill: @node-element-primary-color;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.name {
|
|
45
|
+
overflow-x: hidden;
|
|
46
|
+
color: @node-element-primary-color;
|
|
47
|
+
//font-size: 12px;
|
|
48
|
+
white-space: nowrap;
|
|
49
|
+
text-overflow: ellipsis;
|
|
50
|
+
vertical-align: middle;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import "antd/es/config-provider/style";
|
|
2
|
+
import _ConfigProvider from "antd/es/config-provider";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { ANT_PREFIX } from "../../constants/global";
|
|
6
|
+
import { NodePopover } from "../node-popover";
|
|
7
|
+
import { ReactSVG } from 'react-svg';
|
|
8
|
+
import "./node-element.less";
|
|
9
|
+
export var NodeElement = function NodeElement(props) {
|
|
10
|
+
var node = props.node;
|
|
11
|
+
var data = (node === null || node === void 0 ? void 0 : node.getData()) || {};
|
|
12
|
+
var name = data.name,
|
|
13
|
+
selected = data.selected,
|
|
14
|
+
imgUrl = data.imgUrl;
|
|
15
|
+
return /*#__PURE__*/React.createElement(_ConfigProvider, {
|
|
16
|
+
prefixCls: ANT_PREFIX
|
|
17
|
+
}, /*#__PURE__*/React.createElement(NodePopover, null, /*#__PURE__*/React.createElement("div", {
|
|
18
|
+
className: classNames('node-element', {
|
|
19
|
+
selected: !!selected
|
|
20
|
+
})
|
|
21
|
+
}, /*#__PURE__*/React.createElement(ReactSVG, {
|
|
22
|
+
src: imgUrl,
|
|
23
|
+
className: "icon"
|
|
24
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
25
|
+
className: "name"
|
|
26
|
+
}, name))));
|
|
27
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
@import "./common-element.less";
|
|
2
|
+
|
|
3
|
+
.node-element {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
width: 180px;
|
|
9
|
+
height: 43px;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
background-color: fade(@node-element-primary-color, 20%);
|
|
12
|
+
border: 1px solid @node-element-primary-color;
|
|
13
|
+
border-radius: 4px;
|
|
14
|
+
|
|
15
|
+
&.selected,
|
|
16
|
+
&:hover {
|
|
17
|
+
background-color: @node-element-primary-color;
|
|
18
|
+
.icon {
|
|
19
|
+
svg path {
|
|
20
|
+
fill: #fff;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
.name {
|
|
24
|
+
color: #ffffff;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
.icon {
|
|
28
|
+
width: 20px;
|
|
29
|
+
height: 20px;
|
|
30
|
+
margin-right: 12px;
|
|
31
|
+
svg {
|
|
32
|
+
width: 20px;
|
|
33
|
+
height: 20px;
|
|
34
|
+
path {
|
|
35
|
+
fill: @node-element-primary-color;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.name {
|
|
41
|
+
overflow-x: hidden;
|
|
42
|
+
color: @node-element-primary-color;
|
|
43
|
+
//font-size: 12px;
|
|
44
|
+
white-space: nowrap;
|
|
45
|
+
text-overflow: ellipsis;
|
|
46
|
+
vertical-align: middle;
|
|
47
|
+
}
|
|
48
|
+
}
|