<template>
  <div>
    <div class="ranking bg-color-black">
      <div class="title d-flex align-center">
         <span>
          <SvgIcon icon-class="fangwu" class="text-icon"></SvgIcon>
        </span>
        <span class="fs-xl text">房屋资产</span>
      </div>

      <dv-scroll-ranking-board class="dv-scr-rank-board mt-1" :config="ranking"/>
    </div>
  </div>
</template>

<script>
import SvgIcon from "@/components/SvgIcon"

export default {
  components: {
    SvgIcon
  },
  inject: ["assets"],
  data() {
    return {}
  },
  methods: {},
  computed: {
    ranking() {
      if (this.assets()[0]) {
        return {
          data: this.assets()[0].map(item => ({
            name:  item.name.length > 16 ? (item.name.slice(0, 14) + '...') : item.name,
            value: item.dengjimianji ?? 0
          })),
          carousel: 'single',
          unit: '平方',
          waitTime: 4000,
          rowNum: 3
        }
      }
    }
  }
}
</script>

<style scoped lang="scss">
.text-icon {
  width: 24px;
  height: 24px;
  color: #1da4a1;
}

.ranking {
  padding: 20px 10px;
  width: 100%;

  .dv-scr-rank-board {
    height: 180px;
    padding: 10px 20px;
  }

  .title {
    display: flex;
    color: #fff;
    padding: 0 20px;
    align-items: center;

    .text {
      padding: 0 8px;
    }
  }
}

::v-deep .dv-scroll-ranking-board .ranking-column .inside-column {
  background: linear-gradient(to left, #7ddacd, #1da4a1);
}
</style>
