From 09ac677d1487bc086713b7e886c6bd7e8a16d9af Mon Sep 17 00:00:00 2001 From: xuliangzhan Date: Fri, 20 Dec 2024 15:43:56 +0800 Subject: [PATCH] releases 3.11.37 --- package.json | 4 ++-- packages/table/src/body.ts | 7 ++++--- packages/table/src/footer.ts | 6 ++++-- packages/table/src/header.ts | 6 ++++-- packages/table/src/methods.ts | 2 +- packages/table/src/table.ts | 9 ++++++--- 6 files changed, 21 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 30af5a2fcb..99aca28445 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vxe-table", - "version": "3.11.36", + "version": "3.11.37", "description": "一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟树、拖拽排序,懒加载、快捷菜单、数据校验、树形结构、打印、导入导出、自定义模板、渲染器、JSON 配置式...", "scripts": { "update": "npm install --legacy-peer-deps", @@ -28,7 +28,7 @@ "style": "lib/style.css", "typings": "types/index.d.ts", "dependencies": { - "vxe-pc-ui": "^3.3.41" + "vxe-pc-ui": "^3.3.43" }, "devDependencies": { "@babel/plugin-transform-modules-commonjs": "^7.25.7", diff --git a/packages/table/src/body.ts b/packages/table/src/body.ts index 268e4269ce..f342eae13f 100644 --- a/packages/table/src/body.ts +++ b/packages/table/src/body.ts @@ -337,7 +337,7 @@ function renderColumn (h: any, _vm: any, $xetable: any, seq: any, rowid: any, fi getClass(className, params), getClass(allCellClassName, params) ], - key: columnKey || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? column.id : $columnIndex, + key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? column.id : $columnIndex, attrs, style: Object.assign({ height: cellHeight @@ -362,6 +362,7 @@ function renderRows (h: CreateElement, _vm: any, $xeTable: any, fixedType: any, expandOpts, editOpts, treeExpandedMaps, + scrollXLoad, scrollYLoad, rowExpandedMaps, radioOpts, @@ -467,7 +468,7 @@ function renderRows (h: CreateElement, _vm: any, $xeTable: any, fixedType: any, rowid }, style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) : null, - key: rowKey || rowOpts.useKey || rowOpts.drag || columnOpts.drag || treeConfig ? rowid : $rowIndex, + key: rowKey || scrollXLoad || scrollYLoad || rowOpts.useKey || rowOpts.drag || columnOpts.drag || treeConfig ? rowid : $rowIndex, nativeOn: trOn }, tdVNs) : h('tr', { @@ -476,7 +477,7 @@ function renderRows (h: CreateElement, _vm: any, $xeTable: any, fixedType: any, rowid }, style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) : null, - key: rowKey || rowOpts.useKey || rowOpts.drag || columnOpts.drag || treeConfig ? rowid : $rowIndex, + key: rowKey || scrollXLoad || scrollYLoad || rowOpts.useKey || rowOpts.drag || columnOpts.drag || treeConfig ? rowid : $rowIndex, on: trOn }, tdVNs) ) diff --git a/packages/table/src/footer.ts b/packages/table/src/footer.ts index 88cd49fcf9..921c5457a8 100644 --- a/packages/table/src/footer.ts +++ b/packages/table/src/footer.ts @@ -26,7 +26,7 @@ function mergeFooterMethod (mergeFooterList: any, _rowIndex: any, _columnIndex: function renderRows (h: CreateElement, _vm: any, tableColumn: VxeTableDefines.ColumnInfo[], footerTableData: any[], row: any, $rowIndex: number, _rowIndex: number) { const { $parent: $xetable, fixedType } = _vm - const { $listeners: tableListeners, footerCellClassName, footerCellStyle, footerAlign: allFooterAlign, mergeFooterList, footerSpanMethod, align: allAlign, scrollXLoad, columnKey, columnOpts, showFooterOverflow: allColumnFooterOverflow, currentColumn, overflowX, scrollbarWidth, tooltipOpts } = $xetable + const { $listeners: tableListeners, footerCellClassName, footerCellStyle, footerAlign: allFooterAlign, mergeFooterList, footerSpanMethod, align: allAlign, scrollXLoad, columnKey, columnOpts, showFooterOverflow: allColumnFooterOverflow, currentColumn, overflowX, scrollYLoad, scrollbarWidth, tooltipOpts } = $xetable return tableColumn.map((column: any, $columnIndex: any) => { const { type, showFooterOverflow, footerAlign, align, footerClassName, editRender, cellRender } = column @@ -135,7 +135,7 @@ function renderRows (h: CreateElement, _vm: any, tableColumn: VxeTableDefines.Co attrs, style: footerCellStyle ? (XEUtils.isFunction(footerCellStyle) ? footerCellStyle(cellParams) : footerCellStyle) : null, on: tfOns, - key: columnKey || columnOpts.useKey || columnOpts.drag ? column.id : $columnIndex + key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || columnOpts.drag ? column.id : $columnIndex }, [ h('div', { class: ['vxe-cell', { @@ -170,6 +170,7 @@ function renderHeads (h: CreateElement, _vm: any, footerTableData: any[]) { if (columnOpts.drag && columnDragOpts.animation) { return h('transition-group', { + key: $rowIndex, props: { tag: 'tr', name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`, @@ -182,6 +183,7 @@ function renderHeads (h: CreateElement, _vm: any, footerTableData: any[]) { }, renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex, _rowIndex)) } return h('tr', { + key: $rowIndex, class: [ 'vxe-footer--row', footerRowClassName ? XEUtils.isFunction(footerRowClassName) ? footerRowClassName(rowParams) : footerRowClassName : '' diff --git a/packages/table/src/header.ts b/packages/table/src/header.ts index e6de71e98e..a491b80b5f 100644 --- a/packages/table/src/header.ts +++ b/packages/table/src/header.ts @@ -17,7 +17,7 @@ const renderRows = (h: CreateElement, _vm: any, cols: VxeTableDefines.ColumnInfo const { fixedType } = _vm - const { resizable: allResizable, border, columnKey, headerCellClassName, headerCellStyle, showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign, currentColumn, scrollXLoad, overflowX, scrollbarWidth, mouseConfig, columnOpts } = $xeTable + const { resizable: allResizable, border, columnKey, headerCellClassName, headerCellStyle, showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign, currentColumn, scrollXLoad, scrollYLoad, overflowX, scrollbarWidth, mouseConfig, columnOpts } = $xeTable const columnDragOpts = $xeTable.computeColumnDragOpts const { disabledMethod: dragDisabledMethod } = columnDragOpts return cols.map((column: any, $columnIndex: any) => { @@ -90,7 +90,7 @@ const renderRows = (h: CreateElement, _vm: any, cols: VxeTableDefines.ColumnInfo attrs: thAttrs, style: headerCellStyle ? (XEUtils.isFunction(headerCellStyle) ? headerCellStyle(params) : headerCellStyle) : null, on: thOns, - key: columnKey || columnOpts.useKey || columnOpts.drag || isColGroup ? colid : $columnIndex + key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || columnOpts.drag || isColGroup ? colid : $columnIndex }, [ h('div', { class: ['vxe-cell', { @@ -140,6 +140,7 @@ function renderHeads (h: CreateElement, _vm: any, headerGroups: any[]) { if (columnOpts.drag && columnDragOpts.animation) { return h('transition-group', { + key: $rowIndex, props: { tag: 'tr', name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`, @@ -152,6 +153,7 @@ function renderHeads (h: CreateElement, _vm: any, headerGroups: any[]) { }, renderRows(h, _vm, cols, $rowIndex)) } return h('tr', { + key: $rowIndex, class: [ 'vxe-header--row', headerRowClassName ? XEUtils.isFunction(headerRowClassName) ? headerRowClassName(params) : headerRowClassName : '' diff --git a/packages/table/src/methods.ts b/packages/table/src/methods.ts index 7d7132794a..96e4fefbb4 100644 --- a/packages/table/src/methods.ts +++ b/packages/table/src/methods.ts @@ -6785,7 +6785,7 @@ const Methods = { const { lyTimeout, lyRunTime, scrollYStore } = internalData const { visibleSize } = scrollYStore - const fpsTime = Math.min(80, Math.floor(visibleSize * 2)) + const fpsTime = Math.min(80, Math.floor(visibleSize)) if (lyTimeout) { clearTimeout(lyTimeout) } diff --git a/packages/table/src/table.ts b/packages/table/src/table.ts index 42c152faa8..ee60864d09 100644 --- a/packages/table/src/table.ts +++ b/packages/table/src/table.ts @@ -734,8 +734,11 @@ export default { } return false }, - tableBorder () { - const { border } = this + computeTableBorder () { + const $xeTable = this + const props = $xeTable + + const { border } = props if (border === true) { return 'full' } @@ -1213,7 +1216,6 @@ export default { stripe, showHeader, height, - tableBorder, treeOpts, treeConfig, mouseConfig, @@ -1250,6 +1252,7 @@ export default { const loadingSlot = $scopedSlots.loading const currLoading = this._isLoading || loading const vSize = computeSize + const tableBorder = $xeTable.computeTableBorder const virtualScrollBars = $xeTable.computeVirtualScrollBars const isArea = mouseConfig && mouseOpts.area const tableStyle = $xeTable.computeTableStyle