|
@@ -118,7 +118,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
printTitle: {
|
|
printTitle: {
|
|
|
type: String,
|
|
type: String,
|
|
|
- default: '宽形表格打印'
|
|
|
|
|
|
|
+ default: ''
|
|
|
},
|
|
},
|
|
|
showControls: {
|
|
showControls: {
|
|
|
type: Boolean,
|
|
type: Boolean,
|
|
@@ -243,8 +243,15 @@ export default {
|
|
|
|
|
|
|
|
return Math.min(widthScale, heightScale, 1)
|
|
return Math.min(widthScale, heightScale, 1)
|
|
|
},
|
|
},
|
|
|
- printTable() {
|
|
|
|
|
|
|
+ printTable(isLandscape) {
|
|
|
const printWindow = window.open('', '_blank')
|
|
const printWindow = window.open('', '_blank')
|
|
|
|
|
+
|
|
|
|
|
+ // let landscape = this.landscape;
|
|
|
|
|
+ // if(!!isLandscape) {
|
|
|
|
|
+ // landscape = isLandscape;
|
|
|
|
|
+ // }
|
|
|
|
|
+ let landscape = isLandscape;
|
|
|
|
|
+ console.log(landscape)
|
|
|
|
|
|
|
|
printWindow.document.open()
|
|
printWindow.document.open()
|
|
|
printWindow.document.write(`
|
|
printWindow.document.write(`
|
|
@@ -257,8 +264,8 @@ export default {
|
|
|
body { margin: 0; padding: 0; font-family: Arial, sans-serif; }
|
|
body { margin: 0; padding: 0; font-family: Arial, sans-serif; }
|
|
|
.print-page {
|
|
.print-page {
|
|
|
page-break-after: always;
|
|
page-break-after: always;
|
|
|
- width: ${this.landscape ? '297mm' : '210mm'};
|
|
|
|
|
- height: ${this.landscape ? '210mm' : '297mm'};
|
|
|
|
|
|
|
+ width: ${landscape ? '297mm' : '210mm'};
|
|
|
|
|
+ height: ${landscape ? '210mm' : '297mm'};
|
|
|
padding: 10mm;
|
|
padding: 10mm;
|
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
|
margin: 0 auto;
|
|
margin: 0 auto;
|
|
@@ -311,7 +318,7 @@ export default {
|
|
|
color: #666;
|
|
color: #666;
|
|
|
}
|
|
}
|
|
|
@page {
|
|
@page {
|
|
|
- size: ${this.landscape ? 'A4 landscape' : 'A4 portrait'};
|
|
|
|
|
|
|
+ size: ${landscape ? 'A4 landscape' : 'A4 portrait'};
|
|
|
margin: 10mm;
|
|
margin: 10mm;
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|