@vtx/modals2 6.0.0-beta.5 → 6.0.0-beta.8

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 (45) 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-card-statistics/index.less +27 -27
  10. package/lib/_components/vm-factor-list/index.less +11 -11
  11. package/lib/_components/vm-filter/style/index.less +7 -11
  12. package/lib/_components/vm-line-charts/index.js +4 -1
  13. package/lib/_components/vm-repair-maintain/index.js +32 -0
  14. package/lib/_components/vm-video/HistoryGrid.js +53 -3
  15. package/lib/_components/vm-video/RealtimeGrid.js +24 -3
  16. package/lib/_components/vm-video/index.js +99 -37
  17. package/lib/_components/vm-video/index.less +18 -14
  18. package/lib/_hooks/useGetChannels.js +20 -6
  19. package/lib/_util/http.js +26 -0
  20. package/lib/vtx-base-modal/Tabs/index.js +2 -1
  21. package/lib/vtx-car-modal/components/Info/index.js +1 -1
  22. package/lib/vtx-car-modal/components/Info/index.less +6 -6
  23. package/lib/vtx-car-modal/content/Common/OilConsumption/index.less +6 -6
  24. package/lib/vtx-car-modal/content/Common/WaterConsumption/index.less +6 -6
  25. package/lib/vtx-car-modal/content/Ljsy/WorkRecord/Detail.js +2 -1
  26. package/lib/vtx-cc-unit-modal/components/BaseInfo/index.less +6 -6
  27. package/lib/vtx-cp-modal/components/BaseInfo/CarWork.js +2 -5
  28. package/lib/vtx-cp-modal/components/BaseInfo/TodayWork.js +7 -1
  29. package/lib/vtx-cp-modal/components/ExeceptionInfo/AlarmRecord.js +8 -4
  30. package/lib/vtx-cp-modal/index.js +12 -12
  31. package/lib/vtx-default-modal/index.js +5 -4
  32. package/lib/vtx-device-modal/components/DataAnalysis/index.less +66 -66
  33. package/lib/vtx-df-modal/index.js +3 -13
  34. package/lib/vtx-kh-modal/components/Record/index.js +1 -205
  35. package/lib/vtx-restaurant-modal/components/Basic/index.less +16 -16
  36. package/lib/vtx-road-modal/components/BaseInfo/Work.js +9 -1
  37. package/lib/vtx-road-modal/components/LaneBaseInfo/Work.js +8 -1
  38. package/lib/vtx-road-modal/index.js +6 -3
  39. package/lib/vtx-road-modal/utils/url.js +12 -0
  40. package/lib/vtx-shxq-modal/api.js +2 -2
  41. package/lib/vtx-shxq-modal/index.js +18 -3
  42. package/lib/vtx-staff-modal/components/AlarmInfo/Charts.js +4 -1
  43. package/lib/vtx-wr-modal/index.js +23 -4
  44. package/lib/vtx-zzz-modal/index.js +6 -12
  45. package/package.json +92 -92
@@ -3,6 +3,7 @@ export { default as VmCalendar, VmCalendarInner, VmCalendarPercent } from "./vm-
3
3
  export { default as VmCardStatistics } from "./vm-card-statistics";
4
4
  export { default as VmCustom } from "./vm-custom";
5
5
  export { default as VmEmpty } from "./vm-empty";
6
+ export { default as VmAppraisalInfo } from "./vm-appraisal-info";
6
7
  export { default as VmExtraTab } from "./vm-extra-tab";
7
8
  export { default as VmFactor } from "./vm-factor";
8
9
  export { default as VmFactorList } from "./vm-factor-list";
@@ -0,0 +1,55 @@
1
+ import { request } from '@vtx/utils';
2
+ import { useRequest } from 'ahooks';
3
+ var BaseService = {
4
+ useKhInfo: function useKhInfo(id, startDate, endDate, checkActivityCode) {
5
+ var _useRequest = useRequest(function () {
6
+ return request.get('/cloud/zykh-reborn/kanban/resourceInfo', {
7
+ data: {
8
+ resourceId: id,
9
+ coordType: 'wgs84',
10
+ startDate: startDate,
11
+ endDate: endDate,
12
+ checkActivityCode: checkActivityCode
13
+ }
14
+ });
15
+ }, {
16
+ ready: !!id,
17
+ refreshDeps: [id, startDate, endDate, checkActivityCode]
18
+ }),
19
+ res = _useRequest.data;
20
+ return {
21
+ khRes: (res === null || res === void 0 ? void 0 : res.data) || {}
22
+ };
23
+ }
24
+ };
25
+ var ReocrdService = {
26
+ useRecordInfo: function useRecordInfo(id, startDate, endDate, checkActivityCode, page, sort) {
27
+ var _useRequest2 = useRequest(function () {
28
+ return request.get('/cloud/zykh-reborn/kanban/recordRulePage', {
29
+ data: {
30
+ resourceId: id,
31
+ startDate: startDate,
32
+ endDate: endDate,
33
+ checkActivityCode: checkActivityCode,
34
+ page: page,
35
+ size: 10,
36
+ sort: sort
37
+ }
38
+ });
39
+ }, {
40
+ ready: !!id,
41
+ refreshDeps: [id, startDate, endDate, checkActivityCode, page, sort]
42
+ }),
43
+ recordRes = _useRequest2.data,
44
+ loading = _useRequest2.loading;
45
+ var records = (recordRes === null || recordRes === void 0 ? void 0 : recordRes.data) || {
46
+ total: 0,
47
+ rows: []
48
+ };
49
+ return {
50
+ records: records,
51
+ loading: loading
52
+ };
53
+ }
54
+ };
55
+ export { BaseService, ReocrdService };
@@ -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 _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; } }
10
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
12
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
13
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
14
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
15
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
16
+ 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; }
17
+ import { VtxImage } from '@vtx/components';
18
+ import { useSetState } from 'ahooks';
19
+ import dayjs from 'dayjs';
20
+ import { translateLocaleText } from "../../hooks/useTranslation.js";
21
+ import useSettings from "../../_hooks/useSettings";
22
+ import VmFactor from "../vm-factor";
23
+ import VmFilter from "../vm-filter";
24
+ import VmTable from "../vm-table";
25
+ import VmWrapper from "../vm-wrapper";
26
+ import { BaseService, ReocrdService } from "./api";
27
+ import "./index.less";
28
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
29
+ export var APPRAISAL_TAB_KEY = 'appraisal';
30
+ export var getAppraisalTab = function getAppraisalTab() {
31
+ return {
32
+ key: APPRAISAL_TAB_KEY,
33
+ title: translateLocaleText("t('vtxwrmodal.assessmentInformation')")
34
+ };
35
+ };
36
+ export var isAppraisalTab = function isAppraisalTab(tab) {
37
+ return (tab === null || tab === void 0 ? void 0 : tab.key) === APPRAISAL_TAB_KEY || "".concat((tab === null || tab === void 0 ? void 0 : tab.key) || '').endsWith('-appraisal');
38
+ };
39
+ export var insertAppraisalTab = function insertAppraisalTab() {
40
+ var tabs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
41
+ if (!Array.isArray(tabs) || tabs.length === 0) {
42
+ return tabs;
43
+ }
44
+ if (tabs.some(isAppraisalTab)) {
45
+ return tabs;
46
+ }
47
+ var customIndex = tabs.findIndex(function (tab) {
48
+ return !!(tab !== null && tab !== void 0 && tab.url);
49
+ });
50
+ if (customIndex === -1) {
51
+ return [].concat(_toConsumableArray(tabs), [getAppraisalTab()]);
52
+ }
53
+ return [].concat(_toConsumableArray(tabs.slice(0, customIndex)), [getAppraisalTab()], _toConsumableArray(tabs.slice(customIndex)));
54
+ };
55
+ var AppraisalInfo = function AppraisalInfo(props) {
56
+ var _useSettings = useSettings(),
57
+ isDark = _useSettings.isDark;
58
+ var id = props.id;
59
+ var _useSetState = useSetState({
60
+ pagination: {
61
+ current: 1,
62
+ pageSize: 10,
63
+ total: 0
64
+ },
65
+ startDate: dayjs().startOf('M'),
66
+ endDate: dayjs(),
67
+ checkActivityCode: '1',
68
+ sort: ''
69
+ }),
70
+ _useSetState2 = _slicedToArray(_useSetState, 2),
71
+ state = _useSetState2[0],
72
+ setState = _useSetState2[1];
73
+ var pagination = state.pagination,
74
+ startDate = state.startDate,
75
+ endDate = state.endDate,
76
+ checkActivityCode = state.checkActivityCode,
77
+ sort = state.sort;
78
+ var _BaseService$useKhInf = BaseService.useKhInfo(id, startDate.format('YYYY-MM-DD'), endDate.format('YYYY-MM-DD'), checkActivityCode === '1' ? '' : checkActivityCode),
79
+ khRes = _BaseService$useKhInf.khRes;
80
+ var _ReocrdService$useRec = ReocrdService.useRecordInfo(id, startDate.format('YYYY-MM-DD'), endDate.format('YYYY-MM-DD'), checkActivityCode === '1' ? '' : checkActivityCode, pagination.current - 1, sort),
81
+ records = _ReocrdService$useRec.records,
82
+ loading = _ReocrdService$useRec.loading;
83
+ var columns = [{
84
+ title: translateLocaleText("t('vtxkhmodal.image')"),
85
+ dataIndex: 'photos',
86
+ key: 'photos',
87
+ width: 120,
88
+ render: function render(text) {
89
+ var photos = JSON.parse(text || '[]');
90
+ var a = [].concat(_toConsumableArray(photos), _toConsumableArray(photos), _toConsumableArray(photos), _toConsumableArray(photos));
91
+ return (photos === null || photos === void 0 ? void 0 : photos.length) > 0 ? /*#__PURE__*/_jsx(VtxImage.PreviewGroup, {
92
+ children: a.map(function (ele, index) {
93
+ return /*#__PURE__*/_jsx(VtxImage, {
94
+ src: "".concat(process.env.PREFIX || '', "/cloudFile/common/downloadFile?id=").concat(ele.id),
95
+ style: {
96
+ width: 80,
97
+ height: 80,
98
+ visibility: index > 0 ? 'hidden' : 'visible'
99
+ },
100
+ alt: ele.name
101
+ }, index);
102
+ })
103
+ }) : '--';
104
+ }
105
+ }, {
106
+ title: translateLocaleText("t('vtxkhmodal.hours')"),
107
+ dataIndex: 'checkDate',
108
+ key: 'checkDate',
109
+ width: 150,
110
+ ellipsis: true
111
+ }, {
112
+ title: translateLocaleText("t('vtxkhmodal.assessmentActivity')"),
113
+ dataIndex: 'checkActivityName',
114
+ key: 'checkActivityName',
115
+ width: 200
116
+ }, {
117
+ title: translateLocaleText("t('vtxkhmodal.assessor')"),
118
+ dataIndex: 'checkUserName',
119
+ key: 'checkUserName'
120
+ }, {
121
+ title: translateLocaleText("t('vtxkhmodal.group')"),
122
+ dataIndex: 'ruleGroupName',
123
+ key: 'ruleGroupName'
124
+ }, {
125
+ title: translateLocaleText("t('vtxkhmodal.assessmentStandard')"),
126
+ dataIndex: 'ruleName',
127
+ key: 'ruleName',
128
+ width: 150
129
+ }, {
130
+ title: translateLocaleText("t('vtxkhmodal.score')"),
131
+ dataIndex: 'deductPoints',
132
+ key: 'deductPoints',
133
+ align: 'right'
134
+ }];
135
+ var pageChange = function pageChange(page) {
136
+ setState({
137
+ pagination: _objectSpread(_objectSpread({}, pagination), {}, {
138
+ current: page
139
+ })
140
+ });
141
+ };
142
+ var tableProps = {
143
+ pagination: _objectSpread(_objectSpread({}, pagination), {}, {
144
+ total: records.total,
145
+ defaultPageSize: 10,
146
+ onChange: pageChange
147
+ }),
148
+ height: 384,
149
+ loading: loading,
150
+ dataSource: records.rows,
151
+ onChange: function onChange(_pagination, _filters, sorter) {
152
+ if (sorter.order) {
153
+ var order = sorter.order === 'ascend' ? 'asc' : 'desc';
154
+ setState({
155
+ sort: "".concat(sorter.field, ",").concat(order)
156
+ });
157
+ } else {
158
+ setState({
159
+ sort: ''
160
+ });
161
+ }
162
+ }
163
+ };
164
+ var filterChange = function filterChange(dateValue) {
165
+ setState({
166
+ startDate: dateValue[0],
167
+ endDate: dateValue[1]
168
+ });
169
+ };
170
+ return /*#__PURE__*/_jsxs(VmWrapper, {
171
+ title: translateLocaleText("t('vtxkhmodal.details')"),
172
+ filterType: "rangePicker",
173
+ dateValue: [startDate, endDate],
174
+ filterChange: filterChange,
175
+ extraLeft: /*#__PURE__*/_jsx(VmFilter.VMSelect, {
176
+ options: [{
177
+ value: '1',
178
+ label: translateLocaleText("t('export.all')")
179
+ }, {
180
+ value: 'RCDC',
181
+ label: translateLocaleText("t('vtxkhmodal.day')")
182
+ }, {
183
+ value: 'ZXDC',
184
+ label: translateLocaleText("t('vtxkhmodal.specialSupervision')")
185
+ }, {
186
+ value: 'DSFCP',
187
+ label: translateLocaleText("t('vtxkhmodal.thirdPartyEvaluation')")
188
+ }, {
189
+ value: 'RCXC',
190
+ label: translateLocaleText("t('vtxkhmodal.day2')")
191
+ }],
192
+ style: {
193
+ width: 132
194
+ },
195
+ value: checkActivityCode,
196
+ onChange: function onChange(e) {
197
+ return setState({
198
+ checkActivityCode: e
199
+ });
200
+ }
201
+ }),
202
+ children: [/*#__PURE__*/_jsx("div", {
203
+ className: "kh-record-summary",
204
+ children: [{
205
+ name: translateLocaleText("t('vtxkhmodal.times')"),
206
+ value: khRes === null || khRes === void 0 ? void 0 : khRes.monthCheckTims,
207
+ key: 'count',
208
+ unit: translateLocaleText("t('common.timesUnit')"),
209
+ fontType: 'blue'
210
+ }, {
211
+ name: translateLocaleText("t('vtxkhmodal.totalDeductedPoints')"),
212
+ value: khRes === null || khRes === void 0 ? void 0 : khRes.monthDeductPoint,
213
+ key: 'subtract',
214
+ unit: translateLocaleText("t('vtxkhmodal.scoreUnit')"),
215
+ fontType: 'red'
216
+ }].map(function (ele) {
217
+ return /*#__PURE__*/_jsx(VmFactor, _objectSpread(_objectSpread({}, ele), {}, {
218
+ img: require("./imgs/".concat(ele.key).concat(isDark ? '' : '_light', ".png")),
219
+ unitStyle: {
220
+ fontSize: 14
221
+ }
222
+ }), ele.key);
223
+ })
224
+ }), /*#__PURE__*/_jsx(VmTable, _objectSpread({
225
+ columns: columns,
226
+ rowKey: "id"
227
+ }, tableProps))]
228
+ });
229
+ };
230
+ export default AppraisalInfo;
@@ -0,0 +1,7 @@
1
+ .kh-record-summary {
2
+ display: flex;
3
+ justify-content: center;
4
+ align-items: center;
5
+ gap: 100px;
6
+ margin: 16px 0;
7
+ }
@@ -1,27 +1,27 @@
1
- .vm-car-statistics {
2
- width: 208px;
3
- height: 84px;
4
- display: flex;
5
- flex-direction: column;
6
- justify-content: space-between;
7
- padding: 20px;
8
- background-size: 100% 100%;
9
- &-label {
10
- color: var(--img-text-color);
11
- }
12
- &-value, &-unit {
13
- color: #1f1f1f;
14
- }
15
- &.vm-car-statistics-dark {
16
- .vm-car-statistics-value,.vm-car-statistics-unit {
17
- background: linear-gradient(180deg, #ffffff 0%, #119FFB 100%);
18
- background-clip: text;
19
- -webkit-text-fill-color: transparent;
20
- }
21
- }
22
- &-value {
23
- font-size: 20px;
24
- font-weight: bold;
25
- margin-right: 4px;
26
- }
27
- }
1
+ .vm-car-statistics {
2
+ width: 208px;
3
+ height: 84px;
4
+ display: flex;
5
+ flex-direction: column;
6
+ justify-content: space-between;
7
+ padding: 20px;
8
+ background-size: 100% 100%;
9
+ &-label {
10
+ color: var(--img-text-color);
11
+ }
12
+ &-value, &-unit {
13
+ color: #1f1f1f;
14
+ }
15
+ &.vm-car-statistics-dark {
16
+ .vm-car-statistics-value,.vm-car-statistics-unit {
17
+ background: linear-gradient(180deg, #ffffff 0%, #119FFB 100%);
18
+ background-clip: text;
19
+ -webkit-text-fill-color: transparent;
20
+ }
21
+ }
22
+ &-value {
23
+ font-size: 20px;
24
+ font-weight: bold;
25
+ margin-right: 4px;
26
+ }
27
+ }
@@ -1,11 +1,11 @@
1
- .vm-factor-list-wrap {
2
- display: flex;
3
- padding: 12px 16px;
4
- height: 68px;
5
- background: #F3F8FF;
6
- border-radius: 8px;
7
- gap: 26px;
8
- &.dark {
9
- background: rgba(0,136,240,0.15);
10
- }
11
- }
1
+ .vm-factor-list-wrap {
2
+ display: flex;
3
+ padding: 12px 16px;
4
+ height: 68px;
5
+ background: #F3F8FF;
6
+ border-radius: 8px;
7
+ gap: 26px;
8
+ &.dark {
9
+ background: rgba(0,136,240,0.15);
10
+ }
11
+ }
@@ -58,28 +58,24 @@
58
58
  --border-color: #0b6baf;
59
59
  }
60
60
 
61
- .ant-select-selector {
62
- background: var(--bg-color) !important;
63
- border-radius: 6px !important;
64
- border: 1px solid var(--border-color) !important;
65
- }
61
+ background: var(--bg-color) !important;
62
+ border-radius: 6px !important;
63
+ border: 1px solid var(--border-color) !important;
66
64
  .ant-select-selection-placeholder {
67
65
  color: var(--color);
68
66
  }
69
67
 
70
68
  &:hover {
71
- .ant-select-selector {
69
+ .ant-select {
72
70
  border: 1px solid var(--hover-color) !important;
73
71
  }
74
72
  }
75
73
  &.dark {
76
- .ant-select-selector {
77
- .ant-select-selection-item {
78
- color: white;
79
- }
74
+ .ant-select-content-value {
75
+ color: white;
80
76
  }
81
77
 
82
- .ant-select-arrow {
78
+ .ant-select-suffix {
83
79
  color: white;
84
80
  }
85
81
  }
@@ -64,7 +64,9 @@ var LineCharts = function LineCharts(_ref) {
64
64
  }],
65
65
  legend: _objectSpread({
66
66
  show: showLegend,
67
- right: dataList.length === 1 ? '5%' : 'center',
67
+ left: '10%',
68
+ top: 0,
69
+ height: 24,
68
70
  type: 'scroll',
69
71
  itemGap: 8,
70
72
  itemHeight: 2,
@@ -84,6 +86,7 @@ var LineCharts = function LineCharts(_ref) {
84
86
  grid: _objectSpread({
85
87
  left: 50,
86
88
  right: 50,
89
+ top: showLegend ? 40 : 20,
87
90
  bottom: showDataZoom ? 50 : 20
88
91
  }, gridOption),
89
92
  xAxis: _objectSpread({
@@ -1,3 +1,9 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
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 _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
+ function _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; }
1
7
  import { translateLocaleText } from "./../../hooks/useTranslation.js";
2
8
  /**
3
9
  * 通用-维保信息
@@ -13,6 +19,32 @@ import RmRecord from "./RmRecord";
13
19
  import RmType from "./RmType";
14
20
  import "./style";
15
21
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
+ export var REPAIR_MAINTAIN_TAB_KEY = 'rm';
23
+ export var getRepairMaintainTab = function getRepairMaintainTab() {
24
+ return {
25
+ key: REPAIR_MAINTAIN_TAB_KEY,
26
+ title: translateLocaleText("t('vtxcarmodal.maintenanceInformation')")
27
+ };
28
+ };
29
+ export var isRepairMaintainTab = function isRepairMaintainTab(tab) {
30
+ return (tab === null || tab === void 0 ? void 0 : tab.key) === REPAIR_MAINTAIN_TAB_KEY || (tab === null || tab === void 0 ? void 0 : tab.key) === 'default-rm' || "".concat((tab === null || tab === void 0 ? void 0 : tab.key) || '').endsWith('-rm');
31
+ };
32
+ export var insertRepairMaintainTab = function insertRepairMaintainTab() {
33
+ var tabs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
34
+ if (!Array.isArray(tabs) || tabs.length === 0) {
35
+ return tabs;
36
+ }
37
+ if (tabs.some(isRepairMaintainTab)) {
38
+ return tabs;
39
+ }
40
+ var customIndex = tabs.findIndex(function (tab) {
41
+ return !!(tab !== null && tab !== void 0 && tab.url);
42
+ });
43
+ if (customIndex === -1) {
44
+ return [].concat(_toConsumableArray(tabs), [getRepairMaintainTab()]);
45
+ }
46
+ return [].concat(_toConsumableArray(tabs.slice(0, customIndex)), [getRepairMaintainTab()], _toConsumableArray(tabs.slice(customIndex)));
47
+ };
16
48
  var RepaireMaintain = function RepaireMaintain(props) {
17
49
  var id = props.id;
18
50
  var date = dayjs().format('YYYY-MM-DD');
@@ -1,15 +1,61 @@
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; }
1
7
  import { HistoryPlayer } from '@vtx/player';
2
- import { forwardRef, useRef } from 'react';
8
+ import { forwardRef, useEffect, useRef, useState } from 'react';
3
9
  import VmEmpty from "../vm-empty";
4
10
  import "./index.less";
5
11
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
6
12
  var GridItem = /*#__PURE__*/forwardRef(function (props, ref) {
7
- var _channel$list;
8
13
  var channel = props.channel,
9
14
  onClose = props.onClose;
15
+ var _useState = useState(''),
16
+ _useState2 = _slicedToArray(_useState, 2),
17
+ url = _useState2[0],
18
+ setUrl = _useState2[1];
19
+ var _useState3 = useState(''),
20
+ _useState4 = _slicedToArray(_useState3, 2),
21
+ startTime = _useState4[0],
22
+ setStartTime = _useState4[1];
23
+ var _useState5 = useState(''),
24
+ _useState6 = _slicedToArray(_useState5, 2),
25
+ endTime = _useState6[0],
26
+ setEndTime = _useState6[1];
10
27
  var name = "".concat(channel === null || channel === void 0 ? void 0 : channel.deviceName, "-").concat(channel === null || channel === void 0 ? void 0 : channel.channelName);
11
- var url = (channel === null || channel === void 0 ? void 0 : channel.totalTimeUrl) || (channel === null || channel === void 0 || (_channel$list = channel.list) === null || _channel$list === void 0 || (_channel$list = _channel$list[0]) === null || _channel$list === void 0 ? void 0 : _channel$list.playbackUrl);
12
28
  var gridItemRef = useRef(null);
29
+ useEffect(function () {
30
+ var _channel$list;
31
+ var src = (channel === null || channel === void 0 ? void 0 : channel.totalTimeUrl) || (channel === null || channel === void 0 || (_channel$list = channel.list) === null || _channel$list === void 0 || (_channel$list = _channel$list[0]) === null || _channel$list === void 0 ? void 0 : _channel$list.playbackUrl);
32
+ if (channel.enableAgent) {
33
+ if (src.indexOf('http') === -1) {
34
+ setUrl("".concat(window.location.origin).concat(src));
35
+ }
36
+ } else {
37
+ setUrl(src);
38
+ }
39
+ if (channel !== null && channel !== void 0 && channel.totalTimeUrl) {
40
+ setStartTime(props === null || props === void 0 ? void 0 : props.startTime);
41
+ setEndTime(props === null || props === void 0 ? void 0 : props.endTime);
42
+ } else {
43
+ var _channel$list2, _channel$list3;
44
+ setStartTime(channel === null || channel === void 0 || (_channel$list2 = channel.list) === null || _channel$list2 === void 0 || (_channel$list2 = _channel$list2[0]) === null || _channel$list2 === void 0 ? void 0 : _channel$list2.beginTime);
45
+ setEndTime(channel === null || channel === void 0 || (_channel$list3 = channel.list) === null || _channel$list3 === void 0 || (_channel$list3 = _channel$list3[0]) === null || _channel$list3 === void 0 ? void 0 : _channel$list3.endTime);
46
+ }
47
+ }, [channel.enableAgent, props.startTime, JSON.stringify(channel)]);
48
+ useEffect(function () {
49
+ var _channel$list4;
50
+ var src = (channel === null || channel === void 0 ? void 0 : channel.totalTimeUrl) || (channel === null || channel === void 0 || (_channel$list4 = channel.list) === null || _channel$list4 === void 0 || (_channel$list4 = _channel$list4[0]) === null || _channel$list4 === void 0 ? void 0 : _channel$list4.playbackUrl);
51
+ if (channel.enableAgent) {
52
+ if (src.indexOf('http') === -1) {
53
+ setUrl("".concat(window.location.origin).concat(src));
54
+ }
55
+ } else {
56
+ setUrl(src);
57
+ }
58
+ }, [JSON.stringify(channel)]);
13
59
  return /*#__PURE__*/_jsx("div", {
14
60
  className: "vm-video-content-container",
15
61
  ref: gridItemRef,
@@ -31,7 +77,11 @@ var GridItem = /*#__PURE__*/forwardRef(function (props, ref) {
31
77
  ref: ref,
32
78
  beenHasVideo: channel.beenHasVideo // 对讲
33
79
  ,
80
+ beenHasAudio: channel.beenHasAudio // 音频
81
+ ,
34
82
  url: url,
83
+ startTime: startTime,
84
+ endTime: endTime,
35
85
  type: channel === null || channel === void 0 ? void 0 : channel.player,
36
86
  deviceIp: channel.deviceIp,
37
87
  devicePort: channel.devicePort,
@@ -1,17 +1,36 @@
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; }
1
7
  import { LivePlayer } from '@vtx/player';
2
- import { forwardRef, useRef } from 'react';
8
+ import { forwardRef, useEffect, useRef, useState } from 'react';
3
9
  import VmEmpty from "../vm-empty";
4
10
  import "./index.less";
5
11
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
6
12
  var GridItem = /*#__PURE__*/forwardRef(function (props, ref) {
7
13
  var channel = props.channel,
8
14
  onClose = props.onClose;
15
+ var _useState = useState(''),
16
+ _useState2 = _slicedToArray(_useState, 2),
17
+ url = _useState2[0],
18
+ setUrl = _useState2[1];
9
19
  var name = "".concat(channel === null || channel === void 0 ? void 0 : channel.deviceName, "-").concat(channel === null || channel === void 0 ? void 0 : channel.channelName);
10
20
  var gridItemRef = useRef(null);
21
+ useEffect(function () {
22
+ if (channel.enableAgent) {
23
+ if ((channel === null || channel === void 0 ? void 0 : channel.url.indexOf('http')) === -1) {
24
+ setUrl("".concat(window.location.origin).concat(channel.url));
25
+ }
26
+ } else {
27
+ setUrl(channel.url);
28
+ }
29
+ }, [channel.enableAgent, channel === null || channel === void 0 ? void 0 : channel.url]);
11
30
  return /*#__PURE__*/_jsx("div", {
12
31
  className: "vm-video-content-container",
13
32
  ref: gridItemRef,
14
- children: channel !== null && channel !== void 0 && channel.url ? /*#__PURE__*/_jsxs(_Fragment, {
33
+ children: url ? /*#__PURE__*/_jsxs(_Fragment, {
15
34
  children: [/*#__PURE__*/_jsxs("div", {
16
35
  className: "vm-video-content-container-header",
17
36
  children: [/*#__PURE__*/_jsx("span", {
@@ -29,7 +48,9 @@ var GridItem = /*#__PURE__*/forwardRef(function (props, ref) {
29
48
  ref: ref,
30
49
  beenHasVideo: channel.beenHasVideo // 对讲
31
50
  ,
32
- url: channel.url,
51
+ beenHasAudio: channel.beenHasAudio // 音频
52
+ ,
53
+ url: url,
33
54
  type: channel === null || channel === void 0 ? void 0 : channel.player,
34
55
  deviceIp: channel.deviceIp,
35
56
  devicePort: channel.devicePort,