提交 1b98a669 authored 作者: 钟是志's avatar 钟是志

打印相关功能调整

上级 350b2000
...@@ -123,6 +123,7 @@ export function getLodop(dir, oOBJECT, oEMBED) { ...@@ -123,6 +123,7 @@ export function getLodop(dir, oOBJECT, oEMBED) {
//===如下空白位置适合调用统一功能(如注册语句、语言选择等):=== //===如下空白位置适合调用统一功能(如注册语句、语言选择等):===
LODOP.SET_SHOW_MODE('LANGUAGE', 0); LODOP.SET_SHOW_MODE('LANGUAGE', 0);
LODOP.SET_LICENSES('成都市知用科技有限公司', '649677881727389907689190562356', '', ''); LODOP.SET_LICENSES('成都市知用科技有限公司', '649677881727389907689190562356', '', '');
console.log('licenses注入语句已执行');
//=========================================================== //===========================================================
return LODOP; return LODOP;
} catch (err) { } catch (err) {
......
...@@ -2,8 +2,8 @@ import { message } from 'antd'; ...@@ -2,8 +2,8 @@ import { message } from 'antd';
import { ModalConfirm, ModalInfo } from '@/baseComponent/Modal'; import { ModalConfirm, ModalInfo } from '@/baseComponent/Modal';
import * as lo from './LodopFuncs'; import * as lo from './LodopFuncs';
export const A4Height = '29.6cm'; export const A4Height = '28.7cm';
export const A4Width = '20.9cm'; export const A4Width = '19.8cm';
export const imageStyleAll = { export const imageStyleAll = {
width: '100%', width: '100%',
// height: '100%', // height: '100%',
...@@ -28,8 +28,6 @@ export function getCLodopFuncJS() { ...@@ -28,8 +28,6 @@ export function getCLodopFuncJS() {
} }
document.querySelector('body').appendChild(sc); document.querySelector('body').appendChild(sc);
sc.onload = function() { sc.onload = function() {
console.log(window.LODOP);
// getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
resolve(true); resolve(true);
console.log('打印插件加载成功'); console.log('打印插件加载成功');
}; };
...@@ -101,3 +99,22 @@ export const styleCount = (config) => { ...@@ -101,3 +99,22 @@ export const styleCount = (config) => {
}; };
return style; return style;
}; };
export const templateCode = [
{
path: '/xg/xg_hard/SearchAndPrint/printReview',
code: 'award',
name: '评奖评优奖状',
},
{
path: '/xg/student_affairs/replace/printStudentCard',
code: 'reissueStudentCard',
name: '学生证补办打印',
},
{
path: '/xg/stundents_record/printStudentCard',
code: 'studentCard',
name: '学生信息-学生证打印',
},
];
import React, { Component, Fragment } from 'react'; import React from 'react';
import { queryConfig } from '../services'; import ViewPrint from './index2';
import { getInfo } from '@/highOrderComponent/Service';
import { message, Button } from 'antd';
import Shell from '@/baseComponent/Shell';
import ReactToPrint from 'react-to-print';
import ButtonDiy from '@/baseComponent/ButtonDiy';
import router from 'umi/router';
import styles from '../index.less';
import DetailDom from './DetailDom';
import { imageStyleAll, A4Width, A4Height } from './config';
export default class ViewPrint extends Component {
constructor(props) {
super(props);
this.state = {
configAll: null,
viewData: null,
loading: false,
minHeight: 0,
showWindowPrint: false,
};
this.getConfigInfo = queryConfig.bind(this);
}
countImageHeight = () => {
if (!this.state.configAll) {
return false;
}
const {
configAll: { backgroundUrl },
} = this.state;
const img = new Image();
img.src = backgroundUrl;
img.onload = () => {
this.setState({
minHeight: img.height,
});
};
};
getViewData = () => {
const { selectedRows } = this.props;
const ids = selectedRows.map((x) => x.id);
this.getConfigInfo().then((x) => {
this.countImageHeight();
if (x && x.queryUrl) {
getInfo(
{
ids: ids.join(','),
},
x.queryUrl,
).then((viewData) => {
if (!viewData || !viewData.length) {
message.warning('未查询到可打印的奖状数据');
console.error(`${x.queryUrl}接口报错或者没有返回数据`);
return false;
}
for (let item of viewData) {
for (let x in item) {
if (item[x] === null || item[x] === 'null') {
item[x] = '';
}
}
}
this.setState({
viewData,
});
});
}
});
};
beforePrint = () => {
console.log('beforePrint');
};
afterPrint = () => {
console.log('afterPrint');
};
componentDidMount() {
this.getViewData();
}
detailDom = (data) => {
const {
configAll: { config },
} = this.state;
const res = [];
for (const item of config) {
res.push(
DetailDom({
config: item,
data: data[item.fieldCode],
}),
);
}
return res;
};
onBeforeGetContent = () => {
this.setState({
loading: true,
});
return new Promise((resolve, reject) => {
const { selectedRows } = this.props;
const { configAll } = this.state;
const ids = selectedRows.map((x) => {
return x.id;
});
if (configAll.callUrl && false) {
// 暂时关闭调用这个接口 不通知后台是否打印了
getInfo({ ids: ids.join(',') }, configAll.callUrl).then((x) => {
if (x) {
this.setState({ showWindowPrint: true }, () => {
resolve(true);
});
} else {
resolve(true);
}
});
} else {
this.setState({ showWindowPrint: true }, () => {
resolve(true);
});
}
});
};
export default class Index extends React.Component {
render() { render() {
const {
loading,
configAll,
viewData,
showWindowPrint,
minHeight,
} = this.state;
if (!viewData || !minHeight) {
return null;
}
if (!configAll.backgroundUrl) {
console.error('没有设置模版图片无法使用');
return null;
}
const { hasPrintBackground, backgroundUrl, wide, high } = configAll;
const imageStyle = {
height: `${high}cm` || A4Height,
width: `${wide}cm` || A4Width,
};
return ( return (
<Fragment> <ViewPrint {...this.props}/>
<Shell styleShell={{ marginTop: '0', marginBottom: '20px' }}>
<div style={{ height: '54px', padding: '12px 0 12px 12px' }}>
<ReactToPrint
trigger={() => (
<Button
shape="round"
type="primary"
loading={loading}
style={{ marginRight: '20px' }}>
打印
</Button>
)}
content={() => this.content}
onBeforeGetContent={this.onBeforeGetContent}
onAfterPrint={() => {
this.setState({
showWindowPrint: false,
loading: false,
});
}}
/>
<ButtonDiy
name={'返回'}
handleClick={() => {
router.goBack();
}}
/>
</div>
</Shell>
{/** 预览的dom **/}
{viewData && viewData.length ? (
<div>
{viewData.map((info, index) => {
return (
<div
className={styles.outSideDivPrint}
key={index + 'divKey'}
style={{
...imageStyle,
}}>
<img
src={backgroundUrl}
draggable={false}
className={styles.bgimagePrint}
alt={'背景图'}
style={imageStyleAll}
/>
{this.detailDom(info)}
</div>
);
})}
</div>
) : null}
{/** 打印的dom */}
{viewData && viewData.length ? (
<div
ref={(node) => (this.content = node)}
style={{
display: showWindowPrint /*|| true*/ ? 'block' : 'none',
}}>
{viewData.map((info, index) => {
return (
<div
className={styles.outSideDivPrint}
key={`${index}divKey`}
style={{
...imageStyle,
}}>
{hasPrintBackground ? (
<img
src={backgroundUrl}
draggable={false}
className={styles.bgimagePrint}
alt={'背景图'}
style={imageStyleAll}
/>
) : null}
{this.detailDom(info)}
</div>
);
})}
</div>
) : null}
</Fragment>
); );
} }
} }
// import React, { Component, Fragment } from 'react';
// import { queryConfig } from '../services';
// import { getInfo } from '@/highOrderComponent/Service';
// import { message, Button } from 'antd';
// import Shell from '@/baseComponent/Shell';
// import ReactToPrint from 'react-to-print';
// import ButtonDiy from '@/baseComponent/ButtonDiy';
// import router from 'umi/router';
// import styles from '../index.less';
// import DetailDom from './DetailDom';
// import { imageStyleAll, A4Width, A4Height } from './config';
//
// export default class ViewPrint extends Component {
// constructor(props) {
// super(props);
// this.state = {
// configAll: null,
// viewData: null,
// loading: false,
// minHeight: 0,
// showWindowPrint: false,
// };
// this.getConfigInfo = queryConfig.bind(this);
// }
//
// countImageHeight = () => {
// if (!this.state.configAll) {
// return false;
// }
// const {
// configAll: { backgroundUrl },
// } = this.state;
// const img = new Image();
// img.src = backgroundUrl;
// img.onload = () => {
// this.setState({
// minHeight: img.height,
// });
// };
// };
//
// getViewData = () => {
// const { selectedRows } = this.props;
// const ids = selectedRows.map((x) => x.id);
// this.getConfigInfo().then((x) => {
// this.countImageHeight();
// if (x && x.queryUrl) {
// getInfo(
// {
// ids: ids.join(','),
// },
// x.queryUrl,
// ).then((viewData) => {
// if (!viewData || !viewData.length) {
// message.warning('未查询到可打印的奖状数据');
// console.error(`${x.queryUrl}接口报错或者没有返回数据`);
// return false;
// }
// for (let item of viewData) {
// for (let x in item) {
// if (item[x] === null || item[x] === 'null') {
// item[x] = '';
// }
// }
// }
// this.setState({
// viewData,
// });
// });
// }
// });
// };
//
//
// beforePrint = () => {
// console.log('beforePrint');
// };
//
// afterPrint = () => {
// console.log('afterPrint');
// };
//
// componentDidMount() {
// this.getViewData();
// }
//
// detailDom = (data) => {
// const {
// configAll: { config },
// } = this.state;
// const res = [];
// for (const item of config) {
// res.push(
// DetailDom({
// config: item,
// data: data[item.fieldCode],
// }),
// );
// }
// return res;
// };
//
// onBeforeGetContent = () => {
// this.setState({
// loading: true,
// });
//
// return new Promise((resolve, reject) => {
// const { selectedRows } = this.props;
// const { configAll } = this.state;
// const ids = selectedRows.map((x) => {
// return x.id;
// });
// if (configAll.callUrl && false) {
// // 暂时关闭调用这个接口 不通知后台是否打印了
// getInfo({ ids: ids.join(',') }, configAll.callUrl).then((x) => {
// if (x) {
// this.setState({ showWindowPrint: true }, () => {
// resolve(true);
// });
// } else {
// resolve(true);
// }
// });
// } else {
// this.setState({ showWindowPrint: true }, () => {
// resolve(true);
// });
// }
// });
// };
//
// render() {
// const {
// loading,
// configAll,
// viewData,
// showWindowPrint,
// minHeight,
// } = this.state;
// if (!viewData || !minHeight) {
// return null;
// }
// if (!configAll.backgroundUrl) {
// console.error('没有设置模版图片无法使用');
// return null;
// }
// const { hasPrintBackground, backgroundUrl, wide, high } = configAll;
// const imageStyle = {
// height: `${high}cm` || A4Height,
// width: `${wide}cm` || A4Width,
// };
//
// return (
// <Fragment>
// <Shell styleShell={{ marginTop: '0', marginBottom: '20px' }}>
// <div style={{ height: '54px', padding: '12px 0 12px 12px' }}>
// <ReactToPrint
// trigger={() => (
// <Button
// shape="round"
// type="primary"
// loading={loading}
// style={{ marginRight: '20px' }}>
// 打印
// </Button>
// )}
// content={() => this.content}
// onBeforeGetContent={this.onBeforeGetContent}
// onAfterPrint={() => {
// this.setState({
// showWindowPrint: false,
// loading: false,
// });
// }}
// />
// <ButtonDiy
// name={'返回'}
// handleClick={() => {
// router.goBack();
// }}
// />
// </div>
// </Shell>
//
// {/** 预览的dom **/}
// {viewData && viewData.length ? (
// <div>
// {viewData.map((info, index) => {
// return (
// <div
// className={styles.outSideDivPrint}
// key={index + 'divKey'}
// style={{
// ...imageStyle,
// }}>
// <img
// src={backgroundUrl}
// draggable={false}
// className={styles.bgimagePrint}
// alt={'背景图'}
// style={imageStyleAll}
// />
// {this.detailDom(info)}
// </div>
// );
// })}
// </div>
// ) : null}
//
// {/** 打印的dom */}
// {viewData && viewData.length ? (
// <div
// ref={(node) => (this.content = node)}
// style={{
// display: showWindowPrint /*|| true*/ ? 'block' : 'none',
// }}>
// {viewData.map((info, index) => {
// return (
// <div
// className={styles.outSideDivPrint}
// key={`${index}divKey`}
// style={{
// ...imageStyle,
// }}>
// {hasPrintBackground ? (
// <img
// src={backgroundUrl}
// draggable={false}
// className={styles.bgimagePrint}
// alt={'背景图'}
// style={imageStyleAll}
// />
// ) : null}
//
// {this.detailDom(info)}
// </div>
// );
// })}
// </div>
// ) : null}
// </Fragment>
// );
// }
// }
...@@ -3,20 +3,15 @@ import { queryConfig } from '../services'; ...@@ -3,20 +3,15 @@ import { queryConfig } from '../services';
import { getInfo } from '@/highOrderComponent/Service'; import { getInfo } from '@/highOrderComponent/Service';
import { message, Button } from 'antd'; import { message, Button } from 'antd';
import Shell from '@/baseComponent/Shell'; import Shell from '@/baseComponent/Shell';
import ReactToPrint from 'react-to-print';
import ButtonDiy from '@/baseComponent/ButtonDiy'; import ButtonDiy from '@/baseComponent/ButtonDiy';
import router from 'umi/router'; import router from 'umi/router';
import styles from '../index.less';
import DetailDom from './DetailDom'; import DetailDom from './DetailDom';
import { imageStyleAll, A4Width, A4Height, getCLodopFuncJS } from './config'; import { A4Width, A4Height, getCLodopFuncJS, templateCode } from './config';
import RenderAuthorized from '@/components/Authorized'; import RenderAuthorized from '@/components/Authorized';
import { getAuthority } from '@/utils/authority'; import { getAuthority } from '@/utils/authority';
import { ModalInfo } from '@/baseComponent/Modal';
const Authorized = RenderAuthorized(getAuthority()); const Authorized = RenderAuthorized(getAuthority());
const { check } = Authorized;
import { ModalInfo } from '@/baseComponent/Modal';
import replace from '../../../../../config/zydxg/routes/studentAffairs/replace';
export default class ViewPrint extends Component { export default class ViewPrint extends Component {
constructor(props) { constructor(props) {
...@@ -47,10 +42,10 @@ export default class ViewPrint extends Component { ...@@ -47,10 +42,10 @@ export default class ViewPrint extends Component {
console.error(`${x.queryUrl}接口报错或者没有返回数据`); console.error(`${x.queryUrl}接口报错或者没有返回数据`);
return false; return false;
} }
// let i = 0; let i = 0;
for (const item of viewData) { for (const item of viewData) {
// item.name = ['黎处', '王昊楠', '古力娜扎', '古丽尼帕尔·阿布都黑利力'][i] || '钟是志'; // item.name = ['黎处', '王昊楠', '古力娜扎', '古丽尼帕尔·阿布都黑利力'][i] || '钟是志';
// i++; i++;
for (let z in item) { for (let z in item) {
if (item[z] === null || item[z] === 'null') { if (item[z] === null || item[z] === 'null') {
item[z] = ''; item[z] = '';
...@@ -96,72 +91,73 @@ export default class ViewPrint extends Component { ...@@ -96,72 +91,73 @@ export default class ViewPrint extends Component {
return res; return res;
}; };
printOne = () => { printOne = (review = false) => {
const { printIndex, configAll, viewData } = this.state; const { printIndex, configAll, viewData } = this.state;
const { printMeth } = configAll; const { printMeth } = configAll;
const { wide, high } = configAll; const { wide, high } = configAll;
const { LODOP } = window; const { LODOP } = window;
let strHTML = document.getElementById(`djfgkjdlfjg`).innerHTML; let strHTML = document.getElementById(`printDomId_${printIndex}`).innerHTML;
/*strHTML = strHTML.replace( if (review) {
'break-after: page;', strHTML = document.getElementById(`printDomId_0`).innerHTML;
'page-break-after: always;', }
); LODOP.PRINT_INITA(0, 0, `${wide}cm`, `${high}cm`, `printDomId_${printIndex}`);
strHTML = `${strHTML}`; LODOP.SET_PRINT_PAGESIZE(printMeth, `${wide}cm`, `${high}cm`, 'CreateCustomPage'); // 打印方向
strHTML = `<div style="
page-break-after: always;
background-color: red;
position: relative;
/!*background-image: url('http://zysoft.cdzhiyong.com:53003/dsf/u/upload/202006/05182802hzom.jpg');*!/
width: 29.6cm;
height: 21cm; "><div style="position: absolute;top: 10.5cm>123123
</div>
</div>`;
console.log(strHTML);*/
LODOP.PRINT_INITA(0, '-0.3cm', `100%`, `100%`, 'printDomId_' + printIndex);
// LODOP.SET_PRINT_MODE('POS_BASEON_PAPER', true);
// LODOP.SET_PRINT_STYLEA('All', 'VOrient', 2);
// LODOP.SET_PRINT_STYLEA('All', 'HOrient', 2);
LODOP.SET_PRINT_PAGESIZE(printMeth, 0, 0, 'A4'); // 纵向打印
//LODOP.SET_PRINT_PAGESIZE(1, 0, 0, 'A4'); // 纵向打印
LODOP.ADD_PRINT_HTM(0, 0, '100%', '100%', strHTML); // HTML 打印 LODOP.ADD_PRINT_HTM(0, 0, '100%', '100%', strHTML); // HTML 打印
// LODOP.ADD_PRINT_URL(0, 0, '100%', '100%', strHTML); // URL 打印 if (review) {
// LODOP.PRINT(); // 直接打印 LODOP.PREVIEW(); // 打印预览
// LODOP.PREVIEW(); // 打印预览 } else {
LODOPObj.PRINT_SETUP(); LODOP.PRINT(); // 打印
}
};
printPreview = () => {
// 打印预览
this.printOne(true);
};
printedDataSave = (index) => {
const { selectedRows } = this.props;
const { configAll } = this.state;
if (!selectedRows[index] || !selectedRows[index].id) {
console.error('printedDataSave 没有正确的id 无法保存打印信息到后台');
return false;
}
const ids = selectedRows[index].id;
getInfo({ ids }, configAll.callUrl).then((x) => {
if (x) {
console.log(`${ids}的打印信息已保存到后台`);
return true;
} else {
return false;
}
});
}; };
printOneByOne = () => { printOneByOne = () => {
// 按队列打印 // 按队列打印
const { configAll, viewData, printIndex } = this.state; const { viewData, printIndex } = this.state;
if (viewData && viewData.length) { if (viewData && viewData.length) {
message.info(`正在打印第${printIndex + 1}张奖状`);
this.printOne(); this.printOne();
const { length } = viewData; const { length } = viewData;
let LODOPObj = window.LODOP; let LODOPObj = window.LODOP;
LODOPObj.On_Return_Remain = true; LODOPObj.On_Return_Remain = true;
LODOPObj.On_Return = (TaskId, Value) => { LODOPObj.On_Return = (TaskId, Value) => {
console.log( if (Number(Value) === 1) {
TaskId, message.info(`正在打印第${printIndex + 1}张`);
Value === 1 || Value === '1' ? '已发出实际打印命令!' : '放弃打印!', this.printedDataSave(printIndex);
); }
this.setState( this.setState({ printIndex: this.state.printIndex + 1 }, () => {
{ if (this.state.printIndex < length) {
printIndex: this.state.printIndex + 1, this.printOne();
}, } else {
() => { this.setState({
if (this.state.printIndex < length) { loading: false,
message.info(`正在打印第${this.state.printIndex + 1}张奖状`); });
this.printOne(); }
} else { });
this.setState({
loading: false,
});
}
},
);
}; };
} else { } else {
console.error('暂无数据无法打印'); console.error('暂无任何数据无法打印');
} }
}; };
...@@ -183,26 +179,36 @@ height: 21cm; "><div style="position: absolute;top: 10.5cm>123123 ...@@ -183,26 +179,36 @@ height: 21cm; "><div style="position: absolute;top: 10.5cm>123123
}; };
render() { render() {
const { const { configAll, viewData, showWindowPrint, loading } = this.state;
configAll,
viewData,
showWindowPrint,
loading,
printBg,
} = this.state;
if (!viewData) { if (!viewData) {
return null; return <Shell styleShell={{ marginTop: '0', marginBottom: '20px' }}>
<div style={{ height: '54px', padding: '12px 0 12px 12px' }}>
<ButtonDiy
name={'返回'}
handleClick={() => {
router.goBack();
}}
/>
</div>
</Shell>;
} }
if (!configAll.backgroundUrl) { if (!configAll.backgroundUrl) {
console.error('没有设置模版图片无法使用'); console.error('没有设置模版图片无法使用');
return null; return null;
} }
const { hasPrintBackground, backgroundUrl, wide, high } = configAll; const { wide, high } = configAll;
let imageStyle = { const imageStyle = {
height: high ? `${high}cm` : A4Height, height: high ? `${high}cm` : A4Height,
width: wide ? `${wide}cm` : A4Width, width: wide ? `${wide}cm` : A4Width,
textAlign: 'center', textAlign: 'center',
}; };
const { pathname } = this.props.location;
const templateInfo = templateCode.find((x) => {
return x.path === pathname;
});
if(!templateInfo){
console.error('未找到templateInfo', pathname);
}
return ( return (
<Fragment> <Fragment>
<Shell styleShell={{ marginTop: '0', marginBottom: '20px' }}> <Shell styleShell={{ marginTop: '0', marginBottom: '20px' }}>
...@@ -217,109 +223,75 @@ height: 21cm; "><div style="position: absolute;top: 10.5cm>123123 ...@@ -217,109 +223,75 @@ height: 21cm; "><div style="position: absolute;top: 10.5cm>123123
<ButtonDiy <ButtonDiy
name={'打印'} name={'打印'}
handleClick={() => { handleClick={() => {
this.setState( this.printByLodop();
{
printBg: false,
},
() => {
this.printByLodop();
},
);
}} }}
loading={loading} loading={loading}
/> />
<ButtonDiy <ButtonDiy
name={'返回'} name={'返回'}
handleClick={() => { handleClick={() => {
router.goBack(); router.goBack();
}} }}
/> />
</div>
</Shell>
{/** 预览的dom */} <Authorized authority={'/jc/setting/PrintPositionSetting'}>
{viewData && viewData.length ? ( <span style={{ float: 'right' }}>
<div> <ButtonDiy
{viewData.map((info, index) => { name={'打印预览(实施)'}
return ( handleClick={() => {
<div this.printPreview();
className={styles.outSideDivPrint} }}
key={index + 'divKey'} loading={loading}
style={{ />
...imageStyle, </span>
}}> </Authorized>
{hasPrintBackground ? ( <Authorized authority={'/jc/setting/PrintPositionSetting'}>
<img <span style={{ float: 'right' }}>
src={backgroundUrl} <ButtonDiy
draggable={false} name={'打印模版设置(实施)'}
alt={'背景图'} handleClick={() => {
style={{ router.push({
zIndex: 1, pathname: '/jc/setting/PrintConfig',
...imageStyleAll, state: { code: templateInfo.code },
// border: '1px solid red', });
}} }}
/> />
) : null} </span>
{this.detailDom(info)} </Authorized>
</div>
);
})}
</div>
) : null}
<div id={'djfgkjdlfjg'}>
<div <Authorized authority={'/jc/setting/PrintPositionSetting'}>
style={{ <span style={{ float: 'right' }}>
pageBreakAfter: 'always', <ButtonDiy
// backgroundColor: 'red', name={'字段位置设置(实施)'}
position: 'relative', handleClick={() => {
width: '100%', router.push({
height: '100%', pathname: '/xg/xg_hard/AwardSet/printSetting',
}}> state: { code: templateInfo.code },
<img });
src={backgroundUrl} }}
width={'1000px'} />
height={'800px'} </span>
style={{ </Authorized>
// position: 'absolute',
// top: '-0.2cm',
}}
/>
</div> </div>
</div> </Shell>
{/** 打印的dom */}
{viewData && viewData.length ? ( {viewData && viewData.length ? (
<div <div
ref={(node) => (this.content = node)} ref={(node) => (this.content = node)}
style={{ style={{
display: showWindowPrint ? 'block' : 'none', display: showWindowPrint || true ? 'block' : 'none',
}}> }}>
{viewData.map((info, index) => { {viewData.map((info, index) => {
return ( return (
<div <div key={`${index}divKey`} id={`printDomId_${index}`}>
key={`${index}divKey`}
id={`printDomId_${index}`}
style={{}}>
<div <div
style={{ style={{
position: 'relative', position: 'relative',
pageBreakAfter: 'always', pageBreakAfter: 'always',
// border: '1px solid red', marginBottom: '10px',
...imageStyle, ...imageStyle,
backgroundColor: '#fff',
}}> }}>
{hasPrintBackground ? (
<img
src={backgroundUrl}
draggable={false}
alt={'背景图'}
style={{
zIndex: 1,
...imageStyleAll,
// border: '1px solid red',
}}
/>
) : null}
{this.detailDom(info)} {this.detailDom(info)}
</div> </div>
</div> </div>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论