coolcare-lite-scada-component 2.0.28 → 2.0.30
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/es/element/EleButton/Component.js +12 -4
- package/es/element/EleFan/Component.js +12 -4
- package/es/element/EleGauge/Component.js +12 -4
- package/es/element/EleIcon/Component.js +12 -4
- package/es/element/EleIndicatorLight/Component.js +12 -4
- package/es/element/ElePointImage/Component.js +12 -4
- package/es/element/ElePointState/Component.js +12 -4
- package/es/element/ElePointValue/Component.js +12 -4
- package/es/element/EleShine/Component.js +12 -4
- package/es/element/EleText/Component.js +21 -0
- package/es/element/PointCard/PointCard1/Component.js +12 -4
- package/es/element/PointCard/PointCard2/Component/PointItem.js +12 -4
- package/es/element/PointCard/PointCard3/Component.js +12 -4
- package/es/element/PointCard/PointListCard/Component.js +12 -4
- package/es/element/PointControl/PointControl1/Component.js +12 -4
- package/es/element/PointControl/PointControl3/Component.js +12 -4
- package/es/element/type.d.ts +5 -3
- package/es/element/utils/handleEleEvent.js +3 -0
- package/es/hooks/useEleEventHandle.js +7 -1
- package/es/pages/display/Player/index.js +56 -24
- package/es/pages/display/index.js +38 -16
- package/es/pages/editor/PanelRight/components/FormBindEvent/index.js +27 -10
- package/package.json +2 -2
|
@@ -39,10 +39,18 @@ var EleButtonComponent = function EleButtonComponent(_ref) {
|
|
|
39
39
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
40
40
|
title: tooltipTitle
|
|
41
41
|
}, /*#__PURE__*/React.createElement("button", {
|
|
42
|
-
onClick:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
onClick: function onClick(e) {
|
|
43
|
+
return eventHandles.current.onClick(e);
|
|
44
|
+
},
|
|
45
|
+
onContextMenu: function onContextMenu(e) {
|
|
46
|
+
return eventHandles.current.onContextMenu(e);
|
|
47
|
+
},
|
|
48
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
49
|
+
return eventHandles.current.onMouseEnter(e);
|
|
50
|
+
},
|
|
51
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
52
|
+
return eventHandles.current.onMouseLeave(e);
|
|
53
|
+
},
|
|
46
54
|
className: styles.button
|
|
47
55
|
}, payload === null || payload === void 0 ? void 0 : payload.btnText)));
|
|
48
56
|
};
|
|
@@ -80,10 +80,18 @@ var EleFanComponent = function EleFanComponent(_ref) {
|
|
|
80
80
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
81
81
|
title: tooltipTitle
|
|
82
82
|
}, /*#__PURE__*/React.createElement("div", {
|
|
83
|
-
onClick:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
onClick: function onClick(e) {
|
|
84
|
+
return eventHandles.current.onClick(e);
|
|
85
|
+
},
|
|
86
|
+
onContextMenu: function onContextMenu(e) {
|
|
87
|
+
return eventHandles.current.onContextMenu(e);
|
|
88
|
+
},
|
|
89
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
90
|
+
return eventHandles.current.onMouseEnter(e);
|
|
91
|
+
},
|
|
92
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
93
|
+
return eventHandles.current.onMouseLeave(e);
|
|
94
|
+
},
|
|
87
95
|
style: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, payload === null || payload === void 0 ? void 0 : payload.fontStyles), payload === null || payload === void 0 ? void 0 : payload.borderStyles), payload === null || payload === void 0 ? void 0 : payload.fillStyles), payload === null || payload === void 0 ? void 0 : payload.margin_padding), {}, {
|
|
88
96
|
backgroundColor: getStatusColor()
|
|
89
97
|
}),
|
|
@@ -111,10 +111,18 @@ var EleGaugeComponent = function EleGaugeComponent(_ref) {
|
|
|
111
111
|
}, [pointData, node]);
|
|
112
112
|
return /*#__PURE__*/React.createElement("div", {
|
|
113
113
|
className: styles.wrap,
|
|
114
|
-
onClick:
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
onClick: function onClick(e) {
|
|
115
|
+
return eventHandles.current.onClick(e);
|
|
116
|
+
},
|
|
117
|
+
onContextMenu: function onContextMenu(e) {
|
|
118
|
+
return eventHandles.current.onContextMenu(e);
|
|
119
|
+
},
|
|
120
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
121
|
+
return eventHandles.current.onMouseEnter(e);
|
|
122
|
+
},
|
|
123
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
124
|
+
return eventHandles.current.onMouseLeave(e);
|
|
125
|
+
},
|
|
118
126
|
style: _objectSpread(_objectSpread({}, payload === null || payload === void 0 ? void 0 : payload.borderStyles), payload === null || payload === void 0 ? void 0 : payload.fillStyles)
|
|
119
127
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
120
128
|
title: false
|
|
@@ -38,10 +38,18 @@ var EleIconComponent = function EleIconComponent(_ref) {
|
|
|
38
38
|
title: tooltipTitle
|
|
39
39
|
}, /*#__PURE__*/React.createElement("div", {
|
|
40
40
|
style: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, payload === null || payload === void 0 ? void 0 : payload.fontStyles), payload === null || payload === void 0 ? void 0 : payload.borderStyles), payload === null || payload === void 0 ? void 0 : payload.fillStyles), payload === null || payload === void 0 ? void 0 : payload.margin_padding),
|
|
41
|
-
onClick:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
onClick: function onClick(e) {
|
|
42
|
+
return eventHandles.current.onClick(e);
|
|
43
|
+
},
|
|
44
|
+
onContextMenu: function onContextMenu(e) {
|
|
45
|
+
return eventHandles.current.onContextMenu(e);
|
|
46
|
+
},
|
|
47
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
48
|
+
return eventHandles.current.onMouseEnter(e);
|
|
49
|
+
},
|
|
50
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
51
|
+
return eventHandles.current.onMouseLeave(e);
|
|
52
|
+
},
|
|
45
53
|
className: styles['ele-icon-wrap']
|
|
46
54
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
47
55
|
type: "icon-".concat((payload === null || payload === void 0 ? void 0 : payload.iconName) || 'smile'),
|
|
@@ -47,10 +47,18 @@ var EleIndicatorLightComponent = function EleIndicatorLightComponent(_ref) {
|
|
|
47
47
|
style: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, payload === null || payload === void 0 ? void 0 : payload.fontStyles), payload === null || payload === void 0 ? void 0 : payload.borderStyles), payload === null || payload === void 0 ? void 0 : payload.fillStyles), payload === null || payload === void 0 ? void 0 : payload.margin_padding), {}, {
|
|
48
48
|
backgroundColor: backgroundColor
|
|
49
49
|
}),
|
|
50
|
-
onClick:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
onClick: function onClick(e) {
|
|
51
|
+
return eventHandles.current.onClick(e);
|
|
52
|
+
},
|
|
53
|
+
onContextMenu: function onContextMenu(e) {
|
|
54
|
+
return eventHandles.current.onContextMenu(e);
|
|
55
|
+
},
|
|
56
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
57
|
+
return eventHandles.current.onMouseEnter(e);
|
|
58
|
+
},
|
|
59
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
60
|
+
return eventHandles.current.onMouseLeave(e);
|
|
61
|
+
},
|
|
54
62
|
className: styles.wrap
|
|
55
63
|
}));
|
|
56
64
|
};
|
|
@@ -45,10 +45,18 @@ var ElePointImageComponent = function ElePointImageComponent(_ref) {
|
|
|
45
45
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
46
46
|
title: tooltipTitle
|
|
47
47
|
}, /*#__PURE__*/React.createElement("div", {
|
|
48
|
-
onClick:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
onClick: function onClick(e) {
|
|
49
|
+
return eventHandles.current.onClick(e);
|
|
50
|
+
},
|
|
51
|
+
onContextMenu: function onContextMenu(e) {
|
|
52
|
+
return eventHandles.current.onContextMenu(e);
|
|
53
|
+
},
|
|
54
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
55
|
+
return eventHandles.current.onMouseEnter(e);
|
|
56
|
+
},
|
|
57
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
58
|
+
return eventHandles.current.onMouseLeave(e);
|
|
59
|
+
},
|
|
52
60
|
className: styles.wrap
|
|
53
61
|
}, (payload === null || payload === void 0 ? void 0 : payload.imgSrc) ? /*#__PURE__*/React.createElement("img", {
|
|
54
62
|
className: styles.img,
|
|
@@ -53,10 +53,18 @@ var ElePointStateComponent = function ElePointStateComponent(_ref) {
|
|
|
53
53
|
title: tooltipTitle
|
|
54
54
|
}, /*#__PURE__*/React.createElement("div", {
|
|
55
55
|
className: styles.wrap,
|
|
56
|
-
onClick:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
onClick: function onClick(e) {
|
|
57
|
+
return eventHandles.current.onClick(e);
|
|
58
|
+
},
|
|
59
|
+
onContextMenu: function onContextMenu(e) {
|
|
60
|
+
return eventHandles.current.onContextMenu(e);
|
|
61
|
+
},
|
|
62
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
63
|
+
return eventHandles.current.onMouseEnter(e);
|
|
64
|
+
},
|
|
65
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
66
|
+
return eventHandles.current.onMouseLeave(e);
|
|
67
|
+
},
|
|
60
68
|
style: _objectSpread(_objectSpread(_objectSpread({}, payload === null || payload === void 0 ? void 0 : payload.borderStyles), payload === null || payload === void 0 ? void 0 : payload.fillStyles), {}, {
|
|
61
69
|
background: typeof bgColor === 'string' ? bgColor : (payload === null || payload === void 0 ? void 0 : (_payload$fillStyles = payload.fillStyles) === null || _payload$fillStyles === void 0 ? void 0 : _payload$fillStyles.backgroundColor) ? payload === null || payload === void 0 ? void 0 : (_payload$fillStyles2 = payload.fillStyles) === null || _payload$fillStyles2 === void 0 ? void 0 : _payload$fillStyles2.backgroundColor : 'invalid-value'
|
|
62
70
|
})
|
|
@@ -54,10 +54,18 @@ var ElePointValueComponent = function ElePointValueComponent(_ref) {
|
|
|
54
54
|
}
|
|
55
55
|
var numberColor = getValueByExpression(pointData === null || pointData === void 0 ? void 0 : pointData.value, payload === null || payload === void 0 ? void 0 : payload.colorExpressions);
|
|
56
56
|
return /*#__PURE__*/React.createElement("div", {
|
|
57
|
-
onClick:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
onClick: function onClick(e) {
|
|
58
|
+
return eventHandles.current.onClick(e);
|
|
59
|
+
},
|
|
60
|
+
onContextMenu: function onContextMenu(e) {
|
|
61
|
+
return eventHandles.current.onContextMenu(e);
|
|
62
|
+
},
|
|
63
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
64
|
+
return eventHandles.current.onMouseEnter(e);
|
|
65
|
+
},
|
|
66
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
67
|
+
return eventHandles.current.onMouseLeave(e);
|
|
68
|
+
},
|
|
61
69
|
style: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, payload === null || payload === void 0 ? void 0 : payload.fontStyles), payload === null || payload === void 0 ? void 0 : payload.borderStyles), payload === null || payload === void 0 ? void 0 : payload.fillStyles), payload === null || payload === void 0 ? void 0 : payload.margin_padding),
|
|
62
70
|
className: "".concat(styles.wrap, " ").concat(styles[directionClassNameMap[direction]])
|
|
63
71
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -50,10 +50,18 @@ var EleShineComponent = function EleShineComponent(_ref) {
|
|
|
50
50
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
51
51
|
title: tooltipTitle
|
|
52
52
|
}, /*#__PURE__*/React.createElement("div", {
|
|
53
|
-
onClick:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
onClick: function onClick(e) {
|
|
54
|
+
return eventHandles.current.onClick(e);
|
|
55
|
+
},
|
|
56
|
+
onContextMenu: function onContextMenu(e) {
|
|
57
|
+
return eventHandles.current.onContextMenu(e);
|
|
58
|
+
},
|
|
59
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
60
|
+
return eventHandles.current.onMouseEnter(e);
|
|
61
|
+
},
|
|
62
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
63
|
+
return eventHandles.current.onMouseLeave(e);
|
|
64
|
+
},
|
|
57
65
|
style: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, payload === null || payload === void 0 ? void 0 : payload.fontStyles), payload === null || payload === void 0 ? void 0 : payload.borderStyles), payload === null || payload === void 0 ? void 0 : payload.fillStyles), payload === null || payload === void 0 ? void 0 : payload.margin_padding),
|
|
58
66
|
className: "".concat(styles.wrap, " ").concat(shineExpressionsValue === '告警' ? styles.shine : '')
|
|
59
67
|
}));
|
|
@@ -7,12 +7,33 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
7
7
|
import React from "react";
|
|
8
8
|
import { memo } from 'react';
|
|
9
9
|
import { reactShapeNodeAreEqual } from "../utils";
|
|
10
|
+
import { useEleEventHandle } from "../../hooks";
|
|
10
11
|
import styles from "./index.css";
|
|
11
12
|
var EleTextComponent = function EleTextComponent(_ref) {
|
|
13
|
+
var _payload$mittMeta$nam, _payload$mittMeta;
|
|
12
14
|
var node = _ref.node;
|
|
13
15
|
var payload = node === null || node === void 0 ? void 0 : node.getData();
|
|
16
|
+
var eventHandles = useEleEventHandle({
|
|
17
|
+
events: payload === null || payload === void 0 ? void 0 : payload.events,
|
|
18
|
+
payload: {
|
|
19
|
+
points: [],
|
|
20
|
+
namespace: (_payload$mittMeta$nam = payload === null || payload === void 0 ? void 0 : (_payload$mittMeta = payload.mittMeta) === null || _payload$mittMeta === void 0 ? void 0 : _payload$mittMeta.namespace) !== null && _payload$mittMeta$nam !== void 0 ? _payload$mittMeta$nam : 0
|
|
21
|
+
}
|
|
22
|
+
});
|
|
14
23
|
return /*#__PURE__*/React.createElement("div", {
|
|
15
24
|
className: "".concat(styles.wrap, " ele-text-wrap"),
|
|
25
|
+
onClick: function onClick(e) {
|
|
26
|
+
return eventHandles.current.onClick(e);
|
|
27
|
+
},
|
|
28
|
+
onContextMenu: function onContextMenu(e) {
|
|
29
|
+
return eventHandles.current.onContextMenu(e);
|
|
30
|
+
},
|
|
31
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
32
|
+
return eventHandles.current.onMouseEnter(e);
|
|
33
|
+
},
|
|
34
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
35
|
+
return eventHandles.current.onMouseLeave(e);
|
|
36
|
+
},
|
|
16
37
|
style: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, payload === null || payload === void 0 ? void 0 : payload.fontStyles), payload === null || payload === void 0 ? void 0 : payload.borderStyles), payload === null || payload === void 0 ? void 0 : payload.fillStyles), payload === null || payload === void 0 ? void 0 : payload.margin_padding)
|
|
17
38
|
}, (payload === null || payload === void 0 ? void 0 : payload.textContent) || '双击输入');
|
|
18
39
|
};
|
|
@@ -64,10 +64,18 @@ var ElePointCardComponent = function ElePointCardComponent(_ref) {
|
|
|
64
64
|
title: tooltipTitle
|
|
65
65
|
}, /*#__PURE__*/React.createElement("div", {
|
|
66
66
|
className: styles['ele-point_card-wrap'],
|
|
67
|
-
onClick:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
onClick: function onClick(e) {
|
|
68
|
+
return eventHandles.current.onClick(e);
|
|
69
|
+
},
|
|
70
|
+
onContextMenu: function onContextMenu(e) {
|
|
71
|
+
return eventHandles.current.onContextMenu(e);
|
|
72
|
+
},
|
|
73
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
74
|
+
return eventHandles.current.onMouseEnter(e);
|
|
75
|
+
},
|
|
76
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
77
|
+
return eventHandles.current.onMouseLeave(e);
|
|
78
|
+
},
|
|
71
79
|
style: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, payload === null || payload === void 0 ? void 0 : payload.fontStyles), payload === null || payload === void 0 ? void 0 : payload.borderStyles), payload === null || payload === void 0 ? void 0 : payload.fillStyles), payload === null || payload === void 0 ? void 0 : payload.margin_padding)
|
|
72
80
|
}, /*#__PURE__*/React.createElement("div", {
|
|
73
81
|
className: styles.top
|
|
@@ -58,10 +58,18 @@ var PointItem = function PointItem(_ref) {
|
|
|
58
58
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
59
59
|
title: tooltipTitle
|
|
60
60
|
}, /*#__PURE__*/React.createElement("div", {
|
|
61
|
-
onClick:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
onClick: function onClick(e) {
|
|
62
|
+
return eventHandles.current.onClick(e);
|
|
63
|
+
},
|
|
64
|
+
onContextMenu: function onContextMenu(e) {
|
|
65
|
+
return eventHandles.current.onContextMenu(e);
|
|
66
|
+
},
|
|
67
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
68
|
+
return eventHandles.current.onMouseEnter(e);
|
|
69
|
+
},
|
|
70
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
71
|
+
return eventHandles.current.onMouseLeave(e);
|
|
72
|
+
},
|
|
65
73
|
className: styles.item,
|
|
66
74
|
style: _objectSpread({}, style)
|
|
67
75
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -78,12 +78,20 @@ var ElePointCard3Component = function ElePointCard3Component(_ref) {
|
|
|
78
78
|
title: tooltipTitle
|
|
79
79
|
}, /*#__PURE__*/React.createElement("div", {
|
|
80
80
|
className: "".concat(styles['ele-point-card3']),
|
|
81
|
-
onClick:
|
|
82
|
-
|
|
81
|
+
onClick: function onClick(e) {
|
|
82
|
+
return eventHandles.current.onClick(e);
|
|
83
|
+
},
|
|
84
|
+
onContextMenu: function onContextMenu(e) {
|
|
85
|
+
return eventHandles.current.onContextMenu(e);
|
|
86
|
+
}
|
|
83
87
|
// className=""
|
|
84
88
|
,
|
|
85
|
-
onMouseEnter:
|
|
86
|
-
|
|
89
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
90
|
+
return eventHandles.current.onMouseEnter(e);
|
|
91
|
+
},
|
|
92
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
93
|
+
return eventHandles.current.onMouseLeave(e);
|
|
94
|
+
},
|
|
87
95
|
style: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, payload === null || payload === void 0 ? void 0 : payload.fontStyles), payload === null || payload === void 0 ? void 0 : payload.borderStyles), payload === null || payload === void 0 ? void 0 : payload.fillStyles), payload === null || payload === void 0 ? void 0 : payload.margin_padding)
|
|
88
96
|
}, /*#__PURE__*/React.createElement("div", {
|
|
89
97
|
className: styles.iconWrap,
|
|
@@ -48,10 +48,18 @@ var PointItem = function PointItem(_ref2) {
|
|
|
48
48
|
point: point
|
|
49
49
|
}) : false
|
|
50
50
|
}, /*#__PURE__*/React.createElement("div", {
|
|
51
|
-
onClick:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
onClick: function onClick(e) {
|
|
52
|
+
return eventHandles.current.onClick(e);
|
|
53
|
+
},
|
|
54
|
+
onContextMenu: function onContextMenu(e) {
|
|
55
|
+
return eventHandles.current.onContextMenu(e);
|
|
56
|
+
},
|
|
57
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
58
|
+
return eventHandles.current.onMouseEnter(e);
|
|
59
|
+
},
|
|
60
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
61
|
+
return eventHandles.current.onMouseLeave(e);
|
|
62
|
+
},
|
|
55
63
|
style: style,
|
|
56
64
|
className: styles.item
|
|
57
65
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -75,10 +75,18 @@ var ElePointControl1Component = function ElePointControl1Component(_ref) {
|
|
|
75
75
|
title: tooltipTitle
|
|
76
76
|
}, /*#__PURE__*/React.createElement("div", {
|
|
77
77
|
className: "".concat(styles['ele-point-card3']),
|
|
78
|
-
onClick:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
onClick: function onClick(e) {
|
|
79
|
+
return eventHandles.current.onClick(e);
|
|
80
|
+
},
|
|
81
|
+
onContextMenu: function onContextMenu(e) {
|
|
82
|
+
return eventHandles.current.onContextMenu(e);
|
|
83
|
+
},
|
|
84
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
85
|
+
return eventHandles.current.onMouseEnter(e);
|
|
86
|
+
},
|
|
87
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
88
|
+
return eventHandles.current.onMouseLeave(e);
|
|
89
|
+
},
|
|
82
90
|
style: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, payload === null || payload === void 0 ? void 0 : payload.fontStyles), payload === null || payload === void 0 ? void 0 : payload.borderStyles), payload === null || payload === void 0 ? void 0 : payload.fillStyles), payload === null || payload === void 0 ? void 0 : payload.margin_padding)
|
|
83
91
|
}, /*#__PURE__*/React.createElement("div", {
|
|
84
92
|
style: _objectSpread(_objectSpread({}, payload === null || payload === void 0 ? void 0 : payload.label.fontStyles), payload === null || payload === void 0 ? void 0 : (_payload$label = payload.label) === null || _payload$label === void 0 ? void 0 : _payload$label.margin_padding),
|
|
@@ -96,10 +96,18 @@ var ElePointControl3Component = function ElePointControl3Component(_ref) {
|
|
|
96
96
|
title: tooltipTitle
|
|
97
97
|
}, /*#__PURE__*/React.createElement("div", {
|
|
98
98
|
className: styles.wrap,
|
|
99
|
-
onClick:
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
onClick: function onClick(e) {
|
|
100
|
+
return eventHandles.current.onClick(e);
|
|
101
|
+
},
|
|
102
|
+
onContextMenu: function onContextMenu(e) {
|
|
103
|
+
return eventHandles.current.onContextMenu(e);
|
|
104
|
+
},
|
|
105
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
106
|
+
return eventHandles.current.onMouseEnter(e);
|
|
107
|
+
},
|
|
108
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
109
|
+
return eventHandles.current.onMouseLeave(e);
|
|
110
|
+
},
|
|
103
111
|
style: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, payload === null || payload === void 0 ? void 0 : payload.fontStyles), payload === null || payload === void 0 ? void 0 : payload.borderStyles), payload === null || payload === void 0 ? void 0 : payload.fillStyles), payload === null || payload === void 0 ? void 0 : payload.margin_padding)
|
|
104
112
|
}, !!(payload === null || payload === void 0 ? void 0 : payload.icon.isShow) ? /*#__PURE__*/React.createElement(Icon, {
|
|
105
113
|
type: "icon-".concat((payload === null || payload === void 0 ? void 0 : payload.icon.name) || defaultIconName),
|
package/es/element/type.d.ts
CHANGED
|
@@ -39,11 +39,13 @@ declare namespace Ele {
|
|
|
39
39
|
/** 打开链接 */
|
|
40
40
|
| 'open-url'
|
|
41
41
|
/** 点位值写入 */
|
|
42
|
-
| 'write-point'
|
|
42
|
+
| 'write-point'
|
|
43
|
+
/** 场景组态切换 */
|
|
44
|
+
| 'freedom-scene-switch';
|
|
43
45
|
export type Event = {
|
|
44
46
|
type: EventType;
|
|
45
47
|
action: EventAction;
|
|
46
|
-
value?:
|
|
48
|
+
value?: any;
|
|
47
49
|
payload?: any;
|
|
48
50
|
};
|
|
49
51
|
|
|
@@ -142,4 +144,4 @@ declare namespace Ele {
|
|
|
142
144
|
/** 12px | 12px 12px 12px 12px */
|
|
143
145
|
margin?: `${number}px` | `${number}px ${number}px ${number}px ${number}px`;
|
|
144
146
|
};
|
|
145
|
-
}
|
|
147
|
+
}
|
|
@@ -53,6 +53,9 @@ export default function handleEleEvent() {
|
|
|
53
53
|
return isString(v.identifierName);
|
|
54
54
|
}));
|
|
55
55
|
return;
|
|
56
|
+
case 'freedom-scene-switch':
|
|
57
|
+
emitter.emit("freedom-scene-switch-".concat(payload.namespace), event.value ? Number(event.value) : undefined);
|
|
58
|
+
return;
|
|
56
59
|
default:
|
|
57
60
|
return;
|
|
58
61
|
}
|
|
@@ -3,6 +3,12 @@ import { handleEleEvent } from "../element/utils";
|
|
|
3
3
|
export default function useEleEventHandle(_ref) {
|
|
4
4
|
var events = _ref.events,
|
|
5
5
|
payload = _ref.payload;
|
|
6
|
+
// const [eventHandles, setEventHandles] = useState<EventHandles>({
|
|
7
|
+
// onClick: () => {},
|
|
8
|
+
// onContextMenu: () => {},
|
|
9
|
+
// onMouseEnter: () => {},
|
|
10
|
+
// onMouseLeave: () => {},
|
|
11
|
+
// })
|
|
6
12
|
var eventHandles = useRef({
|
|
7
13
|
onClick: function onClick() {},
|
|
8
14
|
onContextMenu: function onContextMenu() {},
|
|
@@ -32,5 +38,5 @@ export default function useEleEventHandle(_ref) {
|
|
|
32
38
|
onMouseLeave: onMouseLeave
|
|
33
39
|
};
|
|
34
40
|
}, [events, payload]);
|
|
35
|
-
return eventHandles
|
|
41
|
+
return eventHandles;
|
|
36
42
|
}
|
|
@@ -27,10 +27,11 @@ import emitter from "../../../utils/events";
|
|
|
27
27
|
import { GetDevicePoint } from "../../../services/gateway/Device";
|
|
28
28
|
import "./index.css";
|
|
29
29
|
/** 刷新频率 */
|
|
30
|
-
var RefreshFrequency = 5 * 1000;
|
|
30
|
+
var RefreshFrequency = 1.5 * 60 * 1000;
|
|
31
31
|
var Player = function Player(_ref) {
|
|
32
32
|
var jsonConfig = _ref.jsonConfig,
|
|
33
|
-
query = _ref.query
|
|
33
|
+
query = _ref.query,
|
|
34
|
+
onEvent = _ref.onEvent;
|
|
34
35
|
var graphRef = useRef(null);
|
|
35
36
|
var wrapRef = useRef(null);
|
|
36
37
|
var playerRef = useRef(null);
|
|
@@ -250,6 +251,37 @@ var Player = function Player(_ref) {
|
|
|
250
251
|
emitter.off(eventName, handler);
|
|
251
252
|
};
|
|
252
253
|
}, [query, mittMeta]);
|
|
254
|
+
|
|
255
|
+
// 监听场景组态切换事件
|
|
256
|
+
useEffect(function () {
|
|
257
|
+
var handler = /*#__PURE__*/function () {
|
|
258
|
+
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(scadaId) {
|
|
259
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
260
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
261
|
+
case 0:
|
|
262
|
+
onEvent === null || onEvent === void 0 ? void 0 : onEvent({
|
|
263
|
+
event: 'freedom-scene-switch',
|
|
264
|
+
payload: {
|
|
265
|
+
scadaId: scadaId
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
case 1:
|
|
269
|
+
case "end":
|
|
270
|
+
return _context4.stop();
|
|
271
|
+
}
|
|
272
|
+
}, _callee4);
|
|
273
|
+
}));
|
|
274
|
+
return function handler(_x4) {
|
|
275
|
+
return _ref6.apply(this, arguments);
|
|
276
|
+
};
|
|
277
|
+
}();
|
|
278
|
+
var mittMeta = getMittMeta(query);
|
|
279
|
+
var eventName = "freedom-scene-switch-".concat(mittMeta.namespace);
|
|
280
|
+
emitter.on(eventName, handler);
|
|
281
|
+
return function () {
|
|
282
|
+
emitter.off(eventName, handler);
|
|
283
|
+
};
|
|
284
|
+
}, [query, onEvent]);
|
|
253
285
|
useEffect(function () {
|
|
254
286
|
if (!playerRef.current) return;
|
|
255
287
|
graphRef.current = new Graph({
|
|
@@ -308,23 +340,23 @@ var Player = function Player(_ref) {
|
|
|
308
340
|
// scene === 'device' 加载设备点位数据
|
|
309
341
|
useEffect(function () {
|
|
310
342
|
var fetchDevicePoints = /*#__PURE__*/function () {
|
|
311
|
-
var
|
|
343
|
+
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(deviceId) {
|
|
312
344
|
var res, pointList;
|
|
313
|
-
return _regeneratorRuntime().wrap(function
|
|
314
|
-
while (1) switch (
|
|
345
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
346
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
315
347
|
case 0:
|
|
316
|
-
|
|
348
|
+
_context5.next = 2;
|
|
317
349
|
return GetDevicePoint({
|
|
318
350
|
deviceIdList: [deviceId]
|
|
319
351
|
}, []);
|
|
320
352
|
case 2:
|
|
321
|
-
res =
|
|
353
|
+
res = _context5.sent;
|
|
322
354
|
if (res.success) {
|
|
323
|
-
|
|
355
|
+
_context5.next = 6;
|
|
324
356
|
break;
|
|
325
357
|
}
|
|
326
358
|
message.error('设备点位数据获取失败');
|
|
327
|
-
return
|
|
359
|
+
return _context5.abrupt("return");
|
|
328
360
|
case 6:
|
|
329
361
|
pointList = res.data || [];
|
|
330
362
|
pointList.forEach(function (v) {
|
|
@@ -333,12 +365,12 @@ var Player = function Player(_ref) {
|
|
|
333
365
|
});
|
|
334
366
|
case 8:
|
|
335
367
|
case "end":
|
|
336
|
-
return
|
|
368
|
+
return _context5.stop();
|
|
337
369
|
}
|
|
338
|
-
},
|
|
370
|
+
}, _callee5);
|
|
339
371
|
}));
|
|
340
|
-
return function fetchDevicePoints(
|
|
341
|
-
return
|
|
372
|
+
return function fetchDevicePoints(_x5) {
|
|
373
|
+
return _ref7.apply(this, arguments);
|
|
342
374
|
};
|
|
343
375
|
}();
|
|
344
376
|
var timer;
|
|
@@ -358,23 +390,23 @@ var Player = function Player(_ref) {
|
|
|
358
390
|
// scene === 'freedom' 加载设备点位数据
|
|
359
391
|
useEffect(function () {
|
|
360
392
|
var fetchDevicePoints = /*#__PURE__*/function () {
|
|
361
|
-
var
|
|
393
|
+
var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(ids) {
|
|
362
394
|
var res, pointList;
|
|
363
|
-
return _regeneratorRuntime().wrap(function
|
|
364
|
-
while (1) switch (
|
|
395
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
396
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
365
397
|
case 0:
|
|
366
|
-
|
|
398
|
+
_context6.next = 2;
|
|
367
399
|
return GetDevicePoint({
|
|
368
400
|
pointIdList: ids
|
|
369
401
|
}, []);
|
|
370
402
|
case 2:
|
|
371
|
-
res =
|
|
403
|
+
res = _context6.sent;
|
|
372
404
|
if (res.success) {
|
|
373
|
-
|
|
405
|
+
_context6.next = 6;
|
|
374
406
|
break;
|
|
375
407
|
}
|
|
376
408
|
message.error('设备点位数据获取失败');
|
|
377
|
-
return
|
|
409
|
+
return _context6.abrupt("return");
|
|
378
410
|
case 6:
|
|
379
411
|
pointList = res.data || [];
|
|
380
412
|
pointList.forEach(function (v) {
|
|
@@ -382,12 +414,12 @@ var Player = function Player(_ref) {
|
|
|
382
414
|
});
|
|
383
415
|
case 8:
|
|
384
416
|
case "end":
|
|
385
|
-
return
|
|
417
|
+
return _context6.stop();
|
|
386
418
|
}
|
|
387
|
-
},
|
|
419
|
+
}, _callee6);
|
|
388
420
|
}));
|
|
389
|
-
return function fetchDevicePoints(
|
|
390
|
-
return
|
|
421
|
+
return function fetchDevicePoints(_x6) {
|
|
422
|
+
return _ref8.apply(this, arguments);
|
|
391
423
|
};
|
|
392
424
|
}();
|
|
393
425
|
var timer;
|
|
@@ -9,7 +9,7 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
9
9
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
10
10
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
11
11
|
import React from "react";
|
|
12
|
-
import { useEffect, useState
|
|
12
|
+
import { useEffect, useState } from 'react';
|
|
13
13
|
import { message } from 'antd';
|
|
14
14
|
import { queryToObject } from "../../utils";
|
|
15
15
|
import { GetProductConfiguration } from "../../services/product/Product";
|
|
@@ -21,7 +21,8 @@ import ScadaEmpty from "./components/Empty";
|
|
|
21
21
|
import styles from "./index.css";
|
|
22
22
|
import { storeToken } from "../../utils/auth";
|
|
23
23
|
var Display = function Display(_ref) {
|
|
24
|
-
var query_ = _ref.query_
|
|
24
|
+
var query_ = _ref.query_,
|
|
25
|
+
onEvent = _ref.onEvent;
|
|
25
26
|
var _useState = useState(),
|
|
26
27
|
_useState2 = _slicedToArray(_useState, 2),
|
|
27
28
|
jsonConfig = _useState2[0],
|
|
@@ -30,7 +31,7 @@ var Display = function Display(_ref) {
|
|
|
30
31
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
31
32
|
loading = _useState4[0],
|
|
32
33
|
setLoading = _useState4[1];
|
|
33
|
-
var
|
|
34
|
+
var q = query_ || queryToObject(window.location.href);
|
|
34
35
|
useEffect(function () {
|
|
35
36
|
if (query_) {
|
|
36
37
|
// 被当成组件使用时(非 iframe ),设置接口请求的 prefix
|
|
@@ -42,11 +43,13 @@ var Display = function Display(_ref) {
|
|
|
42
43
|
|
|
43
44
|
// 获取组态配置
|
|
44
45
|
useEffect(function () {
|
|
45
|
-
var query =
|
|
46
|
+
var query = query_ || queryToObject(window.location.href);
|
|
46
47
|
if (!query) return;
|
|
47
48
|
if (query.token && query.xToken) {
|
|
48
49
|
storeToken(query.token, query.xToken);
|
|
49
50
|
}
|
|
51
|
+
|
|
52
|
+
// 产品组态
|
|
50
53
|
if (query.scene === 'product') {
|
|
51
54
|
var fetchProductScadaConfig = /*#__PURE__*/function () {
|
|
52
55
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
@@ -106,6 +109,8 @@ var Display = function Display(_ref) {
|
|
|
106
109
|
}();
|
|
107
110
|
fetchProductScadaConfig();
|
|
108
111
|
}
|
|
112
|
+
|
|
113
|
+
// 设备组态
|
|
109
114
|
if (query.scene === 'device') {
|
|
110
115
|
var fetchDeviceScadaConfig = /*#__PURE__*/function () {
|
|
111
116
|
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
@@ -160,10 +165,12 @@ var Display = function Display(_ref) {
|
|
|
160
165
|
}();
|
|
161
166
|
fetchDeviceScadaConfig();
|
|
162
167
|
}
|
|
168
|
+
|
|
169
|
+
// 场景组态
|
|
163
170
|
if (query.scene === 'freedom') {
|
|
164
171
|
var _fetchDeviceScadaConfig = /*#__PURE__*/function () {
|
|
165
172
|
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
166
|
-
var _data$list, _yield$GetCompanyConf, success, data, scadaConfig;
|
|
173
|
+
var _data$list, _configJSON$cells, _yield$GetCompanyConf, success, data, scadaConfig, configJSON;
|
|
167
174
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
168
175
|
while (1) switch (_context3.prev = _context3.next) {
|
|
169
176
|
case 0:
|
|
@@ -187,25 +194,39 @@ var Display = function Display(_ref) {
|
|
|
187
194
|
return _context3.abrupt("return");
|
|
188
195
|
case 10:
|
|
189
196
|
scadaConfig = data.list[0].config;
|
|
197
|
+
configJSON = JSON.parse(scadaConfig || '{}'); // 修复后端保存数据时,因json数据种存在"%"而导致的"%"数据丢失问题
|
|
198
|
+
if (configJSON === null || configJSON === void 0 ? void 0 : (_configJSON$cells = configJSON.cells) === null || _configJSON$cells === void 0 ? void 0 : _configJSON$cells.length) {
|
|
199
|
+
configJSON === null || configJSON === void 0 ? void 0 : configJSON.cells.forEach(function (item) {
|
|
200
|
+
var _item$attrs, _item$attrs$body, _item$attrs2, _item$attrs2$body, _item$attrs2$body$ref, _item$attrs3, _item$attrs3$body, _item$attrs5, _item$attrs5$body, _item$attrs6, _item$attrs6$body, _item$attrs6$body$ref, _item$attrs7, _item$attrs7$body;
|
|
201
|
+
if ((item === null || item === void 0 ? void 0 : (_item$attrs = item.attrs) === null || _item$attrs === void 0 ? void 0 : (_item$attrs$body = _item$attrs.body) === null || _item$attrs$body === void 0 ? void 0 : _item$attrs$body.refWidth) && (item === null || item === void 0 ? void 0 : (_item$attrs2 = item.attrs) === null || _item$attrs2 === void 0 ? void 0 : (_item$attrs2$body = _item$attrs2.body) === null || _item$attrs2$body === void 0 ? void 0 : (_item$attrs2$body$ref = _item$attrs2$body.refWidth) === null || _item$attrs2$body$ref === void 0 ? void 0 : _item$attrs2$body$ref.indexOf('%')) === -1 && !isNaN(Number(item === null || item === void 0 ? void 0 : (_item$attrs3 = item.attrs) === null || _item$attrs3 === void 0 ? void 0 : (_item$attrs3$body = _item$attrs3.body) === null || _item$attrs3$body === void 0 ? void 0 : _item$attrs3$body.refWidth))) {
|
|
202
|
+
var _item$attrs4, _item$attrs4$body;
|
|
203
|
+
item.attrs.body.refWidth = "".concat(item === null || item === void 0 ? void 0 : (_item$attrs4 = item.attrs) === null || _item$attrs4 === void 0 ? void 0 : (_item$attrs4$body = _item$attrs4.body) === null || _item$attrs4$body === void 0 ? void 0 : _item$attrs4$body.refWidth, "%");
|
|
204
|
+
}
|
|
205
|
+
if ((item === null || item === void 0 ? void 0 : (_item$attrs5 = item.attrs) === null || _item$attrs5 === void 0 ? void 0 : (_item$attrs5$body = _item$attrs5.body) === null || _item$attrs5$body === void 0 ? void 0 : _item$attrs5$body.refHeight) && (item === null || item === void 0 ? void 0 : (_item$attrs6 = item.attrs) === null || _item$attrs6 === void 0 ? void 0 : (_item$attrs6$body = _item$attrs6.body) === null || _item$attrs6$body === void 0 ? void 0 : (_item$attrs6$body$ref = _item$attrs6$body.refHeight) === null || _item$attrs6$body$ref === void 0 ? void 0 : _item$attrs6$body$ref.indexOf('%')) === -1 && !isNaN(Number(item === null || item === void 0 ? void 0 : (_item$attrs7 = item.attrs) === null || _item$attrs7 === void 0 ? void 0 : (_item$attrs7$body = _item$attrs7.body) === null || _item$attrs7$body === void 0 ? void 0 : _item$attrs7$body.refHeight))) {
|
|
206
|
+
var _item$attrs8, _item$attrs8$body;
|
|
207
|
+
item.attrs.body.refHeight = "".concat(item === null || item === void 0 ? void 0 : (_item$attrs8 = item.attrs) === null || _item$attrs8 === void 0 ? void 0 : (_item$attrs8$body = _item$attrs8.body) === null || _item$attrs8$body === void 0 ? void 0 : _item$attrs8$body.refHeight, "%");
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
}
|
|
190
211
|
if (scadaConfig) {
|
|
191
212
|
setJsonConfig(JSON.parse((scadaConfig || '{}').replaceAll('https://coolcare-scada.oss-cn-shanghai.aliyuncs.com/', 'http://10.189.40.132:9000/iot/').replaceAll('https://front-end-assets.oss-cn-shanghai.aliyuncs.com/', 'http://10.189.40.132:9000/iot/')));
|
|
192
213
|
}
|
|
193
|
-
_context3.next =
|
|
214
|
+
_context3.next = 20;
|
|
194
215
|
break;
|
|
195
|
-
case
|
|
196
|
-
_context3.prev =
|
|
216
|
+
case 16:
|
|
217
|
+
_context3.prev = 16;
|
|
197
218
|
_context3.t0 = _context3["catch"](0);
|
|
198
219
|
console.error(_context3.t0);
|
|
199
220
|
message.error('组态配置获取失败');
|
|
200
|
-
case
|
|
201
|
-
_context3.prev =
|
|
221
|
+
case 20:
|
|
222
|
+
_context3.prev = 20;
|
|
202
223
|
setLoading(false);
|
|
203
|
-
return _context3.finish(
|
|
204
|
-
case
|
|
224
|
+
return _context3.finish(20);
|
|
225
|
+
case 23:
|
|
205
226
|
case "end":
|
|
206
227
|
return _context3.stop();
|
|
207
228
|
}
|
|
208
|
-
}, _callee3, null, [[0,
|
|
229
|
+
}, _callee3, null, [[0, 16, 20, 23]]);
|
|
209
230
|
}));
|
|
210
231
|
return function _fetchDeviceScadaConfig() {
|
|
211
232
|
return _ref4.apply(this, arguments);
|
|
@@ -213,7 +234,7 @@ var Display = function Display(_ref) {
|
|
|
213
234
|
}();
|
|
214
235
|
_fetchDeviceScadaConfig();
|
|
215
236
|
}
|
|
216
|
-
}, []);
|
|
237
|
+
}, [query_]);
|
|
217
238
|
useEffect(function () {
|
|
218
239
|
window.addEventListener('message', function (e) {
|
|
219
240
|
var data = e.data;
|
|
@@ -230,9 +251,10 @@ var Display = function Display(_ref) {
|
|
|
230
251
|
return /*#__PURE__*/React.createElement("div", {
|
|
231
252
|
className: styles.wrap,
|
|
232
253
|
id: "scada-body"
|
|
233
|
-
}, !!
|
|
254
|
+
}, !!q && /*#__PURE__*/React.createElement(Player, {
|
|
234
255
|
jsonConfig: jsonConfig,
|
|
235
|
-
query:
|
|
256
|
+
query: q,
|
|
257
|
+
onEvent: onEvent
|
|
236
258
|
}), !loading && !jsonConfig && /*#__PURE__*/React.createElement(ScadaEmpty, null));
|
|
237
259
|
};
|
|
238
260
|
export default Display;
|
|
@@ -35,6 +35,9 @@ var actionOptions = [{
|
|
|
35
35
|
}, {
|
|
36
36
|
label: '点位写入',
|
|
37
37
|
value: 'write-point'
|
|
38
|
+
}, {
|
|
39
|
+
label: '场景组态切换',
|
|
40
|
+
value: 'freedom-scene-switch'
|
|
38
41
|
}];
|
|
39
42
|
var formLayout = {
|
|
40
43
|
wrapperCol: {
|
|
@@ -170,16 +173,30 @@ var FormBindEvent = function FormBindEvent() {
|
|
|
170
173
|
shouldUpdate: true
|
|
171
174
|
}, function (_ref5) {
|
|
172
175
|
var getFieldValue = _ref5.getFieldValue;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
176
|
+
if (getFieldValue(['events', index, 'action']) === 'open-url') {
|
|
177
|
+
return /*#__PURE__*/React.createElement(Form.Item, _extends({}, field, {
|
|
178
|
+
key: "".concat(field.key, "value"),
|
|
179
|
+
label: "\u94FE\u63A5\xA0",
|
|
180
|
+
name: [field.name, 'value'],
|
|
181
|
+
fieldKey: [field.fieldKey, 'value'],
|
|
182
|
+
rules: [{
|
|
183
|
+
required: true,
|
|
184
|
+
message: '请输入'
|
|
185
|
+
}]
|
|
186
|
+
}), /*#__PURE__*/React.createElement(Input, null));
|
|
187
|
+
}
|
|
188
|
+
if (getFieldValue(['events', index, 'action']) === 'freedom-scene-switch') {
|
|
189
|
+
return /*#__PURE__*/React.createElement(Form.Item, _extends({}, field, {
|
|
190
|
+
key: "".concat(field.key, "value"),
|
|
191
|
+
label: "\u573A\u666FID\xA0",
|
|
192
|
+
name: [field.name, 'value'],
|
|
193
|
+
fieldKey: [field.fieldKey, 'value'],
|
|
194
|
+
rules: [{
|
|
195
|
+
required: true,
|
|
196
|
+
message: '请输入'
|
|
197
|
+
}]
|
|
198
|
+
}), /*#__PURE__*/React.createElement(Input, null));
|
|
199
|
+
}
|
|
183
200
|
}));
|
|
184
201
|
}), /*#__PURE__*/React.createElement(Form.Item, {
|
|
185
202
|
wrapperCol: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coolcare-lite-scada-component",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.30",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "umi dev",
|
|
6
6
|
"build:prod": "UMI_ENV=prod umi build",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"test": "umi-test",
|
|
14
14
|
"test:coverage": "umi-test --coverage",
|
|
15
15
|
"analyze": "ANALYZE=1 umi build",
|
|
16
|
-
"deploy:prod": "docker build -t xiiman-docker.pkg.coding.net/coolcare-lite/coolcare-scada/yimin:master-2024-
|
|
16
|
+
"deploy:prod": "docker build -t xiiman-docker.pkg.coding.net/coolcare-lite/coolcare-scada/yimin:master-2024-12-2 . && docker push xiiman-docker.pkg.coding.net/coolcare-lite/coolcare-scada/yimin:master-2024-12-2"
|
|
17
17
|
},
|
|
18
18
|
"main": "./es/componentIndex.js",
|
|
19
19
|
"module": "./es/componentIndex.js",
|