<template>
  <div class="chartsContainer">
    <div v-if=" title " class="chartsContainer-title">
      <span class="title-text">{{ title }}</span>
      <div class="title-slot">
        <slot name="title"></slot>
      </div>
    </div>
    <div class="chartsContainer-content">
      <div class="chartsContainer-content-top" v-if=" name ">
        <div class="chartsContainer-content-name">{{ name }}</div>
        <div class="chartsContainer-content-other">
          <slot name="other"></slot>
        </div>
      </div>
      <div class="chartsContainer-content-describe" v-if=" $slots.describe ">
        <slot name="describe"></slot>
      </div>
      <div class="chartsContainer-content-content">
        <slot></slot>
      </div>
    </div>
  </div>
</template>

<script setup>
import { onMounted } from 'vue';
const porps = defineProps({
  title: {
    type: String,
    default: ''
  },
  name: {
    type: String,
    default: ''
  }
})
</script>

<style lang="scss" scoped>
.chartsContainer {
  width: 100%;
  height: 100%;
  position: relative;
  background: linear-gradient(to bottom, rgba(8, 97, 117, 0) 0%, #13a2d6 200%);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;

  .chartsContainer-title {
    height: 42px;
    width: 100%;
    background: linear-gradient(to right, #004387 0%, #090B18 100%);
    border-left: 1px solid #1892CE;
    line-height: 42px;
    color: #fff;
    font-weight: 900;
    font-size: 20px;
    text-indent: 1em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    // padding: 0 15px;
    
    .title-text {
      flex: 1;
    }
    
    .title-slot {
      display: flex;
      align-items: center;
      margin-left: 10px;
    }
  }

  .chartsContainer-content {
    padding: 20px 15px 10px;
    box-sizing: border-box;
    display: flex;
    width: 100%;
    flex: 1;
    flex-direction: column;
    row-gap: 10px;
    overflow: hidden;

    .chartsContainer-content-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      color: #78DEF5;

      .chartsContainer-content-name {
        color: #fff;
        font-weight: bold;
        font-size: 16px;
        display: flex;
        align-items: center;

        &::before {
          content: '';
          display: inline-block;
          border-left: 9px solid #1CB6FF;
          border-top: 8px solid transparent;
          border-right: 9px solid transparent;
          border-bottom: 8px solid transparent;
        }
      }
      .chartsContainer-content-other {
        display: flex;
        align-items: center;
      }
    }

    .chartsContainer-content-describe {
      color: #78DEF5;
      font-size: 12px;
      font-weight: bold;
       display: flex;
      align-items: center;
    }

    .chartsContainer-content-content {
      flex: 1;
      width: 100%;
      overflow: hidden;
      --el-bg-color: transparent;
      --el-fill-color-blank: transparent;
      --el-border-color-lighter: #1887A6;
      --el-text-color-regular: #fff;
      --el-fill-color-light: #5e93a1;

      :deep(.el-table) {
        .el-table__header-wrapper th {
          background-color: #1CA7C8 !important;
          color: #fff;
        }

        .cell {
          font-weight: bold;
        }
      }
    }
  }
}
</style>