implemented poi and mvi
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<section :class="['template-search', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
||||
<section v-if="notAllInstancesIcon" :class="['template-search', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
||||
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Template:</div>
|
||||
<pre :class="['data', darkMode ? 'pre-darkmode' : 'pre-lightmode']">{{ template.name }}</pre>
|
||||
</section>
|
||||
@ -21,6 +21,7 @@ const modeChanged = computed(() => store.state.updateDarkMode);
|
||||
const template = ref({});
|
||||
const chosenMVTId = computed(() => store.state.chosenMVTId);
|
||||
const chosenPOTId = computed(() => store.state.chosenPOTId);
|
||||
const notAllInstancesIcon = computed(() => store.state.notAllInstancesIcon);
|
||||
|
||||
const darkMode = ref('');
|
||||
|
||||
@ -34,24 +35,26 @@ const getSession = async () => {
|
||||
}
|
||||
|
||||
// get maintenance visit template from id
|
||||
const getMVTById = async () => {
|
||||
if (id.value.fullPath == '/maintenanceVisits') {
|
||||
try {
|
||||
const response = await Axios.get(
|
||||
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getMaintenanceVisitTemplate/${chosenMVTId.value}`
|
||||
);
|
||||
template.value = response.data;
|
||||
} catch (err) {
|
||||
console.log(err.response.statusText);
|
||||
}
|
||||
} else if (id.value.fullPath == '/productionOrders') {
|
||||
try {
|
||||
const response = await Axios.get(
|
||||
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getProductionOrderTemplate/${chosenPOTId.value}`
|
||||
);
|
||||
template.value = response.data;
|
||||
} catch (err) {
|
||||
console.log(err.response.statusText);
|
||||
const getTById = async () => {
|
||||
if (notAllInstancesIcon.value) {
|
||||
if (id.value.fullPath == '/maintenanceVisits') {
|
||||
try {
|
||||
const response = await Axios.get(
|
||||
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getMaintenanceVisitTemplate/${chosenMVTId.value}`
|
||||
);
|
||||
template.value = response.data;
|
||||
} catch (err) {
|
||||
console.log(err.response.statusText);
|
||||
}
|
||||
} else if (id.value.fullPath == '/productionOrders') {
|
||||
try {
|
||||
const response = await Axios.get(
|
||||
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getProductionOrderTemplate/${chosenPOTId.value}`
|
||||
);
|
||||
template.value = response.data;
|
||||
} catch (err) {
|
||||
console.log(err.response.statusText);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -68,7 +71,7 @@ watch(modeChanged, getSession)
|
||||
|
||||
onMounted(async () => {
|
||||
getSession();
|
||||
await getMVTById();
|
||||
await getTById();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user