|
|
@ -89,7 +89,8 @@ export class OneKeyPrint implements Command
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
win.document.body.innerText = "正在生成图纸,请稍等...";
|
|
|
|
win.document.title = "按Ctrl+P打印";
|
|
|
|
|
|
|
|
win.document.body.innerText = "生成后请按Ctrl+P打印,正在生成图纸,请稍等...";
|
|
|
|
const frag = document.createDocumentFragment();
|
|
|
|
const frag = document.createDocumentFragment();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -101,14 +102,27 @@ export class OneKeyPrint implements Command
|
|
|
|
app.Viewer.CameraCtrl.WriteFile(f);
|
|
|
|
app.Viewer.CameraCtrl.WriteFile(f);
|
|
|
|
let vpsbak = app.Viewer.ViewPorts;
|
|
|
|
let vpsbak = app.Viewer.ViewPorts;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let i = 1;
|
|
|
|
|
|
|
|
let count = framesGrounps.size;
|
|
|
|
for (let [, { entitys }] of framesGrounps)
|
|
|
|
for (let [, { entitys }] of framesGrounps)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let div = await GetImgElement(entitys, false);
|
|
|
|
let div = await GetImgElement(entitys, false);
|
|
|
|
frag.append(div);
|
|
|
|
frag.append(div);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
win.document.body.innerText = `生成后请按Ctrl+P打印,正在生成图纸(${i}/${count}),请稍等...`;
|
|
|
|
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
win.document.body.innerText = "";
|
|
|
|
win.document.body.innerText = "";
|
|
|
|
win.document.body.append(frag);
|
|
|
|
win.document.body.append(frag);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// setTimeout(() =>
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// // chrome90如果自动调用这个,那么卡死
|
|
|
|
|
|
|
|
// // win.focus();
|
|
|
|
|
|
|
|
// // win.print();
|
|
|
|
|
|
|
|
// // win.close();
|
|
|
|
|
|
|
|
// }, 100);
|
|
|
|
|
|
|
|
|
|
|
|
//还原视图
|
|
|
|
//还原视图
|
|
|
|
[app.Viewer.Scene, sceneBak] = [sceneBak, app.Viewer.Scene];
|
|
|
|
[app.Viewer.Scene, sceneBak] = [sceneBak, app.Viewer.Scene];
|
|
|
|
app.Viewer.Renderer.setClearColor(clearColorBak);
|
|
|
|
app.Viewer.Renderer.setClearColor(clearColorBak);
|
|
|
|