diff --git a/src/components/panel/page.vue b/src/components/panel/page.vue index f349f71..5a7ac0f 100644 --- a/src/components/panel/page.vue +++ b/src/components/panel/page.vue @@ -32,8 +32,13 @@ (mm) + (mm) + + A4纸张预设 + 标准收据预设 + @@ -50,9 +55,23 @@ export default { // 宽度与高度的比例必须约等于纸张宽度与纸张高度的比例,否则拖拽组件将错位 shapeChanged(element) { if (element === "pageWidth") { - this.pageInfo.width = this.pageInfo.pageWidth * 2 + this.pageInfo.width = this.pageInfo.pageWidth * 2.5 } else if (element === "pageHeight") { - this.pageInfo.height = this.pageInfo.pageHeight * 2 + this.pageInfo.height = this.pageInfo.pageHeight * 2.5 + } + }, + + selectPage(num) { + if (num == 1) { + this.pageInfo.pageWidth = 210 + this.pageInfo.pageHeight = 297 + this.shapeChanged("pageWidth") + this.shapeChanged("pageHeight") + } else if (num == 2) { + this.pageInfo.pageWidth = 210 + this.pageInfo.pageHeight = 105 + this.shapeChanged("pageWidth") + this.shapeChanged("pageHeight") } } } diff --git a/src/components/viewport/index.vue b/src/components/viewport/index.vue index 3d1ccd7..735f6aa 100644 --- a/src/components/viewport/index.vue +++ b/src/components/viewport/index.vue @@ -1,25 +1,14 @@