<template>
  <el-row :gutter="20" class="panel-group">
    <el-col
      :span="6"
      class="card-panel-col"
    >
      <div class="card-panel awaitOrder">
        <!-- <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="6"
            :duration="2600"
            class="card-panel-num"
          />
          <el-divider />
          <span>今日新增笔数:2</span>
        </div>
      </div>
    </el-col>
    <el-col
      :span="6"
      class="card-panel-col"
    >
      <div class="card-panel awaitGive">
        <!-- <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="15"
            :duration="3000"
            class="card-panel-num"
          />
          <el-divider />
          <span>今日交货笔数:5</span>
        </div>
      </div>
    </el-col>
    <el-col
      :span="6"
      class="card-panel-col"
    >
      <div class="card-panel monthOrder">
        <!-- <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="138"
            :duration="3200"
            class="card-panel-num"
          />
          <el-divider />
          <span>年度交货笔数: 675</span>
        </div>
      </div>
    </el-col>
    <el-col
      :span="6"
      class="card-panel-col"
    >
      <div class="card-panel yearlyComp">
        <!-- <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="90"
            :duration="3200"
            class="card-panel-num"
          /> -->
          <el-progress :percentage="90" />
          <el-divider />
          <span>接单 232107 / 208896</span>
        </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: 25%;
}
.panel-group {

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

  .card-panel {
    width: 100%;
    height: 138px;
    display: flex;
    cursor: pointer;
    font-size: 12px;
    position: relative;
    overflow: hidden;
    color: #fff;
    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;
      margin: 5px auto;
      // display: flex;
      // align-items: center;
      // justify-content: center;
      // flex-direction: column;

      .card-panel-text {
        line-height: 18px;
        color: #fff;
        font-size: 14px;
        margin-bottom: 12px;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
      }

      .card-panel-num {
        font-size: 16px;
      }
    }
  }
  .awaitOrder {
      background: #34bfa3!important;
    }
  .awaitGive {
      background: #E6A23C!important;
    }
    .monthOrder {
      background: #409EFF!important;
    }
    .yearlyComp {
      background: rgba(34,49,155, 1)!important;
    }
}

@media screen and (max-width:1200px) {
  ::v-deep .el-col-lg-6 {
  width: 25%;
}
  .panel-group {
  .card-panel-col {
    margin-bottom: 20px;
    flex: 1;
    width: 25%;
    }
  }
}
@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>
