@vtx/modals2 2.15.69 → 2.15.70
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/lib/vm-info-collection/index.js +1 -1
- package/lib/vm-info-collection/index.js.map +1 -1
- package/lib/vtx-car-modal/components/AlarmInfo/index.js +2 -2
- package/lib/vtx-car-modal/components/AlarmInfo/index.js.map +1 -1
- package/lib/vtx-pump-modal/api.js +38 -5
- package/lib/vtx-pump-modal/api.js.map +1 -1
- package/lib/vtx-pump-modal/components/AlarmRecord/index.css +2 -1
- package/lib/vtx-pump-modal/components/AlarmRecord/index.less +2 -1
- package/lib/vtx-pump-modal/components/Basic/index.css +1 -1
- package/lib/vtx-pump-modal/components/Basic/index.less +1 -1
- package/lib/vtx-pump-modal/components/Sbxl/SBXLFXV2.js +204 -0
- package/lib/vtx-pump-modal/components/Sbxl/SBXLFXV2.js.map +1 -0
- package/lib/vtx-pump-modal/components/Sbxl/SBYXQKV2.js +342 -0
- package/lib/vtx-pump-modal/components/Sbxl/SBYXQKV2.js.map +1 -0
- package/lib/vtx-pump-modal/components/Sbxl/index.css +24 -13
- package/lib/vtx-pump-modal/components/Sbxl/index.js +48 -16
- package/lib/vtx-pump-modal/components/Sbxl/index.js.map +1 -1
- package/lib/vtx-pump-modal/components/Sbxl/index.less +30 -12
- package/lib/vtx-pump-modal/components/Sjfx/index.css +2 -0
- package/lib/vtx-pump-modal/components/Sjfx/index.less +2 -1
- package/lib/vtx-pump-modal/components/Sxyx/index.css +2 -0
- package/lib/vtx-pump-modal/components/Sxyx/index.less +2 -1
- package/lib/vtx-pump-modal/index.js +7 -2
- package/lib/vtx-pump-modal/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
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); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = SBXLFX;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
require("./index.less");
|
|
10
|
+
var _antd = require("antd");
|
|
11
|
+
var _ahooks = require("ahooks");
|
|
12
|
+
var _echartsForReact = _interopRequireDefault(require("echarts-for-react"));
|
|
13
|
+
var _api = require("../../api");
|
|
14
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
15
|
+
var _vmNodata = _interopRequireDefault(require("../../../vm-nodata"));
|
|
16
|
+
var _icons = require("@ant-design/icons");
|
|
17
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
18
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
19
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
20
|
+
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."); }
|
|
21
|
+
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; } }
|
|
22
|
+
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; }
|
|
23
|
+
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; } }
|
|
24
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
25
|
+
function SBXLFX(props) {
|
|
26
|
+
var prefix = props.prefix,
|
|
27
|
+
facilityId = props.facilityId,
|
|
28
|
+
deviceId = props.deviceId;
|
|
29
|
+
var _useSetState = (0, _ahooks.useSetState)({
|
|
30
|
+
timeType: 1,
|
|
31
|
+
dataList: []
|
|
32
|
+
}),
|
|
33
|
+
_useSetState2 = _slicedToArray(_useSetState, 2),
|
|
34
|
+
state = _useSetState2[0],
|
|
35
|
+
setState = _useSetState2[1];
|
|
36
|
+
var timeType = state.timeType,
|
|
37
|
+
dataList = state.dataList;
|
|
38
|
+
var option = {
|
|
39
|
+
tooltip: {
|
|
40
|
+
trigger: 'axis',
|
|
41
|
+
valueFormatter: function valueFormatter(value) {
|
|
42
|
+
return "".concat(value, "h");
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
legend: {},
|
|
46
|
+
grid: {
|
|
47
|
+
left: '3%',
|
|
48
|
+
right: '130px',
|
|
49
|
+
bottom: '3%',
|
|
50
|
+
containLabel: true
|
|
51
|
+
},
|
|
52
|
+
xAxis: {
|
|
53
|
+
type: 'value',
|
|
54
|
+
show: false,
|
|
55
|
+
axisLine: {
|
|
56
|
+
show: false
|
|
57
|
+
},
|
|
58
|
+
splitLine: {
|
|
59
|
+
show: false
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
yAxis: {
|
|
63
|
+
type: 'category',
|
|
64
|
+
data: dataList === null || dataList === void 0 ? void 0 : dataList.map(function (it) {
|
|
65
|
+
return it === null || it === void 0 ? void 0 : it.facilityName;
|
|
66
|
+
}),
|
|
67
|
+
axisLine: {
|
|
68
|
+
show: false
|
|
69
|
+
},
|
|
70
|
+
splitLine: {
|
|
71
|
+
show: false
|
|
72
|
+
},
|
|
73
|
+
axisTick: {
|
|
74
|
+
show: false
|
|
75
|
+
},
|
|
76
|
+
axisLabel: {
|
|
77
|
+
color: '#8C8C8C',
|
|
78
|
+
fontSize: '12'
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
series: [{
|
|
82
|
+
name: '高效',
|
|
83
|
+
type: 'bar',
|
|
84
|
+
stack: 'total',
|
|
85
|
+
color: '#52C41A',
|
|
86
|
+
label: {
|
|
87
|
+
show: false
|
|
88
|
+
},
|
|
89
|
+
emphasis: {
|
|
90
|
+
focus: 'series'
|
|
91
|
+
},
|
|
92
|
+
itemStyle: {
|
|
93
|
+
borderRadius: [32, 32, 32, 32]
|
|
94
|
+
},
|
|
95
|
+
barWidth: 10,
|
|
96
|
+
data: dataList === null || dataList === void 0 ? void 0 : dataList.map(function (it) {
|
|
97
|
+
return it === null || it === void 0 ? void 0 : it.efficientHours;
|
|
98
|
+
})
|
|
99
|
+
}, {
|
|
100
|
+
name: '低效',
|
|
101
|
+
type: 'bar',
|
|
102
|
+
stack: 'total',
|
|
103
|
+
color: '#FAAD14',
|
|
104
|
+
label: {
|
|
105
|
+
show: true,
|
|
106
|
+
position: 'right',
|
|
107
|
+
formatter: function formatter(params) {
|
|
108
|
+
var obj = dataList[params === null || params === void 0 ? void 0 : params.dataIndex];
|
|
109
|
+
return "{a|".concat(obj.efficientRate || 0, "%}{c|", "}{b|").concat((obj === null || obj === void 0 ? void 0 : obj.inefficientRate) || 0, "%}");
|
|
110
|
+
},
|
|
111
|
+
textStyle: {
|
|
112
|
+
rich: {
|
|
113
|
+
a: {
|
|
114
|
+
color: '#52C41A',
|
|
115
|
+
fontFamily: 'DIN, DIN',
|
|
116
|
+
fontSize: '14px',
|
|
117
|
+
padding: [0, 10]
|
|
118
|
+
},
|
|
119
|
+
c: {
|
|
120
|
+
width: 1,
|
|
121
|
+
height: 10,
|
|
122
|
+
backgroundColor: '#E8E8E8'
|
|
123
|
+
},
|
|
124
|
+
b: {
|
|
125
|
+
color: '#FAAD14',
|
|
126
|
+
fontFamily: 'DIN, DIN',
|
|
127
|
+
fontSize: '14px',
|
|
128
|
+
padding: [0, 10]
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
emphasis: {
|
|
134
|
+
focus: 'series'
|
|
135
|
+
},
|
|
136
|
+
barWidth: 10,
|
|
137
|
+
itemStyle: {
|
|
138
|
+
borderRadius: [32, 32, 32, 32]
|
|
139
|
+
},
|
|
140
|
+
data: dataList === null || dataList === void 0 ? void 0 : dataList.map(function (it) {
|
|
141
|
+
return it === null || it === void 0 ? void 0 : it.inefficientHours;
|
|
142
|
+
})
|
|
143
|
+
}]
|
|
144
|
+
};
|
|
145
|
+
(0, _react.useEffect)(function () {
|
|
146
|
+
if (deviceId) {
|
|
147
|
+
_api.SbxlService.findWaterPumpDayEfficiencyRecord({
|
|
148
|
+
facilityId: facilityId,
|
|
149
|
+
deviceId: deviceId,
|
|
150
|
+
begin: (0, _moment["default"])().subtract(timeType, 'month').startOf('day').format('YYYY-MM-DD HH:mm:ss'),
|
|
151
|
+
end: (0, _moment["default"])().endOf('day').format('YYYY-MM-DD HH:mm:ss')
|
|
152
|
+
}).then(function (data) {
|
|
153
|
+
setState({
|
|
154
|
+
dataList: data
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
}, [facilityId, deviceId, timeType]);
|
|
159
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
160
|
+
className: "".concat(prefix, "-sbxl-main-top-sbxlfx")
|
|
161
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
162
|
+
className: "".concat(prefix, "-sbxl-main-top-title")
|
|
163
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, "\u6C34\u6CF5\u6548\u7387\u5206\u6790\xA0", /*#__PURE__*/_react["default"].createElement(_antd.Tooltip, {
|
|
164
|
+
title: "\u901A\u8FC7\u5B9E\u65F6\u6570\u636E\u8FD0\u7B97\uFF0C\u5F53\u6C34\u6CF5\u6548\u7387\u226575\u65F6\uFF0C\u4E3A\u9AD8\u6548\uFF0C\u6C34\u6CF5\u6548\u7387\uFF1C75\u65F6\uFF0C\u4E3A\u4F4E\u6548"
|
|
165
|
+
}, /*#__PURE__*/_react["default"].createElement(_icons.QuestionCircleOutlined, null))), /*#__PURE__*/_react["default"].createElement("span", null, /*#__PURE__*/_react["default"].createElement("span", null, "\u65F6\u95F4\uFF1A"), /*#__PURE__*/_react["default"].createElement(_antd.Radio.Group, {
|
|
166
|
+
style: {
|
|
167
|
+
marginLeft: 10
|
|
168
|
+
},
|
|
169
|
+
options: [{
|
|
170
|
+
label: '近一个月',
|
|
171
|
+
value: 1
|
|
172
|
+
}, {
|
|
173
|
+
label: '近半年',
|
|
174
|
+
value: 5
|
|
175
|
+
}, {
|
|
176
|
+
label: '近一年',
|
|
177
|
+
value: 11
|
|
178
|
+
}],
|
|
179
|
+
optionType: "button",
|
|
180
|
+
value: timeType,
|
|
181
|
+
onChange: function onChange(e) {
|
|
182
|
+
setState({
|
|
183
|
+
timeType: e.target.value
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
187
|
+
className: "".concat(prefix, "-sbxl-main-top-chart")
|
|
188
|
+
}, (dataList === null || dataList === void 0 ? void 0 : dataList.length) ? (/*#__PURE__*/_react["default"].createElement(_echartsForReact["default"], {
|
|
189
|
+
option: option,
|
|
190
|
+
notMerge: true,
|
|
191
|
+
lazyUpdate: true,
|
|
192
|
+
style: {
|
|
193
|
+
width: '100%',
|
|
194
|
+
height: "".concat(30 * (dataList === null || dataList === void 0 ? void 0 : dataList.length), "px"),
|
|
195
|
+
minHeight: '200px'
|
|
196
|
+
}
|
|
197
|
+
})) : (/*#__PURE__*/_react["default"].createElement("div", {
|
|
198
|
+
style: {
|
|
199
|
+
height: 100,
|
|
200
|
+
marginTop: 10
|
|
201
|
+
}
|
|
202
|
+
}, /*#__PURE__*/_react["default"].createElement(_vmNodata["default"], null)))));
|
|
203
|
+
}
|
|
204
|
+
//# sourceMappingURL=SBXLFXV2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SBXLFXV2.js","names":["_react","_interopRequireWildcard","require","_antd","_ahooks","_echartsForReact","_interopRequireDefault","_api","_moment","_vmNodata","_icons","e","__esModule","t","WeakMap","r","n","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_slicedToArray","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","a","_arrayLikeToArray","toString","slice","constructor","name","Array","from","test","length","l","Symbol","iterator","u","next","done","push","value","isArray","SBXLFX","props","prefix","facilityId","deviceId","_useSetState","useSetState","timeType","dataList","_useSetState2","state","setState","option","tooltip","trigger","valueFormatter","concat","legend","grid","left","right","bottom","containLabel","xAxis","type","show","axisLine","splitLine","yAxis","data","map","it","facilityName","axisTick","axisLabel","color","fontSize","series","stack","label","emphasis","focus","itemStyle","borderRadius","barWidth","efficientHours","position","formatter","params","obj","dataIndex","efficientRate","inefficientRate","textStyle","rich","fontFamily","padding","c","width","height","backgroundColor","b","inefficientHours","useEffect","SbxlService","findWaterPumpDayEfficiencyRecord","begin","moment","subtract","startOf","format","end","endOf","then","React","createElement","className","Tooltip","title","QuestionCircleOutlined","Radio","Group","style","marginLeft","options","optionType","onChange","target","ReactEcharts","notMerge","lazyUpdate","minHeight","marginTop","NoData"],"sources":["vtx-pump-modal/components/Sbxl/SBXLFXV2.js"],"sourcesContent":["import React, { useEffect } from 'react';\nimport './index.less';\nimport { Radio } from 'antd';\nimport { useSetState } from 'ahooks';\nimport ReactEcharts from 'echarts-for-react';\nimport { SbxlService } from '../../api';\nimport moment from 'moment';\nimport NoData from '../../../vm-nodata';\nimport { QuestionCircleOutlined } from '@ant-design/icons';\nimport { Tooltip } from \"antd\";\nexport default function SBXLFX(props) {\n const { prefix, facilityId, deviceId } = props;\n const [state, setState] = useSetState({\n timeType: 1,\n dataList: [],\n });\n const { timeType, dataList } = state;\n const option = {\n tooltip: {\n trigger: 'axis',\n valueFormatter: (value) => {\n return `${value}h`;\n },\n },\n legend: {},\n grid: {\n left: '3%',\n right: '130px',\n bottom: '3%',\n containLabel: true\n },\n xAxis: {\n type: 'value',\n show: false,\n axisLine: {\n show: false,\n },\n splitLine: {\n show: false,\n },\n },\n yAxis: {\n type: 'category',\n data: dataList === null || dataList === void 0 ? void 0 : dataList.map(it => it === null || it === void 0 ? void 0 : it.facilityName),\n axisLine: {\n show: false,\n },\n splitLine: {\n show: false,\n },\n axisTick: {\n show: false\n },\n axisLabel: {\n color: '#8C8C8C',\n fontSize: '12',\n },\n },\n series: [\n {\n name: '高效',\n type: 'bar',\n stack: 'total',\n color: '#52C41A',\n label: {\n show: false\n },\n emphasis: {\n focus: 'series'\n },\n itemStyle: {\n borderRadius: [32, 32, 32, 32],\n },\n barWidth: 10,\n data: dataList === null || dataList === void 0 ? void 0 : dataList.map(it => it === null || it === void 0 ? void 0 : it.efficientHours),\n },\n {\n name: '低效',\n type: 'bar',\n stack: 'total',\n color: '#FAAD14',\n label: {\n show: true,\n position: 'right',\n formatter: function (params) {\n let obj = dataList[params === null || params === void 0 ? void 0 : params.dataIndex];\n return `{a|${obj.efficientRate || 0}%}{c|${''}}{b|${(obj === null || obj === void 0 ? void 0 : obj.inefficientRate) || 0}%}`;\n },\n textStyle: {\n rich: {\n a: {\n color: '#52C41A',\n fontFamily: 'DIN, DIN',\n fontSize: '14px',\n padding: [0, 10]\n },\n c: {\n width: 1,\n height: 10,\n backgroundColor: '#E8E8E8',\n },\n b: {\n color: '#FAAD14',\n fontFamily: 'DIN, DIN',\n fontSize: '14px',\n padding: [0, 10]\n },\n },\n },\n },\n emphasis: {\n focus: 'series'\n },\n barWidth: 10,\n itemStyle: {\n borderRadius: [32, 32, 32, 32],\n },\n data: dataList === null || dataList === void 0 ? void 0 : dataList.map(it => it === null || it === void 0 ? void 0 : it.inefficientHours),\n },\n ]\n };\n useEffect(() => {\n if (deviceId) {\n SbxlService.findWaterPumpDayEfficiencyRecord({\n facilityId,\n deviceId,\n begin: moment().subtract(timeType, 'month')\n .startOf('day')\n .format('YYYY-MM-DD HH:mm:ss'),\n end: moment()\n .endOf('day')\n .format('YYYY-MM-DD HH:mm:ss'),\n }).then((data) => {\n setState({\n dataList: data\n });\n });\n }\n }, [facilityId, deviceId, timeType]);\n return (React.createElement(\"div\", { className: `${prefix}-sbxl-main-top-sbxlfx` },\n React.createElement(\"div\", { className: `${prefix}-sbxl-main-top-title` },\n React.createElement(\"span\", null,\n \"\\u6C34\\u6CF5\\u6548\\u7387\\u5206\\u6790\\u00A0\",\n React.createElement(Tooltip, { title: \"\\u901A\\u8FC7\\u5B9E\\u65F6\\u6570\\u636E\\u8FD0\\u7B97\\uFF0C\\u5F53\\u6C34\\u6CF5\\u6548\\u7387\\u226575\\u65F6\\uFF0C\\u4E3A\\u9AD8\\u6548\\uFF0C\\u6C34\\u6CF5\\u6548\\u7387\\uFF1C75\\u65F6\\uFF0C\\u4E3A\\u4F4E\\u6548\" },\n React.createElement(QuestionCircleOutlined, null))),\n React.createElement(\"span\", null,\n React.createElement(\"span\", null, \"\\u65F6\\u95F4\\uFF1A\"),\n React.createElement(Radio.Group, { style: { marginLeft: 10 }, options: [\n { label: '近一个月', value: 1 },\n { label: '近半年', value: 5 },\n { label: '近一年', value: 11 },\n ], optionType: \"button\", value: timeType, onChange: e => {\n setState({\n timeType: e.target.value,\n });\n } }))),\n React.createElement(\"div\", { className: `${prefix}-sbxl-main-top-chart` }, (dataList === null || dataList === void 0 ? void 0 : dataList.length) ? (React.createElement(ReactEcharts, { option: option, notMerge: true, lazyUpdate: true, style: {\n width: '100%',\n height: `${30 * (dataList === null || dataList === void 0 ? void 0 : dataList.length)}px`,\n minHeight: '200px'\n } })) : (React.createElement(\"div\", { style: { height: 100, marginTop: 10 } },\n React.createElement(NoData, null))))));\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACAA,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,IAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAF,sBAAA,CAAAJ,OAAA;AACA,IAAAO,SAAA,GAAAH,sBAAA,CAAAJ,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAA2D,SAAAI,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AAAA,SAAAV,wBAAAU,CAAA,EAAAE,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAb,uBAAA,YAAAA,wBAAAU,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,mBAAAT,CAAA,iBAAAA,CAAA,gBAAAU,OAAA,CAAAV,C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"use strict";
|
|
2
|
+
|
|
3
|
+
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); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = SBYXQK;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
require("./index.less");
|
|
10
|
+
var _antd = require("antd");
|
|
11
|
+
var _ahooks = require("ahooks");
|
|
12
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
13
|
+
var _api = require("../../api");
|
|
14
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
15
|
+
var _vmNodata = _interopRequireDefault(require("../../../vm-nodata"));
|
|
16
|
+
var _echartsForReact = _interopRequireDefault(require("echarts-for-react"));
|
|
17
|
+
var echarts = _interopRequireWildcard(require("echarts"));
|
|
18
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
19
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
20
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
21
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
22
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
23
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
24
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
25
|
+
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."); }
|
|
26
|
+
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; } }
|
|
27
|
+
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; }
|
|
28
|
+
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; } }
|
|
29
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
30
|
+
function renderItem(params, api) {
|
|
31
|
+
var categoryIndex = api.value(0);
|
|
32
|
+
var start = api.coord([api.value(1), categoryIndex]);
|
|
33
|
+
var end = api.coord([api.value(2), categoryIndex]);
|
|
34
|
+
var height = 15;
|
|
35
|
+
var rectShape = echarts.graphic.clipRectByRect({
|
|
36
|
+
x: start[0],
|
|
37
|
+
y: start[1] - height / 2,
|
|
38
|
+
width: end[0] - start[0],
|
|
39
|
+
height: height
|
|
40
|
+
}, {
|
|
41
|
+
x: params.coordSys.x,
|
|
42
|
+
y: params.coordSys.y,
|
|
43
|
+
width: params.coordSys.width,
|
|
44
|
+
height: params.coordSys.height
|
|
45
|
+
});
|
|
46
|
+
var shapes;
|
|
47
|
+
shapes = rectShape && {
|
|
48
|
+
type: 'rect',
|
|
49
|
+
transition: ['shape'],
|
|
50
|
+
shape: rectShape,
|
|
51
|
+
style: api.style()
|
|
52
|
+
};
|
|
53
|
+
return shapes;
|
|
54
|
+
}
|
|
55
|
+
function SBYXQK(props) {
|
|
56
|
+
var _a;
|
|
57
|
+
var prefix = props.prefix,
|
|
58
|
+
facilityId = props.facilityId,
|
|
59
|
+
deviceId = props.deviceId;
|
|
60
|
+
var _useSetState = (0, _ahooks.useSetState)({
|
|
61
|
+
timeType: 0,
|
|
62
|
+
dataList: []
|
|
63
|
+
}),
|
|
64
|
+
_useSetState2 = _slicedToArray(_useSetState, 2),
|
|
65
|
+
state = _useSetState2[0],
|
|
66
|
+
setState = _useSetState2[1];
|
|
67
|
+
var _useSetState3 = (0, _ahooks.useSetState)({
|
|
68
|
+
categories: [],
|
|
69
|
+
datatemp: []
|
|
70
|
+
}),
|
|
71
|
+
_useSetState4 = _slicedToArray(_useSetState3, 2),
|
|
72
|
+
chart = _useSetState4[0],
|
|
73
|
+
setChart = _useSetState4[1];
|
|
74
|
+
var timeType = state.timeType,
|
|
75
|
+
dataList = state.dataList;
|
|
76
|
+
var legends = [{
|
|
77
|
+
name: '停止',
|
|
78
|
+
color: '#8C8C8C',
|
|
79
|
+
monitorItemCode: 'w_runstatus'
|
|
80
|
+
}, {
|
|
81
|
+
name: '工频',
|
|
82
|
+
color: '#49E6A2',
|
|
83
|
+
monitorItemCode: 'w_gp_runstatus'
|
|
84
|
+
}, {
|
|
85
|
+
name: '变频',
|
|
86
|
+
color: '#438EF7',
|
|
87
|
+
monitorItemCode: 'w_bp_runstatus'
|
|
88
|
+
}, {
|
|
89
|
+
name: '故障',
|
|
90
|
+
color: '#FAAB59',
|
|
91
|
+
monitorItemCode: 'w_faultstatus'
|
|
92
|
+
}, {
|
|
93
|
+
name: '未知',
|
|
94
|
+
color: '#8A7FEE',
|
|
95
|
+
monitorItemCode: 'unKnow'
|
|
96
|
+
}];
|
|
97
|
+
var convertSecondsToHoursAndMinutes = function convertSecondsToHoursAndMinutes(seconds) {
|
|
98
|
+
var days = Math.floor(seconds / (60 * 60 * 24));
|
|
99
|
+
var hours = Math.floor(seconds % (60 * 60 * 24) / (60 * 60));
|
|
100
|
+
var minutes = Math.floor(seconds % (60 * 60 * 24) % (60 * 60) / 60);
|
|
101
|
+
var remainingSeconds = seconds % (3600 * 24) % 3600 % 60;
|
|
102
|
+
return "".concat(days ? "".concat(days, "\u5929") : '').concat(days || hours ? "".concat(hours, "\u5C0F\u65F6") : '').concat(days || hours || minutes ? "".concat(minutes, "\u5206\u949F") : '').concat(remainingSeconds ? "".concat(remainingSeconds, "\u79D2") : '');
|
|
103
|
+
};
|
|
104
|
+
(0, _react.useEffect)(function () {
|
|
105
|
+
var _a;
|
|
106
|
+
if (dataList === null || dataList === void 0 ? void 0 : dataList.length) {
|
|
107
|
+
var s = new Set();
|
|
108
|
+
dataList.forEach(function (item) {
|
|
109
|
+
s.add(item.id);
|
|
110
|
+
}); // ===> 根据Set 的size 属性 用来获取不重复的数据有多少个
|
|
111
|
+
var newData = Array.from(
|
|
112
|
+
// ====> 这一步很重要,要确定二维数组的长度是多少
|
|
113
|
+
{
|
|
114
|
+
length: s.size
|
|
115
|
+
}, function () {
|
|
116
|
+
return [];
|
|
117
|
+
});
|
|
118
|
+
dataList === null || dataList === void 0 ? void 0 : dataList.forEach(function (item) {
|
|
119
|
+
var index = _toConsumableArray(s).indexOf(item.id); // ====> 循环原数组,将key相同的对象提取到二维数组中
|
|
120
|
+
newData[index].push(item);
|
|
121
|
+
});
|
|
122
|
+
newData = newData.map(function (item, index) {
|
|
123
|
+
return item.map(function (it) {
|
|
124
|
+
return Object.assign(Object.assign({}, it), {
|
|
125
|
+
index: index
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
var data = (_a = _lodash["default"].flatten(newData)) === null || _a === void 0 ? void 0 : _a.map(function (item) {
|
|
130
|
+
return {
|
|
131
|
+
groupId: item.index,
|
|
132
|
+
facilityName: item.facilityName,
|
|
133
|
+
monitorItemName: item.monitorItemName,
|
|
134
|
+
beginTime: item.beginTime,
|
|
135
|
+
endTime: item.endTime,
|
|
136
|
+
monitorItemCode: item === null || item === void 0 ? void 0 : item.monitorItemCode
|
|
137
|
+
};
|
|
138
|
+
});
|
|
139
|
+
var datatemp = data.map(function (d) {
|
|
140
|
+
var _a, _b;
|
|
141
|
+
var _beginTime = new Date(d.beginTime);
|
|
142
|
+
var _endTime = new Date(d.endTime);
|
|
143
|
+
var differenceInMilliseconds = Math.abs(_endTime - _beginTime);
|
|
144
|
+
var differenceInSeconds = differenceInMilliseconds / 1000;
|
|
145
|
+
return {
|
|
146
|
+
facilityName: d.facilityName,
|
|
147
|
+
value: [parseInt(d.groupId), new Date(d.beginTime).getTime(), new Date(d.endTime).getTime()],
|
|
148
|
+
startday: d.beginTime,
|
|
149
|
+
endday: d.endTime,
|
|
150
|
+
monitorItemName: d.monitorItemName,
|
|
151
|
+
runTime: convertSecondsToHoursAndMinutes(differenceInSeconds),
|
|
152
|
+
itemStyle: {
|
|
153
|
+
normal: {
|
|
154
|
+
color: (_b = (_a = legends.filter(function (a) {
|
|
155
|
+
return (a === null || a === void 0 ? void 0 : a.monitorItemCode) == (d === null || d === void 0 ? void 0 : d.monitorItemCode);
|
|
156
|
+
})) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.color
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
});
|
|
161
|
+
var categories = Array.from(new Set(data.map(function (item) {
|
|
162
|
+
return item.facilityName;
|
|
163
|
+
})));
|
|
164
|
+
setChart({
|
|
165
|
+
categories: categories,
|
|
166
|
+
datatemp: datatemp
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
}, [dataList]);
|
|
170
|
+
var option = {
|
|
171
|
+
grid: {
|
|
172
|
+
left: '1%',
|
|
173
|
+
right: '6%',
|
|
174
|
+
bottom: '25px',
|
|
175
|
+
top: '1%',
|
|
176
|
+
containLabel: true
|
|
177
|
+
},
|
|
178
|
+
tooltip: {
|
|
179
|
+
formatter: function formatter(params) {
|
|
180
|
+
var _a, _b;
|
|
181
|
+
return "".concat(params.name, " \n <br/> \u5F00\u59CB\u65F6\u95F4\uFF1A\n ").concat((0, _moment["default"])(params.value[1]).format('YYYY-MM-DD HH:mm:ss'), "\n <br/> \u7ED3\u675F\u65F6\u95F4\uFF1A\n ").concat((0, _moment["default"])(params.value[2]).format('YYYY-MM-DD HH:mm:ss'), "\n <br/>").concat(params.marker).concat((_a = params === null || params === void 0 ? void 0 : params.data) === null || _a === void 0 ? void 0 : _a.monitorItemName, "\u8FD0\u884C\uFF1A\n ").concat((_b = params === null || params === void 0 ? void 0 : params.data) === null || _b === void 0 ? void 0 : _b.runTime, "\n ");
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
dataZoom: [{
|
|
185
|
+
type: 'slider',
|
|
186
|
+
filterMode: 'weakFilter',
|
|
187
|
+
showDataShadow: false,
|
|
188
|
+
labelFormatter: '',
|
|
189
|
+
handleIcon: 'M10.7,11.9H9.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
|
|
190
|
+
handleSize: 14,
|
|
191
|
+
height: 8,
|
|
192
|
+
bottom: 12
|
|
193
|
+
}, {
|
|
194
|
+
type: 'inside',
|
|
195
|
+
filterMode: 'weakFilter'
|
|
196
|
+
}],
|
|
197
|
+
xAxis: {
|
|
198
|
+
scale: true,
|
|
199
|
+
type: 'time',
|
|
200
|
+
min: (0, _moment["default"])().subtract(timeType, 'days').startOf('day').format('YYYY-MM-DD HH:mm:ss'),
|
|
201
|
+
max: (0, _moment["default"])().endOf('day').format('YYYY-MM-DD HH:mm:ss'),
|
|
202
|
+
splitNumber: 4,
|
|
203
|
+
axisLabel: {
|
|
204
|
+
formatter: function formatter(val) {
|
|
205
|
+
return "".concat((0, _moment["default"])(val).format('M-D'), "\n").concat((0, _moment["default"])(val).format('HH:mm:ss'));
|
|
206
|
+
},
|
|
207
|
+
padding: [0, 0, 0, 0],
|
|
208
|
+
showMaxLabel: true
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
yAxis: [{
|
|
212
|
+
yAxisIndex: 0,
|
|
213
|
+
type: 'category',
|
|
214
|
+
data: chart === null || chart === void 0 ? void 0 : chart.categories,
|
|
215
|
+
axisLine: {
|
|
216
|
+
show: false,
|
|
217
|
+
lineStyle: {
|
|
218
|
+
color: '#030101',
|
|
219
|
+
width: 2,
|
|
220
|
+
type: 'solid'
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
splitLine: {
|
|
224
|
+
show: false,
|
|
225
|
+
lineStyle: {
|
|
226
|
+
color: ['#CCCCCC'],
|
|
227
|
+
type: 'solid'
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
axisTick: {
|
|
231
|
+
show: false
|
|
232
|
+
},
|
|
233
|
+
axisLabel: {
|
|
234
|
+
color: '#8C8C8C',
|
|
235
|
+
fontSize: '12'
|
|
236
|
+
}
|
|
237
|
+
}],
|
|
238
|
+
series: [{
|
|
239
|
+
type: 'custom',
|
|
240
|
+
renderItem: renderItem,
|
|
241
|
+
encode: {
|
|
242
|
+
x: [1, 2],
|
|
243
|
+
y: 0
|
|
244
|
+
},
|
|
245
|
+
data: chart === null || chart === void 0 ? void 0 : chart.datatemp
|
|
246
|
+
}]
|
|
247
|
+
};
|
|
248
|
+
(0, _react.useEffect)(function () {
|
|
249
|
+
if (deviceId) {
|
|
250
|
+
_api.SbxlService.findWaterPumpRunView({
|
|
251
|
+
facilityId: facilityId,
|
|
252
|
+
deviceId: deviceId,
|
|
253
|
+
begin: (0, _moment["default"])().subtract(timeType, 'days').startOf('day').format('YYYY-MM-DD HH:mm:ss'),
|
|
254
|
+
end: (0, _moment["default"])().endOf('day').format('YYYY-MM-DD HH:mm:ss')
|
|
255
|
+
}).then(function (data) {
|
|
256
|
+
var list = (data === null || data === void 0 ? void 0 : data.rows) || [];
|
|
257
|
+
var arr = [];
|
|
258
|
+
list === null || list === void 0 ? void 0 : list.map(function (item) {
|
|
259
|
+
var _a;
|
|
260
|
+
(_a = item === null || item === void 0 ? void 0 : item.details) === null || _a === void 0 ? void 0 : _a.map(function (it) {
|
|
261
|
+
var _a, _b;
|
|
262
|
+
arr === null || arr === void 0 ? void 0 : arr.push(Object.assign(Object.assign({}, it), {
|
|
263
|
+
facilityId: item === null || item === void 0 ? void 0 : item.facilityId,
|
|
264
|
+
id: item === null || item === void 0 ? void 0 : item.facilityId,
|
|
265
|
+
facilityName: item === null || item === void 0 ? void 0 : item.facilityName,
|
|
266
|
+
monitorItemName: (_b = (_a = legends.filter(function (a) {
|
|
267
|
+
return (a === null || a === void 0 ? void 0 : a.monitorItemCode) == (it === null || it === void 0 ? void 0 : it.monitorItemCode);
|
|
268
|
+
})) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.name
|
|
269
|
+
}));
|
|
270
|
+
});
|
|
271
|
+
});
|
|
272
|
+
setState({
|
|
273
|
+
dataList: arr
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
}, [facilityId, deviceId, timeType]);
|
|
278
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
279
|
+
className: "".concat(prefix, "-sbxl-main-top-sbyxqk")
|
|
280
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
281
|
+
className: "".concat(prefix, "-sbxl-main-top-title")
|
|
282
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, "\u6C34\u6CF5\u8FD0\u884C\u60C5\u51B5"), /*#__PURE__*/_react["default"].createElement("span", null, /*#__PURE__*/_react["default"].createElement("span", null, "\u65F6\u6BB5\uFF1A"), /*#__PURE__*/_react["default"].createElement(_antd.Radio.Group, {
|
|
283
|
+
style: {
|
|
284
|
+
marginLeft: 10
|
|
285
|
+
},
|
|
286
|
+
options: [{
|
|
287
|
+
label: '近24小时',
|
|
288
|
+
value: 0
|
|
289
|
+
}, {
|
|
290
|
+
label: '近3天',
|
|
291
|
+
value: 2
|
|
292
|
+
}, {
|
|
293
|
+
label: '近7天',
|
|
294
|
+
value: 6
|
|
295
|
+
}],
|
|
296
|
+
optionType: "button",
|
|
297
|
+
value: timeType,
|
|
298
|
+
onChange: function onChange(e) {
|
|
299
|
+
var value = e.target.value;
|
|
300
|
+
setState({
|
|
301
|
+
timeType: value
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
}))), (dataList === null || dataList === void 0 ? void 0 : dataList.length) ? (/*#__PURE__*/_react["default"].createElement("div", {
|
|
305
|
+
className: "".concat(prefix, "-sbxl-main-top-chart")
|
|
306
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
307
|
+
className: "".concat(prefix, "-sbxl-main-top-sbyxqk-legend")
|
|
308
|
+
}, legends.map(function (item) {
|
|
309
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
310
|
+
className: "".concat(prefix, "-sbxl-main-top-sbyxqk-legend-items"),
|
|
311
|
+
key: item.name
|
|
312
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
313
|
+
className: "".concat(prefix, "-sbxl-main-top-sbyxqk-legend-items-icon"),
|
|
314
|
+
style: {
|
|
315
|
+
backgroundColor: item.color
|
|
316
|
+
}
|
|
317
|
+
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
318
|
+
className: "".concat(prefix, "-sbxl-main-top-sbyxqk-legend-items-text")
|
|
319
|
+
}, item.name));
|
|
320
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
321
|
+
style: {
|
|
322
|
+
width: '100%',
|
|
323
|
+
height: "".concat(30 * ((_a = chart === null || chart === void 0 ? void 0 : chart.categories) === null || _a === void 0 ? void 0 : _a.length) + 40, "px"),
|
|
324
|
+
minHeight: '200px'
|
|
325
|
+
}
|
|
326
|
+
}, /*#__PURE__*/_react["default"].createElement(_echartsForReact["default"], {
|
|
327
|
+
echarts: echarts,
|
|
328
|
+
option: option,
|
|
329
|
+
style: {
|
|
330
|
+
width: '100%',
|
|
331
|
+
height: "100%"
|
|
332
|
+
},
|
|
333
|
+
notMerge: true,
|
|
334
|
+
lazyUpdate: true
|
|
335
|
+
})))) : (/*#__PURE__*/_react["default"].createElement("div", {
|
|
336
|
+
style: {
|
|
337
|
+
height: 100,
|
|
338
|
+
marginTop: 10
|
|
339
|
+
}
|
|
340
|
+
}, /*#__PURE__*/_react["default"].createElement(_vmNodata["default"], null))));
|
|
341
|
+
}
|
|
342
|
+
//# sourceMappingURL=SBYXQKV2.js.map
|