29 lines
2.1 KiB
HTML
29 lines
2.1 KiB
HTML
{% set label_font_size = labelFontSize|default(14) %}
|
||
{% set label_color = labelColor|default('#333333') %}
|
||
{% set label_font_weight = labelFontWeight|default('normal') %}
|
||
{% set label_position = labelPosition|default('bottom') %}
|
||
{% set align_map = {'left': 'flex-start', 'center': 'center', 'right': 'flex-end'} %}
|
||
{% set justify = align_map.get(textAlign|default('center'), 'center') %}
|
||
<div style="display: flex; justify-content: {{ justify }}; width: 100%; box-sizing: border-box; line-height: 0;">
|
||
<div style="display: inline-flex; flex-direction: {% if label_position == 'top' %}column-reverse{% elif label_position == 'left' %}row-reverse{% elif label_position == 'right' %}row{% else %}column{% endif %}; align-items: center; gap: 4px; line-height: normal;">
|
||
{% if barcode_image %}
|
||
<img src="{{ barcode_image }}" style="width: {{ width }}; height: {{ height }}; display: block;" />
|
||
{% else %}
|
||
<div style="width: {{ width }}; height: {{ height }}; display: inline-flex; border: 2px dashed #dcdfe6; background-color: #f5f7fa; align-items: center; justify-content: center; flex-direction: column; gap: 8px; color: #909399; font-size: 12px;">
|
||
<div style="display: flex; align-items: center; gap: 2px;">
|
||
<div style="width: 2px; height: 16px; background-color: #909399;"></div>
|
||
<div style="width: 2px; height: 16px; background-color: #909399;"></div>
|
||
<div style="width: 2px; height: 16px; background-color: #909399;"></div>
|
||
<div style="width: 2px; height: 16px; background-color: #909399;"></div>
|
||
<div style="width: 2px; height: 16px; background-color: #909399;"></div>
|
||
<div style="width: 2px; height: 16px; background-color: #909399;"></div>
|
||
<div style="width: 2px; height: 16px; background-color: #909399;"></div>
|
||
<div style="width: 2px; height: 16px; background-color: #909399;"></div>
|
||
</div>
|
||
<span>{{ width }} × {{ height }}</span>
|
||
</div>
|
||
{% endif %}
|
||
{% if label %}<span style="font-size: {{ label_font_size }}px; color: {{ label_color }}; font-weight: {{ label_font_weight }};">{{ label }}</span>{% endif %}
|
||
</div>
|
||
</div>
|