...
|
...
|
@@ -3,6 +3,11 @@ |
3
|
3
|
class="bg-neutral-100 dark:text-gray-300 dark:bg-dark-700 p-4"
|
4
|
4
|
@register="registerTable"
|
5
|
5
|
>
|
|
6
|
+ <template #toolbar>
|
|
7
|
+ <Authority :value="GBT28181_DEVICE_PERMISSION_ENUM.PLAY_SYNC">
|
|
8
|
+ <a-button type="primary" @click="handleSyncPlay">通道同步</a-button>
|
|
9
|
+ </Authority>
|
|
10
|
+ </template>
|
6
|
11
|
<template #hasAudio="{ record }">
|
7
|
12
|
<Switch
|
8
|
13
|
:checked="record.status === 1"
|
...
|
...
|
@@ -17,25 +22,26 @@ |
17
|
22
|
:actions="[
|
18
|
23
|
{
|
19
|
24
|
label: '播放',
|
20
|
|
- auth: 'api:yt:sceneLinkage:get',
|
|
25
|
+ auth: GBT28181_DEVICE_PERMISSION_ENUM.PLAY_SYNC,
|
21
|
26
|
icon: 'ant-design:play-circle-outlined',
|
22
|
27
|
onClick: handlePlay.bind(null, record),
|
23
|
28
|
},
|
24
|
29
|
{
|
25
|
|
- label: '停止点播',
|
26
|
|
- auth: 'api:yt:sceneLinkage:get',
|
|
30
|
+ label: '停止',
|
|
31
|
+ auth: GBT28181_DEVICE_PERMISSION_ENUM.STOP,
|
27
|
32
|
icon: 'ant-design:pause-outlined',
|
28
|
33
|
onClick: handleStopPlay.bind(null, record),
|
|
34
|
+ ifShow: !!record?.streamId, //通道号存在则显示停止点播按钮
|
29
|
35
|
},
|
30
|
36
|
]"
|
31
|
37
|
/>
|
32
|
38
|
</template>
|
33
|
39
|
</BasicTable>
|
34
|
|
- <VideoModal @register="registerModal" />
|
|
40
|
+ <VideoModal @register="registerModal" @reloadTable="reload()" />
|
35
|
41
|
</template>
|
36
|
42
|
|
37
|
43
|
<script lang="ts" setup>
|
38
|
|
- import { configColumns, searchFormSchema } from './config';
|
|
44
|
+ import { configColumns, searchFormSchema, GBT28181_DEVICE_PERMISSION_ENUM } from './config';
|
39
|
45
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
40
|
46
|
import { Switch } from 'ant-design-vue';
|
41
|
47
|
import { DeviceRecord } from '/@/api/device/model/deviceModel';
|
...
|
...
|
@@ -43,7 +49,8 @@ |
43
|
49
|
import { useModal } from '/@/components/Modal';
|
44
|
50
|
import { useMessage } from '/@/hooks/web/useMessage';
|
45
|
51
|
import { getVideoChannelList } from '/@/api/device/videoChannel';
|
46
|
|
- import { stopOnDemandVideoApiGet } from '/@/api/camera/cameraManager';
|
|
52
|
+ import { stopOnDemandVideoApiGet, syncVideoApiGet } from '/@/api/camera/cameraManager';
|
|
53
|
+ import { Authority } from '/@/components/Authority';
|
47
|
54
|
|
48
|
55
|
const props = defineProps<{ deviceDetail: DeviceRecord }>();
|
49
|
56
|
|
...
|
...
|
@@ -96,7 +103,15 @@ |
96
|
103
|
if (!record) return;
|
97
|
104
|
const { deviceId, channelId } = record;
|
98
|
105
|
if (await stopOnDemandVideoApiGet(deviceId, channelId)) {
|
99
|
|
- createMessage.success('已停止点播');
|
|
106
|
+ createMessage.success('已停止');
|
|
107
|
+ }
|
|
108
|
+ };
|
|
109
|
+
|
|
110
|
+ //通道同步
|
|
111
|
+ const handleSyncPlay = async () => {
|
|
112
|
+ if (await syncVideoApiGet(props.deviceDetail.tbDeviceId)) {
|
|
113
|
+ createMessage.success('已同步');
|
|
114
|
+ reload();
|
100
|
115
|
}
|
101
|
116
|
};
|
102
|
117
|
</script> |
...
|
...
|
|