coolcare-lite-scada-component 2.0.30 → 2.0.32

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.
@@ -41,7 +41,9 @@ var EleSwitchComponent = function EleSwitchComponent(_ref) {
41
41
  getContainer: function getContainer() {
42
42
  return document.getElementById("scada-body");
43
43
  },
44
- onOk: function onOk() {
44
+ onOk: function onOk(close) {
45
+ var _window$event;
46
+ (_window$event = window.event) === null || _window$event === void 0 ? void 0 : _window$event.stopPropagation();
45
47
  if (window.scadaMode === 'edit' || !configPoint || !(payload === null || payload === void 0 ? void 0 : payload.pointWriteable)) {
46
48
  return;
47
49
  }
@@ -54,6 +56,12 @@ var EleSwitchComponent = function EleSwitchComponent(_ref) {
54
56
  value: val ? checkedValue : unCheckedValue
55
57
  });
56
58
  setValue(val);
59
+ close();
60
+ },
61
+ onCancel: function onCancel(close) {
62
+ var _window$event2;
63
+ (_window$event2 = window.event) === null || _window$event2 === void 0 ? void 0 : _window$event2.stopPropagation();
64
+ close();
57
65
  }
58
66
  });
59
67
  };
@@ -65,7 +73,10 @@ var EleSwitchComponent = function EleSwitchComponent(_ref) {
65
73
  }
66
74
  }, [pointData === null || pointData === void 0 ? void 0 : pointData.value, payload === null || payload === void 0 ? void 0 : payload.checkedValue]);
67
75
  return /*#__PURE__*/React.createElement("div", {
68
- className: styles.wrap
76
+ className: styles.wrap,
77
+ onClick: function onClick(e) {
78
+ return e.stopPropagation();
79
+ }
69
80
  }, /*#__PURE__*/React.createElement(Tooltip, {
70
81
  title: tooltipTitle
71
82
  }, /*#__PURE__*/React.createElement(Switch, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coolcare-lite-scada-component",
3
- "version": "2.0.30",
3
+ "version": "2.0.32",
4
4
  "scripts": {
5
5
  "start": "umi dev",
6
6
  "build:prod": "UMI_ENV=prod umi build",