<template>

  <el-dialog
    v-model="state"
    width="600"
    class="event-record-dialog"
    :align-center="true"
  >
    <template #header>
      <div class="header">处置记录</div>
    </template>
    
    <div class="container">

      <div class="text-line">
        <div class="text-name">事件发生时间：</div>
        <div class="text-content">{{ params.eventStartTime }}</div>
      </div>

      <!-- <div class="text-line">
        <div class="text-name">事件上报时间：</div>
        <div class="text-content">{{ params.eventStartTime }}</div>
      </div> -->

      <!-- <div class="text-line">
        <div class="text-name">事件处置时间：</div>
        <div class="text-content">{{ params.createTime }}</div>
      </div> -->

      <div class="text-line">
        <div class="text-name">处置状态：</div>
        <div class="text-content">
          <div class="tip-1 status-1">报警未确认</div>
          <div class="tip-2"></div>
        </div>
      </div>

      <!-- <div class="text-line">
        <div class="text-name">事件处置完成时间：</div>
        <div class="text-content"></div>
      </div> -->
     
    </div>

    <template #footer >
  
      <div class="footer">
        <el-button @click="goDetail" type="primary">查看详情</el-button>
      </div>

    </template>
  
  </el-dialog>
  
  </template>
  
  <script lang='ts' setup>
  
  import { ref, reactive, defineExpose } from 'vue'
  import { cancelEvent, postEvent } from '@/api/event'
  import { ElMessage } from 'element-plus'
const router = useRouter()
  
  const state = ref(false)
  const params = ref(null)
  
  const diaOpen = (row) => {
    params.value = row
    state.value = true
  }

  const goDetail = () => {

    const to = {
      path: params.value.eventSource === 1 ? 'detail' : 'tunneldetail',
      query: {
        id: params.value.id,
        from: 'event'
      }
    }
    
    state.value = false
    router.push(to)
    
  }

  defineExpose({
    diaOpen
  })
  
  </script>
  
  <style lang='scss' scoped>
  
  .header {
    height: 48px;
    padding: 0px 20px;
    background: rgb(11, 36, 77);
    display: flex;
    align-items: center;
    color: white;
    font-size: 18px;
    font-weight: 600;
  }
  
  .container {
    padding: 12px 30px;
    box-sizing: border-box;
    position: relative;
    .text-line {
      margin: 10px 0;
      display: flex;
      align-items: center;
      .text-name {
        width: 150px;
        text-align: right;
      }
      .text-content {
        flex-grow: 1;
        display: flex;
        align-items: center;
        .status-1 {
          background: #F56C6C;
          color: white;
          padding: 4px 8px;
          border-radius: 2px;
          border: 1px solid rgba(255, 255, 255, 0.5);
        }
      }
    }
  }

  .footer {
    // background: rgba(69, 116, 182, 0.36);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 24px 20px 24px;
    color: white;
  }
  
  </style>
  
  <style lang="scss">
  
  
  .event-record-dialog {
    padding: 0;
    background: rgb(11, 36, 77);

    --el-text-color-regular: white;

    .el-button {
      // color: rgb(11, 36, 77);
    }

    .el-dialog__header {
      padding: 0;
    }

    .el-dialog__footer {
      padding-top: 0;
    }

    .el-select__wrapper.is-focused{
      box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
    }

    .el-textarea {
      .el-textarea__inner {
        border-radius: 0;
        background: transparent;
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
      }
    }

    .el-select__popper {
      background: #1B446D;
      border: none;
      color: white;
      .el-select-dropdown__empty {
        color: white;
      }
    }

    .el-popper.is-light .el-popper__arrow::before {
      border: none;
      background: #1B446D;
    }

  }
  
  </style>