updated Refactoring code

This commit is contained in:
Warunee Tamkoo 2024-09-02 10:58:34 +07:00
parent 75c0e27880
commit 3be75b9e81

View file

@ -1,19 +1,22 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted } from "vue"; import { ref, onMounted } from "vue";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import router from "@/router"; import router from "@/router";
import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin"; import http from "@/plugins/http";
import PopupReplyInbox from "@/components/PopupReplyInbox.vue";
import PopupDetailInbox from "@/components/PopupDetailInbox.vue";
import { tokenParsed } from "@/plugins/auth"; import { tokenParsed } from "@/plugins/auth";
import { import { useCounterMixin } from "@/stores/mixin";
import type {
InboxDetail, InboxDetail,
InboxList, InboxList,
MenuMainList, MenuMainList,
} from "@/modules/01_dashboard/interface/Main"; } from "@/modules/01_dashboard/interface/Main";
import PopupReplyInbox from "@/components/PopupReplyInbox.vue";
import PopupDetailInbox from "@/components/PopupDetailInbox.vue";
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { showLoader, hideLoader, date2Thai, messageError } = mixin; const { showLoader, hideLoader, date2Thai, messageError } = mixin;
@ -105,15 +108,6 @@ const items = ref<MenuMainList[]>([
}, },
]); ]);
onMounted(async () => {
await fetchlistInbox(1); //
//
const user = await tokenParsed();
if (user) {
fullname.value = user.name;
}
});
/** /**
* งกนดงขอมลกลองขอความ * งกนดงขอมลกลองขอความ
* @param index หนาทโหลดขอม * @param index หนาทโหลดขอม
@ -229,6 +223,15 @@ async function onLoad(index: number, done: Function) {
}, 3000); }, 3000);
} }
} }
onMounted(async () => {
await fetchlistInbox(1); //
//
const user = await tokenParsed();
if (user) {
fullname.value = user.name;
}
});
</script> </script>
<template> <template>