<script setup lang="ts">
import { shallowRef, onMounted } from "vue";
import { usePermission } from "/@/hooks/core";
import Detail from "./components/detail.vue";
import NoAuth from "/@/components/NoAuth/NoAuth.vue";

const active = shallowRef("");

const { hasPermissionWithCode, permissions } = usePermission("mediumDepartment");

onMounted(() => {
  if (hasPermissionWithCode("11")) {
    active.value = "11";
    return;
  }
});
</script>

<template>
  <div class="report-container">
    <ElTabs v-model="active" style="color: #fff" v-if="active">
      <ElTabPane name="11" label="业绩表明细" v-if="hasPermissionWithCode('11')">
        <Detail v-if="active === '11'" />
      </ElTabPane>
    </ElTabs>

    <NoAuth v-else />
  </div>
</template>

<style scoped lang="scss">
.report-container {
  height: calc(100vh - 48px);
  :deep(.el-tabs__header) {
    background-color: #fff;
    padding: 10px 10px 0;
  }
}
</style>
