/** * Created by A.J on 2019/3/9. */$(document).ready(function(){if(""!=$("#propname").val()){var t=$("#propname").val().substr(1).split(",");$.each(t,function(t,a){$("#addpropdiv").html($("#addpropdiv").html()+'<div class="panel panel-default"><div class="panel-body bg-info"><span>'+a+'</span><button type="button" class="close"><span>&times;</span></button></div></div>')})}$("#addprop").on("click",function(){var t=$.trim($(this).prev().val());""!=t&&($("#addpropdiv").html($("#addpropdiv").html()+'<div class="panel panel-default"><div class="panel-body bg-info"><span>'+t+'</span><button type="button" class="close"><span>&times;</span></button></div></div>'),$("#propname").val($("#propname").val()+","+t),$(this).prev().val(""))}),$("#addpropdiv").on("click",".close",function(){var t=$.trim($(this).prev().text()),a=$("#propname").val()+",";a=a.replace(","+t+",",","),$("#propname").val(a.substr(0,a.length-1)),$(this).parent().parent().remove()}),$("#protemp").on("change",function(){""!=$.trim($(this).val())&&$.post("attributetemplatechk",{protemp:$.trim($(this).val()),verification:$("#verification").text()},function(t){"ok"!=t&&$.alert({title:"",content:t,confirmButton:$("#queding").text()})})})});