@vtx/modals2 5.0.9 → 5.0.11
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/index.js +2 -1
- package/lib/vtx-base-modal/index.js +16 -2
- package/lib/vtx-housing-estate-modal/components/Alarm/index.js +0 -1
- package/lib/vtx-housing-estate-modal/components/Sbzj/index.js +139 -0
- package/lib/vtx-housing-estate-modal/components/Sbzj/index.less +73 -0
- package/lib/vtx-housing-estate-modal/components/index.js +1 -0
- package/lib/vtx-housing-estate-modal/imgs/aibox.png +0 -0
- package/lib/vtx-housing-estate-modal/imgs/aibox_light.png +0 -0
- package/lib/vtx-housing-estate-modal/imgs/android.png +0 -0
- package/lib/vtx-housing-estate-modal/imgs/android_light.png +0 -0
- package/lib/vtx-housing-estate-modal/imgs/sbzj_tfd.png +0 -0
- package/lib/vtx-housing-estate-modal/imgs/sbzj_tfd_light.png +0 -0
- package/lib/vtx-housing-estate-modal/imgs/sbzj_video.png +0 -0
- package/lib/vtx-housing-estate-modal/imgs/sbzj_video_light.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/api.js +575 -0
- package/lib/vtx-sdyd-tfd-modal/components/Alarm/CYLJTF.js +61 -0
- package/lib/vtx-sdyd-tfd-modal/components/Alarm/Distribute.js +132 -0
- package/lib/vtx-sdyd-tfd-modal/components/Alarm/FLZL.js +44 -0
- package/lib/vtx-sdyd-tfd-modal/components/Alarm/FLZL_TREND.js +104 -0
- package/lib/vtx-sdyd-tfd-modal/components/Alarm/FSCSFB.js +67 -0
- package/lib/vtx-sdyd-tfd-modal/components/Alarm/FSSD.js +65 -0
- package/lib/vtx-sdyd-tfd-modal/components/Alarm/FSYZQS.js +79 -0
- package/lib/vtx-sdyd-tfd-modal/components/Alarm/GDCLXL.js +111 -0
- package/lib/vtx-sdyd-tfd-modal/components/Alarm/HTLJPH.js +162 -0
- package/lib/vtx-sdyd-tfd-modal/components/Alarm/MYFX.js +43 -0
- package/lib/vtx-sdyd-tfd-modal/components/Alarm/MYFX_FB.js +183 -0
- package/lib/vtx-sdyd-tfd-modal/components/Alarm/MYFX_GD.js +97 -0
- package/lib/vtx-sdyd-tfd-modal/components/Alarm/MYFX_PIE.js +65 -0
- package/lib/vtx-sdyd-tfd-modal/components/Alarm/MYFX_TREND.js +103 -0
- package/lib/vtx-sdyd-tfd-modal/components/Alarm/index.js +104 -0
- package/lib/vtx-sdyd-tfd-modal/components/Alarm/index.less +116 -0
- package/lib/vtx-sdyd-tfd-modal/components/OverView/Hot.js +179 -0
- package/lib/vtx-sdyd-tfd-modal/components/OverView/Left.js +123 -0
- package/lib/vtx-sdyd-tfd-modal/components/OverView/Manage.js +172 -0
- package/lib/vtx-sdyd-tfd-modal/components/OverView/RightBottom.js +177 -0
- package/lib/vtx-sdyd-tfd-modal/components/OverView/index.js +56 -0
- package/lib/vtx-sdyd-tfd-modal/components/OverView/index.less +242 -0
- package/lib/vtx-sdyd-tfd-modal/components/Sbzj/index.js +137 -0
- package/lib/vtx-sdyd-tfd-modal/components/Sbzj/index.less +78 -0
- package/lib/vtx-sdyd-tfd-modal/components/TFRD/index.js +133 -0
- package/lib/vtx-sdyd-tfd-modal/components/TFRD/index.less +12 -0
- package/lib/vtx-sdyd-tfd-modal/components/WGGS/Content.js +63 -0
- package/lib/vtx-sdyd-tfd-modal/components/WGGS/index.js +61 -0
- package/lib/vtx-sdyd-tfd-modal/components/WGGS/index.less +49 -0
- package/lib/vtx-sdyd-tfd-modal/components/WGXW/Content.js +117 -0
- package/lib/vtx-sdyd-tfd-modal/components/WGXW/index.js +52 -0
- package/lib/vtx-sdyd-tfd-modal/components/WGXW/index.less +97 -0
- package/lib/vtx-sdyd-tfd-modal/components/index.js +6 -0
- package/lib/vtx-sdyd-tfd-modal/config.js +63 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/BOTTLE.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/CAN.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/KRAFT_PAPER_BOX.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/NAPKIN.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/NAPKIN_light.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/PLASTIC_BAG.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/aibox.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/aibox_light.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/android.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/android_light.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/avatar.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/avatar_light.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/ddypz.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/ddypz_light.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/garbage_default.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/gzxjcx.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/hjglcx.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/hmd.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/hmd_light.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/manage_bg.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/manage_bg_light.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/rank.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/rank_light.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/sbzj_tfd.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/sbzj_tfd_light.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/sbzj_video.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/sbzj_video_light.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/tfcs.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/tfcs_light.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/tfd.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/tfd_ht.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/tfd_ht_light.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/tfd_light.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/tfd_manyi.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/tfd_manyi_light.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/tfd_twtf.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/tfd_twtf_light.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/tfd_wpd.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/tfd_wpd_light.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/tfd_wstf.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/tfd_wstf_light.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/tfhs.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/tfhs_light.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/wgmsr.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/wgmsr_light.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/yyxj.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/imgs/yyxj_light.png +0 -0
- package/lib/vtx-sdyd-tfd-modal/index.js +113 -0
- package/lib/vtx-sdyd-tfd-modal/style/index.js +4 -0
- package/lib/vtx-sdyd-tfd-modal/style/index.less +1 -0
- package/lib/vtx-shxq-modal/index.js +1 -2
- package/lib/vtx-wr-modal/components/Appraise/index.js +123 -36
- package/lib/vtx-wr-modal/components/Appraise/index.less +40 -43
- package/lib/vtx-wr-modal/components/Base/Jbxx.js +151 -227
- package/lib/vtx-wr-modal/components/Base/Ptss.js +215 -0
- package/lib/vtx-wr-modal/components/Base/Sjjg.js +163 -76
- package/lib/vtx-wr-modal/components/Base/assets/blue/dswsj.png +0 -0
- package/lib/vtx-wr-modal/components/Base/assets/blue/tywsj.png +0 -0
- package/lib/vtx-wr-modal/components/Base/assets/light/dswsj.png +0 -0
- package/lib/vtx-wr-modal/components/Base/assets/light/tywsj.png +0 -0
- package/lib/vtx-wr-modal/components/Base/index.js +319 -32
- package/lib/vtx-wr-modal/components/Base/index.less +237 -227
- package/lib/vtx-wr-modal/components/Build/index.js +169 -0
- package/lib/vtx-wr-modal/components/Build/index.less +104 -0
- package/lib/vtx-wr-modal/components/File/index.js +107 -0
- package/lib/vtx-wr-modal/components/File/index.less +41 -0
- package/lib/vtx-wr-modal/components/Score/index.js +122 -28
- package/lib/vtx-wr-modal/components/Score/index.less +36 -36
- package/lib/vtx-wr-modal/components/index.js +3 -1
- package/lib/vtx-wr-modal/index.js +79 -15
- package/lib/vtx-wr-modal/style/index.js +2 -0
- package/package.json +12 -11
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
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."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
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; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { Radio } from 'antd';
|
|
8
|
+
import dayjs from 'dayjs';
|
|
9
|
+
import EChartsReact from 'echarts-for-react';
|
|
10
|
+
import { useState } from 'react';
|
|
11
|
+
import { VmEmpty, VmTitle } from "../../../_components";
|
|
12
|
+
import { alarmService } from "../../api";
|
|
13
|
+
import "./index.less";
|
|
14
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
|
+
var symbols = {
|
|
16
|
+
'PLASTIC-BAG': require("../../imgs/PLASTIC_BAG.png"),
|
|
17
|
+
NAPKIN: require("../../imgs/NAPKIN.png"),
|
|
18
|
+
BOTTLE: require("../../imgs/BOTTLE.png"),
|
|
19
|
+
CAN: require("../../imgs/CAN.png"),
|
|
20
|
+
KRAFT_PAPER_BOX: require("../../imgs/KRAFT_PAPER_BOX.png"),
|
|
21
|
+
DEFAULT: require("../../imgs/garbage_default.png")
|
|
22
|
+
};
|
|
23
|
+
var HTLJPH = function HTLJPH(_ref) {
|
|
24
|
+
var _ref$classPrefix = _ref.classPrefix,
|
|
25
|
+
classPrefix = _ref$classPrefix === void 0 ? '' : _ref$classPrefix,
|
|
26
|
+
id = _ref.id;
|
|
27
|
+
var _useState = useState('current'),
|
|
28
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
29
|
+
currentTabKey = _useState2[0],
|
|
30
|
+
setCurrentTabKey = _useState2[1];
|
|
31
|
+
var thisWeek = currentTabKey === 'current';
|
|
32
|
+
var getPictorialBarOption = function getPictorialBarOption(_ref2) {
|
|
33
|
+
var _ref2$title = _ref2.title,
|
|
34
|
+
title = _ref2$title === void 0 ? '本周' : _ref2$title,
|
|
35
|
+
_ref2$data = _ref2.data,
|
|
36
|
+
data = _ref2$data === void 0 ? [] : _ref2$data;
|
|
37
|
+
return {
|
|
38
|
+
tooltip: {
|
|
39
|
+
trigger: 'axis',
|
|
40
|
+
axisPointer: {
|
|
41
|
+
type: 'shadow'
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
grid: {
|
|
45
|
+
containLabel: true,
|
|
46
|
+
left: 20
|
|
47
|
+
},
|
|
48
|
+
yAxis: {
|
|
49
|
+
data: data.map(function (item) {
|
|
50
|
+
return item.name;
|
|
51
|
+
}),
|
|
52
|
+
inverse: true,
|
|
53
|
+
axisLine: {
|
|
54
|
+
show: false
|
|
55
|
+
},
|
|
56
|
+
axisTick: {
|
|
57
|
+
show: false
|
|
58
|
+
},
|
|
59
|
+
axisLabel: {
|
|
60
|
+
margin: 30,
|
|
61
|
+
fontSize: 14
|
|
62
|
+
},
|
|
63
|
+
axisPointer: {
|
|
64
|
+
label: {
|
|
65
|
+
show: true,
|
|
66
|
+
margin: 30
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
xAxis: {
|
|
71
|
+
splitLine: {
|
|
72
|
+
show: false
|
|
73
|
+
},
|
|
74
|
+
axisLabel: {
|
|
75
|
+
show: false
|
|
76
|
+
},
|
|
77
|
+
axisTick: {
|
|
78
|
+
show: false
|
|
79
|
+
},
|
|
80
|
+
axisLine: {
|
|
81
|
+
show: false
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
animationDurationUpdate: 500,
|
|
85
|
+
series: [{
|
|
86
|
+
name: title,
|
|
87
|
+
id: 'bar1',
|
|
88
|
+
type: 'pictorialBar',
|
|
89
|
+
label: {
|
|
90
|
+
show: true,
|
|
91
|
+
position: 'right',
|
|
92
|
+
offset: [10, 0],
|
|
93
|
+
fontSize: 16,
|
|
94
|
+
color: '#fff'
|
|
95
|
+
},
|
|
96
|
+
symbolRepeat: true,
|
|
97
|
+
symbolSize: ['80%', '60%'],
|
|
98
|
+
barCategoryGap: '40%',
|
|
99
|
+
// universalTransition: {
|
|
100
|
+
// enabled: true,
|
|
101
|
+
// delay: function (idx, total) {
|
|
102
|
+
// return (idx / total) * 1000;
|
|
103
|
+
// }
|
|
104
|
+
// },
|
|
105
|
+
data: data.map(function (item) {
|
|
106
|
+
return {
|
|
107
|
+
value: item.count,
|
|
108
|
+
symbol: "image://".concat(item.symbol)
|
|
109
|
+
};
|
|
110
|
+
})
|
|
111
|
+
}]
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
// 混投垃圾排行
|
|
115
|
+
var mixRank = alarmService.useMixSumRank({
|
|
116
|
+
throwPointId: id,
|
|
117
|
+
beginTime: thisWeek ? dayjs().startOf('days').format('YYYY-MM-DD 00:00:00') : dayjs().subtract(1, 'weeks').startOf('days').format('YYYY-MM-DD 00:00:00'),
|
|
118
|
+
endTime: thisWeek ? dayjs().endOf('weeks').format('YYYY-MM-DD 23:59:59') : dayjs().subtract(1, 'weeks').endOf('weeks').format('YYYY-MM-DD 23:59:59')
|
|
119
|
+
});
|
|
120
|
+
var barData = (mixRank || []).map(function (item) {
|
|
121
|
+
return {
|
|
122
|
+
name: item.garbageTypeName,
|
|
123
|
+
count: thisWeek ? item.thisWeekCount : item.lastWeekCount,
|
|
124
|
+
symbol: symbols[item.garbageTypeCode] || symbols.DEFAULT
|
|
125
|
+
};
|
|
126
|
+
});
|
|
127
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
128
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
129
|
+
className: "".concat(classPrefix, "-row"),
|
|
130
|
+
children: [/*#__PURE__*/_jsx(VmTitle, {
|
|
131
|
+
title: "\u6DF7\u6295\u5783\u573E\u6392\u884C",
|
|
132
|
+
border: false
|
|
133
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
134
|
+
className: "".concat(classPrefix, "-btns"),
|
|
135
|
+
children: /*#__PURE__*/_jsxs(Radio.Group, {
|
|
136
|
+
value: currentTabKey,
|
|
137
|
+
onChange: function onChange(e) {
|
|
138
|
+
return setCurrentTabKey(e.target.value);
|
|
139
|
+
},
|
|
140
|
+
children: [/*#__PURE__*/_jsx(Radio.Button, {
|
|
141
|
+
value: "current",
|
|
142
|
+
children: "\u672C\u5468"
|
|
143
|
+
}), /*#__PURE__*/_jsx(Radio.Button, {
|
|
144
|
+
value: "last",
|
|
145
|
+
children: "\u4E0A\u5468"
|
|
146
|
+
})]
|
|
147
|
+
})
|
|
148
|
+
})]
|
|
149
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
150
|
+
className: "".concat(classPrefix, "-overflow-rank"),
|
|
151
|
+
children: !(barData !== null && barData !== void 0 && barData.length) ? /*#__PURE__*/_jsx(VmEmpty, {
|
|
152
|
+
type: "NO_CHART"
|
|
153
|
+
}) : /*#__PURE__*/_jsx(EChartsReact, {
|
|
154
|
+
option: getPictorialBarOption({
|
|
155
|
+
title: thisWeek ? '本周' : '上周',
|
|
156
|
+
data: barData
|
|
157
|
+
})
|
|
158
|
+
})
|
|
159
|
+
})]
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
export default HTLJPH;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Col, Row } from 'antd';
|
|
2
|
+
import MYFX_TREND from "./MYFX_TREND";
|
|
3
|
+
import MYFX_FB from "./MYFX_FB";
|
|
4
|
+
import MYFX_GD from "./MYFX_GD";
|
|
5
|
+
import MYFX_PIE from "./MYFX_PIE";
|
|
6
|
+
import "./index.less";
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
var FLZLFX = function FLZLFX(_ref) {
|
|
9
|
+
var _ref$classPrefix = _ref.classPrefix,
|
|
10
|
+
classPrefix = _ref$classPrefix === void 0 ? '' : _ref$classPrefix,
|
|
11
|
+
id = _ref.id;
|
|
12
|
+
return /*#__PURE__*/_jsx("div", {
|
|
13
|
+
children: /*#__PURE__*/_jsxs(Row, {
|
|
14
|
+
gutter: [128, 24],
|
|
15
|
+
children: [/*#__PURE__*/_jsx(Col, {
|
|
16
|
+
span: 12,
|
|
17
|
+
children: /*#__PURE__*/_jsx(MYFX_GD, {
|
|
18
|
+
classPrefix: classPrefix,
|
|
19
|
+
id: id
|
|
20
|
+
})
|
|
21
|
+
}), /*#__PURE__*/_jsx(Col, {
|
|
22
|
+
span: 12,
|
|
23
|
+
children: /*#__PURE__*/_jsx(MYFX_PIE, {
|
|
24
|
+
classPrefix: classPrefix,
|
|
25
|
+
id: id
|
|
26
|
+
})
|
|
27
|
+
}), /*#__PURE__*/_jsx(Col, {
|
|
28
|
+
span: 12,
|
|
29
|
+
children: /*#__PURE__*/_jsx(MYFX_FB, {
|
|
30
|
+
classPrefix: classPrefix,
|
|
31
|
+
id: id
|
|
32
|
+
})
|
|
33
|
+
}), /*#__PURE__*/_jsx(Col, {
|
|
34
|
+
span: 12,
|
|
35
|
+
children: /*#__PURE__*/_jsx(MYFX_TREND, {
|
|
36
|
+
classPrefix: classPrefix,
|
|
37
|
+
id: id
|
|
38
|
+
})
|
|
39
|
+
})]
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
export default FLZLFX;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
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."); }
|
|
3
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
4
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
5
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
10
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
import { Space } from 'antd';
|
|
12
|
+
import dayjs from 'dayjs';
|
|
13
|
+
import ReactEcharts from 'echarts-for-react';
|
|
14
|
+
import groupBy from 'lodash/groupBy';
|
|
15
|
+
import { useState } from 'react';
|
|
16
|
+
import { VmEmpty, VmFilter, VmTitle } from "../../../_components";
|
|
17
|
+
import useSettings from "../../../_hooks/useSettings";
|
|
18
|
+
import { alarmService } from "../../api";
|
|
19
|
+
import "./index.less";
|
|
20
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
+
var MYSDFZB = function MYSDFZB(_ref) {
|
|
22
|
+
var _ref$classPrefix = _ref.classPrefix,
|
|
23
|
+
classPrefix = _ref$classPrefix === void 0 ? '' : _ref$classPrefix,
|
|
24
|
+
id = _ref.id;
|
|
25
|
+
var _useSettings = useSettings(),
|
|
26
|
+
isDark = _useSettings.isDark;
|
|
27
|
+
var _useState = useState(dayjs()),
|
|
28
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
29
|
+
times = _useState2[0],
|
|
30
|
+
setTimes = _useState2[1];
|
|
31
|
+
var mySumByGarbageTypeAndPeriod = alarmService.useMySumByGarbageTypeAndPeriod({
|
|
32
|
+
throwPointId: id,
|
|
33
|
+
beginTime: times.format('YYYY-MM-DD 00:00:00'),
|
|
34
|
+
endTime: times.format('YYYY-MM-DD 23:59:59')
|
|
35
|
+
});
|
|
36
|
+
function transferData(data) {
|
|
37
|
+
var chartData = [];
|
|
38
|
+
var xAxis = [];
|
|
39
|
+
var dataGroupByDate = groupBy(data, 'garbageTypeName');
|
|
40
|
+
var count = 0;
|
|
41
|
+
// eslint-disable-next-line guard-for-in
|
|
42
|
+
for (var key in dataGroupByDate) {
|
|
43
|
+
dataGroupByDate[key].forEach(function (item, index) {
|
|
44
|
+
var x = "".concat(item.periodBegin, "-").concat(item.periodEnd);
|
|
45
|
+
if (!xAxis.includes(x)) {
|
|
46
|
+
xAxis.push(x);
|
|
47
|
+
}
|
|
48
|
+
chartData.push([index, count, item.count]);
|
|
49
|
+
});
|
|
50
|
+
count++;
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
xAxis: xAxis,
|
|
54
|
+
yAxis: Object.keys(dataGroupByDate),
|
|
55
|
+
chartData: chartData
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
var getDistributionChart = function getDistributionChart(data) {
|
|
59
|
+
var _transferData = transferData(data),
|
|
60
|
+
xAxis = _transferData.xAxis,
|
|
61
|
+
yAxis = _transferData.yAxis,
|
|
62
|
+
chartData = _transferData.chartData;
|
|
63
|
+
var max = Math.max.apply(Math, _toConsumableArray(chartData.map(function (item) {
|
|
64
|
+
return item[2];
|
|
65
|
+
})));
|
|
66
|
+
if (!(chartData !== null && chartData !== void 0 && chartData.length)) return {};
|
|
67
|
+
return {
|
|
68
|
+
tooltip: {
|
|
69
|
+
show: false,
|
|
70
|
+
position: 'top',
|
|
71
|
+
formatter: function formatter(params) {
|
|
72
|
+
var value = params.value,
|
|
73
|
+
marker = params.marker,
|
|
74
|
+
name = params.name;
|
|
75
|
+
var garbageType = yAxis[value[1]];
|
|
76
|
+
return "<div>".concat(garbageType, " ").concat(name, "</div><div>").concat(marker, " \u91CD\u91CF\uFF1A").concat(value[2], "kg</div>");
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
grid: {
|
|
80
|
+
top: 50,
|
|
81
|
+
bottom: 0,
|
|
82
|
+
right: 0,
|
|
83
|
+
left: 0,
|
|
84
|
+
containLabel: true
|
|
85
|
+
},
|
|
86
|
+
xAxis: {
|
|
87
|
+
type: 'category',
|
|
88
|
+
data: xAxis,
|
|
89
|
+
splitArea: {
|
|
90
|
+
show: true
|
|
91
|
+
},
|
|
92
|
+
axisLabel: {
|
|
93
|
+
color: isDark ? '#fff' : '#000'
|
|
94
|
+
},
|
|
95
|
+
axisTick: {
|
|
96
|
+
show: false
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
yAxis: {
|
|
100
|
+
type: 'category',
|
|
101
|
+
data: yAxis,
|
|
102
|
+
splitArea: {
|
|
103
|
+
show: true
|
|
104
|
+
},
|
|
105
|
+
axisLabel: {
|
|
106
|
+
color: isDark ? '#fff' : '#000'
|
|
107
|
+
},
|
|
108
|
+
axisTick: {
|
|
109
|
+
show: false
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
visualMap: {
|
|
113
|
+
min: 0,
|
|
114
|
+
max: max,
|
|
115
|
+
calculable: true,
|
|
116
|
+
orient: 'horizontal',
|
|
117
|
+
left: 48,
|
|
118
|
+
top: 0,
|
|
119
|
+
inRange: {
|
|
120
|
+
color: ['rgba(34,154,239,0.5)', '#1CC10D', '#009DFF', '#FF9500', '#F5222D']
|
|
121
|
+
},
|
|
122
|
+
textStyle: {
|
|
123
|
+
color: '#fff'
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
series: [{
|
|
127
|
+
name: '满溢时段分布',
|
|
128
|
+
type: 'heatmap',
|
|
129
|
+
data: chartData,
|
|
130
|
+
label: {
|
|
131
|
+
show: true
|
|
132
|
+
},
|
|
133
|
+
emphasis: {
|
|
134
|
+
itemStyle: {
|
|
135
|
+
shadowBlur: 10,
|
|
136
|
+
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}]
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
var legend = {
|
|
143
|
+
xs: '少',
|
|
144
|
+
sm: '较少',
|
|
145
|
+
md: '中等',
|
|
146
|
+
lg: '多',
|
|
147
|
+
xxl: '较多'
|
|
148
|
+
};
|
|
149
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
150
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
151
|
+
className: "".concat(classPrefix, "-row"),
|
|
152
|
+
children: [/*#__PURE__*/_jsx(VmTitle, {
|
|
153
|
+
title: "\u6EE1\u6EA2\u65F6\u6BB5\u5206\u5E03",
|
|
154
|
+
border: false
|
|
155
|
+
}), /*#__PURE__*/_jsx(VmFilter.VMDatePicker, {
|
|
156
|
+
value: times,
|
|
157
|
+
onChange: function onChange(date) {
|
|
158
|
+
setTimes(date);
|
|
159
|
+
}
|
|
160
|
+
})]
|
|
161
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
162
|
+
style: {
|
|
163
|
+
height: '300px',
|
|
164
|
+
position: 'relative'
|
|
165
|
+
},
|
|
166
|
+
children: [!(mySumByGarbageTypeAndPeriod !== null && mySumByGarbageTypeAndPeriod !== void 0 && mySumByGarbageTypeAndPeriod.length) ? /*#__PURE__*/_jsx(VmEmpty, {}) : /*#__PURE__*/_jsx(ReactEcharts, {
|
|
167
|
+
option: getDistributionChart(mySumByGarbageTypeAndPeriod || [])
|
|
168
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
169
|
+
className: "".concat(classPrefix, "-legends"),
|
|
170
|
+
children: /*#__PURE__*/_jsx(Space, {
|
|
171
|
+
size: 8,
|
|
172
|
+
children: ['xs', 'sm', 'md', 'lg', 'xxl'].map(function (item) {
|
|
173
|
+
return /*#__PURE__*/_jsx("div", {
|
|
174
|
+
className: "".concat(classPrefix, "-legends-item ").concat(item),
|
|
175
|
+
children: legend[item]
|
|
176
|
+
}, item);
|
|
177
|
+
})
|
|
178
|
+
})
|
|
179
|
+
})]
|
|
180
|
+
})]
|
|
181
|
+
});
|
|
182
|
+
};
|
|
183
|
+
export default MYSDFZB;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
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."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
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; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { Progress } from 'antd';
|
|
8
|
+
import dayjs from 'dayjs';
|
|
9
|
+
import { useState } from 'react';
|
|
10
|
+
import { VmFilter, VmTitle } from "../../../_components";
|
|
11
|
+
import useSettings from "../../../_hooks/useSettings";
|
|
12
|
+
import { alarmService } from "../../api";
|
|
13
|
+
import { getPercent } from "../OverView/RightBottom";
|
|
14
|
+
import "./index.less";
|
|
15
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
+
var GDCLXL = function GDCLXL(_ref) {
|
|
17
|
+
var _ref$classPrefix = _ref.classPrefix,
|
|
18
|
+
classPrefix = _ref$classPrefix === void 0 ? '' : _ref$classPrefix,
|
|
19
|
+
id = _ref.id;
|
|
20
|
+
var _useSettings = useSettings(),
|
|
21
|
+
isDark = _useSettings.isDark;
|
|
22
|
+
var _useState = useState(dayjs()),
|
|
23
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
24
|
+
date = _useState2[0],
|
|
25
|
+
setDate = _useState2[1];
|
|
26
|
+
// 工单处理效率
|
|
27
|
+
var efficiencyData = alarmService.useMyEfficiency({
|
|
28
|
+
throwPointId: id,
|
|
29
|
+
beginTime: date.format('YYYY-MM-DD 00:00:00'),
|
|
30
|
+
endTime: date.format('YYYY-MM-DD 23:59:59')
|
|
31
|
+
});
|
|
32
|
+
var strokeColor = {
|
|
33
|
+
alarm: {
|
|
34
|
+
'0%': '#FF575F',
|
|
35
|
+
'100%': '#F5222D'
|
|
36
|
+
},
|
|
37
|
+
normal: {
|
|
38
|
+
'0%': '#02E574',
|
|
39
|
+
'100%': '#0FB964'
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
43
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
44
|
+
className: "".concat(classPrefix, "-row"),
|
|
45
|
+
children: [/*#__PURE__*/_jsx(VmTitle, {
|
|
46
|
+
title: "\u5DE5\u5355\u5904\u7406\u6548\u7387",
|
|
47
|
+
border: false
|
|
48
|
+
}), /*#__PURE__*/_jsx(VmFilter.VMDatePicker, {
|
|
49
|
+
value: date,
|
|
50
|
+
onChange: function onChange(value) {
|
|
51
|
+
return setDate(value);
|
|
52
|
+
}
|
|
53
|
+
})]
|
|
54
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
55
|
+
className: "".concat(classPrefix, "-progress"),
|
|
56
|
+
style: {
|
|
57
|
+
justifyContent: 'center'
|
|
58
|
+
},
|
|
59
|
+
children: [{
|
|
60
|
+
name: '满溢处理时长',
|
|
61
|
+
value: getPercent(efficiencyData === null || efficiencyData === void 0 ? void 0 : efficiencyData.resolveMinute),
|
|
62
|
+
avg: getPercent(efficiencyData === null || efficiencyData === void 0 ? void 0 : efficiencyData.resolveMinute),
|
|
63
|
+
unit: '分'
|
|
64
|
+
}].map(function (ele, index) {
|
|
65
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
66
|
+
className: "".concat(classPrefix, "-progress-item"),
|
|
67
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
68
|
+
children: ele.name
|
|
69
|
+
}), /*#__PURE__*/_jsx(Progress, {
|
|
70
|
+
type: "dashboard",
|
|
71
|
+
percent: ele.value,
|
|
72
|
+
width: 160,
|
|
73
|
+
strokeWidth: 10,
|
|
74
|
+
gapDegree: 180,
|
|
75
|
+
strokeLinecap: "butt",
|
|
76
|
+
strokeColor: strokeColor[ele.value > ele.avg ? 'alarm' : 'normal'],
|
|
77
|
+
trailColor: isDark ? '#9B9FA8' : 'rgba(0, 0, 0, 0.1)',
|
|
78
|
+
showInfo: false
|
|
79
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
80
|
+
className: "".concat(classPrefix, "-progress-desc"),
|
|
81
|
+
style: {
|
|
82
|
+
bottom: 30
|
|
83
|
+
},
|
|
84
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
85
|
+
className: ele.value < ele.avg ? 'white_red' : 'white_green',
|
|
86
|
+
style: {
|
|
87
|
+
fontSize: 16
|
|
88
|
+
},
|
|
89
|
+
children: [ele.value, ele.unit]
|
|
90
|
+
})
|
|
91
|
+
})]
|
|
92
|
+
}, index);
|
|
93
|
+
})
|
|
94
|
+
})]
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
export default GDCLXL;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
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."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
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; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import dayjs from 'dayjs';
|
|
8
|
+
import { sumBy } from 'lodash';
|
|
9
|
+
import { useState } from 'react';
|
|
10
|
+
import { VmFilter, VmPieCharts, VmTitle } from "../../../_components";
|
|
11
|
+
import { alarmService } from "../../api";
|
|
12
|
+
import "./index.less";
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
var FSSD = function FSSD(_ref) {
|
|
15
|
+
var _ref$classPrefix = _ref.classPrefix,
|
|
16
|
+
classPrefix = _ref$classPrefix === void 0 ? '' : _ref$classPrefix,
|
|
17
|
+
id = _ref.id;
|
|
18
|
+
var _useState = useState(dayjs()),
|
|
19
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
+
times = _useState2[0],
|
|
21
|
+
setTimes = _useState2[1];
|
|
22
|
+
|
|
23
|
+
// 事件类型分布
|
|
24
|
+
var mySumByGarbageType = alarmService.useMySumByGarbageType({
|
|
25
|
+
throwPointId: id,
|
|
26
|
+
beginTime: times.format('YYYY-MM-DD 00:00:00'),
|
|
27
|
+
endTime: times.format('YYYY-MM-DD 23:59:59')
|
|
28
|
+
});
|
|
29
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
30
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
31
|
+
className: "".concat(classPrefix, "-row"),
|
|
32
|
+
children: [/*#__PURE__*/_jsx(VmTitle, {
|
|
33
|
+
title: "\u6EE1\u6EA2\u5783\u573E\u7C7B\u578B\u5360\u6BD4",
|
|
34
|
+
border: false
|
|
35
|
+
}), /*#__PURE__*/_jsx(VmFilter.VMDatePicker, {
|
|
36
|
+
value: times,
|
|
37
|
+
onChange: function onChange(value) {
|
|
38
|
+
return setTimes(value);
|
|
39
|
+
}
|
|
40
|
+
})]
|
|
41
|
+
}), /*#__PURE__*/_jsx(VmPieCharts, {
|
|
42
|
+
dataList: (mySumByGarbageType === null || mySumByGarbageType === void 0 ? void 0 : mySumByGarbageType.map(function (ele) {
|
|
43
|
+
return {
|
|
44
|
+
name: ele.garbageTypeName || '-',
|
|
45
|
+
value: ele.count || 0
|
|
46
|
+
};
|
|
47
|
+
})) || [],
|
|
48
|
+
title: "\u603B\u6570(\u6B21)",
|
|
49
|
+
total: sumBy(mySumByGarbageType, 'count'),
|
|
50
|
+
name: "\u843D\u5730\u5305\u53D1\u751F\u65F6\u6BB5"
|
|
51
|
+
// loading={loading}
|
|
52
|
+
,
|
|
53
|
+
unit: "\u6B21",
|
|
54
|
+
height: 150,
|
|
55
|
+
legendConfig: {
|
|
56
|
+
right: '12%'
|
|
57
|
+
},
|
|
58
|
+
innerRadius: ['65%', '85%'],
|
|
59
|
+
outerRadius: ['85%', '95%'],
|
|
60
|
+
colors: ['#1890FF', '#1CEF86', '#FF3E48', '#999999'],
|
|
61
|
+
colors2: ['#1890FF20', '#1CEF8620', '#FF3E4820', '#99999920']
|
|
62
|
+
})]
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
export default FSSD;
|
|
@@ -0,0 +1,103 @@
|
|
|
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(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(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(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _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(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
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(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import dayjs from 'dayjs';
|
|
14
|
+
import groupBy from 'lodash/groupBy';
|
|
15
|
+
import { useState } from 'react';
|
|
16
|
+
import { VmFilter, VmLineCharts, VmTitle } from "../../../_components";
|
|
17
|
+
import { alarmService } from "../../api";
|
|
18
|
+
import "./index.less";
|
|
19
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
+
var TREND = function TREND(_ref) {
|
|
21
|
+
var _ref$classPrefix = _ref.classPrefix,
|
|
22
|
+
classPrefix = _ref$classPrefix === void 0 ? '' : _ref$classPrefix,
|
|
23
|
+
id = _ref.id;
|
|
24
|
+
var _useState = useState([dayjs().subtract(6, 'days'), dayjs()]),
|
|
25
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
26
|
+
times = _useState2[0],
|
|
27
|
+
setTimes = _useState2[1];
|
|
28
|
+
// 满溢一周趋势分布
|
|
29
|
+
var mySumByGarbageTypeAndDay = alarmService.useMySumByGarbageTypeAndDay({
|
|
30
|
+
throwPointId: id,
|
|
31
|
+
beginTime: times[0].format('YYYY-MM-DD 00:00:00'),
|
|
32
|
+
endTime: times[1].format('YYYY-MM-DD 23:59:59')
|
|
33
|
+
});
|
|
34
|
+
var lineData = (mySumByGarbageTypeAndDay || []).map(function (item) {
|
|
35
|
+
return {
|
|
36
|
+
name: item.garbageTypeName || '',
|
|
37
|
+
count: item.count || 0,
|
|
38
|
+
day: item.day || ''
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
var disabledDate = function disabledDate(current) {
|
|
42
|
+
var _times = _slicedToArray(times, 2),
|
|
43
|
+
startDate = _times[0],
|
|
44
|
+
endDate = _times[1];
|
|
45
|
+
if (!startDate || !endDate) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
var tooLate = startDate && current.diff(startDate, 'days') > 7;
|
|
49
|
+
var tooEarly = endDate && endDate.diff(current, 'days') > 7;
|
|
50
|
+
return !!tooEarly || !!tooLate;
|
|
51
|
+
};
|
|
52
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
53
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
54
|
+
className: "".concat(classPrefix, "-row"),
|
|
55
|
+
children: [/*#__PURE__*/_jsx(VmTitle, {
|
|
56
|
+
title: "\u6EE1\u6EA2\u4E00\u5468\u53D8\u5316\u8D8B\u52BF",
|
|
57
|
+
border: false
|
|
58
|
+
}), /*#__PURE__*/_jsx(VmFilter.VMRangePicker, {
|
|
59
|
+
value: times,
|
|
60
|
+
onChange: function onChange(dates) {
|
|
61
|
+
return dates && setTimes(dates);
|
|
62
|
+
},
|
|
63
|
+
disabledDate: disabledDate,
|
|
64
|
+
style: {
|
|
65
|
+
width: '280px'
|
|
66
|
+
}
|
|
67
|
+
})]
|
|
68
|
+
}), /*#__PURE__*/_jsx(VmLineCharts, _objectSpread(_objectSpread({
|
|
69
|
+
height: "250px"
|
|
70
|
+
}, transferLineData(lineData)), {}, {
|
|
71
|
+
// loading={loading}
|
|
72
|
+
unit: "\u6B21",
|
|
73
|
+
legendOption: {
|
|
74
|
+
width: '95%',
|
|
75
|
+
top: 24
|
|
76
|
+
}
|
|
77
|
+
}))]
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
export default TREND;
|
|
81
|
+
var transferLineData = function transferLineData(data) {
|
|
82
|
+
var groupByThrowPoint = groupBy(data || [], 'name');
|
|
83
|
+
var groupByDay = groupBy(data || [], 'day');
|
|
84
|
+
var lineData = [];
|
|
85
|
+
// eslint-disable-next-line guard-for-in
|
|
86
|
+
for (var key in groupByThrowPoint) {
|
|
87
|
+
var item = groupByThrowPoint[key];
|
|
88
|
+
lineData.push({
|
|
89
|
+
name: item[0].name || '',
|
|
90
|
+
data: item.map(function (item) {
|
|
91
|
+
return item.count || 0;
|
|
92
|
+
})
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
// 去除日期中的年
|
|
96
|
+
var xAxis = Object.keys(groupByDay).map(function (item) {
|
|
97
|
+
return item.substring(5);
|
|
98
|
+
});
|
|
99
|
+
return {
|
|
100
|
+
xAxis: xAxis,
|
|
101
|
+
dataList: lineData
|
|
102
|
+
};
|
|
103
|
+
};
|