修复表格行内编辑启用翻页记住选择无效问题(I72OMA)

master
RuoYi 2023-05-19 10:26:15 +08:00
parent 6f8a388e8e
commit 1207052749
1 changed files with 7 additions and 5 deletions

View File

@ -26,7 +26,7 @@ $.extend($.fn.bootstrapTable.columnDefaults, {
alwaysUseFormatter: false alwaysUseFormatter: false
}) })
$.extend($.fn.bootstrapTable.Constructor.EVENTS, { $.extend($.fn.bootstrapTable.events, {
'editable-init.bs.table': 'onEditableInit', 'editable-init.bs.table': 'onEditableInit',
'editable-save.bs.table': 'onEditableSave', 'editable-save.bs.table': 'onEditableSave',
'editable-shown.bs.table': 'onEditableShown', 'editable-shown.bs.table': 'onEditableShown',
@ -63,7 +63,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
column.formatter = column.formatter || (value => value) column.formatter = column.formatter || (value => value)
column._formatter = column._formatter ? column._formatter : column.formatter column._formatter = column._formatter ? column._formatter : column.formatter
column.formatter = (value, row, index) => { column.formatter = (value, row, index, field) => {
let result = Utils.calculateObjectValue(column, column._formatter, [value, row, index], value) let result = Utils.calculateObjectValue(column, column._formatter, [value, row, index], value)
result = typeof result === 'undefined' || result === null ? this.options.undefinedText : result result = typeof result === 'undefined' || result === null ? this.options.undefinedText : result
@ -86,7 +86,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
column.editable, [index, row], {}) column.editable, [index, row], {})
if (editableOpts.hasOwnProperty('noEditFormatter')) { if (editableOpts.hasOwnProperty('noEditFormatter')) {
noEditFormatter = editableOpts.noEditFormatter(value, row, index) noEditFormatter = editableOpts.noEditFormatter(value, row, index, field)
} }
if (noEditFormatter === false) { if (noEditFormatter === false) {
@ -177,11 +177,13 @@ $.BootstrapTable = class extends $.BootstrapTable {
if (params && params.escape) { if (params && params.escape) {
for (const row of data) { for (const row of data) {
for (const [key, value] of Object.entries(row)) { for (const [key, value] of Object.entries(row)) {
row[key] = Utils.unescapeHTML(value) if (typeof(value) !== "number") {
row[key] = Utils.unescapeHTML(value)
}
} }
} }
} }
return data return data
} }
} }