releases 4.5.22

This commit is contained in:
xuliangzhan
2024-04-10 12:09:11 +08:00
parent 2a6db35acf
commit c4f8f424dc
5 changed files with 21 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "vxe-table",
"version": "4.5.22-beta.6",
"version": "4.5.22",
"description": "一个基于 vue 的 PC 端表单/表格组件支持增删改查、虚拟列表、虚拟树、懒加载、快捷菜单、数据校验、树形结构、打印导出、表单渲染、数据分页、弹窗、自定义模板、渲染器、JSON 配置式...",
"scripts": {
"update": "npm install --legacy-peer-deps",
@@ -71,8 +71,7 @@
"vuex": "^4.0.2"
},
"peerDependencies": {
"vue": "^3.2.28",
"xe-utils": "^3.5.0"
"vue": "^3.2.28"
},
"vetur": {
"tags": "helper/vetur/tags.json",

View File

@@ -477,7 +477,7 @@ const tableExportHook: VxeGlobalHooksHandles.HookOptions = {
footLabelMethod = columnOpts.footerExportMethod
}
const _columnIndex = $xetable.getVTColumnIndex(column)
const cellValue = footLabelMethod ? footLabelMethod({ $table: $xetable, items, itemIndex: _columnIndex, _columnIndex, column, options: opts }) : XEUtils.toValueString(items[_columnIndex])
const cellValue = footLabelMethod ? footLabelMethod({ $table: $xetable, items, itemIndex: _columnIndex, row: items, _columnIndex, column, options: opts }) : XEUtils.toValueString(items[_columnIndex])
return cellValue
}

View File

@@ -159,9 +159,10 @@ export default defineComponent({
ref: refFooterTFoot
}, footerTableData.map((list, _rowIndex) => {
const $rowIndex = _rowIndex
const rowParams = { $table: $xetable, row: list, _rowIndex, $rowIndex, fixed: fixedType, type: renderType }
return h('tr', {
class: ['vxe-footer--row', footerRowClassName ? XEUtils.isFunction(footerRowClassName) ? footerRowClassName({ $table: $xetable, _rowIndex, $rowIndex, fixed: fixedType, type: renderType }) : footerRowClassName : ''],
style: footerRowStyle ? (XEUtils.isFunction(footerRowStyle) ? footerRowStyle({ $table: $xetable, _rowIndex, $rowIndex, fixed: fixedType, type: renderType }) : footerRowStyle) : null
class: ['vxe-footer--row', footerRowClassName ? XEUtils.isFunction(footerRowClassName) ? footerRowClassName(rowParams) : footerRowClassName : ''],
style: footerRowStyle ? (XEUtils.isFunction(footerRowStyle) ? footerRowStyle(rowParams) : footerRowStyle) : null
}, tableColumn.map((column, $columnIndex) => {
const { type, showFooterOverflow, footerAlign, align, footerClassName } = column
const showAllTip = tooltipOpts.showAll
@@ -178,7 +179,7 @@ export default defineComponent({
const columnIndex = $xetable.getColumnIndex(column)
const _columnIndex = $xetable.getVTColumnIndex(column)
const itemIndex = _columnIndex
const params: VxeTableDefines.CellRenderFooterParams = {
const cellParams: VxeTableDefines.CellRenderFooterParams = {
$table: $xetable,
$grid: $xetable.xegrid,
row: list,
@@ -203,7 +204,7 @@ export default defineComponent({
if (showTitle) {
updateCellTitle(evnt.currentTarget, column)
} else if (showTooltip || showAllTip) {
$xetable.triggerFooterTooltipEvent(evnt, params)
$xetable.triggerFooterTooltipEvent(evnt, cellParams)
}
}
}
@@ -215,10 +216,10 @@ export default defineComponent({
}
}
tfOns.onClick = (evnt: MouseEvent) => {
$xetable.dispatchEvent('footer-cell-click', Object.assign({ cell: evnt.currentTarget }, params), evnt)
$xetable.dispatchEvent('footer-cell-click', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt)
}
tfOns.onDblclick = (evnt: MouseEvent) => {
$xetable.dispatchEvent('footer-cell-dblclick', Object.assign({ cell: evnt.currentTarget }, params), evnt)
$xetable.dispatchEvent('footer-cell-dblclick', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt)
}
// 合并行或列
if (mergeFooterList.length) {
@@ -237,7 +238,7 @@ export default defineComponent({
}
} else if (footerSpanMethod) {
// 自定义合并方法
const { rowspan = 1, colspan = 1 } = footerSpanMethod(params) || {}
const { rowspan = 1, colspan = 1 } = footerSpanMethod(cellParams) || {}
if (!rowspan || !colspan) {
return null
}
@@ -256,9 +257,9 @@ export default defineComponent({
'fixed--hidden': fixedHiddenColumn,
'col--ellipsis': hasEllipsis,
'col--current': currentColumn === column
}, getPropClass(footerClassName, params), getPropClass(footerCellClassName, params)],
}, getPropClass(footerClassName, cellParams), getPropClass(footerCellClassName, cellParams)],
...attrs,
style: footerCellStyle ? (XEUtils.isFunction(footerCellStyle) ? footerCellStyle(params) : footerCellStyle) : null,
style: footerCellStyle ? (XEUtils.isFunction(footerCellStyle) ? footerCellStyle(cellParams) : footerCellStyle) : null,
...tfOns,
key: columnKey || columnOpts.useKey ? column.id : $columnIndex
}, [
@@ -268,7 +269,7 @@ export default defineComponent({
'c--tooltip': showTooltip,
'c--ellipsis': showEllipsis
}]
}, column.renderFooter(params))
}, column.renderFooter(cellParams))
])
}).concat(scrollbarWidth ? [
h('td', {

1
types/column.d.ts vendored
View File

@@ -113,6 +113,7 @@ export namespace VxeColumnPropTypes {
interface FooterExportParams<D = VxeTableDataRow> {
$table: VxeTableConstructor<D>,
items: any[]
row: any
column: VxeTableDefines.ColumnInfo<D>
_columnIndex: number
}

7
types/table.d.ts vendored
View File

@@ -1187,7 +1187,7 @@ export namespace VxeTablePropTypes {
$grid: VxeGridConstructor<D> | null | undefined
columns: VxeTableDefines.ColumnInfo<D>[]
data: D[]
}) => Array<string | number | null>[]
}) => Array<string | number | null>[] | VxeTableDataRow[]
export type RowClassName<D = VxeTableDataRow> = string | ((params: {
$table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
@@ -1226,6 +1226,7 @@ export namespace VxeTablePropTypes {
export type FooterRowClassName<D = VxeTableDataRow> = string | ((params: {
$table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
row: D
$rowIndex: number
_rowIndex: number
fixed: VxeColumnPropTypes.Fixed
@@ -1234,6 +1235,7 @@ export namespace VxeTablePropTypes {
export type FooterCellClassName<D = VxeTableDataRow> = string | ((params: {
$table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
row: D
$rowIndex: number
_rowIndex: number
column: VxeTableDefines.ColumnInfo<D>
@@ -1263,6 +1265,7 @@ export namespace VxeTablePropTypes {
export type FooterCellStyle<D = VxeTableDataRow> = VNodeStyle | ((params: {
$table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
row: D
$rowIndex: number
column: VxeTableDefines.ColumnInfo<D>
columnIndex: number
@@ -1287,6 +1290,7 @@ export namespace VxeTablePropTypes {
export type FooterRowStyle<D = VxeTableDataRow> = VNodeStyle | ((params: {
$table: VxeTableConstructor<D> & VxeTablePrivateMethods<D>
row: D
$rowIndex: number
_rowIndex: number
fixed: VxeColumnPropTypes.Fixed
@@ -1319,6 +1323,7 @@ export namespace VxeTablePropTypes {
columnIndex: number
_columnIndex: number
$columnIndex: number
row: D
$rowIndex: number
_rowIndex: number
items: any[]