liukx 4 роки тому
батько
коміт
cfcbe2b08f

+ 0 - 12
jay-monitor-data-core/src/main/java/com/jay/monitor/data/core/model/serializable/SQLMonitorDTO.java

@@ -1,7 +1,6 @@
 package com.jay.monitor.data.core.model.serializable;
 
 import com.jay.monitor.data.core.enums.MsgTypeEnums;
-import com.jay.monitor.data.core.model.serializable.base.BaseDTO;
 import com.jay.monitor.data.core.model.serializable.base.CommonDataDTO;
 
 /**
@@ -41,10 +40,6 @@ public class SQLMonitorDTO extends CommonDataDTO {
      * 结果返回
      */
     private Object result;
-    /**
-     * 耗时
-     */
-    private Long time;
 
     public Integer getAffectedRows() {
         return affectedRows;
@@ -94,11 +89,4 @@ public class SQLMonitorDTO extends CommonDataDTO {
         this.result = result;
     }
 
-    public Long getTime() {
-        return time;
-    }
-
-    public void setTime(Long time) {
-        this.time = time;
-    }
 }

+ 27 - 0
jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/controllers/TraceConsoleController.java

@@ -6,7 +6,9 @@ import com.jay.monitor.data.core.model.response.PageResponseModel;
 import com.jay.monitor.data.core.utils.ResponseUtils;
 import com.jay.monitor.data.server.models.entity.JayMonitorMq;
 import com.jay.monitor.data.server.models.request.trace.MQRequest;
+import com.jay.monitor.data.server.models.request.trace.SQLRequest;
 import com.jay.monitor.data.server.models.request.trace.URLRequest;
+import com.jay.monitor.data.server.models.response.trace.SQLTraceResponse;
 import com.jay.monitor.data.server.models.response.trace.URLTraceResponse;
 import com.jay.monitor.data.server.store.ConfigStoreManager;
 import com.jay.monitor.data.server.store.TranceJsonManager;
@@ -39,6 +41,8 @@ public class TraceConsoleController {
     @Autowired
     private TranceJsonManager tranceJsonManager;
 
+    //////////////////////////////////////// route //////////////////////////////////////////////
+
     @RequestMapping(value = "/mqList.html", method = RequestMethod.GET)
     public String list(Model model) throws Exception {
         model.addAttribute("catUrl", configStoreManager.getLogMonitorUrl());
@@ -51,6 +55,14 @@ public class TraceConsoleController {
         return page + "urlList";
     }
 
+    @RequestMapping(value = "/sqlList.html", method = RequestMethod.GET)
+    public String sqlList(Model model) throws Exception {
+        model.addAttribute("catUrl", configStoreManager.getLogMonitorUrl());
+        return page + "sqlList";
+    }
+
+    ///////////////////////////////////////////// API ////////////////////////////////////////////
+
     @RequestMapping(value = "/mqNodeId", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
     @ResponseBody
     public ListResponseModel<JayMonitorMq> findMQList(@RequestBody MQRequest request) throws Exception {
@@ -80,4 +92,19 @@ public class TraceConsoleController {
             .searchDataByList(MsgTypeEnums.URL, date, request.getPageNo(), request.getPageSize(), request);
         return pageResponseModel;
     }
+
+    @RequestMapping(value = "/sqlList", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
+    @ResponseBody
+    public PageResponseModel<SQLTraceResponse> findSqlList(@RequestBody SQLRequest request) throws Exception {
+        PageResponseModel pageResponseModel = getDataPageList(MsgTypeEnums.SQL, request);
+        return pageResponseModel;
+    }
+
+    private PageResponseModel getDataPageList(MsgTypeEnums msgTypeEnums, SQLRequest request) throws Exception {
+        String date = DataUtils.parseDayString(request.getDate());
+        // 将参数对应的全部匹配赋值
+        PageResponseModel pageResponseModel =
+            tranceJsonManager.searchDataByList(msgTypeEnums, date, request.getPageNo(), request.getPageSize(), request);
+        return pageResponseModel;
+    }
 }

+ 198 - 3
jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/models/entity/es/JayMonitorSQLIndex.java

@@ -1,9 +1,204 @@
 package com.jay.monitor.data.server.models.entity.es;
 
-import com.jay.monitor.data.core.model.serializable.SQLMonitorDTO;
+import com.jay.monitor.data.server.anno.ESSearch;
+import com.jay.monitor.data.server.enums.ESQuerySyntax;
+import org.zxp.esclientrhl.annotation.ESID;
 import org.zxp.esclientrhl.annotation.ESMetaData;
 
-@ESMetaData(indexName = "jay_monitor_sql", indexType = "sql", number_of_shards = 5, number_of_replicas = 0)
-public class JayMonitorSQLIndex extends SQLMonitorDTO {
+import java.util.Date;
 
+@ESMetaData(indexName = "jay_monitor_sql", number_of_shards = 5, number_of_replicas = 0, printLog = true)
+public class JayMonitorSQLIndex {
+
+    @ESID
+    private String id;
+
+    private String ip;
+
+    private String applicationName;
+
+    private String groupName;
+
+    private String groupKeyName;
+
+    private String dataId;
+
+    private String logId;
+
+    @ESSearch(value = ESQuerySyntax.gt)
+    private Integer affectedRows;
+
+    @ESSearch(value = ESQuerySyntax.like)
+    private String jsonContent;
+
+    @ESSearch(value = ESQuerySyntax.gt)
+    private Long requestTime;
+
+    /**
+     * 执行命令
+     */
+    private String commandType;
+    /**
+     * sql编号
+     */
+    private String sqlId;
+    /**
+     * 表名称
+     */
+    private String table;
+    /**
+     * SQL 语句
+     */
+    private String sql;
+
+    /**
+     * 结果返回
+     */
+    private Object result;
+
+    /**
+     * 创建时间
+     */
+    private Date createDate;
+
+    /**
+     * 状态
+     */
+    private Integer status;
+
+    public String getIp() {
+        return ip;
+    }
+
+    public void setIp(String ip) {
+        this.ip = ip;
+    }
+
+    public String getApplicationName() {
+        return applicationName;
+    }
+
+    public void setApplicationName(String applicationName) {
+        this.applicationName = applicationName;
+    }
+
+    public String getGroupName() {
+        return groupName;
+    }
+
+    public void setGroupName(String groupName) {
+        this.groupName = groupName;
+    }
+
+    public String getGroupKeyName() {
+        return groupKeyName;
+    }
+
+    public void setGroupKeyName(String groupKeyName) {
+        this.groupKeyName = groupKeyName;
+    }
+
+    public String getDataId() {
+        return dataId;
+    }
+
+    public void setDataId(String dataId) {
+        this.dataId = dataId;
+    }
+
+    public String getLogId() {
+        return logId;
+    }
+
+    public void setLogId(String logId) {
+        this.logId = logId;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public Integer getAffectedRows() {
+        return affectedRows;
+    }
+
+    public void setAffectedRows(Integer affectedRows) {
+        this.affectedRows = affectedRows;
+    }
+
+    public String getJsonContent() {
+        return jsonContent;
+    }
+
+    public void setJsonContent(String jsonContent) {
+        this.jsonContent = jsonContent;
+    }
+
+    public Long getRequestTime() {
+        return requestTime;
+    }
+
+    public void setRequestTime(Long requestTime) {
+        this.requestTime = requestTime;
+    }
+
+    public String getCommandType() {
+        return commandType;
+    }
+
+    public void setCommandType(String commandType) {
+        this.commandType = commandType;
+    }
+
+    public String getSqlId() {
+        return sqlId;
+    }
+
+    public void setSqlId(String sqlId) {
+        this.sqlId = sqlId;
+    }
+
+    public String getTable() {
+        return table;
+    }
+
+    public void setTable(String table) {
+        this.table = table;
+    }
+
+    public String getSql() {
+        return sql;
+    }
+
+    public void setSql(String sql) {
+        this.sql = sql;
+    }
+
+    public Object getResult() {
+        return result;
+    }
+
+    public void setResult(Object result) {
+        this.result = result;
+    }
+
+    public Date getCreateDate() {
+        return createDate;
+    }
+
+    public void setCreateDate(Date createDate) {
+        this.createDate = createDate;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
 }

+ 70 - 64
jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/models/request/trace/SQLRequest.java

@@ -23,32 +23,33 @@ public class SQLRequest extends PageRequest {
     /**
      * 应用地址
      */
-    private String applicationIp;
+    private String ip;
 
     /**
-     * mq类型
+     * 执行命令
      */
-    private String mqType;
-
+    private String commandType;
     /**
-     * 执行类型  producer/consumer
+     * sql编号
      */
-    private String invokeType;
-
+    private String sqlId;
     /**
-     * 订阅主题
+     * 表名称
      */
-    private String topic;
-
+    private String table;
     /**
-     * 分区名称
+     * SQL 语句
      */
-    private String partitionName;
+    private String sql;
 
     /**
-     * 消息编号
+     * 影响行数
      */
-    private String msgId;
+    private Integer affectedRows;
+    /**
+     * 结果返回
+     */
+    private Object result;
 
     /**
      * 应用监控组
@@ -90,88 +91,101 @@ public class SQLRequest extends PageRequest {
      */
     private Long requestTime;
 
-    /**
-     * 数据来源时间
-     */
-    private Date sourceTime;
-
     /**
      * 时间时间
      */
     private Date createdTime;
 
-    public Long getRequestTime() {
-        return requestTime;
+    private String jsonContent;
+
+    public String getJsonContent() {
+        return jsonContent;
     }
 
-    public void setRequestTime(Long requestTime) {
-        this.requestTime = requestTime;
+    public void setJsonContent(String jsonContent) {
+        this.jsonContent = jsonContent;
     }
 
-    private static final long serialVersionUID = 1L;
+    public Integer getAffectedRows() {
+        return affectedRows;
+    }
 
-    public Integer getId() {
-        return id;
+    public void setAffectedRows(Integer affectedRows) {
+        this.affectedRows = affectedRows;
     }
 
-    public void setId(Integer id) {
-        this.id = id;
+    public String getCommandType() {
+        return commandType;
     }
 
-    public String getApplicationName() {
-        return applicationName;
+    public void setCommandType(String commandType) {
+        this.commandType = commandType;
     }
 
-    public void setApplicationName(String applicationName) {
-        this.applicationName = applicationName;
+    public String getSqlId() {
+        return sqlId;
     }
 
-    public String getApplicationIp() {
-        return applicationIp;
+    public void setSqlId(String sqlId) {
+        this.sqlId = sqlId;
     }
 
-    public void setApplicationIp(String applicationIp) {
-        this.applicationIp = applicationIp;
+    public String getTable() {
+        return table;
     }
 
-    public String getMqType() {
-        return mqType;
+    public void setTable(String table) {
+        this.table = table;
     }
 
-    public void setMqType(String mqType) {
-        this.mqType = mqType;
+    public String getSql() {
+        return sql;
     }
 
-    public String getInvokeType() {
-        return invokeType;
+    public void setSql(String sql) {
+        this.sql = sql;
     }
 
-    public void setInvokeType(String invokeType) {
-        this.invokeType = invokeType;
+    public Object getResult() {
+        return result;
     }
 
-    public String getTopic() {
-        return topic;
+    public void setResult(Object result) {
+        this.result = result;
     }
 
-    public void setTopic(String topic) {
-        this.topic = topic;
+    public Long getRequestTime() {
+        return requestTime;
     }
 
-    public String getPartitionName() {
-        return partitionName;
+    public void setRequestTime(Long requestTime) {
+        this.requestTime = requestTime;
     }
 
-    public void setPartitionName(String partitionName) {
-        this.partitionName = partitionName;
+    private static final long serialVersionUID = 1L;
+
+    public Integer getId() {
+        return id;
     }
 
-    public String getMsgId() {
-        return msgId;
+    public void setId(Integer id) {
+        this.id = id;
     }
 
-    public void setMsgId(String msgId) {
-        this.msgId = msgId;
+    public String getApplicationName() {
+        return applicationName;
+    }
+
+    public void setApplicationName(String applicationName) {
+        this.applicationName = applicationName;
+    }
+
+    public String getIp() {
+        return ip;
+    }
+
+    public void setIp(String ip) {
+        this.ip = ip;
     }
 
     public String getDataGroupName() {
@@ -230,14 +244,6 @@ public class SQLRequest extends PageRequest {
         this.status = status;
     }
 
-    public Date getSourceTime() {
-        return sourceTime;
-    }
-
-    public void setSourceTime(Date sourceTime) {
-        this.sourceTime = sourceTime;
-    }
-
     public Date getCreatedTime() {
         return createdTime;
     }

+ 1 - 0
jay-monitor-data-server/src/main/resources/static/js/elab-service-config.js

@@ -8,6 +8,7 @@ var urlConfig = {
     },
     "trace":{
         "mqListService": "/trace/mqList/",
+        "sqlListService": "/trace/sqlList/",
         "urlListService": "/trace/urlList/"
     }
 }

+ 6 - 0
jay-monitor-data-server/src/main/resources/templates/index.html

@@ -131,6 +131,12 @@
                             <cite>网关路由查询</cite>
                         </a>
                     </li>
+                    <li>
+                        <a _href="/trace/sqlList.html">
+                            <i class="iconfont">&#xe6a7;</i>
+                            <cite>SQL查询</cite>
+                        </a>
+                    </li>
                 </ul>
             </li>
 <!--            <li>-->

+ 319 - 0
jay-monitor-data-server/src/main/resources/templates/trace/sqlList.html

@@ -0,0 +1,319 @@
+<html xmlns:th="http://www.thymeleaf.org"
+      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" layout:decorator="~{/base/main}">
+<head>
+    <meta charset="UTF-8"/>
+    <title>链路查找管理</title>
+    <script src="/lib/json-viewer/jquery.json-viewer.js"></script>
+    <link href="/lib/json-viewer/jquery.json-viewer.css" type="text/css" rel="stylesheet">
+</head>
+
+<body>
+<div layout:fragment="content">
+</div>
+<div class="x-nav">
+      <span class="layui-breadcrumb">
+        <a href="">链路查找管理</a>
+        <a>
+          <cite>查询列表</cite></a>
+      </span>
+    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
+       href="javascript:location.replace(location.href);" title="刷新">
+        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
+</div>
+<div class="x-body">
+    <div class="layui-row">
+        <form class="layui-form layui-col-md12 x-so layui-form-pane">
+            <div class="layui-form-item">
+                <div class="layui-inline">
+                    <label class="layui-form-label">日期</label>
+                    <div class="layui-input-block">
+                        <input type="text" required="true" class="layui-input" name="date" id="d_date"
+                               placeholder="yyMMdd">
+                    </div>
+                </div>
+                <div class="layui-inline">
+                    <label class="layui-form-label">项目名称</label>
+                    <div class="layui-input-block">
+                        <input code="text" class="layui-input" name="applicationName" id="q_application_name" value="">
+                    </div>
+                </div>
+                <div class="layui-inline">
+                    <label class="layui-form-label">应用IP</label>
+                    <div class="layui-input-block">
+                        <input code="text" class="layui-input" name="ip" id="q_ip" value="">
+                    </div>
+                </div>
+                <div class="layui-inline">
+                    <label class="layui-form-label">表名</label>
+                    <div class="layui-input-block">
+                        <input code="text" class="layui-input" name="table" id="q_table" value="">
+                    </div>
+                </div>
+                <div class="layui-inline">
+                    <label class="layui-form-label">SQL编号</label>
+                    <div class="layui-input-block">
+                        <input code="text" class="layui-input" name="sqlId" id="q_sql_id" value="">
+                    </div>
+                </div>
+                <div class="layui-inline">
+                    <label class="layui-form-label">影响行数</label>
+                    <div class="layui-input-block">
+                        <input code="text" class="layui-input" name="affectedRows" id="q_affected_rows" value="">
+                    </div>
+                </div>
+                <div class="layui-inline">
+                    <label class="layui-form-label">SQL类型</label>
+                    <div class="layui-input-block">
+                        <input code="text" class="layui-input"  name="commandType" id="q_commandType"  value=""/>
+                    </div>
+                </div>
+            </div>
+            <div class="layui-form-item">
+                <div class="layui-inline">
+                    <label class="layui-form-label">索引组</label>
+                    <div class="layui-input-block">
+                        <input code="text" class="layui-input" name="groupKeyNameName" id="data_group_name" value="">
+                    </div>
+                </div>
+                <div class="layui-inline">
+                    <label class="layui-form-label">索引键</label>
+                    <div class="layui-input-block">
+                        <input code="text" class="layui-input" name="groupKeyName" id="data_group_key" value="">
+                    </div>
+                </div>
+                <div class="layui-inline">
+                    <label class="layui-form-label">索引编号</label>
+                    <div class="layui-input-block">
+                        <input code="text" class="layui-input" name="dataId" id="data_id">
+                    </div>
+                </div>
+
+                <div class="layui-inline">
+                    <label class="layui-form-label">执行耗时</label>
+                    <div class="layui-input-block">
+                        <input code="text" class="layui-input" name="requestTime" id="q_request_time">
+                    </div>
+                </div>
+            </div>
+            <div class="layui-form-item">
+                <div class="layui-inline">
+                    <label class="layui-form-label">是否有效</label>
+                    <div class="layui-input-block">
+                        <select name="status" id="valid_status">
+                        </select>
+                    </div>
+                </div>
+            </div>
+            <!--            <div class="layui-col-xs6 layui-col-md12">-->
+            <!--                <label class="layui-form-label">请求关键字</label>-->
+            <!--                <div class="layui-input-block">-->
+            <!--                    <input code="text" class="layui-input" name="jsonContent" id="jsonContent" value=""-->
+            <!--                           alt="请搜索请求关键字">-->
+            <!--                </div>-->
+            <!--            </div>-->
+            <div class="layui-form-item">
+                <label class="layui-form-label">请求关键字</label>
+                <div class="layui-input-block">
+                    <input code="text" class="layui-input " name="jsonContent" id="jsonContent" value="" alt="请搜索请求关键字"
+                           style="width: 90%">
+                </div>
+            </div>
+            <div class="layui-form-item">
+                <div class="layui-col-xs6 layui-col-md12 " style="text-align: center">
+                    <a class="layui-btn" id="q_submit" lay-submit="" lay-filter="submit_from">查询</a>
+                    <button id="q_reset" code="reset" class="layui-btn layui-btn-primary">重置</button>
+                </div>
+            </div>
+            <!--<button class="layui-btn" lay-submit="" lay-filter="submit_from"><i class="layui-icon"></i>增加</button>-->
+        </form>
+    </div>
+    <table class="layui-table" id="list_table" lay-filter="list_table"></table>
+
+    <pre id="json-renderer"></pre>
+
+</div>
+
+<script code="text/html" id="toolbarDemo">
+
+</script>
+<script>
+    var _self = this;
+    var catUrl = '[(${catUrl})]';
+    var nextTree = function nextTree(logId) {
+        let date = $("#d_date").val();
+        var requestBody = {};
+        requestBody["date"] = date;
+        requestBody["parentLogId"] = logId;
+        requestBody["pageSize"] = 100;
+        elab_common.postReq(urlConfig.trace.sqlListService, requestBody, function (result) {
+            let resultSet = result.pageModel.resultSet;
+            if (resultSet) {
+                var jsonConfig = {collapsed: false, withQuotes: true, withLinks: true}
+                var resultJson = [];
+                $(resultSet).each(function (index, obj) {
+                    var data = {};
+                    data["应用名称"] = obj.applicationName;
+                    data["应用ip"] = obj.ip + "";
+                    data["日志"] = catUrl + obj.logId;
+                    data["执行状态"] = elab_common.getConfigTypeText("common_status", obj.status);
+                    data["创建时间"] = elab_common.longConvertDateTime(obj.createDate);
+                    data["请求时长"] = obj.requestTime;
+                    resultJson[index] = data;
+                });
+                showJson(resultJson, jsonConfig);
+            }
+        });
+    }
+
+    function showJson(obj, jsonConfig) {
+        if (jsonConfig == undefined) {
+            jsonConfig = {collapsed: false, withQuotes: true, withLinks: false};
+        }
+        $('#json-renderer').jsonViewer(obj, jsonConfig);
+        layer.open({
+            type: 1
+            , title: false //不显示标题栏
+            , closeBtn: false
+            , area: '800px;'
+            , shade: 0.8
+            , id: 'LAY_layuipro' //设定一个id,防止重复弹出
+            , btnAlign: 'c'
+            , shadeClose: true
+            , moveType: 1 //拖拽模式,0或者1
+            , content: $('#json-renderer').show()
+        });
+    }
+
+    layui.use(['laydate', 'layer', 'table', 'form', 'element'], function () {
+        var laydate = layui.laydate, layer = layui.layer, table = layui.table, form = layui.form;
+        var listUrl = urlConfig.trace.sqlListService;
+        var updateUrl = urlConfig.route.updateHtml;
+        var delUrl = "";
+        var addUrl = urlConfig.route.refreshHtml;
+        var method = "post";
+        var title = "路由列表";
+
+        // 构建数据
+        var dataColumn = [
+            {field: 'id', title: '主键', hide: true, sort: false}
+            ,
+            {
+                field: 'applicationName', title: '应用名称', width: 170
+            }
+            , {
+                field: 'ip', title: '应用服务器地址', width: 80
+            }
+            , {
+                field: 'sqlId', title: 'SQL编号'
+            }
+            , {
+                field: 'table', title: '表名'
+            }
+            , {
+                field: 'commandType', title: 'SQL命令类型'
+            }, {
+                field: 'sql', title: 'SQL内容'
+            }, {
+                field: 'affectedRows', title: '影响行数'
+            }, {
+                field: 'result', title: '结果内容'
+            }, {
+                field: 'groupName', title: '索引组名'
+            }, {
+                field: 'groupKeyName', title: '索引键'
+            }, {
+                field: 'dataId', title: '索引编号', width: 100
+            }, {
+                field: 'rootLogId', title: '链路顶层编号', hide: true, templet: function (res) {
+                    return '<em><a href="' + catUrl + res.rootLogId + '"  target="_blank" title="点击查看日志详情"><i class="layui-icon" style="font-size: 30px; color: #1E9FFF;">&#xe64c;</i></a></em>'
+                }
+            }, {
+                field: 'logId', title: '链路编号', rowspan: 2, width: 100, templet: function (res) {
+                    // var style = "style=\"color: blue;text-decoration: underline;\"";
+                    var style = "";
+                    return '<em><a href="' + catUrl + res.logId + '" target="_blank" ' + style + ' title="点击查看日志详情"><i class="layui-icon" style="font-size: 30px; color: #1E9FFF;">&#xe64c;</i></a></em>'
+                }
+            }, {
+                field: 'status', title: '是否有效', rowspan: 1, width: 80, templet: function (res) {
+                    var styleString = "style=\"color: red;\"";
+                    if (res.status == 1) {
+                        styleString = "style=\"color: #5fb878;\"";
+                    }
+                    return '<em ' + styleString + '>' + elab_common.getConfigTypeText("common_status", res.status) + '</em>'
+                }
+            }, {
+                field: 'requestTime', title: '执行耗时', rowspan: 1, width: 80, templet: function (res) {
+                    var styleString = "style=\"color: red;\"";
+                    if (res.requestTime < 500) {
+                        styleString = "style=\"color: #5fb878;\"";
+                    }
+                    return '<em ' + styleString + '>' + res.requestTime + '</em>'
+                }
+            }
+            , {
+                field: 'createDate', title: '创建时间', width: 160, templet: function (res) {
+                    return '<em>' + elab_common.longConvertDateTime(res.createDate) + '</em>'
+                }
+            }
+            , {
+                fixed: 'right', title: '操作', width: 100, templet: function (res) {
+                    return '<em><a className="layui-btn layui-btn-xs" lay-event="findDetail"><i class="layui-icon" style="font-size: 30px; color: #1E9FFF;">&#xe62a;</i></a></em>'
+                }
+            }
+        ];
+
+
+        elab_common.layUITableDML(layer, table, title, listUrl, method, dataColumn, updateUrl, delUrl);
+        table.on('tool(list_table)', function (obj) {
+            var event = obj.event;
+            debugger;
+            if ("findDetail" == event) {
+                // elab_common.getReq("/api/log/mq?id=" + obj.data.id, null, function (data) {
+                showJson(JSON.parse(obj.data.jsonContent));
+                // })
+            }
+        });
+
+        table.on('rowDouble(list_table)', function (obj) {
+            showJson(obj.data);
+        });
+
+        form.on('submit(submit_from)', function (data) {
+            //执行重载
+            table.reload('tableList', {
+                page: {
+                    curr: 1 //重新从第 1 页开始
+                }
+                , where: data.field
+
+            });
+            return false;
+        });
+
+        laydate.render({
+            elem: '#d_date'
+            , format: 'yyyy-MM-dd'
+            , isInitValue: true
+            , min: -7
+            , max: 0
+            , value: new Date()
+        });
+
+        init();
+
+        function init() {
+            elab_common.getConfigTypeBySelect("#mq_type", "mq_type", "");
+            elab_common.getConfigTypeBySelect("#valid_status", "common_status", "");
+            form.render('select');
+        }
+
+    });
+
+
+</script>
+<!--<script code="text/html" id="barDemo">-->
+<!--    <a className="layui-btn layui-btn-xs" lay-event="findDetail">消息内容</a>-->
+<!--</script>-->
+</body>
+
+</html>