From bbe2dcb273e89d4d8333ccd6b303c5977fbc6633 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 22 Aug 2023 17:56:24 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1?= =?UTF-8?q?=20router.push=20=20=E0=B9=84=E0=B8=9B=E0=B8=97=E0=B8=B0?= =?UTF-8?q?=E0=B9=80=E0=B8=9A=E0=B8=B5=E0=B8=A2=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../07_insignia/components/2_Manage/Tab1.vue | 46 ++++++++++++------- .../07_insignia/components/2_Manage/Tab2.vue | 8 +++- .../07_insignia/components/2_Manage/Tab3.vue | 7 ++- src/modules/07_insignia/store.ts | 4 +- 4 files changed, 44 insertions(+), 21 deletions(-) diff --git a/src/modules/07_insignia/components/2_Manage/Tab1.vue b/src/modules/07_insignia/components/2_Manage/Tab1.vue index 4c01eb36e..c4e30e4c4 100644 --- a/src/modules/07_insignia/components/2_Manage/Tab1.vue +++ b/src/modules/07_insignia/components/2_Manage/Tab1.vue @@ -6,6 +6,9 @@ import type { QTableProps } from "quasar"; import { useInsigniaDataStore } from "@/modules/07_insignia/store"; import http from "@/plugins/http"; import config from "@/app.config"; +import { useRouter } from "vue-router"; + +const router = useRouter(); const mixin = useCounterMixin(); const { @@ -323,12 +326,11 @@ const addlistperson = async (id: string) => { // }; const clickmodalEdit = (props: any) => { insignia.value = props.insigniaSend; - insigniaType.value = props.insigniaLevel; + // insigniaType.value = props.insigniaLevel; person.value = props; - console.log(person.value); modalEdit.value = true; fecthInsignia(); - fecthInsigniaType(); + // fecthInsigniaType(); }; const clickSave = () => { dialogConfirm( @@ -343,7 +345,7 @@ const clickSave = () => { const listEdit = async (profileId: string) => { let data: any = { insigniaId: insignia.value, - insigniaTypeId: insigniaType.value, + // insigniaTypeId: insigniaType.value, }; await http .put(config.API.insigniaEdit(profileId), data) @@ -428,7 +430,7 @@ const listdelete = async (profileId: string) => { const insignia = ref(""); const insigniaOptions = ref([]); const insigniaType = ref(""); -const insigniaTypeOptions = ref([]); +// const insigniaTypeOptions = ref([]); const fecthInsignia = async () => { await http @@ -436,14 +438,20 @@ const fecthInsignia = async () => { .then((res) => { insigniaOptions.value = res.data.result; }) - .catch((err) => {}); + .catch((err) => { + console.log(err); + }); }; -const fecthInsigniaType = async () => { - await http(config.API.insigniaType) - .then((res) => { - insigniaTypeOptions.value = res.data.result; - }) - .catch((err) => {}); +// const fecthInsigniaType = async () => { +// await http(config.API.insigniaType) +// .then((res) => { +// insigniaTypeOptions.value = res.data.result; +// }) +// .catch((err) => {}); +// }; + +const nextPage = (id: string) => { + router.push(`/registry/${id}`); }; const filterKeyword = ref(""); @@ -597,7 +605,11 @@ const paginationLabel2 = (start: string, end: string, total: string) => { diff --git a/src/modules/07_insignia/components/2_Manage/Tab2.vue b/src/modules/07_insignia/components/2_Manage/Tab2.vue index 5d24b7a6c..4ca4ebf76 100644 --- a/src/modules/07_insignia/components/2_Manage/Tab2.vue +++ b/src/modules/07_insignia/components/2_Manage/Tab2.vue @@ -2,6 +2,9 @@ import { onMounted, ref, watch, reactive } from "vue"; import type { QTableProps } from "quasar"; import { useInsigniaDataStore } from "@/modules/07_insignia/store"; +import { useRouter } from "vue-router"; + +const router = useRouter(); import http from "@/plugins/http"; import config from "@/app.config"; @@ -159,6 +162,9 @@ const changtypeOc = () => { } DataStore.typeOc = organization.value; }; +const nextPage = (id: string) => { + router.push(`/registry/${id}`); +}; const filterKeyword = ref(""); const filterRef = ref(null); @@ -285,7 +291,7 @@ const paginationLabel = (start: string, end: string, total: string) => { {{ props.rowIndex + 1 }} diff --git a/src/modules/07_insignia/components/2_Manage/Tab3.vue b/src/modules/07_insignia/components/2_Manage/Tab3.vue index a9eacf464..1dccc05d3 100644 --- a/src/modules/07_insignia/components/2_Manage/Tab3.vue +++ b/src/modules/07_insignia/components/2_Manage/Tab3.vue @@ -3,7 +3,9 @@ import { onMounted, ref, watch, reactive } from "vue"; import { useQuasar } from "quasar"; import type { QTableProps } from "quasar"; import { useInsigniaDataStore } from "@/modules/07_insignia/store"; +import { useRouter } from "vue-router"; +const router = useRouter(); const DataStore = useInsigniaDataStore(); const props = defineProps({ @@ -155,6 +157,9 @@ const changtypeOc = () => { } DataStore.typeOc = organization.value; }; +const nextPage = (id: string) => { + router.push(`/registry/${id}`); +}; const filterKeyword = ref(""); const filterRef = ref(null); @@ -280,7 +285,7 @@ const paginationLabel = (start: string, end: string, total: string) => { {{ props.rowIndex + 1 }} diff --git a/src/modules/07_insignia/store.ts b/src/modules/07_insignia/store.ts index 4ff9dfd02..fa21123a3 100644 --- a/src/modules/07_insignia/store.ts +++ b/src/modules/07_insignia/store.ts @@ -1,6 +1,7 @@ import { defineStore } from "pinia"; import { ref, } from "vue"; import { useCounterMixin } from "@/stores/mixin"; + const mixin = useCounterMixin(); const { date2Thai @@ -12,7 +13,6 @@ export const useInsigniaDataStore = defineStore("insignia", () => { let typeOc = ref("") let rows = ref([]) const listinsignia = ref([]) - const typeinsigniaValues: Set = new Set(); const typeinsignia = ref("all"); let typeinsigniaOptions = ref([{ id: "all", name: "ทั้งหมด" }]); @@ -66,6 +66,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => { } } }; + return { optionsTypeOc, typeOc, @@ -74,6 +75,5 @@ export const useInsigniaDataStore = defineStore("insignia", () => { typeinsignia, fetchData, searchFilterTable, - }; });