From 07c989d4e61814891a7aa12a0788c3c68255991d Mon Sep 17 00:00:00 2001 From: puriphatt Date: Thu, 5 Sep 2024 09:26:34 +0700 Subject: [PATCH] chore(04): clean unuse --- src/pages/04_product-service/MainPage.vue | 356 ---------------------- 1 file changed, 356 deletions(-) diff --git a/src/pages/04_product-service/MainPage.vue b/src/pages/04_product-service/MainPage.vue index 2fc1e38d..721c4d62 100644 --- a/src/pages/04_product-service/MainPage.vue +++ b/src/pages/04_product-service/MainPage.vue @@ -562,28 +562,6 @@ async function fetchListOfOptionBranch() { currentMyBranch.value?.id || ''; } -// async function fetchListType() { -// const res = await fetchListProductServiceType({ -// page: currentPageType.value, -// pageSize: pageSizeType.value, -// query: !!inputSearch.value ? inputSearch.value : undefined, -// productGroupId: currentIdGrop.value, -// status: -// currentStatus.value === 'All' -// ? undefined -// : currentStatus.value === 'ACTIVE' -// ? 'ACTIVE' -// : 'INACTIVE', -// }); - -// if (res) { -// currentPageType.value = res.page; -// totalType.value = res.total; -// maxPageType.value = Math.ceil(res.total / pageSizeType.value); -// productType.value = res.result; -// } -// } - async function fetchListGroups() { const res = await fetchListProductService({ page: currentPageGroup.value, @@ -691,28 +669,6 @@ async function fetchListOfService() { } } -// async function submitType() { -// if (drawerInfo.value) { -// await editProductServiceType(currentIdType.value, { -// ...formDataGroup.value, -// productGroupId: currentIdGrop.value, -// }); -// drawerInfo.value = false; -// } else { -// dialogInputForm.value = false; -// const res = await createProductServiceType( -// currentIdGrop.value, -// formDataGroup.value, -// ); - -// if (res) { -// stat.value[1].count = stat.value[1].count + 1; -// } -// } - -// await fetchListType(); -// } - async function toggleStatusProduct(id: string, status: Status) { const res = await editProduct(id, { status: status === 'INACTIVE' ? 'ACTIVE' : 'INACTIVE', @@ -732,15 +688,6 @@ async function toggleStatusService(id: string, status: Status) { await alternativeFetch(); flowStore.rotate(); } -// async function toggleStatusType(id: string, status: Status) { -// const res = await editProductServiceType(id, { -// status: status === 'INACTIVE' ? 'ACTIVE' : 'INACTIVE', -// }); -// if (res) currentStatusGroupType.value = res.status; - -// await fetchListType(); -// flowStore.rotate(); -// } async function toggleStatusGroup(id: string, status: Status) { const res = await editProductService(id, { @@ -861,11 +808,6 @@ async function deleteProductById(productId?: string) { message: t('dialog.message.confirmDelete'), action: async () => { if (editByTree.value !== undefined) { - // if (editByTree.value === 'type') { - // // Product Type - // await deleteProductServiceType(productId ?? currentIdType.value); - // await fetchListType(); - // } if (editByTree.value === 'group') { // Product Group const res = await deleteProductService( @@ -881,11 +823,6 @@ async function deleteProductById(productId?: string) { editByTree.value = undefined; drawerInfo.value = false; } else { - // if (productMode.value === 'type') { - // // Product Type - // await deleteProductServiceType(productId ?? currentIdType.value); - // await fetchListType(); - // } if (productMode.value === 'group') { // Product Group const res = await deleteProductService( @@ -1160,7 +1097,6 @@ async function submitProduct() { formDataProduct.value.productGroupId = currentIdGrop.value; if (profileFileImg.value) { formDataProduct.value.image = profileFileImg.value; - // formDataProduct.value.image = imageProduct.value; } if (dialogProduct.value) { @@ -1352,25 +1288,6 @@ async function enterGroup( if (toService) await enterNext('service'); else productMode.value = 'group'; - // await fetchListType(); - // productMode.value = 'type'; - // flowStore.rotate(); - // if ( - // expandedTree.value.length > 1 && - // expandedTree.value[expandedTree.value.length - 1] !== id - // ) { - // console.log(1); - // expandedTree.value.pop(); - // expandedTree.value.push(id); - // } else { - // console.log(2); - // expandedTree.value.push(id); - // } - // currentIdType.value = id; - // productMode.value = 'service'; - // productAndServiceTab.value = 'service'; - // currentStatusList.value.push(status); - flowStore.rotate(); } @@ -1388,7 +1305,6 @@ async function enterNext(type: 'service' | 'product') { } if (type === 'service') { - console.log('service'); productMode.value = 'service'; productAndServiceTab.value = 'service'; currentIdType.value = 'type'; @@ -1408,28 +1324,6 @@ async function enterNext(type: 'service' | 'product') { flowStore.rotate(); } -// async function enterType(id: string, name: string, status: Status) { -// if ( -// expandedTree.value.length > 1 && -// expandedTree.value[expandedTree.value.length - 1] !== id -// ) { -// expandedTree.value.pop(); -// expandedTree.value.push(id); -// } else { -// expandedTree.value.push(id); -// } -// pathTypeName.value = name; -// currentIdType.value = id; -// productMode.value = 'service'; -// productAndServiceTab.value = 'service'; -// currentStatusList.value.push(status); - -// await fetchListOfProduct(); -// await fetchListOfService(); - -// flowStore.rotate(); -// } - function handleStatus() { let tempValue = false; @@ -1446,8 +1340,6 @@ function handleHold(node: ProductGroup & { type: string }) { if ($q.screen.gt.xs) return; holdDialog.value = true; currentNode.value = node; - // return function (props: unknown) { - // }; } onMounted(async () => { @@ -1546,9 +1438,6 @@ watch(currentStatus, async () => { if (productMode.value === 'group') { await fetchListGroups(); } - // else { - // await fetchListType(); - // } flowStore.rotate(); }); @@ -1557,11 +1446,6 @@ watch(inputSearch, async () => { await fetchListGroups(); flowStore.rotate(); } - - // if (productMode.value === 'type') { - // await fetchListType(); - // flowStore.rotate(); - // } }); watch(inputSearchProductAndService, async () => { @@ -1610,22 +1494,6 @@ watch([currentStatusList, productMode], async () => { } " /> - { async (v: (typeof treeProductTypeAndGroup)[number]) => { if (v.type === 'group') { if (currentIdGrop !== v.id) { - // filterStat.push('group'); - // currentStatusList = []; await enterGroup(v.id, v.name, v.status); return; @@ -2015,13 +1881,6 @@ watch([currentStatusList, productMode], async () => { @click=" async () => { filterStat.push(productMode); - // if (productMode === 'type') { - // await enterType( - // props.row.id, - // props.row.name, - // props.row.status, - // ); - // } if (productMode === 'group') { await enterGroup( props.row.id, @@ -2130,16 +1989,6 @@ watch([currentStatusList, productMode], async () => { flat @click.stop=" () => { - // if (productMode === 'type') { - // editByTree = 'type'; - // currentStatusProduct = - // props.row.status === 'INACTIVE'; - // clearFormGroup(); - // currentIdType = props.row.id; - // assignFormDataGroup(props.row); - // isEdit = false; - // drawerInfo = true; - // } if (productMode === 'group') { editByTree = 'group'; currentStatusProduct = @@ -2160,16 +2009,6 @@ watch([currentStatusList, productMode], async () => { :idName="props.row.name" @view=" () => { - // if (productMode === 'type') { - // editByTree = 'type'; - // currentStatusProduct = - // props.row.status === 'INACTIVE'; - // clearFormGroup(); - // currentIdType = props.row.id; - // assignFormDataGroup(props.row); - // isEdit = false; - // drawerInfo = true; - // } if (productMode === 'group') { editByTree = 'group'; currentStatusProduct = @@ -2184,14 +2023,6 @@ watch([currentStatusList, productMode], async () => { " @edit=" () => { - // if (productMode === 'type') { - // editByTree = 'type'; - // clearFormGroup(); - // currentIdType = props.row.id; - // assignFormDataGroup(props.row); - // isEdit = true; - // drawerInfo = true; - // } if (productMode === 'group') { editByTree = 'group'; clearFormGroup(); @@ -2205,9 +2036,6 @@ watch([currentStatusList, productMode], async () => { " @delete=" () => { - // if (productMode === 'type') { - // deleteProductById(props.row.id); - // } if (productMode === 'group') { deleteProductById(props.row.id); } @@ -2228,7 +2056,6 @@ watch([currentStatusList, productMode], async () => { @@ -2598,66 +2334,6 @@ watch([currentStatusList, productMode], async () => { - -
{ if (!currentNode) return; await fetchListOfOptionBranch(); - // if (currentNode.type === 'type') { - // editByTree = 'type'; - // currentStatusProduct = currentNode.status === 'INACTIVE'; - // clearFormGroup(); - // currentIdType = currentNode.id; - // assignFormDataGroup(currentNode); - // isEdit = false; - // drawerInfo = true; - // } if (currentNode.type === 'group') { editByTree = 'group'; currentStatusProduct = currentNode.status === 'INACTIVE'; @@ -4506,13 +4167,6 @@ watch([currentStatusList, productMode], async () => { () => { if (!currentNode) return; editByTree = currentNode.type as 'type' | 'group'; - // if (currentNode.type === 'type') { - // clearFormGroup(); - // currentIdType = currentNode.id; - // assignFormDataGroup(currentNode); - // isEdit = true; - // drawerInfo = true; - // } if (currentNode.type === 'group') { clearFormGroup(); assignFormDataGroup(currentNode); @@ -4566,16 +4220,6 @@ watch([currentStatusList, productMode], async () => { @click=" async () => { if (!currentNode) return; - // if (currentNode.type === 'type') { - // triggerChangeStatus( - // currentNode.id, - // currentNode.status, - // currentNode.type, - // ); - // currentNode.status === 'ACTIVE' - // ? (currentNode.status = 'INACTIVE') - // : (currentNode.status = 'ACTIVE'); - // } if (currentNode.type === 'group') { triggerChangeStatus( currentNode.id,