Skip to content

Commit

Permalink
修复表格分页colspan问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavier9896 committed Mar 2, 2024
1 parent ff06fd4 commit f4e8758
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@
},
"dependencies": {
"@claviska/jquery-minicolors": "^2.3.6",
"@wtto00/html2canvas": "^1.4.3",
"bwip-js": "^4.0.0",
"canvg": "^3.0.10",
"@wtto00/html2canvas": "^1.4.3",
"jquery": "^3.6.0",
"jsbarcode": "^3.11.5",
"jspdf": "^2.5.1",
"lodash": "^4.17.21",
"nzh": "^1.0.8",
"socket.io-client": "^4.5.1"
}
}
}
12 changes: 1 addition & 11 deletions src/hiprint/hiprint.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -5814,16 +5814,13 @@ var hiprint = function (t) {
};
return zz;
}, TablePrintElement.prototype.fixMergeSpan = function (tr, tbody) {
let [nextRowMap, nextColMap] = [new Map(), new Map()];
const nextRowMap = new Map();
tr.children().each((_, td) => {
var field = $(td).attr('field');
nextRowMap.set(field, {
rowSpan: 1,
rowEnd: false
})
nextColMap.set(field, {
colSpan: $(td).nextUntil('td[colspan!=0]').length,
})
tr.nextAll().each((_, nextTr) => {
if ($(nextTr).has(`td[field=${field}][rowspan=0]`).length && !nextRowMap.get(field).rowEnd) {
nextRowMap.set(field, { rowSpan: ++nextRowMap.get(field).rowSpan, rowEnd: false })
Expand All @@ -5839,13 +5836,6 @@ var hiprint = function (t) {
$(td).text("")
}
}
if ($(td).attr("colspan") < 1) {
$(td).attr("colspan", nextColMap.get(field).colSpan);
$(td).css("display", "")
if (this.options.rowsColumnsMergeClean) {
$(td).text("")
}
}
})
return tr;
}, TablePrintElement.prototype.autoCompletion = function (t, e, tfh) {
Expand Down

0 comments on commit f4e8758

Please sign in to comment.