<template>
  <div class="product-qualification-rate">
    <div class="qualification-table">
      <div
        v-for="product in productQualificationData"
        :key="product.symbol"
        class="qualification-row"
      >
        <div class="product-info">
          <span class="product-symbol">{{ product.symbol }}</span>
          <span class="product-name">{{ product.name }}</span>
        </div>
        <div class="progress-container">
          <div class="progress-bar">
            <div
              class="progress-fill"
              :style="{ width: product.rate + '%' }"
            ></div>
          </div>
        </div>
        <div class="rate-value">{{ product.rate }}%</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'ProductQualificationRate',
  data() {
    return {
      productQualificationData: [
        {
          symbol: 'FeMn',
          name: '中锰',
          rate: 100.0
        },
        {
          symbol: 'SiMn',
          name: '硅锰',
          rate: 92.4
        },
        {
          symbol: 'FeSi',
          name: '硅铁',
          rate: 98.4
        },
        {
          symbol: 'FeCr',
          name: '碳铬',
          rate: 97.1
        }
      ]
    }
  }
}
</script>

<style scoped lang="less">
.product-qualification-rate {
  width: 100%;
  height: 100%;
  padding: 20px;

  .qualification-table {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-around;

    .qualification-row {
      display: flex;
      align-items: center;
      height: 60px;
      border-bottom: 1px solid rgba(54, 117, 201, 0.3);

      &:last-child {
        border-bottom: none;
      }

      .product-info {
        width: 120px;
        display: flex;
        flex-direction: column;
        align-items: flex-start;

        .product-symbol {
          font-family: 'DingTalk JinBuTi';
          font-size: 18px;
          font-weight: 600;
          color: #ffffff;
          line-height: 1.2;
        }

        .product-name {
          font-family: 'DingTalk JinBuTi';
          font-size: 14px;
          color: #96dbf2;
          line-height: 1.2;
        }
      }

      .progress-container {
        flex: 1;
        margin: 0 20px;

        .progress-bar {
          width: 100%;
          height: 8px;
          background: rgba(54, 117, 201, 0.2);
          border-radius: 4px;
          overflow: hidden;

          .progress-fill {
            height: 100%;
            background: linear-gradient(90deg, #00ff88 0%, #00cc6a 100%);
            border-radius: 4px;
            transition: width 0.3s ease;
          }
        }
      }

      .rate-value {
        width: 80px;
        text-align: right;
        font-family: 'DingTalk JinBuTi';
        font-size: 20px;
        font-weight: 600;
        color: #ffffff;
      }
    }
  }
}
</style>
