@vtx/modals2 5.0.57 → 5.0.58
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/_components/vm-calendar/index.js +14 -4
- package/lib/_components/vm-calendar/style/index.less +4 -1
- package/lib/_components/vm-filter/index.js +25 -0
- package/lib/_components/vm-pie-charts/index.js +13 -3
- package/lib/_components/vm-progress/index.js +6 -0
- package/lib/_components/vm-table/index.js +3 -3
- package/lib/_components/vm-table/style/index.less +12 -7
- package/lib/_components/vm-video/index.js +6 -1
- package/lib/style/index.less +5 -0
- package/lib/vtx-area-modal/api.js +2 -0
- package/lib/vtx-base-modal/index.js +5 -0
- package/lib/vtx-car-modal/api.js +179 -74
- package/lib/vtx-car-modal/content/JXH/Hw2AlarmInfo/List.js +133 -0
- package/lib/vtx-car-modal/content/JXH/Hw2AlarmInfo/StaticInfo.js +84 -0
- package/lib/vtx-car-modal/content/JXH/Hw2AlarmInfo/index.js +71 -0
- package/lib/vtx-car-modal/content/JXH/Hw2BaseInfo/index.js +223 -0
- package/lib/vtx-car-modal/content/JXH/Hw2StaticInfo/index.js +549 -0
- package/lib/vtx-car-modal/content/JXH/Hw2StaticInfo/index.less +6 -0
- package/lib/vtx-car-modal/content/JXH/Hw2WorkRecord/index.js +291 -0
- package/lib/vtx-car-modal/content/JXH/WorkRecord/index.js +1 -1
- package/lib/vtx-car-modal/content/JXH/index.js +9 -1
- package/lib/vtx-car-modal/imgs/calendar/auto.png +0 -0
- package/lib/vtx-car-modal/imgs/calendar/dark_auto.png +0 -0
- package/lib/vtx-car-modal/imgs/calendar/dark_electricity.png +0 -0
- package/lib/vtx-car-modal/imgs/calendar/dark_oil.png +0 -0
- package/lib/vtx-car-modal/imgs/calendar/dark_transition.png +0 -0
- package/lib/vtx-car-modal/imgs/calendar/dark_water.png +0 -0
- package/lib/vtx-car-modal/imgs/calendar/dark_yy_mileage.png +0 -0
- package/lib/vtx-car-modal/imgs/calendar/electricity.png +0 -0
- package/lib/vtx-car-modal/imgs/calendar/oil.png +0 -0
- package/lib/vtx-car-modal/imgs/calendar/transition.png +0 -0
- package/lib/vtx-car-modal/imgs/calendar/water.png +0 -0
- package/lib/vtx-car-modal/imgs/calendar/yy_mileage.png +0 -0
- package/lib/vtx-car-modal/index.js +9 -1
- package/lib/vtx-cp-modal/components/BaseInfo/TodayWork.js +1 -0
- package/lib/vtx-housing-estate-modal/components/Alarm/GDCLXL.js +2 -0
- package/lib/vtx-housing-estate-modal/components/Alarm/MYFX_GD.js +2 -0
- package/lib/vtx-housing-estate-modal/components/OverView/RightBottom.js +2 -0
- package/lib/vtx-road-modal/api.js +348 -11
- package/lib/vtx-road-modal/components/BaseInfo/Work.js +11 -5
- package/lib/vtx-road-modal/components/BaseInfo/index.js +6 -5
- package/lib/vtx-road-modal/components/LaneBaseInfo/Rules.js +63 -0
- package/lib/vtx-road-modal/components/LaneBaseInfo/Work.js +434 -0
- package/lib/vtx-road-modal/components/LaneBaseInfo/index.js +80 -0
- package/lib/vtx-road-modal/components/LaneBaseInfo/index.less +127 -0
- package/lib/vtx-road-modal/components/LaneCalendar/index.js +194 -0
- package/lib/vtx-road-modal/components/LaneStatistical/index.js +312 -0
- package/lib/vtx-road-modal/components/LaneStatistical/index.less +32 -0
- package/lib/vtx-road-modal/components/index.js +4 -1
- package/lib/vtx-road-modal/imgs/car.png +0 -0
- package/lib/vtx-road-modal/imgs/dark_car.png +0 -0
- package/lib/vtx-road-modal/imgs/dark_person.png +0 -0
- package/lib/vtx-road-modal/imgs/person.png +0 -0
- package/lib/vtx-road-modal/imgs/schedule.png +0 -0
- package/lib/vtx-road-modal/imgs/work.png +0 -0
- package/lib/vtx-road-modal/imgs//344/274/230.png +0 -0
- package/lib/vtx-road-modal/imgs//345/267/256.png +0 -0
- package/lib/vtx-road-modal/imgs//350/211/257.png +0 -0
- package/lib/vtx-road-modal/index.js +18 -13
- package/lib/vtx-sdyd-tfd-modal/components/Alarm/GDCLXL.js +2 -0
- package/lib/vtx-sdyd-tfd-modal/components/Alarm/MYFX_GD.js +2 -0
- package/lib/vtx-sdyd-tfd-modal/components/OverView/RightBottom.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,549 @@
|
|
|
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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
|
+
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."); }
|
|
4
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
|
+
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; }
|
|
7
|
+
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; }
|
|
8
|
+
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; }
|
|
9
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
10
|
+
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); }
|
|
11
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
+
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."); }
|
|
13
|
+
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); }
|
|
14
|
+
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; }
|
|
15
|
+
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; } }
|
|
16
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
+
import { QuestionCircleOutlined } from '@ant-design/icons';
|
|
18
|
+
import { Space, Tabs, Tooltip } from 'antd';
|
|
19
|
+
import dayjs from 'dayjs';
|
|
20
|
+
import { keyBy } from 'lodash';
|
|
21
|
+
import { useContext, useState } from 'react';
|
|
22
|
+
import { VmBarCharts, VmCalendar, VmCalendarInner, VmCalendarPercent, VmTable, VmTabs, VmWrapper } from "../../../../_components";
|
|
23
|
+
import useSettings from "../../../../_hooks/useSettings";
|
|
24
|
+
import { secondToFormatTime } from "../../../../_util";
|
|
25
|
+
import { Hw2Service } from "../../../api";
|
|
26
|
+
import darkElectricityIcon from "../../../imgs/calendar/dark_electricity.png";
|
|
27
|
+
import darkWorkMileageIcon from "../../../imgs/calendar/dark_green_mileage.png";
|
|
28
|
+
import darkMileageIcon from "../../../imgs/calendar/dark_mileage.png";
|
|
29
|
+
import darkOilIcon from "../../../imgs/calendar/dark_oil.png";
|
|
30
|
+
import darkTransitionIcon from "../../../imgs/calendar/dark_transition.png";
|
|
31
|
+
import darkWaterIcon from "../../../imgs/calendar/dark_water.png";
|
|
32
|
+
import lightElectricityIcon from "../../../imgs/calendar/electricity.png";
|
|
33
|
+
import lightWorkMileageIcon from "../../../imgs/calendar/green_mileage.png";
|
|
34
|
+
import lightMileageIcon from "../../../imgs/calendar/mileage.png";
|
|
35
|
+
import lightOilIcon from "../../../imgs/calendar/oil.png";
|
|
36
|
+
import lightTransitionIcon from "../../../imgs/calendar/transition.png";
|
|
37
|
+
import lightWaterIcon from "../../../imgs/calendar/water.png";
|
|
38
|
+
import { CarContext } from "../../../index";
|
|
39
|
+
import "./index.less";
|
|
40
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
41
|
+
var TabPane = Tabs.TabPane;
|
|
42
|
+
var Hw2StaticInfo = function Hw2StaticInfo() {
|
|
43
|
+
var _useState = useState('calendar'),
|
|
44
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
45
|
+
type = _useState2[0],
|
|
46
|
+
setType = _useState2[1];
|
|
47
|
+
var _useContext = useContext(CarContext),
|
|
48
|
+
id = _useContext.id,
|
|
49
|
+
detail = _useContext.detail;
|
|
50
|
+
var isUnmanned = (detail === null || detail === void 0 ? void 0 : detail.driveMode) === 'unmanned';
|
|
51
|
+
var _useState3 = useState(dayjs()),
|
|
52
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
53
|
+
month = _useState4[0],
|
|
54
|
+
setMonth = _useState4[1];
|
|
55
|
+
var common = {
|
|
56
|
+
type: type,
|
|
57
|
+
id: id,
|
|
58
|
+
month: month
|
|
59
|
+
};
|
|
60
|
+
return /*#__PURE__*/_jsx(VmWrapper, {
|
|
61
|
+
title: '作业分析',
|
|
62
|
+
needChange: true,
|
|
63
|
+
showCalendar: true,
|
|
64
|
+
onChange: setType,
|
|
65
|
+
filterType: "monthPicker",
|
|
66
|
+
dateValue: month,
|
|
67
|
+
filterChange: setMonth,
|
|
68
|
+
disabledDate: function disabledDate(current) {
|
|
69
|
+
return current && current > dayjs().endOf('M');
|
|
70
|
+
},
|
|
71
|
+
children: /*#__PURE__*/_jsx(Calendar, _objectSpread(_objectSpread({}, common), {}, {
|
|
72
|
+
isUnmanned: isUnmanned
|
|
73
|
+
}))
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
// 作业率图例
|
|
78
|
+
function RateLegend() {
|
|
79
|
+
return /*#__PURE__*/_jsxs(Space, {
|
|
80
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
81
|
+
children: "\u5B8C\u6210\u7387\uFF1A"
|
|
82
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
83
|
+
className: 'vtx-car-calendar-complete-legend',
|
|
84
|
+
style: {
|
|
85
|
+
background: 'var(--gray-color)'
|
|
86
|
+
}
|
|
87
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
88
|
+
children: "0%"
|
|
89
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
90
|
+
className: 'vtx-car-calendar-complete-legend',
|
|
91
|
+
style: {
|
|
92
|
+
background: 'var(--red-color)'
|
|
93
|
+
}
|
|
94
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
95
|
+
children: "(0%-50%]"
|
|
96
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
97
|
+
className: 'vtx-car-calendar-complete-legend',
|
|
98
|
+
style: {
|
|
99
|
+
background: 'var(--yellow-color)'
|
|
100
|
+
}
|
|
101
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
102
|
+
children: "(50%-80%]"
|
|
103
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
104
|
+
className: 'vtx-car-calendar-complete-legend',
|
|
105
|
+
style: {
|
|
106
|
+
background: 'var(--blue-color)'
|
|
107
|
+
}
|
|
108
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
109
|
+
children: "(80%-100%]"
|
|
110
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
111
|
+
className: 'vtx-car-calendar-complete-legend',
|
|
112
|
+
style: {
|
|
113
|
+
background: 'var(--green-color)'
|
|
114
|
+
}
|
|
115
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
116
|
+
children: "100%"
|
|
117
|
+
})]
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// 获取效率颜色
|
|
122
|
+
function getRateColor() {
|
|
123
|
+
var percent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
124
|
+
var color = 'gray';
|
|
125
|
+
if (percent > 0 && percent <= 50) {
|
|
126
|
+
color = 'red';
|
|
127
|
+
} else if (percent > 50 && percent <= 80) {
|
|
128
|
+
color = 'yellow';
|
|
129
|
+
} else if (percent > 80 && percent < 100) {
|
|
130
|
+
color = 'blue';
|
|
131
|
+
} else if (percent >= 100) {
|
|
132
|
+
color = 'green';
|
|
133
|
+
}
|
|
134
|
+
return color;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// 机械化作业日历-默认
|
|
138
|
+
function Calendar(_ref) {
|
|
139
|
+
var type = _ref.type,
|
|
140
|
+
id = _ref.id,
|
|
141
|
+
month = _ref.month,
|
|
142
|
+
isUnmanned = _ref.isUnmanned;
|
|
143
|
+
var _useSettings = useSettings(),
|
|
144
|
+
isDark = _useSettings.isDark;
|
|
145
|
+
var _useState5 = useState('complete'),
|
|
146
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
147
|
+
activeType = _useState6[0],
|
|
148
|
+
setActiveType = _useState6[1];
|
|
149
|
+
var _Hw2Service$useWorkCa = Hw2Service.useWorkCalendar(id, month.startOf('M').format('YYYY-MM-DD'), month.endOf('M').format('YYYY-MM-DD')),
|
|
150
|
+
_Hw2Service$useWorkCa2 = _Hw2Service$useWorkCa.workCalendar,
|
|
151
|
+
dailyData = _Hw2Service$useWorkCa2 === void 0 ? [] : _Hw2Service$useWorkCa2,
|
|
152
|
+
loading = _Hw2Service$useWorkCa.loading;
|
|
153
|
+
var keyByDate = keyBy(dailyData || [], 'date');
|
|
154
|
+
var mileageIcon = lightMileageIcon;
|
|
155
|
+
var workMileageIcon = lightWorkMileageIcon;
|
|
156
|
+
var oilIcon = lightOilIcon;
|
|
157
|
+
var electricityIcon = lightElectricityIcon;
|
|
158
|
+
var waterIcon = lightWaterIcon;
|
|
159
|
+
var transitionIcon = lightTransitionIcon;
|
|
160
|
+
if (isDark) {
|
|
161
|
+
mileageIcon = darkMileageIcon;
|
|
162
|
+
workMileageIcon = darkWorkMileageIcon;
|
|
163
|
+
oilIcon = darkOilIcon;
|
|
164
|
+
electricityIcon = darkElectricityIcon;
|
|
165
|
+
waterIcon = darkWaterIcon;
|
|
166
|
+
transitionIcon = darkTransitionIcon;
|
|
167
|
+
}
|
|
168
|
+
// 列表字段-默认
|
|
169
|
+
var BaseColumns = [{
|
|
170
|
+
title: '作业日期',
|
|
171
|
+
dataIndex: 'date',
|
|
172
|
+
key: 'date',
|
|
173
|
+
width: 100,
|
|
174
|
+
fixed: 'left'
|
|
175
|
+
}, {
|
|
176
|
+
title: '作业开始时间',
|
|
177
|
+
dataIndex: 'workStartTime',
|
|
178
|
+
key: 'workStartTime',
|
|
179
|
+
render: function render(text) {
|
|
180
|
+
return /*#__PURE__*/_jsx("span", {
|
|
181
|
+
children: text || '-'
|
|
182
|
+
});
|
|
183
|
+
},
|
|
184
|
+
sorter: function sorter(a, b) {
|
|
185
|
+
return a.workStartTime > b.workStartTime ? 1 : -1;
|
|
186
|
+
},
|
|
187
|
+
width: 160
|
|
188
|
+
}, {
|
|
189
|
+
title: '作业结束时间',
|
|
190
|
+
dataIndex: 'workEndTime',
|
|
191
|
+
key: 'workEndTime',
|
|
192
|
+
render: function render(text) {
|
|
193
|
+
return /*#__PURE__*/_jsx("span", {
|
|
194
|
+
children: text || '-'
|
|
195
|
+
});
|
|
196
|
+
},
|
|
197
|
+
sorter: function sorter(a, b) {
|
|
198
|
+
return a.workEndTime > b.workEndTime ? 1 : -1;
|
|
199
|
+
},
|
|
200
|
+
width: 160
|
|
201
|
+
}, {
|
|
202
|
+
title: '作业时长',
|
|
203
|
+
dataIndex: 'workDuration',
|
|
204
|
+
key: 'workDuration',
|
|
205
|
+
render: function render(text) {
|
|
206
|
+
return /*#__PURE__*/_jsx("span", {
|
|
207
|
+
children: secondToFormatTime((text || 0) / 1000) || '-'
|
|
208
|
+
});
|
|
209
|
+
},
|
|
210
|
+
width: 100
|
|
211
|
+
}, {
|
|
212
|
+
title: '行驶时长',
|
|
213
|
+
dataIndex: 'driveDuration',
|
|
214
|
+
key: 'driveDuration',
|
|
215
|
+
render: function render(text) {
|
|
216
|
+
return /*#__PURE__*/_jsx("span", {
|
|
217
|
+
children: secondToFormatTime((text || 0) / 1000) || '-'
|
|
218
|
+
});
|
|
219
|
+
},
|
|
220
|
+
width: 100
|
|
221
|
+
}, {
|
|
222
|
+
title: '排班里程(km)',
|
|
223
|
+
dataIndex: 'planMileage',
|
|
224
|
+
key: 'planMileage',
|
|
225
|
+
render: function render(text) {
|
|
226
|
+
return /*#__PURE__*/_jsx("span", {
|
|
227
|
+
children: text || '-'
|
|
228
|
+
});
|
|
229
|
+
},
|
|
230
|
+
align: 'right',
|
|
231
|
+
width: 120
|
|
232
|
+
}, {
|
|
233
|
+
title: '作业里程(km)',
|
|
234
|
+
dataIndex: 'workMileage',
|
|
235
|
+
key: 'workMileage',
|
|
236
|
+
render: function render(text) {
|
|
237
|
+
return /*#__PURE__*/_jsx("span", {
|
|
238
|
+
children: text || '-'
|
|
239
|
+
});
|
|
240
|
+
},
|
|
241
|
+
align: 'right',
|
|
242
|
+
width: 120
|
|
243
|
+
}].concat(_toConsumableArray(isUnmanned ? [{
|
|
244
|
+
title: '行驶里程(km)',
|
|
245
|
+
dataIndex: 'driveMileage',
|
|
246
|
+
key: 'driveMileage',
|
|
247
|
+
render: function render(text) {
|
|
248
|
+
return /*#__PURE__*/_jsx("span", {
|
|
249
|
+
children: text || '-'
|
|
250
|
+
});
|
|
251
|
+
},
|
|
252
|
+
align: 'right',
|
|
253
|
+
width: 120
|
|
254
|
+
}] : []), [{
|
|
255
|
+
title: '电耗(Kwh)',
|
|
256
|
+
dataIndex: 'electricity',
|
|
257
|
+
key: 'electricity',
|
|
258
|
+
render: function render(text) {
|
|
259
|
+
return /*#__PURE__*/_jsx("span", {
|
|
260
|
+
children: text || '-'
|
|
261
|
+
});
|
|
262
|
+
},
|
|
263
|
+
align: 'right',
|
|
264
|
+
width: 100
|
|
265
|
+
}, {
|
|
266
|
+
title: '水耗(L)',
|
|
267
|
+
dataIndex: 'water',
|
|
268
|
+
key: 'water',
|
|
269
|
+
render: function render(text) {
|
|
270
|
+
return /*#__PURE__*/_jsx("span", {
|
|
271
|
+
children: text || '-'
|
|
272
|
+
});
|
|
273
|
+
},
|
|
274
|
+
align: 'right',
|
|
275
|
+
width: 100
|
|
276
|
+
}], _toConsumableArray(isUnmanned ? [] : [{
|
|
277
|
+
title: '油耗(L)',
|
|
278
|
+
dataIndex: 'oil',
|
|
279
|
+
key: 'oil',
|
|
280
|
+
render: function render(text) {
|
|
281
|
+
return /*#__PURE__*/_jsx("span", {
|
|
282
|
+
children: text || '-'
|
|
283
|
+
});
|
|
284
|
+
},
|
|
285
|
+
align: 'right',
|
|
286
|
+
width: 110
|
|
287
|
+
}]));
|
|
288
|
+
var tableProps = {
|
|
289
|
+
pagination: false,
|
|
290
|
+
dataSource: dailyData
|
|
291
|
+
};
|
|
292
|
+
var dateCellRender = function dateCellRender(value) {
|
|
293
|
+
var date = dayjs(value).format('YYYY-MM-DD');
|
|
294
|
+
var item = keyByDate[date];
|
|
295
|
+
if (!item) {
|
|
296
|
+
return null;
|
|
297
|
+
}
|
|
298
|
+
var completeRate = item.completeRate,
|
|
299
|
+
planMileage = item.planMileage,
|
|
300
|
+
workMileage = item.workMileage,
|
|
301
|
+
water = item.water,
|
|
302
|
+
oil = item.oil,
|
|
303
|
+
electricity = item.electricity,
|
|
304
|
+
transitionMileage = item.transitionMileage,
|
|
305
|
+
driveMileage = item.driveMileage;
|
|
306
|
+
var color = getRateColor(completeRate);
|
|
307
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
308
|
+
children: [activeType === 'complete' && /*#__PURE__*/_jsx(VmCalendarPercent, {
|
|
309
|
+
percent: completeRate,
|
|
310
|
+
color: color
|
|
311
|
+
}), activeType === 'complete' ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
312
|
+
children: [/*#__PURE__*/_jsx(VmCalendarInner, {
|
|
313
|
+
type: "blue",
|
|
314
|
+
img: mileageIcon,
|
|
315
|
+
value: planMileage,
|
|
316
|
+
style: {
|
|
317
|
+
width: '139px',
|
|
318
|
+
justifyContent: 'space-between',
|
|
319
|
+
margin: '8px 0'
|
|
320
|
+
}
|
|
321
|
+
}), /*#__PURE__*/_jsx(VmCalendarInner, {
|
|
322
|
+
type: "green",
|
|
323
|
+
img: workMileageIcon,
|
|
324
|
+
value: workMileage,
|
|
325
|
+
style: {
|
|
326
|
+
width: '139px',
|
|
327
|
+
justifyContent: 'space-between'
|
|
328
|
+
}
|
|
329
|
+
})]
|
|
330
|
+
}) : activeType === 'work' ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
331
|
+
children: [/*#__PURE__*/_jsx(VmCalendarInner, {
|
|
332
|
+
type: "blue",
|
|
333
|
+
img: mileageIcon,
|
|
334
|
+
value: driveMileage,
|
|
335
|
+
style: {
|
|
336
|
+
width: '139px',
|
|
337
|
+
justifyContent: 'space-between',
|
|
338
|
+
margin: '8px 0'
|
|
339
|
+
}
|
|
340
|
+
}), /*#__PURE__*/_jsx(VmCalendarInner, {
|
|
341
|
+
type: "green",
|
|
342
|
+
img: transitionIcon,
|
|
343
|
+
value: transitionMileage,
|
|
344
|
+
style: {
|
|
345
|
+
width: '139px',
|
|
346
|
+
justifyContent: 'space-between'
|
|
347
|
+
}
|
|
348
|
+
})]
|
|
349
|
+
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
350
|
+
children: [/*#__PURE__*/_jsx(VmCalendarInner, {
|
|
351
|
+
type: "yellow",
|
|
352
|
+
img: electricityIcon,
|
|
353
|
+
value: electricity,
|
|
354
|
+
style: {
|
|
355
|
+
width: '139px',
|
|
356
|
+
justifyContent: 'space-between',
|
|
357
|
+
margin: '8px 0'
|
|
358
|
+
}
|
|
359
|
+
}), /*#__PURE__*/_jsx(VmCalendarInner, {
|
|
360
|
+
type: "green",
|
|
361
|
+
img: waterIcon,
|
|
362
|
+
value: water,
|
|
363
|
+
style: {
|
|
364
|
+
width: '139px',
|
|
365
|
+
justifyContent: 'space-between',
|
|
366
|
+
margin: '8px 0'
|
|
367
|
+
}
|
|
368
|
+
}), !isUnmanned && /*#__PURE__*/_jsx(VmCalendarInner, {
|
|
369
|
+
type: "blue",
|
|
370
|
+
img: oilIcon,
|
|
371
|
+
value: oil,
|
|
372
|
+
style: {
|
|
373
|
+
width: '139px',
|
|
374
|
+
justifyContent: 'space-between'
|
|
375
|
+
}
|
|
376
|
+
})]
|
|
377
|
+
})]
|
|
378
|
+
});
|
|
379
|
+
};
|
|
380
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
381
|
+
children: [type === 'calendar' && /*#__PURE__*/_jsx("div", {
|
|
382
|
+
className: 'vtx-car-static-content-type',
|
|
383
|
+
children: /*#__PURE__*/_jsxs(VmTabs, {
|
|
384
|
+
activeKey: activeType,
|
|
385
|
+
onChange: setActiveType,
|
|
386
|
+
children: [/*#__PURE__*/_jsx(TabPane, {
|
|
387
|
+
tab: "\u5B8C\u6210\u7387"
|
|
388
|
+
}, "complete"), isUnmanned && /*#__PURE__*/_jsx(TabPane, {
|
|
389
|
+
tab: "\u8FD0\u884C"
|
|
390
|
+
}, "work"), /*#__PURE__*/_jsx(TabPane, {
|
|
391
|
+
tab: "\u80FD\u8017"
|
|
392
|
+
}, "energy")]
|
|
393
|
+
})
|
|
394
|
+
}), type === 'calendar' && /*#__PURE__*/_jsxs(_Fragment, {
|
|
395
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
396
|
+
className: 'vtx-car-calendar-head',
|
|
397
|
+
children: [(activeType === 'complete' ? [{
|
|
398
|
+
name: '排班里程(km)',
|
|
399
|
+
img: mileageIcon,
|
|
400
|
+
type: 'blue'
|
|
401
|
+
}, {
|
|
402
|
+
name: '作业里程(km)',
|
|
403
|
+
img: workMileageIcon,
|
|
404
|
+
type: 'green'
|
|
405
|
+
}] : activeType === 'work' ? [{
|
|
406
|
+
name: '行驶里程(km)',
|
|
407
|
+
img: mileageIcon,
|
|
408
|
+
type: 'blue'
|
|
409
|
+
}, {
|
|
410
|
+
name: '转场里程(km)',
|
|
411
|
+
img: transitionIcon,
|
|
412
|
+
type: 'yellow'
|
|
413
|
+
}] : [{
|
|
414
|
+
name: '电耗(Kwh)',
|
|
415
|
+
img: electricityIcon,
|
|
416
|
+
type: 'yellow'
|
|
417
|
+
}, {
|
|
418
|
+
name: '水耗(L)',
|
|
419
|
+
img: waterIcon,
|
|
420
|
+
type: 'green'
|
|
421
|
+
}].concat(_toConsumableArray(isUnmanned ? [] : [{
|
|
422
|
+
name: '油耗(L)',
|
|
423
|
+
img: oilIcon,
|
|
424
|
+
type: 'blue'
|
|
425
|
+
}]))).map(function (item, index) {
|
|
426
|
+
return /*#__PURE__*/_jsx(VmCalendarInner, _objectSpread(_objectSpread({}, item), {}, {
|
|
427
|
+
value: item.name
|
|
428
|
+
}), index);
|
|
429
|
+
}), activeType === 'complete' && /*#__PURE__*/_jsx(RateLegend, {})]
|
|
430
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
431
|
+
style: {
|
|
432
|
+
flex: 1,
|
|
433
|
+
minHeight: 0
|
|
434
|
+
},
|
|
435
|
+
children: /*#__PURE__*/_jsx(VmCalendar, {
|
|
436
|
+
dateCellRender: dateCellRender,
|
|
437
|
+
value: month,
|
|
438
|
+
height: activeType === 'energy' && !isUnmanned ? 122 : 86
|
|
439
|
+
})
|
|
440
|
+
})]
|
|
441
|
+
}), type === 'list' && /*#__PURE__*/_jsx(VmTable, _objectSpread({
|
|
442
|
+
columns: BaseColumns.concat({
|
|
443
|
+
title: /*#__PURE__*/_jsxs(Space, {
|
|
444
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
445
|
+
children: "\u5B8C\u6210\u7387"
|
|
446
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
447
|
+
title: "\u4F5C\u4E1A\u91CC\u7A0B/\u6392\u73ED\u91CC\u7A0B",
|
|
448
|
+
children: /*#__PURE__*/_jsx(QuestionCircleOutlined, {})
|
|
449
|
+
})]
|
|
450
|
+
}),
|
|
451
|
+
dataIndex: 'completeRate',
|
|
452
|
+
key: 'completeRate',
|
|
453
|
+
render: function render(text) {
|
|
454
|
+
return /*#__PURE__*/_jsx("span", {
|
|
455
|
+
children: (text || 0) + '%'
|
|
456
|
+
});
|
|
457
|
+
},
|
|
458
|
+
align: 'right',
|
|
459
|
+
width: 100,
|
|
460
|
+
fixed: 'right'
|
|
461
|
+
}),
|
|
462
|
+
rowKey: "id",
|
|
463
|
+
indexFixed: true
|
|
464
|
+
}, tableProps)), type === 'chart' && /*#__PURE__*/_jsxs(_Fragment, {
|
|
465
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
466
|
+
children: "\u4F5C\u4E1A\u60C5\u51B5"
|
|
467
|
+
}), /*#__PURE__*/_jsx(VmBarCharts, {
|
|
468
|
+
dataList: [{
|
|
469
|
+
name: '排班里程',
|
|
470
|
+
data: dailyData.map(function (item) {
|
|
471
|
+
return "\u2000".concat(item.planMileage);
|
|
472
|
+
})
|
|
473
|
+
}, {
|
|
474
|
+
name: '作业里程',
|
|
475
|
+
data: dailyData.map(function (item) {
|
|
476
|
+
return "\u2000".concat(item.workMileage);
|
|
477
|
+
}),
|
|
478
|
+
color: 'green'
|
|
479
|
+
}].concat(_toConsumableArray(isUnmanned ? [{
|
|
480
|
+
name: '行驶里程',
|
|
481
|
+
data: dailyData.map(function (item) {
|
|
482
|
+
return "\u2000".concat(item.driveMileage);
|
|
483
|
+
}),
|
|
484
|
+
color: 'blue'
|
|
485
|
+
}] : [])),
|
|
486
|
+
unit: '%',
|
|
487
|
+
xAxis: dailyData.map(function (item) {
|
|
488
|
+
return item.date;
|
|
489
|
+
}),
|
|
490
|
+
yAxisList: [{
|
|
491
|
+
key: "\u2000",
|
|
492
|
+
unit: 'km',
|
|
493
|
+
name: '(km)'
|
|
494
|
+
}, {
|
|
495
|
+
key: '',
|
|
496
|
+
unit: '%',
|
|
497
|
+
name: '(%)'
|
|
498
|
+
}],
|
|
499
|
+
lineList: [{
|
|
500
|
+
name: '完成率',
|
|
501
|
+
data: dailyData.map(function (item) {
|
|
502
|
+
return item.completeRate;
|
|
503
|
+
}),
|
|
504
|
+
yAxisIndex: 1,
|
|
505
|
+
color: isDark ? '#13F97A' : '#0FB964'
|
|
506
|
+
}],
|
|
507
|
+
loading: loading
|
|
508
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
509
|
+
children: "\u80FD\u8017\u60C5\u51B5"
|
|
510
|
+
}), /*#__PURE__*/_jsx(VmBarCharts, {
|
|
511
|
+
lineList: [{
|
|
512
|
+
name: '水耗',
|
|
513
|
+
data: dailyData.map(function (item) {
|
|
514
|
+
return "\u2000".concat(item.water);
|
|
515
|
+
}),
|
|
516
|
+
color: '#FFAB0C'
|
|
517
|
+
}, _defineProperty({
|
|
518
|
+
name: '电耗',
|
|
519
|
+
data: dailyData.map(function (item) {
|
|
520
|
+
return "".concat(item.electricity);
|
|
521
|
+
}),
|
|
522
|
+
color: 'green',
|
|
523
|
+
yAxisIndex: 1
|
|
524
|
+
}, "color", '#0FB964')].concat(_toConsumableArray(isUnmanned ? [] : [{
|
|
525
|
+
name: '油耗',
|
|
526
|
+
data: dailyData.map(function (item) {
|
|
527
|
+
return "\u2000".concat(item.oil);
|
|
528
|
+
}),
|
|
529
|
+
color: 'blue'
|
|
530
|
+
}])),
|
|
531
|
+
unit: 'kwh',
|
|
532
|
+
xAxis: dailyData.map(function (item) {
|
|
533
|
+
return item.date;
|
|
534
|
+
}),
|
|
535
|
+
yAxisList: [{
|
|
536
|
+
key: "\u2000",
|
|
537
|
+
unit: 'L',
|
|
538
|
+
name: '(L)'
|
|
539
|
+
}, {
|
|
540
|
+
key: '',
|
|
541
|
+
unit: 'kwh',
|
|
542
|
+
name: '(kwh)'
|
|
543
|
+
}],
|
|
544
|
+
loading: loading
|
|
545
|
+
})]
|
|
546
|
+
})]
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
export default Hw2StaticInfo;
|