updated Refactoring code
This commit is contained in:
parent
75c0e27880
commit
3be75b9e81
1 changed files with 17 additions and 14 deletions
|
|
@ -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>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue