Browse Source

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

RuoYi 2 years ago
parent
commit
1207052749

+ 7 - 5
ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/editable/bootstrap-table-editable.js

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