<template>
  <div class="information_index">
    <enterprise v-show="select === 1" />
  </div>
</template>

<script>
import enterprise from "./Enterprise-information1.vue";
import safety from "./safety-management.vue";
export default {
  components: {
    enterprise,
    safety,
  },
  name: "InformationIndex",
  data() {
    return {
      select: 1,
    };
  },
  mounted() {
    this.getFrom();
  },
  methods: {
    getFrom() {
      if (this.$route.query.related) {
        const fromImage = JSON.parse(this.$route.query.related);
        if (fromImage && fromImage.length > 0) {
          this.select = 2;
        } else {
          this.select = 1;
        }
      }
    },
    newTb() {
      this.select = 1;
    },
    tbTask() {
      this.select = 2;
    },
  },
};
</script>

<style scoped lang="scss">
.information_index {
  .mtitle {
    display: flex;
    background: white;
    color: #333333;
    font-size: 4.3vw;
    div {
      height: 13.5vw;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      margin: 0 3vw;
    }
    .selected {
      border-bottom: 5px solid #1d18bc;
      color: #1d18bc;
    }
  }
}
</style>
