coolcare-lite-scada-component 3.0.1 → 3.0.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.
- package/es/components/DialogHistory/index.css +22 -0
- package/es/components/DialogHistory/index.js +317 -83
- package/es/components/DialogImagePicker/GroupPanel/index.js +1 -1
- package/es/components/ECharts/index.js +31 -23
- package/es/components/Icon/index.js +1 -1
- package/es/components/ImageUploader/index.js +1 -1
- package/es/components/ModalChoosePoint/index.js +235 -0
- package/es/element/EleFan/Component.js +1 -1
- package/es/element/EleFanBySvg/index.js +3 -3
- package/es/element/EleImage/index.js +1 -1
- package/es/element/ElePointImage/index.js +1 -1
- package/es/element/ElePointValue/Component.js +10 -6
- package/es/element/ElePointValue/PropsSet/StatisticsPropsSet/index.js +77 -0
- package/es/element/ElePointValue/PropsSet/index.js +5 -1
- package/es/element/EleState/index.js +1 -1
- package/es/element/EleSwitch/Component.js +3 -4
- package/es/element/EleSwitch/index.css +3 -0
- package/es/element/PipeNodes/NodeBL/index.js +1 -1
- package/es/element/PipeNodes/NodeBR/index.js +1 -1
- package/es/element/PipeNodes/NodeBottom/index.js +1 -1
- package/es/element/PipeNodes/NodeCenter/index.js +1 -1
- package/es/element/PipeNodes/NodeHorizontal/index.js +1 -1
- package/es/element/PipeNodes/NodeLeft/index.js +1 -1
- package/es/element/PipeNodes/NodeRight/index.js +1 -1
- package/es/element/PipeNodes/NodeTL/index.js +1 -1
- package/es/element/PipeNodes/NodeTR/index.js +1 -1
- package/es/element/PipeNodes/NodeTop/index.js +1 -1
- package/es/element/PipeNodes/NodeVertical/index.js +1 -1
- package/es/element/type.d.ts +1 -0
- package/es/element/utils/pointWrite.js +6 -7
- package/es/pages/display/Player/index.js +104 -16
- package/es/pages/display/index.js +2 -2
- package/es/pages/editor/PanelLeft/BasicShapeList/listData.js +8 -8
- package/es/pages/editor/PanelLeft/ImgGroup/index.js +1 -1
- package/es/pages/editor/PanelLeft/MetaEleList/listData.js +14 -14
- package/es/pages/editor/PanelLeft/PipeEleList/listData.js +11 -11
- package/es/pages/editor/PanelLeft/PointCardEleList/listData.js +6 -6
- package/es/pages/editor/PanelLeft/RecommendEleList/listData.js +4 -4
- package/es/pages/editor/PanelRight/components/FormLayer/index.js +12 -2
- package/es/pages/editor/index.js +15 -2
- package/es/services/gateway/Point.js +56 -7
- package/es/services/request.js +1 -1
- package/es/typings.d.ts +18 -4
- package/es/utils/date.js +7 -0
- package/package.json +3 -3
|
@@ -6,6 +6,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import React from "react";
|
|
8
8
|
import { useEffect, useRef, useImperativeHandle, forwardRef } from 'react';
|
|
9
|
+
import { Spin } from 'antd';
|
|
9
10
|
import { useSize } from 'ahooks';
|
|
10
11
|
// 引入 echarts 核心模块,核心模块提供了 echarts 使用必须要的接口。
|
|
11
12
|
|
|
@@ -14,12 +15,14 @@ import styles from "./index.css";
|
|
|
14
15
|
/** 默认的颜色组 */
|
|
15
16
|
export var defaultColors = ['#1890FF', '#04C74C', '#FFCD00', '#253076', '#8F30E9', '#03C7C3'];
|
|
16
17
|
var EChartsComponent = function EChartsComponent(_ref, ref) {
|
|
17
|
-
var
|
|
18
|
+
var id = _ref.id,
|
|
19
|
+
option = _ref.option,
|
|
18
20
|
style = _ref.style,
|
|
19
21
|
className = _ref.className,
|
|
20
22
|
_ref$loading = _ref.loading,
|
|
21
|
-
loading = _ref$loading === void 0 ? false : _ref$loading
|
|
22
|
-
|
|
23
|
+
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
24
|
+
onEvents = _ref.onEvents;
|
|
25
|
+
var echartLoaderStatus = useExternal('/imgfile/iot/package/echarts/5.2.2/echarts.min.js', {
|
|
23
26
|
type: 'js',
|
|
24
27
|
js: {
|
|
25
28
|
async: true
|
|
@@ -41,34 +44,33 @@ var EChartsComponent = function EChartsComponent(_ref, ref) {
|
|
|
41
44
|
useEffect(function () {
|
|
42
45
|
if (wrapRef.current && echartLoaderStatus === 'ready') {
|
|
43
46
|
// 初始化图表
|
|
47
|
+
// @ts-ignore
|
|
44
48
|
chartInstance.current = window.echarts.init(wrapRef.current);
|
|
49
|
+
// 绑定事件
|
|
50
|
+
if (onEvents && chartInstance.current) {
|
|
51
|
+
Object.keys(onEvents).forEach(function (eventName) {
|
|
52
|
+
var _chartInstance$curren;
|
|
53
|
+
(_chartInstance$curren = chartInstance.current) === null || _chartInstance$curren === void 0 ? void 0 : _chartInstance$curren.on(eventName, onEvents[eventName]);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
45
56
|
// wrapRef.current.style.removeProperty('position')
|
|
46
57
|
return function () {
|
|
47
|
-
var _chartInstance$
|
|
58
|
+
var _chartInstance$curren3;
|
|
48
59
|
// 组件卸载时,调用 ECharts 的销毁函数
|
|
49
|
-
(
|
|
60
|
+
Object.keys(onEvents).forEach(function (eventName) {
|
|
61
|
+
var _chartInstance$curren2;
|
|
62
|
+
(_chartInstance$curren2 = chartInstance.current) === null || _chartInstance$curren2 === void 0 ? void 0 : _chartInstance$curren2.off(eventName);
|
|
63
|
+
});
|
|
64
|
+
(_chartInstance$curren3 = chartInstance.current) === null || _chartInstance$curren3 === void 0 ? void 0 : _chartInstance$curren3.dispose();
|
|
50
65
|
};
|
|
51
66
|
}
|
|
52
67
|
return function () {};
|
|
53
68
|
}, [echartLoaderStatus]);
|
|
54
69
|
useEffect(function () {
|
|
55
|
-
var _chartInstance$
|
|
70
|
+
var _chartInstance$curren4;
|
|
56
71
|
// 在 wrap 大小改变后,resize 图表
|
|
57
|
-
(_chartInstance$
|
|
72
|
+
(_chartInstance$curren4 = chartInstance.current) === null || _chartInstance$curren4 === void 0 ? void 0 : _chartInstance$curren4.resize();
|
|
58
73
|
}, [size]);
|
|
59
|
-
useEffect(function () {
|
|
60
|
-
if (loading) {
|
|
61
|
-
var _chartInstance$curren3;
|
|
62
|
-
(_chartInstance$curren3 = chartInstance.current) === null || _chartInstance$curren3 === void 0 ? void 0 : _chartInstance$curren3.showLoading({
|
|
63
|
-
color: '#40a9ff',
|
|
64
|
-
lineWidth: 2,
|
|
65
|
-
text: '加载中...'
|
|
66
|
-
});
|
|
67
|
-
} else {
|
|
68
|
-
var _chartInstance$curren4;
|
|
69
|
-
(_chartInstance$curren4 = chartInstance.current) === null || _chartInstance$curren4 === void 0 ? void 0 : _chartInstance$curren4.hideLoading();
|
|
70
|
-
}
|
|
71
|
-
}, [loading]);
|
|
72
74
|
useEffect(function () {
|
|
73
75
|
// 监听 props.option, 变更后重新渲染图表
|
|
74
76
|
if (!option) {
|
|
@@ -84,11 +86,17 @@ var EChartsComponent = function EChartsComponent(_ref, ref) {
|
|
|
84
86
|
}, option));
|
|
85
87
|
}
|
|
86
88
|
}, [option, echartLoaderStatus]);
|
|
87
|
-
return /*#__PURE__*/React.createElement(
|
|
88
|
-
|
|
89
|
+
return /*#__PURE__*/React.createElement(Spin, {
|
|
90
|
+
spinning: loading || echartLoaderStatus === 'loading',
|
|
91
|
+
delay: 200
|
|
89
92
|
}, /*#__PURE__*/React.createElement("div", {
|
|
93
|
+
id: id,
|
|
90
94
|
ref: wrapRef,
|
|
91
|
-
className: "".concat(styles.echarts, " ").concat(className)
|
|
95
|
+
className: "".concat(styles.echarts, " ").concat(className),
|
|
96
|
+
style: style || {
|
|
97
|
+
height: '220px',
|
|
98
|
+
width: '100%'
|
|
99
|
+
}
|
|
92
100
|
}));
|
|
93
101
|
};
|
|
94
102
|
export default /*#__PURE__*/forwardRef(EChartsComponent);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createFromIconfontCN } from '@ant-design/icons';
|
|
2
2
|
var MyIcon = createFromIconfontCN({
|
|
3
|
-
scriptUrl: '
|
|
3
|
+
scriptUrl: '/imgfile/iot/iconfont/scada.js' // 在 iconfont.cn 上生成
|
|
4
4
|
});
|
|
5
5
|
export default MyIcon;
|
|
@@ -72,7 +72,7 @@ var ImageUploader = function ImageUploader(_ref) {
|
|
|
72
72
|
if (!isJpgOrPngOrSvgOrGif) {
|
|
73
73
|
message.error('只能上传 JPG/PNG/Svg/Gif 文件!');
|
|
74
74
|
}
|
|
75
|
-
var size =
|
|
75
|
+
var size = 50;
|
|
76
76
|
var isLtSize = file.size / 1024 / 1024 < size;
|
|
77
77
|
if (!isLtSize) {
|
|
78
78
|
notification.open({
|
|
@@ -0,0 +1,235 @@
|
|
|
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 _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
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); }); }; }
|
|
6
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
7
|
+
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."); }
|
|
8
|
+
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; } }
|
|
9
|
+
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; }
|
|
10
|
+
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; } }
|
|
11
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
12
|
+
import React from "react";
|
|
13
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
14
|
+
import { Modal, Button, Form, Space, message, Select } from 'antd';
|
|
15
|
+
import { GetDevicePage, GetDevicePoint } from "../../services/gateway/Device";
|
|
16
|
+
var Option = Select.Option;
|
|
17
|
+
var tailLayout = {
|
|
18
|
+
wrapperCol: {
|
|
19
|
+
offset: 2,
|
|
20
|
+
span: 22
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
var ModalChoosePoint = function ModalChoosePoint(_ref) {
|
|
24
|
+
var visible = _ref.visible,
|
|
25
|
+
onSubmit = _ref.onSubmit,
|
|
26
|
+
onCancel = _ref.onCancel,
|
|
27
|
+
companyId = _ref.companyId,
|
|
28
|
+
currentDeviceId = _ref.currentDeviceId;
|
|
29
|
+
var _Form$useForm = Form.useForm(),
|
|
30
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
31
|
+
form = _Form$useForm2[0];
|
|
32
|
+
/** 设备列表 */
|
|
33
|
+
var _useState = useState([]),
|
|
34
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
35
|
+
deviceList = _useState2[0],
|
|
36
|
+
setDeviceList = _useState2[1];
|
|
37
|
+
/** 产品点位列表 */
|
|
38
|
+
var _useState3 = useState([]),
|
|
39
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
40
|
+
pointList = _useState4[0],
|
|
41
|
+
setPointList = _useState4[1];
|
|
42
|
+
var closeModal = function closeModal() {
|
|
43
|
+
onCancel === null || onCancel === void 0 ? void 0 : onCancel();
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/** 获取产品最新发布版本点位列表 */
|
|
47
|
+
var fetchPointList = useCallback(/*#__PURE__*/function () {
|
|
48
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(val) {
|
|
49
|
+
var res;
|
|
50
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
51
|
+
while (1) switch (_context.prev = _context.next) {
|
|
52
|
+
case 0:
|
|
53
|
+
_context.prev = 0;
|
|
54
|
+
_context.next = 3;
|
|
55
|
+
return GetDevicePoint({
|
|
56
|
+
deviceIdList: [val]
|
|
57
|
+
});
|
|
58
|
+
case 3:
|
|
59
|
+
res = _context.sent;
|
|
60
|
+
if (res.success) {
|
|
61
|
+
setPointList(res.data || []);
|
|
62
|
+
} else {
|
|
63
|
+
message.error(res.message);
|
|
64
|
+
}
|
|
65
|
+
_context.next = 11;
|
|
66
|
+
break;
|
|
67
|
+
case 7:
|
|
68
|
+
_context.prev = 7;
|
|
69
|
+
_context.t0 = _context["catch"](0);
|
|
70
|
+
console.error(_context.t0);
|
|
71
|
+
message.error('获取属性列表失败');
|
|
72
|
+
case 11:
|
|
73
|
+
case "end":
|
|
74
|
+
return _context.stop();
|
|
75
|
+
}
|
|
76
|
+
}, _callee, null, [[0, 7]]);
|
|
77
|
+
}));
|
|
78
|
+
return function (_x) {
|
|
79
|
+
return _ref2.apply(this, arguments);
|
|
80
|
+
};
|
|
81
|
+
}(), []);
|
|
82
|
+
|
|
83
|
+
/** 获取设备列表 */
|
|
84
|
+
var fetchDeviceList = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
85
|
+
var res, _res$data;
|
|
86
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
87
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
88
|
+
case 0:
|
|
89
|
+
_context2.prev = 0;
|
|
90
|
+
_context2.next = 3;
|
|
91
|
+
return GetDevicePage({
|
|
92
|
+
companyId: companyId
|
|
93
|
+
});
|
|
94
|
+
case 3:
|
|
95
|
+
res = _context2.sent;
|
|
96
|
+
if (res.success) {
|
|
97
|
+
setDeviceList(((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.list) || []);
|
|
98
|
+
} else {
|
|
99
|
+
message.error(res.message);
|
|
100
|
+
}
|
|
101
|
+
_context2.next = 10;
|
|
102
|
+
break;
|
|
103
|
+
case 7:
|
|
104
|
+
_context2.prev = 7;
|
|
105
|
+
_context2.t0 = _context2["catch"](0);
|
|
106
|
+
message.error('获取设备列表失败');
|
|
107
|
+
case 10:
|
|
108
|
+
case "end":
|
|
109
|
+
return _context2.stop();
|
|
110
|
+
}
|
|
111
|
+
}, _callee2, null, [[0, 7]]);
|
|
112
|
+
})), [companyId]);
|
|
113
|
+
|
|
114
|
+
/** 提交表单且数据验证成功后回调事件 */
|
|
115
|
+
var onFinish = /*#__PURE__*/function () {
|
|
116
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(val) {
|
|
117
|
+
var _val$pointIdList;
|
|
118
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
119
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
120
|
+
case 0:
|
|
121
|
+
if ((_val$pointIdList = val.pointIdList) === null || _val$pointIdList === void 0 ? void 0 : _val$pointIdList.length) {
|
|
122
|
+
onSubmit(val.pointIdList);
|
|
123
|
+
closeModal();
|
|
124
|
+
} else {
|
|
125
|
+
message.error('请至少选择一个属性');
|
|
126
|
+
}
|
|
127
|
+
case 1:
|
|
128
|
+
case "end":
|
|
129
|
+
return _context3.stop();
|
|
130
|
+
}
|
|
131
|
+
}, _callee3);
|
|
132
|
+
}));
|
|
133
|
+
return function onFinish(_x2) {
|
|
134
|
+
return _ref4.apply(this, arguments);
|
|
135
|
+
};
|
|
136
|
+
}();
|
|
137
|
+
useEffect(function () {
|
|
138
|
+
if (visible && !deviceList.length) {
|
|
139
|
+
fetchDeviceList();
|
|
140
|
+
}
|
|
141
|
+
}, [visible, deviceList.length]);
|
|
142
|
+
useEffect(function () {
|
|
143
|
+
if (currentDeviceId) {
|
|
144
|
+
fetchPointList(currentDeviceId);
|
|
145
|
+
form.setFieldValue('deviceId', currentDeviceId);
|
|
146
|
+
}
|
|
147
|
+
}, [currentDeviceId]);
|
|
148
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
149
|
+
title: '选择属性',
|
|
150
|
+
closable: false,
|
|
151
|
+
width: 300,
|
|
152
|
+
maskClosable: true,
|
|
153
|
+
footer: null,
|
|
154
|
+
onCancel: closeModal,
|
|
155
|
+
visible: visible,
|
|
156
|
+
wrapClassName: 'form-modal'
|
|
157
|
+
}, /*#__PURE__*/React.createElement(Form, {
|
|
158
|
+
layout: "vertical",
|
|
159
|
+
form: form,
|
|
160
|
+
name: "filterForm",
|
|
161
|
+
onFinish: onFinish,
|
|
162
|
+
initialValues: {
|
|
163
|
+
type: 1
|
|
164
|
+
}
|
|
165
|
+
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
166
|
+
name: "deviceId",
|
|
167
|
+
label: "\u8BBE\u5907",
|
|
168
|
+
rules: [{
|
|
169
|
+
required: true,
|
|
170
|
+
message: '请选择'
|
|
171
|
+
}]
|
|
172
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
173
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
174
|
+
defaultValue: currentDeviceId,
|
|
175
|
+
onChange: function onChange(value) {
|
|
176
|
+
fetchPointList(value);
|
|
177
|
+
form.setFieldsValue({
|
|
178
|
+
pointIdList: []
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}, deviceList.map(function (item) {
|
|
182
|
+
return /*#__PURE__*/React.createElement(Option, {
|
|
183
|
+
value: item.deviceId,
|
|
184
|
+
label: item.deviceName,
|
|
185
|
+
key: item.deviceId
|
|
186
|
+
}, item.deviceName);
|
|
187
|
+
}))), /*#__PURE__*/React.createElement(Form.Item, {
|
|
188
|
+
noStyle: true,
|
|
189
|
+
dependencies: ['deviceId']
|
|
190
|
+
}, function (_ref5) {
|
|
191
|
+
var getFieldValue = _ref5.getFieldValue;
|
|
192
|
+
return /*#__PURE__*/React.createElement(Form.Item, {
|
|
193
|
+
name: "pointIdList",
|
|
194
|
+
label: "\u5C5E\u6027",
|
|
195
|
+
rules: [{
|
|
196
|
+
required: true,
|
|
197
|
+
message: '请选择'
|
|
198
|
+
}]
|
|
199
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
200
|
+
allowClear: true,
|
|
201
|
+
mode: 'multiple',
|
|
202
|
+
showSearch: true,
|
|
203
|
+
optionFilterProp: "label",
|
|
204
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
205
|
+
disabled: !getFieldValue('deviceId')
|
|
206
|
+
}, pointList.map(function (item) {
|
|
207
|
+
return /*#__PURE__*/React.createElement(Option, {
|
|
208
|
+
value: item.pointId,
|
|
209
|
+
label: item.pointName,
|
|
210
|
+
key: item.pointId
|
|
211
|
+
}, item.pointName);
|
|
212
|
+
})));
|
|
213
|
+
}), /*#__PURE__*/React.createElement(Form.Item, _extends({}, tailLayout, {
|
|
214
|
+
noStyle: true,
|
|
215
|
+
className: "modelFooterItem"
|
|
216
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
217
|
+
className: "form-modal-footer"
|
|
218
|
+
}, /*#__PURE__*/React.createElement(Space, {
|
|
219
|
+
align: "center",
|
|
220
|
+
size: 15
|
|
221
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
222
|
+
onClick: onCancel,
|
|
223
|
+
htmlType: "button",
|
|
224
|
+
style: {
|
|
225
|
+
float: 'right'
|
|
226
|
+
}
|
|
227
|
+
}, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
|
|
228
|
+
type: "primary",
|
|
229
|
+
htmlType: "submit",
|
|
230
|
+
style: {
|
|
231
|
+
float: 'right'
|
|
232
|
+
}
|
|
233
|
+
}, "\u786E\u5B9A"))))));
|
|
234
|
+
};
|
|
235
|
+
export default ModalChoosePoint;
|
|
@@ -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: "
|
|
101
|
+
src: "/imgfile/iot/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 = '
|
|
148
|
+
var imgUrl = '/imgfile/iot/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 = '
|
|
150
|
+
imgUrl = '/imgfile/iot/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: '
|
|
244
|
+
xlinkHref: '/imgfile/iot/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: '
|
|
45
|
+
xlinkHref: '/imgfile/iot/%E5%9B%BE%E7%89%87.svg'
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
data: {
|
|
@@ -17,7 +17,7 @@ var directionClassNameMap = {
|
|
|
17
17
|
bottom: 'flex-col-reverse'
|
|
18
18
|
};
|
|
19
19
|
var ElePointValueComponent = function ElePointValueComponent(_ref) {
|
|
20
|
-
var _payload$pointList, _payload$label, _payload$unit, _payload$unit2, _payload$value, _payload$value2, _payload$mittMeta$nam, _payload$mittMeta, _payload$mittMeta2, _payload$label2, _pointValue, _payload$unit3;
|
|
20
|
+
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, _pointValue, _payload$unit3;
|
|
21
21
|
var node = _ref.node;
|
|
22
22
|
var payload = node === null || node === void 0 ? void 0 : node.getData();
|
|
23
23
|
var configPoint = payload === null || payload === void 0 ? void 0 : (_payload$pointList = payload.pointList) === null || _payload$pointList === void 0 ? void 0 : _payload$pointList[0];
|
|
@@ -36,23 +36,27 @@ var ElePointValueComponent = function ElePointValueComponent(_ref) {
|
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
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);
|
|
39
|
+
var value = (pointData === null || pointData === void 0 ? void 0 : pointData.value) || (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) || '-';
|
|
40
|
+
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) {
|
|
41
|
+
value = Number(value.toFixed(1));
|
|
42
|
+
}
|
|
39
43
|
var tooltipTitle = null;
|
|
40
44
|
if (!configPoint) {
|
|
41
45
|
tooltipTitle = '未绑定点位';
|
|
42
46
|
} else {
|
|
43
|
-
var _pointData$
|
|
44
|
-
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",
|
|
47
|
+
var _pointData$unit;
|
|
48
|
+
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", 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) || '-'));
|
|
45
49
|
}
|
|
46
50
|
var pointValue = '';
|
|
47
51
|
if (window.scadaMode === 'edit') {
|
|
48
52
|
pointValue = '点位值';
|
|
49
53
|
} else {
|
|
50
54
|
if (configPoint === null || configPoint === void 0 ? void 0 : configPoint.expressions) {
|
|
51
|
-
pointValue = getValueByExpression(
|
|
55
|
+
pointValue = getValueByExpression(value, configPoint === null || configPoint === void 0 ? void 0 : configPoint.expressions);
|
|
52
56
|
}
|
|
53
|
-
pointValue = (pointData === null || pointData === void 0 ? void 0 : pointData.pointEnumItemKey) ||
|
|
57
|
+
pointValue = (pointData === null || pointData === void 0 ? void 0 : pointData.pointEnumItemKey) || value;
|
|
54
58
|
}
|
|
55
|
-
var numberColor = getValueByExpression(
|
|
59
|
+
var numberColor = getValueByExpression(value, payload === null || payload === void 0 ? void 0 : payload.colorExpressions);
|
|
56
60
|
return /*#__PURE__*/React.createElement("div", {
|
|
57
61
|
onClick: function onClick(e) {
|
|
58
62
|
return eventHandles.current.onClick(e);
|
|
@@ -0,0 +1,77 @@
|
|
|
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 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
|
+
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
|
+
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; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
8
|
+
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."); }
|
|
9
|
+
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; } }
|
|
10
|
+
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; }
|
|
11
|
+
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; } }
|
|
12
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
13
|
+
import React from "react";
|
|
14
|
+
import { Form, Select } from 'antd';
|
|
15
|
+
import { useModel } from 'umi';
|
|
16
|
+
import { useEffect } from 'react';
|
|
17
|
+
var StatisticsPropsSet = function StatisticsPropsSet() {
|
|
18
|
+
var _useModel = useModel('useEditor', function (model) {
|
|
19
|
+
return {
|
|
20
|
+
activeNode: model.activeNode
|
|
21
|
+
};
|
|
22
|
+
}),
|
|
23
|
+
activeNode = _useModel.activeNode;
|
|
24
|
+
var _Form$useForm = Form.useForm(),
|
|
25
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
26
|
+
StatisticsForm = _Form$useForm2[0];
|
|
27
|
+
var valueTypeV = Form.useWatch('valueType', StatisticsForm);
|
|
28
|
+
useEffect(function () {
|
|
29
|
+
if (!activeNode) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
var data = activeNode.getData();
|
|
33
|
+
StatisticsForm.setFieldsValue({
|
|
34
|
+
valueType: data.valueType || 0,
|
|
35
|
+
valueDate: data.valueDate || 0
|
|
36
|
+
});
|
|
37
|
+
}, [activeNode, StatisticsForm]);
|
|
38
|
+
var onUnitFormChange = function onUnitFormChange(changedValues, values) {
|
|
39
|
+
activeNode === null || activeNode === void 0 ? void 0 : activeNode.setData(_objectSpread({}, values), {
|
|
40
|
+
deep: false
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
return /*#__PURE__*/React.createElement(Form, {
|
|
44
|
+
form: StatisticsForm,
|
|
45
|
+
size: "small",
|
|
46
|
+
labelCol: {
|
|
47
|
+
span: 8
|
|
48
|
+
},
|
|
49
|
+
onValuesChange: onUnitFormChange
|
|
50
|
+
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
51
|
+
name: "valueType",
|
|
52
|
+
label: "\u7EDF\u8BA1\u65B9\u5F0F"
|
|
53
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
54
|
+
defaultValue: 0,
|
|
55
|
+
options: [{
|
|
56
|
+
label: '当前值',
|
|
57
|
+
value: 0
|
|
58
|
+
}, {
|
|
59
|
+
label: '累计值',
|
|
60
|
+
value: 1
|
|
61
|
+
}]
|
|
62
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
63
|
+
name: "valueDate",
|
|
64
|
+
label: "\u7EDF\u8BA1\u65F6\u95F4"
|
|
65
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
66
|
+
disabled: valueTypeV === 0,
|
|
67
|
+
defaultValue: 0,
|
|
68
|
+
options: [{
|
|
69
|
+
label: '本月',
|
|
70
|
+
value: 0
|
|
71
|
+
}, {
|
|
72
|
+
label: '本年',
|
|
73
|
+
value: 1
|
|
74
|
+
}]
|
|
75
|
+
})));
|
|
76
|
+
};
|
|
77
|
+
export default StatisticsPropsSet;
|
|
@@ -7,6 +7,7 @@ import GlobalPropsSet from "./GlobalPropSet";
|
|
|
7
7
|
import TitlePropsSet from "./TitlePropsSet";
|
|
8
8
|
import UnitPropsSet from "./UnitPropsSet";
|
|
9
9
|
import ValuePropsSet from "./ValuePropsSet";
|
|
10
|
+
import StatisticsPropsSet from "./StatisticsPropsSet";
|
|
10
11
|
var Panel = Collapse.Panel;
|
|
11
12
|
var PropsSet = function PropsSet() {
|
|
12
13
|
var forceUpdate = useForceUpdate();
|
|
@@ -36,6 +37,9 @@ var PropsSet = function PropsSet() {
|
|
|
36
37
|
}, /*#__PURE__*/React.createElement(TitlePropsSet, null)), /*#__PURE__*/React.createElement(Panel, {
|
|
37
38
|
header: "\u540E\u7F00",
|
|
38
39
|
key: "5"
|
|
39
|
-
}, /*#__PURE__*/React.createElement(UnitPropsSet, null))
|
|
40
|
+
}, /*#__PURE__*/React.createElement(UnitPropsSet, null)), /*#__PURE__*/React.createElement(Panel, {
|
|
41
|
+
header: "\u7EDF\u8BA1\u65B9\u5F0F",
|
|
42
|
+
key: "6"
|
|
43
|
+
}, /*#__PURE__*/React.createElement(StatisticsPropsSet, null)));
|
|
40
44
|
};
|
|
41
45
|
export default PropsSet;
|
|
@@ -23,6 +23,7 @@ var EleSwitchComponent = function EleSwitchComponent(_ref) {
|
|
|
23
23
|
value = _useState2[0],
|
|
24
24
|
setValue = _useState2[1];
|
|
25
25
|
var payload = node === null || node === void 0 ? void 0 : node.getData();
|
|
26
|
+
var premission = payload === null || payload === void 0 ? void 0 : payload.premission;
|
|
26
27
|
var configPoint = payload === null || payload === void 0 ? void 0 : (_payload$pointList = payload.pointList) === null || _payload$pointList === void 0 ? void 0 : _payload$pointList[0];
|
|
27
28
|
var pointData = usePointWatch(configPoint, payload === null || payload === void 0 ? void 0 : (_payload$mittMeta = payload.mittMeta) === null || _payload$mittMeta === void 0 ? void 0 : _payload$mittMeta.namespace);
|
|
28
29
|
var tooltipTitle = null;
|
|
@@ -73,10 +74,8 @@ var EleSwitchComponent = function EleSwitchComponent(_ref) {
|
|
|
73
74
|
}
|
|
74
75
|
}, [pointData === null || pointData === void 0 ? void 0 : pointData.value, payload === null || payload === void 0 ? void 0 : payload.checkedValue]);
|
|
75
76
|
return /*#__PURE__*/React.createElement("div", {
|
|
76
|
-
className: styles.wrap,
|
|
77
|
-
|
|
78
|
-
return e.stopPropagation();
|
|
79
|
-
}
|
|
77
|
+
className: "".concat(styles.wrap, " ").concat(premission.includes("49") ? "" : styles.hide),
|
|
78
|
+
id: "switch-".concat(pointData === null || pointData === void 0 ? void 0 : pointData.deviceId)
|
|
80
79
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
81
80
|
title: tooltipTitle
|
|
82
81
|
}, /*#__PURE__*/React.createElement(Switch, {
|
|
@@ -42,7 +42,7 @@ export var defaultConfig = {
|
|
|
42
42
|
}],
|
|
43
43
|
attrs: {
|
|
44
44
|
body: {
|
|
45
|
-
xlinkHref: '
|
|
45
|
+
xlinkHref: '/imgfile/iot/生产/组态图片/图片元素/be42df157707426fb53360693eae8094.svg',
|
|
46
46
|
refWidth: '100%',
|
|
47
47
|
refHeight: '100%'
|
|
48
48
|
}
|
|
@@ -43,7 +43,7 @@ export var defaultConfig = {
|
|
|
43
43
|
}],
|
|
44
44
|
attrs: {
|
|
45
45
|
body: {
|
|
46
|
-
xlinkHref: '
|
|
46
|
+
xlinkHref: '/imgfile/iot/生产/组态图片/图片元素/7cdce2491ce3468aae034f531bf149d5.svg',
|
|
47
47
|
refWidth: '100%',
|
|
48
48
|
refHeight: '100%'
|
|
49
49
|
}
|
|
@@ -43,7 +43,7 @@ export var defaultConfig = {
|
|
|
43
43
|
}],
|
|
44
44
|
attrs: {
|
|
45
45
|
body: {
|
|
46
|
-
xlinkHref: '
|
|
46
|
+
xlinkHref: '/imgfile/iot/%E7%94%9F%E4%BA%A7/%E7%BB%84%E6%80%81%E5%9B%BE%E7%89%87/%E5%9B%BE%E7%89%87%E5%85%83%E7%B4%A0/2358402046b8439b9bee49814e5d94e3.svg',
|
|
47
47
|
refWidth: '100%',
|
|
48
48
|
refHeight: '100%'
|
|
49
49
|
}
|
|
@@ -43,7 +43,7 @@ export var defaultConfig = {
|
|
|
43
43
|
}],
|
|
44
44
|
attrs: {
|
|
45
45
|
body: {
|
|
46
|
-
xlinkHref: '
|
|
46
|
+
xlinkHref: '/imgfile/iot/%E7%94%9F%E4%BA%A7/%E7%BB%84%E6%80%81%E5%9B%BE%E7%89%87/%E5%9B%BE%E7%89%87%E5%85%83%E7%B4%A0/58225b888f6a48b9af4b21444700c6ba.svg',
|
|
47
47
|
refWidth: '100%',
|
|
48
48
|
refHeight: '100%'
|
|
49
49
|
}
|