coolcare-lite-scada-component 4.1.0 → 4.1.2
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/app.js +23 -0
- package/es/components/BoxShadowPicker/index.less.d.ts +9 -9
- package/es/components/ColorPicker/util.js +4 -4
- package/es/components/DialogHistory/index.css +22 -0
- package/es/components/DialogHistory/index.js +388 -79
- package/es/components/DialogImagePicker/GroupPanel/index.js +1 -12
- package/es/components/ECharts/index.js +31 -23
- package/es/components/FormBindPoint/FreedomScene.js +181 -11
- package/es/components/FormBindPoint/ProductionOrDeviceScene.js +12 -5
- package/es/components/FormBindPoint/index.js +6 -0
- package/es/components/Icon/index.js +1 -1
- package/es/components/IconFont/index.js +6 -0
- package/es/components/ImageUploader/index.js +8 -7
- package/es/components/ModalChangePointValue.js +272 -0
- package/es/components/ModalChoosePoint/index.js +53 -16
- package/es/components/PointSelect/DeviceIndicatorTable.js +111 -0
- package/es/components/PointSelect/IndicatorSelect.js +182 -0
- package/es/constant.js +2 -2
- package/es/element/BorderBox/util/typings.d.ts +9 -9
- package/es/element/Decoration/util/typings.d.ts +9 -9
- package/es/element/EleFan/Component.js +1 -1
- package/es/element/EleFanBySvg/index.js +3 -3
- package/es/element/EleImage/index.js +1 -1
- package/es/element/ElePointImage/Component.js +30 -41
- package/es/element/ElePointImage/index.js +1 -1
- package/es/element/ElePointValue/Component.js +117 -17
- package/es/element/ElePointValue/PropsSet/StatisticsPropsSet/index.js +6 -0
- package/es/element/ElePointValue/index.css +11 -0
- package/es/element/ElePointValue/index.js +6 -0
- package/es/element/EleShine/Component.js +133 -23
- package/es/element/EleShine/PropsSet/OtherPropsSet/index.js +27 -34
- package/es/element/EleShine/PropsSet/PointAlarmTool.js +99 -0
- package/es/element/EleShine/PropsSet/index.js +9 -1
- package/es/element/EleShine/index.js +2 -1
- package/es/element/EleState/index.js +1 -1
- package/es/element/EleSwitch/Component.js +2 -12
- package/es/element/PipeNodes/NodeBL/index.js +1 -1
- package/es/element/PipeNodes/NodeBR/index.js +1 -1
- package/es/element/PipeNodes/NodeBottom/index.js +1 -1
- package/es/element/PipeNodes/NodeCenter/index.js +1 -1
- package/es/element/PipeNodes/NodeHorizontal/index.js +1 -1
- package/es/element/PipeNodes/NodeLeft/index.js +1 -1
- package/es/element/PipeNodes/NodeRight/index.js +1 -1
- package/es/element/PipeNodes/NodeTL/index.js +1 -1
- package/es/element/PipeNodes/NodeTR/index.js +1 -1
- package/es/element/PipeNodes/NodeTop/index.js +1 -1
- package/es/element/PipeNodes/NodeVertical/index.js +1 -1
- package/es/element/PointCard/PointListCard/Component.js +3 -2
- package/es/element/PointCard/PointListCard/index.js +1 -0
- package/es/element/type.d.ts +4 -6
- package/es/element/utils/getValueByExpression.js +3 -0
- package/es/element/utils/handleEleEvent.js +11 -1
- package/es/element/utils/pointWrite.js +4 -5
- package/es/hooks/usePointWatch.js +1 -1
- package/es/models/useEditor.js +14 -8
- package/es/pages/display/Player/index.js +444 -123
- package/es/pages/display/index.js +2 -2
- package/es/pages/document.ejs +1 -1
- package/es/pages/editor/PanelLeft/BasicShapeList/listData.js +8 -8
- package/es/pages/editor/PanelLeft/BorderBoxEleList/index.less.d.ts +7 -7
- package/es/pages/editor/PanelLeft/DecorationEleList/index.less.d.ts +7 -7
- package/es/pages/editor/PanelLeft/GroupManageDialog/index.js +4 -4
- package/es/pages/editor/PanelLeft/ImgGroup/index.js +1 -12
- package/es/pages/editor/PanelLeft/MetaEleList/listData.js +14 -14
- package/es/pages/editor/PanelLeft/PipeEleList/listData.js +11 -11
- package/es/pages/editor/PanelLeft/PointCardEleList/listData.js +6 -6
- package/es/pages/editor/PanelLeft/RecommendEleList/listData.js +4 -4
- package/es/pages/editor/PanelLeft/index.js +3 -3
- package/es/pages/editor/PanelRight/components/FormLayer/index.js +3 -1
- package/es/pages/editor/PanelRight/index.less.d.ts +7 -7
- package/es/pages/editor/PanelTop/HotKeyDescribe/index.js +1 -1
- package/es/pages/editor/PanelTop/Save/index.js +120 -67
- package/es/pages/editor/index.js +223 -135
- package/es/pages/editor/utils/scadaChangeLog.js +237 -0
- package/es/services/common/Uploader.js +1 -1
- package/es/services/common/typings.d.ts +15 -15
- package/es/services/energy/index.js +56 -0
- package/es/services/gateway/Device.js +22 -0
- package/es/services/gateway/Point.js +46 -25
- package/es/services/gateway/typings.d.ts +3 -0
- package/es/services/master/typings.d.ts +362 -362
- package/es/services/product/typings.d.ts +1045 -1045
- package/es/services/project/typings.d.ts +1609 -1609
- package/es/services/request.js +126 -13
- package/es/shims.x6.d.ts +15 -15
- package/es/typings.d.ts +12 -0
- package/es/utils/auth.js +6 -2
- package/es/utils/cssStyle.js +4 -4
- package/es/utils/dataURItoBlob.js +25 -0
- package/es/utils/date.js +7 -0
- package/es/utils/decomposeMatrix.js +5 -5
- package/es/utils/events.js +3 -3
- package/es/utils/index.js +34 -34
- package/es/utils/pointValueFormat.js +3 -3
- package/package.json +16 -15
- package/es/elementCss.css +0 -19
package/es/element/type.d.ts
CHANGED
|
@@ -61,11 +61,11 @@ declare namespace Ele {
|
|
|
61
61
|
pointId: string;
|
|
62
62
|
/** 范围表达式 */
|
|
63
63
|
expressions?: RangeExpression[];
|
|
64
|
-
|
|
64
|
+
dataType?: string;
|
|
65
|
+
deviceType?: string;
|
|
66
|
+
meterId?: string;
|
|
65
67
|
decimalEnabled?: boolean;
|
|
66
|
-
/** 数值展示的小数位数,范围为 0–6 */
|
|
67
68
|
decimalPlaces?: number;
|
|
68
|
-
/** 是否保留小数展示的末尾零 */
|
|
69
69
|
decimalTrailingZeros?: boolean;
|
|
70
70
|
}
|
|
71
71
|
| {
|
|
@@ -74,11 +74,8 @@ declare namespace Ele {
|
|
|
74
74
|
identifierName: string;
|
|
75
75
|
/** 范围表达式 */
|
|
76
76
|
expressions?: RangeExpression[];
|
|
77
|
-
/** 是否按配置的小数位数展示数值 */
|
|
78
77
|
decimalEnabled?: boolean;
|
|
79
|
-
/** 数值展示的小数位数,范围为 0–6 */
|
|
80
78
|
decimalPlaces?: number;
|
|
81
|
-
/** 是否保留小数展示的末尾零 */
|
|
82
79
|
decimalTrailingZeros?: boolean;
|
|
83
80
|
};
|
|
84
81
|
|
|
@@ -143,6 +140,7 @@ declare namespace Ele {
|
|
|
143
140
|
/** 点击选择器-是否禁止选择不可写的点位 */
|
|
144
141
|
pointSelect_disabledUnWriteable?: boolean;
|
|
145
142
|
mittMeta?: MittMeta;
|
|
143
|
+
payload?: string[];
|
|
146
144
|
};
|
|
147
145
|
|
|
148
146
|
export type Size = {
|
|
@@ -5,6 +5,9 @@ function getValueByExpression(val, expressions) {
|
|
|
5
5
|
return undefined;
|
|
6
6
|
}
|
|
7
7
|
if (!expressions || !(expressions === null || expressions === void 0 ? void 0 : expressions.length) || !Array.isArray(expressions)) {
|
|
8
|
+
if (typeof val === 'number') {
|
|
9
|
+
return val.toFixed(1);
|
|
10
|
+
}
|
|
8
11
|
return val;
|
|
9
12
|
}
|
|
10
13
|
var activeExpression;
|
|
@@ -31,7 +31,7 @@ export default function handleEleEvent() {
|
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
33
|
emitter.emit("show-point-history-".concat(payload.namespace), payload.points.filter(function (v) {
|
|
34
|
-
return isString(v.identifierName);
|
|
34
|
+
return isString(v.identifierName || v.indicatorNo);
|
|
35
35
|
}));
|
|
36
36
|
return;
|
|
37
37
|
// 打开链接
|
|
@@ -53,6 +53,16 @@ export default function handleEleEvent() {
|
|
|
53
53
|
return isString(v.identifierName);
|
|
54
54
|
}));
|
|
55
55
|
return;
|
|
56
|
+
// 点位写入2
|
|
57
|
+
case 'show-point-write':
|
|
58
|
+
if (!Array.isArray(payload.points)) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (!payload.points.length) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
emitter.emit("show-point-write-".concat(payload.namespace), payload.points);
|
|
65
|
+
return;
|
|
56
66
|
case 'freedom-scene-switch':
|
|
57
67
|
emitter.emit("freedom-scene-switch-".concat(payload.namespace), event.value ? Number(event.value) : undefined);
|
|
58
68
|
return;
|
|
@@ -101,20 +101,19 @@ export function pointWrite(_x4) {
|
|
|
101
101
|
}
|
|
102
102
|
function _pointWrite() {
|
|
103
103
|
_pointWrite = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(params) {
|
|
104
|
-
var deviceId, value, pointId,
|
|
104
|
+
var query, deviceId, value, pointId, deviceInfo, pointInfo, writeFunction, res, _t3;
|
|
105
105
|
return _regenerator().w(function (_context3) {
|
|
106
106
|
while (1) switch (_context3.p = _context3.n) {
|
|
107
107
|
case 0:
|
|
108
|
-
|
|
109
|
-
deviceId = params.deviceId, value = params.value, pointId = params.pointId;
|
|
110
|
-
query = queryToObject(window.location.href); // 产品组态不能点位写入
|
|
108
|
+
query = queryToObject(window.location.href);
|
|
111
109
|
if (!(query.scene === 'product')) {
|
|
112
110
|
_context3.n = 1;
|
|
113
111
|
break;
|
|
114
112
|
}
|
|
115
113
|
return _context3.a(2);
|
|
116
114
|
case 1:
|
|
117
|
-
//
|
|
115
|
+
// eslint-disable-next-line prefer-const
|
|
116
|
+
deviceId = params.deviceId, value = params.value, pointId = params.pointId; // 如果没有 deviceId(device 场景下),则从 url query 里获取
|
|
118
117
|
if (!deviceId) {
|
|
119
118
|
if (query.scene === 'device') {
|
|
120
119
|
deviceId = parseInt(query.deviceId, 10);
|
|
@@ -18,7 +18,7 @@ function usePointWatch(point, namespace) {
|
|
|
18
18
|
var eventHandler = function eventHandler(val) {
|
|
19
19
|
setPointData(val);
|
|
20
20
|
};
|
|
21
|
-
var eventName = "point-update-".concat('pointId' in point ? point.pointId : point.identifierName, "-").concat(namespace !== null && namespace !== void 0 ? namespace : 0);
|
|
21
|
+
var eventName = "point-update-".concat('pointId' in point ? point.pointId : 'identifierName' in point ? point.identifierName : 'meterId' in point ? point.meterId : 'indicatorNo' in point ? point.indicatorNo : '', "-").concat(namespace !== null && namespace !== void 0 ? namespace : 0);
|
|
22
22
|
emitter.on(eventName, eventHandler);
|
|
23
23
|
return function () {
|
|
24
24
|
// TODO x6 react 组件的 unmount 没有被触发
|
package/es/models/useEditor.js
CHANGED
|
@@ -43,18 +43,22 @@ export default function useEditor() {
|
|
|
43
43
|
_useSetState2 = _slicedToArray(_useSetState, 2),
|
|
44
44
|
pageConfig = _useSetState2[0],
|
|
45
45
|
setPageConfig = _useSetState2[1];
|
|
46
|
+
var _useState5 = useState(''),
|
|
47
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
48
|
+
initialScadaConfigSnapshot = _useState6[0],
|
|
49
|
+
setInitialScadaConfigSnapshot = _useState6[1];
|
|
46
50
|
|
|
47
51
|
/** 缩放大小 */
|
|
48
|
-
var
|
|
49
|
-
|
|
50
|
-
scale =
|
|
51
|
-
setScale =
|
|
52
|
+
var _useState7 = useState(1),
|
|
53
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
54
|
+
scale = _useState8[0],
|
|
55
|
+
setScale = _useState8[1];
|
|
52
56
|
|
|
53
57
|
/** 在 freedom 场景下,用户可选择的设备列表 */
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
userDeviceList =
|
|
57
|
-
setUserDeviceList =
|
|
58
|
+
var _useState9 = useState([]),
|
|
59
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
60
|
+
userDeviceList = _useState0[0],
|
|
61
|
+
setUserDeviceList = _useState0[1];
|
|
58
62
|
var graphCoreRef = useRef(null);
|
|
59
63
|
useEffect(function () {
|
|
60
64
|
var handler = function handler(e) {
|
|
@@ -178,7 +182,9 @@ export default function useEditor() {
|
|
|
178
182
|
activeCell: activeCell,
|
|
179
183
|
selectedCell: selectedCell,
|
|
180
184
|
pageConfig: pageConfig,
|
|
185
|
+
initialScadaConfigSnapshot: initialScadaConfigSnapshot,
|
|
181
186
|
setPageConfig: setPageConfig,
|
|
187
|
+
setInitialScadaConfigSnapshot: setInitialScadaConfigSnapshot,
|
|
182
188
|
fetchUserDeviceList: fetchUserDeviceList
|
|
183
189
|
};
|
|
184
190
|
}
|