diff --git a/src/components/StatCardComponent.vue b/src/components/StatCardComponent.vue index 3f309188..3de5281b 100644 --- a/src/components/StatCardComponent.vue +++ b/src/components/StatCardComponent.vue @@ -6,13 +6,13 @@ const props = withDefaults( branch: { count: number; label: string; - color?: 'pink' | 'purple' | 'green'; + color: 'pink' | 'purple' | 'green'; }[]; dark?: boolean; - isBranch?: boolean; + labelI18n?: boolean; }>(), { - isBranch: false, + labelI18n: false, }, ); @@ -40,7 +40,7 @@ const props = withDefaults(
{{ v.count }}
- {{ isBranch ? $t(v.label) : v.label }} + {{ labelI18n ? $t(v.label) : v.label }}
diff --git a/src/pages/01_branch-management/MainPage.vue b/src/pages/01_branch-management/MainPage.vue index f457be1d..dd7ac111 100644 --- a/src/pages/01_branch-management/MainPage.vue +++ b/src/pages/01_branch-management/MainPage.vue @@ -96,8 +96,8 @@ onMounted(async () => { if (_stats) { stats.value.push( - { count: _stats.hq, label: 'branchHQLabel' }, - { count: _stats.br, label: 'branchLabel' }, + { count: _stats.hq, label: 'branchHQLabel', color: 'pink' }, + { count: _stats.br, label: 'branchLabel', color: 'purple' }, ); } }); @@ -127,9 +127,9 @@ const fieldSelectedBranch = ref<{ value: 'branchHQLabel', }); -const stats = ref< - { count: number; label: string; color?: 'pink' | 'purple' }[] ->([]); +const stats = ref<{ count: number; label: string; color: 'pink' | 'purple' }[]>( + [], +); const defaultFormData = { headOfficeId: null, @@ -338,17 +338,18 @@ async function onSubmit() { const _stats = await branchStore.stats(); if (_stats) { - stats.value[0] = { - count: _stats.hq, - label: 'branchHQLabel', - color: 'pink', - }; - - stats.value[1] = { - count: _stats.br, - label: 'branchLabel', - color: 'purple', - }; + stats.value = [ + { + count: _stats.hq, + label: 'branchHQLabel', + color: 'pink', + }, + { + count: _stats.br, + label: 'branchLabel', + color: 'purple', + }, + ]; } } @@ -388,7 +389,7 @@ watch(locale, () => { - +