|
@@ -48,6 +48,7 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
|
|
+import axios from 'axios';
|
|
import banner from "@/components/banner";
|
|
import banner from "@/components/banner";
|
|
export default {
|
|
export default {
|
|
name: "profile",
|
|
name: "profile",
|
|
@@ -63,6 +64,19 @@ export default {
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ downloadPdfone(pdfUrl, title) {
|
|
|
|
+ axios(pdfUrl, {
|
|
|
|
+ responseType: "blob" // 重要代码
|
|
|
|
+ }).then(res => {
|
|
|
|
+ const url = window.URL.createObjectURL(new Blob([res.data]));
|
|
|
|
+ const link = document.createElement("a");
|
|
|
|
+ link.href = url;
|
|
|
|
+ let fileName = title + ".pdf";
|
|
|
|
+ link.setAttribute("download", fileName);
|
|
|
|
+ document.body.appendChild(link);
|
|
|
|
+ link.click();
|
|
|
|
+ })
|
|
|
|
+ },
|
|
tapProfile(item) {
|
|
tapProfile(item) {
|
|
this.popShow = true;
|
|
this.popShow = true;
|
|
this.profile = item;
|
|
this.profile = item;
|
|
@@ -74,6 +88,9 @@ export default {
|
|
text: this.$t('Download.loading') + '...',
|
|
text: this.$t('Download.loading') + '...',
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
});
|
|
});
|
|
|
|
+ if (title == 'Sanyou Bispecific Reference Antibody Catalog') {
|
|
|
|
+ this.downloadPdfone(pdfUrl, title)
|
|
|
|
+ }
|
|
const xhr = new XMLHttpRequest();
|
|
const xhr = new XMLHttpRequest();
|
|
xhr.open('GET', pdfUrl, true);
|
|
xhr.open('GET', pdfUrl, true);
|
|
xhr.responseType = 'blob';
|
|
xhr.responseType = 'blob';
|