From ba3c9b1a119239a0509a3f133dde585007551511 Mon Sep 17 00:00:00 2001 From: puriphatt Date: Wed, 10 Apr 2024 13:57:17 +0700 Subject: [PATCH 1/6] refactor: form space --- src/components/FormDialog.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/FormDialog.vue b/src/components/FormDialog.vue index ee1cea71..928934c6 100644 --- a/src/components/FormDialog.vue +++ b/src/components/FormDialog.vue @@ -123,7 +123,7 @@ watch(provinceId, (v) => {
@@ -131,7 +131,7 @@ watch(provinceId, (v) => {
Date: Wed, 10 Apr 2024 13:57:39 +0700 Subject: [PATCH 2/6] fix: selector count --- src/components/SelectorList.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/SelectorList.vue b/src/components/SelectorList.vue index fcc26258..c5cc97a7 100644 --- a/src/components/SelectorList.vue +++ b/src/components/SelectorList.vue @@ -28,7 +28,7 @@ defineProps<{ @click="selector = v.label" > {{ $t(v.label) }} -
1
+
{{ v.count }}
From 44b3fa97aaddf8fbcfed130bd120fa4ae72bfcdf Mon Sep 17 00:00:00 2001 From: puriphatt Date: Wed, 10 Apr 2024 13:58:14 +0700 Subject: [PATCH 3/6] refactor: personCard emit --- src/components/home/PersonCard.vue | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/home/PersonCard.vue b/src/components/home/PersonCard.vue index ce416225..ab17ebcd 100644 --- a/src/components/home/PersonCard.vue +++ b/src/components/home/PersonCard.vue @@ -7,6 +7,7 @@ import { Icon } from '@iconify/vue'; defineProps<{ list: { + id: string; name: string; detail: { label: string; value: string }[]; male?: boolean; @@ -18,6 +19,11 @@ defineProps<{ detailColumnCount?: number; }>(); +defineEmits<{ + (e: 'deleteCard', id: string): void; + (e: 'updateCard', id: string): void; +}>(); + const status = ref(false); @@ -55,7 +61,11 @@ const status = ref(false); {{ $t('edit') }} - + Date: Wed, 10 Apr 2024 13:59:13 +0700 Subject: [PATCH 4/6] feat: branch userStats (store, type) --- src/stores/branch/index.ts | 25 +++++++++++++++++++++++++ src/stores/branch/types.ts | 7 +++++++ 2 files changed, 32 insertions(+) diff --git a/src/stores/branch/index.ts b/src/stores/branch/index.ts index 6c13dd48..0c00ed0d 100644 --- a/src/stores/branch/index.ts +++ b/src/stores/branch/index.ts @@ -225,6 +225,29 @@ const useBranchStore = defineStore('api-branch', () => { return false; } + async function userStats( + userType: string, + flow?: { + sessionId: string; + refTransactionId: string; + transactionId: string; + }, + ) { + const res = await api.get(`/branch/user-stats`, { + headers: { + 'X-Session-Id': flow?.sessionId, + 'X-Rtid': flow?.refTransactionId, + 'X-Tid': flow?.transactionId, + }, + data: userType + }); + + if (!res) return false; + if (res.status === 200) return res.data; + + return false; + } + return { data, fetchList, @@ -237,6 +260,8 @@ const useBranchStore = defineStore('api-branch', () => { getUser, addUser, removeUser, + + userStats, }; }); diff --git a/src/stores/branch/types.ts b/src/stores/branch/types.ts index b914933d..e2c90d44 100644 --- a/src/stores/branch/types.ts +++ b/src/stores/branch/types.ts @@ -47,3 +47,10 @@ export type BranchCreate = { provinceId?: string | null; headOfficeId?: string | null; }; + +export type BranchUserStats = { + id: string, + nameEN: string, + name: string; + count: 0 +} From 8e806c7c425495e44a90c95382e457aeb58b7ee1 Mon Sep 17 00:00:00 2001 From: puriphatt Date: Wed, 10 Apr 2024 14:00:19 +0700 Subject: [PATCH 5/6] feat: userTypeStats (type, store) --- src/stores/user/index.ts | 22 ++++++++++++++++++++++ src/stores/user/types.ts | 9 +++++++++ 2 files changed, 31 insertions(+) diff --git a/src/stores/user/index.ts b/src/stores/user/index.ts index 97171cc5..cbb68d6e 100644 --- a/src/stores/user/index.ts +++ b/src/stores/user/index.ts @@ -12,6 +12,7 @@ import { import axios from 'axios'; const useUserStore = defineStore('api-user', () => { + const userStats = ref() const data = ref>(); async function fetchAttachment( @@ -344,6 +345,25 @@ const useUserStore = defineStore('api-user', () => { return res.data || true; } + async function typeStats( + flow?: { + sessionId: string; + refTransactionId: string; + transactionId: string; + },) { + const res = await api.get(`/user/type-stats`, { + headers: { + 'X-Session-Id': flow?.sessionId, + 'X-Rtid': flow?.refTransactionId, + 'X-Tid': flow?.transactionId, + }, + }) + if (!res) return false; + if (res.status === 200) return res.data; + + return false; + } + return { data, fetchList, @@ -360,6 +380,8 @@ const useUserStore = defineStore('api-user', () => { fetchAttachment, addAttachment, deleteAttachment, + + typeStats, }; }); diff --git a/src/stores/user/types.ts b/src/stores/user/types.ts index 4a55fd2c..3e3a895e 100644 --- a/src/stores/user/types.ts +++ b/src/stores/user/types.ts @@ -69,6 +69,8 @@ export type UserCreate = { userType: string; keycloakId: string; profileImage: File; + birthDate?: Date | null; + responsibleArea: string, }; export type UserAttachment = { @@ -83,3 +85,10 @@ export type UserAttachmentCreate = { export type UserAttachmentDelete = { file: string[]; }; + +export type UserTypeStats = { + USER: number; + MESSENGER: number; + DELEGATE: number; + AGENCY: number; +} From fa3d67cd2f1b59c5d0266f61ae1b1c08501faec8 Mon Sep 17 00:00:00 2001 From: puriphatt Date: Wed, 10 Apr 2024 14:00:55 +0700 Subject: [PATCH 6/6] refactor: Personnel => main --- .../02_personnel-management/MainPage.vue | 636 +++++++++++++++--- 1 file changed, 557 insertions(+), 79 deletions(-) diff --git a/src/pages/02_personnel-management/MainPage.vue b/src/pages/02_personnel-management/MainPage.vue index 73ed558b..b2ddaa53 100644 --- a/src/pages/02_personnel-management/MainPage.vue +++ b/src/pages/02_personnel-management/MainPage.vue @@ -1,7 +1,13 @@ + +