فهرست منبع

feat: 计量台账附件ui更新

lanjianrong 4 سال پیش
والد
کامیت
d5dc942a91
2فایلهای تغییر یافته به همراه19 افزوده شده و 5 حذف شده
  1. 17 3
      app/public/js/stage.js
  2. 2 2
      app/view/stage/index.ejs

+ 17 - 3
app/public/js/stage.js

@@ -115,7 +115,14 @@ function getAllList(currPageNum = 1) {
     let html = '';
     // '/tender/' + tender.id + '/measure/stage/' + stage.order + '/download/file/' + att.id
     for(const att of currPageAttData) {
-        html += `<tr><td width="25"><input type="checkbox" class="check-file" file-id=${att.id}></td><td><a href="javascript:void(0)" file-id=${att.id}>${att.filename}${att.fileext}</a></td><td width="50"><a href="/tender/${tender.id}/measure/stage/${stage.order}/download/file/${att.id}" class="att-file-btn">下载</a></td><td>${att.username}</td></td>`
+        html += `<tr>
+        <td width="25"><input type="checkbox" class="check-file" file-id=${att.id}></td>
+        <td>
+        <div class="d-flex">
+            <a href="javascript:void(0)" class="pl-0 col-11 att-file-name" file-id=${att.id}>${att.filename}${att.fileext}</a>
+            <a href="/tender/${tender.id}/measure/stage/${stage.order}/download/file/${att.id}" class="col-1 pl-0 att-file-btn"><i class="fa fa-download"></i></a>
+        </div>
+        </td><td>${att.username}</td></tr>`
     }
     $('#alllist-table').html(html);
     $('#alllist-table').on('click', 'tr', function() {
@@ -129,7 +136,14 @@ 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>';
-            html += `<tr><td width="25"><input type="checkbox" class="check-file" file-id=${att.id}></td><td><a href="javascript:void(0)" file-id=${att.id}>${att.filename}${att.fileext}</a></td><td width="50"><a href="/tender/${tender.id}/measure/stage/${stage.order}/download/file/${att.id}" class="att-file-btn">下载</a></td><td>${att.username}</td></td>`
+            html += `<tr>
+            <td width="25"><input type="checkbox" class="check-file" file-id=${att.id}></td>
+            <td>
+            <div class="d-flex">
+                <a href="javascript:void(0)" class="pl-0 col-11 att-file-name" file-id=${att.id}>${att.filename}${att.fileext}</a>
+                <a href="/tender/${tender.id}/measure/stage/${stage.order}/download/file/${att.id}" class="col-1 pl-0 att-file-btn"><i class="fa fa-download"></i></a>
+            </div>
+            </td><td>${att.username}</td></tr>`
         }
     }
     $('#nodelist-table').html(html);
@@ -3147,7 +3161,7 @@ $(document).ready(() => {
     });
 
     // 获取附件信息
-    $('body').on('click', '.list-table a', function () {
+    $('body').on('click', '.list-table a.att-file-name', function () {
         console.log($(this))
         const fid = $(this).attr('file-id');
         if ($('#showAttachment').attr('file-id') === fid && !$('#showAttachment').is(":hidden")) {

+ 2 - 2
app/view/stage/index.ejs

@@ -278,7 +278,7 @@
                             <div class="tab-pane active" id="dqjiedian">
                                 <div class="sjs-height-3" style="overflow:auto; overflow-x:hidden;">
                                     <table class="table table-sm table-bordered table-hover" style="word-break:break-all; table-layout: fixed">
-                                        <tr><th width="25"><input type="checkbox" class="check-all-file"><th>文件名</th><th width="50">下载</th><th width="80">上传</th></tr>
+                                        <tr><th width="25"><input type="checkbox" class="check-all-file"><th>文件名</th><th width="80">上传</th></tr>
                                         <tbody id="nodelist-table" class="list-table">
                                         </tbody>
                                     </table>
@@ -287,7 +287,7 @@
                             <div class="tab-pane" id="syfujian">
                                 <div class="sjs-height-3" style="overflow:auto; overflow-x:hidden;">
                                     <table class="table table-sm table-bordered table-hover" style="word-break:break-all; table-layout: fixed">
-                                        <tr><th width="25"><input type="checkbox" class="check-all-file"></th><th>文件名</th><th width="50">下载</th><th width="80">上传</th></tr>
+                                        <tr><th width="25"><input type="checkbox" class="check-all-file"></th><th>文件名</th><th width="80">上传</th></tr>
                                         <tbody id="alllist-table" class="list-table">
                                         </tbody>
                                     </table>