refactor(04): service properties acceptation

This commit is contained in:
puriphatt 2024-09-05 16:19:37 +07:00
parent 4f4de866b0
commit 6ec60cc95a
2 changed files with 22 additions and 10 deletions

View file

@ -17,25 +17,25 @@ const formServiceProperties = defineModel<Attributes>('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',

View file

@ -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');
}
"