@vtx/modals2 5.0.4 → 5.0.6

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 (104) hide show
  1. package/lib/_components/vm-bar-charts/index.js +9 -5
  2. package/lib/_components/vm-extra-tab/style/index.less +6 -3
  3. package/lib/_components/vm-map/index.js +1 -1
  4. package/lib/_components/vm-pie-charts/index.js +3 -1
  5. package/lib/_components/vm-tag/style/index.less +1 -0
  6. package/lib/_components/vm-video/HistoryGrid.js +52 -0
  7. package/lib/_components/vm-video/RealtimeGrid.js +8 -4
  8. package/lib/_components/vm-video/index.js +298 -112
  9. package/lib/_components/vm-video/index.less +10 -1
  10. package/lib/_service/index.js +5 -0
  11. package/lib/_util/index.js +0 -5
  12. package/lib/vtx-base-modal/Header/index.js +3 -1
  13. package/lib/vtx-base-modal/index.js +6 -3
  14. package/lib/vtx-car-modal/components/Info/index.js +2 -1
  15. package/lib/vtx-car-modal/content/Cc/AlarmInfo/StaticInfo.js +0 -1
  16. package/lib/vtx-car-modal/content/JXH/BaseInfo/index.js +131 -104
  17. package/lib/vtx-car-modal/content/JXH/StaticInfo/index.js +206 -158
  18. package/lib/vtx-car-modal/content/JXH/WorkRecord/index.js +19 -4
  19. package/lib/vtx-car-modal/content/Unmanned/Analysis/index.js +33 -0
  20. package/lib/vtx-car-modal/content/Unmanned/Calendar/index.js +255 -0
  21. package/lib/vtx-car-modal/content/Unmanned/Monitor/index.js +75 -0
  22. package/lib/vtx-car-modal/content/Unmanned/Monitor/index.less +22 -0
  23. package/lib/vtx-car-modal/content/Unmanned/WorkInfo/index.js +87 -0
  24. package/lib/vtx-car-modal/content/Unmanned/WorkInfo/index.less +0 -0
  25. package/lib/vtx-car-modal/content/Unmanned/index.js +10 -0
  26. package/lib/vtx-car-modal/content/index.js +2 -1
  27. package/lib/vtx-car-modal/imgs/butter.png +0 -0
  28. package/lib/vtx-car-modal/imgs/butter_dark.png +0 -0
  29. package/lib/vtx-car-modal/imgs/clock.png +0 -0
  30. package/lib/vtx-car-modal/imgs/clock_dark.png +0 -0
  31. package/lib/vtx-car-modal/imgs/clock_green.png +0 -0
  32. package/lib/vtx-car-modal/imgs/clock_green_dark.png +0 -0
  33. package/lib/vtx-car-modal/imgs/factor_bg.png +0 -0
  34. package/lib/vtx-car-modal/imgs/track.png +0 -0
  35. package/lib/vtx-car-modal/imgs/track_dark.png +0 -0
  36. package/lib/vtx-car-modal/imgs/track_green.png +0 -0
  37. package/lib/vtx-car-modal/imgs/track_green_dark.png +0 -0
  38. package/lib/vtx-car-modal/imgs/water.png +0 -0
  39. package/lib/vtx-car-modal/imgs/water_dark.png +0 -0
  40. package/lib/vtx-car-modal/index.js +9 -3
  41. package/lib/vtx-default-modal/components/BaseInfo/index.js +6 -3
  42. package/lib/vtx-default-modal/index.js +9 -6
  43. package/lib/vtx-device-modal/components/DataAnalysis/MonitorAnalysis.js +0 -1
  44. package/lib/vtx-df-modal/index.js +0 -2
  45. package/lib/vtx-housing-estate-modal/api.js +559 -0
  46. package/lib/vtx-housing-estate-modal/components/Alarm/Distribute.js +129 -0
  47. package/lib/vtx-housing-estate-modal/components/Alarm/FSCSFB.js +67 -0
  48. package/lib/vtx-housing-estate-modal/components/Alarm/FSSD.js +65 -0
  49. package/lib/vtx-housing-estate-modal/components/Alarm/FSYZQS.js +67 -0
  50. package/lib/vtx-housing-estate-modal/components/Alarm/GDCLXL.js +109 -0
  51. package/lib/vtx-housing-estate-modal/components/Alarm/index.js +99 -0
  52. package/lib/vtx-housing-estate-modal/components/Alarm/index.less +54 -0
  53. package/lib/vtx-housing-estate-modal/components/OverView/Hot.js +179 -0
  54. package/lib/vtx-housing-estate-modal/components/OverView/Left.js +85 -0
  55. package/lib/vtx-housing-estate-modal/components/OverView/Manage.js +172 -0
  56. package/lib/vtx-housing-estate-modal/components/OverView/RightBottom.js +177 -0
  57. package/lib/vtx-housing-estate-modal/components/OverView/index.js +56 -0
  58. package/lib/vtx-housing-estate-modal/components/OverView/index.less +163 -0
  59. package/lib/vtx-housing-estate-modal/components/TFRD/index.js +133 -0
  60. package/lib/vtx-housing-estate-modal/components/TFRD/index.less +12 -0
  61. package/lib/vtx-housing-estate-modal/components/WGGS/Content.js +66 -0
  62. package/lib/vtx-housing-estate-modal/components/WGGS/index.js +68 -0
  63. package/lib/vtx-housing-estate-modal/components/WGGS/index.less +49 -0
  64. package/lib/vtx-housing-estate-modal/components/WGXW/Content.js +119 -0
  65. package/lib/vtx-housing-estate-modal/components/WGXW/index.js +121 -0
  66. package/lib/vtx-housing-estate-modal/components/WGXW/index.less +97 -0
  67. package/lib/vtx-housing-estate-modal/components/index.js +5 -0
  68. package/lib/vtx-housing-estate-modal/config.js +77 -0
  69. package/lib/vtx-housing-estate-modal/imgs/avatar.png +0 -0
  70. package/lib/vtx-housing-estate-modal/imgs/avatar_light.png +0 -0
  71. package/lib/vtx-housing-estate-modal/imgs/ddypz.png +0 -0
  72. package/lib/vtx-housing-estate-modal/imgs/ddypz_light.png +0 -0
  73. package/lib/vtx-housing-estate-modal/imgs/gzxjcx.png +0 -0
  74. package/lib/vtx-housing-estate-modal/imgs/hjglcx.png +0 -0
  75. package/lib/vtx-housing-estate-modal/imgs/hmd.png +0 -0
  76. package/lib/vtx-housing-estate-modal/imgs/hmd_light.png +0 -0
  77. package/lib/vtx-housing-estate-modal/imgs/manage_bg.png +0 -0
  78. package/lib/vtx-housing-estate-modal/imgs/manage_bg_light.png +0 -0
  79. package/lib/vtx-housing-estate-modal/imgs/rank.png +0 -0
  80. package/lib/vtx-housing-estate-modal/imgs/rank_light.png +0 -0
  81. package/lib/vtx-housing-estate-modal/imgs/tfcs.png +0 -0
  82. package/lib/vtx-housing-estate-modal/imgs/tfcs_light.png +0 -0
  83. package/lib/vtx-housing-estate-modal/imgs/tfd.png +0 -0
  84. package/lib/vtx-housing-estate-modal/imgs/tfd_light.png +0 -0
  85. package/lib/vtx-housing-estate-modal/imgs/tfhs.png +0 -0
  86. package/lib/vtx-housing-estate-modal/imgs/tfhs_light.png +0 -0
  87. package/lib/vtx-housing-estate-modal/imgs/wgmsr.png +0 -0
  88. package/lib/vtx-housing-estate-modal/imgs/wgmsr_light.png +0 -0
  89. package/lib/vtx-housing-estate-modal/imgs/yyxj.png +0 -0
  90. package/lib/vtx-housing-estate-modal/imgs/yyxj_light.png +0 -0
  91. package/lib/vtx-housing-estate-modal/index.js +108 -0
  92. package/lib/vtx-housing-estate-modal/style/index.js +4 -0
  93. package/lib/vtx-housing-estate-modal/style/index.less +1 -0
  94. package/lib/vtx-road-modal/components/Calendar/index.js +1 -1
  95. package/lib/vtx-road-modal/components/Statistical/index.js +1 -1
  96. package/lib/vtx-shxq-modal/components/ThrowCalendar/index.js +0 -1
  97. package/lib/vtx-staff-modal/components/BaseInfo/ListZymx.js +15 -5
  98. package/lib/vtx-staff-modal/index.js +4 -1
  99. package/lib/vtx-tfd-modal/components/BaseInfo/index.js +1 -8
  100. package/lib/vtx-zg-modal/components/BaseInfo/index.js +0 -1
  101. package/package.json +1 -1
  102. package/lib/resources/jessibuca/decoder.js +0 -3839
  103. package/lib/resources/jessibuca/decoder.wasm +0 -0
  104. package/lib/resources/jessibuca/jessibuca.js +0 -5350
@@ -13,26 +13,17 @@ import { secondToFormatTimeArray } from "../../../../_util";
13
13
  import { JxhService } from "../../../api";
14
14
  import Info from "../../../components/Info";
15
15
  import { CarContext } from "../../../index";
16
+ import Unmanned from "../../Unmanned";
16
17
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
17
18
  var BaseInfo = function BaseInfo() {
18
19
  var _useContext = useContext(CarContext),
19
20
  id = _useContext.id,
20
- startDate = _useContext.startDate;
21
- var _useSettings = useSettings(),
22
- isDark = _useSettings.isDark;
21
+ startDate = _useContext.startDate,
22
+ info = _useContext.info;
23
23
  var _useState = useState(dayjs(startDate)),
24
24
  _useState2 = _slicedToArray(_useState, 2),
25
25
  date = _useState2[0],
26
26
  setDate = _useState2[1];
27
- var _JxhService$useWorkSu = JxhService.useWorkSummaryJxh(id, dayjs(date).format('YYYY-MM-DD'), dayjs(date).format('YYYY-MM-DD')),
28
- workSummaryJxhRes = _JxhService$useWorkSu.workSummaryJxhRes,
29
- loading = _JxhService$useWorkSu.loading;
30
- var _JxhService$useWorkAn = JxhService.useWorkAnaJxh(id, dayjs(date).subtract(6, 'day').format('YYYY-MM-DD'), dayjs(date).format('YYYY-MM-DD')),
31
- workAnaJxhRes = _JxhService$useWorkAn.workAnaJxhRes,
32
- loadingJxh = _JxhService$useWorkAn.loading;
33
- var xAxis = (workAnaJxhRes === null || workAnaJxhRes === void 0 ? void 0 : workAnaJxhRes.names) || [];
34
- var extraData = workAnaJxhRes === null || workAnaJxhRes === void 0 ? void 0 : workAnaJxhRes.extraData;
35
- var averageSpeed = ((workSummaryJxhRes === null || workSummaryJxhRes === void 0 ? void 0 : workSummaryJxhRes.workMileage) || 0) / (workSummaryJxhRes !== null && workSummaryJxhRes !== void 0 && workSummaryJxhRes.workDuration ? workSummaryJxhRes.workDuration % (24 * 60 * 60) / 60 / 60 : 1);
36
27
  return /*#__PURE__*/_jsxs(Row, {
37
28
  gutter: [16, 16],
38
29
  style: {
@@ -57,104 +48,23 @@ var BaseInfo = function BaseInfo() {
57
48
  disabledDate: function disabledDate(current) {
58
49
  return current && current > dayjs().endOf('day');
59
50
  },
60
- children: /*#__PURE__*/_jsxs(Row, {
61
- gutter: [47, 47],
62
- align: 'middle',
63
- style: {
64
- height: '100%',
65
- marginLeft: 30
66
- },
67
- children: [/*#__PURE__*/_jsx(Col, {
68
- flex: '1',
69
- children: /*#__PURE__*/_jsxs(Row, {
70
- gutter: [34, 34],
71
- children: [/*#__PURE__*/_jsx(Col, {
72
- flex: '108px',
73
- children: /*#__PURE__*/_jsx(VmProgress.Circle, {
74
- rate: (workSummaryJxhRes === null || workSummaryJxhRes === void 0 ? void 0 : workSummaryJxhRes.workRate) || 0,
75
- name: '有效作业率'
76
- })
77
- }), /*#__PURE__*/_jsxs(Col, {
78
- flex: '1',
79
- children: [/*#__PURE__*/_jsx(VmFactor, {
80
- name: '行驶里程',
81
- unit: 'km',
82
- type: 'sm',
83
- value: (workSummaryJxhRes === null || workSummaryJxhRes === void 0 ? void 0 : workSummaryJxhRes.driveMileage) || 0,
84
- fontType: 'blue',
85
- img: isDark ? require("../../../imgs/calendar/dark_mileage.png") : require("../../../imgs/calendar/blue_mileage.png")
86
- }), /*#__PURE__*/_jsx(VmFactor, {
87
- name: '核算作业里程',
88
- unit: 'km',
89
- type: 'sm',
90
- fontType: 'green',
91
- value: (workSummaryJxhRes === null || workSummaryJxhRes === void 0 ? void 0 : workSummaryJxhRes.workMileage) || 0,
92
- img: isDark ? require("../../../imgs/calendar/dark_green_mileage.png") : require("../../../imgs/calendar/mileage.png")
93
- })]
94
- })]
95
- })
96
- }), /*#__PURE__*/_jsx(Col, {
97
- flex: '1',
98
- children: /*#__PURE__*/_jsxs(Row, {
99
- gutter: [34, 34],
100
- children: [/*#__PURE__*/_jsx(Col, {
101
- flex: '108px',
102
- children: /*#__PURE__*/_jsx(VmProgress.Circle, {
103
- type: 'dashboard',
104
- rate: averageSpeed / 200 * 100,
105
- name: '作业均速',
106
- unit: 'km/h',
107
- info: averageSpeed.toFixed(2)
108
- })
109
- }), /*#__PURE__*/_jsxs(Col, {
110
- flex: '1',
111
- children: [/*#__PURE__*/_jsx(VmFactor, {
112
- name: '作业时长',
113
- type: 'sm',
114
- value: secondToFormatTimeArray((workSummaryJxhRes === null || workSummaryJxhRes === void 0 ? void 0 : workSummaryJxhRes.workDuration) || 0),
115
- fontType: 'cyan',
116
- img: isDark ? require("../../../imgs/calendar/cyan_duration.png") : require("../../../imgs/calendar/blue_duration.png")
117
- }), /*#__PURE__*/_jsx(VmFactor, {
118
- name: '作业超速时长',
119
- type: 'sm',
120
- isError: true,
121
- value: secondToFormatTimeArray((workSummaryJxhRes === null || workSummaryJxhRes === void 0 ? void 0 : workSummaryJxhRes.overSpeedDuration) || 0),
122
- fontType: 'red',
123
- img: isDark ? require("../../../imgs/calendar/dark_alarm.png") : require("../../../imgs/calendar/alarm.png")
124
- })]
125
- })]
126
- })
127
- })]
51
+ children: (info === null || info === void 0 ? void 0 : info.driveMode) === 'unmanned' ? /*#__PURE__*/_jsx(Unmanned.WorkInfo, {
52
+ info: info
53
+ }) : /*#__PURE__*/_jsx(BaseWork, {
54
+ id: id,
55
+ date: date
128
56
  })
129
57
  })
130
58
  }), /*#__PURE__*/_jsx("div", {
131
59
  className: 'vtx-car-info-right-wrap-bottom',
132
60
  children: /*#__PURE__*/_jsx(VmWrapper, {
133
61
  title: '近7天运行分析',
134
- children: /*#__PURE__*/_jsx(VmBarCharts, {
135
- dataList: [{
136
- name: '核算作业里程',
137
- data: ((workAnaJxhRes === null || workAnaJxhRes === void 0 ? void 0 : workAnaJxhRes.values.length) > 0 ? workAnaJxhRes === null || workAnaJxhRes === void 0 ? void 0 : workAnaJxhRes.values[0] : []).map(function (item) {
138
- return "\u2000".concat(item);
139
- })
140
- }],
141
- xAxis: xAxis,
142
- unit: '%',
143
- yAxisList: [{
144
- key: "\u2000",
145
- unit: 'km',
146
- name: '(km)'
147
- }].concat([extraData !== null && extraData > 0 ? {
148
- key: '',
149
- unit: '%',
150
- name: '(%)'
151
- } : {}]),
152
- lineList: extraData !== null && extraData > 0 ? [{
153
- name: '有效完成率',
154
- data: (workAnaJxhRes === null || workAnaJxhRes === void 0 ? void 0 : workAnaJxhRes.values.length) > 0 ? workAnaJxhRes === null || workAnaJxhRes === void 0 ? void 0 : workAnaJxhRes.values[1] : [],
155
- yAxisIndex: 1
156
- }] : [],
157
- loading: loadingJxh
62
+ children: (info === null || info === void 0 ? void 0 : info.driveMode) === 'unmanned' ? /*#__PURE__*/_jsx(Unmanned.Analysis, {
63
+ id: id,
64
+ date: date
65
+ }) : /*#__PURE__*/_jsx(BaseAnalysis, {
66
+ id: id,
67
+ date: date
158
68
  })
159
69
  })
160
70
  })]
@@ -162,4 +72,121 @@ var BaseInfo = function BaseInfo() {
162
72
  })]
163
73
  });
164
74
  };
75
+
76
+ // 机械化运行信息-默认
77
+ function BaseWork(_ref) {
78
+ var id = _ref.id,
79
+ date = _ref.date;
80
+ var _useSettings = useSettings(),
81
+ isDark = _useSettings.isDark;
82
+ var _JxhService$useWorkSu = JxhService.useWorkSummaryJxh(id, dayjs(date).format('YYYY-MM-DD'), dayjs(date).format('YYYY-MM-DD')),
83
+ workSummaryJxhRes = _JxhService$useWorkSu.workSummaryJxhRes,
84
+ loading = _JxhService$useWorkSu.loading;
85
+ var averageSpeed = ((workSummaryJxhRes === null || workSummaryJxhRes === void 0 ? void 0 : workSummaryJxhRes.workMileage) || 0) / (workSummaryJxhRes !== null && workSummaryJxhRes !== void 0 && workSummaryJxhRes.workDuration ? workSummaryJxhRes.workDuration % (24 * 60 * 60) / 60 / 60 : 1);
86
+ return /*#__PURE__*/_jsxs(Row, {
87
+ gutter: [47, 47],
88
+ align: 'middle',
89
+ style: {
90
+ height: '100%',
91
+ marginLeft: 30
92
+ },
93
+ children: [/*#__PURE__*/_jsx(Col, {
94
+ flex: '1',
95
+ children: /*#__PURE__*/_jsxs(Row, {
96
+ gutter: [34, 34],
97
+ children: [/*#__PURE__*/_jsx(Col, {
98
+ flex: '108px',
99
+ children: /*#__PURE__*/_jsx(VmProgress.Circle, {
100
+ rate: (workSummaryJxhRes === null || workSummaryJxhRes === void 0 ? void 0 : workSummaryJxhRes.workRate) || 0,
101
+ name: '有效作业率'
102
+ })
103
+ }), /*#__PURE__*/_jsxs(Col, {
104
+ flex: '1',
105
+ children: [/*#__PURE__*/_jsx(VmFactor, {
106
+ name: '行驶里程',
107
+ unit: 'km',
108
+ type: 'sm',
109
+ value: (workSummaryJxhRes === null || workSummaryJxhRes === void 0 ? void 0 : workSummaryJxhRes.driveMileage) || 0,
110
+ fontType: 'blue',
111
+ img: isDark ? require("../../../imgs/calendar/dark_mileage.png") : require("../../../imgs/calendar/blue_mileage.png")
112
+ }), /*#__PURE__*/_jsx(VmFactor, {
113
+ name: '核算作业里程',
114
+ unit: 'km',
115
+ type: 'sm',
116
+ fontType: 'green',
117
+ value: (workSummaryJxhRes === null || workSummaryJxhRes === void 0 ? void 0 : workSummaryJxhRes.workMileage) || 0,
118
+ img: isDark ? require("../../../imgs/calendar/dark_green_mileage.png") : require("../../../imgs/calendar/mileage.png")
119
+ })]
120
+ })]
121
+ })
122
+ }), /*#__PURE__*/_jsx(Col, {
123
+ flex: '1',
124
+ children: /*#__PURE__*/_jsxs(Row, {
125
+ gutter: [34, 34],
126
+ children: [/*#__PURE__*/_jsx(Col, {
127
+ flex: '108px',
128
+ children: /*#__PURE__*/_jsx(VmProgress.Circle, {
129
+ type: 'dashboard',
130
+ rate: averageSpeed / 200 * 100,
131
+ name: '作业均速',
132
+ unit: 'km/h',
133
+ info: averageSpeed.toFixed(2)
134
+ })
135
+ }), /*#__PURE__*/_jsxs(Col, {
136
+ flex: '1',
137
+ children: [/*#__PURE__*/_jsx(VmFactor, {
138
+ name: '作业时长',
139
+ type: 'sm',
140
+ value: secondToFormatTimeArray((workSummaryJxhRes === null || workSummaryJxhRes === void 0 ? void 0 : workSummaryJxhRes.workDuration) || 0),
141
+ fontType: 'cyan',
142
+ img: isDark ? require("../../../imgs/calendar/cyan_duration.png") : require("../../../imgs/calendar/blue_duration.png")
143
+ }), /*#__PURE__*/_jsx(VmFactor, {
144
+ name: '作业超速时长',
145
+ type: 'sm',
146
+ isError: true,
147
+ value: secondToFormatTimeArray((workSummaryJxhRes === null || workSummaryJxhRes === void 0 ? void 0 : workSummaryJxhRes.overSpeedDuration) || 0),
148
+ fontType: 'red',
149
+ img: isDark ? require("../../../imgs/calendar/dark_alarm.png") : require("../../../imgs/calendar/alarm.png")
150
+ })]
151
+ })]
152
+ })
153
+ })]
154
+ });
155
+ }
156
+
157
+ // 机械化近7天运行分析-默认
158
+ function BaseAnalysis(_ref2) {
159
+ var id = _ref2.id,
160
+ date = _ref2.date;
161
+ var _JxhService$useWorkAn = JxhService.useWorkAnaJxh(id, dayjs(date).subtract(6, 'day').format('YYYY-MM-DD'), dayjs(date).format('YYYY-MM-DD')),
162
+ workAnaJxhRes = _JxhService$useWorkAn.workAnaJxhRes,
163
+ loadingJxh = _JxhService$useWorkAn.loading;
164
+ var xAxis = (workAnaJxhRes === null || workAnaJxhRes === void 0 ? void 0 : workAnaJxhRes.names) || [];
165
+ var extraData = workAnaJxhRes === null || workAnaJxhRes === void 0 ? void 0 : workAnaJxhRes.extraData;
166
+ return /*#__PURE__*/_jsx(VmBarCharts, {
167
+ dataList: [{
168
+ name: '核算作业里程',
169
+ data: ((workAnaJxhRes === null || workAnaJxhRes === void 0 ? void 0 : workAnaJxhRes.values.length) > 0 ? workAnaJxhRes === null || workAnaJxhRes === void 0 ? void 0 : workAnaJxhRes.values[0] : []).map(function (item) {
170
+ return "\u2000".concat(item);
171
+ })
172
+ }],
173
+ xAxis: xAxis,
174
+ unit: '%',
175
+ yAxisList: [{
176
+ key: "\u2000",
177
+ unit: 'km',
178
+ name: '(km)'
179
+ }].concat([extraData !== null && extraData > 0 ? {
180
+ key: '',
181
+ unit: '%',
182
+ name: '(%)'
183
+ } : {}]),
184
+ lineList: extraData !== null && extraData > 0 ? [{
185
+ name: '有效完成率',
186
+ data: (workAnaJxhRes === null || workAnaJxhRes === void 0 ? void 0 : workAnaJxhRes.values.length) > 0 ? workAnaJxhRes === null || workAnaJxhRes === void 0 ? void 0 : workAnaJxhRes.values[1] : [],
187
+ yAxisIndex: 1
188
+ }] : [],
189
+ loading: loadingJxh
190
+ });
191
+ }
165
192
  export default BaseInfo;
@@ -24,20 +24,198 @@ import darkMileageIcon from "../../../imgs/calendar/dark_mileage.png";
24
24
  import lightWorkMileageIcon from "../../../imgs/calendar/green_mileage.png";
25
25
  import lightMileageIcon from "../../../imgs/calendar/mileage.png";
26
26
  import { CarContext } from "../../../index";
27
+ import Unmanned from "../../Unmanned";
27
28
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
28
29
  var StaticInfo = function StaticInfo() {
29
- var _useSettings = useSettings(),
30
- isDark = _useSettings.isDark;
31
30
  var _useState = useState('calendar'),
32
31
  _useState2 = _slicedToArray(_useState, 2),
33
32
  type = _useState2[0],
34
33
  setType = _useState2[1];
35
34
  var _useContext = useContext(CarContext),
36
- id = _useContext.id;
35
+ id = _useContext.id,
36
+ info = _useContext.info;
37
37
  var _useState3 = useState(dayjs()),
38
38
  _useState4 = _slicedToArray(_useState3, 2),
39
39
  month = _useState4[0],
40
40
  setMonth = _useState4[1];
41
+ var common = {
42
+ type: type,
43
+ id: id,
44
+ month: month
45
+ };
46
+ return /*#__PURE__*/_jsx(VmWrapper, {
47
+ title: '作业分析',
48
+ needChange: true,
49
+ showCalendar: true,
50
+ onChange: setType,
51
+ filterType: "monthPicker",
52
+ dateValue: month,
53
+ filterChange: setMonth,
54
+ disabledDate: function disabledDate(current) {
55
+ return current && current > dayjs().endOf('M');
56
+ },
57
+ children: (info === null || info === void 0 ? void 0 : info.driveMode) === 'unmanned' ? /*#__PURE__*/_jsx(Unmanned.Calendar, _objectSpread(_objectSpread({}, common), {}, {
58
+ legend: /*#__PURE__*/_jsx(RateLegend, {}),
59
+ getRateColor: getRateColor,
60
+ baseColumns: BaseColumns
61
+ })) : /*#__PURE__*/_jsx(Calendar, _objectSpread({}, common))
62
+ });
63
+ };
64
+
65
+ // 作业率图例
66
+ function RateLegend() {
67
+ return /*#__PURE__*/_jsxs(Space, {
68
+ children: [/*#__PURE__*/_jsx("div", {
69
+ children: "\u6709\u6548\u4F5C\u4E1A\u7387\uFF1A"
70
+ }), /*#__PURE__*/_jsx("div", {
71
+ className: 'vtx-car-calendar-complete-legend',
72
+ style: {
73
+ background: 'var(--gray-color)'
74
+ }
75
+ }), /*#__PURE__*/_jsx("div", {
76
+ children: "0%"
77
+ }), /*#__PURE__*/_jsx("div", {
78
+ className: 'vtx-car-calendar-complete-legend',
79
+ style: {
80
+ background: 'var(--red-color)'
81
+ }
82
+ }), /*#__PURE__*/_jsx("div", {
83
+ children: "(0%-50%]"
84
+ }), /*#__PURE__*/_jsx("div", {
85
+ className: 'vtx-car-calendar-complete-legend',
86
+ style: {
87
+ background: 'var(--yellow-color)'
88
+ }
89
+ }), /*#__PURE__*/_jsx("div", {
90
+ children: "(50%-80%]"
91
+ }), /*#__PURE__*/_jsx("div", {
92
+ className: 'vtx-car-calendar-complete-legend',
93
+ style: {
94
+ background: 'var(--blue-color)'
95
+ }
96
+ }), /*#__PURE__*/_jsx("div", {
97
+ children: "(80%-100%]"
98
+ }), /*#__PURE__*/_jsx("div", {
99
+ className: 'vtx-car-calendar-complete-legend',
100
+ style: {
101
+ background: 'var(--green-color)'
102
+ }
103
+ }), /*#__PURE__*/_jsx("div", {
104
+ children: "100%"
105
+ })]
106
+ });
107
+ }
108
+
109
+ // 列表字段-默认
110
+ var BaseColumns = [{
111
+ title: '作业日期',
112
+ dataIndex: 'workDate',
113
+ key: 'workDate',
114
+ width: 100
115
+ }, {
116
+ title: '作业开始时间',
117
+ dataIndex: 'workStartTime',
118
+ key: 'workStartTime',
119
+ render: function render(text) {
120
+ return /*#__PURE__*/_jsx("span", {
121
+ children: text || '-'
122
+ });
123
+ },
124
+ sorter: function sorter(a, b) {
125
+ return a.workStartTime > b.workStartTime ? 1 : -1;
126
+ },
127
+ width: 160
128
+ }, {
129
+ title: '作业结束时间',
130
+ dataIndex: 'workEndTime',
131
+ key: 'workEndTime',
132
+ render: function render(text) {
133
+ return /*#__PURE__*/_jsx("span", {
134
+ children: text || '-'
135
+ });
136
+ },
137
+ sorter: function sorter(a, b) {
138
+ return a.workEndTime > b.workEndTime ? 1 : -1;
139
+ },
140
+ width: 160
141
+ }, {
142
+ title: '作业时长',
143
+ dataIndex: 'workDuration',
144
+ key: 'workDuration',
145
+ render: function render(text) {
146
+ return /*#__PURE__*/_jsx("span", {
147
+ children: secondToFormatTime((text || 0) / 1000) || '-'
148
+ });
149
+ },
150
+ width: 100
151
+ }, {
152
+ title: '行驶时长',
153
+ dataIndex: 'driveDuration',
154
+ key: 'driveDuration',
155
+ render: function render(text) {
156
+ return /*#__PURE__*/_jsx("span", {
157
+ children: secondToFormatTime((text || 0) / 1000) || '-'
158
+ });
159
+ },
160
+ width: 100
161
+ }, {
162
+ title: '规划里程(km)',
163
+ dataIndex: 'planMileage',
164
+ key: 'planMileage',
165
+ render: function render(text) {
166
+ return /*#__PURE__*/_jsx("span", {
167
+ children: text || '-'
168
+ });
169
+ },
170
+ align: 'right',
171
+ width: 120
172
+ }, {
173
+ title: '核算作业里程(km)',
174
+ dataIndex: 'workMileage',
175
+ key: 'workMileage',
176
+ render: function render(text) {
177
+ return /*#__PURE__*/_jsx("span", {
178
+ children: text || '-'
179
+ });
180
+ },
181
+ align: 'right',
182
+ width: 120
183
+ }, {
184
+ title: '行驶里程(km)',
185
+ dataIndex: 'driveMileage',
186
+ key: 'driveMileage',
187
+ render: function render(text) {
188
+ return /*#__PURE__*/_jsx("span", {
189
+ children: text || '-'
190
+ });
191
+ },
192
+ align: 'right',
193
+ width: 100
194
+ }];
195
+
196
+ // 获取效率颜色
197
+ function getRateColor() {
198
+ var percent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
199
+ var color = 'gray';
200
+ if (percent > 0 && percent <= 50) {
201
+ color = 'red';
202
+ } else if (percent > 50 && percent <= 80) {
203
+ color = 'yellow';
204
+ } else if (percent > 80 && percent < 100) {
205
+ color = 'blue';
206
+ } else if (percent >= 100) {
207
+ color = 'green';
208
+ }
209
+ return color;
210
+ }
211
+
212
+ // 机械化作业日历-默认
213
+ function Calendar(_ref) {
214
+ var type = _ref.type,
215
+ id = _ref.id,
216
+ month = _ref.month;
217
+ var _useSettings = useSettings(),
218
+ isDark = _useSettings.isDark;
41
219
  var _JxhService$useCarWor = JxhService.useCarWorkDailyReport(id, month.startOf('M').format('YYYY-MM-DD'), month.endOf('M').format('YYYY-MM-DD')),
42
220
  _JxhService$useCarWor2 = _JxhService$useCarWor.dailyData,
43
221
  dailyData = _JxhService$useCarWor2 === void 0 ? [] : _JxhService$useCarWor2,
@@ -49,98 +227,6 @@ var StaticInfo = function StaticInfo() {
49
227
  mileageIcon = darkMileageIcon;
50
228
  workMileageIcon = darkWorkMileageIcon;
51
229
  }
52
- var columns = [{
53
- title: '作业日期',
54
- dataIndex: 'workDate',
55
- key: 'workDate',
56
- width: 100
57
- }, {
58
- title: '作业开始时间',
59
- dataIndex: 'workStartTime',
60
- key: 'workStartTime',
61
- render: function render(text) {
62
- return /*#__PURE__*/_jsx("span", {
63
- children: text || '-'
64
- });
65
- },
66
- sorter: function sorter(a, b) {
67
- return a.workStartTime > b.workStartTime ? 1 : -1;
68
- },
69
- width: 160
70
- }, {
71
- title: '作业结束时间',
72
- dataIndex: 'workEndTime',
73
- key: 'workEndTime',
74
- render: function render(text) {
75
- return /*#__PURE__*/_jsx("span", {
76
- children: text || '-'
77
- });
78
- },
79
- sorter: function sorter(a, b) {
80
- return a.workEndTime > b.workEndTime ? 1 : -1;
81
- },
82
- width: 160
83
- }, {
84
- title: '作业时长',
85
- dataIndex: 'workDuration',
86
- key: 'workDuration',
87
- render: function render(text) {
88
- return /*#__PURE__*/_jsx("span", {
89
- children: secondToFormatTime((text || 0) / 1000) || '-'
90
- });
91
- },
92
- width: 100
93
- }, {
94
- title: '行驶时长',
95
- dataIndex: 'driveDuration',
96
- key: 'driveDuration',
97
- render: function render(text) {
98
- return /*#__PURE__*/_jsx("span", {
99
- children: secondToFormatTime((text || 0) / 1000) || '-'
100
- });
101
- },
102
- width: 100
103
- }, {
104
- title: '核算作业里程(km)',
105
- dataIndex: 'workMileage',
106
- key: 'workMileage',
107
- render: function render(text) {
108
- return /*#__PURE__*/_jsx("span", {
109
- children: text || '-'
110
- });
111
- },
112
- align: 'right',
113
- width: 120
114
- }, {
115
- title: '行驶里程(km)',
116
- dataIndex: 'driveMileage',
117
- key: 'driveMileage',
118
- render: function render(text) {
119
- return /*#__PURE__*/_jsx("span", {
120
- children: text || '-'
121
- });
122
- },
123
- align: 'right',
124
- width: 100
125
- }, {
126
- title: /*#__PURE__*/_jsxs(Space, {
127
- children: [/*#__PURE__*/_jsx("span", {
128
- children: "\u6709\u6548\u4F5C\u4E1A\u7387"
129
- }), /*#__PURE__*/_jsx(Tooltip, {
130
- title: "\u6838\u7B97\u4F5C\u4E1A\u91CC\u7A0B/\u884C\u9A76\u91CC\u7A0B",
131
- children: /*#__PURE__*/_jsx(QuestionCircleOutlined, {})
132
- })]
133
- }),
134
- dataIndex: 'percent',
135
- key: 'percent',
136
- render: function render(text) {
137
- return /*#__PURE__*/_jsx("span", {
138
- children: (text || 0) + '%'
139
- });
140
- },
141
- align: 'right',
142
- width: 100
143
- }];
144
230
  var tableProps = {
145
231
  pagination: false,
146
232
  dataSource: dailyData
@@ -154,16 +240,7 @@ var StaticInfo = function StaticInfo() {
154
240
  var percent = item.percent,
155
241
  driveMileage = item.driveMileage,
156
242
  workMileage = item.workMileage;
157
- var color = 'gray';
158
- if (percent > 0 && percent <= 50) {
159
- color = 'red';
160
- } else if (percent > 50 && percent <= 80) {
161
- color = 'yellow';
162
- } else if (percent > 80 && percent < 100) {
163
- color = 'blue';
164
- } else if (percent >= 100) {
165
- color = 'green';
166
- }
243
+ var color = getRateColor(percent);
167
244
  return /*#__PURE__*/_jsxs(_Fragment, {
168
245
  children: [/*#__PURE__*/_jsx(VmCalendarPercent, {
169
246
  percent: percent,
@@ -188,17 +265,7 @@ var StaticInfo = function StaticInfo() {
188
265
  })]
189
266
  });
190
267
  };
191
- return /*#__PURE__*/_jsxs(VmWrapper, {
192
- title: '作业分析',
193
- needChange: true,
194
- showCalendar: true,
195
- onChange: setType,
196
- filterType: "monthPicker",
197
- dateValue: month,
198
- filterChange: setMonth,
199
- disabledDate: function disabledDate(current) {
200
- return current && current > dayjs().endOf('M');
201
- },
268
+ return /*#__PURE__*/_jsxs(_Fragment, {
202
269
  children: [type === 'calendar' && /*#__PURE__*/_jsxs(_Fragment, {
203
270
  children: [/*#__PURE__*/_jsxs("div", {
204
271
  className: 'vtx-car-calendar-head',
@@ -214,46 +281,7 @@ var StaticInfo = function StaticInfo() {
214
281
  return /*#__PURE__*/_jsx(VmCalendarInner, _objectSpread(_objectSpread({}, item), {}, {
215
282
  value: item.name
216
283
  }), index);
217
- }), /*#__PURE__*/_jsxs(Space, {
218
- children: [/*#__PURE__*/_jsx("div", {
219
- children: "\u6709\u6548\u4F5C\u4E1A\u7387\uFF1A"
220
- }), /*#__PURE__*/_jsx("div", {
221
- className: 'vtx-car-calendar-complete-legend',
222
- style: {
223
- background: 'var(--gray-color)'
224
- }
225
- }), /*#__PURE__*/_jsx("div", {
226
- children: "0%"
227
- }), /*#__PURE__*/_jsx("div", {
228
- className: 'vtx-car-calendar-complete-legend',
229
- style: {
230
- background: 'var(--red-color)'
231
- }
232
- }), /*#__PURE__*/_jsx("div", {
233
- children: "(0%-50%]"
234
- }), /*#__PURE__*/_jsx("div", {
235
- className: 'vtx-car-calendar-complete-legend',
236
- style: {
237
- background: 'var(--yellow-color)'
238
- }
239
- }), /*#__PURE__*/_jsx("div", {
240
- children: "(50%-80%]"
241
- }), /*#__PURE__*/_jsx("div", {
242
- className: 'vtx-car-calendar-complete-legend',
243
- style: {
244
- background: 'var(--blue-color)'
245
- }
246
- }), /*#__PURE__*/_jsx("div", {
247
- children: "(80%-100%]"
248
- }), /*#__PURE__*/_jsx("div", {
249
- className: 'vtx-car-calendar-complete-legend',
250
- style: {
251
- background: 'var(--green-color)'
252
- }
253
- }), /*#__PURE__*/_jsx("div", {
254
- children: "100%"
255
- })]
256
- })]
284
+ }), /*#__PURE__*/_jsx(RateLegend, {})]
257
285
  }), /*#__PURE__*/_jsx("div", {
258
286
  style: {
259
287
  flex: 1,
@@ -265,7 +293,27 @@ var StaticInfo = function StaticInfo() {
265
293
  })
266
294
  })]
267
295
  }), type === 'list' && /*#__PURE__*/_jsx(VmTable, _objectSpread({
268
- columns: columns,
296
+ columns: BaseColumns.filter(function (v) {
297
+ return v.key !== 'planMileage';
298
+ }).concat({
299
+ title: /*#__PURE__*/_jsxs(Space, {
300
+ children: [/*#__PURE__*/_jsx("span", {
301
+ children: "\u6709\u6548\u4F5C\u4E1A\u7387"
302
+ }), /*#__PURE__*/_jsx(Tooltip, {
303
+ title: "\u6838\u7B97\u4F5C\u4E1A\u91CC\u7A0B/\u884C\u9A76\u91CC\u7A0B",
304
+ children: /*#__PURE__*/_jsx(QuestionCircleOutlined, {})
305
+ })]
306
+ }),
307
+ dataIndex: 'percent',
308
+ key: 'percent',
309
+ render: function render(text) {
310
+ return /*#__PURE__*/_jsx("span", {
311
+ children: (text || 0) + '%'
312
+ });
313
+ },
314
+ align: 'right',
315
+ width: 100
316
+ }),
269
317
  rowKey: "id"
270
318
  }, tableProps)), type === 'chart' && /*#__PURE__*/_jsx(VmBarCharts, {
271
319
  dataList: [{
@@ -304,5 +352,5 @@ var StaticInfo = function StaticInfo() {
304
352
  loading: loading
305
353
  })]
306
354
  });
307
- };
355
+ }
308
356
  export default StaticInfo;