From 7b3b506d2ed7df0e5f725b8932af336b00be42db Mon Sep 17 00:00:00 2001 From: puriphatt Date: Wed, 27 Nov 2024 15:52:04 +0700 Subject: [PATCH] fix: quotation remark readonly --- src/pages/05_quotation/QuotationForm.vue | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/pages/05_quotation/QuotationForm.vue b/src/pages/05_quotation/QuotationForm.vue index 7d4ab9ad..4853d6e8 100644 --- a/src/pages/05_quotation/QuotationForm.vue +++ b/src/pages/05_quotation/QuotationForm.vue @@ -178,6 +178,15 @@ const attachmentData = ref< }[] >([]); +const getToolbarConfig = computed(() => { + const toolbar = [['left', 'center', 'justify'], ['toggle'], ['clip']]; + if (readonly.value) { + return toolbar.filter((item) => !item.includes('toggle')); + } + + return toolbar; +}); + function getPrice( list: typeof productServiceList.value, filterHook?: ( @@ -1550,11 +1559,7 @@ async function getWorkerFromCriteria( style="cursor: auto; color: var(--foreground)" :flat="!readonly" :style="`width: ${$q.screen.gt.xs ? '100%' : '63vw'}`" - :toolbar="[ - ['left', 'center', 'justify'], - ['toggle'], - ['clip'], - ]" + :toolbar="getToolbarConfig" :toolbar-toggle-color="readonly ? 'disabled' : 'primary'" :toolbar-color=" readonly ? 'disabled' : $q.dark.isActive ? 'white' : '' @@ -1573,8 +1578,8 @@ async function getWorkerFromCriteria( } " > -