All files / src/views/safety ChaptersSafety.vue

0% Statements 0/24
100% Branches 0/0
0% Functions 0/8
0% Lines 0/24

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80                                                                                                                                                               
<template>
  <pattern-tabs :tabs="tabs_items">
    <template v-slot:item>
      <v-window-item class="gap  h-100  " value="mainInfo">
        <MainInfoSafety
          :formainpage="safetyData.mainpage_file"
          :responsibility="safetyData.type_resp"
          :commitee="safetyData.type_comm"
        ></MainInfoSafety>
      </v-window-item>
      <v-window-item class="gap h-100" value="document">
        <documentation-safety  :docSections = "safetyData"  />
      </v-window-item>
      <!-- <v-window-item class="gap h-100" value="testings">
        <TestSafety></TestSafety>
      </v-window-item> -->
    </template>
  </pattern-tabs>
</template>

<script>
import { ref, onMounted, onUpdated } from "vue";

import { pagecounter } from "@/utils/universal_functions";
import PatternTabs from "@/components/UI/PatternTabs.vue";
import { useRoute } from "vue-router";
import TestSafety from "@/views/safety/TestSafety.vue";
import MainInfoSafety from "@/views/safety/MainInfoSafety.vue";
import { axiosApiInstance } from "@/utils/axios-api";
import DocumentationSafety from "./DocumentationSafety.vue";
 
export default {
  components: {
    PatternTabs,
    TestSafety,
    MainInfoSafety,
    DocumentationSafety,
  },
 
  setup() {
    pagecounter();
 
    const safetyData = ref({});
    const loading = ref(false);
    const route = useRoute();
    const getSafety = () => {
      axiosApiInstance
        .get(`api/safety/?chapter=${route.params.chapter}`)
        .then((result) => {
          safetyData.value = result.data;
          loading.value = true;
        });
    };
    getSafety()
    // onMounted(() => getSafety())
    onUpdated(() => getSafety())

    return {
      safetyData,

      tabs_items: [
        { title: "Основная информация", value: "mainInfo" },
        { title: "Документация", value: "document" },
        // { title: "Тестирование", value: "testings" },
      ],
    };
  },
};
</script>
<style>
.active-tab {
  background-color: #e0f2f1;
  color: #004d40;
}
 
a {
  color: inherit;
}
</style>