@vtx/modals2 5.0.55 → 5.0.57

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.
@@ -4,14 +4,16 @@ import VmEmpty from "../vm-empty";
4
4
  import "./index.less";
5
5
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
6
6
  var GridItem = /*#__PURE__*/forwardRef(function (props, ref) {
7
+ var _channel$list;
7
8
  var channel = props.channel,
8
9
  onClose = props.onClose;
9
10
  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);
10
12
  var gridItemRef = useRef(null);
11
13
  return /*#__PURE__*/_jsx("div", {
12
14
  className: "vm-video-content-container",
13
15
  ref: gridItemRef,
14
- children: channel !== null && channel !== void 0 && channel.totalTimeUrl ? /*#__PURE__*/_jsxs(_Fragment, {
16
+ children: url ? /*#__PURE__*/_jsxs(_Fragment, {
15
17
  children: [/*#__PURE__*/_jsxs("div", {
16
18
  className: "vm-video-content-container-header",
17
19
  children: [/*#__PURE__*/_jsx("span", {
@@ -29,7 +31,7 @@ var GridItem = /*#__PURE__*/forwardRef(function (props, ref) {
29
31
  ref: ref,
30
32
  beenHasVideo: channel.beenHasVideo // 对讲
31
33
  ,
32
- url: channel.totalTimeUrl,
34
+ url: url,
33
35
  type: channel === null || channel === void 0 ? void 0 : channel.player,
34
36
  deviceIp: channel.deviceIp,
35
37
  devicePort: channel.devicePort,
@@ -128,13 +128,14 @@ var VmVideo = function VmVideo(_ref) {
128
128
  channelNum: values.channelNum,
129
129
  deviceId: channel.videoDeviceId
130
130
  }).then(function (res) {
131
- var _res$data;
132
- if (!(res !== null && res !== void 0 && (_res$data = res.data) !== null && _res$data !== void 0 && _res$data.totalTimeUrl)) {
131
+ var _data$list;
132
+ var data = (res === null || res === void 0 ? void 0 : res.data) || {};
133
+ if (!(data !== null && data !== void 0 && data.totalTimeUrl) && !((_data$list = data.list) !== null && _data$list !== void 0 && (_data$list = _data$list[0]) !== null && _data$list !== void 0 && _data$list.playbackUrl)) {
133
134
  message.info('未查询到视频!');
134
135
  return;
135
136
  }
136
137
  setState({
137
- history: res === null || res === void 0 ? void 0 : res.data
138
+ history: data
138
139
  });
139
140
  });
140
141
  };
@@ -11,15 +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 { useMemoizedFn } from 'ahooks';
14
+ import dayjs from 'dayjs';
14
15
  import React, { useMemo, useState } from 'react';
16
+ import { VmCustom } from "../_components";
15
17
  import useGetConfig from "../_hooks/useGetConfig";
16
18
  import VtxBaseModal from "../vtx-base-modal";
17
19
  import VtxCarModal from "../vtx-car-modal";
18
20
  import VtxRestaurantModal from "../vtx-restaurant-modal";
19
21
  import { AlarmInfo, BaseInfo, Calendar, ExceptionInfo, Restaurant, SyInfo } from "./components";
20
22
  import "./style";
21
- import { VmCustom } from "../_components";
22
- import dayjs from 'dayjs';
23
23
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
24
24
  var TABS_BASE = 'base';
25
25
  var TABS_SY = 'sy';
@@ -97,6 +97,7 @@ var VtxCcCpModal = function VtxCcCpModal(props) {
97
97
  date: date
98
98
  };
99
99
  }, [id, date]);
100
+ var tabContents = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, TABS_BASE, /*#__PURE__*/_jsx(BaseInfo, {})), TABS_RESTAURANT, /*#__PURE__*/_jsx(Restaurant, {})), TABS_SY, /*#__PURE__*/_jsx(SyInfo, {})), TABS_WARNNING, /*#__PURE__*/_jsx(AlarmInfo, {})), TABS_EXECEPTION, /*#__PURE__*/_jsx(ExceptionInfo, {})), TABS_CALENDAR, /*#__PURE__*/_jsx(Calendar, {}));
100
101
  // 自定义页签可配置多个,包含custom即可
101
102
  if (tabsData !== null && tabsData !== void 0 && tabsData.length) {
102
103
  tabsData.forEach(function (ele) {
@@ -119,7 +120,7 @@ var VtxCcCpModal = function VtxCcCpModal(props) {
119
120
  tabs: tabsData,
120
121
  tabChose: tabChose,
121
122
  date: date,
122
- contents: _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, TABS_BASE, /*#__PURE__*/_jsx(BaseInfo, {})), TABS_RESTAURANT, /*#__PURE__*/_jsx(Restaurant, {})), TABS_SY, /*#__PURE__*/_jsx(SyInfo, {})), TABS_WARNNING, /*#__PURE__*/_jsx(AlarmInfo, {})), TABS_EXECEPTION, /*#__PURE__*/_jsx(ExceptionInfo, {})), TABS_CALENDAR, /*#__PURE__*/_jsx(Calendar, {}))
123
+ contents: tabContents
123
124
  })
124
125
  }), carModal.visible && /*#__PURE__*/_jsx(VtxCarModal, _objectSpread(_objectSpread({}, carModal), {}, {
125
126
  theme: theme,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtx/modals2",
3
- "version": "5.0.55",
3
+ "version": "5.0.57",
4
4
  "description": "弹窗组件",
5
5
  "license": "MIT",
6
6
  "module": "lib/index.js",