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

打印修改

上级 0705985e
......@@ -112,7 +112,12 @@ export default function DetailDom({ config, data }) {
};
if (transform) {
styleOutSide.transform = `rotate(${transform}deg)`;
styleOutSide.WebkitTransform = `rotate(${transform}deg)`;
styleOutSide.MozTransform = `rotate(${transform}deg)`;
styleOutSide.MsTransform = `rotate(${transform}deg)`;
// styleOutSide.MsFilter = "progid:DXImageTransform.Microsoft.Matrix(M11=-1, M12=1.2246467991473532e-16, M21=-1.2246467991473532e-16, M22=-1, SizingMethod='auto expand')";
}
const outSideDom = (children) => {
return (
<div
......
......@@ -2,23 +2,23 @@ import { message } from 'antd';
import { ModalConfirm, ModalInfo } from '@/baseComponent/Modal';
import * as lo from './LodopFuncs';
export const A4Height = '28.7cm';
export const A4Width = '19.8cm';
export const A4Height = '29.7cm';
export const A4Width = '21cm';
export const imageStyleAll = {
width: '100%',
// height: '100%',
};
export const defaultConfigInfo = {
paperHeight: A4Height,
paperWidth: A4Width,
};
export function getCLodopFuncJS() {
return new Promise((resolve, reject) => {
resolve(true);
});
return new Promise((resolve, reject) => {
if (window.LODOP) {
console.log('打印插件加载成功');
......
......@@ -6,10 +6,11 @@ import Shell from '@/baseComponent/Shell';
import ButtonDiy from '@/baseComponent/ButtonDiy';
import router from 'umi/router';
import DetailDom from './DetailDom';
import { A4Width, A4Height, getCLodopFuncJS, templateCode } from './config';
import { A4Width, A4Height, getCLodopFuncJS, templateCode, defaultConfigInfo } from './config';
import RenderAuthorized from '@/components/Authorized';
import { getAuthority } from '@/utils/authority';
import { ModalInfo } from '@/baseComponent/Modal';
import { isJSON } from '@/webPublic/one_stop_public/copy';
const Authorized = RenderAuthorized(getAuthority());
......@@ -93,6 +94,12 @@ export default class ViewPrint extends Component {
printOne = (optionType = 0) => {
const { printIndex, configAll, viewData } = this.state;
let { info } = configAll;
if(isJSON(info)){
info = JSON.parse(info);
}else{
info = defaultConfigInfo;
}
const { printMeth } = configAll;
const { wide, high } = configAll;
const { LODOP } = window;
......@@ -106,20 +113,9 @@ export default class ViewPrint extends Component {
}
console.log(wide, high);
const strHTML = dom.innerHTML;
LODOP.PRINT_INITA(
0,
0,
`${wide}cm`,
`${high}cm`,
`printDomId-djkfgjkdlfg`,
);
LODOP.SET_PRINT_PAGESIZE(
printMeth,
`${wide}cm`,
`${high}cm`,
'CreateCustomPage',
); // 打印方向
LODOP.ADD_PRINT_HTM(0, 0, '100%', '100%', strHTML); // HTML 打印
LODOP.PRINT_INITA(0, 0, `${wide}cm`, `${high}cm`, `printDomId${printIndex}`);
LODOP.SET_PRINT_PAGESIZE(printMeth, info.paperWidth, info.paperHeight, 'CreateCustomPage'); // 打印方向 纸张大小.
LODOP.ADD_PRINT_HTML(0, 0, '100%', '100%', strHTML); // HTML 打印
console.log(strHTML);
switch (optionType) {
case 1:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论