Skip to content

Commit

Permalink
Merge pull request #89 from Jamboy/main
Browse files Browse the repository at this point in the history
feat: 表格列属性为条形码&二维码类型添加标题显隐控制
  • Loading branch information
Xavier9896 authored Jan 8, 2024
2 parents 3e9cfc5 + 678d294 commit 94b1c76
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 15 deletions.
50 changes: 44 additions & 6 deletions src/hiprint/hiprint.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -1570,7 +1570,7 @@ var hiprint = function (t) {
}(),
u = function () {
return function (t) {
this.title = t.title, this.field = t.field, this.width = t.width, this.align = t.align, this.halign = t.halign, this.vAlign = t.vAlign, this.colspan = t.colspan, this.rowspan = t.rowspan, this.checked = t.checked, this.columnId = t.columnId, this.tableSummaryTitle = t.tableSummaryTitle, this.tableSummaryText = t.tableSummaryText, this.tableSummaryColspan = t.tableSummaryColspan, this.tableSummary = t.tableSummary, this.tableSummaryAlign = t.tableSummaryAlign, this.tableSummaryNumFormat = t.tableSummaryNumFormat, this.tableSummaryFormatter = t.tableSummaryFormatter, this.upperCase = t.upperCase, this.renderFormatter = t.renderFormatter && t.renderFormatter.toString(), this.formatter2 = t.formatter2 && t.formatter2.toString(), this.styler2 = t.styler2 && t.styler2.toString(), this.stylerHeader = t.stylerHeader && t.stylerHeader.toString(), this.tableColumnHeight = t.tableColumnHeight, this.tableTextType = t.tableTextType, this.tableBarcodeMode = t.tableBarcodeMode, this.tableQRCodeLevel = t.tableQRCodeLevel;
this.title = t.title, this.field = t.field, this.width = t.width, this.align = t.align, this.halign = t.halign, this.vAlign = t.vAlign, this.colspan = t.colspan, this.rowspan = t.rowspan, this.checked = t.checked, this.columnId = t.columnId, this.tableSummaryTitle = t.tableSummaryTitle, this.tableSummaryText = t.tableSummaryText, this.tableSummaryColspan = t.tableSummaryColspan, this.tableSummary = t.tableSummary, this.tableSummaryAlign = t.tableSummaryAlign, this.tableSummaryNumFormat = t.tableSummaryNumFormat, this.tableSummaryFormatter = t.tableSummaryFormatter, this.showCodeTitle = t.showCodeTitle, this.upperCase = t.upperCase, this.renderFormatter = t.renderFormatter && t.renderFormatter.toString(), this.formatter2 = t.formatter2 && t.formatter2.toString(), this.styler2 = t.styler2 && t.styler2.toString(), this.stylerHeader = t.stylerHeader && t.stylerHeader.toString(), this.tableColumnHeight = t.tableColumnHeight, this.tableTextType = t.tableTextType, this.tableBarcodeMode = t.tableBarcodeMode, this.tableQRCodeLevel = t.tableQRCodeLevel
};
}(),
d = function () {
Expand Down Expand Up @@ -1672,7 +1672,8 @@ var hiprint = function (t) {
f = function (t) {
function e(e) {
var n = this;
return e = e || {}, (n = t.call(this) || this).width = e.width ? parseFloat(e.width.toString()) : 100, n.title = e.title, n.descTitle = e.descTitle, n.field = e.field, n.fixed = e.fixed, n.rowspan = e.rowspan ? parseInt(e.rowspan) : 1, n.colspan = e.colspan ? parseInt(e.colspan) : 1, n.align = e.align, n.halign = e.halign, n.vAlign = e.vAlign, n.formatter = e.formatter, n.styler = e.styler, n.renderFormatter = e.renderFormatter, n.formatter2 = e.formatter2, n.styler2 = e.styler2, n.stylerHeader = e.stylerHeader, n.checkbox = e.checkbox, n.checked = 0 != e.checked, n.columnId = e.columnId || e.field, n.tableColumnHeight = e.tableColumnHeight, n.tableTextType = e.tableTextType, n.tableBarcodeMode = e.tableBarcodeMode, n.tableQRCodeLevel = e.tableQRCodeLevel, n.tableSummaryTitle = e.tableSummaryTitle, n.tableSummaryText = e.tableSummaryText, n.tableSummaryColspan = e.tableSummaryColspan, n.tableSummary = e.tableSummary, n.tableSummaryAlign = e.tableSummaryAlign, n.tableSummaryNumFormat = e.tableSummaryNumFormat, n.tableSummaryFormatter = e.tableSummaryFormatter, n.upperCase = e.upperCase, n;
return e = e || {}, (n = t.call(this) || this).width = e.width ? parseFloat(e.width.toString()) : 100, n.title = e.title, n.descTitle = e.descTitle, n.field = e.field, n.fixed = e.fixed, n.rowspan = e.rowspan ? parseInt(e.rowspan) : 1, n.colspan = e.colspan ? parseInt(e.colspan) : 1, n.align = e.align, n.halign = e.halign, n.vAlign = e.vAlign, n.formatter = e.formatter, n.styler = e.styler, n.renderFormatter = e.renderFormatter, n.formatter2 = e.formatter2, n.styler2 = e.styler2, n.stylerHeader = e.stylerHeader, n.checkbox = e.checkbox, n.checked = 0 != e.checked, n.columnId = e.columnId || e.field, n.tableColumnHeight = e.tableColumnHeight, n.tableTextType = e.tableTextType, n.tableBarcodeMode = e.tableBarcodeMode, n.tableQRCodeLevel = e.tableQRCodeLevel, n.tableSummaryTitle = e.tableSummaryTitle, n.tableSummaryText = e.tableSummaryText, n.tableSummaryColspan = e.tableSummaryColspan, n.tableSummary = e.tableSummary, n.tableSummaryAlign = e.tableSummaryAlign, n.tableSummaryNumFormat = e.tableSummaryNumFormat, n.tableSummaryFormatter = e.tableSummaryFormatter,
n.showCodeTitle = e.showCodeTitle, n.upperCase = e.upperCase, n;
}

return h(e, t), e.prototype.css = function (t) {
Expand Down Expand Up @@ -1899,6 +1900,9 @@ var hiprint = function (t) {
displayValue: !1
}), r.find(".hibarcode_imgcode").attr("height", t.tableColumnHeight || 30 + 'pt'), r.find(".hibarcode_imgcode").css("margin", '5pt 10pt'), r.find(".hibarcode_imgcode").attr("width", "calc(100% - 20pt)")) : r.html("");
// this.options.hideTitle || r.find(".hibarcode_displayValue").html(n)
if (t.showCodeTitle) {
r.find('.hibarcode_displayValue').html(p)
}
} catch (t) {
console.log(t), r.html(`${i18n.__('此格式不支持该文本')}`);
}
Expand All @@ -1917,7 +1921,7 @@ var hiprint = function (t) {
if ("qrcode" == t.tableTextType) {
r.html("");
try {
var qrcodebox = $('<div></div>')
var qrcodebox = $('<div style="margin:2pt 0pt" class="hiqrcode_imgcode"></div>')

if (p) {
var l = parseInt(t.width || t.targetWidth || 20),
Expand All @@ -1930,7 +1934,14 @@ var hiprint = function (t) {
useSVG: !0,
correctLevel: t.tableQRCodeLevel || 0,
}).makeCode(p);
// r.find(".hiqrcode_imgcode").css("margin", '5pt 0pt'),
r.html(qrcodebox)
if(t.showCodeTitle) {
r.append(
'<div class="hiqrcode_displayValue"></div>'
)
r.find('.hiqrcode_displayValue').html(p)
}
}
} catch (t) {
console.log(t), r.html(`${i18n.__('二维码生成失败')}`);
Expand Down Expand Up @@ -4609,6 +4620,31 @@ var hiprint = function (t) {
this.target.remove();
}, t;
}(),
showCodeTitle = (function () {
function t() {
this.name = 'showCodeTitle'
}
return (
(t.prototype.createTarget = function () {
return (
(this.target = $(
` <div class="hiprint-option-item" title="条形码底部是否显示内容">\n <div class="hiprint-option-item-label">\n ${i18n.__('显示码值')}\n </div>\n <div class="hiprint-option-item-field">\n <select class="auto-submit">\n <option value="" >${i18n.__('默认')}</option>\n <option value="true" >${i18n.__('显示')}</option>\n <option value="false" >${i18n.__('隐藏')}</option>\n </select>\n </div>\n </div>`
)),
this.target
)
}),
(t.prototype.getValue = function () {
if ('true' == this.target.find('select').val()) return !0
}),
(t.prototype.setValue = function (t) {
this.target.find('select').val((null == t ? '' : t).toString())
}),
(t.prototype.destroy = function () {
this.target.remove()
}),
t
)
})(),
tableSummaryFormatter = function () {
function t() {
this.name = "tableSummaryFormatter";
Expand All @@ -4625,6 +4661,7 @@ var hiprint = function (t) {
this.target.remove();
}, t;
}(),

upperCase = function () {
function t() {
this.name = "upperCase";
Expand Down Expand Up @@ -4658,6 +4695,7 @@ var hiprint = function (t) {
this.target.remove();
}, t;
}(),

// 表格底部合计栏
tableSummary = function () {
function t() {
Expand Down Expand Up @@ -5204,7 +5242,7 @@ var hiprint = function (t) {
t.init(), t.printElementOptionItems[e.name] = e;
}, t.getItem = function (e) {
return t.init(), t.printElementOptionItems[e];
}, t._printElementOptionItems = [new fontFamily(), new r(), new a(), new p(), new i(), new s(), new l(), new pt(), new u(), new d(), new c(), new h(), new f(), new g(), new m(), new d2(), new c2(), new v(), new y(), new b(), new E(), new qrCodeLevel(), new T(), new P(), new _(), new w(), new x(), new coordinate(), new widthHeight(), new C(), new imageFit(), new O(), new H(), new D(), new paperNumberContinue(), new watermarkOptions(), new I(), new R(), new pageBreak(), new M(), new M2(), new S(), new B(), new F(), new L(), new A(), new z(), new k(), new st(), new N(), new V(), new W(), new j(), new U(), new borderRadius(), new zIndex(), new K(), new G(), new q(), new X(), new Y(), new Q(), new J(), new Z(), new tt(), new et(), new nt(), new it(), new ot(),new textWrap(), new at(), new lt(), new panelLayoutOptions(), new ut(), new ith(), new dt(), new ct(), new ht(), new ft(), new gt(), new mt(), new rowcolumns(), new rowsColumnsMergeClean(), new groupFieldsFormatter(), new groupFormatter(), new groupFooterFormatter(), new vt(), new yt(), new bt(), new Tt(), new Et(), new Pt(), new stylerHeader(), new renderFormatter(), new _t(), new wt(), new maxRows(), new xt(), new tableColumnH(), new tableE(), new tableQRCodeLevel(), new tablept(), new tableSummaryTitle(), new tableSummaryText(), new tableSummaryColspan(), new tableSummary(), new tableSummaryAlign(), new tableSummaryNumFormat(), new tableSummaryFormatter(), new upperCase(), new barcodeType(), new qrcodeType(),new barColor()], t;
}, t._printElementOptionItems = [new fontFamily(), new r(), new a(), new p(), new i(), new s(), new l(), new pt(), new u(), new d(), new c(), new h(), new f(), new g(), new m(), new d2(), new c2(), new v(), new y(), new b(), new E(), new qrCodeLevel(), new T(), new P(), new _(), new w(), new x(), new coordinate(), new widthHeight(), new C(), new imageFit(), new O(), new H(), new D(), new paperNumberContinue(), new watermarkOptions(), new I(), new R(), new pageBreak(), new M(), new M2(), new S(), new B(), new F(), new L(), new A(), new z(), new k(), new st(), new N(), new V(), new W(), new j(), new U(), new borderRadius(), new zIndex(), new K(), new G(), new q(), new X(), new Y(), new Q(), new J(), new Z(), new tt(), new et(), new nt(), new it(), new ot(),new textWrap(), new at(), new lt(), new panelLayoutOptions(), new ut(), new ith(), new dt(), new ct(), new ht(), new ft(), new gt(), new mt(), new rowcolumns(), new rowsColumnsMergeClean(), new groupFieldsFormatter(), new groupFormatter(), new groupFooterFormatter(), new vt(), new yt(), new bt(), new Tt(), new Et(), new Pt(), new stylerHeader(), new renderFormatter(), new _t(), new wt(), new maxRows(), new xt(), new tableColumnH(), new tableE(), new tableQRCodeLevel(), new tablept(), new tableSummaryTitle(), new tableSummaryText(), new tableSummaryColspan(), new tableSummary(), new tableSummaryAlign(), new tableSummaryNumFormat(), new tableSummaryFormatter(),new showCodeTitle(), new upperCase(), new barcodeType(), new qrcodeType(),new barColor(),], t;
}();
}, function (t, e, n) {
"use strict";
Expand Down Expand Up @@ -6537,7 +6575,7 @@ var hiprint = function (t) {
r = (function () {
}(), function () {
return function (t) {
this.width = t.width, this.title = t.title, this.field = t.field, this.checked = t.checked, this.columnId = t.columnId, this.fixed = !1, this.rowspan = t.rowspan || 1, this.colspan = t.colspan || 1, this.align = t.align, this.halign = t.halign, this.vAlign = t.vAlign, this.renderFormatter = t.renderFormatter, this.formatter2 = t.formatter2, this.styler2 = t.styler2, this.stylerHeader = t.stylerHeader, this.tableColumnHeight = t.tableColumnHeight, this.tableTextType = t.tableTextType, this.tableBarcodeMode = t.tableBarcodeMode, this.tableQRCodeLevel = t.tableQRCodeLevel, this.tableSummaryTitle = t.tableSummaryTitle, this.tableSummaryText = t.tableSummaryText, this.tableSummaryColspan = t.tableSummaryColspan, this.tableSummary = t.tableSummary, this.tableSummaryAlign = t.tableSummaryAlign, this.tableSummaryNumFormat = t.tableSummaryNumFormat, this.tableSummaryFormatter = t.tableSummaryFormatter, this.upperCase = t.upperCase;
this.width = t.width, this.title = t.title, this.field = t.field, this.checked = t.checked, this.columnId = t.columnId, this.fixed = !1, this.rowspan = t.rowspan || 1, this.colspan = t.colspan || 1, this.align = t.align, this.halign = t.halign, this.vAlign = t.vAlign, this.renderFormatter = t.renderFormatter, this.formatter2 = t.formatter2, this.styler2 = t.styler2, this.stylerHeader = t.stylerHeader, this.tableColumnHeight = t.tableColumnHeight, this.tableTextType = t.tableTextType, this.tableBarcodeMode = t.tableBarcodeMode, this.tableQRCodeLevel = t.tableQRCodeLevel, this.tableSummaryTitle = t.tableSummaryTitle, this.tableSummaryText = t.tableSummaryText, this.tableSummaryColspan = t.tableSummaryColspan, this.tableSummary = t.tableSummary, this.tableSummaryAlign = t.tableSummaryAlign, this.tableSummaryNumFormat = t.tableSummaryNumFormat, this.tableSummaryFormatter = t.tableSummaryFormatter, this.showCodeTitle = t.showCodeTitle, this.upperCase = t.upperCase;
};
}()),
a = n(5);
Expand Down Expand Up @@ -9792,7 +9830,7 @@ var hiprint = function (t) {
return (e = t.tid ? a.instance.getElementType(t.tid) : nt.createPrintElementType(t.printElementType)) || console.log("miss " + JSON.stringify(t)), e;
}, t.prototype.getPrintStyle = function () {
let layoutStyle = ''
if(this.panelLayoutOptions['layoutType'] === 'row'){
if(this.panelLayoutOptions && this.panelLayoutOptions['layoutType'] === 'row'){
layoutStyle = `
<style>
.hiprint-printTemplate{
Expand Down
9 changes: 9 additions & 0 deletions src/hiprint/hiprint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
adsorbLineMin: 6, //吸附线显示最小距离pt
paperNumberContinue: true, //连续打印页码
panel: {

supportOptions: [
{
name: 'panelPaperRule',
Expand Down Expand Up @@ -1756,6 +1757,11 @@
name: 'tableColumnHeight',
hidden: false
},
{
// 表格条码底部是否显示内容
name: 'showCodeTitle',
hidden: false,
},
{
name: 'paddingLeft',
hidden: false
Expand Down Expand Up @@ -1788,6 +1794,7 @@
name: 'tableSummaryNumFormat',
hidden: false
},

{
name: 'tableSummaryFormatter',
hidden: false
Expand All @@ -1796,6 +1803,7 @@
name: 'upperCase',
hidden: false
},

{
name: 'renderFormatter',
hidden: false
Expand All @@ -1812,6 +1820,7 @@
name: 'stylerHeader',
hidden: false
},

],
default: {
height: 90,
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -247,5 +247,6 @@
"垂直间距%s": "垂直间距%s",
"水平间距%s": "水平间距%s",
"边框圆角": "边框圆角",
"条码颜色": "条码颜色"
"条码颜色": "条码颜色",
"显示码值": "显示码值"
}
3 changes: 2 additions & 1 deletion src/i18n/cn_tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -246,5 +246,6 @@
"排列方式": "排列方式",
"垂直间距%s": "垂直間距%s",
"水平间距%s": "水平間距%s",
"边框圆角": "邊框圓角"
"边框圆角": "邊框圓角",
"显示码值": "顯示碼值"
}
3 changes: 2 additions & 1 deletion src/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,5 +245,6 @@
"排列方式": "Anordnungsart",
"垂直间距%s": "Vertikaler Abstand %s",
"水平间距%s": "Horizontaler Abstand %s",
"边框圆角": "Abgerundete Ecken"
"边框圆角": "Abgerundete Ecken",
"显示码值": "Anzeigecode"
}
3 changes: 2 additions & 1 deletion src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -246,5 +246,6 @@
"排列方式": "Arrangement Method",
"垂直间距%s": "Vertical Spacing %s",
"水平间距%s": "Horizontal Spacing %s",
"边框圆角": "Border Radius"
"边框圆角": "Border Radius",
"显示码值": "Display Code value"
}
3 changes: 2 additions & 1 deletion src/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,5 +245,6 @@
"排列方式": "Método de disposición",
"垂直间距%s": "Espaciado Vertical %s",
"水平间距%s": "Espaciado Horizontal %s",
"边框圆角": "Radio de Borde"
"边框圆角": "Radio de Borde",
"显示码值": "Mostrar Valor del Código"
}
3 changes: 2 additions & 1 deletion src/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,5 +245,6 @@
"排列方式": "Mode d'agencement",
"垂直间距%s": "Espacement Vertical %s",
"水平间距%s": "Espacement Horizontal %s",
"边框圆角": "Rayon de Bordure"
"边框圆角": "Rayon de Bordure",
"显示码值": "Afficher la Valeur du Code"
}
3 changes: 2 additions & 1 deletion src/i18n/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,5 +245,6 @@
"排列方式": "Metodo di disposizione",
"垂直间距%s": "Spaziatura Verticale %s",
"水平间距%s": "Spaziatura Orizzontale %s",
"边框圆角": "Raggio del Bordo"
"边框圆角": "Raggio del Bordo",
"显示码值": "Mostra Valore del Codice"
}
3 changes: 2 additions & 1 deletion src/i18n/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,5 +245,6 @@
"排列方式": "配列方法",
"垂直间距%s": "垂直間隔 %s",
"水平间距%s": "水平間隔 %s",
"边框圆角": "ボーダーラジウス"
"边框圆角": "ボーダーラジウス",
"显示码值": "表示コード値"
}
3 changes: 2 additions & 1 deletion src/i18n/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,5 +245,6 @@
"排列方式": "Способ распределения",
"垂直间距%s": "Вертикальный интервал %s",
"水平间距%s": "Горизонтальный интервал %s",
"边框圆角": "Радиус границы"
"边框圆角": "Радиус границы",
"显示码值": "Отображение кодового значения"
}

0 comments on commit 94b1c76

Please sign in to comment.