<template>
  <dashboard-item-container :title="title">
    <template #right-menu>
      <slot name="right-menu"></slot>
    </template>
    <div v-if="$slots.thead" class="thead">
      <slot name="thead"></slot>
    </div>
    <vue3-scroll-seamless :class="{ none: !$slots.thead }" :classOptions="classOptions" :dataList="props.list"
      class="scroll-wrap">
      <div v-for="(row, index) of props.list" :key="index" class="list-item">
        <slot v-bind="{ row, index }"></slot>
      </div>
    </vue3-scroll-seamless>
  </dashboard-item-container>
</template>

<script setup>
import { vue3ScrollSeamless } from "vue3-scroll-seamless";
import DashboardItemContainer from '@/views/dataBigScreen/dashboard/components/DashboardItemContainer.vue';

const props = defineProps({
  title: {
    type: String,
    default: '',
  },
  list: {
    type: Array,
    default: () => [],
  },
});
const classOptions = {
  limitMoveNum: 5,
  step: 1
};
</script>

<style lang="less" scoped>
.thead {
  display: flex;
  align-items: center;
  width: 100%;
  height: 40px;
  padding: 0 16px;
  color: #fbffff;
  font-size: 12px;
  font-weight: bold;
}

.scroll-wrap {
  width: 100%;
  // height: calc(100% - 82px);
  margin: 0 auto;
  overflow: hidden;
  color: #fbffff;
  font-size: 12px;
  padding: 0 16px;

  &.none {
    // height: calc(100% - 52px);
    margin-top: 12px;
  }


  .list-item {
    display: flex;
    align-items: center;
    color: #fbffff;
    padding: 4px 0;
    font-size: 12px;
  }
}
</style>