From 47d775ca5892828ac5712daf87af8bf0054217d3 Mon Sep 17 00:00:00 2001 From: Net Date: Thu, 5 Sep 2024 10:37:14 +0700 Subject: [PATCH] refactor: add function resetScrollBar --- src/pages/01_branch-management/MainPage.vue | 9 +++++++-- src/pages/02_personnel-management/MainPage.vue | 9 +++++++-- src/pages/03_customer-management/MainPage.vue | 11 +++++------ src/stores/utils/index.ts | 8 ++++++++ 4 files changed, 27 insertions(+), 10 deletions(-) diff --git a/src/pages/01_branch-management/MainPage.vue b/src/pages/01_branch-management/MainPage.vue index 967de34f..68089fe6 100644 --- a/src/pages/01_branch-management/MainPage.vue +++ b/src/pages/01_branch-management/MainPage.vue @@ -6,7 +6,7 @@ import { BranchContact } from 'stores/branch-contact/types'; import { colors, useQuasar } from 'quasar'; import { useI18n } from 'vue-i18n'; import type { QTableProps } from 'quasar'; - +import { resetScrollBar } from 'src/stores/utils'; import useBranchStore from 'stores/branch'; import useFlowStore from 'stores/flow'; import { @@ -1649,7 +1649,12 @@ watch(currentHq, () => { :submit="() => onSubmit()" :delete-data="() => triggerDelete(currentEdit.id)" :close=" - () => ((modalDrawer = false), flowStore.rotate(), (isImageEdit = false)) + () => ( + (modalDrawer = false), + flowStore.rotate(), + (isImageEdit = false), + resetScrollBar('branch-info') + ) " :statusBranch="formData.status" hide-action diff --git a/src/pages/02_personnel-management/MainPage.vue b/src/pages/02_personnel-management/MainPage.vue index 2c56f3c3..7fbbe4d0 100644 --- a/src/pages/02_personnel-management/MainPage.vue +++ b/src/pages/02_personnel-management/MainPage.vue @@ -8,7 +8,7 @@ import { useI18n } from 'vue-i18n'; import useFlowStore from 'stores/flow'; import useUserStore from 'stores/user'; import useBranchStore from 'stores/branch'; -import { isRoleInclude } from 'src/stores/utils'; +import { isRoleInclude, resetScrollBar } from 'src/stores/utils'; import { User, @@ -1494,7 +1494,12 @@ watch( " v-model:drawerOpen="infoDrawer" :submit="() => onSubmit()" - :close="() => onClose()" + :close=" + () => { + onClose(); + resetScrollBar('user-form-content'); + } + " >
diff --git a/src/pages/03_customer-management/MainPage.vue b/src/pages/03_customer-management/MainPage.vue index 9a26ad2f..4d580753 100644 --- a/src/pages/03_customer-management/MainPage.vue +++ b/src/pages/03_customer-management/MainPage.vue @@ -10,7 +10,7 @@ import useOcrStore from 'stores/ocr'; import useCustomerStore from 'stores/customer'; import useEmployeeStore from 'stores/employee'; import useMyBranchStore from 'stores/my-branch'; -import useUtilsStore, { dialog, notify } from 'stores/utils'; +import useUtilsStore, { dialog, notify, resetScrollBar } from 'stores/utils'; import useFlowStore from 'stores/flow'; import { Status } from 'stores/types'; import { @@ -68,6 +68,7 @@ import FormEmployeeOther from 'components/03_customer-management/FormEmployeeOth import useOptionStore from 'stores/options'; import { DialogContainer, DialogHeader } from 'components/dialog'; import KebabAction from 'src/components/shared/KebabAction.vue'; +import { roundElectricalServices } from '@quasar/extras/material-icons-round'; const { t, locale } = useI18n(); const $q = useQuasar(); @@ -2695,6 +2696,7 @@ const emptyCreateDialog = ref(false); :close=" () => { customerFormState.drawerModal = false; + resetScrollBar('customer-form-content'); } " :submit=" @@ -2999,11 +3001,13 @@ const emptyCreateDialog = ref(false);