<template>
  <div class="overview-main-box-wrapper"
    :style="{ width: width ? width : '1064px', height: height ? height : '450px' }">
    <div class="overview-main-box-header">
      <div class="header-left">
        <div class="header-icon">
          <slot name="header-icon"></slot>
        </div>
        <div class="header-title">{{ title }}</div>
      </div>

      <div class="header-right" @click="handleClickToDetail()">
        {{ "查看详情 >" }}
      </div>
    </div>
    <div class="wrapper-main">
      <slot></slot>
    </div>
  </div>
</template>

<script setup>
import { ref, computed } from 'vue'

const emit = defineEmits(['toDetail'])

const props = defineProps({
  title: {
    type: String,
    default: ''
  },
  width: {
    type: String,
    default: ''
  },
  height: {
    type: String,
    default: ''
  }
})

const handleClickToDetail = () => {
  emit('toDetail')
}



</script>

<style lang="scss" scoped>
.overview-main-box-wrapper {
  border: 1px solid rgba(234, 236, 238, 1);
  border-radius: 10px;
  box-shadow: 0px 0px 20px 0px rgba(25, 69, 130, 0.1);
  background: rgba(255, 255, 255, 1);
  position: relative;

  .overview-main-box-header {
    height: 48px;
    border-bottom: 1px solid rgba(240, 242, 244, 1);
    display: flex;
    justify-content: space-between;
    box-sizing: border-box;

    .header-left {
      display: flex;

      .header-icon {
        width: 24px;
        height: 24px;
        margin-top: 12px;
        margin-left: 17px;
      }

      .header-title {
        margin-left: 19px;
        height: 48px;
        padding: 0 16px;
        background: var(--color-main-active);
        color: #fff;
        font-family: Source Han Sans CN;
        font-size: 20px;
        font-weight: 700;
        line-height: 48px;
        text-align: center;
      }
    }

    .header-right {
      margin-right: 27px;
      margin-top: 12px;
      height: 24px;
      color: rgba(20, 89, 187, 1);
      font-family: Microsoft YaHei;
      font-size: 16px;
      font-weight: 400;
      line-height: 24px;
      cursor: pointer;
    }
  }

  .wrapper-main {
    height: calc(100% - 48px);
    overflow: hidden;
    // position: relative;
  }
}
</style>
