var g_theight=getAutoFixHeight("mylogtable")+45;function delLog(t,e){Ewin.confirm({title:" 注意",message:"确实要删除日志 "+t+" 吗？"}).on(function(e){if(!e){return}$.post("delLog",{from:t,to:t},function(e){if(e!=="ok"){myAlert(e)}else{$("#mylogtable").bootstrapTable("refresh")}})})}function initLogTable(){$("#mylogtable").bootstrapTable({pagination:true,showRefresh:true,search:true,clickToSelect:false,striped:true,escape:true,pageSize:parseInt((g_theight-200)/23),queryParams:function(e){var t={searchkey:$("#keyword").val(),top:$("#limit").val(),todate:$("#todate").val()};return t},url:"queryLogs",method:"post",contentType:"application/x-www-form-urlencoded;charset=UTF-8",height:g_theight-25,columns:[{field:"fid",title:"序号",align:"center",width:80},{field:"username",title:"用户名",align:"left",width:100,sortable:true},{field:"type",title:"类型",align:"left",width:100},{field:"content",title:"内容",align:"left"},{field:"userip",title:"ip",align:"center",width:120},{field:"createtime",title:"日期",align:"center",width:170},{field:"operation",title:"-",width:50,formatter:function(e,t,o){return"<a href='#' onclick='delLog("+t.fid+',"'+t.username+"\");'><span class='badge progress-bar-danger' alt='删除'>\n                        <span class='glyphicon glyphicon-remove' alt='删除'></span></span></a>&nbsp;\n                        "},align:"center"}],onPostBody:myOnLogPostBody,onLoadSuccess:function(e){clearMoreLogs()}});getNavPath(null,"首页")}function clearMoreLogs(){$.post("queryLogs",{mode:"cnt"},function(e){if(e>1e4){var t=$("#mylogtable").bootstrapTable("getData");var o=0;var l=t[0].fid-5e3;$.post("delLog",{from:o,to:l},function(e){})}$("#logtitle").html("日志 ["+e+"]")})}function myOnLogPostBody(e){myselecttd.addListenTable("#mylogtable")}function delLogs(){Ewin.confirm({title:" 注意",message:"确实要批量删除日志吗？"}).on(function(e){if(!e){return}var t=$("#beginlog").val();var o=$("#endlog").val();if(o>=t){$.post("delLog",{from:t,to:o},function(e){if(e!=="ok"){myAlert(e)}else{$("#beginlog").val("");$("#endlog").val("");$("#mylogtable").bootstrapTable("refresh")}})}})}function queryLogs(){$("#mylogtable").bootstrapTable("refresh")}