<template>
  <div class="box-card">
    <div class="tit-box">
      <span class="title">{{ title }}</span>
      <slot name="tips"></slot>
      <span class="err-btn" v-if="isErrorBtn && $route.path !== '/product-analysis/report'" @click="$emit('errorResolution')">错误解析</span>
    </div>
    <slot></slot>
  </div>
</template>

<script>
export default {
  props: {
    title: { type: String },
    isErrorBtn: { type: Number, default: 0 }
  }
}
</script>

<style lang="scss" scoped>
.box-card {
  padding: 0 22px 30px;
  position: relative;
  margin-bottom: 30px;
  &::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 620px;
    border-bottom: 1px dashed #c0c0c0;
  }
  .tit-box {
    display: flex;
    // justify-content: space-between;
    color: #4cac94;
    cursor: pointer;
  }
  .err-btn {
    position: relative;
    z-index: 9999;
    margin-left: auto;
  }
  .title {
    font-size: 18px;
    font-weight: bold;
    color: #666666;
    line-height: 100%;
    position: relative;
    &::after {
      content: '';
      position: absolute;
      bottom: 2px;
      left: 0;
      width: 100%;
      height: 5px;
      background: rgba(104, 184, 164, 0.8);
    }
  }
}
</style>
