diff --git a/package.json b/package.json index d7dd3694c3..c9294f90a2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vxe-table", - "version": "4.7.92", + "version": "4.7.93", "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": "^4.2.24" + "vxe-pc-ui": "^4.2.26" }, "devDependencies": { "@types/resize-observer-browser": "^0.1.11", diff --git a/packages/table/src/body.ts b/packages/table/src/body.ts index 0891f7d1bb..f203baee61 100644 --- a/packages/table/src/body.ts +++ b/packages/table/src/body.ts @@ -161,7 +161,7 @@ export default defineComponent({ let hasEllipsis = showTitle || showTooltip || showEllipsis let isDirty const tdOns: any = {} - const cellAlign = align || allAlign + const cellAlign = align || (compConf ? compConf.tableCellAlign : '') || allAlign const errorValidItem = validErrorMaps[`${rowid}:${colid}`] const showValidTip = editRules && validOpts.showMessage && (validOpts.message === 'default' ? (height || tableData.length > 1) : validOpts.message === 'inline') const attrs: any = { colid } diff --git a/packages/table/src/footer.ts b/packages/table/src/footer.ts index 13c2ba7906..30097d0fdd 100644 --- a/packages/table/src/footer.ts +++ b/packages/table/src/footer.ts @@ -1,9 +1,12 @@ import { createCommentVNode, defineComponent, h, ref, Ref, PropType, inject, nextTick, onMounted, onUnmounted } from 'vue' import XEUtils from 'xe-utils' +import { VxeUI } from '../../ui' import { updateCellTitle, getPropClass } from '../../ui/src/dom' import type { VxeTablePrivateMethods, VxeTableConstructor, VxeTableMethods, VxeColumnPropTypes, VxeTableDefines } from '../../../types' +const { renderer } = VxeUI + const renderType = 'footer' function mergeFooterMethod (mergeFooterList: VxeTableDefines.MergeItem[], _rowIndex: number, _columnIndex: number) { @@ -180,12 +183,14 @@ export default defineComponent({ 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 { type, showFooterOverflow, footerAlign, align, footerClassName, editRender, cellRender } = column + const renderOpts = editRender || cellRender + const compConf = renderOpts ? renderer.get(renderOpts.name) : null const showAllTip = tooltipOpts.showAll const isColGroup = column.children && column.children.length const fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX const footOverflow = XEUtils.eqNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow - const footAlign = footerAlign || align || allFooterAlign || allAlign + const footAlign = footerAlign || (compConf ? compConf.tableFooterCellAlign : '') || allFooterAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign let showEllipsis = footOverflow === 'ellipsis' const showTitle = footOverflow === 'title' const showTooltip = footOverflow === true || footOverflow === 'tooltip' diff --git a/packages/table/src/header.ts b/packages/table/src/header.ts index dc966edbb8..2c0117c8a7 100644 --- a/packages/table/src/header.ts +++ b/packages/table/src/header.ts @@ -1,10 +1,13 @@ import { createCommentVNode, defineComponent, h, ref, Ref, PropType, inject, nextTick, watch, onMounted, onUnmounted } from 'vue' import XEUtils from 'xe-utils' +import { VxeUI } from '../../ui' import { convertHeaderColumnToRows, getColReMinWidth } from './util' import { hasClass, getOffsetPos, addClass, removeClass } from '../../ui/src/dom' import type { VxeTablePrivateMethods, VxeTableConstructor, VxeTableMethods, VxeTableDefines, VxeColumnPropTypes } from '../../../types' +const { renderer } = VxeUI + const renderType = 'header' export default defineComponent({ @@ -228,12 +231,14 @@ export default defineComponent({ class: ['vxe-header--row', headerRowClassName ? (XEUtils.isFunction(headerRowClassName) ? headerRowClassName({ $table: $xeTable, $rowIndex, fixed: fixedType, type: renderType }) : headerRowClassName) : ''], style: headerRowStyle ? (XEUtils.isFunction(headerRowStyle) ? headerRowStyle({ $table: $xeTable, $rowIndex, fixed: fixedType, type: renderType }) : headerRowStyle) : null }, cols.map((column, $columnIndex) => { - const { type, showHeaderOverflow, headerAlign, align, headerClassName } = column + const { type, showHeaderOverflow, headerAlign, align, headerClassName, editRender, cellRender } = column const colid = column.id + const renderOpts = editRender || cellRender + const compConf = renderOpts ? renderer.get(renderOpts.name) : null const isColGroup = column.children && column.children.length const fixedHiddenColumn = fixedType ? (column.fixed !== fixedType && !isColGroup) : !!column.fixed && overflowX const headOverflow = XEUtils.eqNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow - const headAlign = headerAlign || align || allHeaderAlign || allAlign + const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : '') || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign let showEllipsis = headOverflow === 'ellipsis' const showTitle = headOverflow === 'title' const showTooltip = headOverflow === true || headOverflow === 'tooltip'