Hu Jie 7 年之前
父節點
當前提交
06ba0545ad

+ 16 - 3
src/main/java/com/uas/platform/b2b/manage/model/Listen.java

@@ -1,5 +1,7 @@
 package com.uas.platform.b2b.manage.model;
 
+import com.uas.platform.b2b.manage.core.util.StringUtils;
+
 import javax.persistence.*;
 import java.util.Date;
 
@@ -18,17 +20,28 @@ public class Listen {
     private Long id;
 
     @Column(name = "mac_address")
-    String macAddress;
+    private String macAddress;
 
     @Column(name = "name", length = 2000)
-    String name;
+    private String name;
 
     @Column(name = "date")
-    Date date;
+    private Date date;
+
+    @Column(name = "description")
+    private String description;
 
     @Transient
     String status;
 
+    public String getDescription() {
+        return StringUtils.isEmpty(description) ? "" : description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
     public String getMacAddress() {
         return macAddress;
     }

+ 7 - 1
src/main/webapp/WEB-INF/views/normal/listen.html

@@ -27,6 +27,12 @@
 </head>
 <body>
 <style>
+    .line-limit-length {
+        max-width: 110px;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+    }
     #loadingDiv {
         position: absolute;
         left: 0;
@@ -89,7 +95,7 @@
     </div>
     <div class="search">
         <div class="search-title" style="float: right">
-            <input id="enterprise-total" style="width: 100px; border:0;outline:0;background: #F7F7F8" readonly>
+            <input id="listen-total" style="width: 100px; border:0;outline:0;background: #F7F7F8" readonly>
         </div>
         <div class="input-group">
             <input type="text" id="keyword" class="form-control" placeholder="请输入名称"><span class="input-group-addon" id="p_search">搜索</span>

+ 18 - 2
src/main/webapp/resources/js/common/listen.js

@@ -41,6 +41,11 @@ function getlistenList(count, page, keyword) {
             for (var i = 0; i < listenList.length; i++) {
                 var trow = getDataRow(listenList[i], i); //定义一个方法,返回tr数据
                 tbody.appendChild(trow);
+                // (function(i) {
+                //     $("#name_detal" + listenList[i].id ).click(function () {
+                //         getDetail(logList[i].detail, logList[i].enName);
+                //     });
+                // })(i);
             }
 
             // 点击搜索
@@ -81,6 +86,10 @@ function getlistenList(count, page, keyword) {
     })
 }
 
+$('#outer').mouseenter(function() {
+    $('#log').append('<div>Handler for .mouseenter() called.</div>');
+});
+
 /**
  * 建立表格数据
  *
@@ -104,8 +113,12 @@ function getDataRow(listen, i) {
     row.appendChild(macAddressCell);
 
 
-    var nameCell = document.createElement('td'); //name
-    nameCell.setAttribute("class", "text-center");
+    var nameCell = document.createElement('td'); //name line-limit-length
+    nameCell.setAttribute("class", "text-center line-limit-length");
+    //nameCell.setAttribute("class", "line-limit-length");
+    nameCell.setAttribute("data-toggle", "tooltip");
+    nameCell.setAttribute("data-placement", "right");
+    nameCell.setAttribute("title", listen.name);
     nameCell.innerHTML = highLightKeywords(listen.name, keyword, null); //填充数据
     row.appendChild(nameCell);
 
@@ -120,6 +133,9 @@ function getDataRow(listen, i) {
 
     var statusCell = document.createElement('td'); //状态
     statusCell.setAttribute("class", "text-center");
+    statusCell.setAttribute("data-toggle", "tooltip");
+    statusCell.setAttribute("data-placement", "right");
+    statusCell.setAttribute("title", listen.description);
     statusCell.innerHTML = highLightKeywords(listen.status, "异常", null); //填充数据
     row.appendChild(statusCell);