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
|
@@ -22,12 +22,7 @@ import { useModel } from 'umi';
|
|
|
22
22
|
import { EditDeviceConfiguration } from "../../../../services/gateway/Device";
|
|
23
23
|
import { AddOrUpdateCompanyConfiguration } from "../../../../services/gateway/CompanyConfiguration";
|
|
24
24
|
import { useQuery } from "../../../../hooks";
|
|
25
|
-
|
|
26
|
-
// const res = await fetch(dataUrl)
|
|
27
|
-
// const blob = await res.blob()
|
|
28
|
-
// return new File([blob], fileName, { type: 'image/jpeg' })
|
|
29
|
-
// }
|
|
30
|
-
|
|
25
|
+
import { buildScadaConfigChangePayload, buildScadaConfigSnapshot, captureScadaScreenshot, getCurrentOperatorId, getScadaConfigSnapshotFromStorage, setScadaConfigSnapshotToStorage } from "../../utils/scadaChangeLog";
|
|
31
26
|
var Save = function Save(_ref) {
|
|
32
27
|
var className = _ref.className,
|
|
33
28
|
iconClassName = _ref.iconClassName,
|
|
@@ -38,126 +33,184 @@ var Save = function Save(_ref) {
|
|
|
38
33
|
setLoading = _useState2[1];
|
|
39
34
|
var _useModel = useModel('useEditor', function (model) {
|
|
40
35
|
return {
|
|
41
|
-
pageConfig: model.pageConfig
|
|
36
|
+
pageConfig: model.pageConfig,
|
|
37
|
+
setInitialScadaConfigSnapshot: model.setInitialScadaConfigSnapshot
|
|
42
38
|
};
|
|
43
39
|
}),
|
|
44
|
-
pageConfig = _useModel.pageConfig
|
|
40
|
+
pageConfig = _useModel.pageConfig,
|
|
41
|
+
setInitialScadaConfigSnapshot = _useModel.setInitialScadaConfigSnapshot;
|
|
45
42
|
var query = useQuery();
|
|
46
|
-
|
|
47
|
-
/** 保存 */
|
|
48
|
-
var handleSave = /*#__PURE__*/function () {
|
|
43
|
+
var buildSaveConfigPayload = /*#__PURE__*/function () {
|
|
49
44
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
50
|
-
var _window
|
|
45
|
+
var _window$graph;
|
|
46
|
+
var graph, graphSnapshot, previousSnapshot, operatorUserId, configChangePayload, _t, _t2, _t3;
|
|
51
47
|
return _regenerator().w(function (_context) {
|
|
52
|
-
while (1) switch (_context.
|
|
48
|
+
while (1) switch (_context.n) {
|
|
49
|
+
case 0:
|
|
50
|
+
graph = window.graph;
|
|
51
|
+
_t = buildScadaConfigSnapshot;
|
|
52
|
+
_t2 = pageConfig;
|
|
53
|
+
_t3 = graph;
|
|
54
|
+
_context.n = 1;
|
|
55
|
+
return captureScadaScreenshot(graph);
|
|
56
|
+
case 1:
|
|
57
|
+
graphSnapshot = _t(_t2, _t3, _context.v);
|
|
58
|
+
previousSnapshot = getScadaConfigSnapshotFromStorage(query);
|
|
59
|
+
operatorUserId = getCurrentOperatorId();
|
|
60
|
+
configChangePayload = buildScadaConfigChangePayload(previousSnapshot, graphSnapshot, operatorUserId, graphSnapshot.screenshot);
|
|
61
|
+
return _context.a(2, {
|
|
62
|
+
config: JSON.stringify(_objectSpread({
|
|
63
|
+
pageConfig: pageConfig
|
|
64
|
+
}, (_window$graph = window.graph) === null || _window$graph === void 0 ? void 0 : _window$graph.toJSON())),
|
|
65
|
+
configChangeLog: JSON.stringify(configChangePayload),
|
|
66
|
+
configHasChanged: configChangePayload.hasChanged,
|
|
67
|
+
operationUserId: operatorUserId,
|
|
68
|
+
graphSnapshot: graphSnapshot
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}, _callee);
|
|
72
|
+
}));
|
|
73
|
+
return function buildSaveConfigPayload() {
|
|
74
|
+
return _ref2.apply(this, arguments);
|
|
75
|
+
};
|
|
76
|
+
}();
|
|
77
|
+
var handleSave = /*#__PURE__*/function () {
|
|
78
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
79
|
+
var _yield$buildSaveConfi, config, configChangeLog, configHasChanged, operationUserId, graphSnapshot, _window, _window$opener, payload, _window$opener2, res, msg, _payload, _res, _payload2, _t4, _t5;
|
|
80
|
+
return _regenerator().w(function (_context2) {
|
|
81
|
+
while (1) switch (_context2.p = _context2.n) {
|
|
53
82
|
case 0:
|
|
83
|
+
_context2.n = 1;
|
|
84
|
+
return buildSaveConfigPayload();
|
|
85
|
+
case 1:
|
|
86
|
+
_yield$buildSaveConfi = _context2.v;
|
|
87
|
+
config = _yield$buildSaveConfi.config;
|
|
88
|
+
configChangeLog = _yield$buildSaveConfi.configChangeLog;
|
|
89
|
+
configHasChanged = _yield$buildSaveConfi.configHasChanged;
|
|
90
|
+
operationUserId = _yield$buildSaveConfi.operationUserId;
|
|
91
|
+
graphSnapshot = _yield$buildSaveConfi.graphSnapshot;
|
|
54
92
|
if (query.scene === 'product') {
|
|
55
93
|
(_window = window) === null || _window === void 0 ? void 0 : (_window$opener = _window.opener) === null || _window$opener === void 0 ? void 0 : _window$opener.postMessage({
|
|
56
94
|
event: 'product-scada-config-change',
|
|
57
95
|
payload: {
|
|
58
|
-
data:
|
|
59
|
-
pageConfig: pageConfig
|
|
60
|
-
}, (_window$graph = window.graph) === null || _window$graph === void 0 ? void 0 : _window$graph.toJSON())),
|
|
96
|
+
data: config,
|
|
61
97
|
productId: Number(query.productId),
|
|
62
98
|
productVersionId: query.productVersionId ? Number(query.productVersionId) : undefined,
|
|
63
|
-
scadaType: Number(query.scadaType)
|
|
99
|
+
scadaType: Number(query.scadaType),
|
|
100
|
+
configHasChanged: configHasChanged,
|
|
101
|
+
configChangeLog: configChangeLog,
|
|
102
|
+
operationUserId: operationUserId
|
|
64
103
|
}
|
|
65
104
|
}, '*');
|
|
105
|
+
payload = JSON.stringify(graphSnapshot);
|
|
106
|
+
setInitialScadaConfigSnapshot(payload);
|
|
107
|
+
setScadaConfigSnapshotToStorage(query, graphSnapshot);
|
|
66
108
|
notification.success({
|
|
67
|
-
message: '
|
|
68
|
-
description:
|
|
109
|
+
message: 'Save success',
|
|
110
|
+
description: 'Save finished, ready for synchronize.',
|
|
69
111
|
duration: 10,
|
|
70
112
|
top: 100
|
|
71
113
|
});
|
|
72
114
|
}
|
|
73
115
|
if (!(query.scene === 'device')) {
|
|
74
|
-
|
|
116
|
+
_context2.n = 7;
|
|
75
117
|
break;
|
|
76
118
|
}
|
|
77
|
-
|
|
119
|
+
_context2.p = 2;
|
|
78
120
|
setLoading(true);
|
|
79
|
-
|
|
121
|
+
_context2.n = 3;
|
|
80
122
|
return EditDeviceConfiguration({
|
|
81
123
|
deviceId: Number(query.deviceId),
|
|
82
|
-
config:
|
|
83
|
-
|
|
84
|
-
|
|
124
|
+
config: config,
|
|
125
|
+
operationUserId: operationUserId,
|
|
126
|
+
configChangeLog: configChangeLog,
|
|
127
|
+
configHasChanged: configHasChanged,
|
|
85
128
|
deviceConfigurationType: Number(query.scadaType)
|
|
86
129
|
});
|
|
87
|
-
case
|
|
88
|
-
res =
|
|
130
|
+
case 3:
|
|
131
|
+
res = _context2.v;
|
|
89
132
|
if (res.success) {
|
|
90
|
-
|
|
133
|
+
_context2.n = 4;
|
|
91
134
|
break;
|
|
92
135
|
}
|
|
93
|
-
message.error('
|
|
94
|
-
return
|
|
95
|
-
case
|
|
96
|
-
message.success('
|
|
136
|
+
message.error('Update failed');
|
|
137
|
+
return _context2.a(2);
|
|
138
|
+
case 4:
|
|
139
|
+
message.success('Update success');
|
|
97
140
|
msg = {
|
|
98
141
|
event: 'device-scada-config-change',
|
|
99
142
|
payload: {
|
|
100
|
-
deviceId: Number(query.deviceId)
|
|
143
|
+
deviceId: Number(query.deviceId),
|
|
144
|
+
operationUserId: operationUserId,
|
|
145
|
+
configHasChanged: configHasChanged,
|
|
146
|
+
configChangeLog: configChangeLog
|
|
101
147
|
}
|
|
102
148
|
};
|
|
149
|
+
_payload = JSON.stringify(graphSnapshot);
|
|
150
|
+
setInitialScadaConfigSnapshot(_payload);
|
|
151
|
+
setScadaConfigSnapshotToStorage(query, graphSnapshot);
|
|
103
152
|
(_window$opener2 = window.opener) === null || _window$opener2 === void 0 ? void 0 : _window$opener2.postMessage(msg, '*');
|
|
104
|
-
|
|
153
|
+
_context2.n = 6;
|
|
105
154
|
break;
|
|
106
|
-
case 4:
|
|
107
|
-
_context.p = 4;
|
|
108
|
-
_t = _context.v;
|
|
109
|
-
console.error(_t);
|
|
110
|
-
message.error('更新失败');
|
|
111
155
|
case 5:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
156
|
+
_context2.p = 5;
|
|
157
|
+
_t4 = _context2.v;
|
|
158
|
+
console.error(_t4);
|
|
159
|
+
message.error('Update failed');
|
|
115
160
|
case 6:
|
|
161
|
+
_context2.p = 6;
|
|
162
|
+
setLoading(false);
|
|
163
|
+
return _context2.f(6);
|
|
164
|
+
case 7:
|
|
116
165
|
if (!(query.scene === 'freedom')) {
|
|
117
|
-
|
|
166
|
+
_context2.n = 13;
|
|
118
167
|
break;
|
|
119
168
|
}
|
|
120
169
|
setLoading(true);
|
|
121
|
-
|
|
122
|
-
|
|
170
|
+
_context2.p = 8;
|
|
171
|
+
_context2.n = 9;
|
|
123
172
|
return AddOrUpdateCompanyConfiguration({
|
|
124
173
|
companyId: Number(query.companyId),
|
|
125
174
|
companyConfigurationId: Number(query.scadaId),
|
|
126
175
|
remark: pageConfig.remark,
|
|
127
176
|
imgUrl: 'scada has config',
|
|
128
177
|
configurationName: pageConfig.title,
|
|
129
|
-
config:
|
|
130
|
-
|
|
131
|
-
|
|
178
|
+
config: config,
|
|
179
|
+
operationUserId: operationUserId,
|
|
180
|
+
configChangeLog: configChangeLog,
|
|
181
|
+
configHasChanged: configHasChanged
|
|
132
182
|
});
|
|
133
|
-
case
|
|
134
|
-
_res =
|
|
183
|
+
case 9:
|
|
184
|
+
_res = _context2.v;
|
|
135
185
|
if (_res.success) {
|
|
136
|
-
|
|
186
|
+
_context2.n = 10;
|
|
137
187
|
break;
|
|
138
188
|
}
|
|
139
|
-
message.error('
|
|
140
|
-
return
|
|
141
|
-
case 9:
|
|
142
|
-
message.success('更新成功');
|
|
143
|
-
_context.n = 11;
|
|
144
|
-
break;
|
|
189
|
+
message.error('Update failed');
|
|
190
|
+
return _context2.a(2);
|
|
145
191
|
case 10:
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
192
|
+
message.success('Update success');
|
|
193
|
+
_payload2 = JSON.stringify(graphSnapshot);
|
|
194
|
+
setInitialScadaConfigSnapshot(_payload2);
|
|
195
|
+
setScadaConfigSnapshotToStorage(query, graphSnapshot);
|
|
196
|
+
_context2.n = 12;
|
|
197
|
+
break;
|
|
150
198
|
case 11:
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
199
|
+
_context2.p = 11;
|
|
200
|
+
_t5 = _context2.v;
|
|
201
|
+
console.error(_t5);
|
|
202
|
+
message.error('Update failed');
|
|
154
203
|
case 12:
|
|
155
|
-
|
|
204
|
+
_context2.p = 12;
|
|
205
|
+
setLoading(false);
|
|
206
|
+
return _context2.f(12);
|
|
207
|
+
case 13:
|
|
208
|
+
return _context2.a(2);
|
|
156
209
|
}
|
|
157
|
-
},
|
|
210
|
+
}, _callee2, null, [[8, 11, 12, 13], [2, 5, 6, 7]]);
|
|
158
211
|
}));
|
|
159
212
|
return function handleSave() {
|
|
160
|
-
return
|
|
213
|
+
return _ref3.apply(this, arguments);
|
|
161
214
|
};
|
|
162
215
|
}();
|
|
163
216
|
return /*#__PURE__*/React.createElement(Tooltip, {
|