升级bootstrap-table到最新版本1.19.1

springboot2
RuoYi 4 years ago
parent 248fe926c5
commit 6bd0dc8e05

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -8,6 +8,7 @@ var Utils = $.fn.bootstrapTable.utils
$.extend($.fn.bootstrapTable.defaults, { $.extend($.fn.bootstrapTable.defaults, {
autoRefresh: false, autoRefresh: false,
showAutoRefresh: true,
autoRefreshInterval: 60, autoRefreshInterval: 60,
autoRefreshSilent: true, autoRefreshSilent: true,
autoRefreshStatus: true, autoRefreshStatus: true,
@ -17,6 +18,7 @@ $.extend($.fn.bootstrapTable.defaults, {
$.extend($.fn.bootstrapTable.defaults.icons, { $.extend($.fn.bootstrapTable.defaults.icons, {
autoRefresh: { autoRefresh: {
bootstrap3: 'glyphicon-time icon-time', bootstrap3: 'glyphicon-time icon-time',
bootstrap5: 'bi-clock',
materialize: 'access_time', materialize: 'access_time',
'bootstrap-table': 'icon-clock' 'bootstrap-table': 'icon-clock'
}[$.fn.bootstrapTable.theme] || 'fa-clock' }[$.fn.bootstrapTable.theme] || 'fa-clock'

@ -225,6 +225,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
const initFixedBody = ($fixedColumns, $fixedHeader) => { const initFixedBody = ($fixedColumns, $fixedHeader) => {
$fixedColumns.find('.fixed-table-body').remove() $fixedColumns.find('.fixed-table-body').remove()
$fixedColumns.append(this.$tableBody.clone(true)) $fixedColumns.append(this.$tableBody.clone(true))
$fixedColumns.find('.fixed-table-body table').removeAttr('id')
const $fixedBody = $fixedColumns.find('.fixed-table-body') const $fixedBody = $fixedColumns.find('.fixed-table-body')

@ -1,5 +1,6 @@
/** /**
* @author zhixin wen <wenzhixin2010@gmail.com> * @author: Dustin Utecht
* @github: https://github.com/UtechtDustin
*/ */
var Utils = $.fn.bootstrapTable.utils var Utils = $.fn.bootstrapTable.utils

@ -43,6 +43,7 @@ $.extend($.fn.bootstrapTable.columnDefaults, {
$.extend($.fn.bootstrapTable.defaults.icons, { $.extend($.fn.bootstrapTable.defaults.icons, {
export: { export: {
bootstrap3: 'glyphicon-export icon-share', bootstrap3: 'glyphicon-export icon-share',
bootstrap5: 'bi-download',
materialize: 'file_download', materialize: 'file_download',
'bootstrap-table': 'icon-download' 'bootstrap-table': 'icon-download'
}[$.fn.bootstrapTable.theme] || 'fa-download' }[$.fn.bootstrapTable.theme] || 'fa-download'
@ -91,30 +92,51 @@ $.BootstrapTable = class extends $.BootstrapTable {
this.buttons = Object.assign(this.buttons, { this.buttons = Object.assign(this.buttons, {
export: { export: {
html: exportTypes.length === 1 ? ` html:
<div class="export ${this.constants.classes.buttonsDropdown}" (() => {
data-type="${exportTypes[0]}"> if (exportTypes.length === 1) {
<button class="${this.constants.buttonsClass}" return `
aria-label="Export" <div class="export ${this.constants.classes.buttonsDropdown}"
type="button" data-type="${exportTypes[0]}">
title="${o.formatExport()}"> <button class="${this.constants.buttonsClass}"
${o.showButtonIcons ? Utils.sprintf(this.constants.html.icon, o.iconsPrefix, o.icons.export) : ''} aria-label="Export"
${o.showButtonText ? o.formatExport() : ''} type="button"
</button> title="${o.formatExport()}">
</div> ${o.showButtonIcons ? Utils.sprintf(this.constants.html.icon, o.iconsPrefix, o.icons.export) : ''}
` : ` ${o.showButtonText ? o.formatExport() : ''}
<div class="export ${this.constants.classes.buttonsDropdown}"> </button>
<button class="${this.constants.buttonsClass} dropdown-toggle" </div>
aria-label="Export" `
${this.constants.dataToggle}="dropdown" }
type="button"
title="${o.formatExport()}"> const html = []
${o.showButtonIcons ? Utils.sprintf(this.constants.html.icon, o.iconsPrefix, o.icons.export) : ''}
${o.showButtonText ? o.formatExport() : ''} html.push(`
${this.constants.html.dropdownCaret} <div class="export ${this.constants.classes.buttonsDropdown}">
</button> <button class="${this.constants.buttonsClass} dropdown-toggle"
</div> aria-label="Export"
` ${this.constants.dataToggle}="dropdown"
type="button"
title="${o.formatExport()}">
${o.showButtonIcons ? Utils.sprintf(this.constants.html.icon, o.iconsPrefix, o.icons.export) : ''}
${o.showButtonText ? o.formatExport() : ''}
${this.constants.html.dropdownCaret}
</button>
${this.constants.html.toolbarDropdown[0]}
`)
for (const type of exportTypes) {
if (TYPE_NAME.hasOwnProperty(type)) {
const $item = $(Utils.sprintf(this.constants.html.pageDropdownItem, '', TYPE_NAME[type]))
$item.attr('data-type', type)
html.push($item.prop('outerHTML'))
}
}
html.push(this.constants.html.toolbarDropdown[1], '</div>')
return html.join('')
})
} }
}) })
} }
@ -126,32 +148,14 @@ $.BootstrapTable = class extends $.BootstrapTable {
return return
} }
let $menu = $(this.constants.html.toolbarDropdown.join('')) this.updateExportButton()
let $items = this.$export let $exportButtons = this.$export.find('[data-type]')
if (exportTypes.length > 1) { if (exportTypes.length === 1) {
this.$export.append($menu) $exportButtons = this.$export.find('button')
// themes support
if ($menu.children().length) {
$menu = $menu.children().eq(0)
}
for (const type of exportTypes) {
if (TYPE_NAME.hasOwnProperty(type)) {
const $item = $(Utils.sprintf(this.constants.html.pageDropdownItem,
'', TYPE_NAME[type]))
$item.attr('data-type', type)
$menu.append($item)
}
}
$items = $menu.children()
} }
this.updateExportButton() $exportButtons.click(e => {
$items.click(e => {
e.preventDefault() e.preventDefault()
const type = $(e.currentTarget).data('type') const type = $(e.currentTarget).data('type')

@ -134,7 +134,8 @@ $.BootstrapTable = class extends $.BootstrapTable {
doPrint (data) { doPrint (data) {
const formatValue = (row, i, column) => { const formatValue = (row, i, column) => {
const value = Utils.calculateObjectValue(column, column.printFormatter, const value = Utils.calculateObjectValue(column,
column.printFormatter || column.formatter,
[row[column.field], row, i], row[column.field]) [row[column.field], row, i], row[column.field])
return typeof value === 'undefined' || value === null ? return typeof value === 'undefined' || value === null ?

@ -13,7 +13,7 @@ $.extend($.fn.bootstrapTable.defaults, {
onDragStyle: null, onDragStyle: null,
onDropStyle: null, onDropStyle: null,
onDragClass: 'reorder_rows_onDragClass', onDragClass: 'reorder_rows_onDragClass',
dragHandle: '>tbody>tr>td', dragHandle: '>tbody>tr>td:not(.bs-checkbox)',
useRowAttrFunc: false, useRowAttrFunc: false,
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
onReorderRowsDrag (row) { onReorderRowsDrag (row) {

@ -43,6 +43,8 @@ $.BootstrapTable = class extends $.BootstrapTable {
.on('column-switch.bs.table page-change.bs.table', () => { .on('column-switch.bs.table page-change.bs.table', () => {
reInitResizable(this) reInitResizable(this)
}) })
reInitResizable(this)
} }
toggleView (...args) { toggleView (...args) {

Loading…
Cancel
Save