瀏覽代碼

附件下载调整,表格行高调整

qymljy 1 年之前
父節點
當前提交
efc77dce3d

+ 18 - 2
src/HDrpManagement/prodectFileData/modules/edit.vue

@@ -176,9 +176,25 @@ export default {
     },
     //下载
     downLoad(item) {
+      console.log(item,'下载')
       this.$emit('updateDownLoadRecord',item)
-      window.open(item.url,'_self')
-    }
+      // this.$emit('updateDownLoadRecord',item)
+      // window.open(item.url,'_self')
+      this.downFile(item.url,item.document)
+    },
+    downFile(url, fileName) {
+      const x = new XMLHttpRequest();
+      x.open("GET", url, true);
+      x.responseType = "blob";
+      x.onload = function () {
+        const url = window.URL.createObjectURL(x.response);
+        const a = document.createElement("a");
+        a.href = url;
+        a.download = fileName;
+        a.click();
+      };
+      x.send();
+    },
   }
 }
 </script>

+ 23 - 1
src/SDrpManagement/ProductGroup/modules/GroupDetail/groupDetail.vue

@@ -254,7 +254,7 @@
           <p>{{ $t("相关链接") }}:&emsp;</p>
           <div>
             <div v-for="item in selectProduct.technicalinfo" :key="item.index">
-              <a class="file-link" :href="item.url">{{ item.document }}</a>
+              <el-button type="text" size="mini" @click="downFile(item.url,item.document)">{{item.document}}</el-button>
             </div>
           </div>
         </div>
@@ -425,6 +425,28 @@ export default {
       });
       this.tool.showMessage(res);
     },
+    downloadFile(fileUrl,fileName) {
+      console.log('执行2221;超链接点击')
+      const element = document.createElement('a');
+      element.href = fileUrl;
+      element.download = fileName;
+      element.click();
+      // 如果浏览器支持取消阻止默认事件,防止表单提交等意外情况
+      element.removeEventListener('click', this.downloadFile);
+    },
+    downFile(url, fileName) {
+      const x = new XMLHttpRequest();
+      x.open("GET", url, true);
+      x.responseType = "blob";
+      x.onload = function () {
+        const url = window.URL.createObjectURL(x.response);
+        const a = document.createElement("a");
+        a.href = url;
+        a.download = fileName;
+        a.click();
+      };
+      x.send();
+    },
   },
 };
 </script>

+ 2 - 2
src/SDrpManagement/QuotedPrice/detail/modules/itemClass/add.vue

@@ -16,7 +16,7 @@
       direction="rtl"
       @close="onColes"
     >
-      <div class="drawer__panel">
+      <div class="drawer__panel" style="margin-bottom: 0 !important;">
         <div class="flex-between" style="margin-bottom: 10px">
           <uploadAllData
             style="display: inline-block !important"
@@ -48,7 +48,7 @@
         <div class="produtMag-panel">
           <el-table
             ref="multipleTable"
-            height="calc(100vh - 370px)"
+            height="calc(100vh - 230px)"
             :data="list"
             style="width: 100%"
             :header-cell-style="{