@vtx/modals2 5.0.56 → 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.
Files changed (64) 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-filter/index.js +25 -0
  4. package/lib/_components/vm-pie-charts/index.js +13 -3
  5. package/lib/_components/vm-progress/index.js +6 -0
  6. package/lib/_components/vm-table/index.js +3 -3
  7. package/lib/_components/vm-table/style/index.less +12 -7
  8. package/lib/_components/vm-video/HistoryGrid.js +4 -2
  9. package/lib/_components/vm-video/index.js +10 -4
  10. package/lib/style/index.less +5 -0
  11. package/lib/vtx-area-modal/api.js +2 -0
  12. package/lib/vtx-base-modal/index.js +5 -0
  13. package/lib/vtx-car-modal/api.js +179 -74
  14. package/lib/vtx-car-modal/content/JXH/Hw2AlarmInfo/List.js +133 -0
  15. package/lib/vtx-car-modal/content/JXH/Hw2AlarmInfo/StaticInfo.js +84 -0
  16. package/lib/vtx-car-modal/content/JXH/Hw2AlarmInfo/index.js +71 -0
  17. package/lib/vtx-car-modal/content/JXH/Hw2BaseInfo/index.js +223 -0
  18. package/lib/vtx-car-modal/content/JXH/Hw2StaticInfo/index.js +549 -0
  19. package/lib/vtx-car-modal/content/JXH/Hw2StaticInfo/index.less +6 -0
  20. package/lib/vtx-car-modal/content/JXH/Hw2WorkRecord/index.js +291 -0
  21. package/lib/vtx-car-modal/content/JXH/WorkRecord/index.js +1 -1
  22. package/lib/vtx-car-modal/content/JXH/index.js +9 -1
  23. package/lib/vtx-car-modal/imgs/calendar/auto.png +0 -0
  24. package/lib/vtx-car-modal/imgs/calendar/dark_auto.png +0 -0
  25. package/lib/vtx-car-modal/imgs/calendar/dark_electricity.png +0 -0
  26. package/lib/vtx-car-modal/imgs/calendar/dark_oil.png +0 -0
  27. package/lib/vtx-car-modal/imgs/calendar/dark_transition.png +0 -0
  28. package/lib/vtx-car-modal/imgs/calendar/dark_water.png +0 -0
  29. package/lib/vtx-car-modal/imgs/calendar/dark_yy_mileage.png +0 -0
  30. package/lib/vtx-car-modal/imgs/calendar/electricity.png +0 -0
  31. package/lib/vtx-car-modal/imgs/calendar/oil.png +0 -0
  32. package/lib/vtx-car-modal/imgs/calendar/transition.png +0 -0
  33. package/lib/vtx-car-modal/imgs/calendar/water.png +0 -0
  34. package/lib/vtx-car-modal/imgs/calendar/yy_mileage.png +0 -0
  35. package/lib/vtx-car-modal/index.js +9 -1
  36. package/lib/vtx-cp-modal/components/BaseInfo/TodayWork.js +1 -0
  37. package/lib/vtx-housing-estate-modal/components/Alarm/GDCLXL.js +2 -0
  38. package/lib/vtx-housing-estate-modal/components/Alarm/MYFX_GD.js +2 -0
  39. package/lib/vtx-housing-estate-modal/components/OverView/RightBottom.js +2 -0
  40. package/lib/vtx-road-modal/api.js +348 -11
  41. package/lib/vtx-road-modal/components/BaseInfo/Work.js +11 -5
  42. package/lib/vtx-road-modal/components/BaseInfo/index.js +6 -5
  43. package/lib/vtx-road-modal/components/LaneBaseInfo/Rules.js +63 -0
  44. package/lib/vtx-road-modal/components/LaneBaseInfo/Work.js +434 -0
  45. package/lib/vtx-road-modal/components/LaneBaseInfo/index.js +80 -0
  46. package/lib/vtx-road-modal/components/LaneBaseInfo/index.less +127 -0
  47. package/lib/vtx-road-modal/components/LaneCalendar/index.js +194 -0
  48. package/lib/vtx-road-modal/components/LaneStatistical/index.js +312 -0
  49. package/lib/vtx-road-modal/components/LaneStatistical/index.less +32 -0
  50. package/lib/vtx-road-modal/components/index.js +4 -1
  51. package/lib/vtx-road-modal/imgs/car.png +0 -0
  52. package/lib/vtx-road-modal/imgs/dark_car.png +0 -0
  53. package/lib/vtx-road-modal/imgs/dark_person.png +0 -0
  54. package/lib/vtx-road-modal/imgs/person.png +0 -0
  55. package/lib/vtx-road-modal/imgs/schedule.png +0 -0
  56. package/lib/vtx-road-modal/imgs/work.png +0 -0
  57. package/lib/vtx-road-modal/imgs//344/274/230.png +0 -0
  58. package/lib/vtx-road-modal/imgs//345/267/256.png +0 -0
  59. package/lib/vtx-road-modal/imgs//350/211/257.png +0 -0
  60. package/lib/vtx-road-modal/index.js +18 -13
  61. package/lib/vtx-sdyd-tfd-modal/components/Alarm/GDCLXL.js +2 -0
  62. package/lib/vtx-sdyd-tfd-modal/components/Alarm/MYFX_GD.js +2 -0
  63. package/lib/vtx-sdyd-tfd-modal/components/OverView/RightBottom.js +2 -0
  64. package/package.json +1 -1
@@ -0,0 +1,133 @@
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 { useSetState } from 'ahooks';
14
+ import { useContext } from 'react';
15
+ import { VmTable, VmTag, VmWrapper } from "../../../../_components";
16
+ import { secondToFormatTime } from "../../../../_util";
17
+ import { JxhService } from "../../../api";
18
+ import { CarContext } from "../../../index";
19
+ import { jsx as _jsx } from "react/jsx-runtime";
20
+ var colorMap = {
21
+ NOT_EDGE_ALIGNED: 'yellow',
22
+ NOT_GROUNDED: 'red',
23
+ OVER_SIGHT: 'purple'
24
+ };
25
+ var List = function List(props) {
26
+ var _useContext = useContext(CarContext),
27
+ id = _useContext.id;
28
+ var startDate = props.startDate,
29
+ endDate = props.endDate;
30
+ var _useSetState = useSetState({
31
+ pagination: {
32
+ current: 1,
33
+ pageSize: 10,
34
+ total: 0
35
+ },
36
+ sort: ''
37
+ }),
38
+ _useSetState2 = _slicedToArray(_useSetState, 2),
39
+ state = _useSetState2[0],
40
+ setState = _useSetState2[1];
41
+ var pagination = state.pagination,
42
+ sort = state.sort;
43
+ var _JxhService$useJXHAla = JxhService.useJXHAlarmList(id, "".concat(startDate, " 00:00:00"), "".concat(endDate, " 23:59:59"), pagination.current - 1, sort),
44
+ alarmRecord = _JxhService$useJXHAla.alarmRecord,
45
+ loading = _JxhService$useJXHAla.loading;
46
+ var columns = [{
47
+ title: '报警路段',
48
+ dataIndex: 'roadName',
49
+ key: 'roadName',
50
+ width: 200
51
+ }, {
52
+ title: '报警类型',
53
+ dataIndex: 'subCategoryName',
54
+ key: 'subCategoryName',
55
+ width: 120,
56
+ render: function render(text, record) {
57
+ return /*#__PURE__*/_jsx(VmTag, {
58
+ title: text,
59
+ type: colorMap[record.subCategoryCode] || 'red'
60
+ });
61
+ }
62
+ }, {
63
+ title: '报警开始时间',
64
+ dataIndex: 'startTime',
65
+ key: 'startTime',
66
+ width: 150,
67
+ sorter: true
68
+ }, {
69
+ title: '报警结束时间',
70
+ dataIndex: 'endTime',
71
+ key: 'endTime',
72
+ width: 150,
73
+ sorter: true
74
+ }, {
75
+ title: '报警时长',
76
+ dataIndex: 'currentDuration',
77
+ key: 'currentDuration',
78
+ width: 120,
79
+ render: function render(text) {
80
+ return /*#__PURE__*/_jsx("span", {
81
+ children: secondToFormatTime(text / 1000)
82
+ });
83
+ }
84
+ }, {
85
+ title: '当前速度(km/h)',
86
+ dataIndex: 'currentSpeed',
87
+ key: 'currentSpeed',
88
+ width: 100,
89
+ align: 'right',
90
+ render: function render(text) {
91
+ return /*#__PURE__*/_jsx("span", {
92
+ children: text ? text.toFixed(2) : 0
93
+ });
94
+ }
95
+ }];
96
+ var pageChange = function pageChange(page) {
97
+ setState({
98
+ pagination: _objectSpread(_objectSpread({}, pagination), {}, {
99
+ current: page
100
+ })
101
+ });
102
+ };
103
+ var tableProps = {
104
+ pagination: _objectSpread(_objectSpread({}, pagination), {}, {
105
+ total: alarmRecord.total || 0,
106
+ defaultPageSize: 10,
107
+ onChange: pageChange
108
+ }),
109
+ height: 440,
110
+ dataSource: alarmRecord.rows || [],
111
+ loading: loading,
112
+ onChange: function onChange(_pagination, _filters, sorter) {
113
+ if (sorter.order) {
114
+ var order = sorter.order === 'ascend' ? 'asc' : 'desc';
115
+ setState({
116
+ sort: "".concat(sorter.field, ",").concat(order)
117
+ });
118
+ } else {
119
+ setState({
120
+ sort: ''
121
+ });
122
+ }
123
+ }
124
+ };
125
+ return /*#__PURE__*/_jsx(VmWrapper, {
126
+ title: '报警明细',
127
+ children: /*#__PURE__*/_jsx(VmTable, _objectSpread({
128
+ columns: columns,
129
+ rowKey: "id"
130
+ }, tableProps))
131
+ });
132
+ };
133
+ export default List;
@@ -0,0 +1,84 @@
1
+ import { Col, Row } from 'antd';
2
+ import _ from 'lodash';
3
+ import { useContext } from 'react';
4
+ import { VmLineCharts, VmPieCharts, VmWrapper } from "../../../../_components";
5
+ import { Hw2Service } from "../../../api";
6
+ import { CarContext } from "../../../index";
7
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
+ var StaticInfo = function StaticInfo(_ref) {
9
+ var startDate = _ref.startDate,
10
+ endDate = _ref.endDate;
11
+ var _useContext = useContext(CarContext),
12
+ id = _useContext.id;
13
+ var _Hw2Service$useAlarmS = Hw2Service.useAlarmSummary(id, "".concat(startDate), "".concat(endDate)),
14
+ alarmSummary = _Hw2Service$useAlarmS.alarmSummary,
15
+ loading = _Hw2Service$useAlarmS.loading;
16
+ var _ref2 = alarmSummary || {},
17
+ _ref2$typeSummary = _ref2.typeSummary,
18
+ typeSummary = _ref2$typeSummary === void 0 ? [] : _ref2$typeSummary,
19
+ _ref2$daySummary = _ref2.daySummary,
20
+ daySummary = _ref2$daySummary === void 0 ? [] : _ref2$daySummary;
21
+ var dataList = [];
22
+ var groupByLabel = _.groupBy(daySummary, 'typeName');
23
+ Object.keys(groupByLabel).forEach(function (label) {
24
+ var data = _.sortBy(groupByLabel[label], 'date');
25
+ dataList.push({
26
+ name: label,
27
+ data: _.map(data, 'num')
28
+ });
29
+ });
30
+ var xAxis = _.sortBy(_.uniqBy(daySummary, 'date'), 'date').map(function (item) {
31
+ return item.date;
32
+ });
33
+ return /*#__PURE__*/_jsxs(Row, {
34
+ gutter: [16, 16],
35
+ style: {
36
+ height: 360
37
+ },
38
+ children: [/*#__PURE__*/_jsx(Col, {
39
+ span: 12,
40
+ style: {
41
+ height: '100%'
42
+ },
43
+ children: /*#__PURE__*/_jsx(VmWrapper, {
44
+ title: '报警汇总',
45
+ children: /*#__PURE__*/_jsx(VmPieCharts, {
46
+ dataList: typeSummary.map(function (item) {
47
+ return {
48
+ name: item.typeName,
49
+ value: item.num
50
+ };
51
+ }),
52
+ name: '报警类型',
53
+ title: '报警总次数',
54
+ total: _.sum(typeSummary.map(function (item) {
55
+ return item.num;
56
+ })),
57
+ loading: loading,
58
+ unit: '次'
59
+ })
60
+ })
61
+ }), /*#__PURE__*/_jsx(Col, {
62
+ span: 12,
63
+ style: {
64
+ height: '100%'
65
+ },
66
+ children: /*#__PURE__*/_jsx(VmWrapper, {
67
+ title: '报警趋势分析',
68
+ children: /*#__PURE__*/_jsx(VmLineCharts, {
69
+ xAxis: xAxis,
70
+ dataList: dataList,
71
+ unit: "\u6B21",
72
+ loading: loading,
73
+ legendOption: {
74
+ width: '95%'
75
+ },
76
+ gridOption: {
77
+ top: 70
78
+ }
79
+ })
80
+ })
81
+ })]
82
+ });
83
+ };
84
+ export default StaticInfo;
@@ -0,0 +1,71 @@
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, Space } from 'antd';
9
+ import dayjs from 'dayjs';
10
+ import { VmWrapper } from "../../../../_components";
11
+ import { VMRangePicker } from "../../../../_components/vm-filter";
12
+ import useSettings from "../../../../_hooks/useSettings";
13
+ import List from "./List";
14
+ import StaticInfo from "./StaticInfo";
15
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
+ var Hw2AlarmInfo = function Hw2AlarmInfo() {
17
+ var _useSettings = useSettings(),
18
+ sDate = _useSettings.startDate,
19
+ eDate = _useSettings.endDate;
20
+ var _useSetState = useSetState({
21
+ startDate: sDate ? sDate : dayjs().subtract(6, 'day'),
22
+ endDate: eDate ? eDate : dayjs(),
23
+ tabKey: '1',
24
+ value: 'GPS'
25
+ }),
26
+ _useSetState2 = _slicedToArray(_useSetState, 2),
27
+ state = _useSetState2[0],
28
+ setState = _useSetState2[1];
29
+ var handleDateChange = function handleDateChange(start, end) {
30
+ setState({
31
+ startDate: start,
32
+ endDate: end
33
+ });
34
+ };
35
+ var startDate = state.startDate,
36
+ endDate = state.endDate;
37
+ var formatStartDate = dayjs(startDate).format('YYYY-MM-DD');
38
+ var formatEndDate = dayjs(endDate).format('YYYY-MM-DD');
39
+ return /*#__PURE__*/_jsxs(Row, {
40
+ gutter: [16, 16],
41
+ children: [/*#__PURE__*/_jsx(Col, {
42
+ span: 24,
43
+ children: /*#__PURE__*/_jsx(VmWrapper, {
44
+ showTitle: false,
45
+ children: /*#__PURE__*/_jsxs(Space, {
46
+ children: [/*#__PURE__*/_jsx("span", {
47
+ children: "\u7EDF\u8BA1\u8303\u56F4"
48
+ }), /*#__PURE__*/_jsx(VMRangePicker, {
49
+ value: [dayjs(startDate), dayjs(endDate)],
50
+ onChange: function onChange(dates) {
51
+ return dates && handleDateChange(dayjs(dates[0]).format('YYYY-MM-DD'), dayjs(dates[1]).format('YYYY-MM-DD'));
52
+ }
53
+ })]
54
+ })
55
+ })
56
+ }), /*#__PURE__*/_jsx(Col, {
57
+ span: 24,
58
+ children: /*#__PURE__*/_jsx(StaticInfo, {
59
+ startDate: formatStartDate,
60
+ endDate: formatEndDate
61
+ })
62
+ }), /*#__PURE__*/_jsx(Col, {
63
+ span: 24,
64
+ children: /*#__PURE__*/_jsx(List, {
65
+ startDate: formatStartDate,
66
+ endDate: formatEndDate
67
+ })
68
+ })]
69
+ });
70
+ };
71
+ export default Hw2AlarmInfo;
@@ -0,0 +1,223 @@
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 { Col, Row } from 'antd';
8
+ import dayjs from 'dayjs';
9
+ import { useContext, useMemo, useState } from 'react';
10
+ import { VmBarCharts, VmFactor, VmProgress, VmWrapper } from "../../../../_components";
11
+ import useSettings from "../../../../_hooks/useSettings";
12
+ import { secondToFormatTimeArray } from "../../../../_util";
13
+ import { Hw2Service } from "../../../api";
14
+ import Info from "../../../components/Info";
15
+ import { CarContext } from "../../../index";
16
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
17
+ var Hw2BaseInfo = function Hw2BaseInfo() {
18
+ var _useContext = useContext(CarContext),
19
+ id = _useContext.id,
20
+ startDate = _useContext.startDate,
21
+ detail = _useContext.detail;
22
+ var isUnmanned = (detail === null || detail === void 0 ? void 0 : detail.driveMode) === 'unmanned';
23
+ var _useState = useState(dayjs(startDate)),
24
+ _useState2 = _slicedToArray(_useState, 2),
25
+ date = _useState2[0],
26
+ setDate = _useState2[1];
27
+ return /*#__PURE__*/_jsxs(Row, {
28
+ gutter: [16, 16],
29
+ style: {
30
+ height: '100%'
31
+ },
32
+ children: [/*#__PURE__*/_jsx(Info, {}), /*#__PURE__*/_jsx(Col, {
33
+ flex: '1',
34
+ style: {
35
+ minWidth: 0,
36
+ height: '100%'
37
+ },
38
+ children: /*#__PURE__*/_jsxs("div", {
39
+ className: 'vtx-car-info-right-wrap',
40
+ children: [/*#__PURE__*/_jsx("div", {
41
+ style: {
42
+ height: 243
43
+ },
44
+ children: /*#__PURE__*/_jsx(VmWrapper, {
45
+ title: '运行信息',
46
+ filterType: "datePicker",
47
+ dateValue: date,
48
+ filterChange: setDate,
49
+ disabledDate: function disabledDate(current) {
50
+ return current && current > dayjs().endOf('day');
51
+ },
52
+ children: /*#__PURE__*/_jsx(BaseWork, {
53
+ id: id,
54
+ date: date,
55
+ isUnmanned: isUnmanned
56
+ })
57
+ })
58
+ }), /*#__PURE__*/_jsx("div", {
59
+ className: 'vtx-car-info-right-wrap-bottom',
60
+ children: /*#__PURE__*/_jsx(VmWrapper, {
61
+ title: '近7天运行分析',
62
+ children: /*#__PURE__*/_jsx(BaseAnalysis, {
63
+ id: id,
64
+ date: date,
65
+ isUnmanned: isUnmanned
66
+ })
67
+ })
68
+ })]
69
+ })
70
+ })]
71
+ });
72
+ };
73
+
74
+ // 机械化运行信息-默认
75
+ function BaseWork(_ref) {
76
+ var id = _ref.id,
77
+ date = _ref.date,
78
+ isUnmanned = _ref.isUnmanned;
79
+ var _useSettings = useSettings(),
80
+ isDark = _useSettings.isDark;
81
+ var _Hw2Service$useWorkIn = Hw2Service.useWorkInfo(id, dayjs(date).format('YYYY-MM-DD')),
82
+ workInfo = _Hw2Service$useWorkIn.workInfo;
83
+ return /*#__PURE__*/_jsx(Row, {
84
+ gutter: [47, 47],
85
+ align: 'middle',
86
+ style: {
87
+ height: '100%',
88
+ marginLeft: 30
89
+ },
90
+ children: /*#__PURE__*/_jsx(Col, {
91
+ flex: '1',
92
+ children: /*#__PURE__*/_jsxs(Row, {
93
+ gutter: [34, 34],
94
+ children: [/*#__PURE__*/_jsx(Col, {
95
+ flex: '108px',
96
+ children: /*#__PURE__*/_jsx(VmProgress.Circle, {
97
+ rate: (workInfo === null || workInfo === void 0 ? void 0 : workInfo.completeRate) || 0,
98
+ name: '完成率'
99
+ })
100
+ }), /*#__PURE__*/_jsxs(Col, {
101
+ flex: '1',
102
+ children: [/*#__PURE__*/_jsx(VmFactor, {
103
+ name: '排班里程',
104
+ unit: 'km',
105
+ type: 'sm',
106
+ value: (workInfo === null || workInfo === void 0 ? void 0 : workInfo.planMileage) || 0,
107
+ fontType: 'blue',
108
+ img: isDark ? require("../../../imgs/calendar/dark_mileage.png") : require("../../../imgs/calendar/blue_mileage.png")
109
+ }), /*#__PURE__*/_jsx(VmFactor, {
110
+ name: '作业里程',
111
+ unit: 'km',
112
+ type: 'sm',
113
+ fontType: 'green',
114
+ value: (workInfo === null || workInfo === void 0 ? void 0 : workInfo.workMileage) || 0,
115
+ img: isDark ? require("../../../imgs/calendar/dark_green_mileage.png") : require("../../../imgs/calendar/green_mileage.png")
116
+ })]
117
+ }), /*#__PURE__*/_jsxs(Col, {
118
+ flex: '1',
119
+ children: [/*#__PURE__*/_jsx(VmFactor, {
120
+ name: '行驶时长',
121
+ type: 'sm',
122
+ value: secondToFormatTimeArray(((workInfo === null || workInfo === void 0 ? void 0 : workInfo.driveDuration) || 0) / 1000),
123
+ fontType: 'blue',
124
+ img: isDark ? require("../../../imgs/clock_dark.png") : require("../../../imgs/clock.png")
125
+ }), /*#__PURE__*/_jsx(VmFactor, {
126
+ name: '作业时长',
127
+ type: 'sm',
128
+ value: secondToFormatTimeArray(((workInfo === null || workInfo === void 0 ? void 0 : workInfo.workDuration) || 0) / 1000),
129
+ fontType: 'green',
130
+ img: isDark ? require("../../../imgs/clock_green_dark.png") : require("../../../imgs/clock_green.png")
131
+ })]
132
+ }), isUnmanned && /*#__PURE__*/_jsxs(Col, {
133
+ flex: '1',
134
+ children: [/*#__PURE__*/_jsx(VmFactor, {
135
+ name: '总电耗',
136
+ unit: 'kwh',
137
+ type: 'sm',
138
+ value: (workInfo === null || workInfo === void 0 ? void 0 : workInfo.electricity) || 0,
139
+ fontType: 'yellow',
140
+ img: isDark ? require("../../../imgs/butter_dark.png") : require("../../../imgs/butter.png")
141
+ }), /*#__PURE__*/_jsx(VmFactor, {
142
+ name: '总水耗',
143
+ unit: 'L',
144
+ type: 'sm',
145
+ fontType: 'green',
146
+ value: (workInfo === null || workInfo === void 0 ? void 0 : workInfo.water) || 0,
147
+ img: isDark ? require("../../../imgs/water_dark.png") : require("../../../imgs/water.png")
148
+ })]
149
+ })]
150
+ })
151
+ })
152
+ });
153
+ }
154
+
155
+ // 机械化近7天运行分析-默认
156
+ function BaseAnalysis(_ref2) {
157
+ var id = _ref2.id,
158
+ date = _ref2.date,
159
+ isUnmanned = _ref2.isUnmanned;
160
+ var _Hw2Service$useWorkCa = Hw2Service.useWorkCalendar(id, dayjs(date).subtract(6, 'day').format('YYYY-MM-DD'), dayjs(date).format('YYYY-MM-DD')),
161
+ workCalendar = _Hw2Service$useWorkCa.workCalendar,
162
+ loadingJxh = _Hw2Service$useWorkCa.loading;
163
+ var _useMemo = useMemo(function () {
164
+ var xAxis = [];
165
+ var planMileageList = [];
166
+ var workMileageList = [];
167
+ var completeRateList = [];
168
+ var electricityList = [];
169
+ workCalendar.forEach(function (item) {
170
+ var date = item.date,
171
+ planMileage = item.planMileage,
172
+ workMileage = item.workMileage,
173
+ completeRate = item.completeRate,
174
+ electricity = item.electricity;
175
+ xAxis.push(date);
176
+ planMileageList.push("\u2000".concat(planMileage));
177
+ workMileageList.push("\u2000".concat(workMileage));
178
+ completeRateList.push(completeRate);
179
+ electricityList.push(electricity);
180
+ });
181
+ return {
182
+ xAxis: xAxis,
183
+ planMileageList: planMileageList,
184
+ workMileageList: workMileageList,
185
+ completeRateList: completeRateList,
186
+ electricityList: electricityList
187
+ };
188
+ }, [workCalendar]),
189
+ xAxis = _useMemo.xAxis,
190
+ planMileageList = _useMemo.planMileageList,
191
+ workMileageList = _useMemo.workMileageList,
192
+ completeRateList = _useMemo.completeRateList,
193
+ electricityList = _useMemo.electricityList;
194
+ return /*#__PURE__*/_jsx(VmBarCharts, {
195
+ dataList: [{
196
+ name: '排班里程',
197
+ data: planMileageList
198
+ }, {
199
+ name: '作业里程',
200
+ data: workMileageList,
201
+ color: 'green'
202
+ }],
203
+ xAxis: xAxis,
204
+ unit: '%',
205
+ yAxisList: [{
206
+ key: "\u2000",
207
+ unit: 'km',
208
+ name: '(km)'
209
+ }, {
210
+ key: '',
211
+ unit: isUnmanned ? 'kwh' : '%',
212
+ name: isUnmanned ? '(kwh)' : '(%)'
213
+ }],
214
+ lineList: [{
215
+ name: isUnmanned ? '总电耗' : '完成率',
216
+ data: isUnmanned ? electricityList : completeRateList,
217
+ yAxisIndex: 1,
218
+ color: isUnmanned ? '#FFAB0C' : ''
219
+ }],
220
+ loading: loadingJxh
221
+ });
222
+ }
223
+ export default Hw2BaseInfo;