function initautobk(){$.post("../bkUnit",{case:"getautobk"},function(t){var e=myJSONParse(t);if(e.msg==="ok"&&e.autop){for(var i in e.autop){if($("#"+i).length){if($("#"+i).attr("type")==="checkbox"){$("#"+i).prop("checked",e.autop[i]==="true"||e.autop[i]===true)}else{$("#"+i).val(e.autop[i])}}}}})}function setautobk(){var t={};$(".autop").each(function(){if(this.type==="checkbox"){t[$(this).attr("id")]=$(this).prop("checked")}else{t[$(this).attr("id")]=$(this).val()}});$.ajaxSettings.async=false;beginWait();$.post("../bkUnit",{case:"setautobk",autop:JSON.stringify(t)},function(t){var e=myJSONParse(t);if(e["msg"]==="ok"){myAlert("设置完毕！")}else{myAlert(e.msg)}});endWait();$.ajaxSettings.async=true}function bkdownload(){Ewin.confirm({title:" 注意",message:"确定开始备份？"}).on(function(t){if(!t){return}$.ajaxSettings.async=false;beginWait();$.post("../bkUnit",{db:$("#mybkdb").prop("checked"),att:$("#mybkatt").prop("checked"),case:"bkunit"},function(t){var e=myJSONParse(t);if(e["msg"]==="ok"){$("#exportmsg").html(e.text);window.open(e.downfile)}else{myAlert(e.msg)}});endWait();$.ajaxSettings.async=true})}function importdb(){Ewin.confirm({title:" 注意",message:"确定开始导入？"}).on(function(t){if(!t){return}var e={};$(".importp").each(function(){if(this.type==="checkbox"){e[$(this).attr("id")]=$(this).prop("checked")}else{e[$(this).attr("id")]=$(this).val()}});$.ajaxSettings.async=false;beginWait();$.post("../bkUnit",{importp:JSON.stringify(e),case:"importdb"},function(t){var e=myJSONParse(t);if(e["msg"]==="ok"){$("#exportmsg").html(e.text)}else{myAlert(e.msg)}});endWait();$.ajaxSettings.async=true})}function clearbks(){Ewin.confirm({title:" 注意",message:"确实要清理您的历史备份吗？"}).on(function(t){if(!t){return}$.ajaxSettings.async=false;beginWait();$.post("../bkUnit",{case:"clearbks"},function(t){var e=myJSONParse(t);if(e["msg"]==="ok"){myAlert("清理完毕！")}else{myAlert(e.msg)}});endWait();$.ajaxSettings.async=true})}