|
|
@@ -108,7 +108,11 @@ const queryDate = ref('')
|
|
|
const playing = ref(false)
|
|
|
const vodData = ref({})
|
|
|
const hisData = ref([])
|
|
|
-const playinfo = ref({})
|
|
|
+const playinfo = ref({
|
|
|
+ playtype: 'playback',
|
|
|
+ deviceId: '',
|
|
|
+ channelId: '',
|
|
|
+})
|
|
|
const channelList = ref<{value: string, label: string}[]>([])
|
|
|
const playbackinfo = ref({})
|
|
|
const timeRange = ref<[string, string] | null>(null)
|
|
|
@@ -147,6 +151,7 @@ const init = () => {
|
|
|
playinfo.value = {
|
|
|
playtype: 'playback',
|
|
|
deviceId: props.device.serialNumber,
|
|
|
+ channelId:''
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -217,8 +222,8 @@ const loadDevRecord = async () => {
|
|
|
try {
|
|
|
const res = await getDevRecord(deviceId.value, channelId.value, query)
|
|
|
console.log('res :>> ', res)
|
|
|
- hisData.value = res.data.recordItems
|
|
|
- if (res.data.recordItems) {
|
|
|
+ hisData.value = res.recordItems
|
|
|
+ if (res.recordItems) {
|
|
|
const len = hisData.value.length
|
|
|
if (len > 0) {
|
|
|
if (hisData.value[0].start < start) {
|
|
|
@@ -260,10 +265,13 @@ const playback = async () => {
|
|
|
if (ssrc.value) {
|
|
|
await closeStream(deviceId.value, channelId.value, ssrc.value)
|
|
|
const res = await playbackvideo(deviceId.value, channelId.value, query)
|
|
|
- initUrl(res.data)
|
|
|
+
|
|
|
+ console.log('res :>>>>>>>>>>>>>>>> ', res)
|
|
|
+ initUrl(res)
|
|
|
} else {
|
|
|
const res = await playbackvideo(deviceId.value, channelId.value, query)
|
|
|
- initUrl(res.data)
|
|
|
+ console.log('***********************', res)
|
|
|
+ initUrl(res)
|
|
|
}
|
|
|
triggerPlay(hisData.value)
|
|
|
} catch (error) {
|
|
|
@@ -365,4 +373,14 @@ const downloadRecord = async () => {
|
|
|
onBeforeUnmount(() => {
|
|
|
closeStreamFunc()
|
|
|
})
|
|
|
+
|
|
|
+defineExpose({
|
|
|
+ loadDevRecord,
|
|
|
+ closeStreamFunc,
|
|
|
+ closeDestroy,
|
|
|
+ timePickerChange,
|
|
|
+ downloadRecord,
|
|
|
+ destroy,
|
|
|
+ queryDate
|
|
|
+})
|
|
|
</script>
|