Browse Source

修改下载

DESKTOP-2K9OVK9\siwei 3 weeks ago
parent
commit
67c5b67b3b
2 changed files with 19 additions and 3 deletions
  1. 8 0
      src/api/supervise/pcsj.js
  2. 11 3
      src/views/remote/satellite/index.vue

+ 8 - 0
src/api/supervise/pcsj.js

@@ -21,6 +21,14 @@ export function listPcsj(query) {
   })
 }
 
+// 获取下载地址
+export function downloadPcsjUrl(id) {
+  return request({
+    url: '/apply/supervise/pcsj/download/url/'+ id,
+    method: 'get'
+  })
+}
+
 // 查询监管批次数据详细
 export function getPcsj(id) {
   return request({

+ 11 - 3
src/views/remote/satellite/index.vue

@@ -298,7 +298,7 @@
         :on-error="handleUploadError"
         :on-success="handleUploadSuccess"
         :on-change="handleChange"
-        :limit="20"
+        :limit="5"
         accept=".zip"
         :file-list="fileList"
         :show-file-list="true"
@@ -321,6 +321,7 @@ import {
   updatePcsj,
   tiffUpload,
   listDept,
+  downloadPcsjUrl,
 } from "@/api/supervise/pcsj";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@@ -487,8 +488,15 @@ export default {
       }
     },
     handleDownload(row) {
-      const zipfile = row.proxypath + ".zip";
-      window.open(`${zipfile}`);
+      downloadPcsjUrl(row.id).then((response) => {
+        const p_len = row.proxypath.indexOf("spotfile");
+        const p_str = row.proxypath.slice(0,p_len);
+        const p_url = process.env.VUE_APP_BASE_API + "/file/spot/download/shp/file/"+row.id+"/"+response.data;
+        const port = window.location.port || this.getDefaultPort();
+        const p_url_str  = window.location.protocol + "//"+window.location.hostname + ":"+port+ p_url;
+        console.log("url:",p_url_str)
+        window.open(`${p_url_str}`);
+      });
     },
     /** 查询监管批次数据列表 */
     getList() {