<template>
  <el-dialog
    class="page-dialog"
    :visible.sync="modalIsShow"
    :close-on-click-modal="false"
    :close-on-press-escape="false"
    append-to-body
    fullscreen
    @close="closeHandle"
  >
    <div slot="title">{{ rowData.obeCultureProgramName }}</div>
    <div class="mb-4 tab-btns">
      <el-button
        v-for="tab in tabs"
        :key="tab.val"
        size="medium"
        :type="curTab == tab.val ? 'primary' : 'default'"
        @click="selectMenu(tab.val)"
        >{{ tab.name }}
      </el-button>
    </div>

    <div v-if="modalIsShow">
      <component :is="curTab" :row-data="rowData"></component>
    </div>

    <div slot="footer"></div>
  </el-dialog>
</template>

<script>
import RequirementStatisticsRadar from "./RequirementStatisticsRadar.vue";
import RequirementStatisticsStatement from "./RequirementStatisticsStatement.vue";

export default {
  name: "detail-requirement-statistics",
  components: {
    RequirementStatisticsRadar,
    RequirementStatisticsStatement,
  },
  props: {
    rowData: {
      type: Object,
      default() {
        return {};
      },
    },
  },
  data() {
    return {
      modalIsShow: false,
      curTab: "RequirementStatisticsRadar",
      tabs: [
        {
          name: "毕业要求达成度雷达图",
          val: "RequirementStatisticsRadar",
        },
        {
          name: "毕业要求达成情况详细报表",
          val: "RequirementStatisticsStatement",
        },
      ],
    };
  },
  methods: {
    cancel() {
      this.modalIsShow = false;
    },
    open() {
      this.modalIsShow = true;
    },
    selectMenu(tab) {
      this.curTab = tab;
    },
    closeHandle() {
      this.curTab = "RequirementStatisticsRadar";
    },
  },
};
</script>
