From 16584f6d9cc3b883965fda76a964eaab8d810d9c Mon Sep 17 00:00:00 2001 From: Net <93821485+somnetsak123@users.noreply.github.com> Date: Thu, 11 Jul 2024 11:44:17 +0700 Subject: [PATCH] =?UTF-8?q?refactor:=20=E0=B8=81=E0=B8=94=20=E0=B9=80?= =?UTF-8?q?=E0=B8=82=E0=B9=89=E0=B8=B2=E0=B8=AA=E0=B8=B4=E0=B8=99=E0=B8=84?= =?UTF-8?q?=E0=B9=89=E0=B8=B2=E0=B9=80=E0=B9=80=E0=B8=A5=E0=B9=89=E0=B8=A7?= =?UTF-8?q?=20=E0=B9=83=E0=B8=AB=E0=B9=89=20=E0=B9=81=E0=B8=AA=E0=B8=94?= =?UTF-8?q?=E0=B8=87=E0=B8=99=E0=B8=B3=E0=B8=99=E0=B8=A7=E0=B8=99=E0=B8=AB?= =?UTF-8?q?=E0=B8=B2=E0=B8=A2=20=E0=B8=97=E0=B8=B5=E0=B9=88=E0=B8=95?= =?UTF-8?q?=E0=B9=89=E0=B8=AD=E0=B8=87=E0=B8=81=E0=B8=B2=E0=B8=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/04_product-service/MainPage.vue | 39 ++++++++++++++++++++--- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/src/pages/04_product-service/MainPage.vue b/src/pages/04_product-service/MainPage.vue index e01a43a6..2767ceb5 100644 --- a/src/pages/04_product-service/MainPage.vue +++ b/src/pages/04_product-service/MainPage.vue @@ -101,18 +101,36 @@ const stat = ref< icon: string; count: number; label: string; + mode: 'group' | 'type' | 'service' | 'product'; color: 'pink' | 'purple' | 'green' | 'orange'; }[] >([ - { icon: 'mdi-folder', count: 0, label: 'productAndService', color: 'pink' }, + { + icon: 'mdi-folder', + count: 0, label: 'productAndService', + mode: 'group', + color: 'pink' + }, { icon: 'mdi-folder-table', count: 0, label: 'productAndServiceType', + mode: 'type', color: 'purple', }, - { icon: 'mdi-server-network', count: 0, label: 'service', color: 'orange' }, - { icon: 'mdi-folder', count: 0, label: 'product', color: 'green' }, + { + icon: 'mdi-server-network', + count: 0, label: 'service', + mode: 'service', + color: 'orange' + + }, + { + icon: 'mdi-folder', + count: 0, label: 'product', + mode: 'product', + color: 'green' + }, ]); const { t } = useI18n(); @@ -330,6 +348,8 @@ const totalProduct = ref(0); const totalService = ref(0); const totalProductAndService = ref(0); +const filterStat = ref<('group' | 'type' | 'service' | 'product')[]>([]); + // แบ่งหน้า const currentPageGroup = ref(1); const maxPageGroup = ref(1); @@ -1134,6 +1154,9 @@ onMounted(async () => { text: 'manage', handler: () => { productMode.value = 'group'; + + + }, }, ]; @@ -1152,6 +1175,7 @@ watch(productMode, () => { text: 'manage', handler: () => { productMode.value = 'group'; + filterStat.value = [] }, }, ]; @@ -1162,6 +1186,9 @@ watch(productMode, () => { argsi18n: { name: pathGroupName.value }, handler: () => { productMode.value = 'type'; + filterStat.value = filterStat.value.filter((item) => { + return item !== 'type'; + }) }, }); } @@ -1311,7 +1338,7 @@ watch(inputSearchProductAndService, async () => {
@@ -1514,6 +1541,7 @@ watch(inputSearchProductAndService, async () => { :props="props" @click=" async () => { + filterStat.push(productMode); if (productMode === 'type') { pathTypeName = props.row.name; currentIdType = props.row.id; @@ -1532,6 +1560,8 @@ watch(inputSearchProductAndService, async () => { await fetchListType(); flowStore.rotate(); } + + } " > @@ -1882,6 +1912,7 @@ watch(inputSearchProductAndService, async () => { " @on-click=" async () => { + filterStat.push(productMode); if (productMode === 'type') { pathTypeName = props.row.name; currentIdType = props.row.id;