Browse Source

排序调整

Hu Jie 7 years ago
parent
commit
cdeeb8a016

+ 1 - 1
src/main/java/com/uas/platform/b2b/manage/controller/ListenController.java

@@ -35,7 +35,7 @@ public class ListenController extends BaseController {
     @RequestMapping("/list")
     public PageResultBean<Listen> findAll(PageParams params, String keyword) {
         PageInfo info = new PageInfo(params);
-        Sort sort = new Sort(Sort.Direction.ASC, "date");
+        Sort sort = new Sort(Sort.Direction.ASC, "status");
         info.setSort(sort);
         if (!StringUtils.isEmpty(keyword)) {
             keyword = keyword.trim();

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

@@ -31,8 +31,8 @@ public class Listen {
     @Column(name = "description")
     private String description;
 
-    @Transient
-    String status;
+    @Column(name = "status")
+    private String status;
 
     public String getDescription() {
         return StringUtils.isEmpty(description) ? "" : description;
@@ -77,10 +77,10 @@ public class Listen {
     public String getStatus() {
         Date now = new Date();
         int minutes = (int) ((now.getTime() - getDate().getTime()) / (1000 * 60));
-        if (minutes > 20) {
+        if (minutes > 30) {
             return status = "异常";
         } else {
-            return status = "正常";
+            return status;
         }
     }
 

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

@@ -109,9 +109,9 @@
         <thead id="listen-head">
         <th class="text-center" width="50">序号</th>
         <th class="text-center" width="80">macAddress</th>
-        <th class="text-center" width="300">轮询名称</th>
-        <th class="text-center" width="200">活跃时间</th>
-        <th class="text-center" width="80">状态</th>
+        <th class="text-center" width="250">轮询名称</th>
+        <th class="text-center" width="150">活跃时间</th>
+        <th class="text-center" width="100">状态</th>
         </thead>
         <tbody id="listen-body">
         </tbody>

+ 6 - 1
src/main/webapp/resources/js/common/listen.js

@@ -127,7 +127,12 @@ function getDataRow(listen, i) {
     statusCell.setAttribute("data-toggle", "tooltip");
     statusCell.setAttribute("data-placement", "right");
     statusCell.setAttribute("title", listen.description);
-    statusCell.innerHTML = highLightKeywords(listen.status, "异常", null); //填充数据
+    if ("异常" == listen.status) {
+        statusCell.innerHTML = highLightKeywords(listen.status, listen.status, null); //填充数据
+    } else {
+        statusCell.innerHTML = highLightKeywords(listen.status, "异常", null);
+
+    }
     row.appendChild(statusCell);
 
     return row;