<!-- eslint-disable vue/multi-word-component-names -->
<template>
  <!-- 基准的列表模块，通过不同的 type 展示不同的样式 -->
  <div class="list flex items-center" :class="`list_${type}`">
    <!-- 部分类型的列表需要加一张图片 -->
    <div :class="`list__image_${type}`"></div>
    <!-- 剩下的部分填充剩余宽度 -->
    <div class="flex-grow h-full" :class="`list__wrapper_${type}`">
      <div v-for="(item, i) in listConfig" :key="`vvhccdcl${i}`" :class="`list-item_${type}`">
        <!-- 列表项前面的图标 -->
        <div :class="`list-item__title_${type}`">{{ item.title }}</div>
        <!-- 列表项的具体内容填充剩余宽度 -->
        <div v-for="(ctx, j) in item.contents" :key="`vvhccdclc${j}`" :class="`list-item__content_${type}`">
          <div class="list-item__label">{{ ctx.label }}</div>
          <div class="list-item__info" :class="`list-item__info_${ctx.color}`">{{ ctx.info }}</div>
          <div class="list-item__value" :class="`list-item__value_${type}`">{{ ctx.value }}</div>
        </div>
      </div>
    </div>
  </div>
</template>
<script lang="ts" setup>
withDefaults(
  defineProps<{
    listConfig: {
      title: string;
      contents: {
        value: string;
        color: string;
        label: string;
        info: string;
      }[];
    }[];
    /** A B */
    type: string;
  }>(),
  {
    listConfig: () => [],
    type: 'A',
  }
);

//   defineEmits(['click']);
</script>
<style lang="less" scoped>
    @import '@/design/theme.less';
    @import '@/design/theme.less';
    /* Timeline 相关的样式 */

    @{theme-deepblue} {
  .list {
    --image-title: url('/@/assets/images/fireNew/7-1.png');
    --image-ListArea: url('/@/assets/images/fireNew/7-2.png');
    --image-ValueBg: url('/@/assets/images/fireNew/7-3.png');
  }
}

.list {
  --image-title: url('/@/assets/images/fireNew/7-1.png');
  --image-ListArea: url('/@/assets/images/fireNew/7-2.png');
  --image-ValueBg: url('/@/assets/images/fireNew/7-3.png');
  padding: 5px 20px;
  position: relative;
  width: 100%;
  height: 100%;
}
    .list-item_A {
      position: relative;
      height: 140px;
      background-repeat: no-repeat;
      background-image: var(--image-img-3);
      background-size: auto 100%;
      background-position: center;
    }
    .list-item__title_A {
      position: absolute;
      left: 41%;
      // font-size: 14px;
      top: 15px;
    }
    // .list-item__content_A {
    //   position: absolute;
    //   left: 35%;
    //   top: 55px;
    //   display: flex;
    //   justify-content: space-evenly;
    // }
    .list-item__content_A:nth-of-type(2) {
      position: absolute;
      top: 15px;
      left: 14%;
      width: 22%;
      text-align: center;
      display: block;

      .list-item__label {
        font-size: 18px;
        margin-bottom: 25px;
      }
      .list-item__info {
        display: none;
      }
      .list-item__value {
        font-size: 24px;
      }
    }
    .list-item__content_A:nth-of-type(3) {
      position: absolute;
      left: 41%;
      top: 55px;

      .list-item__info {
        display: none;
      }
      .list-item__value {
        font-size: 20px;
      }
    }
    .list-item__content_A:nth-of-type(4) {
      position: absolute;
      left: 66%;
      top: 55px;

      .list-item__info {
        display: none;
      }
      .list-item__value {
        font-size: 20px;
      }
    }
    .list-item__content_A:nth-of-type(5) {
      position: absolute;
      left: 35%;
      bottom: 10px;
      display: flex;
      align-items: center;

      .list-item__info {
        display: none;
      }
      .list-item__value {
        font-size: 20px;
        margin-left: 5px;
      }
    }

    .list-item_B {
      // height: 155px;
      background-repeat: no-repeat;
      // background-size: 100% 100%;
      // background-size: auto 100%;
      background-size: 87% auto;
      background-position: center;
      background-image: var(--image-img-7);
      display: flex;
      align-items: center;
      justify-content: space-between;
      text-align: center;
      padding: 0 10%;
      margin-top: 5px;
      height: 33px;

      .list-item__label {
        font-size: 11px;
      }
      .list-item__value {
        font-size: 18px;
        margin-left: 5px;
      }
      .list-item__content_B {
        height: 100%;
        display: flex;
        align-items: center;
        flex-basis: 100px;
        flex-grow: 1;
      }
      .list-item__title_B {
        width: 40px;
        text-align: center;
        margin-right: 50px
        // height: 30px;
        // background-size: auto 80%;
        // background-position: center;
        // background-repeat: no-repeat;
      }
      .list-item__info {
        display: none;
      }
    }

    .list_C {
      padding: 5px 10px;
    }

    .list__wrapper_C {
      display: flex;
      justify-content: space-between;
      flex-wrap: wrap;
    }

    .list-item_C {
      position: relative;
      height: 140px;
      width: 200px;
      background-repeat: no-repeat;
      background-image: var(--image-img-8);
      background-size: 100% 100%;
      background-position: left center;
    }
    .list-item__title_C {
      position: absolute;
      left: 99px;
      // font-size: 14px;
      top: 15px;
    }
    .list-item__content_C:nth-of-type(2) {
      position: absolute;
      top: 15px;
      left: 19px;
      width: 30%;
      text-align: center;
      display: block;

      .list-item__label {
        // font-size: 18px;
        margin-bottom: 25px;
      }
      .list-item__info {
        display: none;
      }
      .list-item__value {
        font-size: 18px;
      }
    }
    .list-item__content_C:nth-of-type(3) {
      position: absolute;
      left: 99px;
      top: 55px;

      .list-item__info {
        display: none;
      }
      .list-item__value {
        font-size: 18px;
      }
    }


    .list_D {
      padding: 5px 10px;
    }

    .list__wrapper_D {
      display: flex;
      justify-content: space-between;
      flex-wrap: wrap;
    }

    .list-item_D {
      background-image: var(--image-ListArea);
      background-size: 100% auto;
      background-position: center;
      background-repeat: no-repeat;
      position: relative;
       height: 130px;
      width: 179px;
       text-align: center;
       margin-left: 15px;
       margin-right: 12px;
       margin-top: 13px;
    }
    .list-item__title_D {
      background-image: var(--image-title);
      background-size: 100% auto;
      background-position: center;
      background-repeat: no-repeat;
      width: 100%;
      bottom: 0;
      font-size: 16px;
    }
    .list-item__content_D:nth-of-type(2) {
              background-image: var(--image-ValueBg);
      background-size: 100% auto;
      background-position: center;
      background-repeat: no-repeat;
    display: flex;
    justify-content: space-between;
    top: 30%;
    left: 10%;
    width: 88%;
    position: absolute;
    .list-item__info {
      display: none;
    }
    .list-item__value {
      margin-right: 10px;
      font-size: 13px;   
      color: #a9e0eb;
    }
  }
  .list-item__content_D:nth-of-type(3) {
        background-image: var(--image-ValueBg);
      background-size: 100% auto;
      background-position: center;
      background-repeat: no-repeat;
    display: flex;
    justify-content: space-between;
    top: 62%;
    left: 10%;
    width: 77%;
    position: absolute;
    .list-item__info {
      display: none;
    }
    .list-item__value {
      font-size: 13px;
      margin-right: 10px;
      color: #a9e0eb;
    }
  }
  .list_E {
    padding: 5px 10px;
  }

  .list__wrapper_E {
    display: flex;
    flex-wrap: wrap;
    padding: 0 10px;
  }

  .list-item_E {
    position: relative;
    height: 100px;
    width: 170px;
    background-repeat: no-repeat;
    background-image: var(--image-list_bg_1);
    background-size: 100% auto;
    background-position: center top;
    text-align: center;
    margin-bottom: 20px;
    margin-left: 5px;
  }
  .list-item__title_E {
    // position: absolute;
    width: 100%;
    // top: 0;
    font-size: 16px;
    font-weight: bold;
    margin-top: 10px;
  }
  .list-item__content_E:nth-of-type(2) {
    position: absolute;
    top: 40%;
    left: 5%;
    text-align: left;

    .list-item__info {
      display: none;
    }
    .list-item__value {
      font-size: 16px;
    }
  }
  .list-item__content_E:nth-of-type(3) {
    position: absolute;
    top: 40%;
    right: 5%;
    text-align: right;

    .list-item__info {
      display: none;
    }
    .list-item__value {
      font-size: 16px;
    }
  }

  .list-item_F {
      // height: 155px;
      background-repeat: no-repeat;
      background-size: 100% 100%;
      // background-size: auto 100%;
      background-position: center;
      background-image: @vent-gas-list-item-bg-img;
      display: flex;
      align-items: center;
      // justify-content: space-between;
      // text-align: center;
      padding: 0 5%;
      margin-top: 5px;
      height: 50px;

      .list-item__title_F {
        flex-basis: 25%;
      }
      .list-item__content_F {
        flex-basis: 25%;
      }
      .list-item__label::after {
        content: '：';
      }
      .list-item__value {
        font-size: 18px;
        margin-left: 5px;
        font-weight: bold;
      }
      .list-item__content_F {
        display: flex;
        align-items: center;
      }
      .list-item__info {
        display: none;
      }
  }

  .list-item_G {
      // height: 155px;
      // background-repeat: no-repeat;
      // background-size: 100% 100%;
      // background-position: center;
      // justify-content: space-between;
      // text-align: center;
      margin-top: 5px;

      .list-item__title_G {
        position: relative;
        width: 100%;
        height: 16px;
        margin-top: 10px;
        margin-bottom: 5px;
        padding-left: 8px;
        top: -2px;
        background-image: var(--image-linear-gradient-1);
        &::before{
          position: absolute;
          content: '';
          width: 100%;
          height: 100%;
          top: 4px;
          left: 0;
          background-image: var(--image-linear-gradient-2);
        }
      }
      .list-item__content_G {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 4px;
        margin: 8px 0;
        background-image: var(--image-linear-gradient-3);
      }
  }

    // .list-item__title_B_O2 {
    //   background-image: url(/@/assets/images/home-container/configurable/firehome/O₂.png);
    // }
    // .list-item__title_B_CH4 {
    //   background-image: url(/@/assets/images/home-container/configurable/firehome/CH₄.png);
    // }
    // .list-item__title_B_CO {
    //   background-image: url(/@/assets/images/home-container/configurable/firehome/CO.png);
    // }
    // .list-item__title_B_CO2 {
    //   background-image: url(/@/assets/images/home-container/configurable/firehome/CO₂.png);
    // }

    // .list-item__label {
    //   flex-basis: 55%;
    // }
    // .list-item__info {
    //   flex-grow: 1;
    // }
    // .list-item__value {
    //   flex-basis: 30%;
    // }
    .list-item__value_red {
      color: red;
    }
    .list-item__value_orange {
      color: orange;
    }
    .list-item__value_yellow {
      color: yellow;
    }
    .list-item__value_green {
      color: yellowgreen;
    }
    .list-item__value_blue {
      color: @vent-table-action-link;
    }
    .list-item__value_white {
      color: white;
    }
    .gallery-item__value_lightblue {
      color: @vent-configurable-home-light-border;
    }
</style>
