提交 b79f1e4a authored 作者: 徐立's avatar 徐立

打印页面关闭margin和padding

上级 696aab4d
...@@ -12,7 +12,6 @@ import moment from 'moment'; ...@@ -12,7 +12,6 @@ import moment from 'moment';
import TableCom from '../tableCompon'; import TableCom from '../tableCompon';
import IsNewTable from './isNewMobileTable'; import IsNewTable from './isNewMobileTable';
import maintain from '../assets/maintain.png'; import maintain from '../assets/maintain.png';
export default class ZdyTable extends Component { export default class ZdyTable extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -442,6 +441,8 @@ export default class ZdyTable extends Component { ...@@ -442,6 +441,8 @@ export default class ZdyTable extends Component {
taskAssignee, taskAssignee,
userId, userId,
isDynamic, // 是否为大数据页面 isDynamic, // 是否为大数据页面
isWebPrint, // 打印界面
isWebPrintEnd,
} = this.props; } = this.props;
let style = {}; let style = {};
if (formConfig.style != null) { if (formConfig.style != null) {
...@@ -482,18 +483,19 @@ export default class ZdyTable extends Component { ...@@ -482,18 +483,19 @@ export default class ZdyTable extends Component {
// overflowY: isDynamic && 'auto', // overflowY: isDynamic && 'auto',
width: '100%', width: '100%',
height: this.props.height, height: this.props.height,
paddingBottom: paddingBottom != null ? paddingBottom : '10px', paddingBottom: paddingBottom != null ? paddingBottom : isWebPrint ? 0 : '10px',
} }
: { : {
overflow: isDynamic ? 'hidden' : 'auto', overflow: isDynamic ? 'hidden' : 'auto',
// overflowY: isDynamic && 'auto', // overflowY: isDynamic && 'auto',
width: '100%', width: '100%',
paddingBottom: paddingBottom != null ? paddingBottom : '10px', paddingBottom: paddingBottom != null ? paddingBottom : isWebPrint ? 0 : '10px',
}; };
if (!isReady) return <></>; if (!isReady) return <></>;
if (this.props.postData?.isUpdate) { if (this.props.postData?.isUpdate) {
updateTime = moment(+this.props.postData?.updateTime).format('llll'); updateTime = moment(+this.props.postData?.updateTime).format('llll');
} }
console.log(isWebPrintEnd);
switch (get) { switch (get) {
case 'web': case 'web':
return ( return (
...@@ -557,7 +559,7 @@ export default class ZdyTable extends Component { ...@@ -557,7 +559,7 @@ export default class ZdyTable extends Component {
style={{ style={{
overflow: 'auto', overflow: 'auto',
margin: max * width > 550 ? 'auto' : '', margin: max * width > 550 ? 'auto' : '',
marginBottom: '5px', marginBottom: isWebPrint ? (isWebPrintEnd ? '5px' : 0) : '1px',
...style, ...style,
}} }}
border={border} border={border}
...@@ -617,6 +619,8 @@ export default class ZdyTable extends Component { ...@@ -617,6 +619,8 @@ export default class ZdyTable extends Component {
}} }}
> >
<TableCom <TableCom
isWebPrintEnd={isWebPrintEnd}
isWebPrint={isWebPrint}
isPrint={this.props.isPrint} isPrint={this.props.isPrint}
formCode={formCode} // 当前表单code formCode={formCode} // 当前表单code
modalInit={modalInit} modalInit={modalInit}
......
...@@ -1474,6 +1474,7 @@ export default class tableCom extends Component { ...@@ -1474,6 +1474,7 @@ export default class tableCom extends Component {
})(<Input type="hidden" />)}{' '} })(<Input type="hidden" />)}{' '}
<ZdyTable <ZdyTable
taskAssignee={taskAssignee} taskAssignee={taskAssignee}
isWebPrint={this.props.isWebPrint || false}
userId={userId} userId={userId}
key={fk} key={fk}
modalInit={modalInit} modalInit={modalInit}
...@@ -1659,7 +1660,6 @@ export default class tableCom extends Component { ...@@ -1659,7 +1660,6 @@ export default class tableCom extends Component {
(json.isMobileLabel == null && json.isLabel) (json.isMobileLabel == null && json.isLabel)
) { ) {
if (obj && obj.defaultValues && obj.defaultValues[formKey]) { if (obj && obj.defaultValues && obj.defaultValues[formKey]) {
return ( return (
<MobileItem <MobileItem
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
...@@ -1669,7 +1669,6 @@ export default class tableCom extends Component { ...@@ -1669,7 +1669,6 @@ export default class tableCom extends Component {
{cm} {cm}
</MobileItem> </MobileItem>
); );
} else { } else {
return ( return (
<> <>
...@@ -3221,13 +3220,17 @@ export default class tableCom extends Component { ...@@ -3221,13 +3220,17 @@ export default class tableCom extends Component {
) : ( ) : (
'' ''
)} )}
{json.isMobileLabel&&!isEdit&&get=="mobile"? <MobileItem {json.isMobileLabel && !isEdit && get == 'mobile' ? (
<MobileItem
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title} label={title}
> >
{cm} {cm}
</MobileItem>:cm} </MobileItem>
) : (
cm
)}
</> </>
); );
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论