<template>
  <el-row :gutter="40" class="panel-group">
    <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
      <div class="card-panel">
        <div class="card-panel-icon-wrapper icon-people"><span class="icon" style="font-size: 48px">&#xe60a;</span></div>
        <div class="card-panel-description">
          <div class="card-panel-text">行政车辆</div>
          <div class="count">
            {{ cdata.car || 0 }}
            <span class="num">辆</span>
          </div>
        </div>
      </div>
    </el-col>
    <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
      <div class="card-panel">
        <div class="card-panel-icon-wrapper icon-money"><svg-icon icon-class="example" class-name="card-panel-icon" /></div>
        <div class="card-panel-description">
          <div class="card-panel-text">所有场所</div>
          <div class="count">
            {{ cdata.place || 0 }}
            <span class="num">个</span>
          </div>
        </div>
      </div>
    </el-col>
    <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
      <div class="card-panel">
        <div class="card-panel-icon-wrapper" style="background-color: #1890ff; color: white"><svg-icon icon-class="swagger" class-name="card-panel-icon" /></div>
        <div class="card-panel-description">
          <div class="card-panel-text">所有通道</div>
          <div class="count">
            {{ cdata.channel || 0 }}
            <span class="num">个</span>
          </div>
        </div>
      </div>
    </el-col>
    <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
      <div class="card-panel">
        <div class="card-panel-icon-wrapper logininfor"><svg-icon icon-class="dashboard" class-name="card-panel-icon" /></div>
        <div class="card-panel-description">
          <div class="card-panel-text">累计过车</div>
          <div class="count">
            {{ cdata.pass || 0 }}
            <span class="num">次</span>
          </div>
        </div>
      </div>
    </el-col>
  </el-row>
</template>

<script>
export default {
  props: {
    cdata: {
      type: Object
    }
  },
  data() {
    return {
      user: this.$store.state.user
    };
  },
  methods: {
    handleSetLineChartData(type) {
      this.$emit('handleSetLineChartData', type);
    }
  }
};
</script>

<style lang="scss" scoped>
.panel-group {
  .card-panel {
    border-radius: 5px;
    height: 100px;
    position: relative;
    overflow: hidden;
    color: #666;
    background: #fff;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.05);
    .count {
      font-weight: bold;
      font-size: 20px;
      .num {
        font-size: 14px;
        font-weight: normal;
        padding-left: 3px;
      }
    }
    &:hover {
      .card-panel-icon-wrapper {
        color: #fff;
      }

      .icon-people {
        background: #40c9c6;
      }

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

      .icon-money {
        background: #f4516c;
      }

      .logininfor {
        background: #34bfa3;
      }
    }

    .icon-people {
      color: white;
      background: #40c9c6;
    }

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

    .icon-money {
      color: white;
      background: #f4516c;
    }

    .logininfor {
      color: white;
      background: #34bfa3;
    }

    .card-panel-icon-wrapper {
      float: left;
      margin: 10px 0 0 14px;
      padding: 16px;
      transition: all 0.38s ease-out;
      border-radius: 6px;
    }

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

    .card-panel-description {
      float: right;
      font-weight: bold;
      margin: 26px;
      margin-left: 0px;
      text-align: center;

      .card-panel-text {
        line-height: 18px;
        text-align: left;
        color: rgba(0, 0, 0, 0.45);
        font-size: 16px;
        margin-bottom: 12px;
      }

      .card-panel-num {
        font-size: 20px;
      }
    }
  }
}
.simes {
  font-size: 14px !important;
  margin-top: -7px !important;
}
@media (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>
