<template>
  <div>
    <!-- 企业端 -->
    <div v-if="showCompanySection">
      <!-- <div> -->
      <qiyeduan />
    </div>
    <!-- 政务端 -->
    <div v-if="checkRole(['common'])">
      <zhengwuduan />
    </div>
  </div>
</template>

<script>
import qiyeduan from '@/views/components/qiyexinxi/qiyexinxi.vue'
import zhengwuduan from '@/views/components/zhengwuxinxi/zhengwuxinxi.vue'
import { checkPermi, checkRole } from "@/utils/permission";

export default {
  components: { qiyeduan, zhengwuduan },
  methods: {
    checkPermi,
    checkRole
  },
  computed: {
    showCompanySection() {
      const isCompany = this.checkRole(['company']);
      const isCommon = this.checkRole(['common']);
      // 如果两个角色都存在，则隐藏企业端
      return isCompany && !isCommon;
    }
  }
}
</script>