implemented mode change

This commit is contained in:
2024-03-25 23:23:37 +01:00
parent 45a4b58f26
commit 3f88f6b821
71 changed files with 3020 additions and 1006 deletions

View File

@ -3,7 +3,8 @@
<div id="content-header">
<router-link to="/maintenanceVisits" class="button" id="maintenanceVisits-button"
@click="defaultMasterChecklistPage()">
<h1 :class="[darkMode ? 'h1-darkmode' : 'h1-lightmode']" id="active-page-name">Maintenance visits</h1>
<h1 :class="[loggedInUserDarkModeBoolean ? 'h1-darkmode' : 'h1-lightmode']" id="active-page-name">Maintenance
visits</h1>
</router-link>
&nbsp;
&nbsp;
@ -23,7 +24,8 @@
&nbsp;
<router-link to="/productionOrders" class="button" id="productionOrders-button"
@click="defaultMasterChecklistPage()">
<h1 :class="[darkMode ? 'h1-darkmode' : 'h1-lightmode']" id="page-name">Production orders</h1>
<h1 :class="[loggedInUserDarkModeBoolean ? 'h1-darkmode' : 'h1-lightmode']" id="page-name">Production orders
</h1>
</router-link>
</div>
<div id="content-body">
@ -42,11 +44,9 @@
<script setup>
import { ref } from 'vue';
import { ref, onMounted, watch } from 'vue';
import CustomerSearch from "../components/CustomerSearch.vue";
import MaintenanceVisitsTemplateTable from "../components/server/MaintenanceVisitsTemplateTable.vue";
// import MaintenanceVisitsTemplateTableNoCustomer from "../components/server/MaintenanceVisitsTemplateTableNoCustomer.vue";
import MaintenanceVisitsTemplate from "../components/server/MaintenanceVisitsTemplate.vue";
import TemplateChecklistMVT from "../components/server/TemplateChecklistMVT.vue";
import TemplateSearch from "../components/TemplateSearch.vue";
@ -57,23 +57,45 @@ import { useStore } from 'vuex';
import { computed } from 'vue';
const store = useStore();
const modeChanged = computed(() => store.state.updateDarkMode);
const onTemplatelist = computed(() => store.state.onTemplatelist);
// const onCustomerTemplatelist = computed(() => store.state.onCustomerTemplatelist);
const onTemplate = computed(() => store.state.onTemplate);
const onInstancelist = computed(() => store.state.onInstancelist);
const onInstance = computed(() => store.state.onInstance);
const loggedInUserDarkModeBoolean = ref('');
definePageMeta({
layout: 'default',
title: 'Maintenance Visits'
})
const darkMode = ref(true)
const defaultMasterChecklistPage = () => {
store.commit('resetStore');
store.commit('changeToTemplatelist')
}
const getSession = async () => {
const loggedInUserDarkModeBool = getItem('logged-in-user-darkMode');
if (loggedInUserDarkModeBool == 1) {
loggedInUserDarkModeBoolean.value = true;
} else {
loggedInUserDarkModeBoolean.value = false;
}
}
function getItem(item) {
if (process.client) {
return localStorage.getItem(item)
} else {
return undefined
}
}
watch(modeChanged, getSession)
onMounted(async () => {
await getSession();
});
</script>
<script>