refactor: correct the typo

This commit is contained in:
Thanaphon Frappet 2024-11-05 09:45:43 +07:00
parent f96837b133
commit a848beb1bf

View file

@ -494,7 +494,7 @@ const totalGroup = ref<number>(0);
const total = ref<number>(0);
// id
const currentIdGrop = ref<string>('');
const currentIdGroup = ref<string>('');
const currentIdType = ref<string>('');
const currentIdService = ref<string>('');
const currentIdProduct = ref<string>('');
@ -628,7 +628,7 @@ async function fetchListOfProduct() {
: currentStatus.value === 'ACTIVE'
? 'ACTIVE'
: undefined,
productGroupId: currentIdGrop.value,
productGroupId: currentIdGroup.value,
});
if (res) {
@ -661,7 +661,7 @@ async function fetchListOfService() {
: currentStatus.value === 'ACTIVE'
? 'ACTIVE'
: undefined,
productGroupId: currentIdGrop.value,
productGroupId: currentIdGroup.value,
});
if (res) {
@ -820,7 +820,7 @@ async function deleteProductById(productId?: string) {
if (editByTree.value === 'group') {
// Product Group
const res = await deleteProductGroup(
productId ?? currentIdGrop.value,
productId ?? currentIdGroup.value,
);
if (res) {
}
@ -835,7 +835,7 @@ async function deleteProductById(productId?: string) {
if (productMode.value === 'group') {
// Product Group
const res = await deleteProductGroup(
productId ?? currentIdGrop.value,
productId ?? currentIdGroup.value,
);
if (res) {
}
@ -1099,12 +1099,12 @@ function assignFormDataProductServiceCreate() {
async function submitService(notClose = false) {
assignFormDataProductServiceCreate();
formDataProductService.value.productGroupId = currentIdGrop.value;
formDataProductService.value.productGroupId = currentIdGroup.value;
if (profileFileImg.value)
formDataProductService.value.image = profileFileImg.value;
if (dialogService.value) {
formDataProductService.value.productGroupId = currentIdGrop.value;
formDataProductService.value.productGroupId = currentIdGroup.value;
if (
formDataProductService.value.code === '' ||
@ -1145,7 +1145,7 @@ async function submitService(notClose = false) {
}
async function submitProduct(notClose = false) {
formDataProduct.value.productGroupId = currentIdGrop.value;
formDataProduct.value.productGroupId = currentIdGroup.value;
if (profileFileImg.value) {
formDataProduct.value.image = profileFileImg.value;
}
@ -1190,7 +1190,7 @@ async function submitGroup() {
if (drawerInfo.value) {
if (currentIdGropTree.value)
await editProductGroup(currentIdGropTree.value, formDataGroup.value);
else await editProductGroup(currentIdGrop.value, formDataGroup.value);
else await editProductGroup(currentIdGroup.value, formDataGroup.value);
} else {
const res = await createProductGroup(formDataGroup.value);
@ -1316,7 +1316,7 @@ async function calculateStats(opt?: {
}) {
if (opt && opt.type === 'service' && productMode.value === 'service') {
const resStatsService = await fetchStatsService({
productGroupId: currentIdGrop.value,
productGroupId: currentIdGroup.value,
});
stat.value[1].count = resStatsService ?? 0;
return;
@ -1324,7 +1324,7 @@ async function calculateStats(opt?: {
if (opt && opt.type === 'product' && productMode.value === 'product') {
const resStatsProduct = await fetchStatsProduct({
productGroupId: currentIdGrop.value,
productGroupId: currentIdGroup.value,
});
stat.value[2].count = resStatsProduct ?? 0;
return;
@ -1403,7 +1403,7 @@ async function enterGroup(
expandedTree.value.push(id);
pathGroupName.value = name;
currentIdType.value = '';
currentIdGrop.value = id;
currentIdGroup.value = id;
currentNoAction.value = status === 'INACTIVE';
pathTypeName.value = name;
@ -1477,7 +1477,7 @@ onMounted(async () => {
i18n: true,
handler: () => {
expandedTree.value = [];
currentIdGrop.value = '';
currentIdGroup.value = '';
productMode.value = 'group';
},
},
@ -1503,7 +1503,7 @@ watch(
handler: () => {
productMode.value = 'group';
expandedTree.value = [];
currentIdGrop.value = '';
currentIdGroup.value = '';
currentIdType.value = '';
filterStat.value = [];
},
@ -1716,17 +1716,17 @@ watch(
@select="
async (v: (typeof treeProductTypeAndGroup)[number]) => {
if (v.type === 'group') {
if (currentIdGrop !== v.id) {
if (currentIdGroup !== v.id) {
await enterGroup(v.id, v.name, v.status);
return;
}
if (currentIdGrop === v.id) {
if (currentIdGroup === v.id) {
expandedTree = [];
filterStat = [];
expandedTree = expandedTree.filter((i) => v.id !== i);
currentIdGrop = '';
currentIdGroup = '';
currentIdType = '';
productMode = 'group';
currentNoAction = false;
@ -2116,7 +2116,7 @@ watch(
clearFormGroup();
await assignFormDataGroup(props.row);
isEdit = false;
currentIdGrop = props.row.id;
currentIdGroup = props.row.id;
drawerInfo = true;
}
}
@ -2136,7 +2136,7 @@ watch(
clearFormGroup();
await assignFormDataGroup(props.row);
isEdit = false;
currentIdGrop = props.row.id;
currentIdGroup = props.row.id;
drawerInfo = true;
}
}
@ -2148,7 +2148,7 @@ watch(
clearFormGroup();
await assignFormDataGroup(props.row);
isEdit = true;
currentIdGrop = props.row.id;
currentIdGroup = props.row.id;
drawerInfo = true;
}
@ -2208,7 +2208,7 @@ watch(
clearFormGroup();
await assignFormDataGroup(props.row);
isEdit = false;
currentIdGrop = props.row.id;
currentIdGroup = props.row.id;
drawerInfo = true;
}
}
@ -2219,7 +2219,7 @@ watch(
clearFormGroup();
await assignFormDataGroup(props.row);
isEdit = true;
currentIdGrop = props.row.id;
currentIdGroup = props.row.id;
drawerInfo = true;
}
@ -4023,7 +4023,7 @@ watch(
dense
@add-product="
async (index) => {
await fetchListOfProductIsAdd(currentIdGrop);
await fetchListOfProductIsAdd(currentIdGroup);
currentWorkIndex = index;
selectProduct = JSON.parse(
JSON.stringify(workItems[currentWorkIndex].product),
@ -4419,7 +4419,7 @@ watch(
:price-display="priceDisplay"
@add-product="
async (index) => {
await fetchListOfProductIsAdd(currentIdGrop);
await fetchListOfProductIsAdd(currentIdGroup);
currentWorkIndex = index;
selectProduct = JSON.parse(
JSON.stringify(workItems[currentWorkIndex].product),
@ -4496,7 +4496,7 @@ watch(
clearFormGroup();
await assignFormDataGroup(currentNode);
isEdit = false;
currentIdGrop = currentNode.id;
currentIdGroup = currentNode.id;
drawerInfo = true;
}
}
@ -4523,7 +4523,7 @@ watch(
clearFormGroup();
await assignFormDataGroup(currentNode);
isEdit = true;
currentIdGrop = currentNode.id;
currentIdGroup = currentNode.id;
drawerInfo = true;
}