<template>
  <transition
    appear
    name="animate__animated animate__move"
    enter-active-class="animate__slideInLeft"
    leave-active-class="animate__slideOutLeft"
  >
    <div class="widget-ContractInfo" v-if="show">
      <div class="head">
        <div class="title">
          <div class="icon"></div>
          <span class="site-info">合同情况</span>
        </div>
      </div>
      <div class="content-info">
        <div class="content-item">
          <div class="title">
            <div class="icon"></div>
            <span class="item-name">建管项目：</span>
            <span class="item-info">项目数量22个，累计完成产值2.28亿</span>
          </div>
          <div class="content">
            <div class="chart-container">
              <div class="chart-title">完成占比：8.3%</div>
              <ComThreeDimensionsChart v-on="$listeners" />
              <!-- 底座背景 -->
              <div class="bg"></div>
            </div>
            <div class="dataInfo">
              <div
                class="data-item"
                v-for="(item, index) of staList"
                :key="item.name"
                :style="index === 0 ? 'background: rgba(11, 122, 192,0.16)' : 'background: rgba(8, 178, 114,0.16)'"
              >
                <div class="pointSymbol" :style="index === 0 ? 'background:#2BA7FF' : 'background:#13D28A'"></div>
                <div class="data-title">{{ item.name }}</div>
                <div class="data-value">{{ item.value }}{{ item.unit }}</div>
              </div>
            </div>
          </div>
        </div>
        <div class="content-item">
          <div class="title">
            <div class="icon"></div>
            <span class="item-name">EPC项目：</span>
            <span class="item-info">总投资27.75亿</span>
          </div>
          <div class="content epc">
            <ComBatteryChart v-on="$listeners" />
          </div>
        </div>
        <div class="content-item">
          <div class="title">
            <div class="icon"></div>
            <span class="item-name">近6个月数据（万元）</span>
            <span class="item-info"></span>
          </div>
          <div class="content">
            <ComLineChart />
          </div>
        </div>
      </div>
    </div>
  </transition>
</template>

<script>
import ComThreeDimensionsChart from '@/views/groupPage/components/ComThreeDimensionsChart.vue'
import ComBatteryChart from '@/views/groupPage/components/ComBatteryChart.vue'
import ComLineChart from '@/views/groupPage/components/ComLineChart.vue'
export default {
  name: 'ContractInfo', //合同情况
  components: {
    ComThreeDimensionsChart,
    ComBatteryChart,
    ComLineChart
  },
  props: {
    show: {}
  },
  data() {
    return {
      staList: [
        { name: '本年投资计划', value: '11.99', unit: '亿' },
        { name: '本年累计完成产值', value: '1', unit: '亿' }
      ]
    }
  },
  watch: {
    show: {
      handler(n, o) {}
    }
  },
  mounted() {},
  methods: {}
}
</script>

<style lang="scss" scoped>
.animate__slideInLeft,
.animate__slideOutLeft {
  animation-duration: 3s; //动画持续时间
  animation-delay: 0s; //动画延迟时间
}
.widget-ContractInfo {
  $size10: 0.052083rem /* 10/192 */;
  $size20: 0.104167rem /* 20/192 */;
  z-index: 2;
  //position
  bottom: $size10 /* 10/192 */;
  margin-left: $size20 /* 20/192 */;
  position: absolute;
  //size
  height: calc(100% - 0.557292rem /* 107/192 */);
  width: 2.083333rem /* 400/192 */;
  //background
  // background-color: rgba(20, 24, 47, 0.5);
  color: #eee;
  // box-shadow: 0 0 20px rgba(1, 9, 20, 1);
  //font
  // font-family: Source Han Sans CN-HEAVY;
  .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;
      }
      .el-select {
        flex: 0.4;
        /deep/ input {
          padding: 0;
          background: transparent;
          border: none;
          font-size: 0.072917rem /* 14/192 */;
          font-weight: 500;
          color: #2ba7ff;
        }
        /deep/ .el-icon-arrow-up:before {
          content: '';
          display: block;
          // 定义元素宽高
          margin-top: 0.041667rem /* 8/192 */;
          width: 0.130208rem /* 25/192 */;
          height: 0.078125rem /* 15/192 */;
          background: url('~@/views/groupPage/images/三角下.png') no-repeat center center;
          background-size: 100% 100%;
          transform: rotate(180deg);
        }
      }
      .datePicker {
        position: absolute;
        left: 1.041667rem /* 200/192 */;
        top: 0.182292rem /* 35/192 */;
        .el-range-editor--mini.el-input__inner {
          width: 1.041667rem /* 200/192 */;
          height: 0.145833rem /* 28/192 */;
        }
        /deep/ .el-date-editor .el-range-input {
          width: 100%;
        }
      }
    }
  }
  .content-info {
    width: 100%;
    height: calc(100% - 0.166667rem);
    overflow: auto;
    padding: 2px;
    font-family: Source Han Sans CN-MEDIUM;
    .content-item {
      width: 100%;
      height: 33%;
      float: left;
      overflow: hidden;
      .title {
        width: 100%;
        display: flex;
        // padding: .145833rem 0 .104167rem 0;
        padding: 0.145833rem 0 0.026042rem /* 5/192 */ 0;
        .icon {
          height: 0.072917rem /* 14/192 */;
          width: 0.078125rem /* 15/192 */;
          margin-right: 0.046875rem /* 9/192 */;
          background: url('~@/views/groupPage/images/三角.png') no-repeat center center;
          background-size: 100% 100%;
        }
        .item-name {
          color: #ffffff;
          font-size: 0.072917rem /* 14/192 */;
          font-weight: 500;
        }
        .item-info {
          color: #2ba7ff;
          font-size: 0.072917rem /* 14/192 */;
          font-weight: 500;
        }
      }
      .content {
        height: calc(100% - 0.234375rem /* 45/192 */);
        width: 100%;
        display: flex;
        .chart-container {
          flex: 0.5;
          .chart-title {
            position: absolute;
            left: 0.234375rem /* 45/192 */;
            font-size: 0.083333rem /* 16/192 */;
            font-family: Source Han Sans CN;
            font-weight: bold;
            top: 0.520833rem /* 100/192 */;
            color: #ffffff;
          }
          .bg {
            width: 100%;
            height: 100%;
          }
          .bg {
            position: absolute;
            top: 0.614583rem /* 118/192 */;
            left: 0.041667rem /* 8/192 */;
            z-index: -1;
            width: 0.9375rem /* 180/192 */;
            height: 0.807292rem /* 155/192 */;
            background: no-repeat center;
            background-image: url('~@/views/groupPage/images/底座样式.png');
            background-size: 100% 100%;
          }
        }
        .dataInfo {
          flex: 0.5;
          display: flex;
          flex-flow: column;
          justify-content: space-around;
          font-family: Source Han Sans CN;
          .data-item {
            display: flex;
            align-items: center;
            justify-content: space-around;
            padding: 0.052083rem /* 10/192 */;
            color: #ffffff;
            height: 0.338542rem /* 65/192 */;
            .pointSymbol {
              border-radius: 50%;
              height: 0.052083rem /* 10/192 */;
              width: 0.052083rem /* 10/192 */;
            }
            .data-title {
              font-size: 0.072917rem /* 14/192 */;
              font-weight: 400;
              color: #ffffff;
            }
            .data-value {
              font-size: 0.083333rem /* 16/192 */;
              font-family: Source Han Sans CN-HEAVY;
              font-weight: bold;
              color: #ffffff;
            }
          }
        }
      }
      .epc {
        background: rgba(14, 167, 255, 0.08);
        margin-top: 0.15625rem /* 30/192 */;
      }
    }
  }
}
</style>