| | |
| | | onMounted(async () => { |
| | | await getTags(); |
| | | await hiprint.init(); |
| | | hiprintTemplate.value = new hiprint.PrintTemplate({}); |
| | | hiprintTemplate.value.design("#hiprint-printTemplate1",{grid:true}); |
| | | |
| | | |
| | | }) |
| | | |
| | |
| | | }) |
| | | |
| | | const changeTag = () => { |
| | | |
| | | hiprintTemplate.value = new hiprint.PrintTemplate({}); |
| | | hiprintTemplate.value.design("#hiprint-printTemplate1",{grid:true}); |
| | | const json = tag.value.value |
| | | hiprintTemplate.value.update(json) |
| | | } |
| | |
| | | }) |
| | | } |
| | | const printOrder = (type) => { |
| | | const list = JSON.parse(JSON.stringify(hiprintTemplate.value.getJson())) |
| | | const list = tag.value.value |
| | | list.panels[0].printElements.forEach(element => { |
| | | element.options.fontFamily = 'Arial' |
| | | if( element.options.field !== undefined){ |
| | |
| | | }) |
| | | |
| | | //hiprintTemplate.value.update(list) |
| | | let object = lastList.value |
| | | let object = JSON.parse(JSON.stringify(lastList.value)) |
| | | //判断是否为表格 |
| | | let columnsNum = null |
| | | if(list.panels[0].printElements[0].options.field==='table'){ |
| | |
| | | } |
| | | //判断是否有 嵌套自定义纸张 |
| | | if(tag.value.tagHeight && tag.value.tagWidth){ |
| | | const print =createTemplate(hiprintTemplate.value.getJson(),object,tag.value.tagWidth,tag.value.tagHeight) |
| | | const print =createTemplate(list,object,tag.value.tagWidth,tag.value.tagHeight) |
| | | hiprintTemplate.value.update(print.template) |
| | | object = print.printData |
| | | } |