/*** Created by A.J on 2019/10/1.*/$(document).ready(function(){$('.popover_dissec').popover({trigger: 'hover'});var gupobzval;$(".banzhuzu").mouseenter(function(){gupobzval = $(this).val();});$(".banzhuzu").change(function(){var gupobj = $(this);var oval = gupobzval;var gupval = $(this).val();$.post("setbzgroups", { id: $(this).next().val(),gup: gupval, verification:$("#verification").text()}, function(data){if(data != 'ok'){gupobj.val(oval);$.alert({title: $('#chucuo').text(),content: data,buttons: {confirm: {text: $('#queding').text(),btnClass: 'btn-info',keys: ['enter']}}});}});});var tfobj,uid;$(".popover_dissec").on("click", function(){tfobj = $(this).parent().parent();uid = $(this).data("id");var bzdj = $(this).parents("tr").children("td:last").children("select").val();$(".shezhibanzhu").addClass("d-none");$(".custom-control-input").each(function(){$(this).prop("checked", false);});if(bzdj == 5){$(".shezhibanzhu").html('<option value="5">'+$("#sxbanzhu").text()+'</option>');}else if(bzdj == 10){$(".shezhibanzhu").html('<option value="10">'+$("#fubanzhu").text()+'</option><option value="5">'+$("#sxbanzhu").text()+'</option>');}else if(bzdj == 15){$(".shezhibanzhu").html('<option value="15">'+$("#banzhu").text()+'</option><option value="10">'+$("#fubanzhu").text()+'</option><option value="5">'+$("#sxbanzhu").text()+'</option>');}var bzarr = [];var str = tfobj.children("span:first").text();var strarr = str.split(",");$.each(strarr,function(index,value){var valuearr = value.replace("]", "").split("[");bzarr.push({nm: $.trim(valuearr[0]), bzn: $.trim(valuearr[1])});});$(".custom-control-input").each(function(){var inobj = $(this);var pin = $(this).parent();var intext = $(this).parent().find("span:first").text();$.each(bzarr,function(index,value){if(value.nm == intext){inobj.prop("checked", true);pin.find("select").removeClass("d-none").find("option").filter(function(){return $(this).text()==value.bzn;}).attr("selected",true);}});});$('#fenpei').modal('show');});$("#fenpeiok").on("click", function(){var sid = "";var snm = "";var obj = $(this);obj.children("i:last").removeClass("d-none");$(".custom-control-input").each(function(){if($(this).is(':checked')){var bz = $(this).parent().find("select").val();if(sid == ""){sid = $(this).data("id")+":"+bz;}else{sid += "," + $(this).data("id")+":"+bz;}var tprt = $(this).parent().find("label.custom-control-label>span").text();var bzz = $(this).parent().find("select").find("option:selected").text();if(snm == ""){snm = tprt+"&nbsp;[&nbsp;"+bzz+"&nbsp;]";}else{snm += ",&nbsp;" + tprt+"&nbsp;[&nbsp;"+bzz+"&nbsp;]";}}});$.post("setmoderator", { uid: uid,sid: sid, verification:$("#verification").text()}, function(data){obj.children("i:last").addClass("d-none");if(data == 'ok'){tfobj.find("span:first").html(snm);$('#fenpei').modal('hide');$(".custom-control-input").each(function(){$(this).prop("checked", false);});}else{$.alert({title: $('#chucuo').text(),content: data,buttons: {confirm: {text: $('#queding').text(),btnClass: 'btn-info',keys: ['enter']}}});}});});$(".custom-control-input").on("change", function(){var pd = $(this).parent();if($(this).prop("checked") == true){pd.find("select").removeClass("d-none");}else{pd.find("select").addClass("d-none");}});});