From fb1c601b73f13694f74e5fa7d72a9e8b229df3f5 Mon Sep 17 00:00:00 2001 From: waruneeta Date: Thu, 9 Nov 2023 10:14:46 +0700 Subject: [PATCH] change menu right --- src/views/MainLayout.vue | 74 ++++++---------------------------------- 1 file changed, 10 insertions(+), 64 deletions(-) diff --git a/src/views/MainLayout.vue b/src/views/MainLayout.vue index 69ba0ae4..bea46b25 100644 --- a/src/views/MainLayout.vue +++ b/src/views/MainLayout.vue @@ -5,16 +5,8 @@ import { useRoute, useRouter } from "vue-router"; import { useDataStore } from "@/stores/data"; import { storeToRefs } from "pinia"; import { scroll, useQuasar } from "quasar"; -import { useCounterMixin } from "@/stores/mixin"; -import http from "@/plugins/http"; -import config from "@/app.config"; - -import type { - ScrollType, - notiType, - optionType, -} from "../interface/request/main/main"; +import type { ScrollType } from "../interface/request/main/main"; import { menuList, tabListLogin, @@ -25,7 +17,7 @@ import { tabList, } from "../interface/request/main/main"; -const { setVerticalScrollPosition, getVerticalScrollPosition } = scroll; +const { setVerticalScrollPosition } = scroll; const store = useDataStore(); const route = useRoute(); const router = useRouter(); @@ -42,40 +34,10 @@ const active = ref(0); const drawerL = ref(false); const fullname = ref(""); const role = ref([]); -const notiTrigger = ref(false); -const text = ref(""); +const menuRight = ref(false); const listTab = ref([]); -const notiList = ref([ - { - id: "1", - sender: "ท", - body: "ขอแก้ไขข้อมูลทะเบียนประวัติ", - timereceive: new Date(), - }, -]); -const options = ref([ - { - icon: "mdi-account-cog", - label: "ผู้ดูแลระบบ", - value: "op1", - color: "primary", - }, - { - icon: "mdi-account-group", - label: "เจ้าหน้าที่", - value: "op2", - color: "blue", - }, - { - icon: "mdi-account-circle", - label: "บุคคล", - value: "op3", - color: "indigo", - }, -]); - /** * toggleBtnRight ปุ่มย่อ ขยาย drawer ขวา */ @@ -95,19 +57,6 @@ const toggleBtnLeft = () => { } }; -/** - * Event onScroll นำ ตำแหน่ง top ที่ scroll - * ใช้ function updateScroll - */ -const onScroll = (scroll: ScrollType) => { - const { position } = scroll; - if (route.name == "PlacementPersonalDetail") { - updateScrollPlacement(position); - } else { - updateScroll(position); - } -}; - /** * updateScroll เป็น function active แทปด้านขวา */ @@ -205,8 +154,7 @@ onMounted(async () => { }); const setListTab = () => { - // console.log(route.name); - + menuRight.value = true if (route.name == "login") { listTab.value = tabListLogin; } else if (route.name == "datamain") { @@ -217,14 +165,16 @@ const setListTab = () => { listTab.value = tabRegistration; } else if (route.name == "recruitmain") { listTab.value = tabRecruit; - } + } changeTab(listTab.value[0].tag); - + if (route.name == "dashboard") { listTab.value = []; + menuRight.value = false } window.scrollTo(0, 0); }; + watch(route, () => { setListTab(); }); @@ -320,7 +270,6 @@ const updateScrollPlacement = (position: number) => { if (position === void 0) { position = document.documentElement.scrollTop || document.body.scrollTop; } - }; const activeBtnPlacement = () => { @@ -350,10 +299,6 @@ if (keycloak.tokenParsed != null) { fullname.value = keycloak.tokenParsed.name; role.value = keycloak.tokenParsed.role; } -const clickTag = (val: string) => { - console.log(val); - router.push(val); -}; @@ -361,7 +306,7 @@ const clickTag = (val: string) => { - + @@ -685,6 +630,7 @@ const clickTag = (val: string) => {