<template>
  <div class="right-content-quality-analysis">
    <techy-analysis-bar
      v-for="(item, index) in datalist"
      :key="index"
      :name="item.name"
      :amount="item.value"
      color="green"
    />

    <!-- <div v-for="item in datalist" :key="item.name" class="analysis-item">
      <span class="absolute" :style="{ backgroundColor: item.color }" />
      <span>{{ item.name }}</span>
      <span>{{ item.value }}</span>
    </div> -->
  </div>
</template>

<script>
import TechyAnalysisBar from './TechyAnalysisBar.vue'

export default {
  name: 'RightContentQualityAnalysis',
  components: { TechyAnalysisBar },
  props: {},
  data() {
    return {
      datalist: [
        { name: '热端', value: 66, color: '#0b88ff' },
        { name: '丝印', value: 93, color: '#0bffa6' },
        { name: '原片', value: 121, color: '#0bffa6' },
        { name: '钢化', value: 2, color: '#e3ff0b' },
        { name: '上片磨边', value: 211, color: '#e3ff0b' },
        { name: '下片铺纸', value: 27, color: '#950bff' },
        { name: '镀膜', value: 44, color: '#950bff' },
        { name: '物流仓储', value: 3, color: '#ff7d0b' },
        { name: '清洗', value: 2, color: '#0bffa6' },
        { name: '包装', value: 22, color: '#ff0bc2' }
      ]
    }
  },
  created() {},
  mounted() {},
  methods: {}
}
</script>

<style scoped>
.right-content-quality-analysis {
  height: calc(100% - calc(32px * var(--beilv)));
  overflow: hidden;
  overflow-y: auto; /** 右边会有多的padding给滑道 */
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: min-content;
  gap: calc(4px * var(--beilv)) calc(6px * var(--beilv));
  justify-content: end;
  align-content: flex-start;
}

.analysis-item {
  padding-left: 16px;
  font-size: 12px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fffc;
  position: relative;
}

.analysis-item::before {
  content: '';
  position: absolute;
  left: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: attr(data-color color, blue);
}

.absolute {
  position: absolute;
  width: 8px;
  height: 8px;
  left: 3px;
  border-radius: 50%;
}
</style>
