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.
Files changed (96) hide show
  1. package/es/app.js +23 -0
  2. package/es/components/BoxShadowPicker/index.less.d.ts +9 -9
  3. package/es/components/ColorPicker/util.js +4 -4
  4. package/es/components/DialogHistory/index.css +22 -0
  5. package/es/components/DialogHistory/index.js +388 -79
  6. package/es/components/DialogImagePicker/GroupPanel/index.js +1 -12
  7. package/es/components/ECharts/index.js +31 -23
  8. package/es/components/FormBindPoint/FreedomScene.js +181 -11
  9. package/es/components/FormBindPoint/ProductionOrDeviceScene.js +12 -5
  10. package/es/components/FormBindPoint/index.js +6 -0
  11. package/es/components/Icon/index.js +1 -1
  12. package/es/components/IconFont/index.js +6 -0
  13. package/es/components/ImageUploader/index.js +8 -7
  14. package/es/components/ModalChangePointValue.js +272 -0
  15. package/es/components/ModalChoosePoint/index.js +53 -16
  16. package/es/components/PointSelect/DeviceIndicatorTable.js +111 -0
  17. package/es/components/PointSelect/IndicatorSelect.js +182 -0
  18. package/es/constant.js +2 -2
  19. package/es/element/BorderBox/util/typings.d.ts +9 -9
  20. package/es/element/Decoration/util/typings.d.ts +9 -9
  21. package/es/element/EleFan/Component.js +1 -1
  22. package/es/element/EleFanBySvg/index.js +3 -3
  23. package/es/element/EleImage/index.js +1 -1
  24. package/es/element/ElePointImage/Component.js +30 -41
  25. package/es/element/ElePointImage/index.js +1 -1
  26. package/es/element/ElePointValue/Component.js +117 -17
  27. package/es/element/ElePointValue/PropsSet/StatisticsPropsSet/index.js +6 -0
  28. package/es/element/ElePointValue/index.css +11 -0
  29. package/es/element/ElePointValue/index.js +6 -0
  30. package/es/element/EleShine/Component.js +133 -23
  31. package/es/element/EleShine/PropsSet/OtherPropsSet/index.js +27 -34
  32. package/es/element/EleShine/PropsSet/PointAlarmTool.js +99 -0
  33. package/es/element/EleShine/PropsSet/index.js +9 -1
  34. package/es/element/EleShine/index.js +2 -1
  35. package/es/element/EleState/index.js +1 -1
  36. package/es/element/EleSwitch/Component.js +2 -12
  37. package/es/element/PipeNodes/NodeBL/index.js +1 -1
  38. package/es/element/PipeNodes/NodeBR/index.js +1 -1
  39. package/es/element/PipeNodes/NodeBottom/index.js +1 -1
  40. package/es/element/PipeNodes/NodeCenter/index.js +1 -1
  41. package/es/element/PipeNodes/NodeHorizontal/index.js +1 -1
  42. package/es/element/PipeNodes/NodeLeft/index.js +1 -1
  43. package/es/element/PipeNodes/NodeRight/index.js +1 -1
  44. package/es/element/PipeNodes/NodeTL/index.js +1 -1
  45. package/es/element/PipeNodes/NodeTR/index.js +1 -1
  46. package/es/element/PipeNodes/NodeTop/index.js +1 -1
  47. package/es/element/PipeNodes/NodeVertical/index.js +1 -1
  48. package/es/element/PointCard/PointListCard/Component.js +3 -2
  49. package/es/element/PointCard/PointListCard/index.js +1 -0
  50. package/es/element/type.d.ts +4 -6
  51. package/es/element/utils/getValueByExpression.js +3 -0
  52. package/es/element/utils/handleEleEvent.js +11 -1
  53. package/es/element/utils/pointWrite.js +4 -5
  54. package/es/hooks/usePointWatch.js +1 -1
  55. package/es/models/useEditor.js +14 -8
  56. package/es/pages/display/Player/index.js +444 -123
  57. package/es/pages/display/index.js +2 -2
  58. package/es/pages/document.ejs +1 -1
  59. package/es/pages/editor/PanelLeft/BasicShapeList/listData.js +8 -8
  60. package/es/pages/editor/PanelLeft/BorderBoxEleList/index.less.d.ts +7 -7
  61. package/es/pages/editor/PanelLeft/DecorationEleList/index.less.d.ts +7 -7
  62. package/es/pages/editor/PanelLeft/GroupManageDialog/index.js +4 -4
  63. package/es/pages/editor/PanelLeft/ImgGroup/index.js +1 -12
  64. package/es/pages/editor/PanelLeft/MetaEleList/listData.js +14 -14
  65. package/es/pages/editor/PanelLeft/PipeEleList/listData.js +11 -11
  66. package/es/pages/editor/PanelLeft/PointCardEleList/listData.js +6 -6
  67. package/es/pages/editor/PanelLeft/RecommendEleList/listData.js +4 -4
  68. package/es/pages/editor/PanelLeft/index.js +3 -3
  69. package/es/pages/editor/PanelRight/components/FormLayer/index.js +3 -1
  70. package/es/pages/editor/PanelRight/index.less.d.ts +7 -7
  71. package/es/pages/editor/PanelTop/HotKeyDescribe/index.js +1 -1
  72. package/es/pages/editor/PanelTop/Save/index.js +120 -67
  73. package/es/pages/editor/index.js +223 -135
  74. package/es/pages/editor/utils/scadaChangeLog.js +237 -0
  75. package/es/services/common/Uploader.js +1 -1
  76. package/es/services/common/typings.d.ts +15 -15
  77. package/es/services/energy/index.js +56 -0
  78. package/es/services/gateway/Device.js +22 -0
  79. package/es/services/gateway/Point.js +46 -25
  80. package/es/services/gateway/typings.d.ts +3 -0
  81. package/es/services/master/typings.d.ts +362 -362
  82. package/es/services/product/typings.d.ts +1045 -1045
  83. package/es/services/project/typings.d.ts +1609 -1609
  84. package/es/services/request.js +126 -13
  85. package/es/shims.x6.d.ts +15 -15
  86. package/es/typings.d.ts +12 -0
  87. package/es/utils/auth.js +6 -2
  88. package/es/utils/cssStyle.js +4 -4
  89. package/es/utils/dataURItoBlob.js +25 -0
  90. package/es/utils/date.js +7 -0
  91. package/es/utils/decomposeMatrix.js +5 -5
  92. package/es/utils/events.js +3 -3
  93. package/es/utils/index.js +34 -34
  94. package/es/utils/pointValueFormat.js +3 -3
  95. package/package.json +16 -15
  96. package/es/elementCss.css +0 -19
@@ -0,0 +1,182 @@
1
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
2
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
3
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
4
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
5
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
6
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
8
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
9
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
10
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
11
+ import React from "react";
12
+ import { Input, Popover } from 'antd';
13
+ import { useState, useEffect } from 'react';
14
+ import { DownOutlined } from '@ant-design/icons';
15
+ import { useMount, useRequest } from 'ahooks';
16
+ import { GetDeviceIndicator } from "../../services/gateway/Device";
17
+ import styles from "./index.css";
18
+ import DeviceIndicatorTable from "./DeviceIndicatorTable";
19
+ var IndicatorSelect = function IndicatorSelect(_ref) {
20
+ var style = _ref.style,
21
+ _ref$size = _ref.size,
22
+ size = _ref$size === void 0 ? 'small' : _ref$size,
23
+ onChange = _ref.onChange,
24
+ value = _ref.value,
25
+ deviceId = _ref.deviceId;
26
+ var _useState = useState(),
27
+ _useState2 = _slicedToArray(_useState, 2),
28
+ pointInfo = _useState2[0],
29
+ setPointInfo = _useState2[1];
30
+ var _useState3 = useState(false),
31
+ _useState4 = _slicedToArray(_useState3, 2),
32
+ visible = _useState4[0],
33
+ setVisible = _useState4[1];
34
+ var _useState5 = useState(false),
35
+ _useState6 = _slicedToArray(_useState5, 2),
36
+ loading = _useState6[0],
37
+ setLoading = _useState6[1];
38
+ var handleDevicePointChange = function handleDevicePointChange(val) {
39
+ var info = {
40
+ indicatorIdentifier: val.indicatorIdentifier,
41
+ indicatorName: val.indicatorName,
42
+ indicatorNo: val.indicatorNo
43
+ };
44
+ setPointInfo(info);
45
+ onChange === null || onChange === void 0 ? void 0 : onChange(info);
46
+ setVisible(false);
47
+ };
48
+ var _useRequest = useRequest(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
49
+ var _yield$GetDeviceIndic, success, data;
50
+ return _regenerator().w(function (_context) {
51
+ while (1) switch (_context.n) {
52
+ case 0:
53
+ if (deviceId) {
54
+ _context.n = 1;
55
+ break;
56
+ }
57
+ return _context.a(2, []);
58
+ case 1:
59
+ setLoading(true);
60
+ _context.n = 2;
61
+ return GetDeviceIndicator({
62
+ deviceIdList: [deviceId]
63
+ });
64
+ case 2:
65
+ _yield$GetDeviceIndic = _context.v;
66
+ success = _yield$GetDeviceIndic.success;
67
+ data = _yield$GetDeviceIndic.data;
68
+ if (success) {
69
+ _context.n = 3;
70
+ break;
71
+ }
72
+ return _context.a(2, []);
73
+ case 3:
74
+ return _context.a(2, data || []);
75
+ }
76
+ }, _callee);
77
+ })), {
78
+ cacheKey: "device-indicator-".concat(deviceId),
79
+ refreshDeps: [deviceId],
80
+ onError: function onError(err) {
81
+ console.error(err);
82
+ },
83
+ onFinally: function onFinally() {
84
+ setLoading(false);
85
+ }
86
+ }),
87
+ deviceIndicatorList = _useRequest.data;
88
+ useEffect(function () {
89
+ if (!value && deviceId) {
90
+ setPointInfo(undefined);
91
+ }
92
+ }, [deviceId, value]);
93
+ useMount(function () {
94
+ var getPointNameWhenInit = /*#__PURE__*/function () {
95
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(params) {
96
+ var _yield$GetDeviceIndic2, success, data, point, _t;
97
+ return _regenerator().w(function (_context2) {
98
+ while (1) switch (_context2.p = _context2.n) {
99
+ case 0:
100
+ _context2.p = 0;
101
+ setLoading(true);
102
+ _context2.n = 1;
103
+ return GetDeviceIndicator(params);
104
+ case 1:
105
+ _yield$GetDeviceIndic2 = _context2.v;
106
+ success = _yield$GetDeviceIndic2.success;
107
+ data = _yield$GetDeviceIndic2.data;
108
+ if (success) {
109
+ _context2.n = 2;
110
+ break;
111
+ }
112
+ return _context2.a(2);
113
+ case 2:
114
+ point = (data || []).find(function (item) {
115
+ return item.indicatorNo === value;
116
+ });
117
+ setPointInfo({
118
+ indicatorIdentifier: point.indicatorIdentifier,
119
+ indicatorName: point.indicatorName,
120
+ indicatorNo: point.indicatorNo
121
+ });
122
+ _context2.n = 4;
123
+ break;
124
+ case 3:
125
+ _context2.p = 3;
126
+ _t = _context2.v;
127
+ console.error(_t);
128
+ case 4:
129
+ _context2.p = 4;
130
+ setLoading(false);
131
+ return _context2.f(4);
132
+ case 5:
133
+ return _context2.a(2);
134
+ }
135
+ }, _callee2, null, [[0, 3, 4, 5]]);
136
+ }));
137
+ return function getPointNameWhenInit(_x) {
138
+ return _ref3.apply(this, arguments);
139
+ };
140
+ }();
141
+ if (deviceId && value) {
142
+ getPointNameWhenInit({
143
+ deviceIdList: [deviceId]
144
+ });
145
+ }
146
+ });
147
+ return /*#__PURE__*/React.createElement(Popover, {
148
+ content: /*#__PURE__*/React.createElement(DeviceIndicatorTable, {
149
+ onChange: handleDevicePointChange,
150
+ data: deviceIndicatorList || [],
151
+ loading: loading,
152
+ indicatorId: pointInfo === null || pointInfo === void 0 ? void 0 : pointInfo.indicatorId,
153
+ onClose: function onClose() {
154
+ return setVisible(false);
155
+ }
156
+ }),
157
+ placement: "leftTop",
158
+ trigger: "click",
159
+ open: visible,
160
+ overlayInnerStyle: {
161
+ width: deviceId ? 620 : 360
162
+ },
163
+ onOpenChange: setVisible
164
+ }, /*#__PURE__*/React.createElement(Input, {
165
+ value: pointInfo === null || pointInfo === void 0 ? void 0 : pointInfo.indicatorName,
166
+ size: size,
167
+ style: style,
168
+ className: styles['cursor-pointer'],
169
+ onClick: function onClick() {
170
+ return setVisible(true);
171
+ },
172
+ readOnly: true,
173
+ placeholder: "",
174
+ suffix: /*#__PURE__*/React.createElement(DownOutlined, {
175
+ style: {
176
+ color: 'rgba(0,0,0,.25)',
177
+ fontSize: 12
178
+ }
179
+ })
180
+ }));
181
+ };
182
+ export default IndicatorSelect;
package/es/constant.js CHANGED
@@ -10,7 +10,7 @@ export var defaultDeviceMobileSize = {
10
10
  height: 600
11
11
  };
12
12
 
13
- /**
14
- * 主要颜色
13
+ /**
14
+ * 主要颜色
15
15
  */
16
16
  export var PRIMARY_COLOR = '#1890ff';
@@ -1,9 +1,9 @@
1
- export type BorderColors = [string, string];
2
-
3
- export type ExtraData = {
4
- colors: BorderColors;
5
- };
6
-
7
- export interface BorderBoxProps<T> {
8
- node?: T;
9
- }
1
+ export type BorderColors = [string, string];
2
+
3
+ export type ExtraData = {
4
+ colors: BorderColors;
5
+ };
6
+
7
+ export interface BorderBoxProps<T> {
8
+ node?: T;
9
+ }
@@ -1,9 +1,9 @@
1
- export type DecorationColors = [string, string];
2
-
3
- export type ExtraData = {
4
- colors: DecorationColors;
5
- };
6
-
7
- export type DecorationProps<T> = {
8
- node?: T;
9
- };
1
+ export type DecorationColors = [string, string];
2
+
3
+ export type ExtraData = {
4
+ colors: DecorationColors;
5
+ };
6
+
7
+ export type DecorationProps<T> = {
8
+ node?: T;
9
+ };
@@ -98,7 +98,7 @@ var EleFanComponent = function EleFanComponent(_ref) {
98
98
  className: styles.wrap
99
99
  }, /*#__PURE__*/React.createElement("img", {
100
100
  className: "".concat(styles['fan-img'], " ").concat(fanIsOn ? styles.on : ''),
101
- src: "http://192.168.2.12:9000/xiaomai/fan.png"
101
+ src: "https://coolcare-scada.oss-cn-shanghai.aliyuncs.com/%E5%AE%98%E6%96%B9%E5%9B%BE%E5%BA%93/fan.png"
102
102
  })));
103
103
  };
104
104
  export default /*#__PURE__*/memo(EleFanComponent, reactShapeNodeAreEqual);
@@ -145,9 +145,9 @@ var EleFan = /*#__PURE__*/function (_NodeBase) {
145
145
  // 开关点位
146
146
  var _eventHandler3 = function _eventHandler3(pointData) {
147
147
  var _data$key7;
148
- var imgUrl = 'http://192.168.2.12:9000/xiaomai/elements/fan-off.jpg';
148
+ var imgUrl = 'https://cdn.sinocold.net/configuration/elements/fan-off.jpg';
149
149
  if (getValueByExpression(pointData.value, (_data$key7 = data[key]) === null || _data$key7 === void 0 ? void 0 : _data$key7.expressions) === '风机开') {
150
- imgUrl = 'http://192.168.2.12:9000/xiaomai/elements/fan.gif';
150
+ imgUrl = 'https://cdn.sinocold.net/configuration/elements/fan.gif';
151
151
  }
152
152
  _this2.attr('image/xlinkHref', imgUrl);
153
153
  };
@@ -241,7 +241,7 @@ export var defaultConfig = {
241
241
  refY: '20%',
242
242
  refWidth: '60%',
243
243
  refHeight: '60%',
244
- xlinkHref: 'http://192.168.2.12:9000/xiaomai/elements/fan.gif'
244
+ xlinkHref: 'https://cdn.sinocold.net/configuration/elements/fan.gif'
245
245
  }
246
246
  },
247
247
  tools: [{
@@ -42,7 +42,7 @@ export var defaultConfig = {
42
42
  // https://developer.mozilla.org/zh-CN/docs/Web/SVG/Attribute/preserveAspectRatio
43
43
  refWidth: '100%',
44
44
  refHeight: '100%',
45
- xlinkHref: 'http://192.168.2.12:9000/xiaomai/%E5%9B%BE%E7%89%87.svg'
45
+ xlinkHref: 'https://cdn.sinocold.net/%E5%B9%B3%E9%9D%A2%E5%9B%BE/%E5%85%83%E7%B4%A0%E5%9B%BE%E7%89%87/%E5%9B%BE%E7%89%87.svg'
46
46
  }
47
47
  },
48
48
  data: {
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
2
  import { memo } from 'react';
3
+ import { Tooltip } from 'antd';
3
4
  import { getValueByExpression, reactShapeNodeAreEqual } from "../utils";
4
5
  import { usePointWatch, useEleEventHandle } from "../../hooks";
5
6
  import styles from "./index.css";
@@ -34,46 +35,34 @@ var ElePointImageComponent = function ElePointImageComponent(_ref) {
34
35
  }
35
36
  });
36
37
  var pointData = usePointWatch(configPoint, payload === null || payload === void 0 ? void 0 : (_payload$mittMeta2 = payload.mittMeta) === null || _payload$mittMeta2 === void 0 ? void 0 : _payload$mittMeta2.namespace);
37
-
38
- // let tooltipTitle = null;
39
- // if (!configPoint) {
40
- // tooltipTitle = '未绑定点位';
41
- // } else {
42
- // tooltipTitle = (
43
- // <div>
44
- // <div>点位名称:{pointData?.pointName || '-'}</div>
45
- // <div>
46
- // 点位值:{pointData?.value ?? '-'} {pointData?.unit ?? '-'}
47
- // </div>
48
- // <div>更新时间:{pointData?.updateTime || '-'}</div>
49
- // </div>
50
- // );
51
- // }
52
-
53
- return (
54
- /*#__PURE__*/
55
- // <Tooltip title={tooltipTitle}>
56
- React.createElement("div", {
57
- onClick: function onClick(e) {
58
- return eventHandles.current.onClick(e);
59
- },
60
- onContextMenu: function onContextMenu(e) {
61
- return eventHandles.current.onContextMenu(e);
62
- },
63
- onMouseEnter: function onMouseEnter(e) {
64
- return eventHandles.current.onMouseEnter(e);
65
- },
66
- onMouseLeave: function onMouseLeave(e) {
67
- return eventHandles.current.onMouseLeave(e);
68
- },
69
- className: styles.wrap
70
- }, (payload === null || payload === void 0 ? void 0 : payload.imgSrc) ? /*#__PURE__*/React.createElement("img", {
71
- className: styles.img,
72
- src: getImageSrc(payload.imgSrc, pointData === null || pointData === void 0 ? void 0 : pointData.value, configPoint === null || configPoint === void 0 ? void 0 : configPoint.expressions),
73
- draggable: false,
74
- alt: ""
75
- }) : null)
76
- // </Tooltip>
77
- );
38
+ var tooltipTitle = null;
39
+ if (!configPoint) {
40
+ tooltipTitle = '未绑定点位';
41
+ } else {
42
+ var _pointData$value, _pointData$unit;
43
+ 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) || '-'));
44
+ }
45
+ return /*#__PURE__*/React.createElement(Tooltip, {
46
+ title: tooltipTitle
47
+ }, /*#__PURE__*/React.createElement("div", {
48
+ onClick: function onClick(e) {
49
+ return eventHandles.current.onClick(e);
50
+ },
51
+ onContextMenu: function onContextMenu(e) {
52
+ return eventHandles.current.onContextMenu(e);
53
+ },
54
+ onMouseEnter: function onMouseEnter(e) {
55
+ return eventHandles.current.onMouseEnter(e);
56
+ },
57
+ onMouseLeave: function onMouseLeave(e) {
58
+ return eventHandles.current.onMouseLeave(e);
59
+ },
60
+ className: styles.wrap
61
+ }, (payload === null || payload === void 0 ? void 0 : payload.imgSrc) ? /*#__PURE__*/React.createElement("img", {
62
+ className: styles.img,
63
+ src: getImageSrc(payload.imgSrc, pointData === null || pointData === void 0 ? void 0 : pointData.value, configPoint === null || configPoint === void 0 ? void 0 : configPoint.expressions),
64
+ draggable: false,
65
+ alt: ""
66
+ }) : null));
78
67
  };
79
68
  export default /*#__PURE__*/memo(ElePointImageComponent, reactShapeNodeAreEqual);
@@ -38,7 +38,7 @@ export var defaultConfig = {
38
38
  width: 36,
39
39
  height: 29,
40
40
  data: {
41
- imgSrc: 'http://192.168.2.12:9000/xiaomai/平面图/元素图片/图片.svg',
41
+ imgSrc: 'https://cdn.sinocold.net/%E5%B9%B3%E9%9D%A2%E5%9B%BE/%E5%85%83%E7%B4%A0%E5%9B%BE%E7%89%87/%E5%9B%BE%E7%89%87.svg',
42
42
  pointList: [],
43
43
  pointListLimit: 1,
44
44
  keepRatio: true,
@@ -1,4 +1,8 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
3
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
4
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
5
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
2
6
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
7
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
8
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
@@ -10,17 +14,21 @@ import { Tooltip } from 'antd';
10
14
  import { getValueByExpression } from "../utils";
11
15
  import { reactShapeNodeAreEqual } from "../utils";
12
16
  import { usePointWatch, useEleEventHandle } from "../../hooks";
13
- import { formatPointDisplayValue } from "../../utils/pointValueFormat";
14
17
  import styles from "./index.css";
18
+ import IconFont from "../../components/IconFont";
19
+ import { useRequest } from 'ahooks';
20
+ import { GetDeviceInfo } from "../../services/gateway/Device";
21
+ import { formatPointDisplayValue } from "../../utils/pointValueFormat";
15
22
  var directionClassNameMap = {
16
23
  top: 'flex-col',
17
24
  left: 'flex-row',
18
25
  bottom: 'flex-col-reverse'
19
26
  };
20
27
  var ElePointValueComponent = function ElePointValueComponent(_ref) {
21
- var _payload$pointList, _payload$label, _payload$unit, _payload$unit2, _payload$value, _payload$value2, _payload$mittMeta$nam, _payload$mittMeta, _payload$mittMeta2, _pointData$aggregateD, _pointData$aggregateD2, _pointData$aggregateD3, _pointData$aggregateD4, _payload$label2, _payload$unit3;
28
+ var _payload$pointList, _payload$label, _payload$unit, _payload$unit2, _payload$value, _payload$value2, _payload$mittMeta$nam, _payload$mittMeta, _payload$mittMeta2, _pointData12, _pointData13, _pointData14, _pointData15, _pointData16, _payload$mittMeta$nam2, _payload$mittMeta3, _payload$label2, _payload$unit3, _pointData17, _pointData18;
22
29
  var node = _ref.node;
23
30
  var payload = node === null || node === void 0 ? void 0 : node.getData();
31
+ var premission = payload === null || payload === void 0 ? void 0 : payload.premission;
24
32
  var configPoint = payload === null || payload === void 0 ? void 0 : (_payload$pointList = payload.pointList) === null || _payload$pointList === void 0 ? void 0 : _payload$pointList[0];
25
33
  var labelStyle = _objectSpread(_objectSpread({}, payload === null || payload === void 0 ? void 0 : (_payload$label = payload.label) === null || _payload$label === void 0 ? void 0 : _payload$label.fontStyles), payload === null || payload === void 0 ? void 0 : payload.label.margin_padding);
26
34
  var unitStyle = _objectSpread(_objectSpread({}, payload === null || payload === void 0 ? void 0 : (_payload$unit = payload.unit) === null || _payload$unit === void 0 ? void 0 : _payload$unit.fontStyles), payload === null || payload === void 0 ? void 0 : (_payload$unit2 = payload.unit) === null || _payload$unit2 === void 0 ? void 0 : _payload$unit2.margin_padding);
@@ -31,37 +39,118 @@ var ElePointValueComponent = function ElePointValueComponent(_ref) {
31
39
  payload: {
32
40
  points: [{
33
41
  identifierName: configPoint === null || configPoint === void 0 ? void 0 : configPoint.identifierName,
34
- deviceId: configPoint && 'deviceId' in configPoint ? configPoint.deviceId : undefined
42
+ deviceId: configPoint && 'deviceId' in configPoint ? configPoint.deviceId : undefined,
43
+ deviceType: configPoint && 'deviceType' in configPoint ? configPoint.deviceType : 'device',
44
+ dataType: configPoint && 'dataType' in configPoint ? configPoint.dataType : undefined,
45
+ meterId: configPoint && 'meterId' in configPoint ? configPoint.meterId : undefined,
46
+ indicatorNo: configPoint && 'indicatorNo' in configPoint ? configPoint.indicatorNo : undefined
35
47
  }],
36
48
  namespace: (_payload$mittMeta$nam = payload === null || payload === void 0 ? void 0 : (_payload$mittMeta = payload.mittMeta) === null || _payload$mittMeta === void 0 ? void 0 : _payload$mittMeta.namespace) !== null && _payload$mittMeta$nam !== void 0 ? _payload$mittMeta$nam : 0
37
49
  }
38
50
  });
39
51
  var pointData = usePointWatch(configPoint, payload === null || payload === void 0 ? void 0 : (_payload$mittMeta2 = payload.mittMeta) === null || _payload$mittMeta2 === void 0 ? void 0 : _payload$mittMeta2.namespace);
40
- var value = (pointData === null || pointData === void 0 ? void 0 : pointData.value) === null ? (pointData === null || pointData === void 0 ? void 0 : (_pointData$aggregateD = pointData.aggregateDataList) === null || _pointData$aggregateD === void 0 ? void 0 : (_pointData$aggregateD2 = _pointData$aggregateD[0]) === null || _pointData$aggregateD2 === void 0 ? void 0 : _pointData$aggregateD2.val) || '-' : pointData === null || pointData === void 0 ? void 0 : pointData.value;
41
- if (pointData === null || pointData === void 0 ? void 0 : (_pointData$aggregateD3 = pointData.aggregateDataList) === null || _pointData$aggregateD3 === void 0 ? void 0 : (_pointData$aggregateD4 = _pointData$aggregateD3[0]) === null || _pointData$aggregateD4 === void 0 ? void 0 : _pointData$aggregateD4.val) {
42
- value = Number(value.toFixed(1));
43
- }
44
- var displayValue = formatPointDisplayValue(value, configPoint);
45
- var tooltipTitle = null;
46
- if (!configPoint) {
47
- tooltipTitle = '未绑定点位';
48
- } else {
49
- var _pointData$unit;
50
- 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", displayValue, " ", (_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) || '-'));
52
+ var value = '-';
53
+ if ('value' in (pointData || {})) {
54
+ var _pointData;
55
+ value = (_pointData = pointData) === null || _pointData === void 0 ? void 0 : _pointData.value;
56
+ } else if ('aggregateDataList' in (pointData || {})) {
57
+ var _pointData2, _pointData2$aggregate, _pointData2$aggregate2;
58
+ value = (_pointData2 = pointData) === null || _pointData2 === void 0 ? void 0 : (_pointData2$aggregate = _pointData2.aggregateDataList) === null || _pointData2$aggregate === void 0 ? void 0 : (_pointData2$aggregate2 = _pointData2$aggregate[0]) === null || _pointData2$aggregate2 === void 0 ? void 0 : _pointData2$aggregate2.val;
59
+ if (typeof value === 'number') {
60
+ value = value.toFixed(1);
61
+ }
62
+ } else if ('indicatorData' in (pointData || {})) {
63
+ var _pointData3, _pointData3$indicator;
64
+ value = (_pointData3 = pointData) === null || _pointData3 === void 0 ? void 0 : (_pointData3$indicator = _pointData3.indicatorData) === null || _pointData3$indicator === void 0 ? void 0 : _pointData3$indicator.val;
65
+ } else if ('metricsList' in (pointData || {})) {
66
+ var _pointData4, _pointData4$metricsLi, _pointData5;
67
+ value = (_pointData4 = pointData) === null || _pointData4 === void 0 ? void 0 : (_pointData4$metricsLi = _pointData4.metricsList) === null || _pointData4$metricsLi === void 0 ? void 0 : _pointData4$metricsLi.reduce(function (a, b) {
68
+ // 将每个数字转换为字符串,然后乘以100,转为整数计算
69
+ var aNum = Math.round(Number(a) * 100);
70
+ var bNum = Math.round(Number(b.val) * 100);
71
+ return (aNum + bNum) / 100;
72
+ }, 0).toFixed(1);
73
+ pointData = _objectSpread(_objectSpread({}, pointData), {}, {
74
+ pointName: (_pointData5 = pointData) === null || _pointData5 === void 0 ? void 0 : _pointData5.name,
75
+ unit: ['kWh', 't', 'm³', 't', 't'][pointData.type - 1]
76
+ });
51
77
  }
78
+ var displayValue = formatPointDisplayValue(typeof value === 'string' && value !== '' ? Number(value) : value, configPoint);
52
79
  var pointValue = '';
53
80
  if (window.scadaMode === 'edit') {
54
81
  pointValue = '点位值';
55
82
  } else {
83
+ var _pointData6;
56
84
  if (configPoint === null || configPoint === void 0 ? void 0 : configPoint.expressions) {
57
85
  pointValue = getValueByExpression(value, configPoint === null || configPoint === void 0 ? void 0 : configPoint.expressions);
58
86
  }
59
- pointValue = (pointData === null || pointData === void 0 ? void 0 : pointData.pointEnumItemKey) || displayValue;
87
+ pointValue = ((_pointData6 = pointData) === null || _pointData6 === void 0 ? void 0 : _pointData6.pointEnumItemKey) || displayValue;
88
+ }
89
+ var tooltipTitle = null;
90
+ if (!configPoint) {
91
+ tooltipTitle = '未绑定点位';
92
+ } else {
93
+ var _pointData7, _pointData8, _pointData$unit, _pointData9, _pointData0, _pointData1, _pointData1$indicator;
94
+ tooltipTitle = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, "\u70B9\u4F4D\u540D\u79F0\uFF1A", ((_pointData7 = pointData) === null || _pointData7 === void 0 ? void 0 : _pointData7.pointName) || ((_pointData8 = pointData) === null || _pointData8 === void 0 ? void 0 : _pointData8.indicatorName) || '-'), /*#__PURE__*/React.createElement("div", null, "\u70B9\u4F4D\u503C\uFF1A", pointValue, " ", (_pointData$unit = (_pointData9 = pointData) === null || _pointData9 === void 0 ? void 0 : _pointData9.unit) !== null && _pointData$unit !== void 0 ? _pointData$unit : '-'), /*#__PURE__*/React.createElement("div", null, "\u66F4\u65B0\u65F6\u95F4\uFF1A", ((_pointData0 = pointData) === null || _pointData0 === void 0 ? void 0 : _pointData0.updateTime) || ((_pointData1 = pointData) === null || _pointData1 === void 0 ? void 0 : (_pointData1$indicator = _pointData1.indicatorData) === null || _pointData1$indicator === void 0 ? void 0 : _pointData1$indicator.ts) || '-'));
60
95
  }
61
96
  var numberColor = getValueByExpression(value, payload === null || payload === void 0 ? void 0 : payload.colorExpressions);
97
+ var _useRequest = useRequest(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
98
+ var _pointData10, _pointData11;
99
+ var _yield$GetDeviceInfo, success, data;
100
+ return _regenerator().w(function (_context) {
101
+ while (1) switch (_context.n) {
102
+ case 0:
103
+ if ((_pointData10 = pointData) === null || _pointData10 === void 0 ? void 0 : _pointData10.deviceId) {
104
+ _context.n = 1;
105
+ break;
106
+ }
107
+ return _context.a(2);
108
+ case 1:
109
+ _context.n = 2;
110
+ return GetDeviceInfo({
111
+ deviceId: (_pointData11 = pointData) === null || _pointData11 === void 0 ? void 0 : _pointData11.deviceId
112
+ });
113
+ case 2:
114
+ _yield$GetDeviceInfo = _context.v;
115
+ success = _yield$GetDeviceInfo.success;
116
+ data = _yield$GetDeviceInfo.data;
117
+ if (success) {
118
+ _context.n = 3;
119
+ break;
120
+ }
121
+ return _context.a(2);
122
+ case 3:
123
+ return _context.a(2, data);
124
+ }
125
+ }, _callee);
126
+ })), {
127
+ cacheKey: "device-info-".concat((_pointData12 = pointData) === null || _pointData12 === void 0 ? void 0 : _pointData12.deviceId),
128
+ onError: function onError(err) {
129
+ console.error(err);
130
+ },
131
+ refreshDeps: [(_pointData13 = pointData) === null || _pointData13 === void 0 ? void 0 : _pointData13.deviceId],
132
+ pollingInterval: 10 * 60 * 1000
133
+ }),
134
+ deviceInfo = _useRequest.data;
135
+ var eventHandles2 = useEleEventHandle({
136
+ events: payload === null || payload === void 0 ? void 0 : payload.events2,
137
+ payload: {
138
+ points: [{
139
+ pointIdList: [(_pointData14 = pointData) === null || _pointData14 === void 0 ? void 0 : _pointData14.pointId],
140
+ protocol: deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.protocol,
141
+ pointEnumItemList: (_pointData15 = pointData) === null || _pointData15 === void 0 ? void 0 : _pointData15.pointEnumItemList,
142
+ pointValue: (_pointData16 = pointData) === null || _pointData16 === void 0 ? void 0 : _pointData16.value
143
+ }],
144
+ namespace: (_payload$mittMeta$nam2 = payload === null || payload === void 0 ? void 0 : (_payload$mittMeta3 = payload.mittMeta) === null || _payload$mittMeta3 === void 0 ? void 0 : _payload$mittMeta3.namespace) !== null && _payload$mittMeta$nam2 !== void 0 ? _payload$mittMeta$nam2 : 0
145
+ }
146
+ });
62
147
  return /*#__PURE__*/React.createElement("div", {
63
148
  onClick: function onClick(e) {
64
- return eventHandles.current.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
+ }
65
154
  },
66
155
  onContextMenu: function onContextMenu(e) {
67
156
  return eventHandles.current.onContextMenu(e);
@@ -88,6 +177,17 @@ var ElePointValueComponent = function ElePointValueComponent(_ref) {
88
177
  }, pointValue === null ? '-' : pointValue), (payload === null || payload === void 0 ? void 0 : (_payload$unit3 = payload.unit) === null || _payload$unit3 === void 0 ? void 0 : _payload$unit3.isShow) ? /*#__PURE__*/React.createElement("span", {
89
178
  style: unitStyle,
90
179
  className: styles.unit
91
- }, (payload === null || payload === void 0 ? void 0 : payload.unit.text) || (pointData === null || pointData === void 0 ? void 0 : pointData.unit)) : null)));
180
+ }, (payload === null || payload === void 0 ? void 0 : payload.unit.text) || ((_pointData17 = pointData) === null || _pointData17 === void 0 ? void 0 : _pointData17.unit)) : null)), ((_pointData18 = pointData) === null || _pointData18 === void 0 ? void 0 : _pointData18.isWrite) && premission.includes('292') ? /*#__PURE__*/React.createElement("div", {
181
+ className: styles.write,
182
+ onClick: function onClick(e) {
183
+ e.stopPropagation();
184
+ eventHandles2.current.onClick(e);
185
+ }
186
+ }, /*#__PURE__*/React.createElement(IconFont, {
187
+ type: 'icon-edit_active',
188
+ style: {
189
+ fontSize: '18px'
190
+ }
191
+ })) : undefined);
92
192
  };
93
193
  export default /*#__PURE__*/memo(ElePointValueComponent, reactShapeNodeAreEqual);
@@ -71,6 +71,12 @@ var StatisticsPropsSet = function StatisticsPropsSet() {
71
71
  }, {
72
72
  label: '本年',
73
73
  value: 1
74
+ }, {
75
+ label: '本日',
76
+ value: 2
77
+ }, {
78
+ label: '本周',
79
+ value: 3
74
80
  }]
75
81
  })));
76
82
  };
@@ -1,4 +1,5 @@
1
1
  .wrap {
2
+ position: relative;
2
3
  display: flex;
3
4
  flex-direction: column;
4
5
  justify-content: space-between;
@@ -15,6 +16,16 @@
15
16
  white-space: nowrap;
16
17
  cursor: pointer;
17
18
  }
19
+ .write {
20
+ position: absolute;
21
+ top: 4px;
22
+ right: -16px;
23
+ display: none;
24
+ cursor: pointer;
25
+ }
26
+ .wrap:hover .write {
27
+ display: block;
28
+ }
18
29
  .unit {
19
30
  margin-left: 4px;
20
31
  font-size: 0.5em;
@@ -47,9 +47,15 @@ export var defaultConfig = {
47
47
  isShow: true
48
48
  },
49
49
  value: {},
50
+ valueType: 0,
51
+ valueDate: 0,
50
52
  events: [{
51
53
  type: 'click',
52
54
  action: 'show-point-history'
55
+ }],
56
+ events2: [{
57
+ type: 'click',
58
+ action: 'show-point-write'
53
59
  }]
54
60
  },
55
61
  component: registerComponentName