锘 var KeySeriesData = [];//鎸夊叧閿瓧鏌ヨ鐨刣ata var flagTipStuatus;//鍏抽棴tip 鏍囪 function clickMotorFilter() { var aVal = $("#aShowMoreFilter"); var IsShow = aVal.attr("value"); if (IsShow == "true") { aVal.attr("value", false); $("#CatalogTypeList").hide(); $("#aShowMoreFilter i").removeClass("fa-angle-down"); $("#aShowMoreFilter i").addClass("fa-angle-right"); } else { aVal.attr("value", true); $("#CatalogTypeList").show(); $("#aShowMoreFilter i").removeClass("fa-angle-right"); $("#aShowMoreFilter i").addClass("fa-angle-down"); } } //鎻愮ず妗 function ShowTip(img, content) { if (content != "" && content != null) { flagTipStuatus = layer.tips(content, img, { tips: [2, '#78BA32'], time: 0, area: '500px' }); } } function HideTip() { layer.close(flagTipStuatus); } //鍏ㄩ儴绫诲埆 function GetAllCatalogList(data) { var html = ""; html += ' '; if (data != null && data.length > 0) { for (var i = 0; i < data.length; i++) { html += ''; } } $("#LeiBieDiv").html(html); //$.ajax({ // type: "get", // url: "../Service/CatalogHandler.ashx", // data: { cmd: "GetAllCatalog" }, // dataType: 'json', // success: function (data, status) { // var html = ""; // html += ' '; // if (data != null && data.length > 0) { // for (var i = 0; i < data.length; i++) { // html += ''; // } // } // $("#LeiBieDiv").html(html); // }, // error: function () { // alert('閿欒浠g爜 421'); // } //}); } //浜у搧绫诲瀷鍒楄〃 function GetallProductTypeList() { var allProductTypeList = GlobalParas.AllProductTypeList; if (allProductTypeList.length == 1) { $("#ProductTypeFilterDiv").hide(); } else { $("#ProductTypeFilterDiv").show(); } var html = ""; if (allProductTypeList != null && allProductTypeList.length > 0) { for (var i = 0; i < allProductTypeList.length; i++) { html += ''; } } $("#ProductTypeDiv").html(html); } //閫夋嫨浜у搧绫诲瀷 function ProductTypeChange(label) { GetAllCatalogFilterList($(label).children().val()); if ($(label).children().val() == 0) { $("#PinLvDiv").show(); } else { $("#PinLvDiv").hide(); } } //鏍规嵁浜у搧绫诲瀷鏉′欢绛涢€夌被鍒垪琛 function GetAllCatalogFilterList(productType, pl) { if (!pl) { pl = ($("#lblMotorFrequence50HZ").parent().prop("checked") ? 50 : 60); } var html = ""; html += ' '; if (AllCatalgoEntity != null && AllCatalgoEntity.length > 0) { for (var i = 0; i < AllCatalgoEntity.length; i++) { if (AllCatalgoEntity[i].ProductType == productType) { html += ''; } } } $("#LeiBieDiv").html(html); //GetAllProductSeries(); FilterCatalogSeries() } //浜у搧绫诲瀷绛涢€変笅鐨勬墍鏈夊瀷鍙峰垪琛 function GetAllProductSeries() { window.setTimeout(function () { var MotorFrequece = $("#lblMotorFrequence50HZ").parent().prop("checked") ? "50" : "60"; var dispSeriess = []; if ($("#TypeAll").children().prop("checked")) { var allCheckCatalogLabels = $("#LeiBieDiv input[type='checkbox']"); if (allCheckCatalogLabels.length > 0) { for (var i = 0; i < allCheckCatalogLabels.length; i++) { var label = $(allCheckCatalogLabels[i]); if (label.attr("ProductType") == 0) {//娉 for (var k = 0; k < AllSeriesEntity.length; k++) { var series = AllSeriesEntity[k]; if (series.IsPump == 1 && series.CatalogID == label.val() && series.MotorFrequece == MotorFrequece) { dispSeriess.push(series); //console.log(series); } } } else { for (var k = 0; k < AllSeriesEntity.length; k++) { var series = AllSeriesEntity[k]; if (series.IsPump == 0 && series.CatalogID == label.val()) dispSeriess.push(series); } } } } }; AllProductEntity = dispSeriess; BuildSeriesHtml(dispSeriess); }); } //鐢垫満棰戠巼閫夋嫨 function RadioFilterCatalogSeries(pl) { if (pl == 50) { $("#lblMotorFrequence50HZ").addClass("active"); $("#lblMotorFrequence60HZ").parent().prop("checked", false); $("#lblMotorFrequence50HZ").parent().prop("checked", true); $("#lblMotorFrequence60HZ").removeClass("active"); } else { $("#lblMotorFrequence60HZ").addClass("active"); $("#lblMotorFrequence50HZ").parent().prop("checked", false); //$("#lblMotorFrequence60HZ").parent().prop("checked", true); $("#lblMotorFrequence50HZ").removeClass("active"); } GetAllCatalogFilterList(0, pl); } function DispAllSeries(all) { if (!$(all).children().prop("checked")) { for (var i = 0; i < $("#LeiBieDiv input[type='checkbox']").length; i++) { $($("#LeiBieDiv input[type='checkbox']")[i]).prop("checked", false); $($("#LeiBieDiv input[type='checkbox']")[i]).parent().removeClass("active"); } } // GetAllProductSeries(); FilterCatalogSeries() } function FilterCatalog() { $("#TypeAll").children().prop("checked", false); $($("#TypeAll input[type='checkbox']")).parent().removeClass("active"); FilterCatalogSeries(); } //鍏ㄩ儴琛屼笟 function GetIndustryList() { var html = ""; html += ''; for (var i = 0; i < AllHangYeEntity.length; i++) { html += ''; } $("#HangYe").html(html); } // function selectAllHangYe(all) { if (!$(all).children().prop("checked")) { for (var i = 0; i < $("#HangYe input[type='checkbox']").length; i++) { $($("#HangYe input[type='checkbox']")[i]).prop("checked", false); $($("#HangYe input[type='checkbox']")[i]).parent().removeClass("active"); } } FilterCatalogSeries(); } //绫诲埆 function FilterCatalogSeries() { //FilterSeries(); window.setTimeout(function () { var MotorFrequece = $("#lblMotorFrequence50HZ").parent().prop("checked") ? "50" : "60"; //var CatalogID = ""; var dispSeriess = []; if ($("#TypeAll").children().prop("checked")) { var allCheckCatalogLabels = $("#LeiBieDiv input[type='checkbox']"); } else { var allCheckCatalogLabels = $("#LeiBieDiv input[type='checkbox']:checked"); } var AppIndustrys = []; if (!$("#HangYeAll").children().prop("checked")) { for (var i = 0; i < $("#HangYe input[type='checkbox']:checked").length; i++) { if ($($("#HangYe input[type='checkbox']:checked")[i]).val() != "on") { AppIndustrys.push($($("#HangYe input[type='checkbox']:checked")[i]).val()); } } } if (allCheckCatalogLabels.length > 0) { for (var i = 0; i < allCheckCatalogLabels.length; i++) { var label = $(allCheckCatalogLabels[i]); if ($("#ProductTypeDiv input[name='ProductName']:checked").val() == 0) {//娉 for (var k = 0; k < AllSeriesEntity.length; k++) { var series = AllSeriesEntity[k]; if (series.IsPump == 1 && series.CatalogID == label.val() && series.MotorFrequece == MotorFrequece) { //console.log(series); if (AppIndustrys != "") { var bol = false; for (var j = 0; j < AppIndustrys.length; j++) { if (series.HangYeList != null) { if (series.HangYeList.indexOf(AppIndustrys[j]) != -1) {//鍒ゆ柇鏄惁鍖呭惈琛屼笟 bol = true; } } } if (bol) dispSeriess.push(series); } else { dispSeriess.push(series); } } } } else { for (var k = 0; k < AllSeriesEntity.length; k++) { var series = AllSeriesEntity[k]; if (series.IsPump == 0 && series.CatalogID == label.val()) dispSeriess.push(series); } } } } AllProductEntity = dispSeriess; NewAllSeriesEntity = dispSeriess; BuildSeriesHtml(NewAllSeriesEntity); }, 300); } //琛屼笟 function HangYeSeries() { $("#HangYeAll").children().prop("checked", false); $($("#HangYeAll input[type='checkbox']")).parent().removeClass("active"); FilterCatalogSeries(); } //鎸夊叧閿瓧鏌ヨ function FilterByKey() { var kty = $("#txtKeyWord").val().trim().toLowerCase(); var data = []; if (kty == "") { data = AllProductEntity; } else { for (var i = 0; i < AllProductEntity.length; i++) { if (AllProductEntity[i].Name.toLowerCase().indexOf(kty) >= 0) { data.push(AllProductEntity[i]); } } } NewAllSeriesEntity = data; BuildSeriesHtml(data); } //杩囨护鏉′欢 function FilterSeries() { var MotorFrequece = $("#PvRadio").prop("checked") ? "50" : "60"; var CatalogID = ""; if (!$("#TypeAll").children().children().prop("checked")) { if ($("#LeiBieDiv input[type='checkbox']:checked").length > 0) { for (var i = 0; i < $("#LeiBieDiv input[type='checkbox']:checked").length; i++) { if ($($("#LeiBieDiv input[type='checkbox']:checked")[i]).val() != "on") { if (CatalogID != "") { CatalogID += ","; } CatalogID += $($("#LeiBieDiv input[type='checkbox']:checked")[i]).val(); } } } } var AppIndustrys = ""; if (!$("#HangYeAll").children().prop("checked")) { for (var i = 0; i < $("#HangYe input[type='checkbox']:checked").length; i++) { if ($($("#HangYe input[type='checkbox']:checked")[i]).val() != "on") { if (AppIndustrys != "") { AppIndustrys += ","; } AppIndustrys += $($("#HangYe input[type='checkbox']:checked")[i]).val(); } } } }; function isGrid(bol) { isGridView = bol; $.cookie('isGridView', bol, { path: '/' }); FilterCatalogSeries(); } //鏍规嵁浼犲叆鐨勫垪琛ㄦ樉绀轰骇鍝 var isGridView = false; function BuildSeriesHtml(data) { if ($.cookie('isGridView') == "true") { $("#lblSeriesDisplayList").removeClass("active"); $("#inputSeriesDisplayList").prop("checked", false); $("#lblSeriesDisplayGrid").addClass("active"); $("#inputSeriesDisplayGrid").prop("checked", true); isGridView = true; var html = ""; for (var i = 0; i < data.length; i++) { //console.log(data[i]); var tipStr = data[i].ShortDescription; if (tipStr == null) { tipStr = ""; } html += '
  • '; html += '
    '; html += '
    ' + data[i].Name.substring(0, 11); html += '
    '; html += '
    '; html += '
    '; if (data[i].IsPump == 1) { html += ''; html += '
    '; html += ''; } else { html += ''; html += '
    '; html += ''; } html += '
  • '; } $("#seriesList").html(html); } else { $("#lblSeriesDisplayList").addClass("active"); $("#inputSeriesDisplayList").prop("checked", false); $("#lblSeriesDisplayGrid").removeClass("active"); $("#inputSeriesDisplayGrid").prop("checked", false); isGridView = false; var html = ""; for (var i = 0; i < data.length ; i++) { //console.log(data[i]); var tipStr = data[i].ShortDescription; if (tipStr == null) { tipStr = ""; } html += '
  • '; html += '
    '; html += '
    '; html += '
    '; if (data[i].IsPump == 1) { html += ''; html += '
    '; html += ' 屑薪械薪懈械 '; html += '
    ' + data[i].Name; html += '
    '; html += '
    ' + tipStr + '
    '; } else { html += ''; html += '
    '; html += ' 屑薪械薪懈械 '; html += '
    ' + data[i].Name; html += '
    '; html += '
    ' + tipStr + '
    '; } html += '
  • '; } $("#seriesList").html(html); } }