From 6ec60cc95ac5c8fb5c02c6a4d7f7a82c9dea709b Mon Sep 17 00:00:00 2001 From: puriphatt Date: Thu, 5 Sep 2024 16:19:37 +0700 Subject: [PATCH] refactor(04): service properties acceptation --- .../04_product-service/ServiceProperties.vue | 8 +++---- src/pages/04_product-service/MainPage.vue | 24 ++++++++++++++----- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/components/04_product-service/ServiceProperties.vue b/src/components/04_product-service/ServiceProperties.vue index 8aabe3e0..3a60712f 100644 --- a/src/components/04_product-service/ServiceProperties.vue +++ b/src/components/04_product-service/ServiceProperties.vue @@ -17,25 +17,25 @@ const formServiceProperties = defineModel('formServiceProperties'); const typeOption = ref([ { - label: t('text'), + label: 'Text', value: 'string', color: 'var(--pink-6-hsl)', icon: 'mdi-alpha-t', }, { - label: t('number'), + label: 'Number', value: 'number', color: 'var(--purple-11-hsl)', icon: 'mdi-numeric', }, { - label: t('date'), + label: 'Date', value: 'date', color: 'var(--green-9-hsl)', icon: 'mdi-calendar-blank-outline', }, { - label: t('selection'), + label: 'Selection', value: 'array', color: 'var(--indigo-7-hsl)', icon: 'mdi-code-array', diff --git a/src/pages/04_product-service/MainPage.vue b/src/pages/04_product-service/MainPage.vue index 663337ea..9a8bb60f 100644 --- a/src/pages/04_product-service/MainPage.vue +++ b/src/pages/04_product-service/MainPage.vue @@ -3807,7 +3807,9 @@ watch([currentStatusList, productMode], async () => { @work-properties=" (index) => { currentWorkIndex = index; - tempValueProperties = workItems[index].attributes; + tempValueProperties = JSON.parse( + JSON.stringify(workItems[index].attributes), + ); openPropertiesDialog('work'); } " @@ -3823,7 +3825,9 @@ watch([currentStatusList, productMode], async () => { v-model:service-attributes="formDataProductService.attributes" @service-properties=" () => { - tempValueProperties = formDataProductService.attributes; + tempValueProperties = JSON.parse( + JSON.stringify(formDataProductService.attributes), + ); openPropertiesDialog('service'); } " @@ -3842,10 +3846,14 @@ watch([currentStatusList, productMode], async () => { :submit=" () => { if (currentPropertiesMode === 'service') { - formDataProductService.attributes = tempValueProperties; + formDataProductService.attributes = JSON.parse( + JSON.stringify(tempValueProperties), + ); } if (currentPropertiesMode === 'work') { - workItems[currentWorkIndex].attributes = tempValueProperties; + workItems[currentWorkIndex].attributes = JSON.parse( + JSON.stringify(tempValueProperties), + ); } propertiesDialog = false; @@ -4103,7 +4111,9 @@ watch([currentStatusList, productMode], async () => { @work-properties=" (index) => { currentWorkIndex = index; - tempValueProperties = workItems[index].attributes; + tempValueProperties = JSON.parse( + JSON.stringify(workItems[index].attributes), + ); openPropertiesDialog('work'); } " @@ -4120,7 +4130,9 @@ watch([currentStatusList, productMode], async () => { v-model:service-attributes="formDataProductService.attributes" @service-properties=" () => { - tempValueProperties = formDataProductService.attributes; + tempValueProperties = JSON.parse( + JSON.stringify(formDataProductService.attributes), + ); openPropertiesDialog('service'); } "