|
@@ -1,86 +1,55 @@
|
|
|
<script lang="ts" setup>
|
|
|
+import {onMounted, reactive, ref} from 'vue'
|
|
|
+
|
|
|
import {AppMain, Navbar} from '@/layout/components/index.js'
|
|
|
import AntvMap from '@/components/AntvMap/index.vue'
|
|
|
import UePlayer from '@/components/UePlayer.vue'
|
|
|
+import GwVideo from "@/components/Video/index.vue";
|
|
|
import {useAppStore} from '@/stores/app'
|
|
|
-import {computed, onMounted, reactive, ref, watch} from 'vue'
|
|
|
-import {useRoute} from 'vue-router'
|
|
|
-import {useStationStore} from '@/stores/station'
|
|
|
import bus from '@/utils/bus'
|
|
|
-import {getStation} from '@/utils/station'
|
|
|
-import {getAlarmData} from '@/api/rolldata'
|
|
|
-import {jumpPage} from '@/utils'
|
|
|
-import CrossSection from '@/components/CrossSection.vue'
|
|
|
import {Vue3Marquee} from 'vue3-marquee'
|
|
|
-import X2js from 'x2js'
|
|
|
|
|
|
const appStore = useAppStore()
|
|
|
-const stationStore = useStationStore()
|
|
|
-const route = useRoute()
|
|
|
-
|
|
|
-// 是否展示动画
|
|
|
-const showOpeningAnimation = computed(() => route.path.indexOf('/index') > -1)
|
|
|
-const showOpeningAnimation2 = ref(true)
|
|
|
-let navbarHeight = '12vh'
|
|
|
-let theme = ''
|
|
|
-let navbarStyle = {height: navbarHeight}
|
|
|
-const dialog = reactive({
|
|
|
- visible: false,
|
|
|
- title: '断面',
|
|
|
- component: 'CrossSection',
|
|
|
- params: {}
|
|
|
-})
|
|
|
+
|
|
|
// 告警信息
|
|
|
const alarmInfo = ref('')
|
|
|
|
|
|
+// 视频
|
|
|
+const dialog = reactive({visible: true, title: '视频'})
|
|
|
+const videoList = []
|
|
|
+const videoCodeOptions = ref([])
|
|
|
+const videoCode = ref('')
|
|
|
+onMounted(async () => {
|
|
|
+ const data = await import('@/assets/json/jiankongdian.json').then(res => res.default);
|
|
|
+ videoList.push(...data)
|
|
|
+ getVideoById('4341a26a-279a-4266-8239-5367f0007af7')
|
|
|
+})
|
|
|
+
|
|
|
+function getVideoById(id: string) {
|
|
|
+ const video = videoList.find(item => item.id === id)
|
|
|
+ if (video) {
|
|
|
+ videoCodeOptions.value = video.children.map(item => {
|
|
|
+ return {label: item.label, value: item.gbbm}
|
|
|
+ })
|
|
|
+ videoCode.value = video.children[0].value
|
|
|
+ dialog.visible = true
|
|
|
+ dialog.title = video.label
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
// 底板回调监听
|
|
|
bus.on('handle_ue_response', (data) => {
|
|
|
- if (data.Category && data.Category === 'ClickMesh') {
|
|
|
+ if (data.Category && data.Category === 'CustomPOI' && data.Data && data.Data.Type === '视屏点') {
|
|
|
if (!data.Data.Name) {
|
|
|
return
|
|
|
}
|
|
|
- if (data.Data.Type === '测站') {
|
|
|
- const station = getStation(data.Data.Name, 'stnm')
|
|
|
- if (station) {
|
|
|
- // 切换测站远视角
|
|
|
- jumpPage(`/station/${station.stcd}`)
|
|
|
- stationStore.setLabelState2('测站主页', true)
|
|
|
- stationStore.setLabelState2('仪器运维', false)
|
|
|
- }
|
|
|
- } else if (data.Data.Type === '运维') {
|
|
|
- if (data.Data.Name === '站房') {
|
|
|
- // 跳转站房界面
|
|
|
- jumpPage(`/sthouse/${route.params.stcd}`)
|
|
|
- } else {
|
|
|
- if (['雨量场', '测桥'].includes(data.Data.Name)) {
|
|
|
- // 雨量场、测桥不是仪器
|
|
|
- return
|
|
|
- }
|
|
|
- // 跳转仪器详情界面
|
|
|
- jumpPage(`/device/${route.params.stcd}/${data.Data.Name}`)
|
|
|
- }
|
|
|
- } else if (data.Data.Type === '弹窗') {
|
|
|
- if (data.Data.Name === '断面桩') {
|
|
|
- stationStore.setStcd(route.params.stcd)
|
|
|
- dialog.component = 'CrossSection'
|
|
|
- dialog.visible = true
|
|
|
- }
|
|
|
- }
|
|
|
+ getVideoById(data.Data.Name)
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
-onMounted(() => {
|
|
|
-})
|
|
|
-
|
|
|
-// 路由监听
|
|
|
-watch(() => route.path, path => {
|
|
|
- // 首页展示动画
|
|
|
- showOpeningAnimation2.value = path.indexOf('/index') > -1
|
|
|
-}, {deep: true})
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
- <div :style="{ '--current-color': theme }" class="app-wrapper">
|
|
|
+ <div class="app-wrapper">
|
|
|
|
|
|
<!-- 开场动画 -->
|
|
|
<!-- <opening-animation v-if="showOpeningAnimation" v-show="showOpeningAnimation2"-->
|
|
@@ -104,12 +73,18 @@ watch(() => route.path, path => {
|
|
|
<div class="alarm-info" v-html="alarmInfo"></div>
|
|
|
</Vue3Marquee>
|
|
|
<!-- 顶部 -->
|
|
|
- <navbar :style="navbarStyle"/>
|
|
|
+ <navbar :style="{height: '12vh'}"/>
|
|
|
<!-- 展示页 -->
|
|
|
<app-main/>
|
|
|
|
|
|
<el-dialog v-model="dialog.visible" :modal="false" :title="dialog.title" align-center draggable>
|
|
|
- <cross-section v-if="dialog.visible"></cross-section>
|
|
|
+ <el-select v-model="videoCode" style="width: 200px;margin-bottom: 10px;">
|
|
|
+ <el-option v-for="item in videoCodeOptions" :key="item.label" :label="item.label"
|
|
|
+ :value="item.value"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <div style="height: 50vh;">
|
|
|
+ <gw-video v-if="dialog.visible" :code="videoCode"></gw-video>
|
|
|
+ </div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</div>
|