|
|
@@ -32,8 +32,13 @@ |
|
|
|
<el-input-number v-model="pageInfo.pageHeight" controls-position="right" :min="0" class="min-input" |
|
|
|
@input="shapeChanged('pageHeight')"></el-input-number> |
|
|
|
<span class="unit-text">(mm)</span> |
|
|
|
<span class="unit-text">(mm)</span> |
|
|
|
</el-form-item> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-button size="mini" type="primary" @click="selectPage(1)">A4纸张预设</el-button> |
|
|
|
<el-button size="mini" type="primary" @click="selectPage(2)">标准收据预设</el-button> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
</template> |
|
|
@@ -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") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|