| | |
| | | .then((res) => { |
| | | m_PageLoading.value = false; |
| | | let result = res.data; |
| | | result.sort((a: any, b: any) => { |
| | | const aPrefix = a.Model.slice(0, 3); |
| | | const bPrefix = b.Model.slice(0, 3); |
| | | const aContainsDP = aPrefix.includes('DP') || aPrefix.includes('DRL'); |
| | | const bContainsDP = bPrefix.includes('DP') || bPrefix.includes('DRL'); |
| | | |
| | | if (aContainsDP && !bContainsDP) { |
| | | return -1; |
| | | } else if (!aContainsDP && bContainsDP) { |
| | | return 1; |
| | | } else { |
| | | return 0; |
| | | } |
| | | }); |
| | | let arr = []; |
| | | result.forEach((item: any, index: number) => { |
| | | if (typeSelect.value === 2) { |
| | | item.Price = item.Price * 10; |
| | | } |
| | | if (typeSelect.value === 4) { |
| | | item.Price = item.Price * 5; |
| | | } |
| | | let incrementFactor = 0.1 * (index + 1); // 根据索引计算递增系数 |
| | | let newPrice = parseFloat(item.Price) + parseFloat((item.Price * incrementFactor).toFixed(1)); // 计算新的Price值 |
| | | |
| | | let node = { |
| | | Id: item.Id, |
| | | Type: item.Type, |
| | |
| | | return factoryIncludeType.value.includes(item.Type); |
| | | }); |
| | | } |
| | | if (typeSelect.value === 1) { |
| | | filterProductData.value.sort((a: any, b: any) => { |
| | | const aContainsDSWQ = a.Model.includes('DSWQ'); |
| | | const bContainsDSWQ = b.Model.includes('DSWQ'); |
| | | const aContainsDRLOrDP = a.Model.substring(0, 3).includes('DRL') || a.Model.substring(0, 2).includes('DP'); |
| | | const bContainsDRLOrDP = b.Model.substring(0, 3).includes('DRL') || b.Model.substring(0, 2).includes('DP'); |
| | | |
| | | if (aContainsDSWQ && !bContainsDSWQ) { |
| | | return -1; |
| | | } else if (!aContainsDSWQ && bContainsDSWQ) { |
| | | return 1; |
| | | } else if (aContainsDRLOrDP && !bContainsDRLOrDP) { |
| | | return -1; |
| | | } else if (!aContainsDRLOrDP && bContainsDRLOrDP) { |
| | | return 1; |
| | | } else { |
| | | return 0; |
| | | } |
| | | }); |
| | | } |
| | | dispEecProduct.value = getSelectPageData(filterProductData.value); |
| | | }; |
| | | const handleCurrentChange = (val: number) => { |