diff --git a/public/config/config.json b/public/config/config.json index 991a8a7..d46ba6a 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,7 @@ { "title":"智能一体机管理系统", - "baseUrl": "http://192.168.10.236:9000", + "baseUrl": "http://192.168.10.235:9000", + "playerType": "get", "version": "1.0.0", "node": "16.18.1" } diff --git a/public/config/config.json b/public/config/config.json index 991a8a7..d46ba6a 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,7 @@ { "title":"智能一体机管理系统", - "baseUrl": "http://192.168.10.236:9000", + "baseUrl": "http://192.168.10.235:9000", + "playerType": "get", "version": "1.0.0", "node": "16.18.1" } diff --git a/src/main.ts b/src/main.ts index 39ad371..148c13c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -23,8 +23,9 @@ downloadAndInstall() // } axios.get(`./config/config.json?ts=${new Date().getTime()}`).then((res) => { - console.log(res.data, 'json文件') + // console.log(res.data, 'json文件') window.localStorage.setItem('IntegratedFront', res.data.baseUrl) + window.localStorage.setItem('playerType', res.data.playerType) request.defaults.baseURL = res.data.baseUrl // 设置默认请求网址 const app = createApp(App) // app.config.globalProperties.hasPerm = hasPermission diff --git a/public/config/config.json b/public/config/config.json index 991a8a7..d46ba6a 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,7 @@ { "title":"智能一体机管理系统", - "baseUrl": "http://192.168.10.236:9000", + "baseUrl": "http://192.168.10.235:9000", + "playerType": "get", "version": "1.0.0", "node": "16.18.1" } diff --git a/src/main.ts b/src/main.ts index 39ad371..148c13c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -23,8 +23,9 @@ downloadAndInstall() // } axios.get(`./config/config.json?ts=${new Date().getTime()}`).then((res) => { - console.log(res.data, 'json文件') + // console.log(res.data, 'json文件') window.localStorage.setItem('IntegratedFront', res.data.baseUrl) + window.localStorage.setItem('playerType', res.data.playerType) request.defaults.baseURL = res.data.baseUrl // 设置默认请求网址 const app = createApp(App) // app.config.globalProperties.hasPerm = hasPermission diff --git a/src/views/page/device/index.vue b/src/views/page/device/index.vue index fb7b5b0..6b2f837 100644 --- a/src/views/page/device/index.vue +++ b/src/views/page/device/index.vue @@ -90,6 +90,10 @@ } // 预览 const preview = (row: any) => { + if (row.status !== '在线') { + ElMessage.warning('设备不在线') + return + } $router.push({ path: '/device/preview', query: { diff --git a/public/config/config.json b/public/config/config.json index 991a8a7..d46ba6a 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,7 @@ { "title":"智能一体机管理系统", - "baseUrl": "http://192.168.10.236:9000", + "baseUrl": "http://192.168.10.235:9000", + "playerType": "get", "version": "1.0.0", "node": "16.18.1" } diff --git a/src/main.ts b/src/main.ts index 39ad371..148c13c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -23,8 +23,9 @@ downloadAndInstall() // } axios.get(`./config/config.json?ts=${new Date().getTime()}`).then((res) => { - console.log(res.data, 'json文件') + // console.log(res.data, 'json文件') window.localStorage.setItem('IntegratedFront', res.data.baseUrl) + window.localStorage.setItem('playerType', res.data.playerType) request.defaults.baseURL = res.data.baseUrl // 设置默认请求网址 const app = createApp(App) // app.config.globalProperties.hasPerm = hasPermission diff --git a/src/views/page/device/index.vue b/src/views/page/device/index.vue index fb7b5b0..6b2f837 100644 --- a/src/views/page/device/index.vue +++ b/src/views/page/device/index.vue @@ -90,6 +90,10 @@ } // 预览 const preview = (row: any) => { + if (row.status !== '在线') { + ElMessage.warning('设备不在线') + return + } $router.push({ path: '/device/preview', query: { diff --git a/src/views/page/video/components/getPlayer.vue b/src/views/page/video/components/getPlayer.vue new file mode 100644 index 0000000..a3de374 --- /dev/null +++ b/src/views/page/video/components/getPlayer.vue @@ -0,0 +1,66 @@ + + + + diff --git a/public/config/config.json b/public/config/config.json index 991a8a7..d46ba6a 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,7 @@ { "title":"智能一体机管理系统", - "baseUrl": "http://192.168.10.236:9000", + "baseUrl": "http://192.168.10.235:9000", + "playerType": "get", "version": "1.0.0", "node": "16.18.1" } diff --git a/src/main.ts b/src/main.ts index 39ad371..148c13c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -23,8 +23,9 @@ downloadAndInstall() // } axios.get(`./config/config.json?ts=${new Date().getTime()}`).then((res) => { - console.log(res.data, 'json文件') + // console.log(res.data, 'json文件') window.localStorage.setItem('IntegratedFront', res.data.baseUrl) + window.localStorage.setItem('playerType', res.data.playerType) request.defaults.baseURL = res.data.baseUrl // 设置默认请求网址 const app = createApp(App) // app.config.globalProperties.hasPerm = hasPermission diff --git a/src/views/page/device/index.vue b/src/views/page/device/index.vue index fb7b5b0..6b2f837 100644 --- a/src/views/page/device/index.vue +++ b/src/views/page/device/index.vue @@ -90,6 +90,10 @@ } // 预览 const preview = (row: any) => { + if (row.status !== '在线') { + ElMessage.warning('设备不在线') + return + } $router.push({ path: '/device/preview', query: { diff --git a/src/views/page/video/components/getPlayer.vue b/src/views/page/video/components/getPlayer.vue new file mode 100644 index 0000000..a3de374 --- /dev/null +++ b/src/views/page/video/components/getPlayer.vue @@ -0,0 +1,66 @@ + + + + diff --git a/src/views/page/video/components/wsPlayer.vue b/src/views/page/video/components/wsPlayer.vue index b3c93b6..2a0e920 100644 --- a/src/views/page/video/components/wsPlayer.vue +++ b/src/views/page/video/components/wsPlayer.vue @@ -9,12 +9,21 @@ type: String, required: true, }, + status: { + type: String, + default: '', + }, }) const publicPath = window.location.href.split('#')[0] const src = ref(`${publicPath}/image/normal.png`) const webSocket = ref() watch(() => $props.id, (newVal) => { - if (newVal) { + console.log($props.status, '$props.status') + if ($props.status !== '在线') { + src.value = `${publicPath}/image/normal.png` + return + } + if (Number(newVal)) { console.log(newVal, 'newVal') src.value = `${publicPath}/image/loaidng2.gif` // webSocket.value = new WebSocket('ws://192.168.10.135:9000/api/display/ws/video/8') @@ -36,6 +45,9 @@ src.value = `${publicPath}/image/error.png` } } + else { + src.value = `${publicPath}/image/normal.png` + } }) onUnmounted(() => { if (webSocket.value) { @@ -47,6 +59,6 @@ diff --git a/public/config/config.json b/public/config/config.json index 991a8a7..d46ba6a 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,6 +1,7 @@ { "title":"智能一体机管理系统", - "baseUrl": "http://192.168.10.236:9000", + "baseUrl": "http://192.168.10.235:9000", + "playerType": "get", "version": "1.0.0", "node": "16.18.1" } diff --git a/src/main.ts b/src/main.ts index 39ad371..148c13c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -23,8 +23,9 @@ downloadAndInstall() // } axios.get(`./config/config.json?ts=${new Date().getTime()}`).then((res) => { - console.log(res.data, 'json文件') + // console.log(res.data, 'json文件') window.localStorage.setItem('IntegratedFront', res.data.baseUrl) + window.localStorage.setItem('playerType', res.data.playerType) request.defaults.baseURL = res.data.baseUrl // 设置默认请求网址 const app = createApp(App) // app.config.globalProperties.hasPerm = hasPermission diff --git a/src/views/page/device/index.vue b/src/views/page/device/index.vue index fb7b5b0..6b2f837 100644 --- a/src/views/page/device/index.vue +++ b/src/views/page/device/index.vue @@ -90,6 +90,10 @@ } // 预览 const preview = (row: any) => { + if (row.status !== '在线') { + ElMessage.warning('设备不在线') + return + } $router.push({ path: '/device/preview', query: { diff --git a/src/views/page/video/components/getPlayer.vue b/src/views/page/video/components/getPlayer.vue new file mode 100644 index 0000000..a3de374 --- /dev/null +++ b/src/views/page/video/components/getPlayer.vue @@ -0,0 +1,66 @@ + + + + diff --git a/src/views/page/video/components/wsPlayer.vue b/src/views/page/video/components/wsPlayer.vue index b3c93b6..2a0e920 100644 --- a/src/views/page/video/components/wsPlayer.vue +++ b/src/views/page/video/components/wsPlayer.vue @@ -9,12 +9,21 @@ type: String, required: true, }, + status: { + type: String, + default: '', + }, }) const publicPath = window.location.href.split('#')[0] const src = ref(`${publicPath}/image/normal.png`) const webSocket = ref() watch(() => $props.id, (newVal) => { - if (newVal) { + console.log($props.status, '$props.status') + if ($props.status !== '在线') { + src.value = `${publicPath}/image/normal.png` + return + } + if (Number(newVal)) { console.log(newVal, 'newVal') src.value = `${publicPath}/image/loaidng2.gif` // webSocket.value = new WebSocket('ws://192.168.10.135:9000/api/display/ws/video/8') @@ -36,6 +45,9 @@ src.value = `${publicPath}/image/error.png` } } + else { + src.value = `${publicPath}/image/normal.png` + } }) onUnmounted(() => { if (webSocket.value) { @@ -47,6 +59,6 @@ diff --git a/src/views/page/video/index.vue b/src/views/page/video/index.vue index 9f48ac1..ec4fae1 100644 --- a/src/views/page/video/index.vue +++ b/src/views/page/video/index.vue @@ -5,7 +5,9 @@ -->