Commit d7d06ae1 by fsn

添加清空日志功能

parent eb529a77
package com.stylefeng.guns.modular.system.controller; package com.stylefeng.guns.modular.system.controller;
import com.baomidou.mybatisplus.mapper.SqlRunner;
import com.baomidou.mybatisplus.plugins.Page; import com.baomidou.mybatisplus.plugins.Page;
import com.stylefeng.guns.common.constant.factory.PageFactory; import com.stylefeng.guns.common.constant.factory.PageFactory;
import com.stylefeng.guns.common.controller.BaseController; import com.stylefeng.guns.common.controller.BaseController;
...@@ -66,4 +67,14 @@ public class LogController extends BaseController { ...@@ -66,4 +67,14 @@ public class LogController extends BaseController {
Map<String, Object> stringObjectMap = BeanKit.beanToMap(operationLog); Map<String, Object> stringObjectMap = BeanKit.beanToMap(operationLog);
return super.warpObject(new LogWarpper(stringObjectMap)); return super.warpObject(new LogWarpper(stringObjectMap));
} }
/**
* 清空日志
*/
@RequestMapping("/delLog")
@ResponseBody
public Object delLog() {
SqlRunner.db().delete("delete from _operation_log");
return super.SUCCESS_TIP;
}
} }
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
</div> </div>
<div class="hidden-xs" id="OptLogTableToolbar" role="group"> <div class="hidden-xs" id="OptLogTableToolbar" role="group">
<#button name="查看详情" icon="fa-plus" clickFun="OptLog.detail()"/> <#button name="查看详情" icon="fa-plus" clickFun="OptLog.detail()"/>
<#button name="清空日志" icon="fa-plus" clickFun="OptLog.delLog()"/>
</div> </div>
<#table id="OptLogTable"/> <#table id="OptLogTable"/>
</div> </div>
......
...@@ -5,6 +5,16 @@ var Feng = { ...@@ -5,6 +5,16 @@ var Feng = {
this.ctxPath = ctx; this.ctxPath = ctx;
} }
}, },
confirm : function(tip,ensure){//询问框
parent.layer.confirm(tip, {
btn: ['确定','取消']
}, function(index){
ensure();
parent.layer.close(index);
}, function(index){
parent.layer.close(index);
});
},
log: function (info) { log: function (info) {
console.log(info); console.log(info);
}, },
......
...@@ -59,6 +59,17 @@ OptLog.detail = function () { ...@@ -59,6 +59,17 @@ OptLog.detail = function () {
} }
}; };
/**
* 清空日志
*/
OptLog.delLog = function () {
// Feng.confirm("是否清空所有日志?",function(){
var ajax = Feng.baseAjax("/log/delLog","清空日志");
ajax.start();
// });
}
/** /**
* 查询日志列表 * 查询日志列表
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment