mirror of
https://gitee.com/Donal/ofd.js.git
synced 2024-11-29 18:38:55 +08:00
输出各阶段的时间
This commit is contained in:
parent
51a1bae945
commit
72857cc74e
@ -294,13 +294,21 @@ export default {
|
||||
|
||||
getOfdDocumentObj(file, screenWidth) {
|
||||
let that = this;
|
||||
let t = new Date().getTime();
|
||||
parseOfdDocument({
|
||||
ofd: file,
|
||||
success(res) {
|
||||
let t1 = new Date().getTime();
|
||||
console.log('解析ofd',t1 - t);
|
||||
console.log(res);
|
||||
that.ofdObj = res;
|
||||
that.pageCount = res.pages.length;
|
||||
const divs = renderOfd(screenWidth, res);
|
||||
let t2 = new Date().getTime();
|
||||
console.log('xml转svg', t2 - t1)
|
||||
that.displayOfdDiv(divs);
|
||||
let t3 = new Date().getTime();
|
||||
console.log('svg渲染到页面', t3 - t2)
|
||||
},
|
||||
fail(error) {
|
||||
console.log(error)
|
||||
|
@ -61,6 +61,9 @@ export const renderOfd = function (screenWidth, ofd) {
|
||||
|
||||
export const renderOfdByScale = function (ofd) {
|
||||
let divArray = [];
|
||||
if (!ofd) {
|
||||
return divArray;
|
||||
}
|
||||
for (const page of ofd.pages) {
|
||||
let box = calPageBoxScale(ofd.document, page);
|
||||
const pageId = Object.keys(page)[0];
|
||||
|
Loading…
Reference in New Issue
Block a user