ells.length > 3 && showRow) { var ratedVoltageText = rowCells[3].textContent; if (ratedVoltageText !== conditions.ratedVoltage) { showRow = false; } } // 根据频率筛选 if (conditions.frequency && rowCells.length > 4 && showRow) { var frequencyText = rowCells[4].textContent; if (frequencyText !== conditions.frequency) { showRow = false; } } // 根据尺寸筛选 if (conditions.size && rowCells.length > 6 && showRow) { var sizeText = rowCells[6].textContent; if (sizeText !== conditions.size) { showRow = false; } } // 根据接线方式筛选 if (conditions.wiring && rowCells.length > 7 && showRow) { var wiringText = rowCells[7].textContent; if (wiringText !== conditions.wiring) { showRow = false; } } // 根据风量范围筛选 if ((conditions.airVolumeMin || conditions.airVolumeMax) && rowCells.length > 8 && showRow) { var airVolumeText = rowCells[8].textContent; var airVolume = parseFloat(airVolumeText); if (!isNaN(airVolume)) { if (conditions.airVolumeMin && parseFloat(conditions.airVolumeMin) > airVolume) { showRow = false; } if (conditions.airVolumeMax && parseFloat(conditions.airVolumeMax) < airVolume) { showRow = false; } } } return showRow; } // 更新下拉列表选项 function updateSelectOptions() { var conditions = getFilterConditions(); // 收集筛选结果中存在的值 var availableVoltageTypes = new Set(); var availablePhases = new Set(); var availableRatedVoltages = new Set(); var availableFrequencies = new Set(); var availableSizes = new Set(); var availableWirings = new Set(); tableRows.forEach(function(row) { if (isRowMatchingConditions(row, conditions)) { var rowCells = row.querySelectorAll('td'); if (rowCells.length > 7) { availableVoltageTypes.add(rowCells[1].textContent); availablePhases.add(rowCells[2].textContent); availableRatedVoltages.add(rowCells[3].textContent); availableFrequencies.add(rowCells[4].textContent); availableSizes.add(rowCells[6].textContent); availableWirings.add(rowCells[7].textContent); } } }); // 更新各个下拉列表 updateSelect(voltageTypeSelect, originalVoltageTypeOptions, availableVoltageTypes); updateSelect(phaseSelect, originalPhaseOptions, availablePhases); updateSelect(ratedVoltageSelect, originalRatedVoltageOptions, availableRatedVoltages); updateSelect(frequencySelect, originalFrequencyOptions, availableFrequencies); updateSelect(sizeSelect, originalSizeOptions, availableSizes); updateSelect(wiringSelect, originalWiringOptions, availableWirings); } // 更新单个下拉列表 function updateSelect(selectElement, originalOptions, availableValues) { // 保存当前选中值 var currentValue = selectElement.value; // 清空下拉列表 selectElement.innerHTML = ''; // 添加默认选项 var defaultOption = document.createElement('option'); defaultOption.value = ''; switch(selectElement.id) { case 'ext_voltage_type': defaultOption.text = '电压类型'; break; case 'ext_phase': defaultOption.text = '相'; break; case 'ext_rated_voltage': defaultOption.text = '额定电压 单位V'; break; case 'ext_frequency': defaultOption.text = '频率 单位Hz'; break; case 'ext_para_size': defaultOption.text = '尺寸 单位mm'; break; case 'ext_wiring': defaultOption.text = '接线方式'; break; default: defaultOption.text = '请选择'; } selectElement.appendChild(defaultOption); // 添加可用的选项 originalOptions.forEach(function(option) { // 跳过默认选项 if (option.value === '') return; // 检查该选项是否在可用值中 if (availableValues.has(option.value)) { var newOption = document.createElement('option'); newOption.value = option.value; newOption.text = option.text; selectElement.appendChild(newOption); } }); // 恢复当前选中值(如果仍然可用) if (currentValue) { var optionExists = false; var options = selectElement.querySelectorAll('option'); options.forEach(function(option) { if (option.value === currentValue) { optionExists = true; } }); if (optionExists) { selectElement.value = currentValue; } } } // 筛选函数 function filterTable(e) { if (e) { e.preventDefault(); // 阻止表单默认提交 } var conditions = getFilterConditions(); // 遍历表格行进行筛选 var hasVisibleRow = false; tableRows.forEach(function(row) { var showRow = isRowMatchingConditions(row, conditions); row.style.display = showRow ? '' : 'none'; if (showRow) { hasVisibleRow = true; } }); // 检查是否有符合条件的行显示 // 如果没有符合条件的行,显示提示信息 var noResultMsg = document.getElementById('no-result-message'); if (!noResultMsg) { noResultMsg = document.createElement('tr'); noResultMsg.id = 'no-result-message'; noResultMsg.innerHTML = '没有找到符合条件的信息'; noResultMsg.style.display = 'none'; document.querySelector('.product-params-table tbody').appendChild(noResultMsg); } noResultMsg.style.display = hasVisibleRow ? 'none' : ''; // 更新下拉列表选项 updateSelectOptions(); } // 添加事件监听 if (searchForm) { searchForm.addEventListener('submit', filterTable); } // 为keywords输入框添加input事件监听(带防抖) if (keywordsInput) { keywordsInput.addEventListener('input', debounce(filterTable, 300)); } // 为电压类型下拉框添加change事件监听 if (voltageTypeSelect) { voltageTypeSelect.addEventListener('change', filterTable); } // 为相下拉框添加change事件监听 if (phaseSelect) { phaseSelect.addEventListener('change', filterTable); } // 为额定电压下拉框添加change事件监听 if (ratedVoltageSelect) { ratedVoltageSelect.addEventListener('change', filterTable); } // 为频率下拉框添加change事件监听 if (frequencySelect) { frequencySelect.addEventListener('change', filterTable); } // 为尺寸下拉框添加change事件监听 if (sizeSelect) { sizeSelect.addEventListener('change', filterTable); } // 为接线方式下拉框添加change事件监听 if (wiringSelect) { wiringSelect.addEventListener('change', filterTable); } // 为风量最小值输入框添加input事件监听(带防抖) if (airVolumeMinInput) { airVolumeMinInput.addEventListener('input', debounce(filterTable, 300)); } // 为风量最大值输入框添加input事件监听(带防抖) if (airVolumeMaxInput) { airVolumeMaxInput.addEventListener('input', debounce(filterTable, 300)); } // 初始化保存原始选项 saveOriginalOptions(); }); Model Voltage Type Phase Rated VoltageV FrequencyHz Sizemm Wiring Type Air Volume Speedrpm Static Pressure RCFD225-D46D_-115B 3~400V±10% 50 225 1233 RCFD225-D46F_-115B 3~400V±10% 50 225 1315 RCFD225-E46D_-115B 1~230±10% 50 225 1185 RCFD225-E46F_-115B 1~230±10% 50 225 1030
Want to learn more about our products?Contact us
Contact us