diff --git a/public/image/offline.png b/public/image/offline.png new file mode 100644 index 0000000..c2ffcd1 --- /dev/null +++ b/public/image/offline.png Binary files differ diff --git a/public/image/offline.png b/public/image/offline.png new file mode 100644 index 0000000..c2ffcd1 --- /dev/null +++ b/public/image/offline.png Binary files differ diff --git a/src/router/modules/page.ts b/src/router/modules/page.ts index c905306..462b063 100644 --- a/src/router/modules/page.ts +++ b/src/router/modules/page.ts @@ -38,29 +38,6 @@ ], }, { - path: '/model', - component: Layout, - redirect: '/model/manage', - name: 'model', - meta: { - title: '算法管理', - icon: 'icon-model', - }, - children: [ - { - path: 'manage', - name: 'ModelManage', - component: () => import('@/views/page/model/index.vue'), - meta: { - title: '算法管理', - sidebar: false, - breadcrumb: true, - activeMenu: '/model', - }, - }, - ], - }, - { path: '/sence', component: Layout, redirect: '/sence/manage', @@ -84,6 +61,30 @@ ], }, { + path: '/model', + component: Layout, + redirect: '/model/manage', + name: 'model', + meta: { + title: '算法管理', + icon: 'icon-model', + }, + children: [ + { + path: 'manage', + name: 'ModelManage', + component: () => import('@/views/page/model/index.vue'), + meta: { + title: '算法管理', + sidebar: false, + breadcrumb: true, + activeMenu: '/model', + }, + }, + ], + }, + + { path: '/gas', component: Layout, redirect: '/gas/list', diff --git a/public/image/offline.png b/public/image/offline.png new file mode 100644 index 0000000..c2ffcd1 --- /dev/null +++ b/public/image/offline.png Binary files differ diff --git a/src/router/modules/page.ts b/src/router/modules/page.ts index c905306..462b063 100644 --- a/src/router/modules/page.ts +++ b/src/router/modules/page.ts @@ -38,29 +38,6 @@ ], }, { - path: '/model', - component: Layout, - redirect: '/model/manage', - name: 'model', - meta: { - title: '算法管理', - icon: 'icon-model', - }, - children: [ - { - path: 'manage', - name: 'ModelManage', - component: () => import('@/views/page/model/index.vue'), - meta: { - title: '算法管理', - sidebar: false, - breadcrumb: true, - activeMenu: '/model', - }, - }, - ], - }, - { path: '/sence', component: Layout, redirect: '/sence/manage', @@ -84,6 +61,30 @@ ], }, { + path: '/model', + component: Layout, + redirect: '/model/manage', + name: 'model', + meta: { + title: '算法管理', + icon: 'icon-model', + }, + children: [ + { + path: 'manage', + name: 'ModelManage', + component: () => import('@/views/page/model/index.vue'), + meta: { + title: '算法管理', + sidebar: false, + breadcrumb: true, + activeMenu: '/model', + }, + }, + ], + }, + + { path: '/gas', component: Layout, redirect: '/gas/list', diff --git a/src/views/page/video/components/getPlayer.vue b/src/views/page/video/components/getPlayer.vue index a3de374..96b4fa3 100644 --- a/src/views/page/video/components/getPlayer.vue +++ b/src/views/page/video/components/getPlayer.vue @@ -19,7 +19,10 @@ const src = ref(`${publicPath}/image/normal.png`) const webSocket = ref() watch(() => $props.id, (newVal) => { - console.log($props.status, '$props.status') + if ($props.status === '离线') { + src.value = `${publicPath}/image/offline.png` + return + } if ($props.status !== '在线') { src.value = `${publicPath}/image/normal.png` return diff --git a/public/image/offline.png b/public/image/offline.png new file mode 100644 index 0000000..c2ffcd1 --- /dev/null +++ b/public/image/offline.png Binary files differ diff --git a/src/router/modules/page.ts b/src/router/modules/page.ts index c905306..462b063 100644 --- a/src/router/modules/page.ts +++ b/src/router/modules/page.ts @@ -38,29 +38,6 @@ ], }, { - path: '/model', - component: Layout, - redirect: '/model/manage', - name: 'model', - meta: { - title: '算法管理', - icon: 'icon-model', - }, - children: [ - { - path: 'manage', - name: 'ModelManage', - component: () => import('@/views/page/model/index.vue'), - meta: { - title: '算法管理', - sidebar: false, - breadcrumb: true, - activeMenu: '/model', - }, - }, - ], - }, - { path: '/sence', component: Layout, redirect: '/sence/manage', @@ -84,6 +61,30 @@ ], }, { + path: '/model', + component: Layout, + redirect: '/model/manage', + name: 'model', + meta: { + title: '算法管理', + icon: 'icon-model', + }, + children: [ + { + path: 'manage', + name: 'ModelManage', + component: () => import('@/views/page/model/index.vue'), + meta: { + title: '算法管理', + sidebar: false, + breadcrumb: true, + activeMenu: '/model', + }, + }, + ], + }, + + { path: '/gas', component: Layout, redirect: '/gas/list', diff --git a/src/views/page/video/components/getPlayer.vue b/src/views/page/video/components/getPlayer.vue index a3de374..96b4fa3 100644 --- a/src/views/page/video/components/getPlayer.vue +++ b/src/views/page/video/components/getPlayer.vue @@ -19,7 +19,10 @@ const src = ref(`${publicPath}/image/normal.png`) const webSocket = ref() watch(() => $props.id, (newVal) => { - console.log($props.status, '$props.status') + if ($props.status === '离线') { + src.value = `${publicPath}/image/offline.png` + return + } if ($props.status !== '在线') { src.value = `${publicPath}/image/normal.png` return diff --git a/src/views/page/video/components/wsPlayer.vue b/src/views/page/video/components/wsPlayer.vue index 2a0e920..878883d 100644 --- a/src/views/page/video/components/wsPlayer.vue +++ b/src/views/page/video/components/wsPlayer.vue @@ -18,7 +18,10 @@ const src = ref(`${publicPath}/image/normal.png`) const webSocket = ref() watch(() => $props.id, (newVal) => { - console.log($props.status, '$props.status') + if ($props.status === '离线') { + src.value = `${publicPath}/image/offline.png` + return + } if ($props.status !== '在线') { src.value = `${publicPath}/image/normal.png` return diff --git a/public/image/offline.png b/public/image/offline.png new file mode 100644 index 0000000..c2ffcd1 --- /dev/null +++ b/public/image/offline.png Binary files differ diff --git a/src/router/modules/page.ts b/src/router/modules/page.ts index c905306..462b063 100644 --- a/src/router/modules/page.ts +++ b/src/router/modules/page.ts @@ -38,29 +38,6 @@ ], }, { - path: '/model', - component: Layout, - redirect: '/model/manage', - name: 'model', - meta: { - title: '算法管理', - icon: 'icon-model', - }, - children: [ - { - path: 'manage', - name: 'ModelManage', - component: () => import('@/views/page/model/index.vue'), - meta: { - title: '算法管理', - sidebar: false, - breadcrumb: true, - activeMenu: '/model', - }, - }, - ], - }, - { path: '/sence', component: Layout, redirect: '/sence/manage', @@ -84,6 +61,30 @@ ], }, { + path: '/model', + component: Layout, + redirect: '/model/manage', + name: 'model', + meta: { + title: '算法管理', + icon: 'icon-model', + }, + children: [ + { + path: 'manage', + name: 'ModelManage', + component: () => import('@/views/page/model/index.vue'), + meta: { + title: '算法管理', + sidebar: false, + breadcrumb: true, + activeMenu: '/model', + }, + }, + ], + }, + + { path: '/gas', component: Layout, redirect: '/gas/list', diff --git a/src/views/page/video/components/getPlayer.vue b/src/views/page/video/components/getPlayer.vue index a3de374..96b4fa3 100644 --- a/src/views/page/video/components/getPlayer.vue +++ b/src/views/page/video/components/getPlayer.vue @@ -19,7 +19,10 @@ const src = ref(`${publicPath}/image/normal.png`) const webSocket = ref() watch(() => $props.id, (newVal) => { - console.log($props.status, '$props.status') + if ($props.status === '离线') { + src.value = `${publicPath}/image/offline.png` + return + } if ($props.status !== '在线') { src.value = `${publicPath}/image/normal.png` return diff --git a/src/views/page/video/components/wsPlayer.vue b/src/views/page/video/components/wsPlayer.vue index 2a0e920..878883d 100644 --- a/src/views/page/video/components/wsPlayer.vue +++ b/src/views/page/video/components/wsPlayer.vue @@ -18,7 +18,10 @@ const src = ref(`${publicPath}/image/normal.png`) const webSocket = ref() watch(() => $props.id, (newVal) => { - console.log($props.status, '$props.status') + if ($props.status === '离线') { + src.value = `${publicPath}/image/offline.png` + return + } if ($props.status !== '在线') { src.value = `${publicPath}/image/normal.png` return diff --git a/src/views/page/video/index.vue b/src/views/page/video/index.vue index ec4fae1..a3623e2 100644 --- a/src/views/page/video/index.vue +++ b/src/views/page/video/index.vue @@ -24,7 +24,14 @@ const deviceList = ref([]) const resultList = ref([]) const offset = ref(1) - +const isFullScreen = ref(false) +const showFull = ref({ id: '', status: '' }) +function changeFullScreen(row: any) { + if (row.id) { + showFull.value = row + isFullScreen.value = true + } +} const loadingResult = ref(true) // 获取识别结果 const fetchResultData = () => { @@ -76,6 +83,7 @@ deviceList.value = [row] showVideo.value.push(row) fetchResultData() + changeFullScreen(row) } } fetchData() @@ -113,22 +121,7 @@ loadingResult.value = false }) } -watch(() => showVideoNum.value, (newVal, oldVal) => { - showVideo.value = [] - if (newVal === '一屏') { - showVideo.value.push(deviceList.value[0] || { url: '', id: '' }) - } - if (newVal === '二屏') { - showVideo.value.push(deviceList.value[0] || { url: '', id: '' }) - showVideo.value.push(deviceList.value[1] || { url: '', id: '' }) - } - else if (newVal === '四屏') { - showVideo.value.push(deviceList.value[0] || { url: '', id: '' }) - showVideo.value.push(deviceList.value[1] || { url: '', id: '' }) - showVideo.value.push(deviceList.value[2] || { url: '', id: '' }) - showVideo.value.push(deviceList.value[3] || { url: '', id: '' }) - } -}) + const load = () => { const row = JSON.parse(($route.query.row || '{}') as string) offset.value += 1 @@ -158,13 +151,35 @@ const playerType = ref(window.localStorage.getItem('playerType')) -const isFullScreen = ref(false) -const showFull = ref({ id: '', status: '' }) -const changeFullScreen = (row: any) => { - if (row.id) { - showFull.value = row - isFullScreen.value = true +const changeShowVideoNum = (index: number) => { + showVideoNum.value = '一屏' + showVideo.value = [] + showVideo.value.push(deviceList.value[index] || { url: '', id: '' }) + changeFullScreen(showVideo.value[0]) +} +watch(() => showVideoNum.value, (newVal, oldVal) => { + showVideo.value = [] + if (newVal === '一屏') { + // showVideo.value.push(deviceList.value[0] || { url: '', id: '' }) } + if (newVal === '二屏') { + showVideo.value.push(deviceList.value[0] || { url: '', id: '' }) + showVideo.value.push(deviceList.value[1] || { url: '', id: '' }) + } + else if (newVal === '四屏') { + showVideo.value.push(deviceList.value[0] || { url: '', id: '' }) + showVideo.value.push(deviceList.value[1] || { url: '', id: '' }) + showVideo.value.push(deviceList.value[2] || { url: '', id: '' }) + showVideo.value.push(deviceList.value[3] || { url: '', id: '' }) + isFullScreen.value = false + } +}) +const dblclickFull = () => { + if ($route.query.row) { + return + } + isFullScreen.value = false + showVideoNum.value = '四屏' } @@ -175,64 +190,91 @@
视频预览 -
- +
+ + + + 一屏 + + + + + 四屏 +
+