<template>
  <div class="center-cmp">
    <div class="cc-header" v-if="false"> 
      <dv-decoration-1 style="width:200px;height:50px;" />
    </div>

    <div class="cc-details">
      <div>本月总产量</div>
      <div class="card">1</div>
      <div class="card">1</div>
      <div class="card">3</div>
      <div class="card">7</div>
    </div>

    <div class="cc-main-container">
      <div class="ccmc-left">
        <div class="station-info">
          本月派工数<span class="station-value">1120</span>
        </div>
        <div class="station-info">
          本月未完成派工数<span class="station-value">600</span>
        </div>
        <div class="station-info">
          本月派工完成率<span class="station-value">60%</span>
        </div>
        <div class="station-info">
          保养台数<span class="station-value">32/40</span>
        </div>
        <div class="station-info"  v-if="dataType !=='整机'">
          机芯备料进度<span class="station-value">45/122</span>
        </div>
      </div>

      <dv-active-ring-chart class="ccmc-middle" :config="config" />

      <div class="ccmc-right">
        <div class="station-info">
         今天产量 <span class="station-value">60</span>
        </div>
        <div class="station-info">
        直通率  <span class="station-value">93%</span>
        </div>
        <div class="station-info">
        今日不良数  <span class="station-value">2</span>
        </div>
        <div class="station-info">
       返工数   <span class="station-value">2</span>
        </div>
        <div class="station-info" v-if="dataType =='整机'">
          整机备料进度<span class="station-value">54/145</span>
        </div>
        <div class="station-info" v-else>
          盖板备料进度<span class="station-value">68/168</span>
        </div>
      </div>

      <LabelTag :config="labelConfig" />
    </div>
  </div>
</template>

<script>
import LabelTag from './LabelTag'

export default {
  name: 'CenterCmp',
  components: {
    LabelTag
  },
  props: { 
    dataType: {
    }
  },
  data () {
    return {
      config: {
        data:  
        [
          {
            name: '机芯缺陷占比',
            value: 42
          },
          {
            name: '盖板缺陷占比',
            value: 58
          }
        ],
        color: ['#00baff', '#3de7c9', '#ffc530', '#469f4b'],
        lineWidth: 30,
        radius: '55%',
        activeRadius: '60%'
      },

      labelConfig: {
        data: ['机芯缺陷占比', '盖板缺陷占比' ]
      }
    }
  }
}
</script>

<style lang="less">
.center-cmp {
  width: 100%;
  height: 100%;
  margin: 0px;
  padding: 0px;
  display: flex;
  flex-direction: column;

  .station-value{
    color: #0777e0;margin-left: 4px;
  }
  .cc-header {
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 30px;
  }

  .cc-details {
    height: 120px;
    display: flex;
    justify-content: center;
    font-size: 32px;
    align-items: center;

    .card {
      background-color: rgba(4,49,128,.6);
      color: #08e5ff;
      height: 70px;
      width: 70px;
      font-size: 45px;
      font-weight: bold;
      line-height: 70px;
      text-align: center;
      margin: 10px;
    }
  }

  .cc-main-container {
    position: relative;
    flex: 1;
    display: flex;

    .ccmc-middle {
      width: 50%;
      height: 90%;

      .active-ring-name {
        font-size: 30px !important;
      }
    }

    .ccmc-left, .ccmc-right {
      width: 25%;
      display: flex;
      flex-direction: column;
      justify-content: center;
      font-size: 24px;

      span {
        font-size: 40px;
        font-weight: bold;
      }

      .station-info {
        height: 80px;
        display: flex;
        align-items: center;
      }
    }

    .ccmc-left {
      align-items: flex-end;

      margin-top: -100px;
      span {
        margin-left: 20px;
      }
    }

    .ccmc-right {
      align-items: flex-start;
      margin-top: -100px;
      span {
        margin-right: 20px;
      }
    }
  }

  .label-tag {
    position: absolute;
    width: 500px;
    height: 30px;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
  }
}
</style>
