<template>
  <div>
    <by-criteria v-if="type === '1'" :groupName="groupName"/>
    <manual v-else :groupName="groupName"/>
  </div>
</template>

<script>
import byCriteria from './components/byCriteria.vue';
import manual from './components/manual.vue';
import {GetGroupsDetail} from "@/api/group";
export default {
  components: {manual, byCriteria },
  data() {
    return {
      type: this.$route.query.type,
      groupName: ""
    };
  },
  created() {
    this.getDetail();
  },
  mounted() {

  },
  methods: {
    beforeunloadHandler(e) {
      console.log("=========================")
      alert("aaaa")
    },
    getDetail() {
      GetGroupsDetail(this.$route.query.id).then((res) => {
        this.groupName = res.groupName;
      });
    },
  }
};
</script>
