<!--
 * @Descripttion:
 * @version:
 * @Author: kBank
 * @Date: 2022-10-24 10:45:39
-->
<template>
  <div class="topbox">
    <div
      class="levelList_i"
      :class="tabActive == item.path ? 'act' : ''"
      v-for="(item, index) in topList"
      :key="index"
      @click.prevent="handleLink(item)"
      :style="
        waitApprovalNum || receiveApprovalNum ? { marginTop: '12px' } : {}
      "
    >
      {{ item.name }}
      <span v-if="waitApprovalNum && item.name == '代办'" class="badge">{{
        waitApprovalNum
      }}</span>
      <span
        v-if="receiveApprovalNum && item.name == '抄送查阅/操作'"
        class="badge"
        >{{ receiveApprovalNum }}</span
      >
      <!-- <i
        v-show="isMouse == item.path && isMouse != tabActive"
        @click.prevent="delItem(item.path)"
        class="el-icon-error cha"
      ></i> -->
      <!-- <div class="li" :class="tabActive == item.path ? 'act1' : ''"></div> -->
    </div>
  </div>
</template>

<script>
export default {
  name: "topBar",
  props: {
    topList: {
      type: Array,
    },
    moren: {
      type: String,
    },
    waitApprovalNum: {
      type: Number,
    },
    receiveApprovalNum: {
      type: Number,
    },
  },
  data() {
    return {
      tabActive: this.moren,
    };
  },
  methods: {
    handleLink(item) {
      this.tabActive = item.path;
      this.$router.push({
        path: item.path,
      });
    },
  },
};
</script>

<style scoped lang="scss">
.topbox {
  align-items: center;
  // height:74px;
  padding: 0px 0 3px 0;
  position: relative;
  display: flex;
  //   background: skyblue;
  .levelList_i {
    padding: 4px 15px;
    margin-left: 20px;
    position: relative;
    cursor: pointer;
    min-width: 88px;
    // height: 28px;
    border-radius: 17px;
    border: 1px solid #cccccc;
    font-size: 12px;
    font-family: MicrosoftYaHei;
    text-align: center;
    // line-height: 28px;
    .badge {
      position: absolute;
      top: -15px;
      right: -12px;
      background-color: #ff0000;
      color: white;
      font-size: 10px;
      width: 20px;
      height: 20px;
      display: flex;
      justify-content: center;
      align-items: center;
      border-radius: 50%;
      z-index: 999 !important;
    }
  }
}
.act {
  color: #ffffff;
  background: #c8161d;
}
.act1 {
  border-bottom: 3px solid #1890ff !important;
}
.cha {
  font-size: 16px;
  color: #606266;
  position: absolute;
  top: 10px;
}
.li {
  width: 40px;
  margin: 0 auto;
  border-bottom: 3px solid transparent;
}
</style>
