Browse Source

feat: 附件增加选中常亮样式

lanjianrong 5 years ago
parent
commit
82c38a8a01
1 changed files with 9 additions and 2 deletions
  1. 9 2
      app/public/js/stage.js

+ 9 - 2
app/public/js/stage.js

@@ -114,9 +114,13 @@ function getAllList(currPageNum = 1) {
     const currPageAttData = attData.slice((currPageNum-1)*pageCount, currPageNum*pageCount);
     let html = '';
     for(const att of currPageAttData) {
-        html += '<tr><td><a href="javascript:void(0)" file-id="'+ att.id +'">'+ att.filename + att.fileext +'</a></td><td>'+ att.username +'</td></tr>';
+        html += '<tr ><td><a href="javascript:void(0)" file-id="'+ att.id +'">'+ att.filename + att.fileext +'</a></td><td>'+ att.username +'</td></tr>';
     }
     $('#alllist-table').html(html);
+    $('#alllist-table').on('click', 'tr', function() {
+        $('#alllist-table tr').removeClass('bg-light')
+        $(this).addClass('bg-light')
+    })
 }
 // 生成当前节点列表
 function getNodeList(node) {
@@ -124,10 +128,13 @@ function getNodeList(node) {
     for(const att of attData) {
         if (node === att.lid) {
             html += '<tr><td><a href="javascript:void(0)" file-id="'+ att.id +'">'+ att.filename + att.fileext +'</a></td><td>'+ att.username +'</td></tr>';
-
         }
     }
     $('#nodelist-table').html(html);
+    $('#nodelist-table').on('click', 'tr', function() {
+        $('#nodelist-table tr').removeClass('bg-light')
+        $(this).addClass('bg-light')
+    })
 }
 
 $(document).ready(() => {