提交 112d4c3d authored 作者: CRS's avatar CRS

合并分支 'crs' 到 'master'

new 查看合并请求 !125
...@@ -888,7 +888,8 @@ export default { ...@@ -888,7 +888,8 @@ export default {
query: { query: {
username: this.$route.query.username, username: this.$route.query.username,
id: this.$route.query.id, id: this.$route.query.id,
popp: this.popp.basic popp: this.popp.basic,
agree: this.isAgree
} }
}); });
window.open(href, '_blank'); window.open(href, '_blank');
......
// 导出页面为PDF格式 // 导出页面为PDF格式
import Vue from 'vue'
let v = new Vue();
import html2Canvas from 'html2canvas' import html2Canvas from 'html2canvas'
import JsPDF from 'jspdf' import JsPDF from 'jspdf'
export default { import {
Loading
} from 'element-ui'
let loading;
export default{
install (Vue, options) { install (Vue, options) {
Vue.prototype.getPdf = function () { Vue.prototype.getPdf = function () {
loading = Loading.service({
lock: true,
text: '正在下载pdf...',
background: 'rgba(0,0,0,.5)'
});
let title = this.htmlTitle let title = this.htmlTitle
v.$message.info('正在生成pdf文件!请稍等')
html2Canvas(document.querySelector('#pdfDom'), { html2Canvas(document.querySelector('#pdfDom'), {
allowTaint: true allowTaint: true
}).then(function (canvas) { }).then(function (canvas) {
...@@ -32,6 +38,7 @@ export default { ...@@ -32,6 +38,7 @@ export default {
} }
} }
} }
loading.close();
PDF.save(title + '.pdf') PDF.save(title + '.pdf')
}) })
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论