From a773fa272d892c43c92c3ea660ceaa14a4941336 Mon Sep 17 00:00:00 2001 From: Net Date: Fri, 6 Sep 2024 11:35:49 +0700 Subject: [PATCH] refactor: add virtual branch --- src/pages/01_branch-management/MainPage.vue | 16 ++++++++++++++-- src/stores/branch/index.ts | 1 + 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/pages/01_branch-management/MainPage.vue b/src/pages/01_branch-management/MainPage.vue index 79df0c53..7b5cdb14 100644 --- a/src/pages/01_branch-management/MainPage.vue +++ b/src/pages/01_branch-management/MainPage.vue @@ -3,7 +3,7 @@ import { storeToRefs } from 'pinia'; import { ref, onMounted, computed, watch } from 'vue'; import { Icon } from '@iconify/vue'; import { BranchContact } from 'stores/branch-contact/types'; -import { colors, useQuasar } from 'quasar'; +import { useQuasar } from 'quasar'; import { useI18n } from 'vue-i18n'; import type { QTableProps } from 'quasar'; import { resetScrollBar } from 'src/stores/utils'; @@ -210,6 +210,13 @@ async function calculateStats() { label: 'branch.card.branchLabel', color: 'purple', }, + + { + icon: 'mdi-home-group', + count: _stats.virtual, + label: 'branch.card.branchVirtual', + color: 'blue', + }, ]; } } @@ -281,7 +288,12 @@ const fieldSelectedBranch = ref<{ }); const stats = ref< - { icon: string; count: number; label: string; color: 'pink' | 'purple' }[] + { + icon: string; + count: number; + label: string; + color: 'pink' | 'purple' | 'blue'; + }[] >([]); const modeView = ref(false); diff --git a/src/stores/branch/index.ts b/src/stores/branch/index.ts index 990cb0eb..e77bd013 100644 --- a/src/stores/branch/index.ts +++ b/src/stores/branch/index.ts @@ -264,6 +264,7 @@ const useBranchStore = defineStore('api-branch', () => { const res = await api.get<{ hq: number; br: number; + virtual: number; }>('/branch/stats', { headers: { 'X-Rtid': flowStore.rtid,