<template>
  <div class="cardOneContainer">
    <el-card class="cardStyle">
      <template #header v-if="showTitle">
        <div class="cardOneheader">
          <div class="cardOneLeft">
            <div class="mainTitle">
              {{ title }}
              <slot name="mainTitCustom"></slot>
            </div>
            <slot name="headerRight"></slot>
          </div>
          <div class="subTitle" v-if="desTitle">{{ desTitle }}</div>
        </div>
      </template>
      <slot name="content"></slot>
    </el-card>
  </div>
</template>

<script setup>
import { ref, onMounted } from 'vue'
const props = defineProps({
  title: {
    type: String,
    default: ''
  },
  showTitle: {
    type: Boolean,
    default: true
  },
  desTitle: {
    type: String,
    default: ''
  }
})
</script>

<style lang="scss" scoped>
.cardOneContainer {
  width: 100%;
  box-sizing: border-box;
}
.cardStyle {
  width: 100%;
  margin-bottom: 10px;
  border: none !important;
  /* :deep (.el-card__header) {
    border: none !important;
  } */
}
.headerStyle {
  border: none !important;
}
.cardOneheader {
  width: 100%;
}
.cardOneLeft {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.mainTitle {
  font-size: 18px;
  /* border-left: 4px solid #0052d9; */
  padding-left: 5px;
  display: flex;
  align-items: center;
  margin-right: 20px;

  /* border-top-left-radius: 2px;
  border-bottom-left-radius: 2px;
  border-bottom-right-radius: 2px; */
}
.mainTitle::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: #0052d9;
  margin-right: 5px;
  border-radius: 4px;
}
.subTitle {
  background: rgba(0, 119, 238, 0.05);
  width: 100%;
  padding: 10px 10px;
  font-size: 14px;
  color: rgba(56, 56, 56, 1);
  display: flex;
  align-items: center;
  margin-top: 5px;
  border-radius: 3px;
}
</style>
