Browse Source

pdf单文件预览下载

hanzhen 3 years ago
parent
commit
c0315f1905
1 changed files with 8 additions and 1 deletions
  1. 8 1
      src/main/resources/static/page/archive/show.html

+ 8 - 1
src/main/resources/static/page/archive/show.html

@@ -99,6 +99,10 @@
                         <th width="40px">备注:</th>
                         <td colspan="3" id="remarks"></td>
                     </tr>
+                    <tr>
+                        <th width="40px">下载:</th>
+                        <td colspan="3" id="uploadFile"></td>
+                    </tr>
                 </table>
             </div>
         </div>
@@ -154,11 +158,14 @@
                         return
                     }
                     if (res.data.length == 1) {
+                        let obj = res.data[0]
                         $("#files").removeClass();
                         $("#files").addClass("layui-col-md0");
                         $("#files").hide();
                         $("#pdf_yl").removeClass();
                         $("#pdf_yl").addClass("layui-col-md12");
+                        let uploadPdf = '<a style="text-align: right;" download="'+obj.fileName+'" href="'+'http://66.1.21.158:9091/' + obj.filePath +'/'+ obj.fileName+ '">预览</a>';
+                        $("#uploadFile").html(uploadPdf);
                     }
                     for (let i = 0; i < res.data.length; i++) {
                         let item = res.data[i]
@@ -184,7 +191,7 @@
             http.get('archive/archive/selectByPrimaryKeyText', {
                 id: archive_id
             }, false, res => {
-                console.log(res)
+                console.log(1111111111111,res)
                 if (res.code == 200) {
                     $("#dh").text(res.data.dh ? res.data.dh : '无');
                     $("#tm").text(res.data.tm ? res.data.tm : '无');