@vtx/modals2 6.0.0-beta.1 → 6.0.0-beta.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.
Files changed (152) hide show
  1. package/lib/_components/index.js +1 -0
  2. package/lib/_components/vm-appraisal-info/api.js +55 -0
  3. package/lib/_components/vm-appraisal-info/imgs/count.png +0 -0
  4. package/lib/_components/vm-appraisal-info/imgs/count_light.png +0 -0
  5. package/lib/_components/vm-appraisal-info/imgs/subtract.png +0 -0
  6. package/lib/_components/vm-appraisal-info/imgs/subtract_light.png +0 -0
  7. package/lib/_components/vm-appraisal-info/index.js +230 -0
  8. package/lib/_components/vm-appraisal-info/index.less +7 -0
  9. package/lib/_components/vm-bar-charts/index.js +1 -1
  10. package/lib/_components/vm-calendar/index.js +3 -4
  11. package/lib/_components/vm-card-statistics/index.less +27 -27
  12. package/lib/_components/vm-factor/index.js +2 -1
  13. package/lib/_components/vm-factor-list/index.less +11 -11
  14. package/lib/_components/vm-filter/index.js +8 -8
  15. package/lib/_components/vm-filter/style/index.less +7 -11
  16. package/lib/_components/vm-info-collection/index.js +3 -2
  17. package/lib/_components/vm-line-charts/index.js +4 -1
  18. package/lib/_components/vm-progress/index.js +2 -1
  19. package/lib/_components/vm-repair-maintain/index.js +34 -2
  20. package/lib/_components/vm-table/index.js +3 -3
  21. package/lib/_components/vm-tag/index.js +2 -1
  22. package/lib/_components/vm-title/index.js +2 -1
  23. package/lib/_components/vm-video/HistoryGrid.js +53 -3
  24. package/lib/_components/vm-video/RealtimeGrid.js +24 -3
  25. package/lib/_components/vm-video/index.js +99 -37
  26. package/lib/_components/vm-video/index.less +6 -2
  27. package/lib/_components/vm-wrapper/index.js +1 -1
  28. package/lib/_components/vm-wrapper/style/index.less +4 -2
  29. package/lib/_hooks/useGetChannels.js +20 -6
  30. package/lib/_service/index.js +7 -33
  31. package/lib/_util/http.js +32 -5
  32. package/lib/_util/index.js +6 -5
  33. package/lib/locales/en.json +140 -1
  34. package/lib/locales/zh-CN.json +142 -3
  35. package/lib/vtx-base-modal/Tabs/index.js +2 -1
  36. package/lib/vtx-base-modal/index.js +2 -1
  37. package/lib/vtx-car-modal/api.js +415 -25
  38. package/lib/vtx-car-modal/components/Info/index.js +1 -1
  39. package/lib/vtx-car-modal/components/Info/index.less +6 -6
  40. package/lib/vtx-car-modal/content/Common/EleUse/index.js +218 -0
  41. package/lib/vtx-car-modal/content/Common/EleUse/index.less +19 -0
  42. package/lib/vtx-car-modal/content/Common/OilConsumption/index.less +6 -6
  43. package/lib/vtx-car-modal/content/Common/OilUse/index.js +230 -0
  44. package/lib/vtx-car-modal/content/Common/OilUse/index.less +19 -0
  45. package/lib/vtx-car-modal/content/Common/OperationAnalysis/index.js +376 -0
  46. package/lib/vtx-car-modal/content/Common/OperationAnalysis/index.less +169 -0
  47. package/lib/vtx-car-modal/content/Common/WaterConsumption/index.less +6 -6
  48. package/lib/vtx-car-modal/content/Common/WaterUse/index.js +201 -0
  49. package/lib/vtx-car-modal/content/Common/WaterUse/index.less +19 -0
  50. package/lib/vtx-car-modal/content/Common/index.js +9 -1
  51. package/lib/vtx-car-modal/content/Ljsy/WorkRecord/Detail.js +2 -1
  52. package/lib/vtx-car-modal/imgs/czb_bg.png +0 -0
  53. package/lib/vtx-car-modal/imgs/czb_bg_dark.png +0 -0
  54. package/lib/vtx-car-modal/imgs/factor/bglyh.png +0 -0
  55. package/lib/vtx-car-modal/imgs/factor/bglyh_dark.png +0 -0
  56. package/lib/vtx-car-modal/imgs/factor/cdcs.png +0 -0
  57. package/lib/vtx-car-modal/imgs/factor/cdcs_dark.png +0 -0
  58. package/lib/vtx-car-modal/imgs/factor/cdje.png +0 -0
  59. package/lib/vtx-car-modal/imgs/factor/cdje_dark.png +0 -0
  60. package/lib/vtx-car-modal/imgs/factor/cdpc.png +0 -0
  61. package/lib/vtx-car-modal/imgs/factor/cdpc_dark.png +0 -0
  62. package/lib/vtx-car-modal/imgs/factor/dccdje.png +0 -0
  63. package/lib/vtx-car-modal/imgs/factor/dccdje_dark.png +0 -0
  64. package/lib/vtx-car-modal/imgs/factor/jscs.png +0 -0
  65. package/lib/vtx-car-modal/imgs/factor/jscs_dark.png +0 -0
  66. package/lib/vtx-car-modal/imgs/factor/jsje.png +0 -0
  67. package/lib/vtx-car-modal/imgs/factor/jsje_dark.png +0 -0
  68. package/lib/vtx-car-modal/imgs/factor/jsl.png +0 -0
  69. package/lib/vtx-car-modal/imgs/factor/jsl_dark.png +0 -0
  70. package/lib/vtx-car-modal/imgs/factor/jspc.png +0 -0
  71. package/lib/vtx-car-modal/imgs/factor/jspc_dark.png +0 -0
  72. package/lib/vtx-car-modal/imgs/factor/jycs.png +0 -0
  73. package/lib/vtx-car-modal/imgs/factor/jycs_dark.png +0 -0
  74. package/lib/vtx-car-modal/imgs/factor/jyje.png +0 -0
  75. package/lib/vtx-car-modal/imgs/factor/jyje_dark.png +0 -0
  76. package/lib/vtx-car-modal/imgs/factor/jyl.png +0 -0
  77. package/lib/vtx-car-modal/imgs/factor/jyl_dark.png +0 -0
  78. package/lib/vtx-car-modal/imgs/factor/ljwbcs.png +0 -0
  79. package/lib/vtx-car-modal/imgs/factor/ljwbcs_dark.png +0 -0
  80. package/lib/vtx-car-modal/imgs/factor/njzfy.png +0 -0
  81. package/lib/vtx-car-modal/imgs/factor/njzfy_dark.png +0 -0
  82. package/lib/vtx-car-modal/imgs/factor/qzxze.png +0 -0
  83. package/lib/vtx-car-modal/imgs/factor/qzxze_dark.png +0 -0
  84. package/lib/vtx-car-modal/imgs/factor/sgcs.png +0 -0
  85. package/lib/vtx-car-modal/imgs/factor/sgcs_dark.png +0 -0
  86. package/lib/vtx-car-modal/imgs/factor/sgfy.png +0 -0
  87. package/lib/vtx-car-modal/imgs/factor/sgfy_dark.png +0 -0
  88. package/lib/vtx-car-modal/imgs/factor/syxze.png +0 -0
  89. package/lib/vtx-car-modal/imgs/factor/syxze_dark.png +0 -0
  90. package/lib/vtx-car-modal/imgs/factor/wbzfy.png +0 -0
  91. package/lib/vtx-car-modal/imgs/factor/wbzfy_dark.png +0 -0
  92. package/lib/vtx-car-modal/imgs/factor/wzcs.png +0 -0
  93. package/lib/vtx-car-modal/imgs/factor/wzcs_dark.png +0 -0
  94. package/lib/vtx-car-modal/imgs/factor/wzkf.png +0 -0
  95. package/lib/vtx-car-modal/imgs/factor/wzkf_dark.png +0 -0
  96. package/lib/vtx-car-modal/imgs/factor/wzkfee.png +0 -0
  97. package/lib/vtx-car-modal/imgs/factor/wzkfee_dark.png +0 -0
  98. package/lib/vtx-car-modal/imgs/factor/xslc.png +0 -0
  99. package/lib/vtx-car-modal/imgs/factor/xslc_dark.png +0 -0
  100. package/lib/vtx-car-modal/imgs/factor/ydcb.png +0 -0
  101. package/lib/vtx-car-modal/imgs/factor/ydcb_dark.png +0 -0
  102. package/lib/vtx-car-modal/imgs/factor/yhcb.png +0 -0
  103. package/lib/vtx-car-modal/imgs/factor/yhcb_dark.png +0 -0
  104. package/lib/vtx-car-modal/imgs/factor/yscb.png +0 -0
  105. package/lib/vtx-car-modal/imgs/factor/yscb_dark.png +0 -0
  106. package/lib/vtx-car-modal/imgs/zjl.png +0 -0
  107. package/lib/vtx-car-modal/imgs/zjl_dark.png +0 -0
  108. package/lib/vtx-car-modal/index.js +31 -9
  109. package/lib/vtx-cc-cp-modal/components/Calendar/index.js +3 -3
  110. package/lib/vtx-cc-unit-modal/components/BaseInfo/index.less +6 -6
  111. package/lib/vtx-cp-modal/components/BaseInfo/CarWork.js +2 -5
  112. package/lib/vtx-cp-modal/components/BaseInfo/TodayWork.js +7 -1
  113. package/lib/vtx-cp-modal/components/ExeceptionInfo/AlarmRecord.js +8 -4
  114. package/lib/vtx-cp-modal/components/SyInfo/Ljcsl.js +2 -2
  115. package/lib/vtx-cp-modal/index.js +12 -12
  116. package/lib/vtx-default-modal/index.js +7 -6
  117. package/lib/vtx-device-modal/components/DataAnalysis/index.less +66 -66
  118. package/lib/vtx-df-modal/components/BaseInfo/Jczbqs.js +2 -2
  119. package/lib/vtx-df-modal/components/BaseInfoZdReborn/Jczbqs.js +2 -2
  120. package/lib/vtx-df-modal/components/WorkCondition/Table.js +2 -2
  121. package/lib/vtx-df-modal/index.js +7 -15
  122. package/lib/vtx-kh-modal/components/Record/index.js +1 -205
  123. package/lib/vtx-restaurant-modal/components/Basic/index.less +16 -16
  124. package/lib/vtx-restaurant-modal/components/Calendar/index.js +3 -3
  125. package/lib/vtx-restaurant-modal/components/SignAndContract/ContactDetail.js +50 -33
  126. package/lib/vtx-restaurant-modal/components/SignAndContract/index.js +3 -3
  127. package/lib/vtx-road-modal/components/BaseInfo/Work.js +9 -1
  128. package/lib/vtx-road-modal/components/LaneBaseInfo/Work.js +8 -1
  129. package/lib/vtx-road-modal/components/LaneCalendar/index.js +3 -0
  130. package/lib/vtx-road-modal/index.js +6 -3
  131. package/lib/vtx-road-modal/utils/url.js +12 -0
  132. package/lib/vtx-shxq-modal/api.js +2 -2
  133. package/lib/vtx-shxq-modal/components/ThrowCalendar/List.js +2 -2
  134. package/lib/vtx-shxq-modal/index.js +21 -4
  135. package/lib/vtx-staff-modal/components/AlarmInfo/Charts.js +4 -1
  136. package/lib/vtx-tfd-modal/components/BaseInfo/Jczbqs.js +2 -2
  137. package/lib/vtx-wr-modal/index.js +28 -7
  138. package/lib/vtx-zf-modal/components/CkEditorCustom/view.js +4 -1
  139. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/editableDiv/FormView.js +5 -4
  140. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/editableDiv/index.js +10 -5
  141. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/input/FormView.js +7 -6
  142. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/input/date.js +10 -5
  143. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/input/index.js +10 -5
  144. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/radio/FormView.js +6 -5
  145. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/radio/checkbox.js +10 -5
  146. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/radio/index.js +10 -5
  147. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/sign/FormView.js +7 -6
  148. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/sign/index.js +12 -7
  149. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/textarea/FormView.js +6 -5
  150. package/lib/vtx-zf-modal/components/CkEditorCustom/widgets/textarea/index.js +10 -5
  151. package/lib/vtx-zzz-modal/index.js +30 -24
  152. package/package.json +92 -92
@@ -0,0 +1,218 @@
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 dayjs from 'dayjs';
15
+ import { useContext } from 'react';
16
+ import { VmBarCharts, VmFactor, VmTable, VmWrapper } from "../../../../_components";
17
+ import useSettings from "../../../../_hooks/useSettings";
18
+ import { MaintenanceService } from "../../../api";
19
+ import { CarContext } from "../../../index";
20
+ import "./index.less";
21
+ import { translateLocaleText } from "./../../../../hooks/useTranslation.js";
22
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
23
+ var WaterUse = function WaterUse() {
24
+ var _useSettings = useSettings(),
25
+ isDark = _useSettings.isDark,
26
+ chartFontColor = _useSettings.chartFontColor;
27
+ var _useContext = useContext(CarContext),
28
+ id = _useContext.id,
29
+ sDate = _useContext.startDate,
30
+ eDate = _useContext.endDate;
31
+ var _useSetState = useSetState({
32
+ startDate: sDate ? sDate : dayjs().subtract(6, 'day'),
33
+ endDate: eDate ? eDate : dayjs(),
34
+ sorter: 'chargeTime,ASC'
35
+ }),
36
+ _useSetState2 = _slicedToArray(_useSetState, 2),
37
+ state = _useSetState2[0],
38
+ setState = _useSetState2[1];
39
+ var startDate = dayjs(state.startDate).format('YYYY-MM-DD');
40
+ var endDate = dayjs(state.endDate).format('YYYY-MM-DD');
41
+ var filterChange = function filterChange(dateValue) {
42
+ setState({
43
+ startDate: dateValue[0],
44
+ endDate: dateValue[1]
45
+ });
46
+ };
47
+ var _MaintenanceService$u = MaintenanceService.useEleSummary(id, startDate, endDate),
48
+ eleSummary = _MaintenanceService$u.eleSummary;
49
+ var _MaintenanceService$u2 = MaintenanceService.useEleRecord(id, "".concat(startDate, " 00:00:00"), "".concat(endDate, " 23:59:59"), state.sorter),
50
+ recordRes = _MaintenanceService$u2.recordRes,
51
+ loading = _MaintenanceService$u2.loading;
52
+ var _MaintenanceService$u3 = MaintenanceService.useEleTypeSummary(id, startDate, endDate),
53
+ eleTypeSummary = _MaintenanceService$u3.eleTypeSummary,
54
+ loadingType = _MaintenanceService$u3.loading;
55
+ var columns = [{
56
+ title: translateLocaleText("t('vtxcarmodal.chargeTime')"),
57
+ dataIndex: 'chargeTime',
58
+ key: 'chargeTime',
59
+ sorter: true,
60
+ width: '30%'
61
+ }, {
62
+ title: translateLocaleText("t('vtxcarmodal.chargeLocation')"),
63
+ dataIndex: 'chargeAddress',
64
+ key: 'chargeAddress',
65
+ width: '30%',
66
+ render: function render(text) {
67
+ return /*#__PURE__*/_jsx("div", {
68
+ children: text || '--'
69
+ });
70
+ }
71
+ }, {
72
+ title: translateLocaleText("t('vtxcarmodal.chargeMoneyYuan')"),
73
+ dataIndex: 'chargeMoney',
74
+ key: 'chargeMoney',
75
+ width: '30%',
76
+ align: 'right'
77
+ }];
78
+ var handleTableChange = function handleTableChange(sorter) {
79
+ setState({
80
+ sorter: "".concat(sorter.columnKey || 'waterTime', ",").concat(sorter.order === 'ascend' ? 'ASC' : 'DESC')
81
+ });
82
+ };
83
+ var tableProps = {
84
+ pagination: {
85
+ total: (recordRes === null || recordRes === void 0 ? void 0 : recordRes.total) || 0,
86
+ defaultPageSize: 10
87
+ },
88
+ height: 360,
89
+ dataSource: (recordRes === null || recordRes === void 0 ? void 0 : recordRes.rows) || [],
90
+ loading: loading,
91
+ handleTableChange: handleTableChange
92
+ };
93
+ return /*#__PURE__*/_jsxs("div", {
94
+ className: 'vtx-car-water-use-wrap',
95
+ children: [/*#__PURE__*/_jsx(VmWrapper, {
96
+ title: translateLocaleText("t('vtxcarmodal.statisticalScope')"),
97
+ filterType: "rangePicker",
98
+ dateValue: [state.startDate, state.endDate],
99
+ filterChange: filterChange,
100
+ showContent: false,
101
+ style: {
102
+ height: 50
103
+ },
104
+ headerStyle: {
105
+ borderBottom: 'none'
106
+ },
107
+ extraStyle: {
108
+ left: 100,
109
+ right: 'unset'
110
+ }
111
+ }), /*#__PURE__*/_jsxs("div", {
112
+ className: "vtx-car-water-use-summary",
113
+ children: [/*#__PURE__*/_jsx(VmWrapper, {
114
+ title: translateLocaleText("t('vtxcarmodal.chargeSummary')"),
115
+ children: /*#__PURE__*/_jsx("div", {
116
+ className: "vtx-car-water-use-row",
117
+ children: [{
118
+ name: translateLocaleText("t('vtxcarmodal.chargeCount')"),
119
+ unit: translateLocaleText("t('common.unit.times')"),
120
+ value: (eleSummary === null || eleSummary === void 0 ? void 0 : eleSummary.chargeCount) || 0,
121
+ icon: 'cdcs'
122
+ }, {
123
+ name: translateLocaleText("t('vtxcarmodal.chargeMoney')"),
124
+ unit: translateLocaleText("t('common.unit.yuan')"),
125
+ value: (eleSummary === null || eleSummary === void 0 ? void 0 : eleSummary.chargeMoney) || 0,
126
+ icon: 'cdje'
127
+ }, {
128
+ name: translateLocaleText("t('vtxcarmodal.singleChargeMoney')"),
129
+ unit: translateLocaleText("t('common.unit.yuanPerTimes')"),
130
+ value: (eleSummary === null || eleSummary === void 0 ? void 0 : eleSummary.singleChargeMoney) || 0,
131
+ icon: 'dccdje'
132
+ }, {
133
+ name: translateLocaleText("t('vtxcarmodal.chargeFrequency')"),
134
+ unit: translateLocaleText("t('common.unit.dayPerTimes')"),
135
+ value: (eleSummary === null || eleSummary === void 0 ? void 0 : eleSummary.chargeFrequency) || 0,
136
+ icon: 'cdpc'
137
+ }, {
138
+ name: translateLocaleText("t('vtxcarmodal.day2')"),
139
+ unit: 'km',
140
+ value: (eleSummary === null || eleSummary === void 0 ? void 0 : eleSummary.distance) || 0,
141
+ icon: 'xslc'
142
+ }, {
143
+ name: translateLocaleText("t('vtxcarmodal.electricCost')"),
144
+ unit: translateLocaleText("t('common.unit.yuanPerKm')"),
145
+ value: (eleSummary === null || eleSummary === void 0 ? void 0 : eleSummary.electricCost) || 0,
146
+ icon: 'ydcb'
147
+ }].map(function (ele) {
148
+ return /*#__PURE__*/_jsx(VmFactor, {
149
+ name: translateLocaleText(ele.name),
150
+ unit: ele.unit,
151
+ value: ele.value,
152
+ img: require("../../../imgs/factor/".concat(ele.icon).concat(isDark ? '_dark' : '', ".png"))
153
+ }, ele.name);
154
+ })
155
+ })
156
+ }), /*#__PURE__*/_jsx(VmWrapper, {
157
+ title: translateLocaleText("t('vtxcarmodal.chargeTimePreferenceAnalysis')"),
158
+ children: /*#__PURE__*/_jsx(VmBarCharts, {
159
+ name: translateLocaleText("t('vtxcarmodal.chargeTimePreferenceAnalysis')"),
160
+ unit: translateLocaleText("t('common.unit.times')"),
161
+ loading: loadingType,
162
+ dataList: [{
163
+ name: translateLocaleText("t('vtxcarmodal.chargeCount')"),
164
+ data: _.map(eleTypeSummary, 'value'),
165
+ color: 'geekblue'
166
+ }],
167
+ yAxisList: [{
168
+ key: '',
169
+ unit: translateLocaleText("t('common.unit.times')"),
170
+ name: ''
171
+ }],
172
+ otherProps: {
173
+ xAxis: {
174
+ type: 'value',
175
+ unit: translateLocaleText("t('common.unit.times')"),
176
+ name: translateLocaleText("t('common.unit.times')"),
177
+ axisLabel: {
178
+ color: chartFontColor
179
+ }
180
+ },
181
+ yAxis: {
182
+ type: 'category',
183
+ data: _.map(eleTypeSummary, 'name'),
184
+ axisLabel: {
185
+ color: chartFontColor
186
+ }
187
+ },
188
+ grid: {
189
+ left: '5%',
190
+ right: '5%',
191
+ bottom: '5%',
192
+ top: '5%',
193
+ containLabel: true
194
+ }
195
+ }
196
+ })
197
+ })]
198
+ }), /*#__PURE__*/_jsx("div", {
199
+ style: {
200
+ flex: 1,
201
+ minHeight: 0
202
+ },
203
+ children: /*#__PURE__*/_jsx(VmWrapper, {
204
+ title: translateLocaleText("t('vtxcarmodal.chargeDetail')"),
205
+ children: /*#__PURE__*/_jsx("div", {
206
+ style: {
207
+ height: '360px'
208
+ },
209
+ children: /*#__PURE__*/_jsx(VmTable, _objectSpread({
210
+ columns: columns,
211
+ rowKey: "id"
212
+ }, tableProps))
213
+ })
214
+ })
215
+ })]
216
+ });
217
+ };
218
+ export default WaterUse;
@@ -0,0 +1,19 @@
1
+ .vtx-car-water-use-wrap {
2
+ height: 100%;
3
+ display: flex;
4
+ gap: 16px;
5
+ flex-direction: column;
6
+
7
+ .vtx-car-water-use-summary {
8
+ height: 240px;
9
+ display: flex;
10
+ gap: 16px;
11
+ flex-shrink: 0;
12
+ }
13
+
14
+ .vtx-car-water-use-row {
15
+ display: grid;
16
+ grid-template-columns: repeat(3, 1fr);
17
+ gap: 40px 0;
18
+ }
19
+ }
@@ -1,6 +1,6 @@
1
- .vtx-car-oil-wrap {
2
- height: 100%;
3
- display: flex;
4
- gap: 16px;
5
- flex-direction: column;
6
- }
1
+ .vtx-car-oil-wrap {
2
+ height: 100%;
3
+ display: flex;
4
+ gap: 16px;
5
+ flex-direction: column;
6
+ }
@@ -0,0 +1,230 @@
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 dayjs from 'dayjs';
15
+ import { useContext } from 'react';
16
+ import { VmBarCharts, VmFactor, VmTable, VmWrapper } from "../../../../_components";
17
+ import useSettings from "../../../../_hooks/useSettings";
18
+ import { MaintenanceService } from "../../../api";
19
+ import { CarContext } from "../../../index";
20
+ import "./index.less";
21
+ import { translateLocaleText } from "../../../../hooks/useTranslation";
22
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
23
+ var OilUse = function OilUse() {
24
+ var _useSettings = useSettings(),
25
+ chartFontColor = _useSettings.chartFontColor,
26
+ isDark = _useSettings.isDark;
27
+ var _useContext = useContext(CarContext),
28
+ id = _useContext.id,
29
+ sDate = _useContext.startDate,
30
+ eDate = _useContext.endDate;
31
+ var _useSetState = useSetState({
32
+ startDate: sDate ? sDate : dayjs().subtract(6, 'day'),
33
+ endDate: eDate ? eDate : dayjs(),
34
+ sorter: 'oilTime,ASC'
35
+ }),
36
+ _useSetState2 = _slicedToArray(_useSetState, 2),
37
+ state = _useSetState2[0],
38
+ setState = _useSetState2[1];
39
+ var startDate = dayjs(state.startDate).format('YYYY-MM-DD');
40
+ var endDate = dayjs(state.endDate).format('YYYY-MM-DD');
41
+ var filterChange = function filterChange(dateValue) {
42
+ setState({
43
+ startDate: dateValue[0],
44
+ endDate: dateValue[1]
45
+ });
46
+ };
47
+ var _MaintenanceService$u = MaintenanceService.useOilSummary(id, startDate, endDate),
48
+ oilUseSummary = _MaintenanceService$u.oilUseSummary;
49
+ var _MaintenanceService$u2 = MaintenanceService.useOilRecord(id, "".concat(startDate, " 00:00:00"), "".concat(endDate, " 23:59:59"), state.sorter),
50
+ recordRes = _MaintenanceService$u2.recordRes,
51
+ loading = _MaintenanceService$u2.loading;
52
+ var _MaintenanceService$u3 = MaintenanceService.useOilTypeSummary(id, startDate, endDate),
53
+ oilUseTypeSummary = _MaintenanceService$u3.oilUseTypeSummary,
54
+ loadingType = _MaintenanceService$u3.loading;
55
+ var columns = [{
56
+ title: translateLocaleText("t('vtxcarmodal.oilRefuelTime')"),
57
+ dataIndex: 'oilTime',
58
+ key: 'oilTime',
59
+ sorter: true,
60
+ width: '15%'
61
+ }, {
62
+ title: translateLocaleText("t('vtxcarmodal.oilRefuelPoint')"),
63
+ dataIndex: 'oilPoint',
64
+ key: 'oilPoint',
65
+ width: '15%'
66
+ }, {
67
+ title: translateLocaleText("t('vtxcarmodal.oilProduct')"),
68
+ dataIndex: 'oilType',
69
+ key: 'oilType',
70
+ width: '15%'
71
+ }, {
72
+ title: translateLocaleText("t('vtxcarmodal.oilRefuelAmountL')"),
73
+ dataIndex: 'oilCount',
74
+ key: 'oilCount',
75
+ align: 'right',
76
+ width: '15%'
77
+ }, {
78
+ title: translateLocaleText("t('vtxcarmodal.totalPriceYuan')"),
79
+ dataIndex: 'totalPrice',
80
+ key: 'totalPrice',
81
+ align: 'right',
82
+ width: '15%'
83
+ }, {
84
+ title: translateLocaleText("t('vtxcarmodal.mileageKm')"),
85
+ dataIndex: 'mileage',
86
+ key: 'mileage',
87
+ align: 'right',
88
+ width: '15%'
89
+ }];
90
+ var handleTableChange = function handleTableChange(sorter) {
91
+ setState({
92
+ sorter: "".concat(sorter.columnKey || 'oilTime', ",").concat(sorter.order === 'ascend' ? 'ASC' : 'DESC')
93
+ });
94
+ };
95
+ var tableProps = {
96
+ pagination: {
97
+ total: (recordRes === null || recordRes === void 0 ? void 0 : recordRes.total) || 0,
98
+ defaultPageSize: 10
99
+ },
100
+ height: 360,
101
+ dataSource: (recordRes === null || recordRes === void 0 ? void 0 : recordRes.rows) || [],
102
+ loading: loading,
103
+ handleTableChange: handleTableChange
104
+ };
105
+ return /*#__PURE__*/_jsxs("div", {
106
+ className: 'vtx-car-water-use-wrap',
107
+ children: [/*#__PURE__*/_jsx(VmWrapper, {
108
+ title: translateLocaleText("t('vtxcarmodal.statisticalScope')"),
109
+ filterType: "rangePicker",
110
+ dateValue: [state.startDate, state.endDate],
111
+ filterChange: filterChange,
112
+ showContent: false,
113
+ style: {
114
+ height: 50
115
+ },
116
+ headerStyle: {
117
+ borderBottom: 'none'
118
+ },
119
+ extraStyle: {
120
+ left: 100,
121
+ right: 'unset'
122
+ }
123
+ }), /*#__PURE__*/_jsxs("div", {
124
+ className: "vtx-car-water-use-summary",
125
+ children: [/*#__PURE__*/_jsx(VmWrapper, {
126
+ title: translateLocaleText("t('vtxcarmodal.oilRefuelSummary')"),
127
+ children: /*#__PURE__*/_jsx("div", {
128
+ className: "vtx-car-water-use-row",
129
+ children: [{
130
+ name: translateLocaleText("t('vtxcarmodal.oilRefuelCount')"),
131
+ unit: translateLocaleText("t('common.unit.times')"),
132
+ value: (oilUseSummary === null || oilUseSummary === void 0 ? void 0 : oilUseSummary.oilCount) || 0,
133
+ icon: 'jycs'
134
+ }, {
135
+ name: translateLocaleText("t('vtxcarmodal.oilRefuelAmount')"),
136
+ unit: 'L',
137
+ value: (oilUseSummary === null || oilUseSummary === void 0 ? void 0 : oilUseSummary.oilAmount) || 0,
138
+ icon: 'jyl'
139
+ }, {
140
+ name: translateLocaleText("t('vtxcarmodal.oilRefuelMoney')"),
141
+ unit: translateLocaleText("t('common.unit.yuan')"),
142
+ value: (oilUseSummary === null || oilUseSummary === void 0 ? void 0 : oilUseSummary.oilMoney) || 0,
143
+ icon: 'jyje'
144
+ }, {
145
+ name: translateLocaleText("t('vtxcarmodal.day2')"),
146
+ unit: 'km',
147
+ value: (oilUseSummary === null || oilUseSummary === void 0 ? void 0 : oilUseSummary.distance) || 0,
148
+ icon: 'xslc'
149
+ }, {
150
+ name: translateLocaleText("t('vtxcarmodal.fuelConsumptionPer100Km')"),
151
+ unit: 'L',
152
+ value: (oilUseSummary === null || oilUseSummary === void 0 ? void 0 : oilUseSummary.averageOilUse) || 0,
153
+ icon: 'bglyh'
154
+ }, {
155
+ name: translateLocaleText("t('vtxcarmodal.oilCost')"),
156
+ unit: translateLocaleText("t('common.unit.yuanPerKm')"),
157
+ value: (oilUseSummary === null || oilUseSummary === void 0 ? void 0 : oilUseSummary.oilCost) || 0,
158
+ icon: 'yhcb'
159
+ }].map(function (ele) {
160
+ return /*#__PURE__*/_jsx(VmFactor, {
161
+ name: translateLocaleText(ele.name),
162
+ unit: ele.unit,
163
+ value: ele.value,
164
+ img: require("../../../imgs/factor/".concat(ele.icon).concat(isDark ? '_dark' : '', ".png"))
165
+ }, ele.name);
166
+ })
167
+ })
168
+ }), /*#__PURE__*/_jsx(VmWrapper, {
169
+ title: translateLocaleText("t('vtxcarmodal.oilRefuelTimePreferenceAnalysis')"),
170
+ children: /*#__PURE__*/_jsx(VmBarCharts, {
171
+ name: translateLocaleText("t('vtxcarmodal.oilRefuelTimePreferenceAnalysis')"),
172
+ unit: translateLocaleText("t('common.unit.times')"),
173
+ loading: loadingType,
174
+ dataList: [{
175
+ name: translateLocaleText("t('vtxcarmodal.oilRefuelCount')"),
176
+ data: _.map(oilUseTypeSummary, 'value'),
177
+ color: 'geekblue'
178
+ }],
179
+ yAxisList: [{
180
+ key: '',
181
+ unit: translateLocaleText("t('common.unit.times')"),
182
+ name: ''
183
+ }],
184
+ otherProps: {
185
+ xAxis: {
186
+ type: 'value',
187
+ unit: translateLocaleText("t('common.unit.times')"),
188
+ name: translateLocaleText("t('common.unit.times')"),
189
+ axisLabel: {
190
+ color: chartFontColor
191
+ }
192
+ },
193
+ yAxis: {
194
+ type: 'category',
195
+ data: _.map(oilUseTypeSummary, 'name'),
196
+ axisLabel: {
197
+ color: chartFontColor
198
+ }
199
+ },
200
+ grid: {
201
+ left: '5%',
202
+ right: '5%',
203
+ bottom: '5%',
204
+ top: '5%',
205
+ containLabel: true
206
+ }
207
+ }
208
+ })
209
+ })]
210
+ }), /*#__PURE__*/_jsx("div", {
211
+ style: {
212
+ flex: 1,
213
+ minHeight: 0
214
+ },
215
+ children: /*#__PURE__*/_jsx(VmWrapper, {
216
+ title: translateLocaleText("t('vtxcarmodal.oilRefuelDetail')"),
217
+ children: /*#__PURE__*/_jsx("div", {
218
+ style: {
219
+ height: '360px'
220
+ },
221
+ children: /*#__PURE__*/_jsx(VmTable, _objectSpread({
222
+ columns: columns,
223
+ rowKey: "id"
224
+ }, tableProps))
225
+ })
226
+ })
227
+ })]
228
+ });
229
+ };
230
+ export default OilUse;
@@ -0,0 +1,19 @@
1
+ .vtx-car-water-use-wrap {
2
+ height: 100%;
3
+ display: flex;
4
+ gap: 16px;
5
+ flex-direction: column;
6
+
7
+ .vtx-car-water-use-summary {
8
+ height: 240px;
9
+ display: flex;
10
+ gap: 16px;
11
+ flex-shrink: 0;
12
+ }
13
+
14
+ .vtx-car-water-use-row {
15
+ display: grid;
16
+ grid-template-columns: repeat(3, 1fr);
17
+ gap: 40px 0;
18
+ }
19
+ }