@vtx/modals2 5.0.57 → 5.0.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/lib/_components/vm-calendar/index.js +14 -4
  2. package/lib/_components/vm-calendar/style/index.less +4 -1
  3. package/lib/_components/vm-card-statistics/index.less +27 -27
  4. package/lib/_components/vm-custom/index.js +1 -1
  5. package/lib/_components/vm-factor-list/index.less +11 -11
  6. package/lib/_components/vm-filter/index.js +25 -0
  7. package/lib/_components/vm-pie-charts/index.js +14 -4
  8. package/lib/_components/vm-popover/index.less +7 -7
  9. package/lib/_components/vm-progress/index.js +6 -0
  10. package/lib/_components/vm-table/index.js +3 -3
  11. package/lib/_components/vm-table/style/index.less +12 -7
  12. package/lib/_components/vm-video/index.js +6 -1
  13. package/lib/style/index.less +5 -0
  14. package/lib/vtx-area-modal/api.js +2 -0
  15. package/lib/vtx-base-modal/Header/index.less +98 -98
  16. package/lib/vtx-base-modal/index.js +5 -0
  17. package/lib/vtx-car-modal/api.js +179 -74
  18. package/lib/vtx-car-modal/components/Info/index.less +6 -6
  19. package/lib/vtx-car-modal/content/Common/OilConsumption/index.less +6 -6
  20. package/lib/vtx-car-modal/content/Common/WaterConsumption/index.less +6 -6
  21. package/lib/vtx-car-modal/content/JXH/Hw2AlarmInfo/List.js +133 -0
  22. package/lib/vtx-car-modal/content/JXH/Hw2AlarmInfo/StaticInfo.js +84 -0
  23. package/lib/vtx-car-modal/content/JXH/Hw2AlarmInfo/index.js +71 -0
  24. package/lib/vtx-car-modal/content/JXH/Hw2BaseInfo/index.js +223 -0
  25. package/lib/vtx-car-modal/content/JXH/Hw2StaticInfo/index.js +549 -0
  26. package/lib/vtx-car-modal/content/JXH/Hw2StaticInfo/index.less +6 -0
  27. package/lib/vtx-car-modal/content/JXH/Hw2WorkRecord/index.js +291 -0
  28. package/lib/vtx-car-modal/content/JXH/WorkRecord/index.js +1 -1
  29. package/lib/vtx-car-modal/content/JXH/index.js +9 -1
  30. package/lib/vtx-car-modal/imgs/calendar/auto.png +0 -0
  31. package/lib/vtx-car-modal/imgs/calendar/dark_auto.png +0 -0
  32. package/lib/vtx-car-modal/imgs/calendar/dark_electricity.png +0 -0
  33. package/lib/vtx-car-modal/imgs/calendar/dark_oil.png +0 -0
  34. package/lib/vtx-car-modal/imgs/calendar/dark_transition.png +0 -0
  35. package/lib/vtx-car-modal/imgs/calendar/dark_water.png +0 -0
  36. package/lib/vtx-car-modal/imgs/calendar/dark_yy_mileage.png +0 -0
  37. package/lib/vtx-car-modal/imgs/calendar/electricity.png +0 -0
  38. package/lib/vtx-car-modal/imgs/calendar/oil.png +0 -0
  39. package/lib/vtx-car-modal/imgs/calendar/transition.png +0 -0
  40. package/lib/vtx-car-modal/imgs/calendar/water.png +0 -0
  41. package/lib/vtx-car-modal/imgs/calendar/yy_mileage.png +0 -0
  42. package/lib/vtx-car-modal/index.js +9 -1
  43. package/lib/vtx-cc-unit-modal/components/BaseInfo/index.less +6 -6
  44. package/lib/vtx-cp-modal/components/BaseInfo/TodayWork.js +1 -0
  45. package/lib/vtx-device-modal/components/DataAnalysis/index.less +66 -66
  46. package/lib/vtx-housing-estate-modal/components/Alarm/GDCLXL.js +2 -0
  47. package/lib/vtx-housing-estate-modal/components/Alarm/MYFX_GD.js +2 -0
  48. package/lib/vtx-housing-estate-modal/components/OverView/RightBottom.js +2 -0
  49. package/lib/vtx-restaurant-modal/components/Basic/index.less +16 -16
  50. package/lib/vtx-restaurant-modal/config.js +52 -52
  51. package/lib/vtx-road-modal/api.js +348 -11
  52. package/lib/vtx-road-modal/components/BaseInfo/Work.js +11 -5
  53. package/lib/vtx-road-modal/components/BaseInfo/index.js +6 -5
  54. package/lib/vtx-road-modal/components/LaneBaseInfo/Rules.js +63 -0
  55. package/lib/vtx-road-modal/components/LaneBaseInfo/Work.js +434 -0
  56. package/lib/vtx-road-modal/components/LaneBaseInfo/index.js +80 -0
  57. package/lib/vtx-road-modal/components/LaneBaseInfo/index.less +127 -0
  58. package/lib/vtx-road-modal/components/LaneCalendar/index.js +194 -0
  59. package/lib/vtx-road-modal/components/LaneStatistical/index.js +312 -0
  60. package/lib/vtx-road-modal/components/LaneStatistical/index.less +32 -0
  61. package/lib/vtx-road-modal/components/Statistical/index.less +32 -32
  62. package/lib/vtx-road-modal/components/index.js +4 -1
  63. package/lib/vtx-road-modal/imgs/car.png +0 -0
  64. package/lib/vtx-road-modal/imgs/dark_car.png +0 -0
  65. package/lib/vtx-road-modal/imgs/dark_person.png +0 -0
  66. package/lib/vtx-road-modal/imgs/person.png +0 -0
  67. package/lib/vtx-road-modal/imgs/schedule.png +0 -0
  68. package/lib/vtx-road-modal/imgs/work.png +0 -0
  69. package/lib/vtx-road-modal/imgs//344/274/230.png +0 -0
  70. package/lib/vtx-road-modal/imgs//345/267/256.png +0 -0
  71. package/lib/vtx-road-modal/imgs//350/211/257.png +0 -0
  72. package/lib/vtx-road-modal/index.js +18 -13
  73. package/lib/vtx-sdyd-tfd-modal/components/Alarm/GDCLXL.js +2 -0
  74. package/lib/vtx-sdyd-tfd-modal/components/Alarm/MYFX_GD.js +2 -0
  75. package/lib/vtx-sdyd-tfd-modal/components/OverView/RightBottom.js +2 -0
  76. package/lib/vtx-staff-modal/components/BaseInfo/WorkStatic.js +2 -2
  77. package/package.json +81 -81
@@ -0,0 +1,127 @@
1
+ @import '../../../style/index';
2
+
3
+ .vtx-road-lane-rule-wrap {
4
+ --bg-color: rgba(155, 155, 155, 0.08);
5
+ --line-bg-color: #bfc3cb;
6
+ display: flex;
7
+ flex-direction: column;
8
+ gap: 8px;
9
+ &.vtx-road-lane-rule-wrap-dark {
10
+ --bg-color: rgba(11,88,142,0.3);
11
+ --line-bg-color: #BFC3CB;
12
+ }
13
+ .vtx-road-lane-rule-item {
14
+ display: flex;
15
+ align-items: center;
16
+ gap: 12px;
17
+ height: 64px;
18
+ padding: 12px;
19
+ border-radius: 8px;
20
+ background: var(--bg-color);
21
+ color: var(--info-color);
22
+ &-left {
23
+ border: 2px dashed;
24
+ height: 25px;
25
+ &.blue {
26
+ border-color: var(--blue-color);
27
+ }
28
+ &.green {
29
+ border-color: var(--green-color);
30
+ }
31
+ &.purple {
32
+ border-color: #b894f9;
33
+ }
34
+ &.orange {
35
+ border-color: #ff8746;
36
+ }
37
+ &.yellow {
38
+ border-color: #ffaa00;
39
+ }
40
+ }
41
+ &-right {
42
+ flex: 1;
43
+ min-width: 0;
44
+ }
45
+ &-top {
46
+ display: flex;
47
+ align-items: center;
48
+ justify-content: space-between;
49
+ }
50
+ &-bottom {
51
+ display: flex;
52
+ align-items: center;
53
+ gap: 8px;
54
+ &-line {
55
+ width: 2px;
56
+ height: 8px;
57
+ margin: 0 4px;
58
+ background: var(--line-bg-color);
59
+ }
60
+ }
61
+ }
62
+ }
63
+
64
+ .vtx-road-lane-mileage-item {
65
+ color: var(--info-color);
66
+ &-value,
67
+ &-unit {
68
+ font-weight: bold;
69
+ font-size: 24px;
70
+ color: var(--blue-color);
71
+ }
72
+ &-unit {
73
+ font-size: 12px;
74
+ margin-left: 4px;
75
+ }
76
+ &-img {
77
+ width: 16px;
78
+ height: 16px;
79
+ margin-right: 2px;
80
+ }
81
+ }
82
+
83
+ .vtx-road-work-type-item {
84
+ display: flex;
85
+ align-items: center;
86
+ gap: 12px;
87
+ color: var(--info-color);
88
+ margin-left: 20px;
89
+ &-value {
90
+ font-weight: bold;
91
+ font-size: 16px;
92
+ }
93
+ &-unit {
94
+ font-weight: bold;
95
+ font-size: 12px;
96
+ }
97
+ &-green-text {
98
+ background: linear-gradient(180deg, #23ea51, #00b129);
99
+ -webkit-background-clip: text;
100
+ background-clip: text;
101
+ -webkit-text-fill-color: transparent;
102
+ }
103
+ &-blue-text {
104
+ background: linear-gradient(180deg, #00a6ff, #3a6dff);
105
+ -webkit-background-clip: text;
106
+ background-clip: text;
107
+ -webkit-text-fill-color: transparent;
108
+ }
109
+ &-orange-text {
110
+ background: linear-gradient(180deg, #faad14, #fa8314);
111
+ -webkit-background-clip: text;
112
+ background-clip: text;
113
+ -webkit-text-fill-color: transparent;
114
+ }
115
+ &-red-text {
116
+ background: linear-gradient(180deg, #ff6464, #ff3b3b);
117
+ -webkit-background-clip: text;
118
+ background-clip: text;
119
+ -webkit-text-fill-color: transparent;
120
+ }
121
+ &-gray-text {
122
+ background: linear-gradient(180deg, #bec4cb, #9599a3);
123
+ -webkit-background-clip: text;
124
+ background-clip: text;
125
+ -webkit-text-fill-color: transparent;
126
+ }
127
+ }
@@ -0,0 +1,194 @@
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 { Space } from 'antd';
14
+ import dayjs from 'dayjs';
15
+ import { useState } from 'react';
16
+ import { VmCalendar, VmCalendarInner, VmCalendarPercent, VmWrapper } from "../../../_components";
17
+ import { VMSelect } from "../../../_components/vm-filter";
18
+ import useSettings from "../../../_hooks/useSettings";
19
+ import { LaneService } from "../../api";
20
+ import darkWorkMileageIcon from "../../imgs/calendar/dark_green_mileage.png";
21
+ import darkMileageIcon from "../../imgs/calendar/dark_mileage.png";
22
+ import lightWorkMileageIcon from "../../imgs/calendar/green_mileage.png";
23
+ import lightMileageIcon from "../../imgs/calendar/mileage.png";
24
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
25
+ var Calendar = function Calendar(_ref) {
26
+ var id = _ref.id;
27
+ var _useSettings = useSettings(),
28
+ isDark = _useSettings.isDark;
29
+ var _useState = useState(dayjs()),
30
+ _useState2 = _slicedToArray(_useState, 2),
31
+ month = _useState2[0],
32
+ setMonth = _useState2[1];
33
+ var _useState3 = useState(undefined),
34
+ _useState4 = _slicedToArray(_useState3, 2),
35
+ workTypeCodes = _useState4[0],
36
+ setWorkTypeCodes = _useState4[1];
37
+ var _useState5 = useState(undefined),
38
+ _useState6 = _slicedToArray(_useState5, 2),
39
+ facilityTypeCodes = _useState6[0],
40
+ setFacilityTypeCodes = _useState6[1];
41
+ var _LaneService$useCalen = LaneService.useCalendar({
42
+ id: id,
43
+ startDate: dayjs(month).startOf('month').format('YYYY-MM-DD'),
44
+ endDate: dayjs(month).endOf('month').format('YYYY-MM-DD'),
45
+ workTypeCodes: workTypeCodes,
46
+ facilityTypeCodes: facilityTypeCodes
47
+ }),
48
+ calendarInfo = _LaneService$useCalen.calendarInfo;
49
+ var workTypeCodeList = LaneService.useGetParams('param_zyqs_workingType');
50
+ var _LaneService$useGetLa = LaneService.useGetLaneList(),
51
+ laneList = _LaneService$useGetLa.laneList;
52
+ var mileageIcon = lightMileageIcon;
53
+ var workMileageIcon = lightWorkMileageIcon;
54
+ if (isDark) {
55
+ mileageIcon = darkMileageIcon;
56
+ workMileageIcon = darkWorkMileageIcon;
57
+ }
58
+ var dateCellRender = function dateCellRender(value) {
59
+ var date = dayjs(value).format('YYYY-MM-DD');
60
+ var info = calendarInfo[date];
61
+ var _ref2 = info || {},
62
+ planMileage = _ref2.planMileage,
63
+ workMileage = _ref2.workMileage,
64
+ completeRate = _ref2.completeRate;
65
+ var color = 'gray';
66
+ if (completeRate > 0 && completeRate <= 50) {
67
+ color = 'red';
68
+ } else if (completeRate > 50 && completeRate <= 80) {
69
+ color = 'yellow';
70
+ } else if (completeRate > 80 && completeRate < 100) {
71
+ color = 'blue';
72
+ } else if (completeRate >= 100) {
73
+ color = 'green';
74
+ }
75
+ return info && /*#__PURE__*/_jsxs(_Fragment, {
76
+ children: [/*#__PURE__*/_jsx(VmCalendarPercent, {
77
+ percent: completeRate,
78
+ color: color
79
+ }), /*#__PURE__*/_jsx(VmCalendarInner, {
80
+ type: "blue",
81
+ img: mileageIcon,
82
+ value: planMileage,
83
+ style: {
84
+ width: '139px',
85
+ justifyContent: 'space-between',
86
+ margin: '8px 0'
87
+ }
88
+ }), /*#__PURE__*/_jsx(VmCalendarInner, {
89
+ type: "green",
90
+ img: workMileageIcon,
91
+ value: workMileage,
92
+ style: {
93
+ width: '139px',
94
+ justifyContent: 'space-between'
95
+ }
96
+ })]
97
+ });
98
+ };
99
+ return /*#__PURE__*/_jsxs(VmWrapper, {
100
+ title: '作业分析',
101
+ extraLeft: /*#__PURE__*/_jsxs(Space, {
102
+ children: [/*#__PURE__*/_jsx(VMSelect, {
103
+ options: laneList,
104
+ style: {
105
+ width: 160
106
+ },
107
+ placeholder: "\u8BF7\u9009\u62E9\u8F66\u9053",
108
+ onChange: setFacilityTypeCodes,
109
+ value: facilityTypeCodes,
110
+ allowClear: true
111
+ }), /*#__PURE__*/_jsx(VMSelect, {
112
+ options: workTypeCodeList,
113
+ style: {
114
+ width: 160
115
+ },
116
+ placeholder: "\u8BF7\u9009\u62E9\u4F5C\u4E1A\u7C7B\u578B",
117
+ onChange: setWorkTypeCodes,
118
+ value: workTypeCodes,
119
+ allowClear: true
120
+ })]
121
+ }),
122
+ filterType: "monthPicker",
123
+ dateValue: month,
124
+ filterChange: setMonth,
125
+ disabledDate: function disabledDate(current) {
126
+ return current && current > dayjs().endOf('M');
127
+ },
128
+ children: [/*#__PURE__*/_jsxs("div", {
129
+ className: 'vtx-road-calendar-head',
130
+ children: [[{
131
+ name: '排班里程(km)',
132
+ img: mileageIcon,
133
+ type: 'blue'
134
+ }, {
135
+ name: '作业里程(km)',
136
+ img: workMileageIcon,
137
+ type: 'green'
138
+ }].map(function (item, index) {
139
+ return /*#__PURE__*/_jsx(VmCalendarInner, _objectSpread(_objectSpread({}, item), {}, {
140
+ value: item.name
141
+ }), index);
142
+ }), /*#__PURE__*/_jsxs(Space, {
143
+ children: [/*#__PURE__*/_jsx("div", {
144
+ children: "\u5B8C\u6210\u7387\uFF1A"
145
+ }), /*#__PURE__*/_jsx("div", {
146
+ className: 'vtx-road-calendar-complete-legend',
147
+ style: {
148
+ background: 'var(--gray-color)'
149
+ }
150
+ }), /*#__PURE__*/_jsx("div", {
151
+ children: "0%"
152
+ }), /*#__PURE__*/_jsx("div", {
153
+ className: 'vtx-road-calendar-complete-legend',
154
+ style: {
155
+ background: 'var(--red-color)'
156
+ }
157
+ }), /*#__PURE__*/_jsx("div", {
158
+ children: "(0%-50%]"
159
+ }), /*#__PURE__*/_jsx("div", {
160
+ className: 'vtx-road-calendar-complete-legend',
161
+ style: {
162
+ background: 'var(--yellow-color)'
163
+ }
164
+ }), /*#__PURE__*/_jsx("div", {
165
+ children: "(50%-80%]"
166
+ }), /*#__PURE__*/_jsx("div", {
167
+ className: 'vtx-road-calendar-complete-legend',
168
+ style: {
169
+ background: 'var(--blue-color)'
170
+ }
171
+ }), /*#__PURE__*/_jsx("div", {
172
+ children: "(80%-100%]"
173
+ }), /*#__PURE__*/_jsx("div", {
174
+ className: 'vtx-road-calendar-complete-legend',
175
+ style: {
176
+ background: 'var(--green-color)'
177
+ }
178
+ }), /*#__PURE__*/_jsx("div", {
179
+ children: "100%"
180
+ })]
181
+ })]
182
+ }), /*#__PURE__*/_jsx("div", {
183
+ style: {
184
+ flex: 1,
185
+ minHeight: 0
186
+ },
187
+ children: /*#__PURE__*/_jsx(VmCalendar, {
188
+ dateCellRender: dateCellRender,
189
+ value: month
190
+ })
191
+ })]
192
+ });
193
+ };
194
+ export default Calendar;
@@ -0,0 +1,312 @@
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 { useSetState } from 'ahooks';
8
+ import { Col, Row } from 'antd';
9
+ import classnames from 'classnames';
10
+ import dayjs from 'dayjs';
11
+ import { isEmpty } from 'lodash';
12
+ import { useEffect, useMemo, useState } from 'react';
13
+ import { VmBarCharts, VmFactor, VmLineCharts, VmWrapper } from "../../../_components";
14
+ import { VMSelect } from "../../../_components/vm-filter";
15
+ import useSettings from "../../../_hooks/useSettings";
16
+ import { LaneService } from "../../api";
17
+ import "./index.less";
18
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
+ var Statistical = function Statistical(_ref) {
20
+ var id = _ref.id;
21
+ var _useSettings = useSettings(),
22
+ isDark = _useSettings.isDark,
23
+ sDate = _useSettings.startDate,
24
+ eDate = _useSettings.endDate;
25
+ var _useSetState = useSetState({
26
+ startDate: sDate ? sDate : dayjs().startOf('M'),
27
+ endDate: eDate ? eDate : dayjs()
28
+ }),
29
+ _useSetState2 = _slicedToArray(_useSetState, 2),
30
+ state = _useSetState2[0],
31
+ setState = _useSetState2[1];
32
+ var startDate = dayjs(state.startDate).format('YYYY-MM-DD');
33
+ var endDate = dayjs(state.endDate).format('YYYY-MM-DD');
34
+ var _useState = useState(''),
35
+ _useState2 = _slicedToArray(_useState, 2),
36
+ shiftId = _useState2[0],
37
+ setShiftId = _useState2[1];
38
+ var _LaneService$useWorkS = LaneService.useWorkSummary(id, startDate, endDate),
39
+ workSummary = _LaneService$useWorkS.workSummary;
40
+ var totalWorkInfo = workSummary.totalWorkInfo,
41
+ completeRate = workSummary.completeRate,
42
+ shiftInfoWorkInfos = workSummary.shiftInfoWorkInfos,
43
+ facilityTypeWorkInfos = workSummary.facilityTypeWorkInfos;
44
+ var _ref2 = totalWorkInfo || {},
45
+ days = _ref2.days,
46
+ workMileage = _ref2.workMileage,
47
+ planMileage = _ref2.planMileage;
48
+ useEffect(function () {
49
+ if (!isEmpty(shiftInfoWorkInfos)) {
50
+ setShiftId(shiftInfoWorkInfos[0].id);
51
+ }
52
+ }, [shiftInfoWorkInfos]);
53
+ var facilityTypeData = useMemo(function () {
54
+ var xAxis = [];
55
+ var dataList = [];
56
+ (facilityTypeWorkInfos || []).forEach(function (item, index) {
57
+ var facilityTypeName = item.facilityTypeName,
58
+ dayWorkInfos = item.dayWorkInfos;
59
+ var data = [];
60
+ dayWorkInfos.forEach(function (dayItem) {
61
+ data.push(dayItem.completeRate);
62
+ if (index === 0) {
63
+ xAxis.push(dayItem.date);
64
+ }
65
+ });
66
+ dataList.push({
67
+ name: facilityTypeName,
68
+ data: data,
69
+ smooth: true,
70
+ symbol: 'none'
71
+ });
72
+ });
73
+ return {
74
+ xAxis: xAxis,
75
+ dataList: dataList
76
+ };
77
+ }, [facilityTypeWorkInfos]);
78
+ var shiftData = useMemo(function () {
79
+ var shiftInfo = (shiftInfoWorkInfos || []).find(function (item) {
80
+ return item.id === shiftId;
81
+ });
82
+ if (shiftInfo) {
83
+ var xAxis = [];
84
+ var planMileageList = [];
85
+ var workMileageList = [];
86
+ (shiftInfo.dayWorkInfos || []).forEach(function (item) {
87
+ xAxis.push(item.date);
88
+ planMileageList.push(item.planMileage);
89
+ workMileageList.push(item.workMileage);
90
+ });
91
+ return {
92
+ xAxis: xAxis,
93
+ dataList: [{
94
+ name: '排班里程',
95
+ data: planMileageList,
96
+ color: 'geekblue'
97
+ }, {
98
+ name: '作业里程',
99
+ data: workMileageList,
100
+ color: 'green'
101
+ }]
102
+ };
103
+ }
104
+ return {};
105
+ }, [shiftInfoWorkInfos, shiftId]);
106
+ return /*#__PURE__*/_jsxs(Row, {
107
+ gutter: [16, 16],
108
+ children: [/*#__PURE__*/_jsx(Col, {
109
+ span: 24,
110
+ children: /*#__PURE__*/_jsx(VmWrapper, {
111
+ title: '作业汇总分析',
112
+ filterType: 'rangePicker',
113
+ filterChange: function filterChange(date) {
114
+ setState({
115
+ startDate: date[0],
116
+ endDate: date[1]
117
+ });
118
+ },
119
+ dateValue: [state.startDate, state.endDate],
120
+ children: /*#__PURE__*/_jsxs(Row, {
121
+ align: 'middle',
122
+ justify: 'center',
123
+ children: [/*#__PURE__*/_jsx(Col, {
124
+ span: 12,
125
+ children: /*#__PURE__*/_jsxs(Row, {
126
+ gutter: [26, 26],
127
+ align: 'middle',
128
+ justify: 'center',
129
+ children: [/*#__PURE__*/_jsx(Col, {
130
+ children: /*#__PURE__*/_jsx(VmFactor, {
131
+ name: '排班天数',
132
+ unit: '天',
133
+ fontType: 'cyan',
134
+ value: days,
135
+ img: isDark ? require("../../imgs/factor/dark_over_rate.png") : require("../../imgs/factor/over_rate.png")
136
+ })
137
+ }), /*#__PURE__*/_jsx(Col, {
138
+ children: /*#__PURE__*/_jsx(VmFactor, {
139
+ name: '排班总里程',
140
+ unit: '公里',
141
+ fontType: 'blue',
142
+ value: planMileage,
143
+ img: isDark ? require("../../imgs/factor/dark_plan_mileage.png") : require("../../imgs/factor/plan_mileage.png")
144
+ })
145
+ }), /*#__PURE__*/_jsx(Col, {
146
+ children: /*#__PURE__*/_jsx(VmFactor, {
147
+ name: '作业总里程',
148
+ unit: '公里',
149
+ fontType: 'green',
150
+ value: workMileage,
151
+ img: isDark ? require("../../imgs/factor/dark_valid_mileage.png") : require("../../imgs/factor/valid_mileage.png")
152
+ })
153
+ })]
154
+ })
155
+ }), /*#__PURE__*/_jsxs(Col, {
156
+ span: 12,
157
+ children: [/*#__PURE__*/_jsxs(Row, {
158
+ align: 'middle',
159
+ justify: 'space-between',
160
+ style: {
161
+ fontWeight: 600,
162
+ fontSize: 16,
163
+ marginBottom: 10
164
+ },
165
+ children: [/*#__PURE__*/_jsx("div", {
166
+ children: "\u5E73\u5747\u5B8C\u6210\u7387"
167
+ }), /*#__PURE__*/_jsxs("div", {
168
+ children: [totalWorkInfo === null || totalWorkInfo === void 0 ? void 0 : totalWorkInfo.completeRate, "%"]
169
+ })]
170
+ }), /*#__PURE__*/_jsxs("div", {
171
+ className: classnames('road-statistic-summary-main-rate', {
172
+ 'road-statistic-summary-main-rate-dark': isDark
173
+ }),
174
+ children: [/*#__PURE__*/_jsxs("div", {
175
+ className: "road-statistic-summary-main-rate--item",
176
+ children: [/*#__PURE__*/_jsxs("div", {
177
+ className: "road-statistic-summary-main-rate--label",
178
+ children: [/*#__PURE__*/_jsx("div", {
179
+ className: "road-statistic-summary-main-rate--block",
180
+ style: {
181
+ background: 'var(--red-color)'
182
+ }
183
+ }), /*#__PURE__*/_jsx("span", {
184
+ children: '<50%'
185
+ })]
186
+ }), /*#__PURE__*/_jsxs("div", {
187
+ className: classnames('road-statistic-summary-main-rate--value', {
188
+ white_yellow: isDark
189
+ }),
190
+ children: [/*#__PURE__*/_jsx("span", {
191
+ children: (completeRate === null || completeRate === void 0 ? void 0 : completeRate.rate1Days) || 0
192
+ }), "\u5929"]
193
+ })]
194
+ }), /*#__PURE__*/_jsxs("div", {
195
+ className: "road-statistic-summary-main-rate--item",
196
+ children: [/*#__PURE__*/_jsxs("div", {
197
+ className: "road-statistic-summary-main-rate--label",
198
+ children: [/*#__PURE__*/_jsx("div", {
199
+ className: "road-statistic-summary-main-rate--block",
200
+ style: {
201
+ background: 'var(--yellow-color)'
202
+ }
203
+ }), /*#__PURE__*/_jsx("span", {
204
+ children: '50%≤完成率<80%'
205
+ })]
206
+ }), /*#__PURE__*/_jsxs("div", {
207
+ className: classnames('road-statistic-summary-main-rate--value', {
208
+ white_blue: isDark
209
+ }),
210
+ children: [/*#__PURE__*/_jsx("span", {
211
+ children: (completeRate === null || completeRate === void 0 ? void 0 : completeRate.rate2Days) || 0
212
+ }), "\u5929"]
213
+ })]
214
+ }), /*#__PURE__*/_jsxs("div", {
215
+ className: "road-statistic-summary-main-rate--item",
216
+ children: [/*#__PURE__*/_jsxs("div", {
217
+ className: "road-statistic-summary-main-rate--label",
218
+ children: [/*#__PURE__*/_jsx("div", {
219
+ className: "road-statistic-summary-main-rate--block",
220
+ style: {
221
+ background: 'var(--blue-color)'
222
+ }
223
+ }), /*#__PURE__*/_jsx("span", {
224
+ children: '80%≤完成率<100%'
225
+ })]
226
+ }), /*#__PURE__*/_jsxs("div", {
227
+ className: classnames('road-statistic-summary-main-rate--value', {
228
+ white_green: isDark
229
+ }),
230
+ children: [/*#__PURE__*/_jsx("span", {
231
+ children: (completeRate === null || completeRate === void 0 ? void 0 : completeRate.rate3Days) || 0
232
+ }), "\u5929"]
233
+ })]
234
+ }), /*#__PURE__*/_jsxs("div", {
235
+ className: "road-statistic-summary-main-rate--item",
236
+ children: [/*#__PURE__*/_jsxs("div", {
237
+ className: "road-statistic-summary-main-rate--label",
238
+ children: [/*#__PURE__*/_jsx("div", {
239
+ className: "road-statistic-summary-main-rate--block",
240
+ style: {
241
+ background: 'var(--green-color)'
242
+ }
243
+ }), /*#__PURE__*/_jsx("span", {
244
+ children: '=100%'
245
+ })]
246
+ }), /*#__PURE__*/_jsxs("div", {
247
+ className: classnames('road-statistic-summary-main-rate--value', {
248
+ white_blue: isDark
249
+ }),
250
+ children: [/*#__PURE__*/_jsx("span", {
251
+ children: (completeRate === null || completeRate === void 0 ? void 0 : completeRate.rate4Days) || 0
252
+ }), "\u5929"]
253
+ })]
254
+ })]
255
+ })]
256
+ })]
257
+ })
258
+ })
259
+ }), /*#__PURE__*/_jsx(Col, {
260
+ span: 24,
261
+ flex: 'auto',
262
+ children: /*#__PURE__*/_jsxs(Row, {
263
+ gutter: [16, 16],
264
+ children: [/*#__PURE__*/_jsx(Col, {
265
+ span: 12,
266
+ children: /*#__PURE__*/_jsx(VmWrapper, {
267
+ title: '班次完成情况分析',
268
+ extraLeft: /*#__PURE__*/_jsx(VMSelect, {
269
+ options: (shiftInfoWorkInfos || []).filter(function (item) {
270
+ return item.startTime && item.endTime;
271
+ }).map(function (item) {
272
+ return {
273
+ label: "".concat(item.name, "(").concat(item.startTime.slice(0, 5), " ~ ").concat(item.endTime.slice(0, 5), ")"),
274
+ value: item.id
275
+ };
276
+ }),
277
+ value: shiftId,
278
+ onChange: setShiftId,
279
+ allowClear: false
280
+ }),
281
+ children: /*#__PURE__*/_jsx(VmBarCharts, {
282
+ height: 299,
283
+ dataList: shiftData.dataList,
284
+ xAxis: shiftData.xAxis,
285
+ unit: "km",
286
+ yAxisList: [{
287
+ key: '',
288
+ unit: 'km',
289
+ name: '(km)'
290
+ }]
291
+ })
292
+ })
293
+ }), /*#__PURE__*/_jsx(Col, {
294
+ span: 12,
295
+ children: /*#__PURE__*/_jsx(VmWrapper, {
296
+ title: '车道完成情况分析',
297
+ children: /*#__PURE__*/_jsx(VmLineCharts, {
298
+ dataList: facilityTypeData.dataList,
299
+ xAxis: facilityTypeData.xAxis,
300
+ unit: '%',
301
+ height: 299,
302
+ legendOption: {
303
+ left: 'center'
304
+ }
305
+ })
306
+ })
307
+ })]
308
+ })
309
+ })]
310
+ });
311
+ };
312
+ export default Statistical;
@@ -0,0 +1,32 @@
1
+ .road-statistic-summary-main-rate {
2
+ --bg-color: linear-gradient(180deg, #E4EFFF 0%, #F5FBFF 100%);
3
+ &-dark {
4
+ --bg-color: linear-gradient(180deg, #1C7CBF 0%, #0B588E 100%);
5
+ }
6
+ width: 100%;
7
+ height: 130px;
8
+ display: flex;
9
+ align-items: center;
10
+ justify-content: space-around;
11
+ padding: 0 24px;
12
+ background: var(--bg-color);
13
+ border-radius: 8px;
14
+ &--block {
15
+ width: 8px;
16
+ height: 8px;
17
+ border-radius: 50%;
18
+ }
19
+ &--label {
20
+ display: flex;
21
+ gap: 4px;
22
+ align-items: center;
23
+ font-size: 16px;
24
+ color: var(--img-text-color);
25
+ }
26
+ &--value {
27
+ margin-left: 12px;
28
+ font-weight: bold;
29
+ font-size: 24px;
30
+ color: #1F1F1F;
31
+ }
32
+ }