coolcare-lite-scada-component 2.0.35 → 2.0.37
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.js +199 -81
- package/es/components/ImageUploader/index.js +1 -1
- package/es/components/ModalChoosePoint/index.js +235 -0
- 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/EleSwitch/Component.js +2 -3
- package/es/element/EleSwitch/index.css +3 -0
- package/es/pages/display/Player/index.js +104 -16
- package/es/pages/editor/PanelRight/components/FormLayer/index.js +12 -2
- package/es/services/gateway/Point.js +56 -7
- package/es/typings.d.ts +12 -4
- package/package.json +4 -4
|
@@ -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;
|
|
@@ -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;
|
|
@@ -11,7 +11,6 @@ import Switch from "../../components/Switch";
|
|
|
11
11
|
import { usePointWatch } from "../../hooks";
|
|
12
12
|
import { isNumber } from "../../utils";
|
|
13
13
|
import { pointWrite } from "../utils";
|
|
14
|
-
import "../../elementCss.css";
|
|
15
14
|
import styles from "./index.css";
|
|
16
15
|
import { ExclamationCircleOutlined } from '@ant-design/icons';
|
|
17
16
|
var confirm = Modal.confirm;
|
|
@@ -23,6 +22,7 @@ var EleSwitchComponent = function EleSwitchComponent(_ref) {
|
|
|
23
22
|
value = _useState2[0],
|
|
24
23
|
setValue = _useState2[1];
|
|
25
24
|
var payload = node === null || node === void 0 ? void 0 : node.getData();
|
|
25
|
+
var premission = payload === null || payload === void 0 ? void 0 : payload.premission;
|
|
26
26
|
var configPoint = payload === null || payload === void 0 ? void 0 : (_payload$pointList = payload.pointList) === null || _payload$pointList === void 0 ? void 0 : _payload$pointList[0];
|
|
27
27
|
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
28
|
var tooltipTitle = null;
|
|
@@ -37,7 +37,6 @@ var EleSwitchComponent = function EleSwitchComponent(_ref) {
|
|
|
37
37
|
title: "操作警告",
|
|
38
38
|
icon: /*#__PURE__*/React.createElement(ExclamationCircleOutlined, null),
|
|
39
39
|
content: "确定执行操作吗?",
|
|
40
|
-
className: "big",
|
|
41
40
|
getContainer: function getContainer() {
|
|
42
41
|
return document.getElementById("scada-body");
|
|
43
42
|
},
|
|
@@ -73,7 +72,7 @@ var EleSwitchComponent = function EleSwitchComponent(_ref) {
|
|
|
73
72
|
}
|
|
74
73
|
}, [pointData === null || pointData === void 0 ? void 0 : pointData.value, payload === null || payload === void 0 ? void 0 : payload.checkedValue]);
|
|
75
74
|
return /*#__PURE__*/React.createElement("div", {
|
|
76
|
-
className: styles.wrap,
|
|
75
|
+
className: "".concat(styles.wrap, " ").concat(premission.includes("49") ? "" : styles.hide),
|
|
77
76
|
onClick: function onClick(e) {
|
|
78
77
|
return e.stopPropagation();
|
|
79
78
|
}
|
|
@@ -26,9 +26,10 @@ import ModalFanDevicePoint from "../../../components/ModalFanDevicePoint";
|
|
|
26
26
|
import emitter from "../../../utils/events";
|
|
27
27
|
import { GetDevicePoint } from "../../../services/gateway/Device";
|
|
28
28
|
import "./index.css";
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
import { GetTdIndicatorAggregateData } from "../../../services/gateway/Point";
|
|
30
|
+
import dayjs from 'dayjs';
|
|
31
31
|
var Player = function Player(_ref) {
|
|
32
|
+
var _jsonConfig$pageConfi;
|
|
32
33
|
var jsonConfig = _ref.jsonConfig,
|
|
33
34
|
query = _ref.query,
|
|
34
35
|
onEvent = _ref.onEvent;
|
|
@@ -63,6 +64,9 @@ var Player = function Player(_ref) {
|
|
|
63
64
|
var mittMeta = useMemo(function () {
|
|
64
65
|
return getMittMeta(query);
|
|
65
66
|
}, [query]);
|
|
67
|
+
|
|
68
|
+
/** 刷新频率 */
|
|
69
|
+
var RefreshFrequency = ((jsonConfig === null || jsonConfig === void 0 ? void 0 : (_jsonConfig$pageConfi = jsonConfig.pageConfig) === null || _jsonConfig$pageConfi === void 0 ? void 0 : _jsonConfig$pageConfi.refreshFrequency) || 1.5 * 60) * 1000;
|
|
66
70
|
useEffect(function () {
|
|
67
71
|
window.scadaMode = 'player';
|
|
68
72
|
return function () {
|
|
@@ -71,11 +75,11 @@ var Player = function Player(_ref) {
|
|
|
71
75
|
}, []);
|
|
72
76
|
useEffect(function () {
|
|
73
77
|
if (jsonConfig) {
|
|
74
|
-
var _jsonConfig$
|
|
78
|
+
var _jsonConfig$pageConfi2, _window$parent;
|
|
75
79
|
var msg = {
|
|
76
80
|
event: 'scada-config-loaded',
|
|
77
81
|
payload: {
|
|
78
|
-
dimensions: (jsonConfig === null || jsonConfig === void 0 ? void 0 : (_jsonConfig$
|
|
82
|
+
dimensions: (jsonConfig === null || jsonConfig === void 0 ? void 0 : (_jsonConfig$pageConfi2 = jsonConfig.pageConfig) === null || _jsonConfig$pageConfi2 === void 0 ? void 0 : _jsonConfig$pageConfi2.dimensions) || {
|
|
79
83
|
width: 341,
|
|
80
84
|
height: 500
|
|
81
85
|
},
|
|
@@ -265,7 +269,13 @@ var Player = function Player(_ref) {
|
|
|
265
269
|
scadaId: scadaId
|
|
266
270
|
}
|
|
267
271
|
});
|
|
268
|
-
|
|
272
|
+
console.log('[186]-index.tsx', onEvent, {
|
|
273
|
+
event: 'freedom-scene-switch',
|
|
274
|
+
payload: {
|
|
275
|
+
scadaId: scadaId
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
case 2:
|
|
269
279
|
case "end":
|
|
270
280
|
return _context4.stop();
|
|
271
281
|
}
|
|
@@ -315,13 +325,13 @@ var Player = function Player(_ref) {
|
|
|
315
325
|
});
|
|
316
326
|
}, [query, mittMeta]);
|
|
317
327
|
useEffect(function () {
|
|
318
|
-
var _jsonConfig$
|
|
328
|
+
var _jsonConfig$pageConfi3, _graphRef$current3;
|
|
319
329
|
if (!wrapSize || !jsonConfig || !query) return;
|
|
320
|
-
if (query.zoomMode === 'width' && (jsonConfig === null || jsonConfig === void 0 ? void 0 : (_jsonConfig$
|
|
330
|
+
if (query.zoomMode === 'width' && (jsonConfig === null || jsonConfig === void 0 ? void 0 : (_jsonConfig$pageConfi3 = jsonConfig.pageConfig) === null || _jsonConfig$pageConfi3 === void 0 ? void 0 : _jsonConfig$pageConfi3.dimensions)) {
|
|
321
331
|
var _graphRef$current;
|
|
322
|
-
var _jsonConfig$
|
|
323
|
-
width = _jsonConfig$
|
|
324
|
-
height = _jsonConfig$
|
|
332
|
+
var _jsonConfig$pageConfi4 = jsonConfig.pageConfig.dimensions,
|
|
333
|
+
width = _jsonConfig$pageConfi4.width,
|
|
334
|
+
height = _jsonConfig$pageConfi4.height;
|
|
325
335
|
var scale = wrapSize.width / width;
|
|
326
336
|
(_graphRef$current = graphRef.current) === null || _graphRef$current === void 0 ? void 0 : _graphRef$current.resize(width * scale, height * scale);
|
|
327
337
|
} else {
|
|
@@ -386,7 +396,7 @@ var Player = function Player(_ref) {
|
|
|
386
396
|
}
|
|
387
397
|
};
|
|
388
398
|
}, [query, jsonConfig, mittMeta]);
|
|
389
|
-
|
|
399
|
+
useEffect(function () {}, [query, jsonConfig, mittMeta]);
|
|
390
400
|
// scene === 'freedom' 加载设备点位数据
|
|
391
401
|
useEffect(function () {
|
|
392
402
|
var fetchDevicePoints = /*#__PURE__*/function () {
|
|
@@ -422,15 +432,71 @@ var Player = function Player(_ref) {
|
|
|
422
432
|
return _ref8.apply(this, arguments);
|
|
423
433
|
};
|
|
424
434
|
}();
|
|
435
|
+
var fetchDeviceSpecialPoint = /*#__PURE__*/function () {
|
|
436
|
+
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(ids, dateType) {
|
|
437
|
+
var res, pointList;
|
|
438
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
439
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
440
|
+
case 0:
|
|
441
|
+
_context7.next = 2;
|
|
442
|
+
return GetTdIndicatorAggregateData(ids.map(function (v) {
|
|
443
|
+
var productNo = {
|
|
444
|
+
r5onwf: 'energy',
|
|
445
|
+
p4snlw: 'steamc',
|
|
446
|
+
rommzw: 'waterc'
|
|
447
|
+
};
|
|
448
|
+
var str = v.split('_');
|
|
449
|
+
return {
|
|
450
|
+
indicatorNo: "".concat(str[0], "_").concat(str[1], "_").concat(productNo[str[0]]),
|
|
451
|
+
aggregateType: 3,
|
|
452
|
+
timeQuantumList: [{
|
|
453
|
+
startDate: dayjs().startOf(dateType == 0 ? "month" : "year").format('YYYY-MM-DD HH:mm:ss'),
|
|
454
|
+
endDate: dayjs().endOf(dateType == 0 ? "month" : "year").format('YYYY-MM-DD HH:mm:ss')
|
|
455
|
+
}]
|
|
456
|
+
};
|
|
457
|
+
}));
|
|
458
|
+
case 2:
|
|
459
|
+
res = _context7.sent;
|
|
460
|
+
if (res.success) {
|
|
461
|
+
_context7.next = 6;
|
|
462
|
+
break;
|
|
463
|
+
}
|
|
464
|
+
message.error('设备点位数据获取失败');
|
|
465
|
+
return _context7.abrupt("return");
|
|
466
|
+
case 6:
|
|
467
|
+
pointList = res.data || [];
|
|
468
|
+
pointList.forEach(function (v) {
|
|
469
|
+
var pointId = ids.find(function (id) {
|
|
470
|
+
return id.includes(v.deviceNo);
|
|
471
|
+
});
|
|
472
|
+
emitter.emit("point-update-".concat(pointId, "-").concat(mittMeta.namespace), v);
|
|
473
|
+
});
|
|
474
|
+
case 8:
|
|
475
|
+
case "end":
|
|
476
|
+
return _context7.stop();
|
|
477
|
+
}
|
|
478
|
+
}, _callee7);
|
|
479
|
+
}));
|
|
480
|
+
return function fetchDeviceSpecialPoint(_x7, _x8) {
|
|
481
|
+
return _ref9.apply(this, arguments);
|
|
482
|
+
};
|
|
483
|
+
}();
|
|
425
484
|
var timer;
|
|
485
|
+
var specialPointTimer;
|
|
426
486
|
if (query.scene === 'freedom' && jsonConfig) {
|
|
427
487
|
var _jsonConfig$cells;
|
|
428
488
|
var pointIds = [];
|
|
489
|
+
var specialPoint = [];
|
|
429
490
|
jsonConfig === null || jsonConfig === void 0 ? void 0 : (_jsonConfig$cells = jsonConfig.cells) === null || _jsonConfig$cells === void 0 ? void 0 : _jsonConfig$cells.forEach(function (cell) {
|
|
430
|
-
var _cell$data
|
|
431
|
-
cell === null || cell === void 0 ? void 0 : (_cell$data = cell.data) === null || _cell$data === void 0 ? void 0 :
|
|
432
|
-
|
|
433
|
-
}
|
|
491
|
+
var _cell$data;
|
|
492
|
+
if ((cell === null || cell === void 0 ? void 0 : (_cell$data = cell.data) === null || _cell$data === void 0 ? void 0 : _cell$data.valueType) == 1) {
|
|
493
|
+
specialPoint.push(cell);
|
|
494
|
+
} else {
|
|
495
|
+
var _cell$data2, _cell$data2$pointList;
|
|
496
|
+
cell === null || cell === void 0 ? void 0 : (_cell$data2 = cell.data) === null || _cell$data2 === void 0 ? void 0 : (_cell$data2$pointList = _cell$data2.pointList) === null || _cell$data2$pointList === void 0 ? void 0 : _cell$data2$pointList.forEach(function (point) {
|
|
497
|
+
pointIds.push(point.pointId);
|
|
498
|
+
});
|
|
499
|
+
}
|
|
434
500
|
|
|
435
501
|
// ele-fan 元素单独处理
|
|
436
502
|
if (cell.shape === 'ele-fan') {
|
|
@@ -458,6 +524,24 @@ var Player = function Player(_ref) {
|
|
|
458
524
|
fetchDevicePoints(pointIds);
|
|
459
525
|
}, RefreshFrequency);
|
|
460
526
|
}
|
|
527
|
+
if (specialPoint.length) {
|
|
528
|
+
var monthPoint = specialPoint.filter(function (item) {
|
|
529
|
+
return item.data.valueDate == 0;
|
|
530
|
+
}).map(function (item) {
|
|
531
|
+
return item.data.pointList[0].pointId;
|
|
532
|
+
});
|
|
533
|
+
var yaerPoint = specialPoint.filter(function (item) {
|
|
534
|
+
return item.data.valueDate == 1;
|
|
535
|
+
}).map(function (item) {
|
|
536
|
+
return item.data.pointList[0].pointId;
|
|
537
|
+
});
|
|
538
|
+
monthPoint.length && fetchDeviceSpecialPoint(monthPoint, 0);
|
|
539
|
+
yaerPoint.length && fetchDeviceSpecialPoint(yaerPoint, 1);
|
|
540
|
+
specialPointTimer = setInterval(function () {
|
|
541
|
+
monthPoint.length && fetchDeviceSpecialPoint(monthPoint, 0);
|
|
542
|
+
yaerPoint.length && fetchDeviceSpecialPoint(yaerPoint, 1);
|
|
543
|
+
}, RefreshFrequency);
|
|
544
|
+
}
|
|
461
545
|
}
|
|
462
546
|
return function () {
|
|
463
547
|
if (timer) {
|
|
@@ -471,7 +555,9 @@ var Player = function Player(_ref) {
|
|
|
471
555
|
var _jsonConfig$cells2;
|
|
472
556
|
jsonConfig === null || jsonConfig === void 0 ? void 0 : (_jsonConfig$cells2 = jsonConfig.cells) === null || _jsonConfig$cells2 === void 0 ? void 0 : _jsonConfig$cells2.forEach(function (v) {
|
|
473
557
|
if (v.data) {
|
|
558
|
+
var _query$premission;
|
|
474
559
|
v.data.mittMeta = mittMeta;
|
|
560
|
+
v.data.premission = ((_query$premission = query.premission) === null || _query$premission === void 0 ? void 0 : _query$premission.split(',')) || [];
|
|
475
561
|
}
|
|
476
562
|
});
|
|
477
563
|
graph.fromJSON(jsonConfig);
|
|
@@ -502,7 +588,9 @@ var Player = function Player(_ref) {
|
|
|
502
588
|
onCancel: function onCancel() {
|
|
503
589
|
return setVisibleDialogHistory(false);
|
|
504
590
|
},
|
|
505
|
-
pointIdListProp: activePointIds
|
|
591
|
+
pointIdListProp: activePointIds,
|
|
592
|
+
companyId: query.companyId,
|
|
593
|
+
projectId: query.projectId
|
|
506
594
|
}), /*#__PURE__*/React.createElement(DialogPointWrite, {
|
|
507
595
|
visible: visibleDialogPointWrite,
|
|
508
596
|
points: activePoints,
|