修改bug
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-drawer :visible.sync="drawer" :append-to-body="true" size="80%">
|
||||
<el-drawer :visible.sync="drawer" :append-to-body="true" size="80%" >
|
||||
<small-title slot="title" :no-padding="true">
|
||||
<!-- <template v-for="demo in demoList"> -->
|
||||
<!-- <el-button :key="demo.name" :type="demo.name === curDemo ? 'primary' : ' '" @click="curDemo = demo.name"> -->
|
||||
@@ -29,24 +29,13 @@
|
||||
<el-col :span="20">
|
||||
<!-- 纸张设置 -->
|
||||
<el-button-group style="margin:0 10px">
|
||||
<el-button
|
||||
v-for="(value,type) in paperTypes"
|
||||
:key="type"
|
||||
:type="curPaperType === type ? 'primary' : ' '"
|
||||
@click="setPaper(type,value)"
|
||||
>
|
||||
<el-button v-for="(value,type) in paperTypes" :key="type" :type="curPaperType === type ? 'primary' : ' '"
|
||||
@click="setPaper(type,value)">
|
||||
{{ type }}
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
<el-input-number
|
||||
style="margin:0 10px"
|
||||
:value="scaleValue "
|
||||
:precision="2"
|
||||
:step="0.1"
|
||||
:min="scaleMin"
|
||||
:max="scaleMax"
|
||||
@change="changeScale"
|
||||
/>
|
||||
<el-input-number style="margin:0 10px" :value="scaleValue " :precision="2" :step="0.1" :min="scaleMin"
|
||||
:max="scaleMax" @change="changeScale" />
|
||||
<el-popover v-model="paperPopVisible" placement="bottom" width="300" title="设置纸张宽高(mm)">
|
||||
<div style="display: flex;align-items: center;justify-content: space-between;margin-bottom: 10px">
|
||||
<el-input v-model="paperWidth" type="number" style=" width: 100px; text-align: center" place="宽(mm)" />~
|
||||
@@ -212,7 +201,7 @@ export default {
|
||||
return type
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
created() {
|
||||
this.init()
|
||||
// console.log('aaaaaa')
|
||||
// this.otherPaper()
|
||||
@@ -224,6 +213,9 @@ export default {
|
||||
// handleClose() {
|
||||
// $('.hiprintEpContainer').empty()
|
||||
// },
|
||||
closed() {
|
||||
$('.hiprintEpContainer').empty()
|
||||
},
|
||||
init(data) {
|
||||
this.drawer = true
|
||||
this.modelData = data
|
||||
@@ -264,6 +256,7 @@ export default {
|
||||
// console.log(this.modelData)
|
||||
// console.log($('#hiprint-printTemplate').empty())
|
||||
if (this.modelData) {
|
||||
// console.log(this.modelData);
|
||||
$('.hiprintEpContainer').empty()
|
||||
hiprint.PrintElementTypeManager.build('.hiprintEpContainer', provider.value)
|
||||
$('.hiprint-printTemplate').empty()
|
||||
@@ -278,7 +271,7 @@ export default {
|
||||
$('.hiprint-printTemplate').empty()
|
||||
// const templates = this.$ls.get('KEY_TEMPLATES', {})
|
||||
const template = provider.value
|
||||
console.log(template)
|
||||
// console.log(template)
|
||||
hiprintTemplate = new hiprint.PrintTemplate({
|
||||
template: template,
|
||||
settingContainer: '#PrintElementOptionSetting',
|
||||
@@ -287,6 +280,7 @@ export default {
|
||||
}
|
||||
// hiprintTemplate.design('#hiprint-printTemplate')
|
||||
// console.log(hiprintTemplate)
|
||||
console.log(hiprintTemplate);
|
||||
hiprintTemplate.design('#hiprint-printTemplate', { grid: true })
|
||||
// 获取当前放大比例, 当zoom时传true 才会有
|
||||
this.scaleValue = hiprintTemplate.editingPanel.scale || 1
|
||||
|
||||
Reference in New Issue
Block a user