function initconf(){$("#submitedit").on("click",function(){saveConfig()});$(".barcodeconfig").change(function(){refreshPreview();$("#submitedit").removeClass("btn-primary").addClass("btn-warning")});loadConfig()}function loadConfig(){$.post("../queryGETable",{tid:getQueryString("tid"),fid:getQueryString("fid"),case:"getfieldinfo"},function(e){var o=myJSONParse(e);if(o.msg!=="ok"){myModalMessage(o.msg)}else if(o.field.content.modeloption){$("#barcodeformat").selectpicker("val",o.field.content.modeloption.format);$("#barcodeheight").val(o.field.content.modeloption.height);$("#barcodewidth").val(o.field.content.modeloption.width);$("#barcodedisplayValue").prop("checked",o.field.content.modeloption.displayValue);$("#barcodefontSize").selectpicker("val",o.field.content.modeloption.fontSize);$("#barcodelineColor").val(o.field.content.modeloption.lineColor)}refreshPreview()})}function saveConfig(){var e={};e.format=$("#barcodeformat").val();e.height=$("#barcodeheight").val();e.width=$("#barcodewidth").val();e.displayValue=$("#barcodedisplayValue").prop("checked");e.fontSize=$("#barcodefontSize").val();e.lineColor=$("#barcodelineColor").val();$.post("../editGETable",{option:JSON.stringify(e),tid:getQueryString("tid"),fid:getQueryString("fid"),case:"editfieldmodeloption"},function(e){var o=myJSONParse(e);if(o.msg!=="ok"){myModalMessage(o.msg)}else{myMessage("配置保存成功！");$("#submitedit").removeClass("btn-warning").addClass("btn-primary")}})}function refreshPreview(){var e={};var o=$("#barcodetestvalue").val();e.format=$("#barcodeformat").val();e.height=$("#barcodeheight").val();e.width=$("#barcodewidth").val();e.displayValue=$("#barcodedisplayValue").prop("checked");e.fontSize=$("#barcodefontSize").val();e.lineColor=$("#barcodelineColor").val();$("#codepreview").JsBarcode(o,e)}