<!-- 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_${ctx.color} 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-img-3: url(/@/assets/images/themify/deepblue/home-container/configurable/firehome/img-3.png);
      --image-img-7: url(/@/assets/images/themify/deepblue/home-container/configurable/firehome/img-7.png);
      --image-img-8: url(/@/assets/images/themify/deepblue/home-container/configurable/firehome/img-8.png);
      --image-img-9: url(/@/assets/images/themify/deepblue/home-container/configurable/firehome/img-9.png);
      --image-list_bg_1: url(/@/assets/images/themify/deepblue/home-container/configurable/dusthome/list_bg_1.png);
      }
    }

    .list {
      --image-img-3: url(/@/assets/images/home-container/configurable/firehome/img-3.png);
      --image-img-7: url(/@/assets/images/home-container/configurable/firehome/img-7.png);
      --image-img-8: url(/@/assets/images/home-container/configurable/firehome/img-8.png);
      --image-img-9: url(/@/assets/images/home-container/configurable/firehome/img-9.png);
      --image-list_bg_1: url(/@/assets/images/home-container/configurable/dusthome/list_bg_1.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 {
      position: relative;
      height: 110px;
      width: 200px;
      background-repeat: no-repeat;
      background-image: var(--image-img-9);
      background-size: 100% auto;
      background-position: center top;
      text-align: center;
      margin-bottom: 20px;
    }
    .list-item__title_D {
      position: absolute;
      width: 100%;
      bottom: 0;
      font-size: 16px;
      font-weight: bold;
    }
    .list-item__content_D:nth-of-type(2) {
      position: absolute;
      top: 10%;
      left: 10%;
      width: 30%;
      text-align: center;

      .list-item__info {
        display: none;
      }
      .list-item__value {
        font-size: 18px;
      }
    }
    .list-item__content_D:nth-of-type(3) {
      position: absolute;
      top: 10%;
      right: 10%;
      width: 30%;
      text-align: center;

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

  .list_E {
    padding: 5px 10px;
  }

  .list__wrapper_E {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 0 10px;
  }

  .list-item_E {
    position: relative;
    height: 104px;
    width: 188px;
    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;
  }
  .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__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>
