|
@@ -135,9 +135,12 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
doPrint (data) {
|
|
doPrint (data) {
|
|
|
- const _this2 = this
|
|
|
|
|
|
|
+ const canPrint = column => {
|
|
|
|
|
+ return !column.printIgnore && column.visible
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
const formatValue = (row, i, column) => {
|
|
const formatValue = (row, i, column) => {
|
|
|
- const value_ = Utils.getItemField(row, column.field, _this2.options.escape, column.escape)
|
|
|
|
|
|
|
+ const value_ = Utils.getItemField(row, column.field, this.options.escape, column.escape)
|
|
|
const value = Utils.calculateObjectValue(column,
|
|
const value = Utils.calculateObjectValue(column,
|
|
|
column.printFormatter || column.formatter,
|
|
column.printFormatter || column.formatter,
|
|
|
[value_, row, i], value_)
|
|
[value_, row, i], value_)
|
|
@@ -153,7 +156,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|
|
for (const columns of columnsArray) {
|
|
for (const columns of columnsArray) {
|
|
|
html.push('<tr>')
|
|
html.push('<tr>')
|
|
|
for (let h = 0; h < columns.length; h++) {
|
|
for (let h = 0; h < columns.length; h++) {
|
|
|
- if (!columns[h].printIgnore && columns[h].visible) {
|
|
|
|
|
|
|
+ if (canPrint(columns[h])) {
|
|
|
html.push(
|
|
html.push(
|
|
|
`<th
|
|
`<th
|
|
|
${Utils.sprintf(' rowspan="%s"', columns[h].rowspan)}
|
|
${Utils.sprintf(' rowspan="%s"', columns[h].rowspan)}
|
|
@@ -211,11 +214,11 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (
|
|
if (
|
|
|
- !columns[j].printIgnore && columns[j].visible && columns[j].field &&
|
|
|
|
|
- (
|
|
|
|
|
- !notRender.includes(`${i},${j}`) ||
|
|
|
|
|
- rowspan > 0 && colspan > 0
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ canPrint(columns[j]) &&
|
|
|
|
|
+ (
|
|
|
|
|
+ !notRender.includes(`${i},${j}`) ||
|
|
|
|
|
+ rowspan > 0 && colspan > 0
|
|
|
|
|
+ )
|
|
|
) {
|
|
) {
|
|
|
if (rowspan > 0 && colspan > 0) {
|
|
if (rowspan > 0 && colspan > 0) {
|
|
|
html.push(`<td ${Utils.sprintf(' rowspan="%s"', rowspan)} ${Utils.sprintf(' colspan="%s"', colspan)}>`, formatValue(data[i], i, columns[j]), '</td>')
|
|
html.push(`<td ${Utils.sprintf(' rowspan="%s"', rowspan)} ${Utils.sprintf(' colspan="%s"', colspan)}>`, formatValue(data[i], i, columns[j]), '</td>')
|
|
@@ -225,7 +228,6 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
html.push('</tr>')
|
|
html.push('</tr>')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -235,7 +237,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
|
|
|
|
|
|
|
|
for (const columns of columnsArray) {
|
|
for (const columns of columnsArray) {
|
|
|
for (let h = 0; h < columns.length; h++) {
|
|
for (let h = 0; h < columns.length; h++) {
|
|
|
- if (!columns[h].printIgnore && columns[h].visible) {
|
|
|
|
|
|
|
+ if (canPrint(columns)) {
|
|
|
const footerData = Utils.trToData(columns, this.$el.find('>tfoot>tr'))
|
|
const footerData = Utils.trToData(columns, this.$el.find('>tfoot>tr'))
|
|
|
const footerValue = Utils.calculateObjectValue(columns[h], columns[h].footerFormatter, [data], footerData[0] && footerData[0][columns[h].field] || '')
|
|
const footerValue = Utils.calculateObjectValue(columns[h], columns[h].footerFormatter, [data], footerData[0] && footerData[0][columns[h].field] || '')
|
|
|
|
|
|