<template>
  <el-row :gutter="20" class="panel-group">
    <el-col
      :xs="24"
      :sm="12"
      :lg="6"
      class="card-panel-col"
    >
      <div class="card-panel">
        <div class="card-panel-icon-wrapper icon-location">
          <svg-icon icon-class="location" class-name="card-panel-icon" />
        </div>
        <div class="card-panel-description">
          <div class="card-panel-text">
            货位数量
          </div>
          <count-to
            :start-val="0"
            :end-val="102400"
            :duration="2600"
            class="card-panel-num"
          />
        </div>
      </div>
    </el-col>
    <el-col
      :xs="24"
      :sm="12"
      :lg="6"
      class="card-panel-col"
    >
      <div class="card-panel">
        <div class="card-panel-icon-wrapper icon-message">
          <svg-icon icon-class="number" class-name="card-panel-icon" />
        </div>
        <div class="card-panel-description">
          <div class="card-panel-text">
            存放数量
          </div>
          <count-to
            :start-val="0"
            :end-val="81212"
            :duration="3000"
            class="card-panel-num"
          />
        </div>
      </div>
    </el-col>
    <el-col
      :xs="24"
      :sm="12"
      :lg="6"
      class="card-panel-col"
    >
      <div class="card-panel">
        <div class="card-panel-icon-wrapper icon-material">
          <svg-icon icon-class="material" class-name="card-panel-icon" />
        </div>
        <div class="card-panel-description">
          <div class="card-panel-text">
            存放物料数
          </div>
          <count-to
            :start-val="0"
            :end-val="9280"
            :duration="3200"
            class="card-panel-num"
          />
        </div>
      </div>
    </el-col>
    <el-col
      :xs="24"
      :sm="12"
      :lg="6"
      class="card-panel-col"
    >
      <div class="card-panel">
        <div class="card-panel-icon-wrapper icon-send">
          <svg-icon icon-class="send" class-name="card-panel-icon" />
        </div>
        <div class="card-panel-description">
          <div class="card-panel-text">
            今日生产发料
          </div>
          <count-to
            :start-val="0"
            :end-val="102400"
            :duration="3200"
            class="card-panel-num"
          />
        </div>
      </div>
    </el-col>
    <el-col
      :xs="24"
      :sm="12"
      :lg="6"
      class="card-panel-col"
    >
      <div class="card-panel">
        <div class="card-panel-icon-wrapper icon-sales">
          <svg-icon icon-class="sales" class-name="card-panel-icon" />
        </div>
        <div class="card-panel-description">
          <div class="card-panel-text">
            今日销售出库
          </div>
          <count-to
            :start-val="0"
            :end-val="13600"
            :duration="3600"
            class="card-panel-num"
          />
        </div>
      </div>
    </el-col>
    <el-col
      :xs="24"
      :sm="12"
      :lg="6"
      class="card-panel-col"
    >
      <div class="card-panel">
        <div class="card-panel-icon-wrapper icon-shopping">
          <svg-icon icon-class="shopping" class-name="card-panel-icon" />
        </div>
        <div class="card-panel-description">
          <div class="card-panel-text">
            今日采购入库
          </div>
          <count-to
            :start-val="0"
            :end-val="13600"
            :duration="3600"
            class="card-panel-num"
          />
        </div>
      </div>
    </el-col>
  </el-row>
</template>

<script>
import CountTo from 'vue-count-to'

export default {
  components: {
    CountTo
  }
}
</script>

<style lang="scss" scoped>

::v-deep .el-col-lg-6 {
  width: 16.66%;
}
.panel-group {

  .card-panel-col {
    margin-bottom: 20px;
    flex: 1;
    width: 16.66%;
  }

  .card-panel {
    width: 100%;
    height: 108px;
    display: flex;
    cursor: pointer;
    font-size: 12px;
    position: relative;
    overflow: hidden;
    color: #666;
    border-radius: 4px;
    background: #fff;
    box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
    border-color: rgba(0, 0, 0, .05);

    &:hover {
      .card-panel-icon-wrapper {
        color: #fff;
      }

      .icon-orders {
        background: #40c9c6;
      }
      .icon-location {
        background: #40c9c6;
      }

      .icon-message {
        background: #36a3f7;
      }

      .icon-material {
        background: #f4516c;
      }
      .icon-send {
        background: #67C23A;
      }
      .icon-shopping {
        background: #34bfa3
      }
      .icon-sales {
        background: #ed0c66;
      }

      .icon-excellent {
        background: #67C23A
      }
    }

    .icon-location {
      color: #40c9c6;
    }

    .icon-message {
      color: #36a3f7;
    }

    .icon-material {
      color: #f4516c;
    }

    .icon-send {
        color: #67C23A;
      }
    .icon-shopping {
      color: #36a3f7
    }
    .icon-sales {
        color: #ed0c66;
      }
    .icon-excellent {
      color: #67C23A;
    }
    .card-panel-icon-wrapper {
      transition: all 0.38s ease-out;
      border-radius: 4px;
      display: flex;
      align-items: center;
      padding: 0 14px;
    }

    .card-panel-icon {
      font-size: 48px;
    }

    .card-panel-description {
      font-weight: bold;
      margin-left: 0px;
      padding-left: 10px;
      display: flex;
      justify-content: center;
      flex-direction: column;

      .card-panel-text {
        line-height: 18px;
        color: rgba(0, 0, 0, 0.45);
        font-size: 14px;
        margin-bottom: 12px;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
      }

      .card-panel-num {
        font-size: 16px;
      }
    }
  }
}

@media screen and (max-width:1200px) {
  ::v-deep .el-col-lg-6 {
  width: 33.33%;
}
  .panel-group {
  .card-panel-col {
    margin-bottom: 20px;
    flex: 1;
    width: 33.33%;
    }
  }
}
@media screen and  (max-width:990px) {
  ::v-deep .el-col-lg-6 {
  width: 50%;
}
  .panel-group {
  .card-panel-col {
    margin-bottom: 20px;
    flex: 1;
    width: 50%;
    }
  }
}

@media screen and  (max-width:760px) {
  ::v-deep .el-col-lg-6 {
  width: 100%;
}
  .panel-group {
  .card-panel-col {
    margin-bottom: 20px;
    flex: 1;
    width: 100%;
    }
  }
}

// @media screen and  (max-width:550px) {
//   .card-panel-description {
//     display: none;
//   }

//   .card-panel-icon-wrapper {
//     float: none !important;
//     width: 100%;
//     height: 100%;
//     margin: 0 !important;

//     .svg-icon {
//       display: block;
//       margin: 14px auto !important;
//       float: none !important;
//     }
//   }
// }
</style>
