<template>
  <el-card class="card">
    <h3 class="cardHead">光字牌</h3>

    <div class="cardBody">
      <el-row :gutter="0" style="display: flex; align-items: center" class="row-spacing">
        <el-col :span="24" class="full-width-col">
          <el-tag type="primary" size="large" class="full-width-tag">生产综合楼1楼火灾报警</el-tag>
        </el-col>
      </el-row>

      <el-row :gutter="0" style="display: flex; align-items: center" class="row-spacing">
        <el-col :span="24" class="full-width-col">
          <el-tag type="danger" size="large" class="full-width-tag blinking-tag"
            >生产综合楼2楼火灾报警</el-tag
          >
        </el-col>
      </el-row>

      <el-row :gutter="0" style="display: flex; align-items: center" class="row-spacing">
        <el-col :span="24" class="full-width-col">
          <el-tag type="primary" size="large" class="full-width-tag"
            >220kV配电装置楼1楼火灾报警</el-tag
          >
        </el-col>
      </el-row>

      <el-row :gutter="0" style="display: flex; align-items: center" class="row-spacing">
        <el-col :span="24" class="full-width-col">
          <el-tag type="primary" size="large" class="full-width-tag"
            >220kV配电装置楼2楼火灾报警</el-tag
          >
        </el-col>
      </el-row>

      <el-row :gutter="0" style="display: flex; align-items: center" class="row-spacing">
        <el-col :span="24" class="full-width-col">
          <el-tag type="primary" size="large" class="full-width-tag">主供电源故障</el-tag>
        </el-col>
      </el-row>

      <el-row :gutter="0" style="display: flex; align-items: center" class="row-spacing">
        <el-col :span="24" class="full-width-col">
          <el-tag type="primary" size="large" class="full-width-tag">备用电源故障</el-tag>
        </el-col>
      </el-row>

      <el-row :gutter="0" style="display: flex; align-items: center">
        <el-col :span="24" class="full-width-col">
          <el-tag type="primary" size="large" class="full-width-tag">接地故障</el-tag>
        </el-col>
      </el-row>
    </div>
  </el-card>
</template>

<script lang="ts" setup>
import { computed, ref, watch, onMounted } from 'vue';

const props = defineProps({
  fontFamily: {
    type: String,
    default: 'Segoe UI'
  },
  fontSize: {
    type: Number,
    default: 14
  },
  testColor: {
    type: String,
    default: '#000000'
  },
  testBool: {
    type: Boolean,
    default: true
  }
});

let computedSize = computed({
  // 读取
  get() {
    return props.fontSize + 'px';
  }, // 修改
  set(val) {
    console.log('有人修改了fullName', val);
  }
});
</script>

<style scoped>
.row-spacing {
  margin-bottom: 10px; /* 每行之间的间隔 */
}

.full-width-col {
  display: flex;
  justify-content: center; /* 水平居中 */
  align-items: center; /* 垂直居中 */
}

.full-width-tag {
  width: 100%; /* 填满父容器 */
  text-align: center; /* 文字水平居中 */
  display: flex; /* 使用 flexbox */
  justify-content: center; /* 文字水平居中 */
  align-items: center; /* 文字垂直居中 */
  font-size: v-bind('computedSize');
}

/* 闪烁动画 */
.blinking-tag {
  animation: blink 1s infinite; /* 1秒一次无限循环 */
}

@keyframes blink {
  0%,
  100% {
    opacity: 1; /* 完全不透明 */
  }
  50% {
    opacity: 0.3; /* 半透明 */
  }
}

.card {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  /* max-width: 480px; */
  color: v-bind('props.testColor');
  font-family: v-bind('props.fontFamily');
  /* font-family: 'Segoe UI'; */
  font-size: v-bind('computedSize' - 1);
}

.cardHead {
  margin: 0;
  padding: 0px;
  padding-bottom: 5px;
  text-align: center;
  font-size: v-bind('computedSize' + 2);
}
.cardBody {
  width: 100%;
  margin: 0 0%;
  padding: 0px 0%;
  /* padding-bottom: 15px; */
}
</style>
