<template>
  <div class="container">
    <!-- 遮罩层区域 -->
    <div class="mask" @click="handleClose"></div>
    <!-- 弹窗内容区域 -->
    <div class="fire">
      <!-- 标题区域 -->
      <div class="title" :title="currentFire">{{ currentFire }}</div>

      <!-- 主体内容区域 -->
      <div class="info">
        <div class="info_container" v-for="(item, index) in 2" :key="item">
          <div class="info_title">火灾{{ index + 1 }}</div>
          <div class="info_box">发生时间：2024-01-18 15:25:26</div>
          <div class="info_box">发生地点：这里是冒烟告警的发生地点发生地点</div>
          <div class="info_detail">
            告警图片：
            <el-image
              class="img"
              src="https://pic.rmb.bdstatic.com/daca09fd4974fe3361289d3306db4d63.jpeg"
              :preview-src-list="[
                'https://pic.rmb.bdstatic.com/daca09fd4974fe3361289d3306db4d63.jpeg',
              ]"
              fit="cover"
              hide-on-click-modal
            />
            <el-image
              class="img"
              src="https://pic.rmb.bdstatic.com/daca09fd4974fe3361289d3306db4d63.jpeg"
              :preview-src-list="[
                'https://pic.rmb.bdstatic.com/daca09fd4974fe3361289d3306db4d63.jpeg',
              ]"
              fit="cover"
              hide-on-click-modal
            />
          </div>
          <div class="info_bts">
            <div class="btn left">告警解除</div>
            <div class="btn right">火灾确认</div>
          </div>
        </div>
      </div>

      <!-- 关闭按钮区域 -->
      <div class="close" @click="handleClose"></div>
    </div>
  </div>
</template>

<script setup lang="ts">
defineProps(["currentFire"]);
const $emit = defineEmits(["closeDialog"]);

// 点击关闭按钮回调
const handleClose = () => {
  $emit("closeDialog", false);
};
</script>

<style lang="scss" scoped>
.container {
  z-index: 9999;
  position: absolute;
  top: -151px;
  left: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 7072px;
  height: 1872px;
  background-color: rgba($color: #000000, $alpha: 0.4);

  .mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 7072px;
    height: 1872px;
  }

  .fire {
    position: relative;
    width: 748px;
    height: 600px;
    background-image: url(@/assets/images/75.png);
    background-size: 100% 100%;

    .title {
      padding: 0 20px;
      margin-left: 269px;
      width: 224px;
      height: 46px;
      line-height: 46px;
      text-align: center;
      font-size: 35px;
      color: #ccffe6;
      font-family: "庞门正道标题体";
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .info {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      margin-top: 18px;
      width: 697px;
      min-height: 393px;
      max-height: 460px;
      font-size: 23px;
      overflow-y: auto;

      .info_container {
        display: flex;
        flex-direction: column;
        justify-content: space-evenly;
        align-items: center;
        height: 393px;

        .info_title {
          width: 628px;
          color: #ccffe6;
          font-size: 30px;
          font-family: "庞门正道标题体";
        }

        .info_box {
          padding-left: 24px;
          width: 628px;
          height: 47px;
          line-height: 47px;
          border-left: 2px solid #90cffc;
          border-top: 0.1px dashed rgba(0, 186, 186, 0.3);
          border-bottom: 1px dashed rgba(0, 186, 186, 0.3);
          border-right: 1px dashed rgba(0, 186, 186, 0.3);
          background-color: rgba(109, 161, 189, 0.21);
          white-space: nowrap;
          text-overflow: ellipsis;
          overflow: hidden;
        }

        .info_detail {
          display: flex;
          padding-left: 24px;
          padding-top: 12px;
          width: 628px;
          height: 165px;
          border-left: 2px solid #90cffc;
          border-top: 0.1px dashed rgba(0, 186, 186, 0.3);
          border-bottom: 1px dashed rgba(0, 186, 186, 0.3);
          border-right: 1px dashed rgba(0, 186, 186, 0.3);
          background-color: rgba(109, 161, 189, 0.21);

          .img {
            margin-right: 15px;
            width: 198px;
            height: 134px;
            border-radius: 6px;
          }
        }

        .info_bts {
          display: flex;
          justify-content: space-around;
          width: 628px;
          height: 47px;

          .btn {
            display: flex;
            justify-content: center;
            align-items: center;
            width: 127px;
            height: 47px;
            border-radius: 10px;
            cursor: pointer;
          }

          .left {
            background-color: rgba(50, 77, 92, 0.8);
          }

          .right {
            background-color: rgba(212, 48, 48, 0.9);
          }
        }
      }
    }

    .close {
      position: absolute;
      top: 10px;
      right: 6px;
      width: 42px;
      height: 42px;
      cursor: pointer;
      background-image: url(@/assets/images/12.png);
      background-size: 100% 100%;
    }
  }
}
</style>
