@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.
- package/lib/_components/index.js +1 -0
- package/lib/_components/vm-appraisal-info/api.js +55 -0
- package/lib/_components/vm-appraisal-info/imgs/count.png +0 -0
- package/lib/_components/vm-appraisal-info/imgs/count_light.png +0 -0
- package/lib/_components/vm-appraisal-info/imgs/subtract.png +0 -0
- package/lib/_components/vm-appraisal-info/imgs/subtract_light.png +0 -0
- package/lib/_components/vm-appraisal-info/index.js +230 -0
- package/lib/_components/vm-appraisal-info/index.less +7 -0
- package/lib/_components/vm-card-statistics/index.less +27 -27
- package/lib/_components/vm-factor-list/index.less +11 -11
- package/lib/_components/vm-filter/style/index.less +7 -11
- package/lib/_components/vm-line-charts/index.js +4 -1
- package/lib/_components/vm-repair-maintain/index.js +32 -0
- package/lib/_components/vm-video/HistoryGrid.js +53 -3
- package/lib/_components/vm-video/RealtimeGrid.js +24 -3
- package/lib/_components/vm-video/index.js +99 -37
- package/lib/_components/vm-video/index.less +18 -14
- package/lib/_hooks/useGetChannels.js +20 -6
- package/lib/_util/http.js +26 -0
- package/lib/vtx-base-modal/Tabs/index.js +2 -1
- package/lib/vtx-car-modal/components/Info/index.js +1 -1
- package/lib/vtx-car-modal/components/Info/index.less +6 -6
- package/lib/vtx-car-modal/content/Common/OilConsumption/index.less +6 -6
- package/lib/vtx-car-modal/content/Common/WaterConsumption/index.less +6 -6
- package/lib/vtx-car-modal/content/Ljsy/WorkRecord/Detail.js +2 -1
- package/lib/vtx-cc-unit-modal/components/BaseInfo/index.less +6 -6
- package/lib/vtx-cp-modal/components/BaseInfo/CarWork.js +2 -5
- package/lib/vtx-cp-modal/components/BaseInfo/TodayWork.js +7 -1
- package/lib/vtx-cp-modal/components/ExeceptionInfo/AlarmRecord.js +8 -4
- package/lib/vtx-cp-modal/index.js +12 -12
- package/lib/vtx-default-modal/index.js +5 -4
- package/lib/vtx-device-modal/components/DataAnalysis/index.less +66 -66
- package/lib/vtx-df-modal/index.js +3 -13
- package/lib/vtx-kh-modal/components/Record/index.js +1 -205
- package/lib/vtx-restaurant-modal/components/Basic/index.less +16 -16
- package/lib/vtx-road-modal/components/BaseInfo/Work.js +9 -1
- package/lib/vtx-road-modal/components/LaneBaseInfo/Work.js +8 -1
- package/lib/vtx-road-modal/index.js +6 -3
- package/lib/vtx-road-modal/utils/url.js +12 -0
- package/lib/vtx-shxq-modal/api.js +2 -2
- package/lib/vtx-shxq-modal/index.js +18 -3
- package/lib/vtx-staff-modal/components/AlarmInfo/Charts.js +4 -1
- package/lib/vtx-wr-modal/index.js +23 -4
- package/lib/vtx-zzz-modal/index.js +6 -12
- package/package.json +92 -92
|
@@ -26,6 +26,29 @@ import "./index.less";
|
|
|
26
26
|
import RealtimeGrid from "./RealtimeGrid";
|
|
27
27
|
import { translateLocaleText } from "./../../hooks/useTranslation.js";
|
|
28
28
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
29
|
+
export var VIDEO_TAB_KEY = 'video';
|
|
30
|
+
export var getVideoTab = function getVideoTab() {
|
|
31
|
+
return {
|
|
32
|
+
key: VIDEO_TAB_KEY,
|
|
33
|
+
title: translateLocaleText("t('vtxdevicemodal.video')")
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export var isVideoTab = function isVideoTab(tab) {
|
|
37
|
+
return (tab === null || tab === void 0 ? void 0 : tab.key) === VIDEO_TAB_KEY || "".concat((tab === null || tab === void 0 ? void 0 : tab.key) || '').endsWith('video');
|
|
38
|
+
};
|
|
39
|
+
export var insertVideoTab = function insertVideoTab() {
|
|
40
|
+
var tabs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
41
|
+
var channels = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
42
|
+
if (!Array.isArray(tabs) || tabs.length === 0) {
|
|
43
|
+
return tabs;
|
|
44
|
+
}
|
|
45
|
+
if (!(channels !== null && channels !== void 0 && channels.length)) {
|
|
46
|
+
return tabs.filter(function (tab) {
|
|
47
|
+
return !isVideoTab(tab);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
return tabs;
|
|
51
|
+
};
|
|
29
52
|
var VmVideo = function VmVideo(_ref) {
|
|
30
53
|
var _ref$channels = _ref.channels,
|
|
31
54
|
channels = _ref$channels === void 0 ? [] : _ref$channels;
|
|
@@ -62,6 +85,8 @@ var VmVideo = function VmVideo(_ref) {
|
|
|
62
85
|
endTime = state.endTime,
|
|
63
86
|
history = state.history;
|
|
64
87
|
useEffect(function () {
|
|
88
|
+
var s,
|
|
89
|
+
e = '';
|
|
65
90
|
if (dateType === 'custom') {
|
|
66
91
|
setState({
|
|
67
92
|
datePickerDisabled: false
|
|
@@ -70,42 +95,47 @@ var VmVideo = function VmVideo(_ref) {
|
|
|
70
95
|
setState({
|
|
71
96
|
datePickerDisabled: true
|
|
72
97
|
});
|
|
73
|
-
if (dateType === 'dayBeforeYesterday') {
|
|
74
|
-
setState({
|
|
75
|
-
startTime: dayjs().subtract(2, 'day').format('YYYY-MM-DD 00:00:00'),
|
|
76
|
-
endTime: dayjs().subtract(2, 'day').format('YYYY-MM-DD 23:59:59')
|
|
77
|
-
});
|
|
78
|
-
} else if (dateType === 'yesterday') {
|
|
79
|
-
setState({
|
|
80
|
-
startTime: dayjs().subtract(1, 'day').format('YYYY-MM-DD 00:00:00'),
|
|
81
|
-
endTime: dayjs().subtract(1, 'day').format('YYYY-MM-DD 23:59:59')
|
|
82
|
-
});
|
|
83
|
-
} else if (dateType === 'today') {
|
|
84
|
-
setState({
|
|
85
|
-
startTime: dayjs().format('YYYY-MM-DD 00:00:00'),
|
|
86
|
-
endTime: dayjs().format('YYYY-MM-DD HH:mm:ss')
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
98
|
}
|
|
99
|
+
if (dateType === 'dayBeforeYesterday') {
|
|
100
|
+
s = dayjs().subtract(2, 'day').format('YYYY-MM-DD 00:00:00');
|
|
101
|
+
e = dayjs().subtract(2, 'day').format('YYYY-MM-DD 23:59:59');
|
|
102
|
+
} else if (dateType === 'yesterday') {
|
|
103
|
+
s = dayjs().subtract(1, 'day').format('YYYY-MM-DD 00:00:00');
|
|
104
|
+
e = dayjs().subtract(1, 'day').format('YYYY-MM-DD 23:59:59');
|
|
105
|
+
} else {
|
|
106
|
+
s = dayjs().format('YYYY-MM-DD 00:00:00');
|
|
107
|
+
e = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
108
|
+
}
|
|
109
|
+
setState({
|
|
110
|
+
startTime: s,
|
|
111
|
+
endTime: e
|
|
112
|
+
});
|
|
113
|
+
form.setFieldsValue({
|
|
114
|
+
beginTime: dayjs(s),
|
|
115
|
+
endTime: dayjs(e)
|
|
116
|
+
});
|
|
90
117
|
}, [dateType]);
|
|
91
118
|
useEffect(function () {
|
|
92
119
|
if (channels !== null && channels !== void 0 && channels.length && tabKey === '1') {
|
|
93
|
-
var
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
120
|
+
var defaultCheckedChannels = channels.map(function (channel, index) {
|
|
121
|
+
return _objectSpread(_objectSpread({}, channel), {}, {
|
|
122
|
+
checked: index < 4
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
Promise.all(channels.slice(0, 4).map(function (ele) {
|
|
97
126
|
return getPreviewUrl({
|
|
98
127
|
channelNum: ele.channelNum,
|
|
99
128
|
deviceId: ele.videoDeviceId
|
|
100
129
|
});
|
|
101
130
|
})).then(function (res) {
|
|
102
|
-
setCheckedChannels(
|
|
103
|
-
|
|
131
|
+
setCheckedChannels(defaultCheckedChannels.map(function (channel, index) {
|
|
132
|
+
var _res$index;
|
|
133
|
+
return _objectSpread(_objectSpread(_objectSpread({}, channel), index < 4 ? (_res$index = res[index]) === null || _res$index === void 0 ? void 0 : _res$index.data : {}), {}, {
|
|
104
134
|
checked: index < 4
|
|
105
135
|
});
|
|
106
136
|
}));
|
|
107
137
|
});
|
|
108
|
-
}
|
|
138
|
+
}
|
|
109
139
|
if (tabKey === '2') {
|
|
110
140
|
var _channels$;
|
|
111
141
|
form.setFieldsValue({
|
|
@@ -158,13 +188,27 @@ var VmVideo = function VmVideo(_ref) {
|
|
|
158
188
|
onChange: function onChange(e) {
|
|
159
189
|
var list = cloneDeep(checkedChannels);
|
|
160
190
|
if (e.target.checked) {
|
|
191
|
+
var selectedCount = list.filter(function (channel) {
|
|
192
|
+
return channel.checked;
|
|
193
|
+
}).length + 1;
|
|
194
|
+
if (selectedCount > 9) {
|
|
195
|
+
message.warning('同时播放通道不能超过9路');
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
if (selectedCount > Number(mode)) {
|
|
199
|
+
setMode(selectedCount <= 4 ? '4' : '9');
|
|
200
|
+
}
|
|
161
201
|
getPreviewUrl({
|
|
162
202
|
channelNum: ele.channelNum,
|
|
163
|
-
deviceId: ele.deviceId
|
|
203
|
+
deviceId: ele.videoDeviceId || ele.deviceId
|
|
164
204
|
}).then(function (res) {
|
|
165
|
-
|
|
205
|
+
var _res$data, _res$data2;
|
|
206
|
+
var currentChannel = list[index];
|
|
207
|
+
list[index] = _objectSpread(_objectSpread(_objectSpread({}, currentChannel), res.data), {}, {
|
|
208
|
+
channelName: currentChannel.channelName || ((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.channelName),
|
|
209
|
+
deviceName: currentChannel.deviceName || ((_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.deviceName),
|
|
166
210
|
checked: true
|
|
167
|
-
}
|
|
211
|
+
});
|
|
168
212
|
setCheckedChannels(list);
|
|
169
213
|
});
|
|
170
214
|
} else {
|
|
@@ -200,8 +244,8 @@ var VmVideo = function VmVideo(_ref) {
|
|
|
200
244
|
requiredMark: false,
|
|
201
245
|
colon: true,
|
|
202
246
|
initialValues: {
|
|
203
|
-
beginTime: startTime ? dayjs(startTime) : dayjs().
|
|
204
|
-
endTime: endTime ? dayjs(endTime) : dayjs().
|
|
247
|
+
beginTime: startTime ? dayjs(startTime) : dayjs().startOf('day'),
|
|
248
|
+
endTime: endTime ? dayjs(endTime) : dayjs().endOf('day')
|
|
205
249
|
},
|
|
206
250
|
autoComplete: "off",
|
|
207
251
|
children: [/*#__PURE__*/_jsx(Form.Item, {
|
|
@@ -353,15 +397,23 @@ var VmVideo = function VmVideo(_ref) {
|
|
|
353
397
|
key: '9'
|
|
354
398
|
}],
|
|
355
399
|
onChange: function onChange(key) {
|
|
356
|
-
|
|
400
|
+
var selectedCount = checkedChannels.filter(function (channel) {
|
|
401
|
+
return channel.checked;
|
|
402
|
+
}).length;
|
|
403
|
+
setMode(selectedCount > Number(key) ? selectedCount <= 4 ? '4' : '9' : key);
|
|
357
404
|
}
|
|
358
405
|
}) : /*#__PURE__*/_jsx(_Fragment, {})
|
|
359
406
|
}), /*#__PURE__*/_jsx("div", {
|
|
360
407
|
className: "vm-video-content _".concat(mode),
|
|
361
|
-
children: tabKey === '1' ? getGridItems(mode, checkedChannels
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
408
|
+
children: tabKey === '1' ? getGridItems(mode, checkedChannels, setCheckedChannels) : /*#__PURE__*/_jsx(HistoryGrid, {
|
|
409
|
+
channel: history,
|
|
410
|
+
startTime: startTime,
|
|
411
|
+
endTime: endTime,
|
|
412
|
+
onClose: function onClose() {
|
|
413
|
+
setState({
|
|
414
|
+
history: {}
|
|
415
|
+
});
|
|
416
|
+
}
|
|
365
417
|
})
|
|
366
418
|
})]
|
|
367
419
|
})]
|
|
@@ -369,18 +421,28 @@ var VmVideo = function VmVideo(_ref) {
|
|
|
369
421
|
};
|
|
370
422
|
export default VmVideo;
|
|
371
423
|
var getGridItems = function getGridItems(latestGrid, channels, setCheckedChannels) {
|
|
424
|
+
var selectedChannels = channels.filter(function (channel) {
|
|
425
|
+
return channel.checked;
|
|
426
|
+
});
|
|
372
427
|
var items = [];
|
|
373
428
|
var _loop = function _loop(i) {
|
|
374
429
|
var element = /*#__PURE__*/_jsx(RealtimeGrid, {
|
|
375
|
-
channel:
|
|
430
|
+
channel: selectedChannels[i] || {
|
|
376
431
|
channelNum: '',
|
|
377
432
|
channelId: ''
|
|
378
433
|
},
|
|
379
434
|
onClose: function onClose() {
|
|
380
435
|
var list = cloneDeep(channels);
|
|
381
|
-
list
|
|
382
|
-
|
|
383
|
-
|
|
436
|
+
var channelIndex = list.findIndex(function (channel) {
|
|
437
|
+
var _selectedChannels$i;
|
|
438
|
+
return channel.channelNum === ((_selectedChannels$i = selectedChannels[i]) === null || _selectedChannels$i === void 0 ? void 0 : _selectedChannels$i.channelNum);
|
|
439
|
+
});
|
|
440
|
+
if (channelIndex === -1) {
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
list[channelIndex].checked = false;
|
|
444
|
+
list[channelIndex].url = '';
|
|
445
|
+
list[channelIndex].player = '';
|
|
384
446
|
setCheckedChannels(list);
|
|
385
447
|
},
|
|
386
448
|
scale: 1
|
|
@@ -59,13 +59,13 @@
|
|
|
59
59
|
padding-top: 12px;
|
|
60
60
|
overflow-y: auto;
|
|
61
61
|
|
|
62
|
-
.channels--item {
|
|
63
|
-
svg {
|
|
64
|
-
|
|
65
|
-
margin-right: 2px;
|
|
66
|
-
}
|
|
67
|
-
.ant-checkbox {
|
|
68
|
-
|
|
62
|
+
.channels--item {
|
|
63
|
+
svg {
|
|
64
|
+
display: block;
|
|
65
|
+
margin-right: 2px;
|
|
66
|
+
}
|
|
67
|
+
.ant-checkbox {
|
|
68
|
+
top: 0;
|
|
69
69
|
}
|
|
70
70
|
.ant-checkbox-checked .ant-checkbox-inner {
|
|
71
71
|
background-color: var(--check-bg);
|
|
@@ -78,13 +78,17 @@
|
|
|
78
78
|
width: 15px;
|
|
79
79
|
height: 15px;
|
|
80
80
|
}
|
|
81
|
-
.ant-checkbox-wrapper {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
81
|
+
.ant-checkbox-wrapper {
|
|
82
|
+
display: inline-flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
font-size: 15px;
|
|
85
|
+
// color: var(--modal-title-color);
|
|
86
|
+
}
|
|
87
|
+
.ant-checkbox + span {
|
|
88
|
+
display: inline-flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
padding: 0 4px;
|
|
91
|
+
}
|
|
88
92
|
}
|
|
89
93
|
}
|
|
90
94
|
}
|
|
@@ -1,13 +1,27 @@
|
|
|
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 _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
1
5
|
import { useRequest } from 'ahooks';
|
|
2
6
|
import http from "../_util/http";
|
|
3
7
|
export default (function (billId, ready) {
|
|
4
|
-
var _useRequest = useRequest(function () {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
var _useRequest = useRequest( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
9
|
+
var url;
|
|
10
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
11
|
+
while (1) switch (_context.prev = _context.next) {
|
|
12
|
+
case 0:
|
|
13
|
+
url = "".concat(process.env.PREFIX || '', "/cloud/vis/base/np/videoDevice/loadVideoChannelByBillId.smvc");
|
|
14
|
+
return _context.abrupt("return", http.get(url, {
|
|
15
|
+
body: {
|
|
16
|
+
billId: billId
|
|
17
|
+
}
|
|
18
|
+
}));
|
|
19
|
+
case 2:
|
|
20
|
+
case "end":
|
|
21
|
+
return _context.stop();
|
|
8
22
|
}
|
|
9
|
-
});
|
|
10
|
-
}, {
|
|
23
|
+
}, _callee);
|
|
24
|
+
})), {
|
|
11
25
|
ready: ready,
|
|
12
26
|
refreshDeps: [billId]
|
|
13
27
|
}),
|
package/lib/_util/http.js
CHANGED
|
@@ -78,6 +78,32 @@ var Http = /*#__PURE__*/function () {
|
|
|
78
78
|
} : {})
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* 判断接口是否存在
|
|
84
|
+
* @param {*} url
|
|
85
|
+
*/
|
|
86
|
+
}, {
|
|
87
|
+
key: "exists",
|
|
88
|
+
value: function exists(url) {
|
|
89
|
+
var _url = baseUrlPrefix + url;
|
|
90
|
+
var token = getVtxToken('token');
|
|
91
|
+
return axios.head(_url, {
|
|
92
|
+
validateStatus: function validateStatus() {
|
|
93
|
+
return true;
|
|
94
|
+
},
|
|
95
|
+
headers: {
|
|
96
|
+
Authorization: token ? "Bearer ".concat(token) : '',
|
|
97
|
+
tenantId: getVtxToken('tenantId'),
|
|
98
|
+
userId: getVtxToken('userId')
|
|
99
|
+
}
|
|
100
|
+
}).then(function (res) {
|
|
101
|
+
return res.status !== 404;
|
|
102
|
+
}).catch(function (error) {
|
|
103
|
+
var _error$response;
|
|
104
|
+
return (error === null || error === void 0 || (_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.status) !== 404;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
81
107
|
/**
|
|
82
108
|
* get 请求
|
|
83
109
|
* @param {*} url
|
|
@@ -124,7 +124,8 @@ var Tabs = function Tabs(props) {
|
|
|
124
124
|
children: tabs.map(function (tab, index) {
|
|
125
125
|
var width = 26,
|
|
126
126
|
height = 26;
|
|
127
|
-
var
|
|
127
|
+
var suffixKey = "".concat(tab.key || '').split('-').slice(1).join('-');
|
|
128
|
+
var ComponentIcon = iconRender[tab.key] || iconRender[suffixKey] || SummaryIcon;
|
|
128
129
|
return /*#__PURE__*/_jsxs("div", {
|
|
129
130
|
onClick: function onClick() {
|
|
130
131
|
onChange(tab.key);
|
|
@@ -110,7 +110,7 @@ var Info = function Info(_ref) {
|
|
|
110
110
|
var list = [{
|
|
111
111
|
name: translateLocaleText("t('vtxcarmodal.today')"),
|
|
112
112
|
unit: 'km',
|
|
113
|
-
value: (info === null || info === void 0 ? void 0 : info.
|
|
113
|
+
value: (info === null || info === void 0 ? void 0 : info.accuMileage) || 0,
|
|
114
114
|
img: showListImg ? isDark ? darkRunIcon : runIcon : null,
|
|
115
115
|
fontType: 'blue'
|
|
116
116
|
}, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
.vm-car-map-wrap {
|
|
2
|
-
flex: 1;
|
|
3
|
-
min-height: 0;
|
|
4
|
-
width: 100%;
|
|
5
|
-
margin-top: 10px;
|
|
6
|
-
}
|
|
1
|
+
.vm-car-map-wrap {
|
|
2
|
+
flex: 1;
|
|
3
|
+
min-height: 0;
|
|
4
|
+
width: 100%;
|
|
5
|
+
margin-top: 10px;
|
|
6
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
.vtx-car-water-wrap {
|
|
2
|
-
height: 100%;
|
|
3
|
-
display: flex;
|
|
4
|
-
gap: 16px;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
}
|
|
1
|
+
.vtx-car-water-wrap {
|
|
2
|
+
height: 100%;
|
|
3
|
+
display: flex;
|
|
4
|
+
gap: 16px;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
}
|
|
@@ -59,7 +59,8 @@ var Detail = function Detail(_ref) {
|
|
|
59
59
|
dataIndex: 'collectPointName',
|
|
60
60
|
key: 'collectPointName',
|
|
61
61
|
fixed: 'left',
|
|
62
|
-
width: 160
|
|
62
|
+
width: 160,
|
|
63
|
+
ellipsis: true
|
|
63
64
|
}, {
|
|
64
65
|
title: translateLocaleText("t('vtxcarmodal.hours10')"),
|
|
65
66
|
dataIndex: 'actualCollectTime',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
.vm-cc-unit-map-wrap {
|
|
2
|
-
flex: 1;
|
|
3
|
-
min-height: 230px;
|
|
4
|
-
width: 100%;
|
|
5
|
-
margin-top: 10px;
|
|
6
|
-
}
|
|
1
|
+
.vm-cc-unit-map-wrap {
|
|
2
|
+
flex: 1;
|
|
3
|
+
min-height: 230px;
|
|
4
|
+
width: 100%;
|
|
5
|
+
margin-top: 10px;
|
|
6
|
+
}
|
|
@@ -94,13 +94,10 @@ export default function CarWork(props) {
|
|
|
94
94
|
}
|
|
95
95
|
var tableProps = {
|
|
96
96
|
scroll: {
|
|
97
|
-
y:
|
|
97
|
+
y: 245,
|
|
98
98
|
x: '100%'
|
|
99
99
|
},
|
|
100
|
-
pagination:
|
|
101
|
-
current: 1,
|
|
102
|
-
pageSize: 10
|
|
103
|
-
},
|
|
100
|
+
pagination: false,
|
|
104
101
|
indexWidth: '8%',
|
|
105
102
|
dataSource: (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) > 0 ? dataSource.map(function (ele, index) {
|
|
106
103
|
var _ele$bidSectionName;
|
|
@@ -53,6 +53,12 @@ export default function TodayWork(props) {
|
|
|
53
53
|
};
|
|
54
54
|
var getValue = function getValue(name, id) {
|
|
55
55
|
var strokeColor = '#1890FF';
|
|
56
|
+
if (!name) {
|
|
57
|
+
return {
|
|
58
|
+
strokeColor: strokeColor,
|
|
59
|
+
src: isDark ? allRateDark : allRate
|
|
60
|
+
};
|
|
61
|
+
}
|
|
56
62
|
var src = name === '全部' ? isDark ? allRateDark : allRate : getIcon(id);
|
|
57
63
|
if (isDark) {
|
|
58
64
|
if (name.indexOf('全部') > -1) {
|
|
@@ -101,7 +107,7 @@ export default function TodayWork(props) {
|
|
|
101
107
|
className: "twork--item-progress",
|
|
102
108
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
103
109
|
className: "twork--item-progress-row",
|
|
104
|
-
children: ["".concat(item === null || item === void 0 ? void 0 : item.productTypeName).concat(translateLocaleText("t('vtxcpmodal.completionRateColon')")), "".concat(item.rate || 0, "%")]
|
|
110
|
+
children: ["".concat((item === null || item === void 0 ? void 0 : item.productTypeName) || '-').concat(translateLocaleText("t('vtxcpmodal.completionRateColon')")), "".concat(item.rate || 0, "%")]
|
|
105
111
|
}), /*#__PURE__*/_jsx(Progress, {
|
|
106
112
|
strokeLinecap: "butt",
|
|
107
113
|
percent: item.rate,
|
|
@@ -94,19 +94,23 @@ export default function AlarmRecord(props) {
|
|
|
94
94
|
title: translateLocaleText("t('vtxzgmodal.hours')"),
|
|
95
95
|
dataIndex: 'submitDate',
|
|
96
96
|
key: 'submitDate',
|
|
97
|
-
sorter: true
|
|
97
|
+
sorter: true,
|
|
98
|
+
width: 150
|
|
98
99
|
}, {
|
|
99
100
|
title: translateLocaleText("t('vtxcccpmodal.type3')"),
|
|
100
101
|
dataIndex: 'abnormalTypeStr',
|
|
101
|
-
key: 'abnormalTypeStr'
|
|
102
|
+
key: 'abnormalTypeStr',
|
|
103
|
+
width: 120
|
|
102
104
|
}, {
|
|
103
105
|
title: translateLocaleText("t('vtxcpmodal.reportVehicle')"),
|
|
104
106
|
dataIndex: 'carCode',
|
|
105
|
-
key: 'carCode'
|
|
107
|
+
key: 'carCode',
|
|
108
|
+
width: 120
|
|
106
109
|
}, {
|
|
107
110
|
title: translateLocaleText("t('vtxcccpmodal.status')"),
|
|
108
111
|
dataIndex: 'dealStatusStr',
|
|
109
112
|
key: 'dealStatusStr',
|
|
113
|
+
width: 120,
|
|
110
114
|
render: function render(text, record) {
|
|
111
115
|
return /*#__PURE__*/_jsxs("span", {
|
|
112
116
|
style: {
|
|
@@ -149,7 +153,7 @@ export default function AlarmRecord(props) {
|
|
|
149
153
|
};
|
|
150
154
|
var handleTableChange = function handleTableChange(sorter) {
|
|
151
155
|
setState({
|
|
152
|
-
sort: "
|
|
156
|
+
sort: "submitDate,".concat(sorter.order === 'ascend' ? 'ASC' : 'DESC')
|
|
153
157
|
});
|
|
154
158
|
};
|
|
155
159
|
var tableProps = {
|
|
@@ -3,8 +3,10 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
3
3
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
4
4
|
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); }
|
|
5
5
|
import { useMemo } from 'react';
|
|
6
|
+
import Appraisal from "../_components/vm-appraisal-info";
|
|
6
7
|
import VmCustom from "../_components/vm-custom";
|
|
7
8
|
import VmRepairMaintain from "../_components/vm-repair-maintain";
|
|
9
|
+
import VmVideo, { insertVideoTab } from "../_components/vm-video";
|
|
8
10
|
import useGetChannels from "../_hooks/useGetChannels";
|
|
9
11
|
import useGetConfig from "../_hooks/useGetConfig";
|
|
10
12
|
import VtxBaseModal from "../vtx-base-modal";
|
|
@@ -20,6 +22,7 @@ var TABS_WARNNING = 'warning';
|
|
|
20
22
|
var TABS_EXECEPTION = 'exeception';
|
|
21
23
|
var TABS_RM = 'default-rm';
|
|
22
24
|
var TABS_VIDEO = 'video';
|
|
25
|
+
var TABS_APPRAISAL = 'appraisal';
|
|
23
26
|
var VtxCpModal = function VtxCpModal(props) {
|
|
24
27
|
var id = props.id,
|
|
25
28
|
title = props.title,
|
|
@@ -59,21 +62,12 @@ var VtxCpModal = function VtxCpModal(props) {
|
|
|
59
62
|
var tabsList = tabsData;
|
|
60
63
|
if (!(facConfig !== null && facConfig !== void 0 && (_facConfig$data = facConfig.data) !== null && _facConfig$data !== void 0 && _facConfig$data.beenCollect)) {
|
|
61
64
|
tabsList = tabsList.filter(function (ele) {
|
|
62
|
-
return !['
|
|
65
|
+
return !['sy', 'warning', 'exeception'].includes(ele.key);
|
|
63
66
|
});
|
|
64
67
|
}
|
|
65
|
-
|
|
66
|
-
return ele.key === 'cp-video';
|
|
67
|
-
}) > -1) {
|
|
68
|
-
if ((channels === null || channels === void 0 ? void 0 : channels.length) < 1) {
|
|
69
|
-
tabsList = tabsList.filter(function (ele) {
|
|
70
|
-
return ele.key !== 'cp-video';
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return tabsList;
|
|
68
|
+
return insertVideoTab(tabsList, channels);
|
|
75
69
|
}, [JSON.stringify(tabsData), JSON.stringify(channels), JSON.stringify(facConfig)]);
|
|
76
|
-
var contents = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, TABS_BASE, /*#__PURE__*/_jsx(BaseInfo, {
|
|
70
|
+
var contents = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, TABS_BASE, /*#__PURE__*/_jsx(BaseInfo, {
|
|
77
71
|
id: id,
|
|
78
72
|
baseInfo: baseInfo,
|
|
79
73
|
info: info,
|
|
@@ -84,8 +78,14 @@ var VtxCpModal = function VtxCpModal(props) {
|
|
|
84
78
|
id: id
|
|
85
79
|
})), TABS_EXECEPTION, /*#__PURE__*/_jsx(ExeceptionInfo, {
|
|
86
80
|
id: id
|
|
81
|
+
})), TABS_APPRAISAL, /*#__PURE__*/_jsx(Appraisal, {
|
|
82
|
+
id: id
|
|
83
|
+
})), "rm", /*#__PURE__*/_jsx(VmRepairMaintain, {
|
|
84
|
+
id: id
|
|
87
85
|
})), TABS_RM, /*#__PURE__*/_jsx(VmRepairMaintain, {
|
|
88
86
|
id: id
|
|
87
|
+
})), TABS_VIDEO, /*#__PURE__*/_jsx(VmVideo, {
|
|
88
|
+
channels: channels
|
|
89
89
|
}));
|
|
90
90
|
// 自定义页签可配置多个,包含custom即可
|
|
91
91
|
if (tabsData !== null && tabsData !== void 0 && tabsData.length) {
|
|
@@ -15,7 +15,7 @@ import useGetConfig from "../_hooks/useGetConfig";
|
|
|
15
15
|
import { CommonService } from "../_service";
|
|
16
16
|
import VtxBaseModal from "../vtx-base-modal";
|
|
17
17
|
import Metering from "../vtx-df-modal/components/Metering";
|
|
18
|
-
import Appraisal from "../
|
|
18
|
+
import Appraisal from "../_components/vm-appraisal-info";
|
|
19
19
|
import { BaseInfo } from "./components";
|
|
20
20
|
import "./style";
|
|
21
21
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -27,6 +27,7 @@ var TABS_METERING = 'metering';
|
|
|
27
27
|
var VtxDefaultModal = function VtxDefaultModal(props) {
|
|
28
28
|
var _info$geometryInfo, _info$geometryInfo2, _info$geometryInfo3;
|
|
29
29
|
var id = props.id,
|
|
30
|
+
facilityId = props.facilityId,
|
|
30
31
|
title = props.title,
|
|
31
32
|
subTitle = props.subTitle,
|
|
32
33
|
theme = props.theme,
|
|
@@ -94,17 +95,17 @@ var VtxDefaultModal = function VtxDefaultModal(props) {
|
|
|
94
95
|
id: id
|
|
95
96
|
})), TABS_RM, /*#__PURE__*/_jsx(VmRepairMaintain, {
|
|
96
97
|
id: id
|
|
97
|
-
})), TABS_VIDEO, /*#__PURE__*/_jsx(VmVideo, {
|
|
98
|
-
channels: channels
|
|
99
98
|
})), TABS_METERING, /*#__PURE__*/_jsx(Metering, {
|
|
100
99
|
id: id
|
|
100
|
+
})), TABS_VIDEO, /*#__PURE__*/_jsx(VmVideo, {
|
|
101
|
+
channels: channels
|
|
101
102
|
}));
|
|
102
103
|
// 自定义页签可配置多个,包含custom即可
|
|
103
104
|
if (tabsData !== null && tabsData !== void 0 && tabsData.length) {
|
|
104
105
|
tabsData.forEach(function (ele) {
|
|
105
106
|
if (ele.url) {
|
|
106
107
|
contents[ele.key] = /*#__PURE__*/_jsx(VmCustom, {
|
|
107
|
-
id: id,
|
|
108
|
+
id: ele.url.indexOf('type=1') > -1 ? facilityId : id,
|
|
108
109
|
url: ele === null || ele === void 0 ? void 0 : ele.url
|
|
109
110
|
});
|
|
110
111
|
}
|