Skip to content

Commit e920365

Browse files
committed
update
1 parent 8836312 commit e920365

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

dist/index.common.js

Lines changed: 9 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,17 +102,19 @@
102102
var doc = new _jspdf["default"]({
103103
putOnlyUsedFonts: true,
104104
orientation: 'landscape'
105-
});
105+
}); // 设置字体
106106

107107
if (fontName && fontUrl) {
108108
doc.addFont(fontName + '.ttf', fontName, 'normal');
109109
doc.setFont(fontName, 'normal');
110-
}
110+
} // 转换数据
111+
111112

112113
doc.table(1, 1, rowList.concat(footList), headers, {
113114
printHeaders: isHeader,
114115
autoSize: false
115-
});
116+
}); // 导出 pdf
117+
116118
doc.save("".concat(filename, ".").concat(type));
117119

118120
if (showMsg) {
@@ -132,12 +134,11 @@
132134
status: 'loading',
133135
duration: -1
134136
});
135-
} // 转换pdf
136-
137+
}
137138

138139
checkFont().then(function () {
139140
if (showMsg) {
140-
setTimeout(exportMethod, 1000);
141+
setTimeout(exportMethod, 1500);
141142
} else {
142143
exportMethod();
143144
}
@@ -162,9 +163,7 @@
162163
}
163164
}
164165

165-
return new Promise(function (resolve) {
166-
return setTimeout(resolve, 1000);
167-
});
166+
return Promise.resolve();
168167
}
169168

170169
function handleExportEvent(params) {

dist/index.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,14 @@ function exportPDF (params: InterceptorExportParams) {
6969
const exportMethod = () => {
7070
/* eslint-disable new-cap */
7171
const doc = new jsPDF({ putOnlyUsedFonts: true, orientation: 'landscape' })
72+
// 设置字体
7273
if (fontName && fontUrl) {
7374
doc.addFont(fontName + '.ttf', fontName, 'normal')
7475
doc.setFont(fontName, 'normal')
7576
}
77+
// 转换数据
7678
doc.table(1, 1, rowList.concat(footList), headers, { printHeaders: isHeader, autoSize: false })
79+
// 导出 pdf
7780
doc.save(`${filename}.${type}`)
7881
if (showMsg) {
7982
_vxetable.modal.close(msgKey)
@@ -83,10 +86,9 @@ function exportPDF (params: InterceptorExportParams) {
8386
if (showMsg) {
8487
_vxetable.modal.message({ id: msgKey, message: _vxetable.t('vxe.table.expLoading'), status: 'loading', duration: -1 })
8588
}
86-
// 转换pdf
8789
checkFont().then(() => {
8890
if (showMsg) {
89-
setTimeout(exportMethod, 1000)
91+
setTimeout(exportMethod, 1500)
9092
} else {
9193
exportMethod()
9294
}
@@ -108,7 +110,7 @@ function checkFont () {
108110
return globalFonts[fontName]
109111
}
110112
}
111-
return new Promise(resolve => setTimeout(resolve, 1000))
113+
return Promise.resolve()
112114
}
113115

114116
function handleExportEvent (params: InterceptorExportParams) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vxe-table-plugin-export-pdf",
3-
"version": "1.4.2",
3+
"version": "1.5.0",
44
"description": "基于 vxe-table 表格的增强插件,支持导出 pdf 格式",
55
"scripts": {
66
"lib": "gulp build"

0 commit comments

Comments
 (0)