@vtx/modals2 5.0.30 → 5.0.32

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 (61) hide show
  1. package/lib/_components/index.js +2 -1
  2. package/lib/_components/vm-card-statistics/index.less +27 -27
  3. package/lib/_components/vm-factor-list/index.less +11 -11
  4. package/lib/_components/vm-info-collection/style/index.js +1 -0
  5. package/lib/_components/vm-pie-charts/index.js +4 -2
  6. package/lib/_components/vm-popover/index.js +19 -0
  7. package/lib/_components/vm-popover/index.less +7 -0
  8. package/lib/_components/vm-table/index.js +4 -4
  9. package/lib/style/index.less +1 -1
  10. package/lib/vtx-base-modal/Header/index.less +98 -98
  11. package/lib/vtx-base-modal/Tabs/index.less +54 -54
  12. package/lib/vtx-base-modal/style/index.less +0 -1
  13. package/lib/vtx-car-modal/api.js +47 -4
  14. package/lib/vtx-car-modal/components/Info/index.less +6 -6
  15. package/lib/vtx-car-modal/content/Common/OilConsumption/index.less +6 -6
  16. package/lib/vtx-car-modal/content/Common/WaterConsumption/index.less +6 -6
  17. package/lib/vtx-car-modal/content/Jzlj/Alarm/Bottom.js +6 -6
  18. package/lib/vtx-car-modal/content/Jzlj/BaseInfo/index.js +27 -20
  19. package/lib/vtx-car-modal/content/Jzlj/Collection/index.js +21 -6
  20. package/lib/vtx-car-modal/content/Jzlj/Dispose/Pies.js +11 -6
  21. package/lib/vtx-car-modal/content/Jzlj/Dispose/index.js +19 -12
  22. package/lib/vtx-car-modal/content/Jzlj/RunCalendar/index.js +9 -7
  23. package/lib/vtx-car-modal/index.js +1 -1
  24. package/lib/vtx-cc-unit-modal/components/BaseInfo/index.less +6 -6
  25. package/lib/vtx-device-modal/components/BaseInfo/KnowledgeBasesDetail.js +77 -0
  26. package/lib/vtx-device-modal/components/BaseInfo/PreviewAndDownload.js +92 -0
  27. package/lib/vtx-device-modal/components/BaseInfo/index.js +104 -46
  28. package/lib/vtx-device-modal/components/DataAnalysis/index.less +66 -66
  29. package/lib/vtx-jzlj-df-tpd-modal/api.js +31 -0
  30. package/lib/vtx-jzlj-df-tpd-modal/components/Collection/Chart.js +5 -4
  31. package/lib/vtx-jzlj-df-tpd-modal/components/Collection/index.js +9 -6
  32. package/lib/vtx-jzlj-df-tpd-modal/components/Dispose/index.js +8 -6
  33. package/lib/vtx-jzlj-df-tpd-modal/components/Overview/CTL.js +7 -6
  34. package/lib/vtx-jzlj-df-tpd-modal/components/Overview/CTYL.js +5 -4
  35. package/lib/vtx-jzlj-df-tpd-modal/components/Overview/CZZ.js +5 -4
  36. package/lib/vtx-jzlj-df-tpd-modal/components/Overview/index.js +11 -3
  37. package/lib/vtx-jzlj-gcxm-modal/api.js +31 -0
  38. package/lib/vtx-jzlj-gcxm-modal/components/Collection/Chart.js +5 -4
  39. package/lib/vtx-jzlj-gcxm-modal/components/Collection/index.js +9 -6
  40. package/lib/vtx-jzlj-gcxm-modal/components/Dispose/index.js +9 -7
  41. package/lib/vtx-jzlj-gcxm-modal/components/Overview/CTL.js +6 -5
  42. package/lib/vtx-jzlj-gcxm-modal/components/Overview/CTYL.js +5 -4
  43. package/lib/vtx-jzlj-gcxm-modal/components/Overview/CZZ.js +9 -8
  44. package/lib/vtx-jzlj-gcxm-modal/components/Overview/index.js +11 -2
  45. package/lib/vtx-jzlj-xnc-modal/api.js +31 -0
  46. package/lib/vtx-jzlj-xnc-modal/components/Collection/Chart.js +5 -4
  47. package/lib/vtx-jzlj-xnc-modal/components/Collection/index.js +9 -6
  48. package/lib/vtx-jzlj-xnc-modal/components/Dispose/index.js +9 -7
  49. package/lib/vtx-jzlj-xnc-modal/components/Overview/CTL.js +7 -6
  50. package/lib/vtx-jzlj-xnc-modal/components/Overview/CTYL.js +5 -4
  51. package/lib/vtx-jzlj-xnc-modal/components/Overview/CZZ.js +8 -7
  52. package/lib/vtx-jzlj-xnc-modal/components/Overview/index.js +11 -3
  53. package/lib/vtx-restaurant-modal/components/Basic/index.less +16 -16
  54. package/lib/vtx-restaurant-modal/config.js +52 -52
  55. package/lib/vtx-road-modal/components/Statistical/index.less +32 -32
  56. package/lib/vtx-staff-modal/api.js +62 -26
  57. package/lib/vtx-staff-modal/components/BaseInfo/WorkStatic.js +118 -33
  58. package/lib/vtx-staff-modal/components/BaseInfo/index.js +12 -80
  59. package/lib/vtx-staff-modal/components/Equipment/index.js +1 -1
  60. package/package.json +1 -1
  61. package/lib/vtx-staff-modal/components/BaseInfo/WorkStaticDay.js +0 -48
@@ -2,41 +2,126 @@
2
2
  * 区域进场量分析
3
3
  */
4
4
 
5
- import { VmEmpty, VmPieCharts } from "../../../_components";
5
+ import { Col, Row } from 'antd';
6
+ import dayjs from 'dayjs';
7
+ import { VmEmpty, VmFactor, VmPieCharts } from "../../../_components";
8
+ import useSettings from "../../../_hooks/useSettings";
9
+ import { BaseService } from "../../api";
10
+ import mileageLight from "../../imgs/mileage.png";
11
+ import mileageDark from "../../imgs/mileage_dark.png";
12
+ import onlineLight from "../../imgs/online.png";
13
+ import onlineDark from "../../imgs/online_dark.png";
14
+ import allTimeLight from "../../imgs/all_time.png";
15
+ import allTimeDark from "../../imgs/all_time_dark.png";
16
+ import avgLight from "../../imgs/avg.png";
17
+ import avgDark from "../../imgs/avg_dark.png";
6
18
  import "./index.less";
7
- import { jsx as _jsx } from "react/jsx-runtime";
19
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
8
20
  function WorkStaticDay(_ref) {
9
- var _workStaticRes$detail, _workStaticRes$detail2;
10
- var workStaticRes = _ref.workStaticRes;
11
- return /*#__PURE__*/_jsx("div", {
12
- className: "staff-base-static-chart",
13
- children: workStaticRes !== null && workStaticRes !== void 0 && (_workStaticRes$detail = workStaticRes.details) !== null && _workStaticRes$detail !== void 0 && _workStaticRes$detail.length ? /*#__PURE__*/_jsx(VmPieCharts, {
14
- unit: "",
15
- name: "",
16
- innerRadius: ['50%', '65%'],
17
- outerRadius: ['65%', '70%'],
18
- dataList: (workStaticRes === null || workStaticRes === void 0 || (_workStaticRes$detail2 = workStaticRes.details) === null || _workStaticRes$detail2 === void 0 ? void 0 : _workStaticRes$detail2.length) > 0 ? workStaticRes === null || workStaticRes === void 0 ? void 0 : workStaticRes.details.map(function (ele) {
19
- return {
20
- name: ele.statusName,
21
- value: ele.duration / 1000,
22
- durationStr: ele.durationStr
23
- };
24
- }) : [],
25
- legendConfig: {
26
- formatter: function formatter(name) {
27
- var value = workStaticRes === null || workStaticRes === void 0 ? void 0 : workStaticRes.details.find(function (item) {
28
- return item.statusName === name;
29
- });
30
- if (value) {
31
- return "\t\t".concat(name, "\t\t").concat(value.durationStr, "\t\t");
32
- } else {
33
- return '';
34
- }
35
- }
36
- }
37
- }) : /*#__PURE__*/_jsx(VmEmpty, {
38
- type: "NO_CHART"
39
- })
21
+ var type = _ref.type,
22
+ service = _ref.service,
23
+ id = _ref.id;
24
+ var _useSettings = useSettings(),
25
+ isDark = _useSettings.isDark;
26
+ var _BaseService$useStaff = BaseService.useStaffStatic(id, type === 'day' ? dayjs().format('YYYY-MM-DD') : dayjs().startOf('M').format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD'), service),
27
+ workInfoRes = _BaseService$useStaff.workInfoRes;
28
+ var _ref2 = workInfoRes || {},
29
+ _ref2$totalMileage = _ref2.totalMileage,
30
+ totalMileage = _ref2$totalMileage === void 0 ? 0 : _ref2$totalMileage,
31
+ onlineHour = _ref2.onlineHour,
32
+ validWorkHour = _ref2.validWorkHour,
33
+ outShiftHour = _ref2.outShiftHour,
34
+ violateStayHour = _ref2.violateStayHour,
35
+ outPostHour = _ref2.outPostHour;
36
+ var avgWorkHour = 0;
37
+ var detail = [];
38
+ if (Number(validWorkHour)) {
39
+ avgWorkHour = (Number(validWorkHour) / dayjs().date()).toFixed(2) || 0;
40
+ detail.push({
41
+ name: '有效作业',
42
+ value: Number(validWorkHour)
43
+ });
44
+ }
45
+ if (Number(outShiftHour)) {
46
+ detail.push({
47
+ name: '脱岗',
48
+ value: Number(outShiftHour)
49
+ });
50
+ }
51
+ if (Number(violateStayHour)) {
52
+ detail.push({
53
+ name: '违规滞留',
54
+ value: Number(violateStayHour)
55
+ });
56
+ }
57
+ if (Number(outPostHour)) {
58
+ detail.push({
59
+ name: '异常离线',
60
+ value: Number(outPostHour)
61
+ });
62
+ }
63
+ return /*#__PURE__*/_jsxs(Row, {
64
+ children: [/*#__PURE__*/_jsx(Col, {
65
+ span: 9,
66
+ children: /*#__PURE__*/_jsxs("div", {
67
+ className: "staff-base-right-static",
68
+ children: [type === 'day' && /*#__PURE__*/_jsxs(_Fragment, {
69
+ children: [/*#__PURE__*/_jsx(VmFactor, {
70
+ name: "\u4ECA\u65E5\u884C\u8D70",
71
+ unit: "km",
72
+ value: totalMileage || 0,
73
+ img: isDark ? mileageDark : mileageLight,
74
+ fontType: "blue"
75
+ }), /*#__PURE__*/_jsx(VmFactor, {
76
+ name: "\u4ECA\u65E5\u5728\u7EBF",
77
+ unit: "h",
78
+ value: onlineHour || '--',
79
+ img: isDark ? onlineDark : onlineLight,
80
+ style: {
81
+ marginBottom: 12
82
+ },
83
+ fontType: "green"
84
+ })]
85
+ }), type === 'month' && /*#__PURE__*/_jsxs(_Fragment, {
86
+ children: [/*#__PURE__*/_jsx(VmFactor, {
87
+ name: "\u603B\u6709\u6548\u4F5C\u4E1A\u65F6\u957F",
88
+ unit: "h",
89
+ value: validWorkHour || 0,
90
+ img: isDark ? allTimeDark : allTimeLight,
91
+ fontType: "blue"
92
+ }), /*#__PURE__*/_jsx(VmFactor, {
93
+ name: "\u65E5\u5747\u6709\u6548\u4F5C\u4E1A\u65F6\u957F",
94
+ unit: "h",
95
+ value: avgWorkHour || '--',
96
+ img: isDark ? avgDark : avgLight,
97
+ fontType: "green",
98
+ style: {
99
+ marginBottom: 12
100
+ }
101
+ })]
102
+ })]
103
+ })
104
+ }), /*#__PURE__*/_jsx(Col, {
105
+ span: 15,
106
+ children: /*#__PURE__*/_jsx("div", {
107
+ className: "staff-base-right--right",
108
+ children: /*#__PURE__*/_jsx("div", {
109
+ className: "staff-base-static-chart",
110
+ children: detail.length ? /*#__PURE__*/_jsx(VmPieCharts, {
111
+ unit: "h",
112
+ name: "",
113
+ innerRadius: ['50%', '65%'],
114
+ outerRadius: ['65%', '70%'],
115
+ dataList: detail,
116
+ legendConfig: {
117
+ right: 20
118
+ }
119
+ }) : /*#__PURE__*/_jsx(VmEmpty, {
120
+ type: "NO_CHART"
121
+ })
122
+ })
123
+ })
124
+ })]
40
125
  });
41
126
  }
42
127
  export default WorkStaticDay;
@@ -11,26 +11,15 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
11
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
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
13
  import { useSetState } from 'ahooks';
14
- import { Col, Row } from 'antd';
15
14
  import dayjs from 'dayjs';
16
- import { VmExtraTab, VmFactor, VmInfoCollection, VmMap, VmTitle, VmWrapper } from "../../../_components";
15
+ import { VmExtraTab, VmInfoCollection, VmMap, VmTitle, VmWrapper } from "../../../_components";
17
16
  import useSettings from "../../../_hooks/useSettings";
18
17
  import { BaseService } from "../../api";
19
- import mileageLight from "../../imgs/mileage.png";
20
- import mileageDark from "../../imgs/mileage_dark.png";
21
- import onlineLight from "../../imgs/online.png";
22
- import onlineDark from "../../imgs/online_dark.png";
23
- import allTimeLight from "../../imgs/all_time.png";
24
- import allTimeDark from "../../imgs/all_time_dark.png";
25
- import avgLight from "../../imgs/avg.png";
26
- import avgDark from "../../imgs/avg_dark.png";
27
18
  import "./index.less";
28
19
  import ListZymx from "./ListZymx";
29
20
  import WorkStatic from "./WorkStatic";
30
- import WorkStaticDay from "./WorkStaticDay";
31
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
21
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
32
22
  var BaseInfo = function BaseInfo(props) {
33
- var _workInfoRes$totalMil;
34
23
  var id = props.id,
35
24
  baseInfo = props.baseInfo,
36
25
  realInfo = props.realInfo,
@@ -39,25 +28,19 @@ var BaseInfo = function BaseInfo(props) {
39
28
  service = _props$service === void 0 ? '' : _props$service;
40
29
  var _useSettings = useSettings(),
41
30
  theme = _useSettings.theme,
42
- isDark = _useSettings.isDark,
43
31
  mapInfo = _useSettings.mapInfo;
44
32
  var _useSetState = useSetState({
45
- activeKey: '1',
33
+ activeKey: 'day',
46
34
  contentStyle: {}
47
35
  }),
48
36
  _useSetState2 = _slicedToArray(_useSetState, 2),
49
37
  state = _useSetState2[0],
50
38
  setState = _useSetState2[1];
51
- var activeKey = state.activeKey,
52
- contentStyle = state.contentStyle;
39
+ var activeKey = state.activeKey;
53
40
  var mapPoints = realInfo.mapPoints,
54
41
  pointLngLat = realInfo.pointLngLat,
55
42
  mapPolygons = realInfo.mapPolygons,
56
43
  realtimeInfo = realInfo.realtimeInfo;
57
- var _BaseService$useWorkI = BaseService.useWorkInfo(id, dayjs().format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD'), service),
58
- workInfoRes = _BaseService$useWorkI.workInfoRes;
59
- var _BaseService$useWorkS = BaseService.useWorkStatic(id, dayjs().startOf('M').format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD'), service),
60
- workStaticRes = _BaseService$useWorkS.workStaticRes;
61
44
  var baseTabContent = /*#__PURE__*/_jsx(VmInfoCollection, {
62
45
  data: baseInfo,
63
46
  gap: 8,
@@ -94,73 +77,22 @@ var BaseInfo = function BaseInfo(props) {
94
77
  extra: /*#__PURE__*/_jsx(VmExtraTab, {
95
78
  data: [{
96
79
  title: '今日',
97
- key: '1'
80
+ key: 'day'
98
81
  }, {
99
82
  title: '本月',
100
- key: '2'
83
+ key: 'month'
101
84
  }],
102
85
  onChange: function onChange(key) {
103
86
  setState({
104
87
  activeKey: key
105
88
  });
106
- }
89
+ },
90
+ value: activeKey
107
91
  }),
108
- children: /*#__PURE__*/_jsx(_Fragment, {
109
- children: /*#__PURE__*/_jsxs(Row, {
110
- children: [/*#__PURE__*/_jsx(Col, {
111
- span: 9,
112
- children: /*#__PURE__*/_jsxs("div", {
113
- className: "staff-base-right-static",
114
- children: [activeKey === '1' && /*#__PURE__*/_jsxs(_Fragment, {
115
- children: [/*#__PURE__*/_jsx(VmFactor, {
116
- name: "\u4ECA\u65E5\u884C\u8D70",
117
- unit: "km",
118
- value: (workInfoRes === null || workInfoRes === void 0 || (_workInfoRes$totalMil = workInfoRes.totalMileage) === null || _workInfoRes$totalMil === void 0 ? void 0 : _workInfoRes$totalMil.toFixed(2)) || 0,
119
- img: isDark ? mileageDark : mileageLight,
120
- fontType: "blue"
121
- }), /*#__PURE__*/_jsx(VmFactor, {
122
- name: "\u4ECA\u65E5\u5728\u7EBF",
123
- unit: "",
124
- value: (workInfoRes === null || workInfoRes === void 0 ? void 0 : workInfoRes.onlineTimeStr) || '--',
125
- img: isDark ? onlineDark : onlineLight,
126
- style: {
127
- marginBottom: 12
128
- },
129
- fontType: "green"
130
- })]
131
- }), activeKey === '2' && /*#__PURE__*/_jsxs(_Fragment, {
132
- children: [/*#__PURE__*/_jsx(VmFactor, {
133
- name: "\u603B\u6709\u6548\u4F5C\u4E1A\u65F6\u957F",
134
- unit: "",
135
- value: (workStaticRes === null || workStaticRes === void 0 ? void 0 : workStaticRes.totalOnLineTimeStr) || 0,
136
- img: isDark ? allTimeDark : allTimeLight,
137
- fontType: "blue"
138
- }), /*#__PURE__*/_jsx(VmFactor, {
139
- name: "\u65E5\u5747\u6709\u6548\u4F5C\u4E1A\u65F6\u957F",
140
- unit: "",
141
- value: (workStaticRes === null || workStaticRes === void 0 ? void 0 : workStaticRes.avgOnLineTimeStr) || '--',
142
- img: isDark ? avgDark : avgLight,
143
- fontType: "green",
144
- style: {
145
- marginBottom: 12
146
- }
147
- })]
148
- })]
149
- })
150
- }), /*#__PURE__*/_jsx(Col, {
151
- span: 15,
152
- children: /*#__PURE__*/_jsxs("div", {
153
- className: "staff-base-right--right",
154
- children: [activeKey === '1' && /*#__PURE__*/_jsx(WorkStaticDay, {
155
- id: id,
156
- service: service
157
- }), activeKey === '2' && /*#__PURE__*/_jsx(WorkStatic, {
158
- id: id,
159
- workStaticRes: workStaticRes
160
- })]
161
- })
162
- })]
163
- })
92
+ children: /*#__PURE__*/_jsx(WorkStatic, {
93
+ type: activeKey,
94
+ service: service,
95
+ id: id
164
96
  })
165
97
  }), /*#__PURE__*/_jsx("div", {
166
98
  className: "staff-zymx",
@@ -137,7 +137,7 @@ var Equipment = function Equipment(props) {
137
137
  className: "staff-equip-map",
138
138
  children: /*#__PURE__*/_jsx(VmMap, _objectSpread({
139
139
  mapCenter: pointLngLat !== null && pointLngLat !== void 0 && pointLngLat.length ? pointLngLat : mapInfo === null || mapInfo === void 0 ? void 0 : mapInfo.mapCenter,
140
- newMapPoints: mapPoints
140
+ mapPoints: mapPoints
141
141
  }, customMapInfo))
142
142
  })
143
143
  })]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtx/modals2",
3
- "version": "5.0.30",
3
+ "version": "5.0.32",
4
4
  "description": "弹窗组件",
5
5
  "license": "MIT",
6
6
  "module": "lib/index.js",
@@ -1,48 +0,0 @@
1
- /**
2
- * 区域进场量分析
3
- */
4
-
5
- import dayjs from 'dayjs';
6
- import { VmEmpty, VmPieCharts } from "../../../_components";
7
- import { BaseService } from "../../api";
8
- import "./index.less";
9
- import { jsx as _jsx } from "react/jsx-runtime";
10
- function WorkStaticDay(_ref) {
11
- var _workStaticRes$detail, _workStaticRes$detail2;
12
- var id = _ref.id,
13
- _ref$service = _ref.service,
14
- service = _ref$service === void 0 ? '' : _ref$service;
15
- var _BaseService$useWorkS = BaseService.useWorkStatic(id, dayjs().format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD'), service),
16
- workStaticRes = _BaseService$useWorkS.workStaticRes;
17
- return /*#__PURE__*/_jsx("div", {
18
- className: "staff-base-static-chart",
19
- children: workStaticRes !== null && workStaticRes !== void 0 && (_workStaticRes$detail = workStaticRes.details) !== null && _workStaticRes$detail !== void 0 && _workStaticRes$detail.length ? /*#__PURE__*/_jsx(VmPieCharts, {
20
- unit: "",
21
- name: "",
22
- innerRadius: ['50%', '65%'],
23
- outerRadius: ['65%', '70%'],
24
- dataList: (workStaticRes === null || workStaticRes === void 0 || (_workStaticRes$detail2 = workStaticRes.details) === null || _workStaticRes$detail2 === void 0 ? void 0 : _workStaticRes$detail2.length) > 0 ? workStaticRes === null || workStaticRes === void 0 ? void 0 : workStaticRes.details.map(function (ele) {
25
- return {
26
- name: ele.statusName,
27
- value: ele.duration / 1000,
28
- durationStr: ele.durationStr
29
- };
30
- }) : [],
31
- legendConfig: {
32
- formatter: function formatter(name) {
33
- var value = workStaticRes === null || workStaticRes === void 0 ? void 0 : workStaticRes.details.find(function (item) {
34
- return item.statusName === name;
35
- });
36
- if (value) {
37
- return "\t\t".concat(name, "\t\t").concat(value.durationStr, "\t\t");
38
- } else {
39
- return '';
40
- }
41
- }
42
- }
43
- }) : /*#__PURE__*/_jsx(VmEmpty, {
44
- type: "NO_CHART"
45
- })
46
- });
47
- }
48
- export default WorkStaticDay;