提交 3991d291 authored 作者: 钟是志's avatar 钟是志

打印功能调整

上级 01b2c780
...@@ -43,6 +43,10 @@ export function getLodop(dir, oOBJECT, oEMBED) { ...@@ -43,6 +43,10 @@ export function getLodop(dir, oOBJECT, oEMBED) {
basePath = getContextOrPath(false); basePath = getContextOrPath(false);
} }
var path = window.location.origin + '/zyd/'; var path = window.location.origin + '/zyd/';
if(window.location.origin.indexOf('localhost') > -1){
path = window.location.origin + '/';
}
console.log(path);
var strHtmInstall = '<br><font color=\'#FF00FF\'>打印控件未安装!点击这里<a href=\'' + path + 'CLodop_32_Print.zip\' target=\'_self\'>执行安装</a>,安装后请刷新页面或重新进入。</font>'; var strHtmInstall = '<br><font color=\'#FF00FF\'>打印控件未安装!点击这里<a href=\'' + path + 'CLodop_32_Print.zip\' target=\'_self\'>执行安装</a>,安装后请刷新页面或重新进入。</font>';
var strHtmUpdate = '<br><font color=\'#FF00FF\'>打印控件需要升级!点击这里<a href=\'' + path + 'CLodop_32_Print.zip\' target=\'_self\'>执行升级</a>,升级后请重新进入。</font>'; var strHtmUpdate = '<br><font color=\'#FF00FF\'>打印控件需要升级!点击这里<a href=\'' + path + 'CLodop_32_Print.zip\' target=\'_self\'>执行升级</a>,升级后请重新进入。</font>';
var strHtm64_Install = '<br><font color=\'#FF00FF\'>打印控件未安装!点击这里<a href=\'' + path + 'CLodop_32_Print.zip\' target=\'_self\'>执行安装</a>,安装后请刷新页面或重新进入。</font>'; var strHtm64_Install = '<br><font color=\'#FF00FF\'>打印控件未安装!点击这里<a href=\'' + path + 'CLodop_32_Print.zip\' target=\'_self\'>执行安装</a>,安装后请刷新页面或重新进入。</font>';
......
...@@ -111,9 +111,7 @@ export default class ViewPrint extends Component { ...@@ -111,9 +111,7 @@ export default class ViewPrint extends Component {
LODOP.SET_PRINT_MODE('POS_BASEON_PAPER', true); LODOP.SET_PRINT_MODE('POS_BASEON_PAPER', true);
LODOP.SET_PRINT_PAGESIZE(printMeth, 0, 0, "A4"); LODOP.SET_PRINT_PAGESIZE(printMeth, 0, 0, "A4");
LODOP.ADD_PRINT_IMAGE(0, 0, "100%", "100%", strHTML); LODOP.ADD_PRINT_IMAGE(0, 0, "100%", "100%", strHTML);
LODOP.PREVIEW(); // 预览模式 LODOP.PRINT(); // 直接打印
// LODOPObj.PRINT(); // 直接打印
// LODOPObj.PRINT_SETUP();
}; };
printOneByOne = () => { printOneByOne = () => {
...@@ -220,14 +218,14 @@ export default class ViewPrint extends Component { ...@@ -220,14 +218,14 @@ export default class ViewPrint extends Component {
style={{ style={{
...imageStyle, ...imageStyle,
}}> }}>
<img {/* <img
src={backgroundUrl} src={backgroundUrl}
draggable={false} draggable={false}
className={styles.bgimagePrint} className={styles.bgimagePrint}
alt={'背景图'} alt={'背景图'}
style={imageStyleAll} style={imageStyleAll}
/> />*/}
{/* {this.detailDom(info)}*/} {this.detailDom(info)}
</div> </div>
); );
})} })}
...@@ -239,7 +237,7 @@ export default class ViewPrint extends Component { ...@@ -239,7 +237,7 @@ export default class ViewPrint extends Component {
<div <div
ref={(node) => (this.content = node)} ref={(node) => (this.content = node)}
style={{ style={{
display: showWindowPrint || true ? 'block' : 'none', display: showWindowPrint ? 'block' : 'none',
}}> }}>
{viewData.map((info, index) => { {viewData.map((info, index) => {
return ( return (
...@@ -254,7 +252,7 @@ export default class ViewPrint extends Component { ...@@ -254,7 +252,7 @@ export default class ViewPrint extends Component {
// border: '1px solid red', // border: '1px solid red',
...imageStyle, ...imageStyle,
}}> }}>
{ hasPrintBackground || printBg ? ( { hasPrintBackground && false ? (
<img <img
src={backgroundUrl} src={backgroundUrl}
draggable={false} draggable={false}
...@@ -266,7 +264,7 @@ export default class ViewPrint extends Component { ...@@ -266,7 +264,7 @@ export default class ViewPrint extends Component {
}} }}
/> />
) : null} ) : null}
{/* {this.detailDom(info)}*/} {this.detailDom(info)}
</div> </div>
</div> </div>
); );
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论