| | |
| | | |
| | | // 记录整体个数 |
| | | let limitCount = 0; |
| | | let size = 0; |
| | | |
| | | // top: 记录 打印元素 top值(注意单位); 提示:相当于记录上次填充到哪儿了 |
| | | for (let v = 1, top = 0; v <= ver; v++) { |
| | |
| | | // 获取 模板 的 打印元素 |
| | | let printElements1 = hiprintTemplateMap.panels[0].printElements; |
| | | const printElements2 = printElements1.map((items) => { |
| | | |
| | | const item = JSON.parse(JSON.stringify(items)) |
| | | // 偏移量计算 |
| | | item.options.top += top |
| | | item.options.left += left |
| | | // !! 元素的字段名 肯定不能重复呀! 所以需要特殊处理!!! |
| | | if (item.options.field) { |
| | | if (item.options.field ) { |
| | | // 及变成 字段名 + 第 v 行 第 h 列 |
| | | // 如: qrcode 变成 qrcode_1_1 (第 1 行 的 第 1 列) |
| | | item.options.field += `_${v}_${h}` |
| | | } |
| | | return item; |
| | | }) |
| | | //判断总个数是否超过标签数量 |
| | | if(limitCount<dataList.length){ |
| | | template.panels[0].printElements = template.panels[0].printElements.concat(printElements2) |
| | | } |
| | | |
| | | |
| | | template.panels[0].printElements = template.panels[0].printElements.concat(printElements2) |
| | | // 3.3. 计算 下一列 模板的 left 值 (单位转换) |
| | | left += hinnn.mm.toPt(hiprintTemplateMap.panels[0].width) |
| | | // 记录整体个数 |
| | |
| | | // 3.4 计算下一行 模板的 top 值 (单位转换) |
| | | top += hinnn.mm.toPt(hiprintTemplateMap.panels[0].height) |
| | | } |
| | | |
| | | |
| | | |
| | | |