<template>
  <transition
    appear
    name="animate__animated animate__move"
    enter-active-class="animate__slideInLeft"
    leave-active-class="animate__slideOutLeft"
  >
    <div class="widget-StatisticalRisk">
      <div class="head">
        <div class="title">
          <div class="icon"></div>
          <span class="site-info">隐患统计</span>
        </div>
      </div>
      <div class="content-info">
        <!---->
        <div class="riskPercent">
          <div class="chartContent"><ComProgressPercentChart :color="['#F3E86D', '#03E1E4']" /></div>
          <div class="staContent">
            <div class="sta-item">
              <div class="sta-value">12个</div>
              <div class="sta-name">隐患整改总数</div>
            </div>
            <div class="sta-item">
              <div class="sta-value total">23个</div>
              <div class="sta-name">隐患上报总数</div>
            </div>
          </div>
        </div>
        <!---->
        <div class="rectification">
          <div class="rectify-item" v-for="(item, index) of rectifyList" :key="item.title">
            <div class="rectify-title" :class="'rectify-title' + index">
              <div class="wrap">
                {{ item.title }}<span :class="'rectify-span' + index">（{{ item.num }}个）</span>
              </div>
            </div>
            <div class="rectify-content">
              <div class="rc-item">重大隐患：<span>1个</span></div>
              <div class="rc-item">重要隐患：<span>1个</span></div>
              <div class="rc-item">轻微隐患：<span>1个</span></div>
            </div>
          </div>
        </div>
        <!---->
        <div class="grandTotalChart">
          <StatisticalReportingChart />
        </div>
      </div>
    </div>
  </transition>
</template>

<script lang="ts">
import { Vue, Component, Prop, Watch } from 'vue-property-decorator'
import ComProgressPercentChart from '@/views/groupPage/components/PieChart/ComProgressPercentChart.vue'
import StatisticalReportingChart from '@/views/groupPage/components/ComprehensiveChart/statisticalReportingChart.vue'
//隐患统计
@Component({
  name: 'StatisticalRisk',
  components: { ComProgressPercentChart, StatisticalReportingChart }
})
export default class StatisticalRisk extends Vue {
  rectifyList = [
    { title: '待整改', num: 3 },
    { title: '整改中', num: 3 },
    { title: '已整改', num: 3 }
  ]
}
</script>

<style lang="scss" scoped>
.animate__slideInLeft,
.animate__slideOutLeft {
  animation-duration: 3s; //动画持续时间
  animation-delay: 0s; //动画延迟时间
}
.widget-StatisticalRisk {
  z-index: 2;
  //position
  top: 0.505208rem /* 97/192 */;
  margin-left: $size20 /* 20/192 */;
  position: absolute;
  //size
  height: 2.604167rem /* 500/192 */;
  width: 2.083333rem /* 400/192 */;
  .head {
    height: 0.166667rem /* 32/192 */;
    width: 100%;
    background: linear-gradient(-90deg, rgba(43, 167, 255, 0.2) 0%, rgba(43, 167, 255, 0.08) 100%);
    font-family: Source Han Sans CN-HEAVY;
    .title {
      width: 100%;
      height: 100%;
      display: flex;
      font-weight: 400;
      align-items: center;
      .icon {
        height: 0.166667rem /* 32/192 */;
        width: 0.34375rem /* 66/192 */;
        background: url('~@/views/groupPage/images/模块图标/统计分析/隐患统计.png') no-repeat center center;
        background-size: 100% 100%;
      }
      span {
        flex: 1;
        font-weight: bold;
        font-size: 0.083333rem /* 16/192 */;
        color: #ffffff;
        padding: 0.041667rem /* 8/192 */;
        background: linear-gradient(0deg, #9bd2fa 0%, #ffffff 100%);
        background-clip: text;
        -webkit-text-fill-color: transparent;
      }
    }
  }
  @mixin contentCenter() {
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .content-info {
    width: 100%;
    height: calc(100% - 0.166667rem);
    display: inline-block;
    font-family: Source Han Sans CN;
    background: linear-gradient(0deg, rgba(14, 167, 255, 0.16) 0%, rgba(14, 167, 255, 0.02) 100%);
    .riskPercent {
      margin-top: 0.09375rem /* 18/192 */;
      height: 0.385417rem /* 74/192 */;
      width: 100%;
      background: rgba(6, 34, 57, 0.9);
      display: flex;
      .chartContent {
        height: 100%;
        width: 0.625rem /* 120/192 */;
      }
      .staContent {
        height: 100%;
        width: calc(100% - 0.625rem /* 120/192 */);
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 100%;
        .sta-item {
          display: flex;
          flex-flow: column;
          align-items: center;
          justify-content: space-evenly;
          .sta-value {
            // width: 0.177083rem /* 34/192 */;
            height: 0.083333rem /* 16/192 */;
            font-size: 0.083333rem /* 16/192 */;
            font-weight: bold;
            color: #ffffff;
            background: linear-gradient(0deg, #08d1d9 0%, #fbe462 100%);
            background-clip: text;
            -webkit-text-fill-color: transparent;
            font-family: Source Han Sans CN-HEAVY;
          }
          .sta-name {
            font-size: 0.072917rem /* 14/192 */;
            font-weight: 400;
            color: #ffffff;
          }
          .total {
            background: linear-gradient(0deg, #ff6e35 0%, #ffd953 100%);
            background-clip: text;
            -webkit-text-fill-color: transparent;
          }
        }
      }
    }
    .rectification {
      margin-top: 0.052083rem /* 10/192 */;
      height: 0.65625rem /* 126/192 */;
      width: 100%;
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 0.052083rem /* 10/192 */;
      .rectify-item {
        display: flex;
        flex-flow: column;
        background: rgba(6, 34, 57, 0.8);
        .rectify-title,
        .rectify-content {
          @include contentCenter();
        }

        .rectify-title {
          width: 100%;
          height: 0.1875rem /* 36/192 */;
          background: #ffda6a;
          font-size: 0.072917rem /* 14/192 */;
          font-weight: 400;
          color: #ffffff;
          .wrap {
            width: 100%;
            height: 70%;
            @include contentCenter();
            margin: 0.026042rem /* 5/192 */;
            background: rgba(6, 13, 25, 1);
            box-shadow: 0 0 8px 5px #060d19;
            border-radius: 2px;
          }
          & span {
            font-family: Source Han Sans CN-HEAVY;
            font-weight: bold;
            // color: #ffda6a;
          }
        }
        //
        .rectify-title0 {
          background: #ffda6a;
        }
        .rectify-span0 {
          color: #ffda6a;
        }
        .rectify-title1 {
          background: #03caf4;
        }
        .rectify-span1 {
          color: #03caf4;
        }
        .rectify-title2 {
          background: #00e16f;
        }
        .rectify-span2 {
          color: #00e16f;
        }
        //
        .rectify-content {
          width: 100%;
          height: calc(100% - 0.1875rem /* 36/192 */);
          flex-flow: column;
          justify-content: space-evenly;
          .rc-item {
            font-size: 0.072917rem /* 14/192 */;
            font-weight: 400;
            color: #84bde5;
            & span {
              font-family: Source Han Sans CN-MEDIUM;
              font-weight: bold;
              color: #ffffff;
            }
          }
        }
      }
    }
    .grandTotalChart {
      width: 100%;
      height: calc(100% - 1.1875rem /* 228/192 */);
    }
  }
}
</style>