<template>
  <div class="event-detail">
    <!-- 页面导航 -->
    <Header />
    <!-- 顶部处置 -->
    <topBar :eventData />
    <!-- 基本信息 -->
    <baseMessage :eventData />
    <!-- 视频组 -->
    <VideosGroups ref="videosRef" :eventData />
  </div>
</template>

<script lang="ts" setup>
import Header from './components/Header/index.vue'
import topBar from './components/topBar/index.vue'
import VideosGroups from './components/VideosGroups/index.vue'
import baseMessage from './components/baseMessage/index.vue'
import { ElMessage } from 'element-plus'

import { ref, onBeforeMount } from 'vue'
import { useRoute, useRouter } from 'vue-router'
// import { useTrafficStoreOut } from '@/store/modules/traffic'

// import { getEventDetail, eventRemain } from '@/api/event'
// import { setCommons } from '@/flash/Detail'
import { gettunnelEventDetail } from '@/api/event'
// import { setCommons } from '@/flash/Detail'
// import bus from '@/utils/eventBus'

const evtPop = ref<any>(null) // 事件处理弹窗实例

const route = useRoute()
const router = useRouter()
// const trafficStore = useTrafficStoreOut()

const eventData = ref({
  alarmType: '报警类型',
  alarmTypeCode: '报警类型编码'
})

// 事件处理
// const goHandle = () => {
//   evtPop.value.diaOpen(eventData.value)
// }

// 事件完成处理
// const handleComplete = () => {
//   const { from } = route.query
//   router.replace({
//     path: from as any
//   })
// }

// 手控摄像头
// const cameraChange = (e) => {
//   videosRef.value.cameraSet(e)
// }

onBeforeMount(() => {
  if (!route.query.id) {
    return ElMessage.error('链接错误！')
  }

  const id = route.query.id
  const res = gettunnelEventDetail({ alarmId: id })
  eventData.value = res

  eventData.value = {
    id: '372d82d2-f8b2-4514-a7dc-a398a02aaaea',
    alarmType: '火灾',
    alarmTypeCode: '01',
    gradeName: '一级火灾报警',
    alarmTime: '2024-08-12 03:54:33',
    alarmSource: 'GXB.AKCCwc-0zx+蜂桶岚火灾探测器左94',
    alarmCondition: null,
    alarm: '火警',
    mill: 'k548+391',
    tunnelId: 'JNN09FTL',
    tunnelName: '漈头隧道',
    tunnelOfficeName: '蜂桶岚隧道管理所',
    subCenterName: '丽水监控分中心',
    regionCenterName: '丽水管理中心',
    operCenterName: '浙高运运管中心',
    provCenterName: '集团应急指挥中心',
    status: '完成',
    rpStatus: '事件已结束',
    direction: '云和方向',
    operator: 'jnn',
    takeLoad: false,
    eventLevel: '',
    dangerCar: false,
    ruleTypeName: '设备状态',
    errorMsg: null,
    equCode: 'FTLZHY94',
    recoverTime: '2024-09-22 22:16:00',
    endTime: '2024-09-22 22:16:00',
    remarkEnd: null,
    alarmDt: '2024-08-12 03:54:33',
    highSpeedLoad: 'G4012溧宁高速(景文段)',
    rpLogId: null,
    alarmRpRecoverDate: null,
    doDt: '2024-09-22 22:16:00',
    endStatus: true,
    timeoutStatus: true,
    handleVos: []
  }
})
</script>

<style lang="scss" scoped>
$base-url: '@/assets/images/event/';
$base-common: '@/assets/images/common/';
</style>

<style lang="scss"></style>
