Commit 924d657124253844ea44741240f189a77fd93a96

Authored by xp.Huang
2 parents 0dcd4865 b5ecc78c

Merge branch 'fix/camera/manage/list-GBT' into 'main_dev'

fix:修复分屏模式下国标视频没有请求接口

See merge request yunteng/thingskit-front!1238
... ... @@ -100,4 +100,10 @@ export interface CameraRecord {
100 100 status: boolean;
101 101 accessMode: number;
102 102 playProtocol: number;
  103 + deviceId?: string;
  104 + channelId?: string;
  105 + params?: {
  106 + channelNo: string;
  107 + deviceId: string;
  108 + };
103 109 }
... ...
... ... @@ -20,6 +20,7 @@
20 20 import { isRtspProtocol } from '/@/components/Video/src/utils';
21 21 import { useFingerprint } from '/@/utils/useFingerprint';
22 22 import { GetResult } from '@fingerprintjs/fingerprintjs';
  23 + import { getVideoControlStart } from '/@/api/device/videoChannel';
23 24
24 25 const props = defineProps({
25 26 mode: {
... ... @@ -76,13 +77,6 @@
76 77
77 78 const result = await getResult();
78 79 fingerprintResult.value = result;
79   - for (const item of items) {
80   - (item as CameraRecordItem).isTransform = false;
81   - (item as CameraRecordItem).videoPlayerOptions = {
82   - ...basicVideoPlayOptions,
83   - };
84   - beforeVideoPlay(item, result);
85   - }
86 80 if (items.length < pagination.pageSize) {
87 81 const fillArr: any = Array.from({ length: pagination.pageSize - items.length }).map(() => ({
88 82 id: buildUUID(),
... ... @@ -91,6 +85,14 @@
91 85 items = [...items, ...fillArr];
92 86 }
93 87 cameraList.value = items;
  88 +
  89 + for (const item of unref(cameraList)) {
  90 + (item as CameraRecordItem).isTransform = false;
  91 + (item as CameraRecordItem).videoPlayerOptions = {
  92 + ...basicVideoPlayOptions,
  93 + };
  94 + beforeVideoPlay(item as CameraRecordItem, result);
  95 + }
94 96 } catch (error) {
95 97 } finally {
96 98 loading.value = false;
... ... @@ -122,6 +124,24 @@
122 124 record.isTransform = true;
123 125 }
124 126 }
  127 + if (record.accessMode === AccessMode.GBT28181) {
  128 + try {
  129 + const { params } = record;
  130 + if (params?.channelNo && params.deviceId) {
  131 + const result = await getVideoControlStart({
  132 + deviceId: params.deviceId,
  133 + channelId: params.channelNo,
  134 + });
  135 +
  136 + (record as CameraRecordItem).videoPlayerOptions = {
  137 + ...basicVideoPlayOptions,
  138 + sources: [{ src: result.data.flv, type: getVideoTypeByUrl(result.data.flv) }],
  139 + };
  140 + }
  141 + } finally {
  142 + record.isTransform = true;
  143 + }
  144 + }
125 145 if (record.accessMode === AccessMode.Streaming) {
126 146 try {
127 147 const { data: { url } = { url: '' } } = await getStreamingPlayUrl(record.id!);
... ...