diff --git a/src/i18n/en-US/product-service.ts b/src/i18n/en-US/product-service.ts index c1e34332..a912978c 100644 --- a/src/i18n/en-US/product-service.ts +++ b/src/i18n/en-US/product-service.ts @@ -9,6 +9,8 @@ export default { service: 'Service', product: 'Product', + productGroup: 'Product Group: {name}', + productType: 'Product Type: {name}', messageTooltipNoProduct: 'No Product and Service Groups', messageTooltipProductCreate: 'Click + for product and service groups.', diff --git a/src/i18n/th-th/main.ts b/src/i18n/th-th/main.ts index 2aa8851d..ea26c3f7 100644 --- a/src/i18n/th-th/main.ts +++ b/src/i18n/th-th/main.ts @@ -9,7 +9,7 @@ export default { mainCustomerCaption: 'จัดการคนภายในองค์กร', mainProductTitle: 'สินค้าและบริการ', - mainProductCaption: 'รายการสินค้าและบริการ', + mainProductCaption: 'ประเภทสินค้าและบริการ', mainQuotationTitle: 'ใบเสนอราคา', mainQuotationCaption: 'รายการใบเสนอราคา', diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index 1a26d58f..1188c616 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -265,7 +265,13 @@ onMounted(async () => { class="text-caption cursor-pointer" @click="item.handler?.()" > - {{ item.text ? $t(item.text) : '' }} + {{ + item.text + ? $t(item.text, { + ...(item.argsi18n || {}), + }) + : '' + }} { watch(productMode, () => { inputSearch.value = ''; currentStatus.value = 'All'; + const tmp: typeof utilsStore.currentTitle.path = []; + + if (productMode.value === 'type' || productMode.value === 'service') { + tmp.push({ + text: 'productGroup', + argsi18n: { name: pathGroupName.value }, + handler: () => { + productMode.value = 'type'; + }, + }); + } + if (productMode.value === 'service') { + tmp.push({ text: 'productType', argsi18n: { name: pathTypeName.value } }); + } + + utilsStore.currentTitle.path = tmp; }); watch(currentStatus, async () => { @@ -1183,47 +1199,6 @@ watch(inputSearchProductAndService, async () => { - -
- -
- {{ pathGroupName }} -
-
- / -
-
- {{ pathTypeName }} -
-
-
{ const currentTitle = ref<{ title: string; - path: { text: string; handler?: () => unknown }[]; + path: { + text: string; + argsi18n?: Record; + handler?: () => unknown; + }[]; }>({ title: '', path: [