<template>
  <Card :title="title">
    <!-- <div class="rates">
      <div class="rate">
        <div class="chart">
          <JRingChart :title="{ text: '89%', y: '40%' }" :data="[{ value: 89 }, { value: 11 }]" :color="['#557DEE', '#182B53']" />
        </div>
        <div class="label">项目整改率</div>
      </div>
      <div class="rate">
        <div class="chart">
          <JRingChart :title="{ text: '89%', y: '40%' }" :data="[{ value: 89 }, { value: 11 }]" :color="['#5BE2F6', '#193F54']" />
        </div>
        <div class="label">项目及时整改率</div>
      </div>
      <div class="rate">
        <div class="chart">
          <JRingChart :title="{ text: '89%', y: '40%' }" :data="[{ value: 89 }, { value: 11 }]" :color="['#FF6C7F', '#39273D']" />
        </div>
        <div class="label">项目及时复查率</div>
      </div>
    </div> -->
    <div class="info">
      <vue-scroll>
        <div class="info-item" v-for="(item, index) in activityList" :key="index">
          {{ `${item.rectifyPeopleAme} 有一条 ${status[item.state]} 的问题` }}
        </div>
      </vue-scroll>
      <div v-if="!activityList.length">无数据</div>
    </div>
  </Card>
</template>

<script>
import Card from '../components/Card.vue'
import JRingChart from '../jChart/pie/JRingChart.vue'
import { selectRectifiedSecurityManageList2Api } from '@/assets/js/api/dataBoard'
export default {
  components: { Card, JRingChart },
  props: {
    title: {
      type: String,
      default: ''
    }
  },
  mounted() {
    selectRectifiedSecurityManageList2Api({ projectSn: this.$store.state.projectSn }).then(res => {
      this.activityList = res.result || []
    })
  },
  data() {
    return {
      activityList: [],
      status: {
        1: '待整改',
        2: '待审核',
        3: '闭合',
        4: '无需整改'
      }
    }
  }
}
</script>

<style lang="less" scoped>
.rates {
  height: 100%;
  display: flex;
  .rate {
    width: 33%;
    height: 70%;
    .chart {
      height: 100%;
    }
    .label {
      text-align: center;
    }
  }
}

.info {
  height: 100%;
  .info-item {
    padding-left: 20px;
  }
}
</style>
