coolcare-lite-scada-component 4.1.5 → 4.1.7

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,9 @@ 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
+ _ref$embedded = _ref.embedded,
88
+ embedded = _ref$embedded === void 0 ? false : _ref$embedded;
87
89
  var graphRef = useRef(null);
88
90
  var wrapRef = useRef(null);
89
91
  var playerRef = useRef(null);
@@ -236,7 +238,7 @@ var Player = function Player(_ref) {
236
238
  message.error('没有找到对应的点');
237
239
  return _context.a(2);
238
240
  case 12:
239
- if (!isInIframe()) {
241
+ if (!(!embedded && query.scene === 'device' && isInIframe())) {
240
242
  _context.n = 13;
241
243
  break;
242
244
  }
@@ -278,7 +280,7 @@ var Player = function Player(_ref) {
278
280
  return function () {
279
281
  emitter.off(eventName, handler);
280
282
  };
281
- }, [query, mittMeta]);
283
+ }, [query, mittMeta, embedded]);
282
284
 
283
285
  // 监听显示点位写入弹窗事件
284
286
  useEffect(function () {
@@ -277,13 +277,15 @@ var Display = function Display(_ref) {
277
277
  }, !!q && jsonConfig && /*#__PURE__*/React.createElement(ScenePlayerByFormat, {
278
278
  config: jsonConfig,
279
279
  query: q,
280
- onEvent: onEvent
280
+ onEvent: onEvent,
281
+ embedded: !!query_
281
282
  }), !loading && !jsonConfig && /*#__PURE__*/React.createElement(ScadaEmpty, null));
282
283
  };
283
284
  var ScenePlayerByFormat = function ScenePlayerByFormat(_ref5) {
284
285
  var config = _ref5.config,
285
286
  query = _ref5.query,
286
- onEvent = _ref5.onEvent;
287
+ onEvent = _ref5.onEvent,
288
+ embedded = _ref5.embedded;
287
289
  var handleEvent = function handleEvent(event) {
288
290
  if (onEvent) {
289
291
  onEvent(event);
@@ -306,7 +308,8 @@ var ScenePlayerByFormat = function ScenePlayerByFormat(_ref5) {
306
308
  }) : /*#__PURE__*/React.createElement(Player, {
307
309
  jsonConfig: config,
308
310
  query: query,
309
- onEvent: handleEvent
311
+ onEvent: handleEvent,
312
+ embedded: embedded
310
313
  });
311
314
  } catch (error) {
312
315
  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.7",
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",
@@ -9,6 +9,7 @@
9
9
  "build:generalfushi": "node scripts/build-scada.mjs generalfushi",
10
10
  "build:yimin": "node scripts/build-scada.mjs yimin",
11
11
  "build:staging": "node scripts/build-scada.mjs staging",
12
+ "test:history": "node --test tests/player-history.test.cjs",
12
13
  "test:3d": "node scripts/test-scada.mjs",
13
14
  "build:component": "father build",
14
15
  "prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",