coolcare-lite-scada-component 4.1.5 → 4.1.6

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.
@@ -146,11 +146,7 @@ var ElePointValueComponent = function ElePointValueComponent(_ref) {
146
146
  });
147
147
  return /*#__PURE__*/React.createElement("div", {
148
148
  onClick: function onClick(e) {
149
- if ((payload === null || payload === void 0 ? void 0 : payload.pointList.length) && (payload === null || payload === void 0 ? void 0 : payload.pointList[0].deviceType) === 'virtual') {
150
- e.stopPropagation();
151
- } else {
152
- eventHandles.current.onClick(e);
153
- }
149
+ return eventHandles.current.onClick(e);
154
150
  },
155
151
  onContextMenu: function onContextMenu(e) {
156
152
  return eventHandles.current.onContextMenu(e);
@@ -83,7 +83,8 @@ var Player = function Player(_ref) {
83
83
  var _jsonConfig$pageConfi;
84
84
  var jsonConfig = _ref.jsonConfig,
85
85
  query = _ref.query,
86
- onEvent = _ref.onEvent;
86
+ onEvent = _ref.onEvent,
87
+ onHistoryEvent = _ref.onHistoryEvent;
87
88
  var graphRef = useRef(null);
88
89
  var wrapRef = useRef(null);
89
90
  var playerRef = useRef(null);
@@ -205,7 +206,7 @@ var Player = function Player(_ref) {
205
206
  console.error(_t);
206
207
  message.error('oops, 出错了');
207
208
  case 7:
208
- _context.n = 15;
209
+ _context.n = 16;
209
210
  break;
210
211
  case 8:
211
212
  deviceId = points === null || points === void 0 ? void 0 : (_points$3 = points[0]) === null || _points$3 === void 0 ? void 0 : _points$3.deviceId;
@@ -236,10 +237,25 @@ var Player = function Player(_ref) {
236
237
  message.error('没有找到对应的点');
237
238
  return _context.a(2);
238
239
  case 12:
239
- if (!isInIframe()) {
240
+ if (!onHistoryEvent) {
240
241
  _context.n = 13;
241
242
  break;
242
243
  }
244
+ onHistoryEvent({
245
+ event: 'show-point-history-modal',
246
+ payload: {
247
+ pointIds: _res.data.map(function (v) {
248
+ return v.pointId;
249
+ }),
250
+ locationSearch: window.location.search
251
+ }
252
+ });
253
+ return _context.a(2);
254
+ case 13:
255
+ if (!(query.scene === 'device' && isInIframe())) {
256
+ _context.n = 14;
257
+ break;
258
+ }
243
259
  // 如果是在 iframe 上显示(嵌入小麦), 使用小麦平台的历史曲线弹窗
244
260
  window.parent.postMessage({
245
261
  event: 'show-point-history-modal',
@@ -251,23 +267,23 @@ var Player = function Player(_ref) {
251
267
  }
252
268
  }, '*');
253
269
  return _context.a(2);
254
- case 13:
270
+ case 14:
255
271
  setActiveIndicatorNos([]);
256
272
  setActivePointIds(_res.data.map(function (v) {
257
273
  return v.pointId;
258
274
  }));
259
275
  setVisibleDialogHistory(true);
260
- _context.n = 15;
276
+ _context.n = 16;
261
277
  break;
262
- case 14:
263
- _context.p = 14;
278
+ case 15:
279
+ _context.p = 15;
264
280
  _t2 = _context.v;
265
281
  console.error(_t2);
266
282
  message.error('oops, 出错了');
267
- case 15:
283
+ case 16:
268
284
  return _context.a(2);
269
285
  }
270
- }, _callee, null, [[9, 14], [2, 6]]);
286
+ }, _callee, null, [[9, 15], [2, 6]]);
271
287
  }));
272
288
  return function handler(_x) {
273
289
  return _ref2.apply(this, arguments);
@@ -278,7 +294,7 @@ var Player = function Player(_ref) {
278
294
  return function () {
279
295
  emitter.off(eventName, handler);
280
296
  };
281
- }, [query, mittMeta]);
297
+ }, [query, mittMeta, onHistoryEvent]);
282
298
 
283
299
  // 监听显示点位写入弹窗事件
284
300
  useEffect(function () {
@@ -306,7 +306,8 @@ var ScenePlayerByFormat = function ScenePlayerByFormat(_ref5) {
306
306
  }) : /*#__PURE__*/React.createElement(Player, {
307
307
  jsonConfig: config,
308
308
  query: query,
309
- onEvent: handleEvent
309
+ onEvent: handleEvent,
310
+ onHistoryEvent: onEvent
310
311
  });
311
312
  } catch (error) {
312
313
  return /*#__PURE__*/React.createElement("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coolcare-lite-scada-component",
3
- "version": "4.1.5",
3
+ "version": "4.1.6",
4
4
  "scripts": {
5
5
  "start": "cross-env PORT=8000 UMI_ENV=prod umi dev",
6
6
  "prepare:3d": "node scripts/build-scada.mjs studio",