coolcare-lite-scada-component 2.0.18 → 2.0.20

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.
@@ -6,12 +6,14 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
6
6
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
7
7
  import React from "react";
8
8
  import { memo, useState, useEffect } from 'react';
9
- import { Tooltip } from 'antd';
9
+ import { Tooltip, Modal } from 'antd';
10
10
  import Switch from "../../components/Switch";
11
11
  import { usePointWatch } from "../../hooks";
12
12
  import { isNumber } from "../../utils";
13
13
  import { pointWrite } from "../utils";
14
14
  import styles from "./index.css";
15
+ import { ExclamationCircleOutlined } from '@ant-design/icons';
16
+ var confirm = Modal.confirm;
15
17
  var EleSwitchComponent = function EleSwitchComponent(_ref) {
16
18
  var _payload$pointList, _payload$mittMeta;
17
19
  var node = _ref.node;
@@ -30,18 +32,29 @@ var EleSwitchComponent = function EleSwitchComponent(_ref) {
30
32
  tooltipTitle = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, "\u70B9\u4F4D\u540D\u79F0\uFF1A", (pointData === null || pointData === void 0 ? void 0 : pointData.pointName) || '-'), /*#__PURE__*/React.createElement("div", null, "\u70B9\u4F4D\u503C\uFF1A", (_pointData$value = pointData === null || pointData === void 0 ? void 0 : pointData.value) !== null && _pointData$value !== void 0 ? _pointData$value : '-', " ", (_pointData$unit = pointData === null || pointData === void 0 ? void 0 : pointData.unit) !== null && _pointData$unit !== void 0 ? _pointData$unit : '-'), /*#__PURE__*/React.createElement("div", null, "\u66F4\u65B0\u65F6\u95F4\uFF1A", (pointData === null || pointData === void 0 ? void 0 : pointData.updateTime) || '-'));
31
33
  }
32
34
  var handleChange = function handleChange(val) {
33
- if (window.scadaMode === 'edit' || !configPoint || !(payload === null || payload === void 0 ? void 0 : payload.pointWriteable)) {
34
- return;
35
- }
36
- var checkedValue = payload.checkedValue,
37
- unCheckedValue = payload.unCheckedValue;
38
- pointWrite({
39
- identifierName: configPoint.identifierName,
40
- pointId: 'pointId' in configPoint ? configPoint.pointId : undefined,
41
- deviceId: 'deviceId' in configPoint ? configPoint.deviceId : undefined,
42
- value: val ? checkedValue : unCheckedValue
35
+ confirm({
36
+ title: "操作警告",
37
+ icon: /*#__PURE__*/React.createElement(ExclamationCircleOutlined, null),
38
+ content: "确定执行操作吗?",
39
+ className: "big",
40
+ getContainer: function getContainer() {
41
+ return document.getElementById("scada-body");
42
+ },
43
+ onOk: function onOk() {
44
+ if (window.scadaMode === 'edit' || !configPoint || !(payload === null || payload === void 0 ? void 0 : payload.pointWriteable)) {
45
+ return;
46
+ }
47
+ var checkedValue = payload.checkedValue,
48
+ unCheckedValue = payload.unCheckedValue;
49
+ pointWrite({
50
+ identifierName: configPoint.identifierName,
51
+ pointId: 'pointId' in configPoint ? configPoint.pointId : undefined,
52
+ deviceId: 'deviceId' in configPoint ? configPoint.deviceId : undefined,
53
+ value: val ? checkedValue : unCheckedValue
54
+ });
55
+ setValue(val);
56
+ }
43
57
  });
44
- setValue(val);
45
58
  };
46
59
  useEffect(function () {
47
60
  if (isNumber(pointData === null || pointData === void 0 ? void 0 : pointData.value) && isNumber(payload === null || payload === void 0 ? void 0 : payload.checkedValue) && (pointData === null || pointData === void 0 ? void 0 : pointData.value) === (payload === null || payload === void 0 ? void 0 : payload.checkedValue)) {
package/es/global.css CHANGED
@@ -160,3 +160,19 @@ body svg {
160
160
  .secondary-collapse.ant-collapse .ant-collapse-arrow {
161
161
  font-size: 10px !important;
162
162
  }
163
+ .big .anticon-exclamation-circle {
164
+ font-size: 44px;
165
+ }
166
+ .big .ant-modal-confirm-title {
167
+ font-size: 64px;
168
+ }
169
+ .big .ant-modal-confirm-content {
170
+ font-size: 48px;
171
+ }
172
+ .big .ant-modal-body {
173
+ padding: 64px 64px 48px;
174
+ }
175
+ .big .ant-btn {
176
+ font-size: 28px !important;
177
+ height: auto !important;
178
+ }
@@ -228,7 +228,8 @@ var Display = function Display(_ref) {
228
228
  });
229
229
  }, []);
230
230
  return /*#__PURE__*/React.createElement("div", {
231
- className: styles.wrap
231
+ className: styles.wrap,
232
+ id: "scada-body"
232
233
  }, !!queryRef.current && /*#__PURE__*/React.createElement(Player, {
233
234
  jsonConfig: jsonConfig,
234
235
  query: queryRef.current
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coolcare-lite-scada-component",
3
- "version": "2.0.18",
3
+ "version": "2.0.20",
4
4
  "scripts": {
5
5
  "start": "umi dev",
6
6
  "build:prod": "UMI_ENV=prod umi build",