修改bug
This commit is contained in:
@@ -202,7 +202,7 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.init()
|
||||
// this.init()
|
||||
// console.log('aaaaaa')
|
||||
// this.otherPaper()
|
||||
},
|
||||
@@ -227,64 +227,67 @@ export default {
|
||||
changeMode() {
|
||||
// hiprintTemplate.clear()
|
||||
// console.log(this.modelData)
|
||||
const { mode } = this
|
||||
const provider = providers[mode]
|
||||
hiprint.init({
|
||||
providers: [provider.f]
|
||||
})
|
||||
this.$nextTick(() => {
|
||||
const { mode } = this
|
||||
const provider = providers[mode]
|
||||
hiprint.init({
|
||||
providers: [provider.f]
|
||||
})
|
||||
|
||||
// $('#hiprint-printTemplate').empty()
|
||||
// console.log(JSON.parse(this.modelData))
|
||||
hiprint.setConfig()
|
||||
// 替换配置
|
||||
hiprint.setConfig({
|
||||
movingDistance: 2.5,
|
||||
text: {
|
||||
supportOptions: [
|
||||
{
|
||||
name: 'styler',
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
name: 'formatter',
|
||||
hidden: true
|
||||
}
|
||||
]
|
||||
// $('#hiprint-printTemplate').empty()
|
||||
// console.log(JSON.parse(this.modelData))
|
||||
hiprint.setConfig()
|
||||
// 替换配置
|
||||
hiprint.setConfig({
|
||||
movingDistance: 2.5,
|
||||
text: {
|
||||
supportOptions: [
|
||||
{
|
||||
name: 'styler',
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
name: 'formatter',
|
||||
hidden: true
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
// 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()
|
||||
hiprintTemplate = new hiprint.PrintTemplate({
|
||||
template: JSON.parse(this.modelData),
|
||||
settingContainer: '#PrintElementOptionSetting',
|
||||
paginationContainer: '.hiprint-printPagination'
|
||||
})
|
||||
} else {
|
||||
$('.hiprintEpContainer').empty()
|
||||
console.log(this.modelData);
|
||||
hiprint.PrintElementTypeManager.build('.hiprintEpContainer', provider.value)
|
||||
$('.hiprint-printTemplate').empty()
|
||||
// const templates = this.$ls.get('KEY_TEMPLATES', {})
|
||||
const template = provider.value
|
||||
// console.log(template)
|
||||
hiprintTemplate = new hiprint.PrintTemplate({
|
||||
template: template,
|
||||
settingContainer: '#PrintElementOptionSetting',
|
||||
paginationContainer: '.hiprint-printPagination'
|
||||
})
|
||||
}
|
||||
hiprintTemplate.design('#hiprint-printTemplate')
|
||||
// console.log(hiprintTemplate)
|
||||
console.log(hiprintTemplate);
|
||||
// hiprintTemplate.design('#hiprint-printTemplate', { grid: true })
|
||||
// 获取当前放大比例, 当zoom时传true 才会有
|
||||
this.scaleValue = hiprintTemplate.editingPanel.scale || 1
|
||||
// this.scaleValue = hiprintTemplate.editingPanel.scale || 1
|
||||
})
|
||||
|
||||
// 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()
|
||||
hiprintTemplate = new hiprint.PrintTemplate({
|
||||
template: JSON.parse(this.modelData),
|
||||
settingContainer: '#PrintElementOptionSetting',
|
||||
paginationContainer: '.hiprint-printPagination'
|
||||
})
|
||||
} else {
|
||||
$('.hiprintEpContainer').empty()
|
||||
hiprint.PrintElementTypeManager.build('.hiprintEpContainer', provider.value)
|
||||
$('.hiprint-printTemplate').empty()
|
||||
// const templates = this.$ls.get('KEY_TEMPLATES', {})
|
||||
const template = provider.value
|
||||
// console.log(template)
|
||||
hiprintTemplate = new hiprint.PrintTemplate({
|
||||
template: template,
|
||||
settingContainer: '#PrintElementOptionSetting',
|
||||
paginationContainer: '.hiprint-printPagination'
|
||||
})
|
||||
}
|
||||
// hiprintTemplate.design('#hiprint-printTemplate')
|
||||
// console.log(hiprintTemplate)
|
||||
console.log(hiprintTemplate);
|
||||
hiprintTemplate.design('#hiprint-printTemplate', { grid: true })
|
||||
// 获取当前放大比例, 当zoom时传true 才会有
|
||||
this.scaleValue = hiprintTemplate.editingPanel.scale || 1
|
||||
// this.scaleValue = hiprintTemplate.editingPanel.scale || 1
|
||||
},
|
||||
/**
|
||||
* 设置纸张大小
|
||||
|
||||
Reference in New Issue
Block a user